Built motion from commit fa8c70b.|0.0.144
[motion.git] / server / config / ami / acw.js
index a1d1d7e..e498e23 100644 (file)
@@ -1 +1 @@
-var _0x517c=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x6C\x6F\x64\x61\x73\x68","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x41\x63\x74\x69\x6F\x6E","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74","\x41\x43\x57\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x69\x64","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x74\x68\x65\x6E","\x6E\x61\x6D\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x61\x67\x65\x6E\x74","\x73\x63\x6F\x70\x65","\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x71\x75\x65\x75\x65","\x66\x69\x6E\x64","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x50\x41\x55\x53\x45\x44\x20\x42\x59\x20\x41\x43\x57","\x75\x6E\x69\x71\x75\x65\x69\x64","\x64\x65\x73\x74\x75\x6E\x69\x71\x75\x65\x69\x64","\x61\x63\x77\x54\x69\x6D\x65\x6F\x75\x74","\x74\x69\x6D\x65\x6F\x75\x74","\x55\x4E\x50\x41\x55\x53\x45\x44\x20\x42\x59\x20\x41\x43\x57","\x75\x6E\x70\x61\x75\x73\x65","\x41\x43\x57","\x63\x72\x65\x61\x74\x65","\x70\x61\x75\x73\x65","\x62\x6F\x64\x79","\x61\x63\x77\x54\x69\x6D\x65","\x61\x73\x53\x65\x63\x6F\x6E\x64\x73","\x61\x63\x77\x41\x74","\x64\x75\x72\x61\x74\x69\x6F\x6E","\x66\x69\x6E\x61\x6C\x6C\x79","\x75\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x72\x65\x6D\x6F\x76\x65","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x69\x6E\x64\x65\x78\x4F\x66","\x6D\x65\x72\x67\x65","\x75\x6E\x73\x68\x69\x66\x74","\x65\x78\x70\x6F\x72\x74\x73"];_0x517c[0];var util=require(_0x517c[1]);var moment=require(_0x517c[2]);var _=require(_0x517c[3]);var VoiceQueue=require(_0x517c[5])[_0x517c[4]];var Agent=require(_0x517c[5])[_0x517c[6]];var Action=require(_0x517c[5])[_0x517c[7]];var ReportAgent=require(_0x517c[5])[_0x517c[8]];var _voiceQueues;var _agents;var activeAcw={};function AfterCallWork(){console[_0x517c[10]](_0x517c[9]);VoiceQueue[_0x517c[16]]()[_0x517c[14]](function(_0xf62ex10){_voiceQueues= _0xf62ex10;synchCollection(VoiceQueue,_voiceQueues,_0x517c[15]);return Agent[_0x517c[18]](_0x517c[17])[_0x517c[16]]()})[_0x517c[14]](function(_0xf62exd){_agents= _0xf62exd;synchCollection(Agent,_agents,_0x517c[12]);Action[_0x517c[13]](function(_0xf62exe,_0xf62exf){return onSave(_0xf62exe,_0xf62exf)})})[_0x517c[11]](function(_0xf62exc){console[_0x517c[10]](_0xf62exc)})}AfterCallWork[_0x517c[20]][_0x517c[19]]= function(_0xf62ex11){var _0xf62ex12=_[_0x517c[22]](_voiceQueues,{name:_0xf62ex11[_0x517c[21]],acw:true});if(_0xf62ex12){var _0xf62ex13=_[_0x517c[22]](_agents,{name:_0xf62ex11[_0x517c[23]]});Action[_0x517c[32]]({name:_0x517c[33],data1:_0x517c[31],data2:_0xf62ex12[_0x517c[27]],data3:_0xf62ex11[_0x517c[25]],data4:_0xf62ex11[_0x517c[21]]},{body:{agent:_0xf62ex13[_0x517c[12]],type:_0x517c[31]},raw:true})[_0x517c[14]](function(){console[_0x517c[10]](_0x517c[24]);activeAcw[_0xf62ex13[_0x517c[12]]]= {uniqueid:_0xf62ex11[_0x517c[25]],destuniqueid:_0xf62ex11[_0x517c[26]],acwTime:_0xf62ex12[_0x517c[27]],acwAt:moment(),unpause:false};activeAcw[_0xf62ex13[_0x517c[12]]][_0x517c[28]]= setTimeout(function(){console[_0x517c[10]](_0x517c[29]);activeAcw[_0xf62ex13[_0x517c[12]]][_0x517c[30]]= true;return Action[_0x517c[32]]({name:_0x517c[30],data1:_0x517c[31],data2:_0xf62ex12[_0x517c[27]],data3:_0xf62ex11[_0x517c[25]],data4:_0xf62ex11[_0x517c[21]]},{body:{agent:_0xf62ex13[_0x517c[12]],type:_0x517c[31]},raw:true})[_0x517c[11]](function(_0xf62exc){console[_0x517c[10]](_0xf62exc)})},_0xf62ex12[_0x517c[27]]* 1000)})[_0x517c[11]](function(_0xf62exc){console[_0x517c[10]](_0xf62exc)})}};function onSave(_0xf62exe,_0xf62exf){var _0xf62ex15;if((_0xf62exe[_0x517c[15]]=== _0x517c[33]|| _0xf62exe[_0x517c[15]]=== _0x517c[30])&& activeAcw[_0xf62exf[_0x517c[34]][_0x517c[17]]]){if(_0xf62exe[_0x517c[15]]=== _0x517c[30]&& activeAcw[_0xf62exf[_0x517c[34]][_0x517c[17]]][_0x517c[30]]){_0xf62ex15= activeAcw[_0xf62exf[_0x517c[34]][_0x517c[17]]][_0x517c[35]]}else {clearTimeout(activeAcw[_0xf62exf[_0x517c[34]][_0x517c[17]]][_0x517c[28]]);_0xf62ex15= moment[_0x517c[38]](moment()- activeAcw[_0xf62exf[_0x517c[34]][_0x517c[17]]][_0x517c[37]])[_0x517c[36]]()};return ReportAgent[_0x517c[40]]({agentacw:true,acwtime:_0xf62ex15},{where:{uniqueid:activeAcw[_0xf62exf[_0x517c[34]][_0x517c[17]]][_0x517c[25]],destuniqueid:activeAcw[_0xf62exf[_0x517c[34]][_0x517c[17]]][_0x517c[26]]},individualHooks:true,raw:true})[_0x517c[11]](function(_0xf62exc){console[_0x517c[10]](_0xf62exc)})[_0x517c[39]](function(){delete activeAcw[_0xf62exf[_0x517c[34]][_0x517c[17]]]})}}function synchCollection(_0xf62ex17,_0xf62ex18,_0xf62ex19){var _0xf62ex1a={};_0xf62ex17[_0x517c[13]](function(_0xf62exe,_0xf62exf){_0xf62ex1a[_0xf62ex19]= _0xf62exe[_0xf62ex19];updateCollection(_0xf62ex18,_0xf62exe,_0xf62ex1a)});_0xf62ex17[_0x517c[41]](function(_0xf62exe,_0xf62exf){_0xf62ex1a[_0xf62ex19]= _0xf62exe[_0xf62ex19];updateCollection(_0xf62ex18,_0xf62exe,_0xf62ex1a)});_0xf62ex17[_0x517c[43]](function(_0xf62exe,_0xf62exf){_0xf62ex1a[_0xf62ex19]= _0xf62exe[_0xf62ex19];_[_0x517c[42]](_0xf62ex18,_0xf62ex1a)})}function updateCollection(_0xf62ex1c,_0xf62exe,_0xf62ex1a){var _0xf62ex1d=_[_0x517c[22]](_0xf62ex1c,_0xf62ex1a);var _0xf62ex1e=_0xf62ex1c[_0x517c[44]](_0xf62ex1d);if(_0xf62ex1d){_[_0x517c[45]](_0xf62ex1c[_0xf62ex1e],_0xf62exe)}else {_0xf62ex1c[_0x517c[46]](_0xf62exe)}}module[_0x517c[47]]= AfterCallWork
\ No newline at end of file
+var _0xcef6=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x6C\x6F\x64\x61\x73\x68","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x55\x73\x65\x72","\x41\x63\x74\x69\x6F\x6E","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74","\x41\x43\x57\x20\x49\x6E\x69\x74\x69\x61\x6C\x69\x7A\x61\x74\x69\x6F\x6E\x2E\x2E\x2E","\x6C\x6F\x67","\x63\x61\x74\x63\x68","\x69\x64","\x61\x66\x74\x65\x72\x43\x72\x65\x61\x74\x65","\x74\x68\x65\x6E","\x6E\x61\x6D\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x61\x67\x65\x6E\x74","\x73\x63\x6F\x70\x65","\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x71\x75\x65\x75\x65","\x66\x69\x6E\x64","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x50\x41\x55\x53\x45\x44\x20\x42\x59\x20\x41\x43\x57","\x75\x6E\x69\x71\x75\x65\x69\x64","\x64\x65\x73\x74\x75\x6E\x69\x71\x75\x65\x69\x64","\x61\x63\x77\x54\x69\x6D\x65\x6F\x75\x74","\x74\x69\x6D\x65\x6F\x75\x74","\x55\x4E\x50\x41\x55\x53\x45\x44\x20\x42\x59\x20\x41\x43\x57","\x75\x6E\x70\x61\x75\x73\x65","\x41\x43\x57","\x63\x72\x65\x61\x74\x65","\x70\x61\x75\x73\x65","\x62\x6F\x64\x79","\x61\x63\x77\x54\x69\x6D\x65","\x61\x73\x53\x65\x63\x6F\x6E\x64\x73","\x61\x63\x77\x41\x74","\x64\x75\x72\x61\x74\x69\x6F\x6E","\x66\x69\x6E\x61\x6C\x6C\x79","\x75\x70\x64\x61\x74\x65","\x61\x66\x74\x65\x72\x55\x70\x64\x61\x74\x65","\x72\x65\x6D\x6F\x76\x65","\x61\x66\x74\x65\x72\x44\x65\x73\x74\x72\x6F\x79","\x69\x6E\x64\x65\x78\x4F\x66","\x6D\x65\x72\x67\x65","\x75\x6E\x73\x68\x69\x66\x74","\x65\x78\x70\x6F\x72\x74\x73"];_0xcef6[0];var util=require(_0xcef6[1]);var moment=require(_0xcef6[2]);var _=require(_0xcef6[3]);var VoiceQueue=require(_0xcef6[5])[_0xcef6[4]];var Agent=require(_0xcef6[5])[_0xcef6[6]];var Action=require(_0xcef6[5])[_0xcef6[7]];var ReportAgent=require(_0xcef6[5])[_0xcef6[8]];var _voiceQueues;var _agents;var activeAcw={};function AfterCallWork(){console[_0xcef6[10]](_0xcef6[9]);VoiceQueue[_0xcef6[16]]()[_0xcef6[14]](function(_0xfc38x10){_voiceQueues= _0xfc38x10;synchCollection(VoiceQueue,_voiceQueues,_0xcef6[15]);return Agent[_0xcef6[18]](_0xcef6[17])[_0xcef6[16]]()})[_0xcef6[14]](function(_0xfc38xd){_agents= _0xfc38xd;synchCollection(Agent,_agents,_0xcef6[12]);Action[_0xcef6[13]](function(_0xfc38xe,_0xfc38xf){return onSave(_0xfc38xe,_0xfc38xf)})})[_0xcef6[11]](function(_0xfc38xc){console[_0xcef6[10]](_0xfc38xc)})}AfterCallWork[_0xcef6[20]][_0xcef6[19]]= function(_0xfc38x11){var _0xfc38x12=_[_0xcef6[22]](_voiceQueues,{name:_0xfc38x11[_0xcef6[21]],acw:true});if(_0xfc38x12){var _0xfc38x13=_[_0xcef6[22]](_agents,{name:_0xfc38x11[_0xcef6[23]]});if(_0xfc38x13){Action[_0xcef6[32]]({name:_0xcef6[33],data1:_0xcef6[31],data2:_0xfc38x12[_0xcef6[27]],data3:_0xfc38x11[_0xcef6[25]],data4:_0xfc38x11[_0xcef6[21]]},{body:{agent:_0xfc38x13[_0xcef6[12]],type:_0xcef6[31]},raw:true})[_0xcef6[14]](function(){console[_0xcef6[10]](_0xcef6[24]);activeAcw[_0xfc38x13[_0xcef6[12]]]= {uniqueid:_0xfc38x11[_0xcef6[25]],destuniqueid:_0xfc38x11[_0xcef6[26]],acwTime:_0xfc38x12[_0xcef6[27]],acwAt:moment(),unpause:false};activeAcw[_0xfc38x13[_0xcef6[12]]][_0xcef6[28]]= setTimeout(function(){console[_0xcef6[10]](_0xcef6[29]);activeAcw[_0xfc38x13[_0xcef6[12]]][_0xcef6[30]]= true;return Action[_0xcef6[32]]({name:_0xcef6[30],data1:_0xcef6[31],data2:_0xfc38x12[_0xcef6[27]],data3:_0xfc38x11[_0xcef6[25]],data4:_0xfc38x11[_0xcef6[21]]},{body:{agent:_0xfc38x13[_0xcef6[12]],type:_0xcef6[31]},raw:true})[_0xcef6[11]](function(_0xfc38xc){console[_0xcef6[10]](_0xfc38xc)})},_0xfc38x12[_0xcef6[27]]* 1000)})[_0xcef6[11]](function(_0xfc38xc){console[_0xcef6[10]](_0xfc38xc)})}}};function onSave(_0xfc38xe,_0xfc38xf){var _0xfc38x15;if((_0xfc38xe[_0xcef6[15]]=== _0xcef6[33]|| _0xfc38xe[_0xcef6[15]]=== _0xcef6[30])&& activeAcw[_0xfc38xf[_0xcef6[34]][_0xcef6[17]]]){if(_0xfc38xe[_0xcef6[15]]=== _0xcef6[30]&& activeAcw[_0xfc38xf[_0xcef6[34]][_0xcef6[17]]][_0xcef6[30]]){_0xfc38x15= activeAcw[_0xfc38xf[_0xcef6[34]][_0xcef6[17]]][_0xcef6[35]]}else {clearTimeout(activeAcw[_0xfc38xf[_0xcef6[34]][_0xcef6[17]]][_0xcef6[28]]);_0xfc38x15= moment[_0xcef6[38]](moment()- activeAcw[_0xfc38xf[_0xcef6[34]][_0xcef6[17]]][_0xcef6[37]])[_0xcef6[36]]()};return ReportAgent[_0xcef6[40]]({agentacw:true,acwtime:_0xfc38x15},{where:{uniqueid:activeAcw[_0xfc38xf[_0xcef6[34]][_0xcef6[17]]][_0xcef6[25]],destuniqueid:activeAcw[_0xfc38xf[_0xcef6[34]][_0xcef6[17]]][_0xcef6[26]]},individualHooks:true,raw:true})[_0xcef6[11]](function(_0xfc38xc){console[_0xcef6[10]](_0xfc38xc)})[_0xcef6[39]](function(){delete activeAcw[_0xfc38xf[_0xcef6[34]][_0xcef6[17]]]})}}function synchCollection(_0xfc38x17,_0xfc38x18,_0xfc38x19){var _0xfc38x1a={};_0xfc38x17[_0xcef6[13]](function(_0xfc38xe,_0xfc38xf){_0xfc38x1a[_0xfc38x19]= _0xfc38xe[_0xfc38x19];updateCollection(_0xfc38x18,_0xfc38xe,_0xfc38x1a)});_0xfc38x17[_0xcef6[41]](function(_0xfc38xe,_0xfc38xf){_0xfc38x1a[_0xfc38x19]= _0xfc38xe[_0xfc38x19];updateCollection(_0xfc38x18,_0xfc38xe,_0xfc38x1a)});_0xfc38x17[_0xcef6[43]](function(_0xfc38xe,_0xfc38xf){_0xfc38x1a[_0xfc38x19]= _0xfc38xe[_0xfc38x19];_[_0xcef6[42]](_0xfc38x18,_0xfc38x1a)})}function updateCollection(_0xfc38x1c,_0xfc38xe,_0xfc38x1a){var _0xfc38x1d=_[_0xcef6[22]](_0xfc38x1c,_0xfc38x1a);var _0xfc38x1e=_0xfc38x1c[_0xcef6[44]](_0xfc38x1d);if(_0xfc38x1d){_[_0xcef6[45]](_0xfc38x1c[_0xfc38x1e],_0xfc38xe)}else {_0xfc38x1c[_0xcef6[46]](_0xfc38xe)}}module[_0xcef6[47]]= AfterCallWork
\ No newline at end of file