Built motion from commit 9d1906d1.|2.5.40
[motion2.git] / server / services / ami / report / voiceQueueReport.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x949e=['includes','[%s][voiceQueueReport][hangup]','length','diff','answered','queuecallercompleteAt','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transferuniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','transfertype','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','[%s][voiceQueueReport][attendedtransfer]','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','milliseconds','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','appdata','CDR(routeAlias)','applicationdata','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceQueueReport][newexten]','exports','moment','util','../../../config/environment','../model/queueReport','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','agents','channels','queueChannels','voiceQueues','campaigns','variables','syncQueueSummary','bind','queuecallerjoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','isEmpty','originated','hasOwnProperty','talking','queueStatusComplete','unlockRR','switch','isNil','Action','status','channel','message','inspect','queueReports','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','Trunk','active','callerid','Interval','stringify','md5','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','loopQueueShow','clearZombieChannels','queues','catch','loopQueueSummary','flagQueueSummary','queuesummary','then','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','waiting','toNumber','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueSummaryComplete','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','syncQueueCallerAbandon','last','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','linkedid','add','seconds','FORWARD','transferexten','toUpperCase','agentcomplete','addVariable','variable','value','queuestatus','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberlastcall','memberpenalty'];(function(_0x31ee1e,_0x4635cf){var _0x43abaf=function(_0x59851d){while(--_0x59851d){_0x31ee1e['push'](_0x31ee1e['shift']());}};_0x43abaf(++_0x4635cf);}(_0x949e,0x11c));var _0xe949=function(_0x4d9859,_0x5ee8c3){_0x4d9859=_0x4d9859-0x0;var _0x376fe6=_0x949e[_0x4d9859];return _0x376fe6;};'use strict';var _=require('lodash');var moment=require(_0xe949('0x0'));var util=require(_0xe949('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xe949('0x2'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');var QueueReport=require(_0xe949('0x3'));config[_0xe949('0x4')]=_[_0xe949('0x5')](config[_0xe949('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xe949('0x6'))(new Redis(config[_0xe949('0x4')]));var Sequence=function(){};Sequence[_0xe949('0x7')][_0xe949('0x8')]=function(_0x41259f){this[_0xe949('0x9')]=this[_0xe949('0x9')]?this[_0xe949('0x9')][_0xe949('0xa')](_0x41259f):_0x41259f();};function VoiceQueueReport(_0x426a95){this[_0xe949('0xb')]=new Sequence();this['queueReports']={};this[_0xe949('0xc')]=_0x426a95[_0xe949('0xc')];this[_0xe949('0xd')]=_0x426a95[_0xe949('0xe')];this[_0xe949('0xf')]=_0x426a95['voiceQueues'];this['flagQueueSummary']=!![];this[_0xe949('0x10')]=_0x426a95[_0xe949('0x10')];this[_0xe949('0x11')]={};ami['on']('queuesummary',this[_0xe949('0x12')][_0xe949('0x13')](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0xe949('0x14'),this['syncQueueCallerJoin']['bind'](this));ami['on'](_0xe949('0x15'),this['syncQueueCallerAbandon'][_0xe949('0x13')](this));ami['on'](_0xe949('0x16'),this[_0xe949('0x17')][_0xe949('0x13')](this));ami['on']('agentcomplete',this[_0xe949('0x18')]['bind'](this));ami['on'](_0xe949('0x19'),this[_0xe949('0x1a')]['bind'](this));ami['on'](_0xe949('0x1b'),this[_0xe949('0x1c')][_0xe949('0x13')](this));ami['on'](_0xe949('0x1d'),this[_0xe949('0x1e')][_0xe949('0x13')](this));ami['on'](_0xe949('0x1f'),this[_0xe949('0x20')]['bind'](this));ami['on'](_0xe949('0x21'),this[_0xe949('0x22')]['bind'](this));ami['on']('musiconholdstop',this[_0xe949('0x23')]['bind'](this));ami['on'](_0xe949('0x24'),this[_0xe949('0x25')][_0xe949('0x13')](this));ami['on'](_0xe949('0x26'),this['syncBlindTransfer'][_0xe949('0x13')](this));this['loopQueueSummary']();this['loopQueueShow']();}function clearChannels(_0x3beea5){if(!_[_0xe949('0x27')](_0x3beea5)){for(var _0x5f587b in _0x3beea5){if(_0x3beea5['hasOwnProperty'](_0x5f587b)){delete _0x3beea5[_0x5f587b];}}}}function clearCampaigns(_0x1b284f){if(!_[_0xe949('0x27')](_0x1b284f)){for(var _0x57902d in _0x1b284f){if(_0x1b284f['hasOwnProperty'](_0x57902d)){_0x1b284f[_0x57902d][_0xe949('0x28')]=0x0;}}}}function clearVoiceQueues(_0x49b13a){if(!_[_0xe949('0x27')](_0x49b13a)){for(var _0x411129 in _0x49b13a){if(_0x49b13a[_0xe949('0x29')](_0x411129)){_0x49b13a[_0x411129][_0xe949('0x28')]=0x0;_0x49b13a[_0x411129][_0xe949('0x2a')]=0x0;_0x49b13a[_0x411129]['pTalking']=0x0;_0x49b13a[_0x411129]['waiting']=0x0;_0x49b13a[_0x411129][_0xe949('0x2b')]=!![];}}}}function clearAgentBooked(_0x501e68){if(!_['isEmpty'](_0x501e68)){for(var _0x182297 in _0x501e68){if(_0x501e68[_0xe949('0x29')](_0x182297)){_0x501e68[_0x182297][_0xe949('0x2c')]=!![];}}}}VoiceQueueReport[_0xe949('0x7')]['clearZombieChannels']=function(){var _0x278d49=this;for(var _0x3cb281 in this[_0xe949('0xd')]){if(this['channels'][_0xe949('0x29')](_0x3cb281)&&!this[_0xe949('0xd')][_0x3cb281][_0xe949('0x2d')]){this[_0xe949('0xb')][_0xe949('0x8')](function(){if(!_[_0xe949('0x2e')](_0x278d49['channels'][_0x3cb281])){return ami[_0xe949('0x2f')]({'action':_0xe949('0x30'),'channel':_0x278d49[_0xe949('0xd')][_0x3cb281][_0xe949('0x31')]})['catch'](function(_0x219a5a){if(_0x219a5a[_0xe949('0x32')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x278d49[_0xe949('0xd')][_0x3cb281]){delete _0x278d49[_0xe949('0xd')][_0x3cb281];logger['error']('[%s][voiceQueueReport][checkChannel]',_0x3cb281,util[_0xe949('0x33')](_0x219a5a,{'showHidden':![],'depth':null}));}if(_0x278d49[_0xe949('0x34')][_0x3cb281]){delete _0x278d49[_0xe949('0x34')][_0x3cb281];logger[_0xe949('0x35')](_0xe949('0x36'),_0x3cb281,util['inspect'](_0x219a5a,{'showHidden':![],'depth':null}));}if(_0x278d49[_0xe949('0x11')][_0x3cb281]){delete _0x278d49['variables'][_0x3cb281];logger[_0xe949('0x35')](_0xe949('0x37'),_0x3cb281,util['inspect'](_0x219a5a,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x20')]=function(){logger['error'](_0xe949('0x38'));clearChannels(this[_0xe949('0xd')]);this[_0xe949('0x39')](this[_0xe949('0x34')]);clearAgentBooked(this[_0xe949('0xc')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xe949('0x10')]);};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x39')]=function(_0x5bddbc){var _0x5443fb=this;if(!_['isEmpty'](_0x5bddbc)){for(var _0x27197b in _0x5bddbc){if(_0x5bddbc['hasOwnProperty'](_0x27197b)){_0x5443fb[_0xe949('0x3a')](_0x5bddbc[_0x27197b],_0xe949('0x3b'));delete _0x5bddbc[_0x27197b];}}}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x3c')]=function(_0x4b1fee,_0x213470,_0x140d89){io['to'](_0x4b1fee)[_0xe949('0x3c')](_0x213470,_0x140d89);};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x3d')]=function(_0x58733f,_0x16d892){logger[_0xe949('0x3e')](_0xe949('0x3f')+_0x16d892+']\x20sending\x20voice_queue_channel:save\x20event:',_0x58733f['uniqueid'],util['inspect'](_0x58733f,{'showHidden':![],'depth':null}));this['emit'](util[_0xe949('0x40')](_0xe949('0x41'),_0x58733f[_0xe949('0x42')]),_0xe949('0x43'),_0x58733f);io[_0xe949('0x3c')](_0xe949('0x44'),_0x58733f);};VoiceQueueReport['prototype'][_0xe949('0x3a')]=function(_0x5d4675,_0x2019a6){logger['debug'](_0xe949('0x3f')+_0x2019a6+_0xe949('0x45'),_0x5d4675['uniqueid'],util[_0xe949('0x33')](_0x5d4675,{'showHidden':![],'depth':null}));this[_0xe949('0x3c')](util['format']('voice:queue:%s',_0x5d4675[_0xe949('0x42')]),_0xe949('0x46'),_0x5d4675);io[_0xe949('0x3c')](_0xe949('0x47'),_0x5d4675);};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x48')]=function(_0x945037,_0x2388a0){if(_0x945037[_0xe949('0x49')]===_0xe949('0x4a')){var _0x1d989e={'id':_0x945037['id'],'name':_0x945037[_0xe949('0x42')],'strategy':_0x945037[_0xe949('0x4b')],'answered':_0x945037['answered'],'available':_0x945037[_0xe949('0x4c')],'loggedIn':_0x945037[_0xe949('0x4d')],'pTalking':_0x945037[_0xe949('0x4e')],'sumBillable':_0x945037[_0xe949('0x4f')],'sumDuration':_0x945037[_0xe949('0x50')],'sumHoldTime':_0x945037[_0xe949('0x51')]||0x0,'talking':_0x945037[_0xe949('0x2a')],'total':_0x945037[_0xe949('0x52')],'type':_0x945037['type'],'unmanaged':_0x945037[_0xe949('0x53')],'abandoned':_0x945037['abandoned'],'waiting':_0x945037['waiting']};if(_0x945037['Trunk']){_0x1d989e[_0xe949('0x54')]={'id':_0x945037[_0xe949('0x54')]['id'],'name':_0x945037[_0xe949('0x54')][_0xe949('0x42')],'active':_0x945037[_0xe949('0x54')][_0xe949('0x55')],'callerid':_0x945037[_0xe949('0x54')][_0xe949('0x56')]};}if(_0x945037['Interval']){_0x1d989e[_0xe949('0x57')]={'id':_0x945037[_0xe949('0x57')]['id'],'name':_0x945037['Interval'][_0xe949('0x42')]};}var _0x1bc97b=md5(JSON[_0xe949('0x58')](_0x1d989e));if(_0x945037['md5']!==_0x1bc97b){_0x945037[_0xe949('0x59')]=_0x1bc97b;logger[_0xe949('0x3e')](_0xe949('0x5a')+_0x2388a0+_0xe949('0x5b'),util['inspect'](_0x1d989e,{'showHidden':![],'depth':null}));this[_0xe949('0x3c')](util[_0xe949('0x40')](_0xe949('0x41'),_0x1d989e[_0xe949('0x42')]),_0xe949('0x5c'),_0x1d989e);}}};VoiceQueueReport[_0xe949('0x7')]['isNotNull']=function(_0x488f68){return _0x488f68!==null&&!_[_0xe949('0x5d')](_0x488f68);};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x5e')]=function(){var _0x2f54c8=this;setInterval(function(){_0x2f54c8[_0xe949('0x5f')]();ami[_0xe949('0x2f')]({'action':_0xe949('0x60')})[_0xe949('0x61')](function(_0x42d6c5){logger[_0xe949('0x35')]('[voiceQueueReport][queues]',util[_0xe949('0x33')](_0x42d6c5,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x62')]=function(){var _0x344e15=this;setInterval(function(){if(_0x344e15[_0xe949('0x63')]){return ami[_0xe949('0x2f')]({'action':_0xe949('0x64')})[_0xe949('0x65')](function(_0x236adf){_0x344e15[_0xe949('0x63')]=![];})[_0xe949('0x61')](function(_0x17eb90){logger[_0xe949('0x35')](_0xe949('0x66'),util[_0xe949('0x33')](_0x17eb90,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x12')]=function(_0x186f48){try{if(this[_0xe949('0x67')](_0x186f48)&&this[_0xe949('0x67')](_0x186f48[_0xe949('0x68')])){logger[_0xe949('0x3e')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xe949('0x33')](_0x186f48,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x186f48[_0xe949('0x68')]]){logger['info'](_0xe949('0x69'),_0x186f48['queue']);var _0x2451f7=_[_0xe949('0x6a')](this['channels'],_0xe949('0x68'))[_0x186f48[_0xe949('0x68')]]||0x0;var _0x576c3b=_0x2451f7-_0x186f48[_0xe949('0x6b')];if(this['voiceQueues'][_0x186f48[_0xe949('0x68')]][_0xe949('0x6c')]!==_[_0xe949('0x6d')](_0x186f48['callers'])||this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x4d')]!==_[_0xe949('0x6d')](_0x186f48[_0xe949('0x6e')])||this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x4c')]!==_['toNumber'](_0x186f48[_0xe949('0x4c')])||this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x2a')]!==_0x576c3b){this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x6c')]=_['toNumber'](_0x186f48[_0xe949('0x6b')]);this[_0xe949('0xf')][_0x186f48['queue']][_0xe949('0x4d')]=_['toNumber'](_0x186f48[_0xe949('0x6e')]);this[_0xe949('0xf')][_0x186f48['queue']][_0xe949('0x4c')]=_[_0xe949('0x6d')](_0x186f48[_0xe949('0x4c')]);this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x2a')]=_0x576c3b>0x0?_0x576c3b:0x0;this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x2a')]=this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x2a')]>_[_0xe949('0x6d')](_0x186f48['loggedin'])?_['toNumber'](_0x186f48[_0xe949('0x6e')]):this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x2a')];this[_0xe949('0x48')](this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]],'queuesummary');}logger[_0xe949('0x3e')](_0xe949('0x6f'),util[_0xe949('0x33')](this[_0xe949('0xf')][_0x186f48['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0xe949('0x70'),this['voiceQueues'][_0x186f48[_0xe949('0x68')]]);}}}catch(_0x9aa7c4){logger['error'](_0xe949('0x66'),util[_0xe949('0x33')](_0x9aa7c4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x71')]=function(_0x34d510){logger[_0xe949('0x3e')](_0xe949('0x72'),util['inspect'](_0x34d510,{'showHidden':![],'depth':null}));this[_0xe949('0x63')]=!![];};VoiceQueueReport['prototype'][_0xe949('0x73')]=function(_0x27b7e3){try{if(this[_0xe949('0x67')](_0x27b7e3)){logger['debug'](_0xe949('0x74'),_0x27b7e3[_0xe949('0x75')],util[_0xe949('0x33')](_0x27b7e3,{'showHidden':![],'depth':null}));if(_[_0xe949('0x5d')](this['queueReports'][_0x27b7e3[_0xe949('0x75')]]))this[_0xe949('0x34')][_0x27b7e3[_0xe949('0x75')]]=[];if(_[_0xe949('0x5d')](this[_0xe949('0xd')][_0x27b7e3[_0xe949('0x75')]]))this[_0xe949('0xd')][_0x27b7e3['uniqueid']]={};var _0x1deb03=new QueueReport();_0x1deb03[_0xe949('0x42')]=_0x27b7e3['queue'];_0x1deb03['type']=this['voiceQueues'][_0x1deb03[_0xe949('0x42')]]&&this[_0xe949('0xf')][_0x1deb03['name']][_0xe949('0x49')]?this[_0xe949('0xf')][_0x1deb03[_0xe949('0x42')]][_0xe949('0x49')]||_0xe949('0x4a'):_0xe949('0x4a');_0x1deb03[_0xe949('0x68')]=_0x27b7e3['queue'];_0x1deb03[_0xe949('0x76')]=moment()['format'](_0xe949('0x77'));_0x1deb03[_0xe949('0x78')]=_0x27b7e3[_0xe949('0x78')];_0x1deb03[_0xe949('0x79')]=_0x27b7e3['count'];_0x1deb03[_0xe949('0x75')]=_0x27b7e3['uniqueid'];_0x1deb03[_0xe949('0x7a')]=this[_0xe949('0xd')][_0x27b7e3[_0xe949('0x75')]][_0xe949('0x7a')];logger[_0xe949('0x7b')](_0xe949('0x7c'),_0x1deb03[_0xe949('0x42')],_0x1deb03['type']);_[_0xe949('0x7d')](_0x1deb03,_[_0xe949('0x7e')](_0x27b7e3,_[_0xe949('0x7f')](_0x1deb03)));this[_0xe949('0x34')][_0x27b7e3[_0xe949('0x75')]][_0xe949('0x80')](_0x1deb03);this[_0xe949('0xd')][_0x27b7e3['uniqueid']]=_0x1deb03;this[_0xe949('0x3d')](_0x1deb03,_0xe949('0x14'));}}catch(_0x18fd0a){logger[_0xe949('0x35')](_0xe949('0x74'),_0x27b7e3[_0xe949('0x75')],util['inspect'](_0x18fd0a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x81')]=function(_0x488b1c){try{if(this[_0xe949('0x67')](_0x488b1c)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x488b1c['uniqueid'],util['inspect'](_0x488b1c,{'showHidden':![],'depth':null}));if(this[_0xe949('0x34')][_0x488b1c[_0xe949('0x75')]]){var _0x145139=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x488b1c[_0xe949('0x75')]]);_0x145139[_0xe949('0x83')]=![];_0x145139['queuecallercompleteAt']=null;_0x145139[_0xe949('0x84')]=_0x488b1c[_0xe949('0x84')];_0x145139[_0xe949('0x85')]=_0x488b1c[_0xe949('0x85')];_0x145139[_0xe949('0x15')]=!![];_0x145139[_0xe949('0x86')]=moment()[_0xe949('0x40')](_0xe949('0x77'));_0x145139[_0xe949('0x87')]=_0xe949('0x88');_0x145139[_0xe949('0x89')]=null;logger[_0xe949('0x7b')](_0xe949('0x8a'),_0x145139[_0xe949('0x42')],_0x145139['type']);this['channels'][_0x488b1c[_0xe949('0x75')]]=_0x145139;this[_0xe949('0x3a')](_0x145139,_0xe949('0x15'));}}}catch(_0x7e2b46){logger[_0xe949('0x35')](_0xe949('0x8b'),_0x488b1c['uniqueid'],util[_0xe949('0x33')](_0x7e2b46,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x17')]=function(_0x1fb258){try{if(this[_0xe949('0x67')](_0x1fb258)){logger[_0xe949('0x3e')](_0xe949('0x8c'),_0x1fb258[_0xe949('0x75')],util[_0xe949('0x33')](_0x1fb258,{'showHidden':![],'depth':null}));if(this[_0xe949('0x34')][_0x1fb258[_0xe949('0x75')]]){var _0x8a6e49=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x1fb258[_0xe949('0x75')]]);_0x8a6e49[_0xe949('0x8d')]=moment()[_0xe949('0x40')](_0xe949('0x77'));_0x8a6e49[_0xe949('0x8e')]=_0x1fb258['connectedlinenum'];_0x8a6e49[_0xe949('0x8f')]=_0x1fb258[_0xe949('0x8f')];logger[_0xe949('0x7b')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x8a6e49[_0xe949('0x42')],_0x8a6e49[_0xe949('0x49')],_0x1fb258[_0xe949('0x8e')],_0x1fb258[_0xe949('0x8f')]);this['channels'][_0x1fb258[_0xe949('0x75')]]=_0x8a6e49;this[_0xe949('0x3d')](_0x8a6e49,'queuecallerleave');}}}catch(_0x449848){logger[_0xe949('0x35')](_0xe949('0x8c'),_0x1fb258[_0xe949('0x75')],util['inspect'](_0x449848,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')]['syncAgentConnect']=function(_0x471513){try{if(this[_0xe949('0x67')](_0x471513)){logger[_0xe949('0x3e')](_0xe949('0x90'),_0x471513[_0xe949('0x75')],util[_0xe949('0x33')](_0x471513,{'showHidden':![],'depth':null}));if(this[_0xe949('0x34')][_0x471513[_0xe949('0x75')]]){var _0x5c3fd4=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x471513[_0xe949('0x75')]]);_0x5c3fd4[_0xe949('0x83')]=!![];_0x5c3fd4[_0xe949('0x87')]='COMPLETEDBYAGENT';logger[_0xe949('0x7b')](_0xe949('0x91'),_0x5c3fd4[_0xe949('0x42')],_0x5c3fd4[_0xe949('0x49')]);}}}catch(_0x53b1a7){logger[_0xe949('0x35')](_0xe949('0x90'),_0x471513[_0xe949('0x75')],util[_0xe949('0x33')](_0x53b1a7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe949('0x18')]=function(_0x5137e7){try{if(this['isNotNull'](_0x5137e7)){logger[_0xe949('0x3e')](_0xe949('0x92'),_0x5137e7[_0xe949('0x75')],util[_0xe949('0x33')](_0x5137e7,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5137e7[_0xe949('0x75')]]){var _0x3c0ca5=_['last'](this[_0xe949('0x34')][_0x5137e7[_0xe949('0x75')]]);_0x3c0ca5[_0xe949('0x15')]=![];_0x3c0ca5[_0xe949('0x86')]=null;_0x3c0ca5[_0xe949('0x93')]=!![];_0x3c0ca5['lastAssignedTo']=_0x5137e7[_0xe949('0x94')];_0x3c0ca5['holdtime']=_0x5137e7[_0xe949('0x84')];_0x3c0ca5[_0xe949('0x83')]=!![];_0x3c0ca5[_0xe949('0x95')]=![];_0x3c0ca5[_0xe949('0x96')]=null;if(!_0x3c0ca5['transfer']){if(_0x5137e7['reason']==_0xe949('0x97')){_0x3c0ca5[_0xe949('0x87')]=_0xe949('0x98');logger[_0xe949('0x7b')](_0xe949('0x99'),_0x3c0ca5[_0xe949('0x42')],_0x3c0ca5[_0xe949('0x49')]);}else{if(_[_0xe949('0x9a')](_0x5137e7['channel'][_0xe949('0x9b')](),'local/')){if(this[_0xe949('0x34')][_0x5137e7[_0xe949('0x9c')]]){var _0x5755d4=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x5137e7['linkedid']]);_0x5755d4['queuecallercomplete']=![];_0x5755d4[_0xe949('0x95')]=!![];_0x5755d4[_0xe949('0x96')]=moment(_0x3c0ca5['queuecallerjoinAt'])[_0xe949('0x9d')](_0x5137e7[_0xe949('0x84')],_0xe949('0x9e'))[_0xe949('0x40')](_0xe949('0x77'));_0x5755d4[_0xe949('0x87')]='FORWARDTRANSFER';_0x5755d4[_0xe949('0x97')]=!![];_0x5755d4['transfertype']=_0xe949('0x9f');_0x5755d4[_0xe949('0xa0')]=_0x5137e7['destexten'];_0x5755d4['transferuniqueid']=_0x5137e7[_0xe949('0x75')];logger[_0xe949('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x5755d4['name'],_0x5755d4[_0xe949('0x49')]);var _0x10d8d3=this[_0xe949('0x34')][_0x5137e7['linkedid']];this[_0xe949('0x34')][_0x5137e7[_0xe949('0x9c')]]=this[_0xe949('0x34')][_0x5137e7[_0xe949('0x75')]];this[_0xe949('0x34')][_0x5137e7[_0xe949('0x75')]]=_0x10d8d3;}}else{_0x3c0ca5['queuecallerexitreason']='COMPLETEDBY'+_0x5137e7['reason'][_0xe949('0xa1')]();logger[_0xe949('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x3c0ca5['name'],_0x3c0ca5[_0xe949('0x49')],_0x3c0ca5[_0xe949('0x87')]);}}}this[_0xe949('0xd')][_0x5137e7[_0xe949('0x75')]]=_0x3c0ca5;this[_0xe949('0x3a')](_0x3c0ca5,_0xe949('0xa2'));}}}catch(_0x4eeba0){logger[_0xe949('0x35')](_0xe949('0x92'),_0x5137e7['uniqueid'],util[_0xe949('0x33')](_0x4eeba0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe949('0x1c')]=function(_0x283648){try{if(this[_0xe949('0x67')](_0x283648)){logger[_0xe949('0x3e')]('[%s][voiceQueueReport][varset]',_0x283648[_0xe949('0x75')],util[_0xe949('0x33')](_0x283648,{'showHidden':![],'depth':null}));this[_0xe949('0xa3')](_0x283648['uniqueid'],_['keys'](_0x283648[_0xe949('0xa4')])[0x0],_0x283648[_0xe949('0xa5')]);if(this['queueReports'][_0x283648[_0xe949('0x75')]]){var _0x3d745b=_['last'](this[_0xe949('0x34')][_0x283648[_0xe949('0x75')]]);if(_0x3d745b){if(this[_0xe949('0x67')](_0x283648[_0xe949('0xa4')])&&this[_0xe949('0x67')](_0x283648[_0xe949('0xa4')][_0xe949('0xa6')])){switch(_0x283648[_0xe949('0xa5')]){case'CONTINUE':_0x3d745b[_0xe949('0x95')]=![];_0x3d745b[_0xe949('0x96')]=null;break;case _0xe949('0xa7'):_0x3d745b[_0xe949('0xa8')]=_0xe949('0xa9');_0x3d745b[_0xe949('0x95')]=!![];_0x3d745b[_0xe949('0x96')]=moment()['format'](_0xe949('0x77'));_0x3d745b[_0xe949('0x8d')]=moment()[_0xe949('0x40')](_0xe949('0x77'));logger[_0xe949('0x3e')](_0xe949('0xaa'),_0x283648[_0xe949('0x75')],util['inspect'](_0x3d745b,{'showHidden':![],'depth':null}));ami[_0xe949('0x3c')](_0xe949('0xab'),_0x3d745b);break;default:_0x3d745b[_0xe949('0x95')]=!![];_0x3d745b[_0xe949('0x96')]=moment()[_0xe949('0x40')](_0xe949('0x77'));_0x3d745b['queuecallerleaveAt']=moment()[_0xe949('0x40')](_0xe949('0x77'));}_0x3d745b['queuecallerabandon']=![];_0x3d745b[_0xe949('0x86')]=null;_0x3d745b[_0xe949('0x87')]=_0x283648[_0xe949('0xa5')];this[_0xe949('0xd')][_0x283648[_0xe949('0x75')]]=_0x3d745b;this['emitVoiceQueueChannelRemove'](_0x3d745b,_0xe949('0x1b'));}else if(this[_0xe949('0x67')](_0x283648[_0xe949('0xa4')])&&this['isNotNull'](_0x283648[_0xe949('0xa4')][_0xe949('0xac')])){if(!_0x3d745b[_0xe949('0x15')]){_0x3d745b[_0xe949('0x95')]=!![];_0x3d745b[_0xe949('0x96')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3d745b[_0xe949('0x87')]=_0xe949('0xad');_0x3d745b[_0xe949('0x8d')]=moment()[_0xe949('0x40')](_0xe949('0x77'));this[_0xe949('0xd')][_0x283648[_0xe949('0x75')]]=_0x3d745b;}}logger[_0xe949('0x7b')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x283648[_0xe949('0x75')],_0x3d745b[_0xe949('0x42')],_0x3d745b[_0xe949('0x49')],_[_0xe949('0x7f')](_0x283648[_0xe949('0xa4')])[0x0],_0x283648[_0xe949('0xa5')]);_0x3d745b[_0xe949('0x11')]=this[_0xe949('0x11')][_0x283648['uniqueid']];}}}}catch(_0x37e726){logger[_0xe949('0x35')](_0xe949('0xae'),_0x283648['uniqueid'],util[_0xe949('0x33')](_0x37e726,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0xa3')]=function(_0x2e0600,_0x1e5f82,_0x2e6e86){var _0x35bd08=[_0xe949('0xaf'),_0xe949('0xb0'),_0xe949('0xb1'),_0xe949('0xb2'),_0xe949('0xb3'),_0xe949('0xb4'),'rtpaudioqosrtt',_0xe949('0xb5'),'sipcallid',_0xe949('0xb6'),_0xe949('0xb7'),'bridgepvtcallid',_0xe949('0xb8'),_0xe949('0xb9'),'memberinterface',_0xe949('0xba'),_0xe949('0x94'),_0xe949('0xbb'),'memberrealtime'];if(!_[_0xe949('0x2e')](_0x1e5f82)&&!_[_0xe949('0xbc')](_0x35bd08,_0x1e5f82)){if(_[_0xe949('0x5d')](this[_0xe949('0x11')][_0x2e0600])){this['variables'][_0x2e0600]={};}this[_0xe949('0x11')][_0x2e0600][_0x1e5f82]=_0x2e6e86;}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x1e')]=function(_0x53c0bf){try{if(this[_0xe949('0x67')](_0x53c0bf)){logger[_0xe949('0x3e')](_0xe949('0xbd'),_0x53c0bf[_0xe949('0x75')],util[_0xe949('0x33')](_0x53c0bf,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x53c0bf[_0xe949('0x75')]]){for(var _0x3a799c=0x0,_0x4b4f95={};_0x3a799c<this[_0xe949('0x34')][_0x53c0bf[_0xe949('0x75')]][_0xe949('0xbe')];_0x3a799c+=0x1){_0x4b4f95=this[_0xe949('0x34')][_0x53c0bf[_0xe949('0x75')]][_0x3a799c];if(this[_0xe949('0xf')][_0x4b4f95[_0xe949('0x68')]]){if(_0x4b4f95[_0xe949('0x95')]&&_0x4b4f95[_0xe949('0x97')]!=!![]){this[_0xe949('0xf')][_0x4b4f95[_0xe949('0x68')]][_0xe949('0x53')]+=0x1;}if(_0x4b4f95[_0xe949('0x15')]){this[_0xe949('0xf')][_0x4b4f95[_0xe949('0x68')]]['abandoned']+=0x1;}this[_0xe949('0xf')][_0x4b4f95['queue']][_0xe949('0x51')]+=moment(_0x4b4f95[_0xe949('0x8d')])['diff'](_0x4b4f95['queuecallerjoinAt'],'seconds')||0x0;if(_0x3a799c===this[_0xe949('0x34')][_0x53c0bf['uniqueid']][_0xe949('0xbe')]-0x1){this['voiceQueues'][_0x4b4f95[_0xe949('0x68')]][_0xe949('0x50')]+=moment()['milliseconds'](0x0)[_0xe949('0xbf')](_0x4b4f95[_0xe949('0x76')],_0xe949('0x9e'));this['voiceQueues'][_0x4b4f95[_0xe949('0x68')]][_0xe949('0x52')]+=0x1;if(_0x4b4f95[_0xe949('0x83')]){this[_0xe949('0xf')][_0x4b4f95['queue']][_0xe949('0xc0')]+=0x1;this[_0xe949('0xf')][_0x4b4f95['queue']][_0xe949('0x4f')]+=moment()['milliseconds'](0x0)['diff'](_0x4b4f95[_0xe949('0x8d')],_0xe949('0x9e'));_0x4b4f95[_0xe949('0xc1')]=moment()[_0xe949('0x40')](_0xe949('0x77'));_0x4b4f95['queuecallerexit']=![];_0x4b4f95[_0xe949('0x96')]=null;}if(_0x4b4f95[_0xe949('0x95')]&&_0x4b4f95[_0xe949('0x97')]!=!![]){_0x4b4f95[_0xe949('0xa8')]=_0xe949('0x53');logger[_0xe949('0x3e')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x53c0bf['uniqueid'],util[_0xe949('0x33')](_0x4b4f95,{'showHidden':![],'depth':null}));ami[_0xe949('0x3c')](_0xe949('0xc2'),_0x4b4f95);}if(_0x4b4f95[_0xe949('0x15')]){_0x4b4f95[_0xe949('0xa8')]='abandoned';logger[_0xe949('0x3e')](_0xe949('0xc3'),_0x53c0bf['uniqueid'],util[_0xe949('0x33')](_0x4b4f95,{'showHidden':![],'depth':null}));ami[_0xe949('0x3c')](_0xe949('0xc4'),_0x4b4f95);}}else{this[_0xe949('0xf')][_0x4b4f95[_0xe949('0x68')]][_0xe949('0x50')]+=this['voiceQueues'][_0x4b4f95[_0xe949('0x68')]]['sumHoldTime'];}logger[_0xe949('0x7b')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x53c0bf[_0xe949('0x75')],_0x4b4f95[_0xe949('0x42')],_0x4b4f95[_0xe949('0x49')],_0x53c0bf[_0xe949('0xc5')]);this[_0xe949('0xd')][_0x53c0bf[_0xe949('0x75')]]=_0x4b4f95;this[_0xe949('0x3a')](_0x4b4f95,_0xe949('0x1d'));this[_0xe949('0x48')](this[_0xe949('0xf')][_0x4b4f95[_0xe949('0x68')]],_0xe949('0x1d'));}}logger[_0xe949('0x3e')](_0xe949('0xc6'),_0x53c0bf['uniqueid'],util[_0xe949('0x33')](this[_0xe949('0x34')][_0x53c0bf[_0xe949('0x75')]],{'showHidden':![],'depth':null}));ami[_0xe949('0x3c')](_0xe949('0xc7'),this[_0xe949('0x34')][_0x53c0bf[_0xe949('0x75')]]);delete this['queueReports'][_0x53c0bf['uniqueid']];delete this[_0xe949('0xd')][_0x53c0bf['uniqueid']];}if(this['variables'][_0x53c0bf[_0xe949('0x75')]]){delete this[_0xe949('0x11')][_0x53c0bf[_0xe949('0x75')]];}}}catch(_0x329ad8){logger[_0xe949('0x35')](_0xe949('0xbd'),_0x53c0bf[_0xe949('0x75')],util['inspect'](_0x329ad8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x25')]=function(_0x3f82bb){try{if(this['isNotNull'](_0x3f82bb)){logger[_0xe949('0x3e')]('[%s][voiceQueueReport][attendedtransfer]',_0x3f82bb[_0xe949('0x75')],util[_0xe949('0x33')](_0x3f82bb,{'showHidden':![],'depth':null}));var _0x181cd1;if(this['queueReports'][_0x3f82bb['transfereeuniqueid']]){_0x181cd1=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xc8')]]);_0x181cd1[_0xe949('0xa0')]=_0x3f82bb[_0xe949('0xc9')];_0x181cd1['transferuniqueid']=_0x3f82bb[_0xe949('0xca')];_0x181cd1[_0xe949('0x87')]=_0xe949('0xcb');_0x181cd1['transfer']=!![];_0x181cd1['transfertype']=_0xe949('0xcc');if(this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xca')]]){var _0x49d1a2=this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xca')]];this[_0xe949('0x34')][_0x3f82bb['secondtransfereruniqueid']]=this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xc8')]];this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xc8')]]=_0x49d1a2;var _0x5af82a=_['last'](this[_0xe949('0x34')][_0x3f82bb['transfereeuniqueid']]);_0x5af82a[_0xe949('0x2d')]=!![];}logger[_0xe949('0x7b')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x3f82bb[_0xe949('0x75')],_0x181cd1[_0xe949('0x42')],_0x181cd1[_0xe949('0x49')],_0x181cd1['transferexten'],_0x181cd1[_0xe949('0xcd')]);}else if(this['queueReports'][_0x3f82bb[_0xe949('0xce')]]){_0x181cd1=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xce')]]);_0x181cd1[_0xe949('0xa0')]=_0x3f82bb[_0xe949('0xcf')];_0x181cd1['transferuniqueid']=_0x3f82bb[_0xe949('0xd0')];_0x181cd1[_0xe949('0x87')]='ATTENDEDTRANSFER';_0x181cd1[_0xe949('0x97')]=!![];_0x181cd1[_0xe949('0xd1')]=_0xe949('0xcc');if(this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xd0')]]){var _0x49d1a2=this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xd0')]];this['queueReports'][_0x3f82bb['origtransfereruniqueid']]=this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xce')]];this['queueReports'][_0x3f82bb[_0xe949('0xce')]]=_0x49d1a2;var _0x5af82a=_['last'](this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xce')]]);_0x5af82a[_0xe949('0x2d')]=!![];}logger[_0xe949('0x7b')](_0xe949('0xd2'),_0x3f82bb[_0xe949('0x75')],_0x181cd1[_0xe949('0x42')],_0x181cd1[_0xe949('0x49')],_0x181cd1[_0xe949('0xa0')],_0x181cd1[_0xe949('0xcd')]);}}}catch(_0x139735){logger[_0xe949('0x35')](_0xe949('0xd3'),_0x3f82bb[_0xe949('0x75')],util[_0xe949('0x33')](_0x139735,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0xd4')]=function(_0x5a71e7){try{if(this[_0xe949('0x67')](_0x5a71e7)){logger['debug'](_0xe949('0xd5'),_0x5a71e7[_0xe949('0x75')],util[_0xe949('0x33')](_0x5a71e7,{'showHidden':![],'depth':null}));if(this[_0xe949('0x34')][_0x5a71e7['transfereeuniqueid']]){var _0x5e5218=_[_0xe949('0x82')](this['queueReports'][_0x5a71e7[_0xe949('0xc8')]]);_0x5e5218['queuecallerexitreason']=_0xe949('0xd6');_0x5e5218[_0xe949('0x97')]=!![];_0x5e5218[_0xe949('0xd1')]=_0xe949('0xd7');_0x5e5218[_0xe949('0xa0')]=_0x5a71e7['extension'];_0x5e5218[_0xe949('0xcd')]=_0x5a71e7[_0xe949('0xc8')];logger[_0xe949('0x7b')](_0xe949('0xd8'),_0x5a71e7['uniqueid'],_0x5e5218[_0xe949('0x42')],_0x5e5218[_0xe949('0x49')],_0x5e5218['transferexten'],_0x5e5218['transferuniqueid']);this[_0xe949('0x1e')]({'event':_0xe949('0xd9'),'uniqueid':_0x5a71e7[_0xe949('0xc8')],'context':_0x5a71e7['context'],'channel':_0x5a71e7['transfererchannel']});}}}catch(_0x2d7406){logger[_0xe949('0x35')](_0xe949('0xd5'),_0x5a71e7[_0xe949('0x75')],util[_0xe949('0x33')](_0x2d7406,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x22')]=function(_0x590582){try{if(this[_0xe949('0x67')](_0x590582)){logger['debug'](_0xe949('0xda'),_0x590582['uniqueid'],util['inspect'](_0x590582,{'showHidden':![],'depth':null}));if(this[_0xe949('0x34')][_0x590582['uniqueid']]){var _0x46f018=_[_0xe949('0x82')](this['queueReports'][_0x590582[_0xe949('0x75')]]);if(!_[_0xe949('0x2e')](_0x46f018[_0xe949('0x8d')])){_0x46f018[_0xe949('0xdb')]=moment()['format'](_0xe949('0x77'));logger[_0xe949('0x7b')](_0xe949('0xdc'),_0x590582[_0xe949('0x75')],_0x46f018[_0xe949('0xdb')]);}}}}catch(_0x1a27ea){logger['error']('[%s][voiceQueueReport][musiconholdstart]',_0x590582[_0xe949('0x75')],util['inspect'](_0x1a27ea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x23')]=function(_0x15cda7){try{if(this[_0xe949('0x67')](_0x15cda7)){logger[_0xe949('0x3e')](_0xe949('0xdd'),_0x15cda7[_0xe949('0x75')],util['inspect'](_0x15cda7,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x15cda7['uniqueid']]){var _0x1d2e1b=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x15cda7['uniqueid']]);if(!_['isNil'](_0x1d2e1b[_0xe949('0xdb')])){_0x1d2e1b[_0xe949('0xde')]+=moment()[_0xe949('0xdf')](0x0)[_0xe949('0xbf')](_0x1d2e1b['mohstarttime'],_0xe949('0x9e'));logger[_0xe949('0x7b')](_0xe949('0xe0'),_0x15cda7[_0xe949('0x75')],_0x1d2e1b['mohtime']);delete _0x1d2e1b[_0xe949('0xdb')];}}}}catch(_0x22f922){logger['error'](_0xe949('0xdd'),_0x15cda7[_0xe949('0x75')],util[_0xe949('0x33')](_0x22f922,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe949('0xe1')]=function(_0xe2e928){try{if(this[_0xe949('0x67')](_0xe2e928)){logger[_0xe949('0x3e')](_0xe949('0xe2'),_0xe2e928[_0xe949('0x75')],util['inspect'](_0xe2e928,{'showHidden':![],'depth':null}));if(_0xe2e928[_0xe949('0xe3')][_0xe949('0x9b')]()===_0xe949('0xe4')){_0xe2e928['applicationdata']=_0xe2e928[_0xe949('0xe5')]&&_0xe2e928[_0xe949('0xe5')][_0xe949('0x9a')](_0xe949('0xe6'))?_0xe2e928[_0xe949('0xe5')]:(_0xe2e928['appdata']||_0xe2e928['applicationdata'])[_0xe949('0x9b')]();if(_[_0xe949('0x9a')](_0xe2e928[_0xe949('0xe7')][_0xe949('0x9b')](),'cdr(')){logger[_0xe949('0x7b')](_0xe949('0xe8'),_0xe2e928[_0xe949('0x75')],_0xe2e928['application'],_0xe2e928[_0xe949('0xe7')]);if(_[_0xe949('0x5d')](this['channels'][_0xe2e928[_0xe949('0x75')]]))this[_0xe949('0xd')][_0xe2e928[_0xe949('0x75')]]={};var _0x5356aa=_0xe2e928[_0xe949('0xe7')]['split']('=');var _0xec270=_0x5356aa[0x0][_0xe949('0x9b')]()[_0xe949('0xe9')](/cdr\((.*)\)/);if(_0xec270)this[_0xe949('0xd')][_0xe2e928[_0xe949('0x75')]][_0xec270[0x1]]=_0x5356aa[0x1];}}}}catch(_0x4a7b94){logger[_0xe949('0x35')](_0xe949('0xea'),_0xe2e928[_0xe949('0x75')],util['inspect'](_0x4a7b94,{'showHidden':![],'depth':null}));}};module[_0xe949('0xeb')]=VoiceQueueReport;