8c7fd849ffae2ab9b3d3fc0fe7f29118bd3dda57
[motion.git] / server / config / ami / acw.js
1 var _0x1f41=["\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","\x61\x6D\x69","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x65\x78\x70\x6F\x72\x74\x73","\x41\x43\x57","\x66\x69\x6E\x61\x6C\x6C\x79","\x5B\x61\x63\x77\x5D","\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","\x69\x6E\x66\x6F","\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","\x5B\x61\x63\x77\x5D\x20\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","\x61\x63\x77","\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","\x5B\x61\x63\x77\x5D\x20\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"];_0x1f41[0];var _=require(_0x1f41[1]);var util=require(_0x1f41[2]);var moment=require(_0x1f41[3]);var BPromise=require(_0x1f41[4]);var VoiceQueue=require(_0x1f41[6])[_0x1f41[5]];var UserHasVoiceQueue=require(_0x1f41[6])[_0x1f41[7]];var Action=require(_0x1f41[6])[_0x1f41[8]];var Agent=require(_0x1f41[6])[_0x1f41[9]];var logger=require(_0x1f41[11])(_0x1f41[10]);module[_0x1f41[12]]= function(){var _0xf185xa=_0x1f41[13];var _0xf185xb=[];var _0xf185xc=[];var _0xf185xd=function(_0xf185xe,_0xf185xf,_0xf185x10){return _0xf185x10({action:_0x1f41[24],interface:util[_0x1f41[27]](_0x1f41[25],_0x1f41[26],_0xf185xf),paused:false})[_0x1f41[21]](function(){return Action[_0x1f41[23]]({name:_0x1f41[22],data1:_0xf185xa,data2:_0xf185xf},{body:{agent:_0xf185xe,type:_0xf185xa},raw:true})})[_0x1f41[21]](function(){logger[_0x1f41[20]](_0x1f41[15],_0x1f41[16],_0xf185xf);return null})[_0x1f41[19]](function(_0xf185x11){logger[_0x1f41[18]](_0x1f41[15],_0x1f41[16],_0xf185xf,JSON[_0x1f41[17]](_0xf185x11));return null})[_0x1f41[14]](function(){if(_0xf185xb[_0xf185xf]){clearTimeout(_0xf185xb[_0xf185xf]);delete _0xf185xb[_0xf185xf]};return null})};return {checkacw:function(_0xf185xf){if(_0xf185xb[_0xf185xf]){clearTimeout(_0xf185xb[_0xf185xf]);delete _0xf185xb[_0xf185xf]};delete _0xf185xc[_0xf185xf]},agentconnect:function(_0xf185x12){return function(_0xf185x13){return Agent[_0x1f41[39]]({where:{name:_0xf185x12[_0x1f41[35]]},include:[{model:VoiceQueue,required:false}]})[_0x1f41[21]](function(_0xf185x14){if(_0xf185x14&&  !_0xf185x14[_0x1f41[29]]&& _0xf185x14[_0x1f41[31]][_0x1f41[30]]){var _0xf185x15=_[_0x1f41[33]](_0xf185x14.VoiceQueues,{name:_0xf185x12[_0x1f41[32]]});if(_0xf185x15&& _0xf185x15[_0x1f41[34]]){_0xf185xc[_0xf185x12[_0x1f41[35]]]= {id:_0xf185x14[_0x1f41[36]],name:_0xf185x14[_0x1f41[37]],acwTimeout:_0xf185x15[_0x1f41[38]]}}}})[_0x1f41[19]](function(_0xf185x11){logger[_0x1f41[18]](_0x1f41[28],JSON[_0x1f41[17]](_0xf185x11))})}},hanguprequest:function(_0xf185x12,_0xf185x10){return function(_0xf185x13){if(_0xf185xc[_0xf185x12[_0x1f41[35]]]){return _0xf185x10({action:_0x1f41[24],interface:util[_0x1f41[27]](_0x1f41[25],_0x1f41[26],_0xf185xc[_0xf185x12[_0x1f41[35]]][_0x1f41[37]]),paused:true,reason:_0xf185xa})[_0x1f41[21]](function(_0xf185x16){if(_0xf185x16){var _0xf185x14=_[_0x1f41[44]](_0xf185xc[_0xf185x12[_0x1f41[35]]]);_0xf185xb[_0xf185x12[_0x1f41[35]]]= setTimeout(function(){_0xf185xd(_0xf185x14[_0x1f41[36]],_0xf185x14[_0x1f41[37]],_0xf185x10)},_0xf185x14[_0x1f41[38]]* 1000)}})[_0x1f41[21]](function(){return Action[_0x1f41[23]]({name:_0x1f41[42],data1:_0xf185xa,data2:_0xf185xc[_0xf185x12[_0x1f41[35]]][_0x1f41[38]],data3:_0xf185x12[_0x1f41[43]],data4:_0xf185x12[_0x1f41[32]]},{body:{agent:_0xf185xc[_0xf185x12[_0x1f41[35]]][_0x1f41[36]],type:_0xf185xa},raw:true})})[_0x1f41[21]](function(){logger[_0x1f41[20]](_0x1f41[15],_0x1f41[41],_0xf185x12[_0x1f41[35]]);return null})[_0x1f41[19]](function(_0xf185x11){logger[_0x1f41[18]](_0x1f41[40],JSON[_0x1f41[17]](_0xf185x11))})[_0x1f41[14]](function(){delete _0xf185xc[_0xf185x12[_0x1f41[35]]]})}}}}}