Built motion from commit c36c9c6.|1.0.17
[motion.git] / server / config / ami / acw.js
index 771d3e6..88ac5e0 100644 (file)
@@ -1 +1 @@
-var _0x9b1c=["\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(_0x9b1c[0]);var _=require(_0x9b1c[1]);var VoiceQueue=require(_0x9b1c[3])[_0x9b1c[2]];var Agent=require(_0x9b1c[3])[_0x9b1c[4]];var Action=require(_0x9b1c[3])[_0x9b1c[5]];var ReportAgent=require(_0x9b1c[3])[_0x9b1c[6]];var _voiceQueues;var _agents;var activeAcw={};function ACW(_0x6e22xb){console[_0x9b1c[8]](_0x9b1c[7]);VoiceQueue[_0x9b1c[14]]()[_0x9b1c[12]](function(_0x6e22x10){_voiceQueues=_0x6e22x10;synchCollection(VoiceQueue,_voiceQueues,_0x9b1c[13]);return Agent[_0x9b1c[16]](_0x9b1c[15])[_0x9b1c[14]]()})[_0x9b1c[12]](function(_0x6e22xd){_agents=_0x6e22xd;synchCollection(Agent,_agents,_0x9b1c[10]);Action[_0x9b1c[11]](function(_0x6e22xe,_0x6e22xf){return onSave(_0x6e22xe,_0x6e22xf)})})[_0x9b1c[9]](function(_0x6e22xc){console[_0x9b1c[8]](_0x6e22xc)})}function onSave(_0x6e22xe,_0x6e22xf){if(_0x6e22xe[_0x9b1c[13]]===_0x9b1c[17]&&activeAcw[_0x6e22xf[_0x9b1c[18]][_0x9b1c[15]]]){var _0x6e22x12;if(activeAcw[_0x6e22xf[_0x9b1c[18]][_0x9b1c[15]]][_0x9b1c[17]]){_0x6e22x12=activeAcw[_0x6e22xf[_0x9b1c[18]][_0x9b1c[15]]][_0x9b1c[19]]}else {clearTimeout(activeAcw[_0x6e22xf[_0x9b1c[18]][_0x9b1c[15]]][_0x9b1c[20]]);_0x6e22x12=moment[_0x9b1c[23]](moment()-activeAcw[_0x6e22xf[_0x9b1c[18]][_0x9b1c[15]]][_0x9b1c[22]])[_0x9b1c[21]]()};return ReportAgent[_0x9b1c[27]]({agentacw:true,acwtime:_0x6e22x12},{where:{uniqueid:activeAcw[_0x6e22xf[_0x9b1c[18]][_0x9b1c[15]]][_0x9b1c[24]],destuniqueid:activeAcw[_0x6e22xf[_0x9b1c[18]][_0x9b1c[15]]][_0x9b1c[25]]},transaction:_0x6e22xf[_0x9b1c[26]],individualHooks:true})[_0x9b1c[12]](function(){delete activeAcw[_0x6e22xf[_0x9b1c[18]][_0x9b1c[15]]]})[_0x9b1c[9]](function(_0x6e22xc){console[_0x9b1c[8]](_0x6e22xc)})}}ACW[_0x9b1c[29]][_0x9b1c[28]]=function(_0x6e22x13){var _0x6e22x14=_[_0x9b1c[31]](_voiceQueues,{name:_0x6e22x13[_0x9b1c[30]],acw:true});if(_0x6e22x14){var _0x6e22x15=_[_0x9b1c[31]](_agents,{name:_0x6e22x13[_0x9b1c[32]]});Action[_0x9b1c[37]]({name:_0x9b1c[38],data1:_0x9b1c[36],data2:_0x6e22x14[_0x9b1c[34]],data3:_0x6e22x13[_0x9b1c[24]],data4:_0x6e22x13[_0x9b1c[30]]},{body:{agent:_0x6e22x15[_0x9b1c[10]],type:_0x9b1c[36]}})[_0x9b1c[12]](function(){console[_0x9b1c[8]](_0x9b1c[33]);activeAcw[_0x6e22x15[_0x9b1c[10]]]={uniqueid:_0x6e22x13[_0x9b1c[24]],destuniqueid:_0x6e22x13[_0x9b1c[25]],acwTime:_0x6e22x14[_0x9b1c[34]],acwAt:moment(),unpause:false};activeAcw[_0x6e22x15[_0x9b1c[10]]][_0x9b1c[20]]=setTimeout(function(){console[_0x9b1c[8]](_0x9b1c[35]);activeAcw[_0x6e22x15[_0x9b1c[10]]][_0x9b1c[17]]=true;return Action[_0x9b1c[37]]({name:_0x9b1c[17],data1:_0x9b1c[36],data2:_0x6e22x14[_0x9b1c[34]],data3:_0x6e22x13[_0x9b1c[24]],data4:_0x6e22x13[_0x9b1c[30]]},{body:{agent:_0x6e22x15[_0x9b1c[10]],type:_0x9b1c[36]}})[_0x9b1c[9]](function(_0x6e22xc){console[_0x9b1c[8]](_0x6e22xc)})},_0x6e22x14[_0x9b1c[34]]*1000)})[_0x9b1c[9]](function(_0x6e22xc){console[_0x9b1c[8]](_0x6e22xc)})}};function synchCollection(_0x6e22x17,_0x6e22x18,_0x6e22x19){var _0x6e22x1a={};_0x6e22x17[_0x9b1c[11]](function(_0x6e22xe){_0x6e22x1a[_0x6e22x19]=_0x6e22xe[_0x6e22x19];updateCollection(_0x6e22x18,_0x6e22xe,_0x6e22x1a)});_0x6e22x17[_0x9b1c[39]](function(_0x6e22xe){_0x6e22x1a[_0x6e22x19]=_0x6e22xe[_0x6e22x19];updateCollection(_0x6e22x18,_0x6e22xe,_0x6e22x1a)});_0x6e22x17[_0x9b1c[41]](function(_0x6e22xe){_0x6e22x1a[_0x6e22x19]=_0x6e22xe[_0x6e22x19];_[_0x9b1c[40]](_0x6e22x18,_0x6e22x1a)})}function updateCollection(_0x6e22x1c,_0x6e22xe,_0x6e22x1a){var _0x6e22x1d=_[_0x9b1c[31]](_0x6e22x1c,_0x6e22x1a);var _0x6e22x1e=_0x6e22x1c[_0x9b1c[42]](_0x6e22x1d);if(_0x6e22x1d){_[_0x9b1c[43]](_0x6e22x1c[_0x6e22x1e],_0x6e22xe)}else {_0x6e22x1c[_0x9b1c[44]](_0x6e22xe)}}module[_0x9b1c[45]]=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