Built motion from commit c36c9c6.|1.0.17
[motion.git] / server / config / ami / acw.js
index d63d9a8..88ac5e0 100644 (file)
@@ -1 +1 @@
-var _0xc9c0=["\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(_0xc9c0[0]);var _=require(_0xc9c0[1]);var VoiceQueue=require(_0xc9c0[3])[_0xc9c0[2]];var Agent=require(_0xc9c0[3])[_0xc9c0[4]];var Action=require(_0xc9c0[3])[_0xc9c0[5]];var ReportAgent=require(_0xc9c0[3])[_0xc9c0[6]];var _voiceQueues;var _agents;var activeAcw={};function ACW(_0xed8axb){console[_0xc9c0[8]](_0xc9c0[7]);VoiceQueue[_0xc9c0[14]]()[_0xc9c0[12]](function(_0xed8ax10){_voiceQueues=_0xed8ax10;synchCollection(VoiceQueue,_voiceQueues,_0xc9c0[13]);return Agent[_0xc9c0[16]](_0xc9c0[15])[_0xc9c0[14]]()})[_0xc9c0[12]](function(_0xed8axd){_agents=_0xed8axd;synchCollection(Agent,_agents,_0xc9c0[10]);Action[_0xc9c0[11]](function(_0xed8axe,_0xed8axf){return onSave(_0xed8axe,_0xed8axf)})})[_0xc9c0[9]](function(_0xed8axc){console[_0xc9c0[8]](_0xed8axc)})}function onSave(_0xed8axe,_0xed8axf){if(_0xed8axe[_0xc9c0[13]]===_0xc9c0[17]&&activeAcw[_0xed8axf[_0xc9c0[18]][_0xc9c0[15]]]){var _0xed8ax12;if(activeAcw[_0xed8axf[_0xc9c0[18]][_0xc9c0[15]]][_0xc9c0[17]]){_0xed8ax12=activeAcw[_0xed8axf[_0xc9c0[18]][_0xc9c0[15]]][_0xc9c0[19]]}else {clearTimeout(activeAcw[_0xed8axf[_0xc9c0[18]][_0xc9c0[15]]][_0xc9c0[20]]);_0xed8ax12=moment[_0xc9c0[23]](moment()-activeAcw[_0xed8axf[_0xc9c0[18]][_0xc9c0[15]]][_0xc9c0[22]])[_0xc9c0[21]]()};return ReportAgent[_0xc9c0[27]]({agentacw:true,acwtime:_0xed8ax12},{where:{uniqueid:activeAcw[_0xed8axf[_0xc9c0[18]][_0xc9c0[15]]][_0xc9c0[24]],destuniqueid:activeAcw[_0xed8axf[_0xc9c0[18]][_0xc9c0[15]]][_0xc9c0[25]]},transaction:_0xed8axf[_0xc9c0[26]],individualHooks:true})[_0xc9c0[12]](function(){delete activeAcw[_0xed8axf[_0xc9c0[18]][_0xc9c0[15]]]})[_0xc9c0[9]](function(_0xed8axc){console[_0xc9c0[8]](_0xed8axc)})}}ACW[_0xc9c0[29]][_0xc9c0[28]]=function(_0xed8ax13){var _0xed8ax14=_[_0xc9c0[31]](_voiceQueues,{name:_0xed8ax13[_0xc9c0[30]],acw:true});if(_0xed8ax14){var _0xed8ax15=_[_0xc9c0[31]](_agents,{name:_0xed8ax13[_0xc9c0[32]]});Action[_0xc9c0[37]]({name:_0xc9c0[38],data1:_0xc9c0[36],data2:_0xed8ax14[_0xc9c0[34]],data3:_0xed8ax13[_0xc9c0[24]],data4:_0xed8ax13[_0xc9c0[30]]},{body:{agent:_0xed8ax15[_0xc9c0[10]],type:_0xc9c0[36]}})[_0xc9c0[12]](function(){console[_0xc9c0[8]](_0xc9c0[33]);activeAcw[_0xed8ax15[_0xc9c0[10]]]={uniqueid:_0xed8ax13[_0xc9c0[24]],destuniqueid:_0xed8ax13[_0xc9c0[25]],acwTime:_0xed8ax14[_0xc9c0[34]],acwAt:moment(),unpause:false};activeAcw[_0xed8ax15[_0xc9c0[10]]][_0xc9c0[20]]=setTimeout(function(){console[_0xc9c0[8]](_0xc9c0[35]);activeAcw[_0xed8ax15[_0xc9c0[10]]][_0xc9c0[17]]=true;return Action[_0xc9c0[37]]({name:_0xc9c0[17],data1:_0xc9c0[36],data2:_0xed8ax14[_0xc9c0[34]],data3:_0xed8ax13[_0xc9c0[24]],data4:_0xed8ax13[_0xc9c0[30]]},{body:{agent:_0xed8ax15[_0xc9c0[10]],type:_0xc9c0[36]}})[_0xc9c0[9]](function(_0xed8axc){console[_0xc9c0[8]](_0xed8axc)})},_0xed8ax14[_0xc9c0[34]]*1000)})[_0xc9c0[9]](function(_0xed8axc){console[_0xc9c0[8]](_0xed8axc)})}};function synchCollection(_0xed8ax17,_0xed8ax18,_0xed8ax19){var _0xed8ax1a={};_0xed8ax17[_0xc9c0[11]](function(_0xed8axe){_0xed8ax1a[_0xed8ax19]=_0xed8axe[_0xed8ax19];updateCollection(_0xed8ax18,_0xed8axe,_0xed8ax1a)});_0xed8ax17[_0xc9c0[39]](function(_0xed8axe){_0xed8ax1a[_0xed8ax19]=_0xed8axe[_0xed8ax19];updateCollection(_0xed8ax18,_0xed8axe,_0xed8ax1a)});_0xed8ax17[_0xc9c0[41]](function(_0xed8axe){_0xed8ax1a[_0xed8ax19]=_0xed8axe[_0xed8ax19];_[_0xc9c0[40]](_0xed8ax18,_0xed8ax1a)})}function updateCollection(_0xed8ax1c,_0xed8axe,_0xed8ax1a){var _0xed8ax1d=_[_0xc9c0[31]](_0xed8ax1c,_0xed8ax1a);var _0xed8ax1e=_0xed8ax1c[_0xc9c0[42]](_0xed8ax1d);if(_0xed8ax1d){_[_0xc9c0[43]](_0xed8ax1c[_0xed8ax1e],_0xed8axe)}else {_0xed8ax1c[_0xc9c0[44]](_0xed8axe)}}module[_0xc9c0[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