Built motion from commit 57474b6.|0.0.99
[motion.git] / server / config / ami / fax.js
index cc3f592..438ec2c 100644 (file)
@@ -1 +1 @@
-var _0xa6b6=["\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","\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\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x72\x65\x63\x65\x69\x76\x65\x66\x61\x78","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x4E\x65\x77\x20\x46\x61\x78\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","\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","\x63\x61\x74\x63\x68","\x46\x61\x78\x20\x6D\x65\x73\x73\x61\x67\x65\x20\x63\x72\x65\x61\x74\x65\x64\x3A","\x69\x64","\x74\x68\x65\x6E","\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\x20\x72\x6F\x6F\x6D\x20\x66\x6F\x75\x6E\x64\x2F\x63\x72\x65\x61\x74\x65\x64\x3A","\x46\x61\x78\x52\x6F\x6F\x6D\x49\x64","\x73\x74\x61\x74\x75\x73","\x52\x45\x43\x45\x49\x56\x45\x44","\x66\x72\x6F\x6D","\x74\x6F","\x6C\x6F\x63\x61\x6C\x73\x74\x61\x74\x69\x6F\x6E\x69\x64","\x63\x72\x65\x61\x74\x65","\x46\x61\x78\x20\x72\x6F\x6F\x6D\x20\x74\x6F\x20\x75\x70\x64\x61\x74\x65","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x46\x61\x78\x20\x72\x6F\x6F\x6D\x20\x74\x6F\x20\x63\x72\x65\x61\x74\x65","\x6E\x61\x6D\x65","\x4E\x45\x57","\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","\x66\x69\x6E\x64\x4F\x6E\x65","\x65\x78\x70\x6F\x72\x74\x73"];var fs=require(_0xa6b6[0]);var util=require(_0xa6b6[1]);var path=require(_0xa6b6[2]);var config=require(_0xa6b6[3]);var _=require(_0xa6b6[4]);var FaxAccount=require(_0xa6b6[6])[_0xa6b6[5]];var FaxRoom=require(_0xa6b6[6])[_0xa6b6[7]];var FaxMessage=require(_0xa6b6[6])[_0xa6b6[8]];function Fax(_0x84b0xa){console[_0xa6b6[10]](_0xa6b6[9])}Fax[_0xa6b6[12]][_0xa6b6[11]]=function(_0x84b0xb){console[_0xa6b6[10]](util[_0xa6b6[15]](_0xa6b6[13],_0x84b0xb[_0xa6b6[14]]));var _0x84b0xc=_[_0xa6b6[16]](_0x84b0xb);var _0x84b0xd;return FaxAccount[_0xa6b6[38]]({where:{localstationid:_0x84b0xb[_0xa6b6[29]]}})[_0xa6b6[21]](function(_0x84b0x11){if(!_0x84b0x11){throw  new Error(_0xa6b6[36])};console[_0xa6b6[10]](_0xa6b6[37],_0x84b0xb[_0xa6b6[29]]);_0x84b0xd=_0x84b0x11;return FaxRoom[_0xa6b6[38]]({where:{from:_0x84b0xb[_0xa6b6[14]],FaxAccountId:_0x84b0x11[_0xa6b6[20]]}})})[_0xa6b6[21]](function(_0x84b0x10){if(_0x84b0x10){console[_0xa6b6[10]](_0xa6b6[31]);return _0x84b0x10[_0xa6b6[32]]({lastEvent:_0xa6b6[26]})}else {console[_0xa6b6[10]](_0xa6b6[33]);return FaxRoom[_0xa6b6[30]]({from:_0x84b0xc[_0xa6b6[14]],account:_0x84b0xd[_0xa6b6[34]],status:_0xa6b6[35],lastEvent:_0xa6b6[26],FaxAccountId:_0x84b0xd[_0xa6b6[20]]})}})[_0xa6b6[21]](function(_0x84b0x10){if(!_0x84b0x10){throw  new Error(_0xa6b6[22])};console[_0xa6b6[10]](_0xa6b6[23],_0x84b0x10[_0xa6b6[20]]);_0x84b0xc[_0xa6b6[24]]=_0x84b0x10[_0xa6b6[20]];_0x84b0xc[_0xa6b6[25]]=_0xa6b6[26];_0x84b0xc[_0xa6b6[27]]=_0x84b0xc[_0xa6b6[14]];_0x84b0xc[_0xa6b6[28]]=_0x84b0xc[_0xa6b6[29]];return FaxMessage[_0xa6b6[30]](_0x84b0xc)})[_0xa6b6[21]](function(_0x84b0xf){console[_0xa6b6[10]](_0xa6b6[19],_0x84b0xf[_0xa6b6[20]])})[_0xa6b6[18]](function(_0x84b0xe){console[_0xa6b6[10]](_0xa6b6[17],_0x84b0xe)})};module[_0xa6b6[39]]=Fax
\ No newline at end of file
+var _0x715a=["\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","\x74\x69\x66\x66\x32\x70\x64\x66","\x70\x72\x6F\x6D\x69\x73\x69\x66\x79","\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","\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\x63\x65\x69\x76\x65\x66\x61\x78","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x4E\x65\x77\x20\x46\x61\x78\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","\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","\x63\x61\x74\x63\x68","\x66\x69\x6C\x65\x6E\x61\x6D\x65","\x72\x6F\x6F\x74","\x73\x65\x72\x76\x65\x72","\x66\x69\x6C\x65\x73","\x66\x61\x78","\x69\x6E\x62\x6F\x75\x6E\x64","\x2F","\x6A\x6F\x69\x6E","\x74\x68\x65\x6E","\x6E\x61\x6D\x65","\x70\x61\x72\x73\x65","\x2E\x70\x64\x66","\x69\x64","\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","\x73\x74\x61\x74\x75\x73","\x52\x45\x43\x45\x49\x56\x45\x44","\x66\x72\x6F\x6D","\x74\x6F","\x6C\x6F\x63\x61\x6C\x73\x74\x61\x74\x69\x6F\x6E\x69\x64","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x4E\x45\x57","\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","\x66\x69\x6E\x64\x4F\x6E\x65","\x65\x78\x70\x6F\x72\x74\x73"];var fs=require(_0x715a[0]);var util=require(_0x715a[1]);var path=require(_0x715a[2]);var config=require(_0x715a[3]);var _=require(_0x715a[4]);var Promise=require(_0x715a[5]);var tiff2pdf=Promise[_0x715a[7]](require(_0x715a[6]));var FaxAccount=require(_0x715a[9])[_0x715a[8]];var FaxRoom=require(_0x715a[9])[_0x715a[10]];var FaxMessage=require(_0x715a[9])[_0x715a[11]];var FaxAttachment=require(_0x715a[9])[_0x715a[12]];function Fax(_0x6d0exd){console[_0x715a[14]](_0x715a[13])}Fax[_0x715a[16]][_0x715a[15]]=function(_0x6d0exe){console[_0x715a[14]](util[_0x715a[19]](_0x715a[17],_0x6d0exe[_0x715a[18]]));var _0x6d0exf=_[_0x715a[20]](_0x6d0exe);var _0x6d0ex10;return FaxAccount[_0x715a[48]]({where:{localstationid:_0x6d0exe[_0x715a[43]]}})[_0x715a[31]](function(_0x6d0ex18){if(!_0x6d0ex18){throw  new Error(_0x715a[46])};console[_0x715a[14]](_0x715a[47],_0x6d0exe[_0x715a[43]]);_0x6d0ex10=_0x6d0ex18;return FaxRoom[_0x715a[48]]({where:{from:_0x6d0exe[_0x715a[18]],FaxAccountId:_0x6d0ex18[_0x715a[35]]}})})[_0x715a[31]](function(_0x6d0ex17){if(_0x6d0ex17){return _0x6d0ex17[_0x715a[44]]({lastEvent:_0x715a[40]})}else {return FaxRoom[_0x715a[36]]({from:_0x6d0exf[_0x715a[18]],account:_0x6d0ex10[_0x715a[32]],status:_0x715a[45],lastEvent:_0x715a[40],FaxAccountId:_0x6d0ex10[_0x715a[35]]})}})[_0x715a[31]](function(_0x6d0ex17){if(!_0x6d0ex17){throw  new Error(_0x715a[37])};_0x6d0exf[_0x715a[38]]=_0x6d0ex17[_0x715a[35]];_0x6d0exf[_0x715a[39]]=_0x715a[40];_0x6d0exf[_0x715a[41]]=_0x6d0exf[_0x715a[18]];_0x6d0exf[_0x715a[42]]=_0x6d0exf[_0x715a[43]];return FaxMessage[_0x715a[36]](_0x6d0exf)})[_0x715a[31]](function(_0x6d0ex13){var _0x6d0ex14=[];var _0x6d0ex15=path[_0x715a[33]](_0x6d0exe[_0x715a[23]])[_0x715a[32]];var _0x6d0ex16=_0x6d0ex15+_0x715a[34];return FaxAttachment[_0x715a[36]]({path:path[_0x715a[30]](config[_0x715a[24]],_0x715a[25],_0x715a[26],_0x715a[27],_0x715a[28],_0x715a[29],_0x6d0ex16),basename:_0x6d0ex16,name:_0x6d0ex15,FaxMessageId:_0x6d0ex13[_0x715a[35]]})})[_0x715a[31]](function(_0x6d0ex12){return tiff2pdf(_0x6d0exe[_0x715a[23]],path[_0x715a[30]](config[_0x715a[24]],_0x715a[25],_0x715a[26],_0x715a[27],_0x715a[28],_0x715a[29]))})[_0x715a[22]](function(_0x6d0ex11){console[_0x715a[14]](_0x715a[21],_0x6d0ex11)})};module[_0x715a[49]]=Fax
\ No newline at end of file