Built motion from commit e1ea3531f.|1.0.19
[motion.git] / server / config / routing / agent.js
index 2a382eb..a0e563e 100644 (file)
@@ -1 +1 @@
-var _0xffa4=["\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","\x2E\x2F\x73\x74\x72\x75\x63\x74\x75\x72\x65","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x61\x70\x70","\x64\x61\x74\x61","\x63\x61\x6C\x6C\x65\x64","\x72\x65\x6A\x65\x63\x74\x65\x64","\x6E\x65\x78\x74","\x69\x6E\x69\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x55\x73\x65\x72\x49\x64","\x63\x68\x61\x6E\x6E\x65\x6C","\x70\x61\x75\x73\x65\x73","\x6C\x61\x62\x65\x6C\x73","\x77\x68\x65\x72\x65","\x72\x6F\x6F\x6D\x73","\x6D\x6F\x64\x65\x6C\x73","\x69\x64","\x70\x75\x73\x68","\x69\x6E\x63\x6C\x75\x64\x65","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x41\x47\x45\x4E\x54\x20\x41\x43\x54\x49\x4F\x4E\x20\x53\x54\x41\x52\x54\x45\x44","\x6C\x6F\x67","\x74\x68\x65\x6E","\x72\x6F\x6F\x6D\x69\x64","\x75\x70\x64\x61\x74\x65","\x5F\x61\x67\x65\x6E\x74\x73","\x74\x6F\x55\x70\x70\x65\x72\x43\x61\x73\x65","\x41\x50\x50\x20\x41\x47\x45\x4E\x54\x2C\x20\x49\x4E\x54\x45\x52\x41\x43\x54\x49\x4F\x4E\x3A","\x75\x6E\x69\x71\x75\x65\x69\x64","\x54\x49\x4D\x45\x4F\x55\x54","\x74\x69\x6D\x65\x6F\x75\x74","\x53\x45\x43","\x69\x6E\x66\x6F","\x6C\x65\x6E\x67\x74\x68","\x6F\x6E\x6C\x69\x6E\x65","\x4F\x50\x45\x4E","\x66\x69\x6C\x74\x65\x72","\x63\x61\x70\x61\x63\x69\x74\x69\x65\x73","\x77\x72\x69\x74\x65\x52\x65\x70\x6F\x72\x74","\x41\x50\x50\x20\x46\x49\x44\x45\x4C\x49\x54\x59\x20\x53\x4B\x49\x50\x20\x49\x4E\x54\x45\x52\x41\x43\x54\x49\x4F\x4E\x3A","\x72\x6F\x6F\x6D\x49\x64","\x66\x69\x6E\x64\x41\x6C\x6C","\x61\x67\x65\x6E\x74","\x6E\x61\x6D\x65","\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","\x6D\x65\x72\x67\x65","\x6D\x61\x70","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x72\x65\x70\x6F\x72\x74\x73","\x73\x65\x73\x73\x69\x6F\x6E\x73","\x65\x78\x70\x6F\x72\x74\x73"];_0xffa4[0];const _=require(_0xffa4[1]);const config=require(_0xffa4[2]);const structure=require(_0xffa4[3]);const cp=require(_0xffa4[4]);const util=require(_0xffa4[5]);const moment=require(_0xffa4[6]);const User=require(_0xffa4[8])[_0xffa4[7]];function Agent(_0xa6c8x9,_0xa6c8xa,_0xa6c8xb){this[_0xffa4[9]]= _0xa6c8x9;this[_0xffa4[10]]= _0xa6c8xa;this[_0xffa4[11]]= [];this[_0xffa4[12]]= [];this[_0xffa4[13]]= _0xa6c8xb}Agent[_0xffa4[15]][_0xffa4[14]]= function init(){var _0xa6c8xd=this;var _0xa6c8xe={where:{id:_0xa6c8xd[_0xffa4[9]][_0xffa4[16]],online:true},include:[]};_0xa6c8xe[_0xffa4[20]][structure[_0xffa4[19]][_0xffa4[18]][_0xa6c8xd[_0xffa4[10]][_0xffa4[17]]]]= false;_0xa6c8xe[_0xffa4[25]][_0xffa4[24]]({model:structure[_0xffa4[22]][_0xffa4[21]][_0xa6c8xd[_0xffa4[10]][_0xffa4[17]]],attributes:[_0xffa4[23]]});return User[_0xffa4[49]](_0xa6c8xe)[_0xffa4[30]](function(_0xa6c8x10){_0xa6c8xd[_0xffa4[33]]= _0xa6c8x10;console[_0xffa4[40]](_0xa6c8xd[_0xffa4[10]][_0xffa4[17]][_0xffa4[34]](),_0xffa4[35],_0xa6c8xd[_0xffa4[10]][_0xffa4[36]],_0xffa4[37],_0xa6c8xd[_0xffa4[9]][_0xffa4[38]],_0xffa4[39]);if(_0xa6c8xd[_0xffa4[33]][_0xffa4[41]]&& available(_0xa6c8xd[_0xffa4[33]][0][_0xffa4[42]],_0xa6c8xd[_0xffa4[33]][0][structure[_0xffa4[19]][_0xffa4[18]][_0xa6c8xd[_0xffa4[10]][_0xffa4[17]]]],_[_0xffa4[44]](_0xa6c8xd[_0xffa4[33]][0][structure[_0xffa4[19]][_0xffa4[21]][_0xa6c8xd[_0xffa4[10]][_0xffa4[17]]]],{status:_0xffa4[43]}),_0xa6c8xd[_0xffa4[33]][0][structure[_0xffa4[19]][_0xffa4[45]][_0xa6c8xd[_0xffa4[10]][_0xffa4[17]]]])){_0xa6c8xd[_0xffa4[46]]();_0xa6c8xd[_0xffa4[38]]= setTimeout(function(){_0xa6c8xd[_0xffa4[13]]()},_0xa6c8xd[_0xffa4[9]][_0xffa4[38]]* 1000)}else {console[_0xffa4[40]](_0xa6c8xd[_0xffa4[10]][_0xffa4[17]][_0xffa4[34]](),_0xffa4[47],_0xa6c8xd[_0xffa4[10]][_0xffa4[48]]);_0xa6c8xd[_0xffa4[13]]()}})[_0xffa4[30]](function(){return structure[_0xffa4[22]][_0xffa4[21]][_0xa6c8xd[_0xffa4[10]][_0xffa4[17]]][_0xffa4[32]]({waiting:true},{where:{id:_0xa6c8xd[_0xffa4[10]][_0xffa4[31]]},individualHooks:true})[_0xffa4[30]](function(){console[_0xffa4[29]](_0xffa4[28])})[_0xffa4[27]](function(_0xa6c8xf){console[_0xffa4[26]]()})})};Agent[_0xffa4[15]][_0xffa4[46]]= function writeReport(){var _0xa6c8xd=this;var _0xa6c8x12=_[_0xffa4[55]](_0xa6c8xd._agents,function(_0xa6c8x13){return _[_0xffa4[54]](_0xa6c8xd[_0xffa4[10]],{timeslot:_0xa6c8xd[_0xffa4[9]][_0xffa4[38]],application:_0xffa4[50],membername:_0xa6c8x13[_0xffa4[51]],memberid:_0xa6c8x13[_0xffa4[23]],calledAt:moment()[_0xffa4[53]](_0xffa4[52]),joinAt:moment()[_0xffa4[53]](_0xffa4[52])})});return structure[_0xffa4[22]][_0xffa4[58]][_0xa6c8xd[_0xffa4[10]][_0xffa4[17]]][_0xffa4[56]](_0xa6c8x12,{individualHooks:true})[_0xffa4[30]](function(){return structure[_0xffa4[22]][_0xffa4[57]][_0xa6c8xd[_0xffa4[10]][_0xffa4[17]]][_0xffa4[56]](_0xa6c8x12,{individualHooks:true})})[_0xffa4[27]](function(_0xa6c8xf){console[_0xffa4[26]](_0xa6c8xf)})};function available(_0xa6c8x15,_0xa6c8x16,_0xa6c8x17,_0xa6c8x18){return _0xa6c8x15&& !_0xa6c8x16&& ((_0xa6c8x17[_0xffa4[41]]< _0xa6c8x18)|| _0xa6c8x18=== 0)}module[_0xffa4[59]]= Agent
\ No newline at end of file
+var _0x321f=["\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","\x2E\x2F\x73\x74\x72\x75\x63\x74\x75\x72\x65","\x63\x68\x69\x6C\x64\x5F\x70\x72\x6F\x63\x65\x73\x73","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x55\x73\x65\x72","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x61\x70\x70","\x64\x61\x74\x61","\x63\x61\x6C\x6C\x65\x64","\x72\x65\x6A\x65\x63\x74\x65\x64","\x6E\x65\x78\x74","\x69\x6E\x69\x74","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x55\x73\x65\x72\x49\x64","\x63\x68\x61\x6E\x6E\x65\x6C","\x70\x61\x75\x73\x65\x73","\x6C\x61\x62\x65\x6C\x73","\x77\x68\x65\x72\x65","\x72\x6F\x6F\x6D\x73","\x6D\x6F\x64\x65\x6C\x73","\x69\x64","\x70\x75\x73\x68","\x69\x6E\x63\x6C\x75\x64\x65","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x41\x47\x45\x4E\x54\x20\x41\x43\x54\x49\x4F\x4E\x20\x53\x54\x41\x52\x54\x45\x44","\x6C\x6F\x67","\x74\x68\x65\x6E","\x72\x6F\x6F\x6D\x69\x64","\x75\x70\x64\x61\x74\x65","\x5F\x61\x67\x65\x6E\x74\x73","\x74\x6F\x55\x70\x70\x65\x72\x43\x61\x73\x65","\x41\x50\x50\x20\x41\x47\x45\x4E\x54\x2C\x20\x49\x4E\x54\x45\x52\x41\x43\x54\x49\x4F\x4E\x3A","\x75\x6E\x69\x71\x75\x65\x69\x64","\x54\x49\x4D\x45\x4F\x55\x54","\x74\x69\x6D\x65\x6F\x75\x74","\x53\x45\x43","\x69\x6E\x66\x6F","\x6C\x65\x6E\x67\x74\x68","\x6F\x6E\x6C\x69\x6E\x65","\x4F\x50\x45\x4E","\x66\x69\x6C\x74\x65\x72","\x63\x61\x70\x61\x63\x69\x74\x69\x65\x73","\x77\x72\x69\x74\x65\x52\x65\x70\x6F\x72\x74","\x41\x50\x50\x20\x46\x49\x44\x45\x4C\x49\x54\x59\x20\x53\x4B\x49\x50\x20\x49\x4E\x54\x45\x52\x41\x43\x54\x49\x4F\x4E\x3A","\x72\x6F\x6F\x6D\x49\x64","\x66\x69\x6E\x64\x41\x6C\x6C","\x61\x67\x65\x6E\x74","\x6E\x61\x6D\x65","\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","\x6D\x65\x72\x67\x65","\x6D\x61\x70","\x62\x75\x6C\x6B\x43\x72\x65\x61\x74\x65","\x72\x65\x70\x6F\x72\x74\x73","\x73\x65\x73\x73\x69\x6F\x6E\x73","\x65\x78\x70\x6F\x72\x74\x73"];_0x321f[0];const _=require(_0x321f[1]);const config=require(_0x321f[2]);const structure=require(_0x321f[3]);const cp=require(_0x321f[4]);const util=require(_0x321f[5]);const moment=require(_0x321f[6]);const User=require(_0x321f[8])[_0x321f[7]];function Agent(_0xdf85x9,_0xdf85xa,_0xdf85xb){this[_0x321f[9]]= _0xdf85x9;this[_0x321f[10]]= _0xdf85xa;this[_0x321f[11]]= [];this[_0x321f[12]]= [];this[_0x321f[13]]= _0xdf85xb}Agent[_0x321f[15]][_0x321f[14]]= function init(){var _0xdf85xd=this;var _0xdf85xe={where:{id:_0xdf85xd[_0x321f[9]][_0x321f[16]],online:true},include:[]};_0xdf85xe[_0x321f[20]][structure[_0x321f[19]][_0x321f[18]][_0xdf85xd[_0x321f[10]][_0x321f[17]]]]= false;_0xdf85xe[_0x321f[25]][_0x321f[24]]({model:structure[_0x321f[22]][_0x321f[21]][_0xdf85xd[_0x321f[10]][_0x321f[17]]],attributes:[_0x321f[23]]});return User[_0x321f[49]](_0xdf85xe)[_0x321f[30]](function(_0xdf85x10){_0xdf85xd[_0x321f[33]]= _0xdf85x10;console[_0x321f[40]](_0xdf85xd[_0x321f[10]][_0x321f[17]][_0x321f[34]](),_0x321f[35],_0xdf85xd[_0x321f[10]][_0x321f[36]],_0x321f[37],_0xdf85xd[_0x321f[9]][_0x321f[38]],_0x321f[39]);if(_0xdf85xd[_0x321f[33]][_0x321f[41]]&& available(_0xdf85xd[_0x321f[33]][0][_0x321f[42]],_0xdf85xd[_0x321f[33]][0][structure[_0x321f[19]][_0x321f[18]][_0xdf85xd[_0x321f[10]][_0x321f[17]]]],_[_0x321f[44]](_0xdf85xd[_0x321f[33]][0][structure[_0x321f[19]][_0x321f[21]][_0xdf85xd[_0x321f[10]][_0x321f[17]]]],{status:_0x321f[43]}),_0xdf85xd[_0x321f[33]][0][structure[_0x321f[19]][_0x321f[45]][_0xdf85xd[_0x321f[10]][_0x321f[17]]]])){_0xdf85xd[_0x321f[46]]();_0xdf85xd[_0x321f[38]]= setTimeout(function(){_0xdf85xd[_0x321f[13]]()},_0xdf85xd[_0x321f[9]][_0x321f[38]]* 1000)}else {console[_0x321f[40]](_0xdf85xd[_0x321f[10]][_0x321f[17]][_0x321f[34]](),_0x321f[47],_0xdf85xd[_0x321f[10]][_0x321f[48]]);_0xdf85xd[_0x321f[13]]()}})[_0x321f[30]](function(){return structure[_0x321f[22]][_0x321f[21]][_0xdf85xd[_0x321f[10]][_0x321f[17]]][_0x321f[32]]({waiting:true},{where:{id:_0xdf85xd[_0x321f[10]][_0x321f[31]]},individualHooks:true})[_0x321f[30]](function(){console[_0x321f[29]](_0x321f[28])})[_0x321f[27]](function(_0xdf85xf){console[_0x321f[26]]()})})};Agent[_0x321f[15]][_0x321f[46]]= function writeReport(){var _0xdf85xd=this;var _0xdf85x12=_[_0x321f[55]](_0xdf85xd._agents,function(_0xdf85x13){return _[_0x321f[54]](_0xdf85xd[_0x321f[10]],{timeslot:_0xdf85xd[_0x321f[9]][_0x321f[38]],application:_0x321f[50],membername:_0xdf85x13[_0x321f[51]],memberid:_0xdf85x13[_0x321f[23]],calledAt:moment()[_0x321f[53]](_0x321f[52]),joinAt:moment()[_0x321f[53]](_0x321f[52])})});return structure[_0x321f[22]][_0x321f[58]][_0xdf85xd[_0x321f[10]][_0x321f[17]]][_0x321f[56]](_0xdf85x12,{individualHooks:true})[_0x321f[30]](function(){return structure[_0x321f[22]][_0x321f[57]][_0xdf85xd[_0x321f[10]][_0x321f[17]]][_0x321f[56]](_0xdf85x12,{individualHooks:true})})[_0x321f[27]](function(_0xdf85xf){console[_0x321f[26]](_0xdf85xf)})};function available(_0xdf85x15,_0xdf85x16,_0xdf85x17,_0xdf85x18){return _0xdf85x15&&  !_0xdf85x16&& ((_0xdf85x17[_0x321f[41]]< _0xdf85x18)|| _0xdf85x18=== 0)}module[_0x321f[59]]= Agent
\ No newline at end of file