Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index f51c887..ff15702 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x949e=['includes','[%s][voiceQueueReport][hangup]','length','diff','answered','queuecallercompleteAt','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transferuniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','transfertype','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','[%s][voiceQueueReport][attendedtransfer]','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','milliseconds','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','appdata','CDR(routeAlias)','applicationdata','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceQueueReport][newexten]','exports','moment','util','../../../config/environment','../model/queueReport','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','agents','channels','queueChannels','voiceQueues','campaigns','variables','syncQueueSummary','bind','queuecallerjoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','isEmpty','originated','hasOwnProperty','talking','queueStatusComplete','unlockRR','switch','isNil','Action','status','channel','message','inspect','queueReports','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','unmanaged','Trunk','active','callerid','Interval','stringify','md5','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','loopQueueShow','clearZombieChannels','queues','catch','loopQueueSummary','flagQueueSummary','queuesummary','then','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','waiting','toNumber','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueSummaryComplete','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','uniqueid','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','syncQueueCallerAbandon','last','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','linkedid','add','seconds','FORWARD','transferexten','toUpperCase','agentcomplete','addVariable','variable','value','queuestatus','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','membercalls','memberdynamic','memberlastcall','memberpenalty'];(function(_0x31ee1e,_0x4635cf){var _0x43abaf=function(_0x59851d){while(--_0x59851d){_0x31ee1e['push'](_0x31ee1e['shift']());}};_0x43abaf(++_0x4635cf);}(_0x949e,0x11c));var _0xe949=function(_0x4d9859,_0x5ee8c3){_0x4d9859=_0x4d9859-0x0;var _0x376fe6=_0x949e[_0x4d9859];return _0x376fe6;};'use strict';var _=require('lodash');var moment=require(_0xe949('0x0'));var util=require(_0xe949('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xe949('0x2'));var logger=require('../../../config/logger')('ami');var ami=require('../ami');var QueueReport=require(_0xe949('0x3'));config[_0xe949('0x4')]=_[_0xe949('0x5')](config[_0xe949('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0xe949('0x6'))(new Redis(config[_0xe949('0x4')]));var Sequence=function(){};Sequence[_0xe949('0x7')][_0xe949('0x8')]=function(_0x41259f){this[_0xe949('0x9')]=this[_0xe949('0x9')]?this[_0xe949('0x9')][_0xe949('0xa')](_0x41259f):_0x41259f();};function VoiceQueueReport(_0x426a95){this[_0xe949('0xb')]=new Sequence();this['queueReports']={};this[_0xe949('0xc')]=_0x426a95[_0xe949('0xc')];this[_0xe949('0xd')]=_0x426a95[_0xe949('0xe')];this[_0xe949('0xf')]=_0x426a95['voiceQueues'];this['flagQueueSummary']=!![];this[_0xe949('0x10')]=_0x426a95[_0xe949('0x10')];this[_0xe949('0x11')]={};ami['on']('queuesummary',this[_0xe949('0x12')][_0xe949('0x13')](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0xe949('0x14'),this['syncQueueCallerJoin']['bind'](this));ami['on'](_0xe949('0x15'),this['syncQueueCallerAbandon'][_0xe949('0x13')](this));ami['on'](_0xe949('0x16'),this[_0xe949('0x17')][_0xe949('0x13')](this));ami['on']('agentcomplete',this[_0xe949('0x18')]['bind'](this));ami['on'](_0xe949('0x19'),this[_0xe949('0x1a')]['bind'](this));ami['on'](_0xe949('0x1b'),this[_0xe949('0x1c')][_0xe949('0x13')](this));ami['on'](_0xe949('0x1d'),this[_0xe949('0x1e')][_0xe949('0x13')](this));ami['on'](_0xe949('0x1f'),this[_0xe949('0x20')]['bind'](this));ami['on'](_0xe949('0x21'),this[_0xe949('0x22')]['bind'](this));ami['on']('musiconholdstop',this[_0xe949('0x23')]['bind'](this));ami['on'](_0xe949('0x24'),this[_0xe949('0x25')][_0xe949('0x13')](this));ami['on'](_0xe949('0x26'),this['syncBlindTransfer'][_0xe949('0x13')](this));this['loopQueueSummary']();this['loopQueueShow']();}function clearChannels(_0x3beea5){if(!_[_0xe949('0x27')](_0x3beea5)){for(var _0x5f587b in _0x3beea5){if(_0x3beea5['hasOwnProperty'](_0x5f587b)){delete _0x3beea5[_0x5f587b];}}}}function clearCampaigns(_0x1b284f){if(!_[_0xe949('0x27')](_0x1b284f)){for(var _0x57902d in _0x1b284f){if(_0x1b284f['hasOwnProperty'](_0x57902d)){_0x1b284f[_0x57902d][_0xe949('0x28')]=0x0;}}}}function clearVoiceQueues(_0x49b13a){if(!_[_0xe949('0x27')](_0x49b13a)){for(var _0x411129 in _0x49b13a){if(_0x49b13a[_0xe949('0x29')](_0x411129)){_0x49b13a[_0x411129][_0xe949('0x28')]=0x0;_0x49b13a[_0x411129][_0xe949('0x2a')]=0x0;_0x49b13a[_0x411129]['pTalking']=0x0;_0x49b13a[_0x411129]['waiting']=0x0;_0x49b13a[_0x411129][_0xe949('0x2b')]=!![];}}}}function clearAgentBooked(_0x501e68){if(!_['isEmpty'](_0x501e68)){for(var _0x182297 in _0x501e68){if(_0x501e68[_0xe949('0x29')](_0x182297)){_0x501e68[_0x182297][_0xe949('0x2c')]=!![];}}}}VoiceQueueReport[_0xe949('0x7')]['clearZombieChannels']=function(){var _0x278d49=this;for(var _0x3cb281 in this[_0xe949('0xd')]){if(this['channels'][_0xe949('0x29')](_0x3cb281)&&!this[_0xe949('0xd')][_0x3cb281][_0xe949('0x2d')]){this[_0xe949('0xb')][_0xe949('0x8')](function(){if(!_[_0xe949('0x2e')](_0x278d49['channels'][_0x3cb281])){return ami[_0xe949('0x2f')]({'action':_0xe949('0x30'),'channel':_0x278d49[_0xe949('0xd')][_0x3cb281][_0xe949('0x31')]})['catch'](function(_0x219a5a){if(_0x219a5a[_0xe949('0x32')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x278d49[_0xe949('0xd')][_0x3cb281]){delete _0x278d49[_0xe949('0xd')][_0x3cb281];logger['error']('[%s][voiceQueueReport][checkChannel]',_0x3cb281,util[_0xe949('0x33')](_0x219a5a,{'showHidden':![],'depth':null}));}if(_0x278d49[_0xe949('0x34')][_0x3cb281]){delete _0x278d49[_0xe949('0x34')][_0x3cb281];logger[_0xe949('0x35')](_0xe949('0x36'),_0x3cb281,util['inspect'](_0x219a5a,{'showHidden':![],'depth':null}));}if(_0x278d49[_0xe949('0x11')][_0x3cb281]){delete _0x278d49['variables'][_0x3cb281];logger[_0xe949('0x35')](_0xe949('0x37'),_0x3cb281,util['inspect'](_0x219a5a,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x20')]=function(){logger['error'](_0xe949('0x38'));clearChannels(this[_0xe949('0xd')]);this[_0xe949('0x39')](this[_0xe949('0x34')]);clearAgentBooked(this[_0xe949('0xc')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xe949('0x10')]);};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x39')]=function(_0x5bddbc){var _0x5443fb=this;if(!_['isEmpty'](_0x5bddbc)){for(var _0x27197b in _0x5bddbc){if(_0x5bddbc['hasOwnProperty'](_0x27197b)){_0x5443fb[_0xe949('0x3a')](_0x5bddbc[_0x27197b],_0xe949('0x3b'));delete _0x5bddbc[_0x27197b];}}}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x3c')]=function(_0x4b1fee,_0x213470,_0x140d89){io['to'](_0x4b1fee)[_0xe949('0x3c')](_0x213470,_0x140d89);};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x3d')]=function(_0x58733f,_0x16d892){logger[_0xe949('0x3e')](_0xe949('0x3f')+_0x16d892+']\x20sending\x20voice_queue_channel:save\x20event:',_0x58733f['uniqueid'],util['inspect'](_0x58733f,{'showHidden':![],'depth':null}));this['emit'](util[_0xe949('0x40')](_0xe949('0x41'),_0x58733f[_0xe949('0x42')]),_0xe949('0x43'),_0x58733f);io[_0xe949('0x3c')](_0xe949('0x44'),_0x58733f);};VoiceQueueReport['prototype'][_0xe949('0x3a')]=function(_0x5d4675,_0x2019a6){logger['debug'](_0xe949('0x3f')+_0x2019a6+_0xe949('0x45'),_0x5d4675['uniqueid'],util[_0xe949('0x33')](_0x5d4675,{'showHidden':![],'depth':null}));this[_0xe949('0x3c')](util['format']('voice:queue:%s',_0x5d4675[_0xe949('0x42')]),_0xe949('0x46'),_0x5d4675);io[_0xe949('0x3c')](_0xe949('0x47'),_0x5d4675);};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x48')]=function(_0x945037,_0x2388a0){if(_0x945037[_0xe949('0x49')]===_0xe949('0x4a')){var _0x1d989e={'id':_0x945037['id'],'name':_0x945037[_0xe949('0x42')],'strategy':_0x945037[_0xe949('0x4b')],'answered':_0x945037['answered'],'available':_0x945037[_0xe949('0x4c')],'loggedIn':_0x945037[_0xe949('0x4d')],'pTalking':_0x945037[_0xe949('0x4e')],'sumBillable':_0x945037[_0xe949('0x4f')],'sumDuration':_0x945037[_0xe949('0x50')],'sumHoldTime':_0x945037[_0xe949('0x51')]||0x0,'talking':_0x945037[_0xe949('0x2a')],'total':_0x945037[_0xe949('0x52')],'type':_0x945037['type'],'unmanaged':_0x945037[_0xe949('0x53')],'abandoned':_0x945037['abandoned'],'waiting':_0x945037['waiting']};if(_0x945037['Trunk']){_0x1d989e[_0xe949('0x54')]={'id':_0x945037[_0xe949('0x54')]['id'],'name':_0x945037[_0xe949('0x54')][_0xe949('0x42')],'active':_0x945037[_0xe949('0x54')][_0xe949('0x55')],'callerid':_0x945037[_0xe949('0x54')][_0xe949('0x56')]};}if(_0x945037['Interval']){_0x1d989e[_0xe949('0x57')]={'id':_0x945037[_0xe949('0x57')]['id'],'name':_0x945037['Interval'][_0xe949('0x42')]};}var _0x1bc97b=md5(JSON[_0xe949('0x58')](_0x1d989e));if(_0x945037['md5']!==_0x1bc97b){_0x945037[_0xe949('0x59')]=_0x1bc97b;logger[_0xe949('0x3e')](_0xe949('0x5a')+_0x2388a0+_0xe949('0x5b'),util['inspect'](_0x1d989e,{'showHidden':![],'depth':null}));this[_0xe949('0x3c')](util[_0xe949('0x40')](_0xe949('0x41'),_0x1d989e[_0xe949('0x42')]),_0xe949('0x5c'),_0x1d989e);}}};VoiceQueueReport[_0xe949('0x7')]['isNotNull']=function(_0x488f68){return _0x488f68!==null&&!_[_0xe949('0x5d')](_0x488f68);};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x5e')]=function(){var _0x2f54c8=this;setInterval(function(){_0x2f54c8[_0xe949('0x5f')]();ami[_0xe949('0x2f')]({'action':_0xe949('0x60')})[_0xe949('0x61')](function(_0x42d6c5){logger[_0xe949('0x35')]('[voiceQueueReport][queues]',util[_0xe949('0x33')](_0x42d6c5,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x62')]=function(){var _0x344e15=this;setInterval(function(){if(_0x344e15[_0xe949('0x63')]){return ami[_0xe949('0x2f')]({'action':_0xe949('0x64')})[_0xe949('0x65')](function(_0x236adf){_0x344e15[_0xe949('0x63')]=![];})[_0xe949('0x61')](function(_0x17eb90){logger[_0xe949('0x35')](_0xe949('0x66'),util[_0xe949('0x33')](_0x17eb90,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x12')]=function(_0x186f48){try{if(this[_0xe949('0x67')](_0x186f48)&&this[_0xe949('0x67')](_0x186f48[_0xe949('0x68')])){logger[_0xe949('0x3e')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xe949('0x33')](_0x186f48,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x186f48[_0xe949('0x68')]]){logger['info'](_0xe949('0x69'),_0x186f48['queue']);var _0x2451f7=_[_0xe949('0x6a')](this['channels'],_0xe949('0x68'))[_0x186f48[_0xe949('0x68')]]||0x0;var _0x576c3b=_0x2451f7-_0x186f48[_0xe949('0x6b')];if(this['voiceQueues'][_0x186f48[_0xe949('0x68')]][_0xe949('0x6c')]!==_[_0xe949('0x6d')](_0x186f48['callers'])||this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x4d')]!==_[_0xe949('0x6d')](_0x186f48[_0xe949('0x6e')])||this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x4c')]!==_['toNumber'](_0x186f48[_0xe949('0x4c')])||this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x2a')]!==_0x576c3b){this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x6c')]=_['toNumber'](_0x186f48[_0xe949('0x6b')]);this[_0xe949('0xf')][_0x186f48['queue']][_0xe949('0x4d')]=_['toNumber'](_0x186f48[_0xe949('0x6e')]);this[_0xe949('0xf')][_0x186f48['queue']][_0xe949('0x4c')]=_[_0xe949('0x6d')](_0x186f48[_0xe949('0x4c')]);this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x2a')]=_0x576c3b>0x0?_0x576c3b:0x0;this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x2a')]=this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x2a')]>_[_0xe949('0x6d')](_0x186f48['loggedin'])?_['toNumber'](_0x186f48[_0xe949('0x6e')]):this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]][_0xe949('0x2a')];this[_0xe949('0x48')](this[_0xe949('0xf')][_0x186f48[_0xe949('0x68')]],'queuesummary');}logger[_0xe949('0x3e')](_0xe949('0x6f'),util[_0xe949('0x33')](this[_0xe949('0xf')][_0x186f48['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0xe949('0x70'),this['voiceQueues'][_0x186f48[_0xe949('0x68')]]);}}}catch(_0x9aa7c4){logger['error'](_0xe949('0x66'),util[_0xe949('0x33')](_0x9aa7c4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x71')]=function(_0x34d510){logger[_0xe949('0x3e')](_0xe949('0x72'),util['inspect'](_0x34d510,{'showHidden':![],'depth':null}));this[_0xe949('0x63')]=!![];};VoiceQueueReport['prototype'][_0xe949('0x73')]=function(_0x27b7e3){try{if(this[_0xe949('0x67')](_0x27b7e3)){logger['debug'](_0xe949('0x74'),_0x27b7e3[_0xe949('0x75')],util[_0xe949('0x33')](_0x27b7e3,{'showHidden':![],'depth':null}));if(_[_0xe949('0x5d')](this['queueReports'][_0x27b7e3[_0xe949('0x75')]]))this[_0xe949('0x34')][_0x27b7e3[_0xe949('0x75')]]=[];if(_[_0xe949('0x5d')](this[_0xe949('0xd')][_0x27b7e3[_0xe949('0x75')]]))this[_0xe949('0xd')][_0x27b7e3['uniqueid']]={};var _0x1deb03=new QueueReport();_0x1deb03[_0xe949('0x42')]=_0x27b7e3['queue'];_0x1deb03['type']=this['voiceQueues'][_0x1deb03[_0xe949('0x42')]]&&this[_0xe949('0xf')][_0x1deb03['name']][_0xe949('0x49')]?this[_0xe949('0xf')][_0x1deb03[_0xe949('0x42')]][_0xe949('0x49')]||_0xe949('0x4a'):_0xe949('0x4a');_0x1deb03[_0xe949('0x68')]=_0x27b7e3['queue'];_0x1deb03[_0xe949('0x76')]=moment()['format'](_0xe949('0x77'));_0x1deb03[_0xe949('0x78')]=_0x27b7e3[_0xe949('0x78')];_0x1deb03[_0xe949('0x79')]=_0x27b7e3['count'];_0x1deb03[_0xe949('0x75')]=_0x27b7e3['uniqueid'];_0x1deb03[_0xe949('0x7a')]=this[_0xe949('0xd')][_0x27b7e3[_0xe949('0x75')]][_0xe949('0x7a')];logger[_0xe949('0x7b')](_0xe949('0x7c'),_0x1deb03[_0xe949('0x42')],_0x1deb03['type']);_[_0xe949('0x7d')](_0x1deb03,_[_0xe949('0x7e')](_0x27b7e3,_[_0xe949('0x7f')](_0x1deb03)));this[_0xe949('0x34')][_0x27b7e3[_0xe949('0x75')]][_0xe949('0x80')](_0x1deb03);this[_0xe949('0xd')][_0x27b7e3['uniqueid']]=_0x1deb03;this[_0xe949('0x3d')](_0x1deb03,_0xe949('0x14'));}}catch(_0x18fd0a){logger[_0xe949('0x35')](_0xe949('0x74'),_0x27b7e3[_0xe949('0x75')],util['inspect'](_0x18fd0a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x81')]=function(_0x488b1c){try{if(this[_0xe949('0x67')](_0x488b1c)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x488b1c['uniqueid'],util['inspect'](_0x488b1c,{'showHidden':![],'depth':null}));if(this[_0xe949('0x34')][_0x488b1c[_0xe949('0x75')]]){var _0x145139=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x488b1c[_0xe949('0x75')]]);_0x145139[_0xe949('0x83')]=![];_0x145139['queuecallercompleteAt']=null;_0x145139[_0xe949('0x84')]=_0x488b1c[_0xe949('0x84')];_0x145139[_0xe949('0x85')]=_0x488b1c[_0xe949('0x85')];_0x145139[_0xe949('0x15')]=!![];_0x145139[_0xe949('0x86')]=moment()[_0xe949('0x40')](_0xe949('0x77'));_0x145139[_0xe949('0x87')]=_0xe949('0x88');_0x145139[_0xe949('0x89')]=null;logger[_0xe949('0x7b')](_0xe949('0x8a'),_0x145139[_0xe949('0x42')],_0x145139['type']);this['channels'][_0x488b1c[_0xe949('0x75')]]=_0x145139;this[_0xe949('0x3a')](_0x145139,_0xe949('0x15'));}}}catch(_0x7e2b46){logger[_0xe949('0x35')](_0xe949('0x8b'),_0x488b1c['uniqueid'],util[_0xe949('0x33')](_0x7e2b46,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x17')]=function(_0x1fb258){try{if(this[_0xe949('0x67')](_0x1fb258)){logger[_0xe949('0x3e')](_0xe949('0x8c'),_0x1fb258[_0xe949('0x75')],util[_0xe949('0x33')](_0x1fb258,{'showHidden':![],'depth':null}));if(this[_0xe949('0x34')][_0x1fb258[_0xe949('0x75')]]){var _0x8a6e49=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x1fb258[_0xe949('0x75')]]);_0x8a6e49[_0xe949('0x8d')]=moment()[_0xe949('0x40')](_0xe949('0x77'));_0x8a6e49[_0xe949('0x8e')]=_0x1fb258['connectedlinenum'];_0x8a6e49[_0xe949('0x8f')]=_0x1fb258[_0xe949('0x8f')];logger[_0xe949('0x7b')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x8a6e49[_0xe949('0x42')],_0x8a6e49[_0xe949('0x49')],_0x1fb258[_0xe949('0x8e')],_0x1fb258[_0xe949('0x8f')]);this['channels'][_0x1fb258[_0xe949('0x75')]]=_0x8a6e49;this[_0xe949('0x3d')](_0x8a6e49,'queuecallerleave');}}}catch(_0x449848){logger[_0xe949('0x35')](_0xe949('0x8c'),_0x1fb258[_0xe949('0x75')],util['inspect'](_0x449848,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')]['syncAgentConnect']=function(_0x471513){try{if(this[_0xe949('0x67')](_0x471513)){logger[_0xe949('0x3e')](_0xe949('0x90'),_0x471513[_0xe949('0x75')],util[_0xe949('0x33')](_0x471513,{'showHidden':![],'depth':null}));if(this[_0xe949('0x34')][_0x471513[_0xe949('0x75')]]){var _0x5c3fd4=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x471513[_0xe949('0x75')]]);_0x5c3fd4[_0xe949('0x83')]=!![];_0x5c3fd4[_0xe949('0x87')]='COMPLETEDBYAGENT';logger[_0xe949('0x7b')](_0xe949('0x91'),_0x5c3fd4[_0xe949('0x42')],_0x5c3fd4[_0xe949('0x49')]);}}}catch(_0x53b1a7){logger[_0xe949('0x35')](_0xe949('0x90'),_0x471513[_0xe949('0x75')],util[_0xe949('0x33')](_0x53b1a7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe949('0x18')]=function(_0x5137e7){try{if(this['isNotNull'](_0x5137e7)){logger[_0xe949('0x3e')](_0xe949('0x92'),_0x5137e7[_0xe949('0x75')],util[_0xe949('0x33')](_0x5137e7,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5137e7[_0xe949('0x75')]]){var _0x3c0ca5=_['last'](this[_0xe949('0x34')][_0x5137e7[_0xe949('0x75')]]);_0x3c0ca5[_0xe949('0x15')]=![];_0x3c0ca5[_0xe949('0x86')]=null;_0x3c0ca5[_0xe949('0x93')]=!![];_0x3c0ca5['lastAssignedTo']=_0x5137e7[_0xe949('0x94')];_0x3c0ca5['holdtime']=_0x5137e7[_0xe949('0x84')];_0x3c0ca5[_0xe949('0x83')]=!![];_0x3c0ca5[_0xe949('0x95')]=![];_0x3c0ca5[_0xe949('0x96')]=null;if(!_0x3c0ca5['transfer']){if(_0x5137e7['reason']==_0xe949('0x97')){_0x3c0ca5[_0xe949('0x87')]=_0xe949('0x98');logger[_0xe949('0x7b')](_0xe949('0x99'),_0x3c0ca5[_0xe949('0x42')],_0x3c0ca5[_0xe949('0x49')]);}else{if(_[_0xe949('0x9a')](_0x5137e7['channel'][_0xe949('0x9b')](),'local/')){if(this[_0xe949('0x34')][_0x5137e7[_0xe949('0x9c')]]){var _0x5755d4=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x5137e7['linkedid']]);_0x5755d4['queuecallercomplete']=![];_0x5755d4[_0xe949('0x95')]=!![];_0x5755d4[_0xe949('0x96')]=moment(_0x3c0ca5['queuecallerjoinAt'])[_0xe949('0x9d')](_0x5137e7[_0xe949('0x84')],_0xe949('0x9e'))[_0xe949('0x40')](_0xe949('0x77'));_0x5755d4[_0xe949('0x87')]='FORWARDTRANSFER';_0x5755d4[_0xe949('0x97')]=!![];_0x5755d4['transfertype']=_0xe949('0x9f');_0x5755d4[_0xe949('0xa0')]=_0x5137e7['destexten'];_0x5755d4['transferuniqueid']=_0x5137e7[_0xe949('0x75')];logger[_0xe949('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x5755d4['name'],_0x5755d4[_0xe949('0x49')]);var _0x10d8d3=this[_0xe949('0x34')][_0x5137e7['linkedid']];this[_0xe949('0x34')][_0x5137e7[_0xe949('0x9c')]]=this[_0xe949('0x34')][_0x5137e7[_0xe949('0x75')]];this[_0xe949('0x34')][_0x5137e7[_0xe949('0x75')]]=_0x10d8d3;}}else{_0x3c0ca5['queuecallerexitreason']='COMPLETEDBY'+_0x5137e7['reason'][_0xe949('0xa1')]();logger[_0xe949('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x3c0ca5['name'],_0x3c0ca5[_0xe949('0x49')],_0x3c0ca5[_0xe949('0x87')]);}}}this[_0xe949('0xd')][_0x5137e7[_0xe949('0x75')]]=_0x3c0ca5;this[_0xe949('0x3a')](_0x3c0ca5,_0xe949('0xa2'));}}}catch(_0x4eeba0){logger[_0xe949('0x35')](_0xe949('0x92'),_0x5137e7['uniqueid'],util[_0xe949('0x33')](_0x4eeba0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe949('0x1c')]=function(_0x283648){try{if(this[_0xe949('0x67')](_0x283648)){logger[_0xe949('0x3e')]('[%s][voiceQueueReport][varset]',_0x283648[_0xe949('0x75')],util[_0xe949('0x33')](_0x283648,{'showHidden':![],'depth':null}));this[_0xe949('0xa3')](_0x283648['uniqueid'],_['keys'](_0x283648[_0xe949('0xa4')])[0x0],_0x283648[_0xe949('0xa5')]);if(this['queueReports'][_0x283648[_0xe949('0x75')]]){var _0x3d745b=_['last'](this[_0xe949('0x34')][_0x283648[_0xe949('0x75')]]);if(_0x3d745b){if(this[_0xe949('0x67')](_0x283648[_0xe949('0xa4')])&&this[_0xe949('0x67')](_0x283648[_0xe949('0xa4')][_0xe949('0xa6')])){switch(_0x283648[_0xe949('0xa5')]){case'CONTINUE':_0x3d745b[_0xe949('0x95')]=![];_0x3d745b[_0xe949('0x96')]=null;break;case _0xe949('0xa7'):_0x3d745b[_0xe949('0xa8')]=_0xe949('0xa9');_0x3d745b[_0xe949('0x95')]=!![];_0x3d745b[_0xe949('0x96')]=moment()['format'](_0xe949('0x77'));_0x3d745b[_0xe949('0x8d')]=moment()[_0xe949('0x40')](_0xe949('0x77'));logger[_0xe949('0x3e')](_0xe949('0xaa'),_0x283648[_0xe949('0x75')],util['inspect'](_0x3d745b,{'showHidden':![],'depth':null}));ami[_0xe949('0x3c')](_0xe949('0xab'),_0x3d745b);break;default:_0x3d745b[_0xe949('0x95')]=!![];_0x3d745b[_0xe949('0x96')]=moment()[_0xe949('0x40')](_0xe949('0x77'));_0x3d745b['queuecallerleaveAt']=moment()[_0xe949('0x40')](_0xe949('0x77'));}_0x3d745b['queuecallerabandon']=![];_0x3d745b[_0xe949('0x86')]=null;_0x3d745b[_0xe949('0x87')]=_0x283648[_0xe949('0xa5')];this[_0xe949('0xd')][_0x283648[_0xe949('0x75')]]=_0x3d745b;this['emitVoiceQueueChannelRemove'](_0x3d745b,_0xe949('0x1b'));}else if(this[_0xe949('0x67')](_0x283648[_0xe949('0xa4')])&&this['isNotNull'](_0x283648[_0xe949('0xa4')][_0xe949('0xac')])){if(!_0x3d745b[_0xe949('0x15')]){_0x3d745b[_0xe949('0x95')]=!![];_0x3d745b[_0xe949('0x96')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3d745b[_0xe949('0x87')]=_0xe949('0xad');_0x3d745b[_0xe949('0x8d')]=moment()[_0xe949('0x40')](_0xe949('0x77'));this[_0xe949('0xd')][_0x283648[_0xe949('0x75')]]=_0x3d745b;}}logger[_0xe949('0x7b')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x283648[_0xe949('0x75')],_0x3d745b[_0xe949('0x42')],_0x3d745b[_0xe949('0x49')],_[_0xe949('0x7f')](_0x283648[_0xe949('0xa4')])[0x0],_0x283648[_0xe949('0xa5')]);_0x3d745b[_0xe949('0x11')]=this[_0xe949('0x11')][_0x283648['uniqueid']];}}}}catch(_0x37e726){logger[_0xe949('0x35')](_0xe949('0xae'),_0x283648['uniqueid'],util[_0xe949('0x33')](_0x37e726,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0xa3')]=function(_0x2e0600,_0x1e5f82,_0x2e6e86){var _0x35bd08=[_0xe949('0xaf'),_0xe949('0xb0'),_0xe949('0xb1'),_0xe949('0xb2'),_0xe949('0xb3'),_0xe949('0xb4'),'rtpaudioqosrtt',_0xe949('0xb5'),'sipcallid',_0xe949('0xb6'),_0xe949('0xb7'),'bridgepvtcallid',_0xe949('0xb8'),_0xe949('0xb9'),'memberinterface',_0xe949('0xba'),_0xe949('0x94'),_0xe949('0xbb'),'memberrealtime'];if(!_[_0xe949('0x2e')](_0x1e5f82)&&!_[_0xe949('0xbc')](_0x35bd08,_0x1e5f82)){if(_[_0xe949('0x5d')](this[_0xe949('0x11')][_0x2e0600])){this['variables'][_0x2e0600]={};}this[_0xe949('0x11')][_0x2e0600][_0x1e5f82]=_0x2e6e86;}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x1e')]=function(_0x53c0bf){try{if(this[_0xe949('0x67')](_0x53c0bf)){logger[_0xe949('0x3e')](_0xe949('0xbd'),_0x53c0bf[_0xe949('0x75')],util[_0xe949('0x33')](_0x53c0bf,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x53c0bf[_0xe949('0x75')]]){for(var _0x3a799c=0x0,_0x4b4f95={};_0x3a799c<this[_0xe949('0x34')][_0x53c0bf[_0xe949('0x75')]][_0xe949('0xbe')];_0x3a799c+=0x1){_0x4b4f95=this[_0xe949('0x34')][_0x53c0bf[_0xe949('0x75')]][_0x3a799c];if(this[_0xe949('0xf')][_0x4b4f95[_0xe949('0x68')]]){if(_0x4b4f95[_0xe949('0x95')]&&_0x4b4f95[_0xe949('0x97')]!=!![]){this[_0xe949('0xf')][_0x4b4f95[_0xe949('0x68')]][_0xe949('0x53')]+=0x1;}if(_0x4b4f95[_0xe949('0x15')]){this[_0xe949('0xf')][_0x4b4f95[_0xe949('0x68')]]['abandoned']+=0x1;}this[_0xe949('0xf')][_0x4b4f95['queue']][_0xe949('0x51')]+=moment(_0x4b4f95[_0xe949('0x8d')])['diff'](_0x4b4f95['queuecallerjoinAt'],'seconds')||0x0;if(_0x3a799c===this[_0xe949('0x34')][_0x53c0bf['uniqueid']][_0xe949('0xbe')]-0x1){this['voiceQueues'][_0x4b4f95[_0xe949('0x68')]][_0xe949('0x50')]+=moment()['milliseconds'](0x0)[_0xe949('0xbf')](_0x4b4f95[_0xe949('0x76')],_0xe949('0x9e'));this['voiceQueues'][_0x4b4f95[_0xe949('0x68')]][_0xe949('0x52')]+=0x1;if(_0x4b4f95[_0xe949('0x83')]){this[_0xe949('0xf')][_0x4b4f95['queue']][_0xe949('0xc0')]+=0x1;this[_0xe949('0xf')][_0x4b4f95['queue']][_0xe949('0x4f')]+=moment()['milliseconds'](0x0)['diff'](_0x4b4f95[_0xe949('0x8d')],_0xe949('0x9e'));_0x4b4f95[_0xe949('0xc1')]=moment()[_0xe949('0x40')](_0xe949('0x77'));_0x4b4f95['queuecallerexit']=![];_0x4b4f95[_0xe949('0x96')]=null;}if(_0x4b4f95[_0xe949('0x95')]&&_0x4b4f95[_0xe949('0x97')]!=!![]){_0x4b4f95[_0xe949('0xa8')]=_0xe949('0x53');logger[_0xe949('0x3e')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x53c0bf['uniqueid'],util[_0xe949('0x33')](_0x4b4f95,{'showHidden':![],'depth':null}));ami[_0xe949('0x3c')](_0xe949('0xc2'),_0x4b4f95);}if(_0x4b4f95[_0xe949('0x15')]){_0x4b4f95[_0xe949('0xa8')]='abandoned';logger[_0xe949('0x3e')](_0xe949('0xc3'),_0x53c0bf['uniqueid'],util[_0xe949('0x33')](_0x4b4f95,{'showHidden':![],'depth':null}));ami[_0xe949('0x3c')](_0xe949('0xc4'),_0x4b4f95);}}else{this[_0xe949('0xf')][_0x4b4f95[_0xe949('0x68')]][_0xe949('0x50')]+=this['voiceQueues'][_0x4b4f95[_0xe949('0x68')]]['sumHoldTime'];}logger[_0xe949('0x7b')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x53c0bf[_0xe949('0x75')],_0x4b4f95[_0xe949('0x42')],_0x4b4f95[_0xe949('0x49')],_0x53c0bf[_0xe949('0xc5')]);this[_0xe949('0xd')][_0x53c0bf[_0xe949('0x75')]]=_0x4b4f95;this[_0xe949('0x3a')](_0x4b4f95,_0xe949('0x1d'));this[_0xe949('0x48')](this[_0xe949('0xf')][_0x4b4f95[_0xe949('0x68')]],_0xe949('0x1d'));}}logger[_0xe949('0x3e')](_0xe949('0xc6'),_0x53c0bf['uniqueid'],util[_0xe949('0x33')](this[_0xe949('0x34')][_0x53c0bf[_0xe949('0x75')]],{'showHidden':![],'depth':null}));ami[_0xe949('0x3c')](_0xe949('0xc7'),this[_0xe949('0x34')][_0x53c0bf[_0xe949('0x75')]]);delete this['queueReports'][_0x53c0bf['uniqueid']];delete this[_0xe949('0xd')][_0x53c0bf['uniqueid']];}if(this['variables'][_0x53c0bf[_0xe949('0x75')]]){delete this[_0xe949('0x11')][_0x53c0bf[_0xe949('0x75')]];}}}catch(_0x329ad8){logger[_0xe949('0x35')](_0xe949('0xbd'),_0x53c0bf[_0xe949('0x75')],util['inspect'](_0x329ad8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x25')]=function(_0x3f82bb){try{if(this['isNotNull'](_0x3f82bb)){logger[_0xe949('0x3e')]('[%s][voiceQueueReport][attendedtransfer]',_0x3f82bb[_0xe949('0x75')],util[_0xe949('0x33')](_0x3f82bb,{'showHidden':![],'depth':null}));var _0x181cd1;if(this['queueReports'][_0x3f82bb['transfereeuniqueid']]){_0x181cd1=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xc8')]]);_0x181cd1[_0xe949('0xa0')]=_0x3f82bb[_0xe949('0xc9')];_0x181cd1['transferuniqueid']=_0x3f82bb[_0xe949('0xca')];_0x181cd1[_0xe949('0x87')]=_0xe949('0xcb');_0x181cd1['transfer']=!![];_0x181cd1['transfertype']=_0xe949('0xcc');if(this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xca')]]){var _0x49d1a2=this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xca')]];this[_0xe949('0x34')][_0x3f82bb['secondtransfereruniqueid']]=this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xc8')]];this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xc8')]]=_0x49d1a2;var _0x5af82a=_['last'](this[_0xe949('0x34')][_0x3f82bb['transfereeuniqueid']]);_0x5af82a[_0xe949('0x2d')]=!![];}logger[_0xe949('0x7b')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x3f82bb[_0xe949('0x75')],_0x181cd1[_0xe949('0x42')],_0x181cd1[_0xe949('0x49')],_0x181cd1['transferexten'],_0x181cd1[_0xe949('0xcd')]);}else if(this['queueReports'][_0x3f82bb[_0xe949('0xce')]]){_0x181cd1=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xce')]]);_0x181cd1[_0xe949('0xa0')]=_0x3f82bb[_0xe949('0xcf')];_0x181cd1['transferuniqueid']=_0x3f82bb[_0xe949('0xd0')];_0x181cd1[_0xe949('0x87')]='ATTENDEDTRANSFER';_0x181cd1[_0xe949('0x97')]=!![];_0x181cd1[_0xe949('0xd1')]=_0xe949('0xcc');if(this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xd0')]]){var _0x49d1a2=this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xd0')]];this['queueReports'][_0x3f82bb['origtransfereruniqueid']]=this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xce')]];this['queueReports'][_0x3f82bb[_0xe949('0xce')]]=_0x49d1a2;var _0x5af82a=_['last'](this[_0xe949('0x34')][_0x3f82bb[_0xe949('0xce')]]);_0x5af82a[_0xe949('0x2d')]=!![];}logger[_0xe949('0x7b')](_0xe949('0xd2'),_0x3f82bb[_0xe949('0x75')],_0x181cd1[_0xe949('0x42')],_0x181cd1[_0xe949('0x49')],_0x181cd1[_0xe949('0xa0')],_0x181cd1[_0xe949('0xcd')]);}}}catch(_0x139735){logger[_0xe949('0x35')](_0xe949('0xd3'),_0x3f82bb[_0xe949('0x75')],util[_0xe949('0x33')](_0x139735,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0xd4')]=function(_0x5a71e7){try{if(this[_0xe949('0x67')](_0x5a71e7)){logger['debug'](_0xe949('0xd5'),_0x5a71e7[_0xe949('0x75')],util[_0xe949('0x33')](_0x5a71e7,{'showHidden':![],'depth':null}));if(this[_0xe949('0x34')][_0x5a71e7['transfereeuniqueid']]){var _0x5e5218=_[_0xe949('0x82')](this['queueReports'][_0x5a71e7[_0xe949('0xc8')]]);_0x5e5218['queuecallerexitreason']=_0xe949('0xd6');_0x5e5218[_0xe949('0x97')]=!![];_0x5e5218[_0xe949('0xd1')]=_0xe949('0xd7');_0x5e5218[_0xe949('0xa0')]=_0x5a71e7['extension'];_0x5e5218[_0xe949('0xcd')]=_0x5a71e7[_0xe949('0xc8')];logger[_0xe949('0x7b')](_0xe949('0xd8'),_0x5a71e7['uniqueid'],_0x5e5218[_0xe949('0x42')],_0x5e5218[_0xe949('0x49')],_0x5e5218['transferexten'],_0x5e5218['transferuniqueid']);this[_0xe949('0x1e')]({'event':_0xe949('0xd9'),'uniqueid':_0x5a71e7[_0xe949('0xc8')],'context':_0x5a71e7['context'],'channel':_0x5a71e7['transfererchannel']});}}}catch(_0x2d7406){logger[_0xe949('0x35')](_0xe949('0xd5'),_0x5a71e7[_0xe949('0x75')],util[_0xe949('0x33')](_0x2d7406,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x22')]=function(_0x590582){try{if(this[_0xe949('0x67')](_0x590582)){logger['debug'](_0xe949('0xda'),_0x590582['uniqueid'],util['inspect'](_0x590582,{'showHidden':![],'depth':null}));if(this[_0xe949('0x34')][_0x590582['uniqueid']]){var _0x46f018=_[_0xe949('0x82')](this['queueReports'][_0x590582[_0xe949('0x75')]]);if(!_[_0xe949('0x2e')](_0x46f018[_0xe949('0x8d')])){_0x46f018[_0xe949('0xdb')]=moment()['format'](_0xe949('0x77'));logger[_0xe949('0x7b')](_0xe949('0xdc'),_0x590582[_0xe949('0x75')],_0x46f018[_0xe949('0xdb')]);}}}}catch(_0x1a27ea){logger['error']('[%s][voiceQueueReport][musiconholdstart]',_0x590582[_0xe949('0x75')],util['inspect'](_0x1a27ea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe949('0x7')][_0xe949('0x23')]=function(_0x15cda7){try{if(this[_0xe949('0x67')](_0x15cda7)){logger[_0xe949('0x3e')](_0xe949('0xdd'),_0x15cda7[_0xe949('0x75')],util['inspect'](_0x15cda7,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x15cda7['uniqueid']]){var _0x1d2e1b=_[_0xe949('0x82')](this[_0xe949('0x34')][_0x15cda7['uniqueid']]);if(!_['isNil'](_0x1d2e1b[_0xe949('0xdb')])){_0x1d2e1b[_0xe949('0xde')]+=moment()[_0xe949('0xdf')](0x0)[_0xe949('0xbf')](_0x1d2e1b['mohstarttime'],_0xe949('0x9e'));logger[_0xe949('0x7b')](_0xe949('0xe0'),_0x15cda7[_0xe949('0x75')],_0x1d2e1b['mohtime']);delete _0x1d2e1b[_0xe949('0xdb')];}}}}catch(_0x22f922){logger['error'](_0xe949('0xdd'),_0x15cda7[_0xe949('0x75')],util[_0xe949('0x33')](_0x22f922,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe949('0xe1')]=function(_0xe2e928){try{if(this[_0xe949('0x67')](_0xe2e928)){logger[_0xe949('0x3e')](_0xe949('0xe2'),_0xe2e928[_0xe949('0x75')],util['inspect'](_0xe2e928,{'showHidden':![],'depth':null}));if(_0xe2e928[_0xe949('0xe3')][_0xe949('0x9b')]()===_0xe949('0xe4')){_0xe2e928['applicationdata']=_0xe2e928[_0xe949('0xe5')]&&_0xe2e928[_0xe949('0xe5')][_0xe949('0x9a')](_0xe949('0xe6'))?_0xe2e928[_0xe949('0xe5')]:(_0xe2e928['appdata']||_0xe2e928['applicationdata'])[_0xe949('0x9b')]();if(_[_0xe949('0x9a')](_0xe2e928[_0xe949('0xe7')][_0xe949('0x9b')](),'cdr(')){logger[_0xe949('0x7b')](_0xe949('0xe8'),_0xe2e928[_0xe949('0x75')],_0xe2e928['application'],_0xe2e928[_0xe949('0xe7')]);if(_[_0xe949('0x5d')](this['channels'][_0xe2e928[_0xe949('0x75')]]))this[_0xe949('0xd')][_0xe2e928[_0xe949('0x75')]]={};var _0x5356aa=_0xe2e928[_0xe949('0xe7')]['split']('=');var _0xec270=_0x5356aa[0x0][_0xe949('0x9b')]()[_0xe949('0xe9')](/cdr\((.*)\)/);if(_0xec270)this[_0xe949('0xd')][_0xe2e928[_0xe949('0x75')]][_0xec270[0x1]]=_0x5356aa[0x1];}}}}catch(_0x4a7b94){logger[_0xe949('0x35')](_0xe949('0xea'),_0xe2e928[_0xe949('0x75')],util['inspect'](_0x4a7b94,{'showHidden':![],'depth':null}));}};module[_0xe949('0xeb')]=VoiceQueueReport;
\ No newline at end of file
+var _0xb2b0=['assign','syncQueueStatusComplete','type','inbound','outbound','custom:queuesummary','statusRequests','completeEvent','syncQueueMember','push','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','emitVoiceQueueChannelSave','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','addVariable','keys','value','variable','CONTINUE','TIMEOUT','lastevent','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','membername','memberpenalty','isNil','includes','length','sumHoldTime','diff','sumDuration','seconds','total','answered','sumBillable','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][handleHangup]','[%s][voiceQueueReport][hangup]','handleHangup','cause-txt','cause','transferid','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfereruniqueid','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','ATTENDED','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','milliseconds','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','split','match','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../model/voiceQueueSummary','defaults','redis','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','realtime','agents','queueChannels','voiceQueues','campaigns','summary','variables','queuesummary','bind','syncQueueSummaryComplete','queuestatuscomplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentconnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','waiting','queuecallerexit','queuecallercomplete','clearZombieChannels','channels','Action','status','channel','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','[%s][voiceQueueReport][','format','voice:queue:%s','queue','voice_queue_channel:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','isNotNull','isUndefined','queues','catch','[voiceQueueReport][queues]','loopQueueSummary','isRunning','actionid','queuestatus','[voiceQueueReport][queuesummary]','createQueueSummaryReport','summaryEvent','createReport','handleInboundQueueSummaryReport','compareToInboundQueue'];(function(_0x1278aa,_0x53cc06){var _0x11cbc8=function(_0x1e7d63){while(--_0x1e7d63){_0x1278aa['push'](_0x1278aa['shift']());}};_0x11cbc8(++_0x53cc06);}(_0xb2b0,0x8f));var _0x0b2b=function(_0x5e69f1,_0x2d1835){_0x5e69f1=_0x5e69f1-0x0;var _0x3ff8d0=_0xb2b0[_0x5e69f1];return _0x3ff8d0;};'use strict';var _=require(_0x0b2b('0x0'));var moment=require(_0x0b2b('0x1'));var util=require(_0x0b2b('0x2'));var Redis=require('ioredis');var config=require(_0x0b2b('0x3'));var logger=require(_0x0b2b('0x4'))(_0x0b2b('0x5'));var ami=require('../ami');var QueueReport=require('../model/queueReport');var VoiceQueueSummary=require(_0x0b2b('0x6'));config['redis']=_[_0x0b2b('0x7')](config[_0x0b2b('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x0b2b('0x9'))(new Redis(config[_0x0b2b('0x8')]));var Sequence=function(){};Sequence[_0x0b2b('0xa')][_0x0b2b('0xb')]=function(_0x114178){this['tail']=this[_0x0b2b('0xc')]?this[_0x0b2b('0xc')][_0x0b2b('0xd')](_0x114178):_0x114178();};function VoiceQueueReport(_0x1c06c6){this[_0x0b2b('0xe')]=new Sequence();this[_0x0b2b('0xf')]={};this[_0x0b2b('0x10')]=_0x1c06c6;this['agents']=_0x1c06c6[_0x0b2b('0x11')];this['channels']=_0x1c06c6[_0x0b2b('0x12')];this[_0x0b2b('0x13')]=_0x1c06c6[_0x0b2b('0x13')];this[_0x0b2b('0x14')]=_0x1c06c6[_0x0b2b('0x14')];this[_0x0b2b('0x15')]=initializeSummary();this[_0x0b2b('0x16')]={};ami['on'](_0x0b2b('0x17'),this['syncQueueSummary'][_0x0b2b('0x18')](this));ami['on']('queuesummarycomplete',this[_0x0b2b('0x19')][_0x0b2b('0x18')](this));ami['on']('queuemember',this['syncQueueMember']['bind'](this));ami['on'](_0x0b2b('0x1a'),this['syncQueueStatusComplete'][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x1b'),this['syncQueueCallerJoin'][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x1c'),this[_0x0b2b('0x1d')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x1e'),this[_0x0b2b('0x1f')]['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x20'),this['syncAgentConnect']['bind'](this));ami['on'](_0x0b2b('0x21'),this[_0x0b2b('0x22')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x23'),this[_0x0b2b('0x24')]['bind'](this));ami['on'](_0x0b2b('0x25'),this['syncFullyBooted']['bind'](this));ami['on']('musiconholdstart',this[_0x0b2b('0x26')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x27'),this[_0x0b2b('0x28')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x29'),this[_0x0b2b('0x2a')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x2b'),this[_0x0b2b('0x2c')][_0x0b2b('0x18')](this));this['loopQueueSummary']();this[_0x0b2b('0x2d')]();}function clearChannels(_0x455eed){if(!_[_0x0b2b('0x2e')](_0x455eed)){for(var _0x4cacf2 in _0x455eed){if(_0x455eed[_0x0b2b('0x2f')](_0x4cacf2)){delete _0x455eed[_0x4cacf2];}}}}function clearCampaigns(_0x539b95){if(!_[_0x0b2b('0x2e')](_0x539b95)){for(var _0x3229c2 in _0x539b95){if(_0x539b95[_0x0b2b('0x2f')](_0x3229c2)){_0x539b95[_0x3229c2][_0x0b2b('0x30')]=0x0;}}}}function clearVoiceQueues(_0x5ec306){if(!_[_0x0b2b('0x2e')](_0x5ec306)){for(var _0x151bf7 in _0x5ec306){if(_0x5ec306['hasOwnProperty'](_0x151bf7)){_0x5ec306[_0x151bf7][_0x0b2b('0x30')]=0x0;_0x5ec306[_0x151bf7]['talking']=0x0;_0x5ec306[_0x151bf7]['pTalking']=0x0;_0x5ec306[_0x151bf7][_0x0b2b('0x31')]=0x0;_0x5ec306[_0x151bf7]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x3396c1){if(!_['isEmpty'](_0x3396c1)){for(var _0x2ded99 in _0x3396c1){if(_0x3396c1[_0x0b2b('0x2f')](_0x2ded99)){_0x3396c1[_0x2ded99]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x528111){return _0x528111[_0x0b2b('0x32')]||_0x528111[_0x0b2b('0x1c')]||_0x528111[_0x0b2b('0x33')];}VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x34')]=function(){var _0x5d06d8=this;for(var _0x4d7a88 in this['channels']){if(this[_0x0b2b('0x35')][_0x0b2b('0x2f')](_0x4d7a88)&&!this[_0x0b2b('0x35')][_0x4d7a88]['switch']){this[_0x0b2b('0xe')]['enqueue'](function(){if(!_['isNil'](_0x5d06d8[_0x0b2b('0x35')][_0x4d7a88])){return ami[_0x0b2b('0x36')]({'action':_0x0b2b('0x37'),'channel':_0x5d06d8['channels'][_0x4d7a88][_0x0b2b('0x38')]})['catch'](function(_0x5bd9aa){if(_0x5bd9aa[_0x0b2b('0x39')]===_0x0b2b('0x3a')){setTimeout(function(){if(_0x5d06d8[_0x0b2b('0x35')][_0x4d7a88]){delete _0x5d06d8[_0x0b2b('0x35')][_0x4d7a88];logger['error'](_0x0b2b('0x3b'),_0x4d7a88,util[_0x0b2b('0x3c')](_0x5bd9aa,{'showHidden':![],'depth':null}));}if(_0x5d06d8[_0x0b2b('0xf')][_0x4d7a88]){delete _0x5d06d8[_0x0b2b('0xf')][_0x4d7a88];logger[_0x0b2b('0x3d')](_0x0b2b('0x3e'),_0x4d7a88,util['inspect'](_0x5bd9aa,{'showHidden':![],'depth':null}));}if(_0x5d06d8[_0x0b2b('0x16')][_0x4d7a88]){delete _0x5d06d8[_0x0b2b('0x16')][_0x4d7a88];logger['error'](_0x0b2b('0x3f'),_0x4d7a88,util[_0x0b2b('0x3c')](_0x5bd9aa,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x40')]=function(){logger[_0x0b2b('0x3d')](_0x0b2b('0x41'));clearChannels(this['channels']);this[_0x0b2b('0x42')](this[_0x0b2b('0xf')]);clearAgentBooked(this[_0x0b2b('0x11')]);clearVoiceQueues(this[_0x0b2b('0x13')]);clearCampaigns(this[_0x0b2b('0x14')]);this['summary']=initializeSummary();};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x42')]=function(_0x4da1b7){var _0x406fe4=this;if(!_['isEmpty'](_0x4da1b7)){for(var _0x26be49 in _0x4da1b7){if(_0x4da1b7[_0x0b2b('0x2f')](_0x26be49)){_0x406fe4[_0x0b2b('0x43')](_0x4da1b7[_0x26be49],_0x0b2b('0x44'));delete _0x4da1b7[_0x26be49];}}}};VoiceQueueReport['prototype'][_0x0b2b('0x45')]=function(_0x48bebc,_0x5c2559,_0x38a233){io['to'](_0x48bebc)[_0x0b2b('0x45')](_0x5c2559,_0x38a233);};VoiceQueueReport[_0x0b2b('0xa')]['emitVoiceQueueChannelSave']=function(_0x1359bc,_0x5e3bf9){logger['debug'](_0x0b2b('0x46')+_0x5e3bf9+']\x20sending\x20voice_queue_channel:save\x20event:',_0x1359bc['uniqueid'],util['inspect'](_0x1359bc,{'showHidden':![],'depth':null}));this[_0x0b2b('0x45')](util[_0x0b2b('0x47')](_0x0b2b('0x48'),_0x1359bc[_0x0b2b('0x49')]),_0x0b2b('0x4a'),_0x1359bc);io[_0x0b2b('0x45')]('voice_queue_presence:save',_0x1359bc);};VoiceQueueReport[_0x0b2b('0xa')]['emitVoiceQueueChannelRemove']=function(_0x238506,_0x4be6f2){logger[_0x0b2b('0x4b')](_0x0b2b('0x46')+_0x4be6f2+_0x0b2b('0x4c'),_0x238506[_0x0b2b('0x4d')],util['inspect'](_0x238506,{'showHidden':![],'depth':null}));if(_0x238506[_0x0b2b('0x4e')]===_0x0b2b('0x4f')){return;}this[_0x0b2b('0x45')](util['format']('voice:queue:%s',_0x238506[_0x0b2b('0x49')]),_0x0b2b('0x50'),_0x238506);io[_0x0b2b('0x45')](_0x0b2b('0x51'),_0x238506);};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x52')]=function(_0x1085c7){if(_0x1085c7['type']==='inbound'){logger[_0x0b2b('0x4b')](_0x0b2b('0x53'),util[_0x0b2b('0x3c')](_0x1085c7,{'showHidden':![],'depth':null}));this[_0x0b2b('0x45')](util[_0x0b2b('0x47')](_0x0b2b('0x48'),_0x1085c7[_0x0b2b('0x54')]),'voice_queue:save',_0x1085c7);}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x55')]=function(_0x113cac){return _0x113cac!==null&&!_[_0x0b2b('0x56')](_0x113cac);};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x2d')]=function(){var _0x58dd8c=this;setInterval(function(){_0x58dd8c[_0x0b2b('0x34')]();ami[_0x0b2b('0x36')]({'action':_0x0b2b('0x57')})[_0x0b2b('0x58')](function(_0x22025e){logger[_0x0b2b('0x3d')](_0x0b2b('0x59'),util[_0x0b2b('0x3c')](_0x22025e,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x5a')]=function(){var _0x8831a=this;setInterval(function(){if(!_0x8831a[_0x0b2b('0x15')][_0x0b2b('0x5b')]){return ami[_0x0b2b('0x36')]({'action':_0x0b2b('0x17')})['then'](function(_0x43b12a){_0x8831a[_0x0b2b('0x15')]['id']=_0x43b12a[_0x0b2b('0x5c')];_0x8831a[_0x0b2b('0x15')][_0x0b2b('0x5b')]=!![];_0x8831a[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x43b12a[_0x0b2b('0x5c')]]={};})[_0x0b2b('0x58')](function(_0x577300){logger['error'](_0x0b2b('0x5e'),util['inspect'](_0x577300,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x5f')]=function(_0x5373d3,_0x5df03d){var _0x29add9;if(this[_0x0b2b('0x15')]&&this['summary'][_0x0b2b('0x57')]&&this[_0x0b2b('0x15')][_0x0b2b('0x57')][_0x5373d3[_0x0b2b('0x54')]]){_0x29add9=this[_0x0b2b('0x15')]['queues'][_0x5373d3[_0x0b2b('0x54')]][_0x0b2b('0x60')];}var _0x80ad92=new VoiceQueueSummary(_0x5373d3);return _0x80ad92[_0x0b2b('0x61')](_0x5df03d[_0x0b2b('0x11')],this[_0x0b2b('0x11')],_0x29add9,this[_0x0b2b('0x10')][_0x0b2b('0x35')]);};VoiceQueueReport['prototype'][_0x0b2b('0x62')]=function(_0x78eecb,_0x2857f6){var _0x44077c=this[_0x0b2b('0x5f')](_0x78eecb,_0x2857f6);var _0x38702d=![];_0x38702d=_0x44077c[_0x0b2b('0x63')](_0x78eecb);if(_0x38702d){Object[_0x0b2b('0x64')](_0x78eecb,_0x44077c);this[_0x0b2b('0x10')][_0x0b2b('0x13')][_0x78eecb['name']]=_0x78eecb;this['emitInboundVoiceQueueSummary'](_0x44077c);}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x65')]=function(_0x1989b3){var _0x2dba6e=null;var _0x1b14e8=this['summary']['id'];if(this[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x1b14e8]){_0x2dba6e=this[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x1b14e8][_0x1989b3['actionid']];}if(!_0x2dba6e){this['summary']=initializeSummary();return;}var _0xed5871=this[_0x0b2b('0x13')][_0x2dba6e[_0x0b2b('0x49')]];if(_0xed5871[_0x0b2b('0x66')]===_0x0b2b('0x67')){this['handleInboundQueueSummaryReport'](_0xed5871,_0x2dba6e);}else if(_0xed5871[_0x0b2b('0x66')]===_0x0b2b('0x68')){var _0x22981d=this[_0x0b2b('0x5f')](_0xed5871,_0x2dba6e);ami[_0x0b2b('0x45')](_0x0b2b('0x69'),_0x22981d);}this[_0x0b2b('0x15')][_0x0b2b('0x6a')]-=0x1;var _0x3bcbb9=this['summary'][_0x0b2b('0x6a')]>0x0?!![]:![];if(!_0x3bcbb9){return this[_0x0b2b('0x19')](this[_0x0b2b('0x15')][_0x0b2b('0x6b')]);}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x6c')]=function(_0x582c62){var _0x8d3c5f=this['summary']['id'];if(this[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x8d3c5f]&&this[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x8d3c5f][_0x582c62['actionid']]){this['summary'][_0x0b2b('0x5d')][_0x8d3c5f][_0x582c62['actionid']][_0x0b2b('0x11')][_0x0b2b('0x6d')](_0x582c62);}};VoiceQueueReport[_0x0b2b('0xa')]['syncQueueSummary']=function(_0x1adb4f){var _0x197d80=this;try{if(this['isNotNull'](_0x1adb4f)&&this[_0x0b2b('0x55')](_0x1adb4f[_0x0b2b('0x49')])){logger[_0x0b2b('0x4b')](_0x0b2b('0x6e'),util[_0x0b2b('0x3c')](_0x1adb4f,{'showHidden':![],'depth':null}));var _0x17a3f4=this[_0x0b2b('0x13')][_0x1adb4f['queue']];if(_0x17a3f4){logger[_0x0b2b('0x4b')](_0x0b2b('0x6f'),_0x17a3f4[_0x0b2b('0x54')]);this[_0x0b2b('0x15')][_0x0b2b('0x57')][_0x17a3f4[_0x0b2b('0x54')]]={'summaryEvent':_0x1adb4f};this[_0x0b2b('0x15')][_0x0b2b('0x6a')]+=0x1;return ami[_0x0b2b('0x36')]({'action':_0x0b2b('0x5d'),'queue':_0x17a3f4[_0x0b2b('0x54')]})['then'](function(_0x55fbb3){if(!_0x197d80['summary'][_0x0b2b('0x5d')][_0x1adb4f[_0x0b2b('0x5c')]]){_0x197d80[_0x0b2b('0x15')]['queuestatus'][_0x1adb4f['actionid']]={};}_0x197d80['summary'][_0x0b2b('0x5d')][_0x1adb4f[_0x0b2b('0x5c')]][_0x55fbb3[_0x0b2b('0x5c')]]={'queue':_0x17a3f4['name'],'agents':[]};})['catch'](function(_0xb02d15){throw _0xb02d15;});}}}catch(_0x40ce9f){logger[_0x0b2b('0x3d')](_0x0b2b('0x5e'),util['inspect'](_0x40ce9f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0b2b('0x19')]=function(_0x955376){if(this[_0x0b2b('0x15')]['statusRequests']>0x0){this[_0x0b2b('0x15')][_0x0b2b('0x6b')]=_0x955376;return;}logger['debug'](_0x0b2b('0x70'),util['inspect'](_0x955376,{'showHidden':![],'depth':null}));this[_0x0b2b('0x15')]=initializeSummary();ami[_0x0b2b('0x45')](_0x0b2b('0x71'),{});};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x72')]=function(_0x3ae799){try{if(this['isNotNull'](_0x3ae799)){logger[_0x0b2b('0x4b')](_0x0b2b('0x73'),_0x3ae799['uniqueid'],util[_0x0b2b('0x3c')](_0x3ae799,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x0b2b('0xf')][_0x3ae799[_0x0b2b('0x4d')]])){this[_0x0b2b('0xf')][_0x3ae799[_0x0b2b('0x4d')]]=[];}if(_[_0x0b2b('0x56')](this[_0x0b2b('0x35')][_0x3ae799[_0x0b2b('0x4d')]])){this['channels'][_0x3ae799['uniqueid']]={};}var _0x1e9ae5=new QueueReport();_0x1e9ae5['queue']=_0x3ae799[_0x0b2b('0x49')];_0x1e9ae5[_0x0b2b('0x66')]=this[_0x0b2b('0x13')][_0x1e9ae5[_0x0b2b('0x49')]]&&this['voiceQueues'][_0x1e9ae5[_0x0b2b('0x49')]][_0x0b2b('0x66')]?this[_0x0b2b('0x13')][_0x1e9ae5[_0x0b2b('0x49')]]['type']||_0x0b2b('0x67'):'inbound';_0x1e9ae5[_0x0b2b('0x74')]=moment()[_0x0b2b('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e9ae5[_0x0b2b('0x75')]=_0x3ae799['position'];_0x1e9ae5[_0x0b2b('0x76')]=_0x3ae799[_0x0b2b('0x76')];_0x1e9ae5[_0x0b2b('0x4d')]=_0x3ae799['uniqueid'];_0x1e9ae5['routealias']=this[_0x0b2b('0x35')][_0x3ae799['uniqueid']]['routealias'];logger[_0x0b2b('0x77')](_0x0b2b('0x78'),_0x1e9ae5[_0x0b2b('0x49')],_0x1e9ae5[_0x0b2b('0x66')]);Object['assign'](_0x1e9ae5,_[_0x0b2b('0x79')](_0x3ae799,_['keys'](_0x1e9ae5)));this[_0x0b2b('0xf')][_0x3ae799[_0x0b2b('0x4d')]][_0x0b2b('0x6d')](_0x1e9ae5);this[_0x0b2b('0x35')][_0x3ae799[_0x0b2b('0x4d')]]=_0x1e9ae5;this[_0x0b2b('0x7a')](_0x1e9ae5,_0x0b2b('0x1b'));}}catch(_0x17a139){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x3ae799[_0x0b2b('0x4d')],util['inspect'](_0x17a139,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')]['syncQueueCallerAbandon']=function(_0x185588){try{if(this[_0x0b2b('0x55')](_0x185588)){logger[_0x0b2b('0x4b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x185588['uniqueid'],util[_0x0b2b('0x3c')](_0x185588,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x185588[_0x0b2b('0x4d')]]){var _0x11a56f=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x185588['uniqueid']]);_0x11a56f[_0x0b2b('0x33')]=![];_0x11a56f[_0x0b2b('0x7c')]=null;_0x11a56f[_0x0b2b('0x7d')]=_0x185588[_0x0b2b('0x7d')];_0x11a56f[_0x0b2b('0x7e')]=_0x185588[_0x0b2b('0x7e')];_0x11a56f[_0x0b2b('0x1c')]=!![];_0x11a56f[_0x0b2b('0x7f')]=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x11a56f[_0x0b2b('0x4e')]=_0x0b2b('0x81');_0x11a56f[_0x0b2b('0x82')]=null;logger[_0x0b2b('0x77')](_0x0b2b('0x83'),_0x11a56f['queue'],_0x11a56f[_0x0b2b('0x66')]);this['channels'][_0x185588[_0x0b2b('0x4d')]]=_0x11a56f;this[_0x0b2b('0x43')](_0x11a56f,_0x0b2b('0x1c'));}}}catch(_0x2279a0){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x185588[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x2279a0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')]['syncQueueCallerLeave']=function(_0x417323){try{if(this['isNotNull'](_0x417323)){logger['debug'](_0x0b2b('0x84'),_0x417323[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x417323,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x417323['uniqueid']]){var _0x362819=_[_0x0b2b('0x7b')](this['queueReports'][_0x417323[_0x0b2b('0x4d')]]);_0x362819[_0x0b2b('0x85')]=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x362819[_0x0b2b('0x86')]=_0x417323[_0x0b2b('0x86')];_0x362819[_0x0b2b('0x87')]=_0x417323[_0x0b2b('0x87')];logger[_0x0b2b('0x77')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x362819['queue'],_0x362819['type'],_0x417323[_0x0b2b('0x86')],_0x417323[_0x0b2b('0x87')]);this[_0x0b2b('0x35')][_0x417323[_0x0b2b('0x4d')]]=_0x362819;this[_0x0b2b('0x7a')](_0x362819,_0x0b2b('0x1e'));}}}catch(_0x2f5b16){logger[_0x0b2b('0x3d')](_0x0b2b('0x84'),_0x417323['uniqueid'],util['inspect'](_0x2f5b16,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0b2b('0x88')]=function(_0x3e7384){try{if(this['isNotNull'](_0x3e7384)){logger[_0x0b2b('0x4b')](_0x0b2b('0x89'),_0x3e7384[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x3e7384,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3e7384[_0x0b2b('0x4d')]]){var _0x534dc0=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x3e7384[_0x0b2b('0x4d')]]);_0x534dc0[_0x0b2b('0x33')]=!![];_0x534dc0[_0x0b2b('0x4e')]=_0x0b2b('0x8a');logger[_0x0b2b('0x77')](_0x0b2b('0x8b'),_0x534dc0[_0x0b2b('0x49')],_0x534dc0[_0x0b2b('0x66')]);}}}catch(_0xbfba8e){logger[_0x0b2b('0x3d')](_0x0b2b('0x89'),_0x3e7384[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0xbfba8e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x8c')]=function(_0x4ba56f){try{if(this[_0x0b2b('0x55')](_0x4ba56f)){logger[_0x0b2b('0x4b')](_0x0b2b('0x8d'),_0x4ba56f['uniqueid'],util[_0x0b2b('0x3c')](_0x4ba56f,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x4ba56f[_0x0b2b('0x4d')]]){var _0x5f3caf=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x4ba56f[_0x0b2b('0x4d')]]);_0x5f3caf[_0x0b2b('0x1c')]=![];_0x5f3caf['queuecallerabandonAt']=null;_0x5f3caf['assigned']=!![];_0x5f3caf[_0x0b2b('0x82')]=_0x4ba56f['membername'];_0x5f3caf[_0x0b2b('0x7d')]=_0x4ba56f[_0x0b2b('0x7d')];_0x5f3caf[_0x0b2b('0x33')]=!![];_0x5f3caf[_0x0b2b('0x32')]=![];_0x5f3caf[_0x0b2b('0x8e')]=null;if(!_0x5f3caf[_0x0b2b('0x8f')]){if(_0x4ba56f[_0x0b2b('0x90')]==_0x0b2b('0x8f')){_0x5f3caf[_0x0b2b('0x4e')]=_0x0b2b('0x91');logger[_0x0b2b('0x77')](_0x0b2b('0x92'),_0x5f3caf['queue'],_0x5f3caf['type']);}else{if(_[_0x0b2b('0x93')](_0x4ba56f[_0x0b2b('0x38')][_0x0b2b('0x94')](),_0x0b2b('0x95'))){if(this[_0x0b2b('0xf')][_0x4ba56f[_0x0b2b('0x96')]]){var _0x1b3bad=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x4ba56f['linkedid']]);_0x1b3bad[_0x0b2b('0x33')]=![];_0x1b3bad[_0x0b2b('0x32')]=!![];_0x1b3bad['queuecallerexitAt']=moment(_0x5f3caf[_0x0b2b('0x74')])['add'](_0x4ba56f[_0x0b2b('0x7d')],'seconds')[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x1b3bad[_0x0b2b('0x4e')]=_0x0b2b('0x97');_0x1b3bad['transfer']=!![];_0x1b3bad[_0x0b2b('0x98')]=_0x0b2b('0x99');_0x1b3bad[_0x0b2b('0x9a')]=_0x4ba56f[_0x0b2b('0x9b')];_0x1b3bad[_0x0b2b('0x9c')]=_0x4ba56f['uniqueid'];logger[_0x0b2b('0x77')](_0x0b2b('0x9d'),_0x1b3bad[_0x0b2b('0x49')],_0x1b3bad[_0x0b2b('0x66')]);var _0x7693c8=this['queueReports'][_0x4ba56f['linkedid']];this['queueReports'][_0x4ba56f[_0x0b2b('0x96')]]=this[_0x0b2b('0xf')][_0x4ba56f[_0x0b2b('0x4d')]];this['queueReports'][_0x4ba56f[_0x0b2b('0x4d')]]=_0x7693c8;}}else{_0x5f3caf['queuecallerexitreason']=_0x0b2b('0x9e')+_0x4ba56f[_0x0b2b('0x90')][_0x0b2b('0x9f')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x5f3caf['queue'],_0x5f3caf[_0x0b2b('0x66')],_0x5f3caf[_0x0b2b('0x4e')]);}}}this[_0x0b2b('0x35')][_0x4ba56f['uniqueid']]=_0x5f3caf;}}}catch(_0x3db38e){logger[_0x0b2b('0x3d')]('[%s][voiceQueueReport][agentcomplete]',_0x4ba56f[_0x0b2b('0x4d')],util['inspect'](_0x3db38e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x22')]=function(_0x121717){try{if(this[_0x0b2b('0x55')](_0x121717)){logger['debug']('[%s][voiceQueueReport][varset]',_0x121717[_0x0b2b('0x4d')],util['inspect'](_0x121717,{'showHidden':![],'depth':null}));this[_0x0b2b('0xa0')](_0x121717[_0x0b2b('0x4d')],_[_0x0b2b('0xa1')](_0x121717['variable'])[0x0],_0x121717[_0x0b2b('0xa2')]);if(this[_0x0b2b('0xf')][_0x121717[_0x0b2b('0x4d')]]){var _0x5a6a2e=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x121717['uniqueid']]);if(_0x5a6a2e){if(this[_0x0b2b('0x55')](_0x121717['variable'])&&this[_0x0b2b('0x55')](_0x121717[_0x0b2b('0xa3')]['queuestatus'])){switch(_0x121717[_0x0b2b('0xa2')]){case _0x0b2b('0xa4'):_0x5a6a2e[_0x0b2b('0x32')]=![];_0x5a6a2e[_0x0b2b('0x8e')]=null;break;case _0x0b2b('0xa5'):_0x5a6a2e[_0x0b2b('0xa6')]='timeout';_0x5a6a2e[_0x0b2b('0x32')]=!![];_0x5a6a2e[_0x0b2b('0x8e')]=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x5a6a2e[_0x0b2b('0x85')]=moment()[_0x0b2b('0x47')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x0b2b('0x4b')](_0x0b2b('0xa7'),_0x121717[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x5a6a2e,{'showHidden':![],'depth':null}));ami[_0x0b2b('0x45')](_0x0b2b('0xa8'),_0x5a6a2e);break;default:_0x5a6a2e['queuecallerexit']=!![];_0x5a6a2e['queuecallerexitAt']=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x5a6a2e[_0x0b2b('0x85')]=moment()['format'](_0x0b2b('0x80'));}_0x5a6a2e['queuecallerabandon']=![];_0x5a6a2e[_0x0b2b('0x7f')]=null;_0x5a6a2e[_0x0b2b('0x4e')]=_0x121717[_0x0b2b('0xa2')];this['channels'][_0x121717['uniqueid']]=_0x5a6a2e;this['emitVoiceQueueChannelRemove'](_0x5a6a2e,_0x0b2b('0x21'));}else if(this[_0x0b2b('0x55')](_0x121717[_0x0b2b('0xa3')])&&this[_0x0b2b('0x55')](_0x121717[_0x0b2b('0xa3')]['queueposition'])){if(!_0x5a6a2e[_0x0b2b('0x1c')]){_0x5a6a2e[_0x0b2b('0x32')]=!![];_0x5a6a2e[_0x0b2b('0x8e')]=moment()['format'](_0x0b2b('0x80'));_0x5a6a2e[_0x0b2b('0x4e')]='EXITWITHKEY';_0x5a6a2e[_0x0b2b('0x85')]=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));this[_0x0b2b('0x35')][_0x121717[_0x0b2b('0x4d')]]=_0x5a6a2e;}}logger[_0x0b2b('0x77')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x121717['uniqueid'],_0x5a6a2e[_0x0b2b('0x49')],_0x5a6a2e[_0x0b2b('0x66')],_[_0x0b2b('0xa1')](_0x121717['variable'])[0x0],_0x121717[_0x0b2b('0xa2')]);_0x5a6a2e[_0x0b2b('0x16')]=this[_0x0b2b('0x16')][_0x121717[_0x0b2b('0x4d')]];}}}}catch(_0x3547f0){logger[_0x0b2b('0x3d')](_0x0b2b('0xa9'),_0x121717[_0x0b2b('0x4d')],util['inspect'](_0x3547f0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0xa0')]=function(_0x362ce2,_0x573112,_0x3d4e76){var _0x2d6f52=[_0x0b2b('0xaa'),_0x0b2b('0xab'),_0x0b2b('0xac'),'rtpaudioqosjitterbridged',_0x0b2b('0xad'),_0x0b2b('0xae'),_0x0b2b('0xaf'),'rtpaudioqosrttbridged',_0x0b2b('0xb0'),_0x0b2b('0xb1'),_0x0b2b('0xb2'),_0x0b2b('0xb3'),'membercalls','memberdynamic',_0x0b2b('0xb4'),_0x0b2b('0xb5'),_0x0b2b('0xb6'),_0x0b2b('0xb7'),'memberrealtime'];if(!_[_0x0b2b('0xb8')](_0x573112)&&!_[_0x0b2b('0xb9')](_0x2d6f52,_0x573112)){if(_[_0x0b2b('0x56')](this[_0x0b2b('0x16')][_0x362ce2])){this[_0x0b2b('0x16')][_0x362ce2]={};}this[_0x0b2b('0x16')][_0x362ce2][_0x573112]=_0x3d4e76;}};VoiceQueueReport['prototype']['handleHangup']=function(_0x2e8149,_0x4ce2a5,_0x3e299f){try{var _0xe9ddb={};if(this[_0x0b2b('0xf')][_0x2e8149]){for(var _0x2aab18=0x0;_0x2aab18<this[_0x0b2b('0xf')][_0x2e8149][_0x0b2b('0xba')];_0x2aab18+=0x1){_0xe9ddb=this['queueReports'][_0x2e8149][_0x2aab18];var _0x2674dd=this[_0x0b2b('0x13')][_0xe9ddb['queue']];if(_0x2674dd){_0x2674dd[_0x0b2b('0xbb')]+=moment(_0xe9ddb['queuecallerleaveAt'])[_0x0b2b('0xbc')](_0xe9ddb[_0x0b2b('0x74')],'seconds')||0x0;if(_0x3e299f&&_0xe9ddb['queuecallerexitreason']===_0x0b2b('0x4f')){_0xe9ddb['queuecallerexitreason']='COMPLETEDBYAGENT';}if(_0x2aab18===this[_0x0b2b('0xf')][_0x2e8149][_0x0b2b('0xba')]-0x1){_0x2674dd[_0x0b2b('0xbd')]+=moment()['milliseconds'](0x0)[_0x0b2b('0xbc')](_0xe9ddb[_0x0b2b('0x74')],_0x0b2b('0xbe'));if(hasCallerLeftTheQueue(_0xe9ddb)&&_0xe9ddb[_0x0b2b('0x4e')]!==_0x0b2b('0x4f')){_0x2674dd[_0x0b2b('0xbf')]+=0x1;}if(_0xe9ddb[_0x0b2b('0x33')]){_0x2674dd[_0x0b2b('0xc0')]+=0x1;_0x2674dd[_0x0b2b('0xc1')]+=moment()['milliseconds'](0x0)['diff'](_0xe9ddb[_0x0b2b('0x85')],'seconds');_0xe9ddb['queuecallercompleteAt']=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0xe9ddb[_0x0b2b('0x32')]=![];_0xe9ddb[_0x0b2b('0x8e')]=null;}if(_0xe9ddb['queuecallerexit']&&_0xe9ddb['transfer']!=!![]){_0x2674dd[_0x0b2b('0xc2')]+=0x1;_0xe9ddb[_0x0b2b('0xa6')]=_0x0b2b('0xc2');logger[_0x0b2b('0x4b')](_0x0b2b('0xc3'),_0x2e8149,util[_0x0b2b('0x3c')](_0xe9ddb,{'showHidden':![],'depth':null}));ami['emit'](_0x0b2b('0xc4'),_0xe9ddb);}if(_0xe9ddb['queuecallerabandon']){_0x2674dd[_0x0b2b('0xc5')]+=0x1;_0xe9ddb[_0x0b2b('0xa6')]=_0x0b2b('0xc5');logger[_0x0b2b('0x4b')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x2e8149,util[_0x0b2b('0x3c')](_0xe9ddb,{'showHidden':![],'depth':null}));ami['emit'](_0x0b2b('0xc6'),_0xe9ddb);}}else{_0x2674dd[_0x0b2b('0xbd')]+=_0x2674dd[_0x0b2b('0xbb')];}logger[_0x0b2b('0x77')](_0x0b2b('0xc7'),_0x2e8149,_0xe9ddb[_0x0b2b('0x49')],_0xe9ddb[_0x0b2b('0x66')],_0x4ce2a5);this['channels'][_0x2e8149]=_0xe9ddb;Object[_0x0b2b('0x64')](this['voiceQueues'][_0xe9ddb[_0x0b2b('0x49')]],_0x2674dd);if(_0xe9ddb['queuecallerleaveAt']){this[_0x0b2b('0x43')](_0xe9ddb,_0x0b2b('0x23'));}}}logger[_0x0b2b('0x4b')](_0x0b2b('0xc8'),_0x2e8149,util['inspect'](this[_0x0b2b('0xf')][_0x2e8149],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0xe9ddb)&&_0xe9ddb[_0x0b2b('0x4e')]!==_0x0b2b('0x4f')){ami[_0x0b2b('0x45')](_0x0b2b('0xc9'),this[_0x0b2b('0xf')][_0x2e8149]);if(this[_0x0b2b('0xf')][_0x2e8149]){delete this['queueReports'][_0x2e8149];}if(this[_0x0b2b('0x35')][_0x2e8149]){delete this[_0x0b2b('0x35')][_0x2e8149];}if(this[_0x0b2b('0x16')][_0x2e8149]){delete this[_0x0b2b('0x16')][_0x2e8149];}}}}catch(_0x5d5eb2){logger[_0x0b2b('0x3d')](_0x0b2b('0xca'),_0x2e8149,util[_0x0b2b('0x3c')](_0x5d5eb2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x24')]=function(_0x5873af){try{if(this[_0x0b2b('0x55')](_0x5873af)){logger[_0x0b2b('0x4b')](_0x0b2b('0xcb'),_0x5873af[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x5873af,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x5873af[_0x0b2b('0x4d')]]){return this[_0x0b2b('0xcc')](_0x5873af['uniqueid'],_0x5873af[_0x0b2b('0xcd')],![]);}if(this[_0x0b2b('0xf')][_0x5873af[_0x0b2b('0x96')]]){if(_0x5873af[_0x0b2b('0xce')]==='21'){return;}return this[_0x0b2b('0xcc')](_0x5873af[_0x0b2b('0x96')],_0x5873af[_0x0b2b('0xcd')],!![]);}var _0xdfdebc=Object[_0x0b2b('0xa1')](this[_0x0b2b('0xf')]);for(var _0x10e86a=0x0;_0x10e86a<_0xdfdebc[_0x0b2b('0xba')];_0x10e86a++){var _0x2150ae=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0xdfdebc[_0x10e86a]]);if(_0x2150ae&&_0x2150ae[_0x0b2b('0xcf')]===_0x5873af['uniqueid']){return this['handleHangup'](_0x2150ae[_0x0b2b('0x4d')],_0x5873af['cause-txt'],!![]);}}if(!this[_0x0b2b('0xf')][_0x5873af[_0x0b2b('0x4d')]]){logger[_0x0b2b('0x4b')](_0x0b2b('0xd0'),_0x5873af[_0x0b2b('0x4d')]);if(this[_0x0b2b('0x35')][_0x5873af[_0x0b2b('0x4d')]]){delete this[_0x0b2b('0x35')][_0x5873af['uniqueid']];}if(this[_0x0b2b('0x16')][_0x5873af[_0x0b2b('0x4d')]]){delete this['variables'][_0x5873af[_0x0b2b('0x4d')]];}}}}catch(_0x313638){logger['error']('[%s][voiceQueueReport][hangup]',_0x5873af['uniqueid'],util[_0x0b2b('0x3c')](_0x313638,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')]['syncAttendedTransfer']=function(_0x3c22cb){try{if(this[_0x0b2b('0x55')](_0x3c22cb)){logger['debug'](_0x0b2b('0xd1'),_0x3c22cb['uniqueid'],util[_0x0b2b('0x3c')](_0x3c22cb,{'showHidden':![],'depth':null}));var _0x164a13;var _0x558ecc;var _0x43499f;if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd2')]]){_0x164a13=_['last'](this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd2')]]);_0x164a13[_0x0b2b('0x9a')]=_0x3c22cb['secondtransfererexten'];_0x164a13[_0x0b2b('0x9c')]=_0x3c22cb[_0x0b2b('0xd3')];_0x164a13[_0x0b2b('0x4e')]=_0x0b2b('0x4f');_0x164a13[_0x0b2b('0x8f')]=!![];_0x164a13[_0x0b2b('0x98')]='ATTENDED';if(this['queueReports'][_0x3c22cb[_0x0b2b('0xd3')]]){_0x43499f=this[_0x0b2b('0xf')][_0x3c22cb['secondtransfereruniqueid']];this['queueReports'][_0x3c22cb[_0x0b2b('0xd3')]]=this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd2')]];this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd2')]]=_0x43499f;_0x558ecc=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x3c22cb['transfereeuniqueid']]);_0x558ecc[_0x0b2b('0xd4')]=!![];}logger[_0x0b2b('0x77')](_0x0b2b('0xd5'),_0x3c22cb['uniqueid'],_0x164a13[_0x0b2b('0x49')],_0x164a13['type'],_0x164a13[_0x0b2b('0x9a')],_0x164a13[_0x0b2b('0x9c')]);}else if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd6')]]){_0x164a13=_['last'](this[_0x0b2b('0xf')][_0x3c22cb['transfertargetuniqueid']]);_0x164a13[_0x0b2b('0x9a')]=_0x3c22cb[_0x0b2b('0xd7')];_0x164a13[_0x0b2b('0x9c')]=_0x3c22cb['origtransfereruniqueid'];_0x164a13[_0x0b2b('0x4e')]=_0x0b2b('0x4f');_0x164a13['transfer']=!![];_0x164a13[_0x0b2b('0x98')]=_0x0b2b('0xd8');if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd9')]]){_0x43499f=this['queueReports'][_0x3c22cb['origtransfereruniqueid']];this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd9')]]=this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd6')]];this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd6')]]=_0x43499f;_0x558ecc=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd6')]]);_0x558ecc[_0x0b2b('0xd4')]=!![];}logger['info'](_0x0b2b('0xd5'),_0x3c22cb[_0x0b2b('0x4d')],_0x164a13[_0x0b2b('0x49')],_0x164a13[_0x0b2b('0x66')],_0x164a13[_0x0b2b('0x9a')],_0x164a13[_0x0b2b('0x9c')]);}else if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd9')]]){_0x164a13=_[_0x0b2b('0x7b')](this['queueReports'][_0x3c22cb['origtransfereruniqueid']]);_0x164a13[_0x0b2b('0x9a')]=_0x3c22cb['origtransfererexten'];_0x164a13[_0x0b2b('0x9c')]=_0x3c22cb[_0x0b2b('0xd9')];_0x164a13[_0x0b2b('0x4e')]='ATTENDEDTRANSFER';_0x164a13['transfer']=!![];_0x164a13[_0x0b2b('0x98')]='ATTENDED';_0x164a13[_0x0b2b('0xd4')]=!![];_0x164a13[_0x0b2b('0xcf')]=_0x3c22cb[_0x0b2b('0xd2')];}else if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd3')]]){_0x164a13=_['last'](this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd3')]]);_0x164a13[_0x0b2b('0x9a')]=_0x3c22cb['secondtransfererexten'];_0x164a13[_0x0b2b('0x9c')]=_0x3c22cb[_0x0b2b('0xd3')];_0x164a13[_0x0b2b('0x4e')]=_0x0b2b('0x4f');_0x164a13[_0x0b2b('0x8f')]=!![];_0x164a13[_0x0b2b('0x98')]=_0x0b2b('0xd8');_0x164a13['switch']=!![];_0x164a13[_0x0b2b('0xcf')]=_0x3c22cb[_0x0b2b('0xd6')];}}}catch(_0x4153d3){logger[_0x0b2b('0x3d')](_0x0b2b('0xd1'),_0x3c22cb[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x4153d3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x2c')]=function(_0x6d8e7b){try{if(this['isNotNull'](_0x6d8e7b)){logger[_0x0b2b('0x4b')](_0x0b2b('0xda'),_0x6d8e7b['uniqueid'],util[_0x0b2b('0x3c')](_0x6d8e7b,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x6d8e7b[_0x0b2b('0xd2')]]){var _0x2c7bf4=_['last'](this[_0x0b2b('0xf')][_0x6d8e7b[_0x0b2b('0xd2')]]);_0x2c7bf4[_0x0b2b('0x4e')]=_0x0b2b('0xdb');_0x2c7bf4[_0x0b2b('0x8f')]=!![];_0x2c7bf4[_0x0b2b('0x98')]=_0x0b2b('0xdc');_0x2c7bf4['transferexten']=_0x6d8e7b[_0x0b2b('0xdd')];_0x2c7bf4[_0x0b2b('0x9c')]=_0x6d8e7b['transfereeuniqueid'];logger['info'](_0x0b2b('0xde'),_0x6d8e7b[_0x0b2b('0x4d')],_0x2c7bf4[_0x0b2b('0x49')],_0x2c7bf4[_0x0b2b('0x66')],_0x2c7bf4[_0x0b2b('0x9a')],_0x2c7bf4[_0x0b2b('0x9c')]);this[_0x0b2b('0x24')]({'event':_0x0b2b('0xdf'),'uniqueid':_0x6d8e7b[_0x0b2b('0xd2')],'context':_0x6d8e7b[_0x0b2b('0xe0')],'channel':_0x6d8e7b[_0x0b2b('0xe1')]});}}}catch(_0x3a1b1d){logger[_0x0b2b('0x3d')](_0x0b2b('0xda'),_0x6d8e7b['uniqueid'],util['inspect'](_0x3a1b1d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncMusicOnHoldStart']=function(_0x5a1ab9){try{if(this[_0x0b2b('0x55')](_0x5a1ab9)){logger[_0x0b2b('0x4b')](_0x0b2b('0xe2'),_0x5a1ab9[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x5a1ab9,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x5a1ab9[_0x0b2b('0x4d')]]){var _0x50f3d1=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x5a1ab9[_0x0b2b('0x4d')]]);if(!_[_0x0b2b('0xb8')](_0x50f3d1[_0x0b2b('0x85')])){_0x50f3d1[_0x0b2b('0xe3')]=moment()['format'](_0x0b2b('0x80'));logger['info'](_0x0b2b('0xe4'),_0x5a1ab9[_0x0b2b('0x4d')],_0x50f3d1[_0x0b2b('0xe3')]);}}}}catch(_0x570436){logger['error'](_0x0b2b('0xe2'),_0x5a1ab9[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x570436,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x28')]=function(_0x309d39){try{if(this[_0x0b2b('0x55')](_0x309d39)){logger['debug'](_0x0b2b('0xe5'),_0x309d39[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x309d39,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x309d39[_0x0b2b('0x4d')]]){var _0x42250d=_['last'](this[_0x0b2b('0xf')][_0x309d39['uniqueid']]);if(!_[_0x0b2b('0xb8')](_0x42250d[_0x0b2b('0xe3')])){_0x42250d[_0x0b2b('0xe6')]+=moment()[_0x0b2b('0xe7')](0x0)[_0x0b2b('0xbc')](_0x42250d[_0x0b2b('0xe3')],_0x0b2b('0xbe'));logger[_0x0b2b('0x77')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x309d39[_0x0b2b('0x4d')],_0x42250d[_0x0b2b('0xe6')]);delete _0x42250d['mohstarttime'];}}}}catch(_0x174ddf){logger[_0x0b2b('0x3d')]('[%s][voiceQueueReport][musiconholdstop]',_0x309d39[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x174ddf,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0b2b('0xe8')]=function(_0x56af54){try{if(this['isNotNull'](_0x56af54)){logger[_0x0b2b('0x4b')](_0x0b2b('0xe9'),_0x56af54[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x56af54,{'showHidden':![],'depth':null}));if(_0x56af54[_0x0b2b('0xea')]['toLowerCase']()===_0x0b2b('0xeb')){_0x56af54[_0x0b2b('0xec')]=_0x56af54[_0x0b2b('0xed')]&&_0x56af54[_0x0b2b('0xed')][_0x0b2b('0x93')](_0x0b2b('0xee'))?_0x56af54[_0x0b2b('0xed')]:(_0x56af54[_0x0b2b('0xed')]||_0x56af54[_0x0b2b('0xec')])[_0x0b2b('0x94')]();if(_[_0x0b2b('0x93')](_0x56af54['applicationdata'][_0x0b2b('0x94')](),_0x0b2b('0xef'))){logger[_0x0b2b('0x77')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x56af54['uniqueid'],_0x56af54[_0x0b2b('0xea')],_0x56af54[_0x0b2b('0xec')]);if(_[_0x0b2b('0x56')](this['channels'][_0x56af54[_0x0b2b('0x4d')]]))this[_0x0b2b('0x35')][_0x56af54[_0x0b2b('0x4d')]]={};var _0x1c134d=_0x56af54[_0x0b2b('0xec')][_0x0b2b('0xf0')]('=');var _0xc6ed53=_0x1c134d[0x0][_0x0b2b('0x94')]()[_0x0b2b('0xf1')](/cdr\((.*)\)/);if(_0xc6ed53)this[_0x0b2b('0x35')][_0x56af54[_0x0b2b('0x4d')]][_0xc6ed53[0x1]]=_0x1c134d[0x1];}}}}catch(_0xf62ade){logger['error']('[%s][voiceQueueReport][newexten]',_0x56af54['uniqueid'],util['inspect'](_0xf62ade,{'showHidden':![],'depth':null}));}};module[_0x0b2b('0xf2')]=VoiceQueueReport;
\ No newline at end of file