Built motion from commit 420f8c692.|1.0.30
[motion.git] / server / config / ami / socket.js
index 15fc8e9..2a229dc 100644 (file)
@@ -1 +1 @@
-var _0x349f=["\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","\x72\x65\x73\x75\x6C\x74","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x74\x79\x70\x65","\x72\x65\x73\x6F\x6C\x76\x65","\x61\x67\x65\x6E\x74\x73","\x72\x65\x70\x6F\x72\x74\x5F\x63\x61\x6C\x6C\x3A\x73\x61\x76\x65","\x76\x6F\x69\x63\x65\x2F\x6F\x75\x74\x62\x6F\x75\x6E\x64\x2F\x67\x6C\x6F\x62\x61\x6C","\x76\x6F\x69\x63\x65\x3A\x6F\x75\x74\x62\x6F\x75\x6E\x64\x3A\x67\x6C\x6F\x62\x61\x6C","\x75\x6E\x69\x71\x75\x65\x69\x64","\x63\x68\x61\x6E\x6E\x65\x6C\x73","\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x61\x67\x65\x6E\x74\x3A\x25\x73","\x73\x70\x6C\x69\x74","\x63\x68\x61\x6E\x6E\x65\x6C","\x72\x65\x70\x6F\x72\x74\x5F\x64\x69\x61\x6C\x3A\x75\x70\x64\x61\x74\x65","\x61\x64\x6D\x69\x6E\x73","\x75\x73\x65\x72\x73","\x72\x65\x70\x6F\x72\x74\x44\x69\x61\x6C","\x64\x65\x76\x69\x63\x65\x73\x74\x61\x74\x65\x63\x68\x61\x6E\x67\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\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"];_0x349f[0];var _=require(_0x349f[1]);var util=require(_0x349f[2]);var moment=require(_0x349f[3]);var BPromise=require(_0x349f[4]);var redis=require(_0x349f[5]);var VoiceQueue=require(_0x349f[7])[_0x349f[6]];var ReportQueue=require(_0x349f[7])[_0x349f[8]];var ReportCall=require(_0x349f[7])[_0x349f[9]];var ReportAgent=require(_0x349f[7])[_0x349f[10]];var ReportDial=require(_0x349f[7])[_0x349f[11]];var ReportMember=require(_0x349f[7])[_0x349f[12]];var User=require(_0x349f[7])[_0x349f[13]];var Triggers=require(_0x349f[14]);var config=require(_0x349f[15]);var logger=require(_0x349f[17])(_0x349f[16]);var utils=require(_0x349f[18]);var redisConf;if(config[_0x349f[19]]){redisConf= {password:config[_0x349f[19]]}};var redisClient=redis[_0x349f[21]](6379,config[_0x349f[20]],redisConf);var io=require(_0x349f[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[_0x349f[23]]= function(){var _0x83e4x16=function(_0x83e4x17,_0x83e4x18,_0x83e4x19){if(_0x83e4x17){io[_0x349f[25]](_0x83e4x17)[_0x349f[24]](_0x83e4x18,_0x83e4x19)}else {io[_0x349f[24]](_0x83e4x18,_0x83e4x19)}};var _0x83e4x1a=function(_0x83e4x1b){delete _0x83e4x1b[_0x349f[26]];delete _0x83e4x1b[_0x349f[27]];delete _0x83e4x1b[_0x349f[28]];delete _0x83e4x1b[_0x349f[29]];_0x83e4x1b[_0x349f[30]]= _0x83e4x1b[_0x349f[31]]|| _0x83e4x1b[_0x349f[30]];_0x83e4x1b[_0x349f[32]]= _0x83e4x1b[_0x349f[33]];_0x83e4x1b[_0x349f[34]]= _0x349f[35];switch(_0x83e4x1b[_0x349f[53]]){case _0x349f[36]:_0x83e4x1b[_0x349f[34]]= _0x349f[35];break;case _0x349f[38]:_0x83e4x1b[_0x349f[34]]= _0x349f[37];break;case _0x349f[40]:_0x83e4x1b[_0x349f[34]]= _0x349f[39];break;case _0x349f[42]:_0x83e4x1b[_0x349f[34]]= _0x349f[41];break;case _0x349f[44]:_0x83e4x1b[_0x349f[34]]= _0x349f[43];break;case _0x349f[46]:_0x83e4x1b[_0x349f[34]]= _0x349f[45];break;case _0x349f[48]:_0x83e4x1b[_0x349f[34]]= _0x349f[47];break;case _0x349f[50]:_0x83e4x1b[_0x349f[34]]= _0x349f[49];break;case _0x349f[52]:_0x83e4x1b[_0x349f[34]]= _0x349f[51];break;default:};_0x83e4x1b[_0x349f[53]]= Number(_0x83e4x1b[_0x349f[53]]);if(_0x83e4x1b[_0x349f[55]](_0x349f[54])){_0x83e4x1b[_0x349f[54]]= Number(_0x83e4x1b[_0x349f[54]])};if(_0x83e4x1b[_0x349f[55]](_0x349f[56])){_0x83e4x1b[_0x349f[56]]= Number(_0x83e4x1b[_0x349f[56]])};if(_0x83e4x1b[_0x349f[55]](_0x349f[57])){if(_0x83e4x1b[_0x349f[57]]=== _0x349f[36]){_0x83e4x1b[_0x349f[57]]= null}else {_0x83e4x1b[_0x349f[57]]= moment()[_0x349f[59]](_0x349f[58])}};_0x83e4x1b[_0x349f[60]]= parseInt(_0x83e4x1b[_0x349f[60]],10)?true:false};function _0x83e4x1c(_0x83e4x1d){if(!params[_0x349f[62]][_0x349f[61]][_0x83e4x1d]){params[_0x349f[62]][_0x349f[61]][_0x83e4x1d]= {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 _0x83e4x1e(){return function(){params[_0x349f[62]][_0x349f[61]]= {};params[_0x349f[62]][_0x349f[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[_0x349f[97]]({attributes:[_0x349f[31]],raw:true})[_0x349f[92]](function(_0x83e4x20){if(_0x83e4x20){_[_0x349f[93]](_0x83e4x20,function(_0x83e4x1d){_0x83e4x1c(_0x83e4x1d[_0x349f[31]])});return ReportQueue[_0x349f[97]]({attributes:[_0x349f[69],_0x349f[79],_0x349f[82],_0x349f[94],_0x349f[95],_0x349f[96],_0x349f[77]],raw:true})}})[_0x349f[92]](function(_0x83e4x20){if(_0x83e4x20){var _0x83e4x21;var _0x83e4x22;var _0x83e4x23=_0x83e4x20[_0x349f[68]];for(var _0x83e4x24=0;_0x83e4x24< _0x83e4x23;_0x83e4x24++){_0x83e4x21= _0x83e4x20[_0x83e4x24];_0x83e4x22= _0x83e4x21[_0x349f[69]];_0x83e4x1c(_0x83e4x22);params[_0x349f[62]][_0x349f[63]][_0x349f[70]]++;params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[70]]++;if(utils[_0x349f[71]](_0x83e4x21)){params[_0x349f[62]][_0x349f[63]][_0x349f[72]]++;params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[72]]++};if(utils[_0x349f[73]](_0x83e4x21)){params[_0x349f[62]][_0x349f[63]][_0x349f[74]]++;params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[74]]++};if(utils[_0x349f[75]](_0x83e4x21)){params[_0x349f[62]][_0x349f[63]][_0x349f[76]]++;params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[76]]++;params[_0x349f[62]][_0x349f[63]][_0x349f[77]]+= _0x83e4x21[_0x349f[77]]|| 0;params[_0x349f[62]][_0x349f[63]][_0x349f[78]]+= moment(_0x83e4x21[_0x349f[82]])[_0x349f[81]](moment(_0x83e4x21[_0x349f[79]]),_0x349f[80]);params[_0x349f[62]][_0x349f[63]][_0x349f[83]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[77]]/ params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[76]]);params[_0x349f[62]][_0x349f[63]][_0x349f[85]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[78]]/ params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[76]]);params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[77]]+= _0x83e4x21[_0x349f[77]]|| 0;params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[78]]+= moment(_0x83e4x21[_0x349f[82]])[_0x349f[81]](moment(_0x83e4x21[_0x349f[79]]),_0x349f[80]);params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[83]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[77]]/ params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[76]]);params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[85]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[78]]/ params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[76]])};if(utils[_0x349f[86]](_0x83e4x21)){params[_0x349f[62]][_0x349f[63]][_0x349f[87]]++;params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[87]]++};if(utils[_0x349f[88]](_0x83e4x21)){params[_0x349f[62]][_0x349f[63]][_0x349f[89]]++;params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[89]]++};params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[90]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[76]]/ (params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[76]]+ params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[87]])* 100,2);params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[91]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[87]]/ (params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[76]]+ params[_0x349f[62]][_0x349f[61]][_0x83e4x22][_0x349f[87]])* 100,2);params[_0x349f[62]][_0x349f[63]][_0x349f[90]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[63]][_0x349f[76]]/ (params[_0x349f[62]][_0x349f[63]][_0x349f[76]]+ params[_0x349f[62]][_0x349f[63]][_0x349f[87]])* 100,2);params[_0x349f[62]][_0x349f[63]][_0x349f[91]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[63]][_0x349f[87]]/ (params[_0x349f[62]][_0x349f[63]][_0x349f[76]]+ params[_0x349f[62]][_0x349f[63]][_0x349f[87]])* 100,2)}}})[_0x349f[67]](function(_0x83e4x1f){logger[_0x349f[66]](_0x349f[64],_0x83e4x1f[_0x349f[65]])})}}function _0x83e4x25(){return function(){params[_0x349f[98]][_0x349f[63]]= {total:0,answered:0,sumDuration:0,avgDuration:0,tigerdial:0};return ReportCall[_0x349f[97]]({where:{type:[_0x349f[98],_0x349f[101]],createdAt:{$gte:moment()[_0x349f[112]](_0x349f[111])}},attributes:[_0x349f[113],_0x349f[104],_0x349f[107]],raw:true})[_0x349f[92]](function(_0x83e4x20){if(_0x83e4x20){var _0x83e4x26=_[_0x349f[100]](_0x83e4x20,{type:_0x349f[98]});var _0x83e4x27=_[_0x349f[100]](_0x83e4x20,{type:_0x349f[101]});if(_0x83e4x26[_0x349f[68]]){params[_0x349f[98]][_0x349f[63]][_0x349f[70]]= _0x83e4x26[_0x349f[68]];params[_0x349f[98]][_0x349f[63]][_0x349f[102]]= _[_0x349f[105]](_0x83e4x26,_0x349f[104])[_0x349f[103]]|| 0;params[_0x349f[98]][_0x349f[63]][_0x349f[106]]= _[_0x349f[108]](_0x83e4x26,_0x349f[107]);if(params[_0x349f[98]][_0x349f[63]][_0x349f[102]]){params[_0x349f[98]][_0x349f[63]][_0x349f[109]]= _[_0x349f[84]]((_[_0x349f[108]](_0x83e4x26[_0x349f[110]],_0x349f[107])/ params[_0x349f[98]][_0x349f[63]][_0x349f[102]]));params[_0x349f[98]][_0x349f[63]][_0x349f[90]]= _[_0x349f[84]](params[_0x349f[98]][_0x349f[63]][_0x349f[102]]/ params[_0x349f[98]][_0x349f[63]][_0x349f[70]]* 100,1)}};if(_0x83e4x27[_0x349f[68]]){params[_0x349f[98]][_0x349f[63]][_0x349f[101]]= _0x83e4x27[_0x349f[68]]}}})[_0x349f[67]](function(_0x83e4x1f){logger[_0x349f[66]](_0x349f[99],_0x83e4x1f[_0x349f[65]])})}}BPromise[_0x349f[114]]()[_0x349f[92]](_0x83e4x1e())[_0x349f[92]](_0x83e4x25());return {cdr:function(_0x83e4x1b){return function(_0x83e4x20){_0x83e4x16(_0x349f[115],_0x349f[116],_0x83e4x1b);if(_0x83e4x1b[_0x349f[113]]== _0x349f[98]|| _0x83e4x1b[_0x349f[113]]== _0x349f[101]){if(_0x83e4x1b[_0x349f[113]]== _0x349f[98]){params[_0x349f[98]][_0x349f[63]][_0x349f[70]]++;_0x83e4x1b[_0x349f[104]]== _0x349f[103]&& (params[_0x349f[98]][_0x349f[63]][_0x349f[102]]++);params[_0x349f[98]][_0x349f[63]][_0x349f[106]]+= Number(_0x83e4x1b[_0x349f[107]]);if(params[_0x349f[98]][_0x349f[63]][_0x349f[102]]){params[_0x349f[98]][_0x349f[63]][_0x349f[109]]= _[_0x349f[84]](params[_0x349f[98]][_0x349f[63]][_0x349f[106]]/ params[_0x349f[98]][_0x349f[63]][_0x349f[102]]);params[_0x349f[98]][_0x349f[63]][_0x349f[90]]= _[_0x349f[84]](params[_0x349f[98]][_0x349f[63]][_0x349f[102]]/ params[_0x349f[98]][_0x349f[63]][_0x349f[70]]* 100,1)}}else {params[_0x349f[98]][_0x349f[63]][_0x349f[101]]++};_0x83e4x16(_0x349f[117],_0x349f[118],params[_0x349f[98]][_0x349f[63]])}}},send:function(_0x83e4x1b){return function(_0x83e4x20){return BPromise[_0x349f[114]]()}},hangup:function(_0x83e4x1b){return function(_0x83e4x20){if(params[_0x349f[98]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]]){delete params[_0x349f[98]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]]};if(params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]]){delete params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]]};var _0x83e4x28={uniqueid:_0x83e4x1b[_0x349f[119]],linkedid:_0x83e4x1b[_0x349f[121]],endtime:moment()[_0x349f[59]](_0x349f[58]),lastevent:_0x349f[122],updatedAt:moment()[_0x349f[59]](_0x349f[58])};_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x1b[_0x349f[125]][_0x349f[124]](/\/|-/)[1]),_0x349f[126],_0x83e4x28);_0x83e4x16(_0x349f[127],_0x349f[126],_0x83e4x28);_0x83e4x16(_0x349f[128],_0x349f[126],_0x83e4x28);if(_0x83e4x20){triggers[_0x349f[129]](_0x83e4x20)};return BPromise[_0x349f[114]]()}},devicestatechange:function(_0x83e4x1b){return function(_0x83e4x20){return User[_0x349f[143]]({where:{name:_0x83e4x1b[_0x349f[142]][_0x349f[141]](_0x349f[139],_0x349f[140])},raw:true})[_0x349f[92]](function(_0x83e4x29){if(_0x83e4x29){var _0x83e4x28=_[_0x349f[134]]({newValues:{id:_0x83e4x29[_0x349f[132]],status:_0x83e4x1b[_0x349f[133]],statusAt:moment()[_0x349f[59]](_0x349f[58])}},_0x83e4x29,{status:_0x83e4x1b[_0x349f[133]],statusAt:moment()[_0x349f[59]](_0x349f[58])});_0x83e4x28[_0x349f[26]]= _0x349f[135];_0x83e4x16(util[_0x349f[59]](_0x349f[136],_0x83e4x29[_0x349f[137]],_0x83e4x29[_0x349f[132]]),_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[128],_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[127],_0x349f[138],_0x83e4x28)}})[_0x349f[67]](function(_0x83e4x1f){logger[_0x349f[131]](_0x349f[130],_0x83e4x1f)})}},peerstatus:function(_0x83e4x1b){return function(_0x83e4x20){if(_0x83e4x20&& _0x83e4x20[0]){_[_0x349f[93]](_0x83e4x20[1],function(_0x83e4x2a){if(!params[_0x349f[144]][_0x83e4x2a[_0x349f[31]]]){params[_0x349f[144]][_0x83e4x2a[_0x349f[31]]]= {name:_0x83e4x2a[_0x349f[31]]}};params[_0x349f[144]][_0x83e4x2a[_0x349f[31]]][_0x349f[145]]= _0x83e4x1b[_0x349f[145]];_0x83e4x16(_0x349f[146],_0x349f[147],params[_0x349f[144]][_0x83e4x2a[_0x349f[31]]])})};return BPromise[_0x349f[114]]()}},registry:function(_0x83e4x1b){return function(_0x83e4x20){if(_0x83e4x20&& _0x83e4x20[0]){_[_0x349f[93]](_0x83e4x20[1],function(_0x83e4x2a){if(!params[_0x349f[144]][_0x83e4x2a[_0x349f[31]]]){params[_0x349f[144]][_0x83e4x2a[_0x349f[31]]]= {name:_0x83e4x2a[_0x349f[31]]}};params[_0x349f[144]][_0x83e4x2a[_0x349f[31]]][_0x349f[53]]= _0x83e4x1b[_0x349f[53]];_0x83e4x16(_0x349f[146],_0x349f[147],params[_0x349f[144]][_0x83e4x2a[_0x349f[31]]])})};return BPromise[_0x349f[114]]()}},agentcalled:function(_0x83e4x1b){return function(_0x83e4x20){if(_0x83e4x20){_0x83e4x1b[_0x349f[148]]&& (_0x83e4x20[_0x349f[149]][_0x349f[148]]= _0x83e4x1b[_0x349f[148]]);_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x20[_0x349f[30]]),_0x349f[150],_0x83e4x20);triggers[_0x349f[151]](_0x83e4x20)};return User[_0x349f[143]]({where:{name:_0x83e4x1b[_0x349f[30]],voicePause:false},raw:true})[_0x349f[92]](function(_0x83e4x29){if(_0x83e4x29){var _0x83e4x2b=moment()[_0x349f[59]](_0x349f[58]);var _0x83e4x28=_[_0x349f[134]]({newValues:{id:_0x83e4x29[_0x349f[132]],queueStatus:_0x349f[153],queueStatusAt:_0x83e4x2b,lastQueue:_0x83e4x1b[_0x349f[69]]}},_0x83e4x29,{queueStatus:_0x349f[153],queueStatusAt:_0x83e4x2b,lastQueue:_0x83e4x1b[_0x349f[69]]});_0x83e4x28[_0x349f[26]]= _0x349f[154];_0x83e4x16(util[_0x349f[59]](_0x349f[136],_0x83e4x29[_0x349f[137]],_0x83e4x29[_0x349f[132]]),_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[128],_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[127],_0x349f[138],_0x83e4x28)}})[_0x349f[67]](function(_0x83e4x1f){logger[_0x349f[66]](_0x349f[152],_0x83e4x1f)})}},agentcomplete:function(_0x83e4x1b){return function(_0x83e4x20){if(_0x83e4x20){triggers[_0x349f[155]](_0x83e4x20)};if(params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[74]]){params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[74]]--};if(params[_0x349f[62]][_0x349f[63]][_0x349f[74]]){params[_0x349f[62]][_0x349f[63]][_0x349f[74]]--;_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[156],{type:_0x349f[74],amount:-1,queue:_0x83e4x1b[_0x349f[69]]})};params[_0x349f[62]][_0x349f[63]][_0x349f[76]]++;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[76]]++;_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[156],{type:_0x349f[122],amount:1,queue:_0x83e4x1b[_0x349f[69]]});params[_0x349f[62]][_0x349f[63]][_0x349f[90]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[63]][_0x349f[76]]/ (params[_0x349f[62]][_0x349f[63]][_0x349f[76]]+ params[_0x349f[62]][_0x349f[63]][_0x349f[87]])* 100,2);params[_0x349f[62]][_0x349f[63]][_0x349f[91]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[63]][_0x349f[87]]/ (params[_0x349f[62]][_0x349f[63]][_0x349f[76]]+ params[_0x349f[62]][_0x349f[63]][_0x349f[87]])* 100,2);params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[90]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[76]]/ (params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[76]]+ params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[87]])* 100,2);params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[91]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[87]]/ (params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[76]]+ params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[87]])* 100,2);params[_0x349f[62]][_0x349f[63]][_0x349f[78]]+= Number(_0x83e4x1b[_0x349f[78]]);params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[78]]+= Number(_0x83e4x1b[_0x349f[78]]);_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[156],{type:_0x349f[78],amount:Number(_0x83e4x1b[_0x349f[78]]),queue:_0x83e4x1b[_0x349f[69]]});params[_0x349f[62]][_0x349f[63]][_0x349f[85]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[63]][_0x349f[78]]/ params[_0x349f[62]][_0x349f[63]][_0x349f[76]]);params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[85]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[78]]/ params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[76]]);params[_0x349f[62]][_0x349f[63]][_0x349f[77]]+= Number(_0x83e4x1b[_0x349f[77]]);params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[77]]+= Number(_0x83e4x1b[_0x349f[77]]);_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[156],{type:_0x349f[77],amount:Number(_0x83e4x1b[_0x349f[77]]),queue:_0x83e4x1b[_0x349f[69]]});params[_0x349f[62]][_0x349f[63]][_0x349f[83]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[63]][_0x349f[77]]/ params[_0x349f[62]][_0x349f[63]][_0x349f[76]]);params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[83]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[77]]/ params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[76]]);var _0x83e4x28;var _0x83e4x2b=moment()[_0x349f[59]](_0x349f[58]);return ReportAgent[_0x349f[143]]({where:{uniqueid:_0x83e4x1b[_0x349f[119]],destuniqueid:_0x83e4x1b[_0x349f[163]]},raw:true})[_0x349f[92]](function(_0x83e4x2c){if(_0x83e4x2c){_0x83e4x28= _[_0x349f[134]]({},_0x83e4x2c,{lastevent:_0x349f[122],agentcomplete:true,agentcompleteAt:_0x83e4x2b,talktime:Number(_0x83e4x1b[_0x349f[78]]),reason:_0x83e4x1b[_0x349f[160]]});_0x83e4x1b[_0x349f[148]]&& (_0x83e4x28[_0x349f[148]]= _0x83e4x1b[_0x349f[148]]);_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x2c[_0x349f[30]]),_0x349f[161],_0x83e4x28)};return ReportQueue[_0x349f[143]]({where:{uniqueid:_0x83e4x1b[_0x349f[119]]},order:_0x349f[162],raw:true})})[_0x349f[92]](function(_0x83e4x2c){if(_0x83e4x2c){_0x83e4x28= _[_0x349f[134]]({},_0x83e4x2c,{queuecallercomplete:true,queuecallercompleteAt:_0x83e4x2b});_0x83e4x16(_0x83e4x2c[_0x349f[69]],_0x349f[159],_0x83e4x28)};return User[_0x349f[143]]({where:{name:_0x83e4x1b[_0x349f[30]]},raw:true})})[_0x349f[92]](function(_0x83e4x29){if(_0x83e4x29){var _0x83e4x28=_[_0x349f[134]]({newValues:{id:_0x83e4x29[_0x349f[132]],queueStatus:_0x349f[122],queueStatusAt:_0x83e4x2b,lastQueue:_0x83e4x1b[_0x349f[69]]}},_0x83e4x29,{queueStatus:_0x349f[122],queueStatusAt:_0x83e4x2b,lastQueue:_0x83e4x1b[_0x349f[69]]});_0x83e4x28[_0x349f[26]]= _0x349f[158];_0x83e4x16(util[_0x349f[59]](_0x349f[136],_0x83e4x29[_0x349f[137]],_0x83e4x29[_0x349f[132]]),_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[128],_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[127],_0x349f[138],_0x83e4x28)}})[_0x349f[67]](function(_0x83e4x1f){logger[_0x349f[66]](_0x349f[157],_0x83e4x1f)})}},agentconnect:function(_0x83e4x1b){return function(_0x83e4x20){if(_0x83e4x20){triggers[_0x349f[155]](_0x83e4x20)};if(params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[72]]){params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[72]]--;_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[156],{type:_0x349f[72],amount:-1,queue:_0x83e4x1b[_0x349f[69]]})};if(params[_0x349f[62]][_0x349f[63]][_0x349f[72]]){params[_0x349f[62]][_0x349f[63]][_0x349f[72]]--};if(params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]]){params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]][_0x349f[164]]= _0x83e4x1b[_0x349f[165]];params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]][_0x349f[166]]= _0x83e4x1b[_0x349f[166]];params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]][_0x349f[77]]= Number(_0x83e4x1b[_0x349f[77]]);params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]][_0x349f[167]]= Number(_0x83e4x1b[_0x349f[167]]);params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]][_0x349f[32]]= _0x83e4x1b[_0x349f[32]];params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]][_0x349f[30]]= _0x83e4x1b[_0x349f[30]]};params[_0x349f[62]][_0x349f[63]][_0x349f[74]]++;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[74]]++;_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[156],{type:_0x349f[74],amount:1,queue:_0x83e4x1b[_0x349f[69]]});var _0x83e4x28;var _0x83e4x2b=moment()[_0x349f[59]](_0x349f[58]);return ReportQueue[_0x349f[143]]({where:{uniqueid:_0x83e4x1b[_0x349f[119]]},order:_0x349f[162],raw:true})[_0x349f[92]](function(_0x83e4x2c){if(_0x83e4x2c){_0x83e4x28= _[_0x349f[134]]({},_0x83e4x2c,{queuecallerleaveAt:moment()[_0x349f[59]](_0x349f[58]),holdtime:_0x83e4x1b[_0x349f[77]],assigned:true,lastAssignedTo:_0x83e4x1b[_0x349f[30]]});_0x83e4x16(_0x83e4x2c[_0x349f[69]],_0x349f[159],_0x83e4x28)};return ReportAgent[_0x349f[143]]({where:{uniqueid:_0x83e4x1b[_0x349f[119]],destuniqueid:_0x83e4x1b[_0x349f[163]]},raw:true})})[_0x349f[92]](function(_0x83e4x2c){if(_0x83e4x2c){_0x83e4x28= _[_0x349f[134]]({},_0x83e4x2c,{lastevent:_0x349f[169],agentconnectAt:moment()[_0x349f[59]](_0x349f[58]),holdtime:_0x83e4x1b[_0x349f[77]]});_0x83e4x1b[_0x349f[148]]&& (_0x83e4x28[_0x349f[148]]= _0x83e4x1b[_0x349f[148]]);_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x2c[_0x349f[30]]),_0x349f[161],_0x83e4x28)};return ReportAgent[_0x349f[97]]({where:{uniqueid:_0x83e4x1b[_0x349f[119]],destuniqueid:{$ne:_0x83e4x1b[_0x349f[163]]},reason:null},raw:true})})[_0x349f[92]](function(_0x83e4x2e){if(_0x83e4x2e&& _0x83e4x2e[_0x349f[68]]){_[_0x349f[93]](_0x83e4x2e,function(_0x83e4x2c){_0x83e4x28= _[_0x349f[134]]({},_0x83e4x2c,{lastevent:_0x349f[171],agentringnoanswer:true,agentringnoanswerAt:_0x83e4x2b,reason:_0x349f[171],answeredelsewheredestinationuniqueid:_0x83e4x1b[_0x349f[163]],answeredelsewheremembername:_0x83e4x1b[_0x349f[30]]});_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x2c[_0x349f[30]]),_0x349f[161],_0x83e4x28)})};return User[_0x349f[143]]({where:{name:_0x83e4x1b[_0x349f[30]]},raw:true})})[_0x349f[92]](function(_0x83e4x29){if(_0x83e4x29){var _0x83e4x28=_[_0x349f[134]]({newValues:{id:_0x83e4x29[_0x349f[132]],queueStatus:_0x349f[169],queueStatusAt:_0x83e4x2b,lastQueue:_0x83e4x1b[_0x349f[69]]}},_0x83e4x29,{queueStatus:_0x349f[169],queueStatusAt:_0x83e4x2b,lastQueue:_0x83e4x1b[_0x349f[69]]});_0x83e4x28[_0x349f[26]]= _0x349f[170];_0x83e4x16(util[_0x349f[59]](_0x349f[136],_0x83e4x29[_0x349f[137]],_0x83e4x29[_0x349f[132]]),_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[128],_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[127],_0x349f[138],_0x83e4x28)};return User[_0x349f[97]]({where:{lastQueue:_0x83e4x1b[_0x349f[69]],name:{$ne:_0x83e4x1b[_0x349f[30]]}},raw:true})})[_0x349f[92]](function(_0x83e4x2d){if(_0x83e4x2d&& _0x83e4x2d[_0x349f[68]]){_[_0x349f[93]](_0x83e4x2d,function(_0x83e4x29){var _0x83e4x28=_[_0x349f[134]]({newValues:{id:_0x83e4x29[_0x349f[132]],queueStatus:_0x349f[122],queueStatusAt:_0x83e4x2b}},_0x83e4x29,{queueStatus:_0x349f[122],queueStatusAt:_0x83e4x2b});_0x83e4x16(util[_0x349f[59]](_0x349f[136],_0x83e4x29[_0x349f[137]],_0x83e4x29[_0x349f[132]]),_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[128],_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[127],_0x349f[138],_0x83e4x28)})}})[_0x349f[67]](function(_0x83e4x1f){logger[_0x349f[66]](_0x349f[168],_0x83e4x1f)})}},agentringnoanswer:function(_0x83e4x1b){return function(_0x83e4x20){if(_0x83e4x20){triggers[_0x349f[155]](_0x83e4x20)};var _0x83e4x28;var _0x83e4x2b=moment()[_0x349f[59]](_0x349f[58]);return User[_0x349f[143]]({where:{name:_0x83e4x1b[_0x349f[30]]},raw:true})[_0x349f[92]](function(_0x83e4x29){if(_0x83e4x29){var _0x83e4x28=_[_0x349f[134]]({newValues:{id:_0x83e4x29[_0x349f[132]],queueStatus:_0x349f[122],queueStatusAt:_0x83e4x2b,lastQueue:_0x83e4x1b[_0x349f[69]]}},_0x83e4x29,{queueStatus:_0x349f[122],queueStatusAt:_0x83e4x2b,lastQueue:_0x83e4x1b[_0x349f[69]]});_0x83e4x28[_0x349f[26]]= _0x349f[174];_0x83e4x16(util[_0x349f[59]](_0x349f[136],_0x83e4x29[_0x349f[137]],_0x83e4x29[_0x349f[132]]),_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[128],_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[127],_0x349f[138],_0x83e4x28)};return ReportAgent[_0x349f[143]]({where:{uniqueid:_0x83e4x1b[_0x349f[119]],destuniqueid:_0x83e4x1b[_0x349f[163]]},raw:true})})[_0x349f[92]](function(_0x83e4x2c){if(_0x83e4x2c){_0x83e4x28= _[_0x349f[134]]({},_0x83e4x2c,{lastevent:_0x349f[173],agentringnoanswer:true,agentringnoanswerAt:moment()[_0x349f[59]](_0x349f[58]),reason:_0x349f[173]});_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x2c[_0x349f[30]]),_0x349f[161],_0x83e4x28)}})[_0x349f[67]](function(_0x83e4x1f){logger[_0x349f[66]](_0x349f[172],_0x83e4x1f)})}},queuememberadded:function(_0x83e4x1b){return function(_0x83e4x20){if(_0x83e4x20){_0x83e4x16(_0x83e4x20[_0x349f[69]],_0x349f[175],_0x83e4x20);_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x20.UserId),_0x349f[175],_0x83e4x20)};return BPromise[_0x349f[114]]()}},queuememberremoved:function(_0x83e4x1b){return function(_0x83e4x20){if(params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]]){delete params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[115]][_0x83e4x1b[_0x349f[30]]]};return User[_0x349f[143]]({where:{name:_0x83e4x1b[_0x349f[32]][_0x349f[141]](_0x349f[139],_0x349f[140])},raw:true})[_0x349f[92]](function(_0x83e4x29){if(_0x83e4x29){_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[177],{queue:_0x83e4x1b[_0x349f[69]],UserId:_0x83e4x29[_0x349f[132]]});_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x29[_0x349f[132]]),_0x349f[177],{queue:_0x83e4x1b[_0x349f[69]],UserId:_0x83e4x29[_0x349f[132]]})}})[_0x349f[67]](function(_0x83e4x1f){logger[_0x349f[66]](_0x349f[176],_0x83e4x1f)})}},queuememberpause:function(_0x83e4x1b){return function(_0x83e4x20){if(_0x83e4x20){_0x83e4x16(_0x83e4x20[_0x349f[69]],_0x349f[175],_0x83e4x20);_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x20.UserId),_0x349f[175],_0x83e4x20)}}},queuememberpenalty:function(_0x83e4x1b){return function(_0x83e4x20){return BPromise[_0x349f[114]]()}},queuememberringinuse:function(_0x83e4x1b){return function(_0x83e4x20){return BPromise[_0x349f[114]]()}},queuemember:function(_0x83e4x1b){return function(_0x83e4x20){_0x83e4x1a(_0x83e4x1b);_0x83e4x1c(_0x83e4x1b[_0x349f[69]]);params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[115]][_0x83e4x1b[_0x349f[31]]]= _0x83e4x1b;return BPromise[_0x349f[114]]()}},queuecallerjoin:function(_0x83e4x1b){return function(_0x83e4x20){if(!params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]]){params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]]= {};params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[72]]= 0;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[74]]= 0;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[76]]= 0;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[87]]= 0;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[89]]= 0;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[77]]= 0;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[78]]= 0;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[83]]= 0;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[85]]= 0;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[90]]= 0;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[91]]= 0;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[70]]= 0};params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]]= {channel:_0x83e4x1b[_0x349f[125]],channelstate:Number(_0x83e4x1b[_0x349f[178]]),channelstatedesc:_0x83e4x1b[_0x349f[179]],calleridnum:_0x83e4x1b[_0x349f[180]],calleridname:_0x83e4x1b[_0x349f[181]],exten:_0x83e4x1b[_0x349f[182]],priority:Number(_0x83e4x1b[_0x349f[183]]),uniqueid:_0x83e4x1b[_0x349f[119]],queue:_0x83e4x1b[_0x349f[69]],position:Number(_0x83e4x1b[_0x349f[184]]),count:Number(_0x83e4x1b[_0x349f[185]])};params[_0x349f[62]][_0x349f[63]][_0x349f[72]]++;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[72]]++;_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[156],{type:_0x349f[70],amount:1,queue:_0x83e4x1b[_0x349f[69]]});params[_0x349f[62]][_0x349f[63]][_0x349f[70]]++;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[70]]++;_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[156],{type:_0x349f[72],amount:1,queue:_0x83e4x1b[_0x349f[69]]});if(_0x83e4x20){_0x83e4x16(_0x83e4x20[_0x349f[69]],_0x349f[186],_0x83e4x20)};return BPromise[_0x349f[114]]()}},queuecallerabandon:function(_0x83e4x1b){return function(_0x83e4x20){if(_0x83e4x20&& _0x83e4x20[_0x349f[187]]&& _0x83e4x20[_0x349f[187]][0]){_[_0x349f[93]](_0x83e4x20[_0x349f[187]][1],function(_0x83e4x2c){_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x2c[_0x349f[30]]),_0x349f[161],_0x83e4x2c)})};if(_0x83e4x20&& _0x83e4x20[_0x349f[188]]){_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[159],_0x83e4x20[_0x349f[188]]);_0x83e4x20[_0x349f[188]][_0x349f[149]][_0x349f[189]]= _0x349f[87];_0x83e4x20[_0x349f[188]][_0x349f[190]][_0x349f[189]]= true;triggers[_0x349f[155]](_0x83e4x20[_0x349f[188]])};var _0x83e4x28;var _0x83e4x2b=moment()[_0x349f[59]](_0x349f[58]);if(params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[72]]){params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[72]]--;_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[156],{type:_0x349f[72],amount:-1,queue:_0x83e4x1b[_0x349f[69]]})};if(params[_0x349f[62]][_0x349f[63]][_0x349f[72]]){params[_0x349f[62]][_0x349f[63]][_0x349f[72]]--};if(params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]]){params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]][_0x349f[77]]= Number(_0x83e4x1b[_0x349f[77]]);params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]][_0x349f[184]]= Number(_0x83e4x1b[_0x349f[184]]);params[_0x349f[62]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]][_0x349f[191]]= Number(_0x83e4x1b[_0x349f[191]])};params[_0x349f[62]][_0x349f[63]][_0x349f[87]]++;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[87]]++;_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[156],{type:_0x349f[192],amount:1,queue:_0x83e4x1b[_0x349f[69]]});params[_0x349f[62]][_0x349f[63]][_0x349f[90]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[63]][_0x349f[76]]/ (params[_0x349f[62]][_0x349f[63]][_0x349f[76]]+ params[_0x349f[62]][_0x349f[63]][_0x349f[87]])* 100,2);params[_0x349f[62]][_0x349f[63]][_0x349f[91]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[63]][_0x349f[87]]/ (params[_0x349f[62]][_0x349f[63]][_0x349f[76]]+ params[_0x349f[62]][_0x349f[63]][_0x349f[87]])* 100,2);params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[90]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[76]]/ (params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[76]]+ params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[87]])* 100,2);params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[91]]= _[_0x349f[84]](params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[87]]/ (params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[76]]+ params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[87]])* 100,2);return User[_0x349f[97]]({where:{lastQueue:_0x83e4x1b[_0x349f[69]]},raw:true})[_0x349f[92]](function(_0x83e4x2f){if(_0x83e4x2f&& _0x83e4x2f[_0x349f[68]]){var _0x83e4x28;_[_0x349f[93]](_0x83e4x2f,function(_0x83e4x30){_0x83e4x28= _[_0x349f[134]]({newValues:{id:_0x83e4x30[_0x349f[132]],queueStatus:_0x349f[122],queueStatusAt:_0x83e4x2b,lastQueue:_0x83e4x1b[_0x349f[69]]}},_0x83e4x30,{id:_0x83e4x30[_0x349f[132]],queueStatus:_0x349f[122],queueStatusAt:_0x83e4x2b,lastQueue:_0x83e4x1b[_0x349f[69]]});_0x83e4x28[_0x349f[26]]= _0x349f[95];_0x83e4x16(util[_0x349f[59]](_0x349f[136],_0x83e4x30[_0x349f[137]],_0x83e4x30[_0x349f[132]]),_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[128],_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[127],_0x349f[138],_0x83e4x28)})}})[_0x349f[67]](function(_0x83e4x1f){logger[_0x349f[66]](_0x349f[193],_0x83e4x1f)})}},blindtransfer:function(_0x83e4x1b){return function(_0x83e4x20){_0x83e4x16(null,_0x83e4x1b[_0x349f[26]][_0x349f[194]](),_0x83e4x1b);return BPromise[_0x349f[114]]()}},attendedtransfer:function(_0x83e4x1b){return function(_0x83e4x20){_0x83e4x16(null,_0x83e4x1b[_0x349f[26]][_0x349f[194]](),_0x83e4x1b);return BPromise[_0x349f[114]]()}},dialbegin:function(_0x83e4x1b){return function(_0x83e4x20){params[_0x349f[98]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]]= {channel:_0x83e4x1b[_0x349f[125]],channelstate:Number(_0x83e4x1b[_0x349f[178]]),channelstatedesc:_0x83e4x1b[_0x349f[179]],calleridnum:_0x83e4x1b[_0x349f[180]],calleridname:_0x83e4x1b[_0x349f[181]],context:_0x83e4x1b[_0x349f[195]],exten:_0x83e4x1b[_0x349f[182]],priority:Number(_0x83e4x1b[_0x349f[183]]),dialstring:_0x83e4x1b[_0x349f[196]]};if(_0x83e4x1b[_0x349f[125]]){var _0x83e4x28=_[_0x349f[197]](_0x83e4x1b,{starttime:moment()[_0x349f[59]](_0x349f[58]),lastevent:_0x349f[153],updatedAt:moment()[_0x349f[59]](_0x349f[58])});_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x1b[_0x349f[125]][_0x349f[124]](/\/|-/)[1]),_0x349f[198],_0x83e4x28);_0x83e4x16(_0x349f[128],_0x349f[126],_[_0x349f[197]](_0x83e4x28,{role:_0x349f[128]}));_0x83e4x16(_0x349f[127],_0x349f[126],_0x83e4x28,_[_0x349f[197]](_0x83e4x28,{role:_0x349f[127]}));if(_0x83e4x20){triggers[_0x349f[129]](_0x83e4x20)}};return BPromise[_0x349f[114]]()}},dialend:function(_0x83e4x1b){return function(_0x83e4x20){if(params[_0x349f[98]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]]){params[_0x349f[98]][_0x349f[120]][_0x83e4x1b[_0x349f[119]]][_0x349f[199]]= _0x83e4x1b[_0x349f[199]]};if(_0x83e4x1b[_0x349f[125]]){var _0x83e4x2b=moment()[_0x349f[59]](_0x349f[58]);var _0x83e4x28={dialstatus:_0x83e4x1b[_0x349f[199]],lastevent:(_0x83e4x1b[_0x349f[199]]=== _0x349f[103])?_0x349f[169]:_0x349f[122],answertime:(_0x83e4x1b[_0x349f[199]]=== _0x349f[103])?_0x83e4x2b:null,uniqueid:_0x83e4x1b[_0x349f[119]],linkedid:_0x83e4x1b[_0x349f[121]],destuniqueid:_0x83e4x1b[_0x349f[163]],destlinkedid:_0x83e4x1b[_0x349f[200]],updatedAt:_0x83e4x2b};_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x1b[_0x349f[125]][_0x349f[124]](/\/|-/)[1]),_0x349f[126],_0x83e4x28);_0x83e4x16(_0x349f[128],_0x349f[126],_0x83e4x28);_0x83e4x16(_0x349f[127],_0x349f[126],_0x83e4x28);if(_0x83e4x20){triggers[_0x349f[129]](_0x83e4x20)}};return BPromise[_0x349f[114]]()}},varset:function(_0x83e4x1b){return function(_0x83e4x20){if(_0x83e4x1b[_0x349f[202]][_0x349f[55]](_0x349f[201])){_0x83e4x16(_0x349f[128],_0x349f[198],{uniqueid:_0x83e4x1b[_0x349f[119]],routeId:_0x83e4x1b[_0x349f[203]],updatedAt:moment()[_0x349f[59]](_0x349f[58])});_0x83e4x16(_0x349f[127],_0x349f[198],{uniqueid:_0x83e4x1b[_0x349f[119]],routeId:_0x83e4x1b[_0x349f[203]],updatedAt:moment()[_0x349f[59]](_0x349f[58])})};if(_0x83e4x1b){triggers[_0x349f[204]](_0x83e4x1b)};return BPromise[_0x349f[114]]()}},queuecallerunmanaged:function(_0x83e4x1b){return function(_0x83e4x20){if(_0x83e4x20){params[_0x349f[62]][_0x349f[63]][_0x349f[89]]+= 1;params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[89]]+= 1;_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[156],{type:_0x349f[89],amount:1,queue:_0x83e4x1b[_0x349f[69]]});if(params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[72]]){params[_0x349f[62]][_0x349f[61]][_0x83e4x1b[_0x349f[69]]][_0x349f[72]]-= 1};if(params[_0x349f[62]][_0x349f[63]][_0x349f[72]]){params[_0x349f[62]][_0x349f[63]][_0x349f[72]]-= 1;_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[156],{type:_0x349f[72],amount:-1,queue:_0x83e4x1b[_0x349f[69]]})};_0x83e4x16(_0x83e4x1b[_0x349f[69]],_0x349f[159],_0x83e4x20);var _0x83e4x2b=moment()[_0x349f[59]](_0x349f[58]);return User[_0x349f[97]]({where:{lastQueue:_0x83e4x1b[_0x349f[69]]},raw:true})[_0x349f[92]](function(_0x83e4x2f){if(_0x83e4x2f&& _0x83e4x2f[_0x349f[68]]){var _0x83e4x28;_[_0x349f[93]](_0x83e4x2f,function(_0x83e4x30){_0x83e4x28= _[_0x349f[134]]({newValues:{id:_0x83e4x30[_0x349f[132]],queueStatus:_0x349f[122],queueStatusAt:_0x83e4x2b,lastQueue:_0x83e4x1b[_0x349f[69]]}},_0x83e4x30,{id:_0x83e4x30[_0x349f[132]],queueStatus:_0x349f[122],queueStatusAt:_0x83e4x2b,lastQueue:_0x83e4x1b[_0x349f[69]]});_0x83e4x28[_0x349f[26]]= _0x349f[205];_0x83e4x16(util[_0x349f[59]](_0x349f[136],_0x83e4x30[_0x349f[137]],_0x83e4x30[_0x349f[132]]),_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[128],_0x349f[138],_0x83e4x28);_0x83e4x16(_0x349f[127],_0x349f[138],_0x83e4x28)})}})[_0x349f[67]](function(_0x83e4x1f){logger[_0x349f[66]](_0x349f[193],_0x83e4x1f)})}}},agentUpdate:function(_0x83e4x30){return function(){_0x83e4x30[_0x349f[26]]= _0x349f[206];_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x30[_0x349f[132]]),_0x349f[138],_0x83e4x30);_0x83e4x16(_0x349f[128],_0x349f[138],_0x83e4x30);_0x83e4x16(_0x349f[127],_0x349f[138],_0x83e4x30)}},console:function(_0x83e4x31){_0x83e4x16(_0x83e4x31[_0x349f[207]],util[_0x349f[59]](_0x349f[208],_0x83e4x31[_0x349f[113]]),_0x83e4x31[_0x349f[209]])},realtimeQueueMembers:function(_0x83e4x32){return function(){_[_0x349f[211]](params[_0x349f[62]][_0x349f[61]],function(_0x83e4x1d,_0x83e4x22){if(_[_0x349f[210]](_0x83e4x32,_0x83e4x22)){_[_0x349f[211]](_0x83e4x1d[_0x349f[115]],function(_0x83e4x30){_0x83e4x16(_0x83e4x22,_0x349f[175],_0x83e4x30)})}})}},updateTriggers:function(_0x83e4x31){return function(){return triggers[_0x349f[212]](_0x83e4x31)}},queueAdd:function(_0x83e4x33,_0x83e4x34){return function(){if(_0x83e4x33&& _0x83e4x34){_[_0x349f[93]](_0x83e4x33,function(_0x83e4x20){_0x83e4x16(null,util[_0x349f[59]](_0x349f[213],_0x83e4x34),_0x83e4x20[0])})}}},queueRemove:function(_0x83e4x20,_0x83e4x34){return function(){if(_0x83e4x20&& _0x83e4x34){_0x83e4x16(null,util[_0x349f[59]](_0x349f[214],_0x83e4x34),_0x83e4x20)}}},checkTriggers:function(_0x83e4x31){return function(){return triggers[_0x349f[215]](_0x83e4x31)}},videoOn:function(_0x83e4x1b){return function(){return triggers[_0x349f[216]](_0x83e4x1b)}},inboundInit:function(){return function(){return BPromise[_0x349f[114]]()[_0x349f[92]](_0x83e4x1e())}},outboundInit:function(){return function(){return BPromise[_0x349f[114]]()[_0x349f[92]](_0x83e4x25())}},reportFaxUpdate:function(_0x83e4x35){return function(){_0x83e4x35[_0x349f[26]]= _0x349f[217];_0x83e4x16(util[_0x349f[59]](_0x349f[123],_0x83e4x35[_0x349f[218]]),_0x349f[138],_0x83e4x35);_0x83e4x16(_0x349f[127],_0x349f[219],_0x83e4x35)}},widgetValues:function(_0x83e4x36,_0x83e4x29){return function(){_[_0x349f[211]](_0x83e4x36,function(_0x83e4x37,_0x83e4x38){_0x83e4x16(util[_0x349f[59]](_0x349f[136],_0x83e4x29[_0x349f[137]],_0x83e4x29[_0x349f[132]]),_0x349f[220]+ _0x83e4x38,_0x83e4x37)})}},receivefax:function(_0x83e4x1b){return function(_0x83e4x31){if(_0x83e4x31){return triggers[_0x349f[221]](_0x83e4x31)};return null}}}}
\ No newline at end of file
+var _0x8b22=["\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","\x72\x65\x70\x6F\x72\x74\x71\x75\x65\x75\x65\x75\x70\x64\x61\x74\x65"];_0x8b22[0];var _=require(_0x8b22[1]);var util=require(_0x8b22[2]);var moment=require(_0x8b22[3]);var BPromise=require(_0x8b22[4]);var redis=require(_0x8b22[5]);var VoiceQueue=require(_0x8b22[7])[_0x8b22[6]];var ReportQueue=require(_0x8b22[7])[_0x8b22[8]];var ReportCall=require(_0x8b22[7])[_0x8b22[9]];var ReportAgent=require(_0x8b22[7])[_0x8b22[10]];var ReportDial=require(_0x8b22[7])[_0x8b22[11]];var ReportMember=require(_0x8b22[7])[_0x8b22[12]];var User=require(_0x8b22[7])[_0x8b22[13]];var Triggers=require(_0x8b22[14]);var config=require(_0x8b22[15]);var logger=require(_0x8b22[17])(_0x8b22[16]);var utils=require(_0x8b22[18]);var redisConf;if(config[_0x8b22[19]]){redisConf= {password:config[_0x8b22[19]]}};var redisClient=redis[_0x8b22[21]](6379,config[_0x8b22[20]],redisConf);var io=require(_0x8b22[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[_0x8b22[23]]= function(){var _0x48edx16=function(_0x48edx17,_0x48edx18,_0x48edx19){if(_0x48edx17){io[_0x8b22[25]](_0x48edx17)[_0x8b22[24]](_0x48edx18,_0x48edx19)}else {io[_0x8b22[24]](_0x48edx18,_0x48edx19)}};var _0x48edx1a=function(_0x48edx1b){delete _0x48edx1b[_0x8b22[26]];delete _0x48edx1b[_0x8b22[27]];delete _0x48edx1b[_0x8b22[28]];delete _0x48edx1b[_0x8b22[29]];_0x48edx1b[_0x8b22[30]]= _0x48edx1b[_0x8b22[31]]|| _0x48edx1b[_0x8b22[30]];_0x48edx1b[_0x8b22[32]]= _0x48edx1b[_0x8b22[33]];_0x48edx1b[_0x8b22[34]]= _0x8b22[35];switch(_0x48edx1b[_0x8b22[53]]){case _0x8b22[36]:_0x48edx1b[_0x8b22[34]]= _0x8b22[35];break;case _0x8b22[38]:_0x48edx1b[_0x8b22[34]]= _0x8b22[37];break;case _0x8b22[40]:_0x48edx1b[_0x8b22[34]]= _0x8b22[39];break;case _0x8b22[42]:_0x48edx1b[_0x8b22[34]]= _0x8b22[41];break;case _0x8b22[44]:_0x48edx1b[_0x8b22[34]]= _0x8b22[43];break;case _0x8b22[46]:_0x48edx1b[_0x8b22[34]]= _0x8b22[45];break;case _0x8b22[48]:_0x48edx1b[_0x8b22[34]]= _0x8b22[47];break;case _0x8b22[50]:_0x48edx1b[_0x8b22[34]]= _0x8b22[49];break;case _0x8b22[52]:_0x48edx1b[_0x8b22[34]]= _0x8b22[51];break;default:};_0x48edx1b[_0x8b22[53]]= Number(_0x48edx1b[_0x8b22[53]]);if(_0x48edx1b[_0x8b22[55]](_0x8b22[54])){_0x48edx1b[_0x8b22[54]]= Number(_0x48edx1b[_0x8b22[54]])};if(_0x48edx1b[_0x8b22[55]](_0x8b22[56])){_0x48edx1b[_0x8b22[56]]= Number(_0x48edx1b[_0x8b22[56]])};if(_0x48edx1b[_0x8b22[55]](_0x8b22[57])){if(_0x48edx1b[_0x8b22[57]]=== _0x8b22[36]){_0x48edx1b[_0x8b22[57]]= null}else {_0x48edx1b[_0x8b22[57]]= moment()[_0x8b22[59]](_0x8b22[58])}};_0x48edx1b[_0x8b22[60]]= parseInt(_0x48edx1b[_0x8b22[60]],10)?true:false};function _0x48edx1c(_0x48edx1d){if(!params[_0x8b22[62]][_0x8b22[61]][_0x48edx1d]){params[_0x8b22[62]][_0x8b22[61]][_0x48edx1d]= {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 _0x48edx1e(){return function(){params[_0x8b22[62]][_0x8b22[61]]= {};params[_0x8b22[62]][_0x8b22[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[_0x8b22[97]]({attributes:[_0x8b22[31]],raw:true})[_0x8b22[92]](function(_0x48edx20){if(_0x48edx20){_[_0x8b22[93]](_0x48edx20,function(_0x48edx1d){_0x48edx1c(_0x48edx1d[_0x8b22[31]])});return ReportQueue[_0x8b22[97]]({attributes:[_0x8b22[69],_0x8b22[79],_0x8b22[82],_0x8b22[94],_0x8b22[95],_0x8b22[96],_0x8b22[77]],raw:true})}})[_0x8b22[92]](function(_0x48edx20){if(_0x48edx20){var _0x48edx21;var _0x48edx22;var _0x48edx23=_0x48edx20[_0x8b22[68]];for(var _0x48edx24=0;_0x48edx24< _0x48edx23;_0x48edx24++){_0x48edx21= _0x48edx20[_0x48edx24];_0x48edx22= _0x48edx21[_0x8b22[69]];_0x48edx1c(_0x48edx22);params[_0x8b22[62]][_0x8b22[63]][_0x8b22[70]]++;params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[70]]++;if(utils[_0x8b22[71]](_0x48edx21)){params[_0x8b22[62]][_0x8b22[63]][_0x8b22[72]]++;params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[72]]++};if(utils[_0x8b22[73]](_0x48edx21)){params[_0x8b22[62]][_0x8b22[63]][_0x8b22[74]]++;params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[74]]++};if(utils[_0x8b22[75]](_0x48edx21)){params[_0x8b22[62]][_0x8b22[63]][_0x8b22[76]]++;params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[76]]++;params[_0x8b22[62]][_0x8b22[63]][_0x8b22[77]]+= _0x48edx21[_0x8b22[77]]|| 0;params[_0x8b22[62]][_0x8b22[63]][_0x8b22[78]]+= moment(_0x48edx21[_0x8b22[82]])[_0x8b22[81]](moment(_0x48edx21[_0x8b22[79]]),_0x8b22[80]);params[_0x8b22[62]][_0x8b22[63]][_0x8b22[83]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[77]]/ params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[76]]);params[_0x8b22[62]][_0x8b22[63]][_0x8b22[85]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[78]]/ params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[76]]);params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[77]]+= _0x48edx21[_0x8b22[77]]|| 0;params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[78]]+= moment(_0x48edx21[_0x8b22[82]])[_0x8b22[81]](moment(_0x48edx21[_0x8b22[79]]),_0x8b22[80]);params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[83]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[77]]/ params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[76]]);params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[85]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[78]]/ params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[76]])};if(utils[_0x8b22[86]](_0x48edx21)){params[_0x8b22[62]][_0x8b22[63]][_0x8b22[87]]++;params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[87]]++};if(utils[_0x8b22[88]](_0x48edx21)){params[_0x8b22[62]][_0x8b22[63]][_0x8b22[89]]++;params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[89]]++};params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[90]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[76]]/ (params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[76]]+ params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[87]])* 100,2);params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[91]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[87]]/ (params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[76]]+ params[_0x8b22[62]][_0x8b22[61]][_0x48edx22][_0x8b22[87]])* 100,2);params[_0x8b22[62]][_0x8b22[63]][_0x8b22[90]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[63]][_0x8b22[76]]/ (params[_0x8b22[62]][_0x8b22[63]][_0x8b22[76]]+ params[_0x8b22[62]][_0x8b22[63]][_0x8b22[87]])* 100,2);params[_0x8b22[62]][_0x8b22[63]][_0x8b22[91]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[63]][_0x8b22[87]]/ (params[_0x8b22[62]][_0x8b22[63]][_0x8b22[76]]+ params[_0x8b22[62]][_0x8b22[63]][_0x8b22[87]])* 100,2)}}})[_0x8b22[67]](function(_0x48edx1f){logger[_0x8b22[66]](_0x8b22[64],_0x48edx1f[_0x8b22[65]])})}}function _0x48edx25(){return function(){params[_0x8b22[98]][_0x8b22[63]]= {total:0,answered:0,sumDuration:0,avgDuration:0,tigerdial:0,answerRate:0};return ReportCall[_0x8b22[97]]({where:{type:[_0x8b22[98],_0x8b22[101]],createdAt:{$gte:moment()[_0x8b22[111]](_0x8b22[110])}},attributes:[_0x8b22[112],_0x8b22[104],_0x8b22[107]],raw:true})[_0x8b22[92]](function(_0x48edx20){if(_0x48edx20){var _0x48edx26=_[_0x8b22[100]](_0x48edx20,{type:_0x8b22[98]});var _0x48edx27=_[_0x8b22[100]](_0x48edx20,{type:_0x8b22[101]});if(_0x48edx26[_0x8b22[68]]){params[_0x8b22[98]][_0x8b22[63]][_0x8b22[70]]= _0x48edx26[_0x8b22[68]];params[_0x8b22[98]][_0x8b22[63]][_0x8b22[102]]= _[_0x8b22[105]](_0x48edx26,_0x8b22[104])[_0x8b22[103]]|| 0;params[_0x8b22[98]][_0x8b22[63]][_0x8b22[106]]= _[_0x8b22[108]](_0x48edx26,_0x8b22[107]);if(params[_0x8b22[98]][_0x8b22[63]][_0x8b22[102]]){params[_0x8b22[98]][_0x8b22[63]][_0x8b22[109]]= _[_0x8b22[84]]((_[_0x8b22[108]](_0x48edx26,_0x8b22[107])/ params[_0x8b22[98]][_0x8b22[63]][_0x8b22[102]]));params[_0x8b22[98]][_0x8b22[63]][_0x8b22[90]]= _[_0x8b22[84]](params[_0x8b22[98]][_0x8b22[63]][_0x8b22[102]]/ params[_0x8b22[98]][_0x8b22[63]][_0x8b22[70]]* 100,1)}};if(_0x48edx27[_0x8b22[68]]){params[_0x8b22[98]][_0x8b22[63]][_0x8b22[101]]= _0x48edx27[_0x8b22[68]]}}})[_0x8b22[67]](function(_0x48edx1f){logger[_0x8b22[66]](_0x8b22[99],_0x48edx1f[_0x8b22[65]])})}}BPromise[_0x8b22[113]]()[_0x8b22[92]](_0x48edx1e())[_0x8b22[92]](_0x48edx25());return {cdr:function(_0x48edx1b){return function(_0x48edx20){_0x48edx16(_0x8b22[114],_0x8b22[115],_0x48edx1b);if(_0x48edx1b[_0x8b22[112]]== _0x8b22[98]|| _0x48edx1b[_0x8b22[112]]== _0x8b22[101]){if(_0x48edx1b[_0x8b22[112]]== _0x8b22[98]){params[_0x8b22[98]][_0x8b22[63]][_0x8b22[70]]++;_0x48edx1b[_0x8b22[104]]== _0x8b22[103]&& (params[_0x8b22[98]][_0x8b22[63]][_0x8b22[102]]++);params[_0x8b22[98]][_0x8b22[63]][_0x8b22[106]]+= Number(_0x48edx1b[_0x8b22[107]]);if(params[_0x8b22[98]][_0x8b22[63]][_0x8b22[102]]){params[_0x8b22[98]][_0x8b22[63]][_0x8b22[109]]= _[_0x8b22[84]](params[_0x8b22[98]][_0x8b22[63]][_0x8b22[106]]/ params[_0x8b22[98]][_0x8b22[63]][_0x8b22[102]]);params[_0x8b22[98]][_0x8b22[63]][_0x8b22[90]]= _[_0x8b22[84]](params[_0x8b22[98]][_0x8b22[63]][_0x8b22[102]]/ params[_0x8b22[98]][_0x8b22[63]][_0x8b22[70]]* 100,1)}}else {params[_0x8b22[98]][_0x8b22[63]][_0x8b22[101]]++};_0x48edx16(_0x8b22[116],_0x8b22[117],params[_0x8b22[98]][_0x8b22[63]])}}},send:function(_0x48edx1b){return function(_0x48edx20){return BPromise[_0x8b22[113]]()}},hangup:function(_0x48edx1b){return function(_0x48edx20){if(params[_0x8b22[98]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]]){delete params[_0x8b22[98]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]]};if(params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]]){delete params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]]};var _0x48edx28={uniqueid:_0x48edx1b[_0x8b22[118]],linkedid:_0x48edx1b[_0x8b22[120]],endtime:moment()[_0x8b22[59]](_0x8b22[58]),lastevent:_0x8b22[121],updatedAt:moment()[_0x8b22[59]](_0x8b22[58])};_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx1b[_0x8b22[124]][_0x8b22[123]](/\/|-/)[1]),_0x8b22[125],_0x48edx28);_0x48edx16(_0x8b22[126],_0x8b22[125],_0x48edx28);_0x48edx16(_0x8b22[127],_0x8b22[125],_0x48edx28);if(_0x48edx20){triggers[_0x8b22[128]](_0x48edx20)};return BPromise[_0x8b22[113]]()}},devicestatechange:function(_0x48edx1b){return function(_0x48edx20){return User[_0x8b22[142]]({where:{name:_0x48edx1b[_0x8b22[141]][_0x8b22[140]](_0x8b22[138],_0x8b22[139])},raw:true})[_0x8b22[92]](function(_0x48edx29){if(_0x48edx29){var _0x48edx28=_[_0x8b22[133]]({newValues:{id:_0x48edx29[_0x8b22[131]],status:_0x48edx1b[_0x8b22[132]],statusAt:moment()[_0x8b22[59]](_0x8b22[58])}},_0x48edx29,{status:_0x48edx1b[_0x8b22[132]],statusAt:moment()[_0x8b22[59]](_0x8b22[58])});_0x48edx28[_0x8b22[26]]= _0x8b22[134];_0x48edx16(util[_0x8b22[59]](_0x8b22[135],_0x48edx29[_0x8b22[136]],_0x48edx29[_0x8b22[131]]),_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[127],_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[126],_0x8b22[137],_0x48edx28)}})[_0x8b22[67]](function(_0x48edx1f){logger[_0x8b22[130]](_0x8b22[129],_0x48edx1f)})}},peerstatus:function(_0x48edx1b){return function(_0x48edx20){if(_0x48edx20&& _0x48edx20[0]){_[_0x8b22[93]](_0x48edx20[1],function(_0x48edx2a){if(!params[_0x8b22[143]][_0x48edx2a[_0x8b22[31]]]){params[_0x8b22[143]][_0x48edx2a[_0x8b22[31]]]= {name:_0x48edx2a[_0x8b22[31]]}};params[_0x8b22[143]][_0x48edx2a[_0x8b22[31]]][_0x8b22[144]]= _0x48edx1b[_0x8b22[144]];_0x48edx16(_0x8b22[145],_0x8b22[146],params[_0x8b22[143]][_0x48edx2a[_0x8b22[31]]])})};return BPromise[_0x8b22[113]]()}},registry:function(_0x48edx1b){return function(_0x48edx20){if(_0x48edx20&& _0x48edx20[0]){_[_0x8b22[93]](_0x48edx20[1],function(_0x48edx2a){if(!params[_0x8b22[143]][_0x48edx2a[_0x8b22[31]]]){params[_0x8b22[143]][_0x48edx2a[_0x8b22[31]]]= {name:_0x48edx2a[_0x8b22[31]]}};params[_0x8b22[143]][_0x48edx2a[_0x8b22[31]]][_0x8b22[53]]= _0x48edx1b[_0x8b22[53]];_0x48edx16(_0x8b22[145],_0x8b22[146],params[_0x8b22[143]][_0x48edx2a[_0x8b22[31]]])})};return BPromise[_0x8b22[113]]()}},agentcalled:function(_0x48edx1b){return function(_0x48edx20){if(_0x48edx20){_0x48edx1b[_0x8b22[147]]&& (_0x48edx20[_0x8b22[148]][_0x8b22[147]]= _0x48edx1b[_0x8b22[147]]);_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx20[_0x8b22[30]]),_0x8b22[149],_0x48edx20);triggers[_0x8b22[150]](_0x48edx20)};return User[_0x8b22[142]]({where:{name:_0x48edx1b[_0x8b22[30]],voicePause:false},raw:true})[_0x8b22[92]](function(_0x48edx29){if(_0x48edx29){var _0x48edx2b=moment()[_0x8b22[59]](_0x8b22[58]);var _0x48edx28=_[_0x8b22[133]]({newValues:{id:_0x48edx29[_0x8b22[131]],queueStatus:_0x8b22[152],queueStatusAt:_0x48edx2b,lastQueue:_0x48edx1b[_0x8b22[69]]}},_0x48edx29,{queueStatus:_0x8b22[152],queueStatusAt:_0x48edx2b,lastQueue:_0x48edx1b[_0x8b22[69]]});_0x48edx28[_0x8b22[26]]= _0x8b22[153];_0x48edx16(util[_0x8b22[59]](_0x8b22[135],_0x48edx29[_0x8b22[136]],_0x48edx29[_0x8b22[131]]),_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[127],_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[126],_0x8b22[137],_0x48edx28)}})[_0x8b22[67]](function(_0x48edx1f){logger[_0x8b22[66]](_0x8b22[151],_0x48edx1f)})}},agentcomplete:function(_0x48edx1b){return function(_0x48edx20){if(_0x48edx20){triggers[_0x8b22[154]](_0x48edx20)};if(params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[74]]){params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[74]]--};if(params[_0x8b22[62]][_0x8b22[63]][_0x8b22[74]]){params[_0x8b22[62]][_0x8b22[63]][_0x8b22[74]]--;_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[155],{type:_0x8b22[74],amount:-1,queue:_0x48edx1b[_0x8b22[69]]})};params[_0x8b22[62]][_0x8b22[63]][_0x8b22[76]]++;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[76]]++;_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[155],{type:_0x8b22[121],amount:1,queue:_0x48edx1b[_0x8b22[69]]});params[_0x8b22[62]][_0x8b22[63]][_0x8b22[90]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[63]][_0x8b22[76]]/ (params[_0x8b22[62]][_0x8b22[63]][_0x8b22[76]]+ params[_0x8b22[62]][_0x8b22[63]][_0x8b22[87]])* 100,2);params[_0x8b22[62]][_0x8b22[63]][_0x8b22[91]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[63]][_0x8b22[87]]/ (params[_0x8b22[62]][_0x8b22[63]][_0x8b22[76]]+ params[_0x8b22[62]][_0x8b22[63]][_0x8b22[87]])* 100,2);params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[90]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[76]]/ (params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[76]]+ params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[87]])* 100,2);params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[91]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[87]]/ (params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[76]]+ params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[87]])* 100,2);params[_0x8b22[62]][_0x8b22[63]][_0x8b22[78]]+= Number(_0x48edx1b[_0x8b22[78]]);params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[78]]+= Number(_0x48edx1b[_0x8b22[78]]);_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[155],{type:_0x8b22[78],amount:Number(_0x48edx1b[_0x8b22[78]]),queue:_0x48edx1b[_0x8b22[69]]});params[_0x8b22[62]][_0x8b22[63]][_0x8b22[85]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[63]][_0x8b22[78]]/ params[_0x8b22[62]][_0x8b22[63]][_0x8b22[76]]);params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[85]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[78]]/ params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[76]]);params[_0x8b22[62]][_0x8b22[63]][_0x8b22[77]]+= Number(_0x48edx1b[_0x8b22[77]]);params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[77]]+= Number(_0x48edx1b[_0x8b22[77]]);_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[155],{type:_0x8b22[77],amount:Number(_0x48edx1b[_0x8b22[77]]),queue:_0x48edx1b[_0x8b22[69]]});params[_0x8b22[62]][_0x8b22[63]][_0x8b22[83]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[63]][_0x8b22[77]]/ params[_0x8b22[62]][_0x8b22[63]][_0x8b22[76]]);params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[83]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[77]]/ params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[76]]);var _0x48edx28;var _0x48edx2b=moment()[_0x8b22[59]](_0x8b22[58]);return ReportAgent[_0x8b22[142]]({where:{uniqueid:_0x48edx1b[_0x8b22[118]],destuniqueid:_0x48edx1b[_0x8b22[162]]},raw:true})[_0x8b22[92]](function(_0x48edx2c){if(_0x48edx2c){_0x48edx28= _[_0x8b22[133]]({},_0x48edx2c,{lastevent:_0x8b22[121],agentcomplete:true,agentcompleteAt:_0x48edx2b,talktime:Number(_0x48edx1b[_0x8b22[78]]),reason:_0x48edx1b[_0x8b22[159]]});_0x48edx1b[_0x8b22[147]]&& (_0x48edx28[_0x8b22[147]]= _0x48edx1b[_0x8b22[147]]);_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx2c[_0x8b22[30]]),_0x8b22[160],_0x48edx28)};return ReportQueue[_0x8b22[142]]({where:{uniqueid:_0x48edx1b[_0x8b22[118]]},order:_0x8b22[161],raw:true})})[_0x8b22[92]](function(_0x48edx2c){if(_0x48edx2c){_0x48edx28= _[_0x8b22[133]]({},_0x48edx2c,{queuecallercomplete:true,queuecallercompleteAt:_0x48edx2b});_0x48edx16(_0x48edx2c[_0x8b22[69]],_0x8b22[158],_0x48edx28)};return User[_0x8b22[142]]({where:{name:_0x48edx1b[_0x8b22[30]]},raw:true})})[_0x8b22[92]](function(_0x48edx29){if(_0x48edx29){var _0x48edx28=_[_0x8b22[133]]({newValues:{id:_0x48edx29[_0x8b22[131]],queueStatus:_0x8b22[121],queueStatusAt:_0x48edx2b,lastQueue:_0x48edx1b[_0x8b22[69]]}},_0x48edx29,{queueStatus:_0x8b22[121],queueStatusAt:_0x48edx2b,lastQueue:_0x48edx1b[_0x8b22[69]]});_0x48edx28[_0x8b22[26]]= _0x8b22[157];_0x48edx16(util[_0x8b22[59]](_0x8b22[135],_0x48edx29[_0x8b22[136]],_0x48edx29[_0x8b22[131]]),_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[127],_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[126],_0x8b22[137],_0x48edx28)}})[_0x8b22[67]](function(_0x48edx1f){logger[_0x8b22[66]](_0x8b22[156],_0x48edx1f)})}},agentconnect:function(_0x48edx1b){return function(_0x48edx20){if(_0x48edx20){triggers[_0x8b22[154]](_0x48edx20)};if(params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[72]]){params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[72]]--;_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[155],{type:_0x8b22[72],amount:-1,queue:_0x48edx1b[_0x8b22[69]]})};if(params[_0x8b22[62]][_0x8b22[63]][_0x8b22[72]]){params[_0x8b22[62]][_0x8b22[63]][_0x8b22[72]]--};if(params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]]){params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]][_0x8b22[163]]= _0x48edx1b[_0x8b22[164]];params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]][_0x8b22[165]]= _0x48edx1b[_0x8b22[165]];params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]][_0x8b22[77]]= Number(_0x48edx1b[_0x8b22[77]]);params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]][_0x8b22[166]]= Number(_0x48edx1b[_0x8b22[166]]);params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]][_0x8b22[32]]= _0x48edx1b[_0x8b22[32]];params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]][_0x8b22[30]]= _0x48edx1b[_0x8b22[30]]};params[_0x8b22[62]][_0x8b22[63]][_0x8b22[74]]++;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[74]]++;_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[155],{type:_0x8b22[74],amount:1,queue:_0x48edx1b[_0x8b22[69]]});var _0x48edx28;var _0x48edx2b=moment()[_0x8b22[59]](_0x8b22[58]);return ReportQueue[_0x8b22[142]]({where:{uniqueid:_0x48edx1b[_0x8b22[118]]},order:_0x8b22[161],raw:true})[_0x8b22[92]](function(_0x48edx2c){if(_0x48edx2c){_0x48edx28= _[_0x8b22[133]]({},_0x48edx2c,{queuecallerleaveAt:moment()[_0x8b22[59]](_0x8b22[58]),holdtime:_0x48edx1b[_0x8b22[77]],assigned:true,lastAssignedTo:_0x48edx1b[_0x8b22[30]]});_0x48edx16(_0x48edx2c[_0x8b22[69]],_0x8b22[158],_0x48edx28)};return ReportAgent[_0x8b22[142]]({where:{uniqueid:_0x48edx1b[_0x8b22[118]],destuniqueid:_0x48edx1b[_0x8b22[162]]},raw:true})})[_0x8b22[92]](function(_0x48edx2c){if(_0x48edx2c){_0x48edx28= _[_0x8b22[133]]({},_0x48edx2c,{lastevent:_0x8b22[168],agentconnectAt:moment()[_0x8b22[59]](_0x8b22[58]),holdtime:_0x48edx1b[_0x8b22[77]]});_0x48edx1b[_0x8b22[147]]&& (_0x48edx28[_0x8b22[147]]= _0x48edx1b[_0x8b22[147]]);_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx2c[_0x8b22[30]]),_0x8b22[160],_0x48edx28)};return ReportAgent[_0x8b22[97]]({where:{uniqueid:_0x48edx1b[_0x8b22[118]],destuniqueid:{$ne:_0x48edx1b[_0x8b22[162]]},reason:null},raw:true})})[_0x8b22[92]](function(_0x48edx2e){if(_0x48edx2e&& _0x48edx2e[_0x8b22[68]]){_[_0x8b22[93]](_0x48edx2e,function(_0x48edx2c){_0x48edx28= _[_0x8b22[133]]({},_0x48edx2c,{lastevent:_0x8b22[170],agentringnoanswer:true,agentringnoanswerAt:_0x48edx2b,reason:_0x8b22[170],answeredelsewheredestinationuniqueid:_0x48edx1b[_0x8b22[162]],answeredelsewheremembername:_0x48edx1b[_0x8b22[30]]});_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx2c[_0x8b22[30]]),_0x8b22[160],_0x48edx28)})};return User[_0x8b22[142]]({where:{name:_0x48edx1b[_0x8b22[30]]},raw:true})})[_0x8b22[92]](function(_0x48edx29){if(_0x48edx29){var _0x48edx28=_[_0x8b22[133]]({newValues:{id:_0x48edx29[_0x8b22[131]],queueStatus:_0x8b22[168],queueStatusAt:_0x48edx2b,lastQueue:_0x48edx1b[_0x8b22[69]]}},_0x48edx29,{queueStatus:_0x8b22[168],queueStatusAt:_0x48edx2b,lastQueue:_0x48edx1b[_0x8b22[69]]});_0x48edx28[_0x8b22[26]]= _0x8b22[169];_0x48edx16(util[_0x8b22[59]](_0x8b22[135],_0x48edx29[_0x8b22[136]],_0x48edx29[_0x8b22[131]]),_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[127],_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[126],_0x8b22[137],_0x48edx28)};return User[_0x8b22[97]]({where:{lastQueue:_0x48edx1b[_0x8b22[69]],name:{$ne:_0x48edx1b[_0x8b22[30]]}},raw:true})})[_0x8b22[92]](function(_0x48edx2d){if(_0x48edx2d&& _0x48edx2d[_0x8b22[68]]){_[_0x8b22[93]](_0x48edx2d,function(_0x48edx29){var _0x48edx28=_[_0x8b22[133]]({newValues:{id:_0x48edx29[_0x8b22[131]],queueStatus:_0x8b22[121],queueStatusAt:_0x48edx2b}},_0x48edx29,{queueStatus:_0x8b22[121],queueStatusAt:_0x48edx2b});_0x48edx16(util[_0x8b22[59]](_0x8b22[135],_0x48edx29[_0x8b22[136]],_0x48edx29[_0x8b22[131]]),_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[127],_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[126],_0x8b22[137],_0x48edx28)})}})[_0x8b22[67]](function(_0x48edx1f){logger[_0x8b22[66]](_0x8b22[167],_0x48edx1f)})}},agentringnoanswer:function(_0x48edx1b){return function(_0x48edx20){if(_0x48edx20){triggers[_0x8b22[154]](_0x48edx20)};var _0x48edx28;var _0x48edx2b=moment()[_0x8b22[59]](_0x8b22[58]);return User[_0x8b22[142]]({where:{name:_0x48edx1b[_0x8b22[30]]},raw:true})[_0x8b22[92]](function(_0x48edx29){if(_0x48edx29){var _0x48edx28=_[_0x8b22[133]]({newValues:{id:_0x48edx29[_0x8b22[131]],queueStatus:_0x8b22[121],queueStatusAt:_0x48edx2b,lastQueue:_0x48edx1b[_0x8b22[69]]}},_0x48edx29,{queueStatus:_0x8b22[121],queueStatusAt:_0x48edx2b,lastQueue:_0x48edx1b[_0x8b22[69]]});_0x48edx28[_0x8b22[26]]= _0x8b22[173];_0x48edx16(util[_0x8b22[59]](_0x8b22[135],_0x48edx29[_0x8b22[136]],_0x48edx29[_0x8b22[131]]),_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[127],_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[126],_0x8b22[137],_0x48edx28)};return ReportAgent[_0x8b22[142]]({where:{uniqueid:_0x48edx1b[_0x8b22[118]],destuniqueid:_0x48edx1b[_0x8b22[162]]},raw:true})})[_0x8b22[92]](function(_0x48edx2c){if(_0x48edx2c){_0x48edx28= _[_0x8b22[133]]({},_0x48edx2c,{lastevent:_0x8b22[172],agentringnoanswer:true,agentringnoanswerAt:moment()[_0x8b22[59]](_0x8b22[58]),reason:_0x8b22[172]});_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx2c[_0x8b22[30]]),_0x8b22[160],_0x48edx28)}})[_0x8b22[67]](function(_0x48edx1f){logger[_0x8b22[66]](_0x8b22[171],_0x48edx1f)})}},queuememberadded:function(_0x48edx1b){return function(_0x48edx20){if(_0x48edx20){_0x48edx16(_0x48edx20[_0x8b22[69]],_0x8b22[174],_0x48edx20);_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx20.UserId),_0x8b22[174],_0x48edx20)};return BPromise[_0x8b22[113]]()}},queuememberremoved:function(_0x48edx1b){return function(_0x48edx20){if(params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]]){delete params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[114]][_0x48edx1b[_0x8b22[30]]]};return User[_0x8b22[142]]({where:{name:_0x48edx1b[_0x8b22[32]][_0x8b22[140]](_0x8b22[138],_0x8b22[139])},raw:true})[_0x8b22[92]](function(_0x48edx29){if(_0x48edx29){_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[176],{queue:_0x48edx1b[_0x8b22[69]],UserId:_0x48edx29[_0x8b22[131]]});_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx29[_0x8b22[131]]),_0x8b22[176],{queue:_0x48edx1b[_0x8b22[69]],UserId:_0x48edx29[_0x8b22[131]]})}})[_0x8b22[67]](function(_0x48edx1f){logger[_0x8b22[66]](_0x8b22[175],_0x48edx1f)})}},queuememberpause:function(_0x48edx1b){return function(_0x48edx20){if(_0x48edx20){_0x48edx16(_0x48edx20[_0x8b22[69]],_0x8b22[174],_0x48edx20);_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx20.UserId),_0x8b22[174],_0x48edx20)}}},queuememberpenalty:function(_0x48edx1b){return function(_0x48edx20){return BPromise[_0x8b22[113]]()}},queuememberringinuse:function(_0x48edx1b){return function(_0x48edx20){return BPromise[_0x8b22[113]]()}},queuemember:function(_0x48edx1b){return function(_0x48edx20){_0x48edx1a(_0x48edx1b);_0x48edx1c(_0x48edx1b[_0x8b22[69]]);params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[114]][_0x48edx1b[_0x8b22[31]]]= _0x48edx1b;return BPromise[_0x8b22[113]]()}},queuecallerjoin:function(_0x48edx1b){return function(_0x48edx20){if(!params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]]){params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]]= {};params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[72]]= 0;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[74]]= 0;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[76]]= 0;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[87]]= 0;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[89]]= 0;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[77]]= 0;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[78]]= 0;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[83]]= 0;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[85]]= 0;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[90]]= 0;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[91]]= 0;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[70]]= 0};params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]]= {channel:_0x48edx1b[_0x8b22[124]],channelstate:Number(_0x48edx1b[_0x8b22[177]]),channelstatedesc:_0x48edx1b[_0x8b22[178]],calleridnum:_0x48edx1b[_0x8b22[179]],calleridname:_0x48edx1b[_0x8b22[180]],exten:_0x48edx1b[_0x8b22[181]],priority:Number(_0x48edx1b[_0x8b22[182]]),uniqueid:_0x48edx1b[_0x8b22[118]],queue:_0x48edx1b[_0x8b22[69]],position:Number(_0x48edx1b[_0x8b22[183]]),count:Number(_0x48edx1b[_0x8b22[184]])};params[_0x8b22[62]][_0x8b22[63]][_0x8b22[72]]++;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[72]]++;_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[155],{type:_0x8b22[70],amount:1,queue:_0x48edx1b[_0x8b22[69]]});params[_0x8b22[62]][_0x8b22[63]][_0x8b22[70]]++;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[70]]++;_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[155],{type:_0x8b22[72],amount:1,queue:_0x48edx1b[_0x8b22[69]]});if(_0x48edx20){_0x48edx16(_0x48edx20[_0x8b22[69]],_0x8b22[185],_0x48edx20)};return BPromise[_0x8b22[113]]()}},queuecallerabandon:function(_0x48edx1b){return function(_0x48edx20){if(_0x48edx20&& _0x48edx20[_0x8b22[186]]&& _0x48edx20[_0x8b22[186]][0]){_[_0x8b22[93]](_0x48edx20[_0x8b22[186]][1],function(_0x48edx2c){_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx2c[_0x8b22[30]]),_0x8b22[160],_0x48edx2c)})};if(_0x48edx20&& _0x48edx20[_0x8b22[187]]){_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[158],_0x48edx20[_0x8b22[187]]);_0x48edx20[_0x8b22[187]][_0x8b22[148]][_0x8b22[188]]= _0x8b22[87];_0x48edx20[_0x8b22[187]][_0x8b22[189]][_0x8b22[188]]= true;triggers[_0x8b22[154]](_0x48edx20[_0x8b22[187]])};var _0x48edx28;var _0x48edx2b=moment()[_0x8b22[59]](_0x8b22[58]);if(params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[72]]){params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[72]]--;_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[155],{type:_0x8b22[72],amount:-1,queue:_0x48edx1b[_0x8b22[69]]})};if(params[_0x8b22[62]][_0x8b22[63]][_0x8b22[72]]){params[_0x8b22[62]][_0x8b22[63]][_0x8b22[72]]--};if(params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]]){params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]][_0x8b22[77]]= Number(_0x48edx1b[_0x8b22[77]]);params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]][_0x8b22[183]]= Number(_0x48edx1b[_0x8b22[183]]);params[_0x8b22[62]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]][_0x8b22[190]]= Number(_0x48edx1b[_0x8b22[190]])};params[_0x8b22[62]][_0x8b22[63]][_0x8b22[87]]++;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[87]]++;_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[155],{type:_0x8b22[191],amount:1,queue:_0x48edx1b[_0x8b22[69]]});params[_0x8b22[62]][_0x8b22[63]][_0x8b22[90]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[63]][_0x8b22[76]]/ (params[_0x8b22[62]][_0x8b22[63]][_0x8b22[76]]+ params[_0x8b22[62]][_0x8b22[63]][_0x8b22[87]])* 100,2);params[_0x8b22[62]][_0x8b22[63]][_0x8b22[91]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[63]][_0x8b22[87]]/ (params[_0x8b22[62]][_0x8b22[63]][_0x8b22[76]]+ params[_0x8b22[62]][_0x8b22[63]][_0x8b22[87]])* 100,2);params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[90]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[76]]/ (params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[76]]+ params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[87]])* 100,2);params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[91]]= _[_0x8b22[84]](params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[87]]/ (params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[76]]+ params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[87]])* 100,2);return User[_0x8b22[97]]({where:{lastQueue:_0x48edx1b[_0x8b22[69]]},raw:true})[_0x8b22[92]](function(_0x48edx2f){if(_0x48edx2f&& _0x48edx2f[_0x8b22[68]]){var _0x48edx28;_[_0x8b22[93]](_0x48edx2f,function(_0x48edx30){_0x48edx28= _[_0x8b22[133]]({newValues:{id:_0x48edx30[_0x8b22[131]],queueStatus:_0x8b22[121],queueStatusAt:_0x48edx2b,lastQueue:_0x48edx1b[_0x8b22[69]]}},_0x48edx30,{id:_0x48edx30[_0x8b22[131]],queueStatus:_0x8b22[121],queueStatusAt:_0x48edx2b,lastQueue:_0x48edx1b[_0x8b22[69]]});_0x48edx28[_0x8b22[26]]= _0x8b22[95];_0x48edx16(util[_0x8b22[59]](_0x8b22[135],_0x48edx30[_0x8b22[136]],_0x48edx30[_0x8b22[131]]),_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[127],_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[126],_0x8b22[137],_0x48edx28)})}})[_0x8b22[67]](function(_0x48edx1f){logger[_0x8b22[66]](_0x8b22[192],_0x48edx1f)})}},blindtransfer:function(_0x48edx1b){return function(_0x48edx20){_0x48edx16(null,_0x48edx1b[_0x8b22[26]][_0x8b22[193]](),_0x48edx1b);return BPromise[_0x8b22[113]]()}},attendedtransfer:function(_0x48edx1b){return function(_0x48edx20){_0x48edx16(null,_0x48edx1b[_0x8b22[26]][_0x8b22[193]](),_0x48edx1b);return BPromise[_0x8b22[113]]()}},dialbegin:function(_0x48edx1b){return function(_0x48edx20){params[_0x8b22[98]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]]= {channel:_0x48edx1b[_0x8b22[124]],channelstate:Number(_0x48edx1b[_0x8b22[177]]),channelstatedesc:_0x48edx1b[_0x8b22[178]],calleridnum:_0x48edx1b[_0x8b22[179]],calleridname:_0x48edx1b[_0x8b22[180]],context:_0x48edx1b[_0x8b22[194]],exten:_0x48edx1b[_0x8b22[181]],priority:Number(_0x48edx1b[_0x8b22[182]]),dialstring:_0x48edx1b[_0x8b22[195]]};if(_0x48edx1b[_0x8b22[124]]){var _0x48edx28=_[_0x8b22[196]](_0x48edx1b,{starttime:moment()[_0x8b22[59]](_0x8b22[58]),lastevent:_0x8b22[152],updatedAt:moment()[_0x8b22[59]](_0x8b22[58])});_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx1b[_0x8b22[124]][_0x8b22[123]](/\/|-/)[1]),_0x8b22[197],_0x48edx28);_0x48edx16(_0x8b22[127],_0x8b22[125],_[_0x8b22[196]](_0x48edx28,{role:_0x8b22[127]}));_0x48edx16(_0x8b22[126],_0x8b22[125],_0x48edx28,_[_0x8b22[196]](_0x48edx28,{role:_0x8b22[126]}));if(_0x48edx20){triggers[_0x8b22[128]](_0x48edx20)}};return BPromise[_0x8b22[113]]()}},dialend:function(_0x48edx1b){return function(_0x48edx20){if(params[_0x8b22[98]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]]){params[_0x8b22[98]][_0x8b22[119]][_0x48edx1b[_0x8b22[118]]][_0x8b22[198]]= _0x48edx1b[_0x8b22[198]]};if(_0x48edx1b[_0x8b22[124]]){var _0x48edx2b=moment()[_0x8b22[59]](_0x8b22[58]);var _0x48edx28={dialstatus:_0x48edx1b[_0x8b22[198]],lastevent:(_0x48edx1b[_0x8b22[198]]=== _0x8b22[103])?_0x8b22[168]:_0x8b22[121],answertime:(_0x48edx1b[_0x8b22[198]]=== _0x8b22[103])?_0x48edx2b:null,uniqueid:_0x48edx1b[_0x8b22[118]],linkedid:_0x48edx1b[_0x8b22[120]],destuniqueid:_0x48edx1b[_0x8b22[162]],destlinkedid:_0x48edx1b[_0x8b22[199]],updatedAt:_0x48edx2b};_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx1b[_0x8b22[124]][_0x8b22[123]](/\/|-/)[1]),_0x8b22[125],_0x48edx28);_0x48edx16(_0x8b22[127],_0x8b22[125],_0x48edx28);_0x48edx16(_0x8b22[126],_0x8b22[125],_0x48edx28);if(_0x48edx20){triggers[_0x8b22[128]](_0x48edx20)}};return BPromise[_0x8b22[113]]()}},varset:function(_0x48edx1b){return function(_0x48edx20){if(_0x48edx1b[_0x8b22[201]][_0x8b22[55]](_0x8b22[200])){_0x48edx16(_0x8b22[127],_0x8b22[197],{uniqueid:_0x48edx1b[_0x8b22[118]],routeId:_0x48edx1b[_0x8b22[202]],updatedAt:moment()[_0x8b22[59]](_0x8b22[58])});_0x48edx16(_0x8b22[126],_0x8b22[197],{uniqueid:_0x48edx1b[_0x8b22[118]],routeId:_0x48edx1b[_0x8b22[202]],updatedAt:moment()[_0x8b22[59]](_0x8b22[58])})};if(_0x48edx1b){triggers[_0x8b22[203]](_0x48edx1b)};return BPromise[_0x8b22[113]]()}},queuecallerunmanaged:function(_0x48edx1b){return function(_0x48edx20){if(_0x48edx20){params[_0x8b22[62]][_0x8b22[63]][_0x8b22[89]]+= 1;params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[89]]+= 1;_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[155],{type:_0x8b22[89],amount:1,queue:_0x48edx1b[_0x8b22[69]]});if(params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[72]]){params[_0x8b22[62]][_0x8b22[61]][_0x48edx1b[_0x8b22[69]]][_0x8b22[72]]-= 1};if(params[_0x8b22[62]][_0x8b22[63]][_0x8b22[72]]){params[_0x8b22[62]][_0x8b22[63]][_0x8b22[72]]-= 1;_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[155],{type:_0x8b22[72],amount:-1,queue:_0x48edx1b[_0x8b22[69]]})};_0x48edx16(_0x48edx1b[_0x8b22[69]],_0x8b22[158],_0x48edx20);var _0x48edx2b=moment()[_0x8b22[59]](_0x8b22[58]);return User[_0x8b22[97]]({where:{lastQueue:_0x48edx1b[_0x8b22[69]]},raw:true})[_0x8b22[92]](function(_0x48edx2f){if(_0x48edx2f&& _0x48edx2f[_0x8b22[68]]){var _0x48edx28;_[_0x8b22[93]](_0x48edx2f,function(_0x48edx30){_0x48edx28= _[_0x8b22[133]]({newValues:{id:_0x48edx30[_0x8b22[131]],queueStatus:_0x8b22[121],queueStatusAt:_0x48edx2b,lastQueue:_0x48edx1b[_0x8b22[69]]}},_0x48edx30,{id:_0x48edx30[_0x8b22[131]],queueStatus:_0x8b22[121],queueStatusAt:_0x48edx2b,lastQueue:_0x48edx1b[_0x8b22[69]]});_0x48edx28[_0x8b22[26]]= _0x8b22[204];_0x48edx16(util[_0x8b22[59]](_0x8b22[135],_0x48edx30[_0x8b22[136]],_0x48edx30[_0x8b22[131]]),_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[127],_0x8b22[137],_0x48edx28);_0x48edx16(_0x8b22[126],_0x8b22[137],_0x48edx28)})}})[_0x8b22[67]](function(_0x48edx1f){logger[_0x8b22[66]](_0x8b22[192],_0x48edx1f)})}}},agentUpdate:function(_0x48edx30){return function(){_0x48edx30[_0x8b22[26]]= _0x8b22[205];_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx30[_0x8b22[131]]),_0x8b22[137],_0x48edx30);_0x48edx16(_0x8b22[127],_0x8b22[137],_0x48edx30);_0x48edx16(_0x8b22[126],_0x8b22[137],_0x48edx30)}},console:function(_0x48edx31){_0x48edx16(_0x48edx31[_0x8b22[206]],util[_0x8b22[59]](_0x8b22[207],_0x48edx31[_0x8b22[112]]),_0x48edx31[_0x8b22[208]])},realtimeQueueMembers:function(_0x48edx32){return function(){_[_0x8b22[210]](params[_0x8b22[62]][_0x8b22[61]],function(_0x48edx1d,_0x48edx22){if(_[_0x8b22[209]](_0x48edx32,_0x48edx22)){_[_0x8b22[210]](_0x48edx1d[_0x8b22[114]],function(_0x48edx30){_0x48edx16(_0x48edx22,_0x8b22[174],_0x48edx30)})}})}},updateTriggers:function(_0x48edx31){return function(){return triggers[_0x8b22[211]](_0x48edx31)}},queueAdd:function(_0x48edx33,_0x48edx34){return function(){if(_0x48edx33&& _0x48edx34){_[_0x8b22[93]](_0x48edx33,function(_0x48edx20){_0x48edx16(null,util[_0x8b22[59]](_0x8b22[212],_0x48edx34),_0x48edx20[0])})}}},queueRemove:function(_0x48edx20,_0x48edx34){return function(){if(_0x48edx20&& _0x48edx34){_0x48edx16(null,util[_0x8b22[59]](_0x8b22[213],_0x48edx34),_0x48edx20)}}},checkTriggers:function(_0x48edx31){return function(){return triggers[_0x8b22[214]](_0x48edx31)}},videoOn:function(_0x48edx1b){return function(){return triggers[_0x8b22[215]](_0x48edx1b)}},inboundInit:function(){return function(){return BPromise[_0x8b22[113]]()[_0x8b22[92]](_0x48edx1e())}},outboundInit:function(){return function(){return BPromise[_0x8b22[113]]()[_0x8b22[92]](_0x48edx25())}},reportFaxUpdate:function(_0x48edx35){return function(){_0x48edx35[_0x8b22[26]]= _0x8b22[216];_0x48edx16(util[_0x8b22[59]](_0x8b22[122],_0x48edx35[_0x8b22[217]]),_0x8b22[137],_0x48edx35);_0x48edx16(_0x8b22[126],_0x8b22[218],_0x48edx35)}},widgetValues:function(_0x48edx36,_0x48edx29){return function(){_[_0x8b22[210]](_0x48edx36,function(_0x48edx37,_0x48edx38){_0x48edx16(util[_0x8b22[59]](_0x8b22[135],_0x48edx29[_0x8b22[136]],_0x48edx29[_0x8b22[131]]),_0x8b22[219]+ _0x48edx38,_0x48edx37)})}},receivefax:function(_0x48edx1b){return function(_0x48edx31){if(_0x48edx31){return triggers[_0x8b22[220]](_0x48edx31)};return null}},reportQueueUpdate:function(_0x48edx35){return function(){_0x48edx35[_0x8b22[26]]= _0x8b22[221];_0x48edx16(util[_0x8b22[59]](_0x48edx35[_0x8b22[69]]),_0x8b22[158],_0x48edx35)}}}}
\ No newline at end of file