Built motion from commit e1760111.|2.6.18
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index 809f966..9368e0a 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaa4e=['lastAssignedTo','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','syncVarSet','[%s][voiceQueueReport][varset]','addVariable','CONTINUE','queuecallerexitAt','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','value','emitVoiceQueueChannelRemove','variable','queueposition','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','handleHangup','length','sumHoldTime','diff','sumDuration','sumBillable','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','hangup','custom:voiceQueueReport','[%s][voiceQueueReport][handleHangup]','[%s][voiceQueueReport][hangup]','cause-txt','transferid','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','mohtime','milliseconds','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','applicationdata','appdata','CDR(routeAlias)','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','[%s][voiceQueueReport][newexten]','util','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','defaults','redis','localhost','prototype','tail','queueReports','realtime','agents','channels','queueChannels','voiceQueues','summary','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','queuemember','syncQueueMember','syncQueueStatusComplete','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','queuecallerexit','queuecallercomplete','clearZombieChannels','switch','sequence','enqueue','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','campaigns','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','emitInboundVoiceQueueSummary','type','inbound','voice_queue:save','isNotNull','isUndefined','queues','isRunning','then','actionid','queuestatus','createQueueSummaryReport','name','summaryEvent','createReport','handleInboundQueueSummaryReport','assign','queue','custom:queuesummary','statusRequests','syncQueueSummaryComplete','completeEvent','push','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','keys','queuecallerjoin','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','ABANDONED'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0xaa4e,0x153));var _0xeaa4=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xaa4e[_0xfae23b];return _0x200640;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xeaa4('0x0'));var Redis=require('ioredis');var config=require(_0xeaa4('0x1'));var logger=require(_0xeaa4('0x2'))(_0xeaa4('0x3'));var ami=require(_0xeaa4('0x4'));var QueueReport=require(_0xeaa4('0x5'));var VoiceQueueSummary=require(_0xeaa4('0x6'));config['redis']=_[_0xeaa4('0x7')](config[_0xeaa4('0x8')],{'host':_0xeaa4('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xeaa4('0x8')]));var Sequence=function(){};Sequence[_0xeaa4('0xa')]['enqueue']=function(_0xf0bc73){this[_0xeaa4('0xb')]=this[_0xeaa4('0xb')]?this[_0xeaa4('0xb')]['finally'](_0xf0bc73):_0xf0bc73();};function VoiceQueueReport(_0xa181d4){this['sequence']=new Sequence();this[_0xeaa4('0xc')]={};this[_0xeaa4('0xd')]=_0xa181d4;this['agents']=_0xa181d4[_0xeaa4('0xe')];this[_0xeaa4('0xf')]=_0xa181d4[_0xeaa4('0x10')];this['voiceQueues']=_0xa181d4[_0xeaa4('0x11')];this['campaigns']=_0xa181d4['campaigns'];this[_0xeaa4('0x12')]=initializeSummary();this[_0xeaa4('0x13')]={};ami['on'](_0xeaa4('0x14'),this[_0xeaa4('0x15')][_0xeaa4('0x16')](this));ami['on'](_0xeaa4('0x17'),this['syncQueueSummaryComplete'][_0xeaa4('0x16')](this));ami['on'](_0xeaa4('0x18'),this[_0xeaa4('0x19')]['bind'](this));ami['on']('queuestatuscomplete',this[_0xeaa4('0x1a')][_0xeaa4('0x16')](this));ami['on']('queuecallerjoin',this['syncQueueCallerJoin'][_0xeaa4('0x16')](this));ami['on'](_0xeaa4('0x1b'),this[_0xeaa4('0x1c')][_0xeaa4('0x16')](this));ami['on']('queuecallerleave',this[_0xeaa4('0x1d')][_0xeaa4('0x16')](this));ami['on'](_0xeaa4('0x1e'),this[_0xeaa4('0x1f')]['bind'](this));ami['on']('agentconnect',this[_0xeaa4('0x20')][_0xeaa4('0x16')](this));ami['on'](_0xeaa4('0x21'),this['syncVarSet']['bind'](this));ami['on']('hangup',this[_0xeaa4('0x22')][_0xeaa4('0x16')](this));ami['on'](_0xeaa4('0x23'),this['syncFullyBooted'][_0xeaa4('0x16')](this));ami['on'](_0xeaa4('0x24'),this[_0xeaa4('0x25')][_0xeaa4('0x16')](this));ami['on']('musiconholdstop',this[_0xeaa4('0x26')][_0xeaa4('0x16')](this));ami['on']('attendedtransfer',this[_0xeaa4('0x27')][_0xeaa4('0x16')](this));ami['on'](_0xeaa4('0x28'),this[_0xeaa4('0x29')][_0xeaa4('0x16')](this));this[_0xeaa4('0x2a')]();this[_0xeaa4('0x2b')]();}function clearChannels(_0x51e82d){if(!_[_0xeaa4('0x2c')](_0x51e82d)){for(var _0x460a2d in _0x51e82d){if(_0x51e82d['hasOwnProperty'](_0x460a2d)){delete _0x51e82d[_0x460a2d];}}}}function clearCampaigns(_0xd01abb){if(!_[_0xeaa4('0x2c')](_0xd01abb)){for(var _0x12f085 in _0xd01abb){if(_0xd01abb[_0xeaa4('0x2d')](_0x12f085)){_0xd01abb[_0x12f085][_0xeaa4('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x9576fd){if(!_['isEmpty'](_0x9576fd)){for(var _0x261414 in _0x9576fd){if(_0x9576fd[_0xeaa4('0x2d')](_0x261414)){_0x9576fd[_0x261414][_0xeaa4('0x2e')]=0x0;_0x9576fd[_0x261414][_0xeaa4('0x2f')]=0x0;_0x9576fd[_0x261414][_0xeaa4('0x30')]=0x0;_0x9576fd[_0x261414][_0xeaa4('0x31')]=0x0;_0x9576fd[_0x261414][_0xeaa4('0x32')]=!![];}}}}function clearAgentBooked(_0x6ec5e8){if(!_[_0xeaa4('0x2c')](_0x6ec5e8)){for(var _0x563421 in _0x6ec5e8){if(_0x6ec5e8[_0xeaa4('0x2d')](_0x563421)){_0x6ec5e8[_0x563421][_0xeaa4('0x33')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x559471){return _0x559471[_0xeaa4('0x34')]||_0x559471['queuecallerabandon']||_0x559471[_0xeaa4('0x35')];}VoiceQueueReport['prototype'][_0xeaa4('0x36')]=function(){var _0x3fd462=this;for(var _0x3d9e91 in this['channels']){if(this[_0xeaa4('0xf')][_0xeaa4('0x2d')](_0x3d9e91)&&!this[_0xeaa4('0xf')][_0x3d9e91][_0xeaa4('0x37')]){this[_0xeaa4('0x38')][_0xeaa4('0x39')](function(){if(!_[_0xeaa4('0x3a')](_0x3fd462[_0xeaa4('0xf')][_0x3d9e91])){return ami[_0xeaa4('0x3b')]({'action':_0xeaa4('0x3c'),'channel':_0x3fd462[_0xeaa4('0xf')][_0x3d9e91][_0xeaa4('0x3d')]})[_0xeaa4('0x3e')](function(_0x55e5eb){if(_0x55e5eb[_0xeaa4('0x3f')]===_0xeaa4('0x40')){setTimeout(function(){if(_0x3fd462[_0xeaa4('0xf')][_0x3d9e91]){delete _0x3fd462['channels'][_0x3d9e91];logger[_0xeaa4('0x41')]('[%s][voiceQueueReport][checkChannel]',_0x3d9e91,util[_0xeaa4('0x42')](_0x55e5eb,{'showHidden':![],'depth':null}));}if(_0x3fd462['queueReports'][_0x3d9e91]){delete _0x3fd462[_0xeaa4('0xc')][_0x3d9e91];logger[_0xeaa4('0x41')](_0xeaa4('0x43'),_0x3d9e91,util[_0xeaa4('0x42')](_0x55e5eb,{'showHidden':![],'depth':null}));}if(_0x3fd462[_0xeaa4('0x13')][_0x3d9e91]){delete _0x3fd462[_0xeaa4('0x13')][_0x3d9e91];logger['error'](_0xeaa4('0x44'),_0x3d9e91,util[_0xeaa4('0x42')](_0x55e5eb,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0x45')]=function(){logger['error'](_0xeaa4('0x46'));clearChannels(this['channels']);this['clearQueueReport'](this[_0xeaa4('0xc')]);clearAgentBooked(this[_0xeaa4('0xe')]);clearVoiceQueues(this[_0xeaa4('0x11')]);clearCampaigns(this[_0xeaa4('0x47')]);this[_0xeaa4('0x12')]=initializeSummary();};VoiceQueueReport['prototype'][_0xeaa4('0x48')]=function(_0x1301a4){var _0x5d8772=this;if(!_['isEmpty'](_0x1301a4)){for(var _0x3aba6f in _0x1301a4){if(_0x1301a4[_0xeaa4('0x2d')](_0x3aba6f)){_0x5d8772['emitVoiceQueueChannelRemove'](_0x1301a4[_0x3aba6f],_0xeaa4('0x49'));delete _0x1301a4[_0x3aba6f];}}}};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0x4a')]=function(_0x95a97e,_0x537581,_0x1c13b7){io['to'](_0x95a97e)[_0xeaa4('0x4a')](_0x537581,_0x1c13b7);};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0x4b')]=function(_0x113f0e,_0x238173){logger[_0xeaa4('0x4c')](_0xeaa4('0x4d')+_0x238173+_0xeaa4('0x4e'),_0x113f0e[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x113f0e,{'showHidden':![],'depth':null}));this[_0xeaa4('0x4a')](util[_0xeaa4('0x50')](_0xeaa4('0x51'),_0x113f0e['queue']),_0xeaa4('0x52'),_0x113f0e);io[_0xeaa4('0x4a')](_0xeaa4('0x53'),_0x113f0e);};VoiceQueueReport[_0xeaa4('0xa')]['emitVoiceQueueChannelRemove']=function(_0x2f9e72,_0x1ec50c){logger['debug']('[%s][voiceQueueReport]['+_0x1ec50c+_0xeaa4('0x54'),_0x2f9e72[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x2f9e72,{'showHidden':![],'depth':null}));if(_0x2f9e72[_0xeaa4('0x55')]===_0xeaa4('0x56')){return;}this[_0xeaa4('0x4a')](util[_0xeaa4('0x50')](_0xeaa4('0x51'),_0x2f9e72['queue']),_0xeaa4('0x57'),_0x2f9e72);io[_0xeaa4('0x4a')]('voice_queue_presence:remove',_0x2f9e72);};VoiceQueueReport['prototype'][_0xeaa4('0x58')]=function(_0x57f687){if(_0x57f687[_0xeaa4('0x59')]===_0xeaa4('0x5a')){logger[_0xeaa4('0x4c')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util['inspect'](_0x57f687,{'showHidden':![],'depth':null}));this[_0xeaa4('0x4a')](util[_0xeaa4('0x50')](_0xeaa4('0x51'),_0x57f687['name']),_0xeaa4('0x5b'),_0x57f687);}};VoiceQueueReport['prototype'][_0xeaa4('0x5c')]=function(_0x32f014){return _0x32f014!==null&&!_[_0xeaa4('0x5d')](_0x32f014);};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0x2b')]=function(){var _0x53f250=this;setInterval(function(){_0x53f250[_0xeaa4('0x36')]();ami[_0xeaa4('0x3b')]({'action':_0xeaa4('0x5e')})[_0xeaa4('0x3e')](function(_0x3cf285){logger[_0xeaa4('0x41')]('[voiceQueueReport][queues]',util[_0xeaa4('0x42')](_0x3cf285,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0xeaa4('0x2a')]=function(){var _0x3673ad=this;setInterval(function(){if(!_0x3673ad[_0xeaa4('0x12')][_0xeaa4('0x5f')]){return ami['Action']({'action':_0xeaa4('0x14')})[_0xeaa4('0x60')](function(_0x538a44){_0x3673ad['summary']['id']=_0x538a44[_0xeaa4('0x61')];_0x3673ad['summary']['isRunning']=!![];_0x3673ad['summary'][_0xeaa4('0x62')][_0x538a44[_0xeaa4('0x61')]]={};})[_0xeaa4('0x3e')](function(_0x1f96f3){logger[_0xeaa4('0x41')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x1f96f3,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xeaa4('0x63')]=function(_0x523a6d,_0x34c928){var _0x1ef49e=this[_0xeaa4('0x12')][_0xeaa4('0x5e')][_0x523a6d[_0xeaa4('0x64')]][_0xeaa4('0x65')];var _0x1180df=new VoiceQueueSummary(_0x523a6d);return _0x1180df[_0xeaa4('0x66')](_0x34c928['agents'],this[_0xeaa4('0xe')],_0x1ef49e,this[_0xeaa4('0xd')]['channels']);};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0x67')]=function(_0x482fb9,_0x48ad58){var _0x597019=this[_0xeaa4('0x63')](_0x482fb9,_0x48ad58);var _0x56a0f5=![];_0x56a0f5=_0x597019['compareToInboundQueue'](_0x482fb9);if(_0x56a0f5){Object[_0xeaa4('0x68')](_0x482fb9,_0x597019);this['realtime'][_0xeaa4('0x11')][_0x482fb9[_0xeaa4('0x64')]]=_0x482fb9;this['emitInboundVoiceQueueSummary'](_0x597019);}};VoiceQueueReport[_0xeaa4('0xa')]['syncQueueStatusComplete']=function(_0x39c204){var _0x17571e=null;var _0x3d1591=this[_0xeaa4('0x12')]['id'];if(this[_0xeaa4('0x12')][_0xeaa4('0x62')][_0x3d1591]){_0x17571e=this[_0xeaa4('0x12')][_0xeaa4('0x62')][_0x3d1591][_0x39c204[_0xeaa4('0x61')]];}if(!_0x17571e){this[_0xeaa4('0x12')]=initializeSummary();return;}var _0x3487cc=this[_0xeaa4('0x11')][_0x17571e[_0xeaa4('0x69')]];if(_0x3487cc['type']===_0xeaa4('0x5a')){this[_0xeaa4('0x67')](_0x3487cc,_0x17571e);}else if(_0x3487cc[_0xeaa4('0x59')]==='outbound'){var _0x5fb0f4=this[_0xeaa4('0x63')](_0x3487cc,_0x17571e);ami[_0xeaa4('0x4a')](_0xeaa4('0x6a'),_0x5fb0f4);}this[_0xeaa4('0x12')]['statusRequests']-=0x1;var _0x1e703f=this[_0xeaa4('0x12')][_0xeaa4('0x6b')]>0x0?!![]:![];if(!_0x1e703f){return this[_0xeaa4('0x6c')](this[_0xeaa4('0x12')][_0xeaa4('0x6d')]);}};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0x19')]=function(_0x415d59){var _0x321205=this[_0xeaa4('0x12')]['id'];if(this[_0xeaa4('0x12')]['queuestatus'][_0x321205]&&this[_0xeaa4('0x12')][_0xeaa4('0x62')][_0x321205][_0x415d59[_0xeaa4('0x61')]]){this[_0xeaa4('0x12')][_0xeaa4('0x62')][_0x321205][_0x415d59[_0xeaa4('0x61')]][_0xeaa4('0xe')][_0xeaa4('0x6e')](_0x415d59);}};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0x15')]=function(_0xcae99f){var _0x28eff6=this;try{if(this[_0xeaa4('0x5c')](_0xcae99f)&&this[_0xeaa4('0x5c')](_0xcae99f['queue'])){logger[_0xeaa4('0x4c')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xeaa4('0x42')](_0xcae99f,{'showHidden':![],'depth':null}));var _0x95b338=this['voiceQueues'][_0xcae99f[_0xeaa4('0x69')]];if(_0x95b338){logger[_0xeaa4('0x4c')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x95b338[_0xeaa4('0x64')]);this[_0xeaa4('0x12')][_0xeaa4('0x5e')][_0x95b338['name']]={'summaryEvent':_0xcae99f};this[_0xeaa4('0x12')][_0xeaa4('0x6b')]+=0x1;return ami[_0xeaa4('0x3b')]({'action':_0xeaa4('0x62'),'queue':_0x95b338[_0xeaa4('0x64')]})[_0xeaa4('0x60')](function(_0x2ce58a){if(!_0x28eff6[_0xeaa4('0x12')][_0xeaa4('0x62')][_0xcae99f[_0xeaa4('0x61')]]){_0x28eff6[_0xeaa4('0x12')][_0xeaa4('0x62')][_0xcae99f[_0xeaa4('0x61')]]={};}_0x28eff6[_0xeaa4('0x12')][_0xeaa4('0x62')][_0xcae99f[_0xeaa4('0x61')]][_0x2ce58a[_0xeaa4('0x61')]]={'queue':_0x95b338['name'],'agents':[]};})[_0xeaa4('0x3e')](function(_0x2c86e0){throw _0x2c86e0;});}}}catch(_0x2754b8){logger['error'](_0xeaa4('0x6f'),util[_0xeaa4('0x42')](_0x2754b8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0x6c')]=function(_0x485b19){if(this[_0xeaa4('0x12')][_0xeaa4('0x6b')]>0x0){this[_0xeaa4('0x12')]['completeEvent']=_0x485b19;return;}logger['debug'](_0xeaa4('0x70'),util['inspect'](_0x485b19,{'showHidden':![],'depth':null}));this[_0xeaa4('0x12')]=initializeSummary();ami[_0xeaa4('0x4a')](_0xeaa4('0x71'),{});};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x24856b){try{if(this[_0xeaa4('0x5c')](_0x24856b)){logger[_0xeaa4('0x4c')](_0xeaa4('0x72'),_0x24856b[_0xeaa4('0x4f')],util['inspect'](_0x24856b,{'showHidden':![],'depth':null}));if(_[_0xeaa4('0x5d')](this[_0xeaa4('0xc')][_0x24856b[_0xeaa4('0x4f')]])){this[_0xeaa4('0xc')][_0x24856b[_0xeaa4('0x4f')]]=[];}if(_[_0xeaa4('0x5d')](this[_0xeaa4('0xf')][_0x24856b['uniqueid']])){this[_0xeaa4('0xf')][_0x24856b[_0xeaa4('0x4f')]]={};}var _0x5d3587=new QueueReport();_0x5d3587[_0xeaa4('0x69')]=_0x24856b[_0xeaa4('0x69')];_0x5d3587[_0xeaa4('0x59')]=this[_0xeaa4('0x11')][_0x5d3587[_0xeaa4('0x69')]]&&this['voiceQueues'][_0x5d3587[_0xeaa4('0x69')]][_0xeaa4('0x59')]?this[_0xeaa4('0x11')][_0x5d3587[_0xeaa4('0x69')]][_0xeaa4('0x59')]||_0xeaa4('0x5a'):_0xeaa4('0x5a');_0x5d3587[_0xeaa4('0x73')]=moment()[_0xeaa4('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d3587[_0xeaa4('0x74')]=_0x24856b['position'];_0x5d3587[_0xeaa4('0x75')]=_0x24856b[_0xeaa4('0x75')];_0x5d3587['uniqueid']=_0x24856b[_0xeaa4('0x4f')];_0x5d3587[_0xeaa4('0x76')]=this['channels'][_0x24856b[_0xeaa4('0x4f')]][_0xeaa4('0x76')];logger[_0xeaa4('0x77')](_0xeaa4('0x78'),_0x5d3587[_0xeaa4('0x69')],_0x5d3587[_0xeaa4('0x59')]);Object['assign'](_0x5d3587,_['pick'](_0x24856b,_[_0xeaa4('0x79')](_0x5d3587)));this['queueReports'][_0x24856b[_0xeaa4('0x4f')]][_0xeaa4('0x6e')](_0x5d3587);this['channels'][_0x24856b[_0xeaa4('0x4f')]]=_0x5d3587;this[_0xeaa4('0x4b')](_0x5d3587,_0xeaa4('0x7a'));}}catch(_0x414b73){logger['error'](_0xeaa4('0x72'),_0x24856b[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x414b73,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0x1c')]=function(_0x422cc0){try{if(this[_0xeaa4('0x5c')](_0x422cc0)){logger[_0xeaa4('0x4c')](_0xeaa4('0x7b'),_0x422cc0['uniqueid'],util['inspect'](_0x422cc0,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x422cc0[_0xeaa4('0x4f')]]){var _0x4dadeb=_[_0xeaa4('0x7c')](this[_0xeaa4('0xc')][_0x422cc0[_0xeaa4('0x4f')]]);_0x4dadeb[_0xeaa4('0x35')]=![];_0x4dadeb[_0xeaa4('0x7d')]=null;_0x4dadeb[_0xeaa4('0x7e')]=_0x422cc0['holdtime'];_0x4dadeb[_0xeaa4('0x7f')]=_0x422cc0[_0xeaa4('0x7f')];_0x4dadeb['queuecallerabandon']=!![];_0x4dadeb[_0xeaa4('0x80')]=moment()[_0xeaa4('0x50')](_0xeaa4('0x81'));_0x4dadeb[_0xeaa4('0x55')]=_0xeaa4('0x82');_0x4dadeb[_0xeaa4('0x83')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x4dadeb[_0xeaa4('0x69')],_0x4dadeb['type']);this[_0xeaa4('0xf')][_0x422cc0[_0xeaa4('0x4f')]]=_0x4dadeb;this['emitVoiceQueueChannelRemove'](_0x4dadeb,_0xeaa4('0x1b'));}}}catch(_0x1d5094){logger['error'](_0xeaa4('0x7b'),_0x422cc0[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x1d5094,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0x1d')]=function(_0x5aeb16){try{if(this[_0xeaa4('0x5c')](_0x5aeb16)){logger[_0xeaa4('0x4c')](_0xeaa4('0x84'),_0x5aeb16[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x5aeb16,{'showHidden':![],'depth':null}));if(this[_0xeaa4('0xc')][_0x5aeb16[_0xeaa4('0x4f')]]){var _0xb9cb42=_[_0xeaa4('0x7c')](this[_0xeaa4('0xc')][_0x5aeb16['uniqueid']]);_0xb9cb42[_0xeaa4('0x85')]=moment()[_0xeaa4('0x50')](_0xeaa4('0x81'));_0xb9cb42['connectedlinenum']=_0x5aeb16[_0xeaa4('0x86')];_0xb9cb42[_0xeaa4('0x87')]=_0x5aeb16[_0xeaa4('0x87')];logger[_0xeaa4('0x77')](_0xeaa4('0x88'),_0xb9cb42[_0xeaa4('0x69')],_0xb9cb42[_0xeaa4('0x59')],_0x5aeb16[_0xeaa4('0x86')],_0x5aeb16[_0xeaa4('0x87')]);this[_0xeaa4('0xf')][_0x5aeb16[_0xeaa4('0x4f')]]=_0xb9cb42;this[_0xeaa4('0x4b')](_0xb9cb42,_0xeaa4('0x89'));}}}catch(_0x298c60){logger['error'](_0xeaa4('0x84'),_0x5aeb16[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x298c60,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0x20')]=function(_0x24fdc9){try{if(this[_0xeaa4('0x5c')](_0x24fdc9)){logger['debug'](_0xeaa4('0x8a'),_0x24fdc9[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x24fdc9,{'showHidden':![],'depth':null}));if(this[_0xeaa4('0xc')][_0x24fdc9[_0xeaa4('0x4f')]]){var _0x19ff9c=_[_0xeaa4('0x7c')](this[_0xeaa4('0xc')][_0x24fdc9[_0xeaa4('0x4f')]]);_0x19ff9c['queuecallercomplete']=!![];_0x19ff9c['queuecallerexitreason']=_0xeaa4('0x8b');logger['info']('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x19ff9c[_0xeaa4('0x69')],_0x19ff9c['type']);}}}catch(_0x4b75f4){logger[_0xeaa4('0x41')](_0xeaa4('0x8a'),_0x24fdc9[_0xeaa4('0x4f')],util['inspect'](_0x4b75f4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeaa4('0xa')]['syncAgentComplete']=function(_0x51d774){try{if(this[_0xeaa4('0x5c')](_0x51d774)){logger['debug'](_0xeaa4('0x8c'),_0x51d774[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x51d774,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x51d774[_0xeaa4('0x4f')]]){var _0x4c60df=_['last'](this[_0xeaa4('0xc')][_0x51d774[_0xeaa4('0x4f')]]);_0x4c60df['queuecallerabandon']=![];_0x4c60df[_0xeaa4('0x80')]=null;_0x4c60df[_0xeaa4('0x8d')]=!![];_0x4c60df[_0xeaa4('0x83')]=_0x51d774[_0xeaa4('0x8e')];_0x4c60df[_0xeaa4('0x7e')]=_0x51d774[_0xeaa4('0x7e')];_0x4c60df['queuecallercomplete']=!![];_0x4c60df[_0xeaa4('0x34')]=![];_0x4c60df['queuecallerexitAt']=null;if(!_0x4c60df[_0xeaa4('0x8f')]){if(_0x51d774['reason']==_0xeaa4('0x8f')){_0x4c60df[_0xeaa4('0x55')]=_0xeaa4('0x90');logger[_0xeaa4('0x77')](_0xeaa4('0x91'),_0x4c60df[_0xeaa4('0x69')],_0x4c60df['type']);}else{if(_[_0xeaa4('0x92')](_0x51d774['channel'][_0xeaa4('0x93')](),_0xeaa4('0x94'))){if(this[_0xeaa4('0xc')][_0x51d774['linkedid']]){var _0x461277=_[_0xeaa4('0x7c')](this['queueReports'][_0x51d774[_0xeaa4('0x95')]]);_0x461277[_0xeaa4('0x35')]=![];_0x461277[_0xeaa4('0x34')]=!![];_0x461277['queuecallerexitAt']=moment(_0x4c60df[_0xeaa4('0x73')])[_0xeaa4('0x96')](_0x51d774[_0xeaa4('0x7e')],_0xeaa4('0x97'))[_0xeaa4('0x50')](_0xeaa4('0x81'));_0x461277['queuecallerexitreason']=_0xeaa4('0x98');_0x461277['transfer']=!![];_0x461277[_0xeaa4('0x99')]=_0xeaa4('0x9a');_0x461277[_0xeaa4('0x9b')]=_0x51d774['destexten'];_0x461277[_0xeaa4('0x9c')]=_0x51d774[_0xeaa4('0x4f')];logger[_0xeaa4('0x77')](_0xeaa4('0x9d'),_0x461277[_0xeaa4('0x69')],_0x461277['type']);var _0x118b25=this[_0xeaa4('0xc')][_0x51d774[_0xeaa4('0x95')]];this[_0xeaa4('0xc')][_0x51d774[_0xeaa4('0x95')]]=this[_0xeaa4('0xc')][_0x51d774[_0xeaa4('0x4f')]];this[_0xeaa4('0xc')][_0x51d774[_0xeaa4('0x4f')]]=_0x118b25;}}else{_0x4c60df[_0xeaa4('0x55')]=_0xeaa4('0x9e')+_0x51d774[_0xeaa4('0x9f')][_0xeaa4('0xa0')]();logger[_0xeaa4('0x77')](_0xeaa4('0xa1'),_0x4c60df[_0xeaa4('0x69')],_0x4c60df[_0xeaa4('0x59')],_0x4c60df[_0xeaa4('0x55')]);}}}this['channels'][_0x51d774[_0xeaa4('0x4f')]]=_0x4c60df;}}}catch(_0x26df80){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x51d774[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x26df80,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xeaa4('0xa2')]=function(_0x1262ee){try{if(this[_0xeaa4('0x5c')](_0x1262ee)){logger[_0xeaa4('0x4c')](_0xeaa4('0xa3'),_0x1262ee[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x1262ee,{'showHidden':![],'depth':null}));this[_0xeaa4('0xa4')](_0x1262ee[_0xeaa4('0x4f')],_[_0xeaa4('0x79')](_0x1262ee['variable'])[0x0],_0x1262ee['value']);if(this[_0xeaa4('0xc')][_0x1262ee[_0xeaa4('0x4f')]]){var _0x512d99=_[_0xeaa4('0x7c')](this[_0xeaa4('0xc')][_0x1262ee[_0xeaa4('0x4f')]]);if(_0x512d99){if(this['isNotNull'](_0x1262ee['variable'])&&this['isNotNull'](_0x1262ee['variable'][_0xeaa4('0x62')])){switch(_0x1262ee['value']){case _0xeaa4('0xa5'):_0x512d99['queuecallerexit']=![];_0x512d99[_0xeaa4('0xa6')]=null;break;case'TIMEOUT':_0x512d99[_0xeaa4('0xa7')]=_0xeaa4('0xa8');_0x512d99[_0xeaa4('0x34')]=!![];_0x512d99[_0xeaa4('0xa6')]=moment()[_0xeaa4('0x50')](_0xeaa4('0x81'));_0x512d99[_0xeaa4('0x85')]=moment()[_0xeaa4('0x50')](_0xeaa4('0x81'));logger['debug'](_0xeaa4('0xa9'),_0x1262ee['uniqueid'],util[_0xeaa4('0x42')](_0x512d99,{'showHidden':![],'depth':null}));ami[_0xeaa4('0x4a')](_0xeaa4('0xaa'),_0x512d99);break;default:_0x512d99[_0xeaa4('0x34')]=!![];_0x512d99[_0xeaa4('0xa6')]=moment()[_0xeaa4('0x50')]('YYYY-MM-DD\x20HH:mm:ss');_0x512d99[_0xeaa4('0x85')]=moment()[_0xeaa4('0x50')](_0xeaa4('0x81'));}_0x512d99[_0xeaa4('0x1b')]=![];_0x512d99[_0xeaa4('0x80')]=null;_0x512d99['queuecallerexitreason']=_0x1262ee[_0xeaa4('0xab')];this[_0xeaa4('0xf')][_0x1262ee['uniqueid']]=_0x512d99;this[_0xeaa4('0xac')](_0x512d99,_0xeaa4('0x21'));}else if(this[_0xeaa4('0x5c')](_0x1262ee['variable'])&&this[_0xeaa4('0x5c')](_0x1262ee[_0xeaa4('0xad')][_0xeaa4('0xae')])){if(!_0x512d99[_0xeaa4('0x1b')]){_0x512d99[_0xeaa4('0x34')]=!![];_0x512d99[_0xeaa4('0xa6')]=moment()[_0xeaa4('0x50')](_0xeaa4('0x81'));_0x512d99['queuecallerexitreason']='EXITWITHKEY';_0x512d99['queuecallerleaveAt']=moment()[_0xeaa4('0x50')](_0xeaa4('0x81'));this[_0xeaa4('0xf')][_0x1262ee[_0xeaa4('0x4f')]]=_0x512d99;}}logger[_0xeaa4('0x77')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x1262ee[_0xeaa4('0x4f')],_0x512d99[_0xeaa4('0x69')],_0x512d99[_0xeaa4('0x59')],_[_0xeaa4('0x79')](_0x1262ee[_0xeaa4('0xad')])[0x0],_0x1262ee['value']);_0x512d99['variables']=this[_0xeaa4('0x13')][_0x1262ee[_0xeaa4('0x4f')]];}}}}catch(_0x4d20ac){logger[_0xeaa4('0x41')](_0xeaa4('0xa3'),_0x1262ee[_0xeaa4('0x4f')],util['inspect'](_0x4d20ac,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeaa4('0xa')]['addVariable']=function(_0x4e0822,_0x530b3f,_0x2216ff){var _0x2fade7=[_0xeaa4('0xaf'),_0xeaa4('0xb0'),_0xeaa4('0xb1'),_0xeaa4('0xb2'),'rtpaudioqosloss',_0xeaa4('0xb3'),_0xeaa4('0xb4'),_0xeaa4('0xb5'),'sipcallid','sipuri',_0xeaa4('0xb6'),'bridgepvtcallid',_0xeaa4('0xb7'),_0xeaa4('0xb8'),_0xeaa4('0xb9'),_0xeaa4('0xba'),_0xeaa4('0x8e'),'memberpenalty','memberrealtime'];if(!_[_0xeaa4('0x3a')](_0x530b3f)&&!_['includes'](_0x2fade7,_0x530b3f)){if(_[_0xeaa4('0x5d')](this['variables'][_0x4e0822])){this[_0xeaa4('0x13')][_0x4e0822]={};}this[_0xeaa4('0x13')][_0x4e0822][_0x530b3f]=_0x2216ff;}};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0xbb')]=function(_0x19dc76,_0x401492,_0x3afe52){try{var _0x370823={};if(this[_0xeaa4('0xc')][_0x19dc76]){for(var _0x1e5e15=0x0;_0x1e5e15<this[_0xeaa4('0xc')][_0x19dc76][_0xeaa4('0xbc')];_0x1e5e15+=0x1){_0x370823=this['queueReports'][_0x19dc76][_0x1e5e15];var _0x1d6521=this[_0xeaa4('0x11')][_0x370823[_0xeaa4('0x69')]];if(_0x1d6521){_0x1d6521[_0xeaa4('0xbd')]+=moment(_0x370823[_0xeaa4('0x85')])[_0xeaa4('0xbe')](_0x370823['queuecallerjoinAt'],_0xeaa4('0x97'))||0x0;if(_0x3afe52&&_0x370823[_0xeaa4('0x55')]==='ATTENDEDTRANSFER'){_0x370823[_0xeaa4('0x55')]=_0xeaa4('0x8b');}if(_0x1e5e15===this['queueReports'][_0x19dc76][_0xeaa4('0xbc')]-0x1){_0x1d6521[_0xeaa4('0xbf')]+=moment()['milliseconds'](0x0)['diff'](_0x370823[_0xeaa4('0x73')],_0xeaa4('0x97'));if(hasCallerLeftTheQueue(_0x370823)&&_0x370823[_0xeaa4('0x55')]!==_0xeaa4('0x56')){_0x1d6521['total']+=0x1;}if(_0x370823[_0xeaa4('0x35')]){_0x1d6521['answered']+=0x1;_0x1d6521[_0xeaa4('0xc0')]+=moment()['milliseconds'](0x0)[_0xeaa4('0xbe')](_0x370823[_0xeaa4('0x85')],_0xeaa4('0x97'));_0x370823[_0xeaa4('0x7d')]=moment()['format'](_0xeaa4('0x81'));_0x370823[_0xeaa4('0x34')]=![];_0x370823[_0xeaa4('0xa6')]=null;}if(_0x370823[_0xeaa4('0x34')]&&_0x370823[_0xeaa4('0x8f')]!=!![]){_0x1d6521[_0xeaa4('0xc1')]+=0x1;_0x370823[_0xeaa4('0xa7')]='unmanaged';logger['debug'](_0xeaa4('0xc2'),_0x19dc76,util[_0xeaa4('0x42')](_0x370823,{'showHidden':![],'depth':null}));ami[_0xeaa4('0x4a')]('custom:queuecallerunmanaged',_0x370823);}if(_0x370823['queuecallerabandon']){_0x1d6521[_0xeaa4('0xc3')]+=0x1;_0x370823['lastevent']=_0xeaa4('0xc3');logger['debug'](_0xeaa4('0xc4'),_0x19dc76,util['inspect'](_0x370823,{'showHidden':![],'depth':null}));ami['emit'](_0xeaa4('0xc5'),_0x370823);}}else{_0x1d6521[_0xeaa4('0xbf')]+=_0x1d6521[_0xeaa4('0xbd')];}logger[_0xeaa4('0x77')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x19dc76,_0x370823[_0xeaa4('0x69')],_0x370823[_0xeaa4('0x59')],_0x401492);this[_0xeaa4('0xf')][_0x19dc76]=_0x370823;Object[_0xeaa4('0x68')](this['voiceQueues'][_0x370823[_0xeaa4('0x69')]],_0x1d6521);if(_0x370823[_0xeaa4('0x85')]){this['emitVoiceQueueChannelRemove'](_0x370823,_0xeaa4('0xc6'));}}}logger[_0xeaa4('0x4c')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x19dc76,util[_0xeaa4('0x42')](this[_0xeaa4('0xc')][_0x19dc76],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x370823)&&_0x370823[_0xeaa4('0x55')]!==_0xeaa4('0x56')){ami[_0xeaa4('0x4a')](_0xeaa4('0xc7'),this[_0xeaa4('0xc')][_0x19dc76]);if(this[_0xeaa4('0xc')][_0x19dc76]){delete this['queueReports'][_0x19dc76];}if(this[_0xeaa4('0xf')][_0x19dc76]){delete this[_0xeaa4('0xf')][_0x19dc76];}if(this[_0xeaa4('0x13')][_0x19dc76]){delete this[_0xeaa4('0x13')][_0x19dc76];}}}}catch(_0xe32cc3){logger[_0xeaa4('0x41')](_0xeaa4('0xc8'),_0x19dc76,util[_0xeaa4('0x42')](_0xe32cc3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeaa4('0xa')]['syncHangup']=function(_0x2de855){try{if(this[_0xeaa4('0x5c')](_0x2de855)){logger['debug'](_0xeaa4('0xc9'),_0x2de855['uniqueid'],util[_0xeaa4('0x42')](_0x2de855,{'showHidden':![],'depth':null}));if(this[_0xeaa4('0xc')][_0x2de855['uniqueid']]){return this[_0xeaa4('0xbb')](_0x2de855[_0xeaa4('0x4f')],_0x2de855[_0xeaa4('0xca')],![]);}if(this[_0xeaa4('0xc')][_0x2de855[_0xeaa4('0x95')]]){if(_0x2de855['cause']==='21'){return;}return this[_0xeaa4('0xbb')](_0x2de855[_0xeaa4('0x95')],_0x2de855[_0xeaa4('0xca')],!![]);}var _0x1f89d2=Object[_0xeaa4('0x79')](this[_0xeaa4('0xc')]);for(var _0x31889d=0x0;_0x31889d<_0x1f89d2['length'];_0x31889d++){var _0x380451=_['last'](this[_0xeaa4('0xc')][_0x1f89d2[_0x31889d]]);if(_0x380451&&_0x380451[_0xeaa4('0xcb')]===_0x2de855[_0xeaa4('0x4f')]){return this[_0xeaa4('0xbb')](_0x380451[_0xeaa4('0x4f')],_0x2de855[_0xeaa4('0xca')],!![]);}}if(!this['queueReports'][_0x2de855[_0xeaa4('0x4f')]]){logger[_0xeaa4('0x4c')]('[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed',_0x2de855['uniqueid']);if(this[_0xeaa4('0xf')][_0x2de855[_0xeaa4('0x4f')]]){delete this[_0xeaa4('0xf')][_0x2de855[_0xeaa4('0x4f')]];}if(this[_0xeaa4('0x13')][_0x2de855[_0xeaa4('0x4f')]]){delete this[_0xeaa4('0x13')][_0x2de855[_0xeaa4('0x4f')]];}}}}catch(_0x2310c7){logger[_0xeaa4('0x41')](_0xeaa4('0xc9'),_0x2de855[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x2310c7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeaa4('0xa')]['syncAttendedTransfer']=function(_0x32d15b){try{if(this[_0xeaa4('0x5c')](_0x32d15b)){logger[_0xeaa4('0x4c')]('[%s][voiceQueueReport][attendedtransfer]',_0x32d15b['uniqueid'],util[_0xeaa4('0x42')](_0x32d15b,{'showHidden':![],'depth':null}));var _0x4f88b6;var _0x2969bd;var _0x30ca89;if(this[_0xeaa4('0xc')][_0x32d15b[_0xeaa4('0xcc')]]){_0x4f88b6=_[_0xeaa4('0x7c')](this[_0xeaa4('0xc')][_0x32d15b['transfereeuniqueid']]);_0x4f88b6[_0xeaa4('0x9b')]=_0x32d15b[_0xeaa4('0xcd')];_0x4f88b6['transferuniqueid']=_0x32d15b[_0xeaa4('0xce')];_0x4f88b6['queuecallerexitreason']=_0xeaa4('0x56');_0x4f88b6[_0xeaa4('0x8f')]=!![];_0x4f88b6[_0xeaa4('0x99')]=_0xeaa4('0xcf');if(this[_0xeaa4('0xc')][_0x32d15b['secondtransfereruniqueid']]){_0x30ca89=this['queueReports'][_0x32d15b[_0xeaa4('0xce')]];this[_0xeaa4('0xc')][_0x32d15b[_0xeaa4('0xce')]]=this[_0xeaa4('0xc')][_0x32d15b[_0xeaa4('0xcc')]];this[_0xeaa4('0xc')][_0x32d15b['transfereeuniqueid']]=_0x30ca89;_0x2969bd=_[_0xeaa4('0x7c')](this[_0xeaa4('0xc')][_0x32d15b['transfereeuniqueid']]);_0x2969bd[_0xeaa4('0x37')]=!![];}logger[_0xeaa4('0x77')](_0xeaa4('0xd0'),_0x32d15b['uniqueid'],_0x4f88b6[_0xeaa4('0x69')],_0x4f88b6[_0xeaa4('0x59')],_0x4f88b6[_0xeaa4('0x9b')],_0x4f88b6[_0xeaa4('0x9c')]);}else if(this[_0xeaa4('0xc')][_0x32d15b[_0xeaa4('0xd1')]]){_0x4f88b6=_[_0xeaa4('0x7c')](this['queueReports'][_0x32d15b['transfertargetuniqueid']]);_0x4f88b6[_0xeaa4('0x9b')]=_0x32d15b[_0xeaa4('0xd2')];_0x4f88b6[_0xeaa4('0x9c')]=_0x32d15b['origtransfereruniqueid'];_0x4f88b6[_0xeaa4('0x55')]=_0xeaa4('0x56');_0x4f88b6[_0xeaa4('0x8f')]=!![];_0x4f88b6[_0xeaa4('0x99')]=_0xeaa4('0xcf');if(this['queueReports'][_0x32d15b[_0xeaa4('0xd3')]]){_0x30ca89=this[_0xeaa4('0xc')][_0x32d15b[_0xeaa4('0xd3')]];this[_0xeaa4('0xc')][_0x32d15b[_0xeaa4('0xd3')]]=this[_0xeaa4('0xc')][_0x32d15b[_0xeaa4('0xd1')]];this[_0xeaa4('0xc')][_0x32d15b[_0xeaa4('0xd1')]]=_0x30ca89;_0x2969bd=_[_0xeaa4('0x7c')](this[_0xeaa4('0xc')][_0x32d15b['transfertargetuniqueid']]);_0x2969bd[_0xeaa4('0x37')]=!![];}logger[_0xeaa4('0x77')](_0xeaa4('0xd0'),_0x32d15b[_0xeaa4('0x4f')],_0x4f88b6['queue'],_0x4f88b6[_0xeaa4('0x59')],_0x4f88b6[_0xeaa4('0x9b')],_0x4f88b6[_0xeaa4('0x9c')]);}else if(this[_0xeaa4('0xc')][_0x32d15b[_0xeaa4('0xd3')]]){_0x4f88b6=_['last'](this[_0xeaa4('0xc')][_0x32d15b[_0xeaa4('0xd3')]]);_0x4f88b6[_0xeaa4('0x9b')]=_0x32d15b[_0xeaa4('0xd2')];_0x4f88b6[_0xeaa4('0x9c')]=_0x32d15b[_0xeaa4('0xd3')];_0x4f88b6[_0xeaa4('0x55')]='ATTENDEDTRANSFER';_0x4f88b6[_0xeaa4('0x8f')]=!![];_0x4f88b6[_0xeaa4('0x99')]='ATTENDED';_0x4f88b6[_0xeaa4('0x37')]=!![];_0x4f88b6[_0xeaa4('0xcb')]=_0x32d15b[_0xeaa4('0xcc')];}else if(this[_0xeaa4('0xc')][_0x32d15b[_0xeaa4('0xce')]]){_0x4f88b6=_[_0xeaa4('0x7c')](this['queueReports'][_0x32d15b[_0xeaa4('0xce')]]);_0x4f88b6['transferexten']=_0x32d15b[_0xeaa4('0xcd')];_0x4f88b6['transferuniqueid']=_0x32d15b[_0xeaa4('0xce')];_0x4f88b6[_0xeaa4('0x55')]='ATTENDEDTRANSFER';_0x4f88b6[_0xeaa4('0x8f')]=!![];_0x4f88b6[_0xeaa4('0x99')]=_0xeaa4('0xcf');_0x4f88b6['switch']=!![];_0x4f88b6[_0xeaa4('0xcb')]=_0x32d15b['transfertargetuniqueid'];}}}catch(_0xc7cd10){logger[_0xeaa4('0x41')](_0xeaa4('0xd4'),_0x32d15b['uniqueid'],util[_0xeaa4('0x42')](_0xc7cd10,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0x29')]=function(_0x4226ce){try{if(this['isNotNull'](_0x4226ce)){logger[_0xeaa4('0x4c')]('[%s][voiceQueueReport][blindtransfer]',_0x4226ce['uniqueid'],util[_0xeaa4('0x42')](_0x4226ce,{'showHidden':![],'depth':null}));if(this[_0xeaa4('0xc')][_0x4226ce[_0xeaa4('0xcc')]]){var _0x17bb00=_[_0xeaa4('0x7c')](this[_0xeaa4('0xc')][_0x4226ce['transfereeuniqueid']]);_0x17bb00[_0xeaa4('0x55')]=_0xeaa4('0xd5');_0x17bb00[_0xeaa4('0x8f')]=!![];_0x17bb00[_0xeaa4('0x99')]=_0xeaa4('0xd6');_0x17bb00[_0xeaa4('0x9b')]=_0x4226ce[_0xeaa4('0xd7')];_0x17bb00[_0xeaa4('0x9c')]=_0x4226ce[_0xeaa4('0xcc')];logger[_0xeaa4('0x77')](_0xeaa4('0xd8'),_0x4226ce[_0xeaa4('0x4f')],_0x17bb00[_0xeaa4('0x69')],_0x17bb00['type'],_0x17bb00['transferexten'],_0x17bb00[_0xeaa4('0x9c')]);this[_0xeaa4('0x22')]({'event':_0xeaa4('0xd9'),'uniqueid':_0x4226ce['transfereeuniqueid'],'context':_0x4226ce[_0xeaa4('0xda')],'channel':_0x4226ce[_0xeaa4('0xdb')]});}}}catch(_0x3b3ccd){logger[_0xeaa4('0x41')](_0xeaa4('0xdc'),_0x4226ce[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x3b3ccd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0x25')]=function(_0x4f773a){try{if(this[_0xeaa4('0x5c')](_0x4f773a)){logger[_0xeaa4('0x4c')](_0xeaa4('0xdd'),_0x4f773a['uniqueid'],util['inspect'](_0x4f773a,{'showHidden':![],'depth':null}));if(this[_0xeaa4('0xc')][_0x4f773a[_0xeaa4('0x4f')]]){var _0x2b700d=_[_0xeaa4('0x7c')](this[_0xeaa4('0xc')][_0x4f773a[_0xeaa4('0x4f')]]);if(!_['isNil'](_0x2b700d[_0xeaa4('0x85')])){_0x2b700d['mohstarttime']=moment()['format'](_0xeaa4('0x81'));logger[_0xeaa4('0x77')](_0xeaa4('0xde'),_0x4f773a[_0xeaa4('0x4f')],_0x2b700d['mohstarttime']);}}}}catch(_0x426f52){logger[_0xeaa4('0x41')]('[%s][voiceQueueReport][musiconholdstart]',_0x4f773a[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x426f52,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xeaa4('0x26')]=function(_0x31234b){try{if(this[_0xeaa4('0x5c')](_0x31234b)){logger[_0xeaa4('0x4c')]('[%s][voiceQueueReport][musiconholdstop]',_0x31234b[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0x31234b,{'showHidden':![],'depth':null}));if(this[_0xeaa4('0xc')][_0x31234b[_0xeaa4('0x4f')]]){var _0x11bd47=_[_0xeaa4('0x7c')](this[_0xeaa4('0xc')][_0x31234b[_0xeaa4('0x4f')]]);if(!_[_0xeaa4('0x3a')](_0x11bd47[_0xeaa4('0xdf')])){_0x11bd47[_0xeaa4('0xe0')]+=moment()[_0xeaa4('0xe1')](0x0)[_0xeaa4('0xbe')](_0x11bd47[_0xeaa4('0xdf')],_0xeaa4('0x97'));logger[_0xeaa4('0x77')](_0xeaa4('0xe2'),_0x31234b['uniqueid'],_0x11bd47[_0xeaa4('0xe0')]);delete _0x11bd47[_0xeaa4('0xdf')];}}}}catch(_0xb7cbe9){logger[_0xeaa4('0x41')](_0xeaa4('0xe3'),_0x31234b[_0xeaa4('0x4f')],util[_0xeaa4('0x42')](_0xb7cbe9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xeaa4('0xa')][_0xeaa4('0xe4')]=function(_0x18b4f4){try{if(this[_0xeaa4('0x5c')](_0x18b4f4)){logger[_0xeaa4('0x4c')]('[%s][voiceQueueReport][newexten]\x20event:',_0x18b4f4['uniqueid'],util[_0xeaa4('0x42')](_0x18b4f4,{'showHidden':![],'depth':null}));if(_0x18b4f4['application']['toLowerCase']()==='set'){_0x18b4f4[_0xeaa4('0xe5')]=_0x18b4f4['appdata']&&_0x18b4f4[_0xeaa4('0xe6')]['startsWith'](_0xeaa4('0xe7'))?_0x18b4f4[_0xeaa4('0xe6')]:(_0x18b4f4[_0xeaa4('0xe6')]||_0x18b4f4['applicationdata'])['toLowerCase']();if(_['startsWith'](_0x18b4f4[_0xeaa4('0xe5')][_0xeaa4('0x93')](),'cdr(')){logger[_0xeaa4('0x77')](_0xeaa4('0xe8'),_0x18b4f4[_0xeaa4('0x4f')],_0x18b4f4[_0xeaa4('0xe9')],_0x18b4f4['applicationdata']);if(_[_0xeaa4('0x5d')](this[_0xeaa4('0xf')][_0x18b4f4[_0xeaa4('0x4f')]]))this['channels'][_0x18b4f4[_0xeaa4('0x4f')]]={};var _0x2cf653=_0x18b4f4[_0xeaa4('0xe5')]['split']('=');var _0x244aac=_0x2cf653[0x0][_0xeaa4('0x93')]()['match'](/cdr\((.*)\)/);if(_0x244aac)this[_0xeaa4('0xf')][_0x18b4f4[_0xeaa4('0x4f')]][_0x244aac[0x1]]=_0x2cf653[0x1];}}}}catch(_0x3eab1a){logger[_0xeaa4('0x41')](_0xeaa4('0xea'),_0x18b4f4['uniqueid'],util[_0xeaa4('0x42')](_0x3eab1a,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
+var _0x9f06=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','sipcallid','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','handleHangup','diff','seconds','sumDuration','total','answered','sumBillable','unmanaged','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','sumHoldTime','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][handleHangup]','cause-txt','length','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','origtransfererexten','transferid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','milliseconds','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','set','applicationdata','appdata','startsWith','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','[%s][voiceQueueReport][newexten]','lodash','moment','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','localhost','prototype','tail','finally','sequence','queueReports','realtime','channels','queueChannels','voiceQueues','queuesummary','syncQueueSummary','bind','syncQueueSummaryComplete','queuemember','syncQueueMember','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','agentcomplete','syncAgentComplete','syncAgentConnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','waiting','unlockRR','queuecallerexit','clearZombieChannels','switch','enqueue','isNil','Action','status','catch','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','error','[%s][voiceQueueReport][checkQueueReport]','variables','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','summary','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][','uniqueid','format','queue','voice_queue_channel:save','emitVoiceQueueChannelRemove','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice:queue:%s','voice_queue_channel:remove','type','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','queues','[voiceQueueReport][queues]','isRunning','queuestatus','actionid','[voiceQueueReport][queuesummary]','createQueueSummaryReport','name','summaryEvent','createReport','agents','handleInboundQueueSummaryReport','compareToInboundQueue','assign','emitInboundVoiceQueueSummary','outbound','statusRequests','completeEvent','push','isNotNull','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','pick','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','assigned','membername','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','channel','toLowerCase','linkedid','FORWARDTRANSFER','transfertype','FORWARD','transferexten','transferuniqueid','COMPLETEDBY','[%s][voiceQueueReport][varset]','addVariable','keys','variable','value','CONTINUE','TIMEOUT','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s'];(function(_0x52d74c,_0x1e39a0){var _0x76b83d=function(_0x27468c){while(--_0x27468c){_0x52d74c['push'](_0x52d74c['shift']());}};_0x76b83d(++_0x1e39a0);}(_0x9f06,0x12e));var _0x69f0=function(_0x589e7d,_0x14a1e7){_0x589e7d=_0x589e7d-0x0;var _0x583e40=_0x9f06[_0x589e7d];return _0x583e40;};'use strict';var _=require(_0x69f0('0x0'));var moment=require(_0x69f0('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0x69f0('0x2'));var logger=require(_0x69f0('0x3'))(_0x69f0('0x4'));var ami=require(_0x69f0('0x5'));var QueueReport=require(_0x69f0('0x6'));var VoiceQueueSummary=require(_0x69f0('0x7'));config[_0x69f0('0x8')]=_[_0x69f0('0x9')](config['redis'],{'host':_0x69f0('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x69f0('0x8')]));var Sequence=function(){};Sequence[_0x69f0('0xb')]['enqueue']=function(_0x13f91e){this[_0x69f0('0xc')]=this[_0x69f0('0xc')]?this[_0x69f0('0xc')][_0x69f0('0xd')](_0x13f91e):_0x13f91e();};function VoiceQueueReport(_0x2e9d91){this[_0x69f0('0xe')]=new Sequence();this[_0x69f0('0xf')]={};this[_0x69f0('0x10')]=_0x2e9d91;this['agents']=_0x2e9d91['agents'];this[_0x69f0('0x11')]=_0x2e9d91[_0x69f0('0x12')];this[_0x69f0('0x13')]=_0x2e9d91[_0x69f0('0x13')];this['campaigns']=_0x2e9d91['campaigns'];this['summary']=initializeSummary();this['variables']={};ami['on'](_0x69f0('0x14'),this[_0x69f0('0x15')][_0x69f0('0x16')](this));ami['on']('queuesummarycomplete',this[_0x69f0('0x17')][_0x69f0('0x16')](this));ami['on'](_0x69f0('0x18'),this[_0x69f0('0x19')][_0x69f0('0x16')](this));ami['on']('queuestatuscomplete',this[_0x69f0('0x1a')]['bind'](this));ami['on'](_0x69f0('0x1b'),this[_0x69f0('0x1c')][_0x69f0('0x16')](this));ami['on'](_0x69f0('0x1d'),this['syncQueueCallerAbandon'][_0x69f0('0x16')](this));ami['on']('queuecallerleave',this['syncQueueCallerLeave'][_0x69f0('0x16')](this));ami['on'](_0x69f0('0x1e'),this[_0x69f0('0x1f')][_0x69f0('0x16')](this));ami['on']('agentconnect',this[_0x69f0('0x20')]['bind'](this));ami['on'](_0x69f0('0x21'),this['syncVarSet'][_0x69f0('0x16')](this));ami['on'](_0x69f0('0x22'),this[_0x69f0('0x23')][_0x69f0('0x16')](this));ami['on'](_0x69f0('0x24'),this[_0x69f0('0x25')]['bind'](this));ami['on']('musiconholdstart',this[_0x69f0('0x26')][_0x69f0('0x16')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x69f0('0x16')](this));ami['on'](_0x69f0('0x27'),this[_0x69f0('0x28')][_0x69f0('0x16')](this));ami['on'](_0x69f0('0x29'),this[_0x69f0('0x2a')][_0x69f0('0x16')](this));this[_0x69f0('0x2b')]();this[_0x69f0('0x2c')]();}function clearChannels(_0x7f51dc){if(!_[_0x69f0('0x2d')](_0x7f51dc)){for(var _0x3552a5 in _0x7f51dc){if(_0x7f51dc[_0x69f0('0x2e')](_0x3552a5)){delete _0x7f51dc[_0x3552a5];}}}}function clearCampaigns(_0x142d98){if(!_['isEmpty'](_0x142d98)){for(var _0x1065b6 in _0x142d98){if(_0x142d98[_0x69f0('0x2e')](_0x1065b6)){_0x142d98[_0x1065b6][_0x69f0('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x32caa4){if(!_[_0x69f0('0x2d')](_0x32caa4)){for(var _0x42a74a in _0x32caa4){if(_0x32caa4[_0x69f0('0x2e')](_0x42a74a)){_0x32caa4[_0x42a74a][_0x69f0('0x2f')]=0x0;_0x32caa4[_0x42a74a]['talking']=0x0;_0x32caa4[_0x42a74a]['pTalking']=0x0;_0x32caa4[_0x42a74a][_0x69f0('0x30')]=0x0;_0x32caa4[_0x42a74a]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x298d80){if(!_['isEmpty'](_0x298d80)){for(var _0x3643f9 in _0x298d80){if(_0x298d80['hasOwnProperty'](_0x3643f9)){_0x298d80[_0x3643f9][_0x69f0('0x31')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x3f81ae){return _0x3f81ae[_0x69f0('0x32')]||_0x3f81ae['queuecallerabandon']||_0x3f81ae['queuecallercomplete'];}VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x33')]=function(){var _0x1a58d9=this;for(var _0x5ab2f6 in this[_0x69f0('0x11')]){if(this[_0x69f0('0x11')]['hasOwnProperty'](_0x5ab2f6)&&!this[_0x69f0('0x11')][_0x5ab2f6][_0x69f0('0x34')]){this[_0x69f0('0xe')][_0x69f0('0x35')](function(){if(!_[_0x69f0('0x36')](_0x1a58d9[_0x69f0('0x11')][_0x5ab2f6])){return ami[_0x69f0('0x37')]({'action':_0x69f0('0x38'),'channel':_0x1a58d9[_0x69f0('0x11')][_0x5ab2f6]['channel']})[_0x69f0('0x39')](function(_0x46dde3){if(_0x46dde3['message']===_0x69f0('0x3a')){setTimeout(function(){if(_0x1a58d9[_0x69f0('0x11')][_0x5ab2f6]){delete _0x1a58d9[_0x69f0('0x11')][_0x5ab2f6];logger['error'](_0x69f0('0x3b'),_0x5ab2f6,util[_0x69f0('0x3c')](_0x46dde3,{'showHidden':![],'depth':null}));}if(_0x1a58d9['queueReports'][_0x5ab2f6]){delete _0x1a58d9['queueReports'][_0x5ab2f6];logger[_0x69f0('0x3d')](_0x69f0('0x3e'),_0x5ab2f6,util[_0x69f0('0x3c')](_0x46dde3,{'showHidden':![],'depth':null}));}if(_0x1a58d9[_0x69f0('0x3f')][_0x5ab2f6]){delete _0x1a58d9[_0x69f0('0x3f')][_0x5ab2f6];logger['error'](_0x69f0('0x40'),_0x5ab2f6,util[_0x69f0('0x3c')](_0x46dde3,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x25')]=function(){logger[_0x69f0('0x3d')](_0x69f0('0x41'));clearChannels(this[_0x69f0('0x11')]);this[_0x69f0('0x42')](this[_0x69f0('0xf')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x69f0('0x13')]);clearCampaigns(this['campaigns']);this[_0x69f0('0x43')]=initializeSummary();};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x42')]=function(_0x553ed4){var _0x2b16e5=this;if(!_[_0x69f0('0x2d')](_0x553ed4)){for(var _0xdbfc8b in _0x553ed4){if(_0x553ed4[_0x69f0('0x2e')](_0xdbfc8b)){_0x2b16e5['emitVoiceQueueChannelRemove'](_0x553ed4[_0xdbfc8b],'clearqueuereport');delete _0x553ed4[_0xdbfc8b];}}}};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x44')]=function(_0x510082,_0x14d351,_0x3442db){io['to'](_0x510082)[_0x69f0('0x44')](_0x14d351,_0x3442db);};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x45')]=function(_0x563910,_0x505f99){logger['debug'](_0x69f0('0x46')+_0x505f99+']\x20sending\x20voice_queue_channel:save\x20event:',_0x563910[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x563910,{'showHidden':![],'depth':null}));this['emit'](util[_0x69f0('0x48')]('voice:queue:%s',_0x563910[_0x69f0('0x49')]),_0x69f0('0x4a'),_0x563910);io[_0x69f0('0x44')]('voice_queue_presence:save',_0x563910);};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x4b')]=function(_0x5d2a61,_0x3276c6){logger[_0x69f0('0x4c')](_0x69f0('0x46')+_0x3276c6+_0x69f0('0x4d'),_0x5d2a61['uniqueid'],util[_0x69f0('0x3c')](_0x5d2a61,{'showHidden':![],'depth':null}));if(_0x5d2a61[_0x69f0('0x4e')]===_0x69f0('0x4f')){return;}this[_0x69f0('0x44')](util[_0x69f0('0x48')](_0x69f0('0x50'),_0x5d2a61[_0x69f0('0x49')]),_0x69f0('0x51'),_0x5d2a61);io[_0x69f0('0x44')]('voice_queue_presence:remove',_0x5d2a61);};VoiceQueueReport[_0x69f0('0xb')]['emitInboundVoiceQueueSummary']=function(_0x1679e2){if(_0x1679e2[_0x69f0('0x52')]===_0x69f0('0x53')){logger[_0x69f0('0x4c')](_0x69f0('0x54'),util[_0x69f0('0x3c')](_0x1679e2,{'showHidden':![],'depth':null}));this[_0x69f0('0x44')](util[_0x69f0('0x48')]('voice:queue:%s',_0x1679e2['name']),_0x69f0('0x55'),_0x1679e2);}};VoiceQueueReport[_0x69f0('0xb')]['isNotNull']=function(_0x317270){return _0x317270!==null&&!_[_0x69f0('0x56')](_0x317270);};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x2c')]=function(){var _0x40a774=this;setInterval(function(){_0x40a774['clearZombieChannels']();ami['Action']({'action':_0x69f0('0x57')})[_0x69f0('0x39')](function(_0x44bdad){logger[_0x69f0('0x3d')](_0x69f0('0x58'),util[_0x69f0('0x3c')](_0x44bdad,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x2b')]=function(){var _0x3fe4d5=this;setInterval(function(){if(!_0x3fe4d5[_0x69f0('0x43')][_0x69f0('0x59')]){return ami[_0x69f0('0x37')]({'action':_0x69f0('0x14')})['then'](function(_0x3cc1d3){_0x3fe4d5[_0x69f0('0x43')]['id']=_0x3cc1d3['actionid'];_0x3fe4d5['summary'][_0x69f0('0x59')]=!![];_0x3fe4d5[_0x69f0('0x43')][_0x69f0('0x5a')][_0x3cc1d3[_0x69f0('0x5b')]]={};})['catch'](function(_0x1b6535){logger[_0x69f0('0x3d')](_0x69f0('0x5c'),util[_0x69f0('0x3c')](_0x1b6535,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x5d')]=function(_0x38e35c,_0x5627aa){var _0x57e2e5=this[_0x69f0('0x43')][_0x69f0('0x57')][_0x38e35c[_0x69f0('0x5e')]][_0x69f0('0x5f')];var _0x44b06d=new VoiceQueueSummary(_0x38e35c);return _0x44b06d[_0x69f0('0x60')](_0x5627aa[_0x69f0('0x61')],this[_0x69f0('0x61')],_0x57e2e5,this[_0x69f0('0x10')][_0x69f0('0x11')]);};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x62')]=function(_0x421fb3,_0x5a9c00){var _0xcc6d3d=this[_0x69f0('0x5d')](_0x421fb3,_0x5a9c00);var _0x2ae502=![];_0x2ae502=_0xcc6d3d[_0x69f0('0x63')](_0x421fb3);if(_0x2ae502){Object[_0x69f0('0x64')](_0x421fb3,_0xcc6d3d);this[_0x69f0('0x10')][_0x69f0('0x13')][_0x421fb3[_0x69f0('0x5e')]]=_0x421fb3;this[_0x69f0('0x65')](_0xcc6d3d);}};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x1a')]=function(_0x144df5){var _0x2239d4=null;var _0x5ba764=this[_0x69f0('0x43')]['id'];if(this['summary']['queuestatus'][_0x5ba764]){_0x2239d4=this[_0x69f0('0x43')][_0x69f0('0x5a')][_0x5ba764][_0x144df5['actionid']];}if(!_0x2239d4){this[_0x69f0('0x43')]=initializeSummary();return;}var _0xe5f78=this[_0x69f0('0x13')][_0x2239d4['queue']];if(_0xe5f78[_0x69f0('0x52')]===_0x69f0('0x53')){this[_0x69f0('0x62')](_0xe5f78,_0x2239d4);}else if(_0xe5f78[_0x69f0('0x52')]===_0x69f0('0x66')){var _0x3eb4f1=this[_0x69f0('0x5d')](_0xe5f78,_0x2239d4);ami[_0x69f0('0x44')]('custom:queuesummary',_0x3eb4f1);}this[_0x69f0('0x43')][_0x69f0('0x67')]-=0x1;var _0x5b6c25=this[_0x69f0('0x43')][_0x69f0('0x67')]>0x0?!![]:![];if(!_0x5b6c25){return this[_0x69f0('0x17')](this[_0x69f0('0x43')][_0x69f0('0x68')]);}};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x19')]=function(_0x10c9af){var _0x38a14=this[_0x69f0('0x43')]['id'];if(this[_0x69f0('0x43')][_0x69f0('0x5a')][_0x38a14]&&this[_0x69f0('0x43')]['queuestatus'][_0x38a14][_0x10c9af[_0x69f0('0x5b')]]){this['summary'][_0x69f0('0x5a')][_0x38a14][_0x10c9af['actionid']][_0x69f0('0x61')][_0x69f0('0x69')](_0x10c9af);}};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x15')]=function(_0x5307b6){var _0xeb7585=this;try{if(this[_0x69f0('0x6a')](_0x5307b6)&&this[_0x69f0('0x6a')](_0x5307b6[_0x69f0('0x49')])){logger[_0x69f0('0x4c')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x69f0('0x3c')](_0x5307b6,{'showHidden':![],'depth':null}));var _0x4eb22c=this['voiceQueues'][_0x5307b6[_0x69f0('0x49')]];if(_0x4eb22c){logger[_0x69f0('0x4c')](_0x69f0('0x6b'),_0x4eb22c['name']);this[_0x69f0('0x43')][_0x69f0('0x57')][_0x4eb22c['name']]={'summaryEvent':_0x5307b6};this['summary'][_0x69f0('0x67')]+=0x1;return ami[_0x69f0('0x37')]({'action':_0x69f0('0x5a'),'queue':_0x4eb22c[_0x69f0('0x5e')]})['then'](function(_0x22d767){if(!_0xeb7585[_0x69f0('0x43')][_0x69f0('0x5a')][_0x5307b6['actionid']]){_0xeb7585[_0x69f0('0x43')][_0x69f0('0x5a')][_0x5307b6[_0x69f0('0x5b')]]={};}_0xeb7585[_0x69f0('0x43')][_0x69f0('0x5a')][_0x5307b6[_0x69f0('0x5b')]][_0x22d767[_0x69f0('0x5b')]]={'queue':_0x4eb22c[_0x69f0('0x5e')],'agents':[]};})['catch'](function(_0x280be6){throw _0x280be6;});}}}catch(_0x379383){logger[_0x69f0('0x3d')]('[voiceQueueReport][queuesummary]',util[_0x69f0('0x3c')](_0x379383,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69f0('0xb')]['syncQueueSummaryComplete']=function(_0xf6b416){if(this[_0x69f0('0x43')][_0x69f0('0x67')]>0x0){this[_0x69f0('0x43')][_0x69f0('0x68')]=_0xf6b416;return;}logger[_0x69f0('0x4c')](_0x69f0('0x6c'),util[_0x69f0('0x3c')](_0xf6b416,{'showHidden':![],'depth':null}));this[_0x69f0('0x43')]=initializeSummary();ami[_0x69f0('0x44')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x1c')]=function(_0x1a30fe){try{if(this['isNotNull'](_0x1a30fe)){logger['debug'](_0x69f0('0x6d'),_0x1a30fe[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x1a30fe,{'showHidden':![],'depth':null}));if(_[_0x69f0('0x56')](this['queueReports'][_0x1a30fe[_0x69f0('0x47')]])){this['queueReports'][_0x1a30fe[_0x69f0('0x47')]]=[];}if(_['isUndefined'](this[_0x69f0('0x11')][_0x1a30fe['uniqueid']])){this['channels'][_0x1a30fe[_0x69f0('0x47')]]={};}var _0x1f78f2=new QueueReport();_0x1f78f2[_0x69f0('0x49')]=_0x1a30fe[_0x69f0('0x49')];_0x1f78f2[_0x69f0('0x52')]=this[_0x69f0('0x13')][_0x1f78f2[_0x69f0('0x49')]]&&this[_0x69f0('0x13')][_0x1f78f2[_0x69f0('0x49')]][_0x69f0('0x52')]?this[_0x69f0('0x13')][_0x1f78f2[_0x69f0('0x49')]]['type']||_0x69f0('0x53'):_0x69f0('0x53');_0x1f78f2[_0x69f0('0x6e')]=moment()['format'](_0x69f0('0x6f'));_0x1f78f2[_0x69f0('0x70')]=_0x1a30fe[_0x69f0('0x70')];_0x1f78f2[_0x69f0('0x71')]=_0x1a30fe[_0x69f0('0x71')];_0x1f78f2[_0x69f0('0x47')]=_0x1a30fe[_0x69f0('0x47')];_0x1f78f2[_0x69f0('0x72')]=this[_0x69f0('0x11')][_0x1a30fe['uniqueid']][_0x69f0('0x72')];logger[_0x69f0('0x73')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x1f78f2['queue'],_0x1f78f2[_0x69f0('0x52')]);Object['assign'](_0x1f78f2,_[_0x69f0('0x74')](_0x1a30fe,_['keys'](_0x1f78f2)));this[_0x69f0('0xf')][_0x1a30fe[_0x69f0('0x47')]][_0x69f0('0x69')](_0x1f78f2);this[_0x69f0('0x11')][_0x1a30fe[_0x69f0('0x47')]]=_0x1f78f2;this[_0x69f0('0x45')](_0x1f78f2,_0x69f0('0x1b'));}}catch(_0x368ae4){logger['error'](_0x69f0('0x6d'),_0x1a30fe['uniqueid'],util[_0x69f0('0x3c')](_0x368ae4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x75')]=function(_0x28a154){try{if(this[_0x69f0('0x6a')](_0x28a154)){logger[_0x69f0('0x4c')](_0x69f0('0x76'),_0x28a154[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x28a154,{'showHidden':![],'depth':null}));if(this[_0x69f0('0xf')][_0x28a154[_0x69f0('0x47')]]){var _0x35929a=_[_0x69f0('0x77')](this[_0x69f0('0xf')][_0x28a154[_0x69f0('0x47')]]);_0x35929a[_0x69f0('0x78')]=![];_0x35929a[_0x69f0('0x79')]=null;_0x35929a[_0x69f0('0x7a')]=_0x28a154[_0x69f0('0x7a')];_0x35929a[_0x69f0('0x7b')]=_0x28a154[_0x69f0('0x7b')];_0x35929a[_0x69f0('0x1d')]=!![];_0x35929a['queuecallerabandonAt']=moment()[_0x69f0('0x48')](_0x69f0('0x6f'));_0x35929a[_0x69f0('0x4e')]=_0x69f0('0x7c');_0x35929a[_0x69f0('0x7d')]=null;logger['info'](_0x69f0('0x7e'),_0x35929a[_0x69f0('0x49')],_0x35929a['type']);this[_0x69f0('0x11')][_0x28a154[_0x69f0('0x47')]]=_0x35929a;this['emitVoiceQueueChannelRemove'](_0x35929a,_0x69f0('0x1d'));}}}catch(_0x3eaa2d){logger[_0x69f0('0x3d')](_0x69f0('0x76'),_0x28a154[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x3eaa2d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x5a6011){try{if(this[_0x69f0('0x6a')](_0x5a6011)){logger[_0x69f0('0x4c')]('[%s][voiceQueueReport][queuecallerleave]',_0x5a6011[_0x69f0('0x47')],util['inspect'](_0x5a6011,{'showHidden':![],'depth':null}));if(this[_0x69f0('0xf')][_0x5a6011[_0x69f0('0x47')]]){var _0x588913=_[_0x69f0('0x77')](this['queueReports'][_0x5a6011['uniqueid']]);_0x588913[_0x69f0('0x7f')]=moment()[_0x69f0('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x588913['connectedlinenum']=_0x5a6011[_0x69f0('0x80')];_0x588913[_0x69f0('0x81')]=_0x5a6011[_0x69f0('0x81')];logger[_0x69f0('0x73')](_0x69f0('0x82'),_0x588913['queue'],_0x588913[_0x69f0('0x52')],_0x5a6011[_0x69f0('0x80')],_0x5a6011[_0x69f0('0x81')]);this[_0x69f0('0x11')][_0x5a6011[_0x69f0('0x47')]]=_0x588913;this[_0x69f0('0x45')](_0x588913,_0x69f0('0x83'));}}}catch(_0x5a0ceb){logger['error'](_0x69f0('0x84'),_0x5a6011[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x5a0ceb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x20')]=function(_0x251886){try{if(this[_0x69f0('0x6a')](_0x251886)){logger[_0x69f0('0x4c')](_0x69f0('0x85'),_0x251886[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x251886,{'showHidden':![],'depth':null}));if(this[_0x69f0('0xf')][_0x251886['uniqueid']]){var _0x199b14=_[_0x69f0('0x77')](this[_0x69f0('0xf')][_0x251886[_0x69f0('0x47')]]);_0x199b14['queuecallercomplete']=!![];_0x199b14[_0x69f0('0x4e')]=_0x69f0('0x86');logger['info'](_0x69f0('0x87'),_0x199b14['queue'],_0x199b14[_0x69f0('0x52')]);}}}catch(_0x2df79c){logger[_0x69f0('0x3d')](_0x69f0('0x85'),_0x251886[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x2df79c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69f0('0xb')]['syncAgentComplete']=function(_0x4ac331){try{if(this[_0x69f0('0x6a')](_0x4ac331)){logger[_0x69f0('0x4c')](_0x69f0('0x88'),_0x4ac331[_0x69f0('0x47')],util['inspect'](_0x4ac331,{'showHidden':![],'depth':null}));if(this[_0x69f0('0xf')][_0x4ac331[_0x69f0('0x47')]]){var _0x528f02=_['last'](this[_0x69f0('0xf')][_0x4ac331['uniqueid']]);_0x528f02['queuecallerabandon']=![];_0x528f02[_0x69f0('0x89')]=null;_0x528f02[_0x69f0('0x8a')]=!![];_0x528f02[_0x69f0('0x7d')]=_0x4ac331[_0x69f0('0x8b')];_0x528f02[_0x69f0('0x7a')]=_0x4ac331[_0x69f0('0x7a')];_0x528f02[_0x69f0('0x78')]=!![];_0x528f02[_0x69f0('0x32')]=![];_0x528f02[_0x69f0('0x8c')]=null;if(!_0x528f02[_0x69f0('0x8d')]){if(_0x4ac331[_0x69f0('0x8e')]==_0x69f0('0x8d')){_0x528f02[_0x69f0('0x4e')]=_0x69f0('0x8f');logger[_0x69f0('0x73')](_0x69f0('0x90'),_0x528f02[_0x69f0('0x49')],_0x528f02['type']);}else{if(_['startsWith'](_0x4ac331[_0x69f0('0x91')][_0x69f0('0x92')](),'local/')){if(this[_0x69f0('0xf')][_0x4ac331[_0x69f0('0x93')]]){var _0x3003c7=_[_0x69f0('0x77')](this[_0x69f0('0xf')][_0x4ac331[_0x69f0('0x93')]]);_0x3003c7[_0x69f0('0x78')]=![];_0x3003c7[_0x69f0('0x32')]=!![];_0x3003c7[_0x69f0('0x8c')]=moment(_0x528f02['queuecallerjoinAt'])['add'](_0x4ac331[_0x69f0('0x7a')],'seconds')[_0x69f0('0x48')](_0x69f0('0x6f'));_0x3003c7['queuecallerexitreason']=_0x69f0('0x94');_0x3003c7[_0x69f0('0x8d')]=!![];_0x3003c7[_0x69f0('0x95')]=_0x69f0('0x96');_0x3003c7[_0x69f0('0x97')]=_0x4ac331['destexten'];_0x3003c7[_0x69f0('0x98')]=_0x4ac331[_0x69f0('0x47')];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x3003c7[_0x69f0('0x49')],_0x3003c7['type']);var _0x546b52=this[_0x69f0('0xf')][_0x4ac331['linkedid']];this['queueReports'][_0x4ac331['linkedid']]=this['queueReports'][_0x4ac331[_0x69f0('0x47')]];this['queueReports'][_0x4ac331[_0x69f0('0x47')]]=_0x546b52;}}else{_0x528f02[_0x69f0('0x4e')]=_0x69f0('0x99')+_0x4ac331[_0x69f0('0x8e')]['toUpperCase']();logger[_0x69f0('0x73')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x528f02[_0x69f0('0x49')],_0x528f02[_0x69f0('0x52')],_0x528f02[_0x69f0('0x4e')]);}}}this[_0x69f0('0x11')][_0x4ac331[_0x69f0('0x47')]]=_0x528f02;}}}catch(_0x1e1ef3){logger[_0x69f0('0x3d')]('[%s][voiceQueueReport][agentcomplete]',_0x4ac331[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x1e1ef3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69f0('0xb')]['syncVarSet']=function(_0x554fde){try{if(this['isNotNull'](_0x554fde)){logger[_0x69f0('0x4c')](_0x69f0('0x9a'),_0x554fde[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x554fde,{'showHidden':![],'depth':null}));this[_0x69f0('0x9b')](_0x554fde[_0x69f0('0x47')],_[_0x69f0('0x9c')](_0x554fde['variable'])[0x0],_0x554fde['value']);if(this['queueReports'][_0x554fde['uniqueid']]){var _0x533c0a=_[_0x69f0('0x77')](this[_0x69f0('0xf')][_0x554fde[_0x69f0('0x47')]]);if(_0x533c0a){if(this['isNotNull'](_0x554fde[_0x69f0('0x9d')])&&this[_0x69f0('0x6a')](_0x554fde[_0x69f0('0x9d')][_0x69f0('0x5a')])){switch(_0x554fde[_0x69f0('0x9e')]){case _0x69f0('0x9f'):_0x533c0a[_0x69f0('0x32')]=![];_0x533c0a[_0x69f0('0x8c')]=null;break;case _0x69f0('0xa0'):_0x533c0a['lastevent']=_0x69f0('0xa1');_0x533c0a[_0x69f0('0x32')]=!![];_0x533c0a[_0x69f0('0x8c')]=moment()[_0x69f0('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x533c0a[_0x69f0('0x7f')]=moment()[_0x69f0('0x48')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x69f0('0x4c')](_0x69f0('0xa2'),_0x554fde[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x533c0a,{'showHidden':![],'depth':null}));ami[_0x69f0('0x44')]('custom:timeout',_0x533c0a);break;default:_0x533c0a[_0x69f0('0x32')]=!![];_0x533c0a[_0x69f0('0x8c')]=moment()[_0x69f0('0x48')](_0x69f0('0x6f'));_0x533c0a[_0x69f0('0x7f')]=moment()[_0x69f0('0x48')]('YYYY-MM-DD\x20HH:mm:ss');}_0x533c0a[_0x69f0('0x1d')]=![];_0x533c0a[_0x69f0('0x89')]=null;_0x533c0a[_0x69f0('0x4e')]=_0x554fde[_0x69f0('0x9e')];this['channels'][_0x554fde[_0x69f0('0x47')]]=_0x533c0a;this['emitVoiceQueueChannelRemove'](_0x533c0a,'varset');}else if(this['isNotNull'](_0x554fde[_0x69f0('0x9d')])&&this['isNotNull'](_0x554fde['variable'][_0x69f0('0xa3')])){if(!_0x533c0a[_0x69f0('0x1d')]){_0x533c0a[_0x69f0('0x32')]=!![];_0x533c0a['queuecallerexitAt']=moment()[_0x69f0('0x48')](_0x69f0('0x6f'));_0x533c0a[_0x69f0('0x4e')]=_0x69f0('0xa4');_0x533c0a[_0x69f0('0x7f')]=moment()[_0x69f0('0x48')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x554fde[_0x69f0('0x47')]]=_0x533c0a;}}logger[_0x69f0('0x73')](_0x69f0('0xa5'),_0x554fde[_0x69f0('0x47')],_0x533c0a['queue'],_0x533c0a[_0x69f0('0x52')],_['keys'](_0x554fde['variable'])[0x0],_0x554fde[_0x69f0('0x9e')]);_0x533c0a[_0x69f0('0x3f')]=this['variables'][_0x554fde[_0x69f0('0x47')]];}}}}catch(_0x513046){logger[_0x69f0('0x3d')](_0x69f0('0x9a'),_0x554fde[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x513046,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x9b')]=function(_0x83e280,_0x3a5e78,_0x39657e){var _0x1a3430=[_0x69f0('0xa6'),_0x69f0('0xa7'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x69f0('0xa8'),'rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged',_0x69f0('0xa9'),'sipuri',_0x69f0('0xaa'),_0x69f0('0xab'),'membercalls',_0x69f0('0xac'),_0x69f0('0xad'),_0x69f0('0xae'),_0x69f0('0x8b'),_0x69f0('0xaf'),'memberrealtime'];if(!_[_0x69f0('0x36')](_0x3a5e78)&&!_['includes'](_0x1a3430,_0x3a5e78)){if(_[_0x69f0('0x56')](this['variables'][_0x83e280])){this['variables'][_0x83e280]={};}this[_0x69f0('0x3f')][_0x83e280][_0x3a5e78]=_0x39657e;}};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0xb0')]=function(_0x1eb334,_0x2981b2,_0x460b6b){try{var _0xc05838={};if(this['queueReports'][_0x1eb334]){for(var _0x367b80=0x0;_0x367b80<this[_0x69f0('0xf')][_0x1eb334]['length'];_0x367b80+=0x1){_0xc05838=this[_0x69f0('0xf')][_0x1eb334][_0x367b80];var _0x6d6df4=this[_0x69f0('0x13')][_0xc05838[_0x69f0('0x49')]];if(_0x6d6df4){_0x6d6df4['sumHoldTime']+=moment(_0xc05838['queuecallerleaveAt'])[_0x69f0('0xb1')](_0xc05838[_0x69f0('0x6e')],_0x69f0('0xb2'))||0x0;if(_0x460b6b&&_0xc05838[_0x69f0('0x4e')]===_0x69f0('0x4f')){_0xc05838[_0x69f0('0x4e')]=_0x69f0('0x86');}if(_0x367b80===this[_0x69f0('0xf')][_0x1eb334]['length']-0x1){_0x6d6df4[_0x69f0('0xb3')]+=moment()['milliseconds'](0x0)[_0x69f0('0xb1')](_0xc05838[_0x69f0('0x6e')],_0x69f0('0xb2'));if(hasCallerLeftTheQueue(_0xc05838)&&_0xc05838['queuecallerexitreason']!=='ATTENDEDTRANSFER'){_0x6d6df4[_0x69f0('0xb4')]+=0x1;}if(_0xc05838['queuecallercomplete']){_0x6d6df4[_0x69f0('0xb5')]+=0x1;_0x6d6df4[_0x69f0('0xb6')]+=moment()['milliseconds'](0x0)[_0x69f0('0xb1')](_0xc05838[_0x69f0('0x7f')],_0x69f0('0xb2'));_0xc05838[_0x69f0('0x79')]=moment()[_0x69f0('0x48')](_0x69f0('0x6f'));_0xc05838[_0x69f0('0x32')]=![];_0xc05838['queuecallerexitAt']=null;}if(_0xc05838['queuecallerexit']&&_0xc05838['transfer']!=!![]){_0x6d6df4[_0x69f0('0xb7')]+=0x1;_0xc05838[_0x69f0('0xb8')]=_0x69f0('0xb7');logger['debug'](_0x69f0('0xb9'),_0x1eb334,util[_0x69f0('0x3c')](_0xc05838,{'showHidden':![],'depth':null}));ami[_0x69f0('0x44')](_0x69f0('0xba'),_0xc05838);}if(_0xc05838[_0x69f0('0x1d')]){_0x6d6df4[_0x69f0('0xbb')]+=0x1;_0xc05838[_0x69f0('0xb8')]=_0x69f0('0xbb');logger[_0x69f0('0x4c')](_0x69f0('0xbc'),_0x1eb334,util['inspect'](_0xc05838,{'showHidden':![],'depth':null}));ami[_0x69f0('0x44')](_0x69f0('0xbd'),_0xc05838);}}else{_0x6d6df4['sumDuration']+=_0x6d6df4[_0x69f0('0xbe')];}logger[_0x69f0('0x73')](_0x69f0('0xbf'),_0x1eb334,_0xc05838[_0x69f0('0x49')],_0xc05838[_0x69f0('0x52')],_0x2981b2);this[_0x69f0('0x11')][_0x1eb334]=_0xc05838;Object[_0x69f0('0x64')](this[_0x69f0('0x13')][_0xc05838[_0x69f0('0x49')]],_0x6d6df4);if(_0xc05838['queuecallerleaveAt']){this[_0x69f0('0x4b')](_0xc05838,_0x69f0('0x22'));}}}logger[_0x69f0('0x4c')](_0x69f0('0xc0'),_0x1eb334,util[_0x69f0('0x3c')](this[_0x69f0('0xf')][_0x1eb334],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0xc05838)&&_0xc05838[_0x69f0('0x4e')]!=='ATTENDEDTRANSFER'){ami[_0x69f0('0x44')](_0x69f0('0xc1'),this['queueReports'][_0x1eb334]);if(this[_0x69f0('0xf')][_0x1eb334]){delete this[_0x69f0('0xf')][_0x1eb334];}if(this[_0x69f0('0x11')][_0x1eb334]){delete this['channels'][_0x1eb334];}if(this[_0x69f0('0x3f')][_0x1eb334]){delete this['variables'][_0x1eb334];}}}}catch(_0x33e1ab){logger[_0x69f0('0x3d')](_0x69f0('0xc2'),_0x1eb334,util[_0x69f0('0x3c')](_0x33e1ab,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x69f0('0x23')]=function(_0x4849d3){try{if(this['isNotNull'](_0x4849d3)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x4849d3[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x4849d3,{'showHidden':![],'depth':null}));if(this[_0x69f0('0xf')][_0x4849d3[_0x69f0('0x47')]]){return this[_0x69f0('0xb0')](_0x4849d3[_0x69f0('0x47')],_0x4849d3[_0x69f0('0xc3')],![]);}if(this['queueReports'][_0x4849d3[_0x69f0('0x93')]]){if(_0x4849d3['cause']==='21'){return;}return this[_0x69f0('0xb0')](_0x4849d3[_0x69f0('0x93')],_0x4849d3[_0x69f0('0xc3')],!![]);}var _0x2cc94e=Object['keys'](this[_0x69f0('0xf')]);for(var _0x181edc=0x0;_0x181edc<_0x2cc94e[_0x69f0('0xc4')];_0x181edc++){var _0x2feca1=_['last'](this[_0x69f0('0xf')][_0x2cc94e[_0x181edc]]);if(_0x2feca1&&_0x2feca1['transferid']===_0x4849d3[_0x69f0('0x47')]){return this[_0x69f0('0xb0')](_0x2feca1[_0x69f0('0x47')],_0x4849d3[_0x69f0('0xc3')],!![]);}}if(!this['queueReports'][_0x4849d3[_0x69f0('0x47')]]){logger[_0x69f0('0x4c')](_0x69f0('0xc5'),_0x4849d3['uniqueid']);if(this[_0x69f0('0x11')][_0x4849d3['uniqueid']]){delete this[_0x69f0('0x11')][_0x4849d3[_0x69f0('0x47')]];}if(this[_0x69f0('0x3f')][_0x4849d3[_0x69f0('0x47')]]){delete this[_0x69f0('0x3f')][_0x4849d3['uniqueid']];}}}}catch(_0x1c4d09){logger[_0x69f0('0x3d')](_0x69f0('0xc6'),_0x4849d3[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x1c4d09,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69f0('0xb')]['syncAttendedTransfer']=function(_0x4ebb60){try{if(this[_0x69f0('0x6a')](_0x4ebb60)){logger[_0x69f0('0x4c')](_0x69f0('0xc7'),_0x4ebb60[_0x69f0('0x47')],util['inspect'](_0x4ebb60,{'showHidden':![],'depth':null}));var _0x28975e;var _0x415953;var _0xf0c5f6;if(this[_0x69f0('0xf')][_0x4ebb60['transfereeuniqueid']]){_0x28975e=_['last'](this['queueReports'][_0x4ebb60[_0x69f0('0xc8')]]);_0x28975e[_0x69f0('0x97')]=_0x4ebb60[_0x69f0('0xc9')];_0x28975e[_0x69f0('0x98')]=_0x4ebb60[_0x69f0('0xca')];_0x28975e[_0x69f0('0x4e')]='ATTENDEDTRANSFER';_0x28975e['transfer']=!![];_0x28975e[_0x69f0('0x95')]=_0x69f0('0xcb');if(this['queueReports'][_0x4ebb60['secondtransfereruniqueid']]){_0xf0c5f6=this[_0x69f0('0xf')][_0x4ebb60[_0x69f0('0xca')]];this['queueReports'][_0x4ebb60[_0x69f0('0xca')]]=this[_0x69f0('0xf')][_0x4ebb60['transfereeuniqueid']];this['queueReports'][_0x4ebb60[_0x69f0('0xc8')]]=_0xf0c5f6;_0x415953=_['last'](this[_0x69f0('0xf')][_0x4ebb60[_0x69f0('0xc8')]]);_0x415953[_0x69f0('0x34')]=!![];}logger[_0x69f0('0x73')](_0x69f0('0xcc'),_0x4ebb60[_0x69f0('0x47')],_0x28975e[_0x69f0('0x49')],_0x28975e[_0x69f0('0x52')],_0x28975e[_0x69f0('0x97')],_0x28975e[_0x69f0('0x98')]);}else if(this[_0x69f0('0xf')][_0x4ebb60['transfertargetuniqueid']]){_0x28975e=_['last'](this[_0x69f0('0xf')][_0x4ebb60[_0x69f0('0xcd')]]);_0x28975e[_0x69f0('0x97')]=_0x4ebb60['origtransfererexten'];_0x28975e[_0x69f0('0x98')]=_0x4ebb60[_0x69f0('0xce')];_0x28975e[_0x69f0('0x4e')]=_0x69f0('0x4f');_0x28975e[_0x69f0('0x8d')]=!![];_0x28975e[_0x69f0('0x95')]='ATTENDED';if(this['queueReports'][_0x4ebb60['origtransfereruniqueid']]){_0xf0c5f6=this[_0x69f0('0xf')][_0x4ebb60[_0x69f0('0xce')]];this[_0x69f0('0xf')][_0x4ebb60[_0x69f0('0xce')]]=this[_0x69f0('0xf')][_0x4ebb60['transfertargetuniqueid']];this[_0x69f0('0xf')][_0x4ebb60['transfertargetuniqueid']]=_0xf0c5f6;_0x415953=_[_0x69f0('0x77')](this[_0x69f0('0xf')][_0x4ebb60['transfertargetuniqueid']]);_0x415953[_0x69f0('0x34')]=!![];}logger[_0x69f0('0x73')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x4ebb60[_0x69f0('0x47')],_0x28975e[_0x69f0('0x49')],_0x28975e[_0x69f0('0x52')],_0x28975e[_0x69f0('0x97')],_0x28975e['transferuniqueid']);}else if(this['queueReports'][_0x4ebb60[_0x69f0('0xce')]]){_0x28975e=_['last'](this['queueReports'][_0x4ebb60[_0x69f0('0xce')]]);_0x28975e['transferexten']=_0x4ebb60[_0x69f0('0xcf')];_0x28975e[_0x69f0('0x98')]=_0x4ebb60[_0x69f0('0xce')];_0x28975e[_0x69f0('0x4e')]=_0x69f0('0x4f');_0x28975e['transfer']=!![];_0x28975e[_0x69f0('0x95')]=_0x69f0('0xcb');_0x28975e[_0x69f0('0x34')]=!![];_0x28975e[_0x69f0('0xd0')]=_0x4ebb60[_0x69f0('0xc8')];}else if(this[_0x69f0('0xf')][_0x4ebb60[_0x69f0('0xca')]]){_0x28975e=_['last'](this[_0x69f0('0xf')][_0x4ebb60['secondtransfereruniqueid']]);_0x28975e['transferexten']=_0x4ebb60[_0x69f0('0xc9')];_0x28975e['transferuniqueid']=_0x4ebb60['secondtransfereruniqueid'];_0x28975e[_0x69f0('0x4e')]=_0x69f0('0x4f');_0x28975e[_0x69f0('0x8d')]=!![];_0x28975e[_0x69f0('0x95')]=_0x69f0('0xcb');_0x28975e[_0x69f0('0x34')]=!![];_0x28975e['transferid']=_0x4ebb60[_0x69f0('0xcd')];}}}catch(_0x48c49d){logger[_0x69f0('0x3d')]('[%s][voiceQueueReport][attendedtransfer]',_0x4ebb60[_0x69f0('0x47')],util['inspect'](_0x48c49d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0x2a')]=function(_0x24df6a){try{if(this[_0x69f0('0x6a')](_0x24df6a)){logger['debug'](_0x69f0('0xd1'),_0x24df6a[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x24df6a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x24df6a[_0x69f0('0xc8')]]){var _0x11a85e=_['last'](this[_0x69f0('0xf')][_0x24df6a[_0x69f0('0xc8')]]);_0x11a85e[_0x69f0('0x4e')]=_0x69f0('0xd2');_0x11a85e[_0x69f0('0x8d')]=!![];_0x11a85e['transfertype']=_0x69f0('0xd3');_0x11a85e[_0x69f0('0x97')]=_0x24df6a['extension'];_0x11a85e[_0x69f0('0x98')]=_0x24df6a[_0x69f0('0xc8')];logger['info'](_0x69f0('0xd4'),_0x24df6a[_0x69f0('0x47')],_0x11a85e[_0x69f0('0x49')],_0x11a85e[_0x69f0('0x52')],_0x11a85e[_0x69f0('0x97')],_0x11a85e[_0x69f0('0x98')]);this['syncHangup']({'event':_0x69f0('0xd5'),'uniqueid':_0x24df6a[_0x69f0('0xc8')],'context':_0x24df6a[_0x69f0('0xd6')],'channel':_0x24df6a[_0x69f0('0xd7')]});}}}catch(_0x13a83c){logger['error'](_0x69f0('0xd1'),_0x24df6a['uniqueid'],util['inspect'](_0x13a83c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x69f0('0x26')]=function(_0x1916e8){try{if(this['isNotNull'](_0x1916e8)){logger[_0x69f0('0x4c')](_0x69f0('0xd8'),_0x1916e8['uniqueid'],util[_0x69f0('0x3c')](_0x1916e8,{'showHidden':![],'depth':null}));if(this[_0x69f0('0xf')][_0x1916e8[_0x69f0('0x47')]]){var _0x24e797=_[_0x69f0('0x77')](this[_0x69f0('0xf')][_0x1916e8['uniqueid']]);if(!_[_0x69f0('0x36')](_0x24e797[_0x69f0('0x7f')])){_0x24e797[_0x69f0('0xd9')]=moment()[_0x69f0('0x48')](_0x69f0('0x6f'));logger['info'](_0x69f0('0xda'),_0x1916e8[_0x69f0('0x47')],_0x24e797['mohstarttime']);}}}}catch(_0x2634f4){logger[_0x69f0('0x3d')](_0x69f0('0xd8'),_0x1916e8[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x2634f4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69f0('0xb')]['syncMusicOnHoldStop']=function(_0x2dbecf){try{if(this['isNotNull'](_0x2dbecf)){logger['debug'](_0x69f0('0xdb'),_0x2dbecf[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x2dbecf,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2dbecf[_0x69f0('0x47')]]){var _0x38d8c8=_[_0x69f0('0x77')](this['queueReports'][_0x2dbecf[_0x69f0('0x47')]]);if(!_[_0x69f0('0x36')](_0x38d8c8['mohstarttime'])){_0x38d8c8['mohtime']+=moment()[_0x69f0('0xdc')](0x0)[_0x69f0('0xb1')](_0x38d8c8[_0x69f0('0xd9')],_0x69f0('0xb2'));logger[_0x69f0('0x73')](_0x69f0('0xdd'),_0x2dbecf[_0x69f0('0x47')],_0x38d8c8[_0x69f0('0xde')]);delete _0x38d8c8[_0x69f0('0xd9')];}}}}catch(_0xad4c1a){logger['error'](_0x69f0('0xdb'),_0x2dbecf[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0xad4c1a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x69f0('0xb')][_0x69f0('0xdf')]=function(_0x49ce8e){try{if(this['isNotNull'](_0x49ce8e)){logger[_0x69f0('0x4c')](_0x69f0('0xe0'),_0x49ce8e[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x49ce8e,{'showHidden':![],'depth':null}));if(_0x49ce8e['application']['toLowerCase']()===_0x69f0('0xe1')){_0x49ce8e[_0x69f0('0xe2')]=_0x49ce8e[_0x69f0('0xe3')]&&_0x49ce8e[_0x69f0('0xe3')][_0x69f0('0xe4')]('CDR(routeAlias)')?_0x49ce8e[_0x69f0('0xe3')]:(_0x49ce8e[_0x69f0('0xe3')]||_0x49ce8e[_0x69f0('0xe2')])[_0x69f0('0x92')]();if(_[_0x69f0('0xe4')](_0x49ce8e[_0x69f0('0xe2')][_0x69f0('0x92')](),'cdr(')){logger['info'](_0x69f0('0xe5'),_0x49ce8e['uniqueid'],_0x49ce8e[_0x69f0('0xe6')],_0x49ce8e[_0x69f0('0xe2')]);if(_[_0x69f0('0x56')](this[_0x69f0('0x11')][_0x49ce8e['uniqueid']]))this['channels'][_0x49ce8e[_0x69f0('0x47')]]={};var _0x5c040a=_0x49ce8e[_0x69f0('0xe2')][_0x69f0('0xe7')]('=');var _0x3b5574=_0x5c040a[0x0]['toLowerCase']()[_0x69f0('0xe8')](/cdr\((.*)\)/);if(_0x3b5574)this[_0x69f0('0x11')][_0x49ce8e[_0x69f0('0x47')]][_0x3b5574[0x1]]=_0x5c040a[0x1];}}}}catch(_0x3401b1){logger[_0x69f0('0x3d')](_0x69f0('0xe9'),_0x49ce8e[_0x69f0('0x47')],util[_0x69f0('0x3c')](_0x3401b1,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file