Built motion from commit 1fd437e9.|2.6.19
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index 7113c6d..0cb4488 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0113=['syncAgentConnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','unlockRR','queuecallerexit','clearZombieChannels','switch','sequence','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','summary','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][','uniqueid','voice:queue:%s','queue','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','type','inbound','debug','format','name','voice_queue:save','isNotNull','isUndefined','queues','isRunning','actionid','queuestatus','createQueueSummaryReport','assign','emitInboundVoiceQueueSummary','outbound','custom:queuesummary','statusRequests','completeEvent','push','syncQueueSummary','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','then','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','syncQueueCallerJoin','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','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]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','transfertype','FORWARD','transferexten','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','syncVarSet','[%s][voiceQueueReport][varset]','variable','value','TIMEOUT','lastevent','timeout','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','keys','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','handleHangup','length','sumHoldTime','diff','answered','sumBillable','milliseconds','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','sumDuration','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','cause-txt','cause','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','transferuniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transferid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','applicationdata','appdata','CDR(routeAlias)','cdr(','split','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','defaults','redis','localhost','prototype','enqueue','tail','finally','queueReports','realtime','agents','channels','voiceQueues','campaigns','variables','queuesummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuemember','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect'];(function(_0x508a9f,_0x485f9d){var _0x20dbb3=function(_0x180b57){while(--_0x180b57){_0x508a9f['push'](_0x508a9f['shift']());}};_0x20dbb3(++_0x485f9d);}(_0x0113,0x1cd));var _0x3011=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0113[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3011('0x0'));var moment=require(_0x3011('0x1'));var util=require(_0x3011('0x2'));var Redis=require('ioredis');var config=require(_0x3011('0x3'));var logger=require(_0x3011('0x4'))(_0x3011('0x5'));var ami=require(_0x3011('0x6'));var QueueReport=require(_0x3011('0x7'));var VoiceQueueSummary=require(_0x3011('0x8'));config['redis']=_[_0x3011('0x9')](config[_0x3011('0xa')],{'host':_0x3011('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3011('0xa')]));var Sequence=function(){};Sequence[_0x3011('0xc')][_0x3011('0xd')]=function(_0x3c9900){this[_0x3011('0xe')]=this[_0x3011('0xe')]?this['tail'][_0x3011('0xf')](_0x3c9900):_0x3c9900();};function VoiceQueueReport(_0x472b86){this['sequence']=new Sequence();this[_0x3011('0x10')]={};this[_0x3011('0x11')]=_0x472b86;this['agents']=_0x472b86[_0x3011('0x12')];this[_0x3011('0x13')]=_0x472b86['queueChannels'];this[_0x3011('0x14')]=_0x472b86['voiceQueues'];this[_0x3011('0x15')]=_0x472b86['campaigns'];this['summary']=initializeSummary();this[_0x3011('0x16')]={};ami['on'](_0x3011('0x17'),this['syncQueueSummary'][_0x3011('0x18')](this));ami['on'](_0x3011('0x19'),this[_0x3011('0x1a')][_0x3011('0x18')](this));ami['on'](_0x3011('0x1b'),this['syncQueueMember'][_0x3011('0x18')](this));ami['on'](_0x3011('0x1c'),this[_0x3011('0x1d')][_0x3011('0x18')](this));ami['on'](_0x3011('0x1e'),this['syncQueueCallerJoin'][_0x3011('0x18')](this));ami['on'](_0x3011('0x1f'),this[_0x3011('0x20')][_0x3011('0x18')](this));ami['on'](_0x3011('0x21'),this[_0x3011('0x22')][_0x3011('0x18')](this));ami['on'](_0x3011('0x23'),this['syncAgentComplete'][_0x3011('0x18')](this));ami['on'](_0x3011('0x24'),this[_0x3011('0x25')][_0x3011('0x18')](this));ami['on'](_0x3011('0x26'),this['syncVarSet']['bind'](this));ami['on'](_0x3011('0x27'),this[_0x3011('0x28')][_0x3011('0x18')](this));ami['on'](_0x3011('0x29'),this[_0x3011('0x2a')][_0x3011('0x18')](this));ami['on'](_0x3011('0x2b'),this[_0x3011('0x2c')][_0x3011('0x18')](this));ami['on'](_0x3011('0x2d'),this[_0x3011('0x2e')][_0x3011('0x18')](this));ami['on'](_0x3011('0x2f'),this[_0x3011('0x30')][_0x3011('0x18')](this));ami['on'](_0x3011('0x31'),this['syncBlindTransfer']['bind'](this));this[_0x3011('0x32')]();this[_0x3011('0x33')]();}function clearChannels(_0x10c85b){if(!_[_0x3011('0x34')](_0x10c85b)){for(var _0x34d8ab in _0x10c85b){if(_0x10c85b[_0x3011('0x35')](_0x34d8ab)){delete _0x10c85b[_0x34d8ab];}}}}function clearCampaigns(_0x3128e4){if(!_[_0x3011('0x34')](_0x3128e4)){for(var _0x25ff07 in _0x3128e4){if(_0x3128e4['hasOwnProperty'](_0x25ff07)){_0x3128e4[_0x25ff07][_0x3011('0x36')]=0x0;}}}}function clearVoiceQueues(_0x3dee75){if(!_[_0x3011('0x34')](_0x3dee75)){for(var _0x4a7262 in _0x3dee75){if(_0x3dee75[_0x3011('0x35')](_0x4a7262)){_0x3dee75[_0x4a7262][_0x3011('0x36')]=0x0;_0x3dee75[_0x4a7262][_0x3011('0x37')]=0x0;_0x3dee75[_0x4a7262][_0x3011('0x38')]=0x0;_0x3dee75[_0x4a7262][_0x3011('0x39')]=0x0;_0x3dee75[_0x4a7262]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x489b0e){if(!_[_0x3011('0x34')](_0x489b0e)){for(var _0x36329a in _0x489b0e){if(_0x489b0e[_0x3011('0x35')](_0x36329a)){_0x489b0e[_0x36329a][_0x3011('0x3a')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x537d20){return _0x537d20[_0x3011('0x3b')]||_0x537d20[_0x3011('0x1f')]||_0x537d20['queuecallercomplete'];}VoiceQueueReport[_0x3011('0xc')][_0x3011('0x3c')]=function(){var _0x55722=this;for(var _0x3824aa in this['channels']){if(this['channels']['hasOwnProperty'](_0x3824aa)&&!this['channels'][_0x3824aa][_0x3011('0x3d')]){this[_0x3011('0x3e')]['enqueue'](function(){if(!_[_0x3011('0x3f')](_0x55722['channels'][_0x3824aa])){return ami[_0x3011('0x40')]({'action':_0x3011('0x41'),'channel':_0x55722[_0x3011('0x13')][_0x3824aa][_0x3011('0x42')]})[_0x3011('0x43')](function(_0x9de8cd){if(_0x9de8cd[_0x3011('0x44')]===_0x3011('0x45')){setTimeout(function(){if(_0x55722[_0x3011('0x13')][_0x3824aa]){delete _0x55722[_0x3011('0x13')][_0x3824aa];logger[_0x3011('0x46')](_0x3011('0x47'),_0x3824aa,util[_0x3011('0x48')](_0x9de8cd,{'showHidden':![],'depth':null}));}if(_0x55722[_0x3011('0x10')][_0x3824aa]){delete _0x55722[_0x3011('0x10')][_0x3824aa];logger['error'](_0x3011('0x49'),_0x3824aa,util[_0x3011('0x48')](_0x9de8cd,{'showHidden':![],'depth':null}));}if(_0x55722[_0x3011('0x16')][_0x3824aa]){delete _0x55722['variables'][_0x3824aa];logger[_0x3011('0x46')](_0x3011('0x4a'),_0x3824aa,util[_0x3011('0x48')](_0x9de8cd,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x2a')]=function(){logger[_0x3011('0x46')](_0x3011('0x4b'));clearChannels(this[_0x3011('0x13')]);this[_0x3011('0x4c')](this[_0x3011('0x10')]);clearAgentBooked(this[_0x3011('0x12')]);clearVoiceQueues(this[_0x3011('0x14')]);clearCampaigns(this[_0x3011('0x15')]);this[_0x3011('0x4d')]=initializeSummary();};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x4c')]=function(_0x527e1c){var _0x47a826=this;if(!_[_0x3011('0x34')](_0x527e1c)){for(var _0x16adab in _0x527e1c){if(_0x527e1c[_0x3011('0x35')](_0x16adab)){_0x47a826[_0x3011('0x4e')](_0x527e1c[_0x16adab],_0x3011('0x4f'));delete _0x527e1c[_0x16adab];}}}};VoiceQueueReport[_0x3011('0xc')]['emit']=function(_0x8e35f1,_0x2a1f66,_0x2af427){io['to'](_0x8e35f1)[_0x3011('0x50')](_0x2a1f66,_0x2af427);};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x51')]=function(_0x1f7748,_0x89bee5){logger['debug'](_0x3011('0x52')+_0x89bee5+']\x20sending\x20voice_queue_channel:save\x20event:',_0x1f7748[_0x3011('0x53')],util[_0x3011('0x48')](_0x1f7748,{'showHidden':![],'depth':null}));this[_0x3011('0x50')](util['format'](_0x3011('0x54'),_0x1f7748[_0x3011('0x55')]),_0x3011('0x56'),_0x1f7748);io['emit'](_0x3011('0x57'),_0x1f7748);};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x4e')]=function(_0x404279,_0x12d023){logger['debug'](_0x3011('0x52')+_0x12d023+_0x3011('0x58'),_0x404279[_0x3011('0x53')],util[_0x3011('0x48')](_0x404279,{'showHidden':![],'depth':null}));if(_0x404279[_0x3011('0x59')]===_0x3011('0x5a')){return;}this[_0x3011('0x50')](util['format'](_0x3011('0x54'),_0x404279[_0x3011('0x55')]),_0x3011('0x5b'),_0x404279);io[_0x3011('0x50')](_0x3011('0x5c'),_0x404279);};VoiceQueueReport[_0x3011('0xc')]['emitInboundVoiceQueueSummary']=function(_0x55163b){if(_0x55163b[_0x3011('0x5d')]===_0x3011('0x5e')){logger[_0x3011('0x5f')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x3011('0x48')](_0x55163b,{'showHidden':![],'depth':null}));this[_0x3011('0x50')](util[_0x3011('0x60')](_0x3011('0x54'),_0x55163b[_0x3011('0x61')]),_0x3011('0x62'),_0x55163b);}};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x63')]=function(_0x1584d2){return _0x1584d2!==null&&!_[_0x3011('0x64')](_0x1584d2);};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x33')]=function(){var _0x49f0ff=this;setInterval(function(){_0x49f0ff[_0x3011('0x3c')]();ami[_0x3011('0x40')]({'action':_0x3011('0x65')})[_0x3011('0x43')](function(_0x58bab4){logger[_0x3011('0x46')]('[voiceQueueReport][queues]',util[_0x3011('0x48')](_0x58bab4,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x32')]=function(){var _0x25192a=this;setInterval(function(){if(!_0x25192a[_0x3011('0x4d')][_0x3011('0x66')]){return ami[_0x3011('0x40')]({'action':_0x3011('0x17')})['then'](function(_0x668b44){_0x25192a[_0x3011('0x4d')]['id']=_0x668b44[_0x3011('0x67')];_0x25192a['summary'][_0x3011('0x66')]=!![];_0x25192a[_0x3011('0x4d')][_0x3011('0x68')][_0x668b44[_0x3011('0x67')]]={};})[_0x3011('0x43')](function(_0xe0fdba){logger['error']('[voiceQueueReport][queuesummary]',util[_0x3011('0x48')](_0xe0fdba,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x69')]=function(_0x3074e3,_0x1605ed){var _0x698eba;if(this[_0x3011('0x4d')]&&this['summary']['queues']&&this[_0x3011('0x4d')][_0x3011('0x65')][_0x3074e3['name']]){_0x698eba=this[_0x3011('0x4d')][_0x3011('0x65')][_0x3074e3[_0x3011('0x61')]]['summaryEvent'];}var _0x9d02b8=new VoiceQueueSummary(_0x3074e3);return _0x9d02b8['createReport'](_0x1605ed[_0x3011('0x12')],this[_0x3011('0x12')],_0x698eba,this[_0x3011('0x11')][_0x3011('0x13')]);};VoiceQueueReport['prototype']['handleInboundQueueSummaryReport']=function(_0x516f4b,_0x4d8766){var _0x5f3c54=this[_0x3011('0x69')](_0x516f4b,_0x4d8766);var _0x5ee07b=![];_0x5ee07b=_0x5f3c54['compareToInboundQueue'](_0x516f4b);if(_0x5ee07b){Object[_0x3011('0x6a')](_0x516f4b,_0x5f3c54);this['realtime'][_0x3011('0x14')][_0x516f4b[_0x3011('0x61')]]=_0x516f4b;this[_0x3011('0x6b')](_0x5f3c54);}};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x1d')]=function(_0xceb34a){var _0xab2967=null;var _0x52871e=this[_0x3011('0x4d')]['id'];if(this[_0x3011('0x4d')][_0x3011('0x68')][_0x52871e]){_0xab2967=this[_0x3011('0x4d')]['queuestatus'][_0x52871e][_0xceb34a[_0x3011('0x67')]];}if(!_0xab2967){this['summary']=initializeSummary();return;}var _0x5ae05c=this[_0x3011('0x14')][_0xab2967[_0x3011('0x55')]];if(_0x5ae05c[_0x3011('0x5d')]===_0x3011('0x5e')){this['handleInboundQueueSummaryReport'](_0x5ae05c,_0xab2967);}else if(_0x5ae05c[_0x3011('0x5d')]===_0x3011('0x6c')){var _0x435576=this[_0x3011('0x69')](_0x5ae05c,_0xab2967);ami[_0x3011('0x50')](_0x3011('0x6d'),_0x435576);}this[_0x3011('0x4d')][_0x3011('0x6e')]-=0x1;var _0x799ebb=this['summary']['statusRequests']>0x0?!![]:![];if(!_0x799ebb){return this[_0x3011('0x1a')](this['summary'][_0x3011('0x6f')]);}};VoiceQueueReport[_0x3011('0xc')]['syncQueueMember']=function(_0x3bf6f8){var _0x353635=this[_0x3011('0x4d')]['id'];if(this[_0x3011('0x4d')][_0x3011('0x68')][_0x353635]&&this['summary']['queuestatus'][_0x353635][_0x3bf6f8[_0x3011('0x67')]]){this[_0x3011('0x4d')][_0x3011('0x68')][_0x353635][_0x3bf6f8[_0x3011('0x67')]][_0x3011('0x12')][_0x3011('0x70')](_0x3bf6f8);}};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x71')]=function(_0x4b1662){var _0x4512ad=this;try{if(this[_0x3011('0x63')](_0x4b1662)&&this[_0x3011('0x63')](_0x4b1662[_0x3011('0x55')])){logger['debug'](_0x3011('0x72'),util[_0x3011('0x48')](_0x4b1662,{'showHidden':![],'depth':null}));var _0x120c65=this[_0x3011('0x14')][_0x4b1662[_0x3011('0x55')]];if(_0x120c65){logger[_0x3011('0x5f')](_0x3011('0x73'),_0x120c65[_0x3011('0x61')]);this[_0x3011('0x4d')][_0x3011('0x65')][_0x120c65[_0x3011('0x61')]]={'summaryEvent':_0x4b1662};this[_0x3011('0x4d')][_0x3011('0x6e')]+=0x1;return ami['Action']({'action':_0x3011('0x68'),'queue':_0x120c65[_0x3011('0x61')]})[_0x3011('0x74')](function(_0x28ec9e){if(!_0x4512ad['summary'][_0x3011('0x68')][_0x4b1662[_0x3011('0x67')]]){_0x4512ad[_0x3011('0x4d')][_0x3011('0x68')][_0x4b1662[_0x3011('0x67')]]={};}_0x4512ad[_0x3011('0x4d')][_0x3011('0x68')][_0x4b1662['actionid']][_0x28ec9e['actionid']]={'queue':_0x120c65[_0x3011('0x61')],'agents':[]};})[_0x3011('0x43')](function(_0x5af8b5){throw _0x5af8b5;});}}}catch(_0x525cb9){logger[_0x3011('0x46')](_0x3011('0x75'),util[_0x3011('0x48')](_0x525cb9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3011('0xc')]['syncQueueSummaryComplete']=function(_0x129a89){if(this[_0x3011('0x4d')][_0x3011('0x6e')]>0x0){this[_0x3011('0x4d')]['completeEvent']=_0x129a89;return;}logger[_0x3011('0x5f')](_0x3011('0x76'),util[_0x3011('0x48')](_0x129a89,{'showHidden':![],'depth':null}));this[_0x3011('0x4d')]=initializeSummary();ami['emit'](_0x3011('0x77'),{});};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x78')]=function(_0x841c3a){try{if(this[_0x3011('0x63')](_0x841c3a)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x841c3a['uniqueid'],util[_0x3011('0x48')](_0x841c3a,{'showHidden':![],'depth':null}));if(_[_0x3011('0x64')](this['queueReports'][_0x841c3a[_0x3011('0x53')]])){this[_0x3011('0x10')][_0x841c3a['uniqueid']]=[];}if(_[_0x3011('0x64')](this[_0x3011('0x13')][_0x841c3a[_0x3011('0x53')]])){this['channels'][_0x841c3a[_0x3011('0x53')]]={};}var _0x5b85e2=new QueueReport();_0x5b85e2[_0x3011('0x55')]=_0x841c3a[_0x3011('0x55')];_0x5b85e2[_0x3011('0x5d')]=this[_0x3011('0x14')][_0x5b85e2['queue']]&&this['voiceQueues'][_0x5b85e2[_0x3011('0x55')]][_0x3011('0x5d')]?this[_0x3011('0x14')][_0x5b85e2[_0x3011('0x55')]][_0x3011('0x5d')]||'inbound':_0x3011('0x5e');_0x5b85e2[_0x3011('0x79')]=moment()[_0x3011('0x60')](_0x3011('0x7a'));_0x5b85e2[_0x3011('0x7b')]=_0x841c3a[_0x3011('0x7b')];_0x5b85e2[_0x3011('0x7c')]=_0x841c3a['count'];_0x5b85e2[_0x3011('0x53')]=_0x841c3a[_0x3011('0x53')];_0x5b85e2[_0x3011('0x7d')]=this['channels'][_0x841c3a[_0x3011('0x53')]][_0x3011('0x7d')];logger[_0x3011('0x7e')](_0x3011('0x7f'),_0x5b85e2[_0x3011('0x55')],_0x5b85e2['type']);Object['assign'](_0x5b85e2,_[_0x3011('0x80')](_0x841c3a,_['keys'](_0x5b85e2)));this[_0x3011('0x10')][_0x841c3a[_0x3011('0x53')]]['push'](_0x5b85e2);this[_0x3011('0x13')][_0x841c3a[_0x3011('0x53')]]=_0x5b85e2;this[_0x3011('0x51')](_0x5b85e2,_0x3011('0x1e'));}}catch(_0x5b5778){logger[_0x3011('0x46')](_0x3011('0x81'),_0x841c3a[_0x3011('0x53')],util[_0x3011('0x48')](_0x5b5778,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x20')]=function(_0x5b1cf7){try{if(this[_0x3011('0x63')](_0x5b1cf7)){logger[_0x3011('0x5f')](_0x3011('0x82'),_0x5b1cf7['uniqueid'],util[_0x3011('0x48')](_0x5b1cf7,{'showHidden':![],'depth':null}));if(this[_0x3011('0x10')][_0x5b1cf7['uniqueid']]){var _0x366364=_[_0x3011('0x83')](this['queueReports'][_0x5b1cf7[_0x3011('0x53')]]);_0x366364[_0x3011('0x84')]=![];_0x366364[_0x3011('0x85')]=null;_0x366364['holdtime']=_0x5b1cf7[_0x3011('0x86')];_0x366364[_0x3011('0x87')]=_0x5b1cf7[_0x3011('0x87')];_0x366364[_0x3011('0x1f')]=!![];_0x366364[_0x3011('0x88')]=moment()[_0x3011('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x366364['queuecallerexitreason']=_0x3011('0x89');_0x366364[_0x3011('0x8a')]=null;logger[_0x3011('0x7e')](_0x3011('0x8b'),_0x366364[_0x3011('0x55')],_0x366364[_0x3011('0x5d')]);this[_0x3011('0x13')][_0x5b1cf7[_0x3011('0x53')]]=_0x366364;this[_0x3011('0x4e')](_0x366364,'queuecallerabandon');}}}catch(_0x5cb3ab){logger[_0x3011('0x46')](_0x3011('0x82'),_0x5b1cf7[_0x3011('0x53')],util[_0x3011('0x48')](_0x5cb3ab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x22')]=function(_0x4abaff){try{if(this[_0x3011('0x63')](_0x4abaff)){logger[_0x3011('0x5f')](_0x3011('0x8c'),_0x4abaff[_0x3011('0x53')],util['inspect'](_0x4abaff,{'showHidden':![],'depth':null}));if(this[_0x3011('0x10')][_0x4abaff[_0x3011('0x53')]]){var _0x2bd38e=_[_0x3011('0x83')](this[_0x3011('0x10')][_0x4abaff[_0x3011('0x53')]]);_0x2bd38e[_0x3011('0x8d')]=moment()[_0x3011('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x2bd38e[_0x3011('0x8e')]=_0x4abaff[_0x3011('0x8e')];_0x2bd38e[_0x3011('0x8f')]=_0x4abaff[_0x3011('0x8f')];logger[_0x3011('0x7e')](_0x3011('0x90'),_0x2bd38e[_0x3011('0x55')],_0x2bd38e[_0x3011('0x5d')],_0x4abaff[_0x3011('0x8e')],_0x4abaff[_0x3011('0x8f')]);this[_0x3011('0x13')][_0x4abaff['uniqueid']]=_0x2bd38e;this[_0x3011('0x51')](_0x2bd38e,_0x3011('0x21'));}}}catch(_0x2e3f35){logger[_0x3011('0x46')]('[%s][voiceQueueReport][queuecallerleave]',_0x4abaff[_0x3011('0x53')],util[_0x3011('0x48')](_0x2e3f35,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x25')]=function(_0x1526b6){try{if(this[_0x3011('0x63')](_0x1526b6)){logger[_0x3011('0x5f')](_0x3011('0x91'),_0x1526b6[_0x3011('0x53')],util[_0x3011('0x48')](_0x1526b6,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1526b6['uniqueid']]){var _0x3d684a=_[_0x3011('0x83')](this[_0x3011('0x10')][_0x1526b6[_0x3011('0x53')]]);_0x3d684a[_0x3011('0x84')]=!![];_0x3d684a[_0x3011('0x59')]=_0x3011('0x92');logger[_0x3011('0x7e')](_0x3011('0x93'),_0x3d684a[_0x3011('0x55')],_0x3d684a['type']);}}}catch(_0x2a1dc0){logger[_0x3011('0x46')](_0x3011('0x91'),_0x1526b6[_0x3011('0x53')],util[_0x3011('0x48')](_0x2a1dc0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3011('0x94')]=function(_0x2fdbdb){try{if(this[_0x3011('0x63')](_0x2fdbdb)){logger[_0x3011('0x5f')](_0x3011('0x95'),_0x2fdbdb[_0x3011('0x53')],util[_0x3011('0x48')](_0x2fdbdb,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2fdbdb[_0x3011('0x53')]]){var _0x1118f5=_[_0x3011('0x83')](this[_0x3011('0x10')][_0x2fdbdb[_0x3011('0x53')]]);_0x1118f5[_0x3011('0x1f')]=![];_0x1118f5[_0x3011('0x88')]=null;_0x1118f5[_0x3011('0x96')]=!![];_0x1118f5[_0x3011('0x8a')]=_0x2fdbdb[_0x3011('0x97')];_0x1118f5['holdtime']=_0x2fdbdb[_0x3011('0x86')];_0x1118f5['queuecallercomplete']=!![];_0x1118f5['queuecallerexit']=![];_0x1118f5[_0x3011('0x98')]=null;if(!_0x1118f5[_0x3011('0x99')]){if(_0x2fdbdb[_0x3011('0x9a')]==_0x3011('0x99')){_0x1118f5[_0x3011('0x59')]=_0x3011('0x9b');logger['info'](_0x3011('0x9c'),_0x1118f5[_0x3011('0x55')],_0x1118f5[_0x3011('0x5d')]);}else{if(_[_0x3011('0x9d')](_0x2fdbdb[_0x3011('0x42')][_0x3011('0x9e')](),_0x3011('0x9f'))){if(this[_0x3011('0x10')][_0x2fdbdb[_0x3011('0xa0')]]){var _0x19e5d5=_[_0x3011('0x83')](this['queueReports'][_0x2fdbdb[_0x3011('0xa0')]]);_0x19e5d5[_0x3011('0x84')]=![];_0x19e5d5[_0x3011('0x3b')]=!![];_0x19e5d5[_0x3011('0x98')]=moment(_0x1118f5[_0x3011('0x79')])[_0x3011('0xa1')](_0x2fdbdb[_0x3011('0x86')],_0x3011('0xa2'))[_0x3011('0x60')](_0x3011('0x7a'));_0x19e5d5[_0x3011('0x59')]='FORWARDTRANSFER';_0x19e5d5[_0x3011('0x99')]=!![];_0x19e5d5[_0x3011('0xa3')]=_0x3011('0xa4');_0x19e5d5[_0x3011('0xa5')]=_0x2fdbdb[_0x3011('0xa6')];_0x19e5d5['transferuniqueid']=_0x2fdbdb[_0x3011('0x53')];logger[_0x3011('0x7e')](_0x3011('0xa7'),_0x19e5d5['queue'],_0x19e5d5[_0x3011('0x5d')]);var _0xe588d0=this[_0x3011('0x10')][_0x2fdbdb[_0x3011('0xa0')]];this[_0x3011('0x10')][_0x2fdbdb[_0x3011('0xa0')]]=this['queueReports'][_0x2fdbdb[_0x3011('0x53')]];this[_0x3011('0x10')][_0x2fdbdb[_0x3011('0x53')]]=_0xe588d0;}}else{_0x1118f5['queuecallerexitreason']='COMPLETEDBY'+_0x2fdbdb[_0x3011('0x9a')]['toUpperCase']();logger[_0x3011('0x7e')](_0x3011('0xa8'),_0x1118f5[_0x3011('0x55')],_0x1118f5[_0x3011('0x5d')],_0x1118f5[_0x3011('0x59')]);}}}this[_0x3011('0x13')][_0x2fdbdb[_0x3011('0x53')]]=_0x1118f5;}}}catch(_0xfb6317){logger[_0x3011('0x46')](_0x3011('0x95'),_0x2fdbdb['uniqueid'],util[_0x3011('0x48')](_0xfb6317,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3011('0xc')][_0x3011('0xa9')]=function(_0x13013a){try{if(this[_0x3011('0x63')](_0x13013a)){logger[_0x3011('0x5f')](_0x3011('0xaa'),_0x13013a[_0x3011('0x53')],util[_0x3011('0x48')](_0x13013a,{'showHidden':![],'depth':null}));this['addVariable'](_0x13013a[_0x3011('0x53')],_['keys'](_0x13013a[_0x3011('0xab')])[0x0],_0x13013a['value']);if(this['queueReports'][_0x13013a[_0x3011('0x53')]]){var _0x204279=_[_0x3011('0x83')](this[_0x3011('0x10')][_0x13013a[_0x3011('0x53')]]);if(_0x204279){if(this[_0x3011('0x63')](_0x13013a['variable'])&&this[_0x3011('0x63')](_0x13013a['variable'][_0x3011('0x68')])){switch(_0x13013a[_0x3011('0xac')]){case'CONTINUE':_0x204279[_0x3011('0x3b')]=![];_0x204279[_0x3011('0x98')]=null;break;case _0x3011('0xad'):_0x204279[_0x3011('0xae')]=_0x3011('0xaf');_0x204279[_0x3011('0x3b')]=!![];_0x204279[_0x3011('0x98')]=moment()[_0x3011('0x60')](_0x3011('0x7a'));_0x204279[_0x3011('0x8d')]=moment()[_0x3011('0x60')](_0x3011('0x7a'));logger[_0x3011('0x5f')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x13013a[_0x3011('0x53')],util['inspect'](_0x204279,{'showHidden':![],'depth':null}));ami['emit'](_0x3011('0xb0'),_0x204279);break;default:_0x204279[_0x3011('0x3b')]=!![];_0x204279['queuecallerexitAt']=moment()[_0x3011('0x60')](_0x3011('0x7a'));_0x204279['queuecallerleaveAt']=moment()[_0x3011('0x60')]('YYYY-MM-DD\x20HH:mm:ss');}_0x204279[_0x3011('0x1f')]=![];_0x204279[_0x3011('0x88')]=null;_0x204279['queuecallerexitreason']=_0x13013a[_0x3011('0xac')];this[_0x3011('0x13')][_0x13013a[_0x3011('0x53')]]=_0x204279;this[_0x3011('0x4e')](_0x204279,_0x3011('0x26'));}else if(this[_0x3011('0x63')](_0x13013a[_0x3011('0xab')])&&this[_0x3011('0x63')](_0x13013a[_0x3011('0xab')][_0x3011('0xb1')])){if(!_0x204279[_0x3011('0x1f')]){_0x204279[_0x3011('0x3b')]=!![];_0x204279[_0x3011('0x98')]=moment()['format'](_0x3011('0x7a'));_0x204279[_0x3011('0x59')]=_0x3011('0xb2');_0x204279[_0x3011('0x8d')]=moment()['format'](_0x3011('0x7a'));this['channels'][_0x13013a[_0x3011('0x53')]]=_0x204279;}}logger[_0x3011('0x7e')](_0x3011('0xb3'),_0x13013a['uniqueid'],_0x204279[_0x3011('0x55')],_0x204279[_0x3011('0x5d')],_[_0x3011('0xb4')](_0x13013a[_0x3011('0xab')])[0x0],_0x13013a[_0x3011('0xac')]);_0x204279[_0x3011('0x16')]=this[_0x3011('0x16')][_0x13013a[_0x3011('0x53')]];}}}}catch(_0xcede8d){logger[_0x3011('0x46')](_0x3011('0xaa'),_0x13013a[_0x3011('0x53')],util['inspect'](_0xcede8d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3011('0xc')][_0x3011('0xb5')]=function(_0x5a3ff8,_0x317693,_0x441de5){var _0x45d160=[_0x3011('0xb6'),_0x3011('0xb7'),'rtpaudioqosjitter',_0x3011('0xb8'),_0x3011('0xb9'),_0x3011('0xba'),'rtpaudioqosrtt',_0x3011('0xbb'),_0x3011('0xbc'),'sipuri',_0x3011('0xbd'),_0x3011('0xbe'),_0x3011('0xbf'),_0x3011('0xc0'),_0x3011('0xc1'),_0x3011('0xc2'),_0x3011('0x97'),_0x3011('0xc3'),_0x3011('0xc4')];if(!_['isNil'](_0x317693)&&!_[_0x3011('0xc5')](_0x45d160,_0x317693)){if(_[_0x3011('0x64')](this[_0x3011('0x16')][_0x5a3ff8])){this[_0x3011('0x16')][_0x5a3ff8]={};}this[_0x3011('0x16')][_0x5a3ff8][_0x317693]=_0x441de5;}};VoiceQueueReport[_0x3011('0xc')][_0x3011('0xc6')]=function(_0x12aab8,_0x1fd072,_0x4f912b){try{var _0x2fc6ea={};if(this[_0x3011('0x10')][_0x12aab8]){for(var _0x4afddd=0x0;_0x4afddd<this[_0x3011('0x10')][_0x12aab8][_0x3011('0xc7')];_0x4afddd+=0x1){_0x2fc6ea=this[_0x3011('0x10')][_0x12aab8][_0x4afddd];var _0x3f921c=this[_0x3011('0x14')][_0x2fc6ea[_0x3011('0x55')]];if(_0x3f921c){_0x3f921c[_0x3011('0xc8')]+=moment(_0x2fc6ea[_0x3011('0x8d')])[_0x3011('0xc9')](_0x2fc6ea[_0x3011('0x79')],_0x3011('0xa2'))||0x0;if(_0x4f912b&&_0x2fc6ea[_0x3011('0x59')]===_0x3011('0x5a')){_0x2fc6ea[_0x3011('0x59')]='COMPLETEDBYAGENT';}if(_0x4afddd===this[_0x3011('0x10')][_0x12aab8][_0x3011('0xc7')]-0x1){_0x3f921c['sumDuration']+=moment()['milliseconds'](0x0)[_0x3011('0xc9')](_0x2fc6ea['queuecallerjoinAt'],_0x3011('0xa2'));if(hasCallerLeftTheQueue(_0x2fc6ea)&&_0x2fc6ea['queuecallerexitreason']!==_0x3011('0x5a')){_0x3f921c['total']+=0x1;}if(_0x2fc6ea['queuecallercomplete']){_0x3f921c[_0x3011('0xca')]+=0x1;_0x3f921c[_0x3011('0xcb')]+=moment()[_0x3011('0xcc')](0x0)[_0x3011('0xc9')](_0x2fc6ea[_0x3011('0x8d')],'seconds');_0x2fc6ea['queuecallercompleteAt']=moment()[_0x3011('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x2fc6ea[_0x3011('0x3b')]=![];_0x2fc6ea['queuecallerexitAt']=null;}if(_0x2fc6ea[_0x3011('0x3b')]&&_0x2fc6ea[_0x3011('0x99')]!=!![]){_0x3f921c['unmanaged']+=0x1;_0x2fc6ea[_0x3011('0xae')]=_0x3011('0xcd');logger[_0x3011('0x5f')](_0x3011('0xce'),_0x12aab8,util[_0x3011('0x48')](_0x2fc6ea,{'showHidden':![],'depth':null}));ami[_0x3011('0x50')]('custom:queuecallerunmanaged',_0x2fc6ea);}if(_0x2fc6ea[_0x3011('0x1f')]){_0x3f921c[_0x3011('0xcf')]+=0x1;_0x2fc6ea[_0x3011('0xae')]=_0x3011('0xcf');logger[_0x3011('0x5f')](_0x3011('0xd0'),_0x12aab8,util['inspect'](_0x2fc6ea,{'showHidden':![],'depth':null}));ami[_0x3011('0x50')](_0x3011('0xd1'),_0x2fc6ea);}}else{_0x3f921c[_0x3011('0xd2')]+=_0x3f921c['sumHoldTime'];}logger[_0x3011('0x7e')](_0x3011('0xd3'),_0x12aab8,_0x2fc6ea[_0x3011('0x55')],_0x2fc6ea[_0x3011('0x5d')],_0x1fd072);this[_0x3011('0x13')][_0x12aab8]=_0x2fc6ea;Object[_0x3011('0x6a')](this[_0x3011('0x14')][_0x2fc6ea[_0x3011('0x55')]],_0x3f921c);if(_0x2fc6ea[_0x3011('0x8d')]){this['emitVoiceQueueChannelRemove'](_0x2fc6ea,_0x3011('0x27'));}}}logger[_0x3011('0x5f')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x12aab8,util[_0x3011('0x48')](this[_0x3011('0x10')][_0x12aab8],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x2fc6ea)&&_0x2fc6ea[_0x3011('0x59')]!==_0x3011('0x5a')){ami[_0x3011('0x50')](_0x3011('0xd4'),this[_0x3011('0x10')][_0x12aab8]);if(this['queueReports'][_0x12aab8]){delete this[_0x3011('0x10')][_0x12aab8];}if(this[_0x3011('0x13')][_0x12aab8]){delete this['channels'][_0x12aab8];}if(this['variables'][_0x12aab8]){delete this['variables'][_0x12aab8];}}}}catch(_0x2852b2){logger[_0x3011('0x46')]('[%s][voiceQueueReport][handleHangup]',_0x12aab8,util[_0x3011('0x48')](_0x2852b2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x28')]=function(_0x4c9a41){try{if(this[_0x3011('0x63')](_0x4c9a41)){logger['debug'](_0x3011('0xd5'),_0x4c9a41[_0x3011('0x53')],util[_0x3011('0x48')](_0x4c9a41,{'showHidden':![],'depth':null}));if(this[_0x3011('0x10')][_0x4c9a41['uniqueid']]){return this['handleHangup'](_0x4c9a41[_0x3011('0x53')],_0x4c9a41[_0x3011('0xd6')],![]);}if(this['queueReports'][_0x4c9a41[_0x3011('0xa0')]]){if(_0x4c9a41[_0x3011('0xd7')]==='21'){return;}return this['handleHangup'](_0x4c9a41[_0x3011('0xa0')],_0x4c9a41[_0x3011('0xd6')],!![]);}var _0x40960e=Object[_0x3011('0xb4')](this[_0x3011('0x10')]);for(var _0x19162a=0x0;_0x19162a<_0x40960e[_0x3011('0xc7')];_0x19162a++){var _0x103c21=_[_0x3011('0x83')](this[_0x3011('0x10')][_0x40960e[_0x19162a]]);if(_0x103c21&&_0x103c21['transferid']===_0x4c9a41[_0x3011('0x53')]){return this[_0x3011('0xc6')](_0x103c21[_0x3011('0x53')],_0x4c9a41[_0x3011('0xd6')],!![]);}}if(!this[_0x3011('0x10')][_0x4c9a41[_0x3011('0x53')]]){logger['debug'](_0x3011('0xd8'),_0x4c9a41[_0x3011('0x53')]);if(this[_0x3011('0x13')][_0x4c9a41['uniqueid']]){delete this[_0x3011('0x13')][_0x4c9a41[_0x3011('0x53')]];}if(this[_0x3011('0x16')][_0x4c9a41[_0x3011('0x53')]]){delete this['variables'][_0x4c9a41[_0x3011('0x53')]];}}}}catch(_0x320336){logger[_0x3011('0x46')](_0x3011('0xd5'),_0x4c9a41[_0x3011('0x53')],util['inspect'](_0x320336,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x30')]=function(_0x1d2727){try{if(this[_0x3011('0x63')](_0x1d2727)){logger['debug'](_0x3011('0xd9'),_0x1d2727[_0x3011('0x53')],util[_0x3011('0x48')](_0x1d2727,{'showHidden':![],'depth':null}));var _0x39f4d3;var _0x124d27;var _0x567ca6;if(this[_0x3011('0x10')][_0x1d2727['transfereeuniqueid']]){_0x39f4d3=_[_0x3011('0x83')](this['queueReports'][_0x1d2727[_0x3011('0xda')]]);_0x39f4d3[_0x3011('0xa5')]=_0x1d2727[_0x3011('0xdb')];_0x39f4d3['transferuniqueid']=_0x1d2727[_0x3011('0xdc')];_0x39f4d3['queuecallerexitreason']='ATTENDEDTRANSFER';_0x39f4d3[_0x3011('0x99')]=!![];_0x39f4d3[_0x3011('0xa3')]='ATTENDED';if(this['queueReports'][_0x1d2727[_0x3011('0xdc')]]){_0x567ca6=this[_0x3011('0x10')][_0x1d2727[_0x3011('0xdc')]];this[_0x3011('0x10')][_0x1d2727[_0x3011('0xdc')]]=this[_0x3011('0x10')][_0x1d2727['transfereeuniqueid']];this[_0x3011('0x10')][_0x1d2727[_0x3011('0xda')]]=_0x567ca6;_0x124d27=_['last'](this[_0x3011('0x10')][_0x1d2727['transfereeuniqueid']]);_0x124d27[_0x3011('0x3d')]=!![];}logger[_0x3011('0x7e')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x1d2727[_0x3011('0x53')],_0x39f4d3['queue'],_0x39f4d3[_0x3011('0x5d')],_0x39f4d3[_0x3011('0xa5')],_0x39f4d3[_0x3011('0xdd')]);}else if(this[_0x3011('0x10')][_0x1d2727['transfertargetuniqueid']]){_0x39f4d3=_[_0x3011('0x83')](this['queueReports'][_0x1d2727[_0x3011('0xde')]]);_0x39f4d3[_0x3011('0xa5')]=_0x1d2727[_0x3011('0xdf')];_0x39f4d3[_0x3011('0xdd')]=_0x1d2727[_0x3011('0xe0')];_0x39f4d3[_0x3011('0x59')]='ATTENDEDTRANSFER';_0x39f4d3[_0x3011('0x99')]=!![];_0x39f4d3[_0x3011('0xa3')]=_0x3011('0xe1');if(this['queueReports'][_0x1d2727['origtransfereruniqueid']]){_0x567ca6=this['queueReports'][_0x1d2727['origtransfereruniqueid']];this[_0x3011('0x10')][_0x1d2727[_0x3011('0xe0')]]=this[_0x3011('0x10')][_0x1d2727[_0x3011('0xde')]];this[_0x3011('0x10')][_0x1d2727[_0x3011('0xde')]]=_0x567ca6;_0x124d27=_['last'](this[_0x3011('0x10')][_0x1d2727[_0x3011('0xde')]]);_0x124d27[_0x3011('0x3d')]=!![];}logger['info'](_0x3011('0xe2'),_0x1d2727[_0x3011('0x53')],_0x39f4d3[_0x3011('0x55')],_0x39f4d3[_0x3011('0x5d')],_0x39f4d3[_0x3011('0xa5')],_0x39f4d3[_0x3011('0xdd')]);}else if(this[_0x3011('0x10')][_0x1d2727[_0x3011('0xe0')]]){_0x39f4d3=_[_0x3011('0x83')](this[_0x3011('0x10')][_0x1d2727['origtransfereruniqueid']]);_0x39f4d3[_0x3011('0xa5')]=_0x1d2727[_0x3011('0xdf')];_0x39f4d3[_0x3011('0xdd')]=_0x1d2727['origtransfereruniqueid'];_0x39f4d3[_0x3011('0x59')]=_0x3011('0x5a');_0x39f4d3[_0x3011('0x99')]=!![];_0x39f4d3[_0x3011('0xa3')]=_0x3011('0xe1');_0x39f4d3[_0x3011('0x3d')]=!![];_0x39f4d3[_0x3011('0xe3')]=_0x1d2727[_0x3011('0xda')];}else if(this[_0x3011('0x10')][_0x1d2727['secondtransfereruniqueid']]){_0x39f4d3=_[_0x3011('0x83')](this[_0x3011('0x10')][_0x1d2727[_0x3011('0xdc')]]);_0x39f4d3['transferexten']=_0x1d2727[_0x3011('0xdb')];_0x39f4d3[_0x3011('0xdd')]=_0x1d2727[_0x3011('0xdc')];_0x39f4d3['queuecallerexitreason']=_0x3011('0x5a');_0x39f4d3['transfer']=!![];_0x39f4d3[_0x3011('0xa3')]=_0x3011('0xe1');_0x39f4d3[_0x3011('0x3d')]=!![];_0x39f4d3[_0x3011('0xe3')]=_0x1d2727[_0x3011('0xde')];}}}catch(_0x157ae1){logger[_0x3011('0x46')](_0x3011('0xd9'),_0x1d2727['uniqueid'],util['inspect'](_0x157ae1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncBlindTransfer']=function(_0x326c65){try{if(this['isNotNull'](_0x326c65)){logger[_0x3011('0x5f')](_0x3011('0xe4'),_0x326c65[_0x3011('0x53')],util[_0x3011('0x48')](_0x326c65,{'showHidden':![],'depth':null}));if(this[_0x3011('0x10')][_0x326c65[_0x3011('0xda')]]){var _0x71b531=_[_0x3011('0x83')](this[_0x3011('0x10')][_0x326c65[_0x3011('0xda')]]);_0x71b531[_0x3011('0x59')]=_0x3011('0xe5');_0x71b531[_0x3011('0x99')]=!![];_0x71b531[_0x3011('0xa3')]=_0x3011('0xe6');_0x71b531[_0x3011('0xa5')]=_0x326c65[_0x3011('0xe7')];_0x71b531[_0x3011('0xdd')]=_0x326c65[_0x3011('0xda')];logger[_0x3011('0x7e')](_0x3011('0xe8'),_0x326c65[_0x3011('0x53')],_0x71b531[_0x3011('0x55')],_0x71b531[_0x3011('0x5d')],_0x71b531[_0x3011('0xa5')],_0x71b531[_0x3011('0xdd')]);this[_0x3011('0x28')]({'event':'BlindTransfer','uniqueid':_0x326c65['transfereeuniqueid'],'context':_0x326c65[_0x3011('0xe9')],'channel':_0x326c65[_0x3011('0xea')]});}}}catch(_0x4cdfea){logger['error']('[%s][voiceQueueReport][blindtransfer]',_0x326c65['uniqueid'],util['inspect'](_0x4cdfea,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3011('0x2c')]=function(_0x3f54b9){try{if(this[_0x3011('0x63')](_0x3f54b9)){logger[_0x3011('0x5f')](_0x3011('0xeb'),_0x3f54b9[_0x3011('0x53')],util[_0x3011('0x48')](_0x3f54b9,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3f54b9[_0x3011('0x53')]]){var _0x1b08c7=_[_0x3011('0x83')](this[_0x3011('0x10')][_0x3f54b9['uniqueid']]);if(!_['isNil'](_0x1b08c7[_0x3011('0x8d')])){_0x1b08c7[_0x3011('0xec')]=moment()[_0x3011('0x60')](_0x3011('0x7a'));logger[_0x3011('0x7e')](_0x3011('0xed'),_0x3f54b9[_0x3011('0x53')],_0x1b08c7[_0x3011('0xec')]);}}}}catch(_0x27428c){logger[_0x3011('0x46')](_0x3011('0xeb'),_0x3f54b9[_0x3011('0x53')],util[_0x3011('0x48')](_0x27428c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3011('0xc')][_0x3011('0x2e')]=function(_0x2e657c){try{if(this[_0x3011('0x63')](_0x2e657c)){logger[_0x3011('0x5f')](_0x3011('0xee'),_0x2e657c[_0x3011('0x53')],util[_0x3011('0x48')](_0x2e657c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2e657c[_0x3011('0x53')]]){var _0x5226f6=_['last'](this[_0x3011('0x10')][_0x2e657c[_0x3011('0x53')]]);if(!_['isNil'](_0x5226f6[_0x3011('0xec')])){_0x5226f6[_0x3011('0xef')]+=moment()['milliseconds'](0x0)[_0x3011('0xc9')](_0x5226f6[_0x3011('0xec')],_0x3011('0xa2'));logger[_0x3011('0x7e')](_0x3011('0xf0'),_0x2e657c[_0x3011('0x53')],_0x5226f6['mohtime']);delete _0x5226f6[_0x3011('0xec')];}}}}catch(_0x1526b1){logger['error'](_0x3011('0xee'),_0x2e657c['uniqueid'],util['inspect'](_0x1526b1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3011('0xf1')]=function(_0x51cf37){try{if(this[_0x3011('0x63')](_0x51cf37)){logger['debug']('[%s][voiceQueueReport][newexten]\x20event:',_0x51cf37[_0x3011('0x53')],util[_0x3011('0x48')](_0x51cf37,{'showHidden':![],'depth':null}));if(_0x51cf37['application']['toLowerCase']()==='set'){_0x51cf37[_0x3011('0xf2')]=_0x51cf37[_0x3011('0xf3')]&&_0x51cf37[_0x3011('0xf3')]['startsWith'](_0x3011('0xf4'))?_0x51cf37[_0x3011('0xf3')]:(_0x51cf37[_0x3011('0xf3')]||_0x51cf37[_0x3011('0xf2')])[_0x3011('0x9e')]();if(_[_0x3011('0x9d')](_0x51cf37[_0x3011('0xf2')][_0x3011('0x9e')](),_0x3011('0xf5'))){logger['info']('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x51cf37['uniqueid'],_0x51cf37['application'],_0x51cf37['applicationdata']);if(_['isUndefined'](this[_0x3011('0x13')][_0x51cf37[_0x3011('0x53')]]))this[_0x3011('0x13')][_0x51cf37['uniqueid']]={};var _0x21d3c6=_0x51cf37[_0x3011('0xf2')][_0x3011('0xf6')]('=');var _0x380194=_0x21d3c6[0x0][_0x3011('0x9e')]()['match'](/cdr\((.*)\)/);if(_0x380194)this[_0x3011('0x13')][_0x51cf37[_0x3011('0x53')]][_0x380194[0x1]]=_0x21d3c6[0x1];}}}}catch(_0x3c82f5){logger['error'](_0x3011('0xf7'),_0x51cf37[_0x3011('0x53')],util[_0x3011('0x48')](_0x3c82f5,{'showHidden':![],'depth':null}));}};module[_0x3011('0xf8')]=VoiceQueueReport;
\ No newline at end of file
+var _0xf209=['sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','includes','handleHangup','length','sumHoldTime','sumDuration','diff','sumBillable','milliseconds','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','custom:voiceQueueReport','[%s][voiceQueueReport][handleHangup]','cause-txt','cause','transferid','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','ATTENDED','secondtransfereruniqueid','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','syncHangup','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','mohtime','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/environment','ami','../ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','queueReports','agents','channels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','queuemember','syncQueueMember','bind','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','queueStatusComplete','unlockRR','queuecallerexit','queuecallercomplete','clearZombieChannels','isNil','Action','channel','catch','message','[%s][voiceQueueReport][checkChannel]','inspect','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','prototype','[FullyBooted]\x20clear\x20realtime','clearQueueReport','summary','emitVoiceQueueChannelRemove','clearqueuereport','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','queue','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','type','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isUndefined','queues','[voiceQueueReport][queues]','isRunning','then','actionid','[voiceQueueReport][queuesummary]','createQueueSummaryReport','summaryEvent','createReport','realtime','compareToInboundQueue','assign','emitInboundVoiceQueueSummary','queuestatus','handleInboundQueueSummaryReport','outbound','statusRequests','completeEvent','push','isNotNull','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','keys','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','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]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','assigned','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','transferexten','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','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt'];(function(_0x3551b9,_0x48b348){var _0x48dd86=function(_0x55d84b){while(--_0x55d84b){_0x3551b9['push'](_0x3551b9['shift']());}};_0x48dd86(++_0x48b348);}(_0xf209,0x144));var _0x9f20=function(_0x308dcc,_0x2d1178){_0x308dcc=_0x308dcc-0x0;var _0x361717=_0xf209[_0x308dcc];return _0x361717;};'use strict';var _=require(_0x9f20('0x0'));var moment=require(_0x9f20('0x1'));var util=require(_0x9f20('0x2'));var Redis=require(_0x9f20('0x3'));var config=require(_0x9f20('0x4'));var logger=require('../../../config/logger')(_0x9f20('0x5'));var ami=require(_0x9f20('0x6'));var QueueReport=require(_0x9f20('0x7'));var VoiceQueueSummary=require(_0x9f20('0x8'));config[_0x9f20('0x9')]=_[_0x9f20('0xa')](config['redis'],{'host':_0x9f20('0xb'),'port':0x18eb});var io=require(_0x9f20('0xc'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0x9f20('0xd')]=function(_0x245760){this['tail']=this[_0x9f20('0xe')]?this[_0x9f20('0xe')][_0x9f20('0xf')](_0x245760):_0x245760();};function VoiceQueueReport(_0x1d549b){this[_0x9f20('0x10')]=new Sequence();this[_0x9f20('0x11')]={};this['realtime']=_0x1d549b;this[_0x9f20('0x12')]=_0x1d549b['agents'];this[_0x9f20('0x13')]=_0x1d549b['queueChannels'];this['voiceQueues']=_0x1d549b[_0x9f20('0x14')];this['campaigns']=_0x1d549b[_0x9f20('0x15')];this['summary']=initializeSummary();this[_0x9f20('0x16')]={};ami['on'](_0x9f20('0x17'),this[_0x9f20('0x18')]['bind'](this));ami['on'](_0x9f20('0x19'),this[_0x9f20('0x1a')]['bind'](this));ami['on'](_0x9f20('0x1b'),this[_0x9f20('0x1c')][_0x9f20('0x1d')](this));ami['on']('queuestatuscomplete',this[_0x9f20('0x1e')]['bind'](this));ami['on'](_0x9f20('0x1f'),this[_0x9f20('0x20')][_0x9f20('0x1d')](this));ami['on'](_0x9f20('0x21'),this[_0x9f20('0x22')][_0x9f20('0x1d')](this));ami['on'](_0x9f20('0x23'),this[_0x9f20('0x24')][_0x9f20('0x1d')](this));ami['on'](_0x9f20('0x25'),this['syncAgentComplete'][_0x9f20('0x1d')](this));ami['on'](_0x9f20('0x26'),this[_0x9f20('0x27')][_0x9f20('0x1d')](this));ami['on'](_0x9f20('0x28'),this[_0x9f20('0x29')]['bind'](this));ami['on'](_0x9f20('0x2a'),this['syncHangup']['bind'](this));ami['on'](_0x9f20('0x2b'),this[_0x9f20('0x2c')][_0x9f20('0x1d')](this));ami['on']('musiconholdstart',this[_0x9f20('0x2d')]['bind'](this));ami['on'](_0x9f20('0x2e'),this[_0x9f20('0x2f')][_0x9f20('0x1d')](this));ami['on'](_0x9f20('0x30'),this[_0x9f20('0x31')]['bind'](this));ami['on'](_0x9f20('0x32'),this[_0x9f20('0x33')]['bind'](this));this[_0x9f20('0x34')]();this[_0x9f20('0x35')]();}function clearChannels(_0x4f0bdc){if(!_[_0x9f20('0x36')](_0x4f0bdc)){for(var _0x521afd in _0x4f0bdc){if(_0x4f0bdc[_0x9f20('0x37')](_0x521afd)){delete _0x4f0bdc[_0x521afd];}}}}function clearCampaigns(_0x1da747){if(!_['isEmpty'](_0x1da747)){for(var _0x2e322b in _0x1da747){if(_0x1da747['hasOwnProperty'](_0x2e322b)){_0x1da747[_0x2e322b][_0x9f20('0x38')]=0x0;}}}}function clearVoiceQueues(_0x562c38){if(!_[_0x9f20('0x36')](_0x562c38)){for(var _0x536fdb in _0x562c38){if(_0x562c38['hasOwnProperty'](_0x536fdb)){_0x562c38[_0x536fdb][_0x9f20('0x38')]=0x0;_0x562c38[_0x536fdb][_0x9f20('0x39')]=0x0;_0x562c38[_0x536fdb][_0x9f20('0x3a')]=0x0;_0x562c38[_0x536fdb]['waiting']=0x0;_0x562c38[_0x536fdb][_0x9f20('0x3b')]=!![];}}}}function clearAgentBooked(_0x966af6){if(!_[_0x9f20('0x36')](_0x966af6)){for(var _0x3949e9 in _0x966af6){if(_0x966af6[_0x9f20('0x37')](_0x3949e9)){_0x966af6[_0x3949e9][_0x9f20('0x3c')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x55593b){return _0x55593b[_0x9f20('0x3d')]||_0x55593b['queuecallerabandon']||_0x55593b[_0x9f20('0x3e')];}VoiceQueueReport['prototype'][_0x9f20('0x3f')]=function(){var _0x1b3eb8=this;for(var _0xca7484 in this[_0x9f20('0x13')]){if(this[_0x9f20('0x13')][_0x9f20('0x37')](_0xca7484)&&!this[_0x9f20('0x13')][_0xca7484]['switch']){this[_0x9f20('0x10')][_0x9f20('0xd')](function(){if(!_[_0x9f20('0x40')](_0x1b3eb8[_0x9f20('0x13')][_0xca7484])){return ami[_0x9f20('0x41')]({'action':'status','channel':_0x1b3eb8[_0x9f20('0x13')][_0xca7484][_0x9f20('0x42')]})[_0x9f20('0x43')](function(_0x1155e8){if(_0x1155e8[_0x9f20('0x44')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1b3eb8[_0x9f20('0x13')][_0xca7484]){delete _0x1b3eb8[_0x9f20('0x13')][_0xca7484];logger['error'](_0x9f20('0x45'),_0xca7484,util[_0x9f20('0x46')](_0x1155e8,{'showHidden':![],'depth':null}));}if(_0x1b3eb8[_0x9f20('0x11')][_0xca7484]){delete _0x1b3eb8[_0x9f20('0x11')][_0xca7484];logger[_0x9f20('0x47')](_0x9f20('0x48'),_0xca7484,util['inspect'](_0x1155e8,{'showHidden':![],'depth':null}));}if(_0x1b3eb8[_0x9f20('0x16')][_0xca7484]){delete _0x1b3eb8['variables'][_0xca7484];logger[_0x9f20('0x47')](_0x9f20('0x49'),_0xca7484,util[_0x9f20('0x46')](_0x1155e8,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x2c')]=function(){logger['error'](_0x9f20('0x4b'));clearChannels(this[_0x9f20('0x13')]);this[_0x9f20('0x4c')](this[_0x9f20('0x11')]);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x9f20('0x15')]);this[_0x9f20('0x4d')]=initializeSummary();};VoiceQueueReport[_0x9f20('0x4a')]['clearQueueReport']=function(_0xdb023c){var _0x245954=this;if(!_[_0x9f20('0x36')](_0xdb023c)){for(var _0x355dd3 in _0xdb023c){if(_0xdb023c[_0x9f20('0x37')](_0x355dd3)){_0x245954[_0x9f20('0x4e')](_0xdb023c[_0x355dd3],_0x9f20('0x4f'));delete _0xdb023c[_0x355dd3];}}}};VoiceQueueReport['prototype'][_0x9f20('0x50')]=function(_0x31c9c1,_0x19d19f,_0x4e212d){io['to'](_0x31c9c1)[_0x9f20('0x50')](_0x19d19f,_0x4e212d);};VoiceQueueReport[_0x9f20('0x4a')]['emitVoiceQueueChannelSave']=function(_0x56220a,_0x23fc4d){logger[_0x9f20('0x51')](_0x9f20('0x52')+_0x23fc4d+_0x9f20('0x53'),_0x56220a[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x56220a,{'showHidden':![],'depth':null}));this[_0x9f20('0x50')](util['format'](_0x9f20('0x55'),_0x56220a[_0x9f20('0x56')]),_0x9f20('0x57'),_0x56220a);io[_0x9f20('0x50')](_0x9f20('0x58'),_0x56220a);};VoiceQueueReport[_0x9f20('0x4a')]['emitVoiceQueueChannelRemove']=function(_0x5248bc,_0x591c9c){logger[_0x9f20('0x51')](_0x9f20('0x52')+_0x591c9c+_0x9f20('0x59'),_0x5248bc['uniqueid'],util[_0x9f20('0x46')](_0x5248bc,{'showHidden':![],'depth':null}));if(_0x5248bc[_0x9f20('0x5a')]===_0x9f20('0x5b')){return;}this[_0x9f20('0x50')](util['format'](_0x9f20('0x55'),_0x5248bc[_0x9f20('0x56')]),_0x9f20('0x5c'),_0x5248bc);io[_0x9f20('0x50')](_0x9f20('0x5d'),_0x5248bc);};VoiceQueueReport[_0x9f20('0x4a')]['emitInboundVoiceQueueSummary']=function(_0x53e66f){if(_0x53e66f[_0x9f20('0x5e')]===_0x9f20('0x5f')){logger[_0x9f20('0x51')](_0x9f20('0x60'),util[_0x9f20('0x46')](_0x53e66f,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x9f20('0x55'),_0x53e66f[_0x9f20('0x61')]),_0x9f20('0x62'),_0x53e66f);}};VoiceQueueReport[_0x9f20('0x4a')]['isNotNull']=function(_0x42e1f1){return _0x42e1f1!==null&&!_[_0x9f20('0x63')](_0x42e1f1);};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x35')]=function(){var _0x17534c=this;setInterval(function(){_0x17534c[_0x9f20('0x3f')]();ami['Action']({'action':_0x9f20('0x64')})[_0x9f20('0x43')](function(_0x4af356){logger[_0x9f20('0x47')](_0x9f20('0x65'),util[_0x9f20('0x46')](_0x4af356,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x34')]=function(){var _0x55f05d=this;setInterval(function(){if(!_0x55f05d[_0x9f20('0x4d')][_0x9f20('0x66')]){return ami['Action']({'action':_0x9f20('0x17')})[_0x9f20('0x67')](function(_0x1e5220){_0x55f05d[_0x9f20('0x4d')]['id']=_0x1e5220[_0x9f20('0x68')];_0x55f05d[_0x9f20('0x4d')]['isRunning']=!![];_0x55f05d[_0x9f20('0x4d')]['queuestatus'][_0x1e5220[_0x9f20('0x68')]]={};})[_0x9f20('0x43')](function(_0x394f46){logger[_0x9f20('0x47')](_0x9f20('0x69'),util[_0x9f20('0x46')](_0x394f46,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x6a')]=function(_0x348f7d,_0x122b8c){var _0x211545;if(this['summary']&&this[_0x9f20('0x4d')]['queues']&&this['summary'][_0x9f20('0x64')][_0x348f7d[_0x9f20('0x61')]]){_0x211545=this[_0x9f20('0x4d')][_0x9f20('0x64')][_0x348f7d[_0x9f20('0x61')]][_0x9f20('0x6b')];}var _0x40250a=new VoiceQueueSummary(_0x348f7d);return _0x40250a[_0x9f20('0x6c')](_0x122b8c['agents'],this[_0x9f20('0x12')],_0x211545,this[_0x9f20('0x6d')][_0x9f20('0x13')]);};VoiceQueueReport[_0x9f20('0x4a')]['handleInboundQueueSummaryReport']=function(_0x5d9f8a,_0x188f23){var _0x346375=this[_0x9f20('0x6a')](_0x5d9f8a,_0x188f23);var _0x45e178=![];_0x45e178=_0x346375[_0x9f20('0x6e')](_0x5d9f8a);if(_0x45e178){Object[_0x9f20('0x6f')](_0x5d9f8a,_0x346375);this[_0x9f20('0x6d')]['voiceQueues'][_0x5d9f8a[_0x9f20('0x61')]]=_0x5d9f8a;this[_0x9f20('0x70')](_0x346375);}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x1e')]=function(_0x420726){var _0x428746=null;var _0x3d8ed3=this[_0x9f20('0x4d')]['id'];if(this[_0x9f20('0x4d')][_0x9f20('0x71')][_0x3d8ed3]){_0x428746=this[_0x9f20('0x4d')]['queuestatus'][_0x3d8ed3][_0x420726[_0x9f20('0x68')]];}if(!_0x428746){this[_0x9f20('0x4d')]=initializeSummary();return;}var _0x575fee=this[_0x9f20('0x14')][_0x428746[_0x9f20('0x56')]];if(_0x575fee[_0x9f20('0x5e')]==='inbound'){this[_0x9f20('0x72')](_0x575fee,_0x428746);}else if(_0x575fee[_0x9f20('0x5e')]===_0x9f20('0x73')){var _0x1139c6=this[_0x9f20('0x6a')](_0x575fee,_0x428746);ami['emit']('custom:queuesummary',_0x1139c6);}this[_0x9f20('0x4d')][_0x9f20('0x74')]-=0x1;var _0x5c51cb=this[_0x9f20('0x4d')]['statusRequests']>0x0?!![]:![];if(!_0x5c51cb){return this[_0x9f20('0x1a')](this['summary'][_0x9f20('0x75')]);}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x1c')]=function(_0x12e57f){var _0x34777a=this[_0x9f20('0x4d')]['id'];if(this[_0x9f20('0x4d')][_0x9f20('0x71')][_0x34777a]&&this['summary'][_0x9f20('0x71')][_0x34777a][_0x12e57f[_0x9f20('0x68')]]){this[_0x9f20('0x4d')][_0x9f20('0x71')][_0x34777a][_0x12e57f[_0x9f20('0x68')]][_0x9f20('0x12')][_0x9f20('0x76')](_0x12e57f);}};VoiceQueueReport['prototype']['syncQueueSummary']=function(_0x57764d){var _0x8a5f64=this;try{if(this['isNotNull'](_0x57764d)&&this[_0x9f20('0x77')](_0x57764d[_0x9f20('0x56')])){logger[_0x9f20('0x51')](_0x9f20('0x78'),util[_0x9f20('0x46')](_0x57764d,{'showHidden':![],'depth':null}));var _0x305ae4=this[_0x9f20('0x14')][_0x57764d[_0x9f20('0x56')]];if(_0x305ae4){logger[_0x9f20('0x51')](_0x9f20('0x79'),_0x305ae4[_0x9f20('0x61')]);this[_0x9f20('0x4d')][_0x9f20('0x64')][_0x305ae4[_0x9f20('0x61')]]={'summaryEvent':_0x57764d};this['summary'][_0x9f20('0x74')]+=0x1;return ami[_0x9f20('0x41')]({'action':'queuestatus','queue':_0x305ae4[_0x9f20('0x61')]})[_0x9f20('0x67')](function(_0x3c3332){if(!_0x8a5f64[_0x9f20('0x4d')][_0x9f20('0x71')][_0x57764d[_0x9f20('0x68')]]){_0x8a5f64[_0x9f20('0x4d')][_0x9f20('0x71')][_0x57764d[_0x9f20('0x68')]]={};}_0x8a5f64['summary'][_0x9f20('0x71')][_0x57764d['actionid']][_0x3c3332['actionid']]={'queue':_0x305ae4[_0x9f20('0x61')],'agents':[]};})[_0x9f20('0x43')](function(_0x561fe5){throw _0x561fe5;});}}}catch(_0x42ba72){logger[_0x9f20('0x47')]('[voiceQueueReport][queuesummary]',util[_0x9f20('0x46')](_0x42ba72,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x1a')]=function(_0x2f2901){if(this[_0x9f20('0x4d')][_0x9f20('0x74')]>0x0){this[_0x9f20('0x4d')][_0x9f20('0x75')]=_0x2f2901;return;}logger[_0x9f20('0x51')](_0x9f20('0x7a'),util[_0x9f20('0x46')](_0x2f2901,{'showHidden':![],'depth':null}));this[_0x9f20('0x4d')]=initializeSummary();ami['emit'](_0x9f20('0x7b'),{});};VoiceQueueReport['prototype'][_0x9f20('0x20')]=function(_0x50f477){try{if(this[_0x9f20('0x77')](_0x50f477)){logger[_0x9f20('0x51')](_0x9f20('0x7c'),_0x50f477[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x50f477,{'showHidden':![],'depth':null}));if(_[_0x9f20('0x63')](this[_0x9f20('0x11')][_0x50f477[_0x9f20('0x54')]])){this[_0x9f20('0x11')][_0x50f477[_0x9f20('0x54')]]=[];}if(_[_0x9f20('0x63')](this['channels'][_0x50f477[_0x9f20('0x54')]])){this['channels'][_0x50f477[_0x9f20('0x54')]]={};}var _0x2b686d=new QueueReport();_0x2b686d['queue']=_0x50f477[_0x9f20('0x56')];_0x2b686d['type']=this[_0x9f20('0x14')][_0x2b686d['queue']]&&this[_0x9f20('0x14')][_0x2b686d[_0x9f20('0x56')]]['type']?this[_0x9f20('0x14')][_0x2b686d['queue']][_0x9f20('0x5e')]||_0x9f20('0x5f'):_0x9f20('0x5f');_0x2b686d[_0x9f20('0x7d')]=moment()[_0x9f20('0x7e')](_0x9f20('0x7f'));_0x2b686d['position']=_0x50f477[_0x9f20('0x80')];_0x2b686d[_0x9f20('0x81')]=_0x50f477[_0x9f20('0x81')];_0x2b686d['uniqueid']=_0x50f477[_0x9f20('0x54')];_0x2b686d[_0x9f20('0x82')]=this['channels'][_0x50f477[_0x9f20('0x54')]][_0x9f20('0x82')];logger[_0x9f20('0x83')](_0x9f20('0x84'),_0x2b686d[_0x9f20('0x56')],_0x2b686d[_0x9f20('0x5e')]);Object[_0x9f20('0x6f')](_0x2b686d,_['pick'](_0x50f477,_[_0x9f20('0x85')](_0x2b686d)));this[_0x9f20('0x11')][_0x50f477['uniqueid']][_0x9f20('0x76')](_0x2b686d);this[_0x9f20('0x13')][_0x50f477[_0x9f20('0x54')]]=_0x2b686d;this[_0x9f20('0x86')](_0x2b686d,_0x9f20('0x1f'));}}catch(_0x481dd1){logger[_0x9f20('0x47')]('[%s][voiceQueueReport][queuecallerjoin]',_0x50f477[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x481dd1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9f20('0x4a')]['syncQueueCallerAbandon']=function(_0x286af9){try{if(this[_0x9f20('0x77')](_0x286af9)){logger[_0x9f20('0x51')](_0x9f20('0x87'),_0x286af9[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x286af9,{'showHidden':![],'depth':null}));if(this[_0x9f20('0x11')][_0x286af9[_0x9f20('0x54')]]){var _0x36e90c=_[_0x9f20('0x88')](this[_0x9f20('0x11')][_0x286af9['uniqueid']]);_0x36e90c[_0x9f20('0x3e')]=![];_0x36e90c[_0x9f20('0x89')]=null;_0x36e90c['holdtime']=_0x286af9[_0x9f20('0x8a')];_0x36e90c[_0x9f20('0x8b')]=_0x286af9['originalposition'];_0x36e90c[_0x9f20('0x21')]=!![];_0x36e90c[_0x9f20('0x8c')]=moment()[_0x9f20('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x36e90c[_0x9f20('0x5a')]=_0x9f20('0x8d');_0x36e90c[_0x9f20('0x8e')]=null;logger[_0x9f20('0x83')](_0x9f20('0x8f'),_0x36e90c[_0x9f20('0x56')],_0x36e90c[_0x9f20('0x5e')]);this[_0x9f20('0x13')][_0x286af9['uniqueid']]=_0x36e90c;this['emitVoiceQueueChannelRemove'](_0x36e90c,_0x9f20('0x21'));}}}catch(_0x2042aa){logger[_0x9f20('0x47')](_0x9f20('0x87'),_0x286af9[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x2042aa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x24')]=function(_0x1db51e){try{if(this['isNotNull'](_0x1db51e)){logger[_0x9f20('0x51')](_0x9f20('0x90'),_0x1db51e[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x1db51e,{'showHidden':![],'depth':null}));if(this[_0x9f20('0x11')][_0x1db51e[_0x9f20('0x54')]]){var _0x2a6b59=_[_0x9f20('0x88')](this[_0x9f20('0x11')][_0x1db51e['uniqueid']]);_0x2a6b59[_0x9f20('0x91')]=moment()[_0x9f20('0x7e')](_0x9f20('0x7f'));_0x2a6b59[_0x9f20('0x92')]=_0x1db51e['connectedlinenum'];_0x2a6b59[_0x9f20('0x93')]=_0x1db51e[_0x9f20('0x93')];logger[_0x9f20('0x83')](_0x9f20('0x94'),_0x2a6b59[_0x9f20('0x56')],_0x2a6b59[_0x9f20('0x5e')],_0x1db51e[_0x9f20('0x92')],_0x1db51e[_0x9f20('0x93')]);this[_0x9f20('0x13')][_0x1db51e[_0x9f20('0x54')]]=_0x2a6b59;this[_0x9f20('0x86')](_0x2a6b59,_0x9f20('0x23'));}}}catch(_0x3bb25b){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x1db51e[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x3bb25b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x27')]=function(_0x5cf34c){try{if(this['isNotNull'](_0x5cf34c)){logger[_0x9f20('0x51')](_0x9f20('0x95'),_0x5cf34c[_0x9f20('0x54')],util['inspect'](_0x5cf34c,{'showHidden':![],'depth':null}));if(this[_0x9f20('0x11')][_0x5cf34c[_0x9f20('0x54')]]){var _0x1b7e55=_[_0x9f20('0x88')](this['queueReports'][_0x5cf34c['uniqueid']]);_0x1b7e55[_0x9f20('0x3e')]=!![];_0x1b7e55[_0x9f20('0x5a')]=_0x9f20('0x96');logger[_0x9f20('0x83')](_0x9f20('0x97'),_0x1b7e55[_0x9f20('0x56')],_0x1b7e55[_0x9f20('0x5e')]);}}}catch(_0x414218){logger[_0x9f20('0x47')](_0x9f20('0x95'),_0x5cf34c[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x414218,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x98')]=function(_0x164d13){try{if(this[_0x9f20('0x77')](_0x164d13)){logger[_0x9f20('0x51')](_0x9f20('0x99'),_0x164d13['uniqueid'],util[_0x9f20('0x46')](_0x164d13,{'showHidden':![],'depth':null}));if(this[_0x9f20('0x11')][_0x164d13[_0x9f20('0x54')]]){var _0x4ceb0a=_['last'](this['queueReports'][_0x164d13['uniqueid']]);_0x4ceb0a[_0x9f20('0x21')]=![];_0x4ceb0a[_0x9f20('0x8c')]=null;_0x4ceb0a[_0x9f20('0x9a')]=!![];_0x4ceb0a['lastAssignedTo']=_0x164d13['membername'];_0x4ceb0a[_0x9f20('0x8a')]=_0x164d13[_0x9f20('0x8a')];_0x4ceb0a[_0x9f20('0x3e')]=!![];_0x4ceb0a[_0x9f20('0x3d')]=![];_0x4ceb0a[_0x9f20('0x9b')]=null;if(!_0x4ceb0a[_0x9f20('0x9c')]){if(_0x164d13[_0x9f20('0x9d')]==_0x9f20('0x9c')){_0x4ceb0a[_0x9f20('0x5a')]=_0x9f20('0x9e');logger[_0x9f20('0x83')](_0x9f20('0x9f'),_0x4ceb0a['queue'],_0x4ceb0a[_0x9f20('0x5e')]);}else{if(_[_0x9f20('0xa0')](_0x164d13[_0x9f20('0x42')][_0x9f20('0xa1')](),_0x9f20('0xa2'))){if(this[_0x9f20('0x11')][_0x164d13[_0x9f20('0xa3')]]){var _0x138a94=_[_0x9f20('0x88')](this[_0x9f20('0x11')][_0x164d13[_0x9f20('0xa3')]]);_0x138a94['queuecallercomplete']=![];_0x138a94[_0x9f20('0x3d')]=!![];_0x138a94[_0x9f20('0x9b')]=moment(_0x4ceb0a[_0x9f20('0x7d')])[_0x9f20('0xa4')](_0x164d13[_0x9f20('0x8a')],_0x9f20('0xa5'))[_0x9f20('0x7e')](_0x9f20('0x7f'));_0x138a94['queuecallerexitreason']=_0x9f20('0xa6');_0x138a94['transfer']=!![];_0x138a94[_0x9f20('0xa7')]='FORWARD';_0x138a94[_0x9f20('0xa8')]=_0x164d13['destexten'];_0x138a94[_0x9f20('0xa9')]=_0x164d13[_0x9f20('0x54')];logger[_0x9f20('0x83')](_0x9f20('0xaa'),_0x138a94[_0x9f20('0x56')],_0x138a94[_0x9f20('0x5e')]);var _0x3046ba=this[_0x9f20('0x11')][_0x164d13[_0x9f20('0xa3')]];this[_0x9f20('0x11')][_0x164d13[_0x9f20('0xa3')]]=this['queueReports'][_0x164d13[_0x9f20('0x54')]];this[_0x9f20('0x11')][_0x164d13[_0x9f20('0x54')]]=_0x3046ba;}}else{_0x4ceb0a['queuecallerexitreason']=_0x9f20('0xab')+_0x164d13[_0x9f20('0x9d')][_0x9f20('0xac')]();logger[_0x9f20('0x83')](_0x9f20('0xad'),_0x4ceb0a[_0x9f20('0x56')],_0x4ceb0a[_0x9f20('0x5e')],_0x4ceb0a[_0x9f20('0x5a')]);}}}this[_0x9f20('0x13')][_0x164d13[_0x9f20('0x54')]]=_0x4ceb0a;}}}catch(_0x1cf10c){logger[_0x9f20('0x47')](_0x9f20('0x99'),_0x164d13[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x1cf10c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x29')]=function(_0x326289){try{if(this[_0x9f20('0x77')](_0x326289)){logger[_0x9f20('0x51')](_0x9f20('0xae'),_0x326289[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x326289,{'showHidden':![],'depth':null}));this[_0x9f20('0xaf')](_0x326289[_0x9f20('0x54')],_[_0x9f20('0x85')](_0x326289[_0x9f20('0xb0')])[0x0],_0x326289[_0x9f20('0xb1')]);if(this[_0x9f20('0x11')][_0x326289[_0x9f20('0x54')]]){var _0x85c809=_[_0x9f20('0x88')](this['queueReports'][_0x326289[_0x9f20('0x54')]]);if(_0x85c809){if(this[_0x9f20('0x77')](_0x326289['variable'])&&this[_0x9f20('0x77')](_0x326289[_0x9f20('0xb0')][_0x9f20('0x71')])){switch(_0x326289[_0x9f20('0xb1')]){case _0x9f20('0xb2'):_0x85c809['queuecallerexit']=![];_0x85c809['queuecallerexitAt']=null;break;case _0x9f20('0xb3'):_0x85c809[_0x9f20('0xb4')]=_0x9f20('0xb5');_0x85c809['queuecallerexit']=!![];_0x85c809['queuecallerexitAt']=moment()['format'](_0x9f20('0x7f'));_0x85c809['queuecallerleaveAt']=moment()['format'](_0x9f20('0x7f'));logger[_0x9f20('0x51')](_0x9f20('0xb6'),_0x326289[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x85c809,{'showHidden':![],'depth':null}));ami['emit'](_0x9f20('0xb7'),_0x85c809);break;default:_0x85c809[_0x9f20('0x3d')]=!![];_0x85c809[_0x9f20('0x9b')]=moment()[_0x9f20('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');_0x85c809[_0x9f20('0x91')]=moment()[_0x9f20('0x7e')](_0x9f20('0x7f'));}_0x85c809[_0x9f20('0x21')]=![];_0x85c809['queuecallerabandonAt']=null;_0x85c809['queuecallerexitreason']=_0x326289[_0x9f20('0xb1')];this[_0x9f20('0x13')][_0x326289[_0x9f20('0x54')]]=_0x85c809;this[_0x9f20('0x4e')](_0x85c809,_0x9f20('0x28'));}else if(this[_0x9f20('0x77')](_0x326289[_0x9f20('0xb0')])&&this[_0x9f20('0x77')](_0x326289['variable'][_0x9f20('0xb8')])){if(!_0x85c809['queuecallerabandon']){_0x85c809['queuecallerexit']=!![];_0x85c809[_0x9f20('0x9b')]=moment()[_0x9f20('0x7e')](_0x9f20('0x7f'));_0x85c809[_0x9f20('0x5a')]=_0x9f20('0xb9');_0x85c809[_0x9f20('0x91')]=moment()[_0x9f20('0x7e')](_0x9f20('0x7f'));this[_0x9f20('0x13')][_0x326289['uniqueid']]=_0x85c809;}}logger[_0x9f20('0x83')](_0x9f20('0xba'),_0x326289[_0x9f20('0x54')],_0x85c809['queue'],_0x85c809[_0x9f20('0x5e')],_[_0x9f20('0x85')](_0x326289[_0x9f20('0xb0')])[0x0],_0x326289['value']);_0x85c809[_0x9f20('0x16')]=this[_0x9f20('0x16')][_0x326289[_0x9f20('0x54')]];}}}}catch(_0x167461){logger['error'](_0x9f20('0xae'),_0x326289[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x167461,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0xaf')]=function(_0x4ab093,_0x224004,_0x500018){var _0x52f67d=[_0x9f20('0xbb'),_0x9f20('0xbc'),_0x9f20('0xbd'),_0x9f20('0xbe'),_0x9f20('0xbf'),_0x9f20('0xc0'),_0x9f20('0xc1'),'rtpaudioqosrttbridged',_0x9f20('0xc2'),_0x9f20('0xc3'),_0x9f20('0xc4'),_0x9f20('0xc5'),'membercalls',_0x9f20('0xc6'),_0x9f20('0xc7'),_0x9f20('0xc8'),_0x9f20('0xc9'),_0x9f20('0xca'),'memberrealtime'];if(!_[_0x9f20('0x40')](_0x224004)&&!_[_0x9f20('0xcb')](_0x52f67d,_0x224004)){if(_[_0x9f20('0x63')](this[_0x9f20('0x16')][_0x4ab093])){this[_0x9f20('0x16')][_0x4ab093]={};}this[_0x9f20('0x16')][_0x4ab093][_0x224004]=_0x500018;}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0xcc')]=function(_0x2bc071,_0x59a117,_0x42ec40){try{var _0x87515f={};if(this[_0x9f20('0x11')][_0x2bc071]){for(var _0x421d0d=0x0;_0x421d0d<this[_0x9f20('0x11')][_0x2bc071][_0x9f20('0xcd')];_0x421d0d+=0x1){_0x87515f=this[_0x9f20('0x11')][_0x2bc071][_0x421d0d];var _0x553fd7=this['voiceQueues'][_0x87515f[_0x9f20('0x56')]];if(_0x553fd7){_0x553fd7[_0x9f20('0xce')]+=moment(_0x87515f[_0x9f20('0x91')])['diff'](_0x87515f[_0x9f20('0x7d')],_0x9f20('0xa5'))||0x0;if(_0x42ec40&&_0x87515f[_0x9f20('0x5a')]==='ATTENDEDTRANSFER'){_0x87515f[_0x9f20('0x5a')]='COMPLETEDBYAGENT';}if(_0x421d0d===this[_0x9f20('0x11')][_0x2bc071]['length']-0x1){_0x553fd7[_0x9f20('0xcf')]+=moment()['milliseconds'](0x0)[_0x9f20('0xd0')](_0x87515f[_0x9f20('0x7d')],_0x9f20('0xa5'));if(hasCallerLeftTheQueue(_0x87515f)&&_0x87515f[_0x9f20('0x5a')]!==_0x9f20('0x5b')){_0x553fd7['total']+=0x1;}if(_0x87515f[_0x9f20('0x3e')]){_0x553fd7['answered']+=0x1;_0x553fd7[_0x9f20('0xd1')]+=moment()[_0x9f20('0xd2')](0x0)[_0x9f20('0xd0')](_0x87515f[_0x9f20('0x91')],'seconds');_0x87515f[_0x9f20('0x89')]=moment()[_0x9f20('0x7e')](_0x9f20('0x7f'));_0x87515f[_0x9f20('0x3d')]=![];_0x87515f[_0x9f20('0x9b')]=null;}if(_0x87515f[_0x9f20('0x3d')]&&_0x87515f['transfer']!=!![]){_0x553fd7[_0x9f20('0xd3')]+=0x1;_0x87515f['lastevent']=_0x9f20('0xd3');logger[_0x9f20('0x51')](_0x9f20('0xd4'),_0x2bc071,util['inspect'](_0x87515f,{'showHidden':![],'depth':null}));ami[_0x9f20('0x50')](_0x9f20('0xd5'),_0x87515f);}if(_0x87515f[_0x9f20('0x21')]){_0x553fd7[_0x9f20('0xd6')]+=0x1;_0x87515f[_0x9f20('0xb4')]=_0x9f20('0xd6');logger[_0x9f20('0x51')](_0x9f20('0xd7'),_0x2bc071,util['inspect'](_0x87515f,{'showHidden':![],'depth':null}));ami[_0x9f20('0x50')]('custom:queuecallerabandon',_0x87515f);}}else{_0x553fd7[_0x9f20('0xcf')]+=_0x553fd7[_0x9f20('0xce')];}logger[_0x9f20('0x83')](_0x9f20('0xd8'),_0x2bc071,_0x87515f[_0x9f20('0x56')],_0x87515f[_0x9f20('0x5e')],_0x59a117);this['channels'][_0x2bc071]=_0x87515f;Object[_0x9f20('0x6f')](this[_0x9f20('0x14')][_0x87515f[_0x9f20('0x56')]],_0x553fd7);if(_0x87515f[_0x9f20('0x91')]){this[_0x9f20('0x4e')](_0x87515f,'hangup');}}}logger[_0x9f20('0x51')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x2bc071,util[_0x9f20('0x46')](this[_0x9f20('0x11')][_0x2bc071],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x87515f)&&_0x87515f['queuecallerexitreason']!==_0x9f20('0x5b')){ami[_0x9f20('0x50')](_0x9f20('0xd9'),this['queueReports'][_0x2bc071]);if(this[_0x9f20('0x11')][_0x2bc071]){delete this[_0x9f20('0x11')][_0x2bc071];}if(this[_0x9f20('0x13')][_0x2bc071]){delete this['channels'][_0x2bc071];}if(this['variables'][_0x2bc071]){delete this['variables'][_0x2bc071];}}}}catch(_0x2ef5aa){logger[_0x9f20('0x47')](_0x9f20('0xda'),_0x2bc071,util[_0x9f20('0x46')](_0x2ef5aa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9f20('0x4a')]['syncHangup']=function(_0x4e8c0d){try{if(this['isNotNull'](_0x4e8c0d)){logger[_0x9f20('0x51')]('[%s][voiceQueueReport][hangup]',_0x4e8c0d['uniqueid'],util[_0x9f20('0x46')](_0x4e8c0d,{'showHidden':![],'depth':null}));if(this[_0x9f20('0x11')][_0x4e8c0d[_0x9f20('0x54')]]){return this[_0x9f20('0xcc')](_0x4e8c0d['uniqueid'],_0x4e8c0d[_0x9f20('0xdb')],![]);}if(this[_0x9f20('0x11')][_0x4e8c0d[_0x9f20('0xa3')]]){if(_0x4e8c0d[_0x9f20('0xdc')]==='21'){return;}return this[_0x9f20('0xcc')](_0x4e8c0d[_0x9f20('0xa3')],_0x4e8c0d['cause-txt'],!![]);}var _0x3acc33=Object[_0x9f20('0x85')](this[_0x9f20('0x11')]);for(var _0x2c5b7c=0x0;_0x2c5b7c<_0x3acc33[_0x9f20('0xcd')];_0x2c5b7c++){var _0x469e9b=_['last'](this['queueReports'][_0x3acc33[_0x2c5b7c]]);if(_0x469e9b&&_0x469e9b[_0x9f20('0xdd')]===_0x4e8c0d[_0x9f20('0x54')]){return this[_0x9f20('0xcc')](_0x469e9b[_0x9f20('0x54')],_0x4e8c0d[_0x9f20('0xdb')],!![]);}}if(!this['queueReports'][_0x4e8c0d[_0x9f20('0x54')]]){logger[_0x9f20('0x51')](_0x9f20('0xde'),_0x4e8c0d[_0x9f20('0x54')]);if(this[_0x9f20('0x13')][_0x4e8c0d['uniqueid']]){delete this[_0x9f20('0x13')][_0x4e8c0d[_0x9f20('0x54')]];}if(this[_0x9f20('0x16')][_0x4e8c0d[_0x9f20('0x54')]]){delete this[_0x9f20('0x16')][_0x4e8c0d[_0x9f20('0x54')]];}}}}catch(_0x4de2de){logger['error'](_0x9f20('0xdf'),_0x4e8c0d[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x4de2de,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x31')]=function(_0x1a7387){try{if(this['isNotNull'](_0x1a7387)){logger[_0x9f20('0x51')](_0x9f20('0xe0'),_0x1a7387[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x1a7387,{'showHidden':![],'depth':null}));var _0x25710f;var _0x30a740;var _0xa98219;if(this[_0x9f20('0x11')][_0x1a7387[_0x9f20('0xe1')]]){_0x25710f=_[_0x9f20('0x88')](this[_0x9f20('0x11')][_0x1a7387[_0x9f20('0xe1')]]);_0x25710f[_0x9f20('0xa8')]=_0x1a7387[_0x9f20('0xe2')];_0x25710f[_0x9f20('0xa9')]=_0x1a7387['secondtransfereruniqueid'];_0x25710f[_0x9f20('0x5a')]=_0x9f20('0x5b');_0x25710f[_0x9f20('0x9c')]=!![];_0x25710f['transfertype']=_0x9f20('0xe3');if(this[_0x9f20('0x11')][_0x1a7387[_0x9f20('0xe4')]]){_0xa98219=this['queueReports'][_0x1a7387[_0x9f20('0xe4')]];this['queueReports'][_0x1a7387[_0x9f20('0xe4')]]=this['queueReports'][_0x1a7387[_0x9f20('0xe1')]];this[_0x9f20('0x11')][_0x1a7387[_0x9f20('0xe1')]]=_0xa98219;_0x30a740=_[_0x9f20('0x88')](this[_0x9f20('0x11')][_0x1a7387[_0x9f20('0xe1')]]);_0x30a740[_0x9f20('0xe5')]=!![];}logger['info'](_0x9f20('0xe6'),_0x1a7387[_0x9f20('0x54')],_0x25710f[_0x9f20('0x56')],_0x25710f['type'],_0x25710f[_0x9f20('0xa8')],_0x25710f['transferuniqueid']);}else if(this[_0x9f20('0x11')][_0x1a7387[_0x9f20('0xe7')]]){_0x25710f=_[_0x9f20('0x88')](this[_0x9f20('0x11')][_0x1a7387[_0x9f20('0xe7')]]);_0x25710f['transferexten']=_0x1a7387[_0x9f20('0xe8')];_0x25710f[_0x9f20('0xa9')]=_0x1a7387[_0x9f20('0xe9')];_0x25710f[_0x9f20('0x5a')]=_0x9f20('0x5b');_0x25710f[_0x9f20('0x9c')]=!![];_0x25710f[_0x9f20('0xa7')]=_0x9f20('0xe3');if(this[_0x9f20('0x11')][_0x1a7387['origtransfereruniqueid']]){_0xa98219=this['queueReports'][_0x1a7387['origtransfereruniqueid']];this[_0x9f20('0x11')][_0x1a7387['origtransfereruniqueid']]=this[_0x9f20('0x11')][_0x1a7387['transfertargetuniqueid']];this[_0x9f20('0x11')][_0x1a7387['transfertargetuniqueid']]=_0xa98219;_0x30a740=_[_0x9f20('0x88')](this[_0x9f20('0x11')][_0x1a7387['transfertargetuniqueid']]);_0x30a740['switch']=!![];}logger[_0x9f20('0x83')](_0x9f20('0xe6'),_0x1a7387[_0x9f20('0x54')],_0x25710f[_0x9f20('0x56')],_0x25710f['type'],_0x25710f[_0x9f20('0xa8')],_0x25710f['transferuniqueid']);}else if(this[_0x9f20('0x11')][_0x1a7387['origtransfereruniqueid']]){_0x25710f=_[_0x9f20('0x88')](this[_0x9f20('0x11')][_0x1a7387[_0x9f20('0xe9')]]);_0x25710f[_0x9f20('0xa8')]=_0x1a7387[_0x9f20('0xe8')];_0x25710f[_0x9f20('0xa9')]=_0x1a7387[_0x9f20('0xe9')];_0x25710f[_0x9f20('0x5a')]=_0x9f20('0x5b');_0x25710f['transfer']=!![];_0x25710f[_0x9f20('0xa7')]=_0x9f20('0xe3');_0x25710f[_0x9f20('0xe5')]=!![];_0x25710f[_0x9f20('0xdd')]=_0x1a7387[_0x9f20('0xe1')];}else if(this[_0x9f20('0x11')][_0x1a7387[_0x9f20('0xe4')]]){_0x25710f=_[_0x9f20('0x88')](this['queueReports'][_0x1a7387[_0x9f20('0xe4')]]);_0x25710f['transferexten']=_0x1a7387[_0x9f20('0xe2')];_0x25710f[_0x9f20('0xa9')]=_0x1a7387[_0x9f20('0xe4')];_0x25710f[_0x9f20('0x5a')]=_0x9f20('0x5b');_0x25710f[_0x9f20('0x9c')]=!![];_0x25710f['transfertype']='ATTENDED';_0x25710f[_0x9f20('0xe5')]=!![];_0x25710f['transferid']=_0x1a7387[_0x9f20('0xe7')];}}}catch(_0xdbf57e){logger[_0x9f20('0x47')](_0x9f20('0xe0'),_0x1a7387[_0x9f20('0x54')],util['inspect'](_0xdbf57e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x33')]=function(_0x2c508d){try{if(this['isNotNull'](_0x2c508d)){logger[_0x9f20('0x51')](_0x9f20('0xea'),_0x2c508d[_0x9f20('0x54')],util['inspect'](_0x2c508d,{'showHidden':![],'depth':null}));if(this[_0x9f20('0x11')][_0x2c508d[_0x9f20('0xe1')]]){var _0xe630f9=_[_0x9f20('0x88')](this[_0x9f20('0x11')][_0x2c508d[_0x9f20('0xe1')]]);_0xe630f9[_0x9f20('0x5a')]=_0x9f20('0xeb');_0xe630f9[_0x9f20('0x9c')]=!![];_0xe630f9[_0x9f20('0xa7')]=_0x9f20('0xec');_0xe630f9['transferexten']=_0x2c508d[_0x9f20('0xed')];_0xe630f9[_0x9f20('0xa9')]=_0x2c508d[_0x9f20('0xe1')];logger['info'](_0x9f20('0xee'),_0x2c508d[_0x9f20('0x54')],_0xe630f9[_0x9f20('0x56')],_0xe630f9[_0x9f20('0x5e')],_0xe630f9[_0x9f20('0xa8')],_0xe630f9['transferuniqueid']);this[_0x9f20('0xef')]({'event':_0x9f20('0xf0'),'uniqueid':_0x2c508d['transfereeuniqueid'],'context':_0x2c508d[_0x9f20('0xf1')],'channel':_0x2c508d[_0x9f20('0xf2')]});}}}catch(_0x5bb1d6){logger[_0x9f20('0x47')](_0x9f20('0xea'),_0x2c508d[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x5bb1d6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x2d')]=function(_0x24f57f){try{if(this[_0x9f20('0x77')](_0x24f57f)){logger['debug'](_0x9f20('0xf3'),_0x24f57f['uniqueid'],util[_0x9f20('0x46')](_0x24f57f,{'showHidden':![],'depth':null}));if(this[_0x9f20('0x11')][_0x24f57f[_0x9f20('0x54')]]){var _0x1d368c=_[_0x9f20('0x88')](this[_0x9f20('0x11')][_0x24f57f[_0x9f20('0x54')]]);if(!_['isNil'](_0x1d368c[_0x9f20('0x91')])){_0x1d368c[_0x9f20('0xf4')]=moment()[_0x9f20('0x7e')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x9f20('0x83')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x24f57f[_0x9f20('0x54')],_0x1d368c['mohstarttime']);}}}}catch(_0x1932ab){logger['error'](_0x9f20('0xf3'),_0x24f57f[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x1932ab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0x2f')]=function(_0x8e87f3){try{if(this[_0x9f20('0x77')](_0x8e87f3)){logger[_0x9f20('0x51')]('[%s][voiceQueueReport][musiconholdstop]',_0x8e87f3[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x8e87f3,{'showHidden':![],'depth':null}));if(this[_0x9f20('0x11')][_0x8e87f3[_0x9f20('0x54')]]){var _0x6b3067=_[_0x9f20('0x88')](this['queueReports'][_0x8e87f3[_0x9f20('0x54')]]);if(!_[_0x9f20('0x40')](_0x6b3067['mohstarttime'])){_0x6b3067[_0x9f20('0xf5')]+=moment()['milliseconds'](0x0)[_0x9f20('0xd0')](_0x6b3067[_0x9f20('0xf4')],_0x9f20('0xa5'));logger['info']('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x8e87f3[_0x9f20('0x54')],_0x6b3067[_0x9f20('0xf5')]);delete _0x6b3067['mohstarttime'];}}}}catch(_0x417ec6){logger['error'](_0x9f20('0xf6'),_0x8e87f3[_0x9f20('0x54')],util['inspect'](_0x417ec6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9f20('0x4a')][_0x9f20('0xf7')]=function(_0x37f52a){try{if(this['isNotNull'](_0x37f52a)){logger['debug'](_0x9f20('0xf8'),_0x37f52a[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x37f52a,{'showHidden':![],'depth':null}));if(_0x37f52a[_0x9f20('0xf9')][_0x9f20('0xa1')]()===_0x9f20('0xfa')){_0x37f52a[_0x9f20('0xfb')]=_0x37f52a['appdata']&&_0x37f52a[_0x9f20('0xfc')][_0x9f20('0xa0')](_0x9f20('0xfd'))?_0x37f52a[_0x9f20('0xfc')]:(_0x37f52a[_0x9f20('0xfc')]||_0x37f52a[_0x9f20('0xfb')])[_0x9f20('0xa1')]();if(_[_0x9f20('0xa0')](_0x37f52a[_0x9f20('0xfb')][_0x9f20('0xa1')](),_0x9f20('0xfe'))){logger[_0x9f20('0x83')](_0x9f20('0xff'),_0x37f52a['uniqueid'],_0x37f52a['application'],_0x37f52a[_0x9f20('0xfb')]);if(_[_0x9f20('0x63')](this[_0x9f20('0x13')][_0x37f52a[_0x9f20('0x54')]]))this[_0x9f20('0x13')][_0x37f52a[_0x9f20('0x54')]]={};var _0x4903b7=_0x37f52a['applicationdata'][_0x9f20('0x100')]('=');var _0x46d6ff=_0x4903b7[0x0][_0x9f20('0xa1')]()['match'](/cdr\((.*)\)/);if(_0x46d6ff)this[_0x9f20('0x13')][_0x37f52a[_0x9f20('0x54')]][_0x46d6ff[0x1]]=_0x4903b7[0x1];}}}}catch(_0x3f794e){logger[_0x9f20('0x47')](_0x9f20('0x101'),_0x37f52a[_0x9f20('0x54')],util[_0x9f20('0x46')](_0x3f794e,{'showHidden':![],'depth':null}));}};module[_0x9f20('0x102')]=VoiceQueueReport;
\ No newline at end of file