Built motion from commit ee60659.|0.0.144
[motion.git] / server / config / ami / fax.js
index 715712a..88a27f4 100644 (file)
@@ -1 +1 @@
-var _0x677c=["\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","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x61\x63\x63\x6F\x75\x6E\x74\x69\x64","\x66\x69\x6E\x64","\x63\x6F\x6E\x6E\x65\x63\x74\x69\x64","\x61\x63\x63\x65\x70\x74","\x72\x65\x6A\x65\x63\x74\x65\x64\x41\x74","\x72\x65\x6A\x65\x63\x74","\x46\x61\x78\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x43\x4C\x4F\x53\x45\x44","\x63\x6C\x6F\x73\x65","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6C\x6C","\x70\x75\x73\x68","\x69\x64","\x46\x61\x78\x20\x61\x63\x63\x6F\x75\x6E\x74\x3A\x20","\x6E\x61\x6D\x65","\x20\x55\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x75\x6E\x73\x68\x69\x66\x74","\x72\x65\x6D\x6F\x76\x65","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x61\x63\x63\x65\x70\x74\x4D\x65\x74\x68\x6F\x64","\x61\x63\x63\x65\x70\x74\x55\x72\x6C","\x46\x61\x78\x20\x61\x63\x63\x6F\x75\x6E\x74\x20\x3C","\x3E\x20\x65\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x61\x63\x63\x65\x70\x74\x20\x77\x65\x62\x68\x6F\x6F\x6B","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\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","\x72\x65\x6A\x65\x63\x74\x4D\x65\x74\x68\x6F\x64","\x72\x65\x6A\x65\x63\x74\x55\x72\x6C","\x3E\x20\x65\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x72\x65\x6A\x65\x63\x74\x20\x77\x65\x62\x68\x6F\x6F\x6B","\x63\x6C\x6F\x73\x65\x4D\x65\x74\x68\x6F\x64","\x63\x6C\x6F\x73\x65\x55\x72\x6C","\x3E\x20\x65\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x63\x6C\x6F\x73\x65\x20\x77\x65\x62\x68\x6F\x6F\x6B","\x57\x65\x62\x68\x6F\x6F\x6B\x20\x6E\x6F\x74\x20\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x64","\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","\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","\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","\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","\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","\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","\x4E\x45\x57","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x44\x45\x53\x43","\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","\x66\x61\x78\x4F\x75\x74","\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","\x65\x78\x70\x6F\x72\x74\x73"];var fs=require(_0x677c[0]);var util=require(_0x677c[1]);var path=require(_0x677c[2]);var config=require(_0x677c[3]);var _=require(_0x677c[4]);var Promise=require(_0x677c[5]);var exec=require(_0x677c[7])[_0x677c[6]];var fse=require(_0x677c[8]);var moment=require(_0x677c[9]);var FaxAccount=require(_0x677c[11])[_0x677c[10]];var FaxRoom=require(_0x677c[11])[_0x677c[12]];var FaxMessage=require(_0x677c[11])[_0x677c[13]];var FaxAttachment=require(_0x677c[11])[_0x677c[14]];var Trunk=require(_0x677c[11])[_0x677c[15]];var User=require(_0x677c[11])[_0x677c[16]];var Contact=require(_0x677c[11])[_0x677c[17]];var ReportFax=require(_0x677c[11])[_0x677c[18]];var Util=require(_0x677c[19]);var Scheduler=require(_0x677c[20]);var faxaccounts;function Fax(_0x1c74x16){console[_0x677c[22]](_0x677c[21]);FaxMessage[_0x677c[23]](function(_0x1c74x17,_0x1c74x18){sendfax(_0x1c74x17,_0x1c74x16,0,_0x1c74x18)});FaxMessage[_0x677c[28]](function(_0x1c74x17){if(_0x1c74x17[_0x677c[25]](_0x677c[24])&& _0x1c74x17[_0x677c[24]]=== _0x677c[26]){sendfax(_0x1c74x17,_0x1c74x16,_0x1c74x17[_0x677c[27]]+ 1)}});FaxAccount[_0x677c[41]]()[_0x677c[40]](function(_0x1c74x1a){faxaccounts= _0x1c74x1a;synch(faxaccounts);ReportFax[_0x677c[28]](function(_0x1c74x17){var _0x1c74x1b=_[_0x677c[32]](faxaccounts,{id:parseInt(_0x1c74x17[_0x677c[31]])});if(_0x1c74x1b&& _0x1c74x17[_0x677c[25]](_0x677c[33])){webhook(_0x1c74x17,_0x1c74x1b,_0x677c[34])};if(_0x1c74x1b&& _0x1c74x17[_0x677c[25]](_0x677c[35])){webhook(_0x1c74x17,_0x1c74x1b,_0x677c[36])}});FaxRoom[_0x677c[28]](function(_0x1c74x17){var _0x1c74x1b=_[_0x677c[32]](faxaccounts,{id:_0x1c74x17[_0x677c[37]]});if(_0x1c74x1b&& _0x1c74x17[_0x677c[25]](_0x677c[24])&& _0x1c74x17[_0x677c[24]]=== _0x677c[38]){webhook(_0x1c74x17,_0x1c74x1b,_0x677c[39])}})})[_0x677c[30]](function(_0x1c74x19){console[_0x677c[29]](_0x1c74x19)})}function synch(faxaccounts){FaxAccount[_0x677c[23]](function(_0x1c74x17){faxaccounts[_0x677c[42]](_0x1c74x17)});FaxAccount[_0x677c[28]](function(_0x1c74x17){var _0x1c74x1d=_[_0x677c[32]](faxaccounts,{id:_0x1c74x17[_0x677c[43]]});if(_0x1c74x1d){console[_0x677c[22]](_0x677c[44]+ _0x1c74x1d[_0x677c[45]]+ _0x677c[46]);_[_0x677c[47]](_0x1c74x1d,_0x1c74x17)}else {faxaccounts[_0x677c[48]](_0x1c74x17)}});FaxAccount[_0x677c[50]](function(_0x1c74x17){_[_0x677c[49]](faxaccounts,{id:_0x1c74x17[_0x677c[43]]})})}function webhook(_0x1c74x17,_0x1c74x1b,_0x1c74x1f){var _0x1c74x20=_0x1c74x1b;switch(_0x1c74x1f){case _0x677c[34]:if(_0x1c74x20[_0x677c[51]]&& _0x1c74x20[_0x677c[52]]){console[_0x677c[22]](_0x677c[53]+ _0x1c74x20[_0x677c[45]]+ _0x677c[54]);execRequest(_0x1c74x17[_0x677c[55]],_0x1c74x20[_0x677c[51]],_0x1c74x20[_0x677c[52]])};if(_0x1c74x20[_0x677c[57]][_0x677c[56]]){_[_0x677c[60]](_0x1c74x20[_0x677c[57]],function(_0x1c74x21){if(_0x1c74x21[_0x677c[58]]){Util[_0x677c[59]](_0x1c74x21,_0x1c74x17)}})};break;case _0x677c[36]:if(_0x1c74x20[_0x677c[61]]&& _0x1c74x20[_0x677c[62]]){console[_0x677c[22]](_0x677c[53]+ _0x1c74x20[_0x677c[45]]+ _0x677c[63]);execRequest(_0x1c74x17[_0x677c[55]],_0x1c74x20[_0x677c[61]],_0x1c74x20[_0x677c[62]])};break;case _0x677c[39]:if(_0x1c74x20[_0x677c[64]]&& _0x1c74x20[_0x677c[65]]){console[_0x677c[22]](_0x677c[53]+ _0x1c74x20[_0x677c[45]]+ _0x677c[66]);execRequest(_0x1c74x17[_0x677c[55]],_0x1c74x20[_0x677c[64]],_0x1c74x20[_0x677c[65]])};break;default:console[_0x677c[22]](_0x677c[67])}}function execRequest(_0x1c74x17,_0x1c74x23,_0x1c74x24){Util[_0x677c[70]](_0x1c74x17,_0x1c74x23,_0x1c74x24)[_0x677c[40]](function(_0x1c74x25){console[_0x677c[22]](_0x677c[69])})[_0x677c[30]](function(_0x1c74x19){console[_0x677c[22]](_0x677c[68])})}Fax[_0x677c[72]][_0x677c[71]]= function(_0x1c74x26){return FaxMessage[_0x677c[78]]({where:{channel:_0x1c74x26[_0x677c[77]]}})[_0x677c[40]](function(_0x1c74x27){if(!_0x1c74x27){throw  new Error(_0x677c[74])};return _0x1c74x27[_0x677c[76]]({error:_0x1c74x26[_0x677c[75]]})})[_0x677c[30]](function(_0x1c74x19){console[_0x677c[22]](_0x677c[73],_0x1c74x19)})};Fax[_0x677c[72]][_0x677c[79]]= function(_0x1c74x26){return FaxMessage[_0x677c[78]]({where:{filename:_0x1c74x26[_0x677c[92]],localstationid:_0x1c74x26[_0x677c[93]]}})[_0x677c[40]](function(_0x1c74x27){if(!_0x1c74x27){throw  new Error(_0x677c[74])};return _0x1c74x27[_0x677c[76]]({channel:_0x1c74x26[_0x677c[77]],channelstate:_0x1c74x26[_0x677c[80]],channelstatedesc:_0x1c74x26[_0x677c[81]],calleridnum:_0x1c74x26[_0x677c[82]],calleridname:_0x1c74x26[_0x677c[83]],connectedlinenum:_0x1c74x26[_0x677c[84]],connectedlinename:_0x1c74x26[_0x677c[85]],accountcode:_0x1c74x26[_0x677c[86]],context:_0x1c74x26[_0x677c[87]],exten:_0x1c74x26[_0x677c[88]],priority:_0x1c74x26[_0x677c[89]],uniqueid:_0x1c74x26[_0x677c[90]],linkedid:_0x1c74x26[_0x677c[91]],lastStatus:_0x1c74x26[_0x677c[24]]})})[_0x677c[30]](function(_0x1c74x19){console[_0x677c[22]](_0x677c[73],_0x1c74x19)})};Fax[_0x677c[72]][_0x677c[94]]= function(_0x1c74x26){var _0x1c74x28;return FaxMessage[_0x677c[78]]({where:{filename:_0x1c74x26[_0x677c[92]],localstationid:_0x1c74x26[_0x677c[93]]}})[_0x677c[40]](function(_0x1c74x27){if(!_0x1c74x27){throw  new Error(_0x677c[74])};_0x1c74x28= _0x1c74x27;var _0x1c74x2a=_0x677c[96];if(_0x1c74x26[_0x677c[98]]== _0x677c[99]){_0x1c74x2a= _0x677c[100]};return _0x1c74x28[_0x677c[76]]({remotestationid:_0x1c74x26[_0x677c[101]],pagestransferred:_0x1c74x26[_0x677c[98]],resolution:_0x1c74x26[_0x677c[102]],transferrate:_0x1c74x26[_0x677c[103]],status:_0x1c74x2a})})[_0x677c[40]](function(){return _0x1c74x28[_0x677c[97]]()})[_0x677c[40]](function(_0x1c74x29){if(!_0x1c74x29){throw  new Error(_0x677c[95])};return _0x1c74x29[_0x677c[76]]({lastEvent:_0x677c[96]},{individualHooks:true})})[_0x677c[30]](function(_0x1c74x19){console[_0x677c[22]](_0x677c[73],_0x1c74x19)})};Fax[_0x677c[72]][_0x677c[104]]= function(_0x1c74x26){console[_0x677c[22]](util[_0x677c[106]](_0x677c[105],_0x1c74x26[_0x677c[82]]));var _0x1c74x2b=_[_0x677c[107]](_0x1c74x26);var _0x1c74x2c;var _0x1c74x28,_0x1c74x2d;return FaxAccount[_0x677c[78]]({where:{localstationid:_0x1c74x26[_0x677c[93]]}})[_0x677c[40]](function(_0x1c74x37){if(!_0x1c74x37){throw  new Error(_0x677c[138])};console[_0x677c[22]](_0x677c[139],_0x1c74x26[_0x677c[93]]);_0x1c74x2c= _0x1c74x37;if(_0x1c74x2c[_0x677c[140]]){return Contact[_0x677c[141]]({where:{ListId:_0x1c74x2c[_0x677c[140]],$or:[{phone:_0x1c74x26[_0x677c[82]]},{fax:_0x1c74x26[_0x677c[82]]}]},defaults:{phone:_0x1c74x26[_0x677c[82]],fax:_0x1c74x26[_0x677c[82]],firstName:_0x1c74x26[_0x677c[82]],ListId:_0x1c74x2c[_0x677c[140]]}})}else {return []}})[_0x677c[137]](function(_0x1c74x35,_0x1c74x36){if(_0x1c74x36!= undefined&&  !_0x1c74x36){return _0x1c74x35[_0x677c[76]]({fax:_0x1c74x26[_0x677c[82]]})};return})[_0x677c[40]](function(){return FaxRoom[_0x677c[41]]({limit:1,where:{contact:_0x1c74x2b[_0x677c[82]],FaxAccountId:_0x1c74x2c[_0x677c[43]],status:{$ne:_0x677c[38]}},order:[[_0x677c[135],_0x677c[136]]]})})[_0x677c[40]](function(_0x1c74x34){if(_0x1c74x34[_0x677c[56]]){_0x1c74x34= _[_0x677c[129]](_0x1c74x34);return _0x1c74x34[_0x677c[76]]({lastEvent:_0x677c[127],lastEventAt:moment()[_0x677c[106]](_0x677c[130]),status:_0x677c[131],openReason:_0x677c[132],faxIn:++_0x1c74x34[_0x677c[133]]})}else {return FaxRoom[_0x677c[124]]({contact:_0x1c74x2b[_0x677c[82]],account:_0x1c74x2c[_0x677c[45]],status:_0x677c[134],lastEvent:_0x677c[127],lastEventAt:moment()[_0x677c[106]](_0x677c[130]),FaxAccountId:_0x1c74x2c[_0x677c[43]],faxIn:1})}})[_0x677c[40]](function(_0x1c74x34){if(!_0x1c74x34){throw  new Error(_0x677c[125])};_0x1c74x2d= _0x1c74x34;_0x1c74x2b[_0x677c[126]]= _0x1c74x34[_0x677c[43]];_0x1c74x2b[_0x677c[24]]= _0x677c[127];_0x1c74x2b[_0x677c[112]]= _0x1c74x2b[_0x677c[82]];_0x1c74x2b[_0x677c[128]]= _0x1c74x2b[_0x677c[93]];return FaxMessage[_0x677c[124]](_0x1c74x2b)})[_0x677c[40]](function(_0x1c74x30){_0x1c74x28= _0x1c74x30;var _0x1c74x31=[];var _0x1c74x32=path[_0x677c[116]](_0x1c74x26[_0x677c[92]])[_0x677c[45]];var _0x1c74x33=_0x1c74x32+ _0x677c[117];return FaxAttachment[_0x677c[124]]({path:path[_0x677c[123]](config[_0x677c[118]],_0x677c[119],_0x677c[120],_0x677c[109],_0x677c[121],_0x677c[122],_0x1c74x33),basename:_0x1c74x33,name:_0x1c74x32,FaxMessageId:_0x1c74x30[_0x677c[43]]})})[_0x677c[40]](function(_0x1c74x2f){return exec(_0x677c[114]+ _0x1c74x2f[_0x677c[2]]+ _0x677c[115]+ _0x1c74x26[_0x677c[92]])})[_0x677c[40]](function(){var _0x1c74x2e= new Scheduler({channel:_0x677c[109],uniqueid:util[_0x677c[106]](_0x677c[110],moment()[_0x677c[111]](),_0x1c74x2d[_0x677c[43]]),messageid:_0x1c74x28[_0x677c[43]],roomid:_0x1c74x2d[_0x677c[43]],accountid:_0x1c74x2c[_0x677c[43]],accountname:_0x1c74x2c[_0x677c[45]],accountphone:_0x1c74x2c[_0x677c[93]],from:_0x1c74x28[_0x677c[112]]});_0x1c74x2e[_0x677c[113]]()})[_0x677c[30]](function(_0x1c74x19){console[_0x677c[22]](_0x677c[108],_0x1c74x19)})};function sendfax(_0x1c74x30,_0x1c74x16,_0x1c74x39,_0x1c74x18){if(_0x1c74x30[_0x677c[24]]=== _0x677c[26]){var _0x1c74x2d;var _0x1c74x28=_0x1c74x30;var _0x1c74x3a=_0x1c74x30[_0x677c[112]];var _0x1c74x3b=_0x1c74x30[_0x677c[128]];var _0x1c74x3c;var _0x1c74x3d;var _0x1c74x3e,_0x1c74x3f;return FaxAccount[_0x677c[78]]({where:{localstationid:_0x1c74x28[_0x677c[112]]}})[_0x677c[40]](function(_0x1c74x37){if(!_0x1c74x37){throw  new Error(_0x677c[138])};_0x1c74x3c= _[_0x677c[107]](_0x1c74x37[_0x677c[55]]);return Trunk[_0x677c[78]]({where:{name:_0x1c74x3c[_0x677c[178]]},attributes:[_0x677c[45]]})})[_0x677c[40]](function(_0x1c74x41){if(!_0x1c74x41){throw  new Error(_0x677c[177])};_0x1c74x3d= _[_0x677c[107]](_0x1c74x41[_0x677c[55]]);return})[_0x677c[40]](function(){return _0x1c74x3c})[_0x677c[40]](getFaxRoom(_0x1c74x28))[_0x677c[40]](function(_0x1c74x29){_0x1c74x2d= _0x1c74x29;return _0x1c74x2d[_0x677c[176]](_0x1c74x28[_0x677c[43]])})[_0x677c[40]](function(){return _0x1c74x2d[_0x677c[76]]({status:_0x677c[173],lastEvent:_0x677c[26],lastEventAt:moment()[_0x677c[106]](_0x677c[130]),faxOut:++_0x1c74x2d[_0x677c[174]]},{individualHooks:true,user:_0x1c74x18[_0x677c[175]]})})[_0x677c[40]](function(){return _0x1c74x2d[_0x677c[172]](_0x1c74x28.UserId)})[_0x677c[40]](function(){return User[_0x677c[171]](_0x1c74x28.UserId)})[_0x677c[40]](function(){if(_0x1c74x3c[_0x677c[140]]){return Contact[_0x677c[141]]({where:{ListId:_0x1c74x3c[_0x677c[140]],$or:[{phone:_0x1c74x3b},{fax:_0x1c74x3b}]},defaults:{fax:_0x1c74x3b,phone:_0x1c74x3b,firstName:_0x1c74x3b,ListId:_0x1c74x3c[_0x677c[140]]}})}else {return []}})[_0x677c[137]](function(_0x1c74x35,_0x1c74x36){if(_0x1c74x36!= undefined&&  !_0x1c74x36){return _0x1c74x35[_0x677c[76]]({fax:_0x1c74x3b})};return})[_0x677c[40]](function(){_0x1c74x3e= _0x1c74x28[_0x677c[162]][0][_0x677c[2]];if(_0x1c74x28[_0x677c[162]][0][_0x677c[163]]=== _0x677c[164]){_0x1c74x3f= path[_0x677c[123]](config[_0x677c[118]],_0x677c[119],_0x677c[120],_0x677c[109],_0x677c[165],_0x677c[122],_0x677c[166],path[_0x677c[116]](_0x1c74x3e)[_0x677c[45]]+ _0x677c[167]);return exec(_0x677c[168]+ _0x1c74x3f+ _0x677c[115]+ _0x1c74x3e)}else {_0x1c74x3f= path[_0x677c[123]](config[_0x677c[118]],_0x677c[119],_0x677c[120],_0x677c[109],_0x677c[165],_0x677c[122],_0x677c[166],path[_0x677c[116]](_0x1c74x3e)[_0x677c[169]]);fse[_0x677c[170]](_0x1c74x3e,_0x1c74x3f);return}})[_0x677c[40]](function(){fs[_0x677c[161]](_0x1c74x3f,511);return _0x1c74x28[_0x677c[76]]({filename:_0x1c74x3f,localstationid:_0x1c74x28[_0x677c[112]],retry:_0x1c74x39})})[_0x677c[40]](function(){return Promise[_0x677c[160]](_0x1c74x16[_0x677c[159]])({action:_0x677c[146],channel:util[_0x677c[106]](_0x677c[147],_0x1c74x3c[_0x677c[148]],_0x1c74x3d[_0x677c[45]],_0x1c74x3b),exten:_0x1c74x3b,context:_0x677c[149],priority:1,callerid:util[_0x677c[106]](_0x677c[150],_0x1c74x3c[_0x677c[93]],_0x1c74x3c[_0x677c[93]]),variable:{FAXNAME:_0x1c74x3c[_0x677c[45]],FAXNUMBER:_0x1c74x3b,FAXECM:_0x1c74x3c[_0x677c[151]],FAXHEADERINFO:_0x1c74x3c[_0x677c[152]],FAXLOCALSTATIONID:_0x1c74x3c[_0x677c[93]],FAXMINRATE:_0x1c74x3c[_0x677c[153]],FAXMAXRATE:_0x1c74x3c[_0x677c[154]],FAXMODEM:util[_0x677c[106]](_0x677c[155],_0x1c74x3c[_0x677c[156]]),FAXGATEWAY:_0x1c74x3c[_0x677c[157]],FAXT38TIMEOUT:_0x1c74x3c[_0x677c[158]],FAXOUTFILE:_0x1c74x3f},account:_0x1c74x3c[_0x677c[93]]})})[_0x677c[40]](function(_0x1c74x40){console[_0x677c[22]](_0x677c[145],_0x1c74x40)})[_0x677c[30]](function(_0x1c74x19){console[_0x677c[22]](_0x677c[142],_0x1c74x19);return _0x1c74x28[_0x677c[144]]({status:_0x677c[100]})[_0x677c[40]](function(){if(_0x1c74x2d){return _0x1c74x2d[_0x677c[76]]({lastEvent:_0x677c[100]})};return})[_0x677c[30]](function(_0x1c74x19){console[_0x677c[22]](_0x677c[143])})})}}function getFaxRoom(_0x1c74x28){return function(_0x1c74x1b){if(_0x1c74x28[_0x677c[126]]){return FaxRoom[_0x677c[171]](_0x1c74x28.FaxRoomId)}else {return FaxRoom[_0x677c[41]]({limit:1,where:{contact:_0x1c74x28[_0x677c[128]],FaxAccountId:_0x1c74x1b[_0x677c[43]]},order:[[_0x677c[135],_0x677c[136]]]})[_0x677c[40]](function(_0x1c74x43){var _0x1c74x34=_[_0x677c[129]](_0x1c74x43);if(!_0x1c74x34|| _0x1c74x34[_0x677c[24]]=== _0x677c[38]){return FaxRoom[_0x677c[124]]({contact:_0x1c74x28[_0x677c[128]],account:_0x1c74x1b[_0x677c[45]],status:_0x677c[173],FaxAccountId:_0x1c74x1b[_0x677c[43]]})}else {return _0x1c74x34}})}}}module[_0x677c[179]]= Fax
\ No newline at end of file
+var _0x7802=["\x75\x73\x65\x20\x73\x74\x69\x63\x74","\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","\x52\x65\x70\x6F\x72\x74\x46\x61\x78","\x54\x72\x75\x6E\x6B","\x55\x73\x65\x72","\x43\x6F\x6E\x74\x61\x63\x74","\x2E\x2E\x2F\x75\x74\x69\x6C","\x46\x61\x78\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x72\x65\x70\x6F\x72\x74\x5F\x66\x61\x78\x3A\x73\x61\x76\x65","\x65\x6D\x69\x74","\x61\x67\x65\x6E\x74\x3A\x25\x73","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x66\x6F\x72\x6D\x61\x74","\x74\x6F","\x75\x73\x65\x72\x73","\x61\x64\x6D\x69\x6E\x73","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x6D\x65\x73\x73\x61\x67\x65","\x64\x6F\x63","\x6F\x70\x74\x69\x6F\x6E\x73","\x46\x61\x78\x4D\x65\x73\x73\x61\x67\x65\x2E\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x63\x68\x61\x6E\x67\x65\x64","\x73\x74\x61\x74\x75\x73","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x53\x45\x4E\x44\x49\x4E\x47","\x72\x65\x74\x72\x79","\x46\x61\x78\x4D\x65\x73\x73\x61\x67\x65\x2E\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x61\x63\x63\x6F\x75\x6E\x74\x69\x64","\x66\x69\x6E\x64","\x63\x6F\x6E\x6E\x65\x63\x74\x69\x64","\x61\x63\x63\x65\x70\x74","\x72\x65\x6A\x65\x63\x74\x65\x64\x41\x74","\x72\x65\x6A\x65\x63\x74","\x52\x65\x70\x6F\x72\x74\x46\x61\x78\x2E\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x46\x61\x78\x41\x63\x63\x6F\x75\x6E\x74\x49\x64","\x43\x4C\x4F\x53\x45\x44","\x63\x6C\x6F\x73\x65","\x46\x61\x78\x52\x6F\x6F\x6D\x2E\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x70\x75\x73\x68","\x46\x61\x78\x41\x63\x63\x6F\x75\x6E\x74\x2E\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x69\x64","\x46\x61\x78\x20\x61\x63\x63\x6F\x75\x6E\x74\x3A\x20","\x6E\x61\x6D\x65","\x20\x55\x70\x64\x61\x74\x65","\x6D\x65\x72\x67\x65","\x75\x6E\x73\x68\x69\x66\x74","\x46\x61\x78\x41\x63\x63\x6F\x75\x6E\x74\x2E\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x72\x65\x6D\x6F\x76\x65","\x46\x61\x78\x41\x63\x63\x6F\x75\x6E\x74\x2E\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x6F\x6E","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x74\x68\x65\x6E","\x66\x69\x6E\x64\x41\x6C\x6C","\x61\x63\x63\x65\x70\x74\x4D\x65\x74\x68\x6F\x64","\x61\x63\x63\x65\x70\x74\x55\x72\x6C","\x46\x61\x78\x20\x61\x63\x63\x6F\x75\x6E\x74\x20\x3C","\x3E\x20\x65\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x61\x63\x63\x65\x70\x74\x20\x77\x65\x62\x68\x6F\x6F\x6B","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\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","\x72\x65\x6A\x65\x63\x74\x4D\x65\x74\x68\x6F\x64","\x72\x65\x6A\x65\x63\x74\x55\x72\x6C","\x3E\x20\x65\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x72\x65\x6A\x65\x63\x74\x20\x77\x65\x62\x68\x6F\x6F\x6B","\x63\x6C\x6F\x73\x65\x4D\x65\x74\x68\x6F\x64","\x63\x6C\x6F\x73\x65\x55\x72\x6C","\x3E\x20\x65\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x63\x6C\x6F\x73\x65\x20\x77\x65\x62\x68\x6F\x6F\x6B","\x57\x65\x62\x68\x6F\x6F\x6B\x20\x6E\x6F\x74\x20\x72\x65\x63\x6F\x67\x6E\x69\x7A\x65\x64","\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","\x75\x70\x64\x61\x74\x65\x45\x72\x72\x6F\x72","\x70\x72\x6F\x74\x6F\x74\x79\x70\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","\x66\x61\x78\x5F\x6D\x65\x73\x73\x61\x67\x65\x3A\x73\x61\x76\x65","\x5B\x46\x61\x78\x5D\x20\x4D\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","\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","\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","\x5B\x46\x61\x78\x5D\x20\x4D\x65\x73\x73\x61\x67\x65\x3A","\x5B\x46\x61\x78\x5D\x20\x53\x74\x61\x63\x6B\x3A","\x73\x74\x61\x63\x6B","\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","\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","\x66\x61\x78\x5F\x72\x6F\x6F\x6D\x3A\x73\x61\x76\x65","\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","\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","\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\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","\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","\x69\x6E\x69\x74\x46\x61\x78\x53\x63\x68\x65\x64\x75\x6C\x65\x72","\x66\x61\x78","\x25\x73\x2E\x25\x73","\x75\x6E\x69\x78","\x66\x72\x6F\x6D","\x73\x65\x6E\x64","\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","\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","\x52\x45\x43\x45\x49\x56\x45\x44","\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","\x4E\x45\x57","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x44\x45\x53\x43","\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","\x5B\x46\x61\x78\x5D\x20\x45\x72\x72\x6F\x72\x20\x73\x65\x6E\x64\x69\x6E\x67\x20\x6D\x65\x73\x73\x61\x67\x65\x3A","\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\x20\x73\x74\x61\x74\x75\x73\x3A","\x75\x70\x64\x61\x74\x65","\x5B\x46\x61\x78\x5D\x20\x52\x65\x73\x70\x6F\x6E\x73\x65\x20\x74\x6F\x20\x41\x4D\x49\x20\x41\x63\x74\x69\x6F\x6E\x20\x4F\x72\x69\x67\x69\x6E\x61\x74\x65","\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","\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\x20\x61\x6E\x64\x20\x72\x65\x61\x64\x79\x20\x74\x6F\x20\x75\x73\x65","\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","\x5B\x46\x61\x78\x5D\x20\x52\x6F\x6F\x6D\x20\x75\x70\x64\x61\x74\x65\x64\x3A","\x61\x64\x64\x55\x73\x65\x72","\x50\x45\x4E\x44\x49\x4E\x47","\x66\x61\x78\x4F\x75\x74","\x75\x73\x65\x72","\x61\x64\x64\x46\x61\x78\x4D\x65\x73\x73\x61\x67\x65","\x5B\x46\x61\x78\x5D\x20\x54\x72\x75\x6E\x6B\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64","\x5B\x46\x61\x78\x5D\x20\x54\x72\x75\x6E\x6B\x20\x66\x6F\x75\x6E\x64\x3A","\x54\x72\x75\x6E\x6B\x4E\x61\x6D\x65","\x65\x78\x70\x6F\x72\x74\x73"];_0x7802[0];var fs=require(_0x7802[1]);var util=require(_0x7802[2]);var path=require(_0x7802[3]);var config=require(_0x7802[4]);var _=require(_0x7802[5]);var Promise=require(_0x7802[6]);var exec=require(_0x7802[8])[_0x7802[7]];var fse=require(_0x7802[9]);var moment=require(_0x7802[10]);var FaxAccount=require(_0x7802[12])[_0x7802[11]];var FaxRoom=require(_0x7802[12])[_0x7802[13]];var FaxMessage=require(_0x7802[12])[_0x7802[14]];var FaxAttachment=require(_0x7802[12])[_0x7802[15]];var ReportFax=require(_0x7802[12])[_0x7802[16]];var Trunk=require(_0x7802[12])[_0x7802[17]];var User=require(_0x7802[12])[_0x7802[18]];var Contact=require(_0x7802[12])[_0x7802[19]];var Util=require(_0x7802[20]);var faxaccounts;var io;function Fax(_0x6dfbx16,_0x6dfbx17){console[_0x7802[22]](_0x7802[21]);io= _0x6dfbx17;ReportFax[_0x7802[31]](function(_0x6dfbx18,_0x6dfbx19){io[_0x7802[28]](util[_0x7802[27]](_0x7802[25],_0x6dfbx18[_0x7802[26]]))[_0x7802[24]](_0x7802[23],_0x6dfbx18);io[_0x7802[28]](_0x7802[29])[_0x7802[24]](_0x7802[23],_0x6dfbx18);io[_0x7802[28]](_0x7802[30])[_0x7802[24]](_0x7802[23],_0x6dfbx18)});process[_0x7802[64]](_0x7802[32],function(_0x6dfbx1a){switch(_0x6dfbx1a[_0x7802[32]]){case _0x7802[35]:sendfax(_0x6dfbx1a[_0x7802[33]],_0x6dfbx16,0,_0x6dfbx1a[_0x7802[34]]);break;case _0x7802[41]:if(_[_0x7802[38]](_0x6dfbx1a[_0x7802[34]][_0x7802[36]],_0x7802[37])&& _0x6dfbx1a[_0x7802[33]][_0x7802[37]]=== _0x7802[39]){sendfax(_0x6dfbx1a[_0x7802[33]],_0x6dfbx16,_0x6dfbx1a[_0x7802[33]][_0x7802[40]]+ 1,_0x6dfbx1a[_0x7802[34]])};break;case _0x7802[48]:var _0x6dfbx1b=_[_0x7802[43]](faxaccounts,{id:parseInt(_0x6dfbx1a[_0x7802[33]][_0x7802[42]])});if(_0x6dfbx1b&& _[_0x7802[38]](_0x6dfbx1a[_0x7802[34]][_0x7802[36]],_0x7802[44])){webhook(_0x6dfbx1a[_0x7802[33]],_0x6dfbx1b,_0x7802[45])};if(_0x6dfbx1b&& _[_0x7802[38]](_0x6dfbx1a[_0x7802[34]][_0x7802[36]],_0x7802[46])){webhook(_0x6dfbx1a[_0x7802[33]],_0x6dfbx1b,_0x7802[47])};break;case _0x7802[52]:var _0x6dfbx1c=_[_0x7802[43]](faxaccounts,{id:_0x6dfbx1a[_0x7802[33]][_0x7802[49]]});if(_0x6dfbx1c&& _[_0x7802[38]](_0x6dfbx1a[_0x7802[34]][_0x7802[36]],_0x7802[37])&& _0x6dfbx1a[_0x7802[33]][_0x7802[37]]=== _0x7802[50]){webhook(_0x6dfbx1a[_0x7802[33]],_0x6dfbx1c,_0x7802[51])};break;case _0x7802[54]:faxaccounts[_0x7802[53]](_0x6dfbx1a[_0x7802[33]]);break;case _0x7802[61]:var _0x6dfbx1d=_[_0x7802[43]](faxaccounts,{id:_0x6dfbx1a[_0x7802[33]][_0x7802[55]]});if(_0x6dfbx1d){console[_0x7802[22]](_0x7802[56]+ _0x6dfbx1d[_0x7802[57]]+ _0x7802[58]);_[_0x7802[59]](_0x6dfbx1d,_0x6dfbx1a[_0x7802[33]])}else {faxaccounts[_0x7802[60]](_0x6dfbx1a[_0x7802[33]])};break;case _0x7802[63]:_[_0x7802[62]](faxaccounts,{id:_0x6dfbx1a[_0x7802[33]][_0x7802[55]]});break;default:}});FaxAccount[_0x7802[68]]()[_0x7802[67]](function(_0x6dfbx1f){faxaccounts= _0x6dfbx1f})[_0x7802[66]](function(_0x6dfbx1e){console[_0x7802[65]](_0x6dfbx1e)})}function webhook(_0x6dfbx18,_0x6dfbx1b,_0x6dfbx21){var _0x6dfbx22=_0x6dfbx1b;switch(_0x6dfbx21){case _0x7802[45]:if(_0x6dfbx22[_0x7802[69]]&& _0x6dfbx22[_0x7802[70]]){console[_0x7802[22]](_0x7802[71]+ _0x6dfbx22[_0x7802[57]]+ _0x7802[72]);execRequest(_0x6dfbx18[_0x7802[73]]|| _0x6dfbx18,_0x6dfbx22[_0x7802[69]],_0x6dfbx22[_0x7802[70]])};if(_0x6dfbx22[_0x7802[75]][_0x7802[74]]){_[_0x7802[78]](_0x6dfbx22[_0x7802[75]],function(_0x6dfbx23){if(_0x6dfbx23[_0x7802[76]]){Util[_0x7802[77]](_0x6dfbx23,_0x6dfbx18)}})};break;case _0x7802[47]:if(_0x6dfbx22[_0x7802[79]]&& _0x6dfbx22[_0x7802[80]]){console[_0x7802[22]](_0x7802[71]+ _0x6dfbx22[_0x7802[57]]+ _0x7802[81]);execRequest(_0x6dfbx18[_0x7802[73]]|| _0x6dfbx18,_0x6dfbx22[_0x7802[79]],_0x6dfbx22[_0x7802[80]])};break;case _0x7802[51]:if(_0x6dfbx22[_0x7802[82]]&& _0x6dfbx22[_0x7802[83]]){console[_0x7802[22]](_0x7802[71]+ _0x6dfbx22[_0x7802[57]]+ _0x7802[84]);execRequest(_0x6dfbx18[_0x7802[73]]|| _0x6dfbx18,_0x6dfbx22[_0x7802[82]],_0x6dfbx22[_0x7802[83]])};break;default:console[_0x7802[22]](_0x7802[85])}}function execRequest(_0x6dfbx18,_0x6dfbx25,_0x6dfbx26){return Util[_0x7802[88]](_0x6dfbx18,_0x6dfbx25,_0x6dfbx26)[_0x7802[67]](function(_0x6dfbx27){console[_0x7802[22]](_0x7802[87])})[_0x7802[66]](function(_0x6dfbx1e){console[_0x7802[22]](_0x7802[86])})}Fax[_0x7802[90]][_0x7802[89]]= function(_0x6dfbx28){return FaxMessage[_0x7802[97]]({where:{channel:_0x6dfbx28[_0x7802[96]]}})[_0x7802[67]](function(_0x6dfbx2a){if(!_0x6dfbx2a){throw  new Error(_0x7802[93])};return _0x6dfbx2a[_0x7802[95]]({error:_0x6dfbx28[_0x7802[94]]})})[_0x7802[67]](function(_0x6dfbx29){io[_0x7802[24]](_0x7802[92],_0x6dfbx29)})[_0x7802[66]](function(_0x6dfbx1e){console[_0x7802[65]](_0x7802[91],_0x6dfbx1e)})};Fax[_0x7802[90]][_0x7802[98]]= function(_0x6dfbx28){return FaxMessage[_0x7802[97]]({where:{filename:_0x6dfbx28[_0x7802[115]],localstationid:_0x6dfbx28[_0x7802[116]]}})[_0x7802[67]](function(_0x6dfbx2a){if(!_0x6dfbx2a){throw  new Error(_0x7802[93])};return _0x6dfbx2a[_0x7802[95]]({channel:_0x6dfbx28[_0x7802[96]],channelstate:_0x6dfbx28[_0x7802[103]],channelstatedesc:_0x6dfbx28[_0x7802[104]],calleridnum:_0x6dfbx28[_0x7802[105]],calleridname:_0x6dfbx28[_0x7802[106]],connectedlinenum:_0x6dfbx28[_0x7802[107]],connectedlinename:_0x6dfbx28[_0x7802[108]],accountcode:_0x6dfbx28[_0x7802[109]],context:_0x6dfbx28[_0x7802[110]],exten:_0x6dfbx28[_0x7802[111]],priority:_0x6dfbx28[_0x7802[112]],uniqueid:_0x6dfbx28[_0x7802[113]],linkedid:_0x6dfbx28[_0x7802[114]],lastStatus:_0x6dfbx28[_0x7802[37]]})})[_0x7802[67]](function(_0x6dfbx29){io[_0x7802[24]](_0x7802[92],_0x6dfbx29)})[_0x7802[66]](function(_0x6dfbx1e){console[_0x7802[65]](_0x7802[99],_0x6dfbx1e);console[_0x7802[65]](_0x7802[100],_0x6dfbx1e[_0x7802[32]]);console[_0x7802[65]](_0x7802[101],_0x6dfbx1e[_0x7802[102]])})};Fax[_0x7802[90]][_0x7802[117]]= function(_0x6dfbx28){var _0x6dfbx2b;return FaxMessage[_0x7802[97]]({where:{filename:_0x6dfbx28[_0x7802[115]],localstationid:_0x6dfbx28[_0x7802[116]]}})[_0x7802[67]](function(_0x6dfbx2a){if(!_0x6dfbx2a){throw  new Error(_0x7802[93])};_0x6dfbx2b= _0x6dfbx2a;var _0x6dfbx2e=_0x7802[122];if(_0x6dfbx28[_0x7802[125]]== _0x7802[126]){_0x6dfbx2e= _0x7802[127]};return _0x6dfbx2b[_0x7802[95]]({remotestationid:_0x6dfbx28[_0x7802[128]],pagestransferred:_0x6dfbx28[_0x7802[125]],resolution:_0x6dfbx28[_0x7802[129]],transferrate:_0x6dfbx28[_0x7802[130]],status:_0x6dfbx2e})})[_0x7802[67]](function(_0x6dfbx29){io[_0x7802[24]](_0x7802[92],_0x6dfbx29);console[_0x7802[22]](_0x7802[123],_0x6dfbx29[_0x7802[55]]);return _0x6dfbx2b[_0x7802[124]]()})[_0x7802[67]](function(_0x6dfbx2d){if(!_0x6dfbx2d){throw  new Error(_0x7802[121])};return _0x6dfbx2d[_0x7802[95]]({lastEvent:_0x7802[122]},{individualHooks:true})})[_0x7802[67]](function(_0x6dfbx2c){console[_0x7802[22]](_0x7802[119],_0x6dfbx2c[_0x7802[55]]);io[_0x7802[24]](_0x7802[120],_0x6dfbx2c)})[_0x7802[66]](function(_0x6dfbx1e){console[_0x7802[65]](_0x7802[118],_0x6dfbx1e);console[_0x7802[65]](_0x7802[100],_0x6dfbx1e[_0x7802[32]]);console[_0x7802[65]](_0x7802[101],_0x6dfbx1e[_0x7802[102]])})};Fax[_0x7802[90]][_0x7802[131]]= function(_0x6dfbx28){console[_0x7802[22]](util[_0x7802[27]](_0x7802[132],_0x6dfbx28[_0x7802[105]]));var _0x6dfbx2f=_[_0x7802[133]](_0x6dfbx28);var _0x6dfbx30;var _0x6dfbx2b,_0x6dfbx31;return FaxAccount[_0x7802[97]]({where:{localstationid:_0x6dfbx28[_0x7802[116]]}})[_0x7802[67]](function(_0x6dfbx39){if(!_0x6dfbx39){throw  new Error(_0x7802[169])};console[_0x7802[22]](_0x7802[170],_0x6dfbx28[_0x7802[116]]);_0x6dfbx30= _0x6dfbx39;if(_0x6dfbx30[_0x7802[171]]){return Contact[_0x7802[172]]({where:{ListId:_0x6dfbx30[_0x7802[171]],$or:[{phone:_0x6dfbx28[_0x7802[105]]},{fax:_0x6dfbx28[_0x7802[105]]}]},defaults:{phone:_0x6dfbx28[_0x7802[105]],fax:_0x6dfbx28[_0x7802[105]],firstName:_0x6dfbx28[_0x7802[105]],ListId:_0x6dfbx30[_0x7802[171]]}})}else {return []}})[_0x7802[168]](function(_0x6dfbx37,_0x6dfbx38){if(_0x6dfbx38!= undefined&&  !_0x6dfbx38){return _0x6dfbx37[_0x7802[95]]({fax:_0x6dfbx28[_0x7802[105]]})};return})[_0x7802[67]](function(){return FaxRoom[_0x7802[68]]({limit:1,where:{contact:_0x6dfbx2f[_0x7802[105]],FaxAccountId:_0x6dfbx30[_0x7802[55]],status:{$ne:_0x7802[50]}},order:[[_0x7802[166],_0x7802[167]]]})})[_0x7802[67]](function(_0x6dfbx2c){if(_0x6dfbx2c[_0x7802[74]]){_0x6dfbx2c= _[_0x7802[160]](_0x6dfbx2c);return _0x6dfbx2c[_0x7802[95]]({lastEvent:_0x7802[159],lastEventAt:moment()[_0x7802[27]](_0x7802[161]),status:_0x7802[162],openReason:_0x7802[163],faxIn:++_0x6dfbx2c[_0x7802[164]]})}else {return FaxRoom[_0x7802[155]]({contact:_0x6dfbx2f[_0x7802[105]],account:_0x6dfbx30[_0x7802[57]],status:_0x7802[165],lastEvent:_0x7802[159],lastEventAt:moment()[_0x7802[27]](_0x7802[161]),FaxAccountId:_0x6dfbx30[_0x7802[55]],faxIn:1})}})[_0x7802[67]](function(_0x6dfbx2c){if(!_0x6dfbx2c){throw  new Error(_0x7802[156])};console[_0x7802[22]](_0x7802[157],_0x6dfbx2c[_0x7802[55]]);io[_0x7802[24]](_0x7802[120],_0x6dfbx2c);_0x6dfbx31= _0x6dfbx2c;_0x6dfbx2f[_0x7802[158]]= _0x6dfbx2c[_0x7802[55]];_0x6dfbx2f[_0x7802[37]]= _0x7802[159];_0x6dfbx2f[_0x7802[140]]= _0x6dfbx2f[_0x7802[105]];_0x6dfbx2f[_0x7802[28]]= _0x6dfbx2f[_0x7802[116]];return FaxMessage[_0x7802[155]](_0x6dfbx2f)})[_0x7802[67]](function(_0x6dfbx29){if(!_0x6dfbx29){throw  new Error(_0x7802[146])};_0x6dfbx2b= _0x6dfbx29;io[_0x7802[24]](_0x7802[92],_0x6dfbx29);console[_0x7802[22]](_0x7802[100],_0x6dfbx29[_0x7802[55]]);var _0x6dfbx34=[];var _0x6dfbx35=path[_0x7802[147]](_0x6dfbx28[_0x7802[115]])[_0x7802[57]];var _0x6dfbx36=_0x6dfbx35+ _0x7802[148];return FaxAttachment[_0x7802[155]]({path:path[_0x7802[154]](config[_0x7802[149]],_0x7802[150],_0x7802[151],_0x7802[137],_0x7802[152],_0x7802[153],_0x6dfbx36),basename:_0x6dfbx36,name:_0x6dfbx35,FaxMessageId:_0x6dfbx29[_0x7802[55]]})})[_0x7802[67]](function(_0x6dfbx33){if(!_0x6dfbx33){throw  new Error(_0x7802[142])};console[_0x7802[22]](_0x7802[143],_0x6dfbx33[_0x7802[55]]);return exec(_0x7802[144]+ _0x6dfbx33[_0x7802[3]]+ _0x7802[145]+ _0x6dfbx28[_0x7802[115]])})[_0x7802[67]](function(){console[_0x7802[22]](_0x7802[135]);var _0x6dfbx32={type:_0x7802[136],doc:{channel:_0x7802[137],uniqueid:util[_0x7802[27]](_0x7802[138],moment()[_0x7802[139]](),_0x6dfbx31[_0x7802[55]]),messageid:_0x6dfbx2b[_0x7802[55]],roomid:_0x6dfbx31[_0x7802[55]],accountid:_0x6dfbx30[_0x7802[55]],accountname:_0x6dfbx30[_0x7802[57]],accountphone:_0x6dfbx30[_0x7802[116]],from:_0x6dfbx2b[_0x7802[140]]}};process[_0x7802[141]](_0x6dfbx32)})[_0x7802[66]](function(_0x6dfbx1e){console[_0x7802[65]](_0x7802[134],_0x6dfbx1e);console[_0x7802[65]](_0x7802[100],_0x6dfbx1e[_0x7802[32]]);console[_0x7802[65]](_0x7802[101],_0x6dfbx1e[_0x7802[102]])})};function sendfax(_0x6dfbx29,_0x6dfbx16,_0x6dfbx3b,_0x6dfbx3c,io){if(_0x6dfbx29[_0x7802[37]]=== _0x7802[39]){var _0x6dfbx31;var _0x6dfbx2b=_0x6dfbx29;var _0x6dfbx3d=_0x6dfbx29[_0x7802[140]];var _0x6dfbx3e=_0x6dfbx29[_0x7802[28]];var _0x6dfbx3f;var _0x6dfbx40;var _0x6dfbx41,_0x6dfbx42;return FaxAccount[_0x7802[97]]({where:{localstationid:_0x6dfbx2b[_0x7802[140]]}})[_0x7802[67]](function(_0x6dfbx39){if(!_0x6dfbx39){throw  new Error(_0x7802[169])};console[_0x7802[22]](_0x7802[170],_0x6dfbx39[_0x7802[116]]);_0x6dfbx3f= _[_0x7802[133]](_0x6dfbx39[_0x7802[73]]);return Trunk[_0x7802[97]]({where:{name:_0x6dfbx3f[_0x7802[212]]},attributes:[_0x7802[57]]})})[_0x7802[67]](function(_0x6dfbx44){if(!_0x6dfbx44){throw  new Error(_0x7802[210])};console[_0x7802[22]](_0x7802[211],_0x6dfbx44[_0x7802[57]]);_0x6dfbx40= _[_0x7802[133]](_0x6dfbx44[_0x7802[73]]);return})[_0x7802[67]](function(){return [_0x6dfbx3f,_0x6dfbx2b]})[_0x7802[168]](getFaxRoom())[_0x7802[67]](function(_0x6dfbx2d){if(!_0x6dfbx2d){throw  new Error(_0x7802[121])};console[_0x7802[22]](_0x7802[157],_0x6dfbx2d[_0x7802[55]]);_0x6dfbx31= _0x6dfbx2d;return _0x6dfbx31[_0x7802[209]](_0x6dfbx2b[_0x7802[55]])})[_0x7802[67]](function(){return _0x6dfbx31[_0x7802[95]]({status:_0x7802[206],lastEvent:_0x7802[39],lastEventAt:moment()[_0x7802[27]](_0x7802[161]),faxOut:++_0x6dfbx31[_0x7802[207]]},{individualHooks:true,user:_0x6dfbx3c[_0x7802[208]]})})[_0x7802[67]](function(_0x6dfbx1a){console[_0x7802[22]](_0x7802[204],_0x6dfbx1a[_0x7802[55]]);io[_0x7802[24]](_0x7802[120],_0x6dfbx1a);return _0x6dfbx31[_0x7802[205]](_0x6dfbx2b.UserId)})[_0x7802[67]](function(){return User[_0x7802[203]](_0x6dfbx2b.UserId)})[_0x7802[67]](function(){if(_0x6dfbx3f[_0x7802[171]]){return Contact[_0x7802[172]]({where:{ListId:_0x6dfbx3f[_0x7802[171]],$or:[{phone:_0x6dfbx3e},{fax:_0x6dfbx3e}]},defaults:{fax:_0x6dfbx3e,phone:_0x6dfbx3e,firstName:_0x6dfbx3e,ListId:_0x6dfbx3f[_0x7802[171]]}})}else {return []}})[_0x7802[168]](function(_0x6dfbx37,_0x6dfbx38){if(_0x6dfbx38!= undefined&&  !_0x6dfbx38){return _0x6dfbx37[_0x7802[95]]({fax:_0x6dfbx3e})};return})[_0x7802[67]](function(){_0x6dfbx41= _0x6dfbx2b[_0x7802[194]][0][_0x7802[3]];if(_0x6dfbx2b[_0x7802[194]][0][_0x7802[195]]=== _0x7802[196]){_0x6dfbx42= path[_0x7802[154]](config[_0x7802[149]],_0x7802[150],_0x7802[151],_0x7802[137],_0x7802[197],_0x7802[153],_0x7802[198],path[_0x7802[147]](_0x6dfbx41)[_0x7802[57]]+ _0x7802[199]);return exec(_0x7802[200]+ _0x6dfbx42+ _0x7802[145]+ _0x6dfbx41)}else {_0x6dfbx42= path[_0x7802[154]](config[_0x7802[149]],_0x7802[150],_0x7802[151],_0x7802[137],_0x7802[197],_0x7802[153],_0x7802[198],path[_0x7802[147]](_0x6dfbx41)[_0x7802[201]]);fse[_0x7802[202]](_0x6dfbx41,_0x6dfbx42);return}})[_0x7802[67]](function(){fs[_0x7802[192]](_0x6dfbx42,511);console[_0x7802[22]](_0x7802[193]);return FaxMessage[_0x7802[175]]({filename:_0x6dfbx42,localstationid:_0x6dfbx2b[_0x7802[140]],retry:_0x6dfbx3b},{where:{id:_0x6dfbx2b[_0x7802[55]]}})})[_0x7802[67]](function(_0x6dfbx29){if(_0x6dfbx29){io[_0x7802[24]](_0x7802[92],_0x6dfbx29)};return Promise[_0x7802[191]](_0x6dfbx16[_0x7802[190]])({action:_0x7802[177],channel:util[_0x7802[27]](_0x7802[178],_0x6dfbx3f[_0x7802[179]],_0x6dfbx40[_0x7802[57]],_0x6dfbx3e),exten:_0x6dfbx3e,context:_0x7802[180],priority:1,callerid:util[_0x7802[27]](_0x7802[181],_0x6dfbx3f[_0x7802[116]],_0x6dfbx3f[_0x7802[116]]),variable:{FAXNAME:_0x6dfbx3f[_0x7802[57]],FAXNUMBER:_0x6dfbx3e,FAXECM:_0x6dfbx3f[_0x7802[182]],FAXHEADERINFO:_0x6dfbx3f[_0x7802[183]],FAXLOCALSTATIONID:_0x6dfbx3f[_0x7802[116]],FAXMINRATE:_0x6dfbx3f[_0x7802[184]],FAXMAXRATE:_0x6dfbx3f[_0x7802[185]],FAXMODEM:util[_0x7802[27]](_0x7802[186],_0x6dfbx3f[_0x7802[187]]),FAXGATEWAY:_0x6dfbx3f[_0x7802[188]],FAXT38TIMEOUT:_0x6dfbx3f[_0x7802[189]],FAXOUTFILE:_0x6dfbx42},account:_0x6dfbx3f[_0x7802[116]]})})[_0x7802[67]](function(_0x6dfbx43){console[_0x7802[22]](_0x7802[176]);console[_0x7802[22]](_0x6dfbx43)})[_0x7802[66]](function(_0x6dfbx1e){console[_0x7802[65]](_0x7802[173],_0x6dfbx1e);console[_0x7802[65]](_0x7802[100],_0x6dfbx1e[_0x7802[32]]);console[_0x7802[65]](_0x7802[101],_0x6dfbx1e[_0x7802[102]]);return FaxMessage[_0x7802[175]]({status:_0x7802[127]},{where:{id:_0x6dfbx2b[_0x7802[55]]}})[_0x7802[67]](function(_0x6dfbx1a){io[_0x7802[24]](_0x7802[92],_0x6dfbx1a);if(_0x6dfbx31){return _0x6dfbx31[_0x7802[95]]({lastEvent:_0x7802[127]})};return})[_0x7802[67]](function(_0x6dfbx1a){if(_0x6dfbx1a){io[_0x7802[24]](_0x7802[120],_0x6dfbx1a)}})[_0x7802[66]](function(_0x6dfbx1e){console[_0x7802[65]](_0x7802[174],_0x6dfbx1e);console[_0x7802[65]](_0x7802[100],_0x6dfbx1e[_0x7802[32]]);console[_0x7802[65]](_0x7802[101],_0x6dfbx1e[_0x7802[102]])})})}}function getFaxRoom(){return function(_0x6dfbx1b,_0x6dfbx2a){if(_0x6dfbx2a[_0x7802[158]]){return FaxRoom[_0x7802[203]](_0x6dfbx2a.FaxRoomId)}else {return FaxRoom[_0x7802[68]]({limit:1,where:{contact:_0x6dfbx2a[_0x7802[28]],FaxAccountId:_0x6dfbx1b[_0x7802[55]]},order:[[_0x7802[166],_0x7802[167]]]})[_0x7802[67]](function(_0x6dfbx46){var _0x6dfbx2c=_[_0x7802[160]](_0x6dfbx46);if(!_0x6dfbx2c|| _0x6dfbx2c[_0x7802[37]]=== _0x7802[50]){return FaxRoom[_0x7802[155]]({contact:_0x6dfbx2a[_0x7802[28]],account:_0x6dfbx1b[_0x7802[57]],status:_0x7802[206],FaxAccountId:_0x6dfbx1b[_0x7802[55]]})}else {return _0x6dfbx2c}})}}}module[_0x7802[213]]= Fax
\ No newline at end of file