Built motion from commit 8613b0174.|1.0.22
[motion.git] / server / config / ami / socket.js
index a3029cc..65e9901 100644 (file)
@@ -1 +1 @@
-var _0x999b=["\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","\x61\x6D\x69","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\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","\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","\x69\x6E\x66\x6F","\x69\x64","\x73\x74\x61\x74\x65","\x61\x73\x73\x69\x67\x6E","\x64\x65\x76\x69\x63\x65\x73\x74\x61\x74\x65\x63\x68\x61\x6E\x67\x65","\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","\x65\x78\x74\x72\x61\x76\x61\x72","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\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","\x61\x67\x65\x6E\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","\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65","\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\x67\x65\x6E\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","\x61\x67\x65\x6E\x74\x72\x69\x6E\x67\x6E\x6F\x61\x6E\x73\x77\x65\x72","\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","\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","\x72\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x6C\x61\x73\x74\x65\x76\x65\x6E\x74","\x5F\x63\x68\x61\x6E\x67\x65\x64","\x6F\x72\x69\x67\x69\x6E\x61\x6C\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x61\x62\x61\x6E\x64\x6F\x6E","\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","\x6D\x65\x72\x67\x65","\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","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x61\x67\x65\x6E\x74\x75\x70\x64\x61\x74\x65","\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","\x76\x69\x64\x65\x6F\x4F\x6E","\x72\x65\x70\x6F\x72\x74\x66\x61\x78\x75\x70\x64\x61\x74\x65","\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","\x77\x69\x64\x67\x65\x74\x5F\x75\x70\x64\x61\x74\x65\x3A","\x72\x65\x63\x65\x69\x76\x65\x66\x61\x78"];_0x999b[0];var _=require(_0x999b[1]);var util=require(_0x999b[2]);var moment=require(_0x999b[3]);var BPromise=require(_0x999b[4]);var redis=require(_0x999b[5]);var VoiceQueue=require(_0x999b[7])[_0x999b[6]];var ReportQueue=require(_0x999b[7])[_0x999b[8]];var ReportCall=require(_0x999b[7])[_0x999b[9]];var ReportAgent=require(_0x999b[7])[_0x999b[10]];var ReportDial=require(_0x999b[7])[_0x999b[11]];var ReportMember=require(_0x999b[7])[_0x999b[12]];var User=require(_0x999b[7])[_0x999b[13]];var Triggers=require(_0x999b[14]);var config=require(_0x999b[15]);var logger=require(_0x999b[17])(_0x999b[16]);var utils=require(_0x999b[18]);var redisConf;if(config[_0x999b[19]]){redisConf= {password:config[_0x999b[19]]}};var redisClient=redis[_0x999b[21]](6379,config[_0x999b[20]],redisConf);var io=require(_0x999b[22])(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[_0x999b[23]]= function(){var _0x5efax16=function(_0x5efax17,_0x5efax18,_0x5efax19){if(_0x5efax17){io[_0x999b[25]](_0x5efax17)[_0x999b[24]](_0x5efax18,_0x5efax19)}else {io[_0x999b[24]](_0x5efax18,_0x5efax19)}};var _0x5efax1a=function(_0x5efax1b){delete _0x5efax1b[_0x999b[26]];delete _0x5efax1b[_0x999b[27]];delete _0x5efax1b[_0x999b[28]];delete _0x5efax1b[_0x999b[29]];_0x5efax1b[_0x999b[30]]= _0x5efax1b[_0x999b[31]]|| _0x5efax1b[_0x999b[30]];_0x5efax1b[_0x999b[32]]= _0x5efax1b[_0x999b[33]];_0x5efax1b[_0x999b[34]]= _0x999b[35];switch(_0x5efax1b[_0x999b[53]]){case _0x999b[36]:_0x5efax1b[_0x999b[34]]= _0x999b[35];break;case _0x999b[38]:_0x5efax1b[_0x999b[34]]= _0x999b[37];break;case _0x999b[40]:_0x5efax1b[_0x999b[34]]= _0x999b[39];break;case _0x999b[42]:_0x5efax1b[_0x999b[34]]= _0x999b[41];break;case _0x999b[44]:_0x5efax1b[_0x999b[34]]= _0x999b[43];break;case _0x999b[46]:_0x5efax1b[_0x999b[34]]= _0x999b[45];break;case _0x999b[48]:_0x5efax1b[_0x999b[34]]= _0x999b[47];break;case _0x999b[50]:_0x5efax1b[_0x999b[34]]= _0x999b[49];break;case _0x999b[52]:_0x5efax1b[_0x999b[34]]= _0x999b[51];break;default:};_0x5efax1b[_0x999b[53]]= Number(_0x5efax1b[_0x999b[53]]);if(_0x5efax1b[_0x999b[55]](_0x999b[54])){_0x5efax1b[_0x999b[54]]= Number(_0x5efax1b[_0x999b[54]])};if(_0x5efax1b[_0x999b[55]](_0x999b[56])){_0x5efax1b[_0x999b[56]]= Number(_0x5efax1b[_0x999b[56]])};if(_0x5efax1b[_0x999b[55]](_0x999b[57])){if(_0x5efax1b[_0x999b[57]]=== _0x999b[36]){_0x5efax1b[_0x999b[57]]= null}else {_0x5efax1b[_0x999b[57]]= moment()[_0x999b[59]](_0x999b[58])}};_0x5efax1b[_0x999b[60]]= parseInt(_0x5efax1b[_0x999b[60]],10)?true:false};function _0x5efax1c(_0x5efax1d){if(!params[_0x999b[62]][_0x999b[61]][_0x5efax1d]){params[_0x999b[62]][_0x999b[61]][_0x5efax1d]= {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 _0x5efax1e(){return function(){params[_0x999b[62]][_0x999b[61]]= {};params[_0x999b[62]][_0x999b[63]]= {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[_0x999b[97]]({attributes:[_0x999b[31]],raw:true})[_0x999b[92]](function(_0x5efax20){if(_0x5efax20){_[_0x999b[93]](_0x5efax20,function(_0x5efax1d){_0x5efax1c(_0x5efax1d[_0x999b[31]])});return ReportQueue[_0x999b[97]]({attributes:[_0x999b[69],_0x999b[79],_0x999b[82],_0x999b[94],_0x999b[95],_0x999b[96],_0x999b[77]],raw:true})}})[_0x999b[92]](function(_0x5efax20){if(_0x5efax20){var _0x5efax21;var _0x5efax22;var _0x5efax23=_0x5efax20[_0x999b[68]];for(var _0x5efax24=0;_0x5efax24< _0x5efax23;_0x5efax24++){_0x5efax21= _0x5efax20[_0x5efax24];_0x5efax22= _0x5efax21[_0x999b[69]];_0x5efax1c(_0x5efax22);params[_0x999b[62]][_0x999b[63]][_0x999b[70]]++;params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[70]]++;if(utils[_0x999b[71]](_0x5efax21)){params[_0x999b[62]][_0x999b[63]][_0x999b[72]]++;params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[72]]++};if(utils[_0x999b[73]](_0x5efax21)){params[_0x999b[62]][_0x999b[63]][_0x999b[74]]++;params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[74]]++};if(utils[_0x999b[75]](_0x5efax21)){params[_0x999b[62]][_0x999b[63]][_0x999b[76]]++;params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[76]]++;params[_0x999b[62]][_0x999b[63]][_0x999b[77]]+= _0x5efax21[_0x999b[77]]|| 0;params[_0x999b[62]][_0x999b[63]][_0x999b[78]]+= moment(_0x5efax21[_0x999b[82]])[_0x999b[81]](moment(_0x5efax21[_0x999b[79]]),_0x999b[80]);params[_0x999b[62]][_0x999b[63]][_0x999b[83]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[77]]/ params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[76]]);params[_0x999b[62]][_0x999b[63]][_0x999b[85]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[78]]/ params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[76]]);params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[77]]+= _0x5efax21[_0x999b[77]]|| 0;params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[78]]+= moment(_0x5efax21[_0x999b[82]])[_0x999b[81]](moment(_0x5efax21[_0x999b[79]]),_0x999b[80]);params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[83]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[77]]/ params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[76]]);params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[85]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[78]]/ params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[76]])};if(utils[_0x999b[86]](_0x5efax21)){params[_0x999b[62]][_0x999b[63]][_0x999b[87]]++;params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[87]]++};if(utils[_0x999b[88]](_0x5efax21)){params[_0x999b[62]][_0x999b[63]][_0x999b[89]]++;params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[89]]++};params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[90]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[76]]/ (params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[76]]+ params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[87]])* 100,2);params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[91]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[87]]/ (params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[76]]+ params[_0x999b[62]][_0x999b[61]][_0x5efax22][_0x999b[87]])* 100,2);params[_0x999b[62]][_0x999b[63]][_0x999b[90]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[63]][_0x999b[76]]/ (params[_0x999b[62]][_0x999b[63]][_0x999b[76]]+ params[_0x999b[62]][_0x999b[63]][_0x999b[87]])* 100,2);params[_0x999b[62]][_0x999b[63]][_0x999b[91]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[63]][_0x999b[87]]/ (params[_0x999b[62]][_0x999b[63]][_0x999b[76]]+ params[_0x999b[62]][_0x999b[63]][_0x999b[87]])* 100,2)}}})[_0x999b[67]](function(_0x5efax1f){logger[_0x999b[66]](_0x999b[64],_0x5efax1f[_0x999b[65]])})}}function _0x5efax25(){return function(){params[_0x999b[98]][_0x999b[63]]= {total:0,answered:0,sumDuration:0,avgDuration:0,tigerdial:0,answerRate:0};return ReportCall[_0x999b[97]]({where:{type:[_0x999b[98],_0x999b[101]],createdAt:{$gte:moment()[_0x999b[111]](_0x999b[110])}},attributes:[_0x999b[112],_0x999b[104],_0x999b[107]],raw:true})[_0x999b[92]](function(_0x5efax20){if(_0x5efax20){var _0x5efax26=_[_0x999b[100]](_0x5efax20,{type:_0x999b[98]});var _0x5efax27=_[_0x999b[100]](_0x5efax20,{type:_0x999b[101]});if(_0x5efax26[_0x999b[68]]){params[_0x999b[98]][_0x999b[63]][_0x999b[70]]= _0x5efax26[_0x999b[68]];params[_0x999b[98]][_0x999b[63]][_0x999b[102]]= _[_0x999b[105]](_0x5efax26,_0x999b[104])[_0x999b[103]]|| 0;params[_0x999b[98]][_0x999b[63]][_0x999b[106]]= _[_0x999b[108]](_0x5efax26,_0x999b[107]);if(params[_0x999b[98]][_0x999b[63]][_0x999b[102]]){params[_0x999b[98]][_0x999b[63]][_0x999b[109]]= _[_0x999b[84]]((_[_0x999b[108]](_0x5efax26,_0x999b[107])/ params[_0x999b[98]][_0x999b[63]][_0x999b[102]]));params[_0x999b[98]][_0x999b[63]][_0x999b[90]]= _[_0x999b[84]](params[_0x999b[98]][_0x999b[63]][_0x999b[102]]/ params[_0x999b[98]][_0x999b[63]][_0x999b[70]]* 100,1)}};if(_0x5efax27[_0x999b[68]]){params[_0x999b[98]][_0x999b[63]][_0x999b[101]]= _0x5efax27[_0x999b[68]]}}})[_0x999b[67]](function(_0x5efax1f){logger[_0x999b[66]](_0x999b[99],_0x5efax1f[_0x999b[65]])})}}BPromise[_0x999b[113]]()[_0x999b[92]](_0x5efax1e())[_0x999b[92]](_0x5efax25());return {cdr:function(_0x5efax1b){return function(_0x5efax20){_0x5efax16(_0x999b[114],_0x999b[115],_0x5efax1b);if(_0x5efax1b[_0x999b[112]]== _0x999b[98]|| _0x5efax1b[_0x999b[112]]== _0x999b[101]){if(_0x5efax1b[_0x999b[112]]== _0x999b[98]){params[_0x999b[98]][_0x999b[63]][_0x999b[70]]++;_0x5efax1b[_0x999b[104]]== _0x999b[103]&& (params[_0x999b[98]][_0x999b[63]][_0x999b[102]]++);params[_0x999b[98]][_0x999b[63]][_0x999b[106]]+= Number(_0x5efax1b[_0x999b[107]]);if(params[_0x999b[98]][_0x999b[63]][_0x999b[102]]){params[_0x999b[98]][_0x999b[63]][_0x999b[109]]= _[_0x999b[84]](params[_0x999b[98]][_0x999b[63]][_0x999b[106]]/ params[_0x999b[98]][_0x999b[63]][_0x999b[102]]);params[_0x999b[98]][_0x999b[63]][_0x999b[90]]= _[_0x999b[84]](params[_0x999b[98]][_0x999b[63]][_0x999b[102]]/ params[_0x999b[98]][_0x999b[63]][_0x999b[70]]* 100,1)}}else {params[_0x999b[98]][_0x999b[63]][_0x999b[101]]++};_0x5efax16(_0x999b[116],_0x999b[117],params[_0x999b[98]][_0x999b[63]])}}},send:function(_0x5efax1b){return function(_0x5efax20){return BPromise[_0x999b[113]]()}},hangup:function(_0x5efax1b){return function(_0x5efax20){if(params[_0x999b[98]][_0x999b[119]][_0x5efax1b[_0x999b[118]]]){delete params[_0x999b[98]][_0x999b[119]][_0x5efax1b[_0x999b[118]]]};if(params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]]){delete params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]]};var _0x5efax28={uniqueid:_0x5efax1b[_0x999b[118]],linkedid:_0x5efax1b[_0x999b[120]],endtime:moment()[_0x999b[59]](_0x999b[58]),lastevent:_0x999b[121],updatedAt:moment()[_0x999b[59]](_0x999b[58])};_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax1b[_0x999b[124]][_0x999b[123]](/\/|-/)[1]),_0x999b[125],_0x5efax28);_0x5efax16(_0x999b[126],_0x999b[125],_0x5efax28);_0x5efax16(_0x999b[127],_0x999b[125],_0x5efax28);if(_0x5efax20){triggers[_0x999b[128]](_0x5efax20)};return BPromise[_0x999b[113]]()}},devicestatechange:function(_0x5efax1b){return function(_0x5efax20){return User[_0x999b[142]]({where:{name:_0x5efax1b[_0x999b[141]][_0x999b[140]](_0x999b[138],_0x999b[139])},raw:true})[_0x999b[92]](function(_0x5efax29){if(_0x5efax29){var _0x5efax28=_[_0x999b[133]]({newValues:{id:_0x5efax29[_0x999b[131]],status:_0x5efax1b[_0x999b[132]],statusAt:moment()[_0x999b[59]](_0x999b[58])}},_0x5efax29,{status:_0x5efax1b[_0x999b[132]],statusAt:moment()[_0x999b[59]](_0x999b[58])});_0x5efax28[_0x999b[26]]= _0x999b[134];_0x5efax16(util[_0x999b[59]](_0x999b[135],_0x5efax29[_0x999b[136]],_0x5efax29[_0x999b[131]]),_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[127],_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[126],_0x999b[137],_0x5efax28)}})[_0x999b[67]](function(_0x5efax1f){logger[_0x999b[130]](_0x999b[129],_0x5efax1f)})}},peerstatus:function(_0x5efax1b){return function(_0x5efax20){if(_0x5efax20&& _0x5efax20[0]){_[_0x999b[93]](_0x5efax20[1],function(_0x5efax2a){if(!params[_0x999b[143]][_0x5efax2a[_0x999b[31]]]){params[_0x999b[143]][_0x5efax2a[_0x999b[31]]]= {name:_0x5efax2a[_0x999b[31]]}};params[_0x999b[143]][_0x5efax2a[_0x999b[31]]][_0x999b[144]]= _0x5efax1b[_0x999b[144]];_0x5efax16(_0x999b[145],_0x999b[146],params[_0x999b[143]][_0x5efax2a[_0x999b[31]]])})};return BPromise[_0x999b[113]]()}},registry:function(_0x5efax1b){return function(_0x5efax20){if(_0x5efax20&& _0x5efax20[0]){_[_0x999b[93]](_0x5efax20[1],function(_0x5efax2a){if(!params[_0x999b[143]][_0x5efax2a[_0x999b[31]]]){params[_0x999b[143]][_0x5efax2a[_0x999b[31]]]= {name:_0x5efax2a[_0x999b[31]]}};params[_0x999b[143]][_0x5efax2a[_0x999b[31]]][_0x999b[53]]= _0x5efax1b[_0x999b[53]];_0x5efax16(_0x999b[145],_0x999b[146],params[_0x999b[143]][_0x5efax2a[_0x999b[31]]])})};return BPromise[_0x999b[113]]()}},agentcalled:function(_0x5efax1b){return function(_0x5efax20){if(_0x5efax20){_0x5efax1b[_0x999b[147]]&& (_0x5efax20[_0x999b[148]][_0x999b[147]]= _0x5efax1b[_0x999b[147]]);_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax20[_0x999b[30]]),_0x999b[149],_0x5efax20);triggers[_0x999b[150]](_0x5efax20)};return User[_0x999b[142]]({where:{name:_0x5efax1b[_0x999b[30]],voicePause:false},raw:true})[_0x999b[92]](function(_0x5efax29){if(_0x5efax29){var _0x5efax2b=moment()[_0x999b[59]](_0x999b[58]);var _0x5efax28=_[_0x999b[133]]({newValues:{id:_0x5efax29[_0x999b[131]],queueStatus:_0x999b[152],queueStatusAt:_0x5efax2b,lastQueue:_0x5efax1b[_0x999b[69]]}},_0x5efax29,{queueStatus:_0x999b[152],queueStatusAt:_0x5efax2b,lastQueue:_0x5efax1b[_0x999b[69]]});_0x5efax28[_0x999b[26]]= _0x999b[153];_0x5efax16(util[_0x999b[59]](_0x999b[135],_0x5efax29[_0x999b[136]],_0x5efax29[_0x999b[131]]),_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[127],_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[126],_0x999b[137],_0x5efax28)}})[_0x999b[67]](function(_0x5efax1f){logger[_0x999b[66]](_0x999b[151],_0x5efax1f)})}},agentcomplete:function(_0x5efax1b){return function(_0x5efax20){if(_0x5efax20){triggers[_0x999b[154]](_0x5efax20)};if(params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[74]]){params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[74]]--};if(params[_0x999b[62]][_0x999b[63]][_0x999b[74]]){params[_0x999b[62]][_0x999b[63]][_0x999b[74]]--;_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[155],{type:_0x999b[74],amount:-1,queue:_0x5efax1b[_0x999b[69]]})};params[_0x999b[62]][_0x999b[63]][_0x999b[76]]++;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[76]]++;_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[155],{type:_0x999b[121],amount:1,queue:_0x5efax1b[_0x999b[69]]});params[_0x999b[62]][_0x999b[63]][_0x999b[90]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[63]][_0x999b[76]]/ (params[_0x999b[62]][_0x999b[63]][_0x999b[76]]+ params[_0x999b[62]][_0x999b[63]][_0x999b[87]])* 100,2);params[_0x999b[62]][_0x999b[63]][_0x999b[91]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[63]][_0x999b[87]]/ (params[_0x999b[62]][_0x999b[63]][_0x999b[76]]+ params[_0x999b[62]][_0x999b[63]][_0x999b[87]])* 100,2);params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[90]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[76]]/ (params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[76]]+ params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[87]])* 100,2);params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[91]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[87]]/ (params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[76]]+ params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[87]])* 100,2);params[_0x999b[62]][_0x999b[63]][_0x999b[78]]+= Number(_0x5efax1b[_0x999b[78]]);params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[78]]+= Number(_0x5efax1b[_0x999b[78]]);_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[155],{type:_0x999b[78],amount:Number(_0x5efax1b[_0x999b[78]]),queue:_0x5efax1b[_0x999b[69]]});params[_0x999b[62]][_0x999b[63]][_0x999b[85]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[63]][_0x999b[78]]/ params[_0x999b[62]][_0x999b[63]][_0x999b[76]]);params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[85]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[78]]/ params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[76]]);params[_0x999b[62]][_0x999b[63]][_0x999b[77]]+= Number(_0x5efax1b[_0x999b[77]]);params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[77]]+= Number(_0x5efax1b[_0x999b[77]]);_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[155],{type:_0x999b[77],amount:Number(_0x5efax1b[_0x999b[77]]),queue:_0x5efax1b[_0x999b[69]]});params[_0x999b[62]][_0x999b[63]][_0x999b[83]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[63]][_0x999b[77]]/ params[_0x999b[62]][_0x999b[63]][_0x999b[76]]);params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[83]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[77]]/ params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[76]]);var _0x5efax28;var _0x5efax2b=moment()[_0x999b[59]](_0x999b[58]);return ReportAgent[_0x999b[142]]({where:{uniqueid:_0x5efax1b[_0x999b[118]],destuniqueid:_0x5efax1b[_0x999b[162]]},raw:true})[_0x999b[92]](function(_0x5efax2c){if(_0x5efax2c){_0x5efax28= _[_0x999b[133]]({},_0x5efax2c,{lastevent:_0x999b[121],agentcomplete:true,agentcompleteAt:_0x5efax2b,talktime:Number(_0x5efax1b[_0x999b[78]]),reason:_0x5efax1b[_0x999b[159]]});_0x5efax1b[_0x999b[147]]&& (_0x5efax28[_0x999b[147]]= _0x5efax1b[_0x999b[147]]);_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax2c[_0x999b[30]]),_0x999b[160],_0x5efax28)};return ReportQueue[_0x999b[142]]({where:{uniqueid:_0x5efax1b[_0x999b[118]]},order:_0x999b[161],raw:true})})[_0x999b[92]](function(_0x5efax2c){if(_0x5efax2c){_0x5efax28= _[_0x999b[133]]({},_0x5efax2c,{queuecallercomplete:true,queuecallercompleteAt:_0x5efax2b});_0x5efax16(_0x5efax2c[_0x999b[69]],_0x999b[158],_0x5efax28)};return User[_0x999b[142]]({where:{name:_0x5efax1b[_0x999b[30]]},raw:true})})[_0x999b[92]](function(_0x5efax29){if(_0x5efax29){var _0x5efax28=_[_0x999b[133]]({newValues:{id:_0x5efax29[_0x999b[131]],queueStatus:_0x999b[121],queueStatusAt:_0x5efax2b,lastQueue:_0x5efax1b[_0x999b[69]]}},_0x5efax29,{queueStatus:_0x999b[121],queueStatusAt:_0x5efax2b,lastQueue:_0x5efax1b[_0x999b[69]]});_0x5efax28[_0x999b[26]]= _0x999b[157];_0x5efax16(util[_0x999b[59]](_0x999b[135],_0x5efax29[_0x999b[136]],_0x5efax29[_0x999b[131]]),_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[127],_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[126],_0x999b[137],_0x5efax28)}})[_0x999b[67]](function(_0x5efax1f){logger[_0x999b[66]](_0x999b[156],_0x5efax1f)})}},agentconnect:function(_0x5efax1b){return function(_0x5efax20){if(_0x5efax20){triggers[_0x999b[154]](_0x5efax20)};if(params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[72]]){params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[72]]--;_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[155],{type:_0x999b[72],amount:-1,queue:_0x5efax1b[_0x999b[69]]})};if(params[_0x999b[62]][_0x999b[63]][_0x999b[72]]){params[_0x999b[62]][_0x999b[63]][_0x999b[72]]--};if(params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]]){params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]][_0x999b[163]]= _0x5efax1b[_0x999b[164]];params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]][_0x999b[165]]= _0x5efax1b[_0x999b[165]];params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]][_0x999b[77]]= Number(_0x5efax1b[_0x999b[77]]);params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]][_0x999b[166]]= Number(_0x5efax1b[_0x999b[166]]);params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]][_0x999b[32]]= _0x5efax1b[_0x999b[32]];params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]][_0x999b[30]]= _0x5efax1b[_0x999b[30]]};params[_0x999b[62]][_0x999b[63]][_0x999b[74]]++;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[74]]++;_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[155],{type:_0x999b[74],amount:1,queue:_0x5efax1b[_0x999b[69]]});var _0x5efax28;var _0x5efax2b=moment()[_0x999b[59]](_0x999b[58]);return ReportQueue[_0x999b[142]]({where:{uniqueid:_0x5efax1b[_0x999b[118]]},order:_0x999b[161],raw:true})[_0x999b[92]](function(_0x5efax2c){if(_0x5efax2c){_0x5efax28= _[_0x999b[133]]({},_0x5efax2c,{queuecallerleaveAt:moment()[_0x999b[59]](_0x999b[58]),holdtime:_0x5efax1b[_0x999b[77]],assigned:true,lastAssignedTo:_0x5efax1b[_0x999b[30]]});_0x5efax16(_0x5efax2c[_0x999b[69]],_0x999b[158],_0x5efax28)};return ReportAgent[_0x999b[142]]({where:{uniqueid:_0x5efax1b[_0x999b[118]],destuniqueid:_0x5efax1b[_0x999b[162]]},raw:true})})[_0x999b[92]](function(_0x5efax2c){if(_0x5efax2c){_0x5efax28= _[_0x999b[133]]({},_0x5efax2c,{lastevent:_0x999b[168],agentconnectAt:moment()[_0x999b[59]](_0x999b[58]),holdtime:_0x5efax1b[_0x999b[77]]});_0x5efax1b[_0x999b[147]]&& (_0x5efax28[_0x999b[147]]= _0x5efax1b[_0x999b[147]]);_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax2c[_0x999b[30]]),_0x999b[160],_0x5efax28)};return ReportAgent[_0x999b[97]]({where:{uniqueid:_0x5efax1b[_0x999b[118]],destuniqueid:{$ne:_0x5efax1b[_0x999b[162]]},reason:null},raw:true})})[_0x999b[92]](function(_0x5efax2e){if(_0x5efax2e&& _0x5efax2e[_0x999b[68]]){_[_0x999b[93]](_0x5efax2e,function(_0x5efax2c){_0x5efax28= _[_0x999b[133]]({},_0x5efax2c,{lastevent:_0x999b[170],agentringnoanswer:true,agentringnoanswerAt:_0x5efax2b,reason:_0x999b[170],answeredelsewheredestinationuniqueid:_0x5efax1b[_0x999b[162]],answeredelsewheremembername:_0x5efax1b[_0x999b[30]]});_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax2c[_0x999b[30]]),_0x999b[160],_0x5efax28)})};return User[_0x999b[142]]({where:{name:_0x5efax1b[_0x999b[30]]},raw:true})})[_0x999b[92]](function(_0x5efax29){if(_0x5efax29){var _0x5efax28=_[_0x999b[133]]({newValues:{id:_0x5efax29[_0x999b[131]],queueStatus:_0x999b[168],queueStatusAt:_0x5efax2b,lastQueue:_0x5efax1b[_0x999b[69]]}},_0x5efax29,{queueStatus:_0x999b[168],queueStatusAt:_0x5efax2b,lastQueue:_0x5efax1b[_0x999b[69]]});_0x5efax28[_0x999b[26]]= _0x999b[169];_0x5efax16(util[_0x999b[59]](_0x999b[135],_0x5efax29[_0x999b[136]],_0x5efax29[_0x999b[131]]),_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[127],_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[126],_0x999b[137],_0x5efax28)};return User[_0x999b[97]]({where:{lastQueue:_0x5efax1b[_0x999b[69]],name:{$ne:_0x5efax1b[_0x999b[30]]}},raw:true})})[_0x999b[92]](function(_0x5efax2d){if(_0x5efax2d&& _0x5efax2d[_0x999b[68]]){_[_0x999b[93]](_0x5efax2d,function(_0x5efax29){var _0x5efax28=_[_0x999b[133]]({newValues:{id:_0x5efax29[_0x999b[131]],queueStatus:_0x999b[121],queueStatusAt:_0x5efax2b}},_0x5efax29,{queueStatus:_0x999b[121],queueStatusAt:_0x5efax2b});_0x5efax16(util[_0x999b[59]](_0x999b[135],_0x5efax29[_0x999b[136]],_0x5efax29[_0x999b[131]]),_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[127],_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[126],_0x999b[137],_0x5efax28)})}})[_0x999b[67]](function(_0x5efax1f){logger[_0x999b[66]](_0x999b[167],_0x5efax1f)})}},agentringnoanswer:function(_0x5efax1b){return function(_0x5efax20){if(_0x5efax20){triggers[_0x999b[154]](_0x5efax20)};var _0x5efax28;var _0x5efax2b=moment()[_0x999b[59]](_0x999b[58]);return User[_0x999b[142]]({where:{name:_0x5efax1b[_0x999b[30]]},raw:true})[_0x999b[92]](function(_0x5efax29){if(_0x5efax29){var _0x5efax28=_[_0x999b[133]]({newValues:{id:_0x5efax29[_0x999b[131]],queueStatus:_0x999b[121],queueStatusAt:_0x5efax2b,lastQueue:_0x5efax1b[_0x999b[69]]}},_0x5efax29,{queueStatus:_0x999b[121],queueStatusAt:_0x5efax2b,lastQueue:_0x5efax1b[_0x999b[69]]});_0x5efax28[_0x999b[26]]= _0x999b[173];_0x5efax16(util[_0x999b[59]](_0x999b[135],_0x5efax29[_0x999b[136]],_0x5efax29[_0x999b[131]]),_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[127],_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[126],_0x999b[137],_0x5efax28)};return ReportAgent[_0x999b[142]]({where:{uniqueid:_0x5efax1b[_0x999b[118]],destuniqueid:_0x5efax1b[_0x999b[162]]},raw:true})})[_0x999b[92]](function(_0x5efax2c){if(_0x5efax2c){_0x5efax28= _[_0x999b[133]]({},_0x5efax2c,{lastevent:_0x999b[172],agentringnoanswer:true,agentringnoanswerAt:moment()[_0x999b[59]](_0x999b[58]),reason:_0x999b[172]});_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax2c[_0x999b[30]]),_0x999b[160],_0x5efax28)}})[_0x999b[67]](function(_0x5efax1f){logger[_0x999b[66]](_0x999b[171],_0x5efax1f)})}},queuememberadded:function(_0x5efax1b){return function(_0x5efax20){if(_0x5efax20){_0x5efax16(_0x5efax20[_0x999b[69]],_0x999b[174],_0x5efax20);_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax20.UserId),_0x999b[174],_0x5efax20)};return BPromise[_0x999b[113]]()}},queuememberremoved:function(_0x5efax1b){return function(_0x5efax20){if(params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]]){delete params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[114]][_0x5efax1b[_0x999b[30]]]};return User[_0x999b[142]]({where:{name:_0x5efax1b[_0x999b[32]][_0x999b[140]](_0x999b[138],_0x999b[139])},raw:true})[_0x999b[92]](function(_0x5efax29){if(_0x5efax29){_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[176],{queue:_0x5efax1b[_0x999b[69]],UserId:_0x5efax29[_0x999b[131]]});_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax29[_0x999b[131]]),_0x999b[176],{queue:_0x5efax1b[_0x999b[69]],UserId:_0x5efax29[_0x999b[131]]})}})[_0x999b[67]](function(_0x5efax1f){logger[_0x999b[66]](_0x999b[175],_0x5efax1f)})}},queuememberpause:function(_0x5efax1b){return function(_0x5efax20){if(_0x5efax20){_0x5efax16(_0x5efax20[_0x999b[69]],_0x999b[174],_0x5efax20);_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax20.UserId),_0x999b[174],_0x5efax20)}}},queuememberpenalty:function(_0x5efax1b){return function(_0x5efax20){return BPromise[_0x999b[113]]()}},queuememberringinuse:function(_0x5efax1b){return function(_0x5efax20){return BPromise[_0x999b[113]]()}},queuemember:function(_0x5efax1b){return function(_0x5efax20){_0x5efax1a(_0x5efax1b);_0x5efax1c(_0x5efax1b[_0x999b[69]]);params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[114]][_0x5efax1b[_0x999b[31]]]= _0x5efax1b;return BPromise[_0x999b[113]]()}},queuecallerjoin:function(_0x5efax1b){return function(_0x5efax20){if(!params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]]){params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]]= {};params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[72]]= 0;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[74]]= 0;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[76]]= 0;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[87]]= 0;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[89]]= 0;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[77]]= 0;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[78]]= 0;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[83]]= 0;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[85]]= 0;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[90]]= 0;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[91]]= 0;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[70]]= 0};params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]]= {channel:_0x5efax1b[_0x999b[124]],channelstate:Number(_0x5efax1b[_0x999b[177]]),channelstatedesc:_0x5efax1b[_0x999b[178]],calleridnum:_0x5efax1b[_0x999b[179]],calleridname:_0x5efax1b[_0x999b[180]],exten:_0x5efax1b[_0x999b[181]],priority:Number(_0x5efax1b[_0x999b[182]]),uniqueid:_0x5efax1b[_0x999b[118]],queue:_0x5efax1b[_0x999b[69]],position:Number(_0x5efax1b[_0x999b[183]]),count:Number(_0x5efax1b[_0x999b[184]])};params[_0x999b[62]][_0x999b[63]][_0x999b[72]]++;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[72]]++;_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[155],{type:_0x999b[70],amount:1,queue:_0x5efax1b[_0x999b[69]]});params[_0x999b[62]][_0x999b[63]][_0x999b[70]]++;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[70]]++;_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[155],{type:_0x999b[72],amount:1,queue:_0x5efax1b[_0x999b[69]]});if(_0x5efax20){_0x5efax16(_0x5efax20[_0x999b[69]],_0x999b[185],_0x5efax20)};return BPromise[_0x999b[113]]()}},queuecallerabandon:function(_0x5efax1b){return function(_0x5efax20){if(_0x5efax20&& _0x5efax20[_0x999b[186]]&& _0x5efax20[_0x999b[186]][0]){_[_0x999b[93]](_0x5efax20[_0x999b[186]][1],function(_0x5efax2c){_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax2c[_0x999b[30]]),_0x999b[160],_0x5efax2c)})};if(_0x5efax20&& _0x5efax20[_0x999b[187]]){_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[158],_0x5efax20[_0x999b[187]]);_0x5efax20[_0x999b[187]][_0x999b[148]][_0x999b[188]]= _0x999b[87];_0x5efax20[_0x999b[187]][_0x999b[189]][_0x999b[188]]= true;triggers[_0x999b[154]](_0x5efax20[_0x999b[187]])};var _0x5efax28;var _0x5efax2b=moment()[_0x999b[59]](_0x999b[58]);if(params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[72]]){params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[72]]--;_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[155],{type:_0x999b[72],amount:-1,queue:_0x5efax1b[_0x999b[69]]})};if(params[_0x999b[62]][_0x999b[63]][_0x999b[72]]){params[_0x999b[62]][_0x999b[63]][_0x999b[72]]--};if(params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]]){params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]][_0x999b[77]]= Number(_0x5efax1b[_0x999b[77]]);params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]][_0x999b[183]]= Number(_0x5efax1b[_0x999b[183]]);params[_0x999b[62]][_0x999b[119]][_0x5efax1b[_0x999b[118]]][_0x999b[190]]= Number(_0x5efax1b[_0x999b[190]])};params[_0x999b[62]][_0x999b[63]][_0x999b[87]]++;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[87]]++;_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[155],{type:_0x999b[191],amount:1,queue:_0x5efax1b[_0x999b[69]]});params[_0x999b[62]][_0x999b[63]][_0x999b[90]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[63]][_0x999b[76]]/ (params[_0x999b[62]][_0x999b[63]][_0x999b[76]]+ params[_0x999b[62]][_0x999b[63]][_0x999b[87]])* 100,2);params[_0x999b[62]][_0x999b[63]][_0x999b[91]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[63]][_0x999b[87]]/ (params[_0x999b[62]][_0x999b[63]][_0x999b[76]]+ params[_0x999b[62]][_0x999b[63]][_0x999b[87]])* 100,2);params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[90]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[76]]/ (params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[76]]+ params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[87]])* 100,2);params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[91]]= _[_0x999b[84]](params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[87]]/ (params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[76]]+ params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[87]])* 100,2);return User[_0x999b[97]]({where:{lastQueue:_0x5efax1b[_0x999b[69]]},raw:true})[_0x999b[92]](function(_0x5efax2f){if(_0x5efax2f&& _0x5efax2f[_0x999b[68]]){var _0x5efax28;_[_0x999b[93]](_0x5efax2f,function(_0x5efax30){_0x5efax28= _[_0x999b[133]]({newValues:{id:_0x5efax30[_0x999b[131]],queueStatus:_0x999b[121],queueStatusAt:_0x5efax2b,lastQueue:_0x5efax1b[_0x999b[69]]}},_0x5efax30,{id:_0x5efax30[_0x999b[131]],queueStatus:_0x999b[121],queueStatusAt:_0x5efax2b,lastQueue:_0x5efax1b[_0x999b[69]]});_0x5efax28[_0x999b[26]]= _0x999b[95];_0x5efax16(util[_0x999b[59]](_0x999b[135],_0x5efax30[_0x999b[136]],_0x5efax30[_0x999b[131]]),_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[127],_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[126],_0x999b[137],_0x5efax28)})}})[_0x999b[67]](function(_0x5efax1f){logger[_0x999b[66]](_0x999b[192],_0x5efax1f)})}},blindtransfer:function(_0x5efax1b){return function(_0x5efax20){_0x5efax16(null,_0x5efax1b[_0x999b[26]][_0x999b[193]](),_0x5efax1b);return BPromise[_0x999b[113]]()}},attendedtransfer:function(_0x5efax1b){return function(_0x5efax20){_0x5efax16(null,_0x5efax1b[_0x999b[26]][_0x999b[193]](),_0x5efax1b);return BPromise[_0x999b[113]]()}},dialbegin:function(_0x5efax1b){return function(_0x5efax20){params[_0x999b[98]][_0x999b[119]][_0x5efax1b[_0x999b[118]]]= {channel:_0x5efax1b[_0x999b[124]],channelstate:Number(_0x5efax1b[_0x999b[177]]),channelstatedesc:_0x5efax1b[_0x999b[178]],calleridnum:_0x5efax1b[_0x999b[179]],calleridname:_0x5efax1b[_0x999b[180]],context:_0x5efax1b[_0x999b[194]],exten:_0x5efax1b[_0x999b[181]],priority:Number(_0x5efax1b[_0x999b[182]]),dialstring:_0x5efax1b[_0x999b[195]]};if(_0x5efax1b[_0x999b[124]]){var _0x5efax28=_[_0x999b[196]](_0x5efax1b,{starttime:moment()[_0x999b[59]](_0x999b[58]),lastevent:_0x999b[152],updatedAt:moment()[_0x999b[59]](_0x999b[58])});_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax1b[_0x999b[124]][_0x999b[123]](/\/|-/)[1]),_0x999b[197],_0x5efax28);_0x5efax16(_0x999b[127],_0x999b[125],_[_0x999b[196]](_0x5efax28,{role:_0x999b[127]}));_0x5efax16(_0x999b[126],_0x999b[125],_0x5efax28,_[_0x999b[196]](_0x5efax28,{role:_0x999b[126]}));if(_0x5efax20){triggers[_0x999b[128]](_0x5efax20)}};return BPromise[_0x999b[113]]()}},dialend:function(_0x5efax1b){return function(_0x5efax20){if(params[_0x999b[98]][_0x999b[119]][_0x5efax1b[_0x999b[118]]]){params[_0x999b[98]][_0x999b[119]][_0x5efax1b[_0x999b[118]]][_0x999b[198]]= _0x5efax1b[_0x999b[198]]};if(_0x5efax1b[_0x999b[124]]){var _0x5efax2b=moment()[_0x999b[59]](_0x999b[58]);var _0x5efax28={dialstatus:_0x5efax1b[_0x999b[198]],lastevent:(_0x5efax1b[_0x999b[198]]=== _0x999b[103])?_0x999b[168]:_0x999b[121],answertime:(_0x5efax1b[_0x999b[198]]=== _0x999b[103])?_0x5efax2b:null,uniqueid:_0x5efax1b[_0x999b[118]],linkedid:_0x5efax1b[_0x999b[120]],destuniqueid:_0x5efax1b[_0x999b[162]],destlinkedid:_0x5efax1b[_0x999b[199]],updatedAt:_0x5efax2b};_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax1b[_0x999b[124]][_0x999b[123]](/\/|-/)[1]),_0x999b[125],_0x5efax28);_0x5efax16(_0x999b[127],_0x999b[125],_0x5efax28);_0x5efax16(_0x999b[126],_0x999b[125],_0x5efax28);if(_0x5efax20){triggers[_0x999b[128]](_0x5efax20)}};return BPromise[_0x999b[113]]()}},varset:function(_0x5efax1b){return function(_0x5efax20){if(_0x5efax1b[_0x999b[201]][_0x999b[55]](_0x999b[200])){_0x5efax16(_0x999b[127],_0x999b[197],{uniqueid:_0x5efax1b[_0x999b[118]],routeId:_0x5efax1b[_0x999b[202]],updatedAt:moment()[_0x999b[59]](_0x999b[58])});_0x5efax16(_0x999b[126],_0x999b[197],{uniqueid:_0x5efax1b[_0x999b[118]],routeId:_0x5efax1b[_0x999b[202]],updatedAt:moment()[_0x999b[59]](_0x999b[58])})};if(_0x5efax1b){triggers[_0x999b[203]](_0x5efax1b)};return BPromise[_0x999b[113]]()}},queuecallerunmanaged:function(_0x5efax1b){return function(_0x5efax20){if(_0x5efax20){params[_0x999b[62]][_0x999b[63]][_0x999b[89]]+= 1;params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[89]]+= 1;_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[155],{type:_0x999b[89],amount:1,queue:_0x5efax1b[_0x999b[69]]});if(params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[72]]){params[_0x999b[62]][_0x999b[61]][_0x5efax1b[_0x999b[69]]][_0x999b[72]]-= 1};if(params[_0x999b[62]][_0x999b[63]][_0x999b[72]]){params[_0x999b[62]][_0x999b[63]][_0x999b[72]]-= 1;_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[155],{type:_0x999b[72],amount:-1,queue:_0x5efax1b[_0x999b[69]]})};_0x5efax16(_0x5efax1b[_0x999b[69]],_0x999b[158],_0x5efax20);var _0x5efax2b=moment()[_0x999b[59]](_0x999b[58]);return User[_0x999b[97]]({where:{lastQueue:_0x5efax1b[_0x999b[69]]},raw:true})[_0x999b[92]](function(_0x5efax2f){if(_0x5efax2f&& _0x5efax2f[_0x999b[68]]){var _0x5efax28;_[_0x999b[93]](_0x5efax2f,function(_0x5efax30){_0x5efax28= _[_0x999b[133]]({newValues:{id:_0x5efax30[_0x999b[131]],queueStatus:_0x999b[121],queueStatusAt:_0x5efax2b,lastQueue:_0x5efax1b[_0x999b[69]]}},_0x5efax30,{id:_0x5efax30[_0x999b[131]],queueStatus:_0x999b[121],queueStatusAt:_0x5efax2b,lastQueue:_0x5efax1b[_0x999b[69]]});_0x5efax28[_0x999b[26]]= _0x999b[204];_0x5efax16(util[_0x999b[59]](_0x999b[135],_0x5efax30[_0x999b[136]],_0x5efax30[_0x999b[131]]),_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[127],_0x999b[137],_0x5efax28);_0x5efax16(_0x999b[126],_0x999b[137],_0x5efax28)})}})[_0x999b[67]](function(_0x5efax1f){logger[_0x999b[66]](_0x999b[192],_0x5efax1f)})}}},agentUpdate:function(_0x5efax30){return function(){_0x5efax30[_0x999b[26]]= _0x999b[205];_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax30[_0x999b[131]]),_0x999b[137],_0x5efax30);_0x5efax16(_0x999b[127],_0x999b[137],_0x5efax30);_0x5efax16(_0x999b[126],_0x999b[137],_0x5efax30)}},console:function(_0x5efax31){_0x5efax16(_0x5efax31[_0x999b[206]],util[_0x999b[59]](_0x999b[207],_0x5efax31[_0x999b[112]]),_0x5efax31[_0x999b[208]])},realtimeQueueMembers:function(_0x5efax32){return function(){_[_0x999b[210]](params[_0x999b[62]][_0x999b[61]],function(_0x5efax1d,_0x5efax22){if(_[_0x999b[209]](_0x5efax32,_0x5efax22)){_[_0x999b[210]](_0x5efax1d[_0x999b[114]],function(_0x5efax30){_0x5efax16(_0x5efax22,_0x999b[174],_0x5efax30)})}})}},updateTriggers:function(_0x5efax31){return function(){return triggers[_0x999b[211]](_0x5efax31)}},queueAdd:function(_0x5efax33,_0x5efax34){return function(){if(_0x5efax33&& _0x5efax34){_[_0x999b[93]](_0x5efax33,function(_0x5efax20){_0x5efax16(null,util[_0x999b[59]](_0x999b[212],_0x5efax34),_0x5efax20[0])})}}},queueRemove:function(_0x5efax20,_0x5efax34){return function(){if(_0x5efax20&& _0x5efax34){_0x5efax16(null,util[_0x999b[59]](_0x999b[213],_0x5efax34),_0x5efax20)}}},checkTriggers:function(_0x5efax31){return function(){return triggers[_0x999b[214]](_0x5efax31)}},videoOn:function(_0x5efax1b){return function(){return triggers[_0x999b[215]](_0x5efax1b)}},inboundInit:function(){return function(){return BPromise[_0x999b[113]]()[_0x999b[92]](_0x5efax1e())}},outboundInit:function(){return function(){return BPromise[_0x999b[113]]()[_0x999b[92]](_0x5efax25())}},reportFaxUpdate:function(_0x5efax35){return function(){_0x5efax35[_0x999b[26]]= _0x999b[216];_0x5efax16(util[_0x999b[59]](_0x999b[122],_0x5efax35[_0x999b[217]]),_0x999b[137],_0x5efax35);_0x5efax16(_0x999b[126],_0x999b[218],_0x5efax35)}},widgetValues:function(_0x5efax36,_0x5efax29){return function(){_[_0x999b[210]](_0x5efax36,function(_0x5efax37,_0x5efax38){_0x5efax16(util[_0x999b[59]](_0x999b[135],_0x5efax29[_0x999b[136]],_0x5efax29[_0x999b[131]]),_0x999b[219]+ _0x5efax38,_0x5efax37)})}},receivefax:function(_0x5efax1b){return function(_0x5efax31){if(_0x5efax31){return triggers[_0x999b[220]](_0x5efax31)};return null}}}}
\ No newline at end of file
+var _0xc593=["\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","\x61\x6D\x69","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\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","\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","\x69\x6E\x66\x6F","\x69\x64","\x73\x74\x61\x74\x65","\x61\x73\x73\x69\x67\x6E","\x64\x65\x76\x69\x63\x65\x73\x74\x61\x74\x65\x63\x68\x61\x6E\x67\x65","\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","\x65\x78\x74\x72\x61\x76\x61\x72","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\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","\x61\x67\x65\x6E\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","\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65","\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\x67\x65\x6E\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","\x61\x67\x65\x6E\x74\x72\x69\x6E\x67\x6E\x6F\x61\x6E\x73\x77\x65\x72","\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","\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","\x72\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x6C\x61\x73\x74\x65\x76\x65\x6E\x74","\x5F\x63\x68\x61\x6E\x67\x65\x64","\x6F\x72\x69\x67\x69\x6E\x61\x6C\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x61\x62\x61\x6E\x64\x6F\x6E","\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","\x6D\x65\x72\x67\x65","\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","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x61\x67\x65\x6E\x74\x75\x70\x64\x61\x74\x65","\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","\x76\x69\x64\x65\x6F\x4F\x6E","\x72\x65\x70\x6F\x72\x74\x66\x61\x78\x75\x70\x64\x61\x74\x65","\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","\x77\x69\x64\x67\x65\x74\x5F\x75\x70\x64\x61\x74\x65\x3A","\x72\x65\x63\x65\x69\x76\x65\x66\x61\x78"];_0xc593[0];var _=require(_0xc593[1]);var util=require(_0xc593[2]);var moment=require(_0xc593[3]);var BPromise=require(_0xc593[4]);var redis=require(_0xc593[5]);var VoiceQueue=require(_0xc593[7])[_0xc593[6]];var ReportQueue=require(_0xc593[7])[_0xc593[8]];var ReportCall=require(_0xc593[7])[_0xc593[9]];var ReportAgent=require(_0xc593[7])[_0xc593[10]];var ReportDial=require(_0xc593[7])[_0xc593[11]];var ReportMember=require(_0xc593[7])[_0xc593[12]];var User=require(_0xc593[7])[_0xc593[13]];var Triggers=require(_0xc593[14]);var config=require(_0xc593[15]);var logger=require(_0xc593[17])(_0xc593[16]);var utils=require(_0xc593[18]);var redisConf;if(config[_0xc593[19]]){redisConf= {password:config[_0xc593[19]]}};var redisClient=redis[_0xc593[21]](6379,config[_0xc593[20]],redisConf);var io=require(_0xc593[22])(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[_0xc593[23]]= function(){var _0xbaf6x16=function(_0xbaf6x17,_0xbaf6x18,_0xbaf6x19){if(_0xbaf6x17){io[_0xc593[25]](_0xbaf6x17)[_0xc593[24]](_0xbaf6x18,_0xbaf6x19)}else {io[_0xc593[24]](_0xbaf6x18,_0xbaf6x19)}};var _0xbaf6x1a=function(_0xbaf6x1b){delete _0xbaf6x1b[_0xc593[26]];delete _0xbaf6x1b[_0xc593[27]];delete _0xbaf6x1b[_0xc593[28]];delete _0xbaf6x1b[_0xc593[29]];_0xbaf6x1b[_0xc593[30]]= _0xbaf6x1b[_0xc593[31]]|| _0xbaf6x1b[_0xc593[30]];_0xbaf6x1b[_0xc593[32]]= _0xbaf6x1b[_0xc593[33]];_0xbaf6x1b[_0xc593[34]]= _0xc593[35];switch(_0xbaf6x1b[_0xc593[53]]){case _0xc593[36]:_0xbaf6x1b[_0xc593[34]]= _0xc593[35];break;case _0xc593[38]:_0xbaf6x1b[_0xc593[34]]= _0xc593[37];break;case _0xc593[40]:_0xbaf6x1b[_0xc593[34]]= _0xc593[39];break;case _0xc593[42]:_0xbaf6x1b[_0xc593[34]]= _0xc593[41];break;case _0xc593[44]:_0xbaf6x1b[_0xc593[34]]= _0xc593[43];break;case _0xc593[46]:_0xbaf6x1b[_0xc593[34]]= _0xc593[45];break;case _0xc593[48]:_0xbaf6x1b[_0xc593[34]]= _0xc593[47];break;case _0xc593[50]:_0xbaf6x1b[_0xc593[34]]= _0xc593[49];break;case _0xc593[52]:_0xbaf6x1b[_0xc593[34]]= _0xc593[51];break;default:};_0xbaf6x1b[_0xc593[53]]= Number(_0xbaf6x1b[_0xc593[53]]);if(_0xbaf6x1b[_0xc593[55]](_0xc593[54])){_0xbaf6x1b[_0xc593[54]]= Number(_0xbaf6x1b[_0xc593[54]])};if(_0xbaf6x1b[_0xc593[55]](_0xc593[56])){_0xbaf6x1b[_0xc593[56]]= Number(_0xbaf6x1b[_0xc593[56]])};if(_0xbaf6x1b[_0xc593[55]](_0xc593[57])){if(_0xbaf6x1b[_0xc593[57]]=== _0xc593[36]){_0xbaf6x1b[_0xc593[57]]= null}else {_0xbaf6x1b[_0xc593[57]]= moment()[_0xc593[59]](_0xc593[58])}};_0xbaf6x1b[_0xc593[60]]= parseInt(_0xbaf6x1b[_0xc593[60]],10)?true:false};function _0xbaf6x1c(_0xbaf6x1d){if(!params[_0xc593[62]][_0xc593[61]][_0xbaf6x1d]){params[_0xc593[62]][_0xc593[61]][_0xbaf6x1d]= {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 _0xbaf6x1e(){return function(){params[_0xc593[62]][_0xc593[61]]= {};params[_0xc593[62]][_0xc593[63]]= {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[_0xc593[97]]({attributes:[_0xc593[31]],raw:true})[_0xc593[92]](function(_0xbaf6x20){if(_0xbaf6x20){_[_0xc593[93]](_0xbaf6x20,function(_0xbaf6x1d){_0xbaf6x1c(_0xbaf6x1d[_0xc593[31]])});return ReportQueue[_0xc593[97]]({attributes:[_0xc593[69],_0xc593[79],_0xc593[82],_0xc593[94],_0xc593[95],_0xc593[96],_0xc593[77]],raw:true})}})[_0xc593[92]](function(_0xbaf6x20){if(_0xbaf6x20){var _0xbaf6x21;var _0xbaf6x22;var _0xbaf6x23=_0xbaf6x20[_0xc593[68]];for(var _0xbaf6x24=0;_0xbaf6x24< _0xbaf6x23;_0xbaf6x24++){_0xbaf6x21= _0xbaf6x20[_0xbaf6x24];_0xbaf6x22= _0xbaf6x21[_0xc593[69]];_0xbaf6x1c(_0xbaf6x22);params[_0xc593[62]][_0xc593[63]][_0xc593[70]]++;params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[70]]++;if(utils[_0xc593[71]](_0xbaf6x21)){params[_0xc593[62]][_0xc593[63]][_0xc593[72]]++;params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[72]]++};if(utils[_0xc593[73]](_0xbaf6x21)){params[_0xc593[62]][_0xc593[63]][_0xc593[74]]++;params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[74]]++};if(utils[_0xc593[75]](_0xbaf6x21)){params[_0xc593[62]][_0xc593[63]][_0xc593[76]]++;params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[76]]++;params[_0xc593[62]][_0xc593[63]][_0xc593[77]]+= _0xbaf6x21[_0xc593[77]]|| 0;params[_0xc593[62]][_0xc593[63]][_0xc593[78]]+= moment(_0xbaf6x21[_0xc593[82]])[_0xc593[81]](moment(_0xbaf6x21[_0xc593[79]]),_0xc593[80]);params[_0xc593[62]][_0xc593[63]][_0xc593[83]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[77]]/ params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[76]]);params[_0xc593[62]][_0xc593[63]][_0xc593[85]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[78]]/ params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[76]]);params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[77]]+= _0xbaf6x21[_0xc593[77]]|| 0;params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[78]]+= moment(_0xbaf6x21[_0xc593[82]])[_0xc593[81]](moment(_0xbaf6x21[_0xc593[79]]),_0xc593[80]);params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[83]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[77]]/ params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[76]]);params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[85]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[78]]/ params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[76]])};if(utils[_0xc593[86]](_0xbaf6x21)){params[_0xc593[62]][_0xc593[63]][_0xc593[87]]++;params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[87]]++};if(utils[_0xc593[88]](_0xbaf6x21)){params[_0xc593[62]][_0xc593[63]][_0xc593[89]]++;params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[89]]++};params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[90]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[76]]/ (params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[76]]+ params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[87]])* 100,2);params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[91]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[87]]/ (params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[76]]+ params[_0xc593[62]][_0xc593[61]][_0xbaf6x22][_0xc593[87]])* 100,2);params[_0xc593[62]][_0xc593[63]][_0xc593[90]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[63]][_0xc593[76]]/ (params[_0xc593[62]][_0xc593[63]][_0xc593[76]]+ params[_0xc593[62]][_0xc593[63]][_0xc593[87]])* 100,2);params[_0xc593[62]][_0xc593[63]][_0xc593[91]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[63]][_0xc593[87]]/ (params[_0xc593[62]][_0xc593[63]][_0xc593[76]]+ params[_0xc593[62]][_0xc593[63]][_0xc593[87]])* 100,2)}}})[_0xc593[67]](function(_0xbaf6x1f){logger[_0xc593[66]](_0xc593[64],_0xbaf6x1f[_0xc593[65]])})}}function _0xbaf6x25(){return function(){params[_0xc593[98]][_0xc593[63]]= {total:0,answered:0,sumDuration:0,avgDuration:0,tigerdial:0,answerRate:0};return ReportCall[_0xc593[97]]({where:{type:[_0xc593[98],_0xc593[101]],createdAt:{$gte:moment()[_0xc593[111]](_0xc593[110])}},attributes:[_0xc593[112],_0xc593[104],_0xc593[107]],raw:true})[_0xc593[92]](function(_0xbaf6x20){if(_0xbaf6x20){var _0xbaf6x26=_[_0xc593[100]](_0xbaf6x20,{type:_0xc593[98]});var _0xbaf6x27=_[_0xc593[100]](_0xbaf6x20,{type:_0xc593[101]});if(_0xbaf6x26[_0xc593[68]]){params[_0xc593[98]][_0xc593[63]][_0xc593[70]]= _0xbaf6x26[_0xc593[68]];params[_0xc593[98]][_0xc593[63]][_0xc593[102]]= _[_0xc593[105]](_0xbaf6x26,_0xc593[104])[_0xc593[103]]|| 0;params[_0xc593[98]][_0xc593[63]][_0xc593[106]]= _[_0xc593[108]](_0xbaf6x26,_0xc593[107]);if(params[_0xc593[98]][_0xc593[63]][_0xc593[102]]){params[_0xc593[98]][_0xc593[63]][_0xc593[109]]= _[_0xc593[84]]((_[_0xc593[108]](_0xbaf6x26,_0xc593[107])/ params[_0xc593[98]][_0xc593[63]][_0xc593[102]]));params[_0xc593[98]][_0xc593[63]][_0xc593[90]]= _[_0xc593[84]](params[_0xc593[98]][_0xc593[63]][_0xc593[102]]/ params[_0xc593[98]][_0xc593[63]][_0xc593[70]]* 100,1)}};if(_0xbaf6x27[_0xc593[68]]){params[_0xc593[98]][_0xc593[63]][_0xc593[101]]= _0xbaf6x27[_0xc593[68]]}}})[_0xc593[67]](function(_0xbaf6x1f){logger[_0xc593[66]](_0xc593[99],_0xbaf6x1f[_0xc593[65]])})}}BPromise[_0xc593[113]]()[_0xc593[92]](_0xbaf6x1e())[_0xc593[92]](_0xbaf6x25());return {cdr:function(_0xbaf6x1b){return function(_0xbaf6x20){_0xbaf6x16(_0xc593[114],_0xc593[115],_0xbaf6x1b);if(_0xbaf6x1b[_0xc593[112]]== _0xc593[98]|| _0xbaf6x1b[_0xc593[112]]== _0xc593[101]){if(_0xbaf6x1b[_0xc593[112]]== _0xc593[98]){params[_0xc593[98]][_0xc593[63]][_0xc593[70]]++;_0xbaf6x1b[_0xc593[104]]== _0xc593[103]&& (params[_0xc593[98]][_0xc593[63]][_0xc593[102]]++);params[_0xc593[98]][_0xc593[63]][_0xc593[106]]+= Number(_0xbaf6x1b[_0xc593[107]]);if(params[_0xc593[98]][_0xc593[63]][_0xc593[102]]){params[_0xc593[98]][_0xc593[63]][_0xc593[109]]= _[_0xc593[84]](params[_0xc593[98]][_0xc593[63]][_0xc593[106]]/ params[_0xc593[98]][_0xc593[63]][_0xc593[102]]);params[_0xc593[98]][_0xc593[63]][_0xc593[90]]= _[_0xc593[84]](params[_0xc593[98]][_0xc593[63]][_0xc593[102]]/ params[_0xc593[98]][_0xc593[63]][_0xc593[70]]* 100,1)}}else {params[_0xc593[98]][_0xc593[63]][_0xc593[101]]++};_0xbaf6x16(_0xc593[116],_0xc593[117],params[_0xc593[98]][_0xc593[63]])}}},send:function(_0xbaf6x1b){return function(_0xbaf6x20){return BPromise[_0xc593[113]]()}},hangup:function(_0xbaf6x1b){return function(_0xbaf6x20){if(params[_0xc593[98]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]]){delete params[_0xc593[98]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]]};if(params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]]){delete params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]]};var _0xbaf6x28={uniqueid:_0xbaf6x1b[_0xc593[118]],linkedid:_0xbaf6x1b[_0xc593[120]],endtime:moment()[_0xc593[59]](_0xc593[58]),lastevent:_0xc593[121],updatedAt:moment()[_0xc593[59]](_0xc593[58])};_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x1b[_0xc593[124]][_0xc593[123]](/\/|-/)[1]),_0xc593[125],_0xbaf6x28);_0xbaf6x16(_0xc593[126],_0xc593[125],_0xbaf6x28);_0xbaf6x16(_0xc593[127],_0xc593[125],_0xbaf6x28);if(_0xbaf6x20){triggers[_0xc593[128]](_0xbaf6x20)};return BPromise[_0xc593[113]]()}},devicestatechange:function(_0xbaf6x1b){return function(_0xbaf6x20){return User[_0xc593[142]]({where:{name:_0xbaf6x1b[_0xc593[141]][_0xc593[140]](_0xc593[138],_0xc593[139])},raw:true})[_0xc593[92]](function(_0xbaf6x29){if(_0xbaf6x29){var _0xbaf6x28=_[_0xc593[133]]({newValues:{id:_0xbaf6x29[_0xc593[131]],status:_0xbaf6x1b[_0xc593[132]],statusAt:moment()[_0xc593[59]](_0xc593[58])}},_0xbaf6x29,{status:_0xbaf6x1b[_0xc593[132]],statusAt:moment()[_0xc593[59]](_0xc593[58])});_0xbaf6x28[_0xc593[26]]= _0xc593[134];_0xbaf6x16(util[_0xc593[59]](_0xc593[135],_0xbaf6x29[_0xc593[136]],_0xbaf6x29[_0xc593[131]]),_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[127],_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[126],_0xc593[137],_0xbaf6x28)}})[_0xc593[67]](function(_0xbaf6x1f){logger[_0xc593[130]](_0xc593[129],_0xbaf6x1f)})}},peerstatus:function(_0xbaf6x1b){return function(_0xbaf6x20){if(_0xbaf6x20&& _0xbaf6x20[0]){_[_0xc593[93]](_0xbaf6x20[1],function(_0xbaf6x2a){if(!params[_0xc593[143]][_0xbaf6x2a[_0xc593[31]]]){params[_0xc593[143]][_0xbaf6x2a[_0xc593[31]]]= {name:_0xbaf6x2a[_0xc593[31]]}};params[_0xc593[143]][_0xbaf6x2a[_0xc593[31]]][_0xc593[144]]= _0xbaf6x1b[_0xc593[144]];_0xbaf6x16(_0xc593[145],_0xc593[146],params[_0xc593[143]][_0xbaf6x2a[_0xc593[31]]])})};return BPromise[_0xc593[113]]()}},registry:function(_0xbaf6x1b){return function(_0xbaf6x20){if(_0xbaf6x20&& _0xbaf6x20[0]){_[_0xc593[93]](_0xbaf6x20[1],function(_0xbaf6x2a){if(!params[_0xc593[143]][_0xbaf6x2a[_0xc593[31]]]){params[_0xc593[143]][_0xbaf6x2a[_0xc593[31]]]= {name:_0xbaf6x2a[_0xc593[31]]}};params[_0xc593[143]][_0xbaf6x2a[_0xc593[31]]][_0xc593[53]]= _0xbaf6x1b[_0xc593[53]];_0xbaf6x16(_0xc593[145],_0xc593[146],params[_0xc593[143]][_0xbaf6x2a[_0xc593[31]]])})};return BPromise[_0xc593[113]]()}},agentcalled:function(_0xbaf6x1b){return function(_0xbaf6x20){if(_0xbaf6x20){_0xbaf6x1b[_0xc593[147]]&& (_0xbaf6x20[_0xc593[148]][_0xc593[147]]= _0xbaf6x1b[_0xc593[147]]);_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x20[_0xc593[30]]),_0xc593[149],_0xbaf6x20);triggers[_0xc593[150]](_0xbaf6x20)};return User[_0xc593[142]]({where:{name:_0xbaf6x1b[_0xc593[30]],voicePause:false},raw:true})[_0xc593[92]](function(_0xbaf6x29){if(_0xbaf6x29){var _0xbaf6x2b=moment()[_0xc593[59]](_0xc593[58]);var _0xbaf6x28=_[_0xc593[133]]({newValues:{id:_0xbaf6x29[_0xc593[131]],queueStatus:_0xc593[152],queueStatusAt:_0xbaf6x2b,lastQueue:_0xbaf6x1b[_0xc593[69]]}},_0xbaf6x29,{queueStatus:_0xc593[152],queueStatusAt:_0xbaf6x2b,lastQueue:_0xbaf6x1b[_0xc593[69]]});_0xbaf6x28[_0xc593[26]]= _0xc593[153];_0xbaf6x16(util[_0xc593[59]](_0xc593[135],_0xbaf6x29[_0xc593[136]],_0xbaf6x29[_0xc593[131]]),_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[127],_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[126],_0xc593[137],_0xbaf6x28)}})[_0xc593[67]](function(_0xbaf6x1f){logger[_0xc593[66]](_0xc593[151],_0xbaf6x1f)})}},agentcomplete:function(_0xbaf6x1b){return function(_0xbaf6x20){if(_0xbaf6x20){triggers[_0xc593[154]](_0xbaf6x20)};if(params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[74]]){params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[74]]--};if(params[_0xc593[62]][_0xc593[63]][_0xc593[74]]){params[_0xc593[62]][_0xc593[63]][_0xc593[74]]--;_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[155],{type:_0xc593[74],amount:-1,queue:_0xbaf6x1b[_0xc593[69]]})};params[_0xc593[62]][_0xc593[63]][_0xc593[76]]++;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[76]]++;_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[155],{type:_0xc593[121],amount:1,queue:_0xbaf6x1b[_0xc593[69]]});params[_0xc593[62]][_0xc593[63]][_0xc593[90]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[63]][_0xc593[76]]/ (params[_0xc593[62]][_0xc593[63]][_0xc593[76]]+ params[_0xc593[62]][_0xc593[63]][_0xc593[87]])* 100,2);params[_0xc593[62]][_0xc593[63]][_0xc593[91]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[63]][_0xc593[87]]/ (params[_0xc593[62]][_0xc593[63]][_0xc593[76]]+ params[_0xc593[62]][_0xc593[63]][_0xc593[87]])* 100,2);params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[90]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[76]]/ (params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[76]]+ params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[87]])* 100,2);params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[91]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[87]]/ (params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[76]]+ params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[87]])* 100,2);params[_0xc593[62]][_0xc593[63]][_0xc593[78]]+= Number(_0xbaf6x1b[_0xc593[78]]);params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[78]]+= Number(_0xbaf6x1b[_0xc593[78]]);_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[155],{type:_0xc593[78],amount:Number(_0xbaf6x1b[_0xc593[78]]),queue:_0xbaf6x1b[_0xc593[69]]});params[_0xc593[62]][_0xc593[63]][_0xc593[85]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[63]][_0xc593[78]]/ params[_0xc593[62]][_0xc593[63]][_0xc593[76]]);params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[85]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[78]]/ params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[76]]);params[_0xc593[62]][_0xc593[63]][_0xc593[77]]+= Number(_0xbaf6x1b[_0xc593[77]]);params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[77]]+= Number(_0xbaf6x1b[_0xc593[77]]);_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[155],{type:_0xc593[77],amount:Number(_0xbaf6x1b[_0xc593[77]]),queue:_0xbaf6x1b[_0xc593[69]]});params[_0xc593[62]][_0xc593[63]][_0xc593[83]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[63]][_0xc593[77]]/ params[_0xc593[62]][_0xc593[63]][_0xc593[76]]);params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[83]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[77]]/ params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[76]]);var _0xbaf6x28;var _0xbaf6x2b=moment()[_0xc593[59]](_0xc593[58]);return ReportAgent[_0xc593[142]]({where:{uniqueid:_0xbaf6x1b[_0xc593[118]],destuniqueid:_0xbaf6x1b[_0xc593[162]]},raw:true})[_0xc593[92]](function(_0xbaf6x2c){if(_0xbaf6x2c){_0xbaf6x28= _[_0xc593[133]]({},_0xbaf6x2c,{lastevent:_0xc593[121],agentcomplete:true,agentcompleteAt:_0xbaf6x2b,talktime:Number(_0xbaf6x1b[_0xc593[78]]),reason:_0xbaf6x1b[_0xc593[159]]});_0xbaf6x1b[_0xc593[147]]&& (_0xbaf6x28[_0xc593[147]]= _0xbaf6x1b[_0xc593[147]]);_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x2c[_0xc593[30]]),_0xc593[160],_0xbaf6x28)};return ReportQueue[_0xc593[142]]({where:{uniqueid:_0xbaf6x1b[_0xc593[118]]},order:_0xc593[161],raw:true})})[_0xc593[92]](function(_0xbaf6x2c){if(_0xbaf6x2c){_0xbaf6x28= _[_0xc593[133]]({},_0xbaf6x2c,{queuecallercomplete:true,queuecallercompleteAt:_0xbaf6x2b});_0xbaf6x16(_0xbaf6x2c[_0xc593[69]],_0xc593[158],_0xbaf6x28)};return User[_0xc593[142]]({where:{name:_0xbaf6x1b[_0xc593[30]]},raw:true})})[_0xc593[92]](function(_0xbaf6x29){if(_0xbaf6x29){var _0xbaf6x28=_[_0xc593[133]]({newValues:{id:_0xbaf6x29[_0xc593[131]],queueStatus:_0xc593[121],queueStatusAt:_0xbaf6x2b,lastQueue:_0xbaf6x1b[_0xc593[69]]}},_0xbaf6x29,{queueStatus:_0xc593[121],queueStatusAt:_0xbaf6x2b,lastQueue:_0xbaf6x1b[_0xc593[69]]});_0xbaf6x28[_0xc593[26]]= _0xc593[157];_0xbaf6x16(util[_0xc593[59]](_0xc593[135],_0xbaf6x29[_0xc593[136]],_0xbaf6x29[_0xc593[131]]),_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[127],_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[126],_0xc593[137],_0xbaf6x28)}})[_0xc593[67]](function(_0xbaf6x1f){logger[_0xc593[66]](_0xc593[156],_0xbaf6x1f)})}},agentconnect:function(_0xbaf6x1b){return function(_0xbaf6x20){if(_0xbaf6x20){triggers[_0xc593[154]](_0xbaf6x20)};if(params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[72]]){params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[72]]--;_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[155],{type:_0xc593[72],amount:-1,queue:_0xbaf6x1b[_0xc593[69]]})};if(params[_0xc593[62]][_0xc593[63]][_0xc593[72]]){params[_0xc593[62]][_0xc593[63]][_0xc593[72]]--};if(params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]]){params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]][_0xc593[163]]= _0xbaf6x1b[_0xc593[164]];params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]][_0xc593[165]]= _0xbaf6x1b[_0xc593[165]];params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]][_0xc593[77]]= Number(_0xbaf6x1b[_0xc593[77]]);params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]][_0xc593[166]]= Number(_0xbaf6x1b[_0xc593[166]]);params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]][_0xc593[32]]= _0xbaf6x1b[_0xc593[32]];params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]][_0xc593[30]]= _0xbaf6x1b[_0xc593[30]]};params[_0xc593[62]][_0xc593[63]][_0xc593[74]]++;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[74]]++;_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[155],{type:_0xc593[74],amount:1,queue:_0xbaf6x1b[_0xc593[69]]});var _0xbaf6x28;var _0xbaf6x2b=moment()[_0xc593[59]](_0xc593[58]);return ReportQueue[_0xc593[142]]({where:{uniqueid:_0xbaf6x1b[_0xc593[118]]},order:_0xc593[161],raw:true})[_0xc593[92]](function(_0xbaf6x2c){if(_0xbaf6x2c){_0xbaf6x28= _[_0xc593[133]]({},_0xbaf6x2c,{queuecallerleaveAt:moment()[_0xc593[59]](_0xc593[58]),holdtime:_0xbaf6x1b[_0xc593[77]],assigned:true,lastAssignedTo:_0xbaf6x1b[_0xc593[30]]});_0xbaf6x16(_0xbaf6x2c[_0xc593[69]],_0xc593[158],_0xbaf6x28)};return ReportAgent[_0xc593[142]]({where:{uniqueid:_0xbaf6x1b[_0xc593[118]],destuniqueid:_0xbaf6x1b[_0xc593[162]]},raw:true})})[_0xc593[92]](function(_0xbaf6x2c){if(_0xbaf6x2c){_0xbaf6x28= _[_0xc593[133]]({},_0xbaf6x2c,{lastevent:_0xc593[168],agentconnectAt:moment()[_0xc593[59]](_0xc593[58]),holdtime:_0xbaf6x1b[_0xc593[77]]});_0xbaf6x1b[_0xc593[147]]&& (_0xbaf6x28[_0xc593[147]]= _0xbaf6x1b[_0xc593[147]]);_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x2c[_0xc593[30]]),_0xc593[160],_0xbaf6x28)};return ReportAgent[_0xc593[97]]({where:{uniqueid:_0xbaf6x1b[_0xc593[118]],destuniqueid:{$ne:_0xbaf6x1b[_0xc593[162]]},reason:null},raw:true})})[_0xc593[92]](function(_0xbaf6x2e){if(_0xbaf6x2e&& _0xbaf6x2e[_0xc593[68]]){_[_0xc593[93]](_0xbaf6x2e,function(_0xbaf6x2c){_0xbaf6x28= _[_0xc593[133]]({},_0xbaf6x2c,{lastevent:_0xc593[170],agentringnoanswer:true,agentringnoanswerAt:_0xbaf6x2b,reason:_0xc593[170],answeredelsewheredestinationuniqueid:_0xbaf6x1b[_0xc593[162]],answeredelsewheremembername:_0xbaf6x1b[_0xc593[30]]});_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x2c[_0xc593[30]]),_0xc593[160],_0xbaf6x28)})};return User[_0xc593[142]]({where:{name:_0xbaf6x1b[_0xc593[30]]},raw:true})})[_0xc593[92]](function(_0xbaf6x29){if(_0xbaf6x29){var _0xbaf6x28=_[_0xc593[133]]({newValues:{id:_0xbaf6x29[_0xc593[131]],queueStatus:_0xc593[168],queueStatusAt:_0xbaf6x2b,lastQueue:_0xbaf6x1b[_0xc593[69]]}},_0xbaf6x29,{queueStatus:_0xc593[168],queueStatusAt:_0xbaf6x2b,lastQueue:_0xbaf6x1b[_0xc593[69]]});_0xbaf6x28[_0xc593[26]]= _0xc593[169];_0xbaf6x16(util[_0xc593[59]](_0xc593[135],_0xbaf6x29[_0xc593[136]],_0xbaf6x29[_0xc593[131]]),_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[127],_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[126],_0xc593[137],_0xbaf6x28)};return User[_0xc593[97]]({where:{lastQueue:_0xbaf6x1b[_0xc593[69]],name:{$ne:_0xbaf6x1b[_0xc593[30]]}},raw:true})})[_0xc593[92]](function(_0xbaf6x2d){if(_0xbaf6x2d&& _0xbaf6x2d[_0xc593[68]]){_[_0xc593[93]](_0xbaf6x2d,function(_0xbaf6x29){var _0xbaf6x28=_[_0xc593[133]]({newValues:{id:_0xbaf6x29[_0xc593[131]],queueStatus:_0xc593[121],queueStatusAt:_0xbaf6x2b}},_0xbaf6x29,{queueStatus:_0xc593[121],queueStatusAt:_0xbaf6x2b});_0xbaf6x16(util[_0xc593[59]](_0xc593[135],_0xbaf6x29[_0xc593[136]],_0xbaf6x29[_0xc593[131]]),_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[127],_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[126],_0xc593[137],_0xbaf6x28)})}})[_0xc593[67]](function(_0xbaf6x1f){logger[_0xc593[66]](_0xc593[167],_0xbaf6x1f)})}},agentringnoanswer:function(_0xbaf6x1b){return function(_0xbaf6x20){if(_0xbaf6x20){triggers[_0xc593[154]](_0xbaf6x20)};var _0xbaf6x28;var _0xbaf6x2b=moment()[_0xc593[59]](_0xc593[58]);return User[_0xc593[142]]({where:{name:_0xbaf6x1b[_0xc593[30]]},raw:true})[_0xc593[92]](function(_0xbaf6x29){if(_0xbaf6x29){var _0xbaf6x28=_[_0xc593[133]]({newValues:{id:_0xbaf6x29[_0xc593[131]],queueStatus:_0xc593[121],queueStatusAt:_0xbaf6x2b,lastQueue:_0xbaf6x1b[_0xc593[69]]}},_0xbaf6x29,{queueStatus:_0xc593[121],queueStatusAt:_0xbaf6x2b,lastQueue:_0xbaf6x1b[_0xc593[69]]});_0xbaf6x28[_0xc593[26]]= _0xc593[173];_0xbaf6x16(util[_0xc593[59]](_0xc593[135],_0xbaf6x29[_0xc593[136]],_0xbaf6x29[_0xc593[131]]),_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[127],_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[126],_0xc593[137],_0xbaf6x28)};return ReportAgent[_0xc593[142]]({where:{uniqueid:_0xbaf6x1b[_0xc593[118]],destuniqueid:_0xbaf6x1b[_0xc593[162]]},raw:true})})[_0xc593[92]](function(_0xbaf6x2c){if(_0xbaf6x2c){_0xbaf6x28= _[_0xc593[133]]({},_0xbaf6x2c,{lastevent:_0xc593[172],agentringnoanswer:true,agentringnoanswerAt:moment()[_0xc593[59]](_0xc593[58]),reason:_0xc593[172]});_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x2c[_0xc593[30]]),_0xc593[160],_0xbaf6x28)}})[_0xc593[67]](function(_0xbaf6x1f){logger[_0xc593[66]](_0xc593[171],_0xbaf6x1f)})}},queuememberadded:function(_0xbaf6x1b){return function(_0xbaf6x20){if(_0xbaf6x20){_0xbaf6x16(_0xbaf6x20[_0xc593[69]],_0xc593[174],_0xbaf6x20);_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x20.UserId),_0xc593[174],_0xbaf6x20)};return BPromise[_0xc593[113]]()}},queuememberremoved:function(_0xbaf6x1b){return function(_0xbaf6x20){if(params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]]){delete params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[114]][_0xbaf6x1b[_0xc593[30]]]};return User[_0xc593[142]]({where:{name:_0xbaf6x1b[_0xc593[32]][_0xc593[140]](_0xc593[138],_0xc593[139])},raw:true})[_0xc593[92]](function(_0xbaf6x29){if(_0xbaf6x29){_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[176],{queue:_0xbaf6x1b[_0xc593[69]],UserId:_0xbaf6x29[_0xc593[131]]});_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x29[_0xc593[131]]),_0xc593[176],{queue:_0xbaf6x1b[_0xc593[69]],UserId:_0xbaf6x29[_0xc593[131]]})}})[_0xc593[67]](function(_0xbaf6x1f){logger[_0xc593[66]](_0xc593[175],_0xbaf6x1f)})}},queuememberpause:function(_0xbaf6x1b){return function(_0xbaf6x20){if(_0xbaf6x20){_0xbaf6x16(_0xbaf6x20[_0xc593[69]],_0xc593[174],_0xbaf6x20);_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x20.UserId),_0xc593[174],_0xbaf6x20)}}},queuememberpenalty:function(_0xbaf6x1b){return function(_0xbaf6x20){return BPromise[_0xc593[113]]()}},queuememberringinuse:function(_0xbaf6x1b){return function(_0xbaf6x20){return BPromise[_0xc593[113]]()}},queuemember:function(_0xbaf6x1b){return function(_0xbaf6x20){_0xbaf6x1a(_0xbaf6x1b);_0xbaf6x1c(_0xbaf6x1b[_0xc593[69]]);params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[114]][_0xbaf6x1b[_0xc593[31]]]= _0xbaf6x1b;return BPromise[_0xc593[113]]()}},queuecallerjoin:function(_0xbaf6x1b){return function(_0xbaf6x20){if(!params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]]){params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]]= {};params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[72]]= 0;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[74]]= 0;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[76]]= 0;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[87]]= 0;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[89]]= 0;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[77]]= 0;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[78]]= 0;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[83]]= 0;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[85]]= 0;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[90]]= 0;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[91]]= 0;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[70]]= 0};params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]]= {channel:_0xbaf6x1b[_0xc593[124]],channelstate:Number(_0xbaf6x1b[_0xc593[177]]),channelstatedesc:_0xbaf6x1b[_0xc593[178]],calleridnum:_0xbaf6x1b[_0xc593[179]],calleridname:_0xbaf6x1b[_0xc593[180]],exten:_0xbaf6x1b[_0xc593[181]],priority:Number(_0xbaf6x1b[_0xc593[182]]),uniqueid:_0xbaf6x1b[_0xc593[118]],queue:_0xbaf6x1b[_0xc593[69]],position:Number(_0xbaf6x1b[_0xc593[183]]),count:Number(_0xbaf6x1b[_0xc593[184]])};params[_0xc593[62]][_0xc593[63]][_0xc593[72]]++;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[72]]++;_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[155],{type:_0xc593[70],amount:1,queue:_0xbaf6x1b[_0xc593[69]]});params[_0xc593[62]][_0xc593[63]][_0xc593[70]]++;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[70]]++;_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[155],{type:_0xc593[72],amount:1,queue:_0xbaf6x1b[_0xc593[69]]});if(_0xbaf6x20){_0xbaf6x16(_0xbaf6x20[_0xc593[69]],_0xc593[185],_0xbaf6x20)};return BPromise[_0xc593[113]]()}},queuecallerabandon:function(_0xbaf6x1b){return function(_0xbaf6x20){if(_0xbaf6x20&& _0xbaf6x20[_0xc593[186]]&& _0xbaf6x20[_0xc593[186]][0]){_[_0xc593[93]](_0xbaf6x20[_0xc593[186]][1],function(_0xbaf6x2c){_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x2c[_0xc593[30]]),_0xc593[160],_0xbaf6x2c)})};if(_0xbaf6x20&& _0xbaf6x20[_0xc593[187]]){_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[158],_0xbaf6x20[_0xc593[187]]);_0xbaf6x20[_0xc593[187]][_0xc593[148]][_0xc593[188]]= _0xc593[87];_0xbaf6x20[_0xc593[187]][_0xc593[189]][_0xc593[188]]= true;triggers[_0xc593[154]](_0xbaf6x20[_0xc593[187]])};var _0xbaf6x28;var _0xbaf6x2b=moment()[_0xc593[59]](_0xc593[58]);if(params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[72]]){params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[72]]--;_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[155],{type:_0xc593[72],amount:-1,queue:_0xbaf6x1b[_0xc593[69]]})};if(params[_0xc593[62]][_0xc593[63]][_0xc593[72]]){params[_0xc593[62]][_0xc593[63]][_0xc593[72]]--};if(params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]]){params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]][_0xc593[77]]= Number(_0xbaf6x1b[_0xc593[77]]);params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]][_0xc593[183]]= Number(_0xbaf6x1b[_0xc593[183]]);params[_0xc593[62]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]][_0xc593[190]]= Number(_0xbaf6x1b[_0xc593[190]])};params[_0xc593[62]][_0xc593[63]][_0xc593[87]]++;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[87]]++;_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[155],{type:_0xc593[191],amount:1,queue:_0xbaf6x1b[_0xc593[69]]});params[_0xc593[62]][_0xc593[63]][_0xc593[90]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[63]][_0xc593[76]]/ (params[_0xc593[62]][_0xc593[63]][_0xc593[76]]+ params[_0xc593[62]][_0xc593[63]][_0xc593[87]])* 100,2);params[_0xc593[62]][_0xc593[63]][_0xc593[91]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[63]][_0xc593[87]]/ (params[_0xc593[62]][_0xc593[63]][_0xc593[76]]+ params[_0xc593[62]][_0xc593[63]][_0xc593[87]])* 100,2);params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[90]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[76]]/ (params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[76]]+ params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[87]])* 100,2);params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[91]]= _[_0xc593[84]](params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[87]]/ (params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[76]]+ params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[87]])* 100,2);return User[_0xc593[97]]({where:{lastQueue:_0xbaf6x1b[_0xc593[69]]},raw:true})[_0xc593[92]](function(_0xbaf6x2f){if(_0xbaf6x2f&& _0xbaf6x2f[_0xc593[68]]){var _0xbaf6x28;_[_0xc593[93]](_0xbaf6x2f,function(_0xbaf6x30){_0xbaf6x28= _[_0xc593[133]]({newValues:{id:_0xbaf6x30[_0xc593[131]],queueStatus:_0xc593[121],queueStatusAt:_0xbaf6x2b,lastQueue:_0xbaf6x1b[_0xc593[69]]}},_0xbaf6x30,{id:_0xbaf6x30[_0xc593[131]],queueStatus:_0xc593[121],queueStatusAt:_0xbaf6x2b,lastQueue:_0xbaf6x1b[_0xc593[69]]});_0xbaf6x28[_0xc593[26]]= _0xc593[95];_0xbaf6x16(util[_0xc593[59]](_0xc593[135],_0xbaf6x30[_0xc593[136]],_0xbaf6x30[_0xc593[131]]),_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[127],_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[126],_0xc593[137],_0xbaf6x28)})}})[_0xc593[67]](function(_0xbaf6x1f){logger[_0xc593[66]](_0xc593[192],_0xbaf6x1f)})}},blindtransfer:function(_0xbaf6x1b){return function(_0xbaf6x20){_0xbaf6x16(null,_0xbaf6x1b[_0xc593[26]][_0xc593[193]](),_0xbaf6x1b);return BPromise[_0xc593[113]]()}},attendedtransfer:function(_0xbaf6x1b){return function(_0xbaf6x20){_0xbaf6x16(null,_0xbaf6x1b[_0xc593[26]][_0xc593[193]](),_0xbaf6x1b);return BPromise[_0xc593[113]]()}},dialbegin:function(_0xbaf6x1b){return function(_0xbaf6x20){params[_0xc593[98]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]]= {channel:_0xbaf6x1b[_0xc593[124]],channelstate:Number(_0xbaf6x1b[_0xc593[177]]),channelstatedesc:_0xbaf6x1b[_0xc593[178]],calleridnum:_0xbaf6x1b[_0xc593[179]],calleridname:_0xbaf6x1b[_0xc593[180]],context:_0xbaf6x1b[_0xc593[194]],exten:_0xbaf6x1b[_0xc593[181]],priority:Number(_0xbaf6x1b[_0xc593[182]]),dialstring:_0xbaf6x1b[_0xc593[195]]};if(_0xbaf6x1b[_0xc593[124]]){var _0xbaf6x28=_[_0xc593[196]](_0xbaf6x1b,{starttime:moment()[_0xc593[59]](_0xc593[58]),lastevent:_0xc593[152],updatedAt:moment()[_0xc593[59]](_0xc593[58])});_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x1b[_0xc593[124]][_0xc593[123]](/\/|-/)[1]),_0xc593[197],_0xbaf6x28);_0xbaf6x16(_0xc593[127],_0xc593[125],_[_0xc593[196]](_0xbaf6x28,{role:_0xc593[127]}));_0xbaf6x16(_0xc593[126],_0xc593[125],_0xbaf6x28,_[_0xc593[196]](_0xbaf6x28,{role:_0xc593[126]}));if(_0xbaf6x20){triggers[_0xc593[128]](_0xbaf6x20)}};return BPromise[_0xc593[113]]()}},dialend:function(_0xbaf6x1b){return function(_0xbaf6x20){if(params[_0xc593[98]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]]){params[_0xc593[98]][_0xc593[119]][_0xbaf6x1b[_0xc593[118]]][_0xc593[198]]= _0xbaf6x1b[_0xc593[198]]};if(_0xbaf6x1b[_0xc593[124]]){var _0xbaf6x2b=moment()[_0xc593[59]](_0xc593[58]);var _0xbaf6x28={dialstatus:_0xbaf6x1b[_0xc593[198]],lastevent:(_0xbaf6x1b[_0xc593[198]]=== _0xc593[103])?_0xc593[168]:_0xc593[121],answertime:(_0xbaf6x1b[_0xc593[198]]=== _0xc593[103])?_0xbaf6x2b:null,uniqueid:_0xbaf6x1b[_0xc593[118]],linkedid:_0xbaf6x1b[_0xc593[120]],destuniqueid:_0xbaf6x1b[_0xc593[162]],destlinkedid:_0xbaf6x1b[_0xc593[199]],updatedAt:_0xbaf6x2b};_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x1b[_0xc593[124]][_0xc593[123]](/\/|-/)[1]),_0xc593[125],_0xbaf6x28);_0xbaf6x16(_0xc593[127],_0xc593[125],_0xbaf6x28);_0xbaf6x16(_0xc593[126],_0xc593[125],_0xbaf6x28);if(_0xbaf6x20){triggers[_0xc593[128]](_0xbaf6x20)}};return BPromise[_0xc593[113]]()}},varset:function(_0xbaf6x1b){return function(_0xbaf6x20){if(_0xbaf6x1b[_0xc593[201]][_0xc593[55]](_0xc593[200])){_0xbaf6x16(_0xc593[127],_0xc593[197],{uniqueid:_0xbaf6x1b[_0xc593[118]],routeId:_0xbaf6x1b[_0xc593[202]],updatedAt:moment()[_0xc593[59]](_0xc593[58])});_0xbaf6x16(_0xc593[126],_0xc593[197],{uniqueid:_0xbaf6x1b[_0xc593[118]],routeId:_0xbaf6x1b[_0xc593[202]],updatedAt:moment()[_0xc593[59]](_0xc593[58])})};if(_0xbaf6x1b){triggers[_0xc593[203]](_0xbaf6x1b)};return BPromise[_0xc593[113]]()}},queuecallerunmanaged:function(_0xbaf6x1b){return function(_0xbaf6x20){if(_0xbaf6x20){params[_0xc593[62]][_0xc593[63]][_0xc593[89]]+= 1;params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[89]]+= 1;_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[155],{type:_0xc593[89],amount:1,queue:_0xbaf6x1b[_0xc593[69]]});if(params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[72]]){params[_0xc593[62]][_0xc593[61]][_0xbaf6x1b[_0xc593[69]]][_0xc593[72]]-= 1};if(params[_0xc593[62]][_0xc593[63]][_0xc593[72]]){params[_0xc593[62]][_0xc593[63]][_0xc593[72]]-= 1;_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[155],{type:_0xc593[72],amount:-1,queue:_0xbaf6x1b[_0xc593[69]]})};_0xbaf6x16(_0xbaf6x1b[_0xc593[69]],_0xc593[158],_0xbaf6x20);var _0xbaf6x2b=moment()[_0xc593[59]](_0xc593[58]);return User[_0xc593[97]]({where:{lastQueue:_0xbaf6x1b[_0xc593[69]]},raw:true})[_0xc593[92]](function(_0xbaf6x2f){if(_0xbaf6x2f&& _0xbaf6x2f[_0xc593[68]]){var _0xbaf6x28;_[_0xc593[93]](_0xbaf6x2f,function(_0xbaf6x30){_0xbaf6x28= _[_0xc593[133]]({newValues:{id:_0xbaf6x30[_0xc593[131]],queueStatus:_0xc593[121],queueStatusAt:_0xbaf6x2b,lastQueue:_0xbaf6x1b[_0xc593[69]]}},_0xbaf6x30,{id:_0xbaf6x30[_0xc593[131]],queueStatus:_0xc593[121],queueStatusAt:_0xbaf6x2b,lastQueue:_0xbaf6x1b[_0xc593[69]]});_0xbaf6x28[_0xc593[26]]= _0xc593[204];_0xbaf6x16(util[_0xc593[59]](_0xc593[135],_0xbaf6x30[_0xc593[136]],_0xbaf6x30[_0xc593[131]]),_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[127],_0xc593[137],_0xbaf6x28);_0xbaf6x16(_0xc593[126],_0xc593[137],_0xbaf6x28)})}})[_0xc593[67]](function(_0xbaf6x1f){logger[_0xc593[66]](_0xc593[192],_0xbaf6x1f)})}}},agentUpdate:function(_0xbaf6x30){return function(){_0xbaf6x30[_0xc593[26]]= _0xc593[205];_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x30[_0xc593[131]]),_0xc593[137],_0xbaf6x30);_0xbaf6x16(_0xc593[127],_0xc593[137],_0xbaf6x30);_0xbaf6x16(_0xc593[126],_0xc593[137],_0xbaf6x30)}},console:function(_0xbaf6x31){_0xbaf6x16(_0xbaf6x31[_0xc593[206]],util[_0xc593[59]](_0xc593[207],_0xbaf6x31[_0xc593[112]]),_0xbaf6x31[_0xc593[208]])},realtimeQueueMembers:function(_0xbaf6x32){return function(){_[_0xc593[210]](params[_0xc593[62]][_0xc593[61]],function(_0xbaf6x1d,_0xbaf6x22){if(_[_0xc593[209]](_0xbaf6x32,_0xbaf6x22)){_[_0xc593[210]](_0xbaf6x1d[_0xc593[114]],function(_0xbaf6x30){_0xbaf6x16(_0xbaf6x22,_0xc593[174],_0xbaf6x30)})}})}},updateTriggers:function(_0xbaf6x31){return function(){return triggers[_0xc593[211]](_0xbaf6x31)}},queueAdd:function(_0xbaf6x33,_0xbaf6x34){return function(){if(_0xbaf6x33&& _0xbaf6x34){_[_0xc593[93]](_0xbaf6x33,function(_0xbaf6x20){_0xbaf6x16(null,util[_0xc593[59]](_0xc593[212],_0xbaf6x34),_0xbaf6x20[0])})}}},queueRemove:function(_0xbaf6x20,_0xbaf6x34){return function(){if(_0xbaf6x20&& _0xbaf6x34){_0xbaf6x16(null,util[_0xc593[59]](_0xc593[213],_0xbaf6x34),_0xbaf6x20)}}},checkTriggers:function(_0xbaf6x31){return function(){return triggers[_0xc593[214]](_0xbaf6x31)}},videoOn:function(_0xbaf6x1b){return function(){return triggers[_0xc593[215]](_0xbaf6x1b)}},inboundInit:function(){return function(){return BPromise[_0xc593[113]]()[_0xc593[92]](_0xbaf6x1e())}},outboundInit:function(){return function(){return BPromise[_0xc593[113]]()[_0xc593[92]](_0xbaf6x25())}},reportFaxUpdate:function(_0xbaf6x35){return function(){_0xbaf6x35[_0xc593[26]]= _0xc593[216];_0xbaf6x16(util[_0xc593[59]](_0xc593[122],_0xbaf6x35[_0xc593[217]]),_0xc593[137],_0xbaf6x35);_0xbaf6x16(_0xc593[126],_0xc593[218],_0xbaf6x35)}},widgetValues:function(_0xbaf6x36,_0xbaf6x29){return function(){_[_0xc593[210]](_0xbaf6x36,function(_0xbaf6x37,_0xbaf6x38){_0xbaf6x16(util[_0xc593[59]](_0xc593[135],_0xbaf6x29[_0xc593[136]],_0xbaf6x29[_0xc593[131]]),_0xc593[219]+ _0xbaf6x38,_0xbaf6x37)})}},receivefax:function(_0xbaf6x1b){return function(_0xbaf6x31){if(_0xbaf6x31){return triggers[_0xc593[220]](_0xbaf6x31)};return null}}}}
\ No newline at end of file