Built motion from commit 9ab4571.|0.0.110
[motion.git] / server / config / automations / fax.js
index 6d902ff..2c52dc4 100644 (file)
@@ -1 +1 @@
-var _0x690c=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x6D\x6F\x6D\x65\x6E\x74","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E","\x46\x61\x78\x52\x6F\x6F\x6D","\x53\x65\x74\x74\x69\x6E\x67\x73","\x45\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x4D\x61\x69\x6C\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20","\x6C\x6F\x67","\x46\x61\x78\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x65\x78\x65\x63\x20\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x69\x64","\x64\x61\x74\x61\x31","\x73\x74\x61\x74\x75\x73","\x61\x63\x74\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x41\x63\x74\x69\x6F\x6E\x73","\x74\x68\x65\x6E","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x70\x75\x73\x68","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x41\x6C\x6C","\x24\x6F\x72","\x41\x6E\x79","\x66\x69\x6E\x64\x41\x6C\x6C","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x6C\x6C","\x73\x63\x6F\x70\x65","\x41\x75\x74\x6F\x6D\x61\x74\x69\x63\x20\x6D\x61\x69\x6C\x20\x73\x74\x61\x74\x75\x73\x20\x65\x72\x72\x6F\x72","\x75\x70\x64\x61\x74\x65","\x66\x69\x65\x6C\x64","\x76\x61\x6C\x75\x65","\x65\x71\x75\x61\x6C\x73","\x6E\x6F\x74\x5F\x65\x71\x75\x61\x6C\x73","\x6F\x70\x65\x72\x61\x74\x6F\x72","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x68\x6F\x75\x72\x73","\x73\x75\x62\x74\x72\x61\x63\x74","\x67\x72\x65\x61\x74\x65\x72","\x67\x72\x65\x61\x74\x65\x72\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x6C\x65\x73\x73","\x6C\x65\x73\x73\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x46\x61\x78\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20","\x20\x73\x65\x74\x20\x77\x69\x74\x68\x20\x74\x69\x6D\x65\x6F\x75\x74\x20","\x74\x69\x6D\x65\x6F\x75\x74","\x69\x6E\x74\x65\x72\x76\x61\x6C","\x65\x78\x70\x6F\x72\x74\x73","\x20\x63\x72\x65\x61\x74\x65\x64\x2C\x20\x74\x68\x65\x20\x73\x74\x61\x74\x75\x73\x20\x69\x73\x20","\x63\x68\x61\x6E\x6E\x65\x6C","\x66\x61\x78","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x20\x75\x70\x64\x61\x74\x65\x64\x2C\x20\x74\x68\x65\x20\x73\x74\x61\x74\x75\x73\x20\x69\x73\x20","\x46\x61\x78\x20\x61\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x75\x6E\x73\x65\x74\x20","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x20\x64\x65\x6C\x65\x74\x65\x64","\x61\x66\x74\x65\x72\x44\x65\x6C\x65\x74\x65","\x46\x61\x78\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x69\x6E\x69\x74\x20\x65\x72\x72\x6F\x72"];_0x690c[0];var _=require(_0x690c[1]);var config=require(_0x690c[2]);var moment=require(_0x690c[3]);var sequelize=require(_0x690c[5])[_0x690c[4]];var Automation=require(_0x690c[5])[_0x690c[6]];var FaxRoom=require(_0x690c[5])[_0x690c[7]];var Settings=require(_0x690c[5])[_0x690c[8]];var automationTimeout;var activeFaxAutomations={};function executeAutomation(_0xbd55xb){console[_0x690c[10]](_0x690c[9],_0xbd55xb);var _0xbd55xc;return Automation[_0x690c[30]](_0x690c[29])[_0x690c[28]](_0xbd55xb)[_0x690c[19]](function(_0xbd55x11){_0xbd55xc=_0xbd55x11;var _0xbd55x12={where:{$and:[],$or:[]}};_0xbd55x11[_0x690c[24]][_0x690c[17]](function(_0xbd55x13){_0xbd55x12[_0x690c[23]][_0x690c[22]][_0x690c[21]](getCondition(_0xbd55x13[_0x690c[20]]))});_0xbd55x11[_0x690c[26]][_0x690c[17]](function(_0xbd55x13){_0xbd55x12[_0x690c[23]][_0x690c[25]][_0x690c[21]](getCondition(_0xbd55x13[_0x690c[20]]))});return FaxRoom[_0x690c[27]](_0xbd55x12)})[_0x690c[19]](function(_0xbd55xe){_0xbd55xe[_0x690c[17]](function(_0xbd55xf){_0xbd55xc[_0x690c[18]][_0x690c[17]](function(_0xbd55x10){switch(_0xbd55x10[_0x690c[16]]){case _0x690c[15]:setStatus(_0xbd55xf[_0x690c[13]],_0xbd55x10[_0x690c[14]]);break;default:}})})})[_0x690c[12]](function(_0xbd55xd){console[_0x690c[10]](_0x690c[11],_0xbd55xd)})}function setStatus(_0xbd55x15,_0xbd55x16){return FaxRoom[_0x690c[32]]({status:_0xbd55x16},{where:{id:_0xbd55x15}})[_0x690c[12]](function(_0xbd55xd){console[_0x690c[10]](_0x690c[31],_0xbd55xd)})}function getCondition(_0xbd55x13){var _0xbd55x18={};switch(_0xbd55x13[_0x690c[33]]){case _0x690c[15]:switch(_0xbd55x13[_0x690c[37]]){case _0x690c[35]:_0xbd55x18[_0xbd55x13[_0x690c[33]]]=_0xbd55x13[_0x690c[34]];break;case _0x690c[36]:_0xbd55x18[_0xbd55x13[_0x690c[33]]]={$ne:_0xbd55x13[_0x690c[34]]};break;default:};break;case _0x690c[46]:var _0xbd55x19=moment()[_0x690c[41]](parseInt(_0xbd55x13[_0x690c[34]],10),_0x690c[40])[_0x690c[39]](_0x690c[38]);switch(_0xbd55x13[_0x690c[37]]){case _0x690c[42]:_0xbd55x18[_0xbd55x13[_0x690c[33]]]={lt:_0xbd55x19};break;case _0x690c[43]:_0xbd55x18[_0xbd55x13[_0x690c[33]]]={$lte:_0xbd55x19};break;case _0x690c[44]:_0xbd55x18[_0xbd55x13[_0x690c[33]]]={$gt:_0xbd55x19};break;case _0x690c[45]:_0xbd55x18[_0xbd55x13[_0x690c[33]]]={$gte:_0xbd55x19};break;default:};break;default:};return _0xbd55x18}function createInterval(_0xbd55x11){console[_0x690c[10]](_0x690c[47],_0xbd55x11[_0x690c[13]],_0x690c[48],_0xbd55x11[_0x690c[49]]*60*1000);activeFaxAutomations[_0x690c[50]+_0xbd55x11[_0x690c[13]]]=setInterval(function(){executeAutomation(_0xbd55x11[_0x690c[13]])},_0xbd55x11[_0x690c[49]]*60*1000)}module[_0x690c[51]]=function(){Automation[_0x690c[55]](function(_0xbd55x1b,_0xbd55x1c){console[_0x690c[10]](_0x690c[47],_0xbd55x1b[_0x690c[13]],_0x690c[52],_0xbd55x1b[_0x690c[15]]);if(_0xbd55x1b[_0x690c[15]]&&_0xbd55x1b[_0x690c[53]]===_0x690c[54]){createInterval(_0xbd55x1b)}});Automation[_0x690c[58]](function(_0xbd55x1b,_0xbd55x1c){console[_0x690c[10]](_0x690c[47],_0xbd55x1b[_0x690c[13]],_0x690c[56],_0xbd55x1b[_0x690c[15]]);if(activeFaxAutomations[_0x690c[50]+_0xbd55x1b[_0x690c[13]]]){console[_0x690c[10]](_0x690c[57],_0xbd55x1b[_0x690c[13]]);clearInterval(activeFaxAutomations[_0x690c[50]+_0xbd55x1b[_0x690c[13]]]);delete activeFaxAutomations[_0x690c[50]+_0xbd55x1b[_0x690c[13]]]};if(_0xbd55x1b[_0x690c[15]]&&_0xbd55x1b[_0x690c[53]]===_0x690c[54]){createInterval(_0xbd55x1b)}});Automation[_0x690c[60]](function(_0xbd55x1b,_0xbd55x1c){console[_0x690c[10]](_0x690c[47],_0xbd55x1b[_0x690c[13]],_0x690c[59]);if(activeFaxAutomations[_0x690c[50]+_0xbd55x1b[_0x690c[13]]]){console[_0x690c[10]](_0x690c[57],_0xbd55x1b[_0x690c[13]]);clearInterval(activeFaxAutomations[_0x690c[50]+_0xbd55x1b[_0x690c[13]]]);delete activeFaxAutomations[_0x690c[50]+_0xbd55x1b[_0x690c[13]]]}});return Automation[_0x690c[30]](_0x690c[29])[_0x690c[27]]({where:{status:true,channel:_0x690c[54]},attributes:[_0x690c[13],_0x690c[49]]})[_0x690c[19]](function(_0xbd55x1d){_0xbd55x1d[_0x690c[17]](function(_0xbd55x11){createInterval(_0xbd55x11)})})[_0x690c[12]](function(_0xbd55xd){console[_0x690c[10]](_0x690c[61],_0xbd55xd)})}
\ No newline at end of file
+var _0xcf26=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x6D\x6F\x6D\x65\x6E\x74","\x73\x65\x71\x75\x65\x6C\x69\x7A\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E","\x46\x61\x78\x52\x6F\x6F\x6D","\x53\x65\x74\x74\x69\x6E\x67\x73","\x45\x78\x65\x63\x75\x74\x69\x6E\x67\x20\x4D\x61\x69\x6C\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20","\x6C\x6F\x67","\x46\x61\x78\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x65\x78\x65\x63\x20\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x69\x64","\x64\x61\x74\x61\x31","\x73\x74\x61\x74\x75\x73","\x61\x63\x74\x69\x6F\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x41\x63\x74\x69\x6F\x6E\x73","\x74\x68\x65\x6E","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x70\x75\x73\x68","\x24\x61\x6E\x64","\x77\x68\x65\x72\x65","\x41\x6C\x6C","\x24\x6F\x72","\x41\x6E\x79","\x66\x69\x6E\x64\x41\x6C\x6C","\x66\x69\x6E\x64\x42\x79\x49\x64","\x61\x6C\x6C","\x73\x63\x6F\x70\x65","\x41\x75\x74\x6F\x6D\x61\x74\x69\x63\x20\x6D\x61\x69\x6C\x20\x73\x74\x61\x74\x75\x73\x20\x65\x72\x72\x6F\x72","\x75\x70\x64\x61\x74\x65","\x66\x69\x65\x6C\x64","\x76\x61\x6C\x75\x65","\x65\x71\x75\x61\x6C\x73","\x6E\x6F\x74\x5F\x65\x71\x75\x61\x6C\x73","\x6F\x70\x65\x72\x61\x74\x6F\x72","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x68\x6F\x75\x72\x73","\x73\x75\x62\x74\x72\x61\x63\x74","\x67\x72\x65\x61\x74\x65\x72","\x67\x72\x65\x61\x74\x65\x72\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x6C\x65\x73\x73","\x6C\x65\x73\x73\x5F\x6F\x72\x5F\x65\x71\x75\x61\x6C","\x63\x72\x65\x61\x74\x65\x64\x41\x74","\x46\x61\x78\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20","\x20\x73\x65\x74\x20\x77\x69\x74\x68\x20\x74\x69\x6D\x65\x6F\x75\x74\x20","\x74\x69\x6D\x65\x6F\x75\x74","\x69\x6E\x74\x65\x72\x76\x61\x6C","\x65\x78\x70\x6F\x72\x74\x73","\x20\x63\x72\x65\x61\x74\x65\x64\x2C\x20\x74\x68\x65\x20\x73\x74\x61\x74\x75\x73\x20\x69\x73\x20","\x63\x68\x61\x6E\x6E\x65\x6C","\x66\x61\x78","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x20\x75\x70\x64\x61\x74\x65\x64\x2C\x20\x74\x68\x65\x20\x73\x74\x61\x74\x75\x73\x20\x69\x73\x20","\x46\x61\x78\x20\x61\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x75\x6E\x73\x65\x74\x20","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x20\x64\x65\x6C\x65\x74\x65\x64","\x61\x66\x74\x65\x72\x44\x65\x6C\x65\x74\x65","\x46\x61\x78\x20\x41\x75\x74\x6F\x6D\x61\x74\x69\x6F\x6E\x20\x69\x6E\x69\x74\x20\x65\x72\x72\x6F\x72"];_0xcf26[0];var _=require(_0xcf26[1]);var config=require(_0xcf26[2]);var moment=require(_0xcf26[3]);var sequelize=require(_0xcf26[5])[_0xcf26[4]];var Automation=require(_0xcf26[5])[_0xcf26[6]];var FaxRoom=require(_0xcf26[5])[_0xcf26[7]];var Settings=require(_0xcf26[5])[_0xcf26[8]];var automationTimeout;var activeFaxAutomations={};function executeAutomation(_0x3a5axb){console[_0xcf26[10]](_0xcf26[9],_0x3a5axb);var _0x3a5axc;return Automation[_0xcf26[30]](_0xcf26[29])[_0xcf26[28]](_0x3a5axb)[_0xcf26[19]](function(_0x3a5ax11){_0x3a5axc=_0x3a5ax11;var _0x3a5ax12={where:{$and:[],$or:[]}};_0x3a5ax11[_0xcf26[24]][_0xcf26[17]](function(_0x3a5ax13){_0x3a5ax12[_0xcf26[23]][_0xcf26[22]][_0xcf26[21]](getCondition(_0x3a5ax13[_0xcf26[20]]))});_0x3a5ax11[_0xcf26[26]][_0xcf26[17]](function(_0x3a5ax13){_0x3a5ax12[_0xcf26[23]][_0xcf26[25]][_0xcf26[21]](getCondition(_0x3a5ax13[_0xcf26[20]]))});return FaxRoom[_0xcf26[27]](_0x3a5ax12)})[_0xcf26[19]](function(_0x3a5axe){_0x3a5axe[_0xcf26[17]](function(_0x3a5axf){_0x3a5axc[_0xcf26[18]][_0xcf26[17]](function(_0x3a5ax10){switch(_0x3a5ax10[_0xcf26[16]]){case _0xcf26[15]:setStatus(_0x3a5axf[_0xcf26[13]],_0x3a5ax10[_0xcf26[14]]);break;default:}})})})[_0xcf26[12]](function(_0x3a5axd){console[_0xcf26[10]](_0xcf26[11],_0x3a5axd)})}function setStatus(_0x3a5ax15,_0x3a5ax16){return FaxRoom[_0xcf26[32]]({status:_0x3a5ax16},{where:{id:_0x3a5ax15}})[_0xcf26[12]](function(_0x3a5axd){console[_0xcf26[10]](_0xcf26[31],_0x3a5axd)})}function getCondition(_0x3a5ax13){var _0x3a5ax18={};switch(_0x3a5ax13[_0xcf26[33]]){case _0xcf26[15]:switch(_0x3a5ax13[_0xcf26[37]]){case _0xcf26[35]:_0x3a5ax18[_0x3a5ax13[_0xcf26[33]]]=_0x3a5ax13[_0xcf26[34]];break;case _0xcf26[36]:_0x3a5ax18[_0x3a5ax13[_0xcf26[33]]]={$ne:_0x3a5ax13[_0xcf26[34]]};break;default:};break;case _0xcf26[46]:var _0x3a5ax19=moment()[_0xcf26[41]](parseInt(_0x3a5ax13[_0xcf26[34]],10),_0xcf26[40])[_0xcf26[39]](_0xcf26[38]);switch(_0x3a5ax13[_0xcf26[37]]){case _0xcf26[42]:_0x3a5ax18[_0x3a5ax13[_0xcf26[33]]]={lt:_0x3a5ax19};break;case _0xcf26[43]:_0x3a5ax18[_0x3a5ax13[_0xcf26[33]]]={$lte:_0x3a5ax19};break;case _0xcf26[44]:_0x3a5ax18[_0x3a5ax13[_0xcf26[33]]]={$gt:_0x3a5ax19};break;case _0xcf26[45]:_0x3a5ax18[_0x3a5ax13[_0xcf26[33]]]={$gte:_0x3a5ax19};break;default:};break;default:};return _0x3a5ax18}function createInterval(_0x3a5ax11){console[_0xcf26[10]](_0xcf26[47],_0x3a5ax11[_0xcf26[13]],_0xcf26[48],_0x3a5ax11[_0xcf26[49]]*60*1000);activeFaxAutomations[_0xcf26[50]+_0x3a5ax11[_0xcf26[13]]]=setInterval(function(){executeAutomation(_0x3a5ax11[_0xcf26[13]])},_0x3a5ax11[_0xcf26[49]]*60*1000)}module[_0xcf26[51]]=function(){Automation[_0xcf26[55]](function(_0x3a5ax1b,_0x3a5ax1c){console[_0xcf26[10]](_0xcf26[47],_0x3a5ax1b[_0xcf26[13]],_0xcf26[52],_0x3a5ax1b[_0xcf26[15]]);if(_0x3a5ax1b[_0xcf26[15]]&&_0x3a5ax1b[_0xcf26[53]]===_0xcf26[54]){createInterval(_0x3a5ax1b)}});Automation[_0xcf26[58]](function(_0x3a5ax1b,_0x3a5ax1c){console[_0xcf26[10]](_0xcf26[47],_0x3a5ax1b[_0xcf26[13]],_0xcf26[56],_0x3a5ax1b[_0xcf26[15]]);if(activeFaxAutomations[_0xcf26[50]+_0x3a5ax1b[_0xcf26[13]]]){console[_0xcf26[10]](_0xcf26[57],_0x3a5ax1b[_0xcf26[13]]);clearInterval(activeFaxAutomations[_0xcf26[50]+_0x3a5ax1b[_0xcf26[13]]]);delete activeFaxAutomations[_0xcf26[50]+_0x3a5ax1b[_0xcf26[13]]]};if(_0x3a5ax1b[_0xcf26[15]]&&_0x3a5ax1b[_0xcf26[53]]===_0xcf26[54]){createInterval(_0x3a5ax1b)}});Automation[_0xcf26[60]](function(_0x3a5ax1b,_0x3a5ax1c){console[_0xcf26[10]](_0xcf26[47],_0x3a5ax1b[_0xcf26[13]],_0xcf26[59]);if(activeFaxAutomations[_0xcf26[50]+_0x3a5ax1b[_0xcf26[13]]]){console[_0xcf26[10]](_0xcf26[57],_0x3a5ax1b[_0xcf26[13]]);clearInterval(activeFaxAutomations[_0xcf26[50]+_0x3a5ax1b[_0xcf26[13]]]);delete activeFaxAutomations[_0xcf26[50]+_0x3a5ax1b[_0xcf26[13]]]}});return Automation[_0xcf26[30]](_0xcf26[29])[_0xcf26[27]]({where:{status:true,channel:_0xcf26[54]},attributes:[_0xcf26[13],_0xcf26[49]]})[_0xcf26[19]](function(_0x3a5ax1d){_0x3a5ax1d[_0xcf26[17]](function(_0x3a5ax11){createInterval(_0x3a5ax11)})})[_0xcf26[12]](function(_0x3a5axd){console[_0xcf26[10]](_0xcf26[61],_0x3a5axd)})}
\ No newline at end of file