Built motion from commit ee17993.|1.0.6
[motion.git] / server / config / ami / acw.js
index b1b576f..5d484b5 100644 (file)
@@ -1 +1 @@
-var _0xab68=["\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(_0xab68[0]);var _=require(_0xab68[1]);var VoiceQueue=require(_0xab68[3])[_0xab68[2]];var Agent=require(_0xab68[3])[_0xab68[4]];var Action=require(_0xab68[3])[_0xab68[5]];var ReportAgent=require(_0xab68[3])[_0xab68[6]];var _voiceQueues;var _agents;var activeAcw={};function ACW(_0xc9c1xb){console[_0xab68[8]](_0xab68[7]);VoiceQueue[_0xab68[14]]()[_0xab68[12]](function(_0xc9c1x10){_voiceQueues=_0xc9c1x10;synchCollection(VoiceQueue,_voiceQueues,_0xab68[13]);return Agent[_0xab68[16]](_0xab68[15])[_0xab68[14]]()})[_0xab68[12]](function(_0xc9c1xd){_agents=_0xc9c1xd;synchCollection(Agent,_agents,_0xab68[10]);Action[_0xab68[11]](function(_0xc9c1xe,_0xc9c1xf){return onSave(_0xc9c1xe,_0xc9c1xf)})})[_0xab68[9]](function(_0xc9c1xc){console[_0xab68[8]](_0xc9c1xc)})}function onSave(_0xc9c1xe,_0xc9c1xf){if(_0xc9c1xe[_0xab68[13]]===_0xab68[17]&&activeAcw[_0xc9c1xf[_0xab68[18]][_0xab68[15]]]){var _0xc9c1x12;if(activeAcw[_0xc9c1xf[_0xab68[18]][_0xab68[15]]][_0xab68[17]]){_0xc9c1x12=activeAcw[_0xc9c1xf[_0xab68[18]][_0xab68[15]]][_0xab68[19]]}else {clearTimeout(activeAcw[_0xc9c1xf[_0xab68[18]][_0xab68[15]]][_0xab68[20]]);_0xc9c1x12=moment[_0xab68[23]](moment()-activeAcw[_0xc9c1xf[_0xab68[18]][_0xab68[15]]][_0xab68[22]])[_0xab68[21]]()};return ReportAgent[_0xab68[27]]({agentacw:true,acwtime:_0xc9c1x12},{where:{uniqueid:activeAcw[_0xc9c1xf[_0xab68[18]][_0xab68[15]]][_0xab68[24]],destuniqueid:activeAcw[_0xc9c1xf[_0xab68[18]][_0xab68[15]]][_0xab68[25]]},transaction:_0xc9c1xf[_0xab68[26]],individualHooks:true})[_0xab68[12]](function(){delete activeAcw[_0xc9c1xf[_0xab68[18]][_0xab68[15]]]})[_0xab68[9]](function(_0xc9c1xc){console[_0xab68[8]](_0xc9c1xc)})}}ACW[_0xab68[29]][_0xab68[28]]=function(_0xc9c1x13){var _0xc9c1x14=_[_0xab68[31]](_voiceQueues,{name:_0xc9c1x13[_0xab68[30]],acw:true});if(_0xc9c1x14){var _0xc9c1x15=_[_0xab68[31]](_agents,{name:_0xc9c1x13[_0xab68[32]]});Action[_0xab68[37]]({name:_0xab68[38],data1:_0xc9c1x13[_0xab68[30]],data2:_0xc9c1x14[_0xab68[34]],data3:_0xc9c1x13[_0xab68[24]],data4:_0xab68[36]},{body:{agent:_0xc9c1x15[_0xab68[10]],type:_0xab68[36]}})[_0xab68[12]](function(){console[_0xab68[8]](_0xab68[33]);activeAcw[_0xc9c1x15[_0xab68[10]]]={uniqueid:_0xc9c1x13[_0xab68[24]],destuniqueid:_0xc9c1x13[_0xab68[25]],acwTime:_0xc9c1x14[_0xab68[34]],acwAt:moment(),unpause:false};activeAcw[_0xc9c1x15[_0xab68[10]]][_0xab68[20]]=setTimeout(function(){console[_0xab68[8]](_0xab68[35]);activeAcw[_0xc9c1x15[_0xab68[10]]][_0xab68[17]]=true;return Action[_0xab68[37]]({name:_0xab68[17],data1:_0xc9c1x13[_0xab68[30]],data2:_0xc9c1x14[_0xab68[34]],data3:_0xc9c1x13[_0xab68[24]],data4:_0xab68[36]},{body:{agent:_0xc9c1x15[_0xab68[10]],type:_0xab68[36]}})[_0xab68[9]](function(_0xc9c1xc){console[_0xab68[8]](_0xc9c1xc)})},_0xc9c1x14[_0xab68[34]]*1000)})[_0xab68[9]](function(_0xc9c1xc){console[_0xab68[8]](_0xc9c1xc)})}};function synchCollection(_0xc9c1x17,_0xc9c1x18,_0xc9c1x19){var _0xc9c1x1a={};_0xc9c1x17[_0xab68[11]](function(_0xc9c1xe){_0xc9c1x1a[_0xc9c1x19]=_0xc9c1xe[_0xc9c1x19];updateCollection(_0xc9c1x18,_0xc9c1xe,_0xc9c1x1a)});_0xc9c1x17[_0xab68[39]](function(_0xc9c1xe){_0xc9c1x1a[_0xc9c1x19]=_0xc9c1xe[_0xc9c1x19];updateCollection(_0xc9c1x18,_0xc9c1xe,_0xc9c1x1a)});_0xc9c1x17[_0xab68[41]](function(_0xc9c1xe){_0xc9c1x1a[_0xc9c1x19]=_0xc9c1xe[_0xc9c1x19];_[_0xab68[40]](_0xc9c1x18,_0xc9c1x1a)})}function updateCollection(_0xc9c1x1c,_0xc9c1xe,_0xc9c1x1a){var _0xc9c1x1d=_[_0xab68[31]](_0xc9c1x1c,_0xc9c1x1a);var _0xc9c1x1e=_0xc9c1x1c[_0xab68[42]](_0xc9c1x1d);if(_0xc9c1x1d){_[_0xab68[43]](_0xc9c1x1c[_0xc9c1x1e],_0xc9c1xe)}else {_0xc9c1x1c[_0xab68[44]](_0xc9c1xe)}}module[_0xab68[45]]=ACW
\ No newline at end of file
+var _0xed58=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x41\x63\x74\x69\x6F\x6E","\x55\x73\x65\x72","\x65\x78\x70\x6F\x72\x74\x73","\x41\x43\x57","\x66\x69\x6E\x61\x6C\x6C\x79","\x61\x63\x77","\x55\x6E\x70\x61\x75\x73\x65\x55\x73\x65\x72","\x73\x74\x72\x69\x6E\x67\x69\x66\x79","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6C\x6F\x67","\x74\x68\x65\x6E","\x75\x6E\x70\x61\x75\x73\x65","\x63\x72\x65\x61\x74\x65","\x63\x68\x65\x63\x6B\x61\x63\x77","\x74\x69\x6D\x65\x6F\x75\x74\x73","\x72\x70\x63","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x69\x64","\x6E\x61\x6D\x65","\x61\x63\x77\x54\x69\x6D\x65\x6F\x75\x74","\x70\x61\x75\x73\x65","\x75\x6E\x69\x71\x75\x65\x69\x64","\x71\x75\x65\x75\x65","\x76\x6F\x69\x63\x65\x50\x61\x75\x73\x65","\x66\x69\x6E\x64\x4F\x6E\x65"];_0xed58[0];var _=require(_0xed58[1]);var util=require(_0xed58[2]);var moment=require(_0xed58[3]);var BPromise=require(_0xed58[4]);var VoiceQueue=require(_0xed58[6])[_0xed58[5]];var Action=require(_0xed58[6])[_0xed58[7]];var Agent=require(_0xed58[6])[_0xed58[8]];module[_0xed58[9]]= function(){var _0x4b59x8=_0xed58[10];var _0x4b59x9=[];var _0x4b59xa=function(_0x4b59xb,_0x4b59xc){return Action[_0xed58[20]]({name:_0xed58[19],data1:_0xed58[10]},{body:{agent:_0x4b59xb,type:_0xed58[10]},raw:true})[_0xed58[18]](function(){console[_0xed58[17]](_0xed58[12],_0xed58[13],_0x4b59xc);return null})[_0xed58[16]](function(_0x4b59xd){console[_0xed58[15]](_0xed58[12],_0xed58[13],_0x4b59xc,JSON[_0xed58[14]](_0x4b59xd));return null})[_0xed58[11]](function(){if(_0x4b59x9[_0x4b59xc]){clearTimeout(_0x4b59x9[_0x4b59xc]);delete _0x4b59x9[_0x4b59xc]};return null})};return {checkacw:function(_0x4b59xc){if(_0x4b59x9[_0x4b59xc]){console[_0xed58[17]](_0xed58[12],_0xed58[21],_0xed58[22],JSON[_0xed58[14]](_0x4b59x9));console[_0xed58[17]](_0xed58[12],_0xed58[21],_0x4b59xc);clearTimeout(_0x4b59x9[_0x4b59xc]);delete _0x4b59x9[_0x4b59xc]}},agentcomplete:function(_0x4b59xe){return function(_0x4b59xf){var _0x4b59x10,_0x4b59x11;return Agent[_0xed58[32]]({where:{name:_0x4b59xe[_0xed58[24]]}})[_0xed58[18]](function(_0x4b59x12){if(_0x4b59x12&& !_0x4b59x12[_0xed58[31]]){_0x4b59x11= _0x4b59x12;return VoiceQueue[_0xed58[32]]({where:{name:_0x4b59xe[_0xed58[30]]},attributes:[_0xed58[26],_0xed58[12],_0xed58[27]]})};return null})[_0xed58[18]](function(_0x4b59x12){if(_0x4b59x12&& _0x4b59x12[_0xed58[12]]){_0x4b59x10= _0x4b59x12;return Action[_0xed58[20]]({name:_0xed58[28],data1:_0xed58[10],data2:_0x4b59x12[_0xed58[27]],data3:_0x4b59xe[_0xed58[29]],data4:_0x4b59xe[_0xed58[30]]},{body:{agent:_0x4b59x11[_0xed58[25]],type:_0xed58[10]},raw:true})};return null})[_0xed58[18]](function(_0x4b59x12){if(_0x4b59x12){_0x4b59x9[_0x4b59xe[_0xed58[24]]]= setTimeout(function(){_0x4b59xa(_0x4b59x11[_0xed58[25]],_0x4b59x11[_0xed58[26]])},_0x4b59x10[_0xed58[27]]* 1000)};return null})[_0xed58[16]](function(_0x4b59xd){console[_0xed58[15]](_0xed58[23],_0xed58[12],JSON[_0xed58[14]](_0x4b59xd))})}}}}
\ No newline at end of file