Built motion from commit e6806ed6.|2.6.0
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index 9d6f1be..048584e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbac9=['sumHoldTime','total','unmanaged','abandoned','Trunk','active','callerid','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','Action','queues','then','flagQueueSummary','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','loggedin','available','toNumber','loggedIn','custom:queuesummary','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','merge','pick','keys','push','queuecallercomplete','queuecallercompleteAt','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','queuecallerabandon','[%s][voiceQueueReport][queuecallerabandon]','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','assigned','membername','holdtime','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','addVariable','variable','value','queuestatus','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','varset','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','includes','[%s][voiceQueueReport][hangup]','diff','length','milliseconds','answered','[%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','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','switch','BLIND','context','transfererchannel','[%s][voiceQueueReport][blindtransfer]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','appdata','CDR(routeAlias)','startsWith','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','moment','util','md5','ioredis','../../../config/environment','ami','../model/queueReport','redis','defaults','localhost','prototype','tail','finally','queueReports','agents','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','waiting','unlockRR','clearZombieChannels','channels','enqueue','isNil','status','channel','catch','message','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_presence:save','debug','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','pTalking','sumBillable','sumDuration'];(function(_0x239277,_0x1533e6){var _0x126418=function(_0x1fb045){while(--_0x1fb045){_0x239277['push'](_0x239277['shift']());}};_0x126418(++_0x1533e6);}(_0xbac9,0x186));var _0x9bac=function(_0x511bd1,_0x223e5b){_0x511bd1=_0x511bd1-0x0;var _0x4c48ec=_0xbac9[_0x511bd1];return _0x4c48ec;};'use strict';var _=require('lodash');var moment=require(_0x9bac('0x0'));var util=require(_0x9bac('0x1'));var md5=require(_0x9bac('0x2'));var Redis=require(_0x9bac('0x3'));var config=require(_0x9bac('0x4'));var logger=require('../../../config/logger')(_0x9bac('0x5'));var ami=require('../ami');var QueueReport=require(_0x9bac('0x6'));config[_0x9bac('0x7')]=_[_0x9bac('0x8')](config['redis'],{'host':_0x9bac('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x9bac('0xa')]['enqueue']=function(_0x52ebbc){this['tail']=this[_0x9bac('0xb')]?this[_0x9bac('0xb')][_0x9bac('0xc')](_0x52ebbc):_0x52ebbc();};function VoiceQueueReport(_0x526575){this['sequence']=new Sequence();this[_0x9bac('0xd')]={};this[_0x9bac('0xe')]=_0x526575[_0x9bac('0xe')];this['channels']=_0x526575['queueChannels'];this[_0x9bac('0xf')]=_0x526575[_0x9bac('0xf')];this['flagQueueSummary']=!![];this[_0x9bac('0x10')]=_0x526575[_0x9bac('0x10')];this[_0x9bac('0x11')]={};ami['on'](_0x9bac('0x12'),this[_0x9bac('0x13')][_0x9bac('0x14')](this));ami['on']('queuesummarycomplete',this[_0x9bac('0x15')][_0x9bac('0x14')](this));ami['on'](_0x9bac('0x16'),this[_0x9bac('0x17')][_0x9bac('0x14')](this));ami['on']('queuecallerabandon',this[_0x9bac('0x18')][_0x9bac('0x14')](this));ami['on']('queuecallerleave',this[_0x9bac('0x19')][_0x9bac('0x14')](this));ami['on'](_0x9bac('0x1a'),this['syncAgentComplete']['bind'](this));ami['on'](_0x9bac('0x1b'),this[_0x9bac('0x1c')][_0x9bac('0x14')](this));ami['on']('varset',this[_0x9bac('0x1d')][_0x9bac('0x14')](this));ami['on'](_0x9bac('0x1e'),this[_0x9bac('0x1f')][_0x9bac('0x14')](this));ami['on'](_0x9bac('0x20'),this[_0x9bac('0x21')][_0x9bac('0x14')](this));ami['on'](_0x9bac('0x22'),this[_0x9bac('0x23')][_0x9bac('0x14')](this));ami['on'](_0x9bac('0x24'),this[_0x9bac('0x25')][_0x9bac('0x14')](this));ami['on']('attendedtransfer',this[_0x9bac('0x26')][_0x9bac('0x14')](this));ami['on'](_0x9bac('0x27'),this[_0x9bac('0x28')][_0x9bac('0x14')](this));this[_0x9bac('0x29')]();this[_0x9bac('0x2a')]();}function clearChannels(_0x4f59ec){if(!_[_0x9bac('0x2b')](_0x4f59ec)){for(var _0x39605c in _0x4f59ec){if(_0x4f59ec[_0x9bac('0x2c')](_0x39605c)){delete _0x4f59ec[_0x39605c];}}}}function clearCampaigns(_0x51fff4){if(!_[_0x9bac('0x2b')](_0x51fff4)){for(var _0x293bea in _0x51fff4){if(_0x51fff4[_0x9bac('0x2c')](_0x293bea)){_0x51fff4[_0x293bea]['originated']=0x0;}}}}function clearVoiceQueues(_0x547767){if(!_[_0x9bac('0x2b')](_0x547767)){for(var _0x17c985 in _0x547767){if(_0x547767[_0x9bac('0x2c')](_0x17c985)){_0x547767[_0x17c985][_0x9bac('0x2d')]=0x0;_0x547767[_0x17c985][_0x9bac('0x2e')]=0x0;_0x547767[_0x17c985]['pTalking']=0x0;_0x547767[_0x17c985][_0x9bac('0x2f')]=0x0;_0x547767[_0x17c985]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x2b6d5c){if(!_[_0x9bac('0x2b')](_0x2b6d5c)){for(var _0x145aec in _0x2b6d5c){if(_0x2b6d5c['hasOwnProperty'](_0x145aec)){_0x2b6d5c[_0x145aec][_0x9bac('0x30')]=!![];}}}}VoiceQueueReport[_0x9bac('0xa')][_0x9bac('0x31')]=function(){var _0x2bd80f=this;for(var _0x4375ec in this[_0x9bac('0x32')]){if(this[_0x9bac('0x32')][_0x9bac('0x2c')](_0x4375ec)&&!this[_0x9bac('0x32')][_0x4375ec]['switch']){this['sequence'][_0x9bac('0x33')](function(){if(!_[_0x9bac('0x34')](_0x2bd80f['channels'][_0x4375ec])){return ami['Action']({'action':_0x9bac('0x35'),'channel':_0x2bd80f[_0x9bac('0x32')][_0x4375ec][_0x9bac('0x36')]})[_0x9bac('0x37')](function(_0x15fe75){if(_0x15fe75[_0x9bac('0x38')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x2bd80f['channels'][_0x4375ec]){delete _0x2bd80f[_0x9bac('0x32')][_0x4375ec];logger[_0x9bac('0x39')](_0x9bac('0x3a'),_0x4375ec,util[_0x9bac('0x3b')](_0x15fe75,{'showHidden':![],'depth':null}));}if(_0x2bd80f[_0x9bac('0xd')][_0x4375ec]){delete _0x2bd80f[_0x9bac('0xd')][_0x4375ec];logger[_0x9bac('0x39')](_0x9bac('0x3c'),_0x4375ec,util[_0x9bac('0x3b')](_0x15fe75,{'showHidden':![],'depth':null}));}if(_0x2bd80f['variables'][_0x4375ec]){delete _0x2bd80f[_0x9bac('0x11')][_0x4375ec];logger['error'](_0x9bac('0x3d'),_0x4375ec,util[_0x9bac('0x3b')](_0x15fe75,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x9bac('0xa')][_0x9bac('0x21')]=function(){logger[_0x9bac('0x39')](_0x9bac('0x3e'));clearChannels(this['channels']);this[_0x9bac('0x3f')](this[_0x9bac('0xd')]);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x9bac('0x10')]);};VoiceQueueReport[_0x9bac('0xa')][_0x9bac('0x3f')]=function(_0xfdf74b){var _0x4cab77=this;if(!_[_0x9bac('0x2b')](_0xfdf74b)){for(var _0x4be51e in _0xfdf74b){if(_0xfdf74b['hasOwnProperty'](_0x4be51e)){_0x4cab77[_0x9bac('0x40')](_0xfdf74b[_0x4be51e],'clearqueuereport');delete _0xfdf74b[_0x4be51e];}}}};VoiceQueueReport['prototype'][_0x9bac('0x41')]=function(_0x5f5d74,_0xc8687c,_0x36c489){io['to'](_0x5f5d74)['emit'](_0xc8687c,_0x36c489);};VoiceQueueReport['prototype'][_0x9bac('0x42')]=function(_0x39f7ab,_0x1349cd){logger['debug'](_0x9bac('0x43')+_0x1349cd+_0x9bac('0x44'),_0x39f7ab[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x39f7ab,{'showHidden':![],'depth':null}));this['emit'](util[_0x9bac('0x46')](_0x9bac('0x47'),_0x39f7ab[_0x9bac('0x48')]),'voice_queue_channel:save',_0x39f7ab);io[_0x9bac('0x41')](_0x9bac('0x49'),_0x39f7ab);};VoiceQueueReport[_0x9bac('0xa')]['emitVoiceQueueChannelRemove']=function(_0x5d5ea7,_0x234635){logger[_0x9bac('0x4a')]('[%s][voiceQueueReport]['+_0x234635+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x5d5ea7[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x5d5ea7,{'showHidden':![],'depth':null}));if(_0x5d5ea7[_0x9bac('0x4b')]===_0x9bac('0x4c'))return;this[_0x9bac('0x41')](util[_0x9bac('0x46')](_0x9bac('0x47'),_0x5d5ea7['name']),_0x9bac('0x4d'),_0x5d5ea7);io[_0x9bac('0x41')](_0x9bac('0x4e'),_0x5d5ea7);};VoiceQueueReport[_0x9bac('0xa')][_0x9bac('0x4f')]=function(_0x2d91d5,_0x219a75){if(_0x2d91d5[_0x9bac('0x50')]===_0x9bac('0x51')){var _0x2467a3={'id':_0x2d91d5['id'],'name':_0x2d91d5[_0x9bac('0x48')],'strategy':_0x2d91d5[_0x9bac('0x52')],'answered':_0x2d91d5['answered'],'available':_0x2d91d5['available'],'loggedIn':_0x2d91d5['loggedIn'],'pTalking':_0x2d91d5[_0x9bac('0x53')],'sumBillable':_0x2d91d5[_0x9bac('0x54')],'sumDuration':_0x2d91d5[_0x9bac('0x55')],'sumHoldTime':_0x2d91d5[_0x9bac('0x56')]||0x0,'talking':_0x2d91d5['talking'],'total':_0x2d91d5[_0x9bac('0x57')],'type':_0x2d91d5[_0x9bac('0x50')],'unmanaged':_0x2d91d5[_0x9bac('0x58')],'abandoned':_0x2d91d5[_0x9bac('0x59')],'waiting':_0x2d91d5[_0x9bac('0x2f')]};if(_0x2d91d5[_0x9bac('0x5a')]){_0x2467a3[_0x9bac('0x5a')]={'id':_0x2d91d5[_0x9bac('0x5a')]['id'],'name':_0x2d91d5[_0x9bac('0x5a')]['name'],'active':_0x2d91d5[_0x9bac('0x5a')][_0x9bac('0x5b')],'callerid':_0x2d91d5['Trunk'][_0x9bac('0x5c')]};}if(_0x2d91d5['Interval']){_0x2467a3['Interval']={'id':_0x2d91d5['Interval']['id'],'name':_0x2d91d5['Interval'][_0x9bac('0x48')]};}var _0x430be8=md5(JSON[_0x9bac('0x5d')](_0x2467a3));if(_0x2d91d5[_0x9bac('0x2')]!==_0x430be8){_0x2d91d5[_0x9bac('0x2')]=_0x430be8;logger[_0x9bac('0x4a')](_0x9bac('0x5e')+_0x219a75+_0x9bac('0x5f'),util['inspect'](_0x2467a3,{'showHidden':![],'depth':null}));this[_0x9bac('0x41')](util[_0x9bac('0x46')](_0x9bac('0x47'),_0x2467a3[_0x9bac('0x48')]),_0x9bac('0x60'),_0x2467a3);}}};VoiceQueueReport['prototype'][_0x9bac('0x61')]=function(_0x24b8b4){return _0x24b8b4!==null&&!_[_0x9bac('0x62')](_0x24b8b4);};VoiceQueueReport['prototype'][_0x9bac('0x2a')]=function(){var _0x561f82=this;setInterval(function(){_0x561f82['clearZombieChannels']();ami[_0x9bac('0x63')]({'action':_0x9bac('0x64')})[_0x9bac('0x37')](function(_0x431a1e){logger[_0x9bac('0x39')]('[voiceQueueReport][queues]',util[_0x9bac('0x3b')](_0x431a1e,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype']['loopQueueSummary']=function(){var _0x582977=this;setInterval(function(){if(_0x582977['flagQueueSummary']){return ami['Action']({'action':_0x9bac('0x12')})[_0x9bac('0x65')](function(){_0x582977[_0x9bac('0x66')]=![];})[_0x9bac('0x37')](function(_0x4131e0){logger[_0x9bac('0x39')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x4131e0,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x9bac('0xa')]['syncQueueSummary']=function(_0x1dd9f1){try{if(this[_0x9bac('0x61')](_0x1dd9f1)&&this[_0x9bac('0x61')](_0x1dd9f1[_0x9bac('0x67')])){logger[_0x9bac('0x4a')](_0x9bac('0x68'),util['inspect'](_0x1dd9f1,{'showHidden':![],'depth':null}));if(this[_0x9bac('0xf')][_0x1dd9f1['queue']]){logger[_0x9bac('0x69')](_0x9bac('0x6a'),_0x1dd9f1[_0x9bac('0x67')]);var _0x21718f=_[_0x9bac('0x6b')](this[_0x9bac('0x32')],_0x9bac('0x67'))[_0x1dd9f1[_0x9bac('0x67')]]||0x0;var _0x1cb521=_0x21718f-_0x1dd9f1['callers'];if(this[_0x9bac('0xf')][_0x1dd9f1[_0x9bac('0x67')]]['waiting']!==_['toNumber'](_0x1dd9f1[_0x9bac('0x6c')])||this['voiceQueues'][_0x1dd9f1[_0x9bac('0x67')]]['loggedIn']!==_['toNumber'](_0x1dd9f1[_0x9bac('0x6d')])||this['voiceQueues'][_0x1dd9f1[_0x9bac('0x67')]][_0x9bac('0x6e')]!==_[_0x9bac('0x6f')](_0x1dd9f1[_0x9bac('0x6e')])||this[_0x9bac('0xf')][_0x1dd9f1['queue']][_0x9bac('0x2e')]!==_0x1cb521){this[_0x9bac('0xf')][_0x1dd9f1[_0x9bac('0x67')]][_0x9bac('0x2f')]=_[_0x9bac('0x6f')](_0x1dd9f1[_0x9bac('0x6c')]);this[_0x9bac('0xf')][_0x1dd9f1[_0x9bac('0x67')]][_0x9bac('0x70')]=_[_0x9bac('0x6f')](_0x1dd9f1[_0x9bac('0x6d')]);this[_0x9bac('0xf')][_0x1dd9f1[_0x9bac('0x67')]][_0x9bac('0x6e')]=_['toNumber'](_0x1dd9f1['available']);this[_0x9bac('0xf')][_0x1dd9f1[_0x9bac('0x67')]][_0x9bac('0x2e')]=_0x1cb521>0x0?_0x1cb521:0x0;this[_0x9bac('0xf')][_0x1dd9f1[_0x9bac('0x67')]]['talking']=this[_0x9bac('0xf')][_0x1dd9f1[_0x9bac('0x67')]][_0x9bac('0x2e')]>_[_0x9bac('0x6f')](_0x1dd9f1[_0x9bac('0x6d')])?_[_0x9bac('0x6f')](_0x1dd9f1[_0x9bac('0x6d')]):this['voiceQueues'][_0x1dd9f1[_0x9bac('0x67')]][_0x9bac('0x2e')];this[_0x9bac('0x4f')](this[_0x9bac('0xf')][_0x1dd9f1[_0x9bac('0x67')]],_0x9bac('0x12'));}logger[_0x9bac('0x4a')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x9bac('0x3b')](this[_0x9bac('0xf')][_0x1dd9f1[_0x9bac('0x67')]],{'showHidden':![],'depth':null}));ami[_0x9bac('0x41')](_0x9bac('0x71'),this[_0x9bac('0xf')][_0x1dd9f1[_0x9bac('0x67')]]);}}}catch(_0x5aa1e2){logger[_0x9bac('0x39')](_0x9bac('0x72'),util[_0x9bac('0x3b')](_0x5aa1e2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bac('0xa')]['syncQueueSummaryComplete']=function(_0x137be2){logger[_0x9bac('0x4a')](_0x9bac('0x73'),util[_0x9bac('0x3b')](_0x137be2,{'showHidden':![],'depth':null}));this[_0x9bac('0x66')]=!![];};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x24c85b){try{if(this[_0x9bac('0x61')](_0x24c85b)){logger[_0x9bac('0x4a')](_0x9bac('0x74'),_0x24c85b[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x24c85b,{'showHidden':![],'depth':null}));if(_[_0x9bac('0x62')](this[_0x9bac('0xd')][_0x24c85b[_0x9bac('0x45')]]))this[_0x9bac('0xd')][_0x24c85b[_0x9bac('0x45')]]=[];if(_[_0x9bac('0x62')](this['channels'][_0x24c85b['uniqueid']]))this[_0x9bac('0x32')][_0x24c85b[_0x9bac('0x45')]]={};var _0x184e92=new QueueReport();_0x184e92['name']=_0x24c85b[_0x9bac('0x67')];_0x184e92[_0x9bac('0x50')]=this[_0x9bac('0xf')][_0x184e92[_0x9bac('0x48')]]&&this[_0x9bac('0xf')][_0x184e92['name']][_0x9bac('0x50')]?this[_0x9bac('0xf')][_0x184e92['name']][_0x9bac('0x50')]||_0x9bac('0x51'):_0x9bac('0x51');_0x184e92[_0x9bac('0x67')]=_0x24c85b[_0x9bac('0x67')];_0x184e92[_0x9bac('0x75')]=moment()[_0x9bac('0x46')](_0x9bac('0x76'));_0x184e92[_0x9bac('0x77')]=_0x24c85b['position'];_0x184e92[_0x9bac('0x78')]=_0x24c85b[_0x9bac('0x78')];_0x184e92[_0x9bac('0x45')]=_0x24c85b[_0x9bac('0x45')];_0x184e92[_0x9bac('0x79')]=this[_0x9bac('0x32')][_0x24c85b[_0x9bac('0x45')]][_0x9bac('0x79')];logger[_0x9bac('0x69')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x184e92[_0x9bac('0x48')],_0x184e92[_0x9bac('0x50')]);_[_0x9bac('0x7a')](_0x184e92,_[_0x9bac('0x7b')](_0x24c85b,_[_0x9bac('0x7c')](_0x184e92)));this[_0x9bac('0xd')][_0x24c85b[_0x9bac('0x45')]][_0x9bac('0x7d')](_0x184e92);this[_0x9bac('0x32')][_0x24c85b[_0x9bac('0x45')]]=_0x184e92;this[_0x9bac('0x42')](_0x184e92,'queuecallerjoin');}}catch(_0x895961){logger[_0x9bac('0x39')](_0x9bac('0x74'),_0x24c85b['uniqueid'],util['inspect'](_0x895961,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bac('0xa')]['syncQueueCallerAbandon']=function(_0x4e83e2){try{if(this[_0x9bac('0x61')](_0x4e83e2)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x4e83e2[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x4e83e2,{'showHidden':![],'depth':null}));if(this[_0x9bac('0xd')][_0x4e83e2[_0x9bac('0x45')]]){var _0x3c7f22=_['last'](this['queueReports'][_0x4e83e2[_0x9bac('0x45')]]);_0x3c7f22[_0x9bac('0x7e')]=![];_0x3c7f22[_0x9bac('0x7f')]=null;_0x3c7f22['holdtime']=_0x4e83e2['holdtime'];_0x3c7f22[_0x9bac('0x80')]=_0x4e83e2[_0x9bac('0x80')];_0x3c7f22['queuecallerabandon']=!![];_0x3c7f22[_0x9bac('0x81')]=moment()[_0x9bac('0x46')](_0x9bac('0x76'));_0x3c7f22[_0x9bac('0x4b')]=_0x9bac('0x82');_0x3c7f22[_0x9bac('0x83')]=null;logger[_0x9bac('0x69')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x3c7f22['name'],_0x3c7f22[_0x9bac('0x50')]);this[_0x9bac('0x32')][_0x4e83e2[_0x9bac('0x45')]]=_0x3c7f22;this[_0x9bac('0x40')](_0x3c7f22,_0x9bac('0x84'));}}}catch(_0x2af6d2){logger[_0x9bac('0x39')](_0x9bac('0x85'),_0x4e83e2[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x2af6d2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bac('0xa')][_0x9bac('0x19')]=function(_0x3430ea){try{if(this[_0x9bac('0x61')](_0x3430ea)){logger[_0x9bac('0x4a')](_0x9bac('0x86'),_0x3430ea[_0x9bac('0x45')],util['inspect'](_0x3430ea,{'showHidden':![],'depth':null}));if(this[_0x9bac('0xd')][_0x3430ea[_0x9bac('0x45')]]){var _0x5e26c5=_[_0x9bac('0x87')](this[_0x9bac('0xd')][_0x3430ea[_0x9bac('0x45')]]);_0x5e26c5[_0x9bac('0x88')]=moment()[_0x9bac('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e26c5[_0x9bac('0x89')]=_0x3430ea['connectedlinenum'];_0x5e26c5['connectedlinename']=_0x3430ea[_0x9bac('0x8a')];logger[_0x9bac('0x69')](_0x9bac('0x8b'),_0x5e26c5[_0x9bac('0x48')],_0x5e26c5[_0x9bac('0x50')],_0x3430ea[_0x9bac('0x89')],_0x3430ea[_0x9bac('0x8a')]);this[_0x9bac('0x32')][_0x3430ea[_0x9bac('0x45')]]=_0x5e26c5;this['emitVoiceQueueChannelSave'](_0x5e26c5,'queuecallerleave');}}}catch(_0x14ebf6){logger['error'](_0x9bac('0x86'),_0x3430ea[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x14ebf6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bac('0xa')][_0x9bac('0x1c')]=function(_0x1ad690){try{if(this['isNotNull'](_0x1ad690)){logger[_0x9bac('0x4a')](_0x9bac('0x8c'),_0x1ad690['uniqueid'],util[_0x9bac('0x3b')](_0x1ad690,{'showHidden':![],'depth':null}));if(this[_0x9bac('0xd')][_0x1ad690[_0x9bac('0x45')]]){var _0x14b83=_['last'](this[_0x9bac('0xd')][_0x1ad690['uniqueid']]);_0x14b83[_0x9bac('0x7e')]=!![];_0x14b83[_0x9bac('0x4b')]=_0x9bac('0x8d');logger[_0x9bac('0x69')](_0x9bac('0x8e'),_0x14b83['name'],_0x14b83[_0x9bac('0x50')]);}}}catch(_0x525022){logger[_0x9bac('0x39')](_0x9bac('0x8c'),_0x1ad690['uniqueid'],util[_0x9bac('0x3b')](_0x525022,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bac('0xa')][_0x9bac('0x8f')]=function(_0x10a5a6){try{if(this[_0x9bac('0x61')](_0x10a5a6)){logger['debug'](_0x9bac('0x90'),_0x10a5a6[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x10a5a6,{'showHidden':![],'depth':null}));if(this[_0x9bac('0xd')][_0x10a5a6[_0x9bac('0x45')]]){var _0x35b323=_[_0x9bac('0x87')](this['queueReports'][_0x10a5a6['uniqueid']]);_0x35b323[_0x9bac('0x84')]=![];_0x35b323[_0x9bac('0x81')]=null;_0x35b323[_0x9bac('0x91')]=!![];_0x35b323[_0x9bac('0x83')]=_0x10a5a6[_0x9bac('0x92')];_0x35b323[_0x9bac('0x93')]=_0x10a5a6[_0x9bac('0x93')];_0x35b323[_0x9bac('0x7e')]=!![];_0x35b323[_0x9bac('0x94')]=![];_0x35b323[_0x9bac('0x95')]=null;if(!_0x35b323[_0x9bac('0x96')]){if(_0x10a5a6[_0x9bac('0x97')]==_0x9bac('0x96')){_0x35b323[_0x9bac('0x4b')]=_0x9bac('0x98');logger[_0x9bac('0x69')](_0x9bac('0x99'),_0x35b323['name'],_0x35b323['type']);}else{if(_['startsWith'](_0x10a5a6[_0x9bac('0x36')]['toLowerCase'](),'local/')){if(this['queueReports'][_0x10a5a6[_0x9bac('0x9a')]]){var _0x11d744=_[_0x9bac('0x87')](this['queueReports'][_0x10a5a6[_0x9bac('0x9a')]]);_0x11d744['queuecallercomplete']=![];_0x11d744[_0x9bac('0x94')]=!![];_0x11d744[_0x9bac('0x95')]=moment(_0x35b323[_0x9bac('0x75')])[_0x9bac('0x9b')](_0x10a5a6[_0x9bac('0x93')],_0x9bac('0x9c'))[_0x9bac('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x11d744[_0x9bac('0x4b')]=_0x9bac('0x9d');_0x11d744[_0x9bac('0x96')]=!![];_0x11d744[_0x9bac('0x9e')]=_0x9bac('0x9f');_0x11d744[_0x9bac('0xa0')]=_0x10a5a6[_0x9bac('0xa1')];_0x11d744[_0x9bac('0xa2')]=_0x10a5a6['uniqueid'];logger['info'](_0x9bac('0xa3'),_0x11d744[_0x9bac('0x48')],_0x11d744['type']);var _0x11f46c=this[_0x9bac('0xd')][_0x10a5a6[_0x9bac('0x9a')]];this['queueReports'][_0x10a5a6['linkedid']]=this[_0x9bac('0xd')][_0x10a5a6[_0x9bac('0x45')]];this[_0x9bac('0xd')][_0x10a5a6['uniqueid']]=_0x11f46c;}}else{_0x35b323[_0x9bac('0x4b')]=_0x9bac('0xa4')+_0x10a5a6[_0x9bac('0x97')][_0x9bac('0xa5')]();logger[_0x9bac('0x69')](_0x9bac('0xa6'),_0x35b323['name'],_0x35b323[_0x9bac('0x50')],_0x35b323[_0x9bac('0x4b')]);}}}this[_0x9bac('0x32')][_0x10a5a6[_0x9bac('0x45')]]=_0x35b323;this['emitVoiceQueueChannelRemove'](_0x35b323,_0x9bac('0x1a'));}}}catch(_0x7a395a){logger['error'](_0x9bac('0x90'),_0x10a5a6['uniqueid'],util[_0x9bac('0x3b')](_0x7a395a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bac('0xa')][_0x9bac('0x1d')]=function(_0x22fcef){try{if(this[_0x9bac('0x61')](_0x22fcef)){logger['debug']('[%s][voiceQueueReport][varset]',_0x22fcef[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x22fcef,{'showHidden':![],'depth':null}));this[_0x9bac('0xa7')](_0x22fcef[_0x9bac('0x45')],_[_0x9bac('0x7c')](_0x22fcef[_0x9bac('0xa8')])[0x0],_0x22fcef[_0x9bac('0xa9')]);if(this['queueReports'][_0x22fcef['uniqueid']]){var _0x38a989=_['last'](this[_0x9bac('0xd')][_0x22fcef[_0x9bac('0x45')]]);if(_0x38a989){if(this[_0x9bac('0x61')](_0x22fcef[_0x9bac('0xa8')])&&this[_0x9bac('0x61')](_0x22fcef[_0x9bac('0xa8')][_0x9bac('0xaa')])){switch(_0x22fcef[_0x9bac('0xa9')]){case'CONTINUE':_0x38a989[_0x9bac('0x94')]=![];_0x38a989['queuecallerexitAt']=null;break;case'TIMEOUT':_0x38a989[_0x9bac('0xab')]=_0x9bac('0xac');_0x38a989[_0x9bac('0x94')]=!![];_0x38a989[_0x9bac('0x95')]=moment()[_0x9bac('0x46')](_0x9bac('0x76'));_0x38a989[_0x9bac('0x88')]=moment()[_0x9bac('0x46')](_0x9bac('0x76'));logger[_0x9bac('0x4a')](_0x9bac('0xad'),_0x22fcef[_0x9bac('0x45')],util['inspect'](_0x38a989,{'showHidden':![],'depth':null}));ami[_0x9bac('0x41')](_0x9bac('0xae'),_0x38a989);break;default:_0x38a989[_0x9bac('0x94')]=!![];_0x38a989[_0x9bac('0x95')]=moment()[_0x9bac('0x46')](_0x9bac('0x76'));_0x38a989[_0x9bac('0x88')]=moment()['format'](_0x9bac('0x76'));}_0x38a989[_0x9bac('0x84')]=![];_0x38a989[_0x9bac('0x81')]=null;_0x38a989[_0x9bac('0x4b')]=_0x22fcef[_0x9bac('0xa9')];this['channels'][_0x22fcef[_0x9bac('0x45')]]=_0x38a989;this[_0x9bac('0x40')](_0x38a989,_0x9bac('0xaf'));}else if(this['isNotNull'](_0x22fcef['variable'])&&this[_0x9bac('0x61')](_0x22fcef[_0x9bac('0xa8')][_0x9bac('0xb0')])){if(!_0x38a989[_0x9bac('0x84')]){_0x38a989[_0x9bac('0x94')]=!![];_0x38a989['queuecallerexitAt']=moment()[_0x9bac('0x46')](_0x9bac('0x76'));_0x38a989['queuecallerexitreason']=_0x9bac('0xb1');_0x38a989['queuecallerleaveAt']=moment()[_0x9bac('0x46')](_0x9bac('0x76'));this[_0x9bac('0x32')][_0x22fcef[_0x9bac('0x45')]]=_0x38a989;}}logger[_0x9bac('0x69')](_0x9bac('0xb2'),_0x22fcef[_0x9bac('0x45')],_0x38a989[_0x9bac('0x48')],_0x38a989['type'],_[_0x9bac('0x7c')](_0x22fcef[_0x9bac('0xa8')])[0x0],_0x22fcef['value']);_0x38a989['variables']=this[_0x9bac('0x11')][_0x22fcef[_0x9bac('0x45')]];}}}}catch(_0x1c2ef7){logger[_0x9bac('0x39')](_0x9bac('0xb3'),_0x22fcef[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x1c2ef7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bac('0xa')]['addVariable']=function(_0x514fc6,_0x965518,_0x5626cb){var _0x5e3fac=[_0x9bac('0xb4'),'rtpaudioqosbridged',_0x9bac('0xb5'),'rtpaudioqosjitterbridged',_0x9bac('0xb6'),'rtpaudioqoslossbridged',_0x9bac('0xb7'),_0x9bac('0xb8'),_0x9bac('0xb9'),_0x9bac('0xba'),_0x9bac('0xbb'),_0x9bac('0xbc'),_0x9bac('0xbd'),_0x9bac('0xbe'),'memberinterface',_0x9bac('0xbf'),_0x9bac('0x92'),_0x9bac('0xc0'),'memberrealtime'];if(!_['isNil'](_0x965518)&&!_[_0x9bac('0xc1')](_0x5e3fac,_0x965518)){if(_[_0x9bac('0x62')](this[_0x9bac('0x11')][_0x514fc6])){this[_0x9bac('0x11')][_0x514fc6]={};}this[_0x9bac('0x11')][_0x514fc6][_0x965518]=_0x5626cb;}};VoiceQueueReport[_0x9bac('0xa')][_0x9bac('0x1f')]=function(_0x552dc6){try{if(this[_0x9bac('0x61')](_0x552dc6)){logger[_0x9bac('0x4a')](_0x9bac('0xc2'),_0x552dc6[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x552dc6,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x552dc6[_0x9bac('0x45')]]){for(var _0x451aa5=0x0,_0xa860e={};_0x451aa5<this[_0x9bac('0xd')][_0x552dc6[_0x9bac('0x45')]]['length'];_0x451aa5+=0x1){_0xa860e=this[_0x9bac('0xd')][_0x552dc6['uniqueid']][_0x451aa5];if(this[_0x9bac('0xf')][_0xa860e[_0x9bac('0x67')]]){if(_0xa860e[_0x9bac('0x94')]&&_0xa860e[_0x9bac('0x96')]!=!![]){this['voiceQueues'][_0xa860e['queue']]['unmanaged']+=0x1;}if(_0xa860e['queuecallerabandon']){this[_0x9bac('0xf')][_0xa860e[_0x9bac('0x67')]][_0x9bac('0x59')]+=0x1;}this['voiceQueues'][_0xa860e[_0x9bac('0x67')]][_0x9bac('0x56')]+=moment(_0xa860e[_0x9bac('0x88')])[_0x9bac('0xc3')](_0xa860e[_0x9bac('0x75')],_0x9bac('0x9c'))||0x0;if(_0x451aa5===this[_0x9bac('0xd')][_0x552dc6[_0x9bac('0x45')]][_0x9bac('0xc4')]-0x1){this[_0x9bac('0xf')][_0xa860e[_0x9bac('0x67')]][_0x9bac('0x55')]+=moment()[_0x9bac('0xc5')](0x0)[_0x9bac('0xc3')](_0xa860e[_0x9bac('0x75')],_0x9bac('0x9c'));this[_0x9bac('0xf')][_0xa860e[_0x9bac('0x67')]][_0x9bac('0x57')]+=0x1;if(_0xa860e[_0x9bac('0x7e')]){this[_0x9bac('0xf')][_0xa860e[_0x9bac('0x67')]][_0x9bac('0xc6')]+=0x1;this[_0x9bac('0xf')][_0xa860e[_0x9bac('0x67')]][_0x9bac('0x54')]+=moment()['milliseconds'](0x0)[_0x9bac('0xc3')](_0xa860e[_0x9bac('0x88')],_0x9bac('0x9c'));_0xa860e[_0x9bac('0x7f')]=moment()[_0x9bac('0x46')](_0x9bac('0x76'));_0xa860e[_0x9bac('0x94')]=![];_0xa860e[_0x9bac('0x95')]=null;}if(_0xa860e[_0x9bac('0x94')]&&_0xa860e['transfer']!=!![]){_0xa860e[_0x9bac('0xab')]=_0x9bac('0x58');logger[_0x9bac('0x4a')](_0x9bac('0xc7'),_0x552dc6[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0xa860e,{'showHidden':![],'depth':null}));ami[_0x9bac('0x41')](_0x9bac('0xc8'),_0xa860e);}if(_0xa860e['queuecallerabandon']){_0xa860e[_0x9bac('0xab')]=_0x9bac('0x59');logger[_0x9bac('0x4a')](_0x9bac('0xc9'),_0x552dc6[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0xa860e,{'showHidden':![],'depth':null}));ami[_0x9bac('0x41')]('custom:queuecallerabandon',_0xa860e);}}else{this['voiceQueues'][_0xa860e['queue']][_0x9bac('0x55')]+=this['voiceQueues'][_0xa860e[_0x9bac('0x67')]][_0x9bac('0x56')];}logger[_0x9bac('0x69')](_0x9bac('0xca'),_0x552dc6[_0x9bac('0x45')],_0xa860e[_0x9bac('0x48')],_0xa860e[_0x9bac('0x50')],_0x552dc6[_0x9bac('0xcb')]);this[_0x9bac('0x32')][_0x552dc6['uniqueid']]=_0xa860e;this[_0x9bac('0x40')](_0xa860e,_0x9bac('0x1e'));this[_0x9bac('0x4f')](this['voiceQueues'][_0xa860e[_0x9bac('0x67')]],_0x9bac('0x1e'));}}logger[_0x9bac('0x4a')](_0x9bac('0xcc'),_0x552dc6['uniqueid'],util['inspect'](this[_0x9bac('0xd')][_0x552dc6[_0x9bac('0x45')]],{'showHidden':![],'depth':null}));ami[_0x9bac('0x41')](_0x9bac('0xcd'),this[_0x9bac('0xd')][_0x552dc6[_0x9bac('0x45')]]);if(_0xa860e['queuecallerexitreason']===_0x9bac('0x4c'))return;delete this['queueReports'][_0x552dc6[_0x9bac('0x45')]];delete this[_0x9bac('0x32')][_0x552dc6[_0x9bac('0x45')]];}if(this[_0x9bac('0x11')][_0x552dc6['uniqueid']]){delete this['variables'][_0x552dc6[_0x9bac('0x45')]];}}}catch(_0x488566){logger['error'](_0x9bac('0xc2'),_0x552dc6[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x488566,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAttendedTransfer']=function(_0x1d0681){try{if(this[_0x9bac('0x61')](_0x1d0681)){logger[_0x9bac('0x4a')](_0x9bac('0xce'),_0x1d0681[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x1d0681,{'showHidden':![],'depth':null}));var _0x30a935;var _0x545492;var _0x22acf1;if(this['queueReports'][_0x1d0681['transfereeuniqueid']]){_0x30a935=_[_0x9bac('0x87')](this[_0x9bac('0xd')][_0x1d0681[_0x9bac('0xcf')]]);_0x30a935[_0x9bac('0xa0')]=_0x1d0681[_0x9bac('0xd0')];_0x30a935['transferuniqueid']=_0x1d0681[_0x9bac('0xd1')];_0x30a935[_0x9bac('0x4b')]=_0x9bac('0x4c');_0x30a935['transfer']=!![];_0x30a935[_0x9bac('0x9e')]='ATTENDED';if(this[_0x9bac('0xd')][_0x1d0681[_0x9bac('0xd1')]]){_0x22acf1=this[_0x9bac('0xd')][_0x1d0681['secondtransfereruniqueid']];this[_0x9bac('0xd')][_0x1d0681['secondtransfereruniqueid']]=this[_0x9bac('0xd')][_0x1d0681['transfereeuniqueid']];this[_0x9bac('0xd')][_0x1d0681[_0x9bac('0xcf')]]=_0x22acf1;_0x545492=_[_0x9bac('0x87')](this[_0x9bac('0xd')][_0x1d0681['transfereeuniqueid']]);_0x545492['switch']=!![];}logger['info'](_0x9bac('0xd2'),_0x1d0681[_0x9bac('0x45')],_0x30a935[_0x9bac('0x48')],_0x30a935[_0x9bac('0x50')],_0x30a935['transferexten'],_0x30a935[_0x9bac('0xa2')]);}else if(this[_0x9bac('0xd')][_0x1d0681[_0x9bac('0xd3')]]){_0x30a935=_[_0x9bac('0x87')](this[_0x9bac('0xd')][_0x1d0681['transfertargetuniqueid']]);_0x30a935[_0x9bac('0xa0')]=_0x1d0681[_0x9bac('0xd4')];_0x30a935[_0x9bac('0xa2')]=_0x1d0681[_0x9bac('0xd5')];_0x30a935[_0x9bac('0x4b')]=_0x9bac('0x4c');_0x30a935[_0x9bac('0x96')]=!![];_0x30a935[_0x9bac('0x9e')]=_0x9bac('0xd6');if(this[_0x9bac('0xd')][_0x1d0681['origtransfereruniqueid']]){_0x22acf1=this[_0x9bac('0xd')][_0x1d0681[_0x9bac('0xd5')]];this[_0x9bac('0xd')][_0x1d0681[_0x9bac('0xd5')]]=this[_0x9bac('0xd')][_0x1d0681[_0x9bac('0xd3')]];this[_0x9bac('0xd')][_0x1d0681[_0x9bac('0xd3')]]=_0x22acf1;_0x545492=_[_0x9bac('0x87')](this['queueReports'][_0x1d0681[_0x9bac('0xd3')]]);_0x545492[_0x9bac('0xd7')]=!![];}logger[_0x9bac('0x69')](_0x9bac('0xd2'),_0x1d0681['uniqueid'],_0x30a935[_0x9bac('0x48')],_0x30a935['type'],_0x30a935[_0x9bac('0xa0')],_0x30a935[_0x9bac('0xa2')]);}else if(this['queueReports'][_0x1d0681[_0x9bac('0xd5')]]){_0x30a935=_[_0x9bac('0x87')](this[_0x9bac('0xd')][_0x1d0681[_0x9bac('0xd5')]]);_0x30a935[_0x9bac('0xa0')]=_0x1d0681[_0x9bac('0xd4')];_0x30a935[_0x9bac('0xa2')]=_0x1d0681['origtransfereruniqueid'];_0x30a935[_0x9bac('0x4b')]=_0x9bac('0x4c');_0x30a935[_0x9bac('0x96')]=!![];_0x30a935[_0x9bac('0x9e')]='ATTENDED';}else if(this[_0x9bac('0xd')][_0x1d0681[_0x9bac('0xd1')]]){_0x30a935=_[_0x9bac('0x87')](this[_0x9bac('0xd')][_0x1d0681[_0x9bac('0xd1')]]);_0x30a935[_0x9bac('0xa0')]=_0x1d0681[_0x9bac('0xd0')];_0x30a935['transferuniqueid']=_0x1d0681[_0x9bac('0xd1')];_0x30a935[_0x9bac('0x4b')]='ATTENDEDTRANSFER';_0x30a935[_0x9bac('0x96')]=!![];_0x30a935[_0x9bac('0x9e')]=_0x9bac('0xd6');}}}catch(_0x2a751b){logger[_0x9bac('0x39')](_0x9bac('0xce'),_0x1d0681['uniqueid'],util[_0x9bac('0x3b')](_0x2a751b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bac('0xa')][_0x9bac('0x28')]=function(_0x15d29e){try{if(this[_0x9bac('0x61')](_0x15d29e)){logger[_0x9bac('0x4a')]('[%s][voiceQueueReport][blindtransfer]',_0x15d29e[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x15d29e,{'showHidden':![],'depth':null}));if(this[_0x9bac('0xd')][_0x15d29e[_0x9bac('0xcf')]]){var _0xb0b9c0=_[_0x9bac('0x87')](this[_0x9bac('0xd')][_0x15d29e['transfereeuniqueid']]);_0xb0b9c0[_0x9bac('0x4b')]='BLINDTRANSFER';_0xb0b9c0[_0x9bac('0x96')]=!![];_0xb0b9c0[_0x9bac('0x9e')]=_0x9bac('0xd8');_0xb0b9c0[_0x9bac('0xa0')]=_0x15d29e['extension'];_0xb0b9c0[_0x9bac('0xa2')]=_0x15d29e[_0x9bac('0xcf')];logger[_0x9bac('0x69')]('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x15d29e['uniqueid'],_0xb0b9c0['name'],_0xb0b9c0[_0x9bac('0x50')],_0xb0b9c0[_0x9bac('0xa0')],_0xb0b9c0[_0x9bac('0xa2')]);this[_0x9bac('0x1f')]({'event':'BlindTransfer','uniqueid':_0x15d29e[_0x9bac('0xcf')],'context':_0x15d29e[_0x9bac('0xd9')],'channel':_0x15d29e[_0x9bac('0xda')]});}}}catch(_0x75d066){logger[_0x9bac('0x39')](_0x9bac('0xdb'),_0x15d29e[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x75d066,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bac('0xa')]['syncMusicOnHoldStart']=function(_0x1b6a7c){try{if(this['isNotNull'](_0x1b6a7c)){logger['debug']('[%s][voiceQueueReport][musiconholdstart]',_0x1b6a7c[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x1b6a7c,{'showHidden':![],'depth':null}));if(this[_0x9bac('0xd')][_0x1b6a7c[_0x9bac('0x45')]]){var _0x3246af=_[_0x9bac('0x87')](this['queueReports'][_0x1b6a7c[_0x9bac('0x45')]]);if(!_[_0x9bac('0x34')](_0x3246af[_0x9bac('0x88')])){_0x3246af[_0x9bac('0xdc')]=moment()[_0x9bac('0x46')](_0x9bac('0x76'));logger[_0x9bac('0x69')](_0x9bac('0xdd'),_0x1b6a7c[_0x9bac('0x45')],_0x3246af['mohstarttime']);}}}}catch(_0x14d0e4){logger[_0x9bac('0x39')]('[%s][voiceQueueReport][musiconholdstart]',_0x1b6a7c[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x14d0e4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bac('0xa')]['syncMusicOnHoldStop']=function(_0x7b6797){try{if(this[_0x9bac('0x61')](_0x7b6797)){logger[_0x9bac('0x4a')]('[%s][voiceQueueReport][musiconholdstop]',_0x7b6797[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x7b6797,{'showHidden':![],'depth':null}));if(this[_0x9bac('0xd')][_0x7b6797[_0x9bac('0x45')]]){var _0x276e24=_[_0x9bac('0x87')](this[_0x9bac('0xd')][_0x7b6797[_0x9bac('0x45')]]);if(!_['isNil'](_0x276e24[_0x9bac('0xdc')])){_0x276e24[_0x9bac('0xde')]+=moment()[_0x9bac('0xc5')](0x0)[_0x9bac('0xc3')](_0x276e24[_0x9bac('0xdc')],_0x9bac('0x9c'));logger[_0x9bac('0x69')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x7b6797['uniqueid'],_0x276e24[_0x9bac('0xde')]);delete _0x276e24[_0x9bac('0xdc')];}}}}catch(_0x202f8c){logger[_0x9bac('0x39')](_0x9bac('0xdf'),_0x7b6797[_0x9bac('0x45')],util['inspect'](_0x202f8c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9bac('0xa')]['syncNewExten']=function(_0x42a26b){try{if(this['isNotNull'](_0x42a26b)){logger[_0x9bac('0x4a')](_0x9bac('0xe0'),_0x42a26b[_0x9bac('0x45')],util['inspect'](_0x42a26b,{'showHidden':![],'depth':null}));if(_0x42a26b[_0x9bac('0xe1')][_0x9bac('0xe2')]()===_0x9bac('0xe3')){_0x42a26b[_0x9bac('0xe4')]=_0x42a26b[_0x9bac('0xe5')]&&_0x42a26b[_0x9bac('0xe5')]['startsWith'](_0x9bac('0xe6'))?_0x42a26b['appdata']:(_0x42a26b[_0x9bac('0xe5')]||_0x42a26b['applicationdata'])[_0x9bac('0xe2')]();if(_[_0x9bac('0xe7')](_0x42a26b['applicationdata']['toLowerCase'](),_0x9bac('0xe8'))){logger[_0x9bac('0x69')](_0x9bac('0xe9'),_0x42a26b[_0x9bac('0x45')],_0x42a26b[_0x9bac('0xe1')],_0x42a26b[_0x9bac('0xe4')]);if(_[_0x9bac('0x62')](this[_0x9bac('0x32')][_0x42a26b[_0x9bac('0x45')]]))this['channels'][_0x42a26b[_0x9bac('0x45')]]={};var _0x67d026=_0x42a26b[_0x9bac('0xe4')][_0x9bac('0xea')]('=');var _0x11f224=_0x67d026[0x0][_0x9bac('0xe2')]()[_0x9bac('0xeb')](/cdr\((.*)\)/);if(_0x11f224)this[_0x9bac('0x32')][_0x42a26b[_0x9bac('0x45')]][_0x11f224[0x1]]=_0x67d026[0x1];}}}}catch(_0x3e4fd8){logger[_0x9bac('0x39')](_0x9bac('0xec'),_0x42a26b[_0x9bac('0x45')],util[_0x9bac('0x3b')](_0x3e4fd8,{'showHidden':![],'depth':null}));}};module[_0x9bac('0xed')]=VoiceQueueReport;
\ No newline at end of file
+var _0x2305=['uniqueid','format','voice:queue:%s','name',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','total','type','abandoned','waiting','Trunk','callerid','Interval','stringify','debug','voice_queue:save','isNotNull','isUndefined','flagQueueSummary','queue','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','toNumber','callers','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','inbound','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','pick','keys','push','queuecallerjoin','[%s][voiceQueueReport][queuecallerabandon]','last','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','COMPLETEDBYAGENT','assigned','membername','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexit','queuecallerjoinAt','seconds','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','varset','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','diff','length','milliseconds','queuecallercompleteAt','lastevent','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','ATTENDED','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transferexten','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','syncBlindTransfer','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','md5','ioredis','../../../config/environment','ami','../ami','../model/queueReport','redis','prototype','tail','finally','sequence','queueReports','channels','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','syncVarSet','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','queueStatusComplete','unlockRR','switch','enqueue','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','agents','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:'];(function(_0x2b9f34,_0x2775b3){var _0x5597e1=function(_0x263e4e){while(--_0x263e4e){_0x2b9f34['push'](_0x2b9f34['shift']());}};_0x5597e1(++_0x2775b3);}(_0x2305,0x18f));var _0x5230=function(_0x58fbb0,_0xe497b5){_0x58fbb0=_0x58fbb0-0x0;var _0x1783d2=_0x2305[_0x58fbb0];return _0x1783d2;};'use strict';var _=require(_0x5230('0x0'));var moment=require(_0x5230('0x1'));var util=require(_0x5230('0x2'));var md5=require(_0x5230('0x3'));var Redis=require(_0x5230('0x4'));var config=require(_0x5230('0x5'));var logger=require('../../../config/logger')(_0x5230('0x6'));var ami=require(_0x5230('0x7'));var QueueReport=require(_0x5230('0x8'));config[_0x5230('0x9')]=_['defaults'](config[_0x5230('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5230('0x9')]));var Sequence=function(){};Sequence[_0x5230('0xa')]['enqueue']=function(_0x172eaa){this[_0x5230('0xb')]=this[_0x5230('0xb')]?this[_0x5230('0xb')][_0x5230('0xc')](_0x172eaa):_0x172eaa();};function VoiceQueueReport(_0x1f21e4){this[_0x5230('0xd')]=new Sequence();this[_0x5230('0xe')]={};this['agents']=_0x1f21e4['agents'];this[_0x5230('0xf')]=_0x1f21e4[_0x5230('0x10')];this['voiceQueues']=_0x1f21e4[_0x5230('0x11')];this['flagQueueSummary']=!![];this['campaigns']=_0x1f21e4[_0x5230('0x12')];this[_0x5230('0x13')]={};ami['on'](_0x5230('0x14'),this[_0x5230('0x15')][_0x5230('0x16')](this));ami['on'](_0x5230('0x17'),this[_0x5230('0x18')]['bind'](this));ami['on']('queuecallerjoin',this[_0x5230('0x19')][_0x5230('0x16')](this));ami['on'](_0x5230('0x1a'),this[_0x5230('0x1b')][_0x5230('0x16')](this));ami['on']('queuecallerleave',this[_0x5230('0x1c')][_0x5230('0x16')](this));ami['on'](_0x5230('0x1d'),this[_0x5230('0x1e')]['bind'](this));ami['on'](_0x5230('0x1f'),this[_0x5230('0x20')]['bind'](this));ami['on']('varset',this[_0x5230('0x21')][_0x5230('0x16')](this));ami['on']('hangup',this[_0x5230('0x22')][_0x5230('0x16')](this));ami['on'](_0x5230('0x23'),this[_0x5230('0x24')]['bind'](this));ami['on'](_0x5230('0x25'),this[_0x5230('0x26')][_0x5230('0x16')](this));ami['on'](_0x5230('0x27'),this['syncMusicOnHoldStop']['bind'](this));ami['on'](_0x5230('0x28'),this[_0x5230('0x29')][_0x5230('0x16')](this));ami['on'](_0x5230('0x2a'),this['syncBlindTransfer'][_0x5230('0x16')](this));this[_0x5230('0x2b')]();this[_0x5230('0x2c')]();}function clearChannels(_0x5a1791){if(!_['isEmpty'](_0x5a1791)){for(var _0x9641e9 in _0x5a1791){if(_0x5a1791['hasOwnProperty'](_0x9641e9)){delete _0x5a1791[_0x9641e9];}}}}function clearCampaigns(_0x1973d3){if(!_[_0x5230('0x2d')](_0x1973d3)){for(var _0x309a06 in _0x1973d3){if(_0x1973d3[_0x5230('0x2e')](_0x309a06)){_0x1973d3[_0x309a06][_0x5230('0x2f')]=0x0;}}}}function clearVoiceQueues(_0xdf7830){if(!_[_0x5230('0x2d')](_0xdf7830)){for(var _0x175ca4 in _0xdf7830){if(_0xdf7830[_0x5230('0x2e')](_0x175ca4)){_0xdf7830[_0x175ca4][_0x5230('0x2f')]=0x0;_0xdf7830[_0x175ca4][_0x5230('0x30')]=0x0;_0xdf7830[_0x175ca4][_0x5230('0x31')]=0x0;_0xdf7830[_0x175ca4]['waiting']=0x0;_0xdf7830[_0x175ca4][_0x5230('0x32')]=!![];}}}}function clearAgentBooked(_0x112b59){if(!_[_0x5230('0x2d')](_0x112b59)){for(var _0x2a0e3b in _0x112b59){if(_0x112b59[_0x5230('0x2e')](_0x2a0e3b)){_0x112b59[_0x2a0e3b][_0x5230('0x33')]=!![];}}}}VoiceQueueReport[_0x5230('0xa')]['clearZombieChannels']=function(){var _0x3416ac=this;for(var _0x1faf79 in this[_0x5230('0xf')]){if(this[_0x5230('0xf')][_0x5230('0x2e')](_0x1faf79)&&!this[_0x5230('0xf')][_0x1faf79][_0x5230('0x34')]){this['sequence'][_0x5230('0x35')](function(){if(!_[_0x5230('0x36')](_0x3416ac[_0x5230('0xf')][_0x1faf79])){return ami[_0x5230('0x37')]({'action':_0x5230('0x38'),'channel':_0x3416ac[_0x5230('0xf')][_0x1faf79][_0x5230('0x39')]})[_0x5230('0x3a')](function(_0x43b003){if(_0x43b003[_0x5230('0x3b')]===_0x5230('0x3c')){setTimeout(function(){if(_0x3416ac['channels'][_0x1faf79]){delete _0x3416ac[_0x5230('0xf')][_0x1faf79];logger[_0x5230('0x3d')](_0x5230('0x3e'),_0x1faf79,util[_0x5230('0x3f')](_0x43b003,{'showHidden':![],'depth':null}));}if(_0x3416ac[_0x5230('0xe')][_0x1faf79]){delete _0x3416ac['queueReports'][_0x1faf79];logger[_0x5230('0x3d')](_0x5230('0x40'),_0x1faf79,util[_0x5230('0x3f')](_0x43b003,{'showHidden':![],'depth':null}));}if(_0x3416ac['variables'][_0x1faf79]){delete _0x3416ac['variables'][_0x1faf79];logger[_0x5230('0x3d')]('[%s][voiceQueueReport][checkVariables]',_0x1faf79,util['inspect'](_0x43b003,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x24')]=function(){logger[_0x5230('0x3d')](_0x5230('0x41'));clearChannels(this[_0x5230('0xf')]);this[_0x5230('0x42')](this['queueReports']);clearAgentBooked(this[_0x5230('0x43')]);clearVoiceQueues(this[_0x5230('0x11')]);clearCampaigns(this[_0x5230('0x12')]);};VoiceQueueReport['prototype'][_0x5230('0x42')]=function(_0x7273a8){var _0x4ec078=this;if(!_[_0x5230('0x2d')](_0x7273a8)){for(var _0x248aa7 in _0x7273a8){if(_0x7273a8[_0x5230('0x2e')](_0x248aa7)){_0x4ec078[_0x5230('0x44')](_0x7273a8[_0x248aa7],'clearqueuereport');delete _0x7273a8[_0x248aa7];}}}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x45')]=function(_0x40ad08,_0x14404f,_0x3970b9){io['to'](_0x40ad08)[_0x5230('0x45')](_0x14404f,_0x3970b9);};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x46')]=function(_0x1f2ff4,_0x421252){logger['debug'](_0x5230('0x47')+_0x421252+_0x5230('0x48'),_0x1f2ff4[_0x5230('0x49')],util[_0x5230('0x3f')](_0x1f2ff4,{'showHidden':![],'depth':null}));this[_0x5230('0x45')](util[_0x5230('0x4a')](_0x5230('0x4b'),_0x1f2ff4[_0x5230('0x4c')]),'voice_queue_channel:save',_0x1f2ff4);io[_0x5230('0x45')]('voice_queue_presence:save',_0x1f2ff4);};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x44')]=function(_0x59d6fb,_0x12be06){logger['debug'](_0x5230('0x47')+_0x12be06+_0x5230('0x4d'),_0x59d6fb['uniqueid'],util['inspect'](_0x59d6fb,{'showHidden':![],'depth':null}));if(_0x59d6fb[_0x5230('0x4e')]===_0x5230('0x4f'))return;this[_0x5230('0x45')](util[_0x5230('0x4a')](_0x5230('0x4b'),_0x59d6fb[_0x5230('0x4c')]),_0x5230('0x50'),_0x59d6fb);io[_0x5230('0x45')](_0x5230('0x51'),_0x59d6fb);};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x52')]=function(_0x1df44c,_0x20d3d2){if(_0x1df44c['type']==='inbound'){var _0x49e3ab={'id':_0x1df44c['id'],'name':_0x1df44c['name'],'strategy':_0x1df44c[_0x5230('0x53')],'answered':_0x1df44c[_0x5230('0x54')],'available':_0x1df44c[_0x5230('0x55')],'loggedIn':_0x1df44c[_0x5230('0x56')],'pTalking':_0x1df44c['pTalking'],'sumBillable':_0x1df44c['sumBillable'],'sumDuration':_0x1df44c[_0x5230('0x57')],'sumHoldTime':_0x1df44c[_0x5230('0x58')]||0x0,'talking':_0x1df44c[_0x5230('0x30')],'total':_0x1df44c[_0x5230('0x59')],'type':_0x1df44c[_0x5230('0x5a')],'unmanaged':_0x1df44c['unmanaged'],'abandoned':_0x1df44c[_0x5230('0x5b')],'waiting':_0x1df44c[_0x5230('0x5c')]};if(_0x1df44c[_0x5230('0x5d')]){_0x49e3ab['Trunk']={'id':_0x1df44c[_0x5230('0x5d')]['id'],'name':_0x1df44c[_0x5230('0x5d')][_0x5230('0x4c')],'active':_0x1df44c[_0x5230('0x5d')]['active'],'callerid':_0x1df44c['Trunk'][_0x5230('0x5e')]};}if(_0x1df44c[_0x5230('0x5f')]){_0x49e3ab[_0x5230('0x5f')]={'id':_0x1df44c[_0x5230('0x5f')]['id'],'name':_0x1df44c[_0x5230('0x5f')][_0x5230('0x4c')]};}var _0x1ac544=md5(JSON[_0x5230('0x60')](_0x49e3ab));if(_0x1df44c[_0x5230('0x3')]!==_0x1ac544){_0x1df44c['md5']=_0x1ac544;logger[_0x5230('0x61')]('[voiceQueueReport]['+_0x20d3d2+']\x20sending\x20voice_queue:save\x20event:',util['inspect'](_0x49e3ab,{'showHidden':![],'depth':null}));this[_0x5230('0x45')](util[_0x5230('0x4a')](_0x5230('0x4b'),_0x49e3ab[_0x5230('0x4c')]),_0x5230('0x62'),_0x49e3ab);}}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x63')]=function(_0x513e76){return _0x513e76!==null&&!_[_0x5230('0x64')](_0x513e76);};VoiceQueueReport['prototype'][_0x5230('0x2c')]=function(){var _0xbea9de=this;setInterval(function(){_0xbea9de['clearZombieChannels']();ami['Action']({'action':'queues'})[_0x5230('0x3a')](function(_0xf88f80){logger[_0x5230('0x3d')]('[voiceQueueReport][queues]',util[_0x5230('0x3f')](_0xf88f80,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x2b')]=function(){var _0x1017ad=this;setInterval(function(){if(_0x1017ad[_0x5230('0x65')]){return ami[_0x5230('0x37')]({'action':_0x5230('0x14')})['then'](function(){_0x1017ad[_0x5230('0x65')]=![];})['catch'](function(_0x5ad252){logger[_0x5230('0x3d')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x5ad252,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0x5230('0x15')]=function(_0x1736ac){try{if(this['isNotNull'](_0x1736ac)&&this[_0x5230('0x63')](_0x1736ac[_0x5230('0x66')])){logger['debug'](_0x5230('0x67'),util[_0x5230('0x3f')](_0x1736ac,{'showHidden':![],'depth':null}));if(this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]]){logger['info'](_0x5230('0x68'),_0x1736ac[_0x5230('0x66')]);var _0x2cff71=_['countBy'](this['channels'],'queue')[_0x1736ac[_0x5230('0x66')]]||0x0;var _0xb83ca2=_0x2cff71-_0x1736ac['callers'];if(this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]]['waiting']!==_[_0x5230('0x69')](_0x1736ac[_0x5230('0x6a')])||this[_0x5230('0x11')][_0x1736ac['queue']][_0x5230('0x56')]!==_[_0x5230('0x69')](_0x1736ac[_0x5230('0x6b')])||this['voiceQueues'][_0x1736ac['queue']][_0x5230('0x55')]!==_[_0x5230('0x69')](_0x1736ac[_0x5230('0x55')])||this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]][_0x5230('0x30')]!==_0xb83ca2){this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]]['waiting']=_[_0x5230('0x69')](_0x1736ac[_0x5230('0x6a')]);this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]][_0x5230('0x56')]=_[_0x5230('0x69')](_0x1736ac[_0x5230('0x6b')]);this[_0x5230('0x11')][_0x1736ac['queue']]['available']=_[_0x5230('0x69')](_0x1736ac[_0x5230('0x55')]);this['voiceQueues'][_0x1736ac[_0x5230('0x66')]][_0x5230('0x30')]=_0xb83ca2>0x0?_0xb83ca2:0x0;this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]][_0x5230('0x30')]=this[_0x5230('0x11')][_0x1736ac['queue']][_0x5230('0x30')]>_['toNumber'](_0x1736ac[_0x5230('0x6b')])?_[_0x5230('0x69')](_0x1736ac['loggedin']):this['voiceQueues'][_0x1736ac[_0x5230('0x66')]][_0x5230('0x30')];this[_0x5230('0x52')](this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]],'queuesummary');}logger[_0x5230('0x61')](_0x5230('0x6c'),util[_0x5230('0x3f')](this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]],{'showHidden':![],'depth':null}));ami[_0x5230('0x45')](_0x5230('0x6d'),this[_0x5230('0x11')][_0x1736ac['queue']]);}}}catch(_0x5146e5){logger[_0x5230('0x3d')](_0x5230('0x6e'),util[_0x5230('0x3f')](_0x5146e5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x18')]=function(_0x44c9fb){logger[_0x5230('0x61')](_0x5230('0x6f'),util['inspect'](_0x44c9fb,{'showHidden':![],'depth':null}));this[_0x5230('0x65')]=!![];};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x19')]=function(_0xf48d03){try{if(this[_0x5230('0x63')](_0xf48d03)){logger[_0x5230('0x61')](_0x5230('0x70'),_0xf48d03['uniqueid'],util['inspect'](_0xf48d03,{'showHidden':![],'depth':null}));if(_[_0x5230('0x64')](this[_0x5230('0xe')][_0xf48d03[_0x5230('0x49')]]))this[_0x5230('0xe')][_0xf48d03[_0x5230('0x49')]]=[];if(_[_0x5230('0x64')](this[_0x5230('0xf')][_0xf48d03[_0x5230('0x49')]]))this['channels'][_0xf48d03[_0x5230('0x49')]]={};var _0x5e66b6=new QueueReport();_0x5e66b6[_0x5230('0x4c')]=_0xf48d03[_0x5230('0x66')];_0x5e66b6[_0x5230('0x5a')]=this['voiceQueues'][_0x5e66b6[_0x5230('0x4c')]]&&this['voiceQueues'][_0x5e66b6[_0x5230('0x4c')]]['type']?this[_0x5230('0x11')][_0x5e66b6[_0x5230('0x4c')]]['type']||_0x5230('0x71'):_0x5230('0x71');_0x5e66b6['queue']=_0xf48d03[_0x5230('0x66')];_0x5e66b6['queuecallerjoinAt']=moment()['format'](_0x5230('0x72'));_0x5e66b6['position']=_0xf48d03[_0x5230('0x73')];_0x5e66b6[_0x5230('0x74')]=_0xf48d03[_0x5230('0x74')];_0x5e66b6[_0x5230('0x49')]=_0xf48d03[_0x5230('0x49')];_0x5e66b6[_0x5230('0x75')]=this[_0x5230('0xf')][_0xf48d03[_0x5230('0x49')]][_0x5230('0x75')];logger[_0x5230('0x76')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x5e66b6[_0x5230('0x4c')],_0x5e66b6[_0x5230('0x5a')]);_['merge'](_0x5e66b6,_[_0x5230('0x77')](_0xf48d03,_[_0x5230('0x78')](_0x5e66b6)));this[_0x5230('0xe')][_0xf48d03[_0x5230('0x49')]][_0x5230('0x79')](_0x5e66b6);this[_0x5230('0xf')][_0xf48d03['uniqueid']]=_0x5e66b6;this['emitVoiceQueueChannelSave'](_0x5e66b6,_0x5230('0x7a'));}}catch(_0x59e226){logger[_0x5230('0x3d')]('[%s][voiceQueueReport][queuecallerjoin]',_0xf48d03[_0x5230('0x49')],util['inspect'](_0x59e226,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5230('0x1b')]=function(_0xa19b9c){try{if(this['isNotNull'](_0xa19b9c)){logger[_0x5230('0x61')](_0x5230('0x7b'),_0xa19b9c[_0x5230('0x49')],util['inspect'](_0xa19b9c,{'showHidden':![],'depth':null}));if(this[_0x5230('0xe')][_0xa19b9c[_0x5230('0x49')]]){var _0x274fcf=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0xa19b9c[_0x5230('0x49')]]);_0x274fcf['queuecallercomplete']=![];_0x274fcf['queuecallercompleteAt']=null;_0x274fcf[_0x5230('0x7d')]=_0xa19b9c[_0x5230('0x7d')];_0x274fcf['originalposition']=_0xa19b9c[_0x5230('0x7e')];_0x274fcf[_0x5230('0x1a')]=!![];_0x274fcf[_0x5230('0x7f')]=moment()[_0x5230('0x4a')](_0x5230('0x72'));_0x274fcf[_0x5230('0x4e')]=_0x5230('0x80');_0x274fcf[_0x5230('0x81')]=null;logger[_0x5230('0x76')](_0x5230('0x82'),_0x274fcf[_0x5230('0x4c')],_0x274fcf[_0x5230('0x5a')]);this[_0x5230('0xf')][_0xa19b9c['uniqueid']]=_0x274fcf;this['emitVoiceQueueChannelRemove'](_0x274fcf,'queuecallerabandon');}}}catch(_0x289555){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0xa19b9c[_0x5230('0x49')],util['inspect'](_0x289555,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')]['syncQueueCallerLeave']=function(_0x2d7932){try{if(this[_0x5230('0x63')](_0x2d7932)){logger[_0x5230('0x61')](_0x5230('0x83'),_0x2d7932[_0x5230('0x49')],util[_0x5230('0x3f')](_0x2d7932,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2d7932[_0x5230('0x49')]]){var _0x8a8e49=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x2d7932[_0x5230('0x49')]]);_0x8a8e49[_0x5230('0x84')]=moment()[_0x5230('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x8a8e49[_0x5230('0x85')]=_0x2d7932[_0x5230('0x85')];_0x8a8e49[_0x5230('0x86')]=_0x2d7932['connectedlinename'];logger[_0x5230('0x76')](_0x5230('0x87'),_0x8a8e49['name'],_0x8a8e49['type'],_0x2d7932[_0x5230('0x85')],_0x2d7932['connectedlinename']);this[_0x5230('0xf')][_0x2d7932['uniqueid']]=_0x8a8e49;this[_0x5230('0x46')](_0x8a8e49,'queuecallerleave');}}}catch(_0x37cb5e){logger[_0x5230('0x3d')](_0x5230('0x83'),_0x2d7932[_0x5230('0x49')],util[_0x5230('0x3f')](_0x37cb5e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x20')]=function(_0x37332e){try{if(this['isNotNull'](_0x37332e)){logger[_0x5230('0x61')](_0x5230('0x88'),_0x37332e['uniqueid'],util['inspect'](_0x37332e,{'showHidden':![],'depth':null}));if(this[_0x5230('0xe')][_0x37332e[_0x5230('0x49')]]){var _0x40be96=_['last'](this['queueReports'][_0x37332e['uniqueid']]);_0x40be96[_0x5230('0x89')]=!![];_0x40be96[_0x5230('0x4e')]=_0x5230('0x8a');logger[_0x5230('0x76')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x40be96[_0x5230('0x4c')],_0x40be96[_0x5230('0x5a')]);}}}catch(_0xdb5d96){logger[_0x5230('0x3d')](_0x5230('0x88'),_0x37332e['uniqueid'],util['inspect'](_0xdb5d96,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5230('0x1e')]=function(_0x465e4f){try{if(this[_0x5230('0x63')](_0x465e4f)){logger[_0x5230('0x61')]('[%s][voiceQueueReport][agentcomplete]',_0x465e4f[_0x5230('0x49')],util['inspect'](_0x465e4f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x465e4f[_0x5230('0x49')]]){var _0x184a50=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x465e4f[_0x5230('0x49')]]);_0x184a50['queuecallerabandon']=![];_0x184a50[_0x5230('0x7f')]=null;_0x184a50[_0x5230('0x8b')]=!![];_0x184a50[_0x5230('0x81')]=_0x465e4f[_0x5230('0x8c')];_0x184a50[_0x5230('0x7d')]=_0x465e4f[_0x5230('0x7d')];_0x184a50[_0x5230('0x89')]=!![];_0x184a50['queuecallerexit']=![];_0x184a50[_0x5230('0x8d')]=null;if(!_0x184a50[_0x5230('0x8e')]){if(_0x465e4f[_0x5230('0x8f')]=='transfer'){_0x184a50[_0x5230('0x4e')]='COMPLETED';logger[_0x5230('0x76')](_0x5230('0x90'),_0x184a50[_0x5230('0x4c')],_0x184a50['type']);}else{if(_[_0x5230('0x91')](_0x465e4f[_0x5230('0x39')][_0x5230('0x92')](),_0x5230('0x93'))){if(this[_0x5230('0xe')][_0x465e4f[_0x5230('0x94')]]){var _0x7b8266=_[_0x5230('0x7c')](this['queueReports'][_0x465e4f[_0x5230('0x94')]]);_0x7b8266[_0x5230('0x89')]=![];_0x7b8266[_0x5230('0x95')]=!![];_0x7b8266['queuecallerexitAt']=moment(_0x184a50[_0x5230('0x96')])['add'](_0x465e4f['holdtime'],_0x5230('0x97'))['format'](_0x5230('0x72'));_0x7b8266[_0x5230('0x4e')]=_0x5230('0x98');_0x7b8266[_0x5230('0x8e')]=!![];_0x7b8266[_0x5230('0x99')]=_0x5230('0x9a');_0x7b8266['transferexten']=_0x465e4f[_0x5230('0x9b')];_0x7b8266[_0x5230('0x9c')]=_0x465e4f[_0x5230('0x49')];logger[_0x5230('0x76')](_0x5230('0x9d'),_0x7b8266[_0x5230('0x4c')],_0x7b8266[_0x5230('0x5a')]);var _0x5634e8=this[_0x5230('0xe')][_0x465e4f[_0x5230('0x94')]];this[_0x5230('0xe')][_0x465e4f[_0x5230('0x94')]]=this[_0x5230('0xe')][_0x465e4f[_0x5230('0x49')]];this[_0x5230('0xe')][_0x465e4f[_0x5230('0x49')]]=_0x5634e8;}}else{_0x184a50[_0x5230('0x4e')]=_0x5230('0x9e')+_0x465e4f[_0x5230('0x8f')][_0x5230('0x9f')]();logger[_0x5230('0x76')](_0x5230('0xa0'),_0x184a50['name'],_0x184a50['type'],_0x184a50[_0x5230('0x4e')]);}}}this[_0x5230('0xf')][_0x465e4f[_0x5230('0x49')]]=_0x184a50;this[_0x5230('0x44')](_0x184a50,'agentcomplete');}}}catch(_0xf9a97d){logger[_0x5230('0x3d')]('[%s][voiceQueueReport][agentcomplete]',_0x465e4f[_0x5230('0x49')],util[_0x5230('0x3f')](_0xf9a97d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')]['syncVarSet']=function(_0x53cbf6){try{if(this['isNotNull'](_0x53cbf6)){logger[_0x5230('0x61')](_0x5230('0xa1'),_0x53cbf6[_0x5230('0x49')],util[_0x5230('0x3f')](_0x53cbf6,{'showHidden':![],'depth':null}));this[_0x5230('0xa2')](_0x53cbf6[_0x5230('0x49')],_['keys'](_0x53cbf6[_0x5230('0xa3')])[0x0],_0x53cbf6[_0x5230('0xa4')]);if(this[_0x5230('0xe')][_0x53cbf6[_0x5230('0x49')]]){var _0x500f03=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x53cbf6[_0x5230('0x49')]]);if(_0x500f03){if(this[_0x5230('0x63')](_0x53cbf6[_0x5230('0xa3')])&&this['isNotNull'](_0x53cbf6[_0x5230('0xa3')][_0x5230('0xa5')])){switch(_0x53cbf6[_0x5230('0xa4')]){case _0x5230('0xa6'):_0x500f03[_0x5230('0x95')]=![];_0x500f03[_0x5230('0x8d')]=null;break;case _0x5230('0xa7'):_0x500f03['lastevent']=_0x5230('0xa8');_0x500f03[_0x5230('0x95')]=!![];_0x500f03['queuecallerexitAt']=moment()[_0x5230('0x4a')](_0x5230('0x72'));_0x500f03[_0x5230('0x84')]=moment()[_0x5230('0x4a')](_0x5230('0x72'));logger[_0x5230('0x61')](_0x5230('0xa9'),_0x53cbf6[_0x5230('0x49')],util['inspect'](_0x500f03,{'showHidden':![],'depth':null}));ami['emit'](_0x5230('0xaa'),_0x500f03);break;default:_0x500f03[_0x5230('0x95')]=!![];_0x500f03['queuecallerexitAt']=moment()['format'](_0x5230('0x72'));_0x500f03[_0x5230('0x84')]=moment()[_0x5230('0x4a')](_0x5230('0x72'));}_0x500f03['queuecallerabandon']=![];_0x500f03[_0x5230('0x7f')]=null;_0x500f03[_0x5230('0x4e')]=_0x53cbf6['value'];this['channels'][_0x53cbf6[_0x5230('0x49')]]=_0x500f03;this[_0x5230('0x44')](_0x500f03,_0x5230('0xab'));}else if(this['isNotNull'](_0x53cbf6['variable'])&&this[_0x5230('0x63')](_0x53cbf6[_0x5230('0xa3')][_0x5230('0xac')])){if(!_0x500f03['queuecallerabandon']){_0x500f03[_0x5230('0x95')]=!![];_0x500f03[_0x5230('0x8d')]=moment()[_0x5230('0x4a')](_0x5230('0x72'));_0x500f03[_0x5230('0x4e')]=_0x5230('0xad');_0x500f03[_0x5230('0x84')]=moment()[_0x5230('0x4a')](_0x5230('0x72'));this[_0x5230('0xf')][_0x53cbf6[_0x5230('0x49')]]=_0x500f03;}}logger[_0x5230('0x76')](_0x5230('0xae'),_0x53cbf6[_0x5230('0x49')],_0x500f03[_0x5230('0x4c')],_0x500f03[_0x5230('0x5a')],_['keys'](_0x53cbf6[_0x5230('0xa3')])[0x0],_0x53cbf6[_0x5230('0xa4')]);_0x500f03[_0x5230('0x13')]=this[_0x5230('0x13')][_0x53cbf6[_0x5230('0x49')]];}}}}catch(_0x124377){logger[_0x5230('0x3d')](_0x5230('0xa1'),_0x53cbf6[_0x5230('0x49')],util[_0x5230('0x3f')](_0x124377,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0xa2')]=function(_0x20f5aa,_0x1f61fe,_0x5170ca){var _0x345f64=[_0x5230('0xaf'),'rtpaudioqosbridged',_0x5230('0xb0'),'rtpaudioqosjitterbridged',_0x5230('0xb1'),_0x5230('0xb2'),'rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri',_0x5230('0xb3'),'bridgepvtcallid',_0x5230('0xb4'),_0x5230('0xb5'),_0x5230('0xb6'),_0x5230('0xb7'),_0x5230('0x8c'),_0x5230('0xb8'),_0x5230('0xb9')];if(!_[_0x5230('0x36')](_0x1f61fe)&&!_[_0x5230('0xba')](_0x345f64,_0x1f61fe)){if(_['isUndefined'](this[_0x5230('0x13')][_0x20f5aa])){this[_0x5230('0x13')][_0x20f5aa]={};}this[_0x5230('0x13')][_0x20f5aa][_0x1f61fe]=_0x5170ca;}};VoiceQueueReport['prototype'][_0x5230('0x22')]=function(_0x54f770){try{if(this[_0x5230('0x63')](_0x54f770)){logger[_0x5230('0x61')]('[%s][voiceQueueReport][hangup]',_0x54f770['uniqueid'],util['inspect'](_0x54f770,{'showHidden':![],'depth':null}));if(this[_0x5230('0xe')][_0x54f770['uniqueid']]){for(var _0x57f0d7=0x0,_0x4bda8c={};_0x57f0d7<this[_0x5230('0xe')][_0x54f770[_0x5230('0x49')]]['length'];_0x57f0d7+=0x1){_0x4bda8c=this[_0x5230('0xe')][_0x54f770[_0x5230('0x49')]][_0x57f0d7];if(this[_0x5230('0x11')][_0x4bda8c['queue']]){if(_0x4bda8c[_0x5230('0x95')]&&_0x4bda8c[_0x5230('0x8e')]!=!![]){this[_0x5230('0x11')][_0x4bda8c[_0x5230('0x66')]]['unmanaged']+=0x1;}if(_0x4bda8c[_0x5230('0x1a')]){this[_0x5230('0x11')][_0x4bda8c['queue']]['abandoned']+=0x1;}this[_0x5230('0x11')][_0x4bda8c[_0x5230('0x66')]][_0x5230('0x58')]+=moment(_0x4bda8c[_0x5230('0x84')])[_0x5230('0xbb')](_0x4bda8c['queuecallerjoinAt'],'seconds')||0x0;if(_0x57f0d7===this[_0x5230('0xe')][_0x54f770['uniqueid']][_0x5230('0xbc')]-0x1){this['voiceQueues'][_0x4bda8c[_0x5230('0x66')]][_0x5230('0x57')]+=moment()[_0x5230('0xbd')](0x0)[_0x5230('0xbb')](_0x4bda8c[_0x5230('0x96')],_0x5230('0x97'));this['voiceQueues'][_0x4bda8c['queue']][_0x5230('0x59')]+=0x1;if(_0x4bda8c[_0x5230('0x89')]){this[_0x5230('0x11')][_0x4bda8c[_0x5230('0x66')]][_0x5230('0x54')]+=0x1;this[_0x5230('0x11')][_0x4bda8c[_0x5230('0x66')]]['sumBillable']+=moment()[_0x5230('0xbd')](0x0)['diff'](_0x4bda8c[_0x5230('0x84')],'seconds');_0x4bda8c[_0x5230('0xbe')]=moment()[_0x5230('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x4bda8c[_0x5230('0x95')]=![];_0x4bda8c[_0x5230('0x8d')]=null;}if(_0x4bda8c[_0x5230('0x95')]&&_0x4bda8c[_0x5230('0x8e')]!=!![]){_0x4bda8c[_0x5230('0xbf')]=_0x5230('0xc0');logger['debug'](_0x5230('0xc1'),_0x54f770[_0x5230('0x49')],util[_0x5230('0x3f')](_0x4bda8c,{'showHidden':![],'depth':null}));ami[_0x5230('0x45')]('custom:queuecallerunmanaged',_0x4bda8c);}if(_0x4bda8c[_0x5230('0x1a')]){_0x4bda8c[_0x5230('0xbf')]=_0x5230('0x5b');logger[_0x5230('0x61')](_0x5230('0xc2'),_0x54f770[_0x5230('0x49')],util[_0x5230('0x3f')](_0x4bda8c,{'showHidden':![],'depth':null}));ami['emit'](_0x5230('0xc3'),_0x4bda8c);}}else{this[_0x5230('0x11')][_0x4bda8c['queue']][_0x5230('0x57')]+=this[_0x5230('0x11')][_0x4bda8c[_0x5230('0x66')]][_0x5230('0x58')];}logger[_0x5230('0x76')](_0x5230('0xc4'),_0x54f770[_0x5230('0x49')],_0x4bda8c['name'],_0x4bda8c[_0x5230('0x5a')],_0x54f770[_0x5230('0xc5')]);this[_0x5230('0xf')][_0x54f770[_0x5230('0x49')]]=_0x4bda8c;this[_0x5230('0x44')](_0x4bda8c,_0x5230('0xc6'));this['emitVoiceQueueSummary'](this[_0x5230('0x11')][_0x4bda8c[_0x5230('0x66')]],_0x5230('0xc6'));}}logger[_0x5230('0x61')](_0x5230('0xc7'),_0x54f770['uniqueid'],util[_0x5230('0x3f')](this['queueReports'][_0x54f770['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x5230('0x45')](_0x5230('0xc8'),this[_0x5230('0xe')][_0x54f770[_0x5230('0x49')]]);if(_0x4bda8c[_0x5230('0x4e')]===_0x5230('0x4f'))return;delete this[_0x5230('0xe')][_0x54f770[_0x5230('0x49')]];delete this[_0x5230('0xf')][_0x54f770[_0x5230('0x49')]];}if(this[_0x5230('0x13')][_0x54f770['uniqueid']]){delete this[_0x5230('0x13')][_0x54f770[_0x5230('0x49')]];}}}catch(_0x35d538){logger[_0x5230('0x3d')](_0x5230('0xc9'),_0x54f770[_0x5230('0x49')],util[_0x5230('0x3f')](_0x35d538,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x29')]=function(_0x2f40f8){try{if(this[_0x5230('0x63')](_0x2f40f8)){logger[_0x5230('0x61')](_0x5230('0xca'),_0x2f40f8[_0x5230('0x49')],util[_0x5230('0x3f')](_0x2f40f8,{'showHidden':![],'depth':null}));var _0x538fe7;var _0x32ad7b;var _0x18abd6;if(this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xcb')]]){_0x538fe7=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xcb')]]);_0x538fe7['transferexten']=_0x2f40f8[_0x5230('0xcc')];_0x538fe7[_0x5230('0x9c')]=_0x2f40f8['secondtransfereruniqueid'];_0x538fe7[_0x5230('0x4e')]=_0x5230('0x4f');_0x538fe7['transfer']=!![];_0x538fe7[_0x5230('0x99')]=_0x5230('0xcd');if(this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xce')]]){_0x18abd6=this['queueReports'][_0x2f40f8[_0x5230('0xce')]];this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xce')]]=this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xcb')]];this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xcb')]]=_0x18abd6;_0x32ad7b=_[_0x5230('0x7c')](this['queueReports'][_0x2f40f8[_0x5230('0xcb')]]);_0x32ad7b[_0x5230('0x34')]=!![];}logger[_0x5230('0x76')](_0x5230('0xcf'),_0x2f40f8[_0x5230('0x49')],_0x538fe7[_0x5230('0x4c')],_0x538fe7['type'],_0x538fe7[_0x5230('0xd0')],_0x538fe7['transferuniqueid']);}else if(this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd1')]]){_0x538fe7=_['last'](this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd1')]]);_0x538fe7['transferexten']=_0x2f40f8[_0x5230('0xd2')];_0x538fe7[_0x5230('0x9c')]=_0x2f40f8[_0x5230('0xd3')];_0x538fe7[_0x5230('0x4e')]=_0x5230('0x4f');_0x538fe7[_0x5230('0x8e')]=!![];_0x538fe7[_0x5230('0x99')]='ATTENDED';if(this['queueReports'][_0x2f40f8[_0x5230('0xd3')]]){_0x18abd6=this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd3')]];this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd3')]]=this[_0x5230('0xe')][_0x2f40f8['transfertargetuniqueid']];this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd1')]]=_0x18abd6;_0x32ad7b=_['last'](this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd1')]]);_0x32ad7b[_0x5230('0x34')]=!![];}logger[_0x5230('0x76')](_0x5230('0xcf'),_0x2f40f8[_0x5230('0x49')],_0x538fe7[_0x5230('0x4c')],_0x538fe7['type'],_0x538fe7[_0x5230('0xd0')],_0x538fe7['transferuniqueid']);}else if(this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd3')]]){_0x538fe7=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd3')]]);_0x538fe7['transferexten']=_0x2f40f8[_0x5230('0xd2')];_0x538fe7[_0x5230('0x9c')]=_0x2f40f8[_0x5230('0xd3')];_0x538fe7['queuecallerexitreason']=_0x5230('0x4f');_0x538fe7[_0x5230('0x8e')]=!![];_0x538fe7[_0x5230('0x99')]=_0x5230('0xcd');}else if(this[_0x5230('0xe')][_0x2f40f8['secondtransfereruniqueid']]){_0x538fe7=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xce')]]);_0x538fe7['transferexten']=_0x2f40f8['secondtransfererexten'];_0x538fe7[_0x5230('0x9c')]=_0x2f40f8['secondtransfereruniqueid'];_0x538fe7['queuecallerexitreason']=_0x5230('0x4f');_0x538fe7[_0x5230('0x8e')]=!![];_0x538fe7[_0x5230('0x99')]=_0x5230('0xcd');}}}catch(_0x170585){logger[_0x5230('0x3d')](_0x5230('0xca'),_0x2f40f8[_0x5230('0x49')],util[_0x5230('0x3f')](_0x170585,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0xd4')]=function(_0x18a89a){try{if(this[_0x5230('0x63')](_0x18a89a)){logger[_0x5230('0x61')]('[%s][voiceQueueReport][blindtransfer]',_0x18a89a[_0x5230('0x49')],util[_0x5230('0x3f')](_0x18a89a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x18a89a[_0x5230('0xcb')]]){var _0x5ac549=_['last'](this[_0x5230('0xe')][_0x18a89a[_0x5230('0xcb')]]);_0x5ac549[_0x5230('0x4e')]=_0x5230('0xd5');_0x5ac549[_0x5230('0x8e')]=!![];_0x5ac549[_0x5230('0x99')]=_0x5230('0xd6');_0x5ac549[_0x5230('0xd0')]=_0x18a89a['extension'];_0x5ac549[_0x5230('0x9c')]=_0x18a89a['transfereeuniqueid'];logger[_0x5230('0x76')](_0x5230('0xd7'),_0x18a89a[_0x5230('0x49')],_0x5ac549[_0x5230('0x4c')],_0x5ac549['type'],_0x5ac549[_0x5230('0xd0')],_0x5ac549[_0x5230('0x9c')]);this[_0x5230('0x22')]({'event':'BlindTransfer','uniqueid':_0x18a89a[_0x5230('0xcb')],'context':_0x18a89a[_0x5230('0xd8')],'channel':_0x18a89a['transfererchannel']});}}}catch(_0x3a0a85){logger[_0x5230('0x3d')](_0x5230('0xd9'),_0x18a89a[_0x5230('0x49')],util[_0x5230('0x3f')](_0x3a0a85,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x26')]=function(_0x9bb555){try{if(this['isNotNull'](_0x9bb555)){logger['debug'](_0x5230('0xda'),_0x9bb555[_0x5230('0x49')],util['inspect'](_0x9bb555,{'showHidden':![],'depth':null}));if(this[_0x5230('0xe')][_0x9bb555[_0x5230('0x49')]]){var _0x8cbf72=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x9bb555[_0x5230('0x49')]]);if(!_[_0x5230('0x36')](_0x8cbf72[_0x5230('0x84')])){_0x8cbf72['mohstarttime']=moment()[_0x5230('0x4a')](_0x5230('0x72'));logger[_0x5230('0x76')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x9bb555[_0x5230('0x49')],_0x8cbf72[_0x5230('0xdb')]);}}}}catch(_0x415832){logger[_0x5230('0x3d')]('[%s][voiceQueueReport][musiconholdstart]',_0x9bb555[_0x5230('0x49')],util[_0x5230('0x3f')](_0x415832,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0xdc')]=function(_0x5351ab){try{if(this[_0x5230('0x63')](_0x5351ab)){logger[_0x5230('0x61')](_0x5230('0xdd'),_0x5351ab['uniqueid'],util[_0x5230('0x3f')](_0x5351ab,{'showHidden':![],'depth':null}));if(this[_0x5230('0xe')][_0x5351ab[_0x5230('0x49')]]){var _0x2187bf=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x5351ab[_0x5230('0x49')]]);if(!_[_0x5230('0x36')](_0x2187bf['mohstarttime'])){_0x2187bf['mohtime']+=moment()[_0x5230('0xbd')](0x0)[_0x5230('0xbb')](_0x2187bf[_0x5230('0xdb')],_0x5230('0x97'));logger[_0x5230('0x76')](_0x5230('0xde'),_0x5351ab[_0x5230('0x49')],_0x2187bf[_0x5230('0xdf')]);delete _0x2187bf['mohstarttime'];}}}}catch(_0x8fdb1e){logger['error'](_0x5230('0xdd'),_0x5351ab[_0x5230('0x49')],util['inspect'](_0x8fdb1e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')]['syncNewExten']=function(_0x1fa404){try{if(this[_0x5230('0x63')](_0x1fa404)){logger[_0x5230('0x61')](_0x5230('0xe0'),_0x1fa404[_0x5230('0x49')],util[_0x5230('0x3f')](_0x1fa404,{'showHidden':![],'depth':null}));if(_0x1fa404[_0x5230('0xe1')]['toLowerCase']()===_0x5230('0xe2')){_0x1fa404[_0x5230('0xe3')]=_0x1fa404[_0x5230('0xe4')]&&_0x1fa404[_0x5230('0xe4')][_0x5230('0x91')](_0x5230('0xe5'))?_0x1fa404[_0x5230('0xe4')]:(_0x1fa404[_0x5230('0xe4')]||_0x1fa404[_0x5230('0xe3')])[_0x5230('0x92')]();if(_[_0x5230('0x91')](_0x1fa404[_0x5230('0xe3')][_0x5230('0x92')](),_0x5230('0xe6'))){logger[_0x5230('0x76')](_0x5230('0xe7'),_0x1fa404[_0x5230('0x49')],_0x1fa404[_0x5230('0xe1')],_0x1fa404[_0x5230('0xe3')]);if(_[_0x5230('0x64')](this[_0x5230('0xf')][_0x1fa404[_0x5230('0x49')]]))this[_0x5230('0xf')][_0x1fa404[_0x5230('0x49')]]={};var _0x4beb43=_0x1fa404['applicationdata'][_0x5230('0xe8')]('=');var _0x50da77=_0x4beb43[0x0][_0x5230('0x92')]()[_0x5230('0xe9')](/cdr\((.*)\)/);if(_0x50da77)this['channels'][_0x1fa404[_0x5230('0x49')]][_0x50da77[0x1]]=_0x4beb43[0x1];}}}}catch(_0x2ade3e){logger['error'](_0x5230('0xea'),_0x1fa404[_0x5230('0x49')],util['inspect'](_0x2ade3e,{'showHidden':![],'depth':null}));}};module[_0x5230('0xeb')]=VoiceQueueReport;
\ No newline at end of file