1 var _0xf744=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x6D\x6F\x6D\x65\x6E\x74","\x75\x74\x69\x6C","\x6C\x6F\x64\x61\x73\x68","\x70\x61\x74\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x65\x78\x65\x63","\x63\x68\x69\x6C\x64\x2D\x70\x72\x6F\x63\x65\x73\x73\x2D\x70\x72\x6F\x6D\x69\x73\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x72\x6F\x75\x74\x69\x6E\x67\x2F\x73\x63\x68\x65\x64\x75\x6C\x65\x72","\x46\x61\x78\x4D\x65\x73\x73\x61\x67\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x46\x61\x78\x52\x6F\x6F\x6D","\x46\x61\x78\x41\x63\x63\x6F\x75\x6E\x74","\x46\x61\x78\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x43\x6F\x6E\x74\x61\x63\x74","\x65\x78\x70\x6F\x72\x74\x73","\x5B\x46\x61\x78\x5D\x20\x4E\x65\x77\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x66\x72\x6F\x6D\x20\x25\x73","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x66\x6F\x72\x6D\x61\x74","\x6C\x6F\x67","\x63\x6C\x6F\x6E\x65","\x5B\x46\x61\x78\x5D\x20\x45\x72\x72\x6F\x72\x20\x72\x65\x63\x65\x69\x76\x69\x6E\x67\x20\x6D\x65\x73\x73\x61\x67\x65\x3A","\x65\x72\x72\x6F\x72","\x5B\x46\x61\x78\x5D\x20\x4D\x65\x73\x73\x61\x67\x65\x3A","\x6D\x65\x73\x73\x61\x67\x65","\x5B\x46\x61\x78\x5D\x20\x53\x74\x61\x63\x6B\x3A","\x73\x74\x61\x63\x6B","\x63\x61\x74\x63\x68","\x5B\x46\x61\x78\x5D\x20\x46\x69\x6C\x65\x20\x63\x6F\x72\x72\x65\x63\x74\x6C\x79\x20\x63\x6F\x6E\x76\x65\x72\x74\x65\x64","\x66\x61\x78","\x25\x73\x2E\x25\x73","\x75\x6E\x69\x78","\x69\x64","\x6E\x61\x6D\x65","\x6C\x6F\x63\x61\x6C\x73\x74\x61\x74\x69\x6F\x6E\x69\x64","\x66\x72\x6F\x6D","\x69\x6E\x69\x74","\x74\x68\x65\x6E","\x5B\x46\x61\x78\x5D\x20\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x20\x6E\x6F\x74\x20\x63\x72\x65\x61\x74\x65\x64","\x5B\x46\x61\x78\x5D\x20\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x3A","\x74\x69\x66\x66\x32\x70\x64\x66\x20\x2D\x6F\x20","\x20","\x66\x69\x6C\x65\x6E\x61\x6D\x65","\x5B\x46\x61\x78\x5D\x20\x4D\x65\x73\x73\x61\x67\x65\x20\x6E\x6F\x74\x20\x63\x72\x65\x61\x74\x65\x64","\x70\x61\x72\x73\x65","\x2E\x70\x64\x66","\x72\x6F\x6F\x74","\x73\x65\x72\x76\x65\x72","\x66\x69\x6C\x65\x73","\x69\x6E\x62\x6F\x75\x6E\x64","\x63\x6F\x6E\x76\x65\x72\x74\x65\x64","\x6A\x6F\x69\x6E","\x63\x72\x65\x61\x74\x65","\x5B\x46\x61\x78\x5D\x20\x52\x6F\x6F\x6D\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x2F\x63\x72\x65\x61\x74\x65\x64","\x5B\x46\x61\x78\x5D\x20\x52\x6F\x6F\x6D\x3A","\x46\x61\x78\x52\x6F\x6F\x6D\x49\x64","\x73\x74\x61\x74\x75\x73","\x52\x45\x43\x45\x49\x56\x45\x44","\x74\x6F","\x6C\x65\x6E\x67\x74\x68","\x66\x69\x72\x73\x74","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x4F\x50\x45\x4E","\x73\x79\x73\x74\x65\x6D","\x66\x61\x78\x49\x6E","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x4E\x45\x57","\x43\x4C\x4F\x53\x45\x44","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x44\x45\x53\x43","\x66\x69\x6E\x64\x41\x6C\x6C","\x73\x70\x72\x65\x61\x64","\x5B\x46\x61\x78\x5D\x20\x41\x63\x63\x6F\x75\x6E\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x5B\x46\x61\x78\x5D\x20\x41\x63\x63\x6F\x75\x6E\x74\x20\x66\x6F\x75\x6E\x64\x3A","\x4C\x69\x73\x74\x49\x64","\x66\x69\x6E\x64\x4F\x72\x43\x72\x65\x61\x74\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x5B\x46\x61\x78\x5D\x20\x45\x72\x72\x6F\x72\x20\x75\x70\x64\x61\x74\x69\x6E\x67\x20\x73\x65\x6E\x64\x69\x6E\x67\x20\x6D\x65\x73\x73\x61\x67\x65\x3A","\x5B\x46\x61\x78\x5D\x20\x52\x6F\x6F\x6D\x20\x75\x70\x64\x61\x74\x65\x20\x66\x6F\x72\x20\x53\x65\x6E\x64\x46\x61\x78\x20\x65\x76\x65\x6E\x74","\x5B\x46\x61\x78\x5D\x20\x52\x6F\x6F\x6D\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x53\x45\x4E\x54","\x5B\x46\x61\x78\x5D\x20\x4D\x65\x73\x73\x61\x67\x65\x20\x75\x70\x64\x61\x74\x65\x20\x66\x6F\x72\x20\x53\x65\x6E\x64\x46\x61\x78\x20\x65\x76\x65\x6E\x74","\x67\x65\x74\x46\x61\x78\x52\x6F\x6F\x6D","\x5B\x46\x61\x78\x5D\x20\x4D\x65\x73\x73\x61\x67\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x70\x61\x67\x65\x73\x74\x72\x61\x6E\x73\x66\x65\x72\x72\x65\x64","\x30","\x46\x41\x49\x4C\x45\x44","\x72\x65\x6D\x6F\x74\x65\x73\x74\x61\x74\x69\x6F\x6E\x69\x64","\x72\x65\x73\x6F\x6C\x75\x74\x69\x6F\x6E","\x74\x72\x61\x6E\x73\x66\x65\x72\x72\x61\x74\x65","\x76\x61\x72\x69\x61\x62\x6C\x65","\x73\x65\x6E\x64","\x72\x65\x73\x6F\x6C\x76\x65","\x5B\x46\x61\x78\x5D\x20\x45\x72\x72\x6F\x72\x20\x75\x70\x64\x61\x74\x69\x6E\x67\x20\x6D\x65\x73\x73\x61\x67\x65\x3A","\x63\x68\x61\x6E\x6E\x65\x6C","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65\x64\x65\x73\x63","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x61\x6D\x65","\x61\x63\x63\x6F\x75\x6E\x74\x63\x6F\x64\x65","\x63\x6F\x6E\x74\x65\x78\x74","\x65\x78\x74\x65\x6E","\x70\x72\x69\x6F\x72\x69\x74\x79","\x75\x6E\x69\x71\x75\x65\x69\x64","\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x66\x61\x78\x65\x72\x72\x6F\x72","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x76\x61\x6C\x75\x65","\x5B\x46\x61\x78\x5D\x20\x45\x72\x72\x6F\x72\x20\x75\x70\x64\x61\x74\x69\x6E\x67\x20\x65\x72\x72\x6F\x72\x3A"];_0xf744[0];var BPromise=require(_0xf744[1]);var moment=require(_0xf744[2]);var util=require(_0xf744[3]);var _=require(_0xf744[4]);var path=require(_0xf744[5]);var config=require(_0xf744[6]);var exec=require(_0xf744[8])[_0xf744[7]];var Scheduler=require(_0xf744[9]);var FaxMessage=require(_0xf744[11])[_0xf744[10]];var FaxRoom=require(_0xf744[11])[_0xf744[12]];var FaxAccount=require(_0xf744[11])[_0xf744[13]];var FaxAttachment=require(_0xf744[11])[_0xf744[14]];var Contact=require(_0xf744[11])[_0xf744[15]];module[_0xf744[16]]= function(){return {receivefax:function(_0x11aaxe){return function(_0x11aaxf){console[_0xf744[20]](util[_0xf744[19]](_0xf744[17],_0x11aaxe[_0xf744[18]]));var _0x11aax10=_[_0xf744[21]](_0x11aaxe);var _0x11aax11;var _0x11aax12,_0x11aax13;return FaxAccount[_0xf744[77]]({where:{localstationid:_0x11aaxe[_0xf744[35]]}})[_0xf744[38]](function(_0x11aax1e){if(!_0x11aax1e){throw new Error(_0xf744[73])};console[_0xf744[20]](_0xf744[74],_0x11aaxe[_0xf744[35]]);_0x11aax11= _0x11aax1e;if(_0x11aax11[_0xf744[75]]){return Contact[_0xf744[76]]({where:{ListId:_0x11aax11[_0xf744[75]],$or:[{phone:_0x11aaxe[_0xf744[18]]},{fax:_0x11aaxe[_0xf744[18]]}]},defaults:{phone:_0x11aaxe[_0xf744[18]],fax:_0x11aaxe[_0xf744[18]],firstName:_0x11aaxe[_0xf744[18]],ListId:_0x11aax11[_0xf744[75]]}})}else {return []}})[_0xf744[72]](function(_0x11aax1c,_0x11aax1d){if(_0x11aax1d!== undefined&& !_0x11aax1d){return _0x11aax1c[_0xf744[66]]({fax:_0x11aaxe[_0xf744[18]]})};return})[_0xf744[38]](function(){return FaxRoom[_0xf744[71]]({limit:1,where:{contact:_0x11aax10[_0xf744[18]],FaxAccountId:_0x11aax11[_0xf744[33]],status:{$ne:_0xf744[68]}},order:[[_0xf744[69],_0xf744[70]]]})})[_0xf744[38]](function(_0x11aax1b){if(_0x11aax1b[_0xf744[60]]){_0x11aax1b= _[_0xf744[61]](_0x11aax1b);return _0x11aax1b[_0xf744[66]]({lastEvent:_0xf744[58],lastEventAt:moment()[_0xf744[19]](_0xf744[62]),status:_0xf744[63],openReason:_0xf744[64],faxIn:++_0x11aax1b[_0xf744[65]]})}else {return FaxRoom[_0xf744[53]]({contact:_0x11aax10[_0xf744[18]],account:_0x11aax11[_0xf744[34]],status:_0xf744[67],lastEvent:_0xf744[58],lastEventAt:moment()[_0xf744[19]](_0xf744[62]),FaxAccountId:_0x11aax11[_0xf744[33]],faxIn:1})}})[_0xf744[38]](function(_0x11aax1b){if(!_0x11aax1b){throw new Error(_0xf744[54])};console[_0xf744[20]](_0xf744[55],_0x11aax1b[_0xf744[33]]);_0x11aax13= _0x11aax1b;_0x11aax10[_0xf744[56]]= _0x11aax1b[_0xf744[33]];_0x11aax10[_0xf744[57]]= _0xf744[58];_0x11aax10[_0xf744[36]]= _0x11aax10[_0xf744[18]];_0x11aax10[_0xf744[59]]= _0x11aax10[_0xf744[35]];return FaxMessage[_0xf744[53]](_0x11aax10)})[_0xf744[38]](function(_0x11aax17){if(!_0x11aax17){throw new Error(_0xf744[44])};_0x11aax12= _0x11aax17;console[_0xf744[20]](_0xf744[24],_0x11aax17[_0xf744[33]]);var _0x11aax18=[];var _0x11aax19=path[_0xf744[45]](_0x11aaxe[_0xf744[43]])[_0xf744[34]];var _0x11aax1a=_0x11aax19+ _0xf744[46];return FaxAttachment[_0xf744[53]]({path:path[_0xf744[52]](config[_0xf744[47]],_0xf744[48],_0xf744[49],_0xf744[30],_0xf744[50],_0xf744[51],_0x11aax1a),basename:_0x11aax1a,name:_0x11aax19,FaxMessageId:_0x11aax17[_0xf744[33]]})})[_0xf744[38]](function(_0x11aax16){if(!_0x11aax16){throw new Error(_0xf744[39])};console[_0xf744[20]](_0xf744[40],_0x11aax16[_0xf744[33]]);return exec(_0xf744[41]+ _0x11aax16[_0xf744[5]]+ _0xf744[42]+ _0x11aaxe[_0xf744[43]])})[_0xf744[38]](function(){console[_0xf744[20]](_0xf744[29]);var _0x11aax15= new Scheduler({channel:_0xf744[30],uniqueid:util[_0xf744[19]](_0xf744[31],moment()[_0xf744[32]](),_0x11aax13[_0xf744[33]]),messageid:_0x11aax12[_0xf744[33]],roomid:_0x11aax13[_0xf744[33]],accountid:_0x11aax11[_0xf744[33]],accountname:_0x11aax11[_0xf744[34]],accountphone:_0x11aax11[_0xf744[35]],from:_0x11aax12[_0xf744[36]]});_0x11aax15[_0xf744[37]]()})[_0xf744[28]](function(_0x11aax14){console[_0xf744[23]](_0xf744[22],_0x11aax14);console[_0xf744[23]](_0xf744[24],_0x11aax14[_0xf744[25]]);console[_0xf744[23]](_0xf744[26],_0x11aax14[_0xf744[27]])})}},sendfax:function(_0x11aaxe){return function(_0x11aaxf){var _0x11aax12;return FaxMessage[_0xf744[77]]({where:{filename:_0x11aaxe[_0xf744[43]],localstationid:_0x11aaxe[_0xf744[35]]}})[_0xf744[38]](function(_0x11aax20){if(!_0x11aax20){throw new Error(_0xf744[84])};_0x11aax12= _0x11aax20;var _0x11aax21=_0xf744[81];if(_0x11aaxe[_0xf744[85]]=== _0xf744[86]){_0x11aax21= _0xf744[87]};return _0x11aax12[_0xf744[66]]({remotestationid:_0x11aaxe[_0xf744[88]],pagestransferred:_0x11aaxe[_0xf744[85]],resolution:_0x11aaxe[_0xf744[89]],transferrate:_0x11aaxe[_0xf744[90]],status:_0x11aax21})})[_0xf744[38]](function(_0x11aax17){console[_0xf744[20]](_0xf744[82],_0x11aax17[_0xf744[33]]);return _0x11aax12[_0xf744[83]]()})[_0xf744[38]](function(_0x11aax1f){if(!_0x11aax1f){throw new Error(_0xf744[80])};return _0x11aax1f[_0xf744[66]]({lastEvent:_0xf744[81]},{individualHooks:true})})[_0xf744[38]](function(_0x11aax1b){console[_0xf744[20]](_0xf744[79],_0x11aax1b[_0xf744[33]])})[_0xf744[28]](function(_0x11aax14){console[_0xf744[23]](_0xf744[78],_0x11aax14);console[_0xf744[23]](_0xf744[24],_0x11aax14[_0xf744[25]]);console[_0xf744[23]](_0xf744[26],_0x11aax14[_0xf744[27]])})}},faxstatus:function(_0x11aaxe){return function(_0x11aaxf){if(_0x11aaxe[_0xf744[91]]!== _0xf744[92]){return BPromise[_0xf744[93]]()};return FaxMessage[_0xf744[77]]({where:{filename:_0x11aaxe[_0xf744[43]],localstationid:_0x11aaxe[_0xf744[35]]}})[_0xf744[38]](function(_0x11aax20){if(!_0x11aax20){throw new Error(_0xf744[84])};return _0x11aax20[_0xf744[66]]({channel:_0x11aaxe[_0xf744[95]],channelstate:_0x11aaxe[_0xf744[96]],channelstatedesc:_0x11aaxe[_0xf744[97]],calleridnum:_0x11aaxe[_0xf744[18]],calleridname:_0x11aaxe[_0xf744[98]],connectedlinenum:_0x11aaxe[_0xf744[99]],connectedlinename:_0x11aaxe[_0xf744[100]],accountcode:_0x11aaxe[_0xf744[101]],context:_0x11aaxe[_0xf744[102]],exten:_0x11aaxe[_0xf744[103]],priority:_0x11aaxe[_0xf744[104]],uniqueid:_0x11aaxe[_0xf744[105]],linkedid:_0x11aaxe[_0xf744[106]],lastStatus:_0x11aaxe[_0xf744[57]]})})[_0xf744[28]](function(_0x11aax14){console[_0xf744[23]](_0xf744[94],_0x11aax14);console[_0xf744[23]](_0xf744[24],_0x11aax14[_0xf744[25]]);console[_0xf744[23]](_0xf744[26],_0x11aax14[_0xf744[27]])})}},faxerror:function(_0x11aaxe){return function(_0x11aaxf){if(!_0x11aaxe[_0xf744[91]][_0xf744[108]](_0xf744[107])|| !_0x11aaxe[_0xf744[109]]){return BPromise[_0xf744[93]]()};return FaxMessage[_0xf744[77]]({where:{channel:_0x11aaxe[_0xf744[95]]}})[_0xf744[38]](function(_0x11aax20){if(_0x11aax20){return _0x11aax20[_0xf744[66]]({error:_0x11aaxe[_0xf744[109]]})};return})[_0xf744[28]](function(_0x11aax14){console[_0xf744[23]](_0xf744[110],_0x11aax14)})}}}}