Built motion from commit 2438401.|1.0.5
[motion.git] / server / config / ami / acw.js
index 6eee350..347eafd 100644 (file)
@@ -1 +1 @@
-var _0x719a=["\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","\x76\x6F\x69\x63\x65","\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(_0x719a[0]);var _=require(_0x719a[1]);var VoiceQueue=require(_0x719a[3])[_0x719a[2]];var Agent=require(_0x719a[3])[_0x719a[4]];var Action=require(_0x719a[3])[_0x719a[5]];var ReportAgent=require(_0x719a[3])[_0x719a[6]];var _voiceQueues;var _agents;var activeAcw={};function ACW(_0xfdbdxb){console[_0x719a[8]](_0x719a[7]);VoiceQueue[_0x719a[14]]()[_0x719a[12]](function(_0xfdbdx10){_voiceQueues=_0xfdbdx10;synchCollection(VoiceQueue,_voiceQueues,_0x719a[13]);return Agent[_0x719a[16]](_0x719a[15])[_0x719a[14]]()})[_0x719a[12]](function(_0xfdbdxd){_agents=_0xfdbdxd;synchCollection(Agent,_agents,_0x719a[10]);Action[_0x719a[11]](function(_0xfdbdxe,_0xfdbdxf){return onSave(_0xfdbdxe,_0xfdbdxf)})})[_0x719a[9]](function(_0xfdbdxc){console[_0x719a[8]](_0xfdbdxc)})}function onSave(_0xfdbdxe,_0xfdbdxf){if(_0xfdbdxe[_0x719a[13]]===_0x719a[17]&&activeAcw[_0xfdbdxf[_0x719a[18]][_0x719a[15]]]){var _0xfdbdx12;if(activeAcw[_0xfdbdxf[_0x719a[18]][_0x719a[15]]][_0x719a[17]]){_0xfdbdx12=activeAcw[_0xfdbdxf[_0x719a[18]][_0x719a[15]]][_0x719a[19]]}else {clearTimeout(activeAcw[_0xfdbdxf[_0x719a[18]][_0x719a[15]]][_0x719a[20]]);_0xfdbdx12=moment[_0x719a[23]](moment()-activeAcw[_0xfdbdxf[_0x719a[18]][_0x719a[15]]][_0x719a[22]])[_0x719a[21]]()};return ReportAgent[_0x719a[27]]({agentacw:true,acwtime:_0xfdbdx12},{where:{uniqueid:activeAcw[_0xfdbdxf[_0x719a[18]][_0x719a[15]]][_0x719a[24]],destuniqueid:activeAcw[_0xfdbdxf[_0x719a[18]][_0x719a[15]]][_0x719a[25]]},transaction:_0xfdbdxf[_0x719a[26]],individualHooks:true})[_0x719a[12]](function(){delete activeAcw[_0xfdbdxf[_0x719a[18]][_0x719a[15]]]})[_0x719a[9]](function(_0xfdbdxc){console[_0x719a[8]](_0xfdbdxc)})}}ACW[_0x719a[29]][_0x719a[28]]=function(_0xfdbdx13){var _0xfdbdx14=_[_0x719a[31]](_voiceQueues,{name:_0xfdbdx13[_0x719a[30]],acw:true});if(_0xfdbdx14){var _0xfdbdx15=_[_0x719a[31]](_agents,{name:_0xfdbdx13[_0x719a[32]]});Action[_0x719a[38]]({name:_0x719a[39],data1:_0xfdbdx13[_0x719a[30]],data2:_0xfdbdx14[_0x719a[34]],data3:_0xfdbdx13[_0x719a[24]],data4:_0x719a[36]},{body:{agent:_0xfdbdx15[_0x719a[10]],type:_0x719a[36]}})[_0x719a[12]](function(){console[_0x719a[8]](_0x719a[33]);activeAcw[_0xfdbdx15[_0x719a[10]]]={uniqueid:_0xfdbdx13[_0x719a[24]],destuniqueid:_0xfdbdx13[_0x719a[25]],acwTime:_0xfdbdx14[_0x719a[34]],acwAt:moment(),unpause:false};activeAcw[_0xfdbdx15[_0x719a[10]]][_0x719a[20]]=setTimeout(function(){console[_0x719a[8]](_0x719a[35]);activeAcw[_0xfdbdx15[_0x719a[10]]][_0x719a[17]]=true;return Action[_0x719a[38]]({name:_0x719a[17],data1:_0xfdbdx13[_0x719a[30]],data2:_0xfdbdx14[_0x719a[34]],data3:_0xfdbdx13[_0x719a[24]],data4:_0x719a[36]},{body:{agent:_0xfdbdx15[_0x719a[10]],type:_0x719a[36],channel:_0x719a[37]}})[_0x719a[9]](function(_0xfdbdxc){console[_0x719a[8]](_0xfdbdxc)})},_0xfdbdx14[_0x719a[34]]*1000)})[_0x719a[9]](function(_0xfdbdxc){console[_0x719a[8]](_0xfdbdxc)})}};function synchCollection(_0xfdbdx17,_0xfdbdx18,_0xfdbdx19){var _0xfdbdx1a={};_0xfdbdx17[_0x719a[11]](function(_0xfdbdxe){_0xfdbdx1a[_0xfdbdx19]=_0xfdbdxe[_0xfdbdx19];updateCollection(_0xfdbdx18,_0xfdbdxe,_0xfdbdx1a)});_0xfdbdx17[_0x719a[40]](function(_0xfdbdxe){_0xfdbdx1a[_0xfdbdx19]=_0xfdbdxe[_0xfdbdx19];updateCollection(_0xfdbdx18,_0xfdbdxe,_0xfdbdx1a)});_0xfdbdx17[_0x719a[42]](function(_0xfdbdxe){_0xfdbdx1a[_0xfdbdx19]=_0xfdbdxe[_0xfdbdx19];_[_0x719a[41]](_0xfdbdx18,_0xfdbdx1a)})}function updateCollection(_0xfdbdx1c,_0xfdbdxe,_0xfdbdx1a){var _0xfdbdx1d=_[_0x719a[31]](_0xfdbdx1c,_0xfdbdx1a);var _0xfdbdx1e=_0xfdbdx1c[_0x719a[43]](_0xfdbdx1d);if(_0xfdbdx1d){_[_0x719a[44]](_0xfdbdx1c[_0xfdbdx1e],_0xfdbdxe)}else {_0xfdbdx1c[_0x719a[45]](_0xfdbdxe)}}module[_0x719a[46]]=ACW
\ No newline at end of file
+var _0x1f47=["\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"];_0x1f47[0];var _=require(_0x1f47[1]);var util=require(_0x1f47[2]);var moment=require(_0x1f47[3]);var BPromise=require(_0x1f47[4]);var VoiceQueue=require(_0x1f47[6])[_0x1f47[5]];var Action=require(_0x1f47[6])[_0x1f47[7]];var Agent=require(_0x1f47[6])[_0x1f47[8]];module[_0x1f47[9]]= function(){var _0xa611x8=_0x1f47[10];var _0xa611x9=[];var _0xa611xa=function(_0xa611xb,_0xa611xc){return Action[_0x1f47[20]]({name:_0x1f47[19],data1:_0x1f47[10]},{body:{agent:_0xa611xb,type:_0x1f47[10]},raw:true})[_0x1f47[18]](function(){console[_0x1f47[17]](_0x1f47[12],_0x1f47[13],_0xa611xc);return null})[_0x1f47[16]](function(_0xa611xd){console[_0x1f47[15]](_0x1f47[12],_0x1f47[13],_0xa611xc,JSON[_0x1f47[14]](_0xa611xd));return null})[_0x1f47[11]](function(){if(_0xa611x9[_0xa611xc]){clearTimeout(_0xa611x9[_0xa611xc]);delete _0xa611x9[_0xa611xc]};return null})};return {checkacw:function(_0xa611xc){if(_0xa611x9[_0xa611xc]){console[_0x1f47[17]](_0x1f47[12],_0x1f47[21],_0x1f47[22],JSON[_0x1f47[14]](_0xa611x9));console[_0x1f47[17]](_0x1f47[12],_0x1f47[21],_0xa611xc);clearTimeout(_0xa611x9[_0xa611xc]);delete _0xa611x9[_0xa611xc]}},agentcomplete:function(_0xa611xe){return function(_0xa611xf){var _0xa611x10,_0xa611x11;return Agent[_0x1f47[32]]({where:{name:_0xa611xe[_0x1f47[24]]}})[_0x1f47[18]](function(_0xa611x12){if(_0xa611x12&& !_0xa611x12[_0x1f47[31]]){_0xa611x11= _0xa611x12;return VoiceQueue[_0x1f47[32]]({where:{name:_0xa611xe[_0x1f47[30]]},attributes:[_0x1f47[26],_0x1f47[12],_0x1f47[27]]})};return null})[_0x1f47[18]](function(_0xa611x12){if(_0xa611x12&& _0xa611x12[_0x1f47[12]]){_0xa611x10= _0xa611x12;return Action[_0x1f47[20]]({name:_0x1f47[28],data1:_0x1f47[10],data2:_0xa611x12[_0x1f47[27]],data3:_0xa611xe[_0x1f47[29]],data4:_0xa611xe[_0x1f47[30]]},{body:{agent:_0xa611x11[_0x1f47[25]],type:_0x1f47[10]},raw:true})};return null})[_0x1f47[18]](function(_0xa611x12){if(_0xa611x12){_0xa611x9[_0xa611xe[_0x1f47[24]]]= setTimeout(function(){_0xa611xa(_0xa611x11[_0x1f47[25]],_0xa611x11[_0x1f47[26]])},_0xa611x10[_0x1f47[27]]* 1000)};return null})[_0x1f47[16]](function(_0xa611xd){console[_0x1f47[15]](_0x1f47[23],_0x1f47[12],JSON[_0x1f47[14]](_0xa611xd))})}}}}
\ No newline at end of file