Built motion from commit 9362eee.|1.0.9
[motion.git] / server / config / ami / acw.js
index d7f3bd0..0be3226 100644 (file)
@@ -1 +1 @@
-var _0xf383=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x75\x74\x69\x6C","\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","\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","\x75\x6E\x69\x71\x75\x65\x69\x64","\x64\x65\x73\x74\x75\x6E\x69\x71\x75\x65\x69\x64","\x61\x63\x77\x54\x69\x6D\x65\x6F\x75\x74","\x74\x69\x6D\x65\x6F\x75\x74","\x55\x4E\x50\x41\x55\x53\x45\x44\x20\x42\x59\x20\x41\x43\x57","\x75\x6E\x70\x61\x75\x73\x65","\x41\x43\x57","\x63\x72\x65\x61\x74\x65","\x70\x61\x75\x73\x65","\x62\x6F\x64\x79","\x61\x63\x77\x54\x69\x6D\x65","\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\x70\x64\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"];_0xf383[0];var util=require(_0xf383[1]);var moment=require(_0xf383[2]);var _=require(_0xf383[3]);var VoiceQueue=require(_0xf383[5])[_0xf383[4]];var Agent=require(_0xf383[5])[_0xf383[6]];var Action=require(_0xf383[5])[_0xf383[7]];var ReportAgent=require(_0xf383[5])[_0xf383[8]];var _voiceQueues;var _agents;var activeAcw={};function AfterCallWork(){console[_0xf383[10]](_0xf383[9]);VoiceQueue[_0xf383[16]]()[_0xf383[14]](function(_0x7021x10){_voiceQueues= _0x7021x10;synchCollection(VoiceQueue,_voiceQueues,_0xf383[15]);return Agent[_0xf383[18]](_0xf383[17])[_0xf383[16]]()})[_0xf383[14]](function(_0x7021xd){_agents= _0x7021xd;synchCollection(Agent,_agents,_0xf383[12]);Action[_0xf383[13]](function(_0x7021xe,_0x7021xf){return onSave(_0x7021xe,_0x7021xf)})})[_0xf383[11]](function(_0x7021xc){console[_0xf383[10]](_0x7021xc)})}AfterCallWork[_0xf383[20]][_0xf383[19]]= function(_0x7021x11){var _0x7021x12=_[_0xf383[22]](_voiceQueues,{name:_0x7021x11[_0xf383[21]],acw:true});if(_0x7021x12){var _0x7021x13=_[_0xf383[22]](_agents,{name:_0x7021x11[_0xf383[23]]});if(_0x7021x13){Action[_0xf383[32]]({name:_0xf383[33],data1:_0xf383[31],data2:_0x7021x12[_0xf383[27]],data3:_0x7021x11[_0xf383[25]],data4:_0x7021x11[_0xf383[21]]},{body:{agent:_0x7021x13[_0xf383[12]],type:_0xf383[31]},raw:true})[_0xf383[14]](function(){console[_0xf383[10]](_0xf383[24]);activeAcw[_0x7021x13[_0xf383[12]]]= {uniqueid:_0x7021x11[_0xf383[25]],destuniqueid:_0x7021x11[_0xf383[26]],acwTime:_0x7021x12[_0xf383[27]],acwAt:moment(),unpause:false};activeAcw[_0x7021x13[_0xf383[12]]][_0xf383[28]]= setTimeout(function(){console[_0xf383[10]](_0xf383[29]);activeAcw[_0x7021x13[_0xf383[12]]][_0xf383[30]]= true;return Action[_0xf383[32]]({name:_0xf383[30],data1:_0xf383[31],data2:_0x7021x12[_0xf383[27]],data3:_0x7021x11[_0xf383[25]],data4:_0x7021x11[_0xf383[21]]},{body:{agent:_0x7021x13[_0xf383[12]],type:_0xf383[31]},raw:true})[_0xf383[11]](function(_0x7021xc){console[_0xf383[10]](_0x7021xc)})},_0x7021x12[_0xf383[27]]* 1000)})[_0xf383[11]](function(_0x7021xc){console[_0xf383[10]](_0x7021xc)})}}};function onSave(_0x7021xe,_0x7021xf){var _0x7021x15;if((_0x7021xe[_0xf383[15]]=== _0xf383[33]|| _0x7021xe[_0xf383[15]]=== _0xf383[30])&& activeAcw[_0x7021xf[_0xf383[34]][_0xf383[17]]]){if(_0x7021xe[_0xf383[15]]=== _0xf383[30]&& activeAcw[_0x7021xf[_0xf383[34]][_0xf383[17]]][_0xf383[30]]){_0x7021x15= activeAcw[_0x7021xf[_0xf383[34]][_0xf383[17]]][_0xf383[35]]}else {clearTimeout(activeAcw[_0x7021xf[_0xf383[34]][_0xf383[17]]][_0xf383[28]]);_0x7021x15= moment[_0xf383[38]](moment()- activeAcw[_0x7021xf[_0xf383[34]][_0xf383[17]]][_0xf383[37]])[_0xf383[36]]()};return ReportAgent[_0xf383[40]]({agentacw:true,acwtime:_0x7021x15},{where:{uniqueid:activeAcw[_0x7021xf[_0xf383[34]][_0xf383[17]]][_0xf383[25]],destuniqueid:activeAcw[_0x7021xf[_0xf383[34]][_0xf383[17]]][_0xf383[26]]},individualHooks:true,raw:true})[_0xf383[11]](function(_0x7021xc){console[_0xf383[10]](_0x7021xc)})[_0xf383[39]](function(){delete activeAcw[_0x7021xf[_0xf383[34]][_0xf383[17]]]})}}function synchCollection(_0x7021x17,_0x7021x18,_0x7021x19){var _0x7021x1a={};_0x7021x17[_0xf383[13]](function(_0x7021xe,_0x7021xf){_0x7021x1a[_0x7021x19]= _0x7021xe[_0x7021x19];updateCollection(_0x7021x18,_0x7021xe,_0x7021x1a)});_0x7021x17[_0xf383[41]](function(_0x7021xe,_0x7021xf){_0x7021x1a[_0x7021x19]= _0x7021xe[_0x7021x19];updateCollection(_0x7021x18,_0x7021xe,_0x7021x1a)});_0x7021x17[_0xf383[43]](function(_0x7021xe,_0x7021xf){_0x7021x1a[_0x7021x19]= _0x7021xe[_0x7021x19];_[_0xf383[42]](_0x7021x18,_0x7021x1a)})}function updateCollection(_0x7021x1c,_0x7021xe,_0x7021x1a){var _0x7021x1d=_[_0xf383[22]](_0x7021x1c,_0x7021x1a);var _0x7021x1e=_0x7021x1c[_0xf383[44]](_0x7021x1d);if(_0x7021x1d){_[_0xf383[45]](_0x7021x1c[_0x7021x1e],_0x7021xe)}else {_0x7021x1c[_0xf383[46]](_0x7021xe)}}module[_0xf383[47]]= AfterCallWork
\ No newline at end of file
+var _0x4e5f=["\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"];_0x4e5f[0];var _=require(_0x4e5f[1]);var util=require(_0x4e5f[2]);var moment=require(_0x4e5f[3]);var BPromise=require(_0x4e5f[4]);var VoiceQueue=require(_0x4e5f[6])[_0x4e5f[5]];var Action=require(_0x4e5f[6])[_0x4e5f[7]];var Agent=require(_0x4e5f[6])[_0x4e5f[8]];module[_0x4e5f[9]]= function(){var _0xfdbex8=_0x4e5f[10];var _0xfdbex9=[];var _0xfdbexa=function(_0xfdbexb,_0xfdbexc){return Action[_0x4e5f[20]]({name:_0x4e5f[19],data1:_0x4e5f[10]},{body:{agent:_0xfdbexb,type:_0x4e5f[10]},raw:true})[_0x4e5f[18]](function(){console[_0x4e5f[17]](_0x4e5f[12],_0x4e5f[13],_0xfdbexc);return null})[_0x4e5f[16]](function(_0xfdbexd){console[_0x4e5f[15]](_0x4e5f[12],_0x4e5f[13],_0xfdbexc,JSON[_0x4e5f[14]](_0xfdbexd));return null})[_0x4e5f[11]](function(){if(_0xfdbex9[_0xfdbexc]){clearTimeout(_0xfdbex9[_0xfdbexc]);delete _0xfdbex9[_0xfdbexc]};return null})};return {checkacw:function(_0xfdbexc){if(_0xfdbex9[_0xfdbexc]){console[_0x4e5f[17]](_0x4e5f[12],_0x4e5f[21],_0x4e5f[22],JSON[_0x4e5f[14]](_0xfdbex9));console[_0x4e5f[17]](_0x4e5f[12],_0x4e5f[21],_0xfdbexc);clearTimeout(_0xfdbex9[_0xfdbexc]);delete _0xfdbex9[_0xfdbexc]}},agentcomplete:function(_0xfdbexe){return function(_0xfdbexf){var _0xfdbex10,_0xfdbex11;return Agent[_0x4e5f[32]]({where:{name:_0xfdbexe[_0x4e5f[24]]}})[_0x4e5f[18]](function(_0xfdbex12){if(_0xfdbex12&& !_0xfdbex12[_0x4e5f[31]]){_0xfdbex11= _0xfdbex12;return VoiceQueue[_0x4e5f[32]]({where:{name:_0xfdbexe[_0x4e5f[30]]},attributes:[_0x4e5f[26],_0x4e5f[12],_0x4e5f[27]]})};return null})[_0x4e5f[18]](function(_0xfdbex12){if(_0xfdbex12&& _0xfdbex12[_0x4e5f[12]]){_0xfdbex10= _0xfdbex12;return Action[_0x4e5f[20]]({name:_0x4e5f[28],data1:_0x4e5f[10],data2:_0xfdbex12[_0x4e5f[27]],data3:_0xfdbexe[_0x4e5f[29]],data4:_0xfdbexe[_0x4e5f[30]]},{body:{agent:_0xfdbex11[_0x4e5f[25]],type:_0x4e5f[10]},raw:true})};return null})[_0x4e5f[18]](function(_0xfdbex12){if(_0xfdbex12){_0xfdbex9[_0xfdbexe[_0x4e5f[24]]]= setTimeout(function(){_0xfdbexa(_0xfdbex11[_0x4e5f[25]],_0xfdbex11[_0x4e5f[26]])},_0xfdbex10[_0x4e5f[27]]* 1000)};return null})[_0x4e5f[16]](function(_0xfdbexd){console[_0x4e5f[15]](_0x4e5f[23],_0x4e5f[12],JSON[_0x4e5f[14]](_0xfdbexd))})}}}}
\ No newline at end of file