Built motion from commit 449495f6.|2.6.27
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index 15e1889..888b6ce 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa7cf=['loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','pTalking','waiting','queueStatusComplete','unlockRR','queuecallerexit','queuecallercomplete','prototype','clearZombieChannels','channels','switch','isNil','Action','status','channel','catch','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','queue','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove','[%s][voiceQueueReport][','queuecallerexitreason','voice_queue_channel:remove','emitInboundVoiceQueueSummary','type','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isNotNull','isUndefined','[voiceQueueReport][queues]','then','actionid','isRunning','queuestatus','[voiceQueueReport][queuesummary]','queues','summaryEvent','createReport','realtime','handleInboundQueueSummaryReport','createQueueSummaryReport','compareToInboundQueue','assign','outbound','custom:queuesummary','statusRequests','completeEvent','push','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','pick','keys','queuecallerjoin','syncQueueCallerAbandon','last','holdtime','originalposition','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinename','connectedlinenum','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','membername','queuecallerexitAt','transfer','COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','TIMEOUT','lastevent','timeout','custom:timeout','varset','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','handleHangup','length','sumHoldTime','diff','ATTENDEDTRANSFER','sumDuration','milliseconds','total','answered','sumBillable','queuecallercompleteAt','[%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:','custom:voiceQueueReport','[%s][voiceQueueReport][handleHangup]','syncHangup','cause','cause-txt','transferid','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%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','context','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','socket.io-emitter','enqueue','tail','finally','sequence','queueReports','agents','voiceQueues','campaigns','summary','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuemember','queuestatuscomplete','syncQueueStatusComplete','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','syncVarSet','hangup','fullybooted','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer'];(function(_0x41cf10,_0x4559eb){var _0x2d7556=function(_0x39ab14){while(--_0x39ab14){_0x41cf10['push'](_0x41cf10['shift']());}};_0x2d7556(++_0x4559eb);}(_0xa7cf,0xc9));var _0xfa7c=function(_0x4c05da,_0x414720){_0x4c05da=_0x4c05da-0x0;var _0x1614db=_0xa7cf[_0x4c05da];return _0x1614db;};'use strict';var _=require(_0xfa7c('0x0'));var moment=require('moment');var util=require(_0xfa7c('0x1'));var Redis=require(_0xfa7c('0x2'));var config=require(_0xfa7c('0x3'));var logger=require(_0xfa7c('0x4'))(_0xfa7c('0x5'));var ami=require(_0xfa7c('0x6'));var QueueReport=require(_0xfa7c('0x7'));var VoiceQueueSummary=require(_0xfa7c('0x8'));config[_0xfa7c('0x9')]=_[_0xfa7c('0xa')](config[_0xfa7c('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xfa7c('0xb'))(new Redis(config[_0xfa7c('0x9')]));var Sequence=function(){};Sequence['prototype'][_0xfa7c('0xc')]=function(_0x259e89){this['tail']=this[_0xfa7c('0xd')]?this[_0xfa7c('0xd')][_0xfa7c('0xe')](_0x259e89):_0x259e89();};function VoiceQueueReport(_0x315ad4){this[_0xfa7c('0xf')]=new Sequence();this[_0xfa7c('0x10')]={};this['realtime']=_0x315ad4;this['agents']=_0x315ad4[_0xfa7c('0x11')];this['channels']=_0x315ad4['queueChannels'];this[_0xfa7c('0x12')]=_0x315ad4['voiceQueues'];this['campaigns']=_0x315ad4[_0xfa7c('0x13')];this[_0xfa7c('0x14')]=initializeSummary();this[_0xfa7c('0x15')]={};ami['on'](_0xfa7c('0x16'),this[_0xfa7c('0x17')][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x19'),this[_0xfa7c('0x1a')]['bind'](this));ami['on'](_0xfa7c('0x1b'),this['syncQueueMember'][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x1c'),this[_0xfa7c('0x1d')][_0xfa7c('0x18')](this));ami['on']('queuecallerjoin',this[_0xfa7c('0x1e')][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x1f'),this['syncQueueCallerAbandon'][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x20'),this['syncQueueCallerLeave']['bind'](this));ami['on'](_0xfa7c('0x21'),this[_0xfa7c('0x22')][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x23'),this[_0xfa7c('0x24')]['bind'](this));ami['on']('varset',this[_0xfa7c('0x25')][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x26'),this['syncHangup'][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x27'),this['syncFullyBooted'][_0xfa7c('0x18')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x28'),this['syncMusicOnHoldStop'][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x29'),this[_0xfa7c('0x2a')][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x2b'),this[_0xfa7c('0x2c')][_0xfa7c('0x18')](this));this[_0xfa7c('0x2d')]();this[_0xfa7c('0x2e')]();}function clearChannels(_0x4c0488){if(!_[_0xfa7c('0x2f')](_0x4c0488)){for(var _0xc45427 in _0x4c0488){if(_0x4c0488[_0xfa7c('0x30')](_0xc45427)){delete _0x4c0488[_0xc45427];}}}}function clearCampaigns(_0x4d5de2){if(!_[_0xfa7c('0x2f')](_0x4d5de2)){for(var _0x4f71db in _0x4d5de2){if(_0x4d5de2['hasOwnProperty'](_0x4f71db)){_0x4d5de2[_0x4f71db]['originated']=0x0;}}}}function clearVoiceQueues(_0x3396a2){if(!_[_0xfa7c('0x2f')](_0x3396a2)){for(var _0x26efc9 in _0x3396a2){if(_0x3396a2[_0xfa7c('0x30')](_0x26efc9)){_0x3396a2[_0x26efc9]['originated']=0x0;_0x3396a2[_0x26efc9]['talking']=0x0;_0x3396a2[_0x26efc9][_0xfa7c('0x31')]=0x0;_0x3396a2[_0x26efc9][_0xfa7c('0x32')]=0x0;_0x3396a2[_0x26efc9][_0xfa7c('0x33')]=!![];}}}}function clearAgentBooked(_0x3f15a0){if(!_[_0xfa7c('0x2f')](_0x3f15a0)){for(var _0x36bbfe in _0x3f15a0){if(_0x3f15a0[_0xfa7c('0x30')](_0x36bbfe)){_0x3f15a0[_0x36bbfe][_0xfa7c('0x34')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0xd64902){return _0xd64902[_0xfa7c('0x35')]||_0xd64902[_0xfa7c('0x1f')]||_0xd64902[_0xfa7c('0x36')];}VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x38')]=function(){var _0x11ddf1=this;for(var _0x57f298 in this[_0xfa7c('0x39')]){if(this[_0xfa7c('0x39')][_0xfa7c('0x30')](_0x57f298)&&!this['channels'][_0x57f298][_0xfa7c('0x3a')]){this[_0xfa7c('0xf')][_0xfa7c('0xc')](function(){if(!_[_0xfa7c('0x3b')](_0x11ddf1['channels'][_0x57f298])){return ami[_0xfa7c('0x3c')]({'action':_0xfa7c('0x3d'),'channel':_0x11ddf1[_0xfa7c('0x39')][_0x57f298][_0xfa7c('0x3e')]})[_0xfa7c('0x3f')](function(_0x4de0bd){if(_0x4de0bd['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x11ddf1[_0xfa7c('0x39')][_0x57f298]){delete _0x11ddf1[_0xfa7c('0x39')][_0x57f298];logger[_0xfa7c('0x40')](_0xfa7c('0x41'),_0x57f298,util[_0xfa7c('0x42')](_0x4de0bd,{'showHidden':![],'depth':null}));}if(_0x11ddf1['queueReports'][_0x57f298]){delete _0x11ddf1[_0xfa7c('0x10')][_0x57f298];logger[_0xfa7c('0x40')](_0xfa7c('0x43'),_0x57f298,util[_0xfa7c('0x42')](_0x4de0bd,{'showHidden':![],'depth':null}));}if(_0x11ddf1[_0xfa7c('0x15')][_0x57f298]){delete _0x11ddf1[_0xfa7c('0x15')][_0x57f298];logger['error']('[%s][voiceQueueReport][checkVariables]',_0x57f298,util[_0xfa7c('0x42')](_0x4de0bd,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x44')]=function(){logger['error'](_0xfa7c('0x45'));clearChannels(this[_0xfa7c('0x39')]);this['clearQueueReport'](this[_0xfa7c('0x10')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0xfa7c('0x12')]);clearCampaigns(this[_0xfa7c('0x13')]);this[_0xfa7c('0x14')]=initializeSummary();};VoiceQueueReport['prototype'][_0xfa7c('0x46')]=function(_0x409649){var _0x40830b=this;if(!_['isEmpty'](_0x409649)){for(var _0x1334e0 in _0x409649){if(_0x409649[_0xfa7c('0x30')](_0x1334e0)){_0x40830b['emitVoiceQueueChannelRemove'](_0x409649[_0x1334e0],_0xfa7c('0x47'));delete _0x409649[_0x1334e0];}}}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x48')]=function(_0x34407d,_0x1a9722,_0x5516cc){io['to'](_0x34407d)[_0xfa7c('0x48')](_0x1a9722,_0x5516cc);};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x49')]=function(_0x3bfad3,_0x15dea0){logger[_0xfa7c('0x4a')]('[%s][voiceQueueReport]['+_0x15dea0+_0xfa7c('0x4b'),_0x3bfad3[_0xfa7c('0x4c')],util['inspect'](_0x3bfad3,{'showHidden':![],'depth':null}));this[_0xfa7c('0x48')](util[_0xfa7c('0x4d')](_0xfa7c('0x4e'),_0x3bfad3[_0xfa7c('0x4f')]),_0xfa7c('0x50'),_0x3bfad3);io['emit'](_0xfa7c('0x51'),_0x3bfad3);};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x52')]=function(_0x192e8c,_0x5a0417){logger[_0xfa7c('0x4a')](_0xfa7c('0x53')+_0x5a0417+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x192e8c[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x192e8c,{'showHidden':![],'depth':null}));if(_0x192e8c[_0xfa7c('0x54')]==='ATTENDEDTRANSFER'){return;}this[_0xfa7c('0x48')](util['format'](_0xfa7c('0x4e'),_0x192e8c[_0xfa7c('0x4f')]),_0xfa7c('0x55'),_0x192e8c);io[_0xfa7c('0x48')]('voice_queue_presence:remove',_0x192e8c);};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x56')]=function(_0x22ce00){if(_0x22ce00[_0xfa7c('0x57')]===_0xfa7c('0x58')){logger[_0xfa7c('0x4a')](_0xfa7c('0x59'),util['inspect'](_0x22ce00,{'showHidden':![],'depth':null}));this[_0xfa7c('0x48')](util[_0xfa7c('0x4d')]('voice:queue:%s',_0x22ce00[_0xfa7c('0x5a')]),_0xfa7c('0x5b'),_0x22ce00);}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x5c')]=function(_0x58ffb7){return _0x58ffb7!==null&&!_[_0xfa7c('0x5d')](_0x58ffb7);};VoiceQueueReport['prototype'][_0xfa7c('0x2e')]=function(){var _0x378aba=this;setInterval(function(){_0x378aba[_0xfa7c('0x38')]();ami[_0xfa7c('0x3c')]({'action':'queues'})['catch'](function(_0xe0956c){logger[_0xfa7c('0x40')](_0xfa7c('0x5e'),util[_0xfa7c('0x42')](_0xe0956c,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype']['loopQueueSummary']=function(){var _0x1414e1=this;setInterval(function(){if(!_0x1414e1[_0xfa7c('0x14')]['isRunning']){return ami['Action']({'action':_0xfa7c('0x16')})[_0xfa7c('0x5f')](function(_0x1d4cb5){_0x1414e1[_0xfa7c('0x14')]['id']=_0x1d4cb5[_0xfa7c('0x60')];_0x1414e1[_0xfa7c('0x14')][_0xfa7c('0x61')]=!![];_0x1414e1[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x1d4cb5[_0xfa7c('0x60')]]={};})[_0xfa7c('0x3f')](function(_0x5d9531){logger['error'](_0xfa7c('0x63'),util['inspect'](_0x5d9531,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xfa7c('0x37')]['createQueueSummaryReport']=function(_0x4e61bb,_0x126b2f){var _0x3d6e40;if(this[_0xfa7c('0x14')]&&this[_0xfa7c('0x14')][_0xfa7c('0x64')]&&this[_0xfa7c('0x14')][_0xfa7c('0x64')][_0x4e61bb[_0xfa7c('0x5a')]]){_0x3d6e40=this['summary'][_0xfa7c('0x64')][_0x4e61bb[_0xfa7c('0x5a')]][_0xfa7c('0x65')];}var _0x5a11d7=new VoiceQueueSummary(_0x4e61bb);return _0x5a11d7[_0xfa7c('0x66')](_0x126b2f[_0xfa7c('0x11')],this[_0xfa7c('0x11')],_0x3d6e40,this[_0xfa7c('0x67')][_0xfa7c('0x39')]);};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x68')]=function(_0x231c72,_0x5148f5){var _0x30265b=this[_0xfa7c('0x69')](_0x231c72,_0x5148f5);var _0x499f2c=![];_0x499f2c=_0x30265b[_0xfa7c('0x6a')](_0x231c72);if(_0x499f2c){Object[_0xfa7c('0x6b')](_0x231c72,_0x30265b);this[_0xfa7c('0x67')][_0xfa7c('0x12')][_0x231c72['name']]=_0x231c72;this['emitInboundVoiceQueueSummary'](_0x30265b);}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x1d')]=function(_0x387da3){var _0x947a51=null;var _0x5df609=this['summary']['id'];if(this[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x5df609]){_0x947a51=this['summary'][_0xfa7c('0x62')][_0x5df609][_0x387da3[_0xfa7c('0x60')]];}if(!_0x947a51){this[_0xfa7c('0x14')]=initializeSummary();return;}var _0x3d04e2=this[_0xfa7c('0x12')][_0x947a51[_0xfa7c('0x4f')]];if(_0x3d04e2[_0xfa7c('0x57')]===_0xfa7c('0x58')){this['handleInboundQueueSummaryReport'](_0x3d04e2,_0x947a51);}else if(_0x3d04e2[_0xfa7c('0x57')]===_0xfa7c('0x6c')){var _0xe4d256=this[_0xfa7c('0x69')](_0x3d04e2,_0x947a51);ami[_0xfa7c('0x48')](_0xfa7c('0x6d'),_0xe4d256);}this[_0xfa7c('0x14')][_0xfa7c('0x6e')]-=0x1;var _0x19795c=this[_0xfa7c('0x14')]['statusRequests']>0x0?!![]:![];if(!_0x19795c){return this[_0xfa7c('0x1a')](this[_0xfa7c('0x14')][_0xfa7c('0x6f')]);}};VoiceQueueReport[_0xfa7c('0x37')]['syncQueueMember']=function(_0x2390b4){var _0x88887=this[_0xfa7c('0x14')]['id'];if(this[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x88887]&&this[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x88887][_0x2390b4[_0xfa7c('0x60')]]){this[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x88887][_0x2390b4[_0xfa7c('0x60')]][_0xfa7c('0x11')][_0xfa7c('0x70')](_0x2390b4);}};VoiceQueueReport[_0xfa7c('0x37')]['syncQueueSummary']=function(_0x231591){var _0x40dac8=this;try{if(this[_0xfa7c('0x5c')](_0x231591)&&this[_0xfa7c('0x5c')](_0x231591[_0xfa7c('0x4f')])){logger[_0xfa7c('0x4a')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xfa7c('0x42')](_0x231591,{'showHidden':![],'depth':null}));var _0x16a14e=this[_0xfa7c('0x12')][_0x231591[_0xfa7c('0x4f')]];if(_0x16a14e){logger[_0xfa7c('0x4a')](_0xfa7c('0x71'),_0x16a14e['name']);this['summary'][_0xfa7c('0x64')][_0x16a14e[_0xfa7c('0x5a')]]={'summaryEvent':_0x231591};this[_0xfa7c('0x14')][_0xfa7c('0x6e')]+=0x1;return ami[_0xfa7c('0x3c')]({'action':_0xfa7c('0x62'),'queue':_0x16a14e[_0xfa7c('0x5a')]})[_0xfa7c('0x5f')](function(_0x327729){if(!_0x40dac8[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x231591['actionid']]){_0x40dac8[_0xfa7c('0x14')]['queuestatus'][_0x231591[_0xfa7c('0x60')]]={};}_0x40dac8[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x231591['actionid']][_0x327729['actionid']]={'queue':_0x16a14e[_0xfa7c('0x5a')],'agents':[]};})[_0xfa7c('0x3f')](function(_0xe6e478){throw _0xe6e478;});}}}catch(_0x57d71b){logger[_0xfa7c('0x40')](_0xfa7c('0x63'),util['inspect'](_0x57d71b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x1a')]=function(_0xff23c2){if(this[_0xfa7c('0x14')]['statusRequests']>0x0){this[_0xfa7c('0x14')]['completeEvent']=_0xff23c2;return;}logger[_0xfa7c('0x4a')](_0xfa7c('0x72'),util[_0xfa7c('0x42')](_0xff23c2,{'showHidden':![],'depth':null}));this[_0xfa7c('0x14')]=initializeSummary();ami['emit'](_0xfa7c('0x73'),{});};VoiceQueueReport[_0xfa7c('0x37')]['syncQueueCallerJoin']=function(_0xb167ce){try{if(this['isNotNull'](_0xb167ce)){logger['debug'](_0xfa7c('0x74'),_0xb167ce['uniqueid'],util[_0xfa7c('0x42')](_0xb167ce,{'showHidden':![],'depth':null}));if(_[_0xfa7c('0x5d')](this[_0xfa7c('0x10')][_0xb167ce[_0xfa7c('0x4c')]])){this[_0xfa7c('0x10')][_0xb167ce['uniqueid']]=[];}if(_[_0xfa7c('0x5d')](this[_0xfa7c('0x39')][_0xb167ce[_0xfa7c('0x4c')]])){this['channels'][_0xb167ce['uniqueid']]={};}var _0xc444a9=new QueueReport();_0xc444a9[_0xfa7c('0x4f')]=_0xb167ce[_0xfa7c('0x4f')];_0xc444a9[_0xfa7c('0x57')]=this[_0xfa7c('0x12')][_0xc444a9[_0xfa7c('0x4f')]]&&this[_0xfa7c('0x12')][_0xc444a9[_0xfa7c('0x4f')]][_0xfa7c('0x57')]?this[_0xfa7c('0x12')][_0xc444a9['queue']][_0xfa7c('0x57')]||_0xfa7c('0x58'):_0xfa7c('0x58');_0xc444a9[_0xfa7c('0x75')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0xc444a9[_0xfa7c('0x77')]=_0xb167ce[_0xfa7c('0x77')];_0xc444a9[_0xfa7c('0x78')]=_0xb167ce[_0xfa7c('0x78')];_0xc444a9[_0xfa7c('0x4c')]=_0xb167ce[_0xfa7c('0x4c')];_0xc444a9[_0xfa7c('0x79')]=this[_0xfa7c('0x39')][_0xb167ce[_0xfa7c('0x4c')]][_0xfa7c('0x79')];logger[_0xfa7c('0x7a')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0xc444a9[_0xfa7c('0x4f')],_0xc444a9[_0xfa7c('0x57')]);Object['assign'](_0xc444a9,_[_0xfa7c('0x7b')](_0xb167ce,_[_0xfa7c('0x7c')](_0xc444a9)));this[_0xfa7c('0x10')][_0xb167ce[_0xfa7c('0x4c')]]['push'](_0xc444a9);this[_0xfa7c('0x39')][_0xb167ce[_0xfa7c('0x4c')]]=_0xc444a9;this[_0xfa7c('0x49')](_0xc444a9,_0xfa7c('0x7d'));}}catch(_0x18a6ab){logger[_0xfa7c('0x40')](_0xfa7c('0x74'),_0xb167ce[_0xfa7c('0x4c')],util['inspect'](_0x18a6ab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x7e')]=function(_0x4d79d2){try{if(this[_0xfa7c('0x5c')](_0x4d79d2)){logger[_0xfa7c('0x4a')]('[%s][voiceQueueReport][queuecallerabandon]',_0x4d79d2['uniqueid'],util[_0xfa7c('0x42')](_0x4d79d2,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x4d79d2[_0xfa7c('0x4c')]]){var _0x11ec77=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0x4d79d2['uniqueid']]);_0x11ec77['queuecallercomplete']=![];_0x11ec77['queuecallercompleteAt']=null;_0x11ec77[_0xfa7c('0x80')]=_0x4d79d2[_0xfa7c('0x80')];_0x11ec77[_0xfa7c('0x81')]=_0x4d79d2[_0xfa7c('0x81')];_0x11ec77[_0xfa7c('0x1f')]=!![];_0x11ec77['queuecallerabandonAt']=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x11ec77['queuecallerexitreason']=_0xfa7c('0x82');_0x11ec77['lastAssignedTo']=null;logger[_0xfa7c('0x7a')](_0xfa7c('0x83'),_0x11ec77[_0xfa7c('0x4f')],_0x11ec77['type']);this['channels'][_0x4d79d2['uniqueid']]=_0x11ec77;this[_0xfa7c('0x52')](_0x11ec77,_0xfa7c('0x1f'));}}}catch(_0x35d2cd){logger[_0xfa7c('0x40')](_0xfa7c('0x84'),_0x4d79d2[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x35d2cd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x5c549d){try{if(this['isNotNull'](_0x5c549d)){logger[_0xfa7c('0x4a')](_0xfa7c('0x85'),_0x5c549d[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x5c549d,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x5c549d[_0xfa7c('0x4c')]]){var _0x411217=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0x5c549d['uniqueid']]);_0x411217[_0xfa7c('0x86')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x411217['connectedlinenum']=_0x5c549d['connectedlinenum'];_0x411217[_0xfa7c('0x87')]=_0x5c549d[_0xfa7c('0x87')];logger[_0xfa7c('0x7a')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x411217[_0xfa7c('0x4f')],_0x411217[_0xfa7c('0x57')],_0x5c549d[_0xfa7c('0x88')],_0x5c549d[_0xfa7c('0x87')]);this[_0xfa7c('0x39')][_0x5c549d[_0xfa7c('0x4c')]]=_0x411217;this[_0xfa7c('0x49')](_0x411217,_0xfa7c('0x20'));}}}catch(_0x1a061a){logger[_0xfa7c('0x40')](_0xfa7c('0x85'),_0x5c549d[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x1a061a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')]['syncAgentConnect']=function(_0x3d60ea){try{if(this[_0xfa7c('0x5c')](_0x3d60ea)){logger[_0xfa7c('0x4a')](_0xfa7c('0x89'),_0x3d60ea[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x3d60ea,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x3d60ea[_0xfa7c('0x4c')]]){var _0x3ea157=_['last'](this['queueReports'][_0x3d60ea[_0xfa7c('0x4c')]]);_0x3ea157[_0xfa7c('0x36')]=!![];_0x3ea157[_0xfa7c('0x54')]=_0xfa7c('0x8a');logger[_0xfa7c('0x7a')](_0xfa7c('0x8b'),_0x3ea157[_0xfa7c('0x4f')],_0x3ea157[_0xfa7c('0x57')]);}}}catch(_0x5168da){logger[_0xfa7c('0x40')](_0xfa7c('0x89'),_0x3d60ea[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x5168da,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x22')]=function(_0x44cf49){try{if(this[_0xfa7c('0x5c')](_0x44cf49)){logger[_0xfa7c('0x4a')](_0xfa7c('0x8c'),_0x44cf49[_0xfa7c('0x4c')],util['inspect'](_0x44cf49,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x44cf49[_0xfa7c('0x4c')]]){var _0x3a97e7=_['last'](this['queueReports'][_0x44cf49['uniqueid']]);_0x3a97e7['queuecallerabandon']=![];_0x3a97e7[_0xfa7c('0x8d')]=null;_0x3a97e7['assigned']=!![];_0x3a97e7['lastAssignedTo']=_0x44cf49[_0xfa7c('0x8e')];_0x3a97e7[_0xfa7c('0x80')]=_0x44cf49[_0xfa7c('0x80')];_0x3a97e7['queuecallercomplete']=!![];_0x3a97e7[_0xfa7c('0x35')]=![];_0x3a97e7[_0xfa7c('0x8f')]=null;if(!_0x3a97e7['transfer']){if(_0x44cf49['reason']==_0xfa7c('0x90')){_0x3a97e7[_0xfa7c('0x54')]=_0xfa7c('0x91');logger[_0xfa7c('0x7a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x3a97e7[_0xfa7c('0x4f')],_0x3a97e7[_0xfa7c('0x57')]);}else{if(_[_0xfa7c('0x92')](_0x44cf49[_0xfa7c('0x3e')][_0xfa7c('0x93')](),_0xfa7c('0x94'))){if(this[_0xfa7c('0x10')][_0x44cf49['linkedid']]){var _0x3f574d=_[_0xfa7c('0x7f')](this['queueReports'][_0x44cf49[_0xfa7c('0x95')]]);_0x3f574d[_0xfa7c('0x36')]=![];_0x3f574d[_0xfa7c('0x35')]=!![];_0x3f574d['queuecallerexitAt']=moment(_0x3a97e7[_0xfa7c('0x75')])[_0xfa7c('0x96')](_0x44cf49['holdtime'],_0xfa7c('0x97'))[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x3f574d[_0xfa7c('0x54')]=_0xfa7c('0x98');_0x3f574d[_0xfa7c('0x90')]=!![];_0x3f574d[_0xfa7c('0x99')]=_0xfa7c('0x9a');_0x3f574d[_0xfa7c('0x9b')]=_0x44cf49[_0xfa7c('0x9c')];_0x3f574d[_0xfa7c('0x9d')]=_0x44cf49[_0xfa7c('0x4c')];logger[_0xfa7c('0x7a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x3f574d[_0xfa7c('0x4f')],_0x3f574d['type']);var _0x58ea14=this['queueReports'][_0x44cf49[_0xfa7c('0x95')]];this['queueReports'][_0x44cf49[_0xfa7c('0x95')]]=this[_0xfa7c('0x10')][_0x44cf49[_0xfa7c('0x4c')]];this[_0xfa7c('0x10')][_0x44cf49[_0xfa7c('0x4c')]]=_0x58ea14;}}else{_0x3a97e7[_0xfa7c('0x54')]='COMPLETEDBY'+_0x44cf49[_0xfa7c('0x9e')][_0xfa7c('0x9f')]();logger[_0xfa7c('0x7a')](_0xfa7c('0xa0'),_0x3a97e7['queue'],_0x3a97e7[_0xfa7c('0x57')],_0x3a97e7[_0xfa7c('0x54')]);}}}this[_0xfa7c('0x39')][_0x44cf49[_0xfa7c('0x4c')]]=_0x3a97e7;}}}catch(_0x155dbf){logger[_0xfa7c('0x40')](_0xfa7c('0x8c'),_0x44cf49[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x155dbf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x25')]=function(_0x202d17){try{if(this[_0xfa7c('0x5c')](_0x202d17)){logger['debug'](_0xfa7c('0xa1'),_0x202d17[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x202d17,{'showHidden':![],'depth':null}));this[_0xfa7c('0xa2')](_0x202d17[_0xfa7c('0x4c')],_[_0xfa7c('0x7c')](_0x202d17[_0xfa7c('0xa3')])[0x0],_0x202d17[_0xfa7c('0xa4')]);if(this[_0xfa7c('0x10')][_0x202d17['uniqueid']]){var _0x5d2d29=_['last'](this['queueReports'][_0x202d17[_0xfa7c('0x4c')]]);if(_0x5d2d29){if(this[_0xfa7c('0x5c')](_0x202d17['variable'])&&this[_0xfa7c('0x5c')](_0x202d17[_0xfa7c('0xa3')][_0xfa7c('0x62')])){switch(_0x202d17['value']){case _0xfa7c('0xa5'):_0x5d2d29[_0xfa7c('0x35')]=![];_0x5d2d29[_0xfa7c('0x8f')]=null;break;case _0xfa7c('0xa6'):_0x5d2d29[_0xfa7c('0xa7')]=_0xfa7c('0xa8');_0x5d2d29[_0xfa7c('0x35')]=!![];_0x5d2d29[_0xfa7c('0x8f')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x5d2d29[_0xfa7c('0x86')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x202d17['uniqueid'],util[_0xfa7c('0x42')](_0x5d2d29,{'showHidden':![],'depth':null}));ami['emit'](_0xfa7c('0xa9'),_0x5d2d29);break;default:_0x5d2d29[_0xfa7c('0x35')]=!![];_0x5d2d29[_0xfa7c('0x8f')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x5d2d29['queuecallerleaveAt']=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));}_0x5d2d29[_0xfa7c('0x1f')]=![];_0x5d2d29[_0xfa7c('0x8d')]=null;_0x5d2d29['queuecallerexitreason']=_0x202d17['value'];this[_0xfa7c('0x39')][_0x202d17[_0xfa7c('0x4c')]]=_0x5d2d29;this[_0xfa7c('0x52')](_0x5d2d29,_0xfa7c('0xaa'));}else if(this[_0xfa7c('0x5c')](_0x202d17['variable'])&&this[_0xfa7c('0x5c')](_0x202d17['variable']['queueposition'])){if(!_0x5d2d29[_0xfa7c('0x1f')]){_0x5d2d29[_0xfa7c('0x35')]=!![];_0x5d2d29[_0xfa7c('0x8f')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x5d2d29[_0xfa7c('0x54')]=_0xfa7c('0xab');_0x5d2d29['queuecallerleaveAt']=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));this['channels'][_0x202d17['uniqueid']]=_0x5d2d29;}}logger[_0xfa7c('0x7a')](_0xfa7c('0xac'),_0x202d17['uniqueid'],_0x5d2d29['queue'],_0x5d2d29[_0xfa7c('0x57')],_['keys'](_0x202d17[_0xfa7c('0xa3')])[0x0],_0x202d17['value']);_0x5d2d29[_0xfa7c('0x15')]=this['variables'][_0x202d17[_0xfa7c('0x4c')]];}}}}catch(_0x15c821){logger[_0xfa7c('0x40')](_0xfa7c('0xa1'),_0x202d17[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x15c821,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0xa2')]=function(_0x1ca1a3,_0xed3cd8,_0x1ccfe4){var _0xe12134=[_0xfa7c('0xad'),_0xfa7c('0xae'),_0xfa7c('0xaf'),_0xfa7c('0xb0'),'rtpaudioqosloss',_0xfa7c('0xb1'),'rtpaudioqosrtt',_0xfa7c('0xb2'),'sipcallid','sipuri',_0xfa7c('0xb3'),_0xfa7c('0xb4'),_0xfa7c('0xb5'),_0xfa7c('0xb6'),_0xfa7c('0xb7'),_0xfa7c('0xb8'),_0xfa7c('0x8e'),_0xfa7c('0xb9'),_0xfa7c('0xba')];if(!_[_0xfa7c('0x3b')](_0xed3cd8)&&!_['includes'](_0xe12134,_0xed3cd8)){if(_[_0xfa7c('0x5d')](this[_0xfa7c('0x15')][_0x1ca1a3])){this[_0xfa7c('0x15')][_0x1ca1a3]={};}this[_0xfa7c('0x15')][_0x1ca1a3][_0xed3cd8]=_0x1ccfe4;}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0xbb')]=function(_0x6e90f6,_0x2ce986,_0x5e6987){try{var _0x2f2aa6={};if(this['queueReports'][_0x6e90f6]){for(var _0x233a72=0x0;_0x233a72<this['queueReports'][_0x6e90f6][_0xfa7c('0xbc')];_0x233a72+=0x1){_0x2f2aa6=this[_0xfa7c('0x10')][_0x6e90f6][_0x233a72];var _0x1d43e1=this[_0xfa7c('0x12')][_0x2f2aa6[_0xfa7c('0x4f')]];if(_0x1d43e1){_0x1d43e1[_0xfa7c('0xbd')]+=moment(_0x2f2aa6[_0xfa7c('0x86')])[_0xfa7c('0xbe')](_0x2f2aa6[_0xfa7c('0x75')],'seconds')||0x0;if(_0x5e6987&&_0x2f2aa6['queuecallerexitreason']===_0xfa7c('0xbf')){_0x2f2aa6[_0xfa7c('0x54')]=_0xfa7c('0x8a');}if(_0x233a72===this[_0xfa7c('0x10')][_0x6e90f6][_0xfa7c('0xbc')]-0x1){_0x1d43e1[_0xfa7c('0xc0')]+=moment()[_0xfa7c('0xc1')](0x0)[_0xfa7c('0xbe')](_0x2f2aa6['queuecallerjoinAt'],_0xfa7c('0x97'));if(hasCallerLeftTheQueue(_0x2f2aa6)&&_0x2f2aa6[_0xfa7c('0x54')]!==_0xfa7c('0xbf')){_0x1d43e1[_0xfa7c('0xc2')]+=0x1;}if(_0x2f2aa6[_0xfa7c('0x36')]){_0x1d43e1[_0xfa7c('0xc3')]+=0x1;_0x1d43e1[_0xfa7c('0xc4')]+=moment()[_0xfa7c('0xc1')](0x0)['diff'](_0x2f2aa6[_0xfa7c('0x86')],_0xfa7c('0x97'));_0x2f2aa6[_0xfa7c('0xc5')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x2f2aa6[_0xfa7c('0x35')]=![];_0x2f2aa6[_0xfa7c('0x8f')]=null;}if(_0x2f2aa6[_0xfa7c('0x35')]&&_0x2f2aa6[_0xfa7c('0x90')]!=!![]){_0x1d43e1['unmanaged']+=0x1;_0x2f2aa6[_0xfa7c('0xa7')]='unmanaged';logger[_0xfa7c('0x4a')](_0xfa7c('0xc6'),_0x6e90f6,util[_0xfa7c('0x42')](_0x2f2aa6,{'showHidden':![],'depth':null}));ami[_0xfa7c('0x48')](_0xfa7c('0xc7'),_0x2f2aa6);}if(_0x2f2aa6[_0xfa7c('0x1f')]){_0x1d43e1[_0xfa7c('0xc8')]+=0x1;_0x2f2aa6['lastevent']='abandoned';logger[_0xfa7c('0x4a')](_0xfa7c('0xc9'),_0x6e90f6,util[_0xfa7c('0x42')](_0x2f2aa6,{'showHidden':![],'depth':null}));ami[_0xfa7c('0x48')]('custom:queuecallerabandon',_0x2f2aa6);}}else{_0x1d43e1[_0xfa7c('0xc0')]+=_0x1d43e1['sumHoldTime'];}logger[_0xfa7c('0x7a')](_0xfa7c('0xca'),_0x6e90f6,_0x2f2aa6[_0xfa7c('0x4f')],_0x2f2aa6[_0xfa7c('0x57')],_0x2ce986);this[_0xfa7c('0x39')][_0x6e90f6]=_0x2f2aa6;Object['assign'](this[_0xfa7c('0x12')][_0x2f2aa6[_0xfa7c('0x4f')]],_0x1d43e1);if(_0x2f2aa6[_0xfa7c('0x86')]){this['emitVoiceQueueChannelRemove'](_0x2f2aa6,_0xfa7c('0x26'));}}}logger['debug'](_0xfa7c('0xcb'),_0x6e90f6,util[_0xfa7c('0x42')](this[_0xfa7c('0x10')][_0x6e90f6],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x2f2aa6)&&_0x2f2aa6[_0xfa7c('0x54')]!==_0xfa7c('0xbf')){ami[_0xfa7c('0x48')](_0xfa7c('0xcc'),this['queueReports'][_0x6e90f6]);if(this['queueReports'][_0x6e90f6]){delete this[_0xfa7c('0x10')][_0x6e90f6];}if(this[_0xfa7c('0x39')][_0x6e90f6]){delete this[_0xfa7c('0x39')][_0x6e90f6];}if(this[_0xfa7c('0x15')][_0x6e90f6]){delete this[_0xfa7c('0x15')][_0x6e90f6];}}}}catch(_0x137e19){logger[_0xfa7c('0x40')](_0xfa7c('0xcd'),_0x6e90f6,util[_0xfa7c('0x42')](_0x137e19,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0xce')]=function(_0xaa1ec0){try{if(this[_0xfa7c('0x5c')](_0xaa1ec0)){logger[_0xfa7c('0x4a')]('[%s][voiceQueueReport][hangup]',_0xaa1ec0[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0xaa1ec0,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0xaa1ec0[_0xfa7c('0x4c')]]){return this[_0xfa7c('0xbb')](_0xaa1ec0[_0xfa7c('0x4c')],_0xaa1ec0['cause-txt'],![]);}if(this[_0xfa7c('0x10')][_0xaa1ec0[_0xfa7c('0x95')]]){if(_0xaa1ec0[_0xfa7c('0xcf')]==='21'){return;}return this['handleHangup'](_0xaa1ec0[_0xfa7c('0x95')],_0xaa1ec0[_0xfa7c('0xd0')],!![]);}var _0x308b65=Object[_0xfa7c('0x7c')](this[_0xfa7c('0x10')]);for(var _0x991bc4=0x0;_0x991bc4<_0x308b65[_0xfa7c('0xbc')];_0x991bc4++){var _0x20d0e3=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0x308b65[_0x991bc4]]);if(_0x20d0e3&&_0x20d0e3[_0xfa7c('0xd1')]===_0xaa1ec0[_0xfa7c('0x4c')]){return this[_0xfa7c('0xbb')](_0x20d0e3[_0xfa7c('0x4c')],_0xaa1ec0[_0xfa7c('0xd0')],!![]);}}if(!this[_0xfa7c('0x10')][_0xaa1ec0[_0xfa7c('0x4c')]]){logger[_0xfa7c('0x4a')]('[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed',_0xaa1ec0[_0xfa7c('0x4c')]);if(this[_0xfa7c('0x39')][_0xaa1ec0['uniqueid']]){delete this[_0xfa7c('0x39')][_0xaa1ec0[_0xfa7c('0x4c')]];}if(this['variables'][_0xaa1ec0['uniqueid']]){delete this['variables'][_0xaa1ec0[_0xfa7c('0x4c')]];}}}}catch(_0x304521){logger['error'](_0xfa7c('0xd2'),_0xaa1ec0['uniqueid'],util[_0xfa7c('0x42')](_0x304521,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x2a')]=function(_0xc8c75c){try{if(this[_0xfa7c('0x5c')](_0xc8c75c)){logger[_0xfa7c('0x4a')](_0xfa7c('0xd3'),_0xc8c75c['uniqueid'],util['inspect'](_0xc8c75c,{'showHidden':![],'depth':null}));var _0x14b9f0;var _0x30d4cb;var _0x47d52f;if(this['queueReports'][_0xc8c75c[_0xfa7c('0xd4')]]){_0x14b9f0=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd4')]]);_0x14b9f0[_0xfa7c('0x9b')]=_0xc8c75c[_0xfa7c('0xd5')];_0x14b9f0[_0xfa7c('0x9d')]=_0xc8c75c[_0xfa7c('0xd6')];_0x14b9f0[_0xfa7c('0x54')]=_0xfa7c('0xbf');_0x14b9f0[_0xfa7c('0x90')]=!![];_0x14b9f0[_0xfa7c('0x99')]=_0xfa7c('0xd7');if(this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd6')]]){_0x47d52f=this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd6')]];this['queueReports'][_0xc8c75c[_0xfa7c('0xd6')]]=this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd4')]];this['queueReports'][_0xc8c75c['transfereeuniqueid']]=_0x47d52f;_0x30d4cb=_['last'](this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd4')]]);_0x30d4cb[_0xfa7c('0x3a')]=!![];}logger[_0xfa7c('0x7a')](_0xfa7c('0xd8'),_0xc8c75c['uniqueid'],_0x14b9f0[_0xfa7c('0x4f')],_0x14b9f0[_0xfa7c('0x57')],_0x14b9f0[_0xfa7c('0x9b')],_0x14b9f0[_0xfa7c('0x9d')]);}else if(this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd9')]]){_0x14b9f0=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd9')]]);_0x14b9f0['transferexten']=_0xc8c75c[_0xfa7c('0xda')];_0x14b9f0[_0xfa7c('0x9d')]=_0xc8c75c[_0xfa7c('0xdb')];_0x14b9f0[_0xfa7c('0x54')]=_0xfa7c('0xbf');_0x14b9f0['transfer']=!![];_0x14b9f0[_0xfa7c('0x99')]=_0xfa7c('0xd7');if(this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xdb')]]){_0x47d52f=this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xdb')]];this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xdb')]]=this['queueReports'][_0xc8c75c['transfertargetuniqueid']];this['queueReports'][_0xc8c75c[_0xfa7c('0xd9')]]=_0x47d52f;_0x30d4cb=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0xc8c75c['transfertargetuniqueid']]);_0x30d4cb[_0xfa7c('0x3a')]=!![];}logger[_0xfa7c('0x7a')](_0xfa7c('0xd8'),_0xc8c75c[_0xfa7c('0x4c')],_0x14b9f0[_0xfa7c('0x4f')],_0x14b9f0[_0xfa7c('0x57')],_0x14b9f0[_0xfa7c('0x9b')],_0x14b9f0[_0xfa7c('0x9d')]);}else if(this['queueReports'][_0xc8c75c[_0xfa7c('0xdb')]]){_0x14b9f0=_['last'](this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xdb')]]);_0x14b9f0[_0xfa7c('0x9b')]=_0xc8c75c[_0xfa7c('0xda')];_0x14b9f0[_0xfa7c('0x9d')]=_0xc8c75c[_0xfa7c('0xdb')];_0x14b9f0['queuecallerexitreason']='ATTENDEDTRANSFER';_0x14b9f0[_0xfa7c('0x90')]=!![];_0x14b9f0[_0xfa7c('0x99')]='ATTENDED';_0x14b9f0[_0xfa7c('0x3a')]=!![];_0x14b9f0[_0xfa7c('0xd1')]=_0xc8c75c[_0xfa7c('0xd4')];}else if(this[_0xfa7c('0x10')][_0xc8c75c['secondtransfereruniqueid']]){_0x14b9f0=_['last'](this[_0xfa7c('0x10')][_0xc8c75c['secondtransfereruniqueid']]);_0x14b9f0[_0xfa7c('0x9b')]=_0xc8c75c['secondtransfererexten'];_0x14b9f0['transferuniqueid']=_0xc8c75c[_0xfa7c('0xd6')];_0x14b9f0[_0xfa7c('0x54')]=_0xfa7c('0xbf');_0x14b9f0[_0xfa7c('0x90')]=!![];_0x14b9f0[_0xfa7c('0x99')]='ATTENDED';_0x14b9f0[_0xfa7c('0x3a')]=!![];_0x14b9f0['transferid']=_0xc8c75c[_0xfa7c('0xd9')];}}}catch(_0x41960d){logger[_0xfa7c('0x40')](_0xfa7c('0xd3'),_0xc8c75c[_0xfa7c('0x4c')],util['inspect'](_0x41960d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x2c')]=function(_0x2c82c9){try{if(this[_0xfa7c('0x5c')](_0x2c82c9)){logger[_0xfa7c('0x4a')](_0xfa7c('0xdc'),_0x2c82c9[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x2c82c9,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x2c82c9['transfereeuniqueid']]){var _0x2cbd68=_['last'](this[_0xfa7c('0x10')][_0x2c82c9[_0xfa7c('0xd4')]]);_0x2cbd68[_0xfa7c('0x54')]=_0xfa7c('0xdd');_0x2cbd68[_0xfa7c('0x90')]=!![];_0x2cbd68['transfertype']=_0xfa7c('0xde');_0x2cbd68[_0xfa7c('0x9b')]=_0x2c82c9[_0xfa7c('0xdf')];_0x2cbd68[_0xfa7c('0x9d')]=_0x2c82c9['transfereeuniqueid'];logger['info'](_0xfa7c('0xe0'),_0x2c82c9['uniqueid'],_0x2cbd68['queue'],_0x2cbd68[_0xfa7c('0x57')],_0x2cbd68[_0xfa7c('0x9b')],_0x2cbd68[_0xfa7c('0x9d')]);this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x2c82c9[_0xfa7c('0xd4')],'context':_0x2c82c9[_0xfa7c('0xe1')],'channel':_0x2c82c9[_0xfa7c('0xe2')]});}}}catch(_0x3f65ac){logger[_0xfa7c('0x40')](_0xfa7c('0xdc'),_0x2c82c9[_0xfa7c('0x4c')],util['inspect'](_0x3f65ac,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xfa7c('0xe3')]=function(_0x41f850){try{if(this[_0xfa7c('0x5c')](_0x41f850)){logger[_0xfa7c('0x4a')](_0xfa7c('0xe4'),_0x41f850[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x41f850,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x41f850[_0xfa7c('0x4c')]]){var _0x1f8ae7=_['last'](this['queueReports'][_0x41f850['uniqueid']]);if(!_[_0xfa7c('0x3b')](_0x1f8ae7[_0xfa7c('0x86')])){_0x1f8ae7['mohstarttime']=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));logger[_0xfa7c('0x7a')](_0xfa7c('0xe5'),_0x41f850[_0xfa7c('0x4c')],_0x1f8ae7[_0xfa7c('0xe6')]);}}}}catch(_0x4f337b){logger[_0xfa7c('0x40')](_0xfa7c('0xe4'),_0x41f850[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x4f337b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0xe7')]=function(_0x5b82f7){try{if(this[_0xfa7c('0x5c')](_0x5b82f7)){logger[_0xfa7c('0x4a')](_0xfa7c('0xe8'),_0x5b82f7[_0xfa7c('0x4c')],util['inspect'](_0x5b82f7,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x5b82f7['uniqueid']]){var _0x15132b=_['last'](this[_0xfa7c('0x10')][_0x5b82f7[_0xfa7c('0x4c')]]);if(!_[_0xfa7c('0x3b')](_0x15132b[_0xfa7c('0xe6')])){_0x15132b['mohtime']+=moment()[_0xfa7c('0xc1')](0x0)[_0xfa7c('0xbe')](_0x15132b[_0xfa7c('0xe6')],_0xfa7c('0x97'));logger[_0xfa7c('0x7a')](_0xfa7c('0xe9'),_0x5b82f7[_0xfa7c('0x4c')],_0x15132b['mohtime']);delete _0x15132b['mohstarttime'];}}}}catch(_0x4e5cd5){logger['error'](_0xfa7c('0xe8'),_0x5b82f7['uniqueid'],util['inspect'](_0x4e5cd5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xfa7c('0xea')]=function(_0x54ed24){try{if(this['isNotNull'](_0x54ed24)){logger['debug'](_0xfa7c('0xeb'),_0x54ed24[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x54ed24,{'showHidden':![],'depth':null}));if(_0x54ed24[_0xfa7c('0xec')][_0xfa7c('0x93')]()===_0xfa7c('0xed')){_0x54ed24[_0xfa7c('0xee')]=_0x54ed24['appdata']&&_0x54ed24[_0xfa7c('0xef')][_0xfa7c('0x92')]('CDR(routeAlias)')?_0x54ed24[_0xfa7c('0xef')]:(_0x54ed24[_0xfa7c('0xef')]||_0x54ed24['applicationdata'])[_0xfa7c('0x93')]();if(_['startsWith'](_0x54ed24[_0xfa7c('0xee')][_0xfa7c('0x93')](),_0xfa7c('0xf0'))){logger[_0xfa7c('0x7a')](_0xfa7c('0xf1'),_0x54ed24[_0xfa7c('0x4c')],_0x54ed24[_0xfa7c('0xec')],_0x54ed24['applicationdata']);if(_[_0xfa7c('0x5d')](this[_0xfa7c('0x39')][_0x54ed24[_0xfa7c('0x4c')]]))this['channels'][_0x54ed24[_0xfa7c('0x4c')]]={};var _0x5535c0=_0x54ed24[_0xfa7c('0xee')][_0xfa7c('0xf2')]('=');var _0x54994c=_0x5535c0[0x0][_0xfa7c('0x93')]()[_0xfa7c('0xf3')](/cdr\((.*)\)/);if(_0x54994c)this['channels'][_0x54ed24['uniqueid']][_0x54994c[0x1]]=_0x5535c0[0x1];}}}}catch(_0x4a7bef){logger[_0xfa7c('0x40')](_0xfa7c('0xf4'),_0x54ed24[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x4a7bef,{'showHidden':![],'depth':null}));}};module[_0xfa7c('0xf5')]=VoiceQueueReport;
\ No newline at end of file
+var _0x4517=['[voiceQueueReport][queues]','isRunning','then','actionid','queuestatus','[voiceQueueReport][queuesummary]','name','summaryEvent','createReport','handleInboundQueueSummaryReport','createQueueSummaryReport','compareToInboundQueue','outbound','custom:queuesummary','statusRequests','completeEvent','syncQueueSummary','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','assign','pick','keys','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','last','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','emitVoiceQueueChannelSave','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexitAt','transfer','reason','COMPLETED','toLowerCase','linkedid','queuecallerexit','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','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','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','includes','length','sumHoldTime','diff','sumDuration','milliseconds','total','answered','unmanaged','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','handleHangup','cause-txt','cause','transferid','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','syncAttendedTransfer','transfereeuniqueid','secondtransfererexten','ATTENDED','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','startsWith','cdr(','split','lodash','moment','util','ioredis','../../../config/environment','ami','../model/queueReport','defaults','redis','socket.io-emitter','tail','finally','sequence','queueReports','realtime','agents','channels','queueChannels','voiceQueues','campaigns','summary','variables','queuesummarycomplete','syncQueueSummaryComplete','bind','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','waiting','queueStatusComplete','unlockRR','queuecallercomplete','clearZombieChannels','switch','enqueue','isNil','Action','channel','catch','message','No\x20such\x20channel','error','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','prototype','emitVoiceQueueChannelRemove','clearqueuereport','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','queue','voice_queue_channel:remove','voice_queue_presence:remove','type','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','voice:queue:%s','voice_queue:save','isNotNull','isUndefined','loopQueueShow','queues'];(function(_0x125597,_0x1d5ddd){var _0x5a6818=function(_0x4943f5){while(--_0x4943f5){_0x125597['push'](_0x125597['shift']());}};_0x5a6818(++_0x1d5ddd);}(_0x4517,0x98));var _0x7451=function(_0x2cbdbd,_0x4b3d8a){_0x2cbdbd=_0x2cbdbd-0x0;var _0x283ee3=_0x4517[_0x2cbdbd];return _0x283ee3;};'use strict';var _=require(_0x7451('0x0'));var moment=require(_0x7451('0x1'));var util=require(_0x7451('0x2'));var Redis=require(_0x7451('0x3'));var config=require(_0x7451('0x4'));var logger=require('../../../config/logger')(_0x7451('0x5'));var ami=require('../ami');var QueueReport=require(_0x7451('0x6'));var VoiceQueueSummary=require('../model/voiceQueueSummary');config['redis']=_[_0x7451('0x7')](config[_0x7451('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x7451('0x9'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x5a6866){this[_0x7451('0xa')]=this[_0x7451('0xa')]?this['tail'][_0x7451('0xb')](_0x5a6866):_0x5a6866();};function VoiceQueueReport(_0x173ee1){this[_0x7451('0xc')]=new Sequence();this[_0x7451('0xd')]={};this[_0x7451('0xe')]=_0x173ee1;this[_0x7451('0xf')]=_0x173ee1[_0x7451('0xf')];this[_0x7451('0x10')]=_0x173ee1[_0x7451('0x11')];this['voiceQueues']=_0x173ee1[_0x7451('0x12')];this[_0x7451('0x13')]=_0x173ee1[_0x7451('0x13')];this[_0x7451('0x14')]=initializeSummary();this[_0x7451('0x15')]={};ami['on']('queuesummary',this['syncQueueSummary']['bind'](this));ami['on'](_0x7451('0x16'),this[_0x7451('0x17')][_0x7451('0x18')](this));ami['on']('queuemember',this[_0x7451('0x19')]['bind'](this));ami['on'](_0x7451('0x1a'),this[_0x7451('0x1b')][_0x7451('0x18')](this));ami['on'](_0x7451('0x1c'),this[_0x7451('0x1d')][_0x7451('0x18')](this));ami['on'](_0x7451('0x1e'),this['syncQueueCallerAbandon'][_0x7451('0x18')](this));ami['on'](_0x7451('0x1f'),this[_0x7451('0x20')][_0x7451('0x18')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x7451('0x18')](this));ami['on']('agentconnect',this[_0x7451('0x21')]['bind'](this));ami['on'](_0x7451('0x22'),this[_0x7451('0x23')][_0x7451('0x18')](this));ami['on'](_0x7451('0x24'),this[_0x7451('0x25')][_0x7451('0x18')](this));ami['on']('fullybooted',this[_0x7451('0x26')][_0x7451('0x18')](this));ami['on'](_0x7451('0x27'),this[_0x7451('0x28')][_0x7451('0x18')](this));ami['on']('musiconholdstop',this[_0x7451('0x29')][_0x7451('0x18')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this[_0x7451('0x2a')][_0x7451('0x18')](this));this[_0x7451('0x2b')]();this['loopQueueShow']();}function clearChannels(_0x35fdeb){if(!_[_0x7451('0x2c')](_0x35fdeb)){for(var _0x4f3fab in _0x35fdeb){if(_0x35fdeb[_0x7451('0x2d')](_0x4f3fab)){delete _0x35fdeb[_0x4f3fab];}}}}function clearCampaigns(_0x5652b6){if(!_[_0x7451('0x2c')](_0x5652b6)){for(var _0x3602a5 in _0x5652b6){if(_0x5652b6[_0x7451('0x2d')](_0x3602a5)){_0x5652b6[_0x3602a5][_0x7451('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x5807b1){if(!_[_0x7451('0x2c')](_0x5807b1)){for(var _0x186d90 in _0x5807b1){if(_0x5807b1['hasOwnProperty'](_0x186d90)){_0x5807b1[_0x186d90][_0x7451('0x2e')]=0x0;_0x5807b1[_0x186d90]['talking']=0x0;_0x5807b1[_0x186d90]['pTalking']=0x0;_0x5807b1[_0x186d90][_0x7451('0x2f')]=0x0;_0x5807b1[_0x186d90][_0x7451('0x30')]=!![];}}}}function clearAgentBooked(_0x177531){if(!_[_0x7451('0x2c')](_0x177531)){for(var _0x2edcd2 in _0x177531){if(_0x177531[_0x7451('0x2d')](_0x2edcd2)){_0x177531[_0x2edcd2][_0x7451('0x31')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x130269){return _0x130269['queuecallerexit']||_0x130269[_0x7451('0x1e')]||_0x130269[_0x7451('0x32')];}VoiceQueueReport['prototype'][_0x7451('0x33')]=function(){var _0x2aa742=this;for(var _0x19cf86 in this[_0x7451('0x10')]){if(this[_0x7451('0x10')]['hasOwnProperty'](_0x19cf86)&&!this[_0x7451('0x10')][_0x19cf86][_0x7451('0x34')]){this['sequence'][_0x7451('0x35')](function(){if(!_[_0x7451('0x36')](_0x2aa742[_0x7451('0x10')][_0x19cf86])){return ami[_0x7451('0x37')]({'action':'status','channel':_0x2aa742['channels'][_0x19cf86][_0x7451('0x38')]})[_0x7451('0x39')](function(_0x466c1d){if(_0x466c1d[_0x7451('0x3a')]===_0x7451('0x3b')){setTimeout(function(){if(_0x2aa742[_0x7451('0x10')][_0x19cf86]){delete _0x2aa742[_0x7451('0x10')][_0x19cf86];logger[_0x7451('0x3c')]('[%s][voiceQueueReport][checkChannel]',_0x19cf86,util[_0x7451('0x3d')](_0x466c1d,{'showHidden':![],'depth':null}));}if(_0x2aa742[_0x7451('0xd')][_0x19cf86]){delete _0x2aa742['queueReports'][_0x19cf86];logger[_0x7451('0x3c')](_0x7451('0x3e'),_0x19cf86,util['inspect'](_0x466c1d,{'showHidden':![],'depth':null}));}if(_0x2aa742[_0x7451('0x15')][_0x19cf86]){delete _0x2aa742[_0x7451('0x15')][_0x19cf86];logger[_0x7451('0x3c')](_0x7451('0x3f'),_0x19cf86,util[_0x7451('0x3d')](_0x466c1d,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype']['syncFullyBooted']=function(){logger[_0x7451('0x3c')](_0x7451('0x40'));clearChannels(this[_0x7451('0x10')]);this[_0x7451('0x41')](this[_0x7451('0xd')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x7451('0x12')]);clearCampaigns(this['campaigns']);this['summary']=initializeSummary();};VoiceQueueReport[_0x7451('0x42')]['clearQueueReport']=function(_0x2f0541){var _0x13d6a6=this;if(!_['isEmpty'](_0x2f0541)){for(var _0xaf7e83 in _0x2f0541){if(_0x2f0541[_0x7451('0x2d')](_0xaf7e83)){_0x13d6a6[_0x7451('0x43')](_0x2f0541[_0xaf7e83],_0x7451('0x44'));delete _0x2f0541[_0xaf7e83];}}}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x45')]=function(_0x5cd2a8,_0x1910cd,_0x5712b5){io['to'](_0x5cd2a8)[_0x7451('0x45')](_0x1910cd,_0x5712b5);};VoiceQueueReport[_0x7451('0x42')]['emitVoiceQueueChannelSave']=function(_0xb4398b,_0x448dbc){logger[_0x7451('0x46')](_0x7451('0x47')+_0x448dbc+_0x7451('0x48'),_0xb4398b[_0x7451('0x49')],util[_0x7451('0x3d')](_0xb4398b,{'showHidden':![],'depth':null}));this[_0x7451('0x45')](util[_0x7451('0x4a')]('voice:queue:%s',_0xb4398b['queue']),_0x7451('0x4b'),_0xb4398b);io[_0x7451('0x45')](_0x7451('0x4c'),_0xb4398b);};VoiceQueueReport[_0x7451('0x42')]['emitVoiceQueueChannelRemove']=function(_0x23b6fd,_0x12bc0a){logger[_0x7451('0x46')]('[%s][voiceQueueReport]['+_0x12bc0a+_0x7451('0x4d'),_0x23b6fd[_0x7451('0x49')],util['inspect'](_0x23b6fd,{'showHidden':![],'depth':null}));if(_0x23b6fd[_0x7451('0x4e')]===_0x7451('0x4f')){return;}this[_0x7451('0x45')](util[_0x7451('0x4a')]('voice:queue:%s',_0x23b6fd[_0x7451('0x50')]),_0x7451('0x51'),_0x23b6fd);io[_0x7451('0x45')](_0x7451('0x52'),_0x23b6fd);};VoiceQueueReport[_0x7451('0x42')]['emitInboundVoiceQueueSummary']=function(_0x2eaa68){if(_0x2eaa68[_0x7451('0x53')]===_0x7451('0x54')){logger[_0x7451('0x46')](_0x7451('0x55'),util[_0x7451('0x3d')](_0x2eaa68,{'showHidden':![],'depth':null}));this[_0x7451('0x45')](util[_0x7451('0x4a')](_0x7451('0x56'),_0x2eaa68['name']),_0x7451('0x57'),_0x2eaa68);}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x58')]=function(_0x1f355b){return _0x1f355b!==null&&!_[_0x7451('0x59')](_0x1f355b);};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x5a')]=function(){var _0x15bb88=this;setInterval(function(){_0x15bb88['clearZombieChannels']();ami['Action']({'action':_0x7451('0x5b')})[_0x7451('0x39')](function(_0x57016d){logger[_0x7451('0x3c')](_0x7451('0x5c'),util[_0x7451('0x3d')](_0x57016d,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x2b')]=function(){var _0x207c53=this;setInterval(function(){if(!_0x207c53[_0x7451('0x14')][_0x7451('0x5d')]){return ami[_0x7451('0x37')]({'action':'queuesummary'})[_0x7451('0x5e')](function(_0x2cdc6f){_0x207c53[_0x7451('0x14')]['id']=_0x2cdc6f[_0x7451('0x5f')];_0x207c53['summary'][_0x7451('0x5d')]=!![];_0x207c53[_0x7451('0x14')][_0x7451('0x60')][_0x2cdc6f[_0x7451('0x5f')]]={};})[_0x7451('0x39')](function(_0x2b07fd){logger[_0x7451('0x3c')](_0x7451('0x61'),util['inspect'](_0x2b07fd,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x7451('0x42')]['createQueueSummaryReport']=function(_0x33da53,_0x399157){var _0x453f0c;if(this['summary']&&this[_0x7451('0x14')][_0x7451('0x5b')]&&this[_0x7451('0x14')][_0x7451('0x5b')][_0x33da53[_0x7451('0x62')]]){_0x453f0c=this[_0x7451('0x14')][_0x7451('0x5b')][_0x33da53[_0x7451('0x62')]][_0x7451('0x63')];}var _0x21d644=new VoiceQueueSummary(_0x33da53);return _0x21d644[_0x7451('0x64')](_0x399157['agents'],this[_0x7451('0xf')],_0x453f0c,this[_0x7451('0xe')][_0x7451('0x10')]);};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x65')]=function(_0x1938a0,_0x9ed810){var _0x5172dd=this[_0x7451('0x66')](_0x1938a0,_0x9ed810);var _0x1ff784=![];_0x1ff784=_0x5172dd[_0x7451('0x67')](_0x1938a0);if(_0x1ff784){Object['assign'](_0x1938a0,_0x5172dd);this[_0x7451('0xe')][_0x7451('0x12')][_0x1938a0[_0x7451('0x62')]]=_0x1938a0;this['emitInboundVoiceQueueSummary'](_0x5172dd);}};VoiceQueueReport[_0x7451('0x42')]['syncQueueStatusComplete']=function(_0x43787d){var _0x6116e7=null;var _0x2c9a11=this[_0x7451('0x14')]['id'];if(this[_0x7451('0x14')][_0x7451('0x60')][_0x2c9a11]){_0x6116e7=this[_0x7451('0x14')][_0x7451('0x60')][_0x2c9a11][_0x43787d['actionid']];}if(!_0x6116e7){this[_0x7451('0x14')]=initializeSummary();return;}var _0x1298f5=this[_0x7451('0x12')][_0x6116e7['queue']];if(_0x1298f5[_0x7451('0x53')]==='inbound'){this[_0x7451('0x65')](_0x1298f5,_0x6116e7);}else if(_0x1298f5[_0x7451('0x53')]===_0x7451('0x68')){var _0x1a27e1=this['createQueueSummaryReport'](_0x1298f5,_0x6116e7);ami[_0x7451('0x45')](_0x7451('0x69'),_0x1a27e1);}this['summary']['statusRequests']-=0x1;var _0x51ee3c=this[_0x7451('0x14')][_0x7451('0x6a')]>0x0?!![]:![];if(!_0x51ee3c){return this[_0x7451('0x17')](this['summary'][_0x7451('0x6b')]);}};VoiceQueueReport['prototype'][_0x7451('0x19')]=function(_0x37b459){var _0x7f472e=this[_0x7451('0x14')]['id'];if(this[_0x7451('0x14')]['queuestatus'][_0x7f472e]&&this['summary']['queuestatus'][_0x7f472e][_0x37b459[_0x7451('0x5f')]]){this[_0x7451('0x14')][_0x7451('0x60')][_0x7f472e][_0x37b459['actionid']][_0x7451('0xf')]['push'](_0x37b459);}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x6c')]=function(_0x3a71c5){var _0x2b6cd5=this;try{if(this[_0x7451('0x58')](_0x3a71c5)&&this[_0x7451('0x58')](_0x3a71c5[_0x7451('0x50')])){logger['debug'](_0x7451('0x6d'),util['inspect'](_0x3a71c5,{'showHidden':![],'depth':null}));var _0x4b03c0=this[_0x7451('0x12')][_0x3a71c5[_0x7451('0x50')]];if(_0x4b03c0){logger[_0x7451('0x46')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x4b03c0[_0x7451('0x62')]);this[_0x7451('0x14')][_0x7451('0x5b')][_0x4b03c0[_0x7451('0x62')]]={'summaryEvent':_0x3a71c5};this[_0x7451('0x14')][_0x7451('0x6a')]+=0x1;return ami[_0x7451('0x37')]({'action':_0x7451('0x60'),'queue':_0x4b03c0['name']})[_0x7451('0x5e')](function(_0x75e606){if(!_0x2b6cd5['summary'][_0x7451('0x60')][_0x3a71c5[_0x7451('0x5f')]]){_0x2b6cd5[_0x7451('0x14')][_0x7451('0x60')][_0x3a71c5[_0x7451('0x5f')]]={};}_0x2b6cd5[_0x7451('0x14')][_0x7451('0x60')][_0x3a71c5[_0x7451('0x5f')]][_0x75e606[_0x7451('0x5f')]]={'queue':_0x4b03c0[_0x7451('0x62')],'agents':[]};})[_0x7451('0x39')](function(_0x451451){throw _0x451451;});}}}catch(_0x59dd3a){logger[_0x7451('0x3c')](_0x7451('0x61'),util[_0x7451('0x3d')](_0x59dd3a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x17')]=function(_0x2193bc){if(this[_0x7451('0x14')][_0x7451('0x6a')]>0x0){this[_0x7451('0x14')][_0x7451('0x6b')]=_0x2193bc;return;}logger[_0x7451('0x46')](_0x7451('0x6e'),util[_0x7451('0x3d')](_0x2193bc,{'showHidden':![],'depth':null}));this['summary']=initializeSummary();ami['emit'](_0x7451('0x6f'),{});};VoiceQueueReport['prototype'][_0x7451('0x1d')]=function(_0x35df9c){try{if(this[_0x7451('0x58')](_0x35df9c)){logger[_0x7451('0x46')](_0x7451('0x70'),_0x35df9c[_0x7451('0x49')],util[_0x7451('0x3d')](_0x35df9c,{'showHidden':![],'depth':null}));if(_[_0x7451('0x59')](this[_0x7451('0xd')][_0x35df9c[_0x7451('0x49')]])){this[_0x7451('0xd')][_0x35df9c[_0x7451('0x49')]]=[];}if(_[_0x7451('0x59')](this[_0x7451('0x10')][_0x35df9c['uniqueid']])){this[_0x7451('0x10')][_0x35df9c[_0x7451('0x49')]]={};}var _0x3edcb5=new QueueReport();_0x3edcb5[_0x7451('0x50')]=_0x35df9c['queue'];_0x3edcb5[_0x7451('0x53')]=this[_0x7451('0x12')][_0x3edcb5[_0x7451('0x50')]]&&this[_0x7451('0x12')][_0x3edcb5['queue']][_0x7451('0x53')]?this[_0x7451('0x12')][_0x3edcb5['queue']]['type']||_0x7451('0x54'):_0x7451('0x54');_0x3edcb5[_0x7451('0x71')]=moment()['format'](_0x7451('0x72'));_0x3edcb5[_0x7451('0x73')]=_0x35df9c['position'];_0x3edcb5[_0x7451('0x74')]=_0x35df9c[_0x7451('0x74')];_0x3edcb5['uniqueid']=_0x35df9c[_0x7451('0x49')];_0x3edcb5['routealias']=this[_0x7451('0x10')][_0x35df9c[_0x7451('0x49')]][_0x7451('0x75')];logger[_0x7451('0x76')](_0x7451('0x77'),_0x3edcb5['queue'],_0x3edcb5[_0x7451('0x53')]);Object[_0x7451('0x78')](_0x3edcb5,_[_0x7451('0x79')](_0x35df9c,_[_0x7451('0x7a')](_0x3edcb5)));this[_0x7451('0xd')][_0x35df9c['uniqueid']]['push'](_0x3edcb5);this[_0x7451('0x10')][_0x35df9c[_0x7451('0x49')]]=_0x3edcb5;this['emitVoiceQueueChannelSave'](_0x3edcb5,_0x7451('0x1c'));}}catch(_0x152fb7){logger['error'](_0x7451('0x70'),_0x35df9c[_0x7451('0x49')],util['inspect'](_0x152fb7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7451('0x7b')]=function(_0x62427){try{if(this[_0x7451('0x58')](_0x62427)){logger[_0x7451('0x46')](_0x7451('0x7c'),_0x62427[_0x7451('0x49')],util[_0x7451('0x3d')](_0x62427,{'showHidden':![],'depth':null}));if(this[_0x7451('0xd')][_0x62427[_0x7451('0x49')]]){var _0x5a36d3=_['last'](this['queueReports'][_0x62427['uniqueid']]);_0x5a36d3['queuecallercomplete']=![];_0x5a36d3[_0x7451('0x7d')]=null;_0x5a36d3[_0x7451('0x7e')]=_0x62427['holdtime'];_0x5a36d3[_0x7451('0x7f')]=_0x62427[_0x7451('0x7f')];_0x5a36d3['queuecallerabandon']=!![];_0x5a36d3[_0x7451('0x80')]=moment()[_0x7451('0x4a')](_0x7451('0x72'));_0x5a36d3[_0x7451('0x4e')]='ABANDONED';_0x5a36d3[_0x7451('0x81')]=null;logger['info'](_0x7451('0x82'),_0x5a36d3[_0x7451('0x50')],_0x5a36d3[_0x7451('0x53')]);this[_0x7451('0x10')][_0x62427['uniqueid']]=_0x5a36d3;this[_0x7451('0x43')](_0x5a36d3,'queuecallerabandon');}}}catch(_0x45f762){logger[_0x7451('0x3c')](_0x7451('0x7c'),_0x62427[_0x7451('0x49')],util[_0x7451('0x3d')](_0x45f762,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x20')]=function(_0x5d39a4){try{if(this['isNotNull'](_0x5d39a4)){logger[_0x7451('0x46')]('[%s][voiceQueueReport][queuecallerleave]',_0x5d39a4[_0x7451('0x49')],util['inspect'](_0x5d39a4,{'showHidden':![],'depth':null}));if(this[_0x7451('0xd')][_0x5d39a4[_0x7451('0x49')]]){var _0x179825=_[_0x7451('0x83')](this[_0x7451('0xd')][_0x5d39a4['uniqueid']]);_0x179825['queuecallerleaveAt']=moment()[_0x7451('0x4a')](_0x7451('0x72'));_0x179825[_0x7451('0x84')]=_0x5d39a4['connectedlinenum'];_0x179825['connectedlinename']=_0x5d39a4[_0x7451('0x85')];logger['info'](_0x7451('0x86'),_0x179825[_0x7451('0x50')],_0x179825[_0x7451('0x53')],_0x5d39a4[_0x7451('0x84')],_0x5d39a4[_0x7451('0x85')]);this[_0x7451('0x10')][_0x5d39a4[_0x7451('0x49')]]=_0x179825;this[_0x7451('0x87')](_0x179825,_0x7451('0x1f'));}}}catch(_0x3bfed6){logger[_0x7451('0x3c')]('[%s][voiceQueueReport][queuecallerleave]',_0x5d39a4[_0x7451('0x49')],util[_0x7451('0x3d')](_0x3bfed6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x21')]=function(_0x1ccd7b){try{if(this[_0x7451('0x58')](_0x1ccd7b)){logger['debug'](_0x7451('0x88'),_0x1ccd7b[_0x7451('0x49')],util['inspect'](_0x1ccd7b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1ccd7b[_0x7451('0x49')]]){var _0x4e3def=_[_0x7451('0x83')](this['queueReports'][_0x1ccd7b['uniqueid']]);_0x4e3def[_0x7451('0x32')]=!![];_0x4e3def[_0x7451('0x4e')]=_0x7451('0x89');logger[_0x7451('0x76')](_0x7451('0x8a'),_0x4e3def[_0x7451('0x50')],_0x4e3def[_0x7451('0x53')]);}}}catch(_0xe9846a){logger[_0x7451('0x3c')](_0x7451('0x88'),_0x1ccd7b[_0x7451('0x49')],util['inspect'](_0xe9846a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x8b')]=function(_0x4bf836){try{if(this[_0x7451('0x58')](_0x4bf836)){logger[_0x7451('0x46')](_0x7451('0x8c'),_0x4bf836[_0x7451('0x49')],util[_0x7451('0x3d')](_0x4bf836,{'showHidden':![],'depth':null}));if(this[_0x7451('0xd')][_0x4bf836[_0x7451('0x49')]]){var _0x2ee8d8=_[_0x7451('0x83')](this['queueReports'][_0x4bf836[_0x7451('0x49')]]);_0x2ee8d8[_0x7451('0x1e')]=![];_0x2ee8d8[_0x7451('0x80')]=null;_0x2ee8d8[_0x7451('0x8d')]=!![];_0x2ee8d8[_0x7451('0x81')]=_0x4bf836[_0x7451('0x8e')];_0x2ee8d8['holdtime']=_0x4bf836[_0x7451('0x7e')];_0x2ee8d8['queuecallercomplete']=!![];_0x2ee8d8['queuecallerexit']=![];_0x2ee8d8[_0x7451('0x8f')]=null;if(!_0x2ee8d8[_0x7451('0x90')]){if(_0x4bf836[_0x7451('0x91')]=='transfer'){_0x2ee8d8[_0x7451('0x4e')]=_0x7451('0x92');logger[_0x7451('0x76')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x2ee8d8[_0x7451('0x50')],_0x2ee8d8[_0x7451('0x53')]);}else{if(_['startsWith'](_0x4bf836[_0x7451('0x38')][_0x7451('0x93')](),'local/')){if(this[_0x7451('0xd')][_0x4bf836['linkedid']]){var _0x5acb9e=_[_0x7451('0x83')](this[_0x7451('0xd')][_0x4bf836[_0x7451('0x94')]]);_0x5acb9e[_0x7451('0x32')]=![];_0x5acb9e[_0x7451('0x95')]=!![];_0x5acb9e[_0x7451('0x8f')]=moment(_0x2ee8d8[_0x7451('0x71')])[_0x7451('0x96')](_0x4bf836[_0x7451('0x7e')],_0x7451('0x97'))[_0x7451('0x4a')](_0x7451('0x72'));_0x5acb9e['queuecallerexitreason']=_0x7451('0x98');_0x5acb9e[_0x7451('0x90')]=!![];_0x5acb9e[_0x7451('0x99')]=_0x7451('0x9a');_0x5acb9e[_0x7451('0x9b')]=_0x4bf836['destexten'];_0x5acb9e[_0x7451('0x9c')]=_0x4bf836[_0x7451('0x49')];logger['info'](_0x7451('0x9d'),_0x5acb9e[_0x7451('0x50')],_0x5acb9e[_0x7451('0x53')]);var _0x1a47b8=this[_0x7451('0xd')][_0x4bf836['linkedid']];this['queueReports'][_0x4bf836[_0x7451('0x94')]]=this[_0x7451('0xd')][_0x4bf836[_0x7451('0x49')]];this[_0x7451('0xd')][_0x4bf836[_0x7451('0x49')]]=_0x1a47b8;}}else{_0x2ee8d8[_0x7451('0x4e')]=_0x7451('0x9e')+_0x4bf836[_0x7451('0x91')][_0x7451('0x9f')]();logger[_0x7451('0x76')](_0x7451('0xa0'),_0x2ee8d8[_0x7451('0x50')],_0x2ee8d8[_0x7451('0x53')],_0x2ee8d8[_0x7451('0x4e')]);}}}this['channels'][_0x4bf836[_0x7451('0x49')]]=_0x2ee8d8;}}}catch(_0x3245f2){logger['error'](_0x7451('0x8c'),_0x4bf836['uniqueid'],util['inspect'](_0x3245f2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x23')]=function(_0xe7cee2){try{if(this[_0x7451('0x58')](_0xe7cee2)){logger[_0x7451('0x46')](_0x7451('0xa1'),_0xe7cee2[_0x7451('0x49')],util[_0x7451('0x3d')](_0xe7cee2,{'showHidden':![],'depth':null}));this[_0x7451('0xa2')](_0xe7cee2[_0x7451('0x49')],_[_0x7451('0x7a')](_0xe7cee2[_0x7451('0xa3')])[0x0],_0xe7cee2[_0x7451('0xa4')]);if(this[_0x7451('0xd')][_0xe7cee2[_0x7451('0x49')]]){var _0x445f52=_[_0x7451('0x83')](this['queueReports'][_0xe7cee2[_0x7451('0x49')]]);if(_0x445f52){if(this[_0x7451('0x58')](_0xe7cee2[_0x7451('0xa3')])&&this['isNotNull'](_0xe7cee2[_0x7451('0xa3')][_0x7451('0x60')])){switch(_0xe7cee2[_0x7451('0xa4')]){case _0x7451('0xa5'):_0x445f52[_0x7451('0x95')]=![];_0x445f52[_0x7451('0x8f')]=null;break;case _0x7451('0xa6'):_0x445f52['lastevent']=_0x7451('0xa7');_0x445f52[_0x7451('0x95')]=!![];_0x445f52[_0x7451('0x8f')]=moment()['format'](_0x7451('0x72'));_0x445f52[_0x7451('0xa8')]=moment()[_0x7451('0x4a')](_0x7451('0x72'));logger[_0x7451('0x46')](_0x7451('0xa9'),_0xe7cee2[_0x7451('0x49')],util[_0x7451('0x3d')](_0x445f52,{'showHidden':![],'depth':null}));ami['emit'](_0x7451('0xaa'),_0x445f52);break;default:_0x445f52[_0x7451('0x95')]=!![];_0x445f52['queuecallerexitAt']=moment()[_0x7451('0x4a')](_0x7451('0x72'));_0x445f52[_0x7451('0xa8')]=moment()[_0x7451('0x4a')](_0x7451('0x72'));}_0x445f52[_0x7451('0x1e')]=![];_0x445f52[_0x7451('0x80')]=null;_0x445f52[_0x7451('0x4e')]=_0xe7cee2[_0x7451('0xa4')];this['channels'][_0xe7cee2[_0x7451('0x49')]]=_0x445f52;this[_0x7451('0x43')](_0x445f52,_0x7451('0x22'));}else if(this['isNotNull'](_0xe7cee2[_0x7451('0xa3')])&&this[_0x7451('0x58')](_0xe7cee2[_0x7451('0xa3')]['queueposition'])){if(!_0x445f52[_0x7451('0x1e')]){_0x445f52[_0x7451('0x95')]=!![];_0x445f52[_0x7451('0x8f')]=moment()['format'](_0x7451('0x72'));_0x445f52['queuecallerexitreason']=_0x7451('0xab');_0x445f52[_0x7451('0xa8')]=moment()[_0x7451('0x4a')](_0x7451('0x72'));this[_0x7451('0x10')][_0xe7cee2[_0x7451('0x49')]]=_0x445f52;}}logger[_0x7451('0x76')](_0x7451('0xac'),_0xe7cee2[_0x7451('0x49')],_0x445f52[_0x7451('0x50')],_0x445f52[_0x7451('0x53')],_[_0x7451('0x7a')](_0xe7cee2[_0x7451('0xa3')])[0x0],_0xe7cee2[_0x7451('0xa4')]);_0x445f52[_0x7451('0x15')]=this['variables'][_0xe7cee2[_0x7451('0x49')]];}}}}catch(_0x3ef623){logger[_0x7451('0x3c')](_0x7451('0xa1'),_0xe7cee2[_0x7451('0x49')],util[_0x7451('0x3d')](_0x3ef623,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7451('0xa2')]=function(_0x3f29e6,_0x418602,_0x3bd208){var _0xc14b4c=[_0x7451('0xad'),_0x7451('0xae'),_0x7451('0xaf'),_0x7451('0xb0'),_0x7451('0xb1'),_0x7451('0xb2'),_0x7451('0xb3'),_0x7451('0xb4'),_0x7451('0xb5'),_0x7451('0xb6'),_0x7451('0xb7'),_0x7451('0xb8'),_0x7451('0xb9'),_0x7451('0xba'),_0x7451('0xbb'),_0x7451('0xbc'),'membername','memberpenalty',_0x7451('0xbd')];if(!_[_0x7451('0x36')](_0x418602)&&!_[_0x7451('0xbe')](_0xc14b4c,_0x418602)){if(_[_0x7451('0x59')](this['variables'][_0x3f29e6])){this[_0x7451('0x15')][_0x3f29e6]={};}this[_0x7451('0x15')][_0x3f29e6][_0x418602]=_0x3bd208;}};VoiceQueueReport[_0x7451('0x42')]['handleHangup']=function(_0x2840b3,_0x1fced9,_0x59dcf0){try{var _0x4da43f={};if(this['queueReports'][_0x2840b3]){for(var _0x5e7f5a=0x0;_0x5e7f5a<this[_0x7451('0xd')][_0x2840b3][_0x7451('0xbf')];_0x5e7f5a+=0x1){_0x4da43f=this[_0x7451('0xd')][_0x2840b3][_0x5e7f5a];var _0x552131=this[_0x7451('0x12')][_0x4da43f[_0x7451('0x50')]];if(_0x552131){_0x552131[_0x7451('0xc0')]+=moment(_0x4da43f[_0x7451('0xa8')])[_0x7451('0xc1')](_0x4da43f[_0x7451('0x71')],_0x7451('0x97'))||0x0;if(_0x59dcf0&&_0x4da43f[_0x7451('0x4e')]===_0x7451('0x4f')){_0x4da43f[_0x7451('0x4e')]=_0x7451('0x89');}if(_0x5e7f5a===this[_0x7451('0xd')][_0x2840b3]['length']-0x1){_0x552131[_0x7451('0xc2')]+=moment()[_0x7451('0xc3')](0x0)[_0x7451('0xc1')](_0x4da43f['queuecallerjoinAt'],_0x7451('0x97'));if(hasCallerLeftTheQueue(_0x4da43f)&&_0x4da43f[_0x7451('0x4e')]!==_0x7451('0x4f')){_0x552131[_0x7451('0xc4')]+=0x1;}if(_0x4da43f[_0x7451('0x32')]){_0x552131[_0x7451('0xc5')]+=0x1;_0x552131['sumBillable']+=moment()[_0x7451('0xc3')](0x0)[_0x7451('0xc1')](_0x4da43f[_0x7451('0xa8')],_0x7451('0x97'));_0x4da43f[_0x7451('0x7d')]=moment()[_0x7451('0x4a')](_0x7451('0x72'));_0x4da43f['queuecallerexit']=![];_0x4da43f[_0x7451('0x8f')]=null;}if(_0x4da43f[_0x7451('0x95')]&&_0x4da43f['transfer']!=!![]){_0x552131[_0x7451('0xc6')]+=0x1;_0x4da43f[_0x7451('0xc7')]=_0x7451('0xc6');logger[_0x7451('0x46')](_0x7451('0xc8'),_0x2840b3,util[_0x7451('0x3d')](_0x4da43f,{'showHidden':![],'depth':null}));ami[_0x7451('0x45')](_0x7451('0xc9'),_0x4da43f);}if(_0x4da43f[_0x7451('0x1e')]){_0x552131['abandoned']+=0x1;_0x4da43f[_0x7451('0xc7')]='abandoned';logger[_0x7451('0x46')](_0x7451('0xca'),_0x2840b3,util['inspect'](_0x4da43f,{'showHidden':![],'depth':null}));ami[_0x7451('0x45')](_0x7451('0xcb'),_0x4da43f);}}else{_0x552131['sumDuration']+=_0x552131['sumHoldTime'];}logger[_0x7451('0x76')](_0x7451('0xcc'),_0x2840b3,_0x4da43f[_0x7451('0x50')],_0x4da43f[_0x7451('0x53')],_0x1fced9);this[_0x7451('0x10')][_0x2840b3]=_0x4da43f;Object[_0x7451('0x78')](this['voiceQueues'][_0x4da43f[_0x7451('0x50')]],_0x552131);if(_0x4da43f[_0x7451('0xa8')]){this[_0x7451('0x43')](_0x4da43f,'hangup');}}}logger[_0x7451('0x46')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x2840b3,util[_0x7451('0x3d')](this[_0x7451('0xd')][_0x2840b3],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x4da43f)&&_0x4da43f[_0x7451('0x4e')]!==_0x7451('0x4f')){ami[_0x7451('0x45')](_0x7451('0xcd'),this[_0x7451('0xd')][_0x2840b3]);if(this['queueReports'][_0x2840b3]){delete this[_0x7451('0xd')][_0x2840b3];}if(this[_0x7451('0x10')][_0x2840b3]){delete this[_0x7451('0x10')][_0x2840b3];}if(this['variables'][_0x2840b3]){delete this[_0x7451('0x15')][_0x2840b3];}}}}catch(_0x43400d){logger['error']('[%s][voiceQueueReport][handleHangup]',_0x2840b3,util[_0x7451('0x3d')](_0x43400d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncHangup']=function(_0x51f61b){try{if(this[_0x7451('0x58')](_0x51f61b)){logger[_0x7451('0x46')](_0x7451('0xce'),_0x51f61b[_0x7451('0x49')],util[_0x7451('0x3d')](_0x51f61b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x51f61b[_0x7451('0x49')]]){return this[_0x7451('0xcf')](_0x51f61b['uniqueid'],_0x51f61b[_0x7451('0xd0')],![]);}if(this[_0x7451('0xd')][_0x51f61b[_0x7451('0x94')]]){if(_0x51f61b[_0x7451('0xd1')]==='21'){return;}return this[_0x7451('0xcf')](_0x51f61b[_0x7451('0x94')],_0x51f61b[_0x7451('0xd0')],!![]);}var _0x25e871=Object[_0x7451('0x7a')](this['queueReports']);for(var _0x3642bb=0x0;_0x3642bb<_0x25e871['length'];_0x3642bb++){var _0x2c3dcf=_['last'](this[_0x7451('0xd')][_0x25e871[_0x3642bb]]);if(_0x2c3dcf&&_0x2c3dcf[_0x7451('0xd2')]===_0x51f61b[_0x7451('0x49')]){return this['handleHangup'](_0x2c3dcf[_0x7451('0x49')],_0x51f61b[_0x7451('0xd0')],!![]);}}if(!this['queueReports'][_0x51f61b[_0x7451('0x49')]]){logger[_0x7451('0x46')](_0x7451('0xd3'),_0x51f61b[_0x7451('0x49')]);if(this['channels'][_0x51f61b[_0x7451('0x49')]]){delete this[_0x7451('0x10')][_0x51f61b[_0x7451('0x49')]];}if(this[_0x7451('0x15')][_0x51f61b[_0x7451('0x49')]]){delete this[_0x7451('0x15')][_0x51f61b['uniqueid']];}}}}catch(_0x40a5c4){logger[_0x7451('0x3c')](_0x7451('0xce'),_0x51f61b['uniqueid'],util[_0x7451('0x3d')](_0x40a5c4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0xd4')]=function(_0x38fb93){try{if(this['isNotNull'](_0x38fb93)){logger[_0x7451('0x46')]('[%s][voiceQueueReport][attendedtransfer]',_0x38fb93[_0x7451('0x49')],util[_0x7451('0x3d')](_0x38fb93,{'showHidden':![],'depth':null}));var _0x24df68;var _0x237c10;var _0x3d1d99;if(this[_0x7451('0xd')][_0x38fb93['transfereeuniqueid']]){_0x24df68=_['last'](this[_0x7451('0xd')][_0x38fb93[_0x7451('0xd5')]]);_0x24df68[_0x7451('0x9b')]=_0x38fb93[_0x7451('0xd6')];_0x24df68[_0x7451('0x9c')]=_0x38fb93['secondtransfereruniqueid'];_0x24df68[_0x7451('0x4e')]=_0x7451('0x4f');_0x24df68['transfer']=!![];_0x24df68[_0x7451('0x99')]=_0x7451('0xd7');if(this[_0x7451('0xd')][_0x38fb93[_0x7451('0xd8')]]){_0x3d1d99=this[_0x7451('0xd')][_0x38fb93[_0x7451('0xd8')]];this[_0x7451('0xd')][_0x38fb93[_0x7451('0xd8')]]=this['queueReports'][_0x38fb93[_0x7451('0xd5')]];this['queueReports'][_0x38fb93[_0x7451('0xd5')]]=_0x3d1d99;_0x237c10=_[_0x7451('0x83')](this[_0x7451('0xd')][_0x38fb93[_0x7451('0xd5')]]);_0x237c10['switch']=!![];}logger[_0x7451('0x76')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x38fb93['uniqueid'],_0x24df68[_0x7451('0x50')],_0x24df68[_0x7451('0x53')],_0x24df68['transferexten'],_0x24df68[_0x7451('0x9c')]);}else if(this[_0x7451('0xd')][_0x38fb93[_0x7451('0xd9')]]){_0x24df68=_['last'](this[_0x7451('0xd')][_0x38fb93[_0x7451('0xd9')]]);_0x24df68[_0x7451('0x9b')]=_0x38fb93[_0x7451('0xda')];_0x24df68['transferuniqueid']=_0x38fb93[_0x7451('0xdb')];_0x24df68['queuecallerexitreason']='ATTENDEDTRANSFER';_0x24df68[_0x7451('0x90')]=!![];_0x24df68[_0x7451('0x99')]=_0x7451('0xd7');if(this['queueReports'][_0x38fb93[_0x7451('0xdb')]]){_0x3d1d99=this['queueReports'][_0x38fb93[_0x7451('0xdb')]];this[_0x7451('0xd')][_0x38fb93[_0x7451('0xdb')]]=this['queueReports'][_0x38fb93['transfertargetuniqueid']];this[_0x7451('0xd')][_0x38fb93['transfertargetuniqueid']]=_0x3d1d99;_0x237c10=_[_0x7451('0x83')](this[_0x7451('0xd')][_0x38fb93[_0x7451('0xd9')]]);_0x237c10[_0x7451('0x34')]=!![];}logger[_0x7451('0x76')](_0x7451('0xdc'),_0x38fb93[_0x7451('0x49')],_0x24df68[_0x7451('0x50')],_0x24df68['type'],_0x24df68[_0x7451('0x9b')],_0x24df68[_0x7451('0x9c')]);}else if(this[_0x7451('0xd')][_0x38fb93['origtransfereruniqueid']]){_0x24df68=_[_0x7451('0x83')](this[_0x7451('0xd')][_0x38fb93['origtransfereruniqueid']]);_0x24df68[_0x7451('0x9b')]=_0x38fb93[_0x7451('0xda')];_0x24df68[_0x7451('0x9c')]=_0x38fb93['origtransfereruniqueid'];_0x24df68['queuecallerexitreason']=_0x7451('0x4f');_0x24df68[_0x7451('0x90')]=!![];_0x24df68[_0x7451('0x99')]=_0x7451('0xd7');_0x24df68['switch']=!![];_0x24df68[_0x7451('0xd2')]=_0x38fb93[_0x7451('0xd5')];}else if(this['queueReports'][_0x38fb93[_0x7451('0xd8')]]){_0x24df68=_[_0x7451('0x83')](this['queueReports'][_0x38fb93[_0x7451('0xd8')]]);_0x24df68[_0x7451('0x9b')]=_0x38fb93[_0x7451('0xd6')];_0x24df68[_0x7451('0x9c')]=_0x38fb93['secondtransfereruniqueid'];_0x24df68['queuecallerexitreason']=_0x7451('0x4f');_0x24df68['transfer']=!![];_0x24df68['transfertype']=_0x7451('0xd7');_0x24df68['switch']=!![];_0x24df68['transferid']=_0x38fb93[_0x7451('0xd9')];}}}catch(_0x5b41fd){logger[_0x7451('0x3c')](_0x7451('0xdd'),_0x38fb93[_0x7451('0x49')],util[_0x7451('0x3d')](_0x5b41fd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncBlindTransfer']=function(_0x40b217){try{if(this['isNotNull'](_0x40b217)){logger[_0x7451('0x46')](_0x7451('0xde'),_0x40b217[_0x7451('0x49')],util[_0x7451('0x3d')](_0x40b217,{'showHidden':![],'depth':null}));if(this[_0x7451('0xd')][_0x40b217[_0x7451('0xd5')]]){var _0x260637=_[_0x7451('0x83')](this['queueReports'][_0x40b217[_0x7451('0xd5')]]);_0x260637[_0x7451('0x4e')]=_0x7451('0xdf');_0x260637[_0x7451('0x90')]=!![];_0x260637[_0x7451('0x99')]=_0x7451('0xe0');_0x260637[_0x7451('0x9b')]=_0x40b217['extension'];_0x260637[_0x7451('0x9c')]=_0x40b217[_0x7451('0xd5')];logger[_0x7451('0x76')](_0x7451('0xe1'),_0x40b217[_0x7451('0x49')],_0x260637[_0x7451('0x50')],_0x260637[_0x7451('0x53')],_0x260637[_0x7451('0x9b')],_0x260637[_0x7451('0x9c')]);this[_0x7451('0x25')]({'event':_0x7451('0xe2'),'uniqueid':_0x40b217['transfereeuniqueid'],'context':_0x40b217[_0x7451('0xe3')],'channel':_0x40b217[_0x7451('0xe4')]});}}}catch(_0x6669b5){logger['error'](_0x7451('0xde'),_0x40b217['uniqueid'],util[_0x7451('0x3d')](_0x6669b5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0x28')]=function(_0x3370c6){try{if(this[_0x7451('0x58')](_0x3370c6)){logger[_0x7451('0x46')](_0x7451('0xe5'),_0x3370c6[_0x7451('0x49')],util['inspect'](_0x3370c6,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3370c6[_0x7451('0x49')]]){var _0x1da6f1=_[_0x7451('0x83')](this[_0x7451('0xd')][_0x3370c6[_0x7451('0x49')]]);if(!_[_0x7451('0x36')](_0x1da6f1[_0x7451('0xa8')])){_0x1da6f1['mohstarttime']=moment()[_0x7451('0x4a')](_0x7451('0x72'));logger[_0x7451('0x76')](_0x7451('0xe6'),_0x3370c6[_0x7451('0x49')],_0x1da6f1[_0x7451('0xe7')]);}}}}catch(_0x2802d4){logger[_0x7451('0x3c')]('[%s][voiceQueueReport][musiconholdstart]',_0x3370c6[_0x7451('0x49')],util['inspect'](_0x2802d4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')]['syncMusicOnHoldStop']=function(_0x4e1337){try{if(this[_0x7451('0x58')](_0x4e1337)){logger[_0x7451('0x46')]('[%s][voiceQueueReport][musiconholdstop]',_0x4e1337[_0x7451('0x49')],util[_0x7451('0x3d')](_0x4e1337,{'showHidden':![],'depth':null}));if(this[_0x7451('0xd')][_0x4e1337[_0x7451('0x49')]]){var _0x2742fd=_[_0x7451('0x83')](this['queueReports'][_0x4e1337[_0x7451('0x49')]]);if(!_[_0x7451('0x36')](_0x2742fd[_0x7451('0xe7')])){_0x2742fd[_0x7451('0xe8')]+=moment()[_0x7451('0xc3')](0x0)[_0x7451('0xc1')](_0x2742fd[_0x7451('0xe7')],'seconds');logger[_0x7451('0x76')](_0x7451('0xe9'),_0x4e1337[_0x7451('0x49')],_0x2742fd[_0x7451('0xe8')]);delete _0x2742fd['mohstarttime'];}}}}catch(_0xaa6957){logger[_0x7451('0x3c')](_0x7451('0xea'),_0x4e1337['uniqueid'],util[_0x7451('0x3d')](_0xaa6957,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7451('0x42')][_0x7451('0xeb')]=function(_0x5b7933){try{if(this[_0x7451('0x58')](_0x5b7933)){logger[_0x7451('0x46')](_0x7451('0xec'),_0x5b7933[_0x7451('0x49')],util[_0x7451('0x3d')](_0x5b7933,{'showHidden':![],'depth':null}));if(_0x5b7933[_0x7451('0xed')][_0x7451('0x93')]()===_0x7451('0xee')){_0x5b7933[_0x7451('0xef')]=_0x5b7933[_0x7451('0xf0')]&&_0x5b7933[_0x7451('0xf0')][_0x7451('0xf1')]('CDR(routeAlias)')?_0x5b7933[_0x7451('0xf0')]:(_0x5b7933[_0x7451('0xf0')]||_0x5b7933[_0x7451('0xef')])[_0x7451('0x93')]();if(_[_0x7451('0xf1')](_0x5b7933[_0x7451('0xef')][_0x7451('0x93')](),_0x7451('0xf2'))){logger[_0x7451('0x76')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x5b7933[_0x7451('0x49')],_0x5b7933['application'],_0x5b7933[_0x7451('0xef')]);if(_['isUndefined'](this[_0x7451('0x10')][_0x5b7933[_0x7451('0x49')]]))this[_0x7451('0x10')][_0x5b7933[_0x7451('0x49')]]={};var _0x1fda3e=_0x5b7933[_0x7451('0xef')][_0x7451('0xf3')]('=');var _0x2579a6=_0x1fda3e[0x0][_0x7451('0x93')]()['match'](/cdr\((.*)\)/);if(_0x2579a6)this[_0x7451('0x10')][_0x5b7933['uniqueid']][_0x2579a6[0x1]]=_0x1fda3e[0x1];}}}}catch(_0x54e5fc){logger[_0x7451('0x3c')]('[%s][voiceQueueReport][newexten]',_0x5b7933[_0x7451('0x49')],util['inspect'](_0x54e5fc,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file