Built motion from commit ec3ecc5.|1.0.2
[motion.git] / server / config / ami / socket.js
index c94ac61..ea32ac0 100644 (file)
@@ -1 +1 @@
-var _0x5612=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x72\x65\x64\x69\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74","\x52\x65\x70\x6F\x72\x74\x44\x69\x61\x6C","\x52\x65\x70\x6F\x72\x74\x4D\x65\x6D\x62\x65\x72","\x55\x73\x65\x72","\x2E\x2E\x2F\x74\x72\x69\x67\x67\x65\x72\x73","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x2E\x2F\x75\x74\x69\x6C\x73","\x72\x65\x64\x69\x73\x50\x77\x64","\x69\x70","\x63\x72\x65\x61\x74\x65\x43\x6C\x69\x65\x6E\x74","\x73\x6F\x63\x6B\x65\x74\x2E\x69\x6F\x2D\x65\x6D\x69\x74\x74\x65\x72","\x65\x78\x70\x6F\x72\x74\x73","\x65\x6D\x69\x74","\x74\x6F","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x74\x6F\x74\x61\x6C","\x67\x6C\x6F\x62\x61\x6C","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x61\x6E\x73\x77\x65\x72\x65\x64","\x41\x4E\x53\x57\x45\x52\x45\x44","\x64\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x63\x6F\x75\x6E\x74\x42\x79","\x73\x75\x6D\x44\x75\x72\x61\x74\x69\x6F\x6E","\x62\x69\x6C\x6C\x61\x62\x6C\x65\x73\x65\x63\x6F\x6E\x64\x73","\x73\x75\x6D\x42\x79","\x61\x76\x67\x44\x75\x72\x61\x74\x69\x6F\x6E","\x72\x65\x73\x75\x6C\x74","\x72\x6F\x75\x6E\x64","\x61\x6E\x73\x77\x65\x72\x52\x61\x74\x65","\x74\x68\x65\x6E","\x71\x75\x65\x75\x65","\x71\x75\x65\x75\x65\x73","\x69\x6E\x62\x6F\x75\x6E\x64","\x77\x61\x69\x74\x69\x6E\x67","\x61\x63\x74\x69\x76\x65","\x63\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x68\x6F\x6C\x64\x74\x69\x6D\x65","\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x61\x76\x67\x48\x6F\x6C\x64\x74\x69\x6D\x65","\x61\x76\x67\x54\x61\x6C\x6B\x74\x69\x6D\x65","\x61\x62\x61\x6E\x64\x6F\x6E\x52\x61\x74\x65","\x69\x73\x57\x61\x69\x74\x69\x6E\x67","\x69\x73\x41\x63\x74\x69\x76\x65","\x69\x73\x43\x6F\x6D\x70\x6C\x65\x74\x65\x64","\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","\x69\x73\x41\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x69\x73\x55\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x74\x79\x70\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x6E\x61\x6D\x65","\x6B\x65\x79\x42\x79","\x61\x67\x65\x6E\x74\x73","\x66\x6F\x72\x45\x61\x63\x68","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x65\x78\x69\x74","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x76\x6F\x69\x63\x65\x2F\x6F\x75\x74\x62\x6F\x75\x6E\x64\x2F\x67\x6C\x6F\x62\x61\x6C","\x76\x6F\x69\x63\x65\x3A\x6F\x75\x74\x62\x6F\x75\x6E\x64\x3A\x67\x6C\x6F\x62\x61\x6C","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x65\x76\x65\x6E\x74","\x72\x65\x73\x6F\x6C\x76\x65","\x75\x6E\x69\x71\x75\x65\x69\x64","\x63\x68\x61\x6E\x6E\x65\x6C\x73","\x76\x6F\x69\x63\x65\x2F\x6F\x75\x74\x62\x6F\x75\x6E\x64\x2F\x63\x68\x61\x6E\x6E\x65\x6C\x73","\x76\x6F\x69\x63\x65\x3A\x6F\x75\x74\x62\x6F\x75\x6E\x64\x3A\x63\x68\x61\x6E\x6E\x65\x6C\x73","\x76\x6F\x69\x63\x65\x2F\x69\x6E\x62\x6F\x75\x6E\x64\x2F\x63\x68\x61\x6E\x6E\x65\x6C\x73","\x76\x6F\x69\x63\x65\x3A\x69\x6E\x62\x6F\x75\x6E\x64\x3A\x63\x68\x61\x6E\x6E\x65\x6C\x73","\x6C\x69\x6E\x6B\x65\x64\x69\x64","\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","\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\x73\x61\x76\x65","\x61\x64\x6D\x69\x6E\x73","\x72\x65\x70\x6F\x72\x74\x5F\x64\x69\x61\x6C\x3A\x75\x70\x64\x61\x74\x65","\x75\x73\x65\x72\x73","\x72\x65\x70\x6F\x72\x74\x44\x69\x61\x6C","\x64\x65\x76\x69\x63\x65\x73\x74\x61\x74\x65\x63\x68\x61\x6E\x67\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x6C\x6F\x67","\x69\x64","\x73\x74\x61\x74\x65","\x61\x73\x73\x69\x67\x6E","\x25\x73\x3A\x25\x73","\x72\x6F\x6C\x65","\x61\x67\x65\x6E\x74\x3A\x73\x61\x76\x65","\x53\x49\x50\x2F","","\x72\x65\x70\x6C\x61\x63\x65","\x64\x65\x76\x69\x63\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x2F","\x70\x65\x65\x72","\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","\x75\x73\x65\x72\x6E\x61\x6D\x65","\x64\x6F\x6D\x61\x69\x6E","\x73\x61\x74\x75\x73","\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","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x74\x72\x75\x6E\x6B","\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","\x76\x6F\x69\x63\x65\x2F\x69\x6E\x62\x6F\x75\x6E\x64\x2F\x71\x75\x65\x75\x65\x73\x2F\x25\x73","\x76\x6F\x69\x63\x65\x3A\x69\x6E\x62\x6F\x75\x6E\x64\x3A\x71\x75\x65\x75\x65\x73\x3A\x25\x73","\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x3A\x75\x70\x64\x61\x74\x65","\x72\x65\x61\x73\x6F\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x3A\x75\x70\x64\x61\x74\x65","\x64\x65\x73\x74\x75\x6E\x69\x71\x75\x65\x69\x64","\x63\x6F\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x61\x6D\x65","\x72\x69\x6E\x67\x74\x69\x6D\x65","\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x61\x67\x65\x6E\x74\x63\x6F\x6E\x6E\x65\x63\x74\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x63\x6F\x6E\x6E\x65\x63\x74","\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x65\x6C\x73\x65\x77\x68\x65\x72\x65","\x61\x67\x65\x6E\x74\x72\x69\x6E\x67\x6E\x6F\x61\x6E\x73\x77\x65\x72\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x72\x65\x6A\x65\x63\x74\x65\x64","\x73\x74\x61\x74\x65\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x70\x65\x6E\x61\x6C\x74\x79","\x63\x61\x6C\x6C\x73\x74\x61\x6B\x65\x6E","\x73\x74\x61\x74\x75\x73","\x70\x61\x75\x73\x65\x64","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x76\x6F\x69\x63\x65\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x71\x75\x65\x75\x65\x6D\x65\x6D\x62\x65\x72\x72\x65\x6D\x6F\x76\x65\x64\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x76\x6F\x69\x63\x65\x5F\x71\x75\x65\x75\x65\x3A\x72\x65\x6D\x6F\x76\x65","\x71\x75\x65\x75\x65\x6D\x65\x6D\x62\x65\x72\x70\x61\x75\x73\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x6D\x65\x72\x67\x65","\x71\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x49\x4E\x55\x53\x45","\x52\x49\x4E\x47\x49\x4E\x47","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65\x64\x65\x73\x63","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x65\x78\x74\x65\x6E","\x70\x72\x69\x6F\x72\x69\x74\x79","\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x63\x6F\x75\x6E\x74","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6A\x6F\x69\x6E\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x6F\x72\x69\x67\x69\x6E\x61\x6C\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x61\x62\x61\x6E\x64\x6F\x6E","\x63\x6F\x6E\x74\x65\x78\x74","\x64\x69\x61\x6C\x73\x74\x72\x69\x6E\x67","\x64\x69\x61\x6C\x73\x74\x61\x74\x75\x73","\x41\x4E\x53\x57\x45\x52","\x64\x65\x73\x74\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x71\x75\x65\x75\x65\x73\x74\x61\x74\x75\x73","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x76\x61\x72\x69\x61\x62\x6C\x65","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x72\x6F\x75\x74\x65\x69\x64","\x76\x61\x6C\x75\x65"];_0x5612[0];var _=require(_0x5612[1]);var util=require(_0x5612[2]);var moment=require(_0x5612[3]);var BPromise=require(_0x5612[4]);var redis=require(_0x5612[5]);var VoiceQueue=require(_0x5612[7])[_0x5612[6]];var ReportQueue=require(_0x5612[7])[_0x5612[8]];var ReportCall=require(_0x5612[7])[_0x5612[9]];var ReportAgent=require(_0x5612[7])[_0x5612[10]];var ReportDial=require(_0x5612[7])[_0x5612[11]];var ReportMember=require(_0x5612[7])[_0x5612[12]];var User=require(_0x5612[7])[_0x5612[13]];var Triggers=require(_0x5612[14]);var config=require(_0x5612[15]);var utils=require(_0x5612[16]);var redisConf;if(config[_0x5612[17]]){redisConf= {password:config[_0x5612[17]]}};var redisClient=redis[_0x5612[19]](6379,config[_0x5612[18]],redisConf);var io=require(_0x5612[20])(redisClient);var triggers= new Triggers(io);var params={trunks:[],inbound:{queues:[],channels:[],global:{waiting:0,active:0,completed:0,abandoned:0,unmanaged:0,holdtime:0,talktime:0,avgHoldtime:0,avgTalktime:0,answerRate:0,abandonRate:0,total:0}},outbound:{global:{total:0,answered:0,sumDuration:0,avgDuration:0},channels:[]}};module[_0x5612[21]]= function(){var _0x5e13x15=function(_0x5e13x16,_0x5e13x17,_0x5e13x18){if(_0x5e13x16){io[_0x5612[23]](_0x5e13x16)[_0x5612[22]](_0x5e13x17,_0x5e13x18)}else {io[_0x5612[22]](_0x5e13x17,_0x5e13x18)}};VoiceQueue[_0x5612[65]]({attributes:[_0x5612[66]],raw:true})[_0x5612[41]](function(_0x5e13x1a){if(_0x5e13x1a){params[_0x5612[44]][_0x5612[43]]= _[_0x5612[69]](_[_0x5612[67]](_0x5e13x1a,_0x5612[66]),function(_0x5e13x1f,_0x5e13x20){_0x5e13x1f[_0x5612[68]]= {};_0x5e13x1f[_0x5612[45]]= 0;_0x5e13x1f[_0x5612[46]]= 0;_0x5e13x1f[_0x5612[47]]= 0;_0x5e13x1f[_0x5612[48]]= 0;_0x5e13x1f[_0x5612[49]]= 0;_0x5e13x1f[_0x5612[50]]= 0;_0x5e13x1f[_0x5612[51]]= 0;_0x5e13x1f[_0x5612[52]]= 0;_0x5e13x1f[_0x5612[53]]= 0;_0x5e13x1f[_0x5612[40]]= 0;_0x5e13x1f[_0x5612[54]]= 0;_0x5e13x1f[_0x5612[27]]= 0});return ReportQueue[_0x5612[65]]({attributes:[_0x5612[42],_0x5612[58],_0x5612[61],_0x5612[70],_0x5612[71],_0x5612[72],_0x5612[50]],raw:true})}})[_0x5612[41]](function(_0x5e13x1a){if(_0x5e13x1a){var _0x5e13x1b;var _0x5e13x1c;var _0x5e13x1d=_0x5e13x1a[_0x5612[26]];for(var _0x5e13x1e=0;_0x5e13x1e< _0x5e13x1d;_0x5e13x1e++){_0x5e13x1b= _0x5e13x1a[_0x5e13x1e];_0x5e13x1c= _0x5e13x1b[_0x5612[42]];if(!params[_0x5612[44]][_0x5612[43]][_0x5e13x1c]){params[_0x5612[44]][_0x5612[43]][_0x5e13x1c]= {};params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[45]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[46]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[47]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[48]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[49]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[50]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[51]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[52]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[53]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[40]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[54]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[27]]= 0};params[_0x5612[44]][_0x5612[28]][_0x5612[27]]++;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[27]]++;if(utils[_0x5612[55]](_0x5e13x1b)){params[_0x5612[44]][_0x5612[28]][_0x5612[45]]++;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[45]]++};if(utils[_0x5612[56]](_0x5e13x1b)){params[_0x5612[44]][_0x5612[28]][_0x5612[46]]++;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[46]]++};if(utils[_0x5612[57]](_0x5e13x1b)){params[_0x5612[44]][_0x5612[28]][_0x5612[47]]++;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[47]]++;params[_0x5612[44]][_0x5612[28]][_0x5612[50]]+= _0x5e13x1b[_0x5612[50]]|| 0;params[_0x5612[44]][_0x5612[28]][_0x5612[51]]+= moment(_0x5e13x1b[_0x5612[61]])[_0x5612[60]](moment(_0x5e13x1b[_0x5612[58]]),_0x5612[59]);params[_0x5612[44]][_0x5612[28]][_0x5612[52]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[50]]/ params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[47]]);params[_0x5612[44]][_0x5612[28]][_0x5612[53]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[51]]/ params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[47]]);params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[50]]+= _0x5e13x1b[_0x5612[50]]|| 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[51]]+= moment(_0x5e13x1b[_0x5612[61]])[_0x5612[60]](moment(_0x5e13x1b[_0x5612[58]]),_0x5612[59]);params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[52]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[50]]/ params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[47]]);params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[53]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[51]]/ params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[47]])};if(utils[_0x5612[62]](_0x5e13x1b)){params[_0x5612[44]][_0x5612[28]][_0x5612[48]]++;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[48]]++};if(utils[_0x5612[63]](_0x5e13x1b)){params[_0x5612[44]][_0x5612[28]][_0x5612[49]]++;params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[49]]++}};params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[40]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[47]]/ (params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[47]]+ params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[48]])* 100,2);params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[54]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[48]]/ (params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[47]]+ params[_0x5612[44]][_0x5612[43]][_0x5e13x1c][_0x5612[48]])* 100,2);params[_0x5612[44]][_0x5612[28]][_0x5612[40]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[28]][_0x5612[47]]/ (params[_0x5612[44]][_0x5612[28]][_0x5612[47]]+ params[_0x5612[44]][_0x5612[28]][_0x5612[48]])* 100,2);params[_0x5612[44]][_0x5612[28]][_0x5612[54]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[28]][_0x5612[48]]/ (params[_0x5612[44]][_0x5612[28]][_0x5612[47]]+ params[_0x5612[44]][_0x5612[28]][_0x5612[48]])* 100,2)};return ReportCall[_0x5612[65]]({where:{type:_0x5612[29]},attributes:[_0x5612[64],_0x5612[32],_0x5612[35]],raw:true})})[_0x5612[41]](function(_0x5e13x1a){if(_0x5e13x1a){if(_0x5e13x1a[_0x5612[26]]){params[_0x5612[29]][_0x5612[28]][_0x5612[27]]= _0x5e13x1a[_0x5612[26]];params[_0x5612[29]][_0x5612[28]][_0x5612[30]]= _[_0x5612[33]](_0x5e13x1a,_0x5612[32])[_0x5612[31]]|| 0;params[_0x5612[29]][_0x5612[28]][_0x5612[34]]= _[_0x5612[36]](_0x5e13x1a,_0x5612[35]);if(params[_0x5612[29]][_0x5612[28]][_0x5612[30]]){params[_0x5612[29]][_0x5612[28]][_0x5612[37]]= _[_0x5612[39]]((_[_0x5612[36]](_0x5e13x1a[_0x5612[38]],_0x5612[35])/ params[_0x5612[29]][_0x5612[28]][_0x5612[30]]));params[_0x5612[29]][_0x5612[28]][_0x5612[40]]= _[_0x5612[39]](params[_0x5612[29]][_0x5612[28]][_0x5612[30]]/ params[_0x5612[29]][_0x5612[28]][_0x5612[27]]* 100,1)}}}})[_0x5612[25]](function(_0x5e13x19){console[_0x5612[24]](_0x5e13x19)});return {cdr:function(_0x5e13x21){return function(_0x5e13x1a){if(_0x5e13x21[_0x5612[64]]=== _0x5612[29]){params[_0x5612[29]][_0x5612[28]][_0x5612[27]]++;params[_0x5612[29]][_0x5612[28]][_0x5612[30]]= (_0x5e13x21[_0x5612[32]]=== _0x5612[31])?++params[_0x5612[29]][_0x5612[28]][_0x5612[30]]:params[_0x5612[29]][_0x5612[28]][_0x5612[30]];params[_0x5612[29]][_0x5612[28]][_0x5612[34]]+= Number(_0x5e13x21[_0x5612[35]]);if(params[_0x5612[29]][_0x5612[28]][_0x5612[30]]){params[_0x5612[29]][_0x5612[28]][_0x5612[37]]= _[_0x5612[39]](params[_0x5612[29]][_0x5612[28]][_0x5612[34]]/ params[_0x5612[29]][_0x5612[28]][_0x5612[30]]);params[_0x5612[29]][_0x5612[28]][_0x5612[40]]= _[_0x5612[39]](params[_0x5612[29]][_0x5612[28]][_0x5612[30]]/ params[_0x5612[29]][_0x5612[28]][_0x5612[27]]* 100,1)};_0x5e13x15(_0x5612[73],_0x5612[74],params[_0x5612[29]][_0x5612[28]])};_0x5e13x15(null,_0x5e13x21[_0x5612[76]][_0x5612[75]](),_0x5e13x21);return BPromise[_0x5612[77]]()}},send:function(_0x5e13x21){return function(_0x5e13x1a){return BPromise[_0x5612[77]]()}},hangup:function(_0x5e13x21){return function(_0x5e13x1a){if(params[_0x5612[29]][_0x5612[79]][_0x5e13x21[_0x5612[78]]]){delete params[_0x5612[29]][_0x5612[79]][_0x5e13x21[_0x5612[78]]];_0x5e13x15(_0x5612[80],_0x5612[81],params[_0x5612[29]][_0x5612[79]])};if(params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]]){delete params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]];_0x5e13x15(_0x5612[82],_0x5612[83],params[_0x5612[44]][_0x5612[79]])};var _0x5e13x22={uniqueid:_0x5e13x21[_0x5612[78]],linkedid:_0x5e13x21[_0x5612[84]],endtime:moment()[_0x5612[86]](_0x5612[85]),lastevent:_0x5612[87],updatedAt:moment()[_0x5612[86]](_0x5612[85])};_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x21[_0x5612[90]][_0x5612[89]](/\/|-/)[1]),_0x5612[91],_0x5e13x22);_0x5e13x15(_0x5612[92],_0x5612[93],_0x5e13x22);_0x5e13x15(_0x5612[94],_0x5612[93],_0x5e13x22);if(_0x5e13x1a){triggers[_0x5612[95]](_0x5e13x1a)};return BPromise[_0x5612[77]]()}},devicestatechange:function(_0x5e13x21){return function(_0x5e13x1a){return User[_0x5612[108]]({where:{name:_0x5e13x21[_0x5612[107]][_0x5612[106]](_0x5612[104],_0x5612[105])},raw:true})[_0x5612[41]](function(_0x5e13x23){if(_0x5e13x23){var _0x5e13x22=_[_0x5612[100]]({newValues:{id:_0x5e13x23[_0x5612[98]],status:_0x5e13x21[_0x5612[99]],statusAt:moment()[_0x5612[86]](_0x5612[85])}},_0x5e13x23,{status:_0x5e13x21[_0x5612[99]],statusAt:moment()[_0x5612[86]](_0x5612[85])});_0x5e13x15(util[_0x5612[86]](_0x5612[101],_0x5e13x23[_0x5612[102]],_0x5e13x23[_0x5612[98]]),_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[94],_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[92],_0x5612[103],_0x5e13x22)}})[_0x5612[25]](function(_0x5e13x19){console[_0x5612[97]](_0x5612[96],_0x5e13x19)})}},peerstatus:function(_0x5e13x21){return function(_0x5e13x1a){var _0x5e13x24=_0x5e13x21[_0x5612[110]][_0x5612[89]](_0x5612[109])[1];if(params[_0x5612[111]][_0x5e13x24]){params[_0x5612[111]][_0x5e13x24][_0x5612[112]]= _0x5e13x21[_0x5612[112]];_0x5e13x15(_0x5612[113],_0x5612[114],params[_0x5612[111]][_0x5e13x24])};return BPromise[_0x5612[77]]()}},registry:function(_0x5e13x21){return function(_0x5e13x1a){params[_0x5612[111]][_0x5e13x21[_0x5612[115]]]= {username:_0x5e13x21[_0x5612[115]],domain:_0x5e13x21[_0x5612[116]],status:_0x5e13x21[_0x5612[117]]};_0x5e13x15(_0x5612[113],_0x5612[114],params[_0x5612[111]][_0x5e13x21[_0x5612[115]]]);return BPromise[_0x5612[77]]()}},agentcalled:function(_0x5e13x21){return function(_0x5e13x1a){if(_0x5e13x1a){triggers[_0x5612[118]](_0x5e13x1a)};return User[_0x5612[108]]({where:{name:_0x5e13x21[_0x5612[121]],voicePause:false},raw:true})[_0x5612[41]](function(_0x5e13x23){if(_0x5e13x23){var _0x5e13x25=moment()[_0x5612[86]](_0x5612[85]);var _0x5e13x22=_[_0x5612[100]]({newValues:{id:_0x5e13x23[_0x5612[98]],queueStatus:_0x5612[120],queueStatusAt:_0x5e13x25,lastQueue:_0x5e13x21[_0x5612[42]]}},_0x5e13x23,{queueStatus:_0x5612[120],queueStatusAt:_0x5e13x25,lastQueue:_0x5e13x21[_0x5612[42]]});_0x5e13x15(util[_0x5612[86]](_0x5612[101],_0x5e13x23[_0x5612[102]],_0x5e13x23[_0x5612[98]]),_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[94],_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[92],_0x5612[103],_0x5e13x22)}})[_0x5612[25]](function(_0x5e13x19){console[_0x5612[97]](_0x5612[119],_0x5e13x19)})}},registryentry:function(_0x5e13x21){return function(_0x5e13x1a){params[_0x5612[122]][_0x5e13x21[_0x5612[115]]]= {username:_0x5e13x21[_0x5612[115]],domain:_0x5e13x21[_0x5612[116]],status:_0x5e13x21[_0x5612[99]]};_0x5e13x15(_0x5612[113],_0x5612[114],params[_0x5612[111]][_0x5e13x21[_0x5612[115]]]);return BPromise[_0x5612[77]]()}},agentcomplete:function(_0x5e13x21){return function(_0x5e13x1a){if(_0x5e13x1a){triggers[_0x5612[123]](_0x5e13x1a)};if(params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[46]]){params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[46]]--};if(params[_0x5612[44]][_0x5612[28]][_0x5612[46]]){params[_0x5612[44]][_0x5612[28]][_0x5612[46]]--;_0x5e13x15(_0x5e13x21[_0x5612[42]],_0x5612[124],{type:_0x5612[46],amount:-1,queue:_0x5e13x21[_0x5612[42]]})};params[_0x5612[44]][_0x5612[28]][_0x5612[47]]++;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[47]]++;_0x5e13x15(_0x5e13x21[_0x5612[42]],_0x5612[124],{type:_0x5612[87],amount:1,queue:_0x5e13x21[_0x5612[42]]});params[_0x5612[44]][_0x5612[28]][_0x5612[40]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[28]][_0x5612[47]]/ (params[_0x5612[44]][_0x5612[28]][_0x5612[47]]+ params[_0x5612[44]][_0x5612[28]][_0x5612[48]])* 100,2);params[_0x5612[44]][_0x5612[28]][_0x5612[54]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[28]][_0x5612[48]]/ (params[_0x5612[44]][_0x5612[28]][_0x5612[47]]+ params[_0x5612[44]][_0x5612[28]][_0x5612[48]])* 100,2);params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[40]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[47]]/ (params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[47]]+ params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[48]])* 100,2);params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[54]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[48]]/ (params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[47]]+ params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[48]])* 100,2);params[_0x5612[44]][_0x5612[28]][_0x5612[51]]+= Number(_0x5e13x21[_0x5612[51]]);params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[51]]+= Number(_0x5e13x21[_0x5612[51]]);_0x5e13x15(_0x5e13x21[_0x5612[42]],_0x5612[124],{type:_0x5612[51],amount:Number(_0x5e13x21[_0x5612[51]]),queue:_0x5e13x21[_0x5612[42]]});params[_0x5612[44]][_0x5612[28]][_0x5612[53]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[28]][_0x5612[51]]/ params[_0x5612[44]][_0x5612[28]][_0x5612[47]]);params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[53]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[51]]/ params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[47]]);params[_0x5612[44]][_0x5612[28]][_0x5612[50]]+= Number(_0x5e13x21[_0x5612[50]]);params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[50]]+= Number(_0x5e13x21[_0x5612[50]]);_0x5e13x15(_0x5e13x21[_0x5612[42]],_0x5612[124],{type:_0x5612[50],amount:Number(_0x5e13x21[_0x5612[50]]),queue:_0x5e13x21[_0x5612[42]]});params[_0x5612[44]][_0x5612[28]][_0x5612[52]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[28]][_0x5612[50]]/ params[_0x5612[44]][_0x5612[28]][_0x5612[47]]);params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[52]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[50]]/ params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[47]]);_0x5e13x15(util[_0x5612[86]](_0x5612[125],_0x5e13x21[_0x5612[42]]),util[_0x5612[86]](_0x5612[126],_0x5e13x21[_0x5612[42]]),params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]]);var _0x5e13x22;var _0x5e13x25=moment()[_0x5612[86]](_0x5612[85]);return ReportAgent[_0x5612[108]]({where:{uniqueid:_0x5e13x21[_0x5612[78]],destuniqueid:_0x5e13x21[_0x5612[131]]},raw:true})[_0x5612[41]](function(_0x5e13x26){if(_0x5e13x26){_0x5e13x22= _[_0x5612[100]]({},_0x5e13x26,{lastevent:_0x5612[87],agentcomplete:true,agentcompleteAt:_0x5e13x25,talktime:Number(_0x5e13x21[_0x5612[51]]),reason:_0x5e13x21[_0x5612[129]]});_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x26[_0x5612[121]]),_0x5612[130],_0x5e13x22)};return ReportQueue[_0x5612[108]]({where:{uniqueid:_0x5e13x21[_0x5612[78]]},raw:true})})[_0x5612[41]](function(_0x5e13x26){if(_0x5e13x26){_0x5e13x22= _[_0x5612[100]]({},_0x5e13x26,{queuecallercomplete:true,queuecallercompleteAt:_0x5e13x25});_0x5e13x15(_0x5e13x26[_0x5612[42]],_0x5612[128],_0x5e13x22)};return User[_0x5612[108]]({where:{name:_0x5e13x21[_0x5612[121]],voicePause:false},raw:true})})[_0x5612[41]](function(_0x5e13x23){if(_0x5e13x23){var _0x5e13x22=_[_0x5612[100]]({newValues:{id:_0x5e13x23[_0x5612[98]],queueStatus:_0x5612[87],queueStatusAt:_0x5e13x25,lastQueue:_0x5e13x21[_0x5612[42]]}},_0x5e13x23,{queueStatus:_0x5612[87],queueStatusAt:_0x5e13x25,lastQueue:_0x5e13x21[_0x5612[42]]});_0x5e13x15(util[_0x5612[86]](_0x5612[101],_0x5e13x23[_0x5612[102]],_0x5e13x23[_0x5612[98]]),_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[94],_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[92],_0x5612[103],_0x5e13x22)}})[_0x5612[25]](function(_0x5e13x19){console[_0x5612[97]](_0x5612[127],_0x5e13x19)})}},agentconnect:function(_0x5e13x21){return function(_0x5e13x1a){if(_0x5e13x1a){triggers[_0x5612[123]](_0x5e13x1a)};if(params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[45]]){params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[45]]--;_0x5e13x15(_0x5e13x21[_0x5612[42]],_0x5612[124],{type:_0x5612[45],amount:-1,queue:_0x5e13x21[_0x5612[42]]})};if(params[_0x5612[44]][_0x5612[28]][_0x5612[45]]){params[_0x5612[44]][_0x5612[28]][_0x5612[45]]--};if(params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]]){params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]][_0x5612[132]]= _0x5e13x21[_0x5612[133]];params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]][_0x5612[134]]= _0x5e13x21[_0x5612[134]];params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]][_0x5612[50]]= Number(_0x5e13x21[_0x5612[50]]);params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]][_0x5612[135]]= Number(_0x5e13x21[_0x5612[135]]);params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]][_0x5612[136]]= _0x5e13x21[_0x5612[136]];params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]][_0x5612[121]]= _0x5e13x21[_0x5612[121]];_0x5e13x15(_0x5612[82],_0x5612[83],params[_0x5612[44]][_0x5612[79]])};params[_0x5612[44]][_0x5612[28]][_0x5612[46]]++;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[46]]++;_0x5e13x15(_0x5e13x21[_0x5612[42]],_0x5612[124],{type:_0x5612[46],amount:1,queue:_0x5e13x21[_0x5612[42]]});_0x5e13x15(util[_0x5612[86]](_0x5612[125],_0x5e13x21[_0x5612[42]]),util[_0x5612[86]](_0x5612[126],_0x5e13x21[_0x5612[42]]),params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]]);var _0x5e13x22;var _0x5e13x25=moment()[_0x5612[86]](_0x5612[85]);return ReportQueue[_0x5612[108]]({where:{uniqueid:_0x5e13x21[_0x5612[78]]},raw:true})[_0x5612[41]](function(_0x5e13x26){if(_0x5e13x26){_0x5e13x22= _[_0x5612[100]]({},_0x5e13x26,{queuecallerleaveAt:moment()[_0x5612[86]](_0x5612[85]),holdtime:_0x5e13x21[_0x5612[50]],assigned:true,lastAssignedTo:_0x5e13x21[_0x5612[121]]});_0x5e13x15(_0x5e13x26[_0x5612[42]],_0x5612[128],_0x5e13x22)};return ReportAgent[_0x5612[108]]({where:{uniqueid:_0x5e13x21[_0x5612[78]],destuniqueid:_0x5e13x21[_0x5612[131]]},raw:true})})[_0x5612[41]](function(_0x5e13x26){if(_0x5e13x26){_0x5e13x22= _[_0x5612[100]]({},_0x5e13x26,{lastevent:_0x5612[138],agentconnectAt:moment()[_0x5612[86]](_0x5612[85]),holdtime:_0x5e13x21[_0x5612[50]]});_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x26[_0x5612[121]]),_0x5612[130],_0x5e13x22)};return ReportAgent[_0x5612[65]]({where:{uniqueid:_0x5e13x21[_0x5612[78]],destuniqueid:{$ne:_0x5e13x21[_0x5612[131]]},reason:null},raw:true})})[_0x5612[41]](function(_0x5e13x28){if(_0x5e13x28&& _0x5e13x28[_0x5612[26]]){_[_0x5612[69]](_0x5e13x28,function(_0x5e13x26){_0x5e13x22= _[_0x5612[100]]({},_0x5e13x26,{lastevent:_0x5612[139],agentringnoanswer:true,agentringnoanswerAt:_0x5e13x25,reason:_0x5612[139],answeredelsewheredestinationuniqueid:_0x5e13x21[_0x5612[131]],answeredelsewheremembername:_0x5e13x21[_0x5612[121]]});_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x26[_0x5612[121]]),_0x5612[130],_0x5e13x22)})};return User[_0x5612[108]]({where:{name:_0x5e13x21[_0x5612[121]],voicePause:false},raw:true})})[_0x5612[41]](function(_0x5e13x23){if(_0x5e13x23){var _0x5e13x22=_[_0x5612[100]]({newValues:{id:_0x5e13x23[_0x5612[98]],queueStatus:_0x5612[138],queueStatusAt:_0x5e13x25,lastQueue:_0x5e13x21[_0x5612[42]]}},_0x5e13x23,{queueStatus:_0x5612[138],queueStatusAt:_0x5e13x25,lastQueue:_0x5e13x21[_0x5612[42]]});_0x5e13x15(util[_0x5612[86]](_0x5612[101],_0x5e13x23[_0x5612[102]],_0x5e13x23[_0x5612[98]]),_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[94],_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[92],_0x5612[103],_0x5e13x22)};return User[_0x5612[65]]({where:{lastQueue:_0x5e13x21[_0x5612[42]],name:{$ne:_0x5e13x21[_0x5612[121]]}},raw:true})})[_0x5612[41]](function(_0x5e13x27){if(_0x5e13x27&& _0x5e13x27[_0x5612[26]]){_[_0x5612[69]](_0x5e13x27,function(_0x5e13x23){var _0x5e13x22=_[_0x5612[100]]({newValues:{id:_0x5e13x23[_0x5612[98]],queueStatus:_0x5612[87],queueStatusAt:_0x5e13x25}},_0x5e13x23,{queueStatus:_0x5612[87],queueStatusAt:_0x5e13x25});_0x5e13x15(util[_0x5612[86]](_0x5612[101],_0x5e13x23[_0x5612[102]],_0x5e13x23[_0x5612[98]]),_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[94],_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[92],_0x5612[103],_0x5e13x22)})}})[_0x5612[25]](function(_0x5e13x19){console[_0x5612[97]](_0x5612[137],_0x5e13x19)})}},agentringnoanswer:function(_0x5e13x21){return function(_0x5e13x1a){if(_0x5e13x1a){triggers[_0x5612[123]](_0x5e13x1a)};var _0x5e13x22;var _0x5e13x25=moment()[_0x5612[86]](_0x5612[85]);return User[_0x5612[108]]({where:{name:_0x5e13x21[_0x5612[121]],voicePause:false},raw:true})[_0x5612[41]](function(_0x5e13x23){if(_0x5e13x23){var _0x5e13x22=_[_0x5612[100]]({newValues:{id:_0x5e13x23[_0x5612[98]],queueStatus:_0x5612[87],queueStatusAt:_0x5e13x25,lastQueue:_0x5e13x21[_0x5612[42]]}},_0x5e13x23,{queueStatus:_0x5612[87],queueStatusAt:_0x5e13x25,lastQueue:_0x5e13x21[_0x5612[42]]});_0x5e13x15(util[_0x5612[86]](_0x5612[101],_0x5e13x23[_0x5612[102]],_0x5e13x23[_0x5612[98]]),_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[94],_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[92],_0x5612[103],_0x5e13x22)};return ReportAgent[_0x5612[108]]({where:{uniqueid:_0x5e13x21[_0x5612[78]],destuniqueid:_0x5e13x21[_0x5612[131]]},raw:true})})[_0x5612[41]](function(_0x5e13x26){if(_0x5e13x26){_0x5e13x22= _[_0x5612[100]]({},_0x5e13x26,{lastevent:_0x5612[141],agentringnoanswer:true,agentringnoanswerAt:moment()[_0x5612[86]](_0x5612[85]),reason:_0x5612[141]});_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x26[_0x5612[121]]),_0x5612[130],_0x5e13x22)}})[_0x5612[25]](function(_0x5e13x19){console[_0x5612[97]](_0x5612[140],_0x5e13x19)})}},queuememberadded:function(_0x5e13x21){return function(_0x5e13x1a){params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[68]][_0x5e13x21[_0x5612[121]]]= {membername:_0x5e13x21[_0x5612[121]],interface:_0x5e13x21[_0x5612[142]],penalty:Number(_0x5e13x21[_0x5612[143]]),callstaken:Number(_0x5e13x21[_0x5612[144]]),lastcall:_0x5e13x21[_0x5612[144]],status:Number(_0x5e13x21[_0x5612[145]]),paused:Number(_0x5e13x21[_0x5612[146]])};_0x5e13x15(util[_0x5612[86]](_0x5612[125],_0x5e13x21[_0x5612[42]]),util[_0x5612[86]](_0x5612[126],_0x5e13x21[_0x5612[42]]),params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]]);if(_0x5e13x1a){_0x5e13x15(_0x5e13x1a[_0x5612[42]],_0x5612[147],_0x5e13x1a);_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x1a.UserId),_0x5612[147],_0x5e13x1a)};return BPromise[_0x5612[77]]()}},queuememberremoved:function(_0x5e13x21){return function(_0x5e13x1a){delete params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[68]][_0x5e13x21[_0x5612[121]]];_0x5e13x15(util[_0x5612[86]](_0x5612[125],_0x5e13x21[_0x5612[42]]),util[_0x5612[86]](_0x5612[126],_0x5e13x21[_0x5612[42]]),params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]]);return User[_0x5612[108]]({where:{name:_0x5e13x21[_0x5612[136]][_0x5612[106]](_0x5612[104],_0x5612[105])},raw:true})[_0x5612[41]](function(_0x5e13x23){if(_0x5e13x23){_0x5e13x15(_0x5e13x21[_0x5612[42]],_0x5612[149],{queue:_0x5e13x21[_0x5612[42]],UserId:_0x5e13x23[_0x5612[98]]});_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x23[_0x5612[98]]),_0x5612[149],{queue:_0x5e13x21[_0x5612[42]],UserId:_0x5e13x23[_0x5612[98]]})}})[_0x5612[25]](function(_0x5e13x19){console[_0x5612[24]](_0x5612[148],_0x5e13x19)})}},queuememberpause:function(_0x5e13x21){return function(_0x5e13x1a){if(_0x5e13x1a){_0x5e13x15(_0x5e13x1a[_0x5612[42]],_0x5612[147],_0x5e13x1a);_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x1a.UserId),_0x5612[147],_0x5e13x1a)};var _0x5e13x22;var _0x5e13x25=moment()[_0x5612[86]](_0x5612[85]);return User[_0x5612[108]]({where:{name:_0x5e13x21[_0x5612[121]]},raw:true})[_0x5612[41]](function(_0x5e13x23){if(_0x5e13x23){var _0x5e13x29={id:_0x5e13x23[_0x5612[98]],voicePause:false,queueStatusAt:_0x5e13x25};if(parseInt(_0x5e13x21[_0x5612[146]],10)){_[_0x5612[151]](_0x5e13x29,{voicePause:true,chatPause:true,mailPause:true,faxPause:true,smsPause:true,openchannelPause:true,pauseType:_0x5e13x21[_0x5612[129]],lastPauseAt:_0x5e13x25,queueStatus:_0x5612[146]})}else {switch(_0x5e13x23[_0x5612[145]]){case _0x5612[153]:_0x5e13x29[_0x5612[152]]= _0x5612[138];break;case _0x5612[154]:_0x5e13x29[_0x5612[152]]= _0x5612[120];break;default:_0x5e13x29[_0x5612[152]]= _0x5612[87]}};var _0x5e13x22=_[_0x5612[100]]({newValues:_0x5e13x29},_0x5e13x23,_0x5e13x29);_0x5e13x15(util[_0x5612[86]](_0x5612[101],_0x5e13x23[_0x5612[102]],_0x5e13x23[_0x5612[98]]),_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[94],_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[92],_0x5612[103],_0x5e13x22)}})[_0x5612[25]](function(_0x5e13x19){console[_0x5612[97]](_0x5612[150],_0x5e13x19)})}},queuememberpenalty:function(_0x5e13x21){return function(_0x5e13x1a){if(_0x5e13x1a){_0x5e13x15(_0x5e13x1a[_0x5612[42]],_0x5612[147],_0x5e13x1a);_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x1a.UserId),_0x5612[147],_0x5e13x1a)};return BPromise[_0x5612[77]]()}},queuememberringinuse:function(_0x5e13x21){return function(_0x5e13x1a){if(_0x5e13x1a){_0x5e13x15(_0x5e13x1a[_0x5612[42]],_0x5612[147],_0x5e13x1a);_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x1a.UserId),_0x5612[147],_0x5e13x1a)};return BPromise[_0x5612[77]]()}},queuememberstatus:function(_0x5e13x21){return function(_0x5e13x1a){if(_0x5e13x1a){_0x5e13x15(_0x5e13x1a[_0x5612[42]],_0x5612[147],_0x5e13x1a);_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x1a.UserId),_0x5612[147],_0x5e13x1a)};return BPromise[_0x5612[77]]()}},queuemember:function(_0x5e13x21){return function(_0x5e13x1a){params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[68]][_0x5e13x21[_0x5612[66]]]= {membername:_0x5e13x21[_0x5612[66]],interface:_0x5e13x21[_0x5612[142]],penalty:Number(_0x5e13x21[_0x5612[143]]),callstaken:Number(_0x5e13x21[_0x5612[144]]),lastcall:_0x5e13x21[_0x5612[144]],status:Number(_0x5e13x21[_0x5612[145]]),paused:Number(_0x5e13x21[_0x5612[146]])};return BPromise[_0x5612[77]]()}},queuecallerjoin:function(_0x5e13x21){if(!params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]]){params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]]= {};params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[45]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[46]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[47]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[48]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[49]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[50]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[51]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[52]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[53]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[40]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[54]]= 0;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[27]]= 0};params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]]= {channel:_0x5e13x21[_0x5612[90]],channelstate:Number(_0x5e13x21[_0x5612[155]]),channelstatedesc:_0x5e13x21[_0x5612[156]],calleridnum:_0x5e13x21[_0x5612[157]],calleridname:_0x5e13x21[_0x5612[158]],exten:_0x5e13x21[_0x5612[159]],priority:Number(_0x5e13x21[_0x5612[160]]),uniqueid:_0x5e13x21[_0x5612[78]],queue:_0x5e13x21[_0x5612[42]],position:Number(_0x5e13x21[_0x5612[161]]),count:Number(_0x5e13x21[_0x5612[162]])};_0x5e13x15(_0x5612[82],_0x5612[83],params[_0x5612[44]][_0x5612[79]]);params[_0x5612[44]][_0x5612[28]][_0x5612[45]]++;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[45]]++;_0x5e13x15(_0x5e13x21[_0x5612[42]],_0x5612[124],{type:_0x5612[27],amount:1,queue:_0x5e13x21[_0x5612[42]]});params[_0x5612[44]][_0x5612[28]][_0x5612[27]]++;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[27]]++;_0x5e13x15(_0x5e13x21[_0x5612[42]],_0x5612[124],{type:_0x5612[45],amount:1,queue:_0x5e13x21[_0x5612[42]]});_0x5e13x15(util[_0x5612[86]](_0x5612[125],_0x5e13x21[_0x5612[42]]),util[_0x5612[86]](_0x5612[126],_0x5e13x21[_0x5612[42]]),params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]]);return function(_0x5e13x1a){if(_0x5e13x1a){_0x5e13x15(_0x5e13x1a[_0x5612[42]],_0x5612[163],_0x5e13x1a)};return BPromise[_0x5612[77]]()}},queuecallerabandon:function(_0x5e13x21){return function(_0x5e13x1a){if(_0x5e13x1a[0]){_[_0x5612[69]](_0x5e13x1a[1],function(_0x5e13x26){triggers[_0x5612[123]](_0x5e13x26);_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x26[_0x5612[121]]),_0x5612[130],_0x5e13x26)})};var _0x5e13x22;var _0x5e13x25=moment()[_0x5612[86]](_0x5612[85]);return ReportQueue[_0x5612[108]]({where:{uniqueid:_0x5e13x21[_0x5612[78]],queuecallerexit:false},raw:true})[_0x5612[41]](function(_0x5e13x26){if(_0x5e13x26){if(params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[45]]){params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[45]]--;_0x5e13x15(_0x5e13x21[_0x5612[42]],_0x5612[124],{type:_0x5612[45],amount:-1,queue:_0x5e13x21[_0x5612[42]]})};if(params[_0x5612[44]][_0x5612[28]][_0x5612[45]]){params[_0x5612[44]][_0x5612[28]][_0x5612[45]]--};if(params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]]){params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]][_0x5612[50]]= Number(_0x5e13x21[_0x5612[50]]);params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]][_0x5612[161]]= Number(_0x5e13x21[_0x5612[161]]);params[_0x5612[44]][_0x5612[79]][_0x5e13x21[_0x5612[78]]][_0x5612[165]]= Number(_0x5e13x21[_0x5612[165]]);_0x5e13x15(_0x5612[82],_0x5612[83],params[_0x5612[44]][_0x5612[79]])};params[_0x5612[44]][_0x5612[28]][_0x5612[48]]++;params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[48]]++;_0x5e13x15(_0x5e13x21[_0x5612[42]],_0x5612[124],{type:_0x5612[166],amount:1,queue:_0x5e13x21[_0x5612[42]]});params[_0x5612[44]][_0x5612[28]][_0x5612[40]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[28]][_0x5612[47]]/ (params[_0x5612[44]][_0x5612[28]][_0x5612[47]]+ params[_0x5612[44]][_0x5612[28]][_0x5612[48]])* 100,2);params[_0x5612[44]][_0x5612[28]][_0x5612[54]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[28]][_0x5612[48]]/ (params[_0x5612[44]][_0x5612[28]][_0x5612[47]]+ params[_0x5612[44]][_0x5612[28]][_0x5612[48]])* 100,2);params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[40]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[47]]/ (params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[47]]+ params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[48]])* 100,2);params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[54]]= _[_0x5612[39]](params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[48]]/ (params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[47]]+ params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]][_0x5612[48]])* 100,2);_0x5e13x15(util[_0x5612[86]](_0x5612[125],_0x5e13x21[_0x5612[42]]),util[_0x5612[86]](_0x5612[126],_0x5e13x21[_0x5612[42]]),params[_0x5612[44]][_0x5612[43]][_0x5e13x21[_0x5612[42]]]);_0x5e13x15(_0x5e13x26[_0x5612[42]],_0x5612[128],_[_0x5612[151]](_0x5e13x26,{queuecallerabandon:true,queuecallerabandonAt:_0x5e13x25,queuecallerleaveAt:_0x5e13x25,originalposition:_0x5e13x21[_0x5612[165]],position:_0x5e13x21[_0x5612[161]],holdtime:_0x5e13x21[_0x5612[50]]}))};return User[_0x5612[65]]({where:{lastQueue:_0x5e13x21[_0x5612[42]],voicePause:false},raw:true})})[_0x5612[41]](function(_0x5e13x2a){if(_0x5e13x2a&& _0x5e13x2a[_0x5612[26]]){var _0x5e13x22;_[_0x5612[69]](_0x5e13x2a,function(_0x5e13x2b){_0x5e13x22= _[_0x5612[100]]({newValues:{id:_0x5e13x2b[_0x5612[98]],queueStatus:_0x5612[87],queueStatusAt:_0x5e13x25,lastQueue:_0x5e13x21[_0x5612[42]]}},_0x5e13x2b,{id:_0x5e13x2b[_0x5612[98]],queueStatus:_0x5612[87],queueStatusAt:_0x5e13x25,lastQueue:_0x5e13x21[_0x5612[42]]});_0x5e13x15(util[_0x5612[86]](_0x5612[101],_0x5e13x2b[_0x5612[102]],_0x5e13x2b[_0x5612[98]]),_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[94],_0x5612[103],_0x5e13x22);_0x5e13x15(_0x5612[92],_0x5612[103],_0x5e13x22)})}})[_0x5612[25]](function(_0x5e13x19){console[_0x5612[97]](_0x5612[164],_0x5e13x19)})}},blindtransfer:function(_0x5e13x21){return function(_0x5e13x1a){_0x5e13x15(null,_0x5e13x21[_0x5612[76]][_0x5612[75]](),_0x5e13x21);return BPromise[_0x5612[77]]()}},attendedtransfer:function(_0x5e13x21){return function(_0x5e13x1a){_0x5e13x15(null,_0x5e13x21[_0x5612[76]][_0x5612[75]](),_0x5e13x21);return BPromise[_0x5612[77]]()}},dialbegin:function(_0x5e13x21){return function(_0x5e13x1a){params[_0x5612[29]][_0x5612[79]][_0x5e13x21[_0x5612[78]]]= {channel:_0x5e13x21[_0x5612[90]],channelstate:Number(_0x5e13x21[_0x5612[155]]),channelstatedesc:_0x5e13x21[_0x5612[156]],calleridnum:_0x5e13x21[_0x5612[157]],calleridname:_0x5e13x21[_0x5612[158]],context:_0x5e13x21[_0x5612[167]],exten:_0x5e13x21[_0x5612[159]],priority:Number(_0x5e13x21[_0x5612[160]]),dialstring:_0x5e13x21[_0x5612[168]]};_0x5e13x15(_0x5612[80],_0x5612[81],params[_0x5612[29]][_0x5612[79]]);var _0x5e13x22=_[_0x5612[151]](_0x5e13x21,{starttime:moment()[_0x5612[86]](_0x5612[85]),lastevent:_0x5612[120],updatedAt:moment()[_0x5612[86]](_0x5612[85])});_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x21[_0x5612[90]][_0x5612[89]](/\/|-/)[1]),_0x5612[91],_0x5e13x22);_0x5e13x15(_0x5612[94],_0x5612[93],_[_0x5612[151]](_0x5e13x22,{role:_0x5612[94]}));_0x5e13x15(_0x5612[92],_0x5612[93],_0x5e13x22,_[_0x5612[151]](_0x5e13x22,{role:_0x5612[92]}));if(_0x5e13x1a){triggers[_0x5612[95]](_0x5e13x1a)};return BPromise[_0x5612[77]]()}},dialend:function(_0x5e13x21){return function(_0x5e13x1a){params[_0x5612[29]][_0x5612[79]][_0x5e13x21[_0x5612[78]]][_0x5612[169]]= _0x5e13x21[_0x5612[169]];_0x5e13x15(_0x5612[80],_0x5612[81],params[_0x5612[29]][_0x5612[79]]);var _0x5e13x25=moment()[_0x5612[86]](_0x5612[85]);var _0x5e13x22={dialstatus:_0x5e13x21[_0x5612[169]],lastevent:(_0x5e13x21[_0x5612[169]]=== _0x5612[170])?_0x5612[138]:_0x5612[87],answertime:(_0x5e13x21[_0x5612[169]]=== _0x5612[170])?_0x5e13x25:null,uniqueid:_0x5e13x21[_0x5612[78]],linkedid:_0x5e13x21[_0x5612[84]],destuniqueid:_0x5e13x21[_0x5612[131]],destlinkedid:_0x5e13x21[_0x5612[171]],updatedAt:_0x5e13x25};_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x21[_0x5612[90]][_0x5612[89]](/\/|-/)[1]),_0x5612[93],_0x5e13x22);_0x5e13x15(_0x5612[94],_0x5612[93],_0x5e13x22);_0x5e13x15(_0x5612[92],_0x5612[93],_0x5e13x22);if(_0x5e13x1a){triggers[_0x5612[95]](_0x5e13x1a)};return BPromise[_0x5612[77]]()}},varset:function(_0x5e13x21){return function(_0x5e13x1a){if(_0x5e13x21[_0x5612[174]][_0x5612[173]](_0x5612[172])){if(_0x5e13x1a){params[_0x5612[44]][_0x5612[28]][_0x5612[49]]+= 1;params[_0x5612[44]][_0x5612[43]][_0x5e13x1a[_0x5612[42]]][_0x5612[49]]+= 1;_0x5e13x15(_0x5e13x1a[_0x5612[42]],_0x5612[124],{type:_0x5612[49],amount:1,queue:_0x5e13x1a[_0x5612[42]]});if(params[_0x5612[44]][_0x5612[43]][_0x5e13x1a[_0x5612[42]]][_0x5612[45]]){params[_0x5612[44]][_0x5612[43]][_0x5e13x1a[_0x5612[42]]][_0x5612[45]]-= 1};if(params[_0x5612[44]][_0x5612[28]][_0x5612[45]]){params[_0x5612[44]][_0x5612[28]][_0x5612[45]]-= 1};_0x5e13x15(_0x5e13x1a[_0x5612[42]],_0x5612[124],{type:_0x5612[45],amount:-1,queue:_0x5e13x1a[_0x5612[42]]});_0x5e13x15(_0x5e13x1a[_0x5612[42]],_0x5612[128],_0x5e13x1a);_0x5e13x15(util[_0x5612[86]](_0x5612[125],_0x5e13x1a[_0x5612[42]]),util[_0x5612[86]](_0x5612[126],_0x5e13x1a[_0x5612[42]]),params[_0x5612[44]][_0x5612[43]][_0x5e13x1a[_0x5612[42]]])}};if(_0x5e13x21[_0x5612[174]][_0x5612[173]](_0x5612[175])){_0x5e13x15(_0x5612[94],_0x5612[91],{uniqueid:_0x5e13x21[_0x5612[78]],routeId:_0x5e13x21[_0x5612[176]],updatedAt:moment()[_0x5612[86]](_0x5612[85])});_0x5e13x15(_0x5612[92],_0x5612[91],{uniqueid:_0x5e13x21[_0x5612[78]],routeId:_0x5e13x21[_0x5612[176]],updatedAt:moment()[_0x5612[86]](_0x5612[85])})};return BPromise[_0x5612[77]]()}},agentUpdate:function(_0x5e13x2b){return function(){_0x5e13x15(util[_0x5612[86]](_0x5612[88],_0x5e13x2b[_0x5612[98]]),_0x5612[103],_0x5e13x2b);_0x5e13x15(_0x5612[94],_0x5612[103],_0x5e13x2b);_0x5e13x15(_0x5612[92],_0x5612[103],_0x5e13x2b)}}}}
\ No newline at end of file
+var _0xfb38=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x72\x65\x64\x69\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74","\x52\x65\x70\x6F\x72\x74\x44\x69\x61\x6C","\x52\x65\x70\x6F\x72\x74\x4D\x65\x6D\x62\x65\x72","\x55\x73\x65\x72","\x2E\x2E\x2F\x74\x72\x69\x67\x67\x65\x72\x73","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x2E\x2F\x75\x74\x69\x6C\x73","\x72\x65\x64\x69\x73\x50\x77\x64","\x69\x70","\x63\x72\x65\x61\x74\x65\x43\x6C\x69\x65\x6E\x74","\x73\x6F\x63\x6B\x65\x74\x2E\x69\x6F\x2D\x65\x6D\x69\x74\x74\x65\x72","\x65\x78\x70\x6F\x72\x74\x73","\x65\x6D\x69\x74","\x74\x6F","\x65\x76\x65\x6E\x74","\x70\x72\x69\x76\x69\x6C\x65\x67\x65","\x6D\x65\x6D\x62\x65\x72\x73\x68\x69\x70","\x72\x69\x6E\x67\x69\x6E\x75\x73\x65","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x6E\x61\x6D\x65","\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x73\x74\x61\x74\x65\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x73\x74\x61\x74\x75\x73\x64\x65\x73\x63","\x55\x4E\x4B\x4E\x4F\x57\x4E","\x30","\x4E\x4F\x54\x5F\x49\x4E\x55\x53\x45","\x31","\x49\x4E\x55\x53\x45","\x32","\x42\x55\x53\x59","\x33","\x49\x4E\x56\x41\x4C\x49\x44","\x34","\x55\x4E\x41\x56\x41\x49\x4C\x41\x42\x4C\x45","\x35","\x52\x49\x4E\x47\x49\x4E\x47","\x36","\x52\x49\x4E\x47\x49\x4E\x55\x53\x45","\x37","\x4F\x4E\x48\x4F\x4C\x44","\x38","\x73\x74\x61\x74\x75\x73","\x70\x65\x6E\x61\x6C\x74\x79","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x63\x61\x6C\x6C\x73\x74\x61\x6B\x65\x6E","\x6C\x61\x73\x74\x63\x61\x6C\x6C","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x70\x61\x75\x73\x65\x64","\x71\x75\x65\x75\x65\x73","\x69\x6E\x62\x6F\x75\x6E\x64","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x74\x6F\x74\x61\x6C","\x67\x6C\x6F\x62\x61\x6C","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x61\x6E\x73\x77\x65\x72\x65\x64","\x41\x4E\x53\x57\x45\x52\x45\x44","\x64\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x63\x6F\x75\x6E\x74\x42\x79","\x73\x75\x6D\x44\x75\x72\x61\x74\x69\x6F\x6E","\x62\x69\x6C\x6C\x61\x62\x6C\x65\x73\x65\x63\x6F\x6E\x64\x73","\x73\x75\x6D\x42\x79","\x61\x76\x67\x44\x75\x72\x61\x74\x69\x6F\x6E","\x72\x65\x73\x75\x6C\x74","\x72\x6F\x75\x6E\x64","\x61\x6E\x73\x77\x65\x72\x52\x61\x74\x65","\x74\x68\x65\x6E","\x71\x75\x65\x75\x65","\x69\x73\x57\x61\x69\x74\x69\x6E\x67","\x77\x61\x69\x74\x69\x6E\x67","\x69\x73\x41\x63\x74\x69\x76\x65","\x61\x63\x74\x69\x76\x65","\x69\x73\x43\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x63\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x68\x6F\x6C\x64\x74\x69\x6D\x65","\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6C\x65\x61\x76\x65\x41\x74","\x73\x65\x63\x6F\x6E\x64\x73","\x64\x69\x66\x66","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x41\x74","\x61\x76\x67\x48\x6F\x6C\x64\x74\x69\x6D\x65","\x61\x76\x67\x54\x61\x6C\x6B\x74\x69\x6D\x65","\x69\x73\x41\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x69\x73\x55\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x61\x62\x61\x6E\x64\x6F\x6E\x52\x61\x74\x65","\x74\x79\x70\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x66\x6F\x72\x45\x61\x63\x68","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x65\x78\x69\x74","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x76\x6F\x69\x63\x65\x2F\x6F\x75\x74\x62\x6F\x75\x6E\x64\x2F\x67\x6C\x6F\x62\x61\x6C","\x76\x6F\x69\x63\x65\x3A\x6F\x75\x74\x62\x6F\x75\x6E\x64\x3A\x67\x6C\x6F\x62\x61\x6C","\x61\x67\x65\x6E\x74\x73","\x72\x65\x70\x6F\x72\x74\x5F\x63\x61\x6C\x6C\x3A\x73\x61\x76\x65","\x72\x65\x73\x6F\x6C\x76\x65","\x75\x6E\x69\x71\x75\x65\x69\x64","\x63\x68\x61\x6E\x6E\x65\x6C\x73","\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x61\x67\x65\x6E\x74\x3A\x25\x73","\x73\x70\x6C\x69\x74","\x63\x68\x61\x6E\x6E\x65\x6C","\x72\x65\x70\x6F\x72\x74\x5F\x64\x69\x61\x6C\x3A\x75\x70\x64\x61\x74\x65","\x61\x64\x6D\x69\x6E\x73","\x75\x73\x65\x72\x73","\x72\x65\x70\x6F\x72\x74\x44\x69\x61\x6C","\x64\x65\x76\x69\x63\x65\x73\x74\x61\x74\x65\x63\x68\x61\x6E\x67\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x6C\x6F\x67","\x69\x64","\x73\x74\x61\x74\x65","\x61\x73\x73\x69\x67\x6E","\x25\x73\x3A\x25\x73","\x72\x6F\x6C\x65","\x61\x67\x65\x6E\x74\x3A\x73\x61\x76\x65","\x53\x49\x50\x2F","","\x72\x65\x70\x6C\x61\x63\x65","\x64\x65\x76\x69\x63\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x74\x72\x75\x6E\x6B\x73","\x70\x65\x65\x72\x73\x74\x61\x74\x75\x73","\x76\x6F\x69\x63\x65\x2F\x74\x72\x75\x6E\x6B\x73","\x76\x6F\x69\x63\x65\x3A\x74\x72\x75\x6E\x6B\x73","\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x3A\x73\x61\x76\x65","\x72\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x43\x72\x65\x61\x74\x65","\x61\x67\x65\x6E\x74\x63\x61\x6C\x6C\x65\x64\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x63\x61\x6C\x6C\x65\x64","\x72\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x55\x70\x64\x61\x74\x65","\x76\x6F\x69\x63\x65\x3A\x69\x6E\x62\x6F\x75\x6E\x64","\x61\x67\x65\x6E\x74\x63\x6F\x6D\x70\x6C\x65\x74\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x3A\x75\x70\x64\x61\x74\x65","\x72\x65\x61\x73\x6F\x6E","\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x3A\x75\x70\x64\x61\x74\x65","\x64\x65\x73\x74\x75\x6E\x69\x71\x75\x65\x69\x64","\x63\x6F\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x61\x6D\x65","\x72\x69\x6E\x67\x74\x69\x6D\x65","\x61\x67\x65\x6E\x74\x63\x6F\x6E\x6E\x65\x63\x74\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x63\x6F\x6E\x6E\x65\x63\x74","\x61\x6E\x73\x77\x65\x72\x65\x64\x5F\x65\x6C\x73\x65\x77\x68\x65\x72\x65","\x61\x67\x65\x6E\x74\x72\x69\x6E\x67\x6E\x6F\x61\x6E\x73\x77\x65\x72\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x72\x65\x6A\x65\x63\x74\x65\x64","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x76\x6F\x69\x63\x65\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x71\x75\x65\x75\x65\x6D\x65\x6D\x62\x65\x72\x72\x65\x6D\x6F\x76\x65\x64\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x76\x6F\x69\x63\x65\x5F\x71\x75\x65\x75\x65\x3A\x72\x65\x6D\x6F\x76\x65","\x71\x75\x65\x75\x65\x6D\x65\x6D\x62\x65\x72\x70\x61\x75\x73\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x6D\x65\x72\x67\x65","\x71\x75\x65\x75\x65\x53\x74\x61\x74\x75\x73","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65\x64\x65\x73\x63","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x65\x78\x74\x65\x6E","\x70\x72\x69\x6F\x72\x69\x74\x79","\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x63\x6F\x75\x6E\x74","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6A\x6F\x69\x6E\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x6F\x72\x69\x67\x69\x6E\x61\x6C\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x61\x62\x61\x6E\x64\x6F\x6E","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x63\x6F\x6E\x74\x65\x78\x74","\x64\x69\x61\x6C\x73\x74\x72\x69\x6E\x67","\x72\x65\x70\x6F\x72\x74\x5F\x64\x69\x61\x6C\x3A\x73\x61\x76\x65","\x64\x69\x61\x6C\x73\x74\x61\x74\x75\x73","\x41\x4E\x53\x57\x45\x52","\x64\x65\x73\x74\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x71\x75\x65\x75\x65\x73\x74\x61\x74\x75\x73","\x76\x61\x72\x69\x61\x62\x6C\x65","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x72\x6F\x75\x74\x65\x69\x64","\x76\x61\x6C\x75\x65","\x76\x61\x72\x53\x65\x74","\x73\x6F\x63\x6B\x65\x74","\x63\x6F\x6E\x73\x6F\x6C\x65\x3A\x25\x73","\x64\x61\x74\x61","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x66\x6F\x72\x4F\x77\x6E","\x75\x70\x64\x61\x74\x65\x54\x72\x69\x67\x67\x65\x72\x73","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x25\x73\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x25\x73\x5F\x71\x75\x65\x75\x65\x3A\x72\x65\x6D\x6F\x76\x65","\x63\x68\x65\x63\x6B\x54\x72\x69\x67\x67\x65\x72\x73"];_0xfb38[0];var _=require(_0xfb38[1]);var util=require(_0xfb38[2]);var moment=require(_0xfb38[3]);var BPromise=require(_0xfb38[4]);var redis=require(_0xfb38[5]);var VoiceQueue=require(_0xfb38[7])[_0xfb38[6]];var ReportQueue=require(_0xfb38[7])[_0xfb38[8]];var ReportCall=require(_0xfb38[7])[_0xfb38[9]];var ReportAgent=require(_0xfb38[7])[_0xfb38[10]];var ReportDial=require(_0xfb38[7])[_0xfb38[11]];var ReportMember=require(_0xfb38[7])[_0xfb38[12]];var User=require(_0xfb38[7])[_0xfb38[13]];var Triggers=require(_0xfb38[14]);var config=require(_0xfb38[15]);var utils=require(_0xfb38[16]);var redisConf;if(config[_0xfb38[17]]){redisConf= {password:config[_0xfb38[17]]}};var redisClient=redis[_0xfb38[19]](6379,config[_0xfb38[18]],redisConf);var io=require(_0xfb38[20])(redisClient);var triggers= new Triggers(io);var params={trunks:[],inbound:{queues:{},channels:[],global:{waiting:0,active:0,completed:0,abandoned:0,unmanaged:0,holdtime:0,talktime:0,avgHoldtime:0,avgTalktime:0,answerRate:0,abandonRate:0,total:0}},outbound:{global:{total:0,answered:0,sumDuration:0,avgDuration:0},channels:[]}};module[_0xfb38[21]]= function(){var _0x7920x15=function(_0x7920x16,_0x7920x17,_0x7920x18){if(_0x7920x16){io[_0xfb38[23]](_0x7920x16)[_0xfb38[22]](_0x7920x17,_0x7920x18)}else {io[_0xfb38[22]](_0x7920x17,_0x7920x18)}};var _0x7920x19=function(_0x7920x1a){delete _0x7920x1a[_0xfb38[24]];delete _0x7920x1a[_0xfb38[25]];delete _0x7920x1a[_0xfb38[26]];delete _0x7920x1a[_0xfb38[27]];_0x7920x1a[_0xfb38[28]]= _0x7920x1a[_0xfb38[29]]|| _0x7920x1a[_0xfb38[28]];_0x7920x1a[_0xfb38[30]]= _0x7920x1a[_0xfb38[31]];_0x7920x1a[_0xfb38[32]]= _0xfb38[33];switch(_0x7920x1a[_0xfb38[51]]){case _0xfb38[34]:_0x7920x1a[_0xfb38[32]]= _0xfb38[33];break;case _0xfb38[36]:_0x7920x1a[_0xfb38[32]]= _0xfb38[35];break;case _0xfb38[38]:_0x7920x1a[_0xfb38[32]]= _0xfb38[37];break;case _0xfb38[40]:_0x7920x1a[_0xfb38[32]]= _0xfb38[39];break;case _0xfb38[42]:_0x7920x1a[_0xfb38[32]]= _0xfb38[41];break;case _0xfb38[44]:_0x7920x1a[_0xfb38[32]]= _0xfb38[43];break;case _0xfb38[46]:_0x7920x1a[_0xfb38[32]]= _0xfb38[45];break;case _0xfb38[48]:_0x7920x1a[_0xfb38[32]]= _0xfb38[47];break;case _0xfb38[50]:_0x7920x1a[_0xfb38[32]]= _0xfb38[49];break;default:};_0x7920x1a[_0xfb38[51]]= Number(_0x7920x1a[_0xfb38[51]]);if(_0x7920x1a[_0xfb38[53]](_0xfb38[52])){_0x7920x1a[_0xfb38[52]]= Number(_0x7920x1a[_0xfb38[52]])};if(_0x7920x1a[_0xfb38[53]](_0xfb38[54])){_0x7920x1a[_0xfb38[54]]= Number(_0x7920x1a[_0xfb38[54]])};if(_0x7920x1a[_0xfb38[53]](_0xfb38[55])){if(_0x7920x1a[_0xfb38[55]]=== _0xfb38[34]){_0x7920x1a[_0xfb38[55]]= null}else {_0x7920x1a[_0xfb38[55]]= moment()[_0xfb38[57]](_0xfb38[56])}};_0x7920x1a[_0xfb38[58]]= parseInt(_0x7920x1a[_0xfb38[58]],10)?true:false};function _0x7920x1b(_0x7920x1c){if(!params[_0xfb38[60]][_0xfb38[59]][_0x7920x1c]){params[_0xfb38[60]][_0xfb38[59]][_0x7920x1c]= {agents:{},waiting:0,active:0,completed:0,abandoned:0,unmanaged:0,holdtime:0,talktime:0,avgHoldtime:0,avgTalktime:0,answerRate:0,abandonRate:0,total:0}}}VoiceQueue[_0xfb38[100]]({attributes:[_0xfb38[29]],raw:true})[_0xfb38[78]](function(_0x7920x1e){if(_0x7920x1e){_[_0xfb38[101]](_0x7920x1e,function(_0x7920x1c){_0x7920x1b(_0x7920x1c[_0xfb38[29]])});return ReportQueue[_0xfb38[100]]({attributes:[_0xfb38[79],_0xfb38[88],_0xfb38[91],_0xfb38[102],_0xfb38[103],_0xfb38[104],_0xfb38[86]],raw:true})}})[_0xfb38[78]](function(_0x7920x1e){if(_0x7920x1e){var _0x7920x1f;var _0x7920x20;var _0x7920x21=_0x7920x1e[_0xfb38[63]];for(var _0x7920x22=0;_0x7920x22< _0x7920x21;_0x7920x22++){_0x7920x1f= _0x7920x1e[_0x7920x22];_0x7920x20= _0x7920x1f[_0xfb38[79]];_0x7920x1b(_0x7920x20);params[_0xfb38[60]][_0xfb38[65]][_0xfb38[64]]++;params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[64]]++;if(utils[_0xfb38[80]](_0x7920x1f)){params[_0xfb38[60]][_0xfb38[65]][_0xfb38[81]]++;params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[81]]++};if(utils[_0xfb38[82]](_0x7920x1f)){params[_0xfb38[60]][_0xfb38[65]][_0xfb38[83]]++;params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[83]]++};if(utils[_0xfb38[84]](_0x7920x1f)){params[_0xfb38[60]][_0xfb38[65]][_0xfb38[85]]++;params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[85]]++;params[_0xfb38[60]][_0xfb38[65]][_0xfb38[86]]+= _0x7920x1f[_0xfb38[86]]|| 0;params[_0xfb38[60]][_0xfb38[65]][_0xfb38[87]]+= moment(_0x7920x1f[_0xfb38[91]])[_0xfb38[90]](moment(_0x7920x1f[_0xfb38[88]]),_0xfb38[89]);params[_0xfb38[60]][_0xfb38[65]][_0xfb38[92]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[86]]/ params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[85]]);params[_0xfb38[60]][_0xfb38[65]][_0xfb38[93]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[87]]/ params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[85]]);params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[86]]+= _0x7920x1f[_0xfb38[86]]|| 0;params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[87]]+= moment(_0x7920x1f[_0xfb38[91]])[_0xfb38[90]](moment(_0x7920x1f[_0xfb38[88]]),_0xfb38[89]);params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[92]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[86]]/ params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[85]]);params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[93]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[87]]/ params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[85]])};if(utils[_0xfb38[94]](_0x7920x1f)){params[_0xfb38[60]][_0xfb38[65]][_0xfb38[95]]++;params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[95]]++};if(utils[_0xfb38[96]](_0x7920x1f)){params[_0xfb38[60]][_0xfb38[65]][_0xfb38[97]]++;params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[97]]++}};params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[77]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[85]]/ (params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[85]]+ params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[95]])* 100,2);params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[98]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[95]]/ (params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[85]]+ params[_0xfb38[60]][_0xfb38[59]][_0x7920x20][_0xfb38[95]])* 100,2);params[_0xfb38[60]][_0xfb38[65]][_0xfb38[77]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[65]][_0xfb38[85]]/ (params[_0xfb38[60]][_0xfb38[65]][_0xfb38[85]]+ params[_0xfb38[60]][_0xfb38[65]][_0xfb38[95]])* 100,2);params[_0xfb38[60]][_0xfb38[65]][_0xfb38[98]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[65]][_0xfb38[95]]/ (params[_0xfb38[60]][_0xfb38[65]][_0xfb38[85]]+ params[_0xfb38[60]][_0xfb38[65]][_0xfb38[95]])* 100,2)};return ReportCall[_0xfb38[100]]({where:{type:_0xfb38[66]},attributes:[_0xfb38[99],_0xfb38[69],_0xfb38[72]],raw:true})})[_0xfb38[78]](function(_0x7920x1e){if(_0x7920x1e){if(_0x7920x1e[_0xfb38[63]]){params[_0xfb38[66]][_0xfb38[65]][_0xfb38[64]]= _0x7920x1e[_0xfb38[63]];params[_0xfb38[66]][_0xfb38[65]][_0xfb38[67]]= _[_0xfb38[70]](_0x7920x1e,_0xfb38[69])[_0xfb38[68]]|| 0;params[_0xfb38[66]][_0xfb38[65]][_0xfb38[71]]= _[_0xfb38[73]](_0x7920x1e,_0xfb38[72]);if(params[_0xfb38[66]][_0xfb38[65]][_0xfb38[67]]){params[_0xfb38[66]][_0xfb38[65]][_0xfb38[74]]= _[_0xfb38[76]]((_[_0xfb38[73]](_0x7920x1e[_0xfb38[75]],_0xfb38[72])/ params[_0xfb38[66]][_0xfb38[65]][_0xfb38[67]]));params[_0xfb38[66]][_0xfb38[65]][_0xfb38[77]]= _[_0xfb38[76]](params[_0xfb38[66]][_0xfb38[65]][_0xfb38[67]]/ params[_0xfb38[66]][_0xfb38[65]][_0xfb38[64]]* 100,1)}}}})[_0xfb38[62]](function(_0x7920x1d){console[_0xfb38[61]](_0x7920x1d)});return {cdr:function(_0x7920x1a){return function(_0x7920x1e){if(_0x7920x1a[_0xfb38[99]]=== _0xfb38[66]){params[_0xfb38[66]][_0xfb38[65]][_0xfb38[64]]++;params[_0xfb38[66]][_0xfb38[65]][_0xfb38[67]]= (_0x7920x1a[_0xfb38[69]]=== _0xfb38[68])?++params[_0xfb38[66]][_0xfb38[65]][_0xfb38[67]]:params[_0xfb38[66]][_0xfb38[65]][_0xfb38[67]];params[_0xfb38[66]][_0xfb38[65]][_0xfb38[71]]+= Number(_0x7920x1a[_0xfb38[72]]);if(params[_0xfb38[66]][_0xfb38[65]][_0xfb38[67]]){params[_0xfb38[66]][_0xfb38[65]][_0xfb38[74]]= _[_0xfb38[76]](params[_0xfb38[66]][_0xfb38[65]][_0xfb38[71]]/ params[_0xfb38[66]][_0xfb38[65]][_0xfb38[67]]);params[_0xfb38[66]][_0xfb38[65]][_0xfb38[77]]= _[_0xfb38[76]](params[_0xfb38[66]][_0xfb38[65]][_0xfb38[67]]/ params[_0xfb38[66]][_0xfb38[65]][_0xfb38[64]]* 100,1)};_0x7920x15(_0xfb38[105],_0xfb38[106],params[_0xfb38[66]][_0xfb38[65]])};_0x7920x15(_0xfb38[107],_0xfb38[108],_0x7920x1a);return BPromise[_0xfb38[109]]()}},send:function(_0x7920x1a){return function(_0x7920x1e){return BPromise[_0xfb38[109]]()}},hangup:function(_0x7920x1a){return function(_0x7920x1e){if(params[_0xfb38[66]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]]){delete params[_0xfb38[66]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]]};if(params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]]){delete params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]]};var _0x7920x23={uniqueid:_0x7920x1a[_0xfb38[110]],linkedid:_0x7920x1a[_0xfb38[112]],endtime:moment()[_0xfb38[57]](_0xfb38[56]),lastevent:_0xfb38[113],updatedAt:moment()[_0xfb38[57]](_0xfb38[56])};_0x7920x15(util[_0xfb38[57]](_0xfb38[114],_0x7920x1a[_0xfb38[116]][_0xfb38[115]](/\/|-/)[1]),_0xfb38[117],_0x7920x23);_0x7920x15(_0xfb38[118],_0xfb38[117],_0x7920x23);_0x7920x15(_0xfb38[119],_0xfb38[117],_0x7920x23);if(_0x7920x1e){triggers[_0xfb38[120]](_0x7920x1e)};return BPromise[_0xfb38[109]]()}},devicestatechange:function(_0x7920x1a){return function(_0x7920x1e){return User[_0xfb38[133]]({where:{name:_0x7920x1a[_0xfb38[132]][_0xfb38[131]](_0xfb38[129],_0xfb38[130])},raw:true})[_0xfb38[78]](function(_0x7920x24){if(_0x7920x24){var _0x7920x23=_[_0xfb38[125]]({newValues:{id:_0x7920x24[_0xfb38[123]],status:_0x7920x1a[_0xfb38[124]],statusAt:moment()[_0xfb38[57]](_0xfb38[56])}},_0x7920x24,{status:_0x7920x1a[_0xfb38[124]],statusAt:moment()[_0xfb38[57]](_0xfb38[56])});_0x7920x15(util[_0xfb38[57]](_0xfb38[126],_0x7920x24[_0xfb38[127]],_0x7920x24[_0xfb38[123]]),_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[119],_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[118],_0xfb38[128],_0x7920x23)}})[_0xfb38[62]](function(_0x7920x1d){console[_0xfb38[122]](_0xfb38[121],_0x7920x1d)})}},peerstatus:function(_0x7920x1a){return function(_0x7920x1e){if(_0x7920x1e&& _0x7920x1e[0]){_[_0xfb38[101]](_0x7920x1e[1],function(_0x7920x25){if(!params[_0xfb38[134]][_0x7920x25[_0xfb38[29]]]){params[_0xfb38[134]][_0x7920x25[_0xfb38[29]]]= {name:_0x7920x25[_0xfb38[29]]}};params[_0xfb38[134]][_0x7920x25[_0xfb38[29]]][_0xfb38[135]]= _0x7920x1a[_0xfb38[135]];_0x7920x15(_0xfb38[136],_0xfb38[137],params[_0xfb38[134]][_0x7920x25[_0xfb38[29]]])})};return BPromise[_0xfb38[109]]()}},registry:function(_0x7920x1a){return function(_0x7920x1e){if(_0x7920x1e&& _0x7920x1e[0]){_[_0xfb38[101]](_0x7920x1e[1],function(_0x7920x25){if(!params[_0xfb38[134]][_0x7920x25[_0xfb38[29]]]){params[_0xfb38[134]][_0x7920x25[_0xfb38[29]]]= {name:_0x7920x25[_0xfb38[29]]}};params[_0xfb38[134]][_0x7920x25[_0xfb38[29]]][_0xfb38[51]]= _0x7920x1a[_0xfb38[51]];_0x7920x15(_0xfb38[136],_0xfb38[137],params[_0xfb38[134]][_0x7920x25[_0xfb38[29]]])})};return BPromise[_0xfb38[109]]()}},agentcalled:function(_0x7920x1a){return function(_0x7920x1e){if(_0x7920x1e){_0x7920x15(util[_0xfb38[57]](_0xfb38[114],_0x7920x1e[_0xfb38[28]]),_0xfb38[138],_0x7920x1e);triggers[_0xfb38[139]](_0x7920x1e)};return User[_0xfb38[133]]({where:{name:_0x7920x1a[_0xfb38[28]],voicePause:false},raw:true})[_0xfb38[78]](function(_0x7920x24){if(_0x7920x24){var _0x7920x26=moment()[_0xfb38[57]](_0xfb38[56]);var _0x7920x23=_[_0xfb38[125]]({newValues:{id:_0x7920x24[_0xfb38[123]],queueStatus:_0xfb38[141],queueStatusAt:_0x7920x26,lastQueue:_0x7920x1a[_0xfb38[79]]}},_0x7920x24,{queueStatus:_0xfb38[141],queueStatusAt:_0x7920x26,lastQueue:_0x7920x1a[_0xfb38[79]]});_0x7920x15(util[_0xfb38[57]](_0xfb38[126],_0x7920x24[_0xfb38[127]],_0x7920x24[_0xfb38[123]]),_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[119],_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[118],_0xfb38[128],_0x7920x23)}})[_0xfb38[62]](function(_0x7920x1d){console[_0xfb38[122]](_0xfb38[140],_0x7920x1d)})}},agentcomplete:function(_0x7920x1a){return function(_0x7920x1e){if(_0x7920x1e){triggers[_0xfb38[142]](_0x7920x1e)};if(params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[83]]){params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[83]]--};if(params[_0xfb38[60]][_0xfb38[65]][_0xfb38[83]]){params[_0xfb38[60]][_0xfb38[65]][_0xfb38[83]]--;_0x7920x15(_0x7920x1a[_0xfb38[79]],_0xfb38[143],{type:_0xfb38[83],amount:-1,queue:_0x7920x1a[_0xfb38[79]]})};params[_0xfb38[60]][_0xfb38[65]][_0xfb38[85]]++;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[85]]++;_0x7920x15(_0x7920x1a[_0xfb38[79]],_0xfb38[143],{type:_0xfb38[113],amount:1,queue:_0x7920x1a[_0xfb38[79]]});params[_0xfb38[60]][_0xfb38[65]][_0xfb38[77]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[65]][_0xfb38[85]]/ (params[_0xfb38[60]][_0xfb38[65]][_0xfb38[85]]+ params[_0xfb38[60]][_0xfb38[65]][_0xfb38[95]])* 100,2);params[_0xfb38[60]][_0xfb38[65]][_0xfb38[98]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[65]][_0xfb38[95]]/ (params[_0xfb38[60]][_0xfb38[65]][_0xfb38[85]]+ params[_0xfb38[60]][_0xfb38[65]][_0xfb38[95]])* 100,2);params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[77]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[85]]/ (params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[85]]+ params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[95]])* 100,2);params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[98]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[95]]/ (params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[85]]+ params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[95]])* 100,2);params[_0xfb38[60]][_0xfb38[65]][_0xfb38[87]]+= Number(_0x7920x1a[_0xfb38[87]]);params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[87]]+= Number(_0x7920x1a[_0xfb38[87]]);_0x7920x15(_0x7920x1a[_0xfb38[79]],_0xfb38[143],{type:_0xfb38[87],amount:Number(_0x7920x1a[_0xfb38[87]]),queue:_0x7920x1a[_0xfb38[79]]});params[_0xfb38[60]][_0xfb38[65]][_0xfb38[93]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[65]][_0xfb38[87]]/ params[_0xfb38[60]][_0xfb38[65]][_0xfb38[85]]);params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[93]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[87]]/ params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[85]]);params[_0xfb38[60]][_0xfb38[65]][_0xfb38[86]]+= Number(_0x7920x1a[_0xfb38[86]]);params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[86]]+= Number(_0x7920x1a[_0xfb38[86]]);_0x7920x15(_0x7920x1a[_0xfb38[79]],_0xfb38[143],{type:_0xfb38[86],amount:Number(_0x7920x1a[_0xfb38[86]]),queue:_0x7920x1a[_0xfb38[79]]});params[_0xfb38[60]][_0xfb38[65]][_0xfb38[92]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[65]][_0xfb38[86]]/ params[_0xfb38[60]][_0xfb38[65]][_0xfb38[85]]);params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[92]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[86]]/ params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[85]]);var _0x7920x23;var _0x7920x26=moment()[_0xfb38[57]](_0xfb38[56]);return ReportAgent[_0xfb38[133]]({where:{uniqueid:_0x7920x1a[_0xfb38[110]],destuniqueid:_0x7920x1a[_0xfb38[148]]},raw:true})[_0xfb38[78]](function(_0x7920x27){if(_0x7920x27){_0x7920x23= _[_0xfb38[125]]({},_0x7920x27,{lastevent:_0xfb38[113],agentcomplete:true,agentcompleteAt:_0x7920x26,talktime:Number(_0x7920x1a[_0xfb38[87]]),reason:_0x7920x1a[_0xfb38[146]]});_0x7920x15(util[_0xfb38[57]](_0xfb38[114],_0x7920x27[_0xfb38[28]]),_0xfb38[147],_0x7920x23)};return ReportQueue[_0xfb38[133]]({where:{uniqueid:_0x7920x1a[_0xfb38[110]]},raw:true})})[_0xfb38[78]](function(_0x7920x27){if(_0x7920x27){_0x7920x23= _[_0xfb38[125]]({},_0x7920x27,{queuecallercomplete:true,queuecallercompleteAt:_0x7920x26});_0x7920x15(_0x7920x27[_0xfb38[79]],_0xfb38[145],_0x7920x23)};return User[_0xfb38[133]]({where:{name:_0x7920x1a[_0xfb38[28]],voicePause:false},raw:true})})[_0xfb38[78]](function(_0x7920x24){if(_0x7920x24){var _0x7920x23=_[_0xfb38[125]]({newValues:{id:_0x7920x24[_0xfb38[123]],queueStatus:_0xfb38[113],queueStatusAt:_0x7920x26,lastQueue:_0x7920x1a[_0xfb38[79]]}},_0x7920x24,{queueStatus:_0xfb38[113],queueStatusAt:_0x7920x26,lastQueue:_0x7920x1a[_0xfb38[79]]});_0x7920x15(util[_0xfb38[57]](_0xfb38[126],_0x7920x24[_0xfb38[127]],_0x7920x24[_0xfb38[123]]),_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[119],_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[118],_0xfb38[128],_0x7920x23)}})[_0xfb38[62]](function(_0x7920x1d){console[_0xfb38[122]](_0xfb38[144],_0x7920x1d)})}},agentconnect:function(_0x7920x1a){return function(_0x7920x1e){if(_0x7920x1e){triggers[_0xfb38[142]](_0x7920x1e)};if(params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[81]]){params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[81]]--;_0x7920x15(_0x7920x1a[_0xfb38[79]],_0xfb38[143],{type:_0xfb38[81],amount:-1,queue:_0x7920x1a[_0xfb38[79]]})};if(params[_0xfb38[60]][_0xfb38[65]][_0xfb38[81]]){params[_0xfb38[60]][_0xfb38[65]][_0xfb38[81]]--};if(params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]]){params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]][_0xfb38[149]]= _0x7920x1a[_0xfb38[150]];params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]][_0xfb38[151]]= _0x7920x1a[_0xfb38[151]];params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]][_0xfb38[86]]= Number(_0x7920x1a[_0xfb38[86]]);params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]][_0xfb38[152]]= Number(_0x7920x1a[_0xfb38[152]]);params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]][_0xfb38[30]]= _0x7920x1a[_0xfb38[30]];params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]][_0xfb38[28]]= _0x7920x1a[_0xfb38[28]]};params[_0xfb38[60]][_0xfb38[65]][_0xfb38[83]]++;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[83]]++;_0x7920x15(_0x7920x1a[_0xfb38[79]],_0xfb38[143],{type:_0xfb38[83],amount:1,queue:_0x7920x1a[_0xfb38[79]]});var _0x7920x23;var _0x7920x26=moment()[_0xfb38[57]](_0xfb38[56]);return ReportQueue[_0xfb38[133]]({where:{uniqueid:_0x7920x1a[_0xfb38[110]]},raw:true})[_0xfb38[78]](function(_0x7920x27){if(_0x7920x27){_0x7920x23= _[_0xfb38[125]]({},_0x7920x27,{queuecallerleaveAt:moment()[_0xfb38[57]](_0xfb38[56]),holdtime:_0x7920x1a[_0xfb38[86]],assigned:true,lastAssignedTo:_0x7920x1a[_0xfb38[28]]});_0x7920x15(_0x7920x27[_0xfb38[79]],_0xfb38[145],_0x7920x23)};return ReportAgent[_0xfb38[133]]({where:{uniqueid:_0x7920x1a[_0xfb38[110]],destuniqueid:_0x7920x1a[_0xfb38[148]]},raw:true})})[_0xfb38[78]](function(_0x7920x27){if(_0x7920x27){_0x7920x23= _[_0xfb38[125]]({},_0x7920x27,{lastevent:_0xfb38[154],agentconnectAt:moment()[_0xfb38[57]](_0xfb38[56]),holdtime:_0x7920x1a[_0xfb38[86]]});_0x7920x15(util[_0xfb38[57]](_0xfb38[114],_0x7920x27[_0xfb38[28]]),_0xfb38[147],_0x7920x23)};return ReportAgent[_0xfb38[100]]({where:{uniqueid:_0x7920x1a[_0xfb38[110]],destuniqueid:{$ne:_0x7920x1a[_0xfb38[148]]},reason:null},raw:true})})[_0xfb38[78]](function(_0x7920x29){if(_0x7920x29&& _0x7920x29[_0xfb38[63]]){_[_0xfb38[101]](_0x7920x29,function(_0x7920x27){_0x7920x23= _[_0xfb38[125]]({},_0x7920x27,{lastevent:_0xfb38[155],agentringnoanswer:true,agentringnoanswerAt:_0x7920x26,reason:_0xfb38[155],answeredelsewheredestinationuniqueid:_0x7920x1a[_0xfb38[148]],answeredelsewheremembername:_0x7920x1a[_0xfb38[28]]});_0x7920x15(util[_0xfb38[57]](_0xfb38[114],_0x7920x27[_0xfb38[28]]),_0xfb38[147],_0x7920x23)})};return User[_0xfb38[133]]({where:{name:_0x7920x1a[_0xfb38[28]],voicePause:false},raw:true})})[_0xfb38[78]](function(_0x7920x24){if(_0x7920x24){var _0x7920x23=_[_0xfb38[125]]({newValues:{id:_0x7920x24[_0xfb38[123]],queueStatus:_0xfb38[154],queueStatusAt:_0x7920x26,lastQueue:_0x7920x1a[_0xfb38[79]]}},_0x7920x24,{queueStatus:_0xfb38[154],queueStatusAt:_0x7920x26,lastQueue:_0x7920x1a[_0xfb38[79]]});_0x7920x15(util[_0xfb38[57]](_0xfb38[126],_0x7920x24[_0xfb38[127]],_0x7920x24[_0xfb38[123]]),_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[119],_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[118],_0xfb38[128],_0x7920x23)};return User[_0xfb38[100]]({where:{lastQueue:_0x7920x1a[_0xfb38[79]],name:{$ne:_0x7920x1a[_0xfb38[28]]}},raw:true})})[_0xfb38[78]](function(_0x7920x28){if(_0x7920x28&& _0x7920x28[_0xfb38[63]]){_[_0xfb38[101]](_0x7920x28,function(_0x7920x24){var _0x7920x23=_[_0xfb38[125]]({newValues:{id:_0x7920x24[_0xfb38[123]],queueStatus:_0xfb38[113],queueStatusAt:_0x7920x26}},_0x7920x24,{queueStatus:_0xfb38[113],queueStatusAt:_0x7920x26});_0x7920x15(util[_0xfb38[57]](_0xfb38[126],_0x7920x24[_0xfb38[127]],_0x7920x24[_0xfb38[123]]),_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[119],_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[118],_0xfb38[128],_0x7920x23)})}})[_0xfb38[62]](function(_0x7920x1d){console[_0xfb38[122]](_0xfb38[153],_0x7920x1d)})}},agentringnoanswer:function(_0x7920x1a){return function(_0x7920x1e){if(_0x7920x1e){triggers[_0xfb38[142]](_0x7920x1e)};var _0x7920x23;var _0x7920x26=moment()[_0xfb38[57]](_0xfb38[56]);return User[_0xfb38[133]]({where:{name:_0x7920x1a[_0xfb38[28]],voicePause:false},raw:true})[_0xfb38[78]](function(_0x7920x24){if(_0x7920x24){var _0x7920x23=_[_0xfb38[125]]({newValues:{id:_0x7920x24[_0xfb38[123]],queueStatus:_0xfb38[113],queueStatusAt:_0x7920x26,lastQueue:_0x7920x1a[_0xfb38[79]]}},_0x7920x24,{queueStatus:_0xfb38[113],queueStatusAt:_0x7920x26,lastQueue:_0x7920x1a[_0xfb38[79]]});_0x7920x15(util[_0xfb38[57]](_0xfb38[126],_0x7920x24[_0xfb38[127]],_0x7920x24[_0xfb38[123]]),_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[119],_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[118],_0xfb38[128],_0x7920x23)};return ReportAgent[_0xfb38[133]]({where:{uniqueid:_0x7920x1a[_0xfb38[110]],destuniqueid:_0x7920x1a[_0xfb38[148]]},raw:true})})[_0xfb38[78]](function(_0x7920x27){if(_0x7920x27){_0x7920x23= _[_0xfb38[125]]({},_0x7920x27,{lastevent:_0xfb38[157],agentringnoanswer:true,agentringnoanswerAt:moment()[_0xfb38[57]](_0xfb38[56]),reason:_0xfb38[157]});_0x7920x15(util[_0xfb38[57]](_0xfb38[114],_0x7920x27[_0xfb38[28]]),_0xfb38[147],_0x7920x23)}})[_0xfb38[62]](function(_0x7920x1d){console[_0xfb38[122]](_0xfb38[156],_0x7920x1d)})}},queuememberadded:function(_0x7920x1a){return function(_0x7920x1e){if(_0x7920x1e){_0x7920x15(_0x7920x1e[_0xfb38[79]],_0xfb38[158],_0x7920x1e);_0x7920x15(util[_0xfb38[57]](_0xfb38[114],_0x7920x1e.UserId),_0xfb38[158],_0x7920x1e)};return BPromise[_0xfb38[109]]()}},queuememberremoved:function(_0x7920x1a){return function(_0x7920x1e){if(params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]]){delete params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[107]][_0x7920x1a[_0xfb38[28]]]};return User[_0xfb38[133]]({where:{name:_0x7920x1a[_0xfb38[30]][_0xfb38[131]](_0xfb38[129],_0xfb38[130])},raw:true})[_0xfb38[78]](function(_0x7920x24){if(_0x7920x24){_0x7920x15(_0x7920x1a[_0xfb38[79]],_0xfb38[160],{queue:_0x7920x1a[_0xfb38[79]],UserId:_0x7920x24[_0xfb38[123]]});_0x7920x15(util[_0xfb38[57]](_0xfb38[114],_0x7920x24[_0xfb38[123]]),_0xfb38[160],{queue:_0x7920x1a[_0xfb38[79]],UserId:_0x7920x24[_0xfb38[123]]})}})[_0xfb38[62]](function(_0x7920x1d){console[_0xfb38[61]](_0xfb38[159],_0x7920x1d)})}},queuememberpause:function(_0x7920x1a){return function(_0x7920x1e){if(_0x7920x1e){_0x7920x15(_0x7920x1e[_0xfb38[79]],_0xfb38[158],_0x7920x1e);_0x7920x15(util[_0xfb38[57]](_0xfb38[114],_0x7920x1e.UserId),_0xfb38[158],_0x7920x1e)};var _0x7920x23;var _0x7920x26=moment()[_0xfb38[57]](_0xfb38[56]);return User[_0xfb38[133]]({where:{name:_0x7920x1a[_0xfb38[28]]},raw:true})[_0xfb38[78]](function(_0x7920x24){if(_0x7920x24){var _0x7920x2a={id:_0x7920x24[_0xfb38[123]],voicePause:false,queueStatusAt:_0x7920x26};if(parseInt(_0x7920x1a[_0xfb38[58]],10)){_[_0xfb38[162]](_0x7920x2a,{voicePause:true,chatPause:true,mailPause:true,faxPause:true,smsPause:true,openchannelPause:true,pauseType:_0x7920x1a[_0xfb38[146]],lastPauseAt:_0x7920x26,queueStatus:_0xfb38[58]})}else {switch(_0x7920x24[_0xfb38[51]]){case _0xfb38[37]:_0x7920x2a[_0xfb38[163]]= _0xfb38[154];break;case _0xfb38[45]:_0x7920x2a[_0xfb38[163]]= _0xfb38[141];break;default:_0x7920x2a[_0xfb38[163]]= _0xfb38[113]}};var _0x7920x23=_[_0xfb38[125]]({newValues:_0x7920x2a},_0x7920x24,_0x7920x2a);_0x7920x15(util[_0xfb38[57]](_0xfb38[126],_0x7920x24[_0xfb38[127]],_0x7920x24[_0xfb38[123]]),_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[119],_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[118],_0xfb38[128],_0x7920x23)}})[_0xfb38[62]](function(_0x7920x1d){console[_0xfb38[122]](_0xfb38[161],_0x7920x1d)})}},queuememberpenalty:function(_0x7920x1a){return function(_0x7920x1e){return BPromise[_0xfb38[109]]()}},queuememberringinuse:function(_0x7920x1a){return function(_0x7920x1e){return BPromise[_0xfb38[109]]()}},queuemember:function(_0x7920x1a){return function(_0x7920x1e){_0x7920x19(_0x7920x1a);_0x7920x1b(_0x7920x1a[_0xfb38[79]]);params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[107]][_0x7920x1a[_0xfb38[29]]]= _0x7920x1a;return BPromise[_0xfb38[109]]()}},queuecallerjoin:function(_0x7920x1a){if(!params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]]){params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]]= {};params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[81]]= 0;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[83]]= 0;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[85]]= 0;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[95]]= 0;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[97]]= 0;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[86]]= 0;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[87]]= 0;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[92]]= 0;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[93]]= 0;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[77]]= 0;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[98]]= 0;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[64]]= 0};params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]]= {channel:_0x7920x1a[_0xfb38[116]],channelstate:Number(_0x7920x1a[_0xfb38[164]]),channelstatedesc:_0x7920x1a[_0xfb38[165]],calleridnum:_0x7920x1a[_0xfb38[166]],calleridname:_0x7920x1a[_0xfb38[167]],exten:_0x7920x1a[_0xfb38[168]],priority:Number(_0x7920x1a[_0xfb38[169]]),uniqueid:_0x7920x1a[_0xfb38[110]],queue:_0x7920x1a[_0xfb38[79]],position:Number(_0x7920x1a[_0xfb38[170]]),count:Number(_0x7920x1a[_0xfb38[171]])};params[_0xfb38[60]][_0xfb38[65]][_0xfb38[81]]++;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[81]]++;_0x7920x15(_0x7920x1a[_0xfb38[79]],_0xfb38[143],{type:_0xfb38[64],amount:1,queue:_0x7920x1a[_0xfb38[79]]});params[_0xfb38[60]][_0xfb38[65]][_0xfb38[64]]++;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[64]]++;_0x7920x15(_0x7920x1a[_0xfb38[79]],_0xfb38[143],{type:_0xfb38[81],amount:1,queue:_0x7920x1a[_0xfb38[79]]});return function(_0x7920x1e){if(_0x7920x1e){_0x7920x15(_0x7920x1e[_0xfb38[79]],_0xfb38[172],_0x7920x1e)};return BPromise[_0xfb38[109]]()}},queuecallerabandon:function(_0x7920x1a){return function(_0x7920x1e){if(_0x7920x1e&& _0x7920x1e[0]){_[_0xfb38[101]](_0x7920x1e[1],function(_0x7920x27){triggers[_0xfb38[142]](_0x7920x27);_0x7920x15(util[_0xfb38[57]](_0xfb38[114],_0x7920x27[_0xfb38[28]]),_0xfb38[147],_0x7920x27)})};var _0x7920x23;var _0x7920x26=moment()[_0xfb38[57]](_0xfb38[56]);return ReportQueue[_0xfb38[133]]({where:{uniqueid:_0x7920x1a[_0xfb38[110]],queuecallerexit:false},raw:true})[_0xfb38[78]](function(_0x7920x27){if(_0x7920x27){if(params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[81]]){params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[81]]--;_0x7920x15(_0x7920x1a[_0xfb38[79]],_0xfb38[143],{type:_0xfb38[81],amount:-1,queue:_0x7920x1a[_0xfb38[79]]})};if(params[_0xfb38[60]][_0xfb38[65]][_0xfb38[81]]){params[_0xfb38[60]][_0xfb38[65]][_0xfb38[81]]--};if(params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]]){params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]][_0xfb38[86]]= Number(_0x7920x1a[_0xfb38[86]]);params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]][_0xfb38[170]]= Number(_0x7920x1a[_0xfb38[170]]);params[_0xfb38[60]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]][_0xfb38[174]]= Number(_0x7920x1a[_0xfb38[174]])};params[_0xfb38[60]][_0xfb38[65]][_0xfb38[95]]++;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[95]]++;_0x7920x15(_0x7920x1a[_0xfb38[79]],_0xfb38[143],{type:_0xfb38[175],amount:1,queue:_0x7920x1a[_0xfb38[79]]});params[_0xfb38[60]][_0xfb38[65]][_0xfb38[77]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[65]][_0xfb38[85]]/ (params[_0xfb38[60]][_0xfb38[65]][_0xfb38[85]]+ params[_0xfb38[60]][_0xfb38[65]][_0xfb38[95]])* 100,2);params[_0xfb38[60]][_0xfb38[65]][_0xfb38[98]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[65]][_0xfb38[95]]/ (params[_0xfb38[60]][_0xfb38[65]][_0xfb38[85]]+ params[_0xfb38[60]][_0xfb38[65]][_0xfb38[95]])* 100,2);params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[77]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[85]]/ (params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[85]]+ params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[95]])* 100,2);params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[98]]= _[_0xfb38[76]](params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[95]]/ (params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[85]]+ params[_0xfb38[60]][_0xfb38[59]][_0x7920x1a[_0xfb38[79]]][_0xfb38[95]])* 100,2);_0x7920x15(_0x7920x27[_0xfb38[79]],_0xfb38[145],_[_0xfb38[162]](_0x7920x27,{queuecallerabandon:true,queuecallerabandonAt:_0x7920x26,queuecallerleaveAt:_0x7920x26,originalposition:_0x7920x1a[_0xfb38[174]],position:_0x7920x1a[_0xfb38[170]],holdtime:_0x7920x1a[_0xfb38[86]]}))};return User[_0xfb38[100]]({where:{lastQueue:_0x7920x1a[_0xfb38[79]],voicePause:false},raw:true})})[_0xfb38[78]](function(_0x7920x2b){if(_0x7920x2b&& _0x7920x2b[_0xfb38[63]]){var _0x7920x23;_[_0xfb38[101]](_0x7920x2b,function(_0x7920x2c){_0x7920x23= _[_0xfb38[125]]({newValues:{id:_0x7920x2c[_0xfb38[123]],queueStatus:_0xfb38[113],queueStatusAt:_0x7920x26,lastQueue:_0x7920x1a[_0xfb38[79]]}},_0x7920x2c,{id:_0x7920x2c[_0xfb38[123]],queueStatus:_0xfb38[113],queueStatusAt:_0x7920x26,lastQueue:_0x7920x1a[_0xfb38[79]]});_0x7920x15(util[_0xfb38[57]](_0xfb38[126],_0x7920x2c[_0xfb38[127]],_0x7920x2c[_0xfb38[123]]),_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[119],_0xfb38[128],_0x7920x23);_0x7920x15(_0xfb38[118],_0xfb38[128],_0x7920x23)})}})[_0xfb38[62]](function(_0x7920x1d){console[_0xfb38[122]](_0xfb38[173],_0x7920x1d)})}},blindtransfer:function(_0x7920x1a){return function(_0x7920x1e){_0x7920x15(null,_0x7920x1a[_0xfb38[24]][_0xfb38[176]](),_0x7920x1a);return BPromise[_0xfb38[109]]()}},attendedtransfer:function(_0x7920x1a){return function(_0x7920x1e){_0x7920x15(null,_0x7920x1a[_0xfb38[24]][_0xfb38[176]](),_0x7920x1a);return BPromise[_0xfb38[109]]()}},dialbegin:function(_0x7920x1a){return function(_0x7920x1e){params[_0xfb38[66]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]]= {channel:_0x7920x1a[_0xfb38[116]],channelstate:Number(_0x7920x1a[_0xfb38[164]]),channelstatedesc:_0x7920x1a[_0xfb38[165]],calleridnum:_0x7920x1a[_0xfb38[166]],calleridname:_0x7920x1a[_0xfb38[167]],context:_0x7920x1a[_0xfb38[177]],exten:_0x7920x1a[_0xfb38[168]],priority:Number(_0x7920x1a[_0xfb38[169]]),dialstring:_0x7920x1a[_0xfb38[178]]};if(_0x7920x1a[_0xfb38[116]]){var _0x7920x23=_[_0xfb38[162]](_0x7920x1a,{starttime:moment()[_0xfb38[57]](_0xfb38[56]),lastevent:_0xfb38[141],updatedAt:moment()[_0xfb38[57]](_0xfb38[56])});_0x7920x15(util[_0xfb38[57]](_0xfb38[114],_0x7920x1a[_0xfb38[116]][_0xfb38[115]](/\/|-/)[1]),_0xfb38[179],_0x7920x23);_0x7920x15(_0xfb38[119],_0xfb38[117],_[_0xfb38[162]](_0x7920x23,{role:_0xfb38[119]}));_0x7920x15(_0xfb38[118],_0xfb38[117],_0x7920x23,_[_0xfb38[162]](_0x7920x23,{role:_0xfb38[118]}));if(_0x7920x1e){triggers[_0xfb38[120]](_0x7920x1e)}};return BPromise[_0xfb38[109]]()}},dialend:function(_0x7920x1a){return function(_0x7920x1e){if(params[_0xfb38[66]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]]){params[_0xfb38[66]][_0xfb38[111]][_0x7920x1a[_0xfb38[110]]][_0xfb38[180]]= _0x7920x1a[_0xfb38[180]]};if(_0x7920x1a[_0xfb38[116]]){var _0x7920x26=moment()[_0xfb38[57]](_0xfb38[56]);var _0x7920x23={dialstatus:_0x7920x1a[_0xfb38[180]],lastevent:(_0x7920x1a[_0xfb38[180]]=== _0xfb38[181])?_0xfb38[154]:_0xfb38[113],answertime:(_0x7920x1a[_0xfb38[180]]=== _0xfb38[181])?_0x7920x26:null,uniqueid:_0x7920x1a[_0xfb38[110]],linkedid:_0x7920x1a[_0xfb38[112]],destuniqueid:_0x7920x1a[_0xfb38[148]],destlinkedid:_0x7920x1a[_0xfb38[182]],updatedAt:_0x7920x26};_0x7920x15(util[_0xfb38[57]](_0xfb38[114],_0x7920x1a[_0xfb38[116]][_0xfb38[115]](/\/|-/)[1]),_0xfb38[117],_0x7920x23);_0x7920x15(_0xfb38[119],_0xfb38[117],_0x7920x23);_0x7920x15(_0xfb38[118],_0xfb38[117],_0x7920x23);if(_0x7920x1e){triggers[_0xfb38[120]](_0x7920x1e)}};return BPromise[_0xfb38[109]]()}},varset:function(_0x7920x1a){return function(_0x7920x1e){if(_0x7920x1a[_0xfb38[184]][_0xfb38[53]](_0xfb38[183])){if(_0x7920x1e){params[_0xfb38[60]][_0xfb38[65]][_0xfb38[97]]+= 1;params[_0xfb38[60]][_0xfb38[59]][_0x7920x1e[_0xfb38[79]]][_0xfb38[97]]+= 1;_0x7920x15(_0x7920x1e[_0xfb38[79]],_0xfb38[143],{type:_0xfb38[97],amount:1,queue:_0x7920x1e[_0xfb38[79]]});if(params[_0xfb38[60]][_0xfb38[59]][_0x7920x1e[_0xfb38[79]]][_0xfb38[81]]){params[_0xfb38[60]][_0xfb38[59]][_0x7920x1e[_0xfb38[79]]][_0xfb38[81]]-= 1};if(params[_0xfb38[60]][_0xfb38[65]][_0xfb38[81]]){params[_0xfb38[60]][_0xfb38[65]][_0xfb38[81]]-= 1};_0x7920x15(_0x7920x1e[_0xfb38[79]],_0xfb38[143],{type:_0xfb38[81],amount:-1,queue:_0x7920x1e[_0xfb38[79]]});_0x7920x15(_0x7920x1e[_0xfb38[79]],_0xfb38[145],_0x7920x1e)}};if(_0x7920x1a[_0xfb38[184]][_0xfb38[53]](_0xfb38[185])){_0x7920x15(_0xfb38[119],_0xfb38[179],{uniqueid:_0x7920x1a[_0xfb38[110]],routeId:_0x7920x1a[_0xfb38[186]],updatedAt:moment()[_0xfb38[57]](_0xfb38[56])});_0x7920x15(_0xfb38[118],_0xfb38[179],{uniqueid:_0x7920x1a[_0xfb38[110]],routeId:_0x7920x1a[_0xfb38[186]],updatedAt:moment()[_0xfb38[57]](_0xfb38[56])})};if(_0x7920x1a){triggers[_0xfb38[187]](_0x7920x1a)};return BPromise[_0xfb38[109]]()}},agentUpdate:function(_0x7920x2c){return function(){_0x7920x15(util[_0xfb38[57]](_0xfb38[114],_0x7920x2c[_0xfb38[123]]),_0xfb38[128],_0x7920x2c);_0x7920x15(_0xfb38[119],_0xfb38[128],_0x7920x2c);_0x7920x15(_0xfb38[118],_0xfb38[128],_0x7920x2c)}},console:function(_0x7920x2d){_0x7920x15(_0x7920x2d[_0xfb38[188]],util[_0xfb38[57]](_0xfb38[189],_0x7920x2d[_0xfb38[99]]),_0x7920x2d[_0xfb38[190]])},realtimeQueueMembers:function(_0x7920x2e){return function(){_[_0xfb38[192]](params[_0xfb38[60]][_0xfb38[59]],function(_0x7920x1c,_0x7920x20){if(_[_0xfb38[191]](_0x7920x2e,_0x7920x20)){_[_0xfb38[192]](_0x7920x1c[_0xfb38[107]],function(_0x7920x2c){_0x7920x15(_0x7920x20,_0xfb38[158],_0x7920x2c)})}})}},updateTriggers:function(_0x7920x2d){return function(){return triggers[_0xfb38[193]](_0x7920x2d)}},queueAdd:function(_0x7920x2f,_0x7920x30){return function(){if(_0x7920x2f&& _0x7920x30){_[_0xfb38[101]](_0x7920x2f,function(_0x7920x1e){_0x7920x15(null,util[_0xfb38[57]](_0xfb38[194],_0x7920x30),_0x7920x1e[0])})}}},queueRemove:function(_0x7920x1e,_0x7920x30){return function(){if(_0x7920x1e&& _0x7920x30){_0x7920x15(null,util[_0xfb38[57]](_0xfb38[195],_0x7920x30),_0x7920x1e)}}},checkTriggers:function(_0x7920x2d){return function(){return triggers[_0xfb38[196]](_0x7920x2d)}}}}
\ No newline at end of file