Built motion from commit ee60659.|0.0.144
[motion.git] / server / config / ami / acw.js
index fec72c9..080ddc4 100644 (file)
@@ -1 +1 @@
-var _0xf7bf=["\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","\x75\x6E\x70\x61\x75\x73\x65","\x62\x6F\x64\x79","\x61\x63\x77\x54\x69\x6D\x65","\x74\x69\x6D\x65\x6F\x75\x74","\x61\x73\x53\x65\x63\x6F\x6E\x64\x73","\x61\x63\x77\x41\x74","\x64\x75\x72\x61\x74\x69\x6F\x6E","\x75\x6E\x69\x71\x75\x65\x69\x64","\x64\x65\x73\x74\x75\x6E\x69\x71\x75\x65\x69\x64","\x74\x72\x61\x6E\x73\x61\x63\x74\x69\x6F\x6E","\x75\x70\x64\x61\x74\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","\x61\x63\x77\x54\x69\x6D\x65\x6F\x75\x74","\x55\x4E\x50\x41\x55\x53\x45\x44\x20\x42\x59\x20\x41\x43\x57","\x41\x43\x57","\x63\x72\x65\x61\x74\x65","\x70\x61\x75\x73\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"];var moment=require(_0xf7bf[0]);var _=require(_0xf7bf[1]);var VoiceQueue=require(_0xf7bf[3])[_0xf7bf[2]];var Agent=require(_0xf7bf[3])[_0xf7bf[4]];var Action=require(_0xf7bf[3])[_0xf7bf[5]];var ReportAgent=require(_0xf7bf[3])[_0xf7bf[6]];var _voiceQueues;var _agents;var activeAcw={};function ACW(_0x9662xb){console[_0xf7bf[8]](_0xf7bf[7]);VoiceQueue[_0xf7bf[14]]()[_0xf7bf[12]](function(_0x9662x10){_voiceQueues=_0x9662x10;synchCollection(VoiceQueue,_voiceQueues,_0xf7bf[13]);return Agent[_0xf7bf[16]](_0xf7bf[15])[_0xf7bf[14]]()})[_0xf7bf[12]](function(_0x9662xd){_agents=_0x9662xd;synchCollection(Agent,_agents,_0xf7bf[10]);Action[_0xf7bf[11]](function(_0x9662xe,_0x9662xf){return onSave(_0x9662xe,_0x9662xf)})})[_0xf7bf[9]](function(_0x9662xc){console[_0xf7bf[8]](_0x9662xc)})}function onSave(_0x9662xe,_0x9662xf){if(_0x9662xe[_0xf7bf[13]]===_0xf7bf[17]&&activeAcw[_0x9662xf[_0xf7bf[18]][_0xf7bf[15]]]){var _0x9662x12;if(activeAcw[_0x9662xf[_0xf7bf[18]][_0xf7bf[15]]][_0xf7bf[17]]){_0x9662x12=activeAcw[_0x9662xf[_0xf7bf[18]][_0xf7bf[15]]][_0xf7bf[19]]}else {clearTimeout(activeAcw[_0x9662xf[_0xf7bf[18]][_0xf7bf[15]]][_0xf7bf[20]]);_0x9662x12=moment[_0xf7bf[23]](moment()-activeAcw[_0x9662xf[_0xf7bf[18]][_0xf7bf[15]]][_0xf7bf[22]])[_0xf7bf[21]]()};return ReportAgent[_0xf7bf[27]]({agentacw:true,acwtime:_0x9662x12},{where:{uniqueid:activeAcw[_0x9662xf[_0xf7bf[18]][_0xf7bf[15]]][_0xf7bf[24]],destuniqueid:activeAcw[_0x9662xf[_0xf7bf[18]][_0xf7bf[15]]][_0xf7bf[25]]},transaction:_0x9662xf[_0xf7bf[26]],individualHooks:true})[_0xf7bf[12]](function(){delete activeAcw[_0x9662xf[_0xf7bf[18]][_0xf7bf[15]]]})[_0xf7bf[9]](function(_0x9662xc){console[_0xf7bf[8]](_0x9662xc)})}}ACW[_0xf7bf[29]][_0xf7bf[28]]=function(_0x9662x13){var _0x9662x14=_[_0xf7bf[31]](_voiceQueues,{name:_0x9662x13[_0xf7bf[30]],acw:true});if(_0x9662x14){var _0x9662x15=_[_0xf7bf[31]](_agents,{name:_0x9662x13[_0xf7bf[32]]});Action[_0xf7bf[37]]({name:_0xf7bf[38],data1:_0xf7bf[36],data2:_0x9662x14[_0xf7bf[34]],data3:_0x9662x13[_0xf7bf[24]],data4:_0x9662x13[_0xf7bf[30]]},{body:{agent:_0x9662x15[_0xf7bf[10]],type:_0xf7bf[36]}})[_0xf7bf[12]](function(){console[_0xf7bf[8]](_0xf7bf[33]);activeAcw[_0x9662x15[_0xf7bf[10]]]={uniqueid:_0x9662x13[_0xf7bf[24]],destuniqueid:_0x9662x13[_0xf7bf[25]],acwTime:_0x9662x14[_0xf7bf[34]],acwAt:moment(),unpause:false};activeAcw[_0x9662x15[_0xf7bf[10]]][_0xf7bf[20]]=setTimeout(function(){console[_0xf7bf[8]](_0xf7bf[35]);activeAcw[_0x9662x15[_0xf7bf[10]]][_0xf7bf[17]]=true;return Action[_0xf7bf[37]]({name:_0xf7bf[17],data1:_0xf7bf[36],data2:_0x9662x14[_0xf7bf[34]],data3:_0x9662x13[_0xf7bf[24]],data4:_0x9662x13[_0xf7bf[30]]},{body:{agent:_0x9662x15[_0xf7bf[10]],type:_0xf7bf[36]}})[_0xf7bf[9]](function(_0x9662xc){console[_0xf7bf[8]](_0x9662xc)})},_0x9662x14[_0xf7bf[34]]*1000)})[_0xf7bf[9]](function(_0x9662xc){console[_0xf7bf[8]](_0x9662xc)})}};function synchCollection(_0x9662x17,_0x9662x18,_0x9662x19){var _0x9662x1a={};_0x9662x17[_0xf7bf[11]](function(_0x9662xe){_0x9662x1a[_0x9662x19]=_0x9662xe[_0x9662x19];updateCollection(_0x9662x18,_0x9662xe,_0x9662x1a)});_0x9662x17[_0xf7bf[39]](function(_0x9662xe){_0x9662x1a[_0x9662x19]=_0x9662xe[_0x9662x19];updateCollection(_0x9662x18,_0x9662xe,_0x9662x1a)});_0x9662x17[_0xf7bf[41]](function(_0x9662xe){_0x9662x1a[_0x9662x19]=_0x9662xe[_0x9662x19];_[_0xf7bf[40]](_0x9662x18,_0x9662x1a)})}function updateCollection(_0x9662x1c,_0x9662xe,_0x9662x1a){var _0x9662x1d=_[_0xf7bf[31]](_0x9662x1c,_0x9662x1a);var _0x9662x1e=_0x9662x1c[_0xf7bf[42]](_0x9662x1d);if(_0x9662x1d){_[_0xf7bf[43]](_0x9662x1c[_0x9662x1e],_0x9662xe)}else {_0x9662x1c[_0xf7bf[44]](_0x9662xe)}}module[_0xf7bf[45]]=ACW
\ No newline at end of file
+var _0xb4bd=["\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"];_0xb4bd[0];var util=require(_0xb4bd[1]);var moment=require(_0xb4bd[2]);var _=require(_0xb4bd[3]);var VoiceQueue=require(_0xb4bd[5])[_0xb4bd[4]];var Agent=require(_0xb4bd[5])[_0xb4bd[6]];var Action=require(_0xb4bd[5])[_0xb4bd[7]];var ReportAgent=require(_0xb4bd[5])[_0xb4bd[8]];var _voiceQueues;var _agents;var activeAcw={};function AfterCallWork(){console[_0xb4bd[10]](_0xb4bd[9]);VoiceQueue[_0xb4bd[16]]()[_0xb4bd[14]](function(_0xf764x10){_voiceQueues= _0xf764x10;synchCollection(VoiceQueue,_voiceQueues,_0xb4bd[15]);return Agent[_0xb4bd[18]](_0xb4bd[17])[_0xb4bd[16]]()})[_0xb4bd[14]](function(_0xf764xd){_agents= _0xf764xd;synchCollection(Agent,_agents,_0xb4bd[12]);Action[_0xb4bd[13]](function(_0xf764xe,_0xf764xf){return onSave(_0xf764xe,_0xf764xf)})})[_0xb4bd[11]](function(_0xf764xc){console[_0xb4bd[10]](_0xf764xc)})}AfterCallWork[_0xb4bd[20]][_0xb4bd[19]]= function(_0xf764x11){var _0xf764x12=_[_0xb4bd[22]](_voiceQueues,{name:_0xf764x11[_0xb4bd[21]],acw:true});if(_0xf764x12){var _0xf764x13=_[_0xb4bd[22]](_agents,{name:_0xf764x11[_0xb4bd[23]]});if(_0xf764x13){Action[_0xb4bd[32]]({name:_0xb4bd[33],data1:_0xb4bd[31],data2:_0xf764x12[_0xb4bd[27]],data3:_0xf764x11[_0xb4bd[25]],data4:_0xf764x11[_0xb4bd[21]]},{body:{agent:_0xf764x13[_0xb4bd[12]],type:_0xb4bd[31]},raw:true})[_0xb4bd[14]](function(){console[_0xb4bd[10]](_0xb4bd[24]);activeAcw[_0xf764x13[_0xb4bd[12]]]= {uniqueid:_0xf764x11[_0xb4bd[25]],destuniqueid:_0xf764x11[_0xb4bd[26]],acwTime:_0xf764x12[_0xb4bd[27]],acwAt:moment(),unpause:false};activeAcw[_0xf764x13[_0xb4bd[12]]][_0xb4bd[28]]= setTimeout(function(){console[_0xb4bd[10]](_0xb4bd[29]);activeAcw[_0xf764x13[_0xb4bd[12]]][_0xb4bd[30]]= true;return Action[_0xb4bd[32]]({name:_0xb4bd[30],data1:_0xb4bd[31],data2:_0xf764x12[_0xb4bd[27]],data3:_0xf764x11[_0xb4bd[25]],data4:_0xf764x11[_0xb4bd[21]]},{body:{agent:_0xf764x13[_0xb4bd[12]],type:_0xb4bd[31]},raw:true})[_0xb4bd[11]](function(_0xf764xc){console[_0xb4bd[10]](_0xf764xc)})},_0xf764x12[_0xb4bd[27]]* 1000)})[_0xb4bd[11]](function(_0xf764xc){console[_0xb4bd[10]](_0xf764xc)})}}};function onSave(_0xf764xe,_0xf764xf){var _0xf764x15;if((_0xf764xe[_0xb4bd[15]]=== _0xb4bd[33]|| _0xf764xe[_0xb4bd[15]]=== _0xb4bd[30])&& activeAcw[_0xf764xf[_0xb4bd[34]][_0xb4bd[17]]]){if(_0xf764xe[_0xb4bd[15]]=== _0xb4bd[30]&& activeAcw[_0xf764xf[_0xb4bd[34]][_0xb4bd[17]]][_0xb4bd[30]]){_0xf764x15= activeAcw[_0xf764xf[_0xb4bd[34]][_0xb4bd[17]]][_0xb4bd[35]]}else {clearTimeout(activeAcw[_0xf764xf[_0xb4bd[34]][_0xb4bd[17]]][_0xb4bd[28]]);_0xf764x15= moment[_0xb4bd[38]](moment()- activeAcw[_0xf764xf[_0xb4bd[34]][_0xb4bd[17]]][_0xb4bd[37]])[_0xb4bd[36]]()};return ReportAgent[_0xb4bd[40]]({agentacw:true,acwtime:_0xf764x15},{where:{uniqueid:activeAcw[_0xf764xf[_0xb4bd[34]][_0xb4bd[17]]][_0xb4bd[25]],destuniqueid:activeAcw[_0xf764xf[_0xb4bd[34]][_0xb4bd[17]]][_0xb4bd[26]]},individualHooks:true,raw:true})[_0xb4bd[11]](function(_0xf764xc){console[_0xb4bd[10]](_0xf764xc)})[_0xb4bd[39]](function(){delete activeAcw[_0xf764xf[_0xb4bd[34]][_0xb4bd[17]]]})}}function synchCollection(_0xf764x17,_0xf764x18,_0xf764x19){var _0xf764x1a={};_0xf764x17[_0xb4bd[13]](function(_0xf764xe,_0xf764xf){_0xf764x1a[_0xf764x19]= _0xf764xe[_0xf764x19];updateCollection(_0xf764x18,_0xf764xe,_0xf764x1a)});_0xf764x17[_0xb4bd[41]](function(_0xf764xe,_0xf764xf){_0xf764x1a[_0xf764x19]= _0xf764xe[_0xf764x19];updateCollection(_0xf764x18,_0xf764xe,_0xf764x1a)});_0xf764x17[_0xb4bd[43]](function(_0xf764xe,_0xf764xf){_0xf764x1a[_0xf764x19]= _0xf764xe[_0xf764x19];_[_0xb4bd[42]](_0xf764x18,_0xf764x1a)})}function updateCollection(_0xf764x1c,_0xf764xe,_0xf764x1a){var _0xf764x1d=_[_0xb4bd[22]](_0xf764x1c,_0xf764x1a);var _0xf764x1e=_0xf764x1c[_0xb4bd[44]](_0xf764x1d);if(_0xf764x1d){_[_0xb4bd[45]](_0xf764x1c[_0xf764x1e],_0xf764xe)}else {_0xf764x1c[_0xb4bd[46]](_0xf764xe)}}module[_0xb4bd[47]]= AfterCallWork
\ No newline at end of file