Built motion from commit 7db97eb.|0.0.116
[motion.git] / server / config / ami / acw.js
index fad1fbe..99e07a0 100644 (file)
@@ -1 +1 @@
-var _0xbbb1=["\x6D\x6F\x6D\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","\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x70\x72\x6F\x74\x6F\x74\x79\x70\x65","\x69\x73\x43\x6F\x6E\x6E\x65\x63\x74\x65\x64","\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x53\x49\x50\x2F\x6D\x61\x73\x73\x69\x6D\x69\x6C\x69\x61\x6E\x6F\x2E\x62\x75\x6E\x67\x61\x72\x6F","\x51\x75\x65\x75\x65\x50\x61\x75\x73\x65","\x55\x4E\x41\x56\x41\x49\x4C\x41\x42\x4C\x45\x20\x42\x59\x20\x41\x43\x57","\x65\x72\x72\x6F\x72","\x50\x41\x55\x53\x45\x20\x41\x43\x57\x20\x69\x6E\x20\x61\x6C\x6C\x20\x71\x75\x65\x75\x65\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x61\x67\x65\x6E\x74\x20","\x71\x75\x65\x75\x65","\x41\x43\x57","\x53\x49\x4E\x47\x4C\x45\x20\x50\x41\x55\x53\x45\x20\x41\x43\x57\x20\x69\x6E\x20","\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x61\x67\x65\x6E\x74\x20","\x55\x4E\x50\x41\x55\x53\x45\x20\x41\x43\x57\x20\x69\x6E\x20\x61\x6C\x6C\x20\x71\x75\x65\x75\x65\x20\x66\x6F\x72\x20\x74\x68\x65\x20\x61\x67\x65\x6E\x74\x20","\x61\x63\x74\x69\x6F\x6E","\x61\x67\x65\x6E\x74\x70\x61\x75\x73\x65","\x72\x65\x61\x73\x6F\x6E","\x70\x61\x75\x73\x65\x64","\x31","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x5B\x61\x63\x77\x5D\x20\x61\x67\x65\x6E\x74\x20\x61\x63\x77\x20\x20","\x63\x61\x74\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x41\x74","\x73\x65\x63\x6F\x6E\x64\x73","\x64\x69\x66\x66","\x5B\x61\x63\x77\x5D\x20\x61\x67\x65\x6E\x74\x20\x61\x63\x77\x20","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x20\x75\x70\x64\x61\x74\x65\x64\x20\x73\x65\x63\x6F\x6E\x64\x73\x20","\x20\x41\x43\x57\x20\x69\x6E\x20\x71\x75\x65\x75\x65\x20","\x74\x68\x65\x6E","\x75\x70\x64\x61\x74\x65\x41\x74\x74\x72\x69\x62\x75\x74\x65\x73","\x5B\x61\x63\x77\x5D\x20\x61\x67\x65\x6E\x74\x20\x61\x63\x77\x20\x20\x6E\x6F\x74\x20\x66\x6F\x75\x6E\x64\x21","\x66\x69\x6E\x64\x41\x6C\x6C","\x5B\x61\x63\x77\x5D\x20\x61\x67\x65\x6E\x74\x20\x61\x63\x77\x20\x75\x70\x64\x61\x74\x65\x20\x65\x72\x72\x6F\x72\x3A\x20\x20","\x5B\x61\x63\x77\x5D\x20\x61\x67\x65\x6E\x74\x20\x61\x63\x77\x20\x75\x70\x64\x61\x74\x65\x64","\x75\x6E\x69\x71\x75\x65\x69\x64","\x64\x65\x73\x74\x75\x6E\x69\x71\x75\x65\x69\x64","\x75\x70\x64\x61\x74\x65","\x65\x78\x70\x6F\x72\x74\x73"];var moment=require(_0xbbb1[0]);var asteriskManager=null;function ACW(_0x1622x4){console[_0xbbb1[2]](_0xbbb1[1]);asteriskManager=_0x1622x4;}ACW[_0xbbb1[4]][_0xbbb1[3]]=function(_0x1622x5){if(asteriskManager&&asteriskManager[_0xbbb1[5]]()){if(_0x1622x5[_0xbbb1[6]]===_0xbbb1[7]){asteriskManager[_0xbbb1[17]]({action:_0xbbb1[8],interface:_0x1622x5[_0xbbb1[6]],paused:true,reason:_0xbbb1[9]},function(_0x1622x6,_0x1622x7){if(_0x1622x6){console[_0xbbb1[10]](_0x1622x6);return ;};console[_0xbbb1[2]](_0xbbb1[11]+_0x1622x5[_0xbbb1[6]]);asteriskManager[_0xbbb1[17]]({action:_0xbbb1[8],interface:_0x1622x5[_0xbbb1[6]],queue:_0x1622x5[_0xbbb1[12]],paused:true,reason:_0xbbb1[13]},function(_0x1622x6,_0x1622x7){if(_0x1622x6){console[_0xbbb1[10]](_0x1622x6);return ;};console[_0xbbb1[2]](_0xbbb1[14]+_0x1622x5[_0xbbb1[12]]+_0xbbb1[15]+_0x1622x5[_0xbbb1[6]]);findAndUpdateFlag(_0x1622x5);setTimeout(function(){asteriskManager[_0xbbb1[17]]({action:_0xbbb1[8],interface:_0x1622x5[_0xbbb1[6]],paused:false},function(_0x1622x6,_0x1622x7){if(_0x1622x6){console[_0xbbb1[10]](_0x1622x6)};console[_0xbbb1[2]](_0xbbb1[16]+_0x1622x5[_0xbbb1[6]]);})},5000);});})}}};ACW[_0xbbb1[4]][_0xbbb1[18]]=function(_0x1622x5){if((_0x1622x5[_0xbbb1[19]]===_0xbbb1[13]||_0x1622x5[_0xbbb1[19]]===_0xbbb1[9])&&_0x1622x5[_0xbbb1[20]]===_0xbbb1[21]){return }};function findAndUpdateTime(_0x1622x5){var _0x1622x9=require(_0xbbb1[23])[_0xbbb1[22]];_0x1622x9[_0xbbb1[37]]({where:{agentcomplete:true,agentacw:true,acwtime:null,queue:_0x1622x5[_0xbbb1[12]],interface:_0x1622x5[_0xbbb1[6]]}})[_0xbbb1[34]](function(_0x1622xa){if(_0x1622xa[_0xbbb1[26]]>0){var _0x1622x9=_0x1622xa[_0x1622xa[_0xbbb1[26]]-1];var _0x1622xb=moment()[_0xbbb1[29]](_0x1622x9[_0xbbb1[27]],_0xbbb1[28]);_0x1622x9[_0xbbb1[35]]({acwtime:_0x1622xb})[_0xbbb1[34]](function(_0x1622x7){console[_0xbbb1[2]](_0xbbb1[30]+_0x1622x7[_0xbbb1[31]]+_0xbbb1[32]+_0x1622xb+_0xbbb1[33]+_0x1622x7[_0xbbb1[12]])})[_0xbbb1[25]](function(_0x1622x6){console[_0xbbb1[10]](_0xbbb1[24]+_0x1622x6)});}else {console[_0xbbb1[10]]( new Error(_0xbbb1[36]))}})[_0xbbb1[25]](function(_0x1622x6){console[_0xbbb1[10]](_0xbbb1[24]+_0x1622x6)});}function findAndUpdateFlag(_0x1622x5){var _0x1622x9=require(_0xbbb1[23])[_0xbbb1[22]];_0x1622x9[_0xbbb1[42]]({agentacw:true},{where:{uniqueid:_0x1622x5[_0xbbb1[40]],destuniqueid:_0x1622x5[_0xbbb1[41]]}})[_0xbbb1[34]](function(_0x1622x9){console[_0xbbb1[2]](_0xbbb1[39])})[_0xbbb1[25]](function(_0x1622x6){console[_0xbbb1[10]](_0xbbb1[38]+_0x1622x6)});}module[_0xbbb1[43]]=ACW;
\ No newline at end of file
+var _0xabf8=["\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(_0xabf8[0]);var _=require(_0xabf8[1]);var VoiceQueue=require(_0xabf8[3])[_0xabf8[2]];var Agent=require(_0xabf8[3])[_0xabf8[4]];var Action=require(_0xabf8[3])[_0xabf8[5]];var ReportAgent=require(_0xabf8[3])[_0xabf8[6]];var _voiceQueues;var _agents;var activeAcw={};function ACW(_0x8907xb){console[_0xabf8[8]](_0xabf8[7]);VoiceQueue[_0xabf8[14]]()[_0xabf8[12]](function(_0x8907x10){_voiceQueues= _0x8907x10;synchCollection(VoiceQueue,_voiceQueues,_0xabf8[13]);return Agent[_0xabf8[16]](_0xabf8[15])[_0xabf8[14]]()})[_0xabf8[12]](function(_0x8907xd){_agents= _0x8907xd;synchCollection(Agent,_agents,_0xabf8[10]);Action[_0xabf8[11]](function(_0x8907xe,_0x8907xf){return onSave(_0x8907xe,_0x8907xf)})})[_0xabf8[9]](function(_0x8907xc){console[_0xabf8[8]](_0x8907xc)})}function onSave(_0x8907xe,_0x8907xf){var _0x8907x12;if((_0x8907xe[_0xabf8[13]]=== _0xabf8[17]|| _0x8907xe[_0xabf8[13]]=== _0xabf8[18])&& activeAcw[_0x8907xf[_0xabf8[19]][_0xabf8[15]]]){if(_0x8907xe[_0xabf8[13]]=== _0xabf8[18]&& activeAcw[_0x8907xf[_0xabf8[19]][_0xabf8[15]]][_0xabf8[18]]){_0x8907x12= activeAcw[_0x8907xf[_0xabf8[19]][_0xabf8[15]]][_0xabf8[20]]}else {clearTimeout(activeAcw[_0x8907xf[_0xabf8[19]][_0xabf8[15]]][_0xabf8[21]]);_0x8907x12= moment[_0xabf8[24]](moment()- activeAcw[_0x8907xf[_0xabf8[19]][_0xabf8[15]]][_0xabf8[23]])[_0xabf8[22]]()};return ReportAgent[_0xabf8[29]]({agentacw:true,acwtime:_0x8907x12},{where:{uniqueid:activeAcw[_0x8907xf[_0xabf8[19]][_0xabf8[15]]][_0xabf8[26]],destuniqueid:activeAcw[_0x8907xf[_0xabf8[19]][_0xabf8[15]]][_0xabf8[27]]},transaction:_0x8907xf[_0xabf8[28]],individualHooks:true})[_0xabf8[9]](function(_0x8907xc){console[_0xabf8[8]](_0x8907xc)})[_0xabf8[25]](function(){delete activeAcw[_0x8907xf[_0xabf8[19]][_0xabf8[15]]]})}}ACW[_0xabf8[31]][_0xabf8[30]]= function(_0x8907x13){var _0x8907x14=_[_0xabf8[33]](_voiceQueues,{name:_0x8907x13[_0xabf8[32]],acw:true});if(_0x8907x14){var _0x8907x15=_[_0xabf8[33]](_agents,{name:_0x8907x13[_0xabf8[34]]});Action[_0xabf8[39]]({name:_0xabf8[17],data1:_0xabf8[38],data2:_0x8907x14[_0xabf8[36]],data3:_0x8907x13[_0xabf8[26]],data4:_0x8907x13[_0xabf8[32]]},{body:{agent:_0x8907x15[_0xabf8[10]],type:_0xabf8[38]}})[_0xabf8[12]](function(){console[_0xabf8[8]](_0xabf8[35]);activeAcw[_0x8907x15[_0xabf8[10]]]= {uniqueid:_0x8907x13[_0xabf8[26]],destuniqueid:_0x8907x13[_0xabf8[27]],acwTime:_0x8907x14[_0xabf8[36]],acwAt:moment(),unpause:false};activeAcw[_0x8907x15[_0xabf8[10]]][_0xabf8[21]]= setTimeout(function(){console[_0xabf8[8]](_0xabf8[37]);activeAcw[_0x8907x15[_0xabf8[10]]][_0xabf8[18]]= true;return Action[_0xabf8[39]]({name:_0xabf8[18],data1:_0xabf8[38],data2:_0x8907x14[_0xabf8[36]],data3:_0x8907x13[_0xabf8[26]],data4:_0x8907x13[_0xabf8[32]]},{body:{agent:_0x8907x15[_0xabf8[10]],type:_0xabf8[38]}})[_0xabf8[9]](function(_0x8907xc){console[_0xabf8[8]](_0x8907xc)})},_0x8907x14[_0xabf8[36]]* 1000)})[_0xabf8[9]](function(_0x8907xc){console[_0xabf8[8]](_0x8907xc)})}};function synchCollection(_0x8907x17,_0x8907x18,_0x8907x19){var _0x8907x1a={};_0x8907x17[_0xabf8[11]](function(_0x8907xe){_0x8907x1a[_0x8907x19]= _0x8907xe[_0x8907x19];updateCollection(_0x8907x18,_0x8907xe,_0x8907x1a)});_0x8907x17[_0xabf8[40]](function(_0x8907xe){_0x8907x1a[_0x8907x19]= _0x8907xe[_0x8907x19];updateCollection(_0x8907x18,_0x8907xe,_0x8907x1a)});_0x8907x17[_0xabf8[42]](function(_0x8907xe){_0x8907x1a[_0x8907x19]= _0x8907xe[_0x8907x19];_[_0xabf8[41]](_0x8907x18,_0x8907x1a)})}function updateCollection(_0x8907x1c,_0x8907xe,_0x8907x1a){var _0x8907x1d=_[_0xabf8[33]](_0x8907x1c,_0x8907x1a);var _0x8907x1e=_0x8907x1c[_0xabf8[43]](_0x8907x1d);if(_0x8907x1d){_[_0xabf8[44]](_0x8907x1c[_0x8907x1e],_0x8907xe)}else {_0x8907x1c[_0xabf8[45]](_0x8907xe)}}module[_0xabf8[46]]= ACW
\ No newline at end of file