Built motion from commit 3594e56.|0.0.120
[motion.git] / server / config / automations / fax.js
index 14d3d03..075dd7a 100644 (file)
@@ -1 +1 @@
-var _0x6f19=["\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"];_0x6f19[0];var _=require(_0x6f19[1]);var config=require(_0x6f19[2]);var moment=require(_0x6f19[3]);var sequelize=require(_0x6f19[5])[_0x6f19[4]];var Automation=require(_0x6f19[5])[_0x6f19[6]];var FaxRoom=require(_0x6f19[5])[_0x6f19[7]];var Settings=require(_0x6f19[5])[_0x6f19[8]];var automationTimeout;var activeFaxAutomations={};function executeAutomation(_0xc05fxb){console[_0x6f19[10]](_0x6f19[9],_0xc05fxb);var _0xc05fxc;return Automation[_0x6f19[30]](_0x6f19[29])[_0x6f19[28]](_0xc05fxb)[_0x6f19[19]](function(_0xc05fx11){_0xc05fxc=_0xc05fx11;var _0xc05fx12={where:{$and:[],$or:[]}};_0xc05fx11[_0x6f19[24]][_0x6f19[17]](function(_0xc05fx13){_0xc05fx12[_0x6f19[23]][_0x6f19[22]][_0x6f19[21]](getCondition(_0xc05fx13[_0x6f19[20]]))});_0xc05fx11[_0x6f19[26]][_0x6f19[17]](function(_0xc05fx13){_0xc05fx12[_0x6f19[23]][_0x6f19[25]][_0x6f19[21]](getCondition(_0xc05fx13[_0x6f19[20]]))});return FaxRoom[_0x6f19[27]](_0xc05fx12)})[_0x6f19[19]](function(_0xc05fxe){_0xc05fxe[_0x6f19[17]](function(_0xc05fxf){_0xc05fxc[_0x6f19[18]][_0x6f19[17]](function(_0xc05fx10){switch(_0xc05fx10[_0x6f19[16]]){case _0x6f19[15]:setStatus(_0xc05fxf[_0x6f19[13]],_0xc05fx10[_0x6f19[14]]);break;default:}})})})[_0x6f19[12]](function(_0xc05fxd){console[_0x6f19[10]](_0x6f19[11],_0xc05fxd)})}function setStatus(_0xc05fx15,_0xc05fx16){return FaxRoom[_0x6f19[32]]({status:_0xc05fx16},{where:{id:_0xc05fx15}})[_0x6f19[12]](function(_0xc05fxd){console[_0x6f19[10]](_0x6f19[31],_0xc05fxd)})}function getCondition(_0xc05fx13){var _0xc05fx18={};switch(_0xc05fx13[_0x6f19[33]]){case _0x6f19[15]:switch(_0xc05fx13[_0x6f19[37]]){case _0x6f19[35]:_0xc05fx18[_0xc05fx13[_0x6f19[33]]]=_0xc05fx13[_0x6f19[34]];break;case _0x6f19[36]:_0xc05fx18[_0xc05fx13[_0x6f19[33]]]={$ne:_0xc05fx13[_0x6f19[34]]};break;default:};break;case _0x6f19[46]:var _0xc05fx19=moment()[_0x6f19[41]](parseInt(_0xc05fx13[_0x6f19[34]],10),_0x6f19[40])[_0x6f19[39]](_0x6f19[38]);switch(_0xc05fx13[_0x6f19[37]]){case _0x6f19[42]:_0xc05fx18[_0xc05fx13[_0x6f19[33]]]={lt:_0xc05fx19};break;case _0x6f19[43]:_0xc05fx18[_0xc05fx13[_0x6f19[33]]]={$lte:_0xc05fx19};break;case _0x6f19[44]:_0xc05fx18[_0xc05fx13[_0x6f19[33]]]={$gt:_0xc05fx19};break;case _0x6f19[45]:_0xc05fx18[_0xc05fx13[_0x6f19[33]]]={$gte:_0xc05fx19};break;default:};break;default:};return _0xc05fx18}function createInterval(_0xc05fx11){console[_0x6f19[10]](_0x6f19[47],_0xc05fx11[_0x6f19[13]],_0x6f19[48],_0xc05fx11[_0x6f19[49]]*60*1000);activeFaxAutomations[_0x6f19[50]+_0xc05fx11[_0x6f19[13]]]=setInterval(function(){executeAutomation(_0xc05fx11[_0x6f19[13]])},_0xc05fx11[_0x6f19[49]]*60*1000)}module[_0x6f19[51]]=function(){Automation[_0x6f19[55]](function(_0xc05fx1b,_0xc05fx1c){console[_0x6f19[10]](_0x6f19[47],_0xc05fx1b[_0x6f19[13]],_0x6f19[52],_0xc05fx1b[_0x6f19[15]]);if(_0xc05fx1b[_0x6f19[15]]&&_0xc05fx1b[_0x6f19[53]]===_0x6f19[54]){createInterval(_0xc05fx1b)}});Automation[_0x6f19[58]](function(_0xc05fx1b,_0xc05fx1c){console[_0x6f19[10]](_0x6f19[47],_0xc05fx1b[_0x6f19[13]],_0x6f19[56],_0xc05fx1b[_0x6f19[15]]);if(activeFaxAutomations[_0x6f19[50]+_0xc05fx1b[_0x6f19[13]]]){console[_0x6f19[10]](_0x6f19[57],_0xc05fx1b[_0x6f19[13]]);clearInterval(activeFaxAutomations[_0x6f19[50]+_0xc05fx1b[_0x6f19[13]]]);delete activeFaxAutomations[_0x6f19[50]+_0xc05fx1b[_0x6f19[13]]]};if(_0xc05fx1b[_0x6f19[15]]&&_0xc05fx1b[_0x6f19[53]]===_0x6f19[54]){createInterval(_0xc05fx1b)}});Automation[_0x6f19[60]](function(_0xc05fx1b,_0xc05fx1c){console[_0x6f19[10]](_0x6f19[47],_0xc05fx1b[_0x6f19[13]],_0x6f19[59]);if(activeFaxAutomations[_0x6f19[50]+_0xc05fx1b[_0x6f19[13]]]){console[_0x6f19[10]](_0x6f19[57],_0xc05fx1b[_0x6f19[13]]);clearInterval(activeFaxAutomations[_0x6f19[50]+_0xc05fx1b[_0x6f19[13]]]);delete activeFaxAutomations[_0x6f19[50]+_0xc05fx1b[_0x6f19[13]]]}});return Automation[_0x6f19[30]](_0x6f19[29])[_0x6f19[27]]({where:{status:true,channel:_0x6f19[54]},attributes:[_0x6f19[13],_0x6f19[49]]})[_0x6f19[19]](function(_0xc05fx1d){_0xc05fx1d[_0x6f19[17]](function(_0xc05fx11){createInterval(_0xc05fx11)})})[_0x6f19[12]](function(_0xc05fxd){console[_0x6f19[10]](_0x6f19[61],_0xc05fxd)})}
\ No newline at end of file
+var _0xd320=["\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"];_0xd320[0];var _=require(_0xd320[1]);var config=require(_0xd320[2]);var moment=require(_0xd320[3]);var sequelize=require(_0xd320[5])[_0xd320[4]];var Automation=require(_0xd320[5])[_0xd320[6]];var FaxRoom=require(_0xd320[5])[_0xd320[7]];var Settings=require(_0xd320[5])[_0xd320[8]];var automationTimeout;var activeFaxAutomations={};function executeAutomation(_0x3375xb){console[_0xd320[10]](_0xd320[9],_0x3375xb);var _0x3375xc;return Automation[_0xd320[30]](_0xd320[29])[_0xd320[28]](_0x3375xb)[_0xd320[19]](function(_0x3375x11){_0x3375xc= _0x3375x11;var _0x3375x12={where:{$and:[],$or:[]}};_0x3375x11[_0xd320[24]][_0xd320[17]](function(_0x3375x13){_0x3375x12[_0xd320[23]][_0xd320[22]][_0xd320[21]](getCondition(_0x3375x13[_0xd320[20]]))});_0x3375x11[_0xd320[26]][_0xd320[17]](function(_0x3375x13){_0x3375x12[_0xd320[23]][_0xd320[25]][_0xd320[21]](getCondition(_0x3375x13[_0xd320[20]]))});return FaxRoom[_0xd320[27]](_0x3375x12)})[_0xd320[19]](function(_0x3375xe){_0x3375xe[_0xd320[17]](function(_0x3375xf){_0x3375xc[_0xd320[18]][_0xd320[17]](function(_0x3375x10){switch(_0x3375x10[_0xd320[16]]){case _0xd320[15]:setStatus(_0x3375xf[_0xd320[13]],_0x3375x10[_0xd320[14]]);break;default:}})})})[_0xd320[12]](function(_0x3375xd){console[_0xd320[10]](_0xd320[11],_0x3375xd)})}function setStatus(_0x3375x15,_0x3375x16){return FaxRoom[_0xd320[32]]({status:_0x3375x16},{where:{id:_0x3375x15}})[_0xd320[12]](function(_0x3375xd){console[_0xd320[10]](_0xd320[31],_0x3375xd)})}function getCondition(_0x3375x13){var _0x3375x18={};switch(_0x3375x13[_0xd320[33]]){case _0xd320[15]:switch(_0x3375x13[_0xd320[37]]){case _0xd320[35]:_0x3375x18[_0x3375x13[_0xd320[33]]]= _0x3375x13[_0xd320[34]];break;case _0xd320[36]:_0x3375x18[_0x3375x13[_0xd320[33]]]= {$ne:_0x3375x13[_0xd320[34]]};break;default:};break;case _0xd320[46]:var _0x3375x19=moment()[_0xd320[41]](parseInt(_0x3375x13[_0xd320[34]],10),_0xd320[40])[_0xd320[39]](_0xd320[38]);switch(_0x3375x13[_0xd320[37]]){case _0xd320[42]:_0x3375x18[_0x3375x13[_0xd320[33]]]= {lt:_0x3375x19};break;case _0xd320[43]:_0x3375x18[_0x3375x13[_0xd320[33]]]= {$lte:_0x3375x19};break;case _0xd320[44]:_0x3375x18[_0x3375x13[_0xd320[33]]]= {$gt:_0x3375x19};break;case _0xd320[45]:_0x3375x18[_0x3375x13[_0xd320[33]]]= {$gte:_0x3375x19};break;default:};break;default:};return _0x3375x18}function createInterval(_0x3375x11){console[_0xd320[10]](_0xd320[47],_0x3375x11[_0xd320[13]],_0xd320[48],_0x3375x11[_0xd320[49]]* 60* 1000);activeFaxAutomations[_0xd320[50]+ _0x3375x11[_0xd320[13]]]= setInterval(function(){executeAutomation(_0x3375x11[_0xd320[13]])},_0x3375x11[_0xd320[49]]* 60* 1000)}module[_0xd320[51]]= function(){Automation[_0xd320[55]](function(_0x3375x1b,_0x3375x1c){console[_0xd320[10]](_0xd320[47],_0x3375x1b[_0xd320[13]],_0xd320[52],_0x3375x1b[_0xd320[15]]);if(_0x3375x1b[_0xd320[15]]&& _0x3375x1b[_0xd320[53]]=== _0xd320[54]){createInterval(_0x3375x1b)}});Automation[_0xd320[58]](function(_0x3375x1b,_0x3375x1c){console[_0xd320[10]](_0xd320[47],_0x3375x1b[_0xd320[13]],_0xd320[56],_0x3375x1b[_0xd320[15]]);if(activeFaxAutomations[_0xd320[50]+ _0x3375x1b[_0xd320[13]]]){console[_0xd320[10]](_0xd320[57],_0x3375x1b[_0xd320[13]]);clearInterval(activeFaxAutomations[_0xd320[50]+ _0x3375x1b[_0xd320[13]]]);delete activeFaxAutomations[_0xd320[50]+ _0x3375x1b[_0xd320[13]]]};if(_0x3375x1b[_0xd320[15]]&& _0x3375x1b[_0xd320[53]]=== _0xd320[54]){createInterval(_0x3375x1b)}});Automation[_0xd320[60]](function(_0x3375x1b,_0x3375x1c){console[_0xd320[10]](_0xd320[47],_0x3375x1b[_0xd320[13]],_0xd320[59]);if(activeFaxAutomations[_0xd320[50]+ _0x3375x1b[_0xd320[13]]]){console[_0xd320[10]](_0xd320[57],_0x3375x1b[_0xd320[13]]);clearInterval(activeFaxAutomations[_0xd320[50]+ _0x3375x1b[_0xd320[13]]]);delete activeFaxAutomations[_0xd320[50]+ _0x3375x1b[_0xd320[13]]]}});return Automation[_0xd320[30]](_0xd320[29])[_0xd320[27]]({where:{status:true,channel:_0xd320[54]},attributes:[_0xd320[13],_0xd320[49]]})[_0xd320[19]](function(_0x3375x1d){_0x3375x1d[_0xd320[17]](function(_0x3375x11){createInterval(_0x3375x11)})})[_0xd320[12]](function(_0x3375xd){console[_0xd320[10]](_0xd320[61],_0x3375xd)})}
\ No newline at end of file