Built motion from commit 5781103.|1.0.7
[motion.git] / server / config / ami / acw.js
index 3f549d7..dc68749 100644 (file)
@@ -1 +1 @@
-var _0xcbf3=["\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(_0xcbf3[0]);var _=require(_0xcbf3[1]);var VoiceQueue=require(_0xcbf3[3])[_0xcbf3[2]];var Agent=require(_0xcbf3[3])[_0xcbf3[4]];var Action=require(_0xcbf3[3])[_0xcbf3[5]];var ReportAgent=require(_0xcbf3[3])[_0xcbf3[6]];var _voiceQueues;var _agents;var activeAcw={};function ACW(_0x2c31xb){console[_0xcbf3[8]](_0xcbf3[7]);VoiceQueue[_0xcbf3[14]]()[_0xcbf3[12]](function(_0x2c31x10){_voiceQueues=_0x2c31x10;synchCollection(VoiceQueue,_voiceQueues,_0xcbf3[13]);return Agent[_0xcbf3[16]](_0xcbf3[15])[_0xcbf3[14]]()})[_0xcbf3[12]](function(_0x2c31xd){_agents=_0x2c31xd;synchCollection(Agent,_agents,_0xcbf3[10]);Action[_0xcbf3[11]](function(_0x2c31xe,_0x2c31xf){return onSave(_0x2c31xe,_0x2c31xf)})})[_0xcbf3[9]](function(_0x2c31xc){console[_0xcbf3[8]](_0x2c31xc)})}function onSave(_0x2c31xe,_0x2c31xf){if(_0x2c31xe[_0xcbf3[13]]===_0xcbf3[17]&&activeAcw[_0x2c31xf[_0xcbf3[18]][_0xcbf3[15]]]){var _0x2c31x12;if(activeAcw[_0x2c31xf[_0xcbf3[18]][_0xcbf3[15]]][_0xcbf3[17]]){_0x2c31x12=activeAcw[_0x2c31xf[_0xcbf3[18]][_0xcbf3[15]]][_0xcbf3[19]]}else {clearTimeout(activeAcw[_0x2c31xf[_0xcbf3[18]][_0xcbf3[15]]][_0xcbf3[20]]);_0x2c31x12=moment[_0xcbf3[23]](moment()-activeAcw[_0x2c31xf[_0xcbf3[18]][_0xcbf3[15]]][_0xcbf3[22]])[_0xcbf3[21]]()};return ReportAgent[_0xcbf3[27]]({agentacw:true,acwtime:_0x2c31x12},{where:{uniqueid:activeAcw[_0x2c31xf[_0xcbf3[18]][_0xcbf3[15]]][_0xcbf3[24]],destuniqueid:activeAcw[_0x2c31xf[_0xcbf3[18]][_0xcbf3[15]]][_0xcbf3[25]]},transaction:_0x2c31xf[_0xcbf3[26]],individualHooks:true})[_0xcbf3[12]](function(){delete activeAcw[_0x2c31xf[_0xcbf3[18]][_0xcbf3[15]]]})[_0xcbf3[9]](function(_0x2c31xc){console[_0xcbf3[8]](_0x2c31xc)})}}ACW[_0xcbf3[29]][_0xcbf3[28]]=function(_0x2c31x13){var _0x2c31x14=_[_0xcbf3[31]](_voiceQueues,{name:_0x2c31x13[_0xcbf3[30]],acw:true});if(_0x2c31x14){var _0x2c31x15=_[_0xcbf3[31]](_agents,{name:_0x2c31x13[_0xcbf3[32]]});Action[_0xcbf3[37]]({name:_0xcbf3[38],data1:_0x2c31x13[_0xcbf3[30]],data2:_0x2c31x14[_0xcbf3[34]],data3:_0x2c31x13[_0xcbf3[24]],data4:_0xcbf3[36]},{body:{agent:_0x2c31x15[_0xcbf3[10]],type:_0xcbf3[36]}})[_0xcbf3[12]](function(){console[_0xcbf3[8]](_0xcbf3[33]);activeAcw[_0x2c31x15[_0xcbf3[10]]]={uniqueid:_0x2c31x13[_0xcbf3[24]],destuniqueid:_0x2c31x13[_0xcbf3[25]],acwTime:_0x2c31x14[_0xcbf3[34]],acwAt:moment(),unpause:false};activeAcw[_0x2c31x15[_0xcbf3[10]]][_0xcbf3[20]]=setTimeout(function(){console[_0xcbf3[8]](_0xcbf3[35]);activeAcw[_0x2c31x15[_0xcbf3[10]]][_0xcbf3[17]]=true;return Action[_0xcbf3[37]]({name:_0xcbf3[17],data1:_0x2c31x13[_0xcbf3[30]],data2:_0x2c31x14[_0xcbf3[34]],data3:_0x2c31x13[_0xcbf3[24]],data4:_0xcbf3[36]},{body:{agent:_0x2c31x15[_0xcbf3[10]],type:_0xcbf3[36]}})[_0xcbf3[9]](function(_0x2c31xc){console[_0xcbf3[8]](_0x2c31xc)})},_0x2c31x14[_0xcbf3[34]]*1000)})[_0xcbf3[9]](function(_0x2c31xc){console[_0xcbf3[8]](_0x2c31xc)})}};function synchCollection(_0x2c31x17,_0x2c31x18,_0x2c31x19){var _0x2c31x1a={};_0x2c31x17[_0xcbf3[11]](function(_0x2c31xe){_0x2c31x1a[_0x2c31x19]=_0x2c31xe[_0x2c31x19];updateCollection(_0x2c31x18,_0x2c31xe,_0x2c31x1a)});_0x2c31x17[_0xcbf3[39]](function(_0x2c31xe){_0x2c31x1a[_0x2c31x19]=_0x2c31xe[_0x2c31x19];updateCollection(_0x2c31x18,_0x2c31xe,_0x2c31x1a)});_0x2c31x17[_0xcbf3[41]](function(_0x2c31xe){_0x2c31x1a[_0x2c31x19]=_0x2c31xe[_0x2c31x19];_[_0xcbf3[40]](_0x2c31x18,_0x2c31x1a)})}function updateCollection(_0x2c31x1c,_0x2c31xe,_0x2c31x1a){var _0x2c31x1d=_[_0xcbf3[31]](_0x2c31x1c,_0x2c31x1a);var _0x2c31x1e=_0x2c31x1c[_0xcbf3[42]](_0x2c31x1d);if(_0x2c31x1d){_[_0xcbf3[43]](_0x2c31x1c[_0x2c31x1e],_0x2c31xe)}else {_0x2c31x1c[_0xcbf3[44]](_0x2c31xe)}}module[_0xcbf3[45]]=ACW
\ No newline at end of file
+var _0xc8da=["\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"];_0xc8da[0];var _=require(_0xc8da[1]);var util=require(_0xc8da[2]);var moment=require(_0xc8da[3]);var BPromise=require(_0xc8da[4]);var VoiceQueue=require(_0xc8da[6])[_0xc8da[5]];var Action=require(_0xc8da[6])[_0xc8da[7]];var Agent=require(_0xc8da[6])[_0xc8da[8]];module[_0xc8da[9]]= function(){var _0x7cb8x8=_0xc8da[10];var _0x7cb8x9=[];var _0x7cb8xa=function(_0x7cb8xb,_0x7cb8xc){return Action[_0xc8da[20]]({name:_0xc8da[19],data1:_0xc8da[10]},{body:{agent:_0x7cb8xb,type:_0xc8da[10]},raw:true})[_0xc8da[18]](function(){console[_0xc8da[17]](_0xc8da[12],_0xc8da[13],_0x7cb8xc);return null})[_0xc8da[16]](function(_0x7cb8xd){console[_0xc8da[15]](_0xc8da[12],_0xc8da[13],_0x7cb8xc,JSON[_0xc8da[14]](_0x7cb8xd));return null})[_0xc8da[11]](function(){if(_0x7cb8x9[_0x7cb8xc]){clearTimeout(_0x7cb8x9[_0x7cb8xc]);delete _0x7cb8x9[_0x7cb8xc]};return null})};return {checkacw:function(_0x7cb8xc){if(_0x7cb8x9[_0x7cb8xc]){console[_0xc8da[17]](_0xc8da[12],_0xc8da[21],_0xc8da[22],JSON[_0xc8da[14]](_0x7cb8x9));console[_0xc8da[17]](_0xc8da[12],_0xc8da[21],_0x7cb8xc);clearTimeout(_0x7cb8x9[_0x7cb8xc]);delete _0x7cb8x9[_0x7cb8xc]}},agentcomplete:function(_0x7cb8xe){return function(_0x7cb8xf){var _0x7cb8x10,_0x7cb8x11;return Agent[_0xc8da[32]]({where:{name:_0x7cb8xe[_0xc8da[24]]}})[_0xc8da[18]](function(_0x7cb8x12){if(_0x7cb8x12&& !_0x7cb8x12[_0xc8da[31]]){_0x7cb8x11= _0x7cb8x12;return VoiceQueue[_0xc8da[32]]({where:{name:_0x7cb8xe[_0xc8da[30]]},attributes:[_0xc8da[26],_0xc8da[12],_0xc8da[27]]})};return null})[_0xc8da[18]](function(_0x7cb8x12){if(_0x7cb8x12&& _0x7cb8x12[_0xc8da[12]]){_0x7cb8x10= _0x7cb8x12;return Action[_0xc8da[20]]({name:_0xc8da[28],data1:_0xc8da[10],data2:_0x7cb8x12[_0xc8da[27]],data3:_0x7cb8xe[_0xc8da[29]],data4:_0x7cb8xe[_0xc8da[30]]},{body:{agent:_0x7cb8x11[_0xc8da[25]],type:_0xc8da[10]},raw:true})};return null})[_0xc8da[18]](function(_0x7cb8x12){if(_0x7cb8x12){_0x7cb8x9[_0x7cb8xe[_0xc8da[24]]]= setTimeout(function(){_0x7cb8xa(_0x7cb8x11[_0xc8da[25]],_0x7cb8x11[_0xc8da[26]])},_0x7cb8x10[_0xc8da[27]]* 1000)};return null})[_0xc8da[16]](function(_0x7cb8xd){console[_0xc8da[15]](_0xc8da[23],_0xc8da[12],JSON[_0xc8da[14]](_0x7cb8xd))})}}}}
\ No newline at end of file