Built motion from commit c36c9c6.|1.0.17
[motion.git] / server / config / ami / acw.js
index 9c16f6a..88ac5e0 100644 (file)
@@ -1 +1 @@
-var _0xe174=["\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","\x70\x61\x75\x73\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","\x66\x69\x6E\x61\x6C\x6C\x79","\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","\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(_0xe174[0]);var _=require(_0xe174[1]);var VoiceQueue=require(_0xe174[3])[_0xe174[2]];var Agent=require(_0xe174[3])[_0xe174[4]];var Action=require(_0xe174[3])[_0xe174[5]];var ReportAgent=require(_0xe174[3])[_0xe174[6]];var _voiceQueues;var _agents;var activeAcw={};function ACW(_0xe574xb){console[_0xe174[8]](_0xe174[7]);VoiceQueue[_0xe174[14]]()[_0xe174[12]](function(_0xe574x10){_voiceQueues= _0xe574x10;synchCollection(VoiceQueue,_voiceQueues,_0xe174[13]);return Agent[_0xe174[16]](_0xe174[15])[_0xe174[14]]()})[_0xe174[12]](function(_0xe574xd){_agents= _0xe574xd;synchCollection(Agent,_agents,_0xe174[10]);Action[_0xe174[11]](function(_0xe574xe,_0xe574xf){return onSave(_0xe574xe,_0xe574xf)})})[_0xe174[9]](function(_0xe574xc){console[_0xe174[8]](_0xe574xc)})}function onSave(_0xe574xe,_0xe574xf){var _0xe574x12;if((_0xe574xe[_0xe174[13]]=== _0xe174[17]|| _0xe574xe[_0xe174[13]]=== _0xe174[18])&& activeAcw[_0xe574xf[_0xe174[19]][_0xe174[15]]]){if(_0xe574xe[_0xe174[13]]=== _0xe174[18]&& activeAcw[_0xe574xf[_0xe174[19]][_0xe174[15]]][_0xe174[18]]){_0xe574x12= activeAcw[_0xe574xf[_0xe174[19]][_0xe174[15]]][_0xe174[20]]}else {clearTimeout(activeAcw[_0xe574xf[_0xe174[19]][_0xe174[15]]][_0xe174[21]]);_0xe574x12= moment[_0xe174[24]](moment()- activeAcw[_0xe574xf[_0xe174[19]][_0xe174[15]]][_0xe174[23]])[_0xe174[22]]()};return ReportAgent[_0xe174[29]]({agentacw:true,acwtime:_0xe574x12},{where:{uniqueid:activeAcw[_0xe574xf[_0xe174[19]][_0xe174[15]]][_0xe174[26]],destuniqueid:activeAcw[_0xe574xf[_0xe174[19]][_0xe174[15]]][_0xe174[27]]},transaction:_0xe574xf[_0xe174[28]],individualHooks:true})[_0xe174[9]](function(_0xe574xc){console[_0xe174[8]](_0xe574xc)})[_0xe174[25]](function(){delete activeAcw[_0xe574xf[_0xe174[19]][_0xe174[15]]]})}}ACW[_0xe174[31]][_0xe174[30]]= function(_0xe574x13){var _0xe574x14=_[_0xe174[33]](_voiceQueues,{name:_0xe574x13[_0xe174[32]],acw:true});if(_0xe574x14){var _0xe574x15=_[_0xe174[33]](_agents,{name:_0xe574x13[_0xe174[34]]});Action[_0xe174[39]]({name:_0xe174[17],data1:_0xe174[38],data2:_0xe574x14[_0xe174[36]],data3:_0xe574x13[_0xe174[26]],data4:_0xe574x13[_0xe174[32]]},{body:{agent:_0xe574x15[_0xe174[10]],type:_0xe174[38]}})[_0xe174[12]](function(){console[_0xe174[8]](_0xe174[35]);activeAcw[_0xe574x15[_0xe174[10]]]= {uniqueid:_0xe574x13[_0xe174[26]],destuniqueid:_0xe574x13[_0xe174[27]],acwTime:_0xe574x14[_0xe174[36]],acwAt:moment(),unpause:false};activeAcw[_0xe574x15[_0xe174[10]]][_0xe174[21]]= setTimeout(function(){console[_0xe174[8]](_0xe174[37]);activeAcw[_0xe574x15[_0xe174[10]]][_0xe174[18]]= true;return Action[_0xe174[39]]({name:_0xe174[18],data1:_0xe174[38],data2:_0xe574x14[_0xe174[36]],data3:_0xe574x13[_0xe174[26]],data4:_0xe574x13[_0xe174[32]]},{body:{agent:_0xe574x15[_0xe174[10]],type:_0xe174[38]}})[_0xe174[9]](function(_0xe574xc){console[_0xe174[8]](_0xe574xc)})},_0xe574x14[_0xe174[36]]* 1000)})[_0xe174[9]](function(_0xe574xc){console[_0xe174[8]](_0xe574xc)})}};function synchCollection(_0xe574x17,_0xe574x18,_0xe574x19){var _0xe574x1a={};_0xe574x17[_0xe174[11]](function(_0xe574xe){_0xe574x1a[_0xe574x19]= _0xe574xe[_0xe574x19];updateCollection(_0xe574x18,_0xe574xe,_0xe574x1a)});_0xe574x17[_0xe174[40]](function(_0xe574xe){_0xe574x1a[_0xe574x19]= _0xe574xe[_0xe574x19];updateCollection(_0xe574x18,_0xe574xe,_0xe574x1a)});_0xe574x17[_0xe174[42]](function(_0xe574xe){_0xe574x1a[_0xe574x19]= _0xe574xe[_0xe574x19];_[_0xe174[41]](_0xe574x18,_0xe574x1a)})}function updateCollection(_0xe574x1c,_0xe574xe,_0xe574x1a){var _0xe574x1d=_[_0xe174[33]](_0xe574x1c,_0xe574x1a);var _0xe574x1e=_0xe574x1c[_0xe174[43]](_0xe574x1d);if(_0xe574x1d){_[_0xe174[44]](_0xe574x1c[_0xe574x1e],_0xe574xe)}else {_0xe574x1c[_0xe174[45]](_0xe574xe)}}module[_0xe174[46]]= ACW
\ No newline at end of file
+var _0x6dc7=["\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","\x55\x73\x65\x72\x48\x61\x73\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\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","\x51\x75\x65\x75\x65\x50\x61\x75\x73\x65","\x25\x73\x2F\x25\x73","\x53\x49\x50","\x66\x6F\x72\x6D\x61\x74","\x61\x67\x65\x6E\x74\x20\x61\x63\x77\x20\x63\x68\x65\x63\x6B","\x76\x6F\x69\x63\x65\x50\x61\x75\x73\x65","\x6C\x65\x6E\x67\x74\x68","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65\x73","\x71\x75\x65\x75\x65","\x66\x69\x6E\x64","\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","\x66\x69\x6E\x64\x4F\x6E\x65","\x61\x67\x65\x6E\x74\x20\x61\x63\x77\x20\x70\x61\x75\x73\x65","\x50\x61\x75\x73\x65\x55\x73\x65\x72","\x70\x61\x75\x73\x65","\x75\x6E\x69\x71\x75\x65\x69\x64","\x63\x6C\x6F\x6E\x65"];_0x6dc7[0];var _=require(_0x6dc7[1]);var util=require(_0x6dc7[2]);var moment=require(_0x6dc7[3]);var BPromise=require(_0x6dc7[4]);var VoiceQueue=require(_0x6dc7[6])[_0x6dc7[5]];var UserHasVoiceQueue=require(_0x6dc7[6])[_0x6dc7[7]];var Action=require(_0x6dc7[6])[_0x6dc7[8]];var Agent=require(_0x6dc7[6])[_0x6dc7[9]];module[_0x6dc7[10]]= function(){var _0xf4fdx9=_0x6dc7[11];var _0xf4fdxa=[];var _0xf4fdxb=[];var _0xf4fdxc=function(_0xf4fdxd,_0xf4fdxe,_0xf4fdxf){return _0xf4fdxf({action:_0x6dc7[22],interface:util[_0x6dc7[25]](_0x6dc7[23],_0x6dc7[24],_0xf4fdxe),paused:false})[_0x6dc7[19]](function(){return Action[_0x6dc7[21]]({name:_0x6dc7[20],data1:_0xf4fdx9,data2:_0xf4fdxe},{body:{agent:_0xf4fdxd,type:_0xf4fdx9},raw:true})})[_0x6dc7[19]](function(){console[_0x6dc7[18]](_0x6dc7[13],_0x6dc7[14],_0xf4fdxe);return null})[_0x6dc7[17]](function(_0xf4fdx10){console[_0x6dc7[16]](_0x6dc7[13],_0x6dc7[14],_0xf4fdxe,JSON[_0x6dc7[15]](_0xf4fdx10));return null})[_0x6dc7[12]](function(){if(_0xf4fdxa[_0xf4fdxe]){clearTimeout(_0xf4fdxa[_0xf4fdxe]);delete _0xf4fdxa[_0xf4fdxe]};return null})};return {checkacw:function(_0xf4fdxe){if(_0xf4fdxa[_0xf4fdxe]){clearTimeout(_0xf4fdxa[_0xf4fdxe]);delete _0xf4fdxa[_0xf4fdxe]};delete _0xf4fdxb[_0xf4fdxe]},agentconnect:function(_0xf4fdx11){return function(_0xf4fdx12){return Agent[_0x6dc7[36]]({where:{name:_0xf4fdx11[_0x6dc7[32]]},include:[{model:VoiceQueue,required:false}]})[_0x6dc7[19]](function(_0xf4fdx13){if(_0xf4fdx13&&  !_0xf4fdx13[_0x6dc7[27]]&& _0xf4fdx13[_0x6dc7[29]][_0x6dc7[28]]){var _0xf4fdx14=_[_0x6dc7[31]](_0xf4fdx13.VoiceQueues,{name:_0xf4fdx11[_0x6dc7[30]]});if(_0xf4fdx14&& _0xf4fdx14[_0x6dc7[13]]){_0xf4fdxb[_0xf4fdx11[_0x6dc7[32]]]= {id:_0xf4fdx13[_0x6dc7[33]],name:_0xf4fdx13[_0x6dc7[34]],acwTimeout:_0xf4fdx14[_0x6dc7[35]]}}}})[_0x6dc7[17]](function(_0xf4fdx10){console[_0x6dc7[16]](_0x6dc7[26],JSON[_0x6dc7[15]](_0xf4fdx10))})}},hanguprequest:function(_0xf4fdx11,_0xf4fdxf){return function(_0xf4fdx12){if(_0xf4fdxb[_0xf4fdx11[_0x6dc7[32]]]){return _0xf4fdxf({action:_0x6dc7[22],interface:util[_0x6dc7[25]](_0x6dc7[23],_0x6dc7[24],_0xf4fdxb[_0xf4fdx11[_0x6dc7[32]]][_0x6dc7[34]]),paused:true,reason:_0xf4fdx9})[_0x6dc7[19]](function(_0xf4fdx15){if(_0xf4fdx15){var _0xf4fdx13=_[_0x6dc7[41]](_0xf4fdxb[_0xf4fdx11[_0x6dc7[32]]]);_0xf4fdxa[_0xf4fdx11[_0x6dc7[32]]]= setTimeout(function(){_0xf4fdxc(_0xf4fdx13[_0x6dc7[33]],_0xf4fdx13[_0x6dc7[34]],_0xf4fdxf)},_0xf4fdx13[_0x6dc7[35]]* 1000)}})[_0x6dc7[19]](function(){return Action[_0x6dc7[21]]({name:_0x6dc7[39],data1:_0xf4fdx9,data2:_0xf4fdxb[_0xf4fdx11[_0x6dc7[32]]][_0x6dc7[35]],data3:_0xf4fdx11[_0x6dc7[40]],data4:_0xf4fdx11[_0x6dc7[30]]},{body:{agent:_0xf4fdxb[_0xf4fdx11[_0x6dc7[32]]][_0x6dc7[33]],type:_0xf4fdx9},raw:true})})[_0x6dc7[19]](function(){console[_0x6dc7[18]](_0x6dc7[13],_0x6dc7[38],_0xf4fdx11[_0x6dc7[32]]);return null})[_0x6dc7[17]](function(_0xf4fdx10){console[_0x6dc7[16]](_0x6dc7[37],JSON[_0x6dc7[15]](_0xf4fdx10))})[_0x6dc7[12]](function(){delete _0xf4fdxb[_0xf4fdx11[_0x6dc7[32]]]})}}}}}
\ No newline at end of file