1 var _0x2c3d=["\x75\x73\x65\x20\x73\x74\x72\x69\x63\x74","\x6C\x6F\x64\x61\x73\x68","\x75\x74\x69\x6C","\x6D\x6F\x6D\x65\x6E\x74","\x62\x6C\x75\x65\x62\x69\x72\x64","\x72\x65\x64\x69\x73","\x56\x6F\x69\x63\x65\x51\x75\x65\x75\x65","\x2E\x2E\x2F\x2E\x2E\x2F\x6D\x6F\x64\x65\x6C\x73","\x52\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x52\x65\x70\x6F\x72\x74\x43\x61\x6C\x6C","\x52\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74","\x52\x65\x70\x6F\x72\x74\x44\x69\x61\x6C","\x52\x65\x70\x6F\x72\x74\x4D\x65\x6D\x62\x65\x72","\x55\x73\x65\x72","\x2E\x2E\x2F\x74\x72\x69\x67\x67\x65\x72\x73","\x2E\x2E\x2F\x65\x6E\x76\x69\x72\x6F\x6E\x6D\x65\x6E\x74","\x61\x6D\x69","\x2E\x2E\x2F\x6C\x6F\x67\x67\x65\x72\x2E\x6A\x73","\x2E\x2F\x75\x74\x69\x6C\x73","\x72\x65\x64\x69\x73\x50\x77\x64","\x69\x70","\x63\x72\x65\x61\x74\x65\x43\x6C\x69\x65\x6E\x74","\x73\x6F\x63\x6B\x65\x74\x2E\x69\x6F\x2D\x65\x6D\x69\x74\x74\x65\x72","\x65\x78\x70\x6F\x72\x74\x73","\x65\x6D\x69\x74","\x74\x6F","\x65\x76\x65\x6E\x74","\x70\x72\x69\x76\x69\x6C\x65\x67\x65","\x6D\x65\x6D\x62\x65\x72\x73\x68\x69\x70","\x72\x69\x6E\x67\x69\x6E\x75\x73\x65","\x6D\x65\x6D\x62\x65\x72\x6E\x61\x6D\x65","\x6E\x61\x6D\x65","\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x73\x74\x61\x74\x65\x69\x6E\x74\x65\x72\x66\x61\x63\x65","\x73\x74\x61\x74\x75\x73\x64\x65\x73\x63","\x55\x4E\x4B\x4E\x4F\x57\x4E","\x30","\x4E\x4F\x54\x5F\x49\x4E\x55\x53\x45","\x31","\x49\x4E\x55\x53\x45","\x32","\x42\x55\x53\x59","\x33","\x49\x4E\x56\x41\x4C\x49\x44","\x34","\x55\x4E\x41\x56\x41\x49\x4C\x41\x42\x4C\x45","\x35","\x52\x49\x4E\x47\x49\x4E\x47","\x36","\x52\x49\x4E\x47\x49\x4E\x55\x53\x45","\x37","\x4F\x4E\x48\x4F\x4C\x44","\x38","\x73\x74\x61\x74\x75\x73","\x70\x65\x6E\x61\x6C\x74\x79","\x68\x61\x73\x4F\x77\x6E\x50\x72\x6F\x70\x65\x72\x74\x79","\x63\x61\x6C\x6C\x73\x74\x61\x6B\x65\x6E","\x6C\x61\x73\x74\x63\x61\x6C\x6C","\x59\x59\x59\x59\x2D\x4D\x4D\x2D\x44\x44\x20\x48\x48\x3A\x6D\x6D\x3A\x73\x73","\x66\x6F\x72\x6D\x61\x74","\x70\x61\x75\x73\x65\x64","\x71\x75\x65\x75\x65\x73","\x69\x6E\x62\x6F\x75\x6E\x64","\x67\x6C\x6F\x62\x61\x6C","\x69\x6E\x62\x6F\x75\x6E\x64\x20\x69\x6E\x69\x74\x20\x65\x72\x72\x6F\x72\x3A","\x73\x74\x61\x63\x6B","\x65\x72\x72\x6F\x72","\x63\x61\x74\x63\x68","\x6C\x65\x6E\x67\x74\x68","\x71\x75\x65\x75\x65","\x74\x6F\x74\x61\x6C","\x69\x73\x57\x61\x69\x74\x69\x6E\x67","\x77\x61\x69\x74\x69\x6E\x67","\x69\x73\x41\x63\x74\x69\x76\x65","\x61\x63\x74\x69\x76\x65","\x69\x73\x43\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x63\x6F\x6D\x70\x6C\x65\x74\x65\x64","\x68\x6F\x6C\x64\x74\x69\x6D\x65","\x74\x61\x6C\x6B\x74\x69\x6D\x65","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6C\x65\x61\x76\x65\x41\x74","\x73\x65\x63\x6F\x6E\x64\x73","\x64\x69\x66\x66","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65\x41\x74","\x61\x76\x67\x48\x6F\x6C\x64\x74\x69\x6D\x65","\x72\x6F\x75\x6E\x64","\x61\x76\x67\x54\x61\x6C\x6B\x74\x69\x6D\x65","\x69\x73\x41\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x61\x62\x61\x6E\x64\x6F\x6E\x65\x64","\x69\x73\x55\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x75\x6E\x6D\x61\x6E\x61\x67\x65\x64","\x61\x6E\x73\x77\x65\x72\x52\x61\x74\x65","\x61\x62\x61\x6E\x64\x6F\x6E\x52\x61\x74\x65","\x74\x68\x65\x6E","\x66\x6F\x72\x45\x61\x63\x68","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x65\x78\x69\x74","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x61\x62\x61\x6E\x64\x6F\x6E","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x66\x69\x6E\x64\x41\x6C\x6C","\x6F\x75\x74\x62\x6F\x75\x6E\x64","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x20\x69\x6E\x69\x74\x20\x65\x72\x72\x6F\x72\x3A","\x66\x69\x6C\x74\x65\x72","\x74\x69\x67\x65\x72\x64\x69\x61\x6C","\x61\x6E\x73\x77\x65\x72\x65\x64","\x41\x4E\x53\x57\x45\x52\x45\x44","\x64\x69\x73\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x63\x6F\x75\x6E\x74\x42\x79","\x73\x75\x6D\x44\x75\x72\x61\x74\x69\x6F\x6E","\x62\x69\x6C\x6C\x61\x62\x6C\x65\x73\x65\x63\x6F\x6E\x64\x73","\x73\x75\x6D\x42\x79","\x61\x76\x67\x44\x75\x72\x61\x74\x69\x6F\x6E","\x72\x65\x73\x75\x6C\x74","\x64\x61\x79","\x73\x74\x61\x72\x74\x4F\x66","\x74\x79\x70\x65","\x72\x65\x73\x6F\x6C\x76\x65","\x61\x67\x65\x6E\x74\x73","\x72\x65\x70\x6F\x72\x74\x5F\x63\x61\x6C\x6C\x3A\x73\x61\x76\x65","\x76\x6F\x69\x63\x65\x2F\x6F\x75\x74\x62\x6F\x75\x6E\x64\x2F\x67\x6C\x6F\x62\x61\x6C","\x76\x6F\x69\x63\x65\x3A\x6F\x75\x74\x62\x6F\x75\x6E\x64\x3A\x67\x6C\x6F\x62\x61\x6C","\x75\x6E\x69\x71\x75\x65\x69\x64","\x63\x68\x61\x6E\x6E\x65\x6C\x73","\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x63\x6F\x6D\x70\x6C\x65\x74\x65","\x61\x67\x65\x6E\x74\x3A\x25\x73","\x73\x70\x6C\x69\x74","\x63\x68\x61\x6E\x6E\x65\x6C","\x72\x65\x70\x6F\x72\x74\x5F\x64\x69\x61\x6C\x3A\x75\x70\x64\x61\x74\x65","\x61\x64\x6D\x69\x6E\x73","\x75\x73\x65\x72\x73","\x72\x65\x70\x6F\x72\x74\x44\x69\x61\x6C","\x64\x65\x76\x69\x63\x65\x73\x74\x61\x74\x65\x63\x68\x61\x6E\x67\x65\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x69\x6E\x66\x6F","\x69\x64","\x73\x74\x61\x74\x65","\x61\x73\x73\x69\x67\x6E","\x25\x73\x3A\x25\x73","\x72\x6F\x6C\x65","\x61\x67\x65\x6E\x74\x3A\x73\x61\x76\x65","\x53\x49\x50\x2F","","\x72\x65\x70\x6C\x61\x63\x65","\x64\x65\x76\x69\x63\x65","\x66\x69\x6E\x64\x4F\x6E\x65","\x74\x72\x75\x6E\x6B\x73","\x70\x65\x65\x72\x73\x74\x61\x74\x75\x73","\x76\x6F\x69\x63\x65\x2F\x74\x72\x75\x6E\x6B\x73","\x76\x6F\x69\x63\x65\x3A\x74\x72\x75\x6E\x6B\x73","\x65\x78\x74\x72\x61\x76\x61\x72","\x64\x61\x74\x61\x56\x61\x6C\x75\x65\x73","\x72\x65\x70\x6F\x72\x74\x5F\x61\x67\x65\x6E\x74\x3A\x73\x61\x76\x65","\x72\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74\x43\x72\x65\x61\x74\x65","\x61\x67\x65\x6E\x74\x63\x61\x6C\x6C\x65\x64\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x63\x61\x6C\x6C\x65\x64","\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","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65","\x63\x68\x61\x6E\x6E\x65\x6C\x73\x74\x61\x74\x65\x64\x65\x73\x63","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x75\x6D","\x63\x61\x6C\x6C\x65\x72\x69\x64\x6E\x61\x6D\x65","\x65\x78\x74\x65\x6E","\x70\x72\x69\x6F\x72\x69\x74\x79","\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x63\x6F\x75\x6E\x74","\x72\x65\x70\x6F\x72\x74\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x72\x65\x70\x6F\x72\x74\x41\x67\x65\x6E\x74","\x72\x65\x70\x6F\x72\x74\x51\x75\x65\x75\x65","\x6C\x61\x73\x74\x65\x76\x65\x6E\x74","\x5F\x63\x68\x61\x6E\x67\x65\x64","\x6F\x72\x69\x67\x69\x6E\x61\x6C\x70\x6F\x73\x69\x74\x69\x6F\x6E","\x61\x62\x61\x6E\x64\x6F\x6E","\x71\x75\x65\x75\x65\x63\x61\x6C\x6C\x65\x72\x6A\x6F\x69\x6E\x20\x2D\x20\x73\x6F\x63\x6B\x65\x74","\x74\x6F\x4C\x6F\x77\x65\x72\x43\x61\x73\x65","\x63\x6F\x6E\x74\x65\x78\x74","\x64\x69\x61\x6C\x73\x74\x72\x69\x6E\x67","\x6D\x65\x72\x67\x65","\x72\x65\x70\x6F\x72\x74\x5F\x64\x69\x61\x6C\x3A\x73\x61\x76\x65","\x64\x69\x61\x6C\x73\x74\x61\x74\x75\x73","\x64\x65\x73\x74\x6C\x69\x6E\x6B\x65\x64\x69\x64","\x6F\x75\x74\x62\x6F\x75\x6E\x64\x72\x6F\x75\x74\x65\x69\x64","\x76\x61\x72\x69\x61\x62\x6C\x65","\x76\x61\x6C\x75\x65","\x76\x61\x72\x53\x65\x74","\x73\x6F\x63\x6B\x65\x74","\x63\x6F\x6E\x73\x6F\x6C\x65\x3A\x25\x73","\x64\x61\x74\x61","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x66\x6F\x72\x4F\x77\x6E","\x75\x70\x64\x61\x74\x65\x54\x72\x69\x67\x67\x65\x72\x73","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x25\x73\x5F\x71\x75\x65\x75\x65\x3A\x73\x61\x76\x65","\x75\x73\x65\x72\x5F\x68\x61\x73\x5F\x25\x73\x5F\x71\x75\x65\x75\x65\x3A\x72\x65\x6D\x6F\x76\x65","\x63\x68\x65\x63\x6B\x54\x72\x69\x67\x67\x65\x72\x73","\x76\x69\x64\x65\x6F\x4F\x6E","\x6D\x65\x6D\x62\x65\x72\x69\x64","\x72\x65\x70\x6F\x72\x74\x5F\x66\x61\x78\x3A\x75\x70\x64\x61\x74\x65","\x77\x69\x64\x67\x65\x74\x5F\x75\x70\x64\x61\x74\x65\x3A","\x72\x65\x63\x65\x69\x76\x65\x66\x61\x78"];_0x2c3d[0];var _=require(_0x2c3d[1]);var util=require(_0x2c3d[2]);var moment=require(_0x2c3d[3]);var BPromise=require(_0x2c3d[4]);var redis=require(_0x2c3d[5]);var VoiceQueue=require(_0x2c3d[7])[_0x2c3d[6]];var ReportQueue=require(_0x2c3d[7])[_0x2c3d[8]];var ReportCall=require(_0x2c3d[7])[_0x2c3d[9]];var ReportAgent=require(_0x2c3d[7])[_0x2c3d[10]];var ReportDial=require(_0x2c3d[7])[_0x2c3d[11]];var ReportMember=require(_0x2c3d[7])[_0x2c3d[12]];var User=require(_0x2c3d[7])[_0x2c3d[13]];var Triggers=require(_0x2c3d[14]);var config=require(_0x2c3d[15]);var logger=require(_0x2c3d[17])(_0x2c3d[16]);var utils=require(_0x2c3d[18]);var redisConf;if(config[_0x2c3d[19]]){redisConf= {password:config[_0x2c3d[19]]}};var redisClient=redis[_0x2c3d[21]](6379,config[_0x2c3d[20]],redisConf);var io=require(_0x2c3d[22])(redisClient);var triggers= new Triggers(io);var params={trunks:[],inbound:{queues:{},channels:[],global:{waiting:0,active:0,completed:0,abandoned:0,unmanaged:0,holdtime:0,talktime:0,avgHoldtime:0,avgTalktime:0,answerRate:0,abandonRate:0,total:0}},outbound:{global:{total:0,answered:0,sumDuration:0,avgDuration:0,tigerdial:0},channels:[]}};module[_0x2c3d[23]]= function(){var _0x1cbex16=function(_0x1cbex17,_0x1cbex18,_0x1cbex19){if(_0x1cbex17){io[_0x2c3d[25]](_0x1cbex17)[_0x2c3d[24]](_0x1cbex18,_0x1cbex19)}else {io[_0x2c3d[24]](_0x1cbex18,_0x1cbex19)}};var _0x1cbex1a=function(_0x1cbex1b){delete _0x1cbex1b[_0x2c3d[26]];delete _0x1cbex1b[_0x2c3d[27]];delete _0x1cbex1b[_0x2c3d[28]];delete _0x1cbex1b[_0x2c3d[29]];_0x1cbex1b[_0x2c3d[30]]= _0x1cbex1b[_0x2c3d[31]]|| _0x1cbex1b[_0x2c3d[30]];_0x1cbex1b[_0x2c3d[32]]= _0x1cbex1b[_0x2c3d[33]];_0x1cbex1b[_0x2c3d[34]]= _0x2c3d[35];switch(_0x1cbex1b[_0x2c3d[53]]){case _0x2c3d[36]:_0x1cbex1b[_0x2c3d[34]]= _0x2c3d[35];break;case _0x2c3d[38]:_0x1cbex1b[_0x2c3d[34]]= _0x2c3d[37];break;case _0x2c3d[40]:_0x1cbex1b[_0x2c3d[34]]= _0x2c3d[39];break;case _0x2c3d[42]:_0x1cbex1b[_0x2c3d[34]]= _0x2c3d[41];break;case _0x2c3d[44]:_0x1cbex1b[_0x2c3d[34]]= _0x2c3d[43];break;case _0x2c3d[46]:_0x1cbex1b[_0x2c3d[34]]= _0x2c3d[45];break;case _0x2c3d[48]:_0x1cbex1b[_0x2c3d[34]]= _0x2c3d[47];break;case _0x2c3d[50]:_0x1cbex1b[_0x2c3d[34]]= _0x2c3d[49];break;case _0x2c3d[52]:_0x1cbex1b[_0x2c3d[34]]= _0x2c3d[51];break;default:};_0x1cbex1b[_0x2c3d[53]]= Number(_0x1cbex1b[_0x2c3d[53]]);if(_0x1cbex1b[_0x2c3d[55]](_0x2c3d[54])){_0x1cbex1b[_0x2c3d[54]]= Number(_0x1cbex1b[_0x2c3d[54]])};if(_0x1cbex1b[_0x2c3d[55]](_0x2c3d[56])){_0x1cbex1b[_0x2c3d[56]]= Number(_0x1cbex1b[_0x2c3d[56]])};if(_0x1cbex1b[_0x2c3d[55]](_0x2c3d[57])){if(_0x1cbex1b[_0x2c3d[57]]=== _0x2c3d[36]){_0x1cbex1b[_0x2c3d[57]]= null}else {_0x1cbex1b[_0x2c3d[57]]= moment()[_0x2c3d[59]](_0x2c3d[58])}};_0x1cbex1b[_0x2c3d[60]]= parseInt(_0x1cbex1b[_0x2c3d[60]],10)?true:false};function _0x1cbex1c(_0x1cbex1d){if(!params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1d]){params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1d]= {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 _0x1cbex1e(){return function(){params[_0x2c3d[62]][_0x2c3d[61]]= {};params[_0x2c3d[62]][_0x2c3d[63]]= {waiting:0,active:0,completed:0,abandoned:0,unmanaged:0,holdtime:0,talktime:0,avgHoldtime:0,avgTalktime:0,answerRate:0,abandonRate:0,total:0};return VoiceQueue[_0x2c3d[97]]({attributes:[_0x2c3d[31]],raw:true})[_0x2c3d[92]](function(_0x1cbex20){if(_0x1cbex20){_[_0x2c3d[93]](_0x1cbex20,function(_0x1cbex1d){_0x1cbex1c(_0x1cbex1d[_0x2c3d[31]])});return ReportQueue[_0x2c3d[97]]({attributes:[_0x2c3d[69],_0x2c3d[79],_0x2c3d[82],_0x2c3d[94],_0x2c3d[95],_0x2c3d[96],_0x2c3d[77]],raw:true})}})[_0x2c3d[92]](function(_0x1cbex20){if(_0x1cbex20){var _0x1cbex21;var _0x1cbex22;var _0x1cbex23=_0x1cbex20[_0x2c3d[68]];for(var _0x1cbex24=0;_0x1cbex24< _0x1cbex23;_0x1cbex24++){_0x1cbex21= _0x1cbex20[_0x1cbex24];_0x1cbex22= _0x1cbex21[_0x2c3d[69]];_0x1cbex1c(_0x1cbex22);params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[70]]++;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[70]]++;if(utils[_0x2c3d[71]](_0x1cbex21)){params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[72]]++;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[72]]++};if(utils[_0x2c3d[73]](_0x1cbex21)){params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[74]]++;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[74]]++};if(utils[_0x2c3d[75]](_0x1cbex21)){params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[76]]++;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[76]]++;params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[77]]+= _0x1cbex21[_0x2c3d[77]]|| 0;params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[78]]+= moment(_0x1cbex21[_0x2c3d[82]])[_0x2c3d[81]](moment(_0x1cbex21[_0x2c3d[79]]),_0x2c3d[80]);params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[83]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[77]]/ params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[76]]);params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[85]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[78]]/ params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[76]]);params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[77]]+= _0x1cbex21[_0x2c3d[77]]|| 0;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[78]]+= moment(_0x1cbex21[_0x2c3d[82]])[_0x2c3d[81]](moment(_0x1cbex21[_0x2c3d[79]]),_0x2c3d[80]);params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[83]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[77]]/ params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[76]]);params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[85]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[78]]/ params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[76]])};if(utils[_0x2c3d[86]](_0x1cbex21)){params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[87]]++;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[87]]++};if(utils[_0x2c3d[88]](_0x1cbex21)){params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[89]]++;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[89]]++};params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[90]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[76]]/ (params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[76]]+ params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[87]])* 100,2);params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[91]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[87]]/ (params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[76]]+ params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex22][_0x2c3d[87]])* 100,2);params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[90]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[76]]/ (params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[76]]+ params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[87]])* 100,2);params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[91]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[87]]/ (params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[76]]+ params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[87]])* 100,2)}}})[_0x2c3d[67]](function(_0x1cbex1f){logger[_0x2c3d[66]](_0x2c3d[64],_0x1cbex1f[_0x2c3d[65]])})}}function _0x1cbex25(){return function(){params[_0x2c3d[98]][_0x2c3d[63]]= {total:0,answered:0,sumDuration:0,avgDuration:0,tigerdial:0};return ReportCall[_0x2c3d[97]]({where:{type:[_0x2c3d[98],_0x2c3d[101]],createdAt:{$gte:moment()[_0x2c3d[112]](_0x2c3d[111])}},attributes:[_0x2c3d[113],_0x2c3d[104],_0x2c3d[107]],raw:true})[_0x2c3d[92]](function(_0x1cbex20){if(_0x1cbex20){var _0x1cbex26=_[_0x2c3d[100]](_0x1cbex20,{type:_0x2c3d[98]});var _0x1cbex27=_[_0x2c3d[100]](_0x1cbex20,{type:_0x2c3d[101]});if(_0x1cbex26[_0x2c3d[68]]){params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[70]]= _0x1cbex26[_0x2c3d[68]];params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[102]]= _[_0x2c3d[105]](_0x1cbex26,_0x2c3d[104])[_0x2c3d[103]]|| 0;params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[106]]= _[_0x2c3d[108]](_0x1cbex26,_0x2c3d[107]);if(params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[102]]){params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[109]]= _[_0x2c3d[84]]((_[_0x2c3d[108]](_0x1cbex26[_0x2c3d[110]],_0x2c3d[107])/ params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[102]]));params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[90]]= _[_0x2c3d[84]](params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[102]]/ params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[70]]* 100,1)}};if(_0x1cbex27[_0x2c3d[68]]){params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[101]]= _0x1cbex27[_0x2c3d[68]]}}})[_0x2c3d[67]](function(_0x1cbex1f){logger[_0x2c3d[66]](_0x2c3d[99],_0x1cbex1f[_0x2c3d[65]])})}}BPromise[_0x2c3d[114]]()[_0x2c3d[92]](_0x1cbex1e())[_0x2c3d[92]](_0x1cbex25());return {cdr:function(_0x1cbex1b){return function(_0x1cbex20){_0x1cbex16(_0x2c3d[115],_0x2c3d[116],_0x1cbex1b);if(_0x1cbex1b[_0x2c3d[113]]== _0x2c3d[98]|| _0x1cbex1b[_0x2c3d[113]]== _0x2c3d[101]){if(_0x1cbex1b[_0x2c3d[113]]== _0x2c3d[98]){params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[70]]++;_0x1cbex1b[_0x2c3d[104]]== _0x2c3d[103]&& (params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[102]]++);params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[106]]+= Number(_0x1cbex1b[_0x2c3d[107]]);if(params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[102]]){params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[109]]= _[_0x2c3d[84]](params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[106]]/ params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[102]]);params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[90]]= _[_0x2c3d[84]](params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[102]]/ params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[70]]* 100,1)}}else {params[_0x2c3d[98]][_0x2c3d[63]][_0x2c3d[101]]++};_0x1cbex16(_0x2c3d[117],_0x2c3d[118],params[_0x2c3d[98]][_0x2c3d[63]])}}},send:function(_0x1cbex1b){return function(_0x1cbex20){return BPromise[_0x2c3d[114]]()}},hangup:function(_0x1cbex1b){return function(_0x1cbex20){if(params[_0x2c3d[98]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]]){delete params[_0x2c3d[98]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]]};if(params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]]){delete params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]]};var _0x1cbex28={uniqueid:_0x1cbex1b[_0x2c3d[119]],linkedid:_0x1cbex1b[_0x2c3d[121]],endtime:moment()[_0x2c3d[59]](_0x2c3d[58]),lastevent:_0x2c3d[122],updatedAt:moment()[_0x2c3d[59]](_0x2c3d[58])};_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex1b[_0x2c3d[125]][_0x2c3d[124]](/\/|-/)[1]),_0x2c3d[126],_0x1cbex28);_0x1cbex16(_0x2c3d[127],_0x2c3d[126],_0x1cbex28);_0x1cbex16(_0x2c3d[128],_0x2c3d[126],_0x1cbex28);if(_0x1cbex20){triggers[_0x2c3d[129]](_0x1cbex20)};return BPromise[_0x2c3d[114]]()}},devicestatechange:function(_0x1cbex1b){return function(_0x1cbex20){return User[_0x2c3d[142]]({where:{name:_0x1cbex1b[_0x2c3d[141]][_0x2c3d[140]](_0x2c3d[138],_0x2c3d[139])},raw:true})[_0x2c3d[92]](function(_0x1cbex29){if(_0x1cbex29){var _0x1cbex28=_[_0x2c3d[134]]({newValues:{id:_0x1cbex29[_0x2c3d[132]],status:_0x1cbex1b[_0x2c3d[133]],statusAt:moment()[_0x2c3d[59]](_0x2c3d[58])}},_0x1cbex29,{status:_0x1cbex1b[_0x2c3d[133]],statusAt:moment()[_0x2c3d[59]](_0x2c3d[58])});_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[135],_0x1cbex29[_0x2c3d[136]],_0x1cbex29[_0x2c3d[132]]),_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[128],_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[127],_0x2c3d[137],_0x1cbex28)}})[_0x2c3d[67]](function(_0x1cbex1f){logger[_0x2c3d[131]](_0x2c3d[130],_0x1cbex1f)})}},peerstatus:function(_0x1cbex1b){return function(_0x1cbex20){if(_0x1cbex20&& _0x1cbex20[0]){_[_0x2c3d[93]](_0x1cbex20[1],function(_0x1cbex2a){if(!params[_0x2c3d[143]][_0x1cbex2a[_0x2c3d[31]]]){params[_0x2c3d[143]][_0x1cbex2a[_0x2c3d[31]]]= {name:_0x1cbex2a[_0x2c3d[31]]}};params[_0x2c3d[143]][_0x1cbex2a[_0x2c3d[31]]][_0x2c3d[144]]= _0x1cbex1b[_0x2c3d[144]];_0x1cbex16(_0x2c3d[145],_0x2c3d[146],params[_0x2c3d[143]][_0x1cbex2a[_0x2c3d[31]]])})};return BPromise[_0x2c3d[114]]()}},registry:function(_0x1cbex1b){return function(_0x1cbex20){if(_0x1cbex20&& _0x1cbex20[0]){_[_0x2c3d[93]](_0x1cbex20[1],function(_0x1cbex2a){if(!params[_0x2c3d[143]][_0x1cbex2a[_0x2c3d[31]]]){params[_0x2c3d[143]][_0x1cbex2a[_0x2c3d[31]]]= {name:_0x1cbex2a[_0x2c3d[31]]}};params[_0x2c3d[143]][_0x1cbex2a[_0x2c3d[31]]][_0x2c3d[53]]= _0x1cbex1b[_0x2c3d[53]];_0x1cbex16(_0x2c3d[145],_0x2c3d[146],params[_0x2c3d[143]][_0x1cbex2a[_0x2c3d[31]]])})};return BPromise[_0x2c3d[114]]()}},agentcalled:function(_0x1cbex1b){return function(_0x1cbex20){if(_0x1cbex20){_0x1cbex1b[_0x2c3d[147]]&& (_0x1cbex20[_0x2c3d[148]][_0x2c3d[147]]= _0x1cbex1b[_0x2c3d[147]]);_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex20[_0x2c3d[30]]),_0x2c3d[149],_0x1cbex20);triggers[_0x2c3d[150]](_0x1cbex20)};return User[_0x2c3d[142]]({where:{name:_0x1cbex1b[_0x2c3d[30]],voicePause:false},raw:true})[_0x2c3d[92]](function(_0x1cbex29){if(_0x1cbex29){var _0x1cbex2b=moment()[_0x2c3d[59]](_0x2c3d[58]);var _0x1cbex28=_[_0x2c3d[134]]({newValues:{id:_0x1cbex29[_0x2c3d[132]],queueStatus:_0x2c3d[152],queueStatusAt:_0x1cbex2b,lastQueue:_0x1cbex1b[_0x2c3d[69]]}},_0x1cbex29,{queueStatus:_0x2c3d[152],queueStatusAt:_0x1cbex2b,lastQueue:_0x1cbex1b[_0x2c3d[69]]});_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[135],_0x1cbex29[_0x2c3d[136]],_0x1cbex29[_0x2c3d[132]]),_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[128],_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[127],_0x2c3d[137],_0x1cbex28)}})[_0x2c3d[67]](function(_0x1cbex1f){logger[_0x2c3d[66]](_0x2c3d[151],_0x1cbex1f)})}},agentcomplete:function(_0x1cbex1b){return function(_0x1cbex20){if(_0x1cbex20){triggers[_0x2c3d[153]](_0x1cbex20)};if(params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[74]]){params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[74]]--};if(params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[74]]){params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[74]]--;_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[154],{type:_0x2c3d[74],amount:-1,queue:_0x1cbex1b[_0x2c3d[69]]})};params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[76]]++;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[76]]++;_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[154],{type:_0x2c3d[122],amount:1,queue:_0x1cbex1b[_0x2c3d[69]]});params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[90]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[76]]/ (params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[76]]+ params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[87]])* 100,2);params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[91]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[87]]/ (params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[76]]+ params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[87]])* 100,2);params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[90]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[76]]/ (params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[76]]+ params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[87]])* 100,2);params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[91]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[87]]/ (params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[76]]+ params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[87]])* 100,2);params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[78]]+= Number(_0x1cbex1b[_0x2c3d[78]]);params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[78]]+= Number(_0x1cbex1b[_0x2c3d[78]]);_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[154],{type:_0x2c3d[78],amount:Number(_0x1cbex1b[_0x2c3d[78]]),queue:_0x1cbex1b[_0x2c3d[69]]});params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[85]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[78]]/ params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[76]]);params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[85]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[78]]/ params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[76]]);params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[77]]+= Number(_0x1cbex1b[_0x2c3d[77]]);params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[77]]+= Number(_0x1cbex1b[_0x2c3d[77]]);_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[154],{type:_0x2c3d[77],amount:Number(_0x1cbex1b[_0x2c3d[77]]),queue:_0x1cbex1b[_0x2c3d[69]]});params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[83]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[77]]/ params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[76]]);params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[83]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[77]]/ params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[76]]);var _0x1cbex28;var _0x1cbex2b=moment()[_0x2c3d[59]](_0x2c3d[58]);return ReportAgent[_0x2c3d[142]]({where:{uniqueid:_0x1cbex1b[_0x2c3d[119]],destuniqueid:_0x1cbex1b[_0x2c3d[160]]},raw:true})[_0x2c3d[92]](function(_0x1cbex2c){if(_0x1cbex2c){_0x1cbex28= _[_0x2c3d[134]]({},_0x1cbex2c,{lastevent:_0x2c3d[122],agentcomplete:true,agentcompleteAt:_0x1cbex2b,talktime:Number(_0x1cbex1b[_0x2c3d[78]]),reason:_0x1cbex1b[_0x2c3d[157]]});_0x1cbex1b[_0x2c3d[147]]&& (_0x1cbex28[_0x2c3d[147]]= _0x1cbex1b[_0x2c3d[147]]);_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex2c[_0x2c3d[30]]),_0x2c3d[158],_0x1cbex28)};return ReportQueue[_0x2c3d[142]]({where:{uniqueid:_0x1cbex1b[_0x2c3d[119]]},order:_0x2c3d[159],raw:true})})[_0x2c3d[92]](function(_0x1cbex2c){if(_0x1cbex2c){_0x1cbex28= _[_0x2c3d[134]]({},_0x1cbex2c,{queuecallercomplete:true,queuecallercompleteAt:_0x1cbex2b});_0x1cbex16(_0x1cbex2c[_0x2c3d[69]],_0x2c3d[156],_0x1cbex28)};return User[_0x2c3d[142]]({where:{name:_0x1cbex1b[_0x2c3d[30]]},raw:true})})[_0x2c3d[92]](function(_0x1cbex29){if(_0x1cbex29){var _0x1cbex28=_[_0x2c3d[134]]({newValues:{id:_0x1cbex29[_0x2c3d[132]],queueStatus:_0x2c3d[122],queueStatusAt:_0x1cbex2b,lastQueue:_0x1cbex1b[_0x2c3d[69]]}},_0x1cbex29,{queueStatus:_0x2c3d[122],queueStatusAt:_0x1cbex2b,lastQueue:_0x1cbex1b[_0x2c3d[69]]});_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[135],_0x1cbex29[_0x2c3d[136]],_0x1cbex29[_0x2c3d[132]]),_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[128],_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[127],_0x2c3d[137],_0x1cbex28)}})[_0x2c3d[67]](function(_0x1cbex1f){logger[_0x2c3d[66]](_0x2c3d[155],_0x1cbex1f)})}},agentconnect:function(_0x1cbex1b){return function(_0x1cbex20){if(_0x1cbex20){triggers[_0x2c3d[153]](_0x1cbex20)};if(params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[72]]){params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[72]]--;_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[154],{type:_0x2c3d[72],amount:-1,queue:_0x1cbex1b[_0x2c3d[69]]})};if(params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[72]]){params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[72]]--};if(params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]]){params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]][_0x2c3d[161]]= _0x1cbex1b[_0x2c3d[162]];params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]][_0x2c3d[163]]= _0x1cbex1b[_0x2c3d[163]];params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]][_0x2c3d[77]]= Number(_0x1cbex1b[_0x2c3d[77]]);params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]][_0x2c3d[164]]= Number(_0x1cbex1b[_0x2c3d[164]]);params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]][_0x2c3d[32]]= _0x1cbex1b[_0x2c3d[32]];params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]][_0x2c3d[30]]= _0x1cbex1b[_0x2c3d[30]]};params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[74]]++;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[74]]++;_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[154],{type:_0x2c3d[74],amount:1,queue:_0x1cbex1b[_0x2c3d[69]]});var _0x1cbex28;var _0x1cbex2b=moment()[_0x2c3d[59]](_0x2c3d[58]);return ReportQueue[_0x2c3d[142]]({where:{uniqueid:_0x1cbex1b[_0x2c3d[119]]},order:_0x2c3d[159],raw:true})[_0x2c3d[92]](function(_0x1cbex2c){if(_0x1cbex2c){_0x1cbex28= _[_0x2c3d[134]]({},_0x1cbex2c,{queuecallerleaveAt:moment()[_0x2c3d[59]](_0x2c3d[58]),holdtime:_0x1cbex1b[_0x2c3d[77]],assigned:true,lastAssignedTo:_0x1cbex1b[_0x2c3d[30]]});_0x1cbex16(_0x1cbex2c[_0x2c3d[69]],_0x2c3d[156],_0x1cbex28)};return ReportAgent[_0x2c3d[142]]({where:{uniqueid:_0x1cbex1b[_0x2c3d[119]],destuniqueid:_0x1cbex1b[_0x2c3d[160]]},raw:true})})[_0x2c3d[92]](function(_0x1cbex2c){if(_0x1cbex2c){_0x1cbex28= _[_0x2c3d[134]]({},_0x1cbex2c,{lastevent:_0x2c3d[166],agentconnectAt:moment()[_0x2c3d[59]](_0x2c3d[58]),holdtime:_0x1cbex1b[_0x2c3d[77]]});_0x1cbex1b[_0x2c3d[147]]&& (_0x1cbex28[_0x2c3d[147]]= _0x1cbex1b[_0x2c3d[147]]);_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex2c[_0x2c3d[30]]),_0x2c3d[158],_0x1cbex28)};return ReportAgent[_0x2c3d[97]]({where:{uniqueid:_0x1cbex1b[_0x2c3d[119]],destuniqueid:{$ne:_0x1cbex1b[_0x2c3d[160]]},reason:null},raw:true})})[_0x2c3d[92]](function(_0x1cbex2e){if(_0x1cbex2e&& _0x1cbex2e[_0x2c3d[68]]){_[_0x2c3d[93]](_0x1cbex2e,function(_0x1cbex2c){_0x1cbex28= _[_0x2c3d[134]]({},_0x1cbex2c,{lastevent:_0x2c3d[167],agentringnoanswer:true,agentringnoanswerAt:_0x1cbex2b,reason:_0x2c3d[167],answeredelsewheredestinationuniqueid:_0x1cbex1b[_0x2c3d[160]],answeredelsewheremembername:_0x1cbex1b[_0x2c3d[30]]});_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex2c[_0x2c3d[30]]),_0x2c3d[158],_0x1cbex28)})};return User[_0x2c3d[142]]({where:{name:_0x1cbex1b[_0x2c3d[30]]},raw:true})})[_0x2c3d[92]](function(_0x1cbex29){if(_0x1cbex29){var _0x1cbex28=_[_0x2c3d[134]]({newValues:{id:_0x1cbex29[_0x2c3d[132]],queueStatus:_0x2c3d[166],queueStatusAt:_0x1cbex2b,lastQueue:_0x1cbex1b[_0x2c3d[69]]}},_0x1cbex29,{queueStatus:_0x2c3d[166],queueStatusAt:_0x1cbex2b,lastQueue:_0x1cbex1b[_0x2c3d[69]]});_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[135],_0x1cbex29[_0x2c3d[136]],_0x1cbex29[_0x2c3d[132]]),_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[128],_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[127],_0x2c3d[137],_0x1cbex28)};return User[_0x2c3d[97]]({where:{lastQueue:_0x1cbex1b[_0x2c3d[69]],name:{$ne:_0x1cbex1b[_0x2c3d[30]]}},raw:true})})[_0x2c3d[92]](function(_0x1cbex2d){if(_0x1cbex2d&& _0x1cbex2d[_0x2c3d[68]]){_[_0x2c3d[93]](_0x1cbex2d,function(_0x1cbex29){var _0x1cbex28=_[_0x2c3d[134]]({newValues:{id:_0x1cbex29[_0x2c3d[132]],queueStatus:_0x2c3d[122],queueStatusAt:_0x1cbex2b}},_0x1cbex29,{queueStatus:_0x2c3d[122],queueStatusAt:_0x1cbex2b});_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[135],_0x1cbex29[_0x2c3d[136]],_0x1cbex29[_0x2c3d[132]]),_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[128],_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[127],_0x2c3d[137],_0x1cbex28)})}})[_0x2c3d[67]](function(_0x1cbex1f){logger[_0x2c3d[66]](_0x2c3d[165],_0x1cbex1f)})}},agentringnoanswer:function(_0x1cbex1b){return function(_0x1cbex20){if(_0x1cbex20){triggers[_0x2c3d[153]](_0x1cbex20)};var _0x1cbex28;var _0x1cbex2b=moment()[_0x2c3d[59]](_0x2c3d[58]);return User[_0x2c3d[142]]({where:{name:_0x1cbex1b[_0x2c3d[30]]},raw:true})[_0x2c3d[92]](function(_0x1cbex29){if(_0x1cbex29){var _0x1cbex28=_[_0x2c3d[134]]({newValues:{id:_0x1cbex29[_0x2c3d[132]],queueStatus:_0x2c3d[122],queueStatusAt:_0x1cbex2b,lastQueue:_0x1cbex1b[_0x2c3d[69]]}},_0x1cbex29,{queueStatus:_0x2c3d[122],queueStatusAt:_0x1cbex2b,lastQueue:_0x1cbex1b[_0x2c3d[69]]});_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[135],_0x1cbex29[_0x2c3d[136]],_0x1cbex29[_0x2c3d[132]]),_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[128],_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[127],_0x2c3d[137],_0x1cbex28)};return ReportAgent[_0x2c3d[142]]({where:{uniqueid:_0x1cbex1b[_0x2c3d[119]],destuniqueid:_0x1cbex1b[_0x2c3d[160]]},raw:true})})[_0x2c3d[92]](function(_0x1cbex2c){if(_0x1cbex2c){_0x1cbex28= _[_0x2c3d[134]]({},_0x1cbex2c,{lastevent:_0x2c3d[169],agentringnoanswer:true,agentringnoanswerAt:moment()[_0x2c3d[59]](_0x2c3d[58]),reason:_0x2c3d[169]});_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex2c[_0x2c3d[30]]),_0x2c3d[158],_0x1cbex28)}})[_0x2c3d[67]](function(_0x1cbex1f){logger[_0x2c3d[66]](_0x2c3d[168],_0x1cbex1f)})}},queuememberadded:function(_0x1cbex1b){return function(_0x1cbex20){if(_0x1cbex20){_0x1cbex16(_0x1cbex20[_0x2c3d[69]],_0x2c3d[170],_0x1cbex20);_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex20.UserId),_0x2c3d[170],_0x1cbex20)};return BPromise[_0x2c3d[114]]()}},queuememberremoved:function(_0x1cbex1b){return function(_0x1cbex20){if(params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]]){delete params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[115]][_0x1cbex1b[_0x2c3d[30]]]};return User[_0x2c3d[142]]({where:{name:_0x1cbex1b[_0x2c3d[32]][_0x2c3d[140]](_0x2c3d[138],_0x2c3d[139])},raw:true})[_0x2c3d[92]](function(_0x1cbex29){if(_0x1cbex29){_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[172],{queue:_0x1cbex1b[_0x2c3d[69]],UserId:_0x1cbex29[_0x2c3d[132]]});_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex29[_0x2c3d[132]]),_0x2c3d[172],{queue:_0x1cbex1b[_0x2c3d[69]],UserId:_0x1cbex29[_0x2c3d[132]]})}})[_0x2c3d[67]](function(_0x1cbex1f){logger[_0x2c3d[66]](_0x2c3d[171],_0x1cbex1f)})}},queuememberpause:function(_0x1cbex1b){return function(_0x1cbex20){if(_0x1cbex20){_0x1cbex16(_0x1cbex20[_0x2c3d[69]],_0x2c3d[170],_0x1cbex20);_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex20.UserId),_0x2c3d[170],_0x1cbex20)}}},queuememberpenalty:function(_0x1cbex1b){return function(_0x1cbex20){return BPromise[_0x2c3d[114]]()}},queuememberringinuse:function(_0x1cbex1b){return function(_0x1cbex20){return BPromise[_0x2c3d[114]]()}},queuemember:function(_0x1cbex1b){return function(_0x1cbex20){_0x1cbex1a(_0x1cbex1b);_0x1cbex1c(_0x1cbex1b[_0x2c3d[69]]);params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[115]][_0x1cbex1b[_0x2c3d[31]]]= _0x1cbex1b;return BPromise[_0x2c3d[114]]()}},queuecallerjoin:function(_0x1cbex1b){return function(_0x1cbex20){if(!params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]]){params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]]= {};params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[72]]= 0;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[74]]= 0;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[76]]= 0;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[87]]= 0;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[89]]= 0;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[77]]= 0;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[78]]= 0;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[83]]= 0;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[85]]= 0;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[90]]= 0;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[91]]= 0;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[70]]= 0};params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]]= {channel:_0x1cbex1b[_0x2c3d[125]],channelstate:Number(_0x1cbex1b[_0x2c3d[173]]),channelstatedesc:_0x1cbex1b[_0x2c3d[174]],calleridnum:_0x1cbex1b[_0x2c3d[175]],calleridname:_0x1cbex1b[_0x2c3d[176]],exten:_0x1cbex1b[_0x2c3d[177]],priority:Number(_0x1cbex1b[_0x2c3d[178]]),uniqueid:_0x1cbex1b[_0x2c3d[119]],queue:_0x1cbex1b[_0x2c3d[69]],position:Number(_0x1cbex1b[_0x2c3d[179]]),count:Number(_0x1cbex1b[_0x2c3d[180]])};params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[72]]++;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[72]]++;_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[154],{type:_0x2c3d[70],amount:1,queue:_0x1cbex1b[_0x2c3d[69]]});params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[70]]++;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[70]]++;_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[154],{type:_0x2c3d[72],amount:1,queue:_0x1cbex1b[_0x2c3d[69]]});if(_0x1cbex20){_0x1cbex16(_0x1cbex20[_0x2c3d[69]],_0x2c3d[181],_0x1cbex20)};return BPromise[_0x2c3d[114]]()}},queuecallerabandon:function(_0x1cbex1b){return function(_0x1cbex20){if(_0x1cbex20&& _0x1cbex20[_0x2c3d[182]]&& _0x1cbex20[_0x2c3d[182]][0]){_[_0x2c3d[93]](_0x1cbex20[_0x2c3d[182]][1],function(_0x1cbex2c){_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex2c[_0x2c3d[30]]),_0x2c3d[158],_0x1cbex2c)})};if(_0x1cbex20&& _0x1cbex20[_0x2c3d[183]]){_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[156],_0x1cbex20[_0x2c3d[183]]);_0x1cbex20[_0x2c3d[183]][_0x2c3d[148]][_0x2c3d[184]]= _0x2c3d[87];_0x1cbex20[_0x2c3d[183]][_0x2c3d[185]][_0x2c3d[184]]= true;triggers[_0x2c3d[153]](_0x1cbex20[_0x2c3d[183]])};var _0x1cbex28;var _0x1cbex2b=moment()[_0x2c3d[59]](_0x2c3d[58]);if(params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[72]]){params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[72]]--;_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[154],{type:_0x2c3d[72],amount:-1,queue:_0x1cbex1b[_0x2c3d[69]]})};if(params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[72]]){params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[72]]--};if(params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]]){params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]][_0x2c3d[77]]= Number(_0x1cbex1b[_0x2c3d[77]]);params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]][_0x2c3d[179]]= Number(_0x1cbex1b[_0x2c3d[179]]);params[_0x2c3d[62]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]][_0x2c3d[186]]= Number(_0x1cbex1b[_0x2c3d[186]])};params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[87]]++;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[87]]++;_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[154],{type:_0x2c3d[187],amount:1,queue:_0x1cbex1b[_0x2c3d[69]]});params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[90]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[76]]/ (params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[76]]+ params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[87]])* 100,2);params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[91]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[87]]/ (params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[76]]+ params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[87]])* 100,2);params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[90]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[76]]/ (params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[76]]+ params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[87]])* 100,2);params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[91]]= _[_0x2c3d[84]](params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[87]]/ (params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[76]]+ params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[87]])* 100,2);return User[_0x2c3d[97]]({where:{lastQueue:_0x1cbex1b[_0x2c3d[69]]},raw:true})[_0x2c3d[92]](function(_0x1cbex2f){if(_0x1cbex2f&& _0x1cbex2f[_0x2c3d[68]]){var _0x1cbex28;_[_0x2c3d[93]](_0x1cbex2f,function(_0x1cbex30){_0x1cbex28= _[_0x2c3d[134]]({newValues:{id:_0x1cbex30[_0x2c3d[132]],queueStatus:_0x2c3d[122],queueStatusAt:_0x1cbex2b,lastQueue:_0x1cbex1b[_0x2c3d[69]]}},_0x1cbex30,{id:_0x1cbex30[_0x2c3d[132]],queueStatus:_0x2c3d[122],queueStatusAt:_0x1cbex2b,lastQueue:_0x1cbex1b[_0x2c3d[69]]});_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[135],_0x1cbex30[_0x2c3d[136]],_0x1cbex30[_0x2c3d[132]]),_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[128],_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[127],_0x2c3d[137],_0x1cbex28)})}})[_0x2c3d[67]](function(_0x1cbex1f){logger[_0x2c3d[66]](_0x2c3d[188],_0x1cbex1f)})}},blindtransfer:function(_0x1cbex1b){return function(_0x1cbex20){_0x1cbex16(null,_0x1cbex1b[_0x2c3d[26]][_0x2c3d[189]](),_0x1cbex1b);return BPromise[_0x2c3d[114]]()}},attendedtransfer:function(_0x1cbex1b){return function(_0x1cbex20){_0x1cbex16(null,_0x1cbex1b[_0x2c3d[26]][_0x2c3d[189]](),_0x1cbex1b);return BPromise[_0x2c3d[114]]()}},dialbegin:function(_0x1cbex1b){return function(_0x1cbex20){params[_0x2c3d[98]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]]= {channel:_0x1cbex1b[_0x2c3d[125]],channelstate:Number(_0x1cbex1b[_0x2c3d[173]]),channelstatedesc:_0x1cbex1b[_0x2c3d[174]],calleridnum:_0x1cbex1b[_0x2c3d[175]],calleridname:_0x1cbex1b[_0x2c3d[176]],context:_0x1cbex1b[_0x2c3d[190]],exten:_0x1cbex1b[_0x2c3d[177]],priority:Number(_0x1cbex1b[_0x2c3d[178]]),dialstring:_0x1cbex1b[_0x2c3d[191]]};if(_0x1cbex1b[_0x2c3d[125]]){var _0x1cbex28=_[_0x2c3d[192]](_0x1cbex1b,{starttime:moment()[_0x2c3d[59]](_0x2c3d[58]),lastevent:_0x2c3d[152],updatedAt:moment()[_0x2c3d[59]](_0x2c3d[58])});_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex1b[_0x2c3d[125]][_0x2c3d[124]](/\/|-/)[1]),_0x2c3d[193],_0x1cbex28);_0x1cbex16(_0x2c3d[128],_0x2c3d[126],_[_0x2c3d[192]](_0x1cbex28,{role:_0x2c3d[128]}));_0x1cbex16(_0x2c3d[127],_0x2c3d[126],_0x1cbex28,_[_0x2c3d[192]](_0x1cbex28,{role:_0x2c3d[127]}));if(_0x1cbex20){triggers[_0x2c3d[129]](_0x1cbex20)}};return BPromise[_0x2c3d[114]]()}},dialend:function(_0x1cbex1b){return function(_0x1cbex20){if(params[_0x2c3d[98]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]]){params[_0x2c3d[98]][_0x2c3d[120]][_0x1cbex1b[_0x2c3d[119]]][_0x2c3d[194]]= _0x1cbex1b[_0x2c3d[194]]};if(_0x1cbex1b[_0x2c3d[125]]){var _0x1cbex2b=moment()[_0x2c3d[59]](_0x2c3d[58]);var _0x1cbex28={dialstatus:_0x1cbex1b[_0x2c3d[194]],lastevent:(_0x1cbex1b[_0x2c3d[194]]=== _0x2c3d[103])?_0x2c3d[166]:_0x2c3d[122],answertime:(_0x1cbex1b[_0x2c3d[194]]=== _0x2c3d[103])?_0x1cbex2b:null,uniqueid:_0x1cbex1b[_0x2c3d[119]],linkedid:_0x1cbex1b[_0x2c3d[121]],destuniqueid:_0x1cbex1b[_0x2c3d[160]],destlinkedid:_0x1cbex1b[_0x2c3d[195]],updatedAt:_0x1cbex2b};_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex1b[_0x2c3d[125]][_0x2c3d[124]](/\/|-/)[1]),_0x2c3d[126],_0x1cbex28);_0x1cbex16(_0x2c3d[128],_0x2c3d[126],_0x1cbex28);_0x1cbex16(_0x2c3d[127],_0x2c3d[126],_0x1cbex28);if(_0x1cbex20){triggers[_0x2c3d[129]](_0x1cbex20)}};return BPromise[_0x2c3d[114]]()}},varset:function(_0x1cbex1b){return function(_0x1cbex20){if(_0x1cbex1b[_0x2c3d[197]][_0x2c3d[55]](_0x2c3d[196])){_0x1cbex16(_0x2c3d[128],_0x2c3d[193],{uniqueid:_0x1cbex1b[_0x2c3d[119]],routeId:_0x1cbex1b[_0x2c3d[198]],updatedAt:moment()[_0x2c3d[59]](_0x2c3d[58])});_0x1cbex16(_0x2c3d[127],_0x2c3d[193],{uniqueid:_0x1cbex1b[_0x2c3d[119]],routeId:_0x1cbex1b[_0x2c3d[198]],updatedAt:moment()[_0x2c3d[59]](_0x2c3d[58])})};if(_0x1cbex1b){triggers[_0x2c3d[199]](_0x1cbex1b)};return BPromise[_0x2c3d[114]]()}},queuecallerunmanaged:function(_0x1cbex1b){return function(_0x1cbex20){if(_0x1cbex20){params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[89]]+= 1;params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[89]]+= 1;_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[154],{type:_0x2c3d[89],amount:1,queue:_0x1cbex1b[_0x2c3d[69]]});if(params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[72]]){params[_0x2c3d[62]][_0x2c3d[61]][_0x1cbex1b[_0x2c3d[69]]][_0x2c3d[72]]-= 1};if(params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[72]]){params[_0x2c3d[62]][_0x2c3d[63]][_0x2c3d[72]]-= 1;_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[154],{type:_0x2c3d[72],amount:-1,queue:_0x1cbex1b[_0x2c3d[69]]})};_0x1cbex16(_0x1cbex1b[_0x2c3d[69]],_0x2c3d[156],_0x1cbex20);var _0x1cbex2b=moment()[_0x2c3d[59]](_0x2c3d[58]);return User[_0x2c3d[97]]({where:{lastQueue:_0x1cbex1b[_0x2c3d[69]]},raw:true})[_0x2c3d[92]](function(_0x1cbex2f){if(_0x1cbex2f&& _0x1cbex2f[_0x2c3d[68]]){var _0x1cbex28;_[_0x2c3d[93]](_0x1cbex2f,function(_0x1cbex30){_0x1cbex28= _[_0x2c3d[134]]({newValues:{id:_0x1cbex30[_0x2c3d[132]],queueStatus:_0x2c3d[122],queueStatusAt:_0x1cbex2b,lastQueue:_0x1cbex1b[_0x2c3d[69]]}},_0x1cbex30,{id:_0x1cbex30[_0x2c3d[132]],queueStatus:_0x2c3d[122],queueStatusAt:_0x1cbex2b,lastQueue:_0x1cbex1b[_0x2c3d[69]]});_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[135],_0x1cbex30[_0x2c3d[136]],_0x1cbex30[_0x2c3d[132]]),_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[128],_0x2c3d[137],_0x1cbex28);_0x1cbex16(_0x2c3d[127],_0x2c3d[137],_0x1cbex28)})}})[_0x2c3d[67]](function(_0x1cbex1f){logger[_0x2c3d[66]](_0x2c3d[188],_0x1cbex1f)})}}},agentUpdate:function(_0x1cbex30){return function(){_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex30[_0x2c3d[132]]),_0x2c3d[137],_0x1cbex30);_0x1cbex16(_0x2c3d[128],_0x2c3d[137],_0x1cbex30);_0x1cbex16(_0x2c3d[127],_0x2c3d[137],_0x1cbex30)}},console:function(_0x1cbex31){_0x1cbex16(_0x1cbex31[_0x2c3d[200]],util[_0x2c3d[59]](_0x2c3d[201],_0x1cbex31[_0x2c3d[113]]),_0x1cbex31[_0x2c3d[202]])},realtimeQueueMembers:function(_0x1cbex32){return function(){_[_0x2c3d[204]](params[_0x2c3d[62]][_0x2c3d[61]],function(_0x1cbex1d,_0x1cbex22){if(_[_0x2c3d[203]](_0x1cbex32,_0x1cbex22)){_[_0x2c3d[204]](_0x1cbex1d[_0x2c3d[115]],function(_0x1cbex30){_0x1cbex16(_0x1cbex22,_0x2c3d[170],_0x1cbex30)})}})}},updateTriggers:function(_0x1cbex31){return function(){return triggers[_0x2c3d[205]](_0x1cbex31)}},queueAdd:function(_0x1cbex33,_0x1cbex34){return function(){if(_0x1cbex33&& _0x1cbex34){_[_0x2c3d[93]](_0x1cbex33,function(_0x1cbex20){_0x1cbex16(null,util[_0x2c3d[59]](_0x2c3d[206],_0x1cbex34),_0x1cbex20[0])})}}},queueRemove:function(_0x1cbex20,_0x1cbex34){return function(){if(_0x1cbex20&& _0x1cbex34){_0x1cbex16(null,util[_0x2c3d[59]](_0x2c3d[207],_0x1cbex34),_0x1cbex20)}}},checkTriggers:function(_0x1cbex31){return function(){return triggers[_0x2c3d[208]](_0x1cbex31)}},videoOn:function(_0x1cbex1b){return function(){return triggers[_0x2c3d[209]](_0x1cbex1b)}},inboundInit:function(){return function(){return BPromise[_0x2c3d[114]]()[_0x2c3d[92]](_0x1cbex1e())}},outboundInit:function(){return function(){return BPromise[_0x2c3d[114]]()[_0x2c3d[92]](_0x1cbex25())}},reportFaxUpdate:function(_0x1cbex35){return function(){_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[123],_0x1cbex35[_0x2c3d[210]]),_0x2c3d[137],_0x1cbex35);_0x1cbex16(_0x2c3d[127],_0x2c3d[211],_0x1cbex35)}},widgetValues:function(_0x1cbex36,_0x1cbex29){return function(){_[_0x2c3d[204]](_0x1cbex36,function(_0x1cbex37,_0x1cbex38){_0x1cbex16(util[_0x2c3d[59]](_0x2c3d[135],_0x1cbex29[_0x2c3d[136]],_0x1cbex29[_0x2c3d[132]]),_0x2c3d[212]+ _0x1cbex38,_0x1cbex37)})}},receivefax:function(_0x1cbex1b){return function(_0x1cbex31){if(_0x1cbex31){return triggers[_0x2c3d[213]](_0x1cbex31)};return null}}}}