1 var _0xe7c4=["\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","\x67\x6C\x6F\x62\x61\x6C","\x69\x6E\x62\x6F\x75\x6E\x64\x20\x69\x6E\x69\x74\x20\x65\x72\x72\x6F\x72\x3A","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x71\x75\x65\x75\x65","\x74\x6F\x74\x61\x6C","\x69\x73\x57\x61\x69\x74\x69\x6E\x67","\x77\x61\x69\x74\x69\x6E\x67","\x69\x73\x41\x63\x74\x69\x76\x65","\x61\x63\x74\x69\x76\x65","\x69\x73\x43\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x63\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x68\x6F\x6C\x64\x74\x69\x6D\x65","\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6C\x65\x61\x76\x65\x41\x74","\x73\x65\x63\x6F\x6E\x64\x73","\x64\x69\x66\x66","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x41\x74","\x61\x76\x67\x48\x6F\x6C\x64\x74\x69\x6D\x65","\x72\x6F\x75\x6E\x64","\x61\x76\x67\x54\x61\x6C\x6B\x74\x69\x6D\x65","\x69\x73\x41\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x69\x73\x55\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x61\x6E\x73\x77\x65\x72\x52\x61\x74\x65","\x61\x62\x61\x6E\x64\x6F\x6E\x52\x61\x74\x65","\x74\x68\x65\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x65\x78\x69\x74","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x20\x69\x6E\x69\x74\x20\x65\x72\x72\x6F\x72\x3A","\x66\x69\x6C\x74\x65\x72","\x74\x69\x67\x65\x72\x64\x69\x61\x6C","\x61\x6E\x73\x77\x65\x72\x65\x64","\x41\x4E\x53\x57\x45\x52\x45\x44","\x64\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x63\x6F\x75\x6E\x74\x42\x79","\x73\x75\x6D\x44\x75\x72\x61\x74\x69\x6F\x6E","\x62\x69\x6C\x6C\x61\x62\x6C\x65\x73\x65\x63\x6F\x6E\x64\x73","\x73\x75\x6D\x42\x79","\x61\x76\x67\x44\x75\x72\x61\x74\x69\x6F\x6E","\x72\x65\x73\x75\x6C\x74","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x74\x79\x70\x65","\x72\x65\x73\x6F\x6C\x76\x65","\x61\x67\x65\x6E\x74\x73","\x72\x65\x70\x6F\x72\x74\x5F\x63\x61\x6C\x6C\x3A\x73\x61\x76\x65","\x76\x6F\x69\x63\x65\x2F\x6F\x75\x74\x62\x6F\x75\x6E\x64\x2F\x67\x6C\x6F\x62\x61\x6C","\x76\x6F\x69\x63\x65\x3A\x6F\x75\x74\x62\x6F\x75\x6E\x64\x3A\x67\x6C\x6F\x62\x61\x6C","\x75\x6E\x69\x71\x75\x65\x69\x64","\x63\x68\x61\x6E\x6E\x65\x6C\x73","\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x61\x67\x65\x6E\x74\x3A\x25\x73","\x73\x70\x6C\x69\x74","\x63\x68\x61\x6E\x6E\x65\x6C","\x72\x65\x70\x6F\x72\x74\x5F\x64\x69\x61\x6C\x3A\x75\x70\x64\x61\x74\x65","\x61\x64\x6D\x69\x6E\x73","\x75\x73\x65\x72\x73","\x72\x65\x70\x6F\x72\x74\x44\x69\x61\x6C","\x64\x65\x76\x69\x63\x65\x73\x74\x61\x74\x65\x63\x68\x61\x6E\x67\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\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","\x69\x64\x20\x44\x45\x53\x43","\x64\x65\x73\x74\x75\x6E\x69\x71\x75\x65\x69\x64","\x63\x6F\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x75\x6D","\x63\x6F\x6E\x6E\x65\x63\x74\x65\x64\x6C\x69\x6E\x65\x6E\x61\x6D\x65","\x72\x69\x6E\x67\x74\x69\x6D\x65","\x61\x67\x65\x6E\x74\x63\x6F\x6E\x6E\x65\x63\x74\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x63\x6F\x6E\x6E\x65\x63\x74","\x61\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","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65\x64\x65\x73\x63","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x65\x78\x74\x65\x6E","\x70\x72\x69\x6F\x72\x69\x74\x79","\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x63\x6F\x75\x6E\x74","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x72\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74","\x72\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x6C\x61\x73\x74\x65\x76\x65\x6E\x74","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x5F\x63\x68\x61\x6E\x67\x65\x64","\x6F\x72\x69\x67\x69\x6E\x61\x6C\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x61\x62\x61\x6E\x64\x6F\x6E","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6A\x6F\x69\x6E\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x63\x6F\x6E\x74\x65\x78\x74","\x64\x69\x61\x6C\x73\x74\x72\x69\x6E\x67","\x72\x65\x70\x6F\x72\x74\x5F\x64\x69\x61\x6C\x3A\x73\x61\x76\x65","\x64\x69\x61\x6C\x73\x74\x61\x74\x75\x73","\x64\x65\x73\x74\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x72\x6F\x75\x74\x65\x69\x64","\x76\x61\x72\x69\x61\x62\x6C\x65","\x76\x61\x6C\x75\x65","\x76\x61\x72\x53\x65\x74","\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","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x72\x65\x70\x6F\x72\x74\x5F\x66\x61\x78\x3A\x75\x70\x64\x61\x74\x65"];_0xe7c4[0];var _=require(_0xe7c4[1]);var util=require(_0xe7c4[2]);var moment=require(_0xe7c4[3]);var BPromise=require(_0xe7c4[4]);var redis=require(_0xe7c4[5]);var VoiceQueue=require(_0xe7c4[7])[_0xe7c4[6]];var ReportQueue=require(_0xe7c4[7])[_0xe7c4[8]];var ReportCall=require(_0xe7c4[7])[_0xe7c4[9]];var ReportAgent=require(_0xe7c4[7])[_0xe7c4[10]];var ReportDial=require(_0xe7c4[7])[_0xe7c4[11]];var ReportMember=require(_0xe7c4[7])[_0xe7c4[12]];var User=require(_0xe7c4[7])[_0xe7c4[13]];var Triggers=require(_0xe7c4[14]);var config=require(_0xe7c4[15]);var utils=require(_0xe7c4[16]);var redisConf;if(config[_0xe7c4[17]]){redisConf= {password:config[_0xe7c4[17]]}};var redisClient=redis[_0xe7c4[19]](6379,config[_0xe7c4[18]],redisConf);var io=require(_0xe7c4[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,tigerdial:0},channels:[]}};module[_0xe7c4[21]]= function(){var _0xaa3dx15=function(_0xaa3dx16,_0xaa3dx17,_0xaa3dx18){if(_0xaa3dx16){io[_0xe7c4[23]](_0xaa3dx16)[_0xe7c4[22]](_0xaa3dx17,_0xaa3dx18)}else {io[_0xe7c4[22]](_0xaa3dx17,_0xaa3dx18)}};var _0xaa3dx19=function(_0xaa3dx1a){delete _0xaa3dx1a[_0xe7c4[24]];delete _0xaa3dx1a[_0xe7c4[25]];delete _0xaa3dx1a[_0xe7c4[26]];delete _0xaa3dx1a[_0xe7c4[27]];_0xaa3dx1a[_0xe7c4[28]]= _0xaa3dx1a[_0xe7c4[29]]|| _0xaa3dx1a[_0xe7c4[28]];_0xaa3dx1a[_0xe7c4[30]]= _0xaa3dx1a[_0xe7c4[31]];_0xaa3dx1a[_0xe7c4[32]]= _0xe7c4[33];switch(_0xaa3dx1a[_0xe7c4[51]]){case _0xe7c4[34]:_0xaa3dx1a[_0xe7c4[32]]= _0xe7c4[33];break;case _0xe7c4[36]:_0xaa3dx1a[_0xe7c4[32]]= _0xe7c4[35];break;case _0xe7c4[38]:_0xaa3dx1a[_0xe7c4[32]]= _0xe7c4[37];break;case _0xe7c4[40]:_0xaa3dx1a[_0xe7c4[32]]= _0xe7c4[39];break;case _0xe7c4[42]:_0xaa3dx1a[_0xe7c4[32]]= _0xe7c4[41];break;case _0xe7c4[44]:_0xaa3dx1a[_0xe7c4[32]]= _0xe7c4[43];break;case _0xe7c4[46]:_0xaa3dx1a[_0xe7c4[32]]= _0xe7c4[45];break;case _0xe7c4[48]:_0xaa3dx1a[_0xe7c4[32]]= _0xe7c4[47];break;case _0xe7c4[50]:_0xaa3dx1a[_0xe7c4[32]]= _0xe7c4[49];break;default:};_0xaa3dx1a[_0xe7c4[51]]= Number(_0xaa3dx1a[_0xe7c4[51]]);if(_0xaa3dx1a[_0xe7c4[53]](_0xe7c4[52])){_0xaa3dx1a[_0xe7c4[52]]= Number(_0xaa3dx1a[_0xe7c4[52]])};if(_0xaa3dx1a[_0xe7c4[53]](_0xe7c4[54])){_0xaa3dx1a[_0xe7c4[54]]= Number(_0xaa3dx1a[_0xe7c4[54]])};if(_0xaa3dx1a[_0xe7c4[53]](_0xe7c4[55])){if(_0xaa3dx1a[_0xe7c4[55]]=== _0xe7c4[34]){_0xaa3dx1a[_0xe7c4[55]]= null}else {_0xaa3dx1a[_0xe7c4[55]]= moment()[_0xe7c4[57]](_0xe7c4[56])}};_0xaa3dx1a[_0xe7c4[58]]= parseInt(_0xaa3dx1a[_0xe7c4[58]],10)?true:false};function _0xaa3dx1b(_0xaa3dx1c){if(!params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1c]){params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1c]= {agents:{},waiting:0,active:0,completed:0,abandoned:0,unmanaged:0,holdtime:0,talktime:0,avgHoldtime:0,avgTalktime:0,answerRate:0,abandonRate:0,total:0}}}function _0xaa3dx1d(){return function(){params[_0xe7c4[60]][_0xe7c4[59]]= {};params[_0xe7c4[60]][_0xe7c4[61]]= {waiting:0,active:0,completed:0,abandoned:0,unmanaged:0,holdtime:0,talktime:0,avgHoldtime:0,avgTalktime:0,answerRate:0,abandonRate:0,total:0};return VoiceQueue[_0xe7c4[95]]({attributes:[_0xe7c4[29]],raw:true})[_0xe7c4[90]](function(_0xaa3dx1f){if(_0xaa3dx1f){_[_0xe7c4[91]](_0xaa3dx1f,function(_0xaa3dx1c){_0xaa3dx1b(_0xaa3dx1c[_0xe7c4[29]])});return ReportQueue[_0xe7c4[95]]({attributes:[_0xe7c4[67],_0xe7c4[77],_0xe7c4[80],_0xe7c4[92],_0xe7c4[93],_0xe7c4[94],_0xe7c4[75]],raw:true})}})[_0xe7c4[90]](function(_0xaa3dx1f){if(_0xaa3dx1f){var _0xaa3dx20;var _0xaa3dx21;var _0xaa3dx22=_0xaa3dx1f[_0xe7c4[66]];for(var _0xaa3dx23=0;_0xaa3dx23< _0xaa3dx22;_0xaa3dx23++){_0xaa3dx20= _0xaa3dx1f[_0xaa3dx23];_0xaa3dx21= _0xaa3dx20[_0xe7c4[67]];_0xaa3dx1b(_0xaa3dx21);params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[68]]++;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[68]]++;if(utils[_0xe7c4[69]](_0xaa3dx20)){params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[70]]++;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[70]]++};if(utils[_0xe7c4[71]](_0xaa3dx20)){params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[72]]++;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[72]]++};if(utils[_0xe7c4[73]](_0xaa3dx20)){params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[74]]++;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[74]]++;params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[75]]+= _0xaa3dx20[_0xe7c4[75]]|| 0;params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[76]]+= moment(_0xaa3dx20[_0xe7c4[80]])[_0xe7c4[79]](moment(_0xaa3dx20[_0xe7c4[77]]),_0xe7c4[78]);params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[81]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[75]]/ params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[74]]);params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[83]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[76]]/ params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[74]]);params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[75]]+= _0xaa3dx20[_0xe7c4[75]]|| 0;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[76]]+= moment(_0xaa3dx20[_0xe7c4[80]])[_0xe7c4[79]](moment(_0xaa3dx20[_0xe7c4[77]]),_0xe7c4[78]);params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[81]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[75]]/ params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[74]]);params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[83]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[76]]/ params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[74]])};if(utils[_0xe7c4[84]](_0xaa3dx20)){params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[85]]++;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[85]]++};if(utils[_0xe7c4[86]](_0xaa3dx20)){params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[87]]++;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[87]]++};params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[88]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[74]]/ (params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[74]]+ params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[85]])* 100,2);params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[89]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[85]]/ (params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[74]]+ params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx21][_0xe7c4[85]])* 100,2);params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[88]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[74]]/ (params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[74]]+ params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[85]])* 100,2);params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[89]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[85]]/ (params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[74]]+ params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[85]])* 100,2)}}})[_0xe7c4[65]](function(_0xaa3dx1e){console[_0xe7c4[64]](_0xe7c4[62],_0xaa3dx1e[_0xe7c4[63]])})}}function _0xaa3dx24(){return function(){params[_0xe7c4[96]][_0xe7c4[61]]= {total:0,answered:0,sumDuration:0,avgDuration:0,tigerdial:0};return ReportCall[_0xe7c4[95]]({where:{type:[_0xe7c4[96],_0xe7c4[99]],createdAt:{$gte:moment()[_0xe7c4[110]](_0xe7c4[109])}},attributes:[_0xe7c4[111],_0xe7c4[102],_0xe7c4[105]],raw:true})[_0xe7c4[90]](function(_0xaa3dx1f){if(_0xaa3dx1f){var _0xaa3dx25=_[_0xe7c4[98]](_0xaa3dx1f,{type:_0xe7c4[96]});var _0xaa3dx26=_[_0xe7c4[98]](_0xaa3dx1f,{type:_0xe7c4[99]});if(_0xaa3dx25[_0xe7c4[66]]){params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[68]]= _0xaa3dx25[_0xe7c4[66]];params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[100]]= _[_0xe7c4[103]](_0xaa3dx25,_0xe7c4[102])[_0xe7c4[101]]|| 0;params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[104]]= _[_0xe7c4[106]](_0xaa3dx25,_0xe7c4[105]);if(params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[100]]){params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[107]]= _[_0xe7c4[82]]((_[_0xe7c4[106]](_0xaa3dx25[_0xe7c4[108]],_0xe7c4[105])/ params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[100]]));params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[88]]= _[_0xe7c4[82]](params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[100]]/ params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[68]]* 100,1)}};if(_0xaa3dx26[_0xe7c4[66]]){params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[99]]= _0xaa3dx26[_0xe7c4[66]]}}})[_0xe7c4[65]](function(_0xaa3dx1e){console[_0xe7c4[64]](_0xe7c4[97],_0xaa3dx1e[_0xe7c4[63]])})}}BPromise[_0xe7c4[112]]()[_0xe7c4[90]](_0xaa3dx1d())[_0xe7c4[90]](_0xaa3dx24());return {cdr:function(_0xaa3dx1a){return function(_0xaa3dx1f){_0xaa3dx15(_0xe7c4[113],_0xe7c4[114],_0xaa3dx1a);if(_0xaa3dx1a[_0xe7c4[111]]== _0xe7c4[96]|| _0xaa3dx1a[_0xe7c4[111]]== _0xe7c4[99]){if(_0xaa3dx1a[_0xe7c4[111]]== _0xe7c4[96]){params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[68]]++;_0xaa3dx1a[_0xe7c4[102]]== _0xe7c4[101]&& (params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[100]]++);params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[104]]+= Number(_0xaa3dx1a[_0xe7c4[105]]);if(params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[100]]){params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[107]]= _[_0xe7c4[82]](params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[104]]/ params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[100]]);params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[88]]= _[_0xe7c4[82]](params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[100]]/ params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[68]]* 100,1)}}else {params[_0xe7c4[96]][_0xe7c4[61]][_0xe7c4[99]]++};_0xaa3dx15(_0xe7c4[115],_0xe7c4[116],params[_0xe7c4[96]][_0xe7c4[61]])}}},send:function(_0xaa3dx1a){return function(_0xaa3dx1f){return BPromise[_0xe7c4[112]]()}},hangup:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(params[_0xe7c4[96]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]]){delete params[_0xe7c4[96]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]]};if(params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]]){delete params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]]};var _0xaa3dx27={uniqueid:_0xaa3dx1a[_0xe7c4[117]],linkedid:_0xaa3dx1a[_0xe7c4[119]],endtime:moment()[_0xe7c4[57]](_0xe7c4[56]),lastevent:_0xe7c4[120],updatedAt:moment()[_0xe7c4[57]](_0xe7c4[56])};_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx1a[_0xe7c4[123]][_0xe7c4[122]](/\/|-/)[1]),_0xe7c4[124],_0xaa3dx27);_0xaa3dx15(_0xe7c4[125],_0xe7c4[124],_0xaa3dx27);_0xaa3dx15(_0xe7c4[126],_0xe7c4[124],_0xaa3dx27);if(_0xaa3dx1f){triggers[_0xe7c4[127]](_0xaa3dx1f)};return BPromise[_0xe7c4[112]]()}},devicestatechange:function(_0xaa3dx1a){return function(_0xaa3dx1f){return User[_0xe7c4[140]]({where:{name:_0xaa3dx1a[_0xe7c4[139]][_0xe7c4[138]](_0xe7c4[136],_0xe7c4[137])},raw:true})[_0xe7c4[90]](function(_0xaa3dx28){if(_0xaa3dx28){var _0xaa3dx27=_[_0xe7c4[132]]({newValues:{id:_0xaa3dx28[_0xe7c4[130]],status:_0xaa3dx1a[_0xe7c4[131]],statusAt:moment()[_0xe7c4[57]](_0xe7c4[56])}},_0xaa3dx28,{status:_0xaa3dx1a[_0xe7c4[131]],statusAt:moment()[_0xe7c4[57]](_0xe7c4[56])});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[133],_0xaa3dx28[_0xe7c4[134]],_0xaa3dx28[_0xe7c4[130]]),_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[126],_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[125],_0xe7c4[135],_0xaa3dx27)}})[_0xe7c4[65]](function(_0xaa3dx1e){console[_0xe7c4[129]](_0xe7c4[128],_0xaa3dx1e)})}},peerstatus:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(_0xaa3dx1f&& _0xaa3dx1f[0]){_[_0xe7c4[91]](_0xaa3dx1f[1],function(_0xaa3dx29){if(!params[_0xe7c4[141]][_0xaa3dx29[_0xe7c4[29]]]){params[_0xe7c4[141]][_0xaa3dx29[_0xe7c4[29]]]= {name:_0xaa3dx29[_0xe7c4[29]]}};params[_0xe7c4[141]][_0xaa3dx29[_0xe7c4[29]]][_0xe7c4[142]]= _0xaa3dx1a[_0xe7c4[142]];_0xaa3dx15(_0xe7c4[143],_0xe7c4[144],params[_0xe7c4[141]][_0xaa3dx29[_0xe7c4[29]]])})};return BPromise[_0xe7c4[112]]()}},registry:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(_0xaa3dx1f&& _0xaa3dx1f[0]){_[_0xe7c4[91]](_0xaa3dx1f[1],function(_0xaa3dx29){if(!params[_0xe7c4[141]][_0xaa3dx29[_0xe7c4[29]]]){params[_0xe7c4[141]][_0xaa3dx29[_0xe7c4[29]]]= {name:_0xaa3dx29[_0xe7c4[29]]}};params[_0xe7c4[141]][_0xaa3dx29[_0xe7c4[29]]][_0xe7c4[51]]= _0xaa3dx1a[_0xe7c4[51]];_0xaa3dx15(_0xe7c4[143],_0xe7c4[144],params[_0xe7c4[141]][_0xaa3dx29[_0xe7c4[29]]])})};return BPromise[_0xe7c4[112]]()}},agentcalled:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(_0xaa3dx1f){_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx1f[_0xe7c4[28]]),_0xe7c4[145],_0xaa3dx1f);triggers[_0xe7c4[146]](_0xaa3dx1f)};return User[_0xe7c4[140]]({where:{name:_0xaa3dx1a[_0xe7c4[28]],voicePause:false},raw:true})[_0xe7c4[90]](function(_0xaa3dx28){if(_0xaa3dx28){var _0xaa3dx2a=moment()[_0xe7c4[57]](_0xe7c4[56]);var _0xaa3dx27=_[_0xe7c4[132]]({newValues:{id:_0xaa3dx28[_0xe7c4[130]],queueStatus:_0xe7c4[148],queueStatusAt:_0xaa3dx2a,lastQueue:_0xaa3dx1a[_0xe7c4[67]]}},_0xaa3dx28,{queueStatus:_0xe7c4[148],queueStatusAt:_0xaa3dx2a,lastQueue:_0xaa3dx1a[_0xe7c4[67]]});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[133],_0xaa3dx28[_0xe7c4[134]],_0xaa3dx28[_0xe7c4[130]]),_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[126],_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[125],_0xe7c4[135],_0xaa3dx27)}})[_0xe7c4[65]](function(_0xaa3dx1e){console[_0xe7c4[129]](_0xe7c4[147],_0xaa3dx1e)})}},agentcomplete:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(_0xaa3dx1f){triggers[_0xe7c4[149]](_0xaa3dx1f)};if(params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[72]]){params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[72]]--};if(params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[72]]){params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[72]]--;_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[150],{type:_0xe7c4[72],amount:-1,queue:_0xaa3dx1a[_0xe7c4[67]]})};params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[74]]++;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[74]]++;_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[150],{type:_0xe7c4[120],amount:1,queue:_0xaa3dx1a[_0xe7c4[67]]});params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[88]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[74]]/ (params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[74]]+ params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[85]])* 100,2);params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[89]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[85]]/ (params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[74]]+ params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[85]])* 100,2);params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[88]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[74]]/ (params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[74]]+ params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[85]])* 100,2);params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[89]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[85]]/ (params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[74]]+ params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[85]])* 100,2);params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[76]]+= Number(_0xaa3dx1a[_0xe7c4[76]]);params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[76]]+= Number(_0xaa3dx1a[_0xe7c4[76]]);_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[150],{type:_0xe7c4[76],amount:Number(_0xaa3dx1a[_0xe7c4[76]]),queue:_0xaa3dx1a[_0xe7c4[67]]});params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[83]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[76]]/ params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[74]]);params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[83]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[76]]/ params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[74]]);params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[75]]+= Number(_0xaa3dx1a[_0xe7c4[75]]);params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[75]]+= Number(_0xaa3dx1a[_0xe7c4[75]]);_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[150],{type:_0xe7c4[75],amount:Number(_0xaa3dx1a[_0xe7c4[75]]),queue:_0xaa3dx1a[_0xe7c4[67]]});params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[81]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[75]]/ params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[74]]);params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[81]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[75]]/ params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[74]]);var _0xaa3dx27;var _0xaa3dx2a=moment()[_0xe7c4[57]](_0xe7c4[56]);return ReportAgent[_0xe7c4[140]]({where:{uniqueid:_0xaa3dx1a[_0xe7c4[117]],destuniqueid:_0xaa3dx1a[_0xe7c4[156]]},raw:true})[_0xe7c4[90]](function(_0xaa3dx2b){if(_0xaa3dx2b){_0xaa3dx27= _[_0xe7c4[132]]({},_0xaa3dx2b,{lastevent:_0xe7c4[120],agentcomplete:true,agentcompleteAt:_0xaa3dx2a,talktime:Number(_0xaa3dx1a[_0xe7c4[76]]),reason:_0xaa3dx1a[_0xe7c4[153]]});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx2b[_0xe7c4[28]]),_0xe7c4[154],_0xaa3dx27)};return ReportQueue[_0xe7c4[140]]({where:{uniqueid:_0xaa3dx1a[_0xe7c4[117]]},order:_0xe7c4[155],raw:true})})[_0xe7c4[90]](function(_0xaa3dx2b){if(_0xaa3dx2b){_0xaa3dx27= _[_0xe7c4[132]]({},_0xaa3dx2b,{queuecallercomplete:true,queuecallercompleteAt:_0xaa3dx2a});_0xaa3dx15(_0xaa3dx2b[_0xe7c4[67]],_0xe7c4[152],_0xaa3dx27)};return User[_0xe7c4[140]]({where:{name:_0xaa3dx1a[_0xe7c4[28]]},raw:true})})[_0xe7c4[90]](function(_0xaa3dx28){if(_0xaa3dx28){var _0xaa3dx27=_[_0xe7c4[132]]({newValues:{id:_0xaa3dx28[_0xe7c4[130]],queueStatus:_0xe7c4[120],queueStatusAt:_0xaa3dx2a,lastQueue:_0xaa3dx1a[_0xe7c4[67]]}},_0xaa3dx28,{queueStatus:_0xe7c4[120],queueStatusAt:_0xaa3dx2a,lastQueue:_0xaa3dx1a[_0xe7c4[67]]});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[133],_0xaa3dx28[_0xe7c4[134]],_0xaa3dx28[_0xe7c4[130]]),_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[126],_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[125],_0xe7c4[135],_0xaa3dx27)}})[_0xe7c4[65]](function(_0xaa3dx1e){console[_0xe7c4[129]](_0xe7c4[151],_0xaa3dx1e)})}},agentconnect:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(_0xaa3dx1f){triggers[_0xe7c4[149]](_0xaa3dx1f)};if(params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[70]]){params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[70]]--;_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[150],{type:_0xe7c4[70],amount:-1,queue:_0xaa3dx1a[_0xe7c4[67]]})};if(params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[70]]){params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[70]]--};if(params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]]){params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]][_0xe7c4[157]]= _0xaa3dx1a[_0xe7c4[158]];params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]][_0xe7c4[159]]= _0xaa3dx1a[_0xe7c4[159]];params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]][_0xe7c4[75]]= Number(_0xaa3dx1a[_0xe7c4[75]]);params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]][_0xe7c4[160]]= Number(_0xaa3dx1a[_0xe7c4[160]]);params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]][_0xe7c4[30]]= _0xaa3dx1a[_0xe7c4[30]];params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]][_0xe7c4[28]]= _0xaa3dx1a[_0xe7c4[28]]};params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[72]]++;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[72]]++;_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[150],{type:_0xe7c4[72],amount:1,queue:_0xaa3dx1a[_0xe7c4[67]]});var _0xaa3dx27;var _0xaa3dx2a=moment()[_0xe7c4[57]](_0xe7c4[56]);return ReportQueue[_0xe7c4[140]]({where:{uniqueid:_0xaa3dx1a[_0xe7c4[117]]},order:_0xe7c4[155],raw:true})[_0xe7c4[90]](function(_0xaa3dx2b){if(_0xaa3dx2b){_0xaa3dx27= _[_0xe7c4[132]]({},_0xaa3dx2b,{queuecallerleaveAt:moment()[_0xe7c4[57]](_0xe7c4[56]),holdtime:_0xaa3dx1a[_0xe7c4[75]],assigned:true,lastAssignedTo:_0xaa3dx1a[_0xe7c4[28]]});_0xaa3dx15(_0xaa3dx2b[_0xe7c4[67]],_0xe7c4[152],_0xaa3dx27)};return ReportAgent[_0xe7c4[140]]({where:{uniqueid:_0xaa3dx1a[_0xe7c4[117]],destuniqueid:_0xaa3dx1a[_0xe7c4[156]]},raw:true})})[_0xe7c4[90]](function(_0xaa3dx2b){if(_0xaa3dx2b){_0xaa3dx27= _[_0xe7c4[132]]({},_0xaa3dx2b,{lastevent:_0xe7c4[162],agentconnectAt:moment()[_0xe7c4[57]](_0xe7c4[56]),holdtime:_0xaa3dx1a[_0xe7c4[75]]});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx2b[_0xe7c4[28]]),_0xe7c4[154],_0xaa3dx27)};return ReportAgent[_0xe7c4[95]]({where:{uniqueid:_0xaa3dx1a[_0xe7c4[117]],destuniqueid:{$ne:_0xaa3dx1a[_0xe7c4[156]]},reason:null},raw:true})})[_0xe7c4[90]](function(_0xaa3dx2d){if(_0xaa3dx2d&& _0xaa3dx2d[_0xe7c4[66]]){_[_0xe7c4[91]](_0xaa3dx2d,function(_0xaa3dx2b){_0xaa3dx27= _[_0xe7c4[132]]({},_0xaa3dx2b,{lastevent:_0xe7c4[163],agentringnoanswer:true,agentringnoanswerAt:_0xaa3dx2a,reason:_0xe7c4[163],answeredelsewheredestinationuniqueid:_0xaa3dx1a[_0xe7c4[156]],answeredelsewheremembername:_0xaa3dx1a[_0xe7c4[28]]});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx2b[_0xe7c4[28]]),_0xe7c4[154],_0xaa3dx27)})};return User[_0xe7c4[140]]({where:{name:_0xaa3dx1a[_0xe7c4[28]]},raw:true})})[_0xe7c4[90]](function(_0xaa3dx28){if(_0xaa3dx28){var _0xaa3dx27=_[_0xe7c4[132]]({newValues:{id:_0xaa3dx28[_0xe7c4[130]],queueStatus:_0xe7c4[162],queueStatusAt:_0xaa3dx2a,lastQueue:_0xaa3dx1a[_0xe7c4[67]]}},_0xaa3dx28,{queueStatus:_0xe7c4[162],queueStatusAt:_0xaa3dx2a,lastQueue:_0xaa3dx1a[_0xe7c4[67]]});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[133],_0xaa3dx28[_0xe7c4[134]],_0xaa3dx28[_0xe7c4[130]]),_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[126],_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[125],_0xe7c4[135],_0xaa3dx27)};return User[_0xe7c4[95]]({where:{lastQueue:_0xaa3dx1a[_0xe7c4[67]],name:{$ne:_0xaa3dx1a[_0xe7c4[28]]}},raw:true})})[_0xe7c4[90]](function(_0xaa3dx2c){if(_0xaa3dx2c&& _0xaa3dx2c[_0xe7c4[66]]){_[_0xe7c4[91]](_0xaa3dx2c,function(_0xaa3dx28){var _0xaa3dx27=_[_0xe7c4[132]]({newValues:{id:_0xaa3dx28[_0xe7c4[130]],queueStatus:_0xe7c4[120],queueStatusAt:_0xaa3dx2a}},_0xaa3dx28,{queueStatus:_0xe7c4[120],queueStatusAt:_0xaa3dx2a});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[133],_0xaa3dx28[_0xe7c4[134]],_0xaa3dx28[_0xe7c4[130]]),_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[126],_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[125],_0xe7c4[135],_0xaa3dx27)})}})[_0xe7c4[65]](function(_0xaa3dx1e){console[_0xe7c4[129]](_0xe7c4[161],_0xaa3dx1e)})}},agentringnoanswer:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(_0xaa3dx1f){triggers[_0xe7c4[149]](_0xaa3dx1f)};var _0xaa3dx27;var _0xaa3dx2a=moment()[_0xe7c4[57]](_0xe7c4[56]);return User[_0xe7c4[140]]({where:{name:_0xaa3dx1a[_0xe7c4[28]]},raw:true})[_0xe7c4[90]](function(_0xaa3dx28){if(_0xaa3dx28){var _0xaa3dx27=_[_0xe7c4[132]]({newValues:{id:_0xaa3dx28[_0xe7c4[130]],queueStatus:_0xe7c4[120],queueStatusAt:_0xaa3dx2a,lastQueue:_0xaa3dx1a[_0xe7c4[67]]}},_0xaa3dx28,{queueStatus:_0xe7c4[120],queueStatusAt:_0xaa3dx2a,lastQueue:_0xaa3dx1a[_0xe7c4[67]]});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[133],_0xaa3dx28[_0xe7c4[134]],_0xaa3dx28[_0xe7c4[130]]),_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[126],_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[125],_0xe7c4[135],_0xaa3dx27)};return ReportAgent[_0xe7c4[140]]({where:{uniqueid:_0xaa3dx1a[_0xe7c4[117]],destuniqueid:_0xaa3dx1a[_0xe7c4[156]]},raw:true})})[_0xe7c4[90]](function(_0xaa3dx2b){if(_0xaa3dx2b){_0xaa3dx27= _[_0xe7c4[132]]({},_0xaa3dx2b,{lastevent:_0xe7c4[165],agentringnoanswer:true,agentringnoanswerAt:moment()[_0xe7c4[57]](_0xe7c4[56]),reason:_0xe7c4[165]});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx2b[_0xe7c4[28]]),_0xe7c4[154],_0xaa3dx27)}})[_0xe7c4[65]](function(_0xaa3dx1e){console[_0xe7c4[129]](_0xe7c4[164],_0xaa3dx1e)})}},queuememberadded:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(_0xaa3dx1f){_0xaa3dx15(_0xaa3dx1f[_0xe7c4[67]],_0xe7c4[166],_0xaa3dx1f);_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx1f.UserId),_0xe7c4[166],_0xaa3dx1f)};return BPromise[_0xe7c4[112]]()}},queuememberremoved:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]]){delete params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[113]][_0xaa3dx1a[_0xe7c4[28]]]};return User[_0xe7c4[140]]({where:{name:_0xaa3dx1a[_0xe7c4[30]][_0xe7c4[138]](_0xe7c4[136],_0xe7c4[137])},raw:true})[_0xe7c4[90]](function(_0xaa3dx28){if(_0xaa3dx28){_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[168],{queue:_0xaa3dx1a[_0xe7c4[67]],UserId:_0xaa3dx28[_0xe7c4[130]]});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx28[_0xe7c4[130]]),_0xe7c4[168],{queue:_0xaa3dx1a[_0xe7c4[67]],UserId:_0xaa3dx28[_0xe7c4[130]]})}})[_0xe7c4[65]](function(_0xaa3dx1e){console[_0xe7c4[64]](_0xe7c4[167],_0xaa3dx1e)})}},queuememberpause:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(_0xaa3dx1f){_0xaa3dx15(_0xaa3dx1f[_0xe7c4[67]],_0xe7c4[166],_0xaa3dx1f);_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx1f.UserId),_0xe7c4[166],_0xaa3dx1f)};if(parseInt(_0xaa3dx1a[_0xe7c4[58]],10)){var _0xaa3dx27;var _0xaa3dx2a=moment()[_0xe7c4[57]](_0xe7c4[56]);return User[_0xe7c4[140]]({where:{name:_0xaa3dx1a[_0xe7c4[28]]},raw:true})[_0xe7c4[90]](function(_0xaa3dx28){if(_0xaa3dx28){var _0xaa3dx2e={id:_0xaa3dx28[_0xe7c4[130]],voicePause:false};_[_0xe7c4[170]](_0xaa3dx2e,{voicePause:true,chatPause:true,mailPause:true,faxPause:true,smsPause:true,openchannelPause:true,pauseType:_0xaa3dx1a[_0xe7c4[153]],lastPauseAt:_0xaa3dx2a});var _0xaa3dx27=_[_0xe7c4[132]]({newValues:_0xaa3dx2e},_0xaa3dx28,_0xaa3dx2e);_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[133],_0xaa3dx28[_0xe7c4[134]],_0xaa3dx28[_0xe7c4[130]]),_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[126],_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[125],_0xe7c4[135],_0xaa3dx27)}})[_0xe7c4[65]](function(_0xaa3dx1e){console[_0xe7c4[129]](_0xe7c4[169],_0xaa3dx1e)})}}},queuememberpenalty:function(_0xaa3dx1a){return function(_0xaa3dx1f){return BPromise[_0xe7c4[112]]()}},queuememberringinuse:function(_0xaa3dx1a){return function(_0xaa3dx1f){return BPromise[_0xe7c4[112]]()}},queuemember:function(_0xaa3dx1a){return function(_0xaa3dx1f){_0xaa3dx19(_0xaa3dx1a);_0xaa3dx1b(_0xaa3dx1a[_0xe7c4[67]]);params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[113]][_0xaa3dx1a[_0xe7c4[29]]]= _0xaa3dx1a;return BPromise[_0xe7c4[112]]()}},queuecallerjoin:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(!params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]]){params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]]= {};params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[70]]= 0;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[72]]= 0;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[74]]= 0;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[85]]= 0;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[87]]= 0;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[75]]= 0;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[76]]= 0;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[81]]= 0;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[83]]= 0;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[88]]= 0;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[89]]= 0;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[68]]= 0};params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]]= {channel:_0xaa3dx1a[_0xe7c4[123]],channelstate:Number(_0xaa3dx1a[_0xe7c4[171]]),channelstatedesc:_0xaa3dx1a[_0xe7c4[172]],calleridnum:_0xaa3dx1a[_0xe7c4[173]],calleridname:_0xaa3dx1a[_0xe7c4[174]],exten:_0xaa3dx1a[_0xe7c4[175]],priority:Number(_0xaa3dx1a[_0xe7c4[176]]),uniqueid:_0xaa3dx1a[_0xe7c4[117]],queue:_0xaa3dx1a[_0xe7c4[67]],position:Number(_0xaa3dx1a[_0xe7c4[177]]),count:Number(_0xaa3dx1a[_0xe7c4[178]])};params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[70]]++;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[70]]++;_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[150],{type:_0xe7c4[68],amount:1,queue:_0xaa3dx1a[_0xe7c4[67]]});params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[68]]++;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[68]]++;_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[150],{type:_0xe7c4[70],amount:1,queue:_0xaa3dx1a[_0xe7c4[67]]});if(_0xaa3dx1f){_0xaa3dx15(_0xaa3dx1f[_0xe7c4[67]],_0xe7c4[179],_0xaa3dx1f)};return BPromise[_0xe7c4[112]]()}},queuecallerabandon:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(_0xaa3dx1f&& _0xaa3dx1f[_0xe7c4[180]]&& _0xaa3dx1f[_0xe7c4[180]][0]){_[_0xe7c4[91]](_0xaa3dx1f[_0xe7c4[180]][1],function(_0xaa3dx2b){_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx2b[_0xe7c4[28]]),_0xe7c4[154],_0xaa3dx2b)})};if(_0xaa3dx1f&& _0xaa3dx1f[_0xe7c4[181]]){_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[152],_0xaa3dx1f[_0xe7c4[181]]);_0xaa3dx1f[_0xe7c4[181]][_0xe7c4[183]][_0xe7c4[182]]= _0xe7c4[85];_0xaa3dx1f[_0xe7c4[181]][_0xe7c4[184]][_0xe7c4[182]]= true;triggers[_0xe7c4[149]](_0xaa3dx1f[_0xe7c4[181]])};var _0xaa3dx27;var _0xaa3dx2a=moment()[_0xe7c4[57]](_0xe7c4[56]);if(params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[70]]){params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[70]]--;_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[150],{type:_0xe7c4[70],amount:-1,queue:_0xaa3dx1a[_0xe7c4[67]]})};if(params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[70]]){params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[70]]--};if(params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]]){params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]][_0xe7c4[75]]= Number(_0xaa3dx1a[_0xe7c4[75]]);params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]][_0xe7c4[177]]= Number(_0xaa3dx1a[_0xe7c4[177]]);params[_0xe7c4[60]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]][_0xe7c4[185]]= Number(_0xaa3dx1a[_0xe7c4[185]])};params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[85]]++;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[85]]++;_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[150],{type:_0xe7c4[186],amount:1,queue:_0xaa3dx1a[_0xe7c4[67]]});params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[88]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[74]]/ (params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[74]]+ params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[85]])* 100,2);params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[89]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[85]]/ (params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[74]]+ params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[85]])* 100,2);params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[88]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[74]]/ (params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[74]]+ params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[85]])* 100,2);params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[89]]= _[_0xe7c4[82]](params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[85]]/ (params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[74]]+ params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[85]])* 100,2);return User[_0xe7c4[95]]({where:{lastQueue:_0xaa3dx1a[_0xe7c4[67]]},raw:true})[_0xe7c4[90]](function(_0xaa3dx2f){if(_0xaa3dx2f&& _0xaa3dx2f[_0xe7c4[66]]){var _0xaa3dx27;_[_0xe7c4[91]](_0xaa3dx2f,function(_0xaa3dx30){_0xaa3dx27= _[_0xe7c4[132]]({newValues:{id:_0xaa3dx30[_0xe7c4[130]],queueStatus:_0xe7c4[120],queueStatusAt:_0xaa3dx2a,lastQueue:_0xaa3dx1a[_0xe7c4[67]]}},_0xaa3dx30,{id:_0xaa3dx30[_0xe7c4[130]],queueStatus:_0xe7c4[120],queueStatusAt:_0xaa3dx2a,lastQueue:_0xaa3dx1a[_0xe7c4[67]]});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[133],_0xaa3dx30[_0xe7c4[134]],_0xaa3dx30[_0xe7c4[130]]),_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[126],_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[125],_0xe7c4[135],_0xaa3dx27)})}})[_0xe7c4[65]](function(_0xaa3dx1e){console[_0xe7c4[129]](_0xe7c4[187],_0xaa3dx1e)})}},blindtransfer:function(_0xaa3dx1a){return function(_0xaa3dx1f){_0xaa3dx15(null,_0xaa3dx1a[_0xe7c4[24]][_0xe7c4[188]](),_0xaa3dx1a);return BPromise[_0xe7c4[112]]()}},attendedtransfer:function(_0xaa3dx1a){return function(_0xaa3dx1f){_0xaa3dx15(null,_0xaa3dx1a[_0xe7c4[24]][_0xe7c4[188]](),_0xaa3dx1a);return BPromise[_0xe7c4[112]]()}},dialbegin:function(_0xaa3dx1a){return function(_0xaa3dx1f){params[_0xe7c4[96]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]]= {channel:_0xaa3dx1a[_0xe7c4[123]],channelstate:Number(_0xaa3dx1a[_0xe7c4[171]]),channelstatedesc:_0xaa3dx1a[_0xe7c4[172]],calleridnum:_0xaa3dx1a[_0xe7c4[173]],calleridname:_0xaa3dx1a[_0xe7c4[174]],context:_0xaa3dx1a[_0xe7c4[189]],exten:_0xaa3dx1a[_0xe7c4[175]],priority:Number(_0xaa3dx1a[_0xe7c4[176]]),dialstring:_0xaa3dx1a[_0xe7c4[190]]};if(_0xaa3dx1a[_0xe7c4[123]]){var _0xaa3dx27=_[_0xe7c4[170]](_0xaa3dx1a,{starttime:moment()[_0xe7c4[57]](_0xe7c4[56]),lastevent:_0xe7c4[148],updatedAt:moment()[_0xe7c4[57]](_0xe7c4[56])});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx1a[_0xe7c4[123]][_0xe7c4[122]](/\/|-/)[1]),_0xe7c4[191],_0xaa3dx27);_0xaa3dx15(_0xe7c4[126],_0xe7c4[124],_[_0xe7c4[170]](_0xaa3dx27,{role:_0xe7c4[126]}));_0xaa3dx15(_0xe7c4[125],_0xe7c4[124],_0xaa3dx27,_[_0xe7c4[170]](_0xaa3dx27,{role:_0xe7c4[125]}));if(_0xaa3dx1f){triggers[_0xe7c4[127]](_0xaa3dx1f)}};return BPromise[_0xe7c4[112]]()}},dialend:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(params[_0xe7c4[96]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]]){params[_0xe7c4[96]][_0xe7c4[118]][_0xaa3dx1a[_0xe7c4[117]]][_0xe7c4[192]]= _0xaa3dx1a[_0xe7c4[192]]};if(_0xaa3dx1a[_0xe7c4[123]]){var _0xaa3dx2a=moment()[_0xe7c4[57]](_0xe7c4[56]);var _0xaa3dx27={dialstatus:_0xaa3dx1a[_0xe7c4[192]],lastevent:(_0xaa3dx1a[_0xe7c4[192]]=== _0xe7c4[101])?_0xe7c4[162]:_0xe7c4[120],answertime:(_0xaa3dx1a[_0xe7c4[192]]=== _0xe7c4[101])?_0xaa3dx2a:null,uniqueid:_0xaa3dx1a[_0xe7c4[117]],linkedid:_0xaa3dx1a[_0xe7c4[119]],destuniqueid:_0xaa3dx1a[_0xe7c4[156]],destlinkedid:_0xaa3dx1a[_0xe7c4[193]],updatedAt:_0xaa3dx2a};_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx1a[_0xe7c4[123]][_0xe7c4[122]](/\/|-/)[1]),_0xe7c4[124],_0xaa3dx27);_0xaa3dx15(_0xe7c4[126],_0xe7c4[124],_0xaa3dx27);_0xaa3dx15(_0xe7c4[125],_0xe7c4[124],_0xaa3dx27);if(_0xaa3dx1f){triggers[_0xe7c4[127]](_0xaa3dx1f)}};return BPromise[_0xe7c4[112]]()}},varset:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(_0xaa3dx1a[_0xe7c4[195]][_0xe7c4[53]](_0xe7c4[194])){_0xaa3dx15(_0xe7c4[126],_0xe7c4[191],{uniqueid:_0xaa3dx1a[_0xe7c4[117]],routeId:_0xaa3dx1a[_0xe7c4[196]],updatedAt:moment()[_0xe7c4[57]](_0xe7c4[56])});_0xaa3dx15(_0xe7c4[125],_0xe7c4[191],{uniqueid:_0xaa3dx1a[_0xe7c4[117]],routeId:_0xaa3dx1a[_0xe7c4[196]],updatedAt:moment()[_0xe7c4[57]](_0xe7c4[56])})};if(_0xaa3dx1a){triggers[_0xe7c4[197]](_0xaa3dx1a)};return BPromise[_0xe7c4[112]]()}},queuecallerunmanaged:function(_0xaa3dx1a){return function(_0xaa3dx1f){if(_0xaa3dx1f){params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[87]]+= 1;params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[87]]+= 1;_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[150],{type:_0xe7c4[87],amount:1,queue:_0xaa3dx1a[_0xe7c4[67]]});if(params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[70]]){params[_0xe7c4[60]][_0xe7c4[59]][_0xaa3dx1a[_0xe7c4[67]]][_0xe7c4[70]]-= 1};if(params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[70]]){params[_0xe7c4[60]][_0xe7c4[61]][_0xe7c4[70]]-= 1;_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[150],{type:_0xe7c4[70],amount:-1,queue:_0xaa3dx1a[_0xe7c4[67]]})};_0xaa3dx15(_0xaa3dx1a[_0xe7c4[67]],_0xe7c4[152],_0xaa3dx1f);var _0xaa3dx2a=moment()[_0xe7c4[57]](_0xe7c4[56]);return User[_0xe7c4[95]]({where:{lastQueue:_0xaa3dx1a[_0xe7c4[67]]},raw:true})[_0xe7c4[90]](function(_0xaa3dx2f){if(_0xaa3dx2f&& _0xaa3dx2f[_0xe7c4[66]]){var _0xaa3dx27;_[_0xe7c4[91]](_0xaa3dx2f,function(_0xaa3dx30){_0xaa3dx27= _[_0xe7c4[132]]({newValues:{id:_0xaa3dx30[_0xe7c4[130]],queueStatus:_0xe7c4[120],queueStatusAt:_0xaa3dx2a,lastQueue:_0xaa3dx1a[_0xe7c4[67]]}},_0xaa3dx30,{id:_0xaa3dx30[_0xe7c4[130]],queueStatus:_0xe7c4[120],queueStatusAt:_0xaa3dx2a,lastQueue:_0xaa3dx1a[_0xe7c4[67]]});_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[133],_0xaa3dx30[_0xe7c4[134]],_0xaa3dx30[_0xe7c4[130]]),_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[126],_0xe7c4[135],_0xaa3dx27);_0xaa3dx15(_0xe7c4[125],_0xe7c4[135],_0xaa3dx27)})}})[_0xe7c4[65]](function(_0xaa3dx1e){console[_0xe7c4[129]](_0xe7c4[187],_0xaa3dx1e)})}}},agentUpdate:function(_0xaa3dx30){return function(){_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx30[_0xe7c4[130]]),_0xe7c4[135],_0xaa3dx30);_0xaa3dx15(_0xe7c4[126],_0xe7c4[135],_0xaa3dx30);_0xaa3dx15(_0xe7c4[125],_0xe7c4[135],_0xaa3dx30)}},console:function(_0xaa3dx31){_0xaa3dx15(_0xaa3dx31[_0xe7c4[198]],util[_0xe7c4[57]](_0xe7c4[199],_0xaa3dx31[_0xe7c4[111]]),_0xaa3dx31[_0xe7c4[200]])},realtimeQueueMembers:function(_0xaa3dx32){return function(){_[_0xe7c4[202]](params[_0xe7c4[60]][_0xe7c4[59]],function(_0xaa3dx1c,_0xaa3dx21){if(_[_0xe7c4[201]](_0xaa3dx32,_0xaa3dx21)){_[_0xe7c4[202]](_0xaa3dx1c[_0xe7c4[113]],function(_0xaa3dx30){_0xaa3dx15(_0xaa3dx21,_0xe7c4[166],_0xaa3dx30)})}})}},updateTriggers:function(_0xaa3dx31){return function(){return triggers[_0xe7c4[203]](_0xaa3dx31)}},queueAdd:function(_0xaa3dx33,_0xaa3dx34){return function(){if(_0xaa3dx33&& _0xaa3dx34){_[_0xe7c4[91]](_0xaa3dx33,function(_0xaa3dx1f){_0xaa3dx15(null,util[_0xe7c4[57]](_0xe7c4[204],_0xaa3dx34),_0xaa3dx1f[0])})}}},queueRemove:function(_0xaa3dx1f,_0xaa3dx34){return function(){if(_0xaa3dx1f&& _0xaa3dx34){_0xaa3dx15(null,util[_0xe7c4[57]](_0xe7c4[205],_0xaa3dx34),_0xaa3dx1f)}}},checkTriggers:function(_0xaa3dx31){return function(){return triggers[_0xe7c4[206]](_0xaa3dx31)}},inboundInit:function(){return function(){return BPromise[_0xe7c4[112]]()[_0xe7c4[90]](_0xaa3dx1d())}},outboundInit:function(){return function(){return BPromise[_0xe7c4[112]]()[_0xe7c4[90]](_0xaa3dx24())}},reportFaxUpdate:function(_0xaa3dx35){return function(){_0xaa3dx15(util[_0xe7c4[57]](_0xe7c4[121],_0xaa3dx35[_0xe7c4[207]]),_0xe7c4[135],_0xaa3dx35);_0xaa3dx15(_0xe7c4[125],_0xe7c4[208],_0xaa3dx35)}}}}