Built motion from commit 943eae279.|1.0.24
[motion.git] / server / config / ami / socket.js
index ec6a6dc..510354b 100644 (file)
@@ -1 +1 @@
-var _0xf275=["\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"];_0xf275[0];var _=require(_0xf275[1]);var util=require(_0xf275[2]);var moment=require(_0xf275[3]);var BPromise=require(_0xf275[4]);var redis=require(_0xf275[5]);var VoiceQueue=require(_0xf275[7])[_0xf275[6]];var ReportQueue=require(_0xf275[7])[_0xf275[8]];var ReportCall=require(_0xf275[7])[_0xf275[9]];var ReportAgent=require(_0xf275[7])[_0xf275[10]];var ReportDial=require(_0xf275[7])[_0xf275[11]];var ReportMember=require(_0xf275[7])[_0xf275[12]];var User=require(_0xf275[7])[_0xf275[13]];var Triggers=require(_0xf275[14]);var config=require(_0xf275[15]);var logger=require(_0xf275[17])(_0xf275[16]);var utils=require(_0xf275[18]);var redisConf;if(config[_0xf275[19]]){redisConf= {password:config[_0xf275[19]]}};var redisClient=redis[_0xf275[21]](6379,config[_0xf275[20]],redisConf);var io=require(_0xf275[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[_0xf275[23]]= function(){var _0x44b6x16=function(_0x44b6x17,_0x44b6x18,_0x44b6x19){if(_0x44b6x17){io[_0xf275[25]](_0x44b6x17)[_0xf275[24]](_0x44b6x18,_0x44b6x19)}else {io[_0xf275[24]](_0x44b6x18,_0x44b6x19)}};var _0x44b6x1a=function(_0x44b6x1b){delete _0x44b6x1b[_0xf275[26]];delete _0x44b6x1b[_0xf275[27]];delete _0x44b6x1b[_0xf275[28]];delete _0x44b6x1b[_0xf275[29]];_0x44b6x1b[_0xf275[30]]= _0x44b6x1b[_0xf275[31]]|| _0x44b6x1b[_0xf275[30]];_0x44b6x1b[_0xf275[32]]= _0x44b6x1b[_0xf275[33]];_0x44b6x1b[_0xf275[34]]= _0xf275[35];switch(_0x44b6x1b[_0xf275[53]]){case _0xf275[36]:_0x44b6x1b[_0xf275[34]]= _0xf275[35];break;case _0xf275[38]:_0x44b6x1b[_0xf275[34]]= _0xf275[37];break;case _0xf275[40]:_0x44b6x1b[_0xf275[34]]= _0xf275[39];break;case _0xf275[42]:_0x44b6x1b[_0xf275[34]]= _0xf275[41];break;case _0xf275[44]:_0x44b6x1b[_0xf275[34]]= _0xf275[43];break;case _0xf275[46]:_0x44b6x1b[_0xf275[34]]= _0xf275[45];break;case _0xf275[48]:_0x44b6x1b[_0xf275[34]]= _0xf275[47];break;case _0xf275[50]:_0x44b6x1b[_0xf275[34]]= _0xf275[49];break;case _0xf275[52]:_0x44b6x1b[_0xf275[34]]= _0xf275[51];break;default:};_0x44b6x1b[_0xf275[53]]= Number(_0x44b6x1b[_0xf275[53]]);if(_0x44b6x1b[_0xf275[55]](_0xf275[54])){_0x44b6x1b[_0xf275[54]]= Number(_0x44b6x1b[_0xf275[54]])};if(_0x44b6x1b[_0xf275[55]](_0xf275[56])){_0x44b6x1b[_0xf275[56]]= Number(_0x44b6x1b[_0xf275[56]])};if(_0x44b6x1b[_0xf275[55]](_0xf275[57])){if(_0x44b6x1b[_0xf275[57]]=== _0xf275[36]){_0x44b6x1b[_0xf275[57]]= null}else {_0x44b6x1b[_0xf275[57]]= moment()[_0xf275[59]](_0xf275[58])}};_0x44b6x1b[_0xf275[60]]= parseInt(_0x44b6x1b[_0xf275[60]],10)?true:false};function _0x44b6x1c(_0x44b6x1d){if(!params[_0xf275[62]][_0xf275[61]][_0x44b6x1d]){params[_0xf275[62]][_0xf275[61]][_0x44b6x1d]= {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 _0x44b6x1e(){return function(){params[_0xf275[62]][_0xf275[61]]= {};params[_0xf275[62]][_0xf275[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[_0xf275[97]]({attributes:[_0xf275[31]],raw:true})[_0xf275[92]](function(_0x44b6x20){if(_0x44b6x20){_[_0xf275[93]](_0x44b6x20,function(_0x44b6x1d){_0x44b6x1c(_0x44b6x1d[_0xf275[31]])});return ReportQueue[_0xf275[97]]({attributes:[_0xf275[69],_0xf275[79],_0xf275[82],_0xf275[94],_0xf275[95],_0xf275[96],_0xf275[77]],raw:true})}})[_0xf275[92]](function(_0x44b6x20){if(_0x44b6x20){var _0x44b6x21;var _0x44b6x22;var _0x44b6x23=_0x44b6x20[_0xf275[68]];for(var _0x44b6x24=0;_0x44b6x24< _0x44b6x23;_0x44b6x24++){_0x44b6x21= _0x44b6x20[_0x44b6x24];_0x44b6x22= _0x44b6x21[_0xf275[69]];_0x44b6x1c(_0x44b6x22);params[_0xf275[62]][_0xf275[63]][_0xf275[70]]++;params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[70]]++;if(utils[_0xf275[71]](_0x44b6x21)){params[_0xf275[62]][_0xf275[63]][_0xf275[72]]++;params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[72]]++};if(utils[_0xf275[73]](_0x44b6x21)){params[_0xf275[62]][_0xf275[63]][_0xf275[74]]++;params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[74]]++};if(utils[_0xf275[75]](_0x44b6x21)){params[_0xf275[62]][_0xf275[63]][_0xf275[76]]++;params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[76]]++;params[_0xf275[62]][_0xf275[63]][_0xf275[77]]+= _0x44b6x21[_0xf275[77]]|| 0;params[_0xf275[62]][_0xf275[63]][_0xf275[78]]+= moment(_0x44b6x21[_0xf275[82]])[_0xf275[81]](moment(_0x44b6x21[_0xf275[79]]),_0xf275[80]);params[_0xf275[62]][_0xf275[63]][_0xf275[83]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[77]]/ params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[76]]);params[_0xf275[62]][_0xf275[63]][_0xf275[85]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[78]]/ params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[76]]);params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[77]]+= _0x44b6x21[_0xf275[77]]|| 0;params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[78]]+= moment(_0x44b6x21[_0xf275[82]])[_0xf275[81]](moment(_0x44b6x21[_0xf275[79]]),_0xf275[80]);params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[83]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[77]]/ params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[76]]);params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[85]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[78]]/ params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[76]])};if(utils[_0xf275[86]](_0x44b6x21)){params[_0xf275[62]][_0xf275[63]][_0xf275[87]]++;params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[87]]++};if(utils[_0xf275[88]](_0x44b6x21)){params[_0xf275[62]][_0xf275[63]][_0xf275[89]]++;params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[89]]++};params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[90]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[76]]/ (params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[76]]+ params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[87]])* 100,2);params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[91]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[87]]/ (params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[76]]+ params[_0xf275[62]][_0xf275[61]][_0x44b6x22][_0xf275[87]])* 100,2);params[_0xf275[62]][_0xf275[63]][_0xf275[90]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[63]][_0xf275[76]]/ (params[_0xf275[62]][_0xf275[63]][_0xf275[76]]+ params[_0xf275[62]][_0xf275[63]][_0xf275[87]])* 100,2);params[_0xf275[62]][_0xf275[63]][_0xf275[91]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[63]][_0xf275[87]]/ (params[_0xf275[62]][_0xf275[63]][_0xf275[76]]+ params[_0xf275[62]][_0xf275[63]][_0xf275[87]])* 100,2)}}})[_0xf275[67]](function(_0x44b6x1f){logger[_0xf275[66]](_0xf275[64],_0x44b6x1f[_0xf275[65]])})}}function _0x44b6x25(){return function(){params[_0xf275[98]][_0xf275[63]]= {total:0,answered:0,sumDuration:0,avgDuration:0,tigerdial:0,answerRate:0};return ReportCall[_0xf275[97]]({where:{type:[_0xf275[98],_0xf275[101]],createdAt:{$gte:moment()[_0xf275[111]](_0xf275[110])}},attributes:[_0xf275[112],_0xf275[104],_0xf275[107]],raw:true})[_0xf275[92]](function(_0x44b6x20){if(_0x44b6x20){var _0x44b6x26=_[_0xf275[100]](_0x44b6x20,{type:_0xf275[98]});var _0x44b6x27=_[_0xf275[100]](_0x44b6x20,{type:_0xf275[101]});if(_0x44b6x26[_0xf275[68]]){params[_0xf275[98]][_0xf275[63]][_0xf275[70]]= _0x44b6x26[_0xf275[68]];params[_0xf275[98]][_0xf275[63]][_0xf275[102]]= _[_0xf275[105]](_0x44b6x26,_0xf275[104])[_0xf275[103]]|| 0;params[_0xf275[98]][_0xf275[63]][_0xf275[106]]= _[_0xf275[108]](_0x44b6x26,_0xf275[107]);if(params[_0xf275[98]][_0xf275[63]][_0xf275[102]]){params[_0xf275[98]][_0xf275[63]][_0xf275[109]]= _[_0xf275[84]]((_[_0xf275[108]](_0x44b6x26,_0xf275[107])/ params[_0xf275[98]][_0xf275[63]][_0xf275[102]]));params[_0xf275[98]][_0xf275[63]][_0xf275[90]]= _[_0xf275[84]](params[_0xf275[98]][_0xf275[63]][_0xf275[102]]/ params[_0xf275[98]][_0xf275[63]][_0xf275[70]]* 100,1)}};if(_0x44b6x27[_0xf275[68]]){params[_0xf275[98]][_0xf275[63]][_0xf275[101]]= _0x44b6x27[_0xf275[68]]}}})[_0xf275[67]](function(_0x44b6x1f){logger[_0xf275[66]](_0xf275[99],_0x44b6x1f[_0xf275[65]])})}}BPromise[_0xf275[113]]()[_0xf275[92]](_0x44b6x1e())[_0xf275[92]](_0x44b6x25());return {cdr:function(_0x44b6x1b){return function(_0x44b6x20){_0x44b6x16(_0xf275[114],_0xf275[115],_0x44b6x1b);if(_0x44b6x1b[_0xf275[112]]== _0xf275[98]|| _0x44b6x1b[_0xf275[112]]== _0xf275[101]){if(_0x44b6x1b[_0xf275[112]]== _0xf275[98]){params[_0xf275[98]][_0xf275[63]][_0xf275[70]]++;_0x44b6x1b[_0xf275[104]]== _0xf275[103]&& (params[_0xf275[98]][_0xf275[63]][_0xf275[102]]++);params[_0xf275[98]][_0xf275[63]][_0xf275[106]]+= Number(_0x44b6x1b[_0xf275[107]]);if(params[_0xf275[98]][_0xf275[63]][_0xf275[102]]){params[_0xf275[98]][_0xf275[63]][_0xf275[109]]= _[_0xf275[84]](params[_0xf275[98]][_0xf275[63]][_0xf275[106]]/ params[_0xf275[98]][_0xf275[63]][_0xf275[102]]);params[_0xf275[98]][_0xf275[63]][_0xf275[90]]= _[_0xf275[84]](params[_0xf275[98]][_0xf275[63]][_0xf275[102]]/ params[_0xf275[98]][_0xf275[63]][_0xf275[70]]* 100,1)}}else {params[_0xf275[98]][_0xf275[63]][_0xf275[101]]++};_0x44b6x16(_0xf275[116],_0xf275[117],params[_0xf275[98]][_0xf275[63]])}}},send:function(_0x44b6x1b){return function(_0x44b6x20){return BPromise[_0xf275[113]]()}},hangup:function(_0x44b6x1b){return function(_0x44b6x20){if(params[_0xf275[98]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]]){delete params[_0xf275[98]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]]};if(params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]]){delete params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]]};var _0x44b6x28={uniqueid:_0x44b6x1b[_0xf275[118]],linkedid:_0x44b6x1b[_0xf275[120]],endtime:moment()[_0xf275[59]](_0xf275[58]),lastevent:_0xf275[121],updatedAt:moment()[_0xf275[59]](_0xf275[58])};_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x1b[_0xf275[124]][_0xf275[123]](/\/|-/)[1]),_0xf275[125],_0x44b6x28);_0x44b6x16(_0xf275[126],_0xf275[125],_0x44b6x28);_0x44b6x16(_0xf275[127],_0xf275[125],_0x44b6x28);if(_0x44b6x20){triggers[_0xf275[128]](_0x44b6x20)};return BPromise[_0xf275[113]]()}},devicestatechange:function(_0x44b6x1b){return function(_0x44b6x20){return User[_0xf275[142]]({where:{name:_0x44b6x1b[_0xf275[141]][_0xf275[140]](_0xf275[138],_0xf275[139])},raw:true})[_0xf275[92]](function(_0x44b6x29){if(_0x44b6x29){var _0x44b6x28=_[_0xf275[133]]({newValues:{id:_0x44b6x29[_0xf275[131]],status:_0x44b6x1b[_0xf275[132]],statusAt:moment()[_0xf275[59]](_0xf275[58])}},_0x44b6x29,{status:_0x44b6x1b[_0xf275[132]],statusAt:moment()[_0xf275[59]](_0xf275[58])});_0x44b6x28[_0xf275[26]]= _0xf275[134];_0x44b6x16(util[_0xf275[59]](_0xf275[135],_0x44b6x29[_0xf275[136]],_0x44b6x29[_0xf275[131]]),_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[127],_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[126],_0xf275[137],_0x44b6x28)}})[_0xf275[67]](function(_0x44b6x1f){logger[_0xf275[130]](_0xf275[129],_0x44b6x1f)})}},peerstatus:function(_0x44b6x1b){return function(_0x44b6x20){if(_0x44b6x20&& _0x44b6x20[0]){_[_0xf275[93]](_0x44b6x20[1],function(_0x44b6x2a){if(!params[_0xf275[143]][_0x44b6x2a[_0xf275[31]]]){params[_0xf275[143]][_0x44b6x2a[_0xf275[31]]]= {name:_0x44b6x2a[_0xf275[31]]}};params[_0xf275[143]][_0x44b6x2a[_0xf275[31]]][_0xf275[144]]= _0x44b6x1b[_0xf275[144]];_0x44b6x16(_0xf275[145],_0xf275[146],params[_0xf275[143]][_0x44b6x2a[_0xf275[31]]])})};return BPromise[_0xf275[113]]()}},registry:function(_0x44b6x1b){return function(_0x44b6x20){if(_0x44b6x20&& _0x44b6x20[0]){_[_0xf275[93]](_0x44b6x20[1],function(_0x44b6x2a){if(!params[_0xf275[143]][_0x44b6x2a[_0xf275[31]]]){params[_0xf275[143]][_0x44b6x2a[_0xf275[31]]]= {name:_0x44b6x2a[_0xf275[31]]}};params[_0xf275[143]][_0x44b6x2a[_0xf275[31]]][_0xf275[53]]= _0x44b6x1b[_0xf275[53]];_0x44b6x16(_0xf275[145],_0xf275[146],params[_0xf275[143]][_0x44b6x2a[_0xf275[31]]])})};return BPromise[_0xf275[113]]()}},agentcalled:function(_0x44b6x1b){return function(_0x44b6x20){if(_0x44b6x20){_0x44b6x1b[_0xf275[147]]&& (_0x44b6x20[_0xf275[148]][_0xf275[147]]= _0x44b6x1b[_0xf275[147]]);_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x20[_0xf275[30]]),_0xf275[149],_0x44b6x20);triggers[_0xf275[150]](_0x44b6x20)};return User[_0xf275[142]]({where:{name:_0x44b6x1b[_0xf275[30]],voicePause:false},raw:true})[_0xf275[92]](function(_0x44b6x29){if(_0x44b6x29){var _0x44b6x2b=moment()[_0xf275[59]](_0xf275[58]);var _0x44b6x28=_[_0xf275[133]]({newValues:{id:_0x44b6x29[_0xf275[131]],queueStatus:_0xf275[152],queueStatusAt:_0x44b6x2b,lastQueue:_0x44b6x1b[_0xf275[69]]}},_0x44b6x29,{queueStatus:_0xf275[152],queueStatusAt:_0x44b6x2b,lastQueue:_0x44b6x1b[_0xf275[69]]});_0x44b6x28[_0xf275[26]]= _0xf275[153];_0x44b6x16(util[_0xf275[59]](_0xf275[135],_0x44b6x29[_0xf275[136]],_0x44b6x29[_0xf275[131]]),_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[127],_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[126],_0xf275[137],_0x44b6x28)}})[_0xf275[67]](function(_0x44b6x1f){logger[_0xf275[66]](_0xf275[151],_0x44b6x1f)})}},agentcomplete:function(_0x44b6x1b){return function(_0x44b6x20){if(_0x44b6x20){triggers[_0xf275[154]](_0x44b6x20)};if(params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[74]]){params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[74]]--};if(params[_0xf275[62]][_0xf275[63]][_0xf275[74]]){params[_0xf275[62]][_0xf275[63]][_0xf275[74]]--;_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[155],{type:_0xf275[74],amount:-1,queue:_0x44b6x1b[_0xf275[69]]})};params[_0xf275[62]][_0xf275[63]][_0xf275[76]]++;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[76]]++;_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[155],{type:_0xf275[121],amount:1,queue:_0x44b6x1b[_0xf275[69]]});params[_0xf275[62]][_0xf275[63]][_0xf275[90]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[63]][_0xf275[76]]/ (params[_0xf275[62]][_0xf275[63]][_0xf275[76]]+ params[_0xf275[62]][_0xf275[63]][_0xf275[87]])* 100,2);params[_0xf275[62]][_0xf275[63]][_0xf275[91]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[63]][_0xf275[87]]/ (params[_0xf275[62]][_0xf275[63]][_0xf275[76]]+ params[_0xf275[62]][_0xf275[63]][_0xf275[87]])* 100,2);params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[90]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[76]]/ (params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[76]]+ params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[87]])* 100,2);params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[91]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[87]]/ (params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[76]]+ params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[87]])* 100,2);params[_0xf275[62]][_0xf275[63]][_0xf275[78]]+= Number(_0x44b6x1b[_0xf275[78]]);params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[78]]+= Number(_0x44b6x1b[_0xf275[78]]);_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[155],{type:_0xf275[78],amount:Number(_0x44b6x1b[_0xf275[78]]),queue:_0x44b6x1b[_0xf275[69]]});params[_0xf275[62]][_0xf275[63]][_0xf275[85]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[63]][_0xf275[78]]/ params[_0xf275[62]][_0xf275[63]][_0xf275[76]]);params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[85]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[78]]/ params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[76]]);params[_0xf275[62]][_0xf275[63]][_0xf275[77]]+= Number(_0x44b6x1b[_0xf275[77]]);params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[77]]+= Number(_0x44b6x1b[_0xf275[77]]);_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[155],{type:_0xf275[77],amount:Number(_0x44b6x1b[_0xf275[77]]),queue:_0x44b6x1b[_0xf275[69]]});params[_0xf275[62]][_0xf275[63]][_0xf275[83]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[63]][_0xf275[77]]/ params[_0xf275[62]][_0xf275[63]][_0xf275[76]]);params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[83]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[77]]/ params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[76]]);var _0x44b6x28;var _0x44b6x2b=moment()[_0xf275[59]](_0xf275[58]);return ReportAgent[_0xf275[142]]({where:{uniqueid:_0x44b6x1b[_0xf275[118]],destuniqueid:_0x44b6x1b[_0xf275[162]]},raw:true})[_0xf275[92]](function(_0x44b6x2c){if(_0x44b6x2c){_0x44b6x28= _[_0xf275[133]]({},_0x44b6x2c,{lastevent:_0xf275[121],agentcomplete:true,agentcompleteAt:_0x44b6x2b,talktime:Number(_0x44b6x1b[_0xf275[78]]),reason:_0x44b6x1b[_0xf275[159]]});_0x44b6x1b[_0xf275[147]]&& (_0x44b6x28[_0xf275[147]]= _0x44b6x1b[_0xf275[147]]);_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x2c[_0xf275[30]]),_0xf275[160],_0x44b6x28)};return ReportQueue[_0xf275[142]]({where:{uniqueid:_0x44b6x1b[_0xf275[118]]},order:_0xf275[161],raw:true})})[_0xf275[92]](function(_0x44b6x2c){if(_0x44b6x2c){_0x44b6x28= _[_0xf275[133]]({},_0x44b6x2c,{queuecallercomplete:true,queuecallercompleteAt:_0x44b6x2b});_0x44b6x16(_0x44b6x2c[_0xf275[69]],_0xf275[158],_0x44b6x28)};return User[_0xf275[142]]({where:{name:_0x44b6x1b[_0xf275[30]]},raw:true})})[_0xf275[92]](function(_0x44b6x29){if(_0x44b6x29){var _0x44b6x28=_[_0xf275[133]]({newValues:{id:_0x44b6x29[_0xf275[131]],queueStatus:_0xf275[121],queueStatusAt:_0x44b6x2b,lastQueue:_0x44b6x1b[_0xf275[69]]}},_0x44b6x29,{queueStatus:_0xf275[121],queueStatusAt:_0x44b6x2b,lastQueue:_0x44b6x1b[_0xf275[69]]});_0x44b6x28[_0xf275[26]]= _0xf275[157];_0x44b6x16(util[_0xf275[59]](_0xf275[135],_0x44b6x29[_0xf275[136]],_0x44b6x29[_0xf275[131]]),_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[127],_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[126],_0xf275[137],_0x44b6x28)}})[_0xf275[67]](function(_0x44b6x1f){logger[_0xf275[66]](_0xf275[156],_0x44b6x1f)})}},agentconnect:function(_0x44b6x1b){return function(_0x44b6x20){if(_0x44b6x20){triggers[_0xf275[154]](_0x44b6x20)};if(params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[72]]){params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[72]]--;_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[155],{type:_0xf275[72],amount:-1,queue:_0x44b6x1b[_0xf275[69]]})};if(params[_0xf275[62]][_0xf275[63]][_0xf275[72]]){params[_0xf275[62]][_0xf275[63]][_0xf275[72]]--};if(params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]]){params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]][_0xf275[163]]= _0x44b6x1b[_0xf275[164]];params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]][_0xf275[165]]= _0x44b6x1b[_0xf275[165]];params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]][_0xf275[77]]= Number(_0x44b6x1b[_0xf275[77]]);params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]][_0xf275[166]]= Number(_0x44b6x1b[_0xf275[166]]);params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]][_0xf275[32]]= _0x44b6x1b[_0xf275[32]];params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]][_0xf275[30]]= _0x44b6x1b[_0xf275[30]]};params[_0xf275[62]][_0xf275[63]][_0xf275[74]]++;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[74]]++;_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[155],{type:_0xf275[74],amount:1,queue:_0x44b6x1b[_0xf275[69]]});var _0x44b6x28;var _0x44b6x2b=moment()[_0xf275[59]](_0xf275[58]);return ReportQueue[_0xf275[142]]({where:{uniqueid:_0x44b6x1b[_0xf275[118]]},order:_0xf275[161],raw:true})[_0xf275[92]](function(_0x44b6x2c){if(_0x44b6x2c){_0x44b6x28= _[_0xf275[133]]({},_0x44b6x2c,{queuecallerleaveAt:moment()[_0xf275[59]](_0xf275[58]),holdtime:_0x44b6x1b[_0xf275[77]],assigned:true,lastAssignedTo:_0x44b6x1b[_0xf275[30]]});_0x44b6x16(_0x44b6x2c[_0xf275[69]],_0xf275[158],_0x44b6x28)};return ReportAgent[_0xf275[142]]({where:{uniqueid:_0x44b6x1b[_0xf275[118]],destuniqueid:_0x44b6x1b[_0xf275[162]]},raw:true})})[_0xf275[92]](function(_0x44b6x2c){if(_0x44b6x2c){_0x44b6x28= _[_0xf275[133]]({},_0x44b6x2c,{lastevent:_0xf275[168],agentconnectAt:moment()[_0xf275[59]](_0xf275[58]),holdtime:_0x44b6x1b[_0xf275[77]]});_0x44b6x1b[_0xf275[147]]&& (_0x44b6x28[_0xf275[147]]= _0x44b6x1b[_0xf275[147]]);_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x2c[_0xf275[30]]),_0xf275[160],_0x44b6x28)};return ReportAgent[_0xf275[97]]({where:{uniqueid:_0x44b6x1b[_0xf275[118]],destuniqueid:{$ne:_0x44b6x1b[_0xf275[162]]},reason:null},raw:true})})[_0xf275[92]](function(_0x44b6x2e){if(_0x44b6x2e&& _0x44b6x2e[_0xf275[68]]){_[_0xf275[93]](_0x44b6x2e,function(_0x44b6x2c){_0x44b6x28= _[_0xf275[133]]({},_0x44b6x2c,{lastevent:_0xf275[170],agentringnoanswer:true,agentringnoanswerAt:_0x44b6x2b,reason:_0xf275[170],answeredelsewheredestinationuniqueid:_0x44b6x1b[_0xf275[162]],answeredelsewheremembername:_0x44b6x1b[_0xf275[30]]});_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x2c[_0xf275[30]]),_0xf275[160],_0x44b6x28)})};return User[_0xf275[142]]({where:{name:_0x44b6x1b[_0xf275[30]]},raw:true})})[_0xf275[92]](function(_0x44b6x29){if(_0x44b6x29){var _0x44b6x28=_[_0xf275[133]]({newValues:{id:_0x44b6x29[_0xf275[131]],queueStatus:_0xf275[168],queueStatusAt:_0x44b6x2b,lastQueue:_0x44b6x1b[_0xf275[69]]}},_0x44b6x29,{queueStatus:_0xf275[168],queueStatusAt:_0x44b6x2b,lastQueue:_0x44b6x1b[_0xf275[69]]});_0x44b6x28[_0xf275[26]]= _0xf275[169];_0x44b6x16(util[_0xf275[59]](_0xf275[135],_0x44b6x29[_0xf275[136]],_0x44b6x29[_0xf275[131]]),_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[127],_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[126],_0xf275[137],_0x44b6x28)};return User[_0xf275[97]]({where:{lastQueue:_0x44b6x1b[_0xf275[69]],name:{$ne:_0x44b6x1b[_0xf275[30]]}},raw:true})})[_0xf275[92]](function(_0x44b6x2d){if(_0x44b6x2d&& _0x44b6x2d[_0xf275[68]]){_[_0xf275[93]](_0x44b6x2d,function(_0x44b6x29){var _0x44b6x28=_[_0xf275[133]]({newValues:{id:_0x44b6x29[_0xf275[131]],queueStatus:_0xf275[121],queueStatusAt:_0x44b6x2b}},_0x44b6x29,{queueStatus:_0xf275[121],queueStatusAt:_0x44b6x2b});_0x44b6x16(util[_0xf275[59]](_0xf275[135],_0x44b6x29[_0xf275[136]],_0x44b6x29[_0xf275[131]]),_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[127],_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[126],_0xf275[137],_0x44b6x28)})}})[_0xf275[67]](function(_0x44b6x1f){logger[_0xf275[66]](_0xf275[167],_0x44b6x1f)})}},agentringnoanswer:function(_0x44b6x1b){return function(_0x44b6x20){if(_0x44b6x20){triggers[_0xf275[154]](_0x44b6x20)};var _0x44b6x28;var _0x44b6x2b=moment()[_0xf275[59]](_0xf275[58]);return User[_0xf275[142]]({where:{name:_0x44b6x1b[_0xf275[30]]},raw:true})[_0xf275[92]](function(_0x44b6x29){if(_0x44b6x29){var _0x44b6x28=_[_0xf275[133]]({newValues:{id:_0x44b6x29[_0xf275[131]],queueStatus:_0xf275[121],queueStatusAt:_0x44b6x2b,lastQueue:_0x44b6x1b[_0xf275[69]]}},_0x44b6x29,{queueStatus:_0xf275[121],queueStatusAt:_0x44b6x2b,lastQueue:_0x44b6x1b[_0xf275[69]]});_0x44b6x28[_0xf275[26]]= _0xf275[173];_0x44b6x16(util[_0xf275[59]](_0xf275[135],_0x44b6x29[_0xf275[136]],_0x44b6x29[_0xf275[131]]),_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[127],_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[126],_0xf275[137],_0x44b6x28)};return ReportAgent[_0xf275[142]]({where:{uniqueid:_0x44b6x1b[_0xf275[118]],destuniqueid:_0x44b6x1b[_0xf275[162]]},raw:true})})[_0xf275[92]](function(_0x44b6x2c){if(_0x44b6x2c){_0x44b6x28= _[_0xf275[133]]({},_0x44b6x2c,{lastevent:_0xf275[172],agentringnoanswer:true,agentringnoanswerAt:moment()[_0xf275[59]](_0xf275[58]),reason:_0xf275[172]});_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x2c[_0xf275[30]]),_0xf275[160],_0x44b6x28)}})[_0xf275[67]](function(_0x44b6x1f){logger[_0xf275[66]](_0xf275[171],_0x44b6x1f)})}},queuememberadded:function(_0x44b6x1b){return function(_0x44b6x20){if(_0x44b6x20){_0x44b6x16(_0x44b6x20[_0xf275[69]],_0xf275[174],_0x44b6x20);_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x20.UserId),_0xf275[174],_0x44b6x20)};return BPromise[_0xf275[113]]()}},queuememberremoved:function(_0x44b6x1b){return function(_0x44b6x20){if(params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]]){delete params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[114]][_0x44b6x1b[_0xf275[30]]]};return User[_0xf275[142]]({where:{name:_0x44b6x1b[_0xf275[32]][_0xf275[140]](_0xf275[138],_0xf275[139])},raw:true})[_0xf275[92]](function(_0x44b6x29){if(_0x44b6x29){_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[176],{queue:_0x44b6x1b[_0xf275[69]],UserId:_0x44b6x29[_0xf275[131]]});_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x29[_0xf275[131]]),_0xf275[176],{queue:_0x44b6x1b[_0xf275[69]],UserId:_0x44b6x29[_0xf275[131]]})}})[_0xf275[67]](function(_0x44b6x1f){logger[_0xf275[66]](_0xf275[175],_0x44b6x1f)})}},queuememberpause:function(_0x44b6x1b){return function(_0x44b6x20){if(_0x44b6x20){_0x44b6x16(_0x44b6x20[_0xf275[69]],_0xf275[174],_0x44b6x20);_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x20.UserId),_0xf275[174],_0x44b6x20)}}},queuememberpenalty:function(_0x44b6x1b){return function(_0x44b6x20){return BPromise[_0xf275[113]]()}},queuememberringinuse:function(_0x44b6x1b){return function(_0x44b6x20){return BPromise[_0xf275[113]]()}},queuemember:function(_0x44b6x1b){return function(_0x44b6x20){_0x44b6x1a(_0x44b6x1b);_0x44b6x1c(_0x44b6x1b[_0xf275[69]]);params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[114]][_0x44b6x1b[_0xf275[31]]]= _0x44b6x1b;return BPromise[_0xf275[113]]()}},queuecallerjoin:function(_0x44b6x1b){return function(_0x44b6x20){if(!params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]]){params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]]= {};params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[72]]= 0;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[74]]= 0;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[76]]= 0;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[87]]= 0;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[89]]= 0;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[77]]= 0;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[78]]= 0;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[83]]= 0;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[85]]= 0;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[90]]= 0;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[91]]= 0;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[70]]= 0};params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]]= {channel:_0x44b6x1b[_0xf275[124]],channelstate:Number(_0x44b6x1b[_0xf275[177]]),channelstatedesc:_0x44b6x1b[_0xf275[178]],calleridnum:_0x44b6x1b[_0xf275[179]],calleridname:_0x44b6x1b[_0xf275[180]],exten:_0x44b6x1b[_0xf275[181]],priority:Number(_0x44b6x1b[_0xf275[182]]),uniqueid:_0x44b6x1b[_0xf275[118]],queue:_0x44b6x1b[_0xf275[69]],position:Number(_0x44b6x1b[_0xf275[183]]),count:Number(_0x44b6x1b[_0xf275[184]])};params[_0xf275[62]][_0xf275[63]][_0xf275[72]]++;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[72]]++;_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[155],{type:_0xf275[70],amount:1,queue:_0x44b6x1b[_0xf275[69]]});params[_0xf275[62]][_0xf275[63]][_0xf275[70]]++;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[70]]++;_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[155],{type:_0xf275[72],amount:1,queue:_0x44b6x1b[_0xf275[69]]});if(_0x44b6x20){_0x44b6x16(_0x44b6x20[_0xf275[69]],_0xf275[185],_0x44b6x20)};return BPromise[_0xf275[113]]()}},queuecallerabandon:function(_0x44b6x1b){return function(_0x44b6x20){if(_0x44b6x20&& _0x44b6x20[_0xf275[186]]&& _0x44b6x20[_0xf275[186]][0]){_[_0xf275[93]](_0x44b6x20[_0xf275[186]][1],function(_0x44b6x2c){_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x2c[_0xf275[30]]),_0xf275[160],_0x44b6x2c)})};if(_0x44b6x20&& _0x44b6x20[_0xf275[187]]){_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[158],_0x44b6x20[_0xf275[187]]);_0x44b6x20[_0xf275[187]][_0xf275[148]][_0xf275[188]]= _0xf275[87];_0x44b6x20[_0xf275[187]][_0xf275[189]][_0xf275[188]]= true;triggers[_0xf275[154]](_0x44b6x20[_0xf275[187]])};var _0x44b6x28;var _0x44b6x2b=moment()[_0xf275[59]](_0xf275[58]);if(params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[72]]){params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[72]]--;_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[155],{type:_0xf275[72],amount:-1,queue:_0x44b6x1b[_0xf275[69]]})};if(params[_0xf275[62]][_0xf275[63]][_0xf275[72]]){params[_0xf275[62]][_0xf275[63]][_0xf275[72]]--};if(params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]]){params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]][_0xf275[77]]= Number(_0x44b6x1b[_0xf275[77]]);params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]][_0xf275[183]]= Number(_0x44b6x1b[_0xf275[183]]);params[_0xf275[62]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]][_0xf275[190]]= Number(_0x44b6x1b[_0xf275[190]])};params[_0xf275[62]][_0xf275[63]][_0xf275[87]]++;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[87]]++;_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[155],{type:_0xf275[191],amount:1,queue:_0x44b6x1b[_0xf275[69]]});params[_0xf275[62]][_0xf275[63]][_0xf275[90]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[63]][_0xf275[76]]/ (params[_0xf275[62]][_0xf275[63]][_0xf275[76]]+ params[_0xf275[62]][_0xf275[63]][_0xf275[87]])* 100,2);params[_0xf275[62]][_0xf275[63]][_0xf275[91]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[63]][_0xf275[87]]/ (params[_0xf275[62]][_0xf275[63]][_0xf275[76]]+ params[_0xf275[62]][_0xf275[63]][_0xf275[87]])* 100,2);params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[90]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[76]]/ (params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[76]]+ params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[87]])* 100,2);params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[91]]= _[_0xf275[84]](params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[87]]/ (params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[76]]+ params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[87]])* 100,2);return User[_0xf275[97]]({where:{lastQueue:_0x44b6x1b[_0xf275[69]]},raw:true})[_0xf275[92]](function(_0x44b6x2f){if(_0x44b6x2f&& _0x44b6x2f[_0xf275[68]]){var _0x44b6x28;_[_0xf275[93]](_0x44b6x2f,function(_0x44b6x30){_0x44b6x28= _[_0xf275[133]]({newValues:{id:_0x44b6x30[_0xf275[131]],queueStatus:_0xf275[121],queueStatusAt:_0x44b6x2b,lastQueue:_0x44b6x1b[_0xf275[69]]}},_0x44b6x30,{id:_0x44b6x30[_0xf275[131]],queueStatus:_0xf275[121],queueStatusAt:_0x44b6x2b,lastQueue:_0x44b6x1b[_0xf275[69]]});_0x44b6x28[_0xf275[26]]= _0xf275[95];_0x44b6x16(util[_0xf275[59]](_0xf275[135],_0x44b6x30[_0xf275[136]],_0x44b6x30[_0xf275[131]]),_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[127],_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[126],_0xf275[137],_0x44b6x28)})}})[_0xf275[67]](function(_0x44b6x1f){logger[_0xf275[66]](_0xf275[192],_0x44b6x1f)})}},blindtransfer:function(_0x44b6x1b){return function(_0x44b6x20){_0x44b6x16(null,_0x44b6x1b[_0xf275[26]][_0xf275[193]](),_0x44b6x1b);return BPromise[_0xf275[113]]()}},attendedtransfer:function(_0x44b6x1b){return function(_0x44b6x20){_0x44b6x16(null,_0x44b6x1b[_0xf275[26]][_0xf275[193]](),_0x44b6x1b);return BPromise[_0xf275[113]]()}},dialbegin:function(_0x44b6x1b){return function(_0x44b6x20){params[_0xf275[98]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]]= {channel:_0x44b6x1b[_0xf275[124]],channelstate:Number(_0x44b6x1b[_0xf275[177]]),channelstatedesc:_0x44b6x1b[_0xf275[178]],calleridnum:_0x44b6x1b[_0xf275[179]],calleridname:_0x44b6x1b[_0xf275[180]],context:_0x44b6x1b[_0xf275[194]],exten:_0x44b6x1b[_0xf275[181]],priority:Number(_0x44b6x1b[_0xf275[182]]),dialstring:_0x44b6x1b[_0xf275[195]]};if(_0x44b6x1b[_0xf275[124]]){var _0x44b6x28=_[_0xf275[196]](_0x44b6x1b,{starttime:moment()[_0xf275[59]](_0xf275[58]),lastevent:_0xf275[152],updatedAt:moment()[_0xf275[59]](_0xf275[58])});_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x1b[_0xf275[124]][_0xf275[123]](/\/|-/)[1]),_0xf275[197],_0x44b6x28);_0x44b6x16(_0xf275[127],_0xf275[125],_[_0xf275[196]](_0x44b6x28,{role:_0xf275[127]}));_0x44b6x16(_0xf275[126],_0xf275[125],_0x44b6x28,_[_0xf275[196]](_0x44b6x28,{role:_0xf275[126]}));if(_0x44b6x20){triggers[_0xf275[128]](_0x44b6x20)}};return BPromise[_0xf275[113]]()}},dialend:function(_0x44b6x1b){return function(_0x44b6x20){if(params[_0xf275[98]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]]){params[_0xf275[98]][_0xf275[119]][_0x44b6x1b[_0xf275[118]]][_0xf275[198]]= _0x44b6x1b[_0xf275[198]]};if(_0x44b6x1b[_0xf275[124]]){var _0x44b6x2b=moment()[_0xf275[59]](_0xf275[58]);var _0x44b6x28={dialstatus:_0x44b6x1b[_0xf275[198]],lastevent:(_0x44b6x1b[_0xf275[198]]=== _0xf275[103])?_0xf275[168]:_0xf275[121],answertime:(_0x44b6x1b[_0xf275[198]]=== _0xf275[103])?_0x44b6x2b:null,uniqueid:_0x44b6x1b[_0xf275[118]],linkedid:_0x44b6x1b[_0xf275[120]],destuniqueid:_0x44b6x1b[_0xf275[162]],destlinkedid:_0x44b6x1b[_0xf275[199]],updatedAt:_0x44b6x2b};_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x1b[_0xf275[124]][_0xf275[123]](/\/|-/)[1]),_0xf275[125],_0x44b6x28);_0x44b6x16(_0xf275[127],_0xf275[125],_0x44b6x28);_0x44b6x16(_0xf275[126],_0xf275[125],_0x44b6x28);if(_0x44b6x20){triggers[_0xf275[128]](_0x44b6x20)}};return BPromise[_0xf275[113]]()}},varset:function(_0x44b6x1b){return function(_0x44b6x20){if(_0x44b6x1b[_0xf275[201]][_0xf275[55]](_0xf275[200])){_0x44b6x16(_0xf275[127],_0xf275[197],{uniqueid:_0x44b6x1b[_0xf275[118]],routeId:_0x44b6x1b[_0xf275[202]],updatedAt:moment()[_0xf275[59]](_0xf275[58])});_0x44b6x16(_0xf275[126],_0xf275[197],{uniqueid:_0x44b6x1b[_0xf275[118]],routeId:_0x44b6x1b[_0xf275[202]],updatedAt:moment()[_0xf275[59]](_0xf275[58])})};if(_0x44b6x1b){triggers[_0xf275[203]](_0x44b6x1b)};return BPromise[_0xf275[113]]()}},queuecallerunmanaged:function(_0x44b6x1b){return function(_0x44b6x20){if(_0x44b6x20){params[_0xf275[62]][_0xf275[63]][_0xf275[89]]+= 1;params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[89]]+= 1;_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[155],{type:_0xf275[89],amount:1,queue:_0x44b6x1b[_0xf275[69]]});if(params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[72]]){params[_0xf275[62]][_0xf275[61]][_0x44b6x1b[_0xf275[69]]][_0xf275[72]]-= 1};if(params[_0xf275[62]][_0xf275[63]][_0xf275[72]]){params[_0xf275[62]][_0xf275[63]][_0xf275[72]]-= 1;_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[155],{type:_0xf275[72],amount:-1,queue:_0x44b6x1b[_0xf275[69]]})};_0x44b6x16(_0x44b6x1b[_0xf275[69]],_0xf275[158],_0x44b6x20);var _0x44b6x2b=moment()[_0xf275[59]](_0xf275[58]);return User[_0xf275[97]]({where:{lastQueue:_0x44b6x1b[_0xf275[69]]},raw:true})[_0xf275[92]](function(_0x44b6x2f){if(_0x44b6x2f&& _0x44b6x2f[_0xf275[68]]){var _0x44b6x28;_[_0xf275[93]](_0x44b6x2f,function(_0x44b6x30){_0x44b6x28= _[_0xf275[133]]({newValues:{id:_0x44b6x30[_0xf275[131]],queueStatus:_0xf275[121],queueStatusAt:_0x44b6x2b,lastQueue:_0x44b6x1b[_0xf275[69]]}},_0x44b6x30,{id:_0x44b6x30[_0xf275[131]],queueStatus:_0xf275[121],queueStatusAt:_0x44b6x2b,lastQueue:_0x44b6x1b[_0xf275[69]]});_0x44b6x28[_0xf275[26]]= _0xf275[204];_0x44b6x16(util[_0xf275[59]](_0xf275[135],_0x44b6x30[_0xf275[136]],_0x44b6x30[_0xf275[131]]),_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[127],_0xf275[137],_0x44b6x28);_0x44b6x16(_0xf275[126],_0xf275[137],_0x44b6x28)})}})[_0xf275[67]](function(_0x44b6x1f){logger[_0xf275[66]](_0xf275[192],_0x44b6x1f)})}}},agentUpdate:function(_0x44b6x30){return function(){_0x44b6x30[_0xf275[26]]= _0xf275[205];_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x30[_0xf275[131]]),_0xf275[137],_0x44b6x30);_0x44b6x16(_0xf275[127],_0xf275[137],_0x44b6x30);_0x44b6x16(_0xf275[126],_0xf275[137],_0x44b6x30)}},console:function(_0x44b6x31){_0x44b6x16(_0x44b6x31[_0xf275[206]],util[_0xf275[59]](_0xf275[207],_0x44b6x31[_0xf275[112]]),_0x44b6x31[_0xf275[208]])},realtimeQueueMembers:function(_0x44b6x32){return function(){_[_0xf275[210]](params[_0xf275[62]][_0xf275[61]],function(_0x44b6x1d,_0x44b6x22){if(_[_0xf275[209]](_0x44b6x32,_0x44b6x22)){_[_0xf275[210]](_0x44b6x1d[_0xf275[114]],function(_0x44b6x30){_0x44b6x16(_0x44b6x22,_0xf275[174],_0x44b6x30)})}})}},updateTriggers:function(_0x44b6x31){return function(){return triggers[_0xf275[211]](_0x44b6x31)}},queueAdd:function(_0x44b6x33,_0x44b6x34){return function(){if(_0x44b6x33&& _0x44b6x34){_[_0xf275[93]](_0x44b6x33,function(_0x44b6x20){_0x44b6x16(null,util[_0xf275[59]](_0xf275[212],_0x44b6x34),_0x44b6x20[0])})}}},queueRemove:function(_0x44b6x20,_0x44b6x34){return function(){if(_0x44b6x20&& _0x44b6x34){_0x44b6x16(null,util[_0xf275[59]](_0xf275[213],_0x44b6x34),_0x44b6x20)}}},checkTriggers:function(_0x44b6x31){return function(){return triggers[_0xf275[214]](_0x44b6x31)}},videoOn:function(_0x44b6x1b){return function(){return triggers[_0xf275[215]](_0x44b6x1b)}},inboundInit:function(){return function(){return BPromise[_0xf275[113]]()[_0xf275[92]](_0x44b6x1e())}},outboundInit:function(){return function(){return BPromise[_0xf275[113]]()[_0xf275[92]](_0x44b6x25())}},reportFaxUpdate:function(_0x44b6x35){return function(){_0x44b6x35[_0xf275[26]]= _0xf275[216];_0x44b6x16(util[_0xf275[59]](_0xf275[122],_0x44b6x35[_0xf275[217]]),_0xf275[137],_0x44b6x35);_0x44b6x16(_0xf275[126],_0xf275[218],_0x44b6x35)}},widgetValues:function(_0x44b6x36,_0x44b6x29){return function(){_[_0xf275[210]](_0x44b6x36,function(_0x44b6x37,_0x44b6x38){_0x44b6x16(util[_0xf275[59]](_0xf275[135],_0x44b6x29[_0xf275[136]],_0x44b6x29[_0xf275[131]]),_0xf275[219]+ _0x44b6x38,_0x44b6x37)})}},receivefax:function(_0x44b6x1b){return function(_0x44b6x31){if(_0x44b6x31){return triggers[_0xf275[220]](_0x44b6x31)};return null}}}}
\ No newline at end of file
+var _0x73b8=["\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"];_0x73b8[0];var _=require(_0x73b8[1]);var util=require(_0x73b8[2]);var moment=require(_0x73b8[3]);var BPromise=require(_0x73b8[4]);var redis=require(_0x73b8[5]);var VoiceQueue=require(_0x73b8[7])[_0x73b8[6]];var ReportQueue=require(_0x73b8[7])[_0x73b8[8]];var ReportCall=require(_0x73b8[7])[_0x73b8[9]];var ReportAgent=require(_0x73b8[7])[_0x73b8[10]];var ReportDial=require(_0x73b8[7])[_0x73b8[11]];var ReportMember=require(_0x73b8[7])[_0x73b8[12]];var User=require(_0x73b8[7])[_0x73b8[13]];var Triggers=require(_0x73b8[14]);var config=require(_0x73b8[15]);var logger=require(_0x73b8[17])(_0x73b8[16]);var utils=require(_0x73b8[18]);var redisConf;if(config[_0x73b8[19]]){redisConf= {password:config[_0x73b8[19]]}};var redisClient=redis[_0x73b8[21]](6379,config[_0x73b8[20]],redisConf);var io=require(_0x73b8[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[_0x73b8[23]]= function(){var _0x65d6x16=function(_0x65d6x17,_0x65d6x18,_0x65d6x19){if(_0x65d6x17){io[_0x73b8[25]](_0x65d6x17)[_0x73b8[24]](_0x65d6x18,_0x65d6x19)}else {io[_0x73b8[24]](_0x65d6x18,_0x65d6x19)}};var _0x65d6x1a=function(_0x65d6x1b){delete _0x65d6x1b[_0x73b8[26]];delete _0x65d6x1b[_0x73b8[27]];delete _0x65d6x1b[_0x73b8[28]];delete _0x65d6x1b[_0x73b8[29]];_0x65d6x1b[_0x73b8[30]]= _0x65d6x1b[_0x73b8[31]]|| _0x65d6x1b[_0x73b8[30]];_0x65d6x1b[_0x73b8[32]]= _0x65d6x1b[_0x73b8[33]];_0x65d6x1b[_0x73b8[34]]= _0x73b8[35];switch(_0x65d6x1b[_0x73b8[53]]){case _0x73b8[36]:_0x65d6x1b[_0x73b8[34]]= _0x73b8[35];break;case _0x73b8[38]:_0x65d6x1b[_0x73b8[34]]= _0x73b8[37];break;case _0x73b8[40]:_0x65d6x1b[_0x73b8[34]]= _0x73b8[39];break;case _0x73b8[42]:_0x65d6x1b[_0x73b8[34]]= _0x73b8[41];break;case _0x73b8[44]:_0x65d6x1b[_0x73b8[34]]= _0x73b8[43];break;case _0x73b8[46]:_0x65d6x1b[_0x73b8[34]]= _0x73b8[45];break;case _0x73b8[48]:_0x65d6x1b[_0x73b8[34]]= _0x73b8[47];break;case _0x73b8[50]:_0x65d6x1b[_0x73b8[34]]= _0x73b8[49];break;case _0x73b8[52]:_0x65d6x1b[_0x73b8[34]]= _0x73b8[51];break;default:};_0x65d6x1b[_0x73b8[53]]= Number(_0x65d6x1b[_0x73b8[53]]);if(_0x65d6x1b[_0x73b8[55]](_0x73b8[54])){_0x65d6x1b[_0x73b8[54]]= Number(_0x65d6x1b[_0x73b8[54]])};if(_0x65d6x1b[_0x73b8[55]](_0x73b8[56])){_0x65d6x1b[_0x73b8[56]]= Number(_0x65d6x1b[_0x73b8[56]])};if(_0x65d6x1b[_0x73b8[55]](_0x73b8[57])){if(_0x65d6x1b[_0x73b8[57]]=== _0x73b8[36]){_0x65d6x1b[_0x73b8[57]]= null}else {_0x65d6x1b[_0x73b8[57]]= moment()[_0x73b8[59]](_0x73b8[58])}};_0x65d6x1b[_0x73b8[60]]= parseInt(_0x65d6x1b[_0x73b8[60]],10)?true:false};function _0x65d6x1c(_0x65d6x1d){if(!params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1d]){params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1d]= {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 _0x65d6x1e(){return function(){params[_0x73b8[62]][_0x73b8[61]]= {};params[_0x73b8[62]][_0x73b8[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[_0x73b8[97]]({attributes:[_0x73b8[31]],raw:true})[_0x73b8[92]](function(_0x65d6x20){if(_0x65d6x20){_[_0x73b8[93]](_0x65d6x20,function(_0x65d6x1d){_0x65d6x1c(_0x65d6x1d[_0x73b8[31]])});return ReportQueue[_0x73b8[97]]({attributes:[_0x73b8[69],_0x73b8[79],_0x73b8[82],_0x73b8[94],_0x73b8[95],_0x73b8[96],_0x73b8[77]],raw:true})}})[_0x73b8[92]](function(_0x65d6x20){if(_0x65d6x20){var _0x65d6x21;var _0x65d6x22;var _0x65d6x23=_0x65d6x20[_0x73b8[68]];for(var _0x65d6x24=0;_0x65d6x24< _0x65d6x23;_0x65d6x24++){_0x65d6x21= _0x65d6x20[_0x65d6x24];_0x65d6x22= _0x65d6x21[_0x73b8[69]];_0x65d6x1c(_0x65d6x22);params[_0x73b8[62]][_0x73b8[63]][_0x73b8[70]]++;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[70]]++;if(utils[_0x73b8[71]](_0x65d6x21)){params[_0x73b8[62]][_0x73b8[63]][_0x73b8[72]]++;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[72]]++};if(utils[_0x73b8[73]](_0x65d6x21)){params[_0x73b8[62]][_0x73b8[63]][_0x73b8[74]]++;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[74]]++};if(utils[_0x73b8[75]](_0x65d6x21)){params[_0x73b8[62]][_0x73b8[63]][_0x73b8[76]]++;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[76]]++;params[_0x73b8[62]][_0x73b8[63]][_0x73b8[77]]+= _0x65d6x21[_0x73b8[77]]|| 0;params[_0x73b8[62]][_0x73b8[63]][_0x73b8[78]]+= moment(_0x65d6x21[_0x73b8[82]])[_0x73b8[81]](moment(_0x65d6x21[_0x73b8[79]]),_0x73b8[80]);params[_0x73b8[62]][_0x73b8[63]][_0x73b8[83]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[77]]/ params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[76]]);params[_0x73b8[62]][_0x73b8[63]][_0x73b8[85]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[78]]/ params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[76]]);params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[77]]+= _0x65d6x21[_0x73b8[77]]|| 0;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[78]]+= moment(_0x65d6x21[_0x73b8[82]])[_0x73b8[81]](moment(_0x65d6x21[_0x73b8[79]]),_0x73b8[80]);params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[83]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[77]]/ params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[76]]);params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[85]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[78]]/ params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[76]])};if(utils[_0x73b8[86]](_0x65d6x21)){params[_0x73b8[62]][_0x73b8[63]][_0x73b8[87]]++;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[87]]++};if(utils[_0x73b8[88]](_0x65d6x21)){params[_0x73b8[62]][_0x73b8[63]][_0x73b8[89]]++;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[89]]++};params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[90]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[76]]/ (params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[76]]+ params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[87]])* 100,2);params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[91]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[87]]/ (params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[76]]+ params[_0x73b8[62]][_0x73b8[61]][_0x65d6x22][_0x73b8[87]])* 100,2);params[_0x73b8[62]][_0x73b8[63]][_0x73b8[90]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[63]][_0x73b8[76]]/ (params[_0x73b8[62]][_0x73b8[63]][_0x73b8[76]]+ params[_0x73b8[62]][_0x73b8[63]][_0x73b8[87]])* 100,2);params[_0x73b8[62]][_0x73b8[63]][_0x73b8[91]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[63]][_0x73b8[87]]/ (params[_0x73b8[62]][_0x73b8[63]][_0x73b8[76]]+ params[_0x73b8[62]][_0x73b8[63]][_0x73b8[87]])* 100,2)}}})[_0x73b8[67]](function(_0x65d6x1f){logger[_0x73b8[66]](_0x73b8[64],_0x65d6x1f[_0x73b8[65]])})}}function _0x65d6x25(){return function(){params[_0x73b8[98]][_0x73b8[63]]= {total:0,answered:0,sumDuration:0,avgDuration:0,tigerdial:0,answerRate:0};return ReportCall[_0x73b8[97]]({where:{type:[_0x73b8[98],_0x73b8[101]],createdAt:{$gte:moment()[_0x73b8[111]](_0x73b8[110])}},attributes:[_0x73b8[112],_0x73b8[104],_0x73b8[107]],raw:true})[_0x73b8[92]](function(_0x65d6x20){if(_0x65d6x20){var _0x65d6x26=_[_0x73b8[100]](_0x65d6x20,{type:_0x73b8[98]});var _0x65d6x27=_[_0x73b8[100]](_0x65d6x20,{type:_0x73b8[101]});if(_0x65d6x26[_0x73b8[68]]){params[_0x73b8[98]][_0x73b8[63]][_0x73b8[70]]= _0x65d6x26[_0x73b8[68]];params[_0x73b8[98]][_0x73b8[63]][_0x73b8[102]]= _[_0x73b8[105]](_0x65d6x26,_0x73b8[104])[_0x73b8[103]]|| 0;params[_0x73b8[98]][_0x73b8[63]][_0x73b8[106]]= _[_0x73b8[108]](_0x65d6x26,_0x73b8[107]);if(params[_0x73b8[98]][_0x73b8[63]][_0x73b8[102]]){params[_0x73b8[98]][_0x73b8[63]][_0x73b8[109]]= _[_0x73b8[84]]((_[_0x73b8[108]](_0x65d6x26,_0x73b8[107])/ params[_0x73b8[98]][_0x73b8[63]][_0x73b8[102]]));params[_0x73b8[98]][_0x73b8[63]][_0x73b8[90]]= _[_0x73b8[84]](params[_0x73b8[98]][_0x73b8[63]][_0x73b8[102]]/ params[_0x73b8[98]][_0x73b8[63]][_0x73b8[70]]* 100,1)}};if(_0x65d6x27[_0x73b8[68]]){params[_0x73b8[98]][_0x73b8[63]][_0x73b8[101]]= _0x65d6x27[_0x73b8[68]]}}})[_0x73b8[67]](function(_0x65d6x1f){logger[_0x73b8[66]](_0x73b8[99],_0x65d6x1f[_0x73b8[65]])})}}BPromise[_0x73b8[113]]()[_0x73b8[92]](_0x65d6x1e())[_0x73b8[92]](_0x65d6x25());return {cdr:function(_0x65d6x1b){return function(_0x65d6x20){_0x65d6x16(_0x73b8[114],_0x73b8[115],_0x65d6x1b);if(_0x65d6x1b[_0x73b8[112]]== _0x73b8[98]|| _0x65d6x1b[_0x73b8[112]]== _0x73b8[101]){if(_0x65d6x1b[_0x73b8[112]]== _0x73b8[98]){params[_0x73b8[98]][_0x73b8[63]][_0x73b8[70]]++;_0x65d6x1b[_0x73b8[104]]== _0x73b8[103]&& (params[_0x73b8[98]][_0x73b8[63]][_0x73b8[102]]++);params[_0x73b8[98]][_0x73b8[63]][_0x73b8[106]]+= Number(_0x65d6x1b[_0x73b8[107]]);if(params[_0x73b8[98]][_0x73b8[63]][_0x73b8[102]]){params[_0x73b8[98]][_0x73b8[63]][_0x73b8[109]]= _[_0x73b8[84]](params[_0x73b8[98]][_0x73b8[63]][_0x73b8[106]]/ params[_0x73b8[98]][_0x73b8[63]][_0x73b8[102]]);params[_0x73b8[98]][_0x73b8[63]][_0x73b8[90]]= _[_0x73b8[84]](params[_0x73b8[98]][_0x73b8[63]][_0x73b8[102]]/ params[_0x73b8[98]][_0x73b8[63]][_0x73b8[70]]* 100,1)}}else {params[_0x73b8[98]][_0x73b8[63]][_0x73b8[101]]++};_0x65d6x16(_0x73b8[116],_0x73b8[117],params[_0x73b8[98]][_0x73b8[63]])}}},send:function(_0x65d6x1b){return function(_0x65d6x20){return BPromise[_0x73b8[113]]()}},hangup:function(_0x65d6x1b){return function(_0x65d6x20){if(params[_0x73b8[98]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]]){delete params[_0x73b8[98]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]]};if(params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]]){delete params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]]};var _0x65d6x28={uniqueid:_0x65d6x1b[_0x73b8[118]],linkedid:_0x65d6x1b[_0x73b8[120]],endtime:moment()[_0x73b8[59]](_0x73b8[58]),lastevent:_0x73b8[121],updatedAt:moment()[_0x73b8[59]](_0x73b8[58])};_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x1b[_0x73b8[124]][_0x73b8[123]](/\/|-/)[1]),_0x73b8[125],_0x65d6x28);_0x65d6x16(_0x73b8[126],_0x73b8[125],_0x65d6x28);_0x65d6x16(_0x73b8[127],_0x73b8[125],_0x65d6x28);if(_0x65d6x20){triggers[_0x73b8[128]](_0x65d6x20)};return BPromise[_0x73b8[113]]()}},devicestatechange:function(_0x65d6x1b){return function(_0x65d6x20){return User[_0x73b8[142]]({where:{name:_0x65d6x1b[_0x73b8[141]][_0x73b8[140]](_0x73b8[138],_0x73b8[139])},raw:true})[_0x73b8[92]](function(_0x65d6x29){if(_0x65d6x29){var _0x65d6x28=_[_0x73b8[133]]({newValues:{id:_0x65d6x29[_0x73b8[131]],status:_0x65d6x1b[_0x73b8[132]],statusAt:moment()[_0x73b8[59]](_0x73b8[58])}},_0x65d6x29,{status:_0x65d6x1b[_0x73b8[132]],statusAt:moment()[_0x73b8[59]](_0x73b8[58])});_0x65d6x28[_0x73b8[26]]= _0x73b8[134];_0x65d6x16(util[_0x73b8[59]](_0x73b8[135],_0x65d6x29[_0x73b8[136]],_0x65d6x29[_0x73b8[131]]),_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[127],_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[126],_0x73b8[137],_0x65d6x28)}})[_0x73b8[67]](function(_0x65d6x1f){logger[_0x73b8[130]](_0x73b8[129],_0x65d6x1f)})}},peerstatus:function(_0x65d6x1b){return function(_0x65d6x20){if(_0x65d6x20&& _0x65d6x20[0]){_[_0x73b8[93]](_0x65d6x20[1],function(_0x65d6x2a){if(!params[_0x73b8[143]][_0x65d6x2a[_0x73b8[31]]]){params[_0x73b8[143]][_0x65d6x2a[_0x73b8[31]]]= {name:_0x65d6x2a[_0x73b8[31]]}};params[_0x73b8[143]][_0x65d6x2a[_0x73b8[31]]][_0x73b8[144]]= _0x65d6x1b[_0x73b8[144]];_0x65d6x16(_0x73b8[145],_0x73b8[146],params[_0x73b8[143]][_0x65d6x2a[_0x73b8[31]]])})};return BPromise[_0x73b8[113]]()}},registry:function(_0x65d6x1b){return function(_0x65d6x20){if(_0x65d6x20&& _0x65d6x20[0]){_[_0x73b8[93]](_0x65d6x20[1],function(_0x65d6x2a){if(!params[_0x73b8[143]][_0x65d6x2a[_0x73b8[31]]]){params[_0x73b8[143]][_0x65d6x2a[_0x73b8[31]]]= {name:_0x65d6x2a[_0x73b8[31]]}};params[_0x73b8[143]][_0x65d6x2a[_0x73b8[31]]][_0x73b8[53]]= _0x65d6x1b[_0x73b8[53]];_0x65d6x16(_0x73b8[145],_0x73b8[146],params[_0x73b8[143]][_0x65d6x2a[_0x73b8[31]]])})};return BPromise[_0x73b8[113]]()}},agentcalled:function(_0x65d6x1b){return function(_0x65d6x20){if(_0x65d6x20){_0x65d6x1b[_0x73b8[147]]&& (_0x65d6x20[_0x73b8[148]][_0x73b8[147]]= _0x65d6x1b[_0x73b8[147]]);_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x20[_0x73b8[30]]),_0x73b8[149],_0x65d6x20);triggers[_0x73b8[150]](_0x65d6x20)};return User[_0x73b8[142]]({where:{name:_0x65d6x1b[_0x73b8[30]],voicePause:false},raw:true})[_0x73b8[92]](function(_0x65d6x29){if(_0x65d6x29){var _0x65d6x2b=moment()[_0x73b8[59]](_0x73b8[58]);var _0x65d6x28=_[_0x73b8[133]]({newValues:{id:_0x65d6x29[_0x73b8[131]],queueStatus:_0x73b8[152],queueStatusAt:_0x65d6x2b,lastQueue:_0x65d6x1b[_0x73b8[69]]}},_0x65d6x29,{queueStatus:_0x73b8[152],queueStatusAt:_0x65d6x2b,lastQueue:_0x65d6x1b[_0x73b8[69]]});_0x65d6x28[_0x73b8[26]]= _0x73b8[153];_0x65d6x16(util[_0x73b8[59]](_0x73b8[135],_0x65d6x29[_0x73b8[136]],_0x65d6x29[_0x73b8[131]]),_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[127],_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[126],_0x73b8[137],_0x65d6x28)}})[_0x73b8[67]](function(_0x65d6x1f){logger[_0x73b8[66]](_0x73b8[151],_0x65d6x1f)})}},agentcomplete:function(_0x65d6x1b){return function(_0x65d6x20){if(_0x65d6x20){triggers[_0x73b8[154]](_0x65d6x20)};if(params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[74]]){params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[74]]--};if(params[_0x73b8[62]][_0x73b8[63]][_0x73b8[74]]){params[_0x73b8[62]][_0x73b8[63]][_0x73b8[74]]--;_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[155],{type:_0x73b8[74],amount:-1,queue:_0x65d6x1b[_0x73b8[69]]})};params[_0x73b8[62]][_0x73b8[63]][_0x73b8[76]]++;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[76]]++;_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[155],{type:_0x73b8[121],amount:1,queue:_0x65d6x1b[_0x73b8[69]]});params[_0x73b8[62]][_0x73b8[63]][_0x73b8[90]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[63]][_0x73b8[76]]/ (params[_0x73b8[62]][_0x73b8[63]][_0x73b8[76]]+ params[_0x73b8[62]][_0x73b8[63]][_0x73b8[87]])* 100,2);params[_0x73b8[62]][_0x73b8[63]][_0x73b8[91]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[63]][_0x73b8[87]]/ (params[_0x73b8[62]][_0x73b8[63]][_0x73b8[76]]+ params[_0x73b8[62]][_0x73b8[63]][_0x73b8[87]])* 100,2);params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[90]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[76]]/ (params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[76]]+ params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[87]])* 100,2);params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[91]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[87]]/ (params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[76]]+ params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[87]])* 100,2);params[_0x73b8[62]][_0x73b8[63]][_0x73b8[78]]+= Number(_0x65d6x1b[_0x73b8[78]]);params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[78]]+= Number(_0x65d6x1b[_0x73b8[78]]);_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[155],{type:_0x73b8[78],amount:Number(_0x65d6x1b[_0x73b8[78]]),queue:_0x65d6x1b[_0x73b8[69]]});params[_0x73b8[62]][_0x73b8[63]][_0x73b8[85]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[63]][_0x73b8[78]]/ params[_0x73b8[62]][_0x73b8[63]][_0x73b8[76]]);params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[85]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[78]]/ params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[76]]);params[_0x73b8[62]][_0x73b8[63]][_0x73b8[77]]+= Number(_0x65d6x1b[_0x73b8[77]]);params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[77]]+= Number(_0x65d6x1b[_0x73b8[77]]);_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[155],{type:_0x73b8[77],amount:Number(_0x65d6x1b[_0x73b8[77]]),queue:_0x65d6x1b[_0x73b8[69]]});params[_0x73b8[62]][_0x73b8[63]][_0x73b8[83]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[63]][_0x73b8[77]]/ params[_0x73b8[62]][_0x73b8[63]][_0x73b8[76]]);params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[83]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[77]]/ params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[76]]);var _0x65d6x28;var _0x65d6x2b=moment()[_0x73b8[59]](_0x73b8[58]);return ReportAgent[_0x73b8[142]]({where:{uniqueid:_0x65d6x1b[_0x73b8[118]],destuniqueid:_0x65d6x1b[_0x73b8[162]]},raw:true})[_0x73b8[92]](function(_0x65d6x2c){if(_0x65d6x2c){_0x65d6x28= _[_0x73b8[133]]({},_0x65d6x2c,{lastevent:_0x73b8[121],agentcomplete:true,agentcompleteAt:_0x65d6x2b,talktime:Number(_0x65d6x1b[_0x73b8[78]]),reason:_0x65d6x1b[_0x73b8[159]]});_0x65d6x1b[_0x73b8[147]]&& (_0x65d6x28[_0x73b8[147]]= _0x65d6x1b[_0x73b8[147]]);_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x2c[_0x73b8[30]]),_0x73b8[160],_0x65d6x28)};return ReportQueue[_0x73b8[142]]({where:{uniqueid:_0x65d6x1b[_0x73b8[118]]},order:_0x73b8[161],raw:true})})[_0x73b8[92]](function(_0x65d6x2c){if(_0x65d6x2c){_0x65d6x28= _[_0x73b8[133]]({},_0x65d6x2c,{queuecallercomplete:true,queuecallercompleteAt:_0x65d6x2b});_0x65d6x16(_0x65d6x2c[_0x73b8[69]],_0x73b8[158],_0x65d6x28)};return User[_0x73b8[142]]({where:{name:_0x65d6x1b[_0x73b8[30]]},raw:true})})[_0x73b8[92]](function(_0x65d6x29){if(_0x65d6x29){var _0x65d6x28=_[_0x73b8[133]]({newValues:{id:_0x65d6x29[_0x73b8[131]],queueStatus:_0x73b8[121],queueStatusAt:_0x65d6x2b,lastQueue:_0x65d6x1b[_0x73b8[69]]}},_0x65d6x29,{queueStatus:_0x73b8[121],queueStatusAt:_0x65d6x2b,lastQueue:_0x65d6x1b[_0x73b8[69]]});_0x65d6x28[_0x73b8[26]]= _0x73b8[157];_0x65d6x16(util[_0x73b8[59]](_0x73b8[135],_0x65d6x29[_0x73b8[136]],_0x65d6x29[_0x73b8[131]]),_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[127],_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[126],_0x73b8[137],_0x65d6x28)}})[_0x73b8[67]](function(_0x65d6x1f){logger[_0x73b8[66]](_0x73b8[156],_0x65d6x1f)})}},agentconnect:function(_0x65d6x1b){return function(_0x65d6x20){if(_0x65d6x20){triggers[_0x73b8[154]](_0x65d6x20)};if(params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[72]]){params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[72]]--;_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[155],{type:_0x73b8[72],amount:-1,queue:_0x65d6x1b[_0x73b8[69]]})};if(params[_0x73b8[62]][_0x73b8[63]][_0x73b8[72]]){params[_0x73b8[62]][_0x73b8[63]][_0x73b8[72]]--};if(params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]]){params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]][_0x73b8[163]]= _0x65d6x1b[_0x73b8[164]];params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]][_0x73b8[165]]= _0x65d6x1b[_0x73b8[165]];params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]][_0x73b8[77]]= Number(_0x65d6x1b[_0x73b8[77]]);params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]][_0x73b8[166]]= Number(_0x65d6x1b[_0x73b8[166]]);params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]][_0x73b8[32]]= _0x65d6x1b[_0x73b8[32]];params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]][_0x73b8[30]]= _0x65d6x1b[_0x73b8[30]]};params[_0x73b8[62]][_0x73b8[63]][_0x73b8[74]]++;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[74]]++;_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[155],{type:_0x73b8[74],amount:1,queue:_0x65d6x1b[_0x73b8[69]]});var _0x65d6x28;var _0x65d6x2b=moment()[_0x73b8[59]](_0x73b8[58]);return ReportQueue[_0x73b8[142]]({where:{uniqueid:_0x65d6x1b[_0x73b8[118]]},order:_0x73b8[161],raw:true})[_0x73b8[92]](function(_0x65d6x2c){if(_0x65d6x2c){_0x65d6x28= _[_0x73b8[133]]({},_0x65d6x2c,{queuecallerleaveAt:moment()[_0x73b8[59]](_0x73b8[58]),holdtime:_0x65d6x1b[_0x73b8[77]],assigned:true,lastAssignedTo:_0x65d6x1b[_0x73b8[30]]});_0x65d6x16(_0x65d6x2c[_0x73b8[69]],_0x73b8[158],_0x65d6x28)};return ReportAgent[_0x73b8[142]]({where:{uniqueid:_0x65d6x1b[_0x73b8[118]],destuniqueid:_0x65d6x1b[_0x73b8[162]]},raw:true})})[_0x73b8[92]](function(_0x65d6x2c){if(_0x65d6x2c){_0x65d6x28= _[_0x73b8[133]]({},_0x65d6x2c,{lastevent:_0x73b8[168],agentconnectAt:moment()[_0x73b8[59]](_0x73b8[58]),holdtime:_0x65d6x1b[_0x73b8[77]]});_0x65d6x1b[_0x73b8[147]]&& (_0x65d6x28[_0x73b8[147]]= _0x65d6x1b[_0x73b8[147]]);_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x2c[_0x73b8[30]]),_0x73b8[160],_0x65d6x28)};return ReportAgent[_0x73b8[97]]({where:{uniqueid:_0x65d6x1b[_0x73b8[118]],destuniqueid:{$ne:_0x65d6x1b[_0x73b8[162]]},reason:null},raw:true})})[_0x73b8[92]](function(_0x65d6x2e){if(_0x65d6x2e&& _0x65d6x2e[_0x73b8[68]]){_[_0x73b8[93]](_0x65d6x2e,function(_0x65d6x2c){_0x65d6x28= _[_0x73b8[133]]({},_0x65d6x2c,{lastevent:_0x73b8[170],agentringnoanswer:true,agentringnoanswerAt:_0x65d6x2b,reason:_0x73b8[170],answeredelsewheredestinationuniqueid:_0x65d6x1b[_0x73b8[162]],answeredelsewheremembername:_0x65d6x1b[_0x73b8[30]]});_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x2c[_0x73b8[30]]),_0x73b8[160],_0x65d6x28)})};return User[_0x73b8[142]]({where:{name:_0x65d6x1b[_0x73b8[30]]},raw:true})})[_0x73b8[92]](function(_0x65d6x29){if(_0x65d6x29){var _0x65d6x28=_[_0x73b8[133]]({newValues:{id:_0x65d6x29[_0x73b8[131]],queueStatus:_0x73b8[168],queueStatusAt:_0x65d6x2b,lastQueue:_0x65d6x1b[_0x73b8[69]]}},_0x65d6x29,{queueStatus:_0x73b8[168],queueStatusAt:_0x65d6x2b,lastQueue:_0x65d6x1b[_0x73b8[69]]});_0x65d6x28[_0x73b8[26]]= _0x73b8[169];_0x65d6x16(util[_0x73b8[59]](_0x73b8[135],_0x65d6x29[_0x73b8[136]],_0x65d6x29[_0x73b8[131]]),_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[127],_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[126],_0x73b8[137],_0x65d6x28)};return User[_0x73b8[97]]({where:{lastQueue:_0x65d6x1b[_0x73b8[69]],name:{$ne:_0x65d6x1b[_0x73b8[30]]}},raw:true})})[_0x73b8[92]](function(_0x65d6x2d){if(_0x65d6x2d&& _0x65d6x2d[_0x73b8[68]]){_[_0x73b8[93]](_0x65d6x2d,function(_0x65d6x29){var _0x65d6x28=_[_0x73b8[133]]({newValues:{id:_0x65d6x29[_0x73b8[131]],queueStatus:_0x73b8[121],queueStatusAt:_0x65d6x2b}},_0x65d6x29,{queueStatus:_0x73b8[121],queueStatusAt:_0x65d6x2b});_0x65d6x16(util[_0x73b8[59]](_0x73b8[135],_0x65d6x29[_0x73b8[136]],_0x65d6x29[_0x73b8[131]]),_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[127],_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[126],_0x73b8[137],_0x65d6x28)})}})[_0x73b8[67]](function(_0x65d6x1f){logger[_0x73b8[66]](_0x73b8[167],_0x65d6x1f)})}},agentringnoanswer:function(_0x65d6x1b){return function(_0x65d6x20){if(_0x65d6x20){triggers[_0x73b8[154]](_0x65d6x20)};var _0x65d6x28;var _0x65d6x2b=moment()[_0x73b8[59]](_0x73b8[58]);return User[_0x73b8[142]]({where:{name:_0x65d6x1b[_0x73b8[30]]},raw:true})[_0x73b8[92]](function(_0x65d6x29){if(_0x65d6x29){var _0x65d6x28=_[_0x73b8[133]]({newValues:{id:_0x65d6x29[_0x73b8[131]],queueStatus:_0x73b8[121],queueStatusAt:_0x65d6x2b,lastQueue:_0x65d6x1b[_0x73b8[69]]}},_0x65d6x29,{queueStatus:_0x73b8[121],queueStatusAt:_0x65d6x2b,lastQueue:_0x65d6x1b[_0x73b8[69]]});_0x65d6x28[_0x73b8[26]]= _0x73b8[173];_0x65d6x16(util[_0x73b8[59]](_0x73b8[135],_0x65d6x29[_0x73b8[136]],_0x65d6x29[_0x73b8[131]]),_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[127],_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[126],_0x73b8[137],_0x65d6x28)};return ReportAgent[_0x73b8[142]]({where:{uniqueid:_0x65d6x1b[_0x73b8[118]],destuniqueid:_0x65d6x1b[_0x73b8[162]]},raw:true})})[_0x73b8[92]](function(_0x65d6x2c){if(_0x65d6x2c){_0x65d6x28= _[_0x73b8[133]]({},_0x65d6x2c,{lastevent:_0x73b8[172],agentringnoanswer:true,agentringnoanswerAt:moment()[_0x73b8[59]](_0x73b8[58]),reason:_0x73b8[172]});_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x2c[_0x73b8[30]]),_0x73b8[160],_0x65d6x28)}})[_0x73b8[67]](function(_0x65d6x1f){logger[_0x73b8[66]](_0x73b8[171],_0x65d6x1f)})}},queuememberadded:function(_0x65d6x1b){return function(_0x65d6x20){if(_0x65d6x20){_0x65d6x16(_0x65d6x20[_0x73b8[69]],_0x73b8[174],_0x65d6x20);_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x20.UserId),_0x73b8[174],_0x65d6x20)};return BPromise[_0x73b8[113]]()}},queuememberremoved:function(_0x65d6x1b){return function(_0x65d6x20){if(params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]]){delete params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[114]][_0x65d6x1b[_0x73b8[30]]]};return User[_0x73b8[142]]({where:{name:_0x65d6x1b[_0x73b8[32]][_0x73b8[140]](_0x73b8[138],_0x73b8[139])},raw:true})[_0x73b8[92]](function(_0x65d6x29){if(_0x65d6x29){_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[176],{queue:_0x65d6x1b[_0x73b8[69]],UserId:_0x65d6x29[_0x73b8[131]]});_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x29[_0x73b8[131]]),_0x73b8[176],{queue:_0x65d6x1b[_0x73b8[69]],UserId:_0x65d6x29[_0x73b8[131]]})}})[_0x73b8[67]](function(_0x65d6x1f){logger[_0x73b8[66]](_0x73b8[175],_0x65d6x1f)})}},queuememberpause:function(_0x65d6x1b){return function(_0x65d6x20){if(_0x65d6x20){_0x65d6x16(_0x65d6x20[_0x73b8[69]],_0x73b8[174],_0x65d6x20);_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x20.UserId),_0x73b8[174],_0x65d6x20)}}},queuememberpenalty:function(_0x65d6x1b){return function(_0x65d6x20){return BPromise[_0x73b8[113]]()}},queuememberringinuse:function(_0x65d6x1b){return function(_0x65d6x20){return BPromise[_0x73b8[113]]()}},queuemember:function(_0x65d6x1b){return function(_0x65d6x20){_0x65d6x1a(_0x65d6x1b);_0x65d6x1c(_0x65d6x1b[_0x73b8[69]]);params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[114]][_0x65d6x1b[_0x73b8[31]]]= _0x65d6x1b;return BPromise[_0x73b8[113]]()}},queuecallerjoin:function(_0x65d6x1b){return function(_0x65d6x20){if(!params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]]){params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]]= {};params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[72]]= 0;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[74]]= 0;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[76]]= 0;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[87]]= 0;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[89]]= 0;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[77]]= 0;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[78]]= 0;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[83]]= 0;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[85]]= 0;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[90]]= 0;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[91]]= 0;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[70]]= 0};params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]]= {channel:_0x65d6x1b[_0x73b8[124]],channelstate:Number(_0x65d6x1b[_0x73b8[177]]),channelstatedesc:_0x65d6x1b[_0x73b8[178]],calleridnum:_0x65d6x1b[_0x73b8[179]],calleridname:_0x65d6x1b[_0x73b8[180]],exten:_0x65d6x1b[_0x73b8[181]],priority:Number(_0x65d6x1b[_0x73b8[182]]),uniqueid:_0x65d6x1b[_0x73b8[118]],queue:_0x65d6x1b[_0x73b8[69]],position:Number(_0x65d6x1b[_0x73b8[183]]),count:Number(_0x65d6x1b[_0x73b8[184]])};params[_0x73b8[62]][_0x73b8[63]][_0x73b8[72]]++;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[72]]++;_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[155],{type:_0x73b8[70],amount:1,queue:_0x65d6x1b[_0x73b8[69]]});params[_0x73b8[62]][_0x73b8[63]][_0x73b8[70]]++;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[70]]++;_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[155],{type:_0x73b8[72],amount:1,queue:_0x65d6x1b[_0x73b8[69]]});if(_0x65d6x20){_0x65d6x16(_0x65d6x20[_0x73b8[69]],_0x73b8[185],_0x65d6x20)};return BPromise[_0x73b8[113]]()}},queuecallerabandon:function(_0x65d6x1b){return function(_0x65d6x20){if(_0x65d6x20&& _0x65d6x20[_0x73b8[186]]&& _0x65d6x20[_0x73b8[186]][0]){_[_0x73b8[93]](_0x65d6x20[_0x73b8[186]][1],function(_0x65d6x2c){_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x2c[_0x73b8[30]]),_0x73b8[160],_0x65d6x2c)})};if(_0x65d6x20&& _0x65d6x20[_0x73b8[187]]){_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[158],_0x65d6x20[_0x73b8[187]]);_0x65d6x20[_0x73b8[187]][_0x73b8[148]][_0x73b8[188]]= _0x73b8[87];_0x65d6x20[_0x73b8[187]][_0x73b8[189]][_0x73b8[188]]= true;triggers[_0x73b8[154]](_0x65d6x20[_0x73b8[187]])};var _0x65d6x28;var _0x65d6x2b=moment()[_0x73b8[59]](_0x73b8[58]);if(params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[72]]){params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[72]]--;_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[155],{type:_0x73b8[72],amount:-1,queue:_0x65d6x1b[_0x73b8[69]]})};if(params[_0x73b8[62]][_0x73b8[63]][_0x73b8[72]]){params[_0x73b8[62]][_0x73b8[63]][_0x73b8[72]]--};if(params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]]){params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]][_0x73b8[77]]= Number(_0x65d6x1b[_0x73b8[77]]);params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]][_0x73b8[183]]= Number(_0x65d6x1b[_0x73b8[183]]);params[_0x73b8[62]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]][_0x73b8[190]]= Number(_0x65d6x1b[_0x73b8[190]])};params[_0x73b8[62]][_0x73b8[63]][_0x73b8[87]]++;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[87]]++;_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[155],{type:_0x73b8[191],amount:1,queue:_0x65d6x1b[_0x73b8[69]]});params[_0x73b8[62]][_0x73b8[63]][_0x73b8[90]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[63]][_0x73b8[76]]/ (params[_0x73b8[62]][_0x73b8[63]][_0x73b8[76]]+ params[_0x73b8[62]][_0x73b8[63]][_0x73b8[87]])* 100,2);params[_0x73b8[62]][_0x73b8[63]][_0x73b8[91]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[63]][_0x73b8[87]]/ (params[_0x73b8[62]][_0x73b8[63]][_0x73b8[76]]+ params[_0x73b8[62]][_0x73b8[63]][_0x73b8[87]])* 100,2);params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[90]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[76]]/ (params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[76]]+ params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[87]])* 100,2);params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[91]]= _[_0x73b8[84]](params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[87]]/ (params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[76]]+ params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[87]])* 100,2);return User[_0x73b8[97]]({where:{lastQueue:_0x65d6x1b[_0x73b8[69]]},raw:true})[_0x73b8[92]](function(_0x65d6x2f){if(_0x65d6x2f&& _0x65d6x2f[_0x73b8[68]]){var _0x65d6x28;_[_0x73b8[93]](_0x65d6x2f,function(_0x65d6x30){_0x65d6x28= _[_0x73b8[133]]({newValues:{id:_0x65d6x30[_0x73b8[131]],queueStatus:_0x73b8[121],queueStatusAt:_0x65d6x2b,lastQueue:_0x65d6x1b[_0x73b8[69]]}},_0x65d6x30,{id:_0x65d6x30[_0x73b8[131]],queueStatus:_0x73b8[121],queueStatusAt:_0x65d6x2b,lastQueue:_0x65d6x1b[_0x73b8[69]]});_0x65d6x28[_0x73b8[26]]= _0x73b8[95];_0x65d6x16(util[_0x73b8[59]](_0x73b8[135],_0x65d6x30[_0x73b8[136]],_0x65d6x30[_0x73b8[131]]),_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[127],_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[126],_0x73b8[137],_0x65d6x28)})}})[_0x73b8[67]](function(_0x65d6x1f){logger[_0x73b8[66]](_0x73b8[192],_0x65d6x1f)})}},blindtransfer:function(_0x65d6x1b){return function(_0x65d6x20){_0x65d6x16(null,_0x65d6x1b[_0x73b8[26]][_0x73b8[193]](),_0x65d6x1b);return BPromise[_0x73b8[113]]()}},attendedtransfer:function(_0x65d6x1b){return function(_0x65d6x20){_0x65d6x16(null,_0x65d6x1b[_0x73b8[26]][_0x73b8[193]](),_0x65d6x1b);return BPromise[_0x73b8[113]]()}},dialbegin:function(_0x65d6x1b){return function(_0x65d6x20){params[_0x73b8[98]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]]= {channel:_0x65d6x1b[_0x73b8[124]],channelstate:Number(_0x65d6x1b[_0x73b8[177]]),channelstatedesc:_0x65d6x1b[_0x73b8[178]],calleridnum:_0x65d6x1b[_0x73b8[179]],calleridname:_0x65d6x1b[_0x73b8[180]],context:_0x65d6x1b[_0x73b8[194]],exten:_0x65d6x1b[_0x73b8[181]],priority:Number(_0x65d6x1b[_0x73b8[182]]),dialstring:_0x65d6x1b[_0x73b8[195]]};if(_0x65d6x1b[_0x73b8[124]]){var _0x65d6x28=_[_0x73b8[196]](_0x65d6x1b,{starttime:moment()[_0x73b8[59]](_0x73b8[58]),lastevent:_0x73b8[152],updatedAt:moment()[_0x73b8[59]](_0x73b8[58])});_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x1b[_0x73b8[124]][_0x73b8[123]](/\/|-/)[1]),_0x73b8[197],_0x65d6x28);_0x65d6x16(_0x73b8[127],_0x73b8[125],_[_0x73b8[196]](_0x65d6x28,{role:_0x73b8[127]}));_0x65d6x16(_0x73b8[126],_0x73b8[125],_0x65d6x28,_[_0x73b8[196]](_0x65d6x28,{role:_0x73b8[126]}));if(_0x65d6x20){triggers[_0x73b8[128]](_0x65d6x20)}};return BPromise[_0x73b8[113]]()}},dialend:function(_0x65d6x1b){return function(_0x65d6x20){if(params[_0x73b8[98]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]]){params[_0x73b8[98]][_0x73b8[119]][_0x65d6x1b[_0x73b8[118]]][_0x73b8[198]]= _0x65d6x1b[_0x73b8[198]]};if(_0x65d6x1b[_0x73b8[124]]){var _0x65d6x2b=moment()[_0x73b8[59]](_0x73b8[58]);var _0x65d6x28={dialstatus:_0x65d6x1b[_0x73b8[198]],lastevent:(_0x65d6x1b[_0x73b8[198]]=== _0x73b8[103])?_0x73b8[168]:_0x73b8[121],answertime:(_0x65d6x1b[_0x73b8[198]]=== _0x73b8[103])?_0x65d6x2b:null,uniqueid:_0x65d6x1b[_0x73b8[118]],linkedid:_0x65d6x1b[_0x73b8[120]],destuniqueid:_0x65d6x1b[_0x73b8[162]],destlinkedid:_0x65d6x1b[_0x73b8[199]],updatedAt:_0x65d6x2b};_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x1b[_0x73b8[124]][_0x73b8[123]](/\/|-/)[1]),_0x73b8[125],_0x65d6x28);_0x65d6x16(_0x73b8[127],_0x73b8[125],_0x65d6x28);_0x65d6x16(_0x73b8[126],_0x73b8[125],_0x65d6x28);if(_0x65d6x20){triggers[_0x73b8[128]](_0x65d6x20)}};return BPromise[_0x73b8[113]]()}},varset:function(_0x65d6x1b){return function(_0x65d6x20){if(_0x65d6x1b[_0x73b8[201]][_0x73b8[55]](_0x73b8[200])){_0x65d6x16(_0x73b8[127],_0x73b8[197],{uniqueid:_0x65d6x1b[_0x73b8[118]],routeId:_0x65d6x1b[_0x73b8[202]],updatedAt:moment()[_0x73b8[59]](_0x73b8[58])});_0x65d6x16(_0x73b8[126],_0x73b8[197],{uniqueid:_0x65d6x1b[_0x73b8[118]],routeId:_0x65d6x1b[_0x73b8[202]],updatedAt:moment()[_0x73b8[59]](_0x73b8[58])})};if(_0x65d6x1b){triggers[_0x73b8[203]](_0x65d6x1b)};return BPromise[_0x73b8[113]]()}},queuecallerunmanaged:function(_0x65d6x1b){return function(_0x65d6x20){if(_0x65d6x20){params[_0x73b8[62]][_0x73b8[63]][_0x73b8[89]]+= 1;params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[89]]+= 1;_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[155],{type:_0x73b8[89],amount:1,queue:_0x65d6x1b[_0x73b8[69]]});if(params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[72]]){params[_0x73b8[62]][_0x73b8[61]][_0x65d6x1b[_0x73b8[69]]][_0x73b8[72]]-= 1};if(params[_0x73b8[62]][_0x73b8[63]][_0x73b8[72]]){params[_0x73b8[62]][_0x73b8[63]][_0x73b8[72]]-= 1;_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[155],{type:_0x73b8[72],amount:-1,queue:_0x65d6x1b[_0x73b8[69]]})};_0x65d6x16(_0x65d6x1b[_0x73b8[69]],_0x73b8[158],_0x65d6x20);var _0x65d6x2b=moment()[_0x73b8[59]](_0x73b8[58]);return User[_0x73b8[97]]({where:{lastQueue:_0x65d6x1b[_0x73b8[69]]},raw:true})[_0x73b8[92]](function(_0x65d6x2f){if(_0x65d6x2f&& _0x65d6x2f[_0x73b8[68]]){var _0x65d6x28;_[_0x73b8[93]](_0x65d6x2f,function(_0x65d6x30){_0x65d6x28= _[_0x73b8[133]]({newValues:{id:_0x65d6x30[_0x73b8[131]],queueStatus:_0x73b8[121],queueStatusAt:_0x65d6x2b,lastQueue:_0x65d6x1b[_0x73b8[69]]}},_0x65d6x30,{id:_0x65d6x30[_0x73b8[131]],queueStatus:_0x73b8[121],queueStatusAt:_0x65d6x2b,lastQueue:_0x65d6x1b[_0x73b8[69]]});_0x65d6x28[_0x73b8[26]]= _0x73b8[204];_0x65d6x16(util[_0x73b8[59]](_0x73b8[135],_0x65d6x30[_0x73b8[136]],_0x65d6x30[_0x73b8[131]]),_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[127],_0x73b8[137],_0x65d6x28);_0x65d6x16(_0x73b8[126],_0x73b8[137],_0x65d6x28)})}})[_0x73b8[67]](function(_0x65d6x1f){logger[_0x73b8[66]](_0x73b8[192],_0x65d6x1f)})}}},agentUpdate:function(_0x65d6x30){return function(){_0x65d6x30[_0x73b8[26]]= _0x73b8[205];_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x30[_0x73b8[131]]),_0x73b8[137],_0x65d6x30);_0x65d6x16(_0x73b8[127],_0x73b8[137],_0x65d6x30);_0x65d6x16(_0x73b8[126],_0x73b8[137],_0x65d6x30)}},console:function(_0x65d6x31){_0x65d6x16(_0x65d6x31[_0x73b8[206]],util[_0x73b8[59]](_0x73b8[207],_0x65d6x31[_0x73b8[112]]),_0x65d6x31[_0x73b8[208]])},realtimeQueueMembers:function(_0x65d6x32){return function(){_[_0x73b8[210]](params[_0x73b8[62]][_0x73b8[61]],function(_0x65d6x1d,_0x65d6x22){if(_[_0x73b8[209]](_0x65d6x32,_0x65d6x22)){_[_0x73b8[210]](_0x65d6x1d[_0x73b8[114]],function(_0x65d6x30){_0x65d6x16(_0x65d6x22,_0x73b8[174],_0x65d6x30)})}})}},updateTriggers:function(_0x65d6x31){return function(){return triggers[_0x73b8[211]](_0x65d6x31)}},queueAdd:function(_0x65d6x33,_0x65d6x34){return function(){if(_0x65d6x33&& _0x65d6x34){_[_0x73b8[93]](_0x65d6x33,function(_0x65d6x20){_0x65d6x16(null,util[_0x73b8[59]](_0x73b8[212],_0x65d6x34),_0x65d6x20[0])})}}},queueRemove:function(_0x65d6x20,_0x65d6x34){return function(){if(_0x65d6x20&& _0x65d6x34){_0x65d6x16(null,util[_0x73b8[59]](_0x73b8[213],_0x65d6x34),_0x65d6x20)}}},checkTriggers:function(_0x65d6x31){return function(){return triggers[_0x73b8[214]](_0x65d6x31)}},videoOn:function(_0x65d6x1b){return function(){return triggers[_0x73b8[215]](_0x65d6x1b)}},inboundInit:function(){return function(){return BPromise[_0x73b8[113]]()[_0x73b8[92]](_0x65d6x1e())}},outboundInit:function(){return function(){return BPromise[_0x73b8[113]]()[_0x73b8[92]](_0x65d6x25())}},reportFaxUpdate:function(_0x65d6x35){return function(){_0x65d6x35[_0x73b8[26]]= _0x73b8[216];_0x65d6x16(util[_0x73b8[59]](_0x73b8[122],_0x65d6x35[_0x73b8[217]]),_0x73b8[137],_0x65d6x35);_0x65d6x16(_0x73b8[126],_0x73b8[218],_0x65d6x35)}},widgetValues:function(_0x65d6x36,_0x65d6x29){return function(){_[_0x73b8[210]](_0x65d6x36,function(_0x65d6x37,_0x65d6x38){_0x65d6x16(util[_0x73b8[59]](_0x73b8[135],_0x65d6x29[_0x73b8[136]],_0x65d6x29[_0x73b8[131]]),_0x73b8[219]+ _0x65d6x38,_0x65d6x37)})}},receivefax:function(_0x65d6x1b){return function(_0x65d6x31){if(_0x65d6x31){return triggers[_0x73b8[220]](_0x65d6x31)};return null}}}}
\ No newline at end of file