Built motion from commit 14588770.|2.5.38
[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 _0x6418=['[%s][voiceQueueReport][musiconholdstop]','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','applicationdata','CDR(routeAlias)','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','moment','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','variables','queuesummarycomplete','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','originated','hasOwnProperty','pTalking','waiting','unlockRR','switch','Action','status','channel','catch','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[FullyBooted]\x20clear\x20realtime','campaigns','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave',']\x20sending\x20voice_queue_channel:save\x20event:','format','voice_queue_channel:save','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','inbound','name','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','type','abandoned','Trunk','Interval','[voiceQueueReport][','voice_queue:save','isNotNull','isUndefined','clearZombieChannels','queues','[voiceQueueReport][queues]','queuesummary','then','flagQueueSummary','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','toNumber','callers','loggedin','talking','emitVoiceQueueSummary','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueSummaryComplete','[%s][voiceQueueReport][queuecallerjoin]','uniqueid','queuecallerjoinAt','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','syncQueueCallerLeave','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][queuecallerleave]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','assigned','lastAssignedTo','membername','queuecallercomplete','queuecallerexit','queuecallerexitAt','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','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','CONTINUE','TIMEOUT','lastevent','timeout','queuecallerleaveAt','custom:timeout','value','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','memberinterface','memberlastcall','memberrealtime','isNil','includes','syncHangup','[%s][voiceQueueReport][hangup]','length','unmanaged','diff','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','custom:voiceQueueReport','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','ATTENDEDTRANSFER','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohtime'];(function(_0x4e03ce,_0x56d049){var _0x5cba8e=function(_0x15e789){while(--_0x15e789){_0x4e03ce['push'](_0x4e03ce['shift']());}};_0x5cba8e(++_0x56d049);}(_0x6418,0xfa));var _0x8641=function(_0x293fd8,_0x21f88d){_0x293fd8=_0x293fd8-0x0;var _0x2948ec=_0x6418[_0x293fd8];return _0x2948ec;};'use strict';var _=require('lodash');var moment=require(_0x8641('0x0'));var util=require('util');var md5=require(_0x8641('0x1'));var Redis=require(_0x8641('0x2'));var config=require(_0x8641('0x3'));var logger=require(_0x8641('0x4'))(_0x8641('0x5'));var ami=require(_0x8641('0x6'));var QueueReport=require(_0x8641('0x7'));config[_0x8641('0x8')]=_[_0x8641('0x9')](config[_0x8641('0x8')],{'host':_0x8641('0xa'),'port':0x18eb});var io=require(_0x8641('0xb'))(new Redis(config[_0x8641('0x8')]));var Sequence=function(){};Sequence[_0x8641('0xc')][_0x8641('0xd')]=function(_0x26d740){this[_0x8641('0xe')]=this[_0x8641('0xe')]?this[_0x8641('0xe')][_0x8641('0xf')](_0x26d740):_0x26d740();};function VoiceQueueReport(_0x2545fb){this[_0x8641('0x10')]=new Sequence();this[_0x8641('0x11')]={};this[_0x8641('0x12')]=_0x2545fb[_0x8641('0x12')];this[_0x8641('0x13')]=_0x2545fb[_0x8641('0x14')];this[_0x8641('0x15')]=_0x2545fb[_0x8641('0x15')];this['flagQueueSummary']=!![];this['campaigns']=_0x2545fb['campaigns'];this[_0x8641('0x16')]={};ami['on']('queuesummary',this['syncQueueSummary']['bind'](this));ami['on'](_0x8641('0x17'),this['syncQueueSummaryComplete'][_0x8641('0x18')](this));ami['on'](_0x8641('0x19'),this[_0x8641('0x1a')]['bind'](this));ami['on'](_0x8641('0x1b'),this[_0x8641('0x1c')][_0x8641('0x18')](this));ami['on'](_0x8641('0x1d'),this['syncQueueCallerLeave'][_0x8641('0x18')](this));ami['on'](_0x8641('0x1e'),this[_0x8641('0x1f')]['bind'](this));ami['on']('agentconnect',this[_0x8641('0x20')][_0x8641('0x18')](this));ami['on'](_0x8641('0x21'),this[_0x8641('0x22')]['bind'](this));ami['on']('hangup',this['syncHangup'][_0x8641('0x18')](this));ami['on'](_0x8641('0x23'),this[_0x8641('0x24')][_0x8641('0x18')](this));ami['on'](_0x8641('0x25'),this[_0x8641('0x26')][_0x8641('0x18')](this));ami['on'](_0x8641('0x27'),this[_0x8641('0x28')]['bind'](this));ami['on'](_0x8641('0x29'),this[_0x8641('0x2a')][_0x8641('0x18')](this));ami['on']('blindtransfer',this[_0x8641('0x2b')][_0x8641('0x18')](this));this[_0x8641('0x2c')]();this[_0x8641('0x2d')]();}function clearChannels(_0x2431e6){if(!_[_0x8641('0x2e')](_0x2431e6)){for(var _0x3517ea in _0x2431e6){if(_0x2431e6['hasOwnProperty'](_0x3517ea)){delete _0x2431e6[_0x3517ea];}}}}function clearCampaigns(_0x2ba803){if(!_['isEmpty'](_0x2ba803)){for(var _0x38a57c in _0x2ba803){if(_0x2ba803['hasOwnProperty'](_0x38a57c)){_0x2ba803[_0x38a57c][_0x8641('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x2b4a8b){if(!_[_0x8641('0x2e')](_0x2b4a8b)){for(var _0xd708af in _0x2b4a8b){if(_0x2b4a8b[_0x8641('0x30')](_0xd708af)){_0x2b4a8b[_0xd708af]['originated']=0x0;_0x2b4a8b[_0xd708af]['talking']=0x0;_0x2b4a8b[_0xd708af][_0x8641('0x31')]=0x0;_0x2b4a8b[_0xd708af][_0x8641('0x32')]=0x0;_0x2b4a8b[_0xd708af]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x430c9f){if(!_[_0x8641('0x2e')](_0x430c9f)){for(var _0x1fd59d in _0x430c9f){if(_0x430c9f[_0x8641('0x30')](_0x1fd59d)){_0x430c9f[_0x1fd59d][_0x8641('0x33')]=!![];}}}}VoiceQueueReport['prototype']['clearZombieChannels']=function(){var _0x45a960=this;for(var _0x37e466 in this[_0x8641('0x13')]){if(this[_0x8641('0x13')][_0x8641('0x30')](_0x37e466)&&!this[_0x8641('0x13')][_0x37e466][_0x8641('0x34')]){this[_0x8641('0x10')][_0x8641('0xd')](function(){if(!_['isNil'](_0x45a960[_0x8641('0x13')][_0x37e466])){return ami[_0x8641('0x35')]({'action':_0x8641('0x36'),'channel':_0x45a960[_0x8641('0x13')][_0x37e466][_0x8641('0x37')]})[_0x8641('0x38')](function(_0x4cb31d){if(_0x4cb31d['message']===_0x8641('0x39')){setTimeout(function(){if(_0x45a960[_0x8641('0x13')][_0x37e466]){delete _0x45a960[_0x8641('0x13')][_0x37e466];logger[_0x8641('0x3a')](_0x8641('0x3b'),_0x37e466,util[_0x8641('0x3c')](_0x4cb31d,{'showHidden':![],'depth':null}));}if(_0x45a960[_0x8641('0x11')][_0x37e466]){delete _0x45a960[_0x8641('0x11')][_0x37e466];logger[_0x8641('0x3a')](_0x8641('0x3d'),_0x37e466,util[_0x8641('0x3c')](_0x4cb31d,{'showHidden':![],'depth':null}));}if(_0x45a960[_0x8641('0x16')][_0x37e466]){delete _0x45a960[_0x8641('0x16')][_0x37e466];logger['error']('[%s][voiceQueueReport][checkVariables]',_0x37e466,util[_0x8641('0x3c')](_0x4cb31d,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x8641('0xc')]['syncFullyBooted']=function(){logger[_0x8641('0x3a')](_0x8641('0x3e'));clearChannels(this[_0x8641('0x13')]);this['clearQueueReport'](this[_0x8641('0x11')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x8641('0x15')]);clearCampaigns(this[_0x8641('0x3f')]);};VoiceQueueReport[_0x8641('0xc')][_0x8641('0x40')]=function(_0x49bf68){var _0x3fc1cf=this;if(!_['isEmpty'](_0x49bf68)){for(var _0x1ac7d8 in _0x49bf68){if(_0x49bf68[_0x8641('0x30')](_0x1ac7d8)){_0x3fc1cf[_0x8641('0x41')](_0x49bf68[_0x1ac7d8],_0x8641('0x42'));delete _0x49bf68[_0x1ac7d8];}}}};VoiceQueueReport['prototype']['emit']=function(_0x3aa07c,_0x573121,_0x5eb098){io['to'](_0x3aa07c)[_0x8641('0x43')](_0x573121,_0x5eb098);};VoiceQueueReport['prototype'][_0x8641('0x44')]=function(_0x2ec432,_0x46ddfb){logger['debug']('[%s][voiceQueueReport]['+_0x46ddfb+_0x8641('0x45'),_0x2ec432['uniqueid'],util['inspect'](_0x2ec432,{'showHidden':![],'depth':null}));this['emit'](util[_0x8641('0x46')]('voice:queue:%s',_0x2ec432['name']),_0x8641('0x47'),_0x2ec432);io[_0x8641('0x43')]('voice_queue_presence:save',_0x2ec432);};VoiceQueueReport[_0x8641('0xc')][_0x8641('0x41')]=function(_0x25d59d,_0x322509){logger[_0x8641('0x48')](_0x8641('0x49')+_0x322509+_0x8641('0x4a'),_0x25d59d['uniqueid'],util['inspect'](_0x25d59d,{'showHidden':![],'depth':null}));this['emit'](util[_0x8641('0x46')](_0x8641('0x4b'),_0x25d59d['name']),_0x8641('0x4c'),_0x25d59d);io['emit'](_0x8641('0x4d'),_0x25d59d);};VoiceQueueReport[_0x8641('0xc')]['emitVoiceQueueSummary']=function(_0x19c4cd,_0x469d6b){if(_0x19c4cd['type']===_0x8641('0x4e')){var _0x511a21={'id':_0x19c4cd['id'],'name':_0x19c4cd[_0x8641('0x4f')],'strategy':_0x19c4cd[_0x8641('0x50')],'answered':_0x19c4cd[_0x8641('0x51')],'available':_0x19c4cd[_0x8641('0x52')],'loggedIn':_0x19c4cd[_0x8641('0x53')],'pTalking':_0x19c4cd[_0x8641('0x31')],'sumBillable':_0x19c4cd[_0x8641('0x54')],'sumDuration':_0x19c4cd[_0x8641('0x55')],'sumHoldTime':_0x19c4cd[_0x8641('0x56')]||0x0,'talking':_0x19c4cd['talking'],'total':_0x19c4cd[_0x8641('0x57')],'type':_0x19c4cd[_0x8641('0x58')],'unmanaged':_0x19c4cd['unmanaged'],'abandoned':_0x19c4cd[_0x8641('0x59')],'waiting':_0x19c4cd['waiting']};if(_0x19c4cd['Trunk']){_0x511a21['Trunk']={'id':_0x19c4cd[_0x8641('0x5a')]['id'],'name':_0x19c4cd[_0x8641('0x5a')][_0x8641('0x4f')],'active':_0x19c4cd[_0x8641('0x5a')]['active'],'callerid':_0x19c4cd[_0x8641('0x5a')]['callerid']};}if(_0x19c4cd[_0x8641('0x5b')]){_0x511a21[_0x8641('0x5b')]={'id':_0x19c4cd[_0x8641('0x5b')]['id'],'name':_0x19c4cd[_0x8641('0x5b')][_0x8641('0x4f')]};}var _0x1129d3=md5(JSON['stringify'](_0x511a21));if(_0x19c4cd[_0x8641('0x1')]!==_0x1129d3){_0x19c4cd[_0x8641('0x1')]=_0x1129d3;logger[_0x8641('0x48')](_0x8641('0x5c')+_0x469d6b+']\x20sending\x20voice_queue:save\x20event:',util[_0x8641('0x3c')](_0x511a21,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x8641('0x4b'),_0x511a21['name']),_0x8641('0x5d'),_0x511a21);}}};VoiceQueueReport[_0x8641('0xc')][_0x8641('0x5e')]=function(_0x20dfd2){return _0x20dfd2!==null&&!_[_0x8641('0x5f')](_0x20dfd2);};VoiceQueueReport['prototype'][_0x8641('0x2d')]=function(){var _0x5b1400=this;setInterval(function(){_0x5b1400[_0x8641('0x60')]();ami[_0x8641('0x35')]({'action':_0x8641('0x61')})[_0x8641('0x38')](function(_0x4217e1){logger['error'](_0x8641('0x62'),util[_0x8641('0x3c')](_0x4217e1,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x8641('0x2c')]=function(){var _0x21d12b=this;setInterval(function(){if(_0x21d12b['flagQueueSummary']){return ami[_0x8641('0x35')]({'action':_0x8641('0x63')})[_0x8641('0x64')](function(_0xf99650){_0x21d12b[_0x8641('0x65')]=![];})['catch'](function(_0x14fed2){logger[_0x8641('0x3a')](_0x8641('0x66'),util[_0x8641('0x3c')](_0x14fed2,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x8641('0xc')]['syncQueueSummary']=function(_0x2f9863){try{if(this['isNotNull'](_0x2f9863)&&this[_0x8641('0x5e')](_0x2f9863[_0x8641('0x67')])){logger[_0x8641('0x48')](_0x8641('0x68'),util['inspect'](_0x2f9863,{'showHidden':![],'depth':null}));if(this[_0x8641('0x15')][_0x2f9863[_0x8641('0x67')]]){logger[_0x8641('0x69')](_0x8641('0x6a'),_0x2f9863[_0x8641('0x67')]);var _0x2a3813=_['countBy'](this[_0x8641('0x13')],'queue')[_0x2f9863[_0x8641('0x67')]]||0x0;var _0x2eb5df=_0x2a3813-_0x2f9863['callers'];if(this[_0x8641('0x15')][_0x2f9863[_0x8641('0x67')]][_0x8641('0x32')]!==_[_0x8641('0x6b')](_0x2f9863[_0x8641('0x6c')])||this[_0x8641('0x15')][_0x2f9863['queue']][_0x8641('0x53')]!==_[_0x8641('0x6b')](_0x2f9863[_0x8641('0x6d')])||this[_0x8641('0x15')][_0x2f9863[_0x8641('0x67')]][_0x8641('0x52')]!==_[_0x8641('0x6b')](_0x2f9863[_0x8641('0x52')])||this[_0x8641('0x15')][_0x2f9863[_0x8641('0x67')]][_0x8641('0x6e')]!==_0x2eb5df){this['voiceQueues'][_0x2f9863['queue']][_0x8641('0x32')]=_[_0x8641('0x6b')](_0x2f9863[_0x8641('0x6c')]);this[_0x8641('0x15')][_0x2f9863[_0x8641('0x67')]][_0x8641('0x53')]=_[_0x8641('0x6b')](_0x2f9863[_0x8641('0x6d')]);this[_0x8641('0x15')][_0x2f9863[_0x8641('0x67')]][_0x8641('0x52')]=_[_0x8641('0x6b')](_0x2f9863[_0x8641('0x52')]);this['voiceQueues'][_0x2f9863[_0x8641('0x67')]][_0x8641('0x6e')]=_0x2eb5df>0x0?_0x2eb5df:0x0;this[_0x8641('0x15')][_0x2f9863['queue']][_0x8641('0x6e')]=this[_0x8641('0x15')][_0x2f9863[_0x8641('0x67')]][_0x8641('0x6e')]>_[_0x8641('0x6b')](_0x2f9863['loggedin'])?_[_0x8641('0x6b')](_0x2f9863[_0x8641('0x6d')]):this[_0x8641('0x15')][_0x2f9863[_0x8641('0x67')]]['talking'];this[_0x8641('0x6f')](this[_0x8641('0x15')][_0x2f9863[_0x8641('0x67')]],_0x8641('0x63'));}logger[_0x8641('0x48')](_0x8641('0x70'),util[_0x8641('0x3c')](this[_0x8641('0x15')][_0x2f9863[_0x8641('0x67')]],{'showHidden':![],'depth':null}));ami[_0x8641('0x43')](_0x8641('0x71'),this['voiceQueues'][_0x2f9863[_0x8641('0x67')]]);}}}catch(_0x5b9e5f){logger[_0x8641('0x3a')](_0x8641('0x66'),util[_0x8641('0x3c')](_0x5b9e5f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8641('0xc')][_0x8641('0x72')]=function(_0x4eab32){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util['inspect'](_0x4eab32,{'showHidden':![],'depth':null}));this[_0x8641('0x65')]=!![];};VoiceQueueReport[_0x8641('0xc')][_0x8641('0x1a')]=function(_0x558763){try{if(this[_0x8641('0x5e')](_0x558763)){logger['debug'](_0x8641('0x73'),_0x558763[_0x8641('0x74')],util[_0x8641('0x3c')](_0x558763,{'showHidden':![],'depth':null}));if(_[_0x8641('0x5f')](this[_0x8641('0x11')][_0x558763[_0x8641('0x74')]]))this['queueReports'][_0x558763[_0x8641('0x74')]]=[];if(_[_0x8641('0x5f')](this['channels'][_0x558763[_0x8641('0x74')]]))this[_0x8641('0x13')][_0x558763['uniqueid']]={};var _0x40b009=new QueueReport();_0x40b009[_0x8641('0x4f')]=_0x558763[_0x8641('0x67')];_0x40b009[_0x8641('0x58')]=this[_0x8641('0x15')][_0x40b009['name']]&&this[_0x8641('0x15')][_0x40b009[_0x8641('0x4f')]][_0x8641('0x58')]?this[_0x8641('0x15')][_0x40b009[_0x8641('0x4f')]][_0x8641('0x58')]||_0x8641('0x4e'):'inbound';_0x40b009[_0x8641('0x67')]=_0x558763['queue'];_0x40b009[_0x8641('0x75')]=moment()[_0x8641('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x40b009[_0x8641('0x76')]=_0x558763[_0x8641('0x76')];_0x40b009[_0x8641('0x77')]=_0x558763[_0x8641('0x77')];_0x40b009[_0x8641('0x74')]=_0x558763['uniqueid'];_0x40b009[_0x8641('0x78')]=this[_0x8641('0x13')][_0x558763[_0x8641('0x74')]]['routealias'];logger['info'](_0x8641('0x79'),_0x40b009[_0x8641('0x4f')],_0x40b009[_0x8641('0x58')]);_[_0x8641('0x7a')](_0x40b009,_['pick'](_0x558763,_[_0x8641('0x7b')](_0x40b009)));this[_0x8641('0x11')][_0x558763['uniqueid']][_0x8641('0x7c')](_0x40b009);this[_0x8641('0x13')][_0x558763['uniqueid']]=_0x40b009;this[_0x8641('0x44')](_0x40b009,_0x8641('0x19'));}}catch(_0x2763c8){logger[_0x8641('0x3a')]('[%s][voiceQueueReport][queuecallerjoin]',_0x558763[_0x8641('0x74')],util[_0x8641('0x3c')](_0x2763c8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8641('0xc')][_0x8641('0x1c')]=function(_0x321fda){try{if(this['isNotNull'](_0x321fda)){logger[_0x8641('0x48')](_0x8641('0x7d'),_0x321fda[_0x8641('0x74')],util[_0x8641('0x3c')](_0x321fda,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x321fda[_0x8641('0x74')]]){var _0x1795d3=_[_0x8641('0x7e')](this['queueReports'][_0x321fda['uniqueid']]);_0x1795d3['queuecallercomplete']=![];_0x1795d3[_0x8641('0x7f')]=null;_0x1795d3[_0x8641('0x80')]=_0x321fda[_0x8641('0x80')];_0x1795d3[_0x8641('0x81')]=_0x321fda['originalposition'];_0x1795d3[_0x8641('0x1b')]=!![];_0x1795d3['queuecallerabandonAt']=moment()[_0x8641('0x46')](_0x8641('0x82'));_0x1795d3[_0x8641('0x83')]='ABANDONED';_0x1795d3['lastAssignedTo']=null;logger[_0x8641('0x69')](_0x8641('0x84'),_0x1795d3[_0x8641('0x4f')],_0x1795d3[_0x8641('0x58')]);this[_0x8641('0x13')][_0x321fda[_0x8641('0x74')]]=_0x1795d3;this[_0x8641('0x41')](_0x1795d3,'queuecallerabandon');}}}catch(_0x4297f6){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x321fda['uniqueid'],util[_0x8641('0x3c')](_0x4297f6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8641('0xc')][_0x8641('0x85')]=function(_0x4fb212){try{if(this[_0x8641('0x5e')](_0x4fb212)){logger[_0x8641('0x48')]('[%s][voiceQueueReport][queuecallerleave]',_0x4fb212[_0x8641('0x74')],util['inspect'](_0x4fb212,{'showHidden':![],'depth':null}));if(this[_0x8641('0x11')][_0x4fb212[_0x8641('0x74')]]){var _0x4a3f39=_['last'](this[_0x8641('0x11')][_0x4fb212[_0x8641('0x74')]]);_0x4a3f39['queuecallerleaveAt']=moment()[_0x8641('0x46')](_0x8641('0x82'));_0x4a3f39['connectedlinenum']=_0x4fb212[_0x8641('0x86')];_0x4a3f39[_0x8641('0x87')]=_0x4fb212[_0x8641('0x87')];logger[_0x8641('0x69')](_0x8641('0x88'),_0x4a3f39['name'],_0x4a3f39[_0x8641('0x58')],_0x4fb212[_0x8641('0x86')],_0x4fb212[_0x8641('0x87')]);this[_0x8641('0x13')][_0x4fb212[_0x8641('0x74')]]=_0x4a3f39;this['emitVoiceQueueChannelSave'](_0x4a3f39,'queuecallerleave');}}}catch(_0x4e0019){logger['error'](_0x8641('0x89'),_0x4fb212['uniqueid'],util[_0x8641('0x3c')](_0x4e0019,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8641('0xc')]['syncAgentConnect']=function(_0x5b5efc){try{if(this[_0x8641('0x5e')](_0x5b5efc)){logger[_0x8641('0x48')]('[%s][voiceQueueReport][agentconnect]',_0x5b5efc[_0x8641('0x74')],util['inspect'](_0x5b5efc,{'showHidden':![],'depth':null}));if(this[_0x8641('0x11')][_0x5b5efc[_0x8641('0x74')]]){var _0x278646=_[_0x8641('0x7e')](this[_0x8641('0x11')][_0x5b5efc[_0x8641('0x74')]]);_0x278646['queuecallercomplete']=!![];_0x278646['queuecallerexitreason']=_0x8641('0x8a');logger[_0x8641('0x69')](_0x8641('0x8b'),_0x278646[_0x8641('0x4f')],_0x278646[_0x8641('0x58')]);}}}catch(_0x3f5434){logger[_0x8641('0x3a')]('[%s][voiceQueueReport][agentconnect]',_0x5b5efc['uniqueid'],util[_0x8641('0x3c')](_0x3f5434,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8641('0xc')][_0x8641('0x1f')]=function(_0x4f266f){try{if(this[_0x8641('0x5e')](_0x4f266f)){logger[_0x8641('0x48')](_0x8641('0x8c'),_0x4f266f[_0x8641('0x74')],util['inspect'](_0x4f266f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4f266f[_0x8641('0x74')]]){var _0x4c4f86=_[_0x8641('0x7e')](this['queueReports'][_0x4f266f[_0x8641('0x74')]]);_0x4c4f86[_0x8641('0x1b')]=![];_0x4c4f86[_0x8641('0x8d')]=null;_0x4c4f86[_0x8641('0x8e')]=!![];_0x4c4f86[_0x8641('0x8f')]=_0x4f266f[_0x8641('0x90')];_0x4c4f86['holdtime']=_0x4f266f[_0x8641('0x80')];_0x4c4f86[_0x8641('0x91')]=!![];_0x4c4f86[_0x8641('0x92')]=![];_0x4c4f86[_0x8641('0x93')]=null;if(!_0x4c4f86['transfer']){if(_0x4f266f['reason']==_0x8641('0x94')){_0x4c4f86[_0x8641('0x83')]=_0x8641('0x95');logger[_0x8641('0x69')](_0x8641('0x96'),_0x4c4f86[_0x8641('0x4f')],_0x4c4f86[_0x8641('0x58')]);}else{if(_[_0x8641('0x97')](_0x4f266f['channel'][_0x8641('0x98')](),_0x8641('0x99'))){if(this['queueReports'][_0x4f266f[_0x8641('0x9a')]]){var _0x5f4a8e=_['last'](this[_0x8641('0x11')][_0x4f266f[_0x8641('0x9a')]]);_0x5f4a8e[_0x8641('0x91')]=![];_0x5f4a8e[_0x8641('0x92')]=!![];_0x5f4a8e[_0x8641('0x93')]=moment(_0x4c4f86['queuecallerjoinAt'])[_0x8641('0x9b')](_0x4f266f[_0x8641('0x80')],_0x8641('0x9c'))['format'](_0x8641('0x82'));_0x5f4a8e[_0x8641('0x83')]=_0x8641('0x9d');_0x5f4a8e[_0x8641('0x94')]=!![];_0x5f4a8e[_0x8641('0x9e')]=_0x8641('0x9f');_0x5f4a8e[_0x8641('0xa0')]=_0x4f266f['destexten'];_0x5f4a8e[_0x8641('0xa1')]=_0x4f266f[_0x8641('0x74')];logger['info'](_0x8641('0xa2'),_0x5f4a8e['name'],_0x5f4a8e[_0x8641('0x58')]);var _0x31282a=this[_0x8641('0x11')][_0x4f266f['linkedid']];this[_0x8641('0x11')][_0x4f266f['linkedid']]=this[_0x8641('0x11')][_0x4f266f[_0x8641('0x74')]];this[_0x8641('0x11')][_0x4f266f[_0x8641('0x74')]]=_0x31282a;}}else{_0x4c4f86[_0x8641('0x83')]='COMPLETEDBY'+_0x4f266f[_0x8641('0xa3')][_0x8641('0xa4')]();logger[_0x8641('0x69')](_0x8641('0xa5'),_0x4c4f86[_0x8641('0x4f')],_0x4c4f86[_0x8641('0x58')],_0x4c4f86[_0x8641('0x83')]);}}}this[_0x8641('0x13')][_0x4f266f[_0x8641('0x74')]]=_0x4c4f86;this['emitVoiceQueueChannelRemove'](_0x4c4f86,_0x8641('0x1e'));}}}catch(_0x1c5fa3){logger[_0x8641('0x3a')]('[%s][voiceQueueReport][agentcomplete]',_0x4f266f[_0x8641('0x74')],util[_0x8641('0x3c')](_0x1c5fa3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8641('0xc')][_0x8641('0x22')]=function(_0x391614){try{if(this[_0x8641('0x5e')](_0x391614)){logger[_0x8641('0x48')](_0x8641('0xa6'),_0x391614[_0x8641('0x74')],util[_0x8641('0x3c')](_0x391614,{'showHidden':![],'depth':null}));this[_0x8641('0xa7')](_0x391614[_0x8641('0x74')],_[_0x8641('0x7b')](_0x391614[_0x8641('0xa8')])[0x0],_0x391614['value']);if(this[_0x8641('0x11')][_0x391614[_0x8641('0x74')]]){var _0x4375fe=_[_0x8641('0x7e')](this[_0x8641('0x11')][_0x391614[_0x8641('0x74')]]);if(_0x4375fe){if(this['isNotNull'](_0x391614[_0x8641('0xa8')])&&this[_0x8641('0x5e')](_0x391614['variable']['queuestatus'])){switch(_0x391614['value']){case _0x8641('0xa9'):_0x4375fe[_0x8641('0x92')]=![];_0x4375fe['queuecallerexitAt']=null;break;case _0x8641('0xaa'):_0x4375fe[_0x8641('0xab')]=_0x8641('0xac');_0x4375fe[_0x8641('0x92')]=!![];_0x4375fe['queuecallerexitAt']=moment()[_0x8641('0x46')](_0x8641('0x82'));_0x4375fe[_0x8641('0xad')]=moment()[_0x8641('0x46')](_0x8641('0x82'));logger[_0x8641('0x48')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x391614[_0x8641('0x74')],util[_0x8641('0x3c')](_0x4375fe,{'showHidden':![],'depth':null}));ami[_0x8641('0x43')](_0x8641('0xae'),_0x4375fe);break;default:_0x4375fe['queuecallerexit']=!![];_0x4375fe[_0x8641('0x93')]=moment()['format'](_0x8641('0x82'));_0x4375fe[_0x8641('0xad')]=moment()[_0x8641('0x46')](_0x8641('0x82'));}_0x4375fe[_0x8641('0x1b')]=![];_0x4375fe[_0x8641('0x8d')]=null;_0x4375fe[_0x8641('0x83')]=_0x391614[_0x8641('0xaf')];this[_0x8641('0x13')][_0x391614[_0x8641('0x74')]]=_0x4375fe;this['emitVoiceQueueChannelRemove'](_0x4375fe,_0x8641('0x21'));}else if(this[_0x8641('0x5e')](_0x391614[_0x8641('0xa8')])&&this[_0x8641('0x5e')](_0x391614[_0x8641('0xa8')][_0x8641('0xb0')])){if(!_0x4375fe[_0x8641('0x1b')]){_0x4375fe[_0x8641('0x92')]=!![];_0x4375fe['queuecallerexitAt']=moment()['format'](_0x8641('0x82'));_0x4375fe['queuecallerexitreason']='EXITWITHKEY';_0x4375fe[_0x8641('0xad')]=moment()[_0x8641('0x46')](_0x8641('0x82'));this[_0x8641('0x13')][_0x391614[_0x8641('0x74')]]=_0x4375fe;}}logger['info'](_0x8641('0xb1'),_0x391614[_0x8641('0x74')],_0x4375fe['name'],_0x4375fe[_0x8641('0x58')],_[_0x8641('0x7b')](_0x391614[_0x8641('0xa8')])[0x0],_0x391614[_0x8641('0xaf')]);_0x4375fe[_0x8641('0x16')]=this[_0x8641('0x16')][_0x391614[_0x8641('0x74')]];}}}}catch(_0x60d5c1){logger[_0x8641('0x3a')]('[%s][voiceQueueReport][varset]',_0x391614['uniqueid'],util['inspect'](_0x60d5c1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8641('0xc')]['addVariable']=function(_0x4fe886,_0x16abfa,_0x52df7c){var _0x2bd37e=[_0x8641('0xb2'),'rtpaudioqosbridged',_0x8641('0xb3'),_0x8641('0xb4'),_0x8641('0xb5'),_0x8641('0xb6'),_0x8641('0xb7'),'rtpaudioqosrttbridged',_0x8641('0xb8'),_0x8641('0xb9'),_0x8641('0xba'),'bridgepvtcallid','membercalls','memberdynamic',_0x8641('0xbb'),_0x8641('0xbc'),_0x8641('0x90'),'memberpenalty',_0x8641('0xbd')];if(!_[_0x8641('0xbe')](_0x16abfa)&&!_[_0x8641('0xbf')](_0x2bd37e,_0x16abfa)){if(_[_0x8641('0x5f')](this[_0x8641('0x16')][_0x4fe886])){this[_0x8641('0x16')][_0x4fe886]={};}this['variables'][_0x4fe886][_0x16abfa]=_0x52df7c;}};VoiceQueueReport[_0x8641('0xc')][_0x8641('0xc0')]=function(_0x42c9d2){try{if(this[_0x8641('0x5e')](_0x42c9d2)){logger[_0x8641('0x48')](_0x8641('0xc1'),_0x42c9d2[_0x8641('0x74')],util[_0x8641('0x3c')](_0x42c9d2,{'showHidden':![],'depth':null}));if(this[_0x8641('0x11')][_0x42c9d2[_0x8641('0x74')]]){for(var _0x3c1fc8=0x0,_0x5b6166={};_0x3c1fc8<this['queueReports'][_0x42c9d2[_0x8641('0x74')]][_0x8641('0xc2')];_0x3c1fc8+=0x1){_0x5b6166=this[_0x8641('0x11')][_0x42c9d2['uniqueid']][_0x3c1fc8];if(this[_0x8641('0x15')][_0x5b6166[_0x8641('0x67')]]){if(_0x5b6166['queuecallerexit']&&_0x5b6166['transfer']!=!![]){this[_0x8641('0x15')][_0x5b6166[_0x8641('0x67')]][_0x8641('0xc3')]+=0x1;}if(_0x5b6166['queuecallerabandon']){this['voiceQueues'][_0x5b6166[_0x8641('0x67')]][_0x8641('0x59')]+=0x1;}this[_0x8641('0x15')][_0x5b6166[_0x8641('0x67')]][_0x8641('0x56')]+=moment(_0x5b6166['queuecallerleaveAt'])[_0x8641('0xc4')](_0x5b6166[_0x8641('0x75')],_0x8641('0x9c'))||0x0;if(_0x3c1fc8===this[_0x8641('0x11')][_0x42c9d2[_0x8641('0x74')]]['length']-0x1){this[_0x8641('0x15')][_0x5b6166['queue']][_0x8641('0x55')]+=moment()['milliseconds'](0x0)[_0x8641('0xc4')](_0x5b6166[_0x8641('0x75')],'seconds');this[_0x8641('0x15')][_0x5b6166[_0x8641('0x67')]][_0x8641('0x57')]+=0x1;if(_0x5b6166[_0x8641('0x91')]){this[_0x8641('0x15')][_0x5b6166[_0x8641('0x67')]][_0x8641('0x51')]+=0x1;this[_0x8641('0x15')][_0x5b6166[_0x8641('0x67')]][_0x8641('0x54')]+=moment()[_0x8641('0xc5')](0x0)['diff'](_0x5b6166[_0x8641('0xad')],_0x8641('0x9c'));_0x5b6166['queuecallercompleteAt']=moment()[_0x8641('0x46')](_0x8641('0x82'));_0x5b6166['queuecallerexit']=![];_0x5b6166[_0x8641('0x93')]=null;}if(_0x5b6166[_0x8641('0x92')]&&_0x5b6166['transfer']!=!![]){_0x5b6166[_0x8641('0xab')]=_0x8641('0xc3');logger[_0x8641('0x48')](_0x8641('0xc6'),_0x42c9d2['uniqueid'],util[_0x8641('0x3c')](_0x5b6166,{'showHidden':![],'depth':null}));ami[_0x8641('0x43')](_0x8641('0xc7'),_0x5b6166);}if(_0x5b6166['queuecallerabandon']){_0x5b6166[_0x8641('0xab')]=_0x8641('0x59');logger['debug'](_0x8641('0xc8'),_0x42c9d2['uniqueid'],util[_0x8641('0x3c')](_0x5b6166,{'showHidden':![],'depth':null}));ami[_0x8641('0x43')]('custom:queuecallerabandon',_0x5b6166);}}else{this[_0x8641('0x15')][_0x5b6166['queue']][_0x8641('0x55')]+=this[_0x8641('0x15')][_0x5b6166[_0x8641('0x67')]][_0x8641('0x56')];}logger[_0x8641('0x69')](_0x8641('0xc9'),_0x42c9d2['uniqueid'],_0x5b6166['name'],_0x5b6166[_0x8641('0x58')],_0x42c9d2[_0x8641('0xca')]);this[_0x8641('0x13')][_0x42c9d2[_0x8641('0x74')]]=_0x5b6166;this[_0x8641('0x41')](_0x5b6166,_0x8641('0xcb'));this[_0x8641('0x6f')](this[_0x8641('0x15')][_0x5b6166['queue']],_0x8641('0xcb'));}}logger[_0x8641('0x48')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x42c9d2['uniqueid'],util[_0x8641('0x3c')](this['queueReports'][_0x42c9d2[_0x8641('0x74')]],{'showHidden':![],'depth':null}));ami['emit'](_0x8641('0xcc'),this[_0x8641('0x11')][_0x42c9d2[_0x8641('0x74')]]);delete this[_0x8641('0x11')][_0x42c9d2[_0x8641('0x74')]];delete this[_0x8641('0x13')][_0x42c9d2[_0x8641('0x74')]];}if(this['variables'][_0x42c9d2[_0x8641('0x74')]]){delete this[_0x8641('0x16')][_0x42c9d2[_0x8641('0x74')]];}}}catch(_0x4154ec){logger[_0x8641('0x3a')](_0x8641('0xc1'),_0x42c9d2['uniqueid'],util['inspect'](_0x4154ec,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8641('0xc')][_0x8641('0x2a')]=function(_0xc54f2){try{if(this[_0x8641('0x5e')](_0xc54f2)){logger['debug']('[%s][voiceQueueReport][attendedtransfer]',_0xc54f2[_0x8641('0x74')],util[_0x8641('0x3c')](_0xc54f2,{'showHidden':![],'depth':null}));var _0x40217b;if(this[_0x8641('0x11')][_0xc54f2[_0x8641('0xcd')]]){_0x40217b=_['last'](this[_0x8641('0x11')][_0xc54f2[_0x8641('0xcd')]]);_0x40217b[_0x8641('0xa0')]=_0xc54f2[_0x8641('0xce')];_0x40217b[_0x8641('0xa1')]=_0xc54f2[_0x8641('0xcf')];_0x40217b[_0x8641('0x83')]='ATTENDEDTRANSFER';_0x40217b[_0x8641('0x94')]=!![];_0x40217b[_0x8641('0x9e')]=_0x8641('0xd0');if(this[_0x8641('0x11')][_0xc54f2[_0x8641('0xcf')]]){var _0x4b1b5e=this[_0x8641('0x11')][_0xc54f2[_0x8641('0xcf')]];this[_0x8641('0x11')][_0xc54f2[_0x8641('0xcf')]]=this[_0x8641('0x11')][_0xc54f2[_0x8641('0xcd')]];this['queueReports'][_0xc54f2['transfereeuniqueid']]=_0x4b1b5e;var _0x552a43=_[_0x8641('0x7e')](this[_0x8641('0x11')][_0xc54f2['transfereeuniqueid']]);_0x552a43[_0x8641('0x34')]=!![];}logger[_0x8641('0x69')](_0x8641('0xd1'),_0xc54f2['uniqueid'],_0x40217b[_0x8641('0x4f')],_0x40217b[_0x8641('0x58')],_0x40217b['transferexten'],_0x40217b['transferuniqueid']);}else if(this['queueReports'][_0xc54f2[_0x8641('0xd2')]]){_0x40217b=_['last'](this[_0x8641('0x11')][_0xc54f2[_0x8641('0xd2')]]);_0x40217b['transferexten']=_0xc54f2['origtransfererexten'];_0x40217b[_0x8641('0xa1')]=_0xc54f2[_0x8641('0xd3')];_0x40217b[_0x8641('0x83')]=_0x8641('0xd4');_0x40217b[_0x8641('0x94')]=!![];_0x40217b['transfertype']=_0x8641('0xd0');if(this['queueReports'][_0xc54f2[_0x8641('0xd3')]]){var _0x4b1b5e=this[_0x8641('0x11')][_0xc54f2['origtransfereruniqueid']];this['queueReports'][_0xc54f2[_0x8641('0xd3')]]=this[_0x8641('0x11')][_0xc54f2[_0x8641('0xd2')]];this[_0x8641('0x11')][_0xc54f2[_0x8641('0xd2')]]=_0x4b1b5e;var _0x552a43=_[_0x8641('0x7e')](this[_0x8641('0x11')][_0xc54f2[_0x8641('0xd2')]]);_0x552a43[_0x8641('0x34')]=!![];}logger['info'](_0x8641('0xd1'),_0xc54f2[_0x8641('0x74')],_0x40217b[_0x8641('0x4f')],_0x40217b[_0x8641('0x58')],_0x40217b['transferexten'],_0x40217b[_0x8641('0xa1')]);}}}catch(_0x4c50d7){logger[_0x8641('0x3a')](_0x8641('0xd5'),_0xc54f2[_0x8641('0x74')],util[_0x8641('0x3c')](_0x4c50d7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8641('0xc')][_0x8641('0x2b')]=function(_0x197bdc){try{if(this['isNotNull'](_0x197bdc)){logger['debug'](_0x8641('0xd6'),_0x197bdc[_0x8641('0x74')],util[_0x8641('0x3c')](_0x197bdc,{'showHidden':![],'depth':null}));if(this[_0x8641('0x11')][_0x197bdc[_0x8641('0xcd')]]){var _0x2e25ba=_[_0x8641('0x7e')](this['queueReports'][_0x197bdc[_0x8641('0xcd')]]);_0x2e25ba['queuecallerexitreason']=_0x8641('0xd7');_0x2e25ba['transfer']=!![];_0x2e25ba[_0x8641('0x9e')]=_0x8641('0xd8');_0x2e25ba['transferexten']=_0x197bdc['extension'];_0x2e25ba[_0x8641('0xa1')]=_0x197bdc['transfereeuniqueid'];logger[_0x8641('0x69')]('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x197bdc[_0x8641('0x74')],_0x2e25ba[_0x8641('0x4f')],_0x2e25ba[_0x8641('0x58')],_0x2e25ba['transferexten'],_0x2e25ba['transferuniqueid']);this[_0x8641('0xc0')]({'event':_0x8641('0xd9'),'uniqueid':_0x197bdc['transfereeuniqueid'],'context':_0x197bdc[_0x8641('0xda')],'channel':_0x197bdc[_0x8641('0xdb')]});}}}catch(_0x22548c){logger[_0x8641('0x3a')](_0x8641('0xd6'),_0x197bdc[_0x8641('0x74')],util['inspect'](_0x22548c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8641('0xc')][_0x8641('0x26')]=function(_0x312538){try{if(this['isNotNull'](_0x312538)){logger['debug'](_0x8641('0xdc'),_0x312538['uniqueid'],util[_0x8641('0x3c')](_0x312538,{'showHidden':![],'depth':null}));if(this[_0x8641('0x11')][_0x312538[_0x8641('0x74')]]){var _0xd1998d=_[_0x8641('0x7e')](this[_0x8641('0x11')][_0x312538[_0x8641('0x74')]]);if(!_[_0x8641('0xbe')](_0xd1998d[_0x8641('0xad')])){_0xd1998d[_0x8641('0xdd')]=moment()[_0x8641('0x46')](_0x8641('0x82'));logger[_0x8641('0x69')](_0x8641('0xde'),_0x312538['uniqueid'],_0xd1998d[_0x8641('0xdd')]);}}}}catch(_0x1fe7df){logger[_0x8641('0x3a')](_0x8641('0xdc'),_0x312538[_0x8641('0x74')],util['inspect'](_0x1fe7df,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8641('0x28')]=function(_0x40d81f){try{if(this[_0x8641('0x5e')](_0x40d81f)){logger[_0x8641('0x48')]('[%s][voiceQueueReport][musiconholdstop]',_0x40d81f['uniqueid'],util['inspect'](_0x40d81f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x40d81f[_0x8641('0x74')]]){var _0x83060b=_[_0x8641('0x7e')](this[_0x8641('0x11')][_0x40d81f[_0x8641('0x74')]]);if(!_[_0x8641('0xbe')](_0x83060b[_0x8641('0xdd')])){_0x83060b[_0x8641('0xdf')]+=moment()[_0x8641('0xc5')](0x0)['diff'](_0x83060b['mohstarttime'],'seconds');logger['info']('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x40d81f['uniqueid'],_0x83060b[_0x8641('0xdf')]);delete _0x83060b['mohstarttime'];}}}}catch(_0x302520){logger[_0x8641('0x3a')](_0x8641('0xe0'),_0x40d81f[_0x8641('0x74')],util['inspect'](_0x302520,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8641('0xc')][_0x8641('0xe1')]=function(_0x290c59){try{if(this['isNotNull'](_0x290c59)){logger[_0x8641('0x48')](_0x8641('0xe2'),_0x290c59['uniqueid'],util[_0x8641('0x3c')](_0x290c59,{'showHidden':![],'depth':null}));if(_0x290c59[_0x8641('0xe3')][_0x8641('0x98')]()==='set'){_0x290c59[_0x8641('0xe4')]=_0x290c59['appdata']&&_0x290c59['appdata']['startsWith'](_0x8641('0xe5'))?_0x290c59['appdata']:(_0x290c59[_0x8641('0xe6')]||_0x290c59[_0x8641('0xe4')])[_0x8641('0x98')]();if(_[_0x8641('0x97')](_0x290c59[_0x8641('0xe4')]['toLowerCase'](),_0x8641('0xe7'))){logger[_0x8641('0x69')](_0x8641('0xe8'),_0x290c59[_0x8641('0x74')],_0x290c59['application'],_0x290c59[_0x8641('0xe4')]);if(_[_0x8641('0x5f')](this[_0x8641('0x13')][_0x290c59[_0x8641('0x74')]]))this[_0x8641('0x13')][_0x290c59[_0x8641('0x74')]]={};var _0x22d580=_0x290c59[_0x8641('0xe4')][_0x8641('0xe9')]('=');var _0x324b47=_0x22d580[0x0][_0x8641('0x98')]()[_0x8641('0xea')](/cdr\((.*)\)/);if(_0x324b47)this[_0x8641('0x13')][_0x290c59[_0x8641('0x74')]][_0x324b47[0x1]]=_0x22d580[0x1];}}}}catch(_0x32b357){logger[_0x8641('0x3a')](_0x8641('0xeb'),_0x290c59[_0x8641('0x74')],util['inspect'](_0x32b357,{'showHidden':![],'depth':null}));}};module[_0x8641('0xec')]=VoiceQueueReport;