1 var _0xd2d0=["\x66\x73","\x75\x74\x69\x6C","\x70\x61\x74\x68","\x2E\x2E\x2F\x2E\x2E\x2F\x63\x6F\x6E\x66\x69\x67\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x6C\x6F\x64\x61\x73\x68","\x62\x6C\x75\x65\x62\x69\x72\x64","\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","\x66\x73\x2D\x65\x78\x74\x72\x61","\x6D\x6F\x6D\x65\x6E\x74","\x46\x61\x78\x41\x63\x63\x6F\x75\x6E\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x46\x61\x78\x52\x6F\x6F\x6D","\x46\x61\x78\x4D\x65\x73\x73\x61\x67\x65","\x46\x61\x78\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74","\x54\x72\x75\x6E\x6B","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74","\x52\x65\x70\x6F\x72\x74\x46\x61\x78","\x2E\x2E\x2F\x75\x74\x69\x6C","\x2E\x2E\x2F\x72\x6F\x75\x74\x69\x6E\x67\x2F\x73\x63\x68\x65\x64\x75\x6C\x65\x72","\x46\x61\x78\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x73\x74\x61\x74\x75\x73","\x63\x68\x61\x6E\x67\x65\x64","\x53\x45\x4E\x44\x49\x4E\x47","\x72\x65\x74\x72\x79","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x75\x70\x64\x61\x74\x65\x45\x72\x72\x6F\x72","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x45\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x46\x61\x78\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x76\x61\x6C\x75\x65","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x74\x68\x65\x6E","\x63\x68\x61\x6E\x6E\x65\x6C","\x66\x69\x6E\x64\x4F\x6E\x65","\x75\x70\x64\x61\x74\x65\x4D\x65\x73\x73\x61\x67\x65","\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\x75\x6D","\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\x69\x6C\x65\x6E\x61\x6D\x65","\x6C\x6F\x63\x61\x6C\x73\x74\x61\x74\x69\x6F\x6E\x69\x64","\x75\x70\x64\x61\x74\x65\x53\x65\x6E\x64","\x46\x61\x78\x20\x72\x6F\x6F\x6D\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x53\x45\x4E\x54","\x67\x65\x74\x46\x61\x78\x52\x6F\x6F\x6D","\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","\x72\x65\x63\x65\x69\x76\x65\x66\x61\x78","\x4E\x65\x77\x20\x46\x61\x78\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x66\x72\x6F\x6D\x20\x25\x73","\x66\x6F\x72\x6D\x61\x74","\x63\x6C\x6F\x6E\x65","\x45\x72\x72\x6F\x72\x20\x72\x65\x63\x65\x69\x76\x69\x6E\x67\x20\x66\x61\x78\x20\x6D\x65\x73\x73\x61\x67\x65","\x66\x61\x78","\x25\x73\x2E\x25\x73","\x75\x6E\x69\x78","\x69\x64","\x6E\x61\x6D\x65","\x66\x72\x6F\x6D","\x69\x6E\x69\x74","\x74\x69\x66\x66\x32\x70\x64\x66\x20\x2D\x6F\x20","\x20","\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","\x46\x61\x78\x20\x72\x6F\x6F\x6D\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x2F\x63\x72\x65\x61\x74\x65\x64","\x46\x61\x78\x52\x6F\x6F\x6D\x49\x64","\x52\x45\x43\x45\x49\x56\x45\x44","\x74\x6F","\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","\x4E\x45\x57","\x43\x4C\x4F\x53\x45\x44","\x73\x70\x72\x65\x61\x64","\x46\x61\x78\x20\x61\x63\x63\x6F\x75\x6E\x74\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x46\x61\x78\x20\x61\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","\x45\x72\x72\x6F\x72\x20\x73\x65\x6E\x64\x69\x6E\x67\x20\x66\x61\x78","\x45\x72\x72\x6F\x72\x20\x75\x70\x64\x61\x74\x69\x6E\x67\x20\x65\x72\x72\x6F\x72\x20\x73\x74\x61\x74\x75\x73","\x75\x70\x64\x61\x74\x65","\x72\x65\x73","\x6F\x72\x69\x67\x69\x6E\x61\x74\x65","\x25\x73\x2F\x25\x73\x2F\x25\x73","\x74\x65\x63\x68","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x2D\x66\x61\x78","\x22\x25\x73\x22\x20\x3C\x25\x73\x3E","\x65\x63\x6D","\x68\x65\x61\x64\x65\x72\x69\x6E\x66\x6F","\x6D\x69\x6E\x72\x61\x74\x65","\x6D\x61\x78\x72\x61\x74\x65","\x22\x25\x73\x22","\x6D\x6F\x64\x65\x6D","\x67\x61\x74\x65\x77\x61\x79","\x74\x33\x38\x74\x69\x6D\x65\x6F\x75\x74","\x61\x63\x74\x69\x6F\x6E","\x70\x72\x6F\x6D\x69\x73\x69\x66\x79","\x63\x68\x6D\x6F\x64\x53\x79\x6E\x63","\x46\x61\x78\x41\x74\x74\x61\x63\x68\x6D\x65\x6E\x74\x73","\x74\x79\x70\x65","\x61\x70\x70\x6C\x69\x63\x61\x74\x69\x6F\x6E\x2F\x70\x64\x66","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x2F","\x2E\x74\x69\x66","\x67\x73\x20\x2D\x71\x20\x2D\x64\x4E\x4F\x50\x41\x55\x53\x45\x20\x2D\x64\x42\x41\x54\x43\x48\x20\x2D\x73\x44\x45\x56\x49\x43\x45\x3D\x74\x69\x66\x66\x67\x34\x20\x2D\x73\x50\x41\x50\x45\x52\x53\x49\x5A\x45\x3D\x6C\x65\x74\x74\x65\x72\x20\x2D\x73\x4F\x75\x74\x70\x75\x74\x46\x69\x6C\x65\x3D","\x62\x61\x73\x65","\x63\x6F\x70\x79\x53\x79\x6E\x63","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x64\x64\x55\x73\x65\x72","\x50\x45\x4E\x44\x49\x4E\x47","\x75\x73\x65\x72","\x61\x64\x64\x46\x61\x78\x4D\x65\x73\x73\x61\x67\x65","\x54\x72\x75\x6E\x6B\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x54\x72\x75\x6E\x6B\x4E\x61\x6D\x65","\x72\x65\x71\x75\x65\x73\x74\x20\x66\x61\x69\x6C\x65\x64\x21","\x72\x65\x71\x75\x65\x73\x74\x20\x73\x75\x63\x63\x65\x73\x73\x65\x66\x75\x6C\x21","\x73\x65\x6E\x64\x52\x65\x71\x75\x65\x73\x74","\x63\x6F\x6E\x6E\x65\x63\x74\x69\x64","\x65\x72\x72","\x61\x63\x63\x65\x70\x74\x4D\x65\x74\x68\x6F\x64","\x61\x63\x63\x65\x70\x74\x55\x72\x6C","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x46\x61\x78\x20\x41\x63\x63\x6F\x75\x6E\x74\x20\x48\x54\x54\x50\x20\x4D\x65\x74\x68\x6F\x64\x20\x6F\x72\x20\x55\x52\x4C\x20\x69\x73\x20\x6E\x6F\x74\x20\x63\x6F\x6E\x66\x69\x67\x75\x72\x65\x64\x2E\x20\x43\x6F\x6E\x74\x61\x63\x74\x20\x79\x6F\x75\x72\x20\x61\x64\x6D\x69\x6E\x69\x73\x74\x72\x61\x74\x6F\x72\x21\x21","\x6C\x65\x6E\x67\x74\x68","\x61\x63\x74\x69\x6F\x6E\x73","\x65\x6E\x61\x62\x6C\x65\x64","\x65\x78\x65\x63\x41\x63\x74\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x61\x63\x63\x6F\x75\x6E\x74\x69\x64","\x72\x65\x6A\x65\x63\x74\x65\x64\x41\x74","\x72\x65\x6A\x65\x63\x74\x4D\x65\x74\x68\x6F\x64","\x72\x65\x6A\x65\x63\x74\x55\x72\x6C","\x65\x78\x70\x6F\x72\x74\x73"];var fs=require(_0xd2d0[0]);var util=require(_0xd2d0[1]);var path=require(_0xd2d0[2]);var config=require(_0xd2d0[3]);var _=require(_0xd2d0[4]);var Promise=require(_0xd2d0[5]);var exec=require(_0xd2d0[7])[_0xd2d0[6]];var fse=require(_0xd2d0[8]);var moment=require(_0xd2d0[9]);var FaxAccount=require(_0xd2d0[11])[_0xd2d0[10]];var FaxRoom=require(_0xd2d0[11])[_0xd2d0[12]];var FaxMessage=require(_0xd2d0[11])[_0xd2d0[13]];var FaxAttachment=require(_0xd2d0[11])[_0xd2d0[14]];var Trunk=require(_0xd2d0[11])[_0xd2d0[15]];var User=require(_0xd2d0[11])[_0xd2d0[16]];var Contact=require(_0xd2d0[11])[_0xd2d0[17]];var ReportFax=require(_0xd2d0[11])[_0xd2d0[18]];var Util=require(_0xd2d0[19]);var Scheduler=require(_0xd2d0[20]);function Fax(_0x2b23x15){console[_0xd2d0[22]](_0xd2d0[21]);FaxMessage[_0xd2d0[23]](function(_0x2b23x16,_0x2b23x17){sendfax(_0x2b23x16,_0x2b23x15,0,_0x2b23x17)});FaxMessage[_0xd2d0[28]](function(_0x2b23x16){if(_0x2b23x16[_0xd2d0[25]](_0xd2d0[24])&& _0x2b23x16[_0xd2d0[24]]=== _0xd2d0[26]){sendfax(_0x2b23x16,_0x2b23x15,_0x2b23x16[_0xd2d0[27]]+ 1)}});ReportFax[_0xd2d0[28]](function(_0x2b23x16){onReportUpdate(_0x2b23x16)})}Fax[_0xd2d0[30]][_0xd2d0[29]]= function(_0x2b23x18){return FaxMessage[_0xd2d0[38]]({where:{channel:_0x2b23x18[_0xd2d0[37]]}})[_0xd2d0[36]](function(_0x2b23x1a){if(!_0x2b23x1a){throw new Error(_0xd2d0[33])};return _0x2b23x1a[_0xd2d0[35]]({error:_0x2b23x18[_0xd2d0[34]]})})[_0xd2d0[32]](function(_0x2b23x19){console[_0xd2d0[22]](_0xd2d0[31],_0x2b23x19)})};Fax[_0xd2d0[30]][_0xd2d0[39]]= function(_0x2b23x18){return FaxMessage[_0xd2d0[38]]({where:{filename:_0x2b23x18[_0xd2d0[52]],localstationid:_0x2b23x18[_0xd2d0[53]]}})[_0xd2d0[36]](function(_0x2b23x1a){if(!_0x2b23x1a){throw new Error(_0xd2d0[33])};return _0x2b23x1a[_0xd2d0[35]]({channel:_0x2b23x18[_0xd2d0[37]],channelstate:_0x2b23x18[_0xd2d0[40]],channelstatedesc:_0x2b23x18[_0xd2d0[41]],calleridnum:_0x2b23x18[_0xd2d0[42]],calleridname:_0x2b23x18[_0xd2d0[43]],connectedlinenum:_0x2b23x18[_0xd2d0[44]],connectedlinename:_0x2b23x18[_0xd2d0[45]],accountcode:_0x2b23x18[_0xd2d0[46]],context:_0x2b23x18[_0xd2d0[47]],exten:_0x2b23x18[_0xd2d0[48]],priority:_0x2b23x18[_0xd2d0[49]],uniqueid:_0x2b23x18[_0xd2d0[50]],linkedid:_0x2b23x18[_0xd2d0[51]],lastStatus:_0x2b23x18[_0xd2d0[24]]})})[_0xd2d0[32]](function(_0x2b23x19){console[_0xd2d0[22]](_0xd2d0[31],_0x2b23x19)})};Fax[_0xd2d0[30]][_0xd2d0[54]]= function(_0x2b23x18){var _0x2b23x1b;return FaxMessage[_0xd2d0[38]]({where:{filename:_0x2b23x18[_0xd2d0[52]],localstationid:_0x2b23x18[_0xd2d0[53]]}})[_0xd2d0[36]](function(_0x2b23x1a){if(!_0x2b23x1a){throw new Error(_0xd2d0[33])};_0x2b23x1b= _0x2b23x1a;var _0x2b23x1d=_0xd2d0[56];if(_0x2b23x18[_0xd2d0[58]]== _0xd2d0[59]){_0x2b23x1d= _0xd2d0[60]};return _0x2b23x1b[_0xd2d0[35]]({remotestationid:_0x2b23x18[_0xd2d0[61]],pagestransferred:_0x2b23x18[_0xd2d0[58]],resolution:_0x2b23x18[_0xd2d0[62]],transferrate:_0x2b23x18[_0xd2d0[63]],status:_0x2b23x1d})})[_0xd2d0[36]](function(){return _0x2b23x1b[_0xd2d0[57]]()})[_0xd2d0[36]](function(_0x2b23x1c){if(!_0x2b23x1c){throw new Error(_0xd2d0[55])};return _0x2b23x1c[_0xd2d0[35]]({lastEvent:_0xd2d0[56]},{individualHooks:true})})[_0xd2d0[32]](function(_0x2b23x19){console[_0xd2d0[22]](_0xd2d0[31],_0x2b23x19)})};Fax[_0xd2d0[30]][_0xd2d0[64]]= function(_0x2b23x18){console[_0xd2d0[22]](util[_0xd2d0[66]](_0xd2d0[65],_0x2b23x18[_0xd2d0[42]]));var _0x2b23x1e=_[_0xd2d0[67]](_0x2b23x18);var _0x2b23x1f;var _0x2b23x1b,_0x2b23x20;return FaxAccount[_0xd2d0[38]]({where:{localstationid:_0x2b23x18[_0xd2d0[53]]}})[_0xd2d0[36]](function(_0x2b23x2a){if(!_0x2b23x2a){throw new Error(_0xd2d0[97])};console[_0xd2d0[22]](_0xd2d0[98],_0x2b23x18[_0xd2d0[53]]);_0x2b23x1f= _0x2b23x2a;if(_0x2b23x1f[_0xd2d0[99]]){return Contact[_0xd2d0[100]]({where:{ListId:_0x2b23x1f[_0xd2d0[99]],$or:[{phone:_0x2b23x18[_0xd2d0[42]]},{fax:_0x2b23x18[_0xd2d0[42]]}]},defaults:{phone:_0x2b23x18[_0xd2d0[42]],fax:_0x2b23x18[_0xd2d0[42]],firstName:_0x2b23x18[_0xd2d0[42]],ListId:_0x2b23x1f[_0xd2d0[99]]}})}else {return []}})[_0xd2d0[96]](function(_0x2b23x28,_0x2b23x29){if(_0x2b23x29!= undefined&& !_0x2b23x29){return _0x2b23x28[_0xd2d0[35]]({fax:_0x2b23x18[_0xd2d0[42]]})};return})[_0xd2d0[36]](function(){return FaxRoom[_0xd2d0[38]]({where:{from:_0x2b23x18[_0xd2d0[42]],FaxAccountId:_0x2b23x1f[_0xd2d0[72]],status:{$ne:_0xd2d0[95]}}})})[_0xd2d0[36]](function(_0x2b23x27){if(_0x2b23x27){return _0x2b23x27[_0xd2d0[35]]({lastEvent:_0xd2d0[89],lastEventAt:moment()[_0xd2d0[66]](_0xd2d0[91]),status:_0xd2d0[92],openReason:_0xd2d0[93]})}else {return FaxRoom[_0xd2d0[86]]({from:_0x2b23x1e[_0xd2d0[42]],account:_0x2b23x1f[_0xd2d0[73]],status:_0xd2d0[94],lastEvent:_0xd2d0[89],lastEventAt:moment()[_0xd2d0[66]](_0xd2d0[91]),FaxAccountId:_0x2b23x1f[_0xd2d0[72]]})}})[_0xd2d0[36]](function(_0x2b23x27){if(!_0x2b23x27){throw new Error(_0xd2d0[87])};_0x2b23x20= _0x2b23x27;_0x2b23x1e[_0xd2d0[88]]= _0x2b23x27[_0xd2d0[72]];_0x2b23x1e[_0xd2d0[24]]= _0xd2d0[89];_0x2b23x1e[_0xd2d0[74]]= _0x2b23x1e[_0xd2d0[42]];_0x2b23x1e[_0xd2d0[90]]= _0x2b23x1e[_0xd2d0[53]];return FaxMessage[_0xd2d0[86]](_0x2b23x1e)})[_0xd2d0[36]](function(_0x2b23x23){_0x2b23x1b= _0x2b23x23;var _0x2b23x24=[];var _0x2b23x25=path[_0xd2d0[78]](_0x2b23x18[_0xd2d0[52]])[_0xd2d0[73]];var _0x2b23x26=_0x2b23x25+ _0xd2d0[79];return FaxAttachment[_0xd2d0[86]]({path:path[_0xd2d0[85]](config[_0xd2d0[80]],_0xd2d0[81],_0xd2d0[82],_0xd2d0[69],_0xd2d0[83],_0xd2d0[84],_0x2b23x26),basename:_0x2b23x26,name:_0x2b23x25,FaxMessageId:_0x2b23x23[_0xd2d0[72]]})})[_0xd2d0[36]](function(_0x2b23x22){return exec(_0xd2d0[76]+ _0x2b23x22[_0xd2d0[2]]+ _0xd2d0[77]+ _0x2b23x18[_0xd2d0[52]])})[_0xd2d0[36]](function(){var _0x2b23x21= new Scheduler({channel:_0xd2d0[69],uniqueid:util[_0xd2d0[66]](_0xd2d0[70],moment()[_0xd2d0[71]](),_0x2b23x20[_0xd2d0[72]]),messageid:_0x2b23x1b[_0xd2d0[72]],roomid:_0x2b23x20[_0xd2d0[72]],accountid:_0x2b23x1f[_0xd2d0[72]],accountname:_0x2b23x1f[_0xd2d0[73]],accountphone:_0x2b23x1f[_0xd2d0[53]],from:_0x2b23x1b[_0xd2d0[74]]});_0x2b23x21[_0xd2d0[75]]()})[_0xd2d0[32]](function(_0x2b23x19){console[_0xd2d0[22]](_0xd2d0[68],_0x2b23x19)})};function sendfax(_0x2b23x23,_0x2b23x15,_0x2b23x2c,_0x2b23x17){if(_0x2b23x23[_0xd2d0[24]]=== _0xd2d0[26]){var _0x2b23x20;var _0x2b23x1b=_0x2b23x23;var _0x2b23x2d=_0x2b23x23[_0xd2d0[74]];var _0x2b23x2e=_0x2b23x23[_0xd2d0[90]];var _0x2b23x2f;var _0x2b23x30;var _0x2b23x31,_0x2b23x32;return FaxAccount[_0xd2d0[38]]({where:{localstationid:_0x2b23x1b[_0xd2d0[74]]}})[_0xd2d0[36]](function(_0x2b23x2a){if(!_0x2b23x2a){throw new Error(_0xd2d0[97])};_0x2b23x2f= _0x2b23x2a;return Trunk[_0xd2d0[38]]({where:{name:_0x2b23x2f[_0xd2d0[136]]}})})[_0xd2d0[36]](function(_0x2b23x34){if(!_0x2b23x34){throw new Error(_0xd2d0[135])};_0x2b23x30= _0x2b23x34;if(_0x2b23x1b[_0xd2d0[88]]){return FaxRoom[_0xd2d0[130]](_0x2b23x1b.FaxRoomId)}else {return FaxRoom[_0xd2d0[86]]({from:_0x2b23x2d,account:_0x2b23x2f[_0xd2d0[73]],status:_0xd2d0[132],FaxAccountId:_0x2b23x2f[_0xd2d0[72]]})}})[_0xd2d0[36]](function(_0x2b23x1c){_0x2b23x20= _0x2b23x1c;return _0x2b23x20[_0xd2d0[134]](_0x2b23x1b[_0xd2d0[72]])})[_0xd2d0[36]](function(){return _0x2b23x20[_0xd2d0[35]]({status:_0xd2d0[132],lastEvent:_0xd2d0[26],lastEventAt:moment()[_0xd2d0[66]](_0xd2d0[91])},{individualHooks:true,user:_0x2b23x17[_0xd2d0[133]]})})[_0xd2d0[36]](function(){return _0x2b23x20[_0xd2d0[131]](_0x2b23x1b.UserId)})[_0xd2d0[36]](function(){return User[_0xd2d0[130]](_0x2b23x1b.UserId)})[_0xd2d0[36]](function(){if(_0x2b23x2f[_0xd2d0[99]]){return Contact[_0xd2d0[100]]({where:{ListId:_0x2b23x2f[_0xd2d0[99]],$or:[{phone:_0x2b23x2e},{fax:_0x2b23x2e}]},defaults:{fax:_0x2b23x2e,phone:_0x2b23x2e,firstName:_0x2b23x2e,ListId:_0x2b23x2f[_0xd2d0[99]]}})}else {return []}})[_0xd2d0[96]](function(_0x2b23x28,_0x2b23x29){if(_0x2b23x29!= undefined&& !_0x2b23x29){return _0x2b23x28[_0xd2d0[35]]({fax:_0x2b23x2e})};return})[_0xd2d0[36]](function(){_0x2b23x31= _0x2b23x1b[_0xd2d0[121]][0][_0xd2d0[2]];if(_0x2b23x1b[_0xd2d0[121]][0][_0xd2d0[122]]=== _0xd2d0[123]){_0x2b23x32= path[_0xd2d0[85]](config[_0xd2d0[80]],_0xd2d0[81],_0xd2d0[82],_0xd2d0[69],_0xd2d0[124],_0xd2d0[84],_0xd2d0[125],path[_0xd2d0[78]](_0x2b23x31)[_0xd2d0[73]]+ _0xd2d0[126]);return exec(_0xd2d0[127]+ _0x2b23x32+ _0xd2d0[77]+ _0x2b23x31)}else {_0x2b23x32= path[_0xd2d0[85]](config[_0xd2d0[80]],_0xd2d0[81],_0xd2d0[82],_0xd2d0[69],_0xd2d0[124],_0xd2d0[84],_0xd2d0[125],path[_0xd2d0[78]](_0x2b23x31)[_0xd2d0[128]]);fse[_0xd2d0[129]](_0x2b23x31,_0x2b23x32);return}})[_0xd2d0[36]](function(){fs[_0xd2d0[120]](_0x2b23x32,511);return _0x2b23x1b[_0xd2d0[35]]({filename:_0x2b23x32,localstationid:_0x2b23x1b[_0xd2d0[74]],retry:_0x2b23x2c})})[_0xd2d0[36]](function(){return Promise[_0xd2d0[119]](_0x2b23x15[_0xd2d0[118]])({action:_0xd2d0[105],channel:util[_0xd2d0[66]](_0xd2d0[106],_0x2b23x2f[_0xd2d0[107]],_0x2b23x30[_0xd2d0[73]],_0x2b23x2e),exten:_0x2b23x2e,context:_0xd2d0[108],priority:1,callerid:util[_0xd2d0[66]](_0xd2d0[109],_0x2b23x2f[_0xd2d0[53]],_0x2b23x2f[_0xd2d0[53]]),variable:{FAXNAME:_0x2b23x2f[_0xd2d0[73]],FAXNUMBER:_0x2b23x2e,FAXECM:_0x2b23x2f[_0xd2d0[110]],FAXHEADERINFO:_0x2b23x2f[_0xd2d0[111]],FAXLOCALSTATIONID:_0x2b23x2f[_0xd2d0[53]],FAXMINRATE:_0x2b23x2f[_0xd2d0[112]],FAXMAXRATE:_0x2b23x2f[_0xd2d0[113]],FAXMODEM:util[_0xd2d0[66]](_0xd2d0[114],_0x2b23x2f[_0xd2d0[115]]),FAXGATEWAY:_0x2b23x2f[_0xd2d0[116]],FAXT38TIMEOUT:_0x2b23x2f[_0xd2d0[117]],FAXOUTFILE:_0x2b23x32},account:_0x2b23x2f[_0xd2d0[53]]})})[_0xd2d0[36]](function(_0x2b23x33){console[_0xd2d0[22]](_0xd2d0[104],_0x2b23x33)})[_0xd2d0[32]](function(_0x2b23x19){console[_0xd2d0[22]](_0xd2d0[101],_0x2b23x19);return _0x2b23x1b[_0xd2d0[103]]({status:_0xd2d0[60]})[_0xd2d0[36]](function(){if(_0x2b23x20){return _0x2b23x20[_0xd2d0[35]]({lastEvent:_0xd2d0[60]})};return})[_0xd2d0[32]](function(_0x2b23x19){console[_0xd2d0[22]](_0xd2d0[102])})})}}function execRequest(_0x2b23x16,_0x2b23x36,_0x2b23x37){Util[_0xd2d0[139]](_0x2b23x16,_0x2b23x36,_0x2b23x37)[_0xd2d0[36]](function(_0x2b23x38){console[_0xd2d0[22]](_0xd2d0[138])})[_0xd2d0[32]](function(_0x2b23x19){console[_0xd2d0[22]](_0xd2d0[137])})}function onReportUpdate(_0x2b23x16){var _0x2b23x1f;if(_0x2b23x16[_0xd2d0[25]](_0xd2d0[140])){return FaxAccount[_0xd2d0[130]](parseInt(_0x2b23x16[_0xd2d0[151]]))[_0xd2d0[36]](function(_0x2b23x2a){if(!_0x2b23x2a){throw new Error(_0xd2d0[97])};_0x2b23x1f= _0x2b23x2a;if(_0x2b23x1f[_0xd2d0[142]]&& _0x2b23x1f[_0xd2d0[143]]){execRequest(_0x2b23x16[_0xd2d0[144]],_0x2b23x1f[_0xd2d0[142]],_0x2b23x1f[_0xd2d0[143]])}else {throw new Error(_0xd2d0[145])};if(_0x2b23x1f[_0xd2d0[147]][_0xd2d0[146]]){_[_0xd2d0[150]](_0x2b23x1f[_0xd2d0[147]],function(_0x2b23x3a){if(_0x2b23x3a[_0xd2d0[148]]){Util[_0xd2d0[149]](_0x2b23x3a,_0x2b23x16)}})}})[_0xd2d0[32]](function(_0x2b23x19){console[_0xd2d0[22]](_0xd2d0[141],_0x2b23x19)})};if(_0x2b23x16[_0xd2d0[25]](_0xd2d0[152])){return FaxAccount[_0xd2d0[130]](_0x2b23x16[_0xd2d0[151]])[_0xd2d0[36]](function(_0x2b23x2a){if(!_0x2b23x2a){throw new Error(_0xd2d0[97])};_0x2b23x1f= _0x2b23x2a;if(_0x2b23x1f[_0xd2d0[153]]&& _0x2b23x1f[_0xd2d0[154]]){execRequest(_0x2b23x16[_0xd2d0[144]],_0x2b23x1f[_0xd2d0[153]],_0x2b23x1f[_0xd2d0[154]])}})[_0xd2d0[32]](function(_0x2b23x19){console[_0xd2d0[22]](_0xd2d0[141],_0x2b23x19)})}}module[_0xd2d0[155]]= Fax