Built motion from commit fc731d1ea.|1.0.23
[motion.git] / server / config / routing / agent.js
index e431ce2..20aea16 100644 (file)
@@ -1 +1 @@
-var _0x7d2f=["\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"];_0x7d2f[0];const _=require(_0x7d2f[1]);const config=require(_0x7d2f[2]);const structure=require(_0x7d2f[3]);const cp=require(_0x7d2f[4]);const util=require(_0x7d2f[5]);const moment=require(_0x7d2f[6]);const User=require(_0x7d2f[8])[_0x7d2f[7]];function Agent(_0x8fa5x9,_0x8fa5xa,_0x8fa5xb){this[_0x7d2f[9]]= _0x8fa5x9;this[_0x7d2f[10]]= _0x8fa5xa;this[_0x7d2f[11]]= [];this[_0x7d2f[12]]= [];this[_0x7d2f[13]]= _0x8fa5xb}Agent[_0x7d2f[15]][_0x7d2f[14]]= function init(){var _0x8fa5xd=this;var _0x8fa5xe={where:{id:_0x8fa5xd[_0x7d2f[9]][_0x7d2f[16]],online:true},include:[]};_0x8fa5xe[_0x7d2f[20]][structure[_0x7d2f[19]][_0x7d2f[18]][_0x8fa5xd[_0x7d2f[10]][_0x7d2f[17]]]]= false;_0x8fa5xe[_0x7d2f[25]][_0x7d2f[24]]({model:structure[_0x7d2f[22]][_0x7d2f[21]][_0x8fa5xd[_0x7d2f[10]][_0x7d2f[17]]],attributes:[_0x7d2f[23]]});return User[_0x7d2f[49]](_0x8fa5xe)[_0x7d2f[30]](function(_0x8fa5x10){_0x8fa5xd[_0x7d2f[33]]= _0x8fa5x10;console[_0x7d2f[40]](_0x8fa5xd[_0x7d2f[10]][_0x7d2f[17]][_0x7d2f[34]](),_0x7d2f[35],_0x8fa5xd[_0x7d2f[10]][_0x7d2f[36]],_0x7d2f[37],_0x8fa5xd[_0x7d2f[9]][_0x7d2f[38]],_0x7d2f[39]);if(_0x8fa5xd[_0x7d2f[33]][_0x7d2f[41]]&& available(_0x8fa5xd[_0x7d2f[33]][0][_0x7d2f[42]],_0x8fa5xd[_0x7d2f[33]][0][structure[_0x7d2f[19]][_0x7d2f[18]][_0x8fa5xd[_0x7d2f[10]][_0x7d2f[17]]]],_[_0x7d2f[44]](_0x8fa5xd[_0x7d2f[33]][0][structure[_0x7d2f[19]][_0x7d2f[21]][_0x8fa5xd[_0x7d2f[10]][_0x7d2f[17]]]],{status:_0x7d2f[43]}),_0x8fa5xd[_0x7d2f[33]][0][structure[_0x7d2f[19]][_0x7d2f[45]][_0x8fa5xd[_0x7d2f[10]][_0x7d2f[17]]]])){_0x8fa5xd[_0x7d2f[46]]();_0x8fa5xd[_0x7d2f[38]]= setTimeout(function(){_0x8fa5xd[_0x7d2f[13]]()},_0x8fa5xd[_0x7d2f[9]][_0x7d2f[38]]* 1000)}else {console[_0x7d2f[40]](_0x8fa5xd[_0x7d2f[10]][_0x7d2f[17]][_0x7d2f[34]](),_0x7d2f[47],_0x8fa5xd[_0x7d2f[10]][_0x7d2f[48]]);_0x8fa5xd[_0x7d2f[13]]()}})[_0x7d2f[30]](function(){return structure[_0x7d2f[22]][_0x7d2f[21]][_0x8fa5xd[_0x7d2f[10]][_0x7d2f[17]]][_0x7d2f[32]]({waiting:true},{where:{id:_0x8fa5xd[_0x7d2f[10]][_0x7d2f[31]]},individualHooks:true})[_0x7d2f[30]](function(){console[_0x7d2f[29]](_0x7d2f[28])})[_0x7d2f[27]](function(_0x8fa5xf){console[_0x7d2f[26]]()})})};Agent[_0x7d2f[15]][_0x7d2f[46]]= function writeReport(){var _0x8fa5xd=this;var _0x8fa5x12=_[_0x7d2f[55]](_0x8fa5xd._agents,function(_0x8fa5x13){return _[_0x7d2f[54]](_0x8fa5xd[_0x7d2f[10]],{timeslot:_0x8fa5xd[_0x7d2f[9]][_0x7d2f[38]],application:_0x7d2f[50],membername:_0x8fa5x13[_0x7d2f[51]],memberid:_0x8fa5x13[_0x7d2f[23]],calledAt:moment()[_0x7d2f[53]](_0x7d2f[52]),joinAt:moment()[_0x7d2f[53]](_0x7d2f[52])})});return structure[_0x7d2f[22]][_0x7d2f[58]][_0x8fa5xd[_0x7d2f[10]][_0x7d2f[17]]][_0x7d2f[56]](_0x8fa5x12,{individualHooks:true})[_0x7d2f[30]](function(){return structure[_0x7d2f[22]][_0x7d2f[57]][_0x8fa5xd[_0x7d2f[10]][_0x7d2f[17]]][_0x7d2f[56]](_0x8fa5x12,{individualHooks:true})})[_0x7d2f[27]](function(_0x8fa5xf){console[_0x7d2f[26]](_0x8fa5xf)})};function available(_0x8fa5x15,_0x8fa5x16,_0x8fa5x17,_0x8fa5x18){return _0x8fa5x15&&  !_0x8fa5x16&& ((_0x8fa5x17[_0x7d2f[41]]< _0x8fa5x18)|| _0x8fa5x18=== 0)}module[_0x7d2f[59]]= Agent
\ No newline at end of file
+var _0xeca1=["\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"];_0xeca1[0];const _=require(_0xeca1[1]);const config=require(_0xeca1[2]);const structure=require(_0xeca1[3]);const cp=require(_0xeca1[4]);const util=require(_0xeca1[5]);const moment=require(_0xeca1[6]);const User=require(_0xeca1[8])[_0xeca1[7]];function Agent(_0x9e43x9,_0x9e43xa,_0x9e43xb){this[_0xeca1[9]]= _0x9e43x9;this[_0xeca1[10]]= _0x9e43xa;this[_0xeca1[11]]= [];this[_0xeca1[12]]= [];this[_0xeca1[13]]= _0x9e43xb}Agent[_0xeca1[15]][_0xeca1[14]]= function init(){var _0x9e43xd=this;var _0x9e43xe={where:{id:_0x9e43xd[_0xeca1[9]][_0xeca1[16]],online:true},include:[]};_0x9e43xe[_0xeca1[20]][structure[_0xeca1[19]][_0xeca1[18]][_0x9e43xd[_0xeca1[10]][_0xeca1[17]]]]= false;_0x9e43xe[_0xeca1[25]][_0xeca1[24]]({model:structure[_0xeca1[22]][_0xeca1[21]][_0x9e43xd[_0xeca1[10]][_0xeca1[17]]],attributes:[_0xeca1[23]]});return User[_0xeca1[49]](_0x9e43xe)[_0xeca1[30]](function(_0x9e43x10){_0x9e43xd[_0xeca1[33]]= _0x9e43x10;console[_0xeca1[40]](_0x9e43xd[_0xeca1[10]][_0xeca1[17]][_0xeca1[34]](),_0xeca1[35],_0x9e43xd[_0xeca1[10]][_0xeca1[36]],_0xeca1[37],_0x9e43xd[_0xeca1[9]][_0xeca1[38]],_0xeca1[39]);if(_0x9e43xd[_0xeca1[33]][_0xeca1[41]]&& available(_0x9e43xd[_0xeca1[33]][0][_0xeca1[42]],_0x9e43xd[_0xeca1[33]][0][structure[_0xeca1[19]][_0xeca1[18]][_0x9e43xd[_0xeca1[10]][_0xeca1[17]]]],_[_0xeca1[44]](_0x9e43xd[_0xeca1[33]][0][structure[_0xeca1[19]][_0xeca1[21]][_0x9e43xd[_0xeca1[10]][_0xeca1[17]]]],{status:_0xeca1[43]}),_0x9e43xd[_0xeca1[33]][0][structure[_0xeca1[19]][_0xeca1[45]][_0x9e43xd[_0xeca1[10]][_0xeca1[17]]]])){_0x9e43xd[_0xeca1[46]]();_0x9e43xd[_0xeca1[38]]= setTimeout(function(){_0x9e43xd[_0xeca1[13]]()},_0x9e43xd[_0xeca1[9]][_0xeca1[38]]* 1000)}else {console[_0xeca1[40]](_0x9e43xd[_0xeca1[10]][_0xeca1[17]][_0xeca1[34]](),_0xeca1[47],_0x9e43xd[_0xeca1[10]][_0xeca1[48]]);_0x9e43xd[_0xeca1[13]]()}})[_0xeca1[30]](function(){return structure[_0xeca1[22]][_0xeca1[21]][_0x9e43xd[_0xeca1[10]][_0xeca1[17]]][_0xeca1[32]]({waiting:true},{where:{id:_0x9e43xd[_0xeca1[10]][_0xeca1[31]]},individualHooks:true})[_0xeca1[30]](function(){console[_0xeca1[29]](_0xeca1[28])})[_0xeca1[27]](function(_0x9e43xf){console[_0xeca1[26]]()})})};Agent[_0xeca1[15]][_0xeca1[46]]= function writeReport(){var _0x9e43xd=this;var _0x9e43x12=_[_0xeca1[55]](_0x9e43xd._agents,function(_0x9e43x13){return _[_0xeca1[54]](_0x9e43xd[_0xeca1[10]],{timeslot:_0x9e43xd[_0xeca1[9]][_0xeca1[38]],application:_0xeca1[50],membername:_0x9e43x13[_0xeca1[51]],memberid:_0x9e43x13[_0xeca1[23]],calledAt:moment()[_0xeca1[53]](_0xeca1[52]),joinAt:moment()[_0xeca1[53]](_0xeca1[52])})});return structure[_0xeca1[22]][_0xeca1[58]][_0x9e43xd[_0xeca1[10]][_0xeca1[17]]][_0xeca1[56]](_0x9e43x12,{individualHooks:true})[_0xeca1[30]](function(){return structure[_0xeca1[22]][_0xeca1[57]][_0x9e43xd[_0xeca1[10]][_0xeca1[17]]][_0xeca1[56]](_0x9e43x12,{individualHooks:true})})[_0xeca1[27]](function(_0x9e43xf){console[_0xeca1[26]](_0x9e43xf)})};function available(_0x9e43x15,_0x9e43x16,_0x9e43x17,_0x9e43x18){return _0x9e43x15&&  !_0x9e43x16&& ((_0x9e43x17[_0xeca1[41]]< _0x9e43x18)|| _0x9e43x18=== 0)}module[_0xeca1[59]]= Agent
\ No newline at end of file