Built motion from commit 16cc8f1.|1.0.14
[motion.git] / server / config / ami / socket.js
index 7037199..ef5dcae 100644 (file)
@@ -1 +1 @@
-var _0x82f8=["\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","\x72\x65\x64\x69\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74","\x52\x65\x70\x6F\x72\x74\x44\x69\x61\x6C","\x52\x65\x70\x6F\x72\x74\x4D\x65\x6D\x62\x65\x72","\x55\x73\x65\x72","\x2E\x2E\x2F\x74\x72\x69\x67\x67\x65\x72\x73","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x2E\x2F\x75\x74\x69\x6C\x73","\x72\x65\x64\x69\x73\x50\x77\x64","\x69\x70","\x63\x72\x65\x61\x74\x65\x43\x6C\x69\x65\x6E\x74","\x73\x6F\x63\x6B\x65\x74\x2E\x69\x6F\x2D\x65\x6D\x69\x74\x74\x65\x72","\x65\x78\x70\x6F\x72\x74\x73","\x65\x6D\x69\x74","\x74\x6F","\x65\x76\x65\x6E\x74","\x70\x72\x69\x76\x69\x6C\x65\x67\x65","\x6D\x65\x6D\x62\x65\x72\x73\x68\x69\x70","\x72\x69\x6E\x67\x69\x6E\x75\x73\x65","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x6E\x61\x6D\x65","\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x73\x74\x61\x74\x65\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x73\x74\x61\x74\x75\x73\x64\x65\x73\x63","\x55\x4E\x4B\x4E\x4F\x57\x4E","\x30","\x4E\x4F\x54\x5F\x49\x4E\x55\x53\x45","\x31","\x49\x4E\x55\x53\x45","\x32","\x42\x55\x53\x59","\x33","\x49\x4E\x56\x41\x4C\x49\x44","\x34","\x55\x4E\x41\x56\x41\x49\x4C\x41\x42\x4C\x45","\x35","\x52\x49\x4E\x47\x49\x4E\x47","\x36","\x52\x49\x4E\x47\x49\x4E\x55\x53\x45","\x37","\x4F\x4E\x48\x4F\x4C\x44","\x38","\x73\x74\x61\x74\x75\x73","\x70\x65\x6E\x61\x6C\x74\x79","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x63\x61\x6C\x6C\x73\x74\x61\x6B\x65\x6E","\x6C\x61\x73\x74\x63\x61\x6C\x6C","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x70\x61\x75\x73\x65\x64","\x71\x75\x65\x75\x65\x73","\x69\x6E\x62\x6F\x75\x6E\x64","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x74\x6F\x74\x61\x6C","\x67\x6C\x6F\x62\x61\x6C","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x61\x6E\x73\x77\x65\x72\x65\x64","\x41\x4E\x53\x57\x45\x52\x45\x44","\x64\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x63\x6F\x75\x6E\x74\x42\x79","\x73\x75\x6D\x44\x75\x72\x61\x74\x69\x6F\x6E","\x62\x69\x6C\x6C\x61\x62\x6C\x65\x73\x65\x63\x6F\x6E\x64\x73","\x73\x75\x6D\x42\x79","\x61\x76\x67\x44\x75\x72\x61\x74\x69\x6F\x6E","\x72\x65\x73\x75\x6C\x74","\x72\x6F\x75\x6E\x64","\x61\x6E\x73\x77\x65\x72\x52\x61\x74\x65","\x74\x68\x65\x6E","\x71\x75\x65\x75\x65","\x69\x73\x57\x61\x69\x74\x69\x6E\x67","\x77\x61\x69\x74\x69\x6E\x67","\x69\x73\x41\x63\x74\x69\x76\x65","\x61\x63\x74\x69\x76\x65","\x69\x73\x43\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x63\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x68\x6F\x6C\x64\x74\x69\x6D\x65","\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6C\x65\x61\x76\x65\x41\x74","\x73\x65\x63\x6F\x6E\x64\x73","\x64\x69\x66\x66","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x41\x74","\x61\x76\x67\x48\x6F\x6C\x64\x74\x69\x6D\x65","\x61\x76\x67\x54\x61\x6C\x6B\x74\x69\x6D\x65","\x69\x73\x41\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x69\x73\x55\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x61\x62\x61\x6E\x64\x6F\x6E\x52\x61\x74\x65","\x74\x79\x70\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x66\x6F\x72\x45\x61\x63\x68","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x65\x78\x69\x74","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x76\x6F\x69\x63\x65\x2F\x6F\x75\x74\x62\x6F\x75\x6E\x64\x2F\x67\x6C\x6F\x62\x61\x6C","\x76\x6F\x69\x63\x65\x3A\x6F\x75\x74\x62\x6F\x75\x6E\x64\x3A\x67\x6C\x6F\x62\x61\x6C","\x61\x67\x65\x6E\x74\x73","\x72\x65\x70\x6F\x72\x74\x5F\x63\x61\x6C\x6C\x3A\x73\x61\x76\x65","\x72\x65\x73\x6F\x6C\x76\x65","\x75\x6E\x69\x71\x75\x65\x69\x64","\x63\x68\x61\x6E\x6E\x65\x6C\x73","\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x61\x67\x65\x6E\x74\x3A\x25\x73","\x73\x70\x6C\x69\x74","\x63\x68\x61\x6E\x6E\x65\x6C","\x72\x65\x70\x6F\x72\x74\x5F\x64\x69\x61\x6C\x3A\x75\x70\x64\x61\x74\x65","\x61\x64\x6D\x69\x6E\x73","\x75\x73\x65\x72\x73","\x72\x65\x70\x6F\x72\x74\x44\x69\x61\x6C","\x64\x65\x76\x69\x63\x65\x73\x74\x61\x74\x65\x63\x68\x61\x6E\x67\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x6C\x6F\x67","\x69\x64","\x73\x74\x61\x74\x65","\x61\x73\x73\x69\x67\x6E","\x25\x73\x3A\x25\x73","\x72\x6F\x6C\x65","\x61\x67\x65\x6E\x74\x3A\x73\x61\x76\x65","\x53\x49\x50\x2F","","\x72\x65\x70\x6C\x61\x63\x65","\x64\x65\x76\x69\x63\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x74\x72\x75\x6E\x6B\x73","\x70\x65\x65\x72\x73\x74\x61\x74\x75\x73","\x76\x6F\x69\x63\x65\x2F\x74\x72\x75\x6E\x6B\x73","\x76\x6F\x69\x63\x65\x3A\x74\x72\x75\x6E\x6B\x73","\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x3A\x73\x61\x76\x65","\x72\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x43\x72\x65\x61\x74\x65","\x61\x67\x65\x6E\x74\x63\x61\x6C\x6C\x65\x64\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x63\x61\x6C\x6C\x65\x64","\x72\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x55\x70\x64\x61\x74\x65","\x76\x6F\x69\x63\x65\x3A\x69\x6E\x62\x6F\x75\x6E\x64","\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x3A\x75\x70\x64\x61\x74\x65","\x72\x65\x61\x73\x6F\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x3A\x75\x70\x64\x61\x74\x65","\x64\x65\x73\x74\x75\x6E\x69\x71\x75\x65\x69\x64","\x63\x6F\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x61\x6D\x65","\x72\x69\x6E\x67\x74\x69\x6D\x65","\x61\x67\x65\x6E\x74\x63\x6F\x6E\x6E\x65\x63\x74\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x63\x6F\x6E\x6E\x65\x63\x74","\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x65\x6C\x73\x65\x77\x68\x65\x72\x65","\x61\x67\x65\x6E\x74\x72\x69\x6E\x67\x6E\x6F\x61\x6E\x73\x77\x65\x72\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x72\x65\x6A\x65\x63\x74\x65\x64","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x76\x6F\x69\x63\x65\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x71\x75\x65\x75\x65\x6D\x65\x6D\x62\x65\x72\x72\x65\x6D\x6F\x76\x65\x64\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x76\x6F\x69\x63\x65\x5F\x71\x75\x65\x75\x65\x3A\x72\x65\x6D\x6F\x76\x65","\x71\x75\x65\x75\x65\x6D\x65\x6D\x62\x65\x72\x70\x61\x75\x73\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x6D\x65\x72\x67\x65","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65\x64\x65\x73\x63","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x65\x78\x74\x65\x6E","\x70\x72\x69\x6F\x72\x69\x74\x79","\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x63\x6F\x75\x6E\x74","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6A\x6F\x69\x6E\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x6F\x72\x69\x67\x69\x6E\x61\x6C\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x61\x62\x61\x6E\x64\x6F\x6E","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x63\x6F\x6E\x74\x65\x78\x74","\x64\x69\x61\x6C\x73\x74\x72\x69\x6E\x67","\x72\x65\x70\x6F\x72\x74\x5F\x64\x69\x61\x6C\x3A\x73\x61\x76\x65","\x64\x69\x61\x6C\x73\x74\x61\x74\x75\x73","\x41\x4E\x53\x57\x45\x52","\x64\x65\x73\x74\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x71\x75\x65\x75\x65\x73\x74\x61\x74\x75\x73","\x76\x61\x72\x69\x61\x62\x6C\x65","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x72\x6F\x75\x74\x65\x69\x64","\x76\x61\x6C\x75\x65","\x76\x61\x72\x53\x65\x74","\x73\x6F\x63\x6B\x65\x74","\x63\x6F\x6E\x73\x6F\x6C\x65\x3A\x25\x73","\x64\x61\x74\x61","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x66\x6F\x72\x4F\x77\x6E","\x75\x70\x64\x61\x74\x65\x54\x72\x69\x67\x67\x65\x72\x73","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x25\x73\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x25\x73\x5F\x71\x75\x65\x75\x65\x3A\x72\x65\x6D\x6F\x76\x65","\x63\x68\x65\x63\x6B\x54\x72\x69\x67\x67\x65\x72\x73"];_0x82f8[0];var _=require(_0x82f8[1]);var util=require(_0x82f8[2]);var moment=require(_0x82f8[3]);var BPromise=require(_0x82f8[4]);var redis=require(_0x82f8[5]);var VoiceQueue=require(_0x82f8[7])[_0x82f8[6]];var ReportQueue=require(_0x82f8[7])[_0x82f8[8]];var ReportCall=require(_0x82f8[7])[_0x82f8[9]];var ReportAgent=require(_0x82f8[7])[_0x82f8[10]];var ReportDial=require(_0x82f8[7])[_0x82f8[11]];var ReportMember=require(_0x82f8[7])[_0x82f8[12]];var User=require(_0x82f8[7])[_0x82f8[13]];var Triggers=require(_0x82f8[14]);var config=require(_0x82f8[15]);var utils=require(_0x82f8[16]);var redisConf;if(config[_0x82f8[17]]){redisConf= {password:config[_0x82f8[17]]}};var redisClient=redis[_0x82f8[19]](6379,config[_0x82f8[18]],redisConf);var io=require(_0x82f8[20])(redisClient);var triggers= new Triggers(io);var params={trunks:[],inbound:{queues:{},channels:[],global:{waiting:0,active:0,completed:0,abandoned:0,unmanaged:0,holdtime:0,talktime:0,avgHoldtime:0,avgTalktime:0,answerRate:0,abandonRate:0,total:0}},outbound:{global:{total:0,answered:0,sumDuration:0,avgDuration:0},channels:[]}};module[_0x82f8[21]]= function(){var _0x657cx15=function(_0x657cx16,_0x657cx17,_0x657cx18){if(_0x657cx16){io[_0x82f8[23]](_0x657cx16)[_0x82f8[22]](_0x657cx17,_0x657cx18)}else {io[_0x82f8[22]](_0x657cx17,_0x657cx18)}};var _0x657cx19=function(_0x657cx1a){delete _0x657cx1a[_0x82f8[24]];delete _0x657cx1a[_0x82f8[25]];delete _0x657cx1a[_0x82f8[26]];delete _0x657cx1a[_0x82f8[27]];_0x657cx1a[_0x82f8[28]]= _0x657cx1a[_0x82f8[29]]|| _0x657cx1a[_0x82f8[28]];_0x657cx1a[_0x82f8[30]]= _0x657cx1a[_0x82f8[31]];_0x657cx1a[_0x82f8[32]]= _0x82f8[33];switch(_0x657cx1a[_0x82f8[51]]){case _0x82f8[34]:_0x657cx1a[_0x82f8[32]]= _0x82f8[33];break;case _0x82f8[36]:_0x657cx1a[_0x82f8[32]]= _0x82f8[35];break;case _0x82f8[38]:_0x657cx1a[_0x82f8[32]]= _0x82f8[37];break;case _0x82f8[40]:_0x657cx1a[_0x82f8[32]]= _0x82f8[39];break;case _0x82f8[42]:_0x657cx1a[_0x82f8[32]]= _0x82f8[41];break;case _0x82f8[44]:_0x657cx1a[_0x82f8[32]]= _0x82f8[43];break;case _0x82f8[46]:_0x657cx1a[_0x82f8[32]]= _0x82f8[45];break;case _0x82f8[48]:_0x657cx1a[_0x82f8[32]]= _0x82f8[47];break;case _0x82f8[50]:_0x657cx1a[_0x82f8[32]]= _0x82f8[49];break;default:};_0x657cx1a[_0x82f8[51]]= Number(_0x657cx1a[_0x82f8[51]]);if(_0x657cx1a[_0x82f8[53]](_0x82f8[52])){_0x657cx1a[_0x82f8[52]]= Number(_0x657cx1a[_0x82f8[52]])};if(_0x657cx1a[_0x82f8[53]](_0x82f8[54])){_0x657cx1a[_0x82f8[54]]= Number(_0x657cx1a[_0x82f8[54]])};if(_0x657cx1a[_0x82f8[53]](_0x82f8[55])){if(_0x657cx1a[_0x82f8[55]]=== _0x82f8[34]){_0x657cx1a[_0x82f8[55]]= null}else {_0x657cx1a[_0x82f8[55]]= moment()[_0x82f8[57]](_0x82f8[56])}};_0x657cx1a[_0x82f8[58]]= parseInt(_0x657cx1a[_0x82f8[58]],10)?true:false};function _0x657cx1b(_0x657cx1c){if(!params[_0x82f8[60]][_0x82f8[59]][_0x657cx1c]){params[_0x82f8[60]][_0x82f8[59]][_0x657cx1c]= {agents:{},waiting:0,active:0,completed:0,abandoned:0,unmanaged:0,holdtime:0,talktime:0,avgHoldtime:0,avgTalktime:0,answerRate:0,abandonRate:0,total:0}}}VoiceQueue[_0x82f8[100]]({attributes:[_0x82f8[29]],raw:true})[_0x82f8[78]](function(_0x657cx1e){if(_0x657cx1e){_[_0x82f8[101]](_0x657cx1e,function(_0x657cx1c){_0x657cx1b(_0x657cx1c[_0x82f8[29]])});return ReportQueue[_0x82f8[100]]({attributes:[_0x82f8[79],_0x82f8[88],_0x82f8[91],_0x82f8[102],_0x82f8[103],_0x82f8[104],_0x82f8[86]],raw:true})}})[_0x82f8[78]](function(_0x657cx1e){if(_0x657cx1e){var _0x657cx1f;var _0x657cx20;var _0x657cx21=_0x657cx1e[_0x82f8[63]];for(var _0x657cx22=0;_0x657cx22< _0x657cx21;_0x657cx22++){_0x657cx1f= _0x657cx1e[_0x657cx22];_0x657cx20= _0x657cx1f[_0x82f8[79]];_0x657cx1b(_0x657cx20);params[_0x82f8[60]][_0x82f8[65]][_0x82f8[64]]++;params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[64]]++;if(utils[_0x82f8[80]](_0x657cx1f)){params[_0x82f8[60]][_0x82f8[65]][_0x82f8[81]]++;params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[81]]++};if(utils[_0x82f8[82]](_0x657cx1f)){params[_0x82f8[60]][_0x82f8[65]][_0x82f8[83]]++;params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[83]]++};if(utils[_0x82f8[84]](_0x657cx1f)){params[_0x82f8[60]][_0x82f8[65]][_0x82f8[85]]++;params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[85]]++;params[_0x82f8[60]][_0x82f8[65]][_0x82f8[86]]+= _0x657cx1f[_0x82f8[86]]|| 0;params[_0x82f8[60]][_0x82f8[65]][_0x82f8[87]]+= moment(_0x657cx1f[_0x82f8[91]])[_0x82f8[90]](moment(_0x657cx1f[_0x82f8[88]]),_0x82f8[89]);params[_0x82f8[60]][_0x82f8[65]][_0x82f8[92]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[86]]/ params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[85]]);params[_0x82f8[60]][_0x82f8[65]][_0x82f8[93]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[87]]/ params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[85]]);params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[86]]+= _0x657cx1f[_0x82f8[86]]|| 0;params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[87]]+= moment(_0x657cx1f[_0x82f8[91]])[_0x82f8[90]](moment(_0x657cx1f[_0x82f8[88]]),_0x82f8[89]);params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[92]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[86]]/ params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[85]]);params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[93]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[87]]/ params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[85]])};if(utils[_0x82f8[94]](_0x657cx1f)){params[_0x82f8[60]][_0x82f8[65]][_0x82f8[95]]++;params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[95]]++};if(utils[_0x82f8[96]](_0x657cx1f)){params[_0x82f8[60]][_0x82f8[65]][_0x82f8[97]]++;params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[97]]++}};params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[77]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[85]]/ (params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[85]]+ params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[95]])* 100,2);params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[98]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[95]]/ (params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[85]]+ params[_0x82f8[60]][_0x82f8[59]][_0x657cx20][_0x82f8[95]])* 100,2);params[_0x82f8[60]][_0x82f8[65]][_0x82f8[77]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[65]][_0x82f8[85]]/ (params[_0x82f8[60]][_0x82f8[65]][_0x82f8[85]]+ params[_0x82f8[60]][_0x82f8[65]][_0x82f8[95]])* 100,2);params[_0x82f8[60]][_0x82f8[65]][_0x82f8[98]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[65]][_0x82f8[95]]/ (params[_0x82f8[60]][_0x82f8[65]][_0x82f8[85]]+ params[_0x82f8[60]][_0x82f8[65]][_0x82f8[95]])* 100,2)};return ReportCall[_0x82f8[100]]({where:{type:_0x82f8[66]},attributes:[_0x82f8[99],_0x82f8[69],_0x82f8[72]],raw:true})})[_0x82f8[78]](function(_0x657cx1e){if(_0x657cx1e){if(_0x657cx1e[_0x82f8[63]]){params[_0x82f8[66]][_0x82f8[65]][_0x82f8[64]]= _0x657cx1e[_0x82f8[63]];params[_0x82f8[66]][_0x82f8[65]][_0x82f8[67]]= _[_0x82f8[70]](_0x657cx1e,_0x82f8[69])[_0x82f8[68]]|| 0;params[_0x82f8[66]][_0x82f8[65]][_0x82f8[71]]= _[_0x82f8[73]](_0x657cx1e,_0x82f8[72]);if(params[_0x82f8[66]][_0x82f8[65]][_0x82f8[67]]){params[_0x82f8[66]][_0x82f8[65]][_0x82f8[74]]= _[_0x82f8[76]]((_[_0x82f8[73]](_0x657cx1e[_0x82f8[75]],_0x82f8[72])/ params[_0x82f8[66]][_0x82f8[65]][_0x82f8[67]]));params[_0x82f8[66]][_0x82f8[65]][_0x82f8[77]]= _[_0x82f8[76]](params[_0x82f8[66]][_0x82f8[65]][_0x82f8[67]]/ params[_0x82f8[66]][_0x82f8[65]][_0x82f8[64]]* 100,1)}}}})[_0x82f8[62]](function(_0x657cx1d){console[_0x82f8[61]](_0x657cx1d)});return {cdr:function(_0x657cx1a){return function(_0x657cx1e){if(_0x657cx1a[_0x82f8[99]]=== _0x82f8[66]){params[_0x82f8[66]][_0x82f8[65]][_0x82f8[64]]++;params[_0x82f8[66]][_0x82f8[65]][_0x82f8[67]]= (_0x657cx1a[_0x82f8[69]]=== _0x82f8[68])?++params[_0x82f8[66]][_0x82f8[65]][_0x82f8[67]]:params[_0x82f8[66]][_0x82f8[65]][_0x82f8[67]];params[_0x82f8[66]][_0x82f8[65]][_0x82f8[71]]+= Number(_0x657cx1a[_0x82f8[72]]);if(params[_0x82f8[66]][_0x82f8[65]][_0x82f8[67]]){params[_0x82f8[66]][_0x82f8[65]][_0x82f8[74]]= _[_0x82f8[76]](params[_0x82f8[66]][_0x82f8[65]][_0x82f8[71]]/ params[_0x82f8[66]][_0x82f8[65]][_0x82f8[67]]);params[_0x82f8[66]][_0x82f8[65]][_0x82f8[77]]= _[_0x82f8[76]](params[_0x82f8[66]][_0x82f8[65]][_0x82f8[67]]/ params[_0x82f8[66]][_0x82f8[65]][_0x82f8[64]]* 100,1)};_0x657cx15(_0x82f8[105],_0x82f8[106],params[_0x82f8[66]][_0x82f8[65]])};_0x657cx15(_0x82f8[107],_0x82f8[108],_0x657cx1a);return BPromise[_0x82f8[109]]()}},send:function(_0x657cx1a){return function(_0x657cx1e){return BPromise[_0x82f8[109]]()}},hangup:function(_0x657cx1a){return function(_0x657cx1e){if(params[_0x82f8[66]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]]){delete params[_0x82f8[66]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]]};if(params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]]){delete params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]]};var _0x657cx23={uniqueid:_0x657cx1a[_0x82f8[110]],linkedid:_0x657cx1a[_0x82f8[112]],endtime:moment()[_0x82f8[57]](_0x82f8[56]),lastevent:_0x82f8[113],updatedAt:moment()[_0x82f8[57]](_0x82f8[56])};_0x657cx15(util[_0x82f8[57]](_0x82f8[114],_0x657cx1a[_0x82f8[116]][_0x82f8[115]](/\/|-/)[1]),_0x82f8[117],_0x657cx23);_0x657cx15(_0x82f8[118],_0x82f8[117],_0x657cx23);_0x657cx15(_0x82f8[119],_0x82f8[117],_0x657cx23);if(_0x657cx1e){triggers[_0x82f8[120]](_0x657cx1e)};return BPromise[_0x82f8[109]]()}},devicestatechange:function(_0x657cx1a){return function(_0x657cx1e){return User[_0x82f8[133]]({where:{name:_0x657cx1a[_0x82f8[132]][_0x82f8[131]](_0x82f8[129],_0x82f8[130])},raw:true})[_0x82f8[78]](function(_0x657cx24){if(_0x657cx24){var _0x657cx23=_[_0x82f8[125]]({newValues:{id:_0x657cx24[_0x82f8[123]],status:_0x657cx1a[_0x82f8[124]],statusAt:moment()[_0x82f8[57]](_0x82f8[56])}},_0x657cx24,{status:_0x657cx1a[_0x82f8[124]],statusAt:moment()[_0x82f8[57]](_0x82f8[56])});_0x657cx15(util[_0x82f8[57]](_0x82f8[126],_0x657cx24[_0x82f8[127]],_0x657cx24[_0x82f8[123]]),_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[119],_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[118],_0x82f8[128],_0x657cx23)}})[_0x82f8[62]](function(_0x657cx1d){console[_0x82f8[122]](_0x82f8[121],_0x657cx1d)})}},peerstatus:function(_0x657cx1a){return function(_0x657cx1e){if(_0x657cx1e&& _0x657cx1e[0]){_[_0x82f8[101]](_0x657cx1e[1],function(_0x657cx25){if(!params[_0x82f8[134]][_0x657cx25[_0x82f8[29]]]){params[_0x82f8[134]][_0x657cx25[_0x82f8[29]]]= {name:_0x657cx25[_0x82f8[29]]}};params[_0x82f8[134]][_0x657cx25[_0x82f8[29]]][_0x82f8[135]]= _0x657cx1a[_0x82f8[135]];_0x657cx15(_0x82f8[136],_0x82f8[137],params[_0x82f8[134]][_0x657cx25[_0x82f8[29]]])})};return BPromise[_0x82f8[109]]()}},registry:function(_0x657cx1a){return function(_0x657cx1e){if(_0x657cx1e&& _0x657cx1e[0]){_[_0x82f8[101]](_0x657cx1e[1],function(_0x657cx25){if(!params[_0x82f8[134]][_0x657cx25[_0x82f8[29]]]){params[_0x82f8[134]][_0x657cx25[_0x82f8[29]]]= {name:_0x657cx25[_0x82f8[29]]}};params[_0x82f8[134]][_0x657cx25[_0x82f8[29]]][_0x82f8[51]]= _0x657cx1a[_0x82f8[51]];_0x657cx15(_0x82f8[136],_0x82f8[137],params[_0x82f8[134]][_0x657cx25[_0x82f8[29]]])})};return BPromise[_0x82f8[109]]()}},agentcalled:function(_0x657cx1a){return function(_0x657cx1e){if(_0x657cx1e){_0x657cx15(util[_0x82f8[57]](_0x82f8[114],_0x657cx1e[_0x82f8[28]]),_0x82f8[138],_0x657cx1e);triggers[_0x82f8[139]](_0x657cx1e)};return User[_0x82f8[133]]({where:{name:_0x657cx1a[_0x82f8[28]],voicePause:false},raw:true})[_0x82f8[78]](function(_0x657cx24){if(_0x657cx24){var _0x657cx26=moment()[_0x82f8[57]](_0x82f8[56]);var _0x657cx23=_[_0x82f8[125]]({newValues:{id:_0x657cx24[_0x82f8[123]],queueStatus:_0x82f8[141],queueStatusAt:_0x657cx26,lastQueue:_0x657cx1a[_0x82f8[79]]}},_0x657cx24,{queueStatus:_0x82f8[141],queueStatusAt:_0x657cx26,lastQueue:_0x657cx1a[_0x82f8[79]]});_0x657cx15(util[_0x82f8[57]](_0x82f8[126],_0x657cx24[_0x82f8[127]],_0x657cx24[_0x82f8[123]]),_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[119],_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[118],_0x82f8[128],_0x657cx23)}})[_0x82f8[62]](function(_0x657cx1d){console[_0x82f8[122]](_0x82f8[140],_0x657cx1d)})}},agentcomplete:function(_0x657cx1a){return function(_0x657cx1e){if(_0x657cx1e){triggers[_0x82f8[142]](_0x657cx1e)};if(params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[83]]){params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[83]]--};if(params[_0x82f8[60]][_0x82f8[65]][_0x82f8[83]]){params[_0x82f8[60]][_0x82f8[65]][_0x82f8[83]]--;_0x657cx15(_0x657cx1a[_0x82f8[79]],_0x82f8[143],{type:_0x82f8[83],amount:-1,queue:_0x657cx1a[_0x82f8[79]]})};params[_0x82f8[60]][_0x82f8[65]][_0x82f8[85]]++;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[85]]++;_0x657cx15(_0x657cx1a[_0x82f8[79]],_0x82f8[143],{type:_0x82f8[113],amount:1,queue:_0x657cx1a[_0x82f8[79]]});params[_0x82f8[60]][_0x82f8[65]][_0x82f8[77]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[65]][_0x82f8[85]]/ (params[_0x82f8[60]][_0x82f8[65]][_0x82f8[85]]+ params[_0x82f8[60]][_0x82f8[65]][_0x82f8[95]])* 100,2);params[_0x82f8[60]][_0x82f8[65]][_0x82f8[98]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[65]][_0x82f8[95]]/ (params[_0x82f8[60]][_0x82f8[65]][_0x82f8[85]]+ params[_0x82f8[60]][_0x82f8[65]][_0x82f8[95]])* 100,2);params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[77]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[85]]/ (params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[85]]+ params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[95]])* 100,2);params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[98]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[95]]/ (params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[85]]+ params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[95]])* 100,2);params[_0x82f8[60]][_0x82f8[65]][_0x82f8[87]]+= Number(_0x657cx1a[_0x82f8[87]]);params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[87]]+= Number(_0x657cx1a[_0x82f8[87]]);_0x657cx15(_0x657cx1a[_0x82f8[79]],_0x82f8[143],{type:_0x82f8[87],amount:Number(_0x657cx1a[_0x82f8[87]]),queue:_0x657cx1a[_0x82f8[79]]});params[_0x82f8[60]][_0x82f8[65]][_0x82f8[93]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[65]][_0x82f8[87]]/ params[_0x82f8[60]][_0x82f8[65]][_0x82f8[85]]);params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[93]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[87]]/ params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[85]]);params[_0x82f8[60]][_0x82f8[65]][_0x82f8[86]]+= Number(_0x657cx1a[_0x82f8[86]]);params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[86]]+= Number(_0x657cx1a[_0x82f8[86]]);_0x657cx15(_0x657cx1a[_0x82f8[79]],_0x82f8[143],{type:_0x82f8[86],amount:Number(_0x657cx1a[_0x82f8[86]]),queue:_0x657cx1a[_0x82f8[79]]});params[_0x82f8[60]][_0x82f8[65]][_0x82f8[92]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[65]][_0x82f8[86]]/ params[_0x82f8[60]][_0x82f8[65]][_0x82f8[85]]);params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[92]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[86]]/ params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[85]]);var _0x657cx23;var _0x657cx26=moment()[_0x82f8[57]](_0x82f8[56]);return ReportAgent[_0x82f8[133]]({where:{uniqueid:_0x657cx1a[_0x82f8[110]],destuniqueid:_0x657cx1a[_0x82f8[148]]},raw:true})[_0x82f8[78]](function(_0x657cx27){if(_0x657cx27){_0x657cx23= _[_0x82f8[125]]({},_0x657cx27,{lastevent:_0x82f8[113],agentcomplete:true,agentcompleteAt:_0x657cx26,talktime:Number(_0x657cx1a[_0x82f8[87]]),reason:_0x657cx1a[_0x82f8[146]]});_0x657cx15(util[_0x82f8[57]](_0x82f8[114],_0x657cx27[_0x82f8[28]]),_0x82f8[147],_0x657cx23)};return ReportQueue[_0x82f8[133]]({where:{uniqueid:_0x657cx1a[_0x82f8[110]]},raw:true})})[_0x82f8[78]](function(_0x657cx27){if(_0x657cx27){_0x657cx23= _[_0x82f8[125]]({},_0x657cx27,{queuecallercomplete:true,queuecallercompleteAt:_0x657cx26});_0x657cx15(_0x657cx27[_0x82f8[79]],_0x82f8[145],_0x657cx23)};return User[_0x82f8[133]]({where:{name:_0x657cx1a[_0x82f8[28]],voicePause:false},raw:true})})[_0x82f8[78]](function(_0x657cx24){if(_0x657cx24){var _0x657cx23=_[_0x82f8[125]]({newValues:{id:_0x657cx24[_0x82f8[123]],queueStatus:_0x82f8[113],queueStatusAt:_0x657cx26,lastQueue:_0x657cx1a[_0x82f8[79]]}},_0x657cx24,{queueStatus:_0x82f8[113],queueStatusAt:_0x657cx26,lastQueue:_0x657cx1a[_0x82f8[79]]});_0x657cx15(util[_0x82f8[57]](_0x82f8[126],_0x657cx24[_0x82f8[127]],_0x657cx24[_0x82f8[123]]),_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[119],_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[118],_0x82f8[128],_0x657cx23)}})[_0x82f8[62]](function(_0x657cx1d){console[_0x82f8[122]](_0x82f8[144],_0x657cx1d)})}},agentconnect:function(_0x657cx1a){return function(_0x657cx1e){if(_0x657cx1e){triggers[_0x82f8[142]](_0x657cx1e)};if(params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[81]]){params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[81]]--;_0x657cx15(_0x657cx1a[_0x82f8[79]],_0x82f8[143],{type:_0x82f8[81],amount:-1,queue:_0x657cx1a[_0x82f8[79]]})};if(params[_0x82f8[60]][_0x82f8[65]][_0x82f8[81]]){params[_0x82f8[60]][_0x82f8[65]][_0x82f8[81]]--};if(params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]]){params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]][_0x82f8[149]]= _0x657cx1a[_0x82f8[150]];params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]][_0x82f8[151]]= _0x657cx1a[_0x82f8[151]];params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]][_0x82f8[86]]= Number(_0x657cx1a[_0x82f8[86]]);params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]][_0x82f8[152]]= Number(_0x657cx1a[_0x82f8[152]]);params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]][_0x82f8[30]]= _0x657cx1a[_0x82f8[30]];params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]][_0x82f8[28]]= _0x657cx1a[_0x82f8[28]]};params[_0x82f8[60]][_0x82f8[65]][_0x82f8[83]]++;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[83]]++;_0x657cx15(_0x657cx1a[_0x82f8[79]],_0x82f8[143],{type:_0x82f8[83],amount:1,queue:_0x657cx1a[_0x82f8[79]]});var _0x657cx23;var _0x657cx26=moment()[_0x82f8[57]](_0x82f8[56]);return ReportQueue[_0x82f8[133]]({where:{uniqueid:_0x657cx1a[_0x82f8[110]]},raw:true})[_0x82f8[78]](function(_0x657cx27){if(_0x657cx27){_0x657cx23= _[_0x82f8[125]]({},_0x657cx27,{queuecallerleaveAt:moment()[_0x82f8[57]](_0x82f8[56]),holdtime:_0x657cx1a[_0x82f8[86]],assigned:true,lastAssignedTo:_0x657cx1a[_0x82f8[28]]});_0x657cx15(_0x657cx27[_0x82f8[79]],_0x82f8[145],_0x657cx23)};return ReportAgent[_0x82f8[133]]({where:{uniqueid:_0x657cx1a[_0x82f8[110]],destuniqueid:_0x657cx1a[_0x82f8[148]]},raw:true})})[_0x82f8[78]](function(_0x657cx27){if(_0x657cx27){_0x657cx23= _[_0x82f8[125]]({},_0x657cx27,{lastevent:_0x82f8[154],agentconnectAt:moment()[_0x82f8[57]](_0x82f8[56]),holdtime:_0x657cx1a[_0x82f8[86]]});_0x657cx15(util[_0x82f8[57]](_0x82f8[114],_0x657cx27[_0x82f8[28]]),_0x82f8[147],_0x657cx23)};return ReportAgent[_0x82f8[100]]({where:{uniqueid:_0x657cx1a[_0x82f8[110]],destuniqueid:{$ne:_0x657cx1a[_0x82f8[148]]},reason:null},raw:true})})[_0x82f8[78]](function(_0x657cx29){if(_0x657cx29&& _0x657cx29[_0x82f8[63]]){_[_0x82f8[101]](_0x657cx29,function(_0x657cx27){_0x657cx23= _[_0x82f8[125]]({},_0x657cx27,{lastevent:_0x82f8[155],agentringnoanswer:true,agentringnoanswerAt:_0x657cx26,reason:_0x82f8[155],answeredelsewheredestinationuniqueid:_0x657cx1a[_0x82f8[148]],answeredelsewheremembername:_0x657cx1a[_0x82f8[28]]});_0x657cx15(util[_0x82f8[57]](_0x82f8[114],_0x657cx27[_0x82f8[28]]),_0x82f8[147],_0x657cx23)})};return User[_0x82f8[133]]({where:{name:_0x657cx1a[_0x82f8[28]],voicePause:false},raw:true})})[_0x82f8[78]](function(_0x657cx24){if(_0x657cx24){var _0x657cx23=_[_0x82f8[125]]({newValues:{id:_0x657cx24[_0x82f8[123]],queueStatus:_0x82f8[154],queueStatusAt:_0x657cx26,lastQueue:_0x657cx1a[_0x82f8[79]]}},_0x657cx24,{queueStatus:_0x82f8[154],queueStatusAt:_0x657cx26,lastQueue:_0x657cx1a[_0x82f8[79]]});_0x657cx15(util[_0x82f8[57]](_0x82f8[126],_0x657cx24[_0x82f8[127]],_0x657cx24[_0x82f8[123]]),_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[119],_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[118],_0x82f8[128],_0x657cx23)};return User[_0x82f8[100]]({where:{lastQueue:_0x657cx1a[_0x82f8[79]],name:{$ne:_0x657cx1a[_0x82f8[28]]}},raw:true})})[_0x82f8[78]](function(_0x657cx28){if(_0x657cx28&& _0x657cx28[_0x82f8[63]]){_[_0x82f8[101]](_0x657cx28,function(_0x657cx24){var _0x657cx23=_[_0x82f8[125]]({newValues:{id:_0x657cx24[_0x82f8[123]],queueStatus:_0x82f8[113],queueStatusAt:_0x657cx26}},_0x657cx24,{queueStatus:_0x82f8[113],queueStatusAt:_0x657cx26});_0x657cx15(util[_0x82f8[57]](_0x82f8[126],_0x657cx24[_0x82f8[127]],_0x657cx24[_0x82f8[123]]),_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[119],_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[118],_0x82f8[128],_0x657cx23)})}})[_0x82f8[62]](function(_0x657cx1d){console[_0x82f8[122]](_0x82f8[153],_0x657cx1d)})}},agentringnoanswer:function(_0x657cx1a){return function(_0x657cx1e){if(_0x657cx1e){triggers[_0x82f8[142]](_0x657cx1e)};var _0x657cx23;var _0x657cx26=moment()[_0x82f8[57]](_0x82f8[56]);return User[_0x82f8[133]]({where:{name:_0x657cx1a[_0x82f8[28]],voicePause:false},raw:true})[_0x82f8[78]](function(_0x657cx24){if(_0x657cx24){var _0x657cx23=_[_0x82f8[125]]({newValues:{id:_0x657cx24[_0x82f8[123]],queueStatus:_0x82f8[113],queueStatusAt:_0x657cx26,lastQueue:_0x657cx1a[_0x82f8[79]]}},_0x657cx24,{queueStatus:_0x82f8[113],queueStatusAt:_0x657cx26,lastQueue:_0x657cx1a[_0x82f8[79]]});_0x657cx15(util[_0x82f8[57]](_0x82f8[126],_0x657cx24[_0x82f8[127]],_0x657cx24[_0x82f8[123]]),_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[119],_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[118],_0x82f8[128],_0x657cx23)};return ReportAgent[_0x82f8[133]]({where:{uniqueid:_0x657cx1a[_0x82f8[110]],destuniqueid:_0x657cx1a[_0x82f8[148]]},raw:true})})[_0x82f8[78]](function(_0x657cx27){if(_0x657cx27){_0x657cx23= _[_0x82f8[125]]({},_0x657cx27,{lastevent:_0x82f8[157],agentringnoanswer:true,agentringnoanswerAt:moment()[_0x82f8[57]](_0x82f8[56]),reason:_0x82f8[157]});_0x657cx15(util[_0x82f8[57]](_0x82f8[114],_0x657cx27[_0x82f8[28]]),_0x82f8[147],_0x657cx23)}})[_0x82f8[62]](function(_0x657cx1d){console[_0x82f8[122]](_0x82f8[156],_0x657cx1d)})}},queuememberadded:function(_0x657cx1a){return function(_0x657cx1e){if(_0x657cx1e){_0x657cx15(_0x657cx1e[_0x82f8[79]],_0x82f8[158],_0x657cx1e);_0x657cx15(util[_0x82f8[57]](_0x82f8[114],_0x657cx1e.UserId),_0x82f8[158],_0x657cx1e)};return BPromise[_0x82f8[109]]()}},queuememberremoved:function(_0x657cx1a){return function(_0x657cx1e){if(params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]]){delete params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[107]][_0x657cx1a[_0x82f8[28]]]};return User[_0x82f8[133]]({where:{name:_0x657cx1a[_0x82f8[30]][_0x82f8[131]](_0x82f8[129],_0x82f8[130])},raw:true})[_0x82f8[78]](function(_0x657cx24){if(_0x657cx24){_0x657cx15(_0x657cx1a[_0x82f8[79]],_0x82f8[160],{queue:_0x657cx1a[_0x82f8[79]],UserId:_0x657cx24[_0x82f8[123]]});_0x657cx15(util[_0x82f8[57]](_0x82f8[114],_0x657cx24[_0x82f8[123]]),_0x82f8[160],{queue:_0x657cx1a[_0x82f8[79]],UserId:_0x657cx24[_0x82f8[123]]})}})[_0x82f8[62]](function(_0x657cx1d){console[_0x82f8[61]](_0x82f8[159],_0x657cx1d)})}},queuememberpause:function(_0x657cx1a){return function(_0x657cx1e){if(_0x657cx1e){_0x657cx15(_0x657cx1e[_0x82f8[79]],_0x82f8[158],_0x657cx1e);_0x657cx15(util[_0x82f8[57]](_0x82f8[114],_0x657cx1e.UserId),_0x82f8[158],_0x657cx1e)};if(parseInt(_0x657cx1a[_0x82f8[58]],10)){var _0x657cx23;var _0x657cx26=moment()[_0x82f8[57]](_0x82f8[56]);return User[_0x82f8[133]]({where:{name:_0x657cx1a[_0x82f8[28]]},raw:true})[_0x82f8[78]](function(_0x657cx24){if(_0x657cx24){var _0x657cx2a={id:_0x657cx24[_0x82f8[123]],voicePause:false};_[_0x82f8[162]](_0x657cx2a,{voicePause:true,chatPause:true,mailPause:true,faxPause:true,smsPause:true,openchannelPause:true,pauseType:_0x657cx1a[_0x82f8[146]],lastPauseAt:_0x657cx26});var _0x657cx23=_[_0x82f8[125]]({newValues:_0x657cx2a},_0x657cx24,_0x657cx2a);_0x657cx15(util[_0x82f8[57]](_0x82f8[126],_0x657cx24[_0x82f8[127]],_0x657cx24[_0x82f8[123]]),_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[119],_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[118],_0x82f8[128],_0x657cx23)}})[_0x82f8[62]](function(_0x657cx1d){console[_0x82f8[122]](_0x82f8[161],_0x657cx1d)})}}},queuememberpenalty:function(_0x657cx1a){return function(_0x657cx1e){return BPromise[_0x82f8[109]]()}},queuememberringinuse:function(_0x657cx1a){return function(_0x657cx1e){return BPromise[_0x82f8[109]]()}},queuemember:function(_0x657cx1a){return function(_0x657cx1e){_0x657cx19(_0x657cx1a);_0x657cx1b(_0x657cx1a[_0x82f8[79]]);params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[107]][_0x657cx1a[_0x82f8[29]]]= _0x657cx1a;return BPromise[_0x82f8[109]]()}},queuecallerjoin:function(_0x657cx1a){if(!params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]]){params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]]= {};params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[81]]= 0;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[83]]= 0;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[85]]= 0;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[95]]= 0;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[97]]= 0;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[86]]= 0;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[87]]= 0;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[92]]= 0;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[93]]= 0;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[77]]= 0;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[98]]= 0;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[64]]= 0};params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]]= {channel:_0x657cx1a[_0x82f8[116]],channelstate:Number(_0x657cx1a[_0x82f8[163]]),channelstatedesc:_0x657cx1a[_0x82f8[164]],calleridnum:_0x657cx1a[_0x82f8[165]],calleridname:_0x657cx1a[_0x82f8[166]],exten:_0x657cx1a[_0x82f8[167]],priority:Number(_0x657cx1a[_0x82f8[168]]),uniqueid:_0x657cx1a[_0x82f8[110]],queue:_0x657cx1a[_0x82f8[79]],position:Number(_0x657cx1a[_0x82f8[169]]),count:Number(_0x657cx1a[_0x82f8[170]])};params[_0x82f8[60]][_0x82f8[65]][_0x82f8[81]]++;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[81]]++;_0x657cx15(_0x657cx1a[_0x82f8[79]],_0x82f8[143],{type:_0x82f8[64],amount:1,queue:_0x657cx1a[_0x82f8[79]]});params[_0x82f8[60]][_0x82f8[65]][_0x82f8[64]]++;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[64]]++;_0x657cx15(_0x657cx1a[_0x82f8[79]],_0x82f8[143],{type:_0x82f8[81],amount:1,queue:_0x657cx1a[_0x82f8[79]]});return function(_0x657cx1e){if(_0x657cx1e){_0x657cx15(_0x657cx1e[_0x82f8[79]],_0x82f8[171],_0x657cx1e)};return BPromise[_0x82f8[109]]()}},queuecallerabandon:function(_0x657cx1a){return function(_0x657cx1e){if(_0x657cx1e&& _0x657cx1e[0]){_[_0x82f8[101]](_0x657cx1e[1],function(_0x657cx27){triggers[_0x82f8[142]](_0x657cx27);_0x657cx15(util[_0x82f8[57]](_0x82f8[114],_0x657cx27[_0x82f8[28]]),_0x82f8[147],_0x657cx27)})};var _0x657cx23;var _0x657cx26=moment()[_0x82f8[57]](_0x82f8[56]);return ReportQueue[_0x82f8[133]]({where:{uniqueid:_0x657cx1a[_0x82f8[110]],queuecallerexit:false},raw:true})[_0x82f8[78]](function(_0x657cx27){if(_0x657cx27){if(params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[81]]){params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[81]]--;_0x657cx15(_0x657cx1a[_0x82f8[79]],_0x82f8[143],{type:_0x82f8[81],amount:-1,queue:_0x657cx1a[_0x82f8[79]]})};if(params[_0x82f8[60]][_0x82f8[65]][_0x82f8[81]]){params[_0x82f8[60]][_0x82f8[65]][_0x82f8[81]]--};if(params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]]){params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]][_0x82f8[86]]= Number(_0x657cx1a[_0x82f8[86]]);params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]][_0x82f8[169]]= Number(_0x657cx1a[_0x82f8[169]]);params[_0x82f8[60]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]][_0x82f8[173]]= Number(_0x657cx1a[_0x82f8[173]])};params[_0x82f8[60]][_0x82f8[65]][_0x82f8[95]]++;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[95]]++;_0x657cx15(_0x657cx1a[_0x82f8[79]],_0x82f8[143],{type:_0x82f8[174],amount:1,queue:_0x657cx1a[_0x82f8[79]]});params[_0x82f8[60]][_0x82f8[65]][_0x82f8[77]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[65]][_0x82f8[85]]/ (params[_0x82f8[60]][_0x82f8[65]][_0x82f8[85]]+ params[_0x82f8[60]][_0x82f8[65]][_0x82f8[95]])* 100,2);params[_0x82f8[60]][_0x82f8[65]][_0x82f8[98]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[65]][_0x82f8[95]]/ (params[_0x82f8[60]][_0x82f8[65]][_0x82f8[85]]+ params[_0x82f8[60]][_0x82f8[65]][_0x82f8[95]])* 100,2);params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[77]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[85]]/ (params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[85]]+ params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[95]])* 100,2);params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[98]]= _[_0x82f8[76]](params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[95]]/ (params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[85]]+ params[_0x82f8[60]][_0x82f8[59]][_0x657cx1a[_0x82f8[79]]][_0x82f8[95]])* 100,2);_0x657cx15(_0x657cx27[_0x82f8[79]],_0x82f8[145],_[_0x82f8[162]](_0x657cx27,{queuecallerabandon:true,queuecallerabandonAt:_0x657cx26,queuecallerleaveAt:_0x657cx26,originalposition:_0x657cx1a[_0x82f8[173]],position:_0x657cx1a[_0x82f8[169]],holdtime:_0x657cx1a[_0x82f8[86]]}))};return User[_0x82f8[100]]({where:{lastQueue:_0x657cx1a[_0x82f8[79]],voicePause:false},raw:true})})[_0x82f8[78]](function(_0x657cx2b){if(_0x657cx2b&& _0x657cx2b[_0x82f8[63]]){var _0x657cx23;_[_0x82f8[101]](_0x657cx2b,function(_0x657cx2c){_0x657cx23= _[_0x82f8[125]]({newValues:{id:_0x657cx2c[_0x82f8[123]],queueStatus:_0x82f8[113],queueStatusAt:_0x657cx26,lastQueue:_0x657cx1a[_0x82f8[79]]}},_0x657cx2c,{id:_0x657cx2c[_0x82f8[123]],queueStatus:_0x82f8[113],queueStatusAt:_0x657cx26,lastQueue:_0x657cx1a[_0x82f8[79]]});_0x657cx15(util[_0x82f8[57]](_0x82f8[126],_0x657cx2c[_0x82f8[127]],_0x657cx2c[_0x82f8[123]]),_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[119],_0x82f8[128],_0x657cx23);_0x657cx15(_0x82f8[118],_0x82f8[128],_0x657cx23)})}})[_0x82f8[62]](function(_0x657cx1d){console[_0x82f8[122]](_0x82f8[172],_0x657cx1d)})}},blindtransfer:function(_0x657cx1a){return function(_0x657cx1e){_0x657cx15(null,_0x657cx1a[_0x82f8[24]][_0x82f8[175]](),_0x657cx1a);return BPromise[_0x82f8[109]]()}},attendedtransfer:function(_0x657cx1a){return function(_0x657cx1e){_0x657cx15(null,_0x657cx1a[_0x82f8[24]][_0x82f8[175]](),_0x657cx1a);return BPromise[_0x82f8[109]]()}},dialbegin:function(_0x657cx1a){return function(_0x657cx1e){params[_0x82f8[66]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]]= {channel:_0x657cx1a[_0x82f8[116]],channelstate:Number(_0x657cx1a[_0x82f8[163]]),channelstatedesc:_0x657cx1a[_0x82f8[164]],calleridnum:_0x657cx1a[_0x82f8[165]],calleridname:_0x657cx1a[_0x82f8[166]],context:_0x657cx1a[_0x82f8[176]],exten:_0x657cx1a[_0x82f8[167]],priority:Number(_0x657cx1a[_0x82f8[168]]),dialstring:_0x657cx1a[_0x82f8[177]]};if(_0x657cx1a[_0x82f8[116]]){var _0x657cx23=_[_0x82f8[162]](_0x657cx1a,{starttime:moment()[_0x82f8[57]](_0x82f8[56]),lastevent:_0x82f8[141],updatedAt:moment()[_0x82f8[57]](_0x82f8[56])});_0x657cx15(util[_0x82f8[57]](_0x82f8[114],_0x657cx1a[_0x82f8[116]][_0x82f8[115]](/\/|-/)[1]),_0x82f8[178],_0x657cx23);_0x657cx15(_0x82f8[119],_0x82f8[117],_[_0x82f8[162]](_0x657cx23,{role:_0x82f8[119]}));_0x657cx15(_0x82f8[118],_0x82f8[117],_0x657cx23,_[_0x82f8[162]](_0x657cx23,{role:_0x82f8[118]}));if(_0x657cx1e){triggers[_0x82f8[120]](_0x657cx1e)}};return BPromise[_0x82f8[109]]()}},dialend:function(_0x657cx1a){return function(_0x657cx1e){if(params[_0x82f8[66]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]]){params[_0x82f8[66]][_0x82f8[111]][_0x657cx1a[_0x82f8[110]]][_0x82f8[179]]= _0x657cx1a[_0x82f8[179]]};if(_0x657cx1a[_0x82f8[116]]){var _0x657cx26=moment()[_0x82f8[57]](_0x82f8[56]);var _0x657cx23={dialstatus:_0x657cx1a[_0x82f8[179]],lastevent:(_0x657cx1a[_0x82f8[179]]=== _0x82f8[180])?_0x82f8[154]:_0x82f8[113],answertime:(_0x657cx1a[_0x82f8[179]]=== _0x82f8[180])?_0x657cx26:null,uniqueid:_0x657cx1a[_0x82f8[110]],linkedid:_0x657cx1a[_0x82f8[112]],destuniqueid:_0x657cx1a[_0x82f8[148]],destlinkedid:_0x657cx1a[_0x82f8[181]],updatedAt:_0x657cx26};_0x657cx15(util[_0x82f8[57]](_0x82f8[114],_0x657cx1a[_0x82f8[116]][_0x82f8[115]](/\/|-/)[1]),_0x82f8[117],_0x657cx23);_0x657cx15(_0x82f8[119],_0x82f8[117],_0x657cx23);_0x657cx15(_0x82f8[118],_0x82f8[117],_0x657cx23);if(_0x657cx1e){triggers[_0x82f8[120]](_0x657cx1e)}};return BPromise[_0x82f8[109]]()}},varset:function(_0x657cx1a){return function(_0x657cx1e){if(_0x657cx1a[_0x82f8[183]][_0x82f8[53]](_0x82f8[182])){if(_0x657cx1e){params[_0x82f8[60]][_0x82f8[65]][_0x82f8[97]]+= 1;params[_0x82f8[60]][_0x82f8[59]][_0x657cx1e[_0x82f8[79]]][_0x82f8[97]]+= 1;_0x657cx15(_0x657cx1e[_0x82f8[79]],_0x82f8[143],{type:_0x82f8[97],amount:1,queue:_0x657cx1e[_0x82f8[79]]});if(params[_0x82f8[60]][_0x82f8[59]][_0x657cx1e[_0x82f8[79]]][_0x82f8[81]]){params[_0x82f8[60]][_0x82f8[59]][_0x657cx1e[_0x82f8[79]]][_0x82f8[81]]-= 1};if(params[_0x82f8[60]][_0x82f8[65]][_0x82f8[81]]){params[_0x82f8[60]][_0x82f8[65]][_0x82f8[81]]-= 1};_0x657cx15(_0x657cx1e[_0x82f8[79]],_0x82f8[143],{type:_0x82f8[81],amount:-1,queue:_0x657cx1e[_0x82f8[79]]});_0x657cx15(_0x657cx1e[_0x82f8[79]],_0x82f8[145],_0x657cx1e)}};if(_0x657cx1a[_0x82f8[183]][_0x82f8[53]](_0x82f8[184])){_0x657cx15(_0x82f8[119],_0x82f8[178],{uniqueid:_0x657cx1a[_0x82f8[110]],routeId:_0x657cx1a[_0x82f8[185]],updatedAt:moment()[_0x82f8[57]](_0x82f8[56])});_0x657cx15(_0x82f8[118],_0x82f8[178],{uniqueid:_0x657cx1a[_0x82f8[110]],routeId:_0x657cx1a[_0x82f8[185]],updatedAt:moment()[_0x82f8[57]](_0x82f8[56])})};if(_0x657cx1a){triggers[_0x82f8[186]](_0x657cx1a)};return BPromise[_0x82f8[109]]()}},agentUpdate:function(_0x657cx2c){return function(){_0x657cx15(util[_0x82f8[57]](_0x82f8[114],_0x657cx2c[_0x82f8[123]]),_0x82f8[128],_0x657cx2c);_0x657cx15(_0x82f8[119],_0x82f8[128],_0x657cx2c);_0x657cx15(_0x82f8[118],_0x82f8[128],_0x657cx2c)}},console:function(_0x657cx2d){_0x657cx15(_0x657cx2d[_0x82f8[187]],util[_0x82f8[57]](_0x82f8[188],_0x657cx2d[_0x82f8[99]]),_0x657cx2d[_0x82f8[189]])},realtimeQueueMembers:function(_0x657cx2e){return function(){_[_0x82f8[191]](params[_0x82f8[60]][_0x82f8[59]],function(_0x657cx1c,_0x657cx20){if(_[_0x82f8[190]](_0x657cx2e,_0x657cx20)){_[_0x82f8[191]](_0x657cx1c[_0x82f8[107]],function(_0x657cx2c){_0x657cx15(_0x657cx20,_0x82f8[158],_0x657cx2c)})}})}},updateTriggers:function(_0x657cx2d){return function(){return triggers[_0x82f8[192]](_0x657cx2d)}},queueAdd:function(_0x657cx2f,_0x657cx30){return function(){if(_0x657cx2f&& _0x657cx30){_[_0x82f8[101]](_0x657cx2f,function(_0x657cx1e){_0x657cx15(null,util[_0x82f8[57]](_0x82f8[193],_0x657cx30),_0x657cx1e[0])})}}},queueRemove:function(_0x657cx1e,_0x657cx30){return function(){if(_0x657cx1e&& _0x657cx30){_0x657cx15(null,util[_0x82f8[57]](_0x82f8[194],_0x657cx30),_0x657cx1e)}}},checkTriggers:function(_0x657cx2d){return function(){return triggers[_0x82f8[195]](_0x657cx2d)}}}}
\ No newline at end of file
+var _0xb85f=["\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","\x72\x65\x64\x69\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74","\x52\x65\x70\x6F\x72\x74\x44\x69\x61\x6C","\x52\x65\x70\x6F\x72\x74\x4D\x65\x6D\x62\x65\x72","\x55\x73\x65\x72","\x2E\x2E\x2F\x74\x72\x69\x67\x67\x65\x72\x73","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x2E\x2F\x75\x74\x69\x6C\x73","\x72\x65\x64\x69\x73\x50\x77\x64","\x69\x70","\x63\x72\x65\x61\x74\x65\x43\x6C\x69\x65\x6E\x74","\x73\x6F\x63\x6B\x65\x74\x2E\x69\x6F\x2D\x65\x6D\x69\x74\x74\x65\x72","\x65\x78\x70\x6F\x72\x74\x73","\x65\x6D\x69\x74","\x74\x6F","\x65\x76\x65\x6E\x74","\x70\x72\x69\x76\x69\x6C\x65\x67\x65","\x6D\x65\x6D\x62\x65\x72\x73\x68\x69\x70","\x72\x69\x6E\x67\x69\x6E\x75\x73\x65","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x6E\x61\x6D\x65","\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x73\x74\x61\x74\x65\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x73\x74\x61\x74\x75\x73\x64\x65\x73\x63","\x55\x4E\x4B\x4E\x4F\x57\x4E","\x30","\x4E\x4F\x54\x5F\x49\x4E\x55\x53\x45","\x31","\x49\x4E\x55\x53\x45","\x32","\x42\x55\x53\x59","\x33","\x49\x4E\x56\x41\x4C\x49\x44","\x34","\x55\x4E\x41\x56\x41\x49\x4C\x41\x42\x4C\x45","\x35","\x52\x49\x4E\x47\x49\x4E\x47","\x36","\x52\x49\x4E\x47\x49\x4E\x55\x53\x45","\x37","\x4F\x4E\x48\x4F\x4C\x44","\x38","\x73\x74\x61\x74\x75\x73","\x70\x65\x6E\x61\x6C\x74\x79","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x63\x61\x6C\x6C\x73\x74\x61\x6B\x65\x6E","\x6C\x61\x73\x74\x63\x61\x6C\x6C","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x70\x61\x75\x73\x65\x64","\x71\x75\x65\x75\x65\x73","\x69\x6E\x62\x6F\x75\x6E\x64","\x67\x6C\x6F\x62\x61\x6C","\x69\x6E\x62\x6F\x75\x6E\x64\x20\x69\x6E\x69\x74\x20\x65\x72\x72\x6F\x72\x3A","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x71\x75\x65\x75\x65","\x74\x6F\x74\x61\x6C","\x69\x73\x57\x61\x69\x74\x69\x6E\x67","\x77\x61\x69\x74\x69\x6E\x67","\x69\x73\x41\x63\x74\x69\x76\x65","\x61\x63\x74\x69\x76\x65","\x69\x73\x43\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x63\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x68\x6F\x6C\x64\x74\x69\x6D\x65","\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6C\x65\x61\x76\x65\x41\x74","\x73\x65\x63\x6F\x6E\x64\x73","\x64\x69\x66\x66","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x41\x74","\x61\x76\x67\x48\x6F\x6C\x64\x74\x69\x6D\x65","\x72\x6F\x75\x6E\x64","\x61\x76\x67\x54\x61\x6C\x6B\x74\x69\x6D\x65","\x69\x73\x41\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x69\x73\x55\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x61\x6E\x73\x77\x65\x72\x52\x61\x74\x65","\x61\x62\x61\x6E\x64\x6F\x6E\x52\x61\x74\x65","\x74\x68\x65\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x65\x78\x69\x74","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x20\x69\x6E\x69\x74\x20\x65\x72\x72\x6F\x72\x3A","\x66\x69\x6C\x74\x65\x72","\x74\x69\x67\x65\x72\x64\x69\x61\x6C","\x61\x6E\x73\x77\x65\x72\x65\x64","\x41\x4E\x53\x57\x45\x52\x45\x44","\x64\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x63\x6F\x75\x6E\x74\x42\x79","\x73\x75\x6D\x44\x75\x72\x61\x74\x69\x6F\x6E","\x62\x69\x6C\x6C\x61\x62\x6C\x65\x73\x65\x63\x6F\x6E\x64\x73","\x73\x75\x6D\x42\x79","\x61\x76\x67\x44\x75\x72\x61\x74\x69\x6F\x6E","\x72\x65\x73\x75\x6C\x74","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x74\x79\x70\x65","\x72\x65\x73\x6F\x6C\x76\x65","\x61\x67\x65\x6E\x74\x73","\x72\x65\x70\x6F\x72\x74\x5F\x63\x61\x6C\x6C\x3A\x73\x61\x76\x65","\x76\x6F\x69\x63\x65\x2F\x6F\x75\x74\x62\x6F\x75\x6E\x64\x2F\x67\x6C\x6F\x62\x61\x6C","\x76\x6F\x69\x63\x65\x3A\x6F\x75\x74\x62\x6F\x75\x6E\x64\x3A\x67\x6C\x6F\x62\x61\x6C","\x75\x6E\x69\x71\x75\x65\x69\x64","\x63\x68\x61\x6E\x6E\x65\x6C\x73","\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x61\x67\x65\x6E\x74\x3A\x25\x73","\x73\x70\x6C\x69\x74","\x63\x68\x61\x6E\x6E\x65\x6C","\x72\x65\x70\x6F\x72\x74\x5F\x64\x69\x61\x6C\x3A\x75\x70\x64\x61\x74\x65","\x61\x64\x6D\x69\x6E\x73","\x75\x73\x65\x72\x73","\x72\x65\x70\x6F\x72\x74\x44\x69\x61\x6C","\x64\x65\x76\x69\x63\x65\x73\x74\x61\x74\x65\x63\x68\x61\x6E\x67\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x6C\x6F\x67","\x69\x64","\x73\x74\x61\x74\x65","\x61\x73\x73\x69\x67\x6E","\x25\x73\x3A\x25\x73","\x72\x6F\x6C\x65","\x61\x67\x65\x6E\x74\x3A\x73\x61\x76\x65","\x53\x49\x50\x2F","","\x72\x65\x70\x6C\x61\x63\x65","\x64\x65\x76\x69\x63\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x74\x72\x75\x6E\x6B\x73","\x70\x65\x65\x72\x73\x74\x61\x74\x75\x73","\x76\x6F\x69\x63\x65\x2F\x74\x72\x75\x6E\x6B\x73","\x76\x6F\x69\x63\x65\x3A\x74\x72\x75\x6E\x6B\x73","\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x3A\x73\x61\x76\x65","\x72\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x43\x72\x65\x61\x74\x65","\x61\x67\x65\x6E\x74\x63\x61\x6C\x6C\x65\x64\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x63\x61\x6C\x6C\x65\x64","\x72\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x55\x70\x64\x61\x74\x65","\x76\x6F\x69\x63\x65\x3A\x69\x6E\x62\x6F\x75\x6E\x64","\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x3A\x75\x70\x64\x61\x74\x65","\x72\x65\x61\x73\x6F\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x3A\x75\x70\x64\x61\x74\x65","\x69\x64\x20\x44\x45\x53\x43","\x64\x65\x73\x74\x75\x6E\x69\x71\x75\x65\x69\x64","\x63\x6F\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x61\x6D\x65","\x72\x69\x6E\x67\x74\x69\x6D\x65","\x61\x67\x65\x6E\x74\x63\x6F\x6E\x6E\x65\x63\x74\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x63\x6F\x6E\x6E\x65\x63\x74","\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x65\x6C\x73\x65\x77\x68\x65\x72\x65","\x61\x67\x65\x6E\x74\x72\x69\x6E\x67\x6E\x6F\x61\x6E\x73\x77\x65\x72\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x72\x65\x6A\x65\x63\x74\x65\x64","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x76\x6F\x69\x63\x65\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x71\x75\x65\x75\x65\x6D\x65\x6D\x62\x65\x72\x72\x65\x6D\x6F\x76\x65\x64\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x76\x6F\x69\x63\x65\x5F\x71\x75\x65\x75\x65\x3A\x72\x65\x6D\x6F\x76\x65","\x71\x75\x65\x75\x65\x6D\x65\x6D\x62\x65\x72\x70\x61\x75\x73\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x6D\x65\x72\x67\x65","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65\x64\x65\x73\x63","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x65\x78\x74\x65\x6E","\x70\x72\x69\x6F\x72\x69\x74\x79","\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x63\x6F\x75\x6E\x74","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x72\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74","\x6F\x72\x69\x67\x69\x6E\x61\x6C\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x61\x62\x61\x6E\x64\x6F\x6E","\x72\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6A\x6F\x69\x6E\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x63\x6F\x6E\x74\x65\x78\x74","\x64\x69\x61\x6C\x73\x74\x72\x69\x6E\x67","\x72\x65\x70\x6F\x72\x74\x5F\x64\x69\x61\x6C\x3A\x73\x61\x76\x65","\x64\x69\x61\x6C\x73\x74\x61\x74\x75\x73","\x64\x65\x73\x74\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x72\x6F\x75\x74\x65\x69\x64","\x76\x61\x72\x69\x61\x62\x6C\x65","\x76\x61\x6C\x75\x65","\x76\x61\x72\x53\x65\x74","\x73\x6F\x63\x6B\x65\x74","\x63\x6F\x6E\x73\x6F\x6C\x65\x3A\x25\x73","\x64\x61\x74\x61","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x66\x6F\x72\x4F\x77\x6E","\x75\x70\x64\x61\x74\x65\x54\x72\x69\x67\x67\x65\x72\x73","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x25\x73\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x25\x73\x5F\x71\x75\x65\x75\x65\x3A\x72\x65\x6D\x6F\x76\x65","\x63\x68\x65\x63\x6B\x54\x72\x69\x67\x67\x65\x72\x73","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x72\x65\x70\x6F\x72\x74\x5F\x66\x61\x78\x3A\x75\x70\x64\x61\x74\x65"];_0xb85f[0];var _=require(_0xb85f[1]);var util=require(_0xb85f[2]);var moment=require(_0xb85f[3]);var BPromise=require(_0xb85f[4]);var redis=require(_0xb85f[5]);var VoiceQueue=require(_0xb85f[7])[_0xb85f[6]];var ReportQueue=require(_0xb85f[7])[_0xb85f[8]];var ReportCall=require(_0xb85f[7])[_0xb85f[9]];var ReportAgent=require(_0xb85f[7])[_0xb85f[10]];var ReportDial=require(_0xb85f[7])[_0xb85f[11]];var ReportMember=require(_0xb85f[7])[_0xb85f[12]];var User=require(_0xb85f[7])[_0xb85f[13]];var Triggers=require(_0xb85f[14]);var config=require(_0xb85f[15]);var utils=require(_0xb85f[16]);var redisConf;if(config[_0xb85f[17]]){redisConf= {password:config[_0xb85f[17]]}};var redisClient=redis[_0xb85f[19]](6379,config[_0xb85f[18]],redisConf);var io=require(_0xb85f[20])(redisClient);var triggers= new Triggers(io);var params={trunks:[],inbound:{queues:{},channels:[],global:{waiting:0,active:0,completed:0,abandoned:0,unmanaged:0,holdtime:0,talktime:0,avgHoldtime:0,avgTalktime:0,answerRate:0,abandonRate:0,total:0}},outbound:{global:{total:0,answered:0,sumDuration:0,avgDuration:0,tigerdial:0},channels:[]}};module[_0xb85f[21]]= function(){var _0x5a22x15=function(_0x5a22x16,_0x5a22x17,_0x5a22x18){if(_0x5a22x16){io[_0xb85f[23]](_0x5a22x16)[_0xb85f[22]](_0x5a22x17,_0x5a22x18)}else {io[_0xb85f[22]](_0x5a22x17,_0x5a22x18)}};var _0x5a22x19=function(_0x5a22x1a){delete _0x5a22x1a[_0xb85f[24]];delete _0x5a22x1a[_0xb85f[25]];delete _0x5a22x1a[_0xb85f[26]];delete _0x5a22x1a[_0xb85f[27]];_0x5a22x1a[_0xb85f[28]]= _0x5a22x1a[_0xb85f[29]]|| _0x5a22x1a[_0xb85f[28]];_0x5a22x1a[_0xb85f[30]]= _0x5a22x1a[_0xb85f[31]];_0x5a22x1a[_0xb85f[32]]= _0xb85f[33];switch(_0x5a22x1a[_0xb85f[51]]){case _0xb85f[34]:_0x5a22x1a[_0xb85f[32]]= _0xb85f[33];break;case _0xb85f[36]:_0x5a22x1a[_0xb85f[32]]= _0xb85f[35];break;case _0xb85f[38]:_0x5a22x1a[_0xb85f[32]]= _0xb85f[37];break;case _0xb85f[40]:_0x5a22x1a[_0xb85f[32]]= _0xb85f[39];break;case _0xb85f[42]:_0x5a22x1a[_0xb85f[32]]= _0xb85f[41];break;case _0xb85f[44]:_0x5a22x1a[_0xb85f[32]]= _0xb85f[43];break;case _0xb85f[46]:_0x5a22x1a[_0xb85f[32]]= _0xb85f[45];break;case _0xb85f[48]:_0x5a22x1a[_0xb85f[32]]= _0xb85f[47];break;case _0xb85f[50]:_0x5a22x1a[_0xb85f[32]]= _0xb85f[49];break;default:};_0x5a22x1a[_0xb85f[51]]= Number(_0x5a22x1a[_0xb85f[51]]);if(_0x5a22x1a[_0xb85f[53]](_0xb85f[52])){_0x5a22x1a[_0xb85f[52]]= Number(_0x5a22x1a[_0xb85f[52]])};if(_0x5a22x1a[_0xb85f[53]](_0xb85f[54])){_0x5a22x1a[_0xb85f[54]]= Number(_0x5a22x1a[_0xb85f[54]])};if(_0x5a22x1a[_0xb85f[53]](_0xb85f[55])){if(_0x5a22x1a[_0xb85f[55]]=== _0xb85f[34]){_0x5a22x1a[_0xb85f[55]]= null}else {_0x5a22x1a[_0xb85f[55]]= moment()[_0xb85f[57]](_0xb85f[56])}};_0x5a22x1a[_0xb85f[58]]= parseInt(_0x5a22x1a[_0xb85f[58]],10)?true:false};function _0x5a22x1b(_0x5a22x1c){if(!params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1c]){params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1c]= {agents:{},waiting:0,active:0,completed:0,abandoned:0,unmanaged:0,holdtime:0,talktime:0,avgHoldtime:0,avgTalktime:0,answerRate:0,abandonRate:0,total:0}}}function _0x5a22x1d(){return function(){params[_0xb85f[60]][_0xb85f[59]]= {};params[_0xb85f[60]][_0xb85f[61]]= {waiting:0,active:0,completed:0,abandoned:0,unmanaged:0,holdtime:0,talktime:0,avgHoldtime:0,avgTalktime:0,answerRate:0,abandonRate:0,total:0};return VoiceQueue[_0xb85f[95]]({attributes:[_0xb85f[29]],raw:true})[_0xb85f[90]](function(_0x5a22x1f){if(_0x5a22x1f){_[_0xb85f[91]](_0x5a22x1f,function(_0x5a22x1c){_0x5a22x1b(_0x5a22x1c[_0xb85f[29]])});return ReportQueue[_0xb85f[95]]({attributes:[_0xb85f[67],_0xb85f[77],_0xb85f[80],_0xb85f[92],_0xb85f[93],_0xb85f[94],_0xb85f[75]],raw:true})}})[_0xb85f[90]](function(_0x5a22x1f){if(_0x5a22x1f){var _0x5a22x20;var _0x5a22x21;var _0x5a22x22=_0x5a22x1f[_0xb85f[66]];for(var _0x5a22x23=0;_0x5a22x23< _0x5a22x22;_0x5a22x23++){_0x5a22x20= _0x5a22x1f[_0x5a22x23];_0x5a22x21= _0x5a22x20[_0xb85f[67]];_0x5a22x1b(_0x5a22x21);params[_0xb85f[60]][_0xb85f[61]][_0xb85f[68]]++;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[68]]++;if(utils[_0xb85f[69]](_0x5a22x20)){params[_0xb85f[60]][_0xb85f[61]][_0xb85f[70]]++;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[70]]++};if(utils[_0xb85f[71]](_0x5a22x20)){params[_0xb85f[60]][_0xb85f[61]][_0xb85f[72]]++;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[72]]++};if(utils[_0xb85f[73]](_0x5a22x20)){params[_0xb85f[60]][_0xb85f[61]][_0xb85f[74]]++;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[74]]++;params[_0xb85f[60]][_0xb85f[61]][_0xb85f[75]]+= _0x5a22x20[_0xb85f[75]]|| 0;params[_0xb85f[60]][_0xb85f[61]][_0xb85f[76]]+= moment(_0x5a22x20[_0xb85f[80]])[_0xb85f[79]](moment(_0x5a22x20[_0xb85f[77]]),_0xb85f[78]);params[_0xb85f[60]][_0xb85f[61]][_0xb85f[81]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[75]]/ params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[74]]);params[_0xb85f[60]][_0xb85f[61]][_0xb85f[83]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[76]]/ params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[74]]);params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[75]]+= _0x5a22x20[_0xb85f[75]]|| 0;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[76]]+= moment(_0x5a22x20[_0xb85f[80]])[_0xb85f[79]](moment(_0x5a22x20[_0xb85f[77]]),_0xb85f[78]);params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[81]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[75]]/ params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[74]]);params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[83]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[76]]/ params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[74]])};if(utils[_0xb85f[84]](_0x5a22x20)){params[_0xb85f[60]][_0xb85f[61]][_0xb85f[85]]++;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[85]]++};if(utils[_0xb85f[86]](_0x5a22x20)){params[_0xb85f[60]][_0xb85f[61]][_0xb85f[87]]++;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[87]]++};params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[88]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[74]]/ (params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[74]]+ params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[85]])* 100,2);params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[89]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[85]]/ (params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[74]]+ params[_0xb85f[60]][_0xb85f[59]][_0x5a22x21][_0xb85f[85]])* 100,2);params[_0xb85f[60]][_0xb85f[61]][_0xb85f[88]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[61]][_0xb85f[74]]/ (params[_0xb85f[60]][_0xb85f[61]][_0xb85f[74]]+ params[_0xb85f[60]][_0xb85f[61]][_0xb85f[85]])* 100,2);params[_0xb85f[60]][_0xb85f[61]][_0xb85f[89]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[61]][_0xb85f[85]]/ (params[_0xb85f[60]][_0xb85f[61]][_0xb85f[74]]+ params[_0xb85f[60]][_0xb85f[61]][_0xb85f[85]])* 100,2)}}})[_0xb85f[65]](function(_0x5a22x1e){console[_0xb85f[64]](_0xb85f[62],_0x5a22x1e[_0xb85f[63]])})}}function _0x5a22x24(){return function(){params[_0xb85f[96]][_0xb85f[61]]= {total:0,answered:0,sumDuration:0,avgDuration:0,tigerdial:0};return ReportCall[_0xb85f[95]]({where:{type:[_0xb85f[96],_0xb85f[99]],createdAt:{$gte:moment()[_0xb85f[110]](_0xb85f[109])}},attributes:[_0xb85f[111],_0xb85f[102],_0xb85f[105]],raw:true})[_0xb85f[90]](function(_0x5a22x1f){if(_0x5a22x1f){var _0x5a22x25=_[_0xb85f[98]](_0x5a22x1f,{type:_0xb85f[96]});var _0x5a22x26=_[_0xb85f[98]](_0x5a22x1f,{type:_0xb85f[99]});if(_0x5a22x25[_0xb85f[66]]){params[_0xb85f[96]][_0xb85f[61]][_0xb85f[68]]= _0x5a22x25[_0xb85f[66]];params[_0xb85f[96]][_0xb85f[61]][_0xb85f[100]]= _[_0xb85f[103]](_0x5a22x25,_0xb85f[102])[_0xb85f[101]]|| 0;params[_0xb85f[96]][_0xb85f[61]][_0xb85f[104]]= _[_0xb85f[106]](_0x5a22x25,_0xb85f[105]);if(params[_0xb85f[96]][_0xb85f[61]][_0xb85f[100]]){params[_0xb85f[96]][_0xb85f[61]][_0xb85f[107]]= _[_0xb85f[82]]((_[_0xb85f[106]](_0x5a22x25[_0xb85f[108]],_0xb85f[105])/ params[_0xb85f[96]][_0xb85f[61]][_0xb85f[100]]));params[_0xb85f[96]][_0xb85f[61]][_0xb85f[88]]= _[_0xb85f[82]](params[_0xb85f[96]][_0xb85f[61]][_0xb85f[100]]/ params[_0xb85f[96]][_0xb85f[61]][_0xb85f[68]]* 100,1)}};if(_0x5a22x26[_0xb85f[66]]){params[_0xb85f[96]][_0xb85f[61]][_0xb85f[99]]= _0x5a22x26[_0xb85f[66]]}}})[_0xb85f[65]](function(_0x5a22x1e){console[_0xb85f[64]](_0xb85f[97],_0x5a22x1e[_0xb85f[63]])})}}BPromise[_0xb85f[112]]()[_0xb85f[90]](_0x5a22x1d())[_0xb85f[90]](_0x5a22x24());return {cdr:function(_0x5a22x1a){return function(_0x5a22x1f){_0x5a22x15(_0xb85f[113],_0xb85f[114],_0x5a22x1a);if(_0x5a22x1a[_0xb85f[111]]== _0xb85f[96]|| _0x5a22x1a[_0xb85f[111]]== _0xb85f[99]){if(_0x5a22x1a[_0xb85f[111]]== _0xb85f[96]){params[_0xb85f[96]][_0xb85f[61]][_0xb85f[68]]++;_0x5a22x1a[_0xb85f[102]]== _0xb85f[101]&& (params[_0xb85f[96]][_0xb85f[61]][_0xb85f[100]]++);params[_0xb85f[96]][_0xb85f[61]][_0xb85f[104]]+= Number(_0x5a22x1a[_0xb85f[105]]);if(params[_0xb85f[96]][_0xb85f[61]][_0xb85f[100]]){params[_0xb85f[96]][_0xb85f[61]][_0xb85f[107]]= _[_0xb85f[82]](params[_0xb85f[96]][_0xb85f[61]][_0xb85f[104]]/ params[_0xb85f[96]][_0xb85f[61]][_0xb85f[100]]);params[_0xb85f[96]][_0xb85f[61]][_0xb85f[88]]= _[_0xb85f[82]](params[_0xb85f[96]][_0xb85f[61]][_0xb85f[100]]/ params[_0xb85f[96]][_0xb85f[61]][_0xb85f[68]]* 100,1)}}else {params[_0xb85f[96]][_0xb85f[61]][_0xb85f[99]]++};_0x5a22x15(_0xb85f[115],_0xb85f[116],params[_0xb85f[96]][_0xb85f[61]])}}},send:function(_0x5a22x1a){return function(_0x5a22x1f){return BPromise[_0xb85f[112]]()}},hangup:function(_0x5a22x1a){return function(_0x5a22x1f){if(params[_0xb85f[96]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]]){delete params[_0xb85f[96]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]]};if(params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]]){delete params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]]};var _0x5a22x27={uniqueid:_0x5a22x1a[_0xb85f[117]],linkedid:_0x5a22x1a[_0xb85f[119]],endtime:moment()[_0xb85f[57]](_0xb85f[56]),lastevent:_0xb85f[120],updatedAt:moment()[_0xb85f[57]](_0xb85f[56])};_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x1a[_0xb85f[123]][_0xb85f[122]](/\/|-/)[1]),_0xb85f[124],_0x5a22x27);_0x5a22x15(_0xb85f[125],_0xb85f[124],_0x5a22x27);_0x5a22x15(_0xb85f[126],_0xb85f[124],_0x5a22x27);if(_0x5a22x1f){triggers[_0xb85f[127]](_0x5a22x1f)};return BPromise[_0xb85f[112]]()}},devicestatechange:function(_0x5a22x1a){return function(_0x5a22x1f){return User[_0xb85f[140]]({where:{name:_0x5a22x1a[_0xb85f[139]][_0xb85f[138]](_0xb85f[136],_0xb85f[137])},raw:true})[_0xb85f[90]](function(_0x5a22x28){if(_0x5a22x28){var _0x5a22x27=_[_0xb85f[132]]({newValues:{id:_0x5a22x28[_0xb85f[130]],status:_0x5a22x1a[_0xb85f[131]],statusAt:moment()[_0xb85f[57]](_0xb85f[56])}},_0x5a22x28,{status:_0x5a22x1a[_0xb85f[131]],statusAt:moment()[_0xb85f[57]](_0xb85f[56])});_0x5a22x15(util[_0xb85f[57]](_0xb85f[133],_0x5a22x28[_0xb85f[134]],_0x5a22x28[_0xb85f[130]]),_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[126],_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[125],_0xb85f[135],_0x5a22x27)}})[_0xb85f[65]](function(_0x5a22x1e){console[_0xb85f[129]](_0xb85f[128],_0x5a22x1e)})}},peerstatus:function(_0x5a22x1a){return function(_0x5a22x1f){if(_0x5a22x1f&& _0x5a22x1f[0]){_[_0xb85f[91]](_0x5a22x1f[1],function(_0x5a22x29){if(!params[_0xb85f[141]][_0x5a22x29[_0xb85f[29]]]){params[_0xb85f[141]][_0x5a22x29[_0xb85f[29]]]= {name:_0x5a22x29[_0xb85f[29]]}};params[_0xb85f[141]][_0x5a22x29[_0xb85f[29]]][_0xb85f[142]]= _0x5a22x1a[_0xb85f[142]];_0x5a22x15(_0xb85f[143],_0xb85f[144],params[_0xb85f[141]][_0x5a22x29[_0xb85f[29]]])})};return BPromise[_0xb85f[112]]()}},registry:function(_0x5a22x1a){return function(_0x5a22x1f){if(_0x5a22x1f&& _0x5a22x1f[0]){_[_0xb85f[91]](_0x5a22x1f[1],function(_0x5a22x29){if(!params[_0xb85f[141]][_0x5a22x29[_0xb85f[29]]]){params[_0xb85f[141]][_0x5a22x29[_0xb85f[29]]]= {name:_0x5a22x29[_0xb85f[29]]}};params[_0xb85f[141]][_0x5a22x29[_0xb85f[29]]][_0xb85f[51]]= _0x5a22x1a[_0xb85f[51]];_0x5a22x15(_0xb85f[143],_0xb85f[144],params[_0xb85f[141]][_0x5a22x29[_0xb85f[29]]])})};return BPromise[_0xb85f[112]]()}},agentcalled:function(_0x5a22x1a){return function(_0x5a22x1f){if(_0x5a22x1f){_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x1f[_0xb85f[28]]),_0xb85f[145],_0x5a22x1f);triggers[_0xb85f[146]](_0x5a22x1f)};return User[_0xb85f[140]]({where:{name:_0x5a22x1a[_0xb85f[28]],voicePause:false},raw:true})[_0xb85f[90]](function(_0x5a22x28){if(_0x5a22x28){var _0x5a22x2a=moment()[_0xb85f[57]](_0xb85f[56]);var _0x5a22x27=_[_0xb85f[132]]({newValues:{id:_0x5a22x28[_0xb85f[130]],queueStatus:_0xb85f[148],queueStatusAt:_0x5a22x2a,lastQueue:_0x5a22x1a[_0xb85f[67]]}},_0x5a22x28,{queueStatus:_0xb85f[148],queueStatusAt:_0x5a22x2a,lastQueue:_0x5a22x1a[_0xb85f[67]]});_0x5a22x15(util[_0xb85f[57]](_0xb85f[133],_0x5a22x28[_0xb85f[134]],_0x5a22x28[_0xb85f[130]]),_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[126],_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[125],_0xb85f[135],_0x5a22x27)}})[_0xb85f[65]](function(_0x5a22x1e){console[_0xb85f[129]](_0xb85f[147],_0x5a22x1e)})}},agentcomplete:function(_0x5a22x1a){return function(_0x5a22x1f){if(_0x5a22x1f){triggers[_0xb85f[149]](_0x5a22x1f)};if(params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[72]]){params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[72]]--};if(params[_0xb85f[60]][_0xb85f[61]][_0xb85f[72]]){params[_0xb85f[60]][_0xb85f[61]][_0xb85f[72]]--;_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[150],{type:_0xb85f[72],amount:-1,queue:_0x5a22x1a[_0xb85f[67]]})};params[_0xb85f[60]][_0xb85f[61]][_0xb85f[74]]++;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[74]]++;_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[150],{type:_0xb85f[120],amount:1,queue:_0x5a22x1a[_0xb85f[67]]});params[_0xb85f[60]][_0xb85f[61]][_0xb85f[88]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[61]][_0xb85f[74]]/ (params[_0xb85f[60]][_0xb85f[61]][_0xb85f[74]]+ params[_0xb85f[60]][_0xb85f[61]][_0xb85f[85]])* 100,2);params[_0xb85f[60]][_0xb85f[61]][_0xb85f[89]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[61]][_0xb85f[85]]/ (params[_0xb85f[60]][_0xb85f[61]][_0xb85f[74]]+ params[_0xb85f[60]][_0xb85f[61]][_0xb85f[85]])* 100,2);params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[88]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[74]]/ (params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[74]]+ params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[85]])* 100,2);params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[89]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[85]]/ (params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[74]]+ params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[85]])* 100,2);params[_0xb85f[60]][_0xb85f[61]][_0xb85f[76]]+= Number(_0x5a22x1a[_0xb85f[76]]);params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[76]]+= Number(_0x5a22x1a[_0xb85f[76]]);_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[150],{type:_0xb85f[76],amount:Number(_0x5a22x1a[_0xb85f[76]]),queue:_0x5a22x1a[_0xb85f[67]]});params[_0xb85f[60]][_0xb85f[61]][_0xb85f[83]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[61]][_0xb85f[76]]/ params[_0xb85f[60]][_0xb85f[61]][_0xb85f[74]]);params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[83]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[76]]/ params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[74]]);params[_0xb85f[60]][_0xb85f[61]][_0xb85f[75]]+= Number(_0x5a22x1a[_0xb85f[75]]);params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[75]]+= Number(_0x5a22x1a[_0xb85f[75]]);_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[150],{type:_0xb85f[75],amount:Number(_0x5a22x1a[_0xb85f[75]]),queue:_0x5a22x1a[_0xb85f[67]]});params[_0xb85f[60]][_0xb85f[61]][_0xb85f[81]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[61]][_0xb85f[75]]/ params[_0xb85f[60]][_0xb85f[61]][_0xb85f[74]]);params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[81]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[75]]/ params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[74]]);var _0x5a22x27;var _0x5a22x2a=moment()[_0xb85f[57]](_0xb85f[56]);return ReportAgent[_0xb85f[140]]({where:{uniqueid:_0x5a22x1a[_0xb85f[117]],destuniqueid:_0x5a22x1a[_0xb85f[156]]},raw:true})[_0xb85f[90]](function(_0x5a22x2b){if(_0x5a22x2b){_0x5a22x27= _[_0xb85f[132]]({},_0x5a22x2b,{lastevent:_0xb85f[120],agentcomplete:true,agentcompleteAt:_0x5a22x2a,talktime:Number(_0x5a22x1a[_0xb85f[76]]),reason:_0x5a22x1a[_0xb85f[153]]});_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x2b[_0xb85f[28]]),_0xb85f[154],_0x5a22x27)};return ReportQueue[_0xb85f[140]]({where:{uniqueid:_0x5a22x1a[_0xb85f[117]]},order:_0xb85f[155],raw:true})})[_0xb85f[90]](function(_0x5a22x2b){if(_0x5a22x2b){_0x5a22x27= _[_0xb85f[132]]({},_0x5a22x2b,{queuecallercomplete:true,queuecallercompleteAt:_0x5a22x2a});_0x5a22x15(_0x5a22x2b[_0xb85f[67]],_0xb85f[152],_0x5a22x27)};return User[_0xb85f[140]]({where:{name:_0x5a22x1a[_0xb85f[28]]},raw:true})})[_0xb85f[90]](function(_0x5a22x28){if(_0x5a22x28){var _0x5a22x27=_[_0xb85f[132]]({newValues:{id:_0x5a22x28[_0xb85f[130]],queueStatus:_0xb85f[120],queueStatusAt:_0x5a22x2a,lastQueue:_0x5a22x1a[_0xb85f[67]]}},_0x5a22x28,{queueStatus:_0xb85f[120],queueStatusAt:_0x5a22x2a,lastQueue:_0x5a22x1a[_0xb85f[67]]});_0x5a22x15(util[_0xb85f[57]](_0xb85f[133],_0x5a22x28[_0xb85f[134]],_0x5a22x28[_0xb85f[130]]),_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[126],_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[125],_0xb85f[135],_0x5a22x27)}})[_0xb85f[65]](function(_0x5a22x1e){console[_0xb85f[129]](_0xb85f[151],_0x5a22x1e)})}},agentconnect:function(_0x5a22x1a){return function(_0x5a22x1f){if(_0x5a22x1f){triggers[_0xb85f[149]](_0x5a22x1f)};if(params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[70]]){params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[70]]--;_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[150],{type:_0xb85f[70],amount:-1,queue:_0x5a22x1a[_0xb85f[67]]})};if(params[_0xb85f[60]][_0xb85f[61]][_0xb85f[70]]){params[_0xb85f[60]][_0xb85f[61]][_0xb85f[70]]--};if(params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]]){params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]][_0xb85f[157]]= _0x5a22x1a[_0xb85f[158]];params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]][_0xb85f[159]]= _0x5a22x1a[_0xb85f[159]];params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]][_0xb85f[75]]= Number(_0x5a22x1a[_0xb85f[75]]);params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]][_0xb85f[160]]= Number(_0x5a22x1a[_0xb85f[160]]);params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]][_0xb85f[30]]= _0x5a22x1a[_0xb85f[30]];params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]][_0xb85f[28]]= _0x5a22x1a[_0xb85f[28]]};params[_0xb85f[60]][_0xb85f[61]][_0xb85f[72]]++;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[72]]++;_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[150],{type:_0xb85f[72],amount:1,queue:_0x5a22x1a[_0xb85f[67]]});var _0x5a22x27;var _0x5a22x2a=moment()[_0xb85f[57]](_0xb85f[56]);return ReportQueue[_0xb85f[140]]({where:{uniqueid:_0x5a22x1a[_0xb85f[117]]},order:_0xb85f[155],raw:true})[_0xb85f[90]](function(_0x5a22x2b){if(_0x5a22x2b){_0x5a22x27= _[_0xb85f[132]]({},_0x5a22x2b,{queuecallerleaveAt:moment()[_0xb85f[57]](_0xb85f[56]),holdtime:_0x5a22x1a[_0xb85f[75]],assigned:true,lastAssignedTo:_0x5a22x1a[_0xb85f[28]]});_0x5a22x15(_0x5a22x2b[_0xb85f[67]],_0xb85f[152],_0x5a22x27)};return ReportAgent[_0xb85f[140]]({where:{uniqueid:_0x5a22x1a[_0xb85f[117]],destuniqueid:_0x5a22x1a[_0xb85f[156]]},raw:true})})[_0xb85f[90]](function(_0x5a22x2b){if(_0x5a22x2b){_0x5a22x27= _[_0xb85f[132]]({},_0x5a22x2b,{lastevent:_0xb85f[162],agentconnectAt:moment()[_0xb85f[57]](_0xb85f[56]),holdtime:_0x5a22x1a[_0xb85f[75]]});_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x2b[_0xb85f[28]]),_0xb85f[154],_0x5a22x27)};return ReportAgent[_0xb85f[95]]({where:{uniqueid:_0x5a22x1a[_0xb85f[117]],destuniqueid:{$ne:_0x5a22x1a[_0xb85f[156]]},reason:null},raw:true})})[_0xb85f[90]](function(_0x5a22x2d){if(_0x5a22x2d&& _0x5a22x2d[_0xb85f[66]]){_[_0xb85f[91]](_0x5a22x2d,function(_0x5a22x2b){_0x5a22x27= _[_0xb85f[132]]({},_0x5a22x2b,{lastevent:_0xb85f[163],agentringnoanswer:true,agentringnoanswerAt:_0x5a22x2a,reason:_0xb85f[163],answeredelsewheredestinationuniqueid:_0x5a22x1a[_0xb85f[156]],answeredelsewheremembername:_0x5a22x1a[_0xb85f[28]]});_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x2b[_0xb85f[28]]),_0xb85f[154],_0x5a22x27)})};return User[_0xb85f[140]]({where:{name:_0x5a22x1a[_0xb85f[28]]},raw:true})})[_0xb85f[90]](function(_0x5a22x28){if(_0x5a22x28){var _0x5a22x27=_[_0xb85f[132]]({newValues:{id:_0x5a22x28[_0xb85f[130]],queueStatus:_0xb85f[162],queueStatusAt:_0x5a22x2a,lastQueue:_0x5a22x1a[_0xb85f[67]]}},_0x5a22x28,{queueStatus:_0xb85f[162],queueStatusAt:_0x5a22x2a,lastQueue:_0x5a22x1a[_0xb85f[67]]});_0x5a22x15(util[_0xb85f[57]](_0xb85f[133],_0x5a22x28[_0xb85f[134]],_0x5a22x28[_0xb85f[130]]),_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[126],_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[125],_0xb85f[135],_0x5a22x27)};return User[_0xb85f[95]]({where:{lastQueue:_0x5a22x1a[_0xb85f[67]],name:{$ne:_0x5a22x1a[_0xb85f[28]]}},raw:true})})[_0xb85f[90]](function(_0x5a22x2c){if(_0x5a22x2c&& _0x5a22x2c[_0xb85f[66]]){_[_0xb85f[91]](_0x5a22x2c,function(_0x5a22x28){var _0x5a22x27=_[_0xb85f[132]]({newValues:{id:_0x5a22x28[_0xb85f[130]],queueStatus:_0xb85f[120],queueStatusAt:_0x5a22x2a}},_0x5a22x28,{queueStatus:_0xb85f[120],queueStatusAt:_0x5a22x2a});_0x5a22x15(util[_0xb85f[57]](_0xb85f[133],_0x5a22x28[_0xb85f[134]],_0x5a22x28[_0xb85f[130]]),_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[126],_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[125],_0xb85f[135],_0x5a22x27)})}})[_0xb85f[65]](function(_0x5a22x1e){console[_0xb85f[129]](_0xb85f[161],_0x5a22x1e)})}},agentringnoanswer:function(_0x5a22x1a){return function(_0x5a22x1f){if(_0x5a22x1f){triggers[_0xb85f[149]](_0x5a22x1f)};var _0x5a22x27;var _0x5a22x2a=moment()[_0xb85f[57]](_0xb85f[56]);return User[_0xb85f[140]]({where:{name:_0x5a22x1a[_0xb85f[28]]},raw:true})[_0xb85f[90]](function(_0x5a22x28){if(_0x5a22x28){var _0x5a22x27=_[_0xb85f[132]]({newValues:{id:_0x5a22x28[_0xb85f[130]],queueStatus:_0xb85f[120],queueStatusAt:_0x5a22x2a,lastQueue:_0x5a22x1a[_0xb85f[67]]}},_0x5a22x28,{queueStatus:_0xb85f[120],queueStatusAt:_0x5a22x2a,lastQueue:_0x5a22x1a[_0xb85f[67]]});_0x5a22x15(util[_0xb85f[57]](_0xb85f[133],_0x5a22x28[_0xb85f[134]],_0x5a22x28[_0xb85f[130]]),_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[126],_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[125],_0xb85f[135],_0x5a22x27)};return ReportAgent[_0xb85f[140]]({where:{uniqueid:_0x5a22x1a[_0xb85f[117]],destuniqueid:_0x5a22x1a[_0xb85f[156]]},raw:true})})[_0xb85f[90]](function(_0x5a22x2b){if(_0x5a22x2b){_0x5a22x27= _[_0xb85f[132]]({},_0x5a22x2b,{lastevent:_0xb85f[165],agentringnoanswer:true,agentringnoanswerAt:moment()[_0xb85f[57]](_0xb85f[56]),reason:_0xb85f[165]});_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x2b[_0xb85f[28]]),_0xb85f[154],_0x5a22x27)}})[_0xb85f[65]](function(_0x5a22x1e){console[_0xb85f[129]](_0xb85f[164],_0x5a22x1e)})}},queuememberadded:function(_0x5a22x1a){return function(_0x5a22x1f){if(_0x5a22x1f){_0x5a22x15(_0x5a22x1f[_0xb85f[67]],_0xb85f[166],_0x5a22x1f);_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x1f.UserId),_0xb85f[166],_0x5a22x1f)};return BPromise[_0xb85f[112]]()}},queuememberremoved:function(_0x5a22x1a){return function(_0x5a22x1f){if(params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]]){delete params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[113]][_0x5a22x1a[_0xb85f[28]]]};return User[_0xb85f[140]]({where:{name:_0x5a22x1a[_0xb85f[30]][_0xb85f[138]](_0xb85f[136],_0xb85f[137])},raw:true})[_0xb85f[90]](function(_0x5a22x28){if(_0x5a22x28){_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[168],{queue:_0x5a22x1a[_0xb85f[67]],UserId:_0x5a22x28[_0xb85f[130]]});_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x28[_0xb85f[130]]),_0xb85f[168],{queue:_0x5a22x1a[_0xb85f[67]],UserId:_0x5a22x28[_0xb85f[130]]})}})[_0xb85f[65]](function(_0x5a22x1e){console[_0xb85f[64]](_0xb85f[167],_0x5a22x1e)})}},queuememberpause:function(_0x5a22x1a){return function(_0x5a22x1f){if(_0x5a22x1f){_0x5a22x15(_0x5a22x1f[_0xb85f[67]],_0xb85f[166],_0x5a22x1f);_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x1f.UserId),_0xb85f[166],_0x5a22x1f)};if(parseInt(_0x5a22x1a[_0xb85f[58]],10)){var _0x5a22x27;var _0x5a22x2a=moment()[_0xb85f[57]](_0xb85f[56]);return User[_0xb85f[140]]({where:{name:_0x5a22x1a[_0xb85f[28]]},raw:true})[_0xb85f[90]](function(_0x5a22x28){if(_0x5a22x28){var _0x5a22x2e={id:_0x5a22x28[_0xb85f[130]],voicePause:false};_[_0xb85f[170]](_0x5a22x2e,{voicePause:true,chatPause:true,mailPause:true,faxPause:true,smsPause:true,openchannelPause:true,pauseType:_0x5a22x1a[_0xb85f[153]],lastPauseAt:_0x5a22x2a});var _0x5a22x27=_[_0xb85f[132]]({newValues:_0x5a22x2e},_0x5a22x28,_0x5a22x2e);_0x5a22x15(util[_0xb85f[57]](_0xb85f[133],_0x5a22x28[_0xb85f[134]],_0x5a22x28[_0xb85f[130]]),_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[126],_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[125],_0xb85f[135],_0x5a22x27)}})[_0xb85f[65]](function(_0x5a22x1e){console[_0xb85f[129]](_0xb85f[169],_0x5a22x1e)})}}},queuememberpenalty:function(_0x5a22x1a){return function(_0x5a22x1f){return BPromise[_0xb85f[112]]()}},queuememberringinuse:function(_0x5a22x1a){return function(_0x5a22x1f){return BPromise[_0xb85f[112]]()}},queuemember:function(_0x5a22x1a){return function(_0x5a22x1f){_0x5a22x19(_0x5a22x1a);_0x5a22x1b(_0x5a22x1a[_0xb85f[67]]);params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[113]][_0x5a22x1a[_0xb85f[29]]]= _0x5a22x1a;return BPromise[_0xb85f[112]]()}},queuecallerjoin:function(_0x5a22x1a){return function(_0x5a22x1f){if(!params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]]){params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]]= {};params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[70]]= 0;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[72]]= 0;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[74]]= 0;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[85]]= 0;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[87]]= 0;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[75]]= 0;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[76]]= 0;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[81]]= 0;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[83]]= 0;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[88]]= 0;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[89]]= 0;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[68]]= 0};params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]]= {channel:_0x5a22x1a[_0xb85f[123]],channelstate:Number(_0x5a22x1a[_0xb85f[171]]),channelstatedesc:_0x5a22x1a[_0xb85f[172]],calleridnum:_0x5a22x1a[_0xb85f[173]],calleridname:_0x5a22x1a[_0xb85f[174]],exten:_0x5a22x1a[_0xb85f[175]],priority:Number(_0x5a22x1a[_0xb85f[176]]),uniqueid:_0x5a22x1a[_0xb85f[117]],queue:_0x5a22x1a[_0xb85f[67]],position:Number(_0x5a22x1a[_0xb85f[177]]),count:Number(_0x5a22x1a[_0xb85f[178]])};params[_0xb85f[60]][_0xb85f[61]][_0xb85f[70]]++;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[70]]++;_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[150],{type:_0xb85f[68],amount:1,queue:_0x5a22x1a[_0xb85f[67]]});params[_0xb85f[60]][_0xb85f[61]][_0xb85f[68]]++;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[68]]++;_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[150],{type:_0xb85f[70],amount:1,queue:_0x5a22x1a[_0xb85f[67]]});if(_0x5a22x1f){_0x5a22x15(_0x5a22x1f[_0xb85f[67]],_0xb85f[179],_0x5a22x1f)};return BPromise[_0xb85f[112]]()}},queuecallerabandon:function(_0x5a22x1a){return function(_0x5a22x1f){if(_0x5a22x1f&& _0x5a22x1f[_0xb85f[180]]&& _0x5a22x1f[_0xb85f[180]][0]){_[_0xb85f[91]](_0x5a22x1f[_0xb85f[180]][1],function(_0x5a22x2b){triggers[_0xb85f[149]](_0x5a22x2b);_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x2b[_0xb85f[28]]),_0xb85f[154],_0x5a22x2b)})};var _0x5a22x27;var _0x5a22x2a=moment()[_0xb85f[57]](_0xb85f[56]);if(params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[70]]){params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[70]]--;_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[150],{type:_0xb85f[70],amount:-1,queue:_0x5a22x1a[_0xb85f[67]]})};if(params[_0xb85f[60]][_0xb85f[61]][_0xb85f[70]]){params[_0xb85f[60]][_0xb85f[61]][_0xb85f[70]]--};if(params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]]){params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]][_0xb85f[75]]= Number(_0x5a22x1a[_0xb85f[75]]);params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]][_0xb85f[177]]= Number(_0x5a22x1a[_0xb85f[177]]);params[_0xb85f[60]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]][_0xb85f[181]]= Number(_0x5a22x1a[_0xb85f[181]])};params[_0xb85f[60]][_0xb85f[61]][_0xb85f[85]]++;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[85]]++;_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[150],{type:_0xb85f[182],amount:1,queue:_0x5a22x1a[_0xb85f[67]]});params[_0xb85f[60]][_0xb85f[61]][_0xb85f[88]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[61]][_0xb85f[74]]/ (params[_0xb85f[60]][_0xb85f[61]][_0xb85f[74]]+ params[_0xb85f[60]][_0xb85f[61]][_0xb85f[85]])* 100,2);params[_0xb85f[60]][_0xb85f[61]][_0xb85f[89]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[61]][_0xb85f[85]]/ (params[_0xb85f[60]][_0xb85f[61]][_0xb85f[74]]+ params[_0xb85f[60]][_0xb85f[61]][_0xb85f[85]])* 100,2);params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[88]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[74]]/ (params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[74]]+ params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[85]])* 100,2);params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[89]]= _[_0xb85f[82]](params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[85]]/ (params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[74]]+ params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[85]])* 100,2);_0x5a22x1f&& _0x5a22x1f[_0xb85f[183]]&& _0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[152],_0x5a22x1f[_0xb85f[183]]);return User[_0xb85f[95]]({where:{lastQueue:_0x5a22x1a[_0xb85f[67]]},raw:true})[_0xb85f[90]](function(_0x5a22x2f){if(_0x5a22x2f&& _0x5a22x2f[_0xb85f[66]]){var _0x5a22x27;_[_0xb85f[91]](_0x5a22x2f,function(_0x5a22x30){_0x5a22x27= _[_0xb85f[132]]({newValues:{id:_0x5a22x30[_0xb85f[130]],queueStatus:_0xb85f[120],queueStatusAt:_0x5a22x2a,lastQueue:_0x5a22x1a[_0xb85f[67]]}},_0x5a22x30,{id:_0x5a22x30[_0xb85f[130]],queueStatus:_0xb85f[120],queueStatusAt:_0x5a22x2a,lastQueue:_0x5a22x1a[_0xb85f[67]]});_0x5a22x15(util[_0xb85f[57]](_0xb85f[133],_0x5a22x30[_0xb85f[134]],_0x5a22x30[_0xb85f[130]]),_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[126],_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[125],_0xb85f[135],_0x5a22x27)})}})[_0xb85f[65]](function(_0x5a22x1e){console[_0xb85f[129]](_0xb85f[184],_0x5a22x1e)})}},blindtransfer:function(_0x5a22x1a){return function(_0x5a22x1f){_0x5a22x15(null,_0x5a22x1a[_0xb85f[24]][_0xb85f[185]](),_0x5a22x1a);return BPromise[_0xb85f[112]]()}},attendedtransfer:function(_0x5a22x1a){return function(_0x5a22x1f){_0x5a22x15(null,_0x5a22x1a[_0xb85f[24]][_0xb85f[185]](),_0x5a22x1a);return BPromise[_0xb85f[112]]()}},dialbegin:function(_0x5a22x1a){return function(_0x5a22x1f){params[_0xb85f[96]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]]= {channel:_0x5a22x1a[_0xb85f[123]],channelstate:Number(_0x5a22x1a[_0xb85f[171]]),channelstatedesc:_0x5a22x1a[_0xb85f[172]],calleridnum:_0x5a22x1a[_0xb85f[173]],calleridname:_0x5a22x1a[_0xb85f[174]],context:_0x5a22x1a[_0xb85f[186]],exten:_0x5a22x1a[_0xb85f[175]],priority:Number(_0x5a22x1a[_0xb85f[176]]),dialstring:_0x5a22x1a[_0xb85f[187]]};if(_0x5a22x1a[_0xb85f[123]]){var _0x5a22x27=_[_0xb85f[170]](_0x5a22x1a,{starttime:moment()[_0xb85f[57]](_0xb85f[56]),lastevent:_0xb85f[148],updatedAt:moment()[_0xb85f[57]](_0xb85f[56])});_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x1a[_0xb85f[123]][_0xb85f[122]](/\/|-/)[1]),_0xb85f[188],_0x5a22x27);_0x5a22x15(_0xb85f[126],_0xb85f[124],_[_0xb85f[170]](_0x5a22x27,{role:_0xb85f[126]}));_0x5a22x15(_0xb85f[125],_0xb85f[124],_0x5a22x27,_[_0xb85f[170]](_0x5a22x27,{role:_0xb85f[125]}));if(_0x5a22x1f){triggers[_0xb85f[127]](_0x5a22x1f)}};return BPromise[_0xb85f[112]]()}},dialend:function(_0x5a22x1a){return function(_0x5a22x1f){if(params[_0xb85f[96]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]]){params[_0xb85f[96]][_0xb85f[118]][_0x5a22x1a[_0xb85f[117]]][_0xb85f[189]]= _0x5a22x1a[_0xb85f[189]]};if(_0x5a22x1a[_0xb85f[123]]){var _0x5a22x2a=moment()[_0xb85f[57]](_0xb85f[56]);var _0x5a22x27={dialstatus:_0x5a22x1a[_0xb85f[189]],lastevent:(_0x5a22x1a[_0xb85f[189]]=== _0xb85f[101])?_0xb85f[162]:_0xb85f[120],answertime:(_0x5a22x1a[_0xb85f[189]]=== _0xb85f[101])?_0x5a22x2a:null,uniqueid:_0x5a22x1a[_0xb85f[117]],linkedid:_0x5a22x1a[_0xb85f[119]],destuniqueid:_0x5a22x1a[_0xb85f[156]],destlinkedid:_0x5a22x1a[_0xb85f[190]],updatedAt:_0x5a22x2a};_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x1a[_0xb85f[123]][_0xb85f[122]](/\/|-/)[1]),_0xb85f[124],_0x5a22x27);_0x5a22x15(_0xb85f[126],_0xb85f[124],_0x5a22x27);_0x5a22x15(_0xb85f[125],_0xb85f[124],_0x5a22x27);if(_0x5a22x1f){triggers[_0xb85f[127]](_0x5a22x1f)}};return BPromise[_0xb85f[112]]()}},varset:function(_0x5a22x1a){return function(_0x5a22x1f){if(_0x5a22x1a[_0xb85f[192]][_0xb85f[53]](_0xb85f[191])){_0x5a22x15(_0xb85f[126],_0xb85f[188],{uniqueid:_0x5a22x1a[_0xb85f[117]],routeId:_0x5a22x1a[_0xb85f[193]],updatedAt:moment()[_0xb85f[57]](_0xb85f[56])});_0x5a22x15(_0xb85f[125],_0xb85f[188],{uniqueid:_0x5a22x1a[_0xb85f[117]],routeId:_0x5a22x1a[_0xb85f[193]],updatedAt:moment()[_0xb85f[57]](_0xb85f[56])})};if(_0x5a22x1a){triggers[_0xb85f[194]](_0x5a22x1a)};return BPromise[_0xb85f[112]]()}},queuecallerunmanaged:function(_0x5a22x1a){return function(_0x5a22x1f){if(_0x5a22x1f){params[_0xb85f[60]][_0xb85f[61]][_0xb85f[87]]+= 1;params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[87]]+= 1;_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[150],{type:_0xb85f[87],amount:1,queue:_0x5a22x1a[_0xb85f[67]]});if(params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[70]]){params[_0xb85f[60]][_0xb85f[59]][_0x5a22x1a[_0xb85f[67]]][_0xb85f[70]]-= 1};if(params[_0xb85f[60]][_0xb85f[61]][_0xb85f[70]]){params[_0xb85f[60]][_0xb85f[61]][_0xb85f[70]]-= 1;_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[150],{type:_0xb85f[70],amount:-1,queue:_0x5a22x1a[_0xb85f[67]]})};_0x5a22x15(_0x5a22x1a[_0xb85f[67]],_0xb85f[152],_0x5a22x1f);var _0x5a22x2a=moment()[_0xb85f[57]](_0xb85f[56]);return User[_0xb85f[95]]({where:{lastQueue:_0x5a22x1a[_0xb85f[67]]},raw:true})[_0xb85f[90]](function(_0x5a22x2f){if(_0x5a22x2f&& _0x5a22x2f[_0xb85f[66]]){var _0x5a22x27;_[_0xb85f[91]](_0x5a22x2f,function(_0x5a22x30){_0x5a22x27= _[_0xb85f[132]]({newValues:{id:_0x5a22x30[_0xb85f[130]],queueStatus:_0xb85f[120],queueStatusAt:_0x5a22x2a,lastQueue:_0x5a22x1a[_0xb85f[67]]}},_0x5a22x30,{id:_0x5a22x30[_0xb85f[130]],queueStatus:_0xb85f[120],queueStatusAt:_0x5a22x2a,lastQueue:_0x5a22x1a[_0xb85f[67]]});_0x5a22x15(util[_0xb85f[57]](_0xb85f[133],_0x5a22x30[_0xb85f[134]],_0x5a22x30[_0xb85f[130]]),_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[126],_0xb85f[135],_0x5a22x27);_0x5a22x15(_0xb85f[125],_0xb85f[135],_0x5a22x27)})}})[_0xb85f[65]](function(_0x5a22x1e){console[_0xb85f[129]](_0xb85f[184],_0x5a22x1e)})}}},agentUpdate:function(_0x5a22x30){return function(){_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x30[_0xb85f[130]]),_0xb85f[135],_0x5a22x30);_0x5a22x15(_0xb85f[126],_0xb85f[135],_0x5a22x30);_0x5a22x15(_0xb85f[125],_0xb85f[135],_0x5a22x30)}},console:function(_0x5a22x31){_0x5a22x15(_0x5a22x31[_0xb85f[195]],util[_0xb85f[57]](_0xb85f[196],_0x5a22x31[_0xb85f[111]]),_0x5a22x31[_0xb85f[197]])},realtimeQueueMembers:function(_0x5a22x32){return function(){_[_0xb85f[199]](params[_0xb85f[60]][_0xb85f[59]],function(_0x5a22x1c,_0x5a22x21){if(_[_0xb85f[198]](_0x5a22x32,_0x5a22x21)){_[_0xb85f[199]](_0x5a22x1c[_0xb85f[113]],function(_0x5a22x30){_0x5a22x15(_0x5a22x21,_0xb85f[166],_0x5a22x30)})}})}},updateTriggers:function(_0x5a22x31){return function(){return triggers[_0xb85f[200]](_0x5a22x31)}},queueAdd:function(_0x5a22x33,_0x5a22x34){return function(){if(_0x5a22x33&& _0x5a22x34){_[_0xb85f[91]](_0x5a22x33,function(_0x5a22x1f){_0x5a22x15(null,util[_0xb85f[57]](_0xb85f[201],_0x5a22x34),_0x5a22x1f[0])})}}},queueRemove:function(_0x5a22x1f,_0x5a22x34){return function(){if(_0x5a22x1f&& _0x5a22x34){_0x5a22x15(null,util[_0xb85f[57]](_0xb85f[202],_0x5a22x34),_0x5a22x1f)}}},checkTriggers:function(_0x5a22x31){return function(){return triggers[_0xb85f[203]](_0x5a22x31)}},inboundInit:function(){return function(){return BPromise[_0xb85f[112]]()[_0xb85f[90]](_0x5a22x1d())}},outboundInit:function(){return function(){return BPromise[_0xb85f[112]]()[_0xb85f[90]](_0x5a22x24())}},reportFaxUpdate:function(_0x5a22x35){return function(){_0x5a22x15(util[_0xb85f[57]](_0xb85f[121],_0x5a22x35[_0xb85f[204]]),_0xb85f[135],_0x5a22x35);_0x5a22x15(_0xb85f[125],_0xb85f[205],_0x5a22x35)}}}}
\ No newline at end of file