Built motion from commit 10af8726.|2.6.34
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index ceee1e4..ebef66f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xbf27=['queuesummarycomplete','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','syncVarSet','hangup','syncHangup','fullybooted','musiconholdstart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','unlockRR','queuecallerexit','queuecallercomplete','clearZombieChannels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][','uniqueid','format','voice:queue:%s','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','queue','voice_queue_presence:remove','emitInboundVoiceQueueSummary','type','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','isRunning','actionid','[voiceQueueReport][queuesummary]','createQueueSummaryReport','createReport','agents','realtime','handleInboundQueueSummaryReport','compareToInboundQueue','inbound','outbound','custom:queuesummary','syncQueueSummaryComplete','syncQueueMember','queuestatus','[voiceQueueReport][queuesummary]\x20name:%s','statusRequests','completeEvent','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','assign','pick','keys','push','last','queuecallercompleteAt','originalposition','queuecallerabandonAt','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','membername','holdtime','queuecallerexitAt','transfer','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','variable','value','CONTINUE','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','varset','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','includes','length','sumHoldTime','diff','sumDuration','milliseconds','sumBillable','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','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','[%s][voiceQueueReport][handleHangup]','[%s][voiceQueueReport][hangup]','handleHangup','cause-txt','transferid','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','syncBlindTransfer','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','[%s][voiceQueueReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','cdr(','split','match','[%s][voiceQueueReport][newexten]','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','channels','queueChannels','voiceQueues','campaigns','summary','variables','queuesummary','syncQueueSummary','bind'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbf27,0xda));var _0x7bf2=function(_0x9960e9,_0x48f28d){_0x9960e9=_0x9960e9-0x0;var _0x535669=_0xbf27[_0x9960e9];return _0x535669;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x7bf2('0x0'));var Redis=require(_0x7bf2('0x1'));var config=require(_0x7bf2('0x2'));var logger=require(_0x7bf2('0x3'))(_0x7bf2('0x4'));var ami=require(_0x7bf2('0x5'));var QueueReport=require(_0x7bf2('0x6'));var VoiceQueueSummary=require(_0x7bf2('0x7'));config['redis']=_[_0x7bf2('0x8')](config[_0x7bf2('0x9')],{'host':_0x7bf2('0xa'),'port':0x18eb});var io=require(_0x7bf2('0xb'))(new Redis(config[_0x7bf2('0x9')]));var Sequence=function(){};Sequence[_0x7bf2('0xc')][_0x7bf2('0xd')]=function(_0x330e21){this[_0x7bf2('0xe')]=this[_0x7bf2('0xe')]?this['tail'][_0x7bf2('0xf')](_0x330e21):_0x330e21();};function VoiceQueueReport(_0xa7b9b2){this[_0x7bf2('0x10')]=new Sequence();this[_0x7bf2('0x11')]={};this['realtime']=_0xa7b9b2;this['agents']=_0xa7b9b2['agents'];this[_0x7bf2('0x12')]=_0xa7b9b2[_0x7bf2('0x13')];this[_0x7bf2('0x14')]=_0xa7b9b2[_0x7bf2('0x14')];this[_0x7bf2('0x15')]=_0xa7b9b2[_0x7bf2('0x15')];this[_0x7bf2('0x16')]=initializeSummary();this[_0x7bf2('0x17')]={};ami['on'](_0x7bf2('0x18'),this[_0x7bf2('0x19')][_0x7bf2('0x1a')](this));ami['on'](_0x7bf2('0x1b'),this['syncQueueSummaryComplete'][_0x7bf2('0x1a')](this));ami['on']('queuemember',this['syncQueueMember'][_0x7bf2('0x1a')](this));ami['on']('queuestatuscomplete',this[_0x7bf2('0x1c')][_0x7bf2('0x1a')](this));ami['on'](_0x7bf2('0x1d'),this[_0x7bf2('0x1e')][_0x7bf2('0x1a')](this));ami['on'](_0x7bf2('0x1f'),this[_0x7bf2('0x20')][_0x7bf2('0x1a')](this));ami['on']('queuecallerleave',this[_0x7bf2('0x21')][_0x7bf2('0x1a')](this));ami['on'](_0x7bf2('0x22'),this[_0x7bf2('0x23')]['bind'](this));ami['on'](_0x7bf2('0x24'),this[_0x7bf2('0x25')][_0x7bf2('0x1a')](this));ami['on']('varset',this[_0x7bf2('0x26')][_0x7bf2('0x1a')](this));ami['on'](_0x7bf2('0x27'),this[_0x7bf2('0x28')][_0x7bf2('0x1a')](this));ami['on'](_0x7bf2('0x29'),this['syncFullyBooted']['bind'](this));ami['on'](_0x7bf2('0x2a'),this['syncMusicOnHoldStart'][_0x7bf2('0x1a')](this));ami['on'](_0x7bf2('0x2b'),this['syncMusicOnHoldStop'][_0x7bf2('0x1a')](this));ami['on'](_0x7bf2('0x2c'),this[_0x7bf2('0x2d')][_0x7bf2('0x1a')](this));ami['on'](_0x7bf2('0x2e'),this['syncBlindTransfer'][_0x7bf2('0x1a')](this));this[_0x7bf2('0x2f')]();this[_0x7bf2('0x30')]();}function clearChannels(_0x6151de){if(!_[_0x7bf2('0x31')](_0x6151de)){for(var _0x1b29cf in _0x6151de){if(_0x6151de['hasOwnProperty'](_0x1b29cf)){delete _0x6151de[_0x1b29cf];}}}}function clearCampaigns(_0x39a7be){if(!_[_0x7bf2('0x31')](_0x39a7be)){for(var _0x134b3a in _0x39a7be){if(_0x39a7be[_0x7bf2('0x32')](_0x134b3a)){_0x39a7be[_0x134b3a]['originated']=0x0;}}}}function clearVoiceQueues(_0x2f435d){if(!_[_0x7bf2('0x31')](_0x2f435d)){for(var _0x5679c2 in _0x2f435d){if(_0x2f435d[_0x7bf2('0x32')](_0x5679c2)){_0x2f435d[_0x5679c2][_0x7bf2('0x33')]=0x0;_0x2f435d[_0x5679c2][_0x7bf2('0x34')]=0x0;_0x2f435d[_0x5679c2][_0x7bf2('0x35')]=0x0;_0x2f435d[_0x5679c2][_0x7bf2('0x36')]=0x0;_0x2f435d[_0x5679c2]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x1dfb88){if(!_[_0x7bf2('0x31')](_0x1dfb88)){for(var _0x78e356 in _0x1dfb88){if(_0x1dfb88[_0x7bf2('0x32')](_0x78e356)){_0x1dfb88[_0x78e356][_0x7bf2('0x37')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x170f23){return _0x170f23[_0x7bf2('0x38')]||_0x170f23[_0x7bf2('0x1f')]||_0x170f23[_0x7bf2('0x39')];}VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x3a')]=function(){var _0x257551=this;for(var _0x247fed in this[_0x7bf2('0x12')]){if(this[_0x7bf2('0x12')][_0x7bf2('0x32')](_0x247fed)&&!this[_0x7bf2('0x12')][_0x247fed][_0x7bf2('0x3b')]){this[_0x7bf2('0x10')][_0x7bf2('0xd')](function(){if(!_[_0x7bf2('0x3c')](_0x257551[_0x7bf2('0x12')][_0x247fed])){return ami[_0x7bf2('0x3d')]({'action':_0x7bf2('0x3e'),'channel':_0x257551['channels'][_0x247fed][_0x7bf2('0x3f')]})[_0x7bf2('0x40')](function(_0x48ce52){if(_0x48ce52[_0x7bf2('0x41')]===_0x7bf2('0x42')){setTimeout(function(){if(_0x257551[_0x7bf2('0x12')][_0x247fed]){delete _0x257551[_0x7bf2('0x12')][_0x247fed];logger[_0x7bf2('0x43')](_0x7bf2('0x44'),_0x247fed,util[_0x7bf2('0x45')](_0x48ce52,{'showHidden':![],'depth':null}));}if(_0x257551[_0x7bf2('0x11')][_0x247fed]){delete _0x257551['queueReports'][_0x247fed];logger[_0x7bf2('0x43')](_0x7bf2('0x46'),_0x247fed,util[_0x7bf2('0x45')](_0x48ce52,{'showHidden':![],'depth':null}));}if(_0x257551[_0x7bf2('0x17')][_0x247fed]){delete _0x257551[_0x7bf2('0x17')][_0x247fed];logger['error'](_0x7bf2('0x47'),_0x247fed,util[_0x7bf2('0x45')](_0x48ce52,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x48')]=function(){logger[_0x7bf2('0x43')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x7bf2('0x12')]);this[_0x7bf2('0x49')](this[_0x7bf2('0x11')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x7bf2('0x14')]);clearCampaigns(this['campaigns']);this['summary']=initializeSummary();};VoiceQueueReport[_0x7bf2('0xc')]['clearQueueReport']=function(_0x5ec58e){var _0x1bc9d3=this;if(!_['isEmpty'](_0x5ec58e)){for(var _0x455a8c in _0x5ec58e){if(_0x5ec58e[_0x7bf2('0x32')](_0x455a8c)){_0x1bc9d3[_0x7bf2('0x4a')](_0x5ec58e[_0x455a8c],_0x7bf2('0x4b'));delete _0x5ec58e[_0x455a8c];}}}};VoiceQueueReport[_0x7bf2('0xc')]['emit']=function(_0x3e3d9d,_0x52904c,_0xb87835){io['to'](_0x3e3d9d)[_0x7bf2('0x4c')](_0x52904c,_0xb87835);};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x4d')]=function(_0x38f67f,_0x55288a){logger[_0x7bf2('0x4e')](_0x7bf2('0x4f')+_0x55288a+']\x20sending\x20voice_queue_channel:save\x20event:',_0x38f67f[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x38f67f,{'showHidden':![],'depth':null}));this[_0x7bf2('0x4c')](util[_0x7bf2('0x51')](_0x7bf2('0x52'),_0x38f67f['queue']),'voice_queue_channel:save',_0x38f67f);io[_0x7bf2('0x4c')](_0x7bf2('0x53'),_0x38f67f);};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x4a')]=function(_0x14027e,_0x4f66ca){logger[_0x7bf2('0x4e')](_0x7bf2('0x4f')+_0x4f66ca+_0x7bf2('0x54'),_0x14027e[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x14027e,{'showHidden':![],'depth':null}));if(_0x14027e[_0x7bf2('0x55')]===_0x7bf2('0x56')){return;}this[_0x7bf2('0x4c')](util[_0x7bf2('0x51')](_0x7bf2('0x52'),_0x14027e[_0x7bf2('0x57')]),'voice_queue_channel:remove',_0x14027e);io['emit'](_0x7bf2('0x58'),_0x14027e);};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x59')]=function(_0x56cce9){if(_0x56cce9[_0x7bf2('0x5a')]==='inbound'){logger[_0x7bf2('0x4e')](_0x7bf2('0x5b'),util[_0x7bf2('0x45')](_0x56cce9,{'showHidden':![],'depth':null}));this[_0x7bf2('0x4c')](util[_0x7bf2('0x51')](_0x7bf2('0x52'),_0x56cce9[_0x7bf2('0x5c')]),_0x7bf2('0x5d'),_0x56cce9);}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x5e')]=function(_0x5f0ec6){return _0x5f0ec6!==null&&!_[_0x7bf2('0x5f')](_0x5f0ec6);};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x30')]=function(){var _0x4d4f83=this;setInterval(function(){_0x4d4f83[_0x7bf2('0x3a')]();ami[_0x7bf2('0x3d')]({'action':_0x7bf2('0x60')})[_0x7bf2('0x40')](function(_0xcbdb6f){logger[_0x7bf2('0x43')](_0x7bf2('0x61'),util[_0x7bf2('0x45')](_0xcbdb6f,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x2f')]=function(){var _0x1d5749=this;setInterval(function(){if(!_0x1d5749['summary'][_0x7bf2('0x62')]){return ami['Action']({'action':_0x7bf2('0x18')})['then'](function(_0x1b2d4a){_0x1d5749[_0x7bf2('0x16')]['id']=_0x1b2d4a[_0x7bf2('0x63')];_0x1d5749[_0x7bf2('0x16')]['isRunning']=!![];_0x1d5749[_0x7bf2('0x16')]['queuestatus'][_0x1b2d4a['actionid']]={};})[_0x7bf2('0x40')](function(_0x427964){logger[_0x7bf2('0x43')](_0x7bf2('0x64'),util['inspect'](_0x427964,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x65')]=function(_0xef26d2,_0x105958){var _0x806e92;if(this['summary']&&this[_0x7bf2('0x16')][_0x7bf2('0x60')]&&this[_0x7bf2('0x16')][_0x7bf2('0x60')][_0xef26d2[_0x7bf2('0x5c')]]){_0x806e92=this[_0x7bf2('0x16')][_0x7bf2('0x60')][_0xef26d2[_0x7bf2('0x5c')]]['summaryEvent'];}var _0x591d58=new VoiceQueueSummary(_0xef26d2);return _0x591d58[_0x7bf2('0x66')](_0x105958['agents'],this[_0x7bf2('0x67')],_0x806e92,this[_0x7bf2('0x68')][_0x7bf2('0x12')]);};VoiceQueueReport['prototype'][_0x7bf2('0x69')]=function(_0x48e8c5,_0x4e8f05){var _0x2173eb=this[_0x7bf2('0x65')](_0x48e8c5,_0x4e8f05);var _0x45d207=![];_0x45d207=_0x2173eb[_0x7bf2('0x6a')](_0x48e8c5);if(_0x45d207){Object['assign'](_0x48e8c5,_0x2173eb);this[_0x7bf2('0x68')]['voiceQueues'][_0x48e8c5['name']]=_0x48e8c5;this['emitInboundVoiceQueueSummary'](_0x2173eb);}};VoiceQueueReport['prototype'][_0x7bf2('0x1c')]=function(_0x5131a8){var _0xacbf1=null;var _0x3bf0b8=this['summary']['id'];if(this[_0x7bf2('0x16')]['queuestatus'][_0x3bf0b8]){_0xacbf1=this[_0x7bf2('0x16')]['queuestatus'][_0x3bf0b8][_0x5131a8['actionid']];}if(!_0xacbf1){this[_0x7bf2('0x16')]=initializeSummary();return;}var _0x2f4439=this[_0x7bf2('0x14')][_0xacbf1[_0x7bf2('0x57')]];if(_0x2f4439[_0x7bf2('0x5a')]===_0x7bf2('0x6b')){this[_0x7bf2('0x69')](_0x2f4439,_0xacbf1);}else if(_0x2f4439[_0x7bf2('0x5a')]===_0x7bf2('0x6c')){var _0xa40fb1=this[_0x7bf2('0x65')](_0x2f4439,_0xacbf1);ami[_0x7bf2('0x4c')](_0x7bf2('0x6d'),_0xa40fb1);}this['summary']['statusRequests']-=0x1;var _0xded5d6=this['summary']['statusRequests']>0x0?!![]:![];if(!_0xded5d6){return this[_0x7bf2('0x6e')](this['summary']['completeEvent']);}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x6f')]=function(_0x1910e4){var _0x217964=this[_0x7bf2('0x16')]['id'];if(this[_0x7bf2('0x16')]['queuestatus'][_0x217964]&&this[_0x7bf2('0x16')][_0x7bf2('0x70')][_0x217964][_0x1910e4[_0x7bf2('0x63')]]){this[_0x7bf2('0x16')]['queuestatus'][_0x217964][_0x1910e4[_0x7bf2('0x63')]][_0x7bf2('0x67')]['push'](_0x1910e4);}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x19')]=function(_0x596e9e){var _0x513165=this;try{if(this[_0x7bf2('0x5e')](_0x596e9e)&&this['isNotNull'](_0x596e9e[_0x7bf2('0x57')])){logger[_0x7bf2('0x4e')]('[voiceQueueReport][queuesummary]\x20event:',util[_0x7bf2('0x45')](_0x596e9e,{'showHidden':![],'depth':null}));var _0x18a7cf=this[_0x7bf2('0x14')][_0x596e9e[_0x7bf2('0x57')]];if(_0x18a7cf){logger[_0x7bf2('0x4e')](_0x7bf2('0x71'),_0x18a7cf[_0x7bf2('0x5c')]);this[_0x7bf2('0x16')][_0x7bf2('0x60')][_0x18a7cf[_0x7bf2('0x5c')]]={'summaryEvent':_0x596e9e};this[_0x7bf2('0x16')][_0x7bf2('0x72')]+=0x1;return ami[_0x7bf2('0x3d')]({'action':'queuestatus','queue':_0x18a7cf[_0x7bf2('0x5c')]})['then'](function(_0x558a20){if(!_0x513165[_0x7bf2('0x16')][_0x7bf2('0x70')][_0x596e9e[_0x7bf2('0x63')]]){_0x513165[_0x7bf2('0x16')]['queuestatus'][_0x596e9e[_0x7bf2('0x63')]]={};}_0x513165[_0x7bf2('0x16')]['queuestatus'][_0x596e9e['actionid']][_0x558a20[_0x7bf2('0x63')]]={'queue':_0x18a7cf[_0x7bf2('0x5c')],'agents':[]};})[_0x7bf2('0x40')](function(_0x8cde67){throw _0x8cde67;});}}}catch(_0x3d6274){logger[_0x7bf2('0x43')](_0x7bf2('0x64'),util[_0x7bf2('0x45')](_0x3d6274,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x6e')]=function(_0x4988d9){if(this['summary'][_0x7bf2('0x72')]>0x0){this[_0x7bf2('0x16')][_0x7bf2('0x73')]=_0x4988d9;return;}logger[_0x7bf2('0x4e')](_0x7bf2('0x74'),util[_0x7bf2('0x45')](_0x4988d9,{'showHidden':![],'depth':null}));this[_0x7bf2('0x16')]=initializeSummary();ami[_0x7bf2('0x4c')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x1e')]=function(_0x4bb184){try{if(this['isNotNull'](_0x4bb184)){logger[_0x7bf2('0x4e')](_0x7bf2('0x75'),_0x4bb184['uniqueid'],util[_0x7bf2('0x45')](_0x4bb184,{'showHidden':![],'depth':null}));if(_[_0x7bf2('0x5f')](this[_0x7bf2('0x11')][_0x4bb184[_0x7bf2('0x50')]])){this[_0x7bf2('0x11')][_0x4bb184['uniqueid']]=[];}if(_[_0x7bf2('0x5f')](this[_0x7bf2('0x12')][_0x4bb184[_0x7bf2('0x50')]])){this[_0x7bf2('0x12')][_0x4bb184['uniqueid']]={};}var _0x23fb7d=new QueueReport();_0x23fb7d[_0x7bf2('0x57')]=_0x4bb184[_0x7bf2('0x57')];_0x23fb7d['type']=this[_0x7bf2('0x14')][_0x23fb7d[_0x7bf2('0x57')]]&&this[_0x7bf2('0x14')][_0x23fb7d[_0x7bf2('0x57')]]['type']?this['voiceQueues'][_0x23fb7d[_0x7bf2('0x57')]]['type']||_0x7bf2('0x6b'):'inbound';_0x23fb7d[_0x7bf2('0x76')]=moment()[_0x7bf2('0x51')](_0x7bf2('0x77'));_0x23fb7d[_0x7bf2('0x78')]=_0x4bb184[_0x7bf2('0x78')];_0x23fb7d[_0x7bf2('0x79')]=_0x4bb184[_0x7bf2('0x79')];_0x23fb7d[_0x7bf2('0x50')]=_0x4bb184[_0x7bf2('0x50')];_0x23fb7d[_0x7bf2('0x7a')]=this[_0x7bf2('0x12')][_0x4bb184['uniqueid']][_0x7bf2('0x7a')];logger[_0x7bf2('0x7b')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x23fb7d['queue'],_0x23fb7d[_0x7bf2('0x5a')]);Object[_0x7bf2('0x7c')](_0x23fb7d,_[_0x7bf2('0x7d')](_0x4bb184,_[_0x7bf2('0x7e')](_0x23fb7d)));this['queueReports'][_0x4bb184[_0x7bf2('0x50')]][_0x7bf2('0x7f')](_0x23fb7d);this[_0x7bf2('0x12')][_0x4bb184[_0x7bf2('0x50')]]=_0x23fb7d;this[_0x7bf2('0x4d')](_0x23fb7d,_0x7bf2('0x1d'));}}catch(_0xf79596){logger[_0x7bf2('0x43')](_0x7bf2('0x75'),_0x4bb184['uniqueid'],util[_0x7bf2('0x45')](_0xf79596,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x20')]=function(_0x504711){try{if(this[_0x7bf2('0x5e')](_0x504711)){logger['debug']('[%s][voiceQueueReport][queuecallerabandon]',_0x504711['uniqueid'],util['inspect'](_0x504711,{'showHidden':![],'depth':null}));if(this[_0x7bf2('0x11')][_0x504711[_0x7bf2('0x50')]]){var _0x250ca8=_[_0x7bf2('0x80')](this[_0x7bf2('0x11')][_0x504711['uniqueid']]);_0x250ca8[_0x7bf2('0x39')]=![];_0x250ca8[_0x7bf2('0x81')]=null;_0x250ca8['holdtime']=_0x504711['holdtime'];_0x250ca8[_0x7bf2('0x82')]=_0x504711[_0x7bf2('0x82')];_0x250ca8[_0x7bf2('0x1f')]=!![];_0x250ca8[_0x7bf2('0x83')]=moment()[_0x7bf2('0x51')](_0x7bf2('0x77'));_0x250ca8['queuecallerexitreason']='ABANDONED';_0x250ca8[_0x7bf2('0x84')]=null;logger['info'](_0x7bf2('0x85'),_0x250ca8[_0x7bf2('0x57')],_0x250ca8[_0x7bf2('0x5a')]);this['channels'][_0x504711['uniqueid']]=_0x250ca8;this[_0x7bf2('0x4a')](_0x250ca8,_0x7bf2('0x1f'));}}}catch(_0x4c9d75){logger[_0x7bf2('0x43')](_0x7bf2('0x86'),_0x504711[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x4c9d75,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x21')]=function(_0x5040c8){try{if(this[_0x7bf2('0x5e')](_0x5040c8)){logger['debug'](_0x7bf2('0x87'),_0x5040c8[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x5040c8,{'showHidden':![],'depth':null}));if(this[_0x7bf2('0x11')][_0x5040c8[_0x7bf2('0x50')]]){var _0x1155ca=_[_0x7bf2('0x80')](this[_0x7bf2('0x11')][_0x5040c8[_0x7bf2('0x50')]]);_0x1155ca['queuecallerleaveAt']=moment()[_0x7bf2('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x1155ca['connectedlinenum']=_0x5040c8[_0x7bf2('0x88')];_0x1155ca['connectedlinename']=_0x5040c8[_0x7bf2('0x89')];logger[_0x7bf2('0x7b')](_0x7bf2('0x8a'),_0x1155ca[_0x7bf2('0x57')],_0x1155ca[_0x7bf2('0x5a')],_0x5040c8[_0x7bf2('0x88')],_0x5040c8[_0x7bf2('0x89')]);this[_0x7bf2('0x12')][_0x5040c8[_0x7bf2('0x50')]]=_0x1155ca;this[_0x7bf2('0x4d')](_0x1155ca,_0x7bf2('0x8b'));}}}catch(_0x48337f){logger['error'](_0x7bf2('0x87'),_0x5040c8[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x48337f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x25')]=function(_0x5be0cb){try{if(this[_0x7bf2('0x5e')](_0x5be0cb)){logger[_0x7bf2('0x4e')](_0x7bf2('0x8c'),_0x5be0cb[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x5be0cb,{'showHidden':![],'depth':null}));if(this[_0x7bf2('0x11')][_0x5be0cb[_0x7bf2('0x50')]]){var _0x292b01=_[_0x7bf2('0x80')](this[_0x7bf2('0x11')][_0x5be0cb[_0x7bf2('0x50')]]);_0x292b01[_0x7bf2('0x39')]=!![];_0x292b01[_0x7bf2('0x55')]=_0x7bf2('0x8d');logger['info'](_0x7bf2('0x8e'),_0x292b01['queue'],_0x292b01['type']);}}}catch(_0x53a26b){logger[_0x7bf2('0x43')](_0x7bf2('0x8c'),_0x5be0cb[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x53a26b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0x23')]=function(_0x5ebfb5){try{if(this[_0x7bf2('0x5e')](_0x5ebfb5)){logger['debug'](_0x7bf2('0x8f'),_0x5ebfb5[_0x7bf2('0x50')],util['inspect'](_0x5ebfb5,{'showHidden':![],'depth':null}));if(this[_0x7bf2('0x11')][_0x5ebfb5[_0x7bf2('0x50')]]){var _0x273917=_[_0x7bf2('0x80')](this[_0x7bf2('0x11')][_0x5ebfb5[_0x7bf2('0x50')]]);_0x273917[_0x7bf2('0x1f')]=![];_0x273917[_0x7bf2('0x83')]=null;_0x273917['assigned']=!![];_0x273917[_0x7bf2('0x84')]=_0x5ebfb5[_0x7bf2('0x90')];_0x273917[_0x7bf2('0x91')]=_0x5ebfb5[_0x7bf2('0x91')];_0x273917[_0x7bf2('0x39')]=!![];_0x273917[_0x7bf2('0x38')]=![];_0x273917[_0x7bf2('0x92')]=null;if(!_0x273917['transfer']){if(_0x5ebfb5['reason']==_0x7bf2('0x93')){_0x273917[_0x7bf2('0x55')]='COMPLETED';logger[_0x7bf2('0x7b')](_0x7bf2('0x94'),_0x273917[_0x7bf2('0x57')],_0x273917[_0x7bf2('0x5a')]);}else{if(_[_0x7bf2('0x95')](_0x5ebfb5['channel']['toLowerCase'](),_0x7bf2('0x96'))){if(this[_0x7bf2('0x11')][_0x5ebfb5[_0x7bf2('0x97')]]){var _0x5ac949=_['last'](this['queueReports'][_0x5ebfb5[_0x7bf2('0x97')]]);_0x5ac949[_0x7bf2('0x39')]=![];_0x5ac949[_0x7bf2('0x38')]=!![];_0x5ac949[_0x7bf2('0x92')]=moment(_0x273917[_0x7bf2('0x76')])[_0x7bf2('0x98')](_0x5ebfb5[_0x7bf2('0x91')],_0x7bf2('0x99'))[_0x7bf2('0x51')](_0x7bf2('0x77'));_0x5ac949[_0x7bf2('0x55')]=_0x7bf2('0x9a');_0x5ac949['transfer']=!![];_0x5ac949[_0x7bf2('0x9b')]='FORWARD';_0x5ac949[_0x7bf2('0x9c')]=_0x5ebfb5[_0x7bf2('0x9d')];_0x5ac949[_0x7bf2('0x9e')]=_0x5ebfb5[_0x7bf2('0x50')];logger[_0x7bf2('0x7b')](_0x7bf2('0x9f'),_0x5ac949[_0x7bf2('0x57')],_0x5ac949['type']);var _0x9b1f36=this[_0x7bf2('0x11')][_0x5ebfb5[_0x7bf2('0x97')]];this['queueReports'][_0x5ebfb5[_0x7bf2('0x97')]]=this[_0x7bf2('0x11')][_0x5ebfb5[_0x7bf2('0x50')]];this['queueReports'][_0x5ebfb5['uniqueid']]=_0x9b1f36;}}else{_0x273917['queuecallerexitreason']='COMPLETEDBY'+_0x5ebfb5[_0x7bf2('0xa0')]['toUpperCase']();logger[_0x7bf2('0x7b')](_0x7bf2('0xa1'),_0x273917['queue'],_0x273917[_0x7bf2('0x5a')],_0x273917[_0x7bf2('0x55')]);}}}this['channels'][_0x5ebfb5[_0x7bf2('0x50')]]=_0x273917;}}}catch(_0x54d93f){logger[_0x7bf2('0x43')](_0x7bf2('0x8f'),_0x5ebfb5[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x54d93f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7bf2('0x26')]=function(_0xf85497){try{if(this[_0x7bf2('0x5e')](_0xf85497)){logger[_0x7bf2('0x4e')](_0x7bf2('0xa2'),_0xf85497['uniqueid'],util['inspect'](_0xf85497,{'showHidden':![],'depth':null}));this['addVariable'](_0xf85497[_0x7bf2('0x50')],_['keys'](_0xf85497[_0x7bf2('0xa3')])[0x0],_0xf85497[_0x7bf2('0xa4')]);if(this[_0x7bf2('0x11')][_0xf85497[_0x7bf2('0x50')]]){var _0x57eb76=_[_0x7bf2('0x80')](this[_0x7bf2('0x11')][_0xf85497['uniqueid']]);if(_0x57eb76){if(this[_0x7bf2('0x5e')](_0xf85497[_0x7bf2('0xa3')])&&this['isNotNull'](_0xf85497[_0x7bf2('0xa3')][_0x7bf2('0x70')])){switch(_0xf85497[_0x7bf2('0xa4')]){case _0x7bf2('0xa5'):_0x57eb76[_0x7bf2('0x38')]=![];_0x57eb76[_0x7bf2('0x92')]=null;break;case _0x7bf2('0xa6'):_0x57eb76[_0x7bf2('0xa7')]=_0x7bf2('0xa8');_0x57eb76[_0x7bf2('0x38')]=!![];_0x57eb76[_0x7bf2('0x92')]=moment()[_0x7bf2('0x51')](_0x7bf2('0x77'));_0x57eb76[_0x7bf2('0xa9')]=moment()[_0x7bf2('0x51')](_0x7bf2('0x77'));logger[_0x7bf2('0x4e')](_0x7bf2('0xaa'),_0xf85497[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x57eb76,{'showHidden':![],'depth':null}));ami['emit'](_0x7bf2('0xab'),_0x57eb76);break;default:_0x57eb76['queuecallerexit']=!![];_0x57eb76[_0x7bf2('0x92')]=moment()[_0x7bf2('0x51')]('YYYY-MM-DD\x20HH:mm:ss');_0x57eb76[_0x7bf2('0xa9')]=moment()[_0x7bf2('0x51')](_0x7bf2('0x77'));}_0x57eb76[_0x7bf2('0x1f')]=![];_0x57eb76['queuecallerabandonAt']=null;_0x57eb76[_0x7bf2('0x55')]=_0xf85497['value'];this[_0x7bf2('0x12')][_0xf85497[_0x7bf2('0x50')]]=_0x57eb76;this['emitVoiceQueueChannelRemove'](_0x57eb76,_0x7bf2('0xac'));}else if(this['isNotNull'](_0xf85497['variable'])&&this['isNotNull'](_0xf85497[_0x7bf2('0xa3')][_0x7bf2('0xad')])){if(!_0x57eb76[_0x7bf2('0x1f')]){_0x57eb76[_0x7bf2('0x38')]=!![];_0x57eb76[_0x7bf2('0x92')]=moment()[_0x7bf2('0x51')](_0x7bf2('0x77'));_0x57eb76[_0x7bf2('0x55')]=_0x7bf2('0xae');_0x57eb76[_0x7bf2('0xa9')]=moment()[_0x7bf2('0x51')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7bf2('0x12')][_0xf85497[_0x7bf2('0x50')]]=_0x57eb76;}}logger[_0x7bf2('0x7b')](_0x7bf2('0xaf'),_0xf85497[_0x7bf2('0x50')],_0x57eb76['queue'],_0x57eb76[_0x7bf2('0x5a')],_[_0x7bf2('0x7e')](_0xf85497[_0x7bf2('0xa3')])[0x0],_0xf85497[_0x7bf2('0xa4')]);_0x57eb76['variables']=this[_0x7bf2('0x17')][_0xf85497[_0x7bf2('0x50')]];}}}}catch(_0x5839e8){logger[_0x7bf2('0x43')](_0x7bf2('0xa2'),_0xf85497[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x5839e8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0xb0')]=function(_0x32b9ec,_0x108bc0,_0x4c7e73){var _0x10036e=[_0x7bf2('0xb1'),_0x7bf2('0xb2'),_0x7bf2('0xb3'),_0x7bf2('0xb4'),_0x7bf2('0xb5'),_0x7bf2('0xb6'),'rtpaudioqosrtt',_0x7bf2('0xb7'),_0x7bf2('0xb8'),_0x7bf2('0xb9'),_0x7bf2('0xba'),_0x7bf2('0xbb'),_0x7bf2('0xbc'),_0x7bf2('0xbd'),'memberinterface',_0x7bf2('0xbe'),_0x7bf2('0x90'),_0x7bf2('0xbf'),_0x7bf2('0xc0')];if(!_[_0x7bf2('0x3c')](_0x108bc0)&&!_[_0x7bf2('0xc1')](_0x10036e,_0x108bc0)){if(_[_0x7bf2('0x5f')](this[_0x7bf2('0x17')][_0x32b9ec])){this[_0x7bf2('0x17')][_0x32b9ec]={};}this[_0x7bf2('0x17')][_0x32b9ec][_0x108bc0]=_0x4c7e73;}};VoiceQueueReport[_0x7bf2('0xc')]['handleHangup']=function(_0x36c920,_0x5e1a0d,_0x36abea){try{var _0x4706aa={};if(this[_0x7bf2('0x11')][_0x36c920]){for(var _0x597f8d=0x0;_0x597f8d<this[_0x7bf2('0x11')][_0x36c920][_0x7bf2('0xc2')];_0x597f8d+=0x1){_0x4706aa=this[_0x7bf2('0x11')][_0x36c920][_0x597f8d];var _0x4a8f41=this['voiceQueues'][_0x4706aa[_0x7bf2('0x57')]];if(_0x4a8f41){_0x4a8f41[_0x7bf2('0xc3')]+=moment(_0x4706aa['queuecallerleaveAt'])[_0x7bf2('0xc4')](_0x4706aa['queuecallerjoinAt'],_0x7bf2('0x99'))||0x0;if(_0x36abea&&_0x4706aa[_0x7bf2('0x55')]===_0x7bf2('0x56')){_0x4706aa[_0x7bf2('0x55')]=_0x7bf2('0x8d');}if(_0x597f8d===this[_0x7bf2('0x11')][_0x36c920]['length']-0x1){_0x4a8f41[_0x7bf2('0xc5')]+=moment()[_0x7bf2('0xc6')](0x0)[_0x7bf2('0xc4')](_0x4706aa[_0x7bf2('0x76')],_0x7bf2('0x99'));if(hasCallerLeftTheQueue(_0x4706aa)&&_0x4706aa[_0x7bf2('0x55')]!==_0x7bf2('0x56')){_0x4a8f41['total']+=0x1;}if(_0x4706aa[_0x7bf2('0x39')]){_0x4a8f41['answered']+=0x1;_0x4a8f41[_0x7bf2('0xc7')]+=moment()['milliseconds'](0x0)['diff'](_0x4706aa[_0x7bf2('0xa9')],_0x7bf2('0x99'));_0x4706aa[_0x7bf2('0x81')]=moment()[_0x7bf2('0x51')](_0x7bf2('0x77'));_0x4706aa[_0x7bf2('0x38')]=![];_0x4706aa[_0x7bf2('0x92')]=null;}if(_0x4706aa[_0x7bf2('0x38')]&&_0x4706aa[_0x7bf2('0x93')]!=!![]){_0x4a8f41[_0x7bf2('0xc8')]+=0x1;_0x4706aa[_0x7bf2('0xa7')]=_0x7bf2('0xc8');logger['debug'](_0x7bf2('0xc9'),_0x36c920,util[_0x7bf2('0x45')](_0x4706aa,{'showHidden':![],'depth':null}));ami['emit'](_0x7bf2('0xca'),_0x4706aa);}if(_0x4706aa[_0x7bf2('0x1f')]){_0x4a8f41[_0x7bf2('0xcb')]+=0x1;_0x4706aa[_0x7bf2('0xa7')]=_0x7bf2('0xcb');logger['debug'](_0x7bf2('0xcc'),_0x36c920,util[_0x7bf2('0x45')](_0x4706aa,{'showHidden':![],'depth':null}));ami[_0x7bf2('0x4c')]('custom:queuecallerabandon',_0x4706aa);}}else{_0x4a8f41[_0x7bf2('0xc5')]+=_0x4a8f41['sumHoldTime'];}logger[_0x7bf2('0x7b')](_0x7bf2('0xcd'),_0x36c920,_0x4706aa['queue'],_0x4706aa['type'],_0x5e1a0d);this['channels'][_0x36c920]=_0x4706aa;Object[_0x7bf2('0x7c')](this['voiceQueues'][_0x4706aa['queue']],_0x4a8f41);if(_0x4706aa['queuecallerleaveAt']){this[_0x7bf2('0x4a')](_0x4706aa,_0x7bf2('0x27'));}}}logger[_0x7bf2('0x4e')](_0x7bf2('0xce'),_0x36c920,util[_0x7bf2('0x45')](this['queueReports'][_0x36c920],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x4706aa)&&_0x4706aa[_0x7bf2('0x55')]!==_0x7bf2('0x56')){ami['emit']('custom:voiceQueueReport',this[_0x7bf2('0x11')][_0x36c920]);if(this[_0x7bf2('0x11')][_0x36c920]){delete this[_0x7bf2('0x11')][_0x36c920];}if(this[_0x7bf2('0x12')][_0x36c920]){delete this[_0x7bf2('0x12')][_0x36c920];}if(this[_0x7bf2('0x17')][_0x36c920]){delete this['variables'][_0x36c920];}}}}catch(_0x553e0f){logger[_0x7bf2('0x43')](_0x7bf2('0xcf'),_0x36c920,util[_0x7bf2('0x45')](_0x553e0f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7bf2('0x28')]=function(_0x4e8c22){try{if(this[_0x7bf2('0x5e')](_0x4e8c22)){logger[_0x7bf2('0x4e')](_0x7bf2('0xd0'),_0x4e8c22['uniqueid'],util['inspect'](_0x4e8c22,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4e8c22['uniqueid']]){return this[_0x7bf2('0xd1')](_0x4e8c22[_0x7bf2('0x50')],_0x4e8c22[_0x7bf2('0xd2')],![]);}if(this[_0x7bf2('0x11')][_0x4e8c22['linkedid']]){if(_0x4e8c22['cause']==='21'){return;}return this[_0x7bf2('0xd1')](_0x4e8c22['linkedid'],_0x4e8c22[_0x7bf2('0xd2')],!![]);}var _0x46c7a6=Object[_0x7bf2('0x7e')](this[_0x7bf2('0x11')]);for(var _0x450da9=0x0;_0x450da9<_0x46c7a6[_0x7bf2('0xc2')];_0x450da9++){var _0x260781=_[_0x7bf2('0x80')](this[_0x7bf2('0x11')][_0x46c7a6[_0x450da9]]);if(_0x260781&&_0x260781[_0x7bf2('0xd3')]===_0x4e8c22[_0x7bf2('0x50')]){return this[_0x7bf2('0xd1')](_0x260781['uniqueid'],_0x4e8c22[_0x7bf2('0xd2')],!![]);}}if(!this['queueReports'][_0x4e8c22[_0x7bf2('0x50')]]){logger['debug']('[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed',_0x4e8c22[_0x7bf2('0x50')]);if(this[_0x7bf2('0x12')][_0x4e8c22['uniqueid']]){delete this['channels'][_0x4e8c22[_0x7bf2('0x50')]];}if(this[_0x7bf2('0x17')][_0x4e8c22[_0x7bf2('0x50')]]){delete this[_0x7bf2('0x17')][_0x4e8c22[_0x7bf2('0x50')]];}}}}catch(_0x29786f){logger[_0x7bf2('0x43')](_0x7bf2('0xd0'),_0x4e8c22['uniqueid'],util[_0x7bf2('0x45')](_0x29786f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7bf2('0xc')]['syncAttendedTransfer']=function(_0x382a01){try{if(this['isNotNull'](_0x382a01)){logger[_0x7bf2('0x4e')](_0x7bf2('0xd4'),_0x382a01[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x382a01,{'showHidden':![],'depth':null}));var _0x12b254;var _0x3f61b8;var _0x5282c5;if(this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xd5')]]){_0x12b254=_[_0x7bf2('0x80')](this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xd5')]]);_0x12b254[_0x7bf2('0x9c')]=_0x382a01[_0x7bf2('0xd6')];_0x12b254[_0x7bf2('0x9e')]=_0x382a01[_0x7bf2('0xd7')];_0x12b254[_0x7bf2('0x55')]='ATTENDEDTRANSFER';_0x12b254[_0x7bf2('0x93')]=!![];_0x12b254[_0x7bf2('0x9b')]=_0x7bf2('0xd8');if(this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xd7')]]){_0x5282c5=this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xd7')]];this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xd7')]]=this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xd5')]];this['queueReports'][_0x382a01['transfereeuniqueid']]=_0x5282c5;_0x3f61b8=_['last'](this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xd5')]]);_0x3f61b8['switch']=!![];}logger[_0x7bf2('0x7b')](_0x7bf2('0xd9'),_0x382a01[_0x7bf2('0x50')],_0x12b254[_0x7bf2('0x57')],_0x12b254['type'],_0x12b254[_0x7bf2('0x9c')],_0x12b254[_0x7bf2('0x9e')]);}else if(this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xda')]]){_0x12b254=_[_0x7bf2('0x80')](this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xda')]]);_0x12b254['transferexten']=_0x382a01[_0x7bf2('0xdb')];_0x12b254['transferuniqueid']=_0x382a01[_0x7bf2('0xdc')];_0x12b254[_0x7bf2('0x55')]=_0x7bf2('0x56');_0x12b254['transfer']=!![];_0x12b254[_0x7bf2('0x9b')]=_0x7bf2('0xd8');if(this[_0x7bf2('0x11')][_0x382a01['origtransfereruniqueid']]){_0x5282c5=this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xdc')]];this['queueReports'][_0x382a01['origtransfereruniqueid']]=this['queueReports'][_0x382a01[_0x7bf2('0xda')]];this['queueReports'][_0x382a01[_0x7bf2('0xda')]]=_0x5282c5;_0x3f61b8=_[_0x7bf2('0x80')](this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xda')]]);_0x3f61b8['switch']=!![];}logger['info'](_0x7bf2('0xd9'),_0x382a01[_0x7bf2('0x50')],_0x12b254['queue'],_0x12b254[_0x7bf2('0x5a')],_0x12b254['transferexten'],_0x12b254[_0x7bf2('0x9e')]);}else if(this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xdc')]]){_0x12b254=_[_0x7bf2('0x80')](this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xdc')]]);_0x12b254[_0x7bf2('0x9c')]=_0x382a01[_0x7bf2('0xdb')];_0x12b254[_0x7bf2('0x9e')]=_0x382a01[_0x7bf2('0xdc')];_0x12b254[_0x7bf2('0x55')]=_0x7bf2('0x56');_0x12b254[_0x7bf2('0x93')]=!![];_0x12b254['transfertype']=_0x7bf2('0xd8');_0x12b254['switch']=!![];_0x12b254[_0x7bf2('0xd3')]=_0x382a01[_0x7bf2('0xd5')];}else if(this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xd7')]]){_0x12b254=_[_0x7bf2('0x80')](this[_0x7bf2('0x11')][_0x382a01[_0x7bf2('0xd7')]]);_0x12b254[_0x7bf2('0x9c')]=_0x382a01['secondtransfererexten'];_0x12b254[_0x7bf2('0x9e')]=_0x382a01[_0x7bf2('0xd7')];_0x12b254[_0x7bf2('0x55')]=_0x7bf2('0x56');_0x12b254[_0x7bf2('0x93')]=!![];_0x12b254['transfertype']=_0x7bf2('0xd8');_0x12b254[_0x7bf2('0x3b')]=!![];_0x12b254['transferid']=_0x382a01[_0x7bf2('0xda')];}}}catch(_0x5451c4){logger[_0x7bf2('0x43')]('[%s][voiceQueueReport][attendedtransfer]',_0x382a01[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x5451c4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0xdd')]=function(_0x26a68a){try{if(this[_0x7bf2('0x5e')](_0x26a68a)){logger[_0x7bf2('0x4e')]('[%s][voiceQueueReport][blindtransfer]',_0x26a68a['uniqueid'],util[_0x7bf2('0x45')](_0x26a68a,{'showHidden':![],'depth':null}));if(this[_0x7bf2('0x11')][_0x26a68a['transfereeuniqueid']]){var _0x1633f1=_[_0x7bf2('0x80')](this['queueReports'][_0x26a68a[_0x7bf2('0xd5')]]);_0x1633f1[_0x7bf2('0x55')]='BLINDTRANSFER';_0x1633f1['transfer']=!![];_0x1633f1['transfertype']='BLIND';_0x1633f1['transferexten']=_0x26a68a[_0x7bf2('0xde')];_0x1633f1[_0x7bf2('0x9e')]=_0x26a68a[_0x7bf2('0xd5')];logger['info'](_0x7bf2('0xdf'),_0x26a68a[_0x7bf2('0x50')],_0x1633f1['queue'],_0x1633f1[_0x7bf2('0x5a')],_0x1633f1['transferexten'],_0x1633f1[_0x7bf2('0x9e')]);this[_0x7bf2('0x28')]({'event':_0x7bf2('0xe0'),'uniqueid':_0x26a68a[_0x7bf2('0xd5')],'context':_0x26a68a['context'],'channel':_0x26a68a[_0x7bf2('0xe1')]});}}}catch(_0x1a5b37){logger[_0x7bf2('0x43')](_0x7bf2('0xe2'),_0x26a68a[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x1a5b37,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0xe3')]=function(_0x33fbfd){try{if(this[_0x7bf2('0x5e')](_0x33fbfd)){logger[_0x7bf2('0x4e')](_0x7bf2('0xe4'),_0x33fbfd['uniqueid'],util[_0x7bf2('0x45')](_0x33fbfd,{'showHidden':![],'depth':null}));if(this[_0x7bf2('0x11')][_0x33fbfd[_0x7bf2('0x50')]]){var _0x4732e8=_[_0x7bf2('0x80')](this[_0x7bf2('0x11')][_0x33fbfd[_0x7bf2('0x50')]]);if(!_[_0x7bf2('0x3c')](_0x4732e8[_0x7bf2('0xa9')])){_0x4732e8[_0x7bf2('0xe5')]=moment()[_0x7bf2('0x51')](_0x7bf2('0x77'));logger[_0x7bf2('0x7b')](_0x7bf2('0xe6'),_0x33fbfd[_0x7bf2('0x50')],_0x4732e8[_0x7bf2('0xe5')]);}}}}catch(_0x256d8e){logger[_0x7bf2('0x43')](_0x7bf2('0xe4'),_0x33fbfd['uniqueid'],util[_0x7bf2('0x45')](_0x256d8e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0xe7')]=function(_0x409bd4){try{if(this[_0x7bf2('0x5e')](_0x409bd4)){logger[_0x7bf2('0x4e')]('[%s][voiceQueueReport][musiconholdstop]',_0x409bd4[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x409bd4,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x409bd4[_0x7bf2('0x50')]]){var _0x590506=_['last'](this['queueReports'][_0x409bd4[_0x7bf2('0x50')]]);if(!_[_0x7bf2('0x3c')](_0x590506[_0x7bf2('0xe5')])){_0x590506[_0x7bf2('0xe8')]+=moment()[_0x7bf2('0xc6')](0x0)[_0x7bf2('0xc4')](_0x590506['mohstarttime'],_0x7bf2('0x99'));logger[_0x7bf2('0x7b')](_0x7bf2('0xe9'),_0x409bd4[_0x7bf2('0x50')],_0x590506['mohtime']);delete _0x590506['mohstarttime'];}}}}catch(_0x346ecf){logger[_0x7bf2('0x43')](_0x7bf2('0xea'),_0x409bd4[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x346ecf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7bf2('0xc')][_0x7bf2('0xeb')]=function(_0x4d3e71){try{if(this[_0x7bf2('0x5e')](_0x4d3e71)){logger[_0x7bf2('0x4e')](_0x7bf2('0xec'),_0x4d3e71[_0x7bf2('0x50')],util['inspect'](_0x4d3e71,{'showHidden':![],'depth':null}));if(_0x4d3e71[_0x7bf2('0xed')][_0x7bf2('0xee')]()==='set'){_0x4d3e71[_0x7bf2('0xef')]=_0x4d3e71['appdata']&&_0x4d3e71[_0x7bf2('0xf0')]['startsWith']('CDR(routeAlias)')?_0x4d3e71[_0x7bf2('0xf0')]:(_0x4d3e71['appdata']||_0x4d3e71['applicationdata'])[_0x7bf2('0xee')]();if(_[_0x7bf2('0x95')](_0x4d3e71[_0x7bf2('0xef')][_0x7bf2('0xee')](),_0x7bf2('0xf1'))){logger[_0x7bf2('0x7b')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x4d3e71[_0x7bf2('0x50')],_0x4d3e71[_0x7bf2('0xed')],_0x4d3e71[_0x7bf2('0xef')]);if(_['isUndefined'](this[_0x7bf2('0x12')][_0x4d3e71[_0x7bf2('0x50')]]))this[_0x7bf2('0x12')][_0x4d3e71[_0x7bf2('0x50')]]={};var _0x4d9dbb=_0x4d3e71[_0x7bf2('0xef')][_0x7bf2('0xf2')]('=');var _0x144a72=_0x4d9dbb[0x0][_0x7bf2('0xee')]()[_0x7bf2('0xf3')](/cdr\((.*)\)/);if(_0x144a72)this[_0x7bf2('0x12')][_0x4d3e71[_0x7bf2('0x50')]][_0x144a72[0x1]]=_0x4d9dbb[0x1];}}}}catch(_0x3d7bde){logger['error'](_0x7bf2('0xf4'),_0x4d3e71[_0x7bf2('0x50')],util[_0x7bf2('0x45')](_0x3d7bde,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
+var _0x8417=['syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','appdata','applicationdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','match','[%s][voiceQueueReport][newexten]','lodash','moment','util','../../../config/logger','../ami','../model/queueReport','redis','defaults','localhost','prototype','enqueue','sequence','realtime','agents','campaigns','summary','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','syncAgentComplete','syncAgentConnect','syncVarSet','hangup','fullybooted','syncFullyBooted','musiconholdstart','musiconholdstop','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','unlockRR','queuecallerexit','queuecallercomplete','clearZombieChannels','channels','switch','isNil','Action','status','catch','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','voiceQueues','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','[%s][voiceQueueReport][','voice:queue:%s','queue','voice_queue_channel:save','voice_queue_presence:save','queuecallerexitreason','ATTENDEDTRANSFER','format','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','inbound','debug','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isNotNull','isUndefined','loopQueueShow','queues','[voiceQueueReport][queues]','isRunning','then','actionid','queuestatus','[voiceQueueReport][queuesummary]','createQueueSummaryReport','summaryEvent','createReport','handleInboundQueueSummaryReport','compareToInboundQueue','assign','type','outbound','custom:queuesummary','statusRequests','syncQueueSummaryComplete','completeEvent','push','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','uniqueid','queuecallerjoinAt','position','count','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','keys','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerjoin]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','assigned','lastAssignedTo','membername','queuecallerexitAt','reason','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','add','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[%s][voiceQueueReport][varset]','value','variable','CONTINUE','TIMEOUT','timeout','custom:timeout','queuecallerleaveAt','varset','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqosjitterbridged','rtpaudioqosloss','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','handleHangup','sumHoldTime','diff','seconds','length','total','sumBillable','lastevent','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','sumDuration','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','deleteChannelAfterTimeout','[%s][voiceQueueReport][hangup]','cause','transferid','cause-txt','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','syncHangup','BlindTransfer','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0x8417,0xfa));var _0x7841=function(_0x4cfd4e,_0x54a832){_0x4cfd4e=_0x4cfd4e-0x0;var _0x47df9c=_0x8417[_0x4cfd4e];return _0x47df9c;};'use strict';var _=require(_0x7841('0x0'));var moment=require(_0x7841('0x1'));var util=require(_0x7841('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x7841('0x3'))('ami');var ami=require(_0x7841('0x4'));var QueueReport=require(_0x7841('0x5'));var VoiceQueueSummary=require('../model/voiceQueueSummary');config[_0x7841('0x6')]=_[_0x7841('0x7')](config['redis'],{'host':_0x7841('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7841('0x6')]));var Sequence=function(){};Sequence[_0x7841('0x9')][_0x7841('0xa')]=function(_0x443732){this['tail']=this['tail']?this['tail']['finally'](_0x443732):_0x443732();};function VoiceQueueReport(_0x35ae77){this[_0x7841('0xb')]=new Sequence();this['queueReports']={};this[_0x7841('0xc')]=_0x35ae77;this[_0x7841('0xd')]=_0x35ae77[_0x7841('0xd')];this['channels']=_0x35ae77['queueChannels'];this['voiceQueues']=_0x35ae77['voiceQueues'];this[_0x7841('0xe')]=_0x35ae77['campaigns'];this[_0x7841('0xf')]=initializeSummary();this[_0x7841('0x10')]={};ami['on'](_0x7841('0x11'),this[_0x7841('0x12')][_0x7841('0x13')](this));ami['on'](_0x7841('0x14'),this['syncQueueSummaryComplete'][_0x7841('0x13')](this));ami['on'](_0x7841('0x15'),this[_0x7841('0x16')][_0x7841('0x13')](this));ami['on'](_0x7841('0x17'),this[_0x7841('0x18')][_0x7841('0x13')](this));ami['on'](_0x7841('0x19'),this[_0x7841('0x1a')][_0x7841('0x13')](this));ami['on']('queuecallerabandon',this[_0x7841('0x1b')][_0x7841('0x13')](this));ami['on'](_0x7841('0x1c'),this['syncQueueCallerLeave'][_0x7841('0x13')](this));ami['on']('agentcomplete',this[_0x7841('0x1d')][_0x7841('0x13')](this));ami['on']('agentconnect',this[_0x7841('0x1e')]['bind'](this));ami['on']('varset',this[_0x7841('0x1f')][_0x7841('0x13')](this));ami['on'](_0x7841('0x20'),this['syncHangup']['bind'](this));ami['on'](_0x7841('0x21'),this[_0x7841('0x22')][_0x7841('0x13')](this));ami['on'](_0x7841('0x23'),this['syncMusicOnHoldStart'][_0x7841('0x13')](this));ami['on'](_0x7841('0x24'),this['syncMusicOnHoldStop'][_0x7841('0x13')](this));ami['on']('attendedtransfer',this[_0x7841('0x25')]['bind'](this));ami['on']('blindtransfer',this[_0x7841('0x26')]['bind'](this));this[_0x7841('0x27')]();this['loopQueueShow']();}function clearChannels(_0x16d236){if(!_[_0x7841('0x28')](_0x16d236)){for(var _0x40a4f9 in _0x16d236){if(_0x16d236['hasOwnProperty'](_0x40a4f9)){delete _0x16d236[_0x40a4f9];}}}}function clearCampaigns(_0x461caa){if(!_[_0x7841('0x28')](_0x461caa)){for(var _0x4f4b33 in _0x461caa){if(_0x461caa[_0x7841('0x29')](_0x4f4b33)){_0x461caa[_0x4f4b33][_0x7841('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x1db3df){if(!_[_0x7841('0x28')](_0x1db3df)){for(var _0x4bc7d5 in _0x1db3df){if(_0x1db3df[_0x7841('0x29')](_0x4bc7d5)){_0x1db3df[_0x4bc7d5]['originated']=0x0;_0x1db3df[_0x4bc7d5]['talking']=0x0;_0x1db3df[_0x4bc7d5][_0x7841('0x2b')]=0x0;_0x1db3df[_0x4bc7d5][_0x7841('0x2c')]=0x0;_0x1db3df[_0x4bc7d5][_0x7841('0x2d')]=!![];}}}}function clearAgentBooked(_0x5f08cd){if(!_['isEmpty'](_0x5f08cd)){for(var _0x55c08a in _0x5f08cd){if(_0x5f08cd[_0x7841('0x29')](_0x55c08a)){_0x5f08cd[_0x55c08a][_0x7841('0x2e')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x4bef68){return _0x4bef68[_0x7841('0x2f')]||_0x4bef68['queuecallerabandon']||_0x4bef68[_0x7841('0x30')];}VoiceQueueReport[_0x7841('0x9')][_0x7841('0x31')]=function(){var _0x29f9e5=this;for(var _0x301ac6 in this[_0x7841('0x32')]){if(this[_0x7841('0x32')]['hasOwnProperty'](_0x301ac6)&&!this[_0x7841('0x32')][_0x301ac6][_0x7841('0x33')]){this['sequence'][_0x7841('0xa')](function(){if(!_[_0x7841('0x34')](_0x29f9e5[_0x7841('0x32')][_0x301ac6])){return ami[_0x7841('0x35')]({'action':_0x7841('0x36'),'channel':_0x29f9e5[_0x7841('0x32')][_0x301ac6]['channel']})[_0x7841('0x37')](function(_0x42d3dd){if(_0x42d3dd['message']===_0x7841('0x38')){setTimeout(function(){if(_0x29f9e5[_0x7841('0x32')][_0x301ac6]){delete _0x29f9e5[_0x7841('0x32')][_0x301ac6];logger[_0x7841('0x39')](_0x7841('0x3a'),_0x301ac6,util[_0x7841('0x3b')](_0x42d3dd,{'showHidden':![],'depth':null}));}if(_0x29f9e5[_0x7841('0x3c')][_0x301ac6]){delete _0x29f9e5[_0x7841('0x3c')][_0x301ac6];logger[_0x7841('0x39')](_0x7841('0x3d'),_0x301ac6,util[_0x7841('0x3b')](_0x42d3dd,{'showHidden':![],'depth':null}));}if(_0x29f9e5[_0x7841('0x10')][_0x301ac6]){delete _0x29f9e5['variables'][_0x301ac6];logger['error'](_0x7841('0x3e'),_0x301ac6,util[_0x7841('0x3b')](_0x42d3dd,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0x7841('0x22')]=function(){logger[_0x7841('0x39')](_0x7841('0x3f'));clearChannels(this[_0x7841('0x32')]);this['clearQueueReport'](this['queueReports']);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x7841('0x40')]);clearCampaigns(this[_0x7841('0xe')]);this[_0x7841('0xf')]=initializeSummary();};VoiceQueueReport[_0x7841('0x9')][_0x7841('0x41')]=function(_0x5cf093){var _0x409abd=this;if(!_['isEmpty'](_0x5cf093)){for(var _0x399af3 in _0x5cf093){if(_0x5cf093[_0x7841('0x29')](_0x399af3)){_0x409abd[_0x7841('0x42')](_0x5cf093[_0x399af3],_0x7841('0x43'));delete _0x5cf093[_0x399af3];}}}};VoiceQueueReport['prototype'][_0x7841('0x44')]=function(_0x160f34,_0x6a8ee7,_0x16f0bb){io['to'](_0x160f34)[_0x7841('0x44')](_0x6a8ee7,_0x16f0bb);};VoiceQueueReport[_0x7841('0x9')]['emitVoiceQueueChannelSave']=function(_0xc40260,_0x106bdf){logger['debug'](_0x7841('0x45')+_0x106bdf+']\x20sending\x20voice_queue_channel:save\x20event:',_0xc40260['uniqueid'],util[_0x7841('0x3b')](_0xc40260,{'showHidden':![],'depth':null}));this[_0x7841('0x44')](util['format'](_0x7841('0x46'),_0xc40260[_0x7841('0x47')]),_0x7841('0x48'),_0xc40260);io[_0x7841('0x44')](_0x7841('0x49'),_0xc40260);};VoiceQueueReport['prototype'][_0x7841('0x42')]=function(_0x519046,_0x1d53d6){logger['debug'](_0x7841('0x45')+_0x1d53d6+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x519046['uniqueid'],util[_0x7841('0x3b')](_0x519046,{'showHidden':![],'depth':null}));if(_0x519046[_0x7841('0x4a')]===_0x7841('0x4b')){return;}this['emit'](util[_0x7841('0x4c')](_0x7841('0x46'),_0x519046['queue']),_0x7841('0x4d'),_0x519046);io[_0x7841('0x44')](_0x7841('0x4e'),_0x519046);};VoiceQueueReport[_0x7841('0x9')][_0x7841('0x4f')]=function(_0x3c2712){if(_0x3c2712['type']===_0x7841('0x50')){logger[_0x7841('0x51')](_0x7841('0x52'),util[_0x7841('0x3b')](_0x3c2712,{'showHidden':![],'depth':null}));this[_0x7841('0x44')](util['format'](_0x7841('0x46'),_0x3c2712[_0x7841('0x53')]),_0x7841('0x54'),_0x3c2712);}};VoiceQueueReport[_0x7841('0x9')][_0x7841('0x55')]=function(_0x442404){return _0x442404!==null&&!_[_0x7841('0x56')](_0x442404);};VoiceQueueReport[_0x7841('0x9')][_0x7841('0x57')]=function(){var _0x4a6e12=this;setInterval(function(){_0x4a6e12['clearZombieChannels']();ami['Action']({'action':_0x7841('0x58')})['catch'](function(_0x3d202c){logger['error'](_0x7841('0x59'),util['inspect'](_0x3d202c,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x7841('0x9')][_0x7841('0x27')]=function(){var _0x4e56cb=this;setInterval(function(){if(!_0x4e56cb[_0x7841('0xf')][_0x7841('0x5a')]){return ami[_0x7841('0x35')]({'action':_0x7841('0x11')})[_0x7841('0x5b')](function(_0x4c2d0e){_0x4e56cb['summary']['id']=_0x4c2d0e[_0x7841('0x5c')];_0x4e56cb[_0x7841('0xf')][_0x7841('0x5a')]=!![];_0x4e56cb[_0x7841('0xf')][_0x7841('0x5d')][_0x4c2d0e[_0x7841('0x5c')]]={};})[_0x7841('0x37')](function(_0xb61de3){logger[_0x7841('0x39')](_0x7841('0x5e'),util[_0x7841('0x3b')](_0xb61de3,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x7841('0x9')][_0x7841('0x5f')]=function(_0x265f01,_0x59ea59){var _0x2c25ad;if(this['summary']&&this[_0x7841('0xf')][_0x7841('0x58')]&&this['summary'][_0x7841('0x58')][_0x265f01[_0x7841('0x53')]]){_0x2c25ad=this['summary']['queues'][_0x265f01['name']][_0x7841('0x60')];}var _0x58fe38=new VoiceQueueSummary(_0x265f01);return _0x58fe38[_0x7841('0x61')](_0x59ea59[_0x7841('0xd')],this[_0x7841('0xd')],_0x2c25ad,this['realtime'][_0x7841('0x32')]);};VoiceQueueReport[_0x7841('0x9')][_0x7841('0x62')]=function(_0x397c7e,_0x5237ce){var _0x24e27b=this[_0x7841('0x5f')](_0x397c7e,_0x5237ce);var _0x59f9d6=![];_0x59f9d6=_0x24e27b[_0x7841('0x63')](_0x397c7e);if(_0x59f9d6){Object[_0x7841('0x64')](_0x397c7e,_0x24e27b);this['realtime']['voiceQueues'][_0x397c7e[_0x7841('0x53')]]=_0x397c7e;this[_0x7841('0x4f')](_0x24e27b);}};VoiceQueueReport[_0x7841('0x9')][_0x7841('0x18')]=function(_0x953aef){var _0x48863=null;var _0x36870b=this['summary']['id'];if(this[_0x7841('0xf')][_0x7841('0x5d')][_0x36870b]){_0x48863=this[_0x7841('0xf')][_0x7841('0x5d')][_0x36870b][_0x953aef['actionid']];}if(!_0x48863){this['summary']=initializeSummary();return;}var _0x52382e=this['voiceQueues'][_0x48863['queue']];if(_0x52382e[_0x7841('0x65')]===_0x7841('0x50')){this[_0x7841('0x62')](_0x52382e,_0x48863);}else if(_0x52382e[_0x7841('0x65')]===_0x7841('0x66')){var _0x120a73=this['createQueueSummaryReport'](_0x52382e,_0x48863);ami[_0x7841('0x44')](_0x7841('0x67'),_0x120a73);}this[_0x7841('0xf')]['statusRequests']-=0x1;var _0xc0940b=this[_0x7841('0xf')][_0x7841('0x68')]>0x0?!![]:![];if(!_0xc0940b){return this[_0x7841('0x69')](this[_0x7841('0xf')][_0x7841('0x6a')]);}};VoiceQueueReport['prototype'][_0x7841('0x16')]=function(_0x5e0055){var _0x505f75=this[_0x7841('0xf')]['id'];if(this[_0x7841('0xf')][_0x7841('0x5d')][_0x505f75]&&this[_0x7841('0xf')]['queuestatus'][_0x505f75][_0x5e0055[_0x7841('0x5c')]]){this[_0x7841('0xf')][_0x7841('0x5d')][_0x505f75][_0x5e0055['actionid']][_0x7841('0xd')][_0x7841('0x6b')](_0x5e0055);}};VoiceQueueReport['prototype'][_0x7841('0x12')]=function(_0x45af0c){var _0x456fa5=this;try{if(this['isNotNull'](_0x45af0c)&&this[_0x7841('0x55')](_0x45af0c[_0x7841('0x47')])){logger[_0x7841('0x51')](_0x7841('0x6c'),util[_0x7841('0x3b')](_0x45af0c,{'showHidden':![],'depth':null}));var _0x4b16a6=this[_0x7841('0x40')][_0x45af0c['queue']];if(_0x4b16a6){logger[_0x7841('0x51')](_0x7841('0x6d'),_0x4b16a6[_0x7841('0x53')]);this['summary'][_0x7841('0x58')][_0x4b16a6[_0x7841('0x53')]]={'summaryEvent':_0x45af0c};this['summary'][_0x7841('0x68')]+=0x1;return ami[_0x7841('0x35')]({'action':_0x7841('0x5d'),'queue':_0x4b16a6['name']})[_0x7841('0x5b')](function(_0x5e6b9b){if(!_0x456fa5['summary']['queuestatus'][_0x45af0c['actionid']]){_0x456fa5[_0x7841('0xf')][_0x7841('0x5d')][_0x45af0c[_0x7841('0x5c')]]={};}_0x456fa5[_0x7841('0xf')][_0x7841('0x5d')][_0x45af0c[_0x7841('0x5c')]][_0x5e6b9b[_0x7841('0x5c')]]={'queue':_0x4b16a6[_0x7841('0x53')],'agents':[]};})['catch'](function(_0x9b4620){throw _0x9b4620;});}}}catch(_0x22a787){logger[_0x7841('0x39')](_0x7841('0x5e'),util['inspect'](_0x22a787,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7841('0x9')][_0x7841('0x69')]=function(_0x165d96){if(this[_0x7841('0xf')][_0x7841('0x68')]>0x0){this[_0x7841('0xf')][_0x7841('0x6a')]=_0x165d96;return;}logger[_0x7841('0x51')](_0x7841('0x6e'),util[_0x7841('0x3b')](_0x165d96,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami[_0x7841('0x44')](_0x7841('0x6f'),{});};VoiceQueueReport['prototype'][_0x7841('0x1a')]=function(_0x2e4a2e){try{if(this[_0x7841('0x55')](_0x2e4a2e)){logger[_0x7841('0x51')]('[%s][voiceQueueReport][queuecallerjoin]',_0x2e4a2e[_0x7841('0x70')],util[_0x7841('0x3b')](_0x2e4a2e,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x7841('0x3c')][_0x2e4a2e['uniqueid']])){this[_0x7841('0x3c')][_0x2e4a2e[_0x7841('0x70')]]=[];}if(_[_0x7841('0x56')](this[_0x7841('0x32')][_0x2e4a2e[_0x7841('0x70')]])){this[_0x7841('0x32')][_0x2e4a2e['uniqueid']]={};}var _0x4109c=new QueueReport();_0x4109c[_0x7841('0x47')]=_0x2e4a2e['queue'];_0x4109c[_0x7841('0x65')]=this['voiceQueues'][_0x4109c[_0x7841('0x47')]]&&this[_0x7841('0x40')][_0x4109c[_0x7841('0x47')]][_0x7841('0x65')]?this[_0x7841('0x40')][_0x4109c[_0x7841('0x47')]][_0x7841('0x65')]||_0x7841('0x50'):_0x7841('0x50');_0x4109c[_0x7841('0x71')]=moment()[_0x7841('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4109c[_0x7841('0x72')]=_0x2e4a2e[_0x7841('0x72')];_0x4109c[_0x7841('0x73')]=_0x2e4a2e['count'];_0x4109c[_0x7841('0x70')]=_0x2e4a2e[_0x7841('0x70')];logger[_0x7841('0x74')](_0x7841('0x75'),_0x4109c[_0x7841('0x47')],_0x4109c['type']);Object[_0x7841('0x64')](_0x4109c,_[_0x7841('0x76')](_0x2e4a2e,_[_0x7841('0x77')](_0x4109c)));this[_0x7841('0x3c')][_0x2e4a2e['uniqueid']][_0x7841('0x6b')](_0x4109c);this[_0x7841('0x32')][_0x2e4a2e['uniqueid']]=_0x4109c;this[_0x7841('0x78')](_0x4109c,'queuecallerjoin');}}catch(_0x4a8a0d){logger[_0x7841('0x39')](_0x7841('0x79'),_0x2e4a2e['uniqueid'],util['inspect'](_0x4a8a0d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7841('0x9')]['syncQueueCallerAbandon']=function(_0x459748){try{if(this[_0x7841('0x55')](_0x459748)){logger[_0x7841('0x51')]('[%s][voiceQueueReport][queuecallerabandon]',_0x459748[_0x7841('0x70')],util[_0x7841('0x3b')](_0x459748,{'showHidden':![],'depth':null}));if(this[_0x7841('0x3c')][_0x459748[_0x7841('0x70')]]){var _0x384fac=_[_0x7841('0x7a')](this[_0x7841('0x3c')][_0x459748['uniqueid']]);_0x384fac[_0x7841('0x30')]=![];_0x384fac[_0x7841('0x7b')]=null;_0x384fac[_0x7841('0x7c')]=_0x459748[_0x7841('0x7c')];_0x384fac[_0x7841('0x7d')]=_0x459748[_0x7841('0x7d')];_0x384fac[_0x7841('0x7e')]=!![];_0x384fac[_0x7841('0x7f')]=moment()[_0x7841('0x4c')](_0x7841('0x80'));_0x384fac[_0x7841('0x4a')]='ABANDONED';_0x384fac['lastAssignedTo']=null;logger[_0x7841('0x74')](_0x7841('0x81'),_0x384fac[_0x7841('0x47')],_0x384fac[_0x7841('0x65')]);this[_0x7841('0x32')][_0x459748[_0x7841('0x70')]]=_0x384fac;this['emitVoiceQueueChannelRemove'](_0x384fac,_0x7841('0x7e'));}}}catch(_0x5a98a2){logger[_0x7841('0x39')](_0x7841('0x82'),_0x459748[_0x7841('0x70')],util[_0x7841('0x3b')](_0x5a98a2,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7841('0x83')]=function(_0x5d099c){try{if(this[_0x7841('0x55')](_0x5d099c)){logger[_0x7841('0x51')](_0x7841('0x84'),_0x5d099c['uniqueid'],util[_0x7841('0x3b')](_0x5d099c,{'showHidden':![],'depth':null}));if(this[_0x7841('0x3c')][_0x5d099c[_0x7841('0x70')]]){var _0x5dd80e=_[_0x7841('0x7a')](this[_0x7841('0x3c')][_0x5d099c['uniqueid']]);_0x5dd80e['queuecallerleaveAt']=moment()['format'](_0x7841('0x80'));_0x5dd80e[_0x7841('0x85')]=_0x5d099c[_0x7841('0x85')];_0x5dd80e[_0x7841('0x86')]=_0x5d099c[_0x7841('0x86')];logger[_0x7841('0x74')](_0x7841('0x87'),_0x5dd80e[_0x7841('0x47')],_0x5dd80e[_0x7841('0x65')],_0x5d099c[_0x7841('0x85')],_0x5d099c['connectedlinename']);this[_0x7841('0x32')][_0x5d099c['uniqueid']]=_0x5dd80e;this['emitVoiceQueueChannelSave'](_0x5dd80e,_0x7841('0x1c'));}}}catch(_0x2f2f22){logger['error'](_0x7841('0x84'),_0x5d099c[_0x7841('0x70')],util[_0x7841('0x3b')](_0x2f2f22,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7841('0x9')][_0x7841('0x1e')]=function(_0x3fec63){try{if(this[_0x7841('0x55')](_0x3fec63)){logger['debug'](_0x7841('0x88'),_0x3fec63[_0x7841('0x70')],util[_0x7841('0x3b')](_0x3fec63,{'showHidden':![],'depth':null}));if(this[_0x7841('0x3c')][_0x3fec63[_0x7841('0x70')]]){var _0x32cf0b=_[_0x7841('0x7a')](this['queueReports'][_0x3fec63['uniqueid']]);_0x32cf0b['queuecallercomplete']=!![];_0x32cf0b[_0x7841('0x4a')]=_0x7841('0x89');logger[_0x7841('0x74')](_0x7841('0x8a'),_0x32cf0b[_0x7841('0x47')],_0x32cf0b[_0x7841('0x65')]);}}}catch(_0x3bf570){logger[_0x7841('0x39')](_0x7841('0x88'),_0x3fec63[_0x7841('0x70')],util[_0x7841('0x3b')](_0x3bf570,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7841('0x9')]['syncAgentComplete']=function(_0x233d5b){try{if(this[_0x7841('0x55')](_0x233d5b)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x233d5b['uniqueid'],util['inspect'](_0x233d5b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x233d5b[_0x7841('0x70')]]){var _0x29ad8d=_['last'](this[_0x7841('0x3c')][_0x233d5b[_0x7841('0x70')]]);_0x29ad8d[_0x7841('0x7e')]=![];_0x29ad8d[_0x7841('0x7f')]=null;_0x29ad8d[_0x7841('0x8b')]=!![];_0x29ad8d[_0x7841('0x8c')]=_0x233d5b[_0x7841('0x8d')];_0x29ad8d['holdtime']=_0x233d5b['holdtime'];_0x29ad8d[_0x7841('0x30')]=!![];_0x29ad8d['queuecallerexit']=![];_0x29ad8d[_0x7841('0x8e')]=null;if(!_0x29ad8d['transfer']){if(_0x233d5b[_0x7841('0x8f')]==_0x7841('0x90')){_0x29ad8d['queuecallerexitreason']=_0x7841('0x91');logger[_0x7841('0x74')](_0x7841('0x92'),_0x29ad8d[_0x7841('0x47')],_0x29ad8d['type']);}else{if(_[_0x7841('0x93')](_0x233d5b[_0x7841('0x94')][_0x7841('0x95')](),_0x7841('0x96'))){if(this['queueReports'][_0x233d5b[_0x7841('0x97')]]){var _0x334769=_[_0x7841('0x7a')](this[_0x7841('0x3c')][_0x233d5b[_0x7841('0x97')]]);_0x334769[_0x7841('0x30')]=![];_0x334769[_0x7841('0x2f')]=!![];_0x334769[_0x7841('0x8e')]=moment(_0x29ad8d['queuecallerjoinAt'])[_0x7841('0x98')](_0x233d5b[_0x7841('0x7c')],'seconds')['format'](_0x7841('0x80'));_0x334769[_0x7841('0x4a')]=_0x7841('0x99');_0x334769[_0x7841('0x90')]=!![];_0x334769[_0x7841('0x9a')]=_0x7841('0x9b');_0x334769[_0x7841('0x9c')]=_0x233d5b[_0x7841('0x9d')];_0x334769[_0x7841('0x9e')]=_0x233d5b[_0x7841('0x70')];logger[_0x7841('0x74')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x334769[_0x7841('0x47')],_0x334769[_0x7841('0x65')]);var _0x61a40e=this[_0x7841('0x3c')][_0x233d5b['linkedid']];this[_0x7841('0x3c')][_0x233d5b[_0x7841('0x97')]]=this['queueReports'][_0x233d5b['uniqueid']];this[_0x7841('0x3c')][_0x233d5b['uniqueid']]=_0x61a40e;}}else{_0x29ad8d[_0x7841('0x4a')]=_0x7841('0x9f')+_0x233d5b['reason'][_0x7841('0xa0')]();logger[_0x7841('0x74')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x29ad8d[_0x7841('0x47')],_0x29ad8d[_0x7841('0x65')],_0x29ad8d[_0x7841('0x4a')]);}}}this[_0x7841('0x32')][_0x233d5b[_0x7841('0x70')]]=_0x29ad8d;}}}catch(_0x46d471){logger[_0x7841('0x39')]('[%s][voiceQueueReport][agentcomplete]',_0x233d5b['uniqueid'],util[_0x7841('0x3b')](_0x46d471,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7841('0x9')]['syncVarSet']=function(_0x579e86){try{if(this[_0x7841('0x55')](_0x579e86)){logger[_0x7841('0x51')](_0x7841('0xa1'),_0x579e86['uniqueid'],util[_0x7841('0x3b')](_0x579e86,{'showHidden':![],'depth':null}));this['addVariable'](_0x579e86[_0x7841('0x70')],_[_0x7841('0x77')](_0x579e86['variable'])[0x0],_0x579e86[_0x7841('0xa2')]);if(this['queueReports'][_0x579e86[_0x7841('0x70')]]){var _0x47ea03=_[_0x7841('0x7a')](this[_0x7841('0x3c')][_0x579e86[_0x7841('0x70')]]);if(_0x47ea03){if(this[_0x7841('0x55')](_0x579e86[_0x7841('0xa3')])&&this['isNotNull'](_0x579e86[_0x7841('0xa3')][_0x7841('0x5d')])){switch(_0x579e86[_0x7841('0xa2')]){case _0x7841('0xa4'):_0x47ea03['queuecallerexit']=![];_0x47ea03[_0x7841('0x8e')]=null;break;case _0x7841('0xa5'):_0x47ea03['lastevent']=_0x7841('0xa6');_0x47ea03[_0x7841('0x2f')]=!![];_0x47ea03['queuecallerexitAt']=moment()[_0x7841('0x4c')](_0x7841('0x80'));_0x47ea03['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x7841('0x51')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x579e86[_0x7841('0x70')],util[_0x7841('0x3b')](_0x47ea03,{'showHidden':![],'depth':null}));ami[_0x7841('0x44')](_0x7841('0xa7'),_0x47ea03);break;default:_0x47ea03['queuecallerexit']=!![];_0x47ea03[_0x7841('0x8e')]=moment()[_0x7841('0x4c')](_0x7841('0x80'));_0x47ea03[_0x7841('0xa8')]=moment()[_0x7841('0x4c')](_0x7841('0x80'));}_0x47ea03[_0x7841('0x7e')]=![];_0x47ea03[_0x7841('0x7f')]=null;_0x47ea03[_0x7841('0x4a')]=_0x579e86[_0x7841('0xa2')];this[_0x7841('0x32')][_0x579e86['uniqueid']]=_0x47ea03;this[_0x7841('0x42')](_0x47ea03,_0x7841('0xa9'));}else if(this[_0x7841('0x55')](_0x579e86[_0x7841('0xa3')])&&this['isNotNull'](_0x579e86[_0x7841('0xa3')][_0x7841('0xaa')])){if(!_0x47ea03[_0x7841('0x7e')]){_0x47ea03[_0x7841('0x2f')]=!![];_0x47ea03[_0x7841('0x8e')]=moment()[_0x7841('0x4c')](_0x7841('0x80'));_0x47ea03['queuecallerexitreason']=_0x7841('0xab');_0x47ea03[_0x7841('0xa8')]=moment()['format'](_0x7841('0x80'));this[_0x7841('0x32')][_0x579e86['uniqueid']]=_0x47ea03;}}logger['info'](_0x7841('0xac'),_0x579e86['uniqueid'],_0x47ea03[_0x7841('0x47')],_0x47ea03[_0x7841('0x65')],_[_0x7841('0x77')](_0x579e86[_0x7841('0xa3')])[0x0],_0x579e86[_0x7841('0xa2')]);_0x47ea03[_0x7841('0x10')]=this[_0x7841('0x10')][_0x579e86[_0x7841('0x70')]];}}}}catch(_0xb93afd){logger['error'](_0x7841('0xa1'),_0x579e86[_0x7841('0x70')],util[_0x7841('0x3b')](_0xb93afd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7841('0xad')]=function(_0x677ad3,_0x39f0ad,_0x208065){var _0x406727=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter',_0x7841('0xae'),_0x7841('0xaf'),'rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged',_0x7841('0xb0'),_0x7841('0xb1'),_0x7841('0xb2'),_0x7841('0xb3'),'membercalls',_0x7841('0xb4'),_0x7841('0xb5'),'memberlastcall',_0x7841('0x8d'),_0x7841('0xb6'),_0x7841('0xb7')];if(!_[_0x7841('0x34')](_0x39f0ad)&&!_[_0x7841('0xb8')](_0x406727,_0x39f0ad)){if(_[_0x7841('0x56')](this[_0x7841('0x10')][_0x677ad3])){this[_0x7841('0x10')][_0x677ad3]={};}this[_0x7841('0x10')][_0x677ad3][_0x39f0ad]=_0x208065;}};VoiceQueueReport[_0x7841('0x9')][_0x7841('0xb9')]=function(_0x29898f,_0x5f5c68,_0x5e0f51){try{var _0x5ed21e={};if(this[_0x7841('0x3c')][_0x29898f]){for(var _0x599e0e=0x0;_0x599e0e<this[_0x7841('0x3c')][_0x29898f]['length'];_0x599e0e+=0x1){_0x5ed21e=this[_0x7841('0x3c')][_0x29898f][_0x599e0e];var _0x2bc146=this[_0x7841('0x40')][_0x5ed21e[_0x7841('0x47')]];if(_0x2bc146){_0x2bc146[_0x7841('0xba')]+=moment(_0x5ed21e['queuecallerleaveAt'])[_0x7841('0xbb')](_0x5ed21e['queuecallerjoinAt'],_0x7841('0xbc'))||0x0;if(_0x5e0f51&&_0x5ed21e[_0x7841('0x4a')]===_0x7841('0x4b')){_0x5ed21e[_0x7841('0x4a')]=_0x7841('0x89');}if(_0x599e0e===this[_0x7841('0x3c')][_0x29898f][_0x7841('0xbd')]-0x1){_0x2bc146['sumDuration']+=moment()['milliseconds'](0x0)['diff'](_0x5ed21e['queuecallerjoinAt'],_0x7841('0xbc'));if(hasCallerLeftTheQueue(_0x5ed21e)&&_0x5ed21e[_0x7841('0x4a')]!=='ATTENDEDTRANSFER'){_0x2bc146[_0x7841('0xbe')]+=0x1;}if(_0x5ed21e[_0x7841('0x30')]){_0x2bc146['answered']+=0x1;_0x2bc146[_0x7841('0xbf')]+=moment()['milliseconds'](0x0)[_0x7841('0xbb')](_0x5ed21e[_0x7841('0xa8')],_0x7841('0xbc'));_0x5ed21e[_0x7841('0x7b')]=moment()[_0x7841('0x4c')](_0x7841('0x80'));_0x5ed21e['queuecallerexit']=![];_0x5ed21e['queuecallerexitAt']=null;}if(_0x5ed21e[_0x7841('0x2f')]&&_0x5ed21e[_0x7841('0x90')]!=!![]){_0x2bc146['unmanaged']+=0x1;_0x5ed21e[_0x7841('0xc0')]=_0x7841('0xc1');logger['debug'](_0x7841('0xc2'),_0x29898f,util[_0x7841('0x3b')](_0x5ed21e,{'showHidden':![],'depth':null}));ami[_0x7841('0x44')]('custom:queuecallerunmanaged',_0x5ed21e);}if(_0x5ed21e[_0x7841('0x7e')]){_0x2bc146[_0x7841('0xc3')]+=0x1;_0x5ed21e['lastevent']=_0x7841('0xc3');logger[_0x7841('0x51')](_0x7841('0xc4'),_0x29898f,util['inspect'](_0x5ed21e,{'showHidden':![],'depth':null}));ami[_0x7841('0x44')](_0x7841('0xc5'),_0x5ed21e);}}else{_0x2bc146[_0x7841('0xc6')]+=_0x2bc146[_0x7841('0xba')];}logger[_0x7841('0x74')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x29898f,_0x5ed21e[_0x7841('0x47')],_0x5ed21e[_0x7841('0x65')],_0x5f5c68);this[_0x7841('0x32')][_0x29898f]=_0x5ed21e;Object['assign'](this['voiceQueues'][_0x5ed21e[_0x7841('0x47')]],_0x2bc146);if(_0x5ed21e[_0x7841('0xa8')]){this['emitVoiceQueueChannelRemove'](_0x5ed21e,_0x7841('0x20'));}}}logger['debug'](_0x7841('0xc7'),_0x29898f,util['inspect'](this[_0x7841('0x3c')][_0x29898f],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x5ed21e)&&_0x5ed21e[_0x7841('0x4a')]!=='ATTENDEDTRANSFER'){ami[_0x7841('0x44')](_0x7841('0xc8'),this[_0x7841('0x3c')][_0x29898f]);if(this[_0x7841('0x3c')][_0x29898f]){delete this[_0x7841('0x3c')][_0x29898f];}if(this[_0x7841('0x32')][_0x29898f]){this[_0x7841('0xc9')](_0x29898f);}if(this[_0x7841('0x10')][_0x29898f]){delete this[_0x7841('0x10')][_0x29898f];}}}}catch(_0x496034){logger[_0x7841('0x39')]('[%s][voiceQueueReport][handleHangup]',_0x29898f,util[_0x7841('0x3b')](_0x496034,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7841('0x9')]['syncHangup']=function(_0x177ac){try{if(this[_0x7841('0x55')](_0x177ac)){logger['debug'](_0x7841('0xca'),_0x177ac[_0x7841('0x70')],util[_0x7841('0x3b')](_0x177ac,{'showHidden':![],'depth':null}));if(this[_0x7841('0x3c')][_0x177ac['uniqueid']]){return this[_0x7841('0xb9')](_0x177ac[_0x7841('0x70')],_0x177ac['cause-txt'],![]);}if(this['queueReports'][_0x177ac['linkedid']]){if(_0x177ac[_0x7841('0xcb')]==='21'){return;}return this[_0x7841('0xb9')](_0x177ac[_0x7841('0x97')],_0x177ac['cause-txt'],!![]);}var _0x570f3e=Object[_0x7841('0x77')](this[_0x7841('0x3c')]);for(var _0x327a12=0x0;_0x327a12<_0x570f3e['length'];_0x327a12++){var _0xca3dfc=_['last'](this['queueReports'][_0x570f3e[_0x327a12]]);if(_0xca3dfc&&_0xca3dfc[_0x7841('0xcc')]===_0x177ac[_0x7841('0x70')]){return this['handleHangup'](_0xca3dfc[_0x7841('0x70')],_0x177ac[_0x7841('0xcd')],!![]);}}if(!this[_0x7841('0x3c')][_0x177ac[_0x7841('0x70')]]){logger[_0x7841('0x51')](_0x7841('0xce'),_0x177ac[_0x7841('0x70')]);if(this[_0x7841('0x32')][_0x177ac['uniqueid']]){this['deleteChannelAfterTimeout'](_0x177ac[_0x7841('0x70')]);}if(this['variables'][_0x177ac['uniqueid']]){delete this[_0x7841('0x10')][_0x177ac['uniqueid']];}}}}catch(_0x246d03){logger[_0x7841('0x39')](_0x7841('0xca'),_0x177ac[_0x7841('0x70')],util[_0x7841('0x3b')](_0x246d03,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7841('0x9')][_0x7841('0x25')]=function(_0x105745){try{if(this[_0x7841('0x55')](_0x105745)){logger[_0x7841('0x51')](_0x7841('0xcf'),_0x105745['uniqueid'],util[_0x7841('0x3b')](_0x105745,{'showHidden':![],'depth':null}));var _0x1a8cba;var _0x1f1eb6;var _0x580198;if(this['queueReports'][_0x105745[_0x7841('0xd0')]]){_0x1a8cba=_[_0x7841('0x7a')](this[_0x7841('0x3c')][_0x105745[_0x7841('0xd0')]]);_0x1a8cba[_0x7841('0x9c')]=_0x105745[_0x7841('0xd1')];_0x1a8cba[_0x7841('0x9e')]=_0x105745[_0x7841('0xd2')];_0x1a8cba[_0x7841('0x4a')]=_0x7841('0x4b');_0x1a8cba[_0x7841('0x90')]=!![];_0x1a8cba[_0x7841('0x9a')]=_0x7841('0xd3');if(this[_0x7841('0x3c')][_0x105745[_0x7841('0xd2')]]){_0x580198=this[_0x7841('0x3c')][_0x105745[_0x7841('0xd2')]];this[_0x7841('0x3c')][_0x105745[_0x7841('0xd2')]]=this[_0x7841('0x3c')][_0x105745[_0x7841('0xd0')]];this['queueReports'][_0x105745[_0x7841('0xd0')]]=_0x580198;_0x1f1eb6=_['last'](this[_0x7841('0x3c')][_0x105745[_0x7841('0xd0')]]);_0x1f1eb6[_0x7841('0x33')]=!![];}logger[_0x7841('0x74')](_0x7841('0xd4'),_0x105745[_0x7841('0x70')],_0x1a8cba[_0x7841('0x47')],_0x1a8cba[_0x7841('0x65')],_0x1a8cba[_0x7841('0x9c')],_0x1a8cba[_0x7841('0x9e')]);}else if(this[_0x7841('0x3c')][_0x105745[_0x7841('0xd5')]]){_0x1a8cba=_[_0x7841('0x7a')](this[_0x7841('0x3c')][_0x105745[_0x7841('0xd5')]]);_0x1a8cba[_0x7841('0x9c')]=_0x105745[_0x7841('0xd6')];_0x1a8cba[_0x7841('0x9e')]=_0x105745[_0x7841('0xd7')];_0x1a8cba['queuecallerexitreason']=_0x7841('0x4b');_0x1a8cba[_0x7841('0x90')]=!![];_0x1a8cba[_0x7841('0x9a')]=_0x7841('0xd3');if(this['queueReports'][_0x105745[_0x7841('0xd7')]]){_0x580198=this[_0x7841('0x3c')][_0x105745[_0x7841('0xd7')]];this[_0x7841('0x3c')][_0x105745[_0x7841('0xd7')]]=this[_0x7841('0x3c')][_0x105745[_0x7841('0xd5')]];this[_0x7841('0x3c')][_0x105745[_0x7841('0xd5')]]=_0x580198;_0x1f1eb6=_[_0x7841('0x7a')](this['queueReports'][_0x105745[_0x7841('0xd5')]]);_0x1f1eb6[_0x7841('0x33')]=!![];}logger[_0x7841('0x74')](_0x7841('0xd4'),_0x105745[_0x7841('0x70')],_0x1a8cba[_0x7841('0x47')],_0x1a8cba[_0x7841('0x65')],_0x1a8cba['transferexten'],_0x1a8cba[_0x7841('0x9e')]);}else if(this[_0x7841('0x3c')][_0x105745[_0x7841('0xd7')]]){_0x1a8cba=_[_0x7841('0x7a')](this[_0x7841('0x3c')][_0x105745['origtransfereruniqueid']]);_0x1a8cba[_0x7841('0x9c')]=_0x105745[_0x7841('0xd6')];_0x1a8cba[_0x7841('0x9e')]=_0x105745[_0x7841('0xd7')];_0x1a8cba[_0x7841('0x4a')]='ATTENDEDTRANSFER';_0x1a8cba[_0x7841('0x90')]=!![];_0x1a8cba[_0x7841('0x9a')]='ATTENDED';_0x1a8cba[_0x7841('0x33')]=!![];_0x1a8cba[_0x7841('0xcc')]=_0x105745[_0x7841('0xd0')];}else if(this[_0x7841('0x3c')][_0x105745[_0x7841('0xd2')]]){_0x1a8cba=_[_0x7841('0x7a')](this[_0x7841('0x3c')][_0x105745[_0x7841('0xd2')]]);_0x1a8cba['transferexten']=_0x105745[_0x7841('0xd1')];_0x1a8cba[_0x7841('0x9e')]=_0x105745['secondtransfereruniqueid'];_0x1a8cba[_0x7841('0x4a')]='ATTENDEDTRANSFER';_0x1a8cba[_0x7841('0x90')]=!![];_0x1a8cba[_0x7841('0x9a')]=_0x7841('0xd3');_0x1a8cba[_0x7841('0x33')]=!![];_0x1a8cba[_0x7841('0xcc')]=_0x105745[_0x7841('0xd5')];}}}catch(_0x442bf6){logger[_0x7841('0x39')](_0x7841('0xcf'),_0x105745[_0x7841('0x70')],util['inspect'](_0x442bf6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7841('0x9')]['syncBlindTransfer']=function(_0x16bdc7){try{if(this[_0x7841('0x55')](_0x16bdc7)){logger[_0x7841('0x51')](_0x7841('0xd8'),_0x16bdc7[_0x7841('0x70')],util['inspect'](_0x16bdc7,{'showHidden':![],'depth':null}));if(this[_0x7841('0x3c')][_0x16bdc7['transfereeuniqueid']]){var _0x18529d=_[_0x7841('0x7a')](this[_0x7841('0x3c')][_0x16bdc7[_0x7841('0xd0')]]);_0x18529d['queuecallerexitreason']='BLINDTRANSFER';_0x18529d['transfer']=!![];_0x18529d['transfertype']=_0x7841('0xd9');_0x18529d[_0x7841('0x9c')]=_0x16bdc7['extension'];_0x18529d[_0x7841('0x9e')]=_0x16bdc7[_0x7841('0xd0')];logger['info'](_0x7841('0xda'),_0x16bdc7[_0x7841('0x70')],_0x18529d['queue'],_0x18529d[_0x7841('0x65')],_0x18529d[_0x7841('0x9c')],_0x18529d[_0x7841('0x9e')]);this[_0x7841('0xdb')]({'event':_0x7841('0xdc'),'uniqueid':_0x16bdc7['transfereeuniqueid'],'context':_0x16bdc7['context'],'channel':_0x16bdc7['transfererchannel']});}}}catch(_0x20a7a5){logger[_0x7841('0x39')](_0x7841('0xd8'),_0x16bdc7[_0x7841('0x70')],util[_0x7841('0x3b')](_0x20a7a5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7841('0x9')]['syncMusicOnHoldStart']=function(_0x1cd1f3){try{if(this[_0x7841('0x55')](_0x1cd1f3)){logger[_0x7841('0x51')]('[%s][voiceQueueReport][musiconholdstart]',_0x1cd1f3['uniqueid'],util[_0x7841('0x3b')](_0x1cd1f3,{'showHidden':![],'depth':null}));if(this[_0x7841('0x3c')][_0x1cd1f3['uniqueid']]){var _0x559312=_[_0x7841('0x7a')](this[_0x7841('0x3c')][_0x1cd1f3[_0x7841('0x70')]]);if(!_['isNil'](_0x559312[_0x7841('0xa8')])){_0x559312[_0x7841('0xdd')]=moment()['format'](_0x7841('0x80'));logger[_0x7841('0x74')](_0x7841('0xde'),_0x1cd1f3['uniqueid'],_0x559312['mohstarttime']);}}}}catch(_0x37a82f){logger[_0x7841('0x39')](_0x7841('0xdf'),_0x1cd1f3[_0x7841('0x70')],util['inspect'](_0x37a82f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7841('0x9')][_0x7841('0xe0')]=function(_0x46d2e2){try{if(this['isNotNull'](_0x46d2e2)){logger[_0x7841('0x51')](_0x7841('0xe1'),_0x46d2e2[_0x7841('0x70')],util[_0x7841('0x3b')](_0x46d2e2,{'showHidden':![],'depth':null}));if(this[_0x7841('0x3c')][_0x46d2e2[_0x7841('0x70')]]){var _0x4e1886=_[_0x7841('0x7a')](this[_0x7841('0x3c')][_0x46d2e2[_0x7841('0x70')]]);if(!_['isNil'](_0x4e1886[_0x7841('0xdd')])){_0x4e1886[_0x7841('0xe2')]+=moment()['milliseconds'](0x0)[_0x7841('0xbb')](_0x4e1886[_0x7841('0xdd')],'seconds');logger['info'](_0x7841('0xe3'),_0x46d2e2[_0x7841('0x70')],_0x4e1886['mohtime']);delete _0x4e1886[_0x7841('0xdd')];}}}}catch(_0x41688a){logger[_0x7841('0x39')](_0x7841('0xe1'),_0x46d2e2[_0x7841('0x70')],util[_0x7841('0x3b')](_0x41688a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7841('0x9')][_0x7841('0xe4')]=function(_0x319797){try{if(this[_0x7841('0x55')](_0x319797)){logger[_0x7841('0x51')](_0x7841('0xe5'),_0x319797[_0x7841('0x70')],util[_0x7841('0x3b')](_0x319797,{'showHidden':![],'depth':null}));if(_0x319797['application'][_0x7841('0x95')]()==='set'){_0x319797['applicationdata']=(_0x319797[_0x7841('0xe6')]||_0x319797[_0x7841('0xe7')])['toLowerCase']();if(_[_0x7841('0x93')](_0x319797['applicationdata'][_0x7841('0x95')](),_0x7841('0xe8'))){logger[_0x7841('0x74')](_0x7841('0xe9'),_0x319797['uniqueid'],_0x319797[_0x7841('0xea')],_0x319797[_0x7841('0xe7')]);if(_[_0x7841('0x56')](this[_0x7841('0x32')][_0x319797[_0x7841('0x70')]]))this[_0x7841('0x32')][_0x319797['uniqueid']]={};var _0x1100e5=_0x319797[_0x7841('0xe7')]['split']('=');var _0x21936b=_0x1100e5[0x0][_0x7841('0x95')]()[_0x7841('0xeb')](/cdr\((.*)\)/);if(_0x21936b)this[_0x7841('0x32')][_0x319797[_0x7841('0x70')]][_0x21936b[0x1]]=_0x1100e5[0x1];}}}}catch(_0x128014){logger['error'](_0x7841('0xec'),_0x319797[_0x7841('0x70')],util['inspect'](_0x128014,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7841('0x9')][_0x7841('0xc9')]=function(_0x1abe20,_0x33c64a=0x2710){if(this[_0x7841('0x32')][_0x1abe20]){setTimeout(()=>{delete this[_0x7841('0x32')][_0x1abe20];},_0x33c64a);}};module['exports']=VoiceQueueReport;
\ No newline at end of file