Built motion from commit ec3ecc5.|1.0.2
[motion.git] / server / config / ami / socket.js
index 836c4d6..ea32ac0 100644 (file)
@@ -1 +1 @@
-var _0x97ff=["\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","\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","\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","\x73\x74\x61\x74\x75\x73","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\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","\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","\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","\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","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x65\x76\x65\x6E\x74","\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","\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"];_0x97ff[0];var _=require(_0x97ff[1]);var util=require(_0x97ff[2]);var moment=require(_0x97ff[3]);var BPromise=require(_0x97ff[4]);var redis=require(_0x97ff[5]);var VoiceQueue=require(_0x97ff[7])[_0x97ff[6]];var ReportQueue=require(_0x97ff[7])[_0x97ff[8]];var ReportCall=require(_0x97ff[7])[_0x97ff[9]];var ReportAgent=require(_0x97ff[7])[_0x97ff[10]];var ReportDial=require(_0x97ff[7])[_0x97ff[11]];var ReportMember=require(_0x97ff[7])[_0x97ff[12]];var User=require(_0x97ff[7])[_0x97ff[13]];var Triggers=require(_0x97ff[14]);var config=require(_0x97ff[15]);var utils=require(_0x97ff[16]);var redisConf;if(config[_0x97ff[17]]){redisConf= {password:config[_0x97ff[17]]}};var redisClient=redis[_0x97ff[19]](6379,config[_0x97ff[18]],redisConf);var io=require(_0x97ff[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[_0x97ff[21]]= function(){var _0xfd88x15=function(_0xfd88x16,_0xfd88x17,_0xfd88x18){if(_0xfd88x16){io[_0x97ff[23]](_0xfd88x16)[_0x97ff[22]](_0xfd88x17,_0xfd88x18)}else {io[_0x97ff[22]](_0xfd88x17,_0xfd88x18)}};VoiceQueue[_0x97ff[65]]({attributes:[_0x97ff[66]],raw:true})[_0x97ff[41]](function(_0xfd88x1a){if(_0xfd88x1a){params[_0x97ff[44]][_0x97ff[43]]= _[_0x97ff[69]](_[_0x97ff[67]](_0xfd88x1a,_0x97ff[66]),function(_0xfd88x1f,_0xfd88x20){_0xfd88x1f[_0x97ff[68]]= {};_0xfd88x1f[_0x97ff[45]]= 0;_0xfd88x1f[_0x97ff[46]]= 0;_0xfd88x1f[_0x97ff[47]]= 0;_0xfd88x1f[_0x97ff[48]]= 0;_0xfd88x1f[_0x97ff[49]]= 0;_0xfd88x1f[_0x97ff[50]]= 0;_0xfd88x1f[_0x97ff[51]]= 0;_0xfd88x1f[_0x97ff[52]]= 0;_0xfd88x1f[_0x97ff[53]]= 0;_0xfd88x1f[_0x97ff[40]]= 0;_0xfd88x1f[_0x97ff[54]]= 0;_0xfd88x1f[_0x97ff[27]]= 0});return ReportQueue[_0x97ff[65]]({attributes:[_0x97ff[42],_0x97ff[58],_0x97ff[61],_0x97ff[70],_0x97ff[71],_0x97ff[72],_0x97ff[50]],raw:true})}})[_0x97ff[41]](function(_0xfd88x1a){if(_0xfd88x1a){var _0xfd88x1b;var _0xfd88x1c;var _0xfd88x1d=_0xfd88x1a[_0x97ff[26]];for(var _0xfd88x1e=0;_0xfd88x1e< _0xfd88x1d;_0xfd88x1e++){_0xfd88x1b= _0xfd88x1a[_0xfd88x1e];_0xfd88x1c= _0xfd88x1b[_0x97ff[42]];if(!params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c]){params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c]= {};params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[45]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[46]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[47]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[48]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[49]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[50]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[51]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[52]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[53]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[40]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[54]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[27]]= 0};params[_0x97ff[44]][_0x97ff[28]][_0x97ff[27]]++;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[27]]++;if(utils[_0x97ff[55]](_0xfd88x1b)){params[_0x97ff[44]][_0x97ff[28]][_0x97ff[45]]++;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[45]]++};if(utils[_0x97ff[56]](_0xfd88x1b)){params[_0x97ff[44]][_0x97ff[28]][_0x97ff[46]]++;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[46]]++};if(utils[_0x97ff[57]](_0xfd88x1b)){params[_0x97ff[44]][_0x97ff[28]][_0x97ff[47]]++;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[47]]++;params[_0x97ff[44]][_0x97ff[28]][_0x97ff[50]]+= _0xfd88x1b[_0x97ff[50]]|| 0;params[_0x97ff[44]][_0x97ff[28]][_0x97ff[51]]+= moment(_0xfd88x1b[_0x97ff[61]])[_0x97ff[60]](moment(_0xfd88x1b[_0x97ff[58]]),_0x97ff[59]);params[_0x97ff[44]][_0x97ff[28]][_0x97ff[52]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[50]]/ params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[47]]);params[_0x97ff[44]][_0x97ff[28]][_0x97ff[53]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[51]]/ params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[47]]);params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[50]]+= _0xfd88x1b[_0x97ff[50]]|| 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[51]]+= moment(_0xfd88x1b[_0x97ff[61]])[_0x97ff[60]](moment(_0xfd88x1b[_0x97ff[58]]),_0x97ff[59]);params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[52]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[50]]/ params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[47]]);params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[53]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[51]]/ params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[47]])};if(utils[_0x97ff[62]](_0xfd88x1b)){params[_0x97ff[44]][_0x97ff[28]][_0x97ff[48]]++;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[48]]++};if(utils[_0x97ff[63]](_0xfd88x1b)){params[_0x97ff[44]][_0x97ff[28]][_0x97ff[49]]++;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[49]]++}};params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[40]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[47]]/ (params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[47]]+ params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[48]])* 100,2);params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[54]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[48]]/ (params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[47]]+ params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1c][_0x97ff[48]])* 100,2);params[_0x97ff[44]][_0x97ff[28]][_0x97ff[40]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[28]][_0x97ff[47]]/ (params[_0x97ff[44]][_0x97ff[28]][_0x97ff[47]]+ params[_0x97ff[44]][_0x97ff[28]][_0x97ff[48]])* 100,2);params[_0x97ff[44]][_0x97ff[28]][_0x97ff[54]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[28]][_0x97ff[48]]/ (params[_0x97ff[44]][_0x97ff[28]][_0x97ff[47]]+ params[_0x97ff[44]][_0x97ff[28]][_0x97ff[48]])* 100,2)};return ReportCall[_0x97ff[65]]({where:{type:_0x97ff[29]},attributes:[_0x97ff[64],_0x97ff[32],_0x97ff[35]],raw:true})})[_0x97ff[41]](function(_0xfd88x1a){if(_0xfd88x1a){if(_0xfd88x1a[_0x97ff[26]]){params[_0x97ff[29]][_0x97ff[28]][_0x97ff[27]]= _0xfd88x1a[_0x97ff[26]];params[_0x97ff[29]][_0x97ff[28]][_0x97ff[30]]= _[_0x97ff[33]](_0xfd88x1a,_0x97ff[32])[_0x97ff[31]]|| 0;params[_0x97ff[29]][_0x97ff[28]][_0x97ff[34]]= _[_0x97ff[36]](_0xfd88x1a,_0x97ff[35]);if(params[_0x97ff[29]][_0x97ff[28]][_0x97ff[30]]){params[_0x97ff[29]][_0x97ff[28]][_0x97ff[37]]= _[_0x97ff[39]]((_[_0x97ff[36]](_0xfd88x1a[_0x97ff[38]],_0x97ff[35])/ params[_0x97ff[29]][_0x97ff[28]][_0x97ff[30]]));params[_0x97ff[29]][_0x97ff[28]][_0x97ff[40]]= _[_0x97ff[39]](params[_0x97ff[29]][_0x97ff[28]][_0x97ff[30]]/ params[_0x97ff[29]][_0x97ff[28]][_0x97ff[27]]* 100,1)}}}})[_0x97ff[25]](function(_0xfd88x19){console[_0x97ff[24]](_0xfd88x19)});return {cdr:function(_0xfd88x21){return function(_0xfd88x1a){if(_0xfd88x21[_0x97ff[64]]=== _0x97ff[29]){params[_0x97ff[29]][_0x97ff[28]][_0x97ff[27]]++;params[_0x97ff[29]][_0x97ff[28]][_0x97ff[30]]= (_0xfd88x21[_0x97ff[32]]=== _0x97ff[31])?++params[_0x97ff[29]][_0x97ff[28]][_0x97ff[30]]:params[_0x97ff[29]][_0x97ff[28]][_0x97ff[30]];params[_0x97ff[29]][_0x97ff[28]][_0x97ff[34]]+= Number(_0xfd88x21[_0x97ff[35]]);if(params[_0x97ff[29]][_0x97ff[28]][_0x97ff[30]]){params[_0x97ff[29]][_0x97ff[28]][_0x97ff[37]]= _[_0x97ff[39]](params[_0x97ff[29]][_0x97ff[28]][_0x97ff[34]]/ params[_0x97ff[29]][_0x97ff[28]][_0x97ff[30]]);params[_0x97ff[29]][_0x97ff[28]][_0x97ff[40]]= _[_0x97ff[39]](params[_0x97ff[29]][_0x97ff[28]][_0x97ff[30]]/ params[_0x97ff[29]][_0x97ff[28]][_0x97ff[27]]* 100,1)};_0xfd88x15(_0x97ff[73],_0x97ff[74],params[_0x97ff[29]][_0x97ff[28]])};_0xfd88x15(_0x97ff[68],_0x97ff[75],_0xfd88x21);return BPromise[_0x97ff[76]]()}},send:function(_0xfd88x21){return function(_0xfd88x1a){return BPromise[_0x97ff[76]]()}},hangup:function(_0xfd88x21){return function(_0xfd88x1a){if(params[_0x97ff[29]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]]){delete params[_0x97ff[29]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]];_0xfd88x15(_0x97ff[79],_0x97ff[80],params[_0x97ff[29]][_0x97ff[78]])};if(params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]]){delete params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]];_0xfd88x15(_0x97ff[81],_0x97ff[82],params[_0x97ff[44]][_0x97ff[78]])};var _0xfd88x22={uniqueid:_0xfd88x21[_0x97ff[77]],linkedid:_0xfd88x21[_0x97ff[83]],endtime:moment()[_0x97ff[85]](_0x97ff[84]),lastevent:_0x97ff[86],updatedAt:moment()[_0x97ff[85]](_0x97ff[84])};_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x21[_0x97ff[89]][_0x97ff[88]](/\/|-/)[1]),_0x97ff[90],_0xfd88x22);_0xfd88x15(_0x97ff[91],_0x97ff[92],_0xfd88x22);_0xfd88x15(_0x97ff[93],_0x97ff[92],_0xfd88x22);if(_0xfd88x1a){triggers[_0x97ff[94]](_0xfd88x1a)};return BPromise[_0x97ff[76]]()}},devicestatechange:function(_0xfd88x21){return function(_0xfd88x1a){return User[_0x97ff[107]]({where:{name:_0xfd88x21[_0x97ff[106]][_0x97ff[105]](_0x97ff[103],_0x97ff[104])},raw:true})[_0x97ff[41]](function(_0xfd88x23){if(_0xfd88x23){var _0xfd88x22=_[_0x97ff[99]]({newValues:{id:_0xfd88x23[_0x97ff[97]],status:_0xfd88x21[_0x97ff[98]],statusAt:moment()[_0x97ff[85]](_0x97ff[84])}},_0xfd88x23,{status:_0xfd88x21[_0x97ff[98]],statusAt:moment()[_0x97ff[85]](_0x97ff[84])});_0xfd88x15(util[_0x97ff[85]](_0x97ff[100],_0xfd88x23[_0x97ff[101]],_0xfd88x23[_0x97ff[97]]),_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[93],_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[91],_0x97ff[102],_0xfd88x22)}})[_0x97ff[25]](function(_0xfd88x19){console[_0x97ff[96]](_0x97ff[95],_0xfd88x19)})}},peerstatus:function(_0xfd88x21){return function(_0xfd88x1a){var _0xfd88x17=_0xfd88x21[_0x97ff[109]][_0x97ff[88]](_0x97ff[108])[1];if(!params[_0x97ff[110]][_0xfd88x17]){params[_0x97ff[110]][_0xfd88x17]= {name:_0xfd88x17}};params[_0x97ff[110]][_0xfd88x17][_0x97ff[111]]= _0xfd88x21[_0x97ff[111]];_0xfd88x15(_0x97ff[112],_0x97ff[113],params[_0x97ff[110]][_0xfd88x17]);return BPromise[_0x97ff[76]]()}},registry:function(_0xfd88x21){return function(_0xfd88x1a){if(_0xfd88x1a&& _0xfd88x1a[0]){_[_0x97ff[69]](_0xfd88x1a[1],function(_0xfd88x24){if(!params[_0x97ff[110]][_0xfd88x24[_0x97ff[66]]]){params[_0x97ff[110]][_0xfd88x24[_0x97ff[66]]]= {name:_0xfd88x24[_0x97ff[66]]}};params[_0x97ff[110]][_0xfd88x24[_0x97ff[66]]][_0x97ff[114]]= _0xfd88x21[_0x97ff[114]];_0xfd88x15(_0x97ff[112],_0x97ff[113],params[_0x97ff[110]][_0xfd88x24[_0x97ff[66]]])})};return BPromise[_0x97ff[76]]()}},agentcalled:function(_0xfd88x21){return function(_0xfd88x1a){if(_0xfd88x1a){_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x1a[_0x97ff[115]]),_0x97ff[116],_0xfd88x1a);triggers[_0x97ff[117]](_0xfd88x1a)};return User[_0x97ff[107]]({where:{name:_0xfd88x21[_0x97ff[115]],voicePause:false},raw:true})[_0x97ff[41]](function(_0xfd88x23){if(_0xfd88x23){var _0xfd88x25=moment()[_0x97ff[85]](_0x97ff[84]);var _0xfd88x22=_[_0x97ff[99]]({newValues:{id:_0xfd88x23[_0x97ff[97]],queueStatus:_0x97ff[119],queueStatusAt:_0xfd88x25,lastQueue:_0xfd88x21[_0x97ff[42]]}},_0xfd88x23,{queueStatus:_0x97ff[119],queueStatusAt:_0xfd88x25,lastQueue:_0xfd88x21[_0x97ff[42]]});_0xfd88x15(util[_0x97ff[85]](_0x97ff[100],_0xfd88x23[_0x97ff[101]],_0xfd88x23[_0x97ff[97]]),_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[93],_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[91],_0x97ff[102],_0xfd88x22)}})[_0x97ff[25]](function(_0xfd88x19){console[_0x97ff[96]](_0x97ff[118],_0xfd88x19)})}},agentcomplete:function(_0xfd88x21){return function(_0xfd88x1a){if(_0xfd88x1a){triggers[_0x97ff[120]](_0xfd88x1a)};if(params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[46]]){params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[46]]--};if(params[_0x97ff[44]][_0x97ff[28]][_0x97ff[46]]){params[_0x97ff[44]][_0x97ff[28]][_0x97ff[46]]--;_0xfd88x15(_0xfd88x21[_0x97ff[42]],_0x97ff[121],{type:_0x97ff[46],amount:-1,queue:_0xfd88x21[_0x97ff[42]]})};params[_0x97ff[44]][_0x97ff[28]][_0x97ff[47]]++;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[47]]++;_0xfd88x15(_0xfd88x21[_0x97ff[42]],_0x97ff[121],{type:_0x97ff[86],amount:1,queue:_0xfd88x21[_0x97ff[42]]});params[_0x97ff[44]][_0x97ff[28]][_0x97ff[40]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[28]][_0x97ff[47]]/ (params[_0x97ff[44]][_0x97ff[28]][_0x97ff[47]]+ params[_0x97ff[44]][_0x97ff[28]][_0x97ff[48]])* 100,2);params[_0x97ff[44]][_0x97ff[28]][_0x97ff[54]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[28]][_0x97ff[48]]/ (params[_0x97ff[44]][_0x97ff[28]][_0x97ff[47]]+ params[_0x97ff[44]][_0x97ff[28]][_0x97ff[48]])* 100,2);params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[40]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[47]]/ (params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[47]]+ params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[48]])* 100,2);params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[54]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[48]]/ (params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[47]]+ params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[48]])* 100,2);params[_0x97ff[44]][_0x97ff[28]][_0x97ff[51]]+= Number(_0xfd88x21[_0x97ff[51]]);params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[51]]+= Number(_0xfd88x21[_0x97ff[51]]);_0xfd88x15(_0xfd88x21[_0x97ff[42]],_0x97ff[121],{type:_0x97ff[51],amount:Number(_0xfd88x21[_0x97ff[51]]),queue:_0xfd88x21[_0x97ff[42]]});params[_0x97ff[44]][_0x97ff[28]][_0x97ff[53]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[28]][_0x97ff[51]]/ params[_0x97ff[44]][_0x97ff[28]][_0x97ff[47]]);params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[53]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[51]]/ params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[47]]);params[_0x97ff[44]][_0x97ff[28]][_0x97ff[50]]+= Number(_0xfd88x21[_0x97ff[50]]);params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[50]]+= Number(_0xfd88x21[_0x97ff[50]]);_0xfd88x15(_0xfd88x21[_0x97ff[42]],_0x97ff[121],{type:_0x97ff[50],amount:Number(_0xfd88x21[_0x97ff[50]]),queue:_0xfd88x21[_0x97ff[42]]});params[_0x97ff[44]][_0x97ff[28]][_0x97ff[52]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[28]][_0x97ff[50]]/ params[_0x97ff[44]][_0x97ff[28]][_0x97ff[47]]);params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[52]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[50]]/ params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[47]]);_0xfd88x15(util[_0x97ff[85]](_0x97ff[122],_0xfd88x21[_0x97ff[42]]),util[_0x97ff[85]](_0x97ff[123],_0xfd88x21[_0x97ff[42]]),params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]]);var _0xfd88x22;var _0xfd88x25=moment()[_0x97ff[85]](_0x97ff[84]);return ReportAgent[_0x97ff[107]]({where:{uniqueid:_0xfd88x21[_0x97ff[77]],destuniqueid:_0xfd88x21[_0x97ff[127]]},raw:true})[_0x97ff[41]](function(_0xfd88x26){if(_0xfd88x26){_0xfd88x22= _[_0x97ff[99]]({},_0xfd88x26,{lastevent:_0x97ff[86],agentcomplete:true,agentcompleteAt:_0xfd88x25,talktime:Number(_0xfd88x21[_0x97ff[51]]),reason:_0xfd88x21[_0x97ff[126]]});_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x26[_0x97ff[115]]),_0x97ff[116],_0xfd88x22)};return ReportQueue[_0x97ff[107]]({where:{uniqueid:_0xfd88x21[_0x97ff[77]]},raw:true})})[_0x97ff[41]](function(_0xfd88x26){if(_0xfd88x26){_0xfd88x22= _[_0x97ff[99]]({},_0xfd88x26,{queuecallercomplete:true,queuecallercompleteAt:_0xfd88x25});_0xfd88x15(_0xfd88x26[_0x97ff[42]],_0x97ff[125],_0xfd88x22)};return User[_0x97ff[107]]({where:{name:_0xfd88x21[_0x97ff[115]],voicePause:false},raw:true})})[_0x97ff[41]](function(_0xfd88x23){if(_0xfd88x23){var _0xfd88x22=_[_0x97ff[99]]({newValues:{id:_0xfd88x23[_0x97ff[97]],queueStatus:_0x97ff[86],queueStatusAt:_0xfd88x25,lastQueue:_0xfd88x21[_0x97ff[42]]}},_0xfd88x23,{queueStatus:_0x97ff[86],queueStatusAt:_0xfd88x25,lastQueue:_0xfd88x21[_0x97ff[42]]});_0xfd88x15(util[_0x97ff[85]](_0x97ff[100],_0xfd88x23[_0x97ff[101]],_0xfd88x23[_0x97ff[97]]),_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[93],_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[91],_0x97ff[102],_0xfd88x22)}})[_0x97ff[25]](function(_0xfd88x19){console[_0x97ff[96]](_0x97ff[124],_0xfd88x19)})}},agentconnect:function(_0xfd88x21){return function(_0xfd88x1a){if(_0xfd88x1a){triggers[_0x97ff[120]](_0xfd88x1a)};if(params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[45]]){params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[45]]--;_0xfd88x15(_0xfd88x21[_0x97ff[42]],_0x97ff[121],{type:_0x97ff[45],amount:-1,queue:_0xfd88x21[_0x97ff[42]]})};if(params[_0x97ff[44]][_0x97ff[28]][_0x97ff[45]]){params[_0x97ff[44]][_0x97ff[28]][_0x97ff[45]]--};if(params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]]){params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]][_0x97ff[128]]= _0xfd88x21[_0x97ff[129]];params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]][_0x97ff[130]]= _0xfd88x21[_0x97ff[130]];params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]][_0x97ff[50]]= Number(_0xfd88x21[_0x97ff[50]]);params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]][_0x97ff[131]]= Number(_0xfd88x21[_0x97ff[131]]);params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]][_0x97ff[132]]= _0xfd88x21[_0x97ff[132]];params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]][_0x97ff[115]]= _0xfd88x21[_0x97ff[115]];_0xfd88x15(_0x97ff[81],_0x97ff[82],params[_0x97ff[44]][_0x97ff[78]])};params[_0x97ff[44]][_0x97ff[28]][_0x97ff[46]]++;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[46]]++;_0xfd88x15(_0xfd88x21[_0x97ff[42]],_0x97ff[121],{type:_0x97ff[46],amount:1,queue:_0xfd88x21[_0x97ff[42]]});_0xfd88x15(util[_0x97ff[85]](_0x97ff[122],_0xfd88x21[_0x97ff[42]]),util[_0x97ff[85]](_0x97ff[123],_0xfd88x21[_0x97ff[42]]),params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]]);var _0xfd88x22;var _0xfd88x25=moment()[_0x97ff[85]](_0x97ff[84]);return ReportQueue[_0x97ff[107]]({where:{uniqueid:_0xfd88x21[_0x97ff[77]]},raw:true})[_0x97ff[41]](function(_0xfd88x26){if(_0xfd88x26){_0xfd88x22= _[_0x97ff[99]]({},_0xfd88x26,{queuecallerleaveAt:moment()[_0x97ff[85]](_0x97ff[84]),holdtime:_0xfd88x21[_0x97ff[50]],assigned:true,lastAssignedTo:_0xfd88x21[_0x97ff[115]]});_0xfd88x15(_0xfd88x26[_0x97ff[42]],_0x97ff[125],_0xfd88x22)};return ReportAgent[_0x97ff[107]]({where:{uniqueid:_0xfd88x21[_0x97ff[77]],destuniqueid:_0xfd88x21[_0x97ff[127]]},raw:true})})[_0x97ff[41]](function(_0xfd88x26){if(_0xfd88x26){_0xfd88x22= _[_0x97ff[99]]({},_0xfd88x26,{lastevent:_0x97ff[134],agentconnectAt:moment()[_0x97ff[85]](_0x97ff[84]),holdtime:_0xfd88x21[_0x97ff[50]]});_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x26[_0x97ff[115]]),_0x97ff[116],_0xfd88x22)};return ReportAgent[_0x97ff[65]]({where:{uniqueid:_0xfd88x21[_0x97ff[77]],destuniqueid:{$ne:_0xfd88x21[_0x97ff[127]]},reason:null},raw:true})})[_0x97ff[41]](function(_0xfd88x28){if(_0xfd88x28&& _0xfd88x28[_0x97ff[26]]){_[_0x97ff[69]](_0xfd88x28,function(_0xfd88x26){_0xfd88x22= _[_0x97ff[99]]({},_0xfd88x26,{lastevent:_0x97ff[135],agentringnoanswer:true,agentringnoanswerAt:_0xfd88x25,reason:_0x97ff[135],answeredelsewheredestinationuniqueid:_0xfd88x21[_0x97ff[127]],answeredelsewheremembername:_0xfd88x21[_0x97ff[115]]});_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x26[_0x97ff[115]]),_0x97ff[116],_0xfd88x22)})};return User[_0x97ff[107]]({where:{name:_0xfd88x21[_0x97ff[115]],voicePause:false},raw:true})})[_0x97ff[41]](function(_0xfd88x23){if(_0xfd88x23){var _0xfd88x22=_[_0x97ff[99]]({newValues:{id:_0xfd88x23[_0x97ff[97]],queueStatus:_0x97ff[134],queueStatusAt:_0xfd88x25,lastQueue:_0xfd88x21[_0x97ff[42]]}},_0xfd88x23,{queueStatus:_0x97ff[134],queueStatusAt:_0xfd88x25,lastQueue:_0xfd88x21[_0x97ff[42]]});_0xfd88x15(util[_0x97ff[85]](_0x97ff[100],_0xfd88x23[_0x97ff[101]],_0xfd88x23[_0x97ff[97]]),_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[93],_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[91],_0x97ff[102],_0xfd88x22)};return User[_0x97ff[65]]({where:{lastQueue:_0xfd88x21[_0x97ff[42]],name:{$ne:_0xfd88x21[_0x97ff[115]]}},raw:true})})[_0x97ff[41]](function(_0xfd88x27){if(_0xfd88x27&& _0xfd88x27[_0x97ff[26]]){_[_0x97ff[69]](_0xfd88x27,function(_0xfd88x23){var _0xfd88x22=_[_0x97ff[99]]({newValues:{id:_0xfd88x23[_0x97ff[97]],queueStatus:_0x97ff[86],queueStatusAt:_0xfd88x25}},_0xfd88x23,{queueStatus:_0x97ff[86],queueStatusAt:_0xfd88x25});_0xfd88x15(util[_0x97ff[85]](_0x97ff[100],_0xfd88x23[_0x97ff[101]],_0xfd88x23[_0x97ff[97]]),_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[93],_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[91],_0x97ff[102],_0xfd88x22)})}})[_0x97ff[25]](function(_0xfd88x19){console[_0x97ff[96]](_0x97ff[133],_0xfd88x19)})}},agentringnoanswer:function(_0xfd88x21){return function(_0xfd88x1a){if(_0xfd88x1a){triggers[_0x97ff[120]](_0xfd88x1a)};var _0xfd88x22;var _0xfd88x25=moment()[_0x97ff[85]](_0x97ff[84]);return User[_0x97ff[107]]({where:{name:_0xfd88x21[_0x97ff[115]],voicePause:false},raw:true})[_0x97ff[41]](function(_0xfd88x23){if(_0xfd88x23){var _0xfd88x22=_[_0x97ff[99]]({newValues:{id:_0xfd88x23[_0x97ff[97]],queueStatus:_0x97ff[86],queueStatusAt:_0xfd88x25,lastQueue:_0xfd88x21[_0x97ff[42]]}},_0xfd88x23,{queueStatus:_0x97ff[86],queueStatusAt:_0xfd88x25,lastQueue:_0xfd88x21[_0x97ff[42]]});_0xfd88x15(util[_0x97ff[85]](_0x97ff[100],_0xfd88x23[_0x97ff[101]],_0xfd88x23[_0x97ff[97]]),_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[93],_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[91],_0x97ff[102],_0xfd88x22)};return ReportAgent[_0x97ff[107]]({where:{uniqueid:_0xfd88x21[_0x97ff[77]],destuniqueid:_0xfd88x21[_0x97ff[127]]},raw:true})})[_0x97ff[41]](function(_0xfd88x26){if(_0xfd88x26){_0xfd88x22= _[_0x97ff[99]]({},_0xfd88x26,{lastevent:_0x97ff[137],agentringnoanswer:true,agentringnoanswerAt:moment()[_0x97ff[85]](_0x97ff[84]),reason:_0x97ff[137]});_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x26[_0x97ff[115]]),_0x97ff[116],_0xfd88x22)}})[_0x97ff[25]](function(_0xfd88x19){console[_0x97ff[96]](_0x97ff[136],_0xfd88x19)})}},queuememberadded:function(_0xfd88x21){return function(_0xfd88x1a){params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[68]][_0xfd88x21[_0x97ff[115]]]= {membername:_0xfd88x21[_0x97ff[115]],interface:_0xfd88x21[_0x97ff[138]],penalty:Number(_0xfd88x21[_0x97ff[139]]),callstaken:Number(_0xfd88x21[_0x97ff[140]]),lastcall:_0xfd88x21[_0x97ff[140]],status:Number(_0xfd88x21[_0x97ff[114]]),paused:Number(_0xfd88x21[_0x97ff[141]])};_0xfd88x15(util[_0x97ff[85]](_0x97ff[122],_0xfd88x21[_0x97ff[42]]),util[_0x97ff[85]](_0x97ff[123],_0xfd88x21[_0x97ff[42]]),params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]]);if(_0xfd88x1a){_0xfd88x15(_0xfd88x1a[_0x97ff[42]],_0x97ff[142],_0xfd88x1a);_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x1a.UserId),_0x97ff[142],_0xfd88x1a)};return BPromise[_0x97ff[76]]()}},queuememberremoved:function(_0xfd88x21){return function(_0xfd88x1a){delete params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[68]][_0xfd88x21[_0x97ff[115]]];_0xfd88x15(util[_0x97ff[85]](_0x97ff[122],_0xfd88x21[_0x97ff[42]]),util[_0x97ff[85]](_0x97ff[123],_0xfd88x21[_0x97ff[42]]),params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]]);return User[_0x97ff[107]]({where:{name:_0xfd88x21[_0x97ff[132]][_0x97ff[105]](_0x97ff[103],_0x97ff[104])},raw:true})[_0x97ff[41]](function(_0xfd88x23){if(_0xfd88x23){_0xfd88x15(_0xfd88x21[_0x97ff[42]],_0x97ff[144],{queue:_0xfd88x21[_0x97ff[42]],UserId:_0xfd88x23[_0x97ff[97]]});_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x23[_0x97ff[97]]),_0x97ff[144],{queue:_0xfd88x21[_0x97ff[42]],UserId:_0xfd88x23[_0x97ff[97]]})}})[_0x97ff[25]](function(_0xfd88x19){console[_0x97ff[24]](_0x97ff[143],_0xfd88x19)})}},queuememberpause:function(_0xfd88x21){return function(_0xfd88x1a){if(_0xfd88x1a){_0xfd88x15(_0xfd88x1a[_0x97ff[42]],_0x97ff[142],_0xfd88x1a);_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x1a.UserId),_0x97ff[142],_0xfd88x1a)};var _0xfd88x22;var _0xfd88x25=moment()[_0x97ff[85]](_0x97ff[84]);return User[_0x97ff[107]]({where:{name:_0xfd88x21[_0x97ff[115]]},raw:true})[_0x97ff[41]](function(_0xfd88x23){if(_0xfd88x23){var _0xfd88x29={id:_0xfd88x23[_0x97ff[97]],voicePause:false,queueStatusAt:_0xfd88x25};if(parseInt(_0xfd88x21[_0x97ff[141]],10)){_[_0x97ff[146]](_0xfd88x29,{voicePause:true,chatPause:true,mailPause:true,faxPause:true,smsPause:true,openchannelPause:true,pauseType:_0xfd88x21[_0x97ff[126]],lastPauseAt:_0xfd88x25,queueStatus:_0x97ff[141]})}else {switch(_0xfd88x23[_0x97ff[114]]){case _0x97ff[148]:_0xfd88x29[_0x97ff[147]]= _0x97ff[134];break;case _0x97ff[149]:_0xfd88x29[_0x97ff[147]]= _0x97ff[119];break;default:_0xfd88x29[_0x97ff[147]]= _0x97ff[86]}};var _0xfd88x22=_[_0x97ff[99]]({newValues:_0xfd88x29},_0xfd88x23,_0xfd88x29);_0xfd88x15(util[_0x97ff[85]](_0x97ff[100],_0xfd88x23[_0x97ff[101]],_0xfd88x23[_0x97ff[97]]),_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[93],_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[91],_0x97ff[102],_0xfd88x22)}})[_0x97ff[25]](function(_0xfd88x19){console[_0x97ff[96]](_0x97ff[145],_0xfd88x19)})}},queuememberpenalty:function(_0xfd88x21){return function(_0xfd88x1a){if(_0xfd88x1a){_0xfd88x15(_0xfd88x1a[_0x97ff[42]],_0x97ff[142],_0xfd88x1a);_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x1a.UserId),_0x97ff[142],_0xfd88x1a)};return BPromise[_0x97ff[76]]()}},queuememberringinuse:function(_0xfd88x21){return function(_0xfd88x1a){if(_0xfd88x1a){_0xfd88x15(_0xfd88x1a[_0x97ff[42]],_0x97ff[142],_0xfd88x1a);_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x1a.UserId),_0x97ff[142],_0xfd88x1a)};return BPromise[_0x97ff[76]]()}},queuememberstatus:function(_0xfd88x21){return function(_0xfd88x1a){if(_0xfd88x1a){_0xfd88x15(_0xfd88x1a[_0x97ff[42]],_0x97ff[142],_0xfd88x1a);_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x1a.UserId),_0x97ff[142],_0xfd88x1a)};return BPromise[_0x97ff[76]]()}},queuemember:function(_0xfd88x21){return function(_0xfd88x1a){params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[68]][_0xfd88x21[_0x97ff[66]]]= {membername:_0xfd88x21[_0x97ff[66]],interface:_0xfd88x21[_0x97ff[138]],penalty:Number(_0xfd88x21[_0x97ff[139]]),callstaken:Number(_0xfd88x21[_0x97ff[140]]),lastcall:_0xfd88x21[_0x97ff[140]],status:Number(_0xfd88x21[_0x97ff[114]]),paused:Number(_0xfd88x21[_0x97ff[141]])};return BPromise[_0x97ff[76]]()}},queuecallerjoin:function(_0xfd88x21){if(!params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]]){params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]]= {};params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[45]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[46]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[47]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[48]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[49]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[50]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[51]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[52]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[53]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[40]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[54]]= 0;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[27]]= 0};params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]]= {channel:_0xfd88x21[_0x97ff[89]],channelstate:Number(_0xfd88x21[_0x97ff[150]]),channelstatedesc:_0xfd88x21[_0x97ff[151]],calleridnum:_0xfd88x21[_0x97ff[152]],calleridname:_0xfd88x21[_0x97ff[153]],exten:_0xfd88x21[_0x97ff[154]],priority:Number(_0xfd88x21[_0x97ff[155]]),uniqueid:_0xfd88x21[_0x97ff[77]],queue:_0xfd88x21[_0x97ff[42]],position:Number(_0xfd88x21[_0x97ff[156]]),count:Number(_0xfd88x21[_0x97ff[157]])};_0xfd88x15(_0x97ff[81],_0x97ff[82],params[_0x97ff[44]][_0x97ff[78]]);params[_0x97ff[44]][_0x97ff[28]][_0x97ff[45]]++;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[45]]++;_0xfd88x15(_0xfd88x21[_0x97ff[42]],_0x97ff[121],{type:_0x97ff[27],amount:1,queue:_0xfd88x21[_0x97ff[42]]});params[_0x97ff[44]][_0x97ff[28]][_0x97ff[27]]++;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[27]]++;_0xfd88x15(_0xfd88x21[_0x97ff[42]],_0x97ff[121],{type:_0x97ff[45],amount:1,queue:_0xfd88x21[_0x97ff[42]]});_0xfd88x15(util[_0x97ff[85]](_0x97ff[122],_0xfd88x21[_0x97ff[42]]),util[_0x97ff[85]](_0x97ff[123],_0xfd88x21[_0x97ff[42]]),params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]]);return function(_0xfd88x1a){if(_0xfd88x1a){_0xfd88x15(_0xfd88x1a[_0x97ff[42]],_0x97ff[158],_0xfd88x1a)};return BPromise[_0x97ff[76]]()}},queuecallerabandon:function(_0xfd88x21){return function(_0xfd88x1a){if(_0xfd88x1a&& _0xfd88x1a[0]){_[_0x97ff[69]](_0xfd88x1a[1],function(_0xfd88x26){triggers[_0x97ff[120]](_0xfd88x26);_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x26[_0x97ff[115]]),_0x97ff[116],_0xfd88x26)})};var _0xfd88x22;var _0xfd88x25=moment()[_0x97ff[85]](_0x97ff[84]);return ReportQueue[_0x97ff[107]]({where:{uniqueid:_0xfd88x21[_0x97ff[77]],queuecallerexit:false},raw:true})[_0x97ff[41]](function(_0xfd88x26){if(_0xfd88x26){if(params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[45]]){params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[45]]--;_0xfd88x15(_0xfd88x21[_0x97ff[42]],_0x97ff[121],{type:_0x97ff[45],amount:-1,queue:_0xfd88x21[_0x97ff[42]]})};if(params[_0x97ff[44]][_0x97ff[28]][_0x97ff[45]]){params[_0x97ff[44]][_0x97ff[28]][_0x97ff[45]]--};if(params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]]){params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]][_0x97ff[50]]= Number(_0xfd88x21[_0x97ff[50]]);params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]][_0x97ff[156]]= Number(_0xfd88x21[_0x97ff[156]]);params[_0x97ff[44]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]][_0x97ff[160]]= Number(_0xfd88x21[_0x97ff[160]]);_0xfd88x15(_0x97ff[81],_0x97ff[82],params[_0x97ff[44]][_0x97ff[78]])};params[_0x97ff[44]][_0x97ff[28]][_0x97ff[48]]++;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[48]]++;_0xfd88x15(_0xfd88x21[_0x97ff[42]],_0x97ff[121],{type:_0x97ff[161],amount:1,queue:_0xfd88x21[_0x97ff[42]]});params[_0x97ff[44]][_0x97ff[28]][_0x97ff[40]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[28]][_0x97ff[47]]/ (params[_0x97ff[44]][_0x97ff[28]][_0x97ff[47]]+ params[_0x97ff[44]][_0x97ff[28]][_0x97ff[48]])* 100,2);params[_0x97ff[44]][_0x97ff[28]][_0x97ff[54]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[28]][_0x97ff[48]]/ (params[_0x97ff[44]][_0x97ff[28]][_0x97ff[47]]+ params[_0x97ff[44]][_0x97ff[28]][_0x97ff[48]])* 100,2);params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[40]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[47]]/ (params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[47]]+ params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[48]])* 100,2);params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[54]]= _[_0x97ff[39]](params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[48]]/ (params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[47]]+ params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]][_0x97ff[48]])* 100,2);_0xfd88x15(util[_0x97ff[85]](_0x97ff[122],_0xfd88x21[_0x97ff[42]]),util[_0x97ff[85]](_0x97ff[123],_0xfd88x21[_0x97ff[42]]),params[_0x97ff[44]][_0x97ff[43]][_0xfd88x21[_0x97ff[42]]]);_0xfd88x15(_0xfd88x26[_0x97ff[42]],_0x97ff[125],_[_0x97ff[146]](_0xfd88x26,{queuecallerabandon:true,queuecallerabandonAt:_0xfd88x25,queuecallerleaveAt:_0xfd88x25,originalposition:_0xfd88x21[_0x97ff[160]],position:_0xfd88x21[_0x97ff[156]],holdtime:_0xfd88x21[_0x97ff[50]]}))};return User[_0x97ff[65]]({where:{lastQueue:_0xfd88x21[_0x97ff[42]],voicePause:false},raw:true})})[_0x97ff[41]](function(_0xfd88x2a){if(_0xfd88x2a&& _0xfd88x2a[_0x97ff[26]]){var _0xfd88x22;_[_0x97ff[69]](_0xfd88x2a,function(_0xfd88x2b){_0xfd88x22= _[_0x97ff[99]]({newValues:{id:_0xfd88x2b[_0x97ff[97]],queueStatus:_0x97ff[86],queueStatusAt:_0xfd88x25,lastQueue:_0xfd88x21[_0x97ff[42]]}},_0xfd88x2b,{id:_0xfd88x2b[_0x97ff[97]],queueStatus:_0x97ff[86],queueStatusAt:_0xfd88x25,lastQueue:_0xfd88x21[_0x97ff[42]]});_0xfd88x15(util[_0x97ff[85]](_0x97ff[100],_0xfd88x2b[_0x97ff[101]],_0xfd88x2b[_0x97ff[97]]),_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[93],_0x97ff[102],_0xfd88x22);_0xfd88x15(_0x97ff[91],_0x97ff[102],_0xfd88x22)})}})[_0x97ff[25]](function(_0xfd88x19){console[_0x97ff[96]](_0x97ff[159],_0xfd88x19)})}},blindtransfer:function(_0xfd88x21){return function(_0xfd88x1a){_0xfd88x15(null,_0xfd88x21[_0x97ff[163]][_0x97ff[162]](),_0xfd88x21);return BPromise[_0x97ff[76]]()}},attendedtransfer:function(_0xfd88x21){return function(_0xfd88x1a){_0xfd88x15(null,_0xfd88x21[_0x97ff[163]][_0x97ff[162]](),_0xfd88x21);return BPromise[_0x97ff[76]]()}},dialbegin:function(_0xfd88x21){return function(_0xfd88x1a){params[_0x97ff[29]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]]= {channel:_0xfd88x21[_0x97ff[89]],channelstate:Number(_0xfd88x21[_0x97ff[150]]),channelstatedesc:_0xfd88x21[_0x97ff[151]],calleridnum:_0xfd88x21[_0x97ff[152]],calleridname:_0xfd88x21[_0x97ff[153]],context:_0xfd88x21[_0x97ff[164]],exten:_0xfd88x21[_0x97ff[154]],priority:Number(_0xfd88x21[_0x97ff[155]]),dialstring:_0xfd88x21[_0x97ff[165]]};_0xfd88x15(_0x97ff[79],_0x97ff[80],params[_0x97ff[29]][_0x97ff[78]]);if(_0xfd88x21[_0x97ff[89]]){var _0xfd88x22=_[_0x97ff[146]](_0xfd88x21,{starttime:moment()[_0x97ff[85]](_0x97ff[84]),lastevent:_0x97ff[119],updatedAt:moment()[_0x97ff[85]](_0x97ff[84])});_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x21[_0x97ff[89]][_0x97ff[88]](/\/|-/)[1]),_0x97ff[90],_0xfd88x22);_0xfd88x15(_0x97ff[93],_0x97ff[92],_[_0x97ff[146]](_0xfd88x22,{role:_0x97ff[93]}));_0xfd88x15(_0x97ff[91],_0x97ff[92],_0xfd88x22,_[_0x97ff[146]](_0xfd88x22,{role:_0x97ff[91]}));if(_0xfd88x1a){triggers[_0x97ff[94]](_0xfd88x1a)}};return BPromise[_0x97ff[76]]()}},dialend:function(_0xfd88x21){return function(_0xfd88x1a){if(params[_0x97ff[29]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]]){params[_0x97ff[29]][_0x97ff[78]][_0xfd88x21[_0x97ff[77]]][_0x97ff[166]]= _0xfd88x21[_0x97ff[166]]};_0xfd88x15(_0x97ff[79],_0x97ff[80],params[_0x97ff[29]][_0x97ff[78]]);if(_0xfd88x21[_0x97ff[89]]){var _0xfd88x25=moment()[_0x97ff[85]](_0x97ff[84]);var _0xfd88x22={dialstatus:_0xfd88x21[_0x97ff[166]],lastevent:(_0xfd88x21[_0x97ff[166]]=== _0x97ff[167])?_0x97ff[134]:_0x97ff[86],answertime:(_0xfd88x21[_0x97ff[166]]=== _0x97ff[167])?_0xfd88x25:null,uniqueid:_0xfd88x21[_0x97ff[77]],linkedid:_0xfd88x21[_0x97ff[83]],destuniqueid:_0xfd88x21[_0x97ff[127]],destlinkedid:_0xfd88x21[_0x97ff[168]],updatedAt:_0xfd88x25};_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x21[_0x97ff[89]][_0x97ff[88]](/\/|-/)[1]),_0x97ff[92],_0xfd88x22);_0xfd88x15(_0x97ff[93],_0x97ff[92],_0xfd88x22);_0xfd88x15(_0x97ff[91],_0x97ff[92],_0xfd88x22);if(_0xfd88x1a){triggers[_0x97ff[94]](_0xfd88x1a)}};return BPromise[_0x97ff[76]]()}},varset:function(_0xfd88x21){return function(_0xfd88x1a){if(_0xfd88x21[_0x97ff[171]][_0x97ff[170]](_0x97ff[169])){if(_0xfd88x1a){params[_0x97ff[44]][_0x97ff[28]][_0x97ff[49]]+= 1;params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1a[_0x97ff[42]]][_0x97ff[49]]+= 1;_0xfd88x15(_0xfd88x1a[_0x97ff[42]],_0x97ff[121],{type:_0x97ff[49],amount:1,queue:_0xfd88x1a[_0x97ff[42]]});if(params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1a[_0x97ff[42]]][_0x97ff[45]]){params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1a[_0x97ff[42]]][_0x97ff[45]]-= 1};if(params[_0x97ff[44]][_0x97ff[28]][_0x97ff[45]]){params[_0x97ff[44]][_0x97ff[28]][_0x97ff[45]]-= 1};_0xfd88x15(_0xfd88x1a[_0x97ff[42]],_0x97ff[121],{type:_0x97ff[45],amount:-1,queue:_0xfd88x1a[_0x97ff[42]]});_0xfd88x15(_0xfd88x1a[_0x97ff[42]],_0x97ff[125],_0xfd88x1a);_0xfd88x15(util[_0x97ff[85]](_0x97ff[122],_0xfd88x1a[_0x97ff[42]]),util[_0x97ff[85]](_0x97ff[123],_0xfd88x1a[_0x97ff[42]]),params[_0x97ff[44]][_0x97ff[43]][_0xfd88x1a[_0x97ff[42]]])}};if(_0xfd88x21[_0x97ff[171]][_0x97ff[170]](_0x97ff[172])){_0xfd88x15(_0x97ff[93],_0x97ff[90],{uniqueid:_0xfd88x21[_0x97ff[77]],routeId:_0xfd88x21[_0x97ff[173]],updatedAt:moment()[_0x97ff[85]](_0x97ff[84])});_0xfd88x15(_0x97ff[91],_0x97ff[90],{uniqueid:_0xfd88x21[_0x97ff[77]],routeId:_0xfd88x21[_0x97ff[173]],updatedAt:moment()[_0x97ff[85]](_0x97ff[84])})};if(_0xfd88x21){triggers[_0x97ff[174]](_0xfd88x21)};return BPromise[_0x97ff[76]]()}},agentUpdate:function(_0xfd88x2b){return function(){_0xfd88x15(util[_0x97ff[85]](_0x97ff[87],_0xfd88x2b[_0x97ff[97]]),_0x97ff[102],_0xfd88x2b);_0xfd88x15(_0x97ff[93],_0x97ff[102],_0xfd88x2b);_0xfd88x15(_0x97ff[91],_0x97ff[102],_0xfd88x2b)}},console:function(_0xfd88x2c){_0xfd88x15(_0xfd88x2c[_0x97ff[175]],util[_0x97ff[85]](_0x97ff[176],_0xfd88x2c[_0x97ff[64]]),_0xfd88x2c[_0x97ff[177]])}}}
\ 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