517261cee90ab9d96d9e7ab768ffd25bea73be8d
[motion2.git] / server / services / ami / report / voiceQueueReport.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x45f8=['connectedlinenum','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','local/','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','linkedid','COMPLETEDBY','toUpperCase','[%s][voiceQueueReport][varset]','addVariable','keys','variable','CONTINUE','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','value','rtpaudioqos','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','membercalls','memberpenalty','includes','handleHangup','length','sumHoldTime','ATTENDEDTRANSFER','sumDuration','total','answered','sumBillable','milliseconds','diff','queuecallercompleteAt','unmanaged','custom:queuecallerunmanaged','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','cause-txt','transferid','deleteChannelAfterTimeout','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','transferuniqueid','secondtransfereruniqueid','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','ATTENDED','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','toLowerCase','set','applicationdata','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','[%s][voiceQueueReport][newexten]','lodash','util','ioredis','../../../config/environment','../../../config/logger','../ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','queueReports','agents','channels','queueChannels','voiceQueues','campaigns','summary','variables','queuesummary','queuesummarycomplete','bind','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','queuecallercomplete','isNil','Action','status','channel','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emit','debug','uniqueid','format','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove','[%s][voiceQueueReport][','queuecallerexitreason','voice:queue:%s','queue','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','type','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','isUndefined','clearZombieChannels','queues','catch','isRunning','then','actionid','queuestatus','[voiceQueueReport][queuesummary]','createQueueSummaryReport','summaryEvent','realtime','handleInboundQueueSummaryReport','compareToInboundQueue','outbound','custom:queuesummary','syncQueueSummaryComplete','push','isNotNull','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','statusRequests','completeEvent','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','info','assign','pick','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerabandon]','last','holdtime','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s'];(function(_0x38921b,_0x5a7908){var _0x10355a=function(_0x5aab6f){while(--_0x5aab6f){_0x38921b['push'](_0x38921b['shift']());}};_0x10355a(++_0x5a7908);}(_0x45f8,0x152));var _0x845f=function(_0x2067e9,_0x5e6a97){_0x2067e9=_0x2067e9-0x0;var _0x280ce4=_0x45f8[_0x2067e9];return _0x280ce4;};'use strict';var _=require(_0x845f('0x0'));var moment=require('moment');var util=require(_0x845f('0x1'));var Redis=require(_0x845f('0x2'));var config=require(_0x845f('0x3'));var logger=require(_0x845f('0x4'))('ami');var ami=require(_0x845f('0x5'));var QueueReport=require(_0x845f('0x6'));var VoiceQueueSummary=require(_0x845f('0x7'));config[_0x845f('0x8')]=_[_0x845f('0x9')](config[_0x845f('0x8')],{'host':_0x845f('0xa'),'port':0x18eb});var io=require(_0x845f('0xb'))(new Redis(config[_0x845f('0x8')]));var Sequence=function(){};Sequence[_0x845f('0xc')][_0x845f('0xd')]=function(_0x42f172){this[_0x845f('0xe')]=this[_0x845f('0xe')]?this[_0x845f('0xe')]['finally'](_0x42f172):_0x42f172();};function VoiceQueueReport(_0x32ec65){this[_0x845f('0xf')]=new Sequence();this[_0x845f('0x10')]={};this['realtime']=_0x32ec65;this['agents']=_0x32ec65[_0x845f('0x11')];this[_0x845f('0x12')]=_0x32ec65[_0x845f('0x13')];this[_0x845f('0x14')]=_0x32ec65['voiceQueues'];this[_0x845f('0x15')]=_0x32ec65[_0x845f('0x15')];this[_0x845f('0x16')]=initializeSummary();this[_0x845f('0x17')]={};ami['on'](_0x845f('0x18'),this['syncQueueSummary']['bind'](this));ami['on'](_0x845f('0x19'),this['syncQueueSummaryComplete'][_0x845f('0x1a')](this));ami['on']('queuemember',this[_0x845f('0x1b')]['bind'](this));ami['on'](_0x845f('0x1c'),this[_0x845f('0x1d')][_0x845f('0x1a')](this));ami['on'](_0x845f('0x1e'),this[_0x845f('0x1f')]['bind'](this));ami['on'](_0x845f('0x20'),this[_0x845f('0x21')][_0x845f('0x1a')](this));ami['on'](_0x845f('0x22'),this['syncQueueCallerLeave'][_0x845f('0x1a')](this));ami['on']('agentcomplete',this[_0x845f('0x23')][_0x845f('0x1a')](this));ami['on']('agentconnect',this['syncAgentConnect']['bind'](this));ami['on'](_0x845f('0x24'),this[_0x845f('0x25')][_0x845f('0x1a')](this));ami['on'](_0x845f('0x26'),this[_0x845f('0x27')]['bind'](this));ami['on'](_0x845f('0x28'),this['syncFullyBooted'][_0x845f('0x1a')](this));ami['on'](_0x845f('0x29'),this[_0x845f('0x2a')][_0x845f('0x1a')](this));ami['on'](_0x845f('0x2b'),this[_0x845f('0x2c')][_0x845f('0x1a')](this));ami['on'](_0x845f('0x2d'),this['syncAttendedTransfer'][_0x845f('0x1a')](this));ami['on'](_0x845f('0x2e'),this[_0x845f('0x2f')][_0x845f('0x1a')](this));this[_0x845f('0x30')]();this['loopQueueShow']();}function clearChannels(_0x5469b2){if(!_[_0x845f('0x31')](_0x5469b2)){for(var _0x532f97 in _0x5469b2){if(_0x5469b2[_0x845f('0x32')](_0x532f97)){delete _0x5469b2[_0x532f97];}}}}function clearCampaigns(_0x2d6594){if(!_[_0x845f('0x31')](_0x2d6594)){for(var _0x20c6f2 in _0x2d6594){if(_0x2d6594[_0x845f('0x32')](_0x20c6f2)){_0x2d6594[_0x20c6f2][_0x845f('0x33')]=0x0;}}}}function clearVoiceQueues(_0x46d009){if(!_[_0x845f('0x31')](_0x46d009)){for(var _0x35ff08 in _0x46d009){if(_0x46d009[_0x845f('0x32')](_0x35ff08)){_0x46d009[_0x35ff08]['originated']=0x0;_0x46d009[_0x35ff08][_0x845f('0x34')]=0x0;_0x46d009[_0x35ff08][_0x845f('0x35')]=0x0;_0x46d009[_0x35ff08][_0x845f('0x36')]=0x0;_0x46d009[_0x35ff08][_0x845f('0x37')]=!![];}}}}function clearAgentBooked(_0x1a62e7){if(!_[_0x845f('0x31')](_0x1a62e7)){for(var _0x198296 in _0x1a62e7){if(_0x1a62e7[_0x845f('0x32')](_0x198296)){_0x1a62e7[_0x198296]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x39e9ad){return _0x39e9ad['queuecallerexit']||_0x39e9ad[_0x845f('0x20')]||_0x39e9ad[_0x845f('0x38')];}VoiceQueueReport[_0x845f('0xc')]['clearZombieChannels']=function(){var _0x308774=this;for(var _0x2b3291 in this['channels']){if(this['channels'][_0x845f('0x32')](_0x2b3291)&&!this[_0x845f('0x12')][_0x2b3291]['switch']){this[_0x845f('0xf')][_0x845f('0xd')](function(){if(!_[_0x845f('0x39')](_0x308774['channels'][_0x2b3291])){return ami[_0x845f('0x3a')]({'action':_0x845f('0x3b'),'channel':_0x308774['channels'][_0x2b3291][_0x845f('0x3c')]})['catch'](function(_0x2d34bf){if(_0x2d34bf[_0x845f('0x3d')]===_0x845f('0x3e')){setTimeout(function(){if(_0x308774[_0x845f('0x12')][_0x2b3291]){delete _0x308774['channels'][_0x2b3291];logger[_0x845f('0x3f')](_0x845f('0x40'),_0x2b3291,util[_0x845f('0x41')](_0x2d34bf,{'showHidden':![],'depth':null}));}if(_0x308774[_0x845f('0x10')][_0x2b3291]){delete _0x308774[_0x845f('0x10')][_0x2b3291];logger[_0x845f('0x3f')](_0x845f('0x42'),_0x2b3291,util['inspect'](_0x2d34bf,{'showHidden':![],'depth':null}));}if(_0x308774[_0x845f('0x17')][_0x2b3291]){delete _0x308774[_0x845f('0x17')][_0x2b3291];logger['error'](_0x845f('0x43'),_0x2b3291,util['inspect'](_0x2d34bf,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x845f('0xc')][_0x845f('0x44')]=function(){logger[_0x845f('0x3f')](_0x845f('0x45'));clearChannels(this[_0x845f('0x12')]);this[_0x845f('0x46')](this['queueReports']);clearAgentBooked(this[_0x845f('0x11')]);clearVoiceQueues(this[_0x845f('0x14')]);clearCampaigns(this[_0x845f('0x15')]);this[_0x845f('0x16')]=initializeSummary();};VoiceQueueReport[_0x845f('0xc')]['clearQueueReport']=function(_0x28e12d){var _0x493828=this;if(!_[_0x845f('0x31')](_0x28e12d)){for(var _0x5aadeb in _0x28e12d){if(_0x28e12d[_0x845f('0x32')](_0x5aadeb)){_0x493828['emitVoiceQueueChannelRemove'](_0x28e12d[_0x5aadeb],'clearqueuereport');delete _0x28e12d[_0x5aadeb];}}}};VoiceQueueReport['prototype']['emit']=function(_0x53e620,_0x2087ed,_0xa835d4){io['to'](_0x53e620)[_0x845f('0x47')](_0x2087ed,_0xa835d4);};VoiceQueueReport[_0x845f('0xc')]['emitVoiceQueueChannelSave']=function(_0x39cfc2,_0x5ac046){logger[_0x845f('0x48')]('[%s][voiceQueueReport]['+_0x5ac046+']\x20sending\x20voice_queue_channel:save\x20event:',_0x39cfc2[_0x845f('0x49')],util[_0x845f('0x41')](_0x39cfc2,{'showHidden':![],'depth':null}));this['emit'](util[_0x845f('0x4a')]('voice:queue:%s',_0x39cfc2['queue']),_0x845f('0x4b'),_0x39cfc2);io['emit'](_0x845f('0x4c'),_0x39cfc2);};VoiceQueueReport['prototype'][_0x845f('0x4d')]=function(_0x470214,_0x4c0506){logger[_0x845f('0x48')](_0x845f('0x4e')+_0x4c0506+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x470214[_0x845f('0x49')],util['inspect'](_0x470214,{'showHidden':![],'depth':null}));if(_0x470214[_0x845f('0x4f')]==='ATTENDEDTRANSFER'){return;}this['emit'](util[_0x845f('0x4a')](_0x845f('0x50'),_0x470214[_0x845f('0x51')]),_0x845f('0x52'),_0x470214);io[_0x845f('0x47')](_0x845f('0x53'),_0x470214);};VoiceQueueReport[_0x845f('0xc')][_0x845f('0x54')]=function(_0x1d82e8){if(_0x1d82e8[_0x845f('0x55')]===_0x845f('0x56')){logger['debug'](_0x845f('0x57'),util['inspect'](_0x1d82e8,{'showHidden':![],'depth':null}));this[_0x845f('0x47')](util[_0x845f('0x4a')](_0x845f('0x50'),_0x1d82e8[_0x845f('0x58')]),'voice_queue:save',_0x1d82e8);}};VoiceQueueReport['prototype']['isNotNull']=function(_0x41658f){return _0x41658f!==null&&!_[_0x845f('0x59')](_0x41658f);};VoiceQueueReport[_0x845f('0xc')]['loopQueueShow']=function(){var _0x11a3cb=this;setInterval(function(){_0x11a3cb[_0x845f('0x5a')]();ami[_0x845f('0x3a')]({'action':_0x845f('0x5b')})[_0x845f('0x5c')](function(_0x64111e){logger[_0x845f('0x3f')]('[voiceQueueReport][queues]',util[_0x845f('0x41')](_0x64111e,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x845f('0xc')][_0x845f('0x30')]=function(){var _0x121162=this;setInterval(function(){if(!_0x121162[_0x845f('0x16')][_0x845f('0x5d')]){return ami[_0x845f('0x3a')]({'action':_0x845f('0x18')})[_0x845f('0x5e')](function(_0x4ce6c6){_0x121162['summary']['id']=_0x4ce6c6[_0x845f('0x5f')];_0x121162[_0x845f('0x16')][_0x845f('0x5d')]=!![];_0x121162[_0x845f('0x16')][_0x845f('0x60')][_0x4ce6c6[_0x845f('0x5f')]]={};})[_0x845f('0x5c')](function(_0x26b669){logger['error'](_0x845f('0x61'),util[_0x845f('0x41')](_0x26b669,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x845f('0xc')][_0x845f('0x62')]=function(_0x47f11e,_0x13b636){var _0x4134c7;if(this['summary']&&this[_0x845f('0x16')]['queues']&&this[_0x845f('0x16')]['queues'][_0x47f11e[_0x845f('0x58')]]){_0x4134c7=this[_0x845f('0x16')][_0x845f('0x5b')][_0x47f11e[_0x845f('0x58')]][_0x845f('0x63')];}var _0x54356e=new VoiceQueueSummary(_0x47f11e);return _0x54356e['createReport'](_0x13b636[_0x845f('0x11')],this[_0x845f('0x11')],_0x4134c7,this[_0x845f('0x64')][_0x845f('0x12')]);};VoiceQueueReport[_0x845f('0xc')][_0x845f('0x65')]=function(_0x4aea52,_0x130285){var _0x27f25d=this[_0x845f('0x62')](_0x4aea52,_0x130285);var _0x1ec5ef=![];_0x1ec5ef=_0x27f25d[_0x845f('0x66')](_0x4aea52);if(_0x1ec5ef){Object['assign'](_0x4aea52,_0x27f25d);this['realtime']['voiceQueues'][_0x4aea52[_0x845f('0x58')]]=_0x4aea52;this[_0x845f('0x54')](_0x27f25d);}};VoiceQueueReport[_0x845f('0xc')][_0x845f('0x1d')]=function(_0x475217){var _0x4bec4=null;var _0x16daf5=this[_0x845f('0x16')]['id'];if(this[_0x845f('0x16')]['queuestatus'][_0x16daf5]){_0x4bec4=this[_0x845f('0x16')]['queuestatus'][_0x16daf5][_0x475217[_0x845f('0x5f')]];}if(!_0x4bec4){this[_0x845f('0x16')]=initializeSummary();return;}var _0x596759=this[_0x845f('0x14')][_0x4bec4[_0x845f('0x51')]];if(_0x596759[_0x845f('0x55')]===_0x845f('0x56')){this[_0x845f('0x65')](_0x596759,_0x4bec4);}else if(_0x596759[_0x845f('0x55')]===_0x845f('0x67')){var _0x31fb9b=this[_0x845f('0x62')](_0x596759,_0x4bec4);ami['emit'](_0x845f('0x68'),_0x31fb9b);}this['summary']['statusRequests']-=0x1;var _0x119031=this[_0x845f('0x16')]['statusRequests']>0x0?!![]:![];if(!_0x119031){return this[_0x845f('0x69')](this[_0x845f('0x16')]['completeEvent']);}};VoiceQueueReport[_0x845f('0xc')][_0x845f('0x1b')]=function(_0xda5369){var _0x457206=this[_0x845f('0x16')]['id'];if(this[_0x845f('0x16')]['queuestatus'][_0x457206]&&this[_0x845f('0x16')]['queuestatus'][_0x457206][_0xda5369[_0x845f('0x5f')]]){this[_0x845f('0x16')][_0x845f('0x60')][_0x457206][_0xda5369['actionid']]['agents'][_0x845f('0x6a')](_0xda5369);}};VoiceQueueReport['prototype']['syncQueueSummary']=function(_0x3a6476){var _0x5cade2=this;try{if(this[_0x845f('0x6b')](_0x3a6476)&&this[_0x845f('0x6b')](_0x3a6476[_0x845f('0x51')])){logger['debug'](_0x845f('0x6c'),util[_0x845f('0x41')](_0x3a6476,{'showHidden':![],'depth':null}));var _0x474025=this[_0x845f('0x14')][_0x3a6476[_0x845f('0x51')]];if(_0x474025){logger[_0x845f('0x48')](_0x845f('0x6d'),_0x474025['name']);this['summary'][_0x845f('0x5b')][_0x474025[_0x845f('0x58')]]={'summaryEvent':_0x3a6476};this[_0x845f('0x16')][_0x845f('0x6e')]+=0x1;return ami[_0x845f('0x3a')]({'action':_0x845f('0x60'),'queue':_0x474025['name']})[_0x845f('0x5e')](function(_0x21a9f2){if(!_0x5cade2[_0x845f('0x16')][_0x845f('0x60')][_0x3a6476[_0x845f('0x5f')]]){_0x5cade2[_0x845f('0x16')][_0x845f('0x60')][_0x3a6476[_0x845f('0x5f')]]={};}_0x5cade2[_0x845f('0x16')][_0x845f('0x60')][_0x3a6476[_0x845f('0x5f')]][_0x21a9f2[_0x845f('0x5f')]]={'queue':_0x474025[_0x845f('0x58')],'agents':[]};})[_0x845f('0x5c')](function(_0x5b2f6f){throw _0x5b2f6f;});}}}catch(_0x59eadb){logger['error'](_0x845f('0x61'),util[_0x845f('0x41')](_0x59eadb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x4fee85){if(this[_0x845f('0x16')]['statusRequests']>0x0){this[_0x845f('0x16')][_0x845f('0x6f')]=_0x4fee85;return;}logger[_0x845f('0x48')](_0x845f('0x70'),util['inspect'](_0x4fee85,{'showHidden':![],'depth':null}));this[_0x845f('0x16')]=initializeSummary();ami[_0x845f('0x47')](_0x845f('0x71'),{});};VoiceQueueReport['prototype'][_0x845f('0x1f')]=function(_0x477f1a){try{if(this[_0x845f('0x6b')](_0x477f1a)){logger[_0x845f('0x48')](_0x845f('0x72'),_0x477f1a[_0x845f('0x49')],util[_0x845f('0x41')](_0x477f1a,{'showHidden':![],'depth':null}));if(_[_0x845f('0x59')](this[_0x845f('0x10')][_0x477f1a[_0x845f('0x49')]])){this[_0x845f('0x10')][_0x477f1a['uniqueid']]=[];}if(_[_0x845f('0x59')](this['channels'][_0x477f1a[_0x845f('0x49')]])){this[_0x845f('0x12')][_0x477f1a[_0x845f('0x49')]]={};}var _0x5e5640=new QueueReport();_0x5e5640['queue']=_0x477f1a[_0x845f('0x51')];_0x5e5640[_0x845f('0x55')]=this[_0x845f('0x14')][_0x5e5640['queue']]&&this[_0x845f('0x14')][_0x5e5640[_0x845f('0x51')]]['type']?this['voiceQueues'][_0x5e5640[_0x845f('0x51')]][_0x845f('0x55')]||_0x845f('0x56'):'inbound';_0x5e5640[_0x845f('0x73')]=moment()['format'](_0x845f('0x74'));_0x5e5640[_0x845f('0x75')]=_0x477f1a[_0x845f('0x75')];_0x5e5640[_0x845f('0x76')]=_0x477f1a['count'];_0x5e5640['uniqueid']=_0x477f1a['uniqueid'];logger[_0x845f('0x77')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x5e5640[_0x845f('0x51')],_0x5e5640['type']);Object[_0x845f('0x78')](_0x5e5640,_[_0x845f('0x79')](_0x477f1a,_['keys'](_0x5e5640)));this['queueReports'][_0x477f1a['uniqueid']][_0x845f('0x6a')](_0x5e5640);this['channels'][_0x477f1a[_0x845f('0x49')]]=_0x5e5640;this[_0x845f('0x7a')](_0x5e5640,_0x845f('0x1e'));}}catch(_0x1c9c47){logger[_0x845f('0x3f')](_0x845f('0x72'),_0x477f1a[_0x845f('0x49')],util[_0x845f('0x41')](_0x1c9c47,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x845f('0xc')][_0x845f('0x21')]=function(_0x51b3fa){try{if(this[_0x845f('0x6b')](_0x51b3fa)){logger['debug'](_0x845f('0x7b'),_0x51b3fa['uniqueid'],util['inspect'](_0x51b3fa,{'showHidden':![],'depth':null}));if(this[_0x845f('0x10')][_0x51b3fa[_0x845f('0x49')]]){var _0x509ab5=_[_0x845f('0x7c')](this[_0x845f('0x10')][_0x51b3fa[_0x845f('0x49')]]);_0x509ab5[_0x845f('0x38')]=![];_0x509ab5['queuecallercompleteAt']=null;_0x509ab5[_0x845f('0x7d')]=_0x51b3fa['holdtime'];_0x509ab5['originalposition']=_0x51b3fa['originalposition'];_0x509ab5['queuecallerabandon']=!![];_0x509ab5[_0x845f('0x7e')]=moment()[_0x845f('0x4a')](_0x845f('0x74'));_0x509ab5['queuecallerexitreason']=_0x845f('0x7f');_0x509ab5[_0x845f('0x80')]=null;logger[_0x845f('0x77')](_0x845f('0x81'),_0x509ab5[_0x845f('0x51')],_0x509ab5[_0x845f('0x55')]);this['channels'][_0x51b3fa[_0x845f('0x49')]]=_0x509ab5;this[_0x845f('0x4d')](_0x509ab5,_0x845f('0x20'));}}}catch(_0xf203c2){logger[_0x845f('0x3f')](_0x845f('0x7b'),_0x51b3fa[_0x845f('0x49')],util['inspect'](_0xf203c2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x845f('0xc')]['syncQueueCallerLeave']=function(_0x1aa91e){try{if(this['isNotNull'](_0x1aa91e)){logger[_0x845f('0x48')]('[%s][voiceQueueReport][queuecallerleave]',_0x1aa91e[_0x845f('0x49')],util[_0x845f('0x41')](_0x1aa91e,{'showHidden':![],'depth':null}));if(this[_0x845f('0x10')][_0x1aa91e[_0x845f('0x49')]]){var _0x1f46df=_['last'](this[_0x845f('0x10')][_0x1aa91e['uniqueid']]);_0x1f46df['queuecallerleaveAt']=moment()[_0x845f('0x4a')](_0x845f('0x74'));_0x1f46df[_0x845f('0x82')]=_0x1aa91e[_0x845f('0x82')];_0x1f46df['connectedlinename']=_0x1aa91e['connectedlinename'];logger[_0x845f('0x77')](_0x845f('0x83'),_0x1f46df[_0x845f('0x51')],_0x1f46df[_0x845f('0x55')],_0x1aa91e[_0x845f('0x82')],_0x1aa91e[_0x845f('0x84')]);this[_0x845f('0x12')][_0x1aa91e[_0x845f('0x49')]]=_0x1f46df;this[_0x845f('0x7a')](_0x1f46df,_0x845f('0x22'));}}}catch(_0x4a0b80){logger[_0x845f('0x3f')]('[%s][voiceQueueReport][queuecallerleave]',_0x1aa91e[_0x845f('0x49')],util[_0x845f('0x41')](_0x4a0b80,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x845f('0xc')][_0x845f('0x85')]=function(_0xd7d789){try{if(this[_0x845f('0x6b')](_0xd7d789)){logger['debug'](_0x845f('0x86'),_0xd7d789['uniqueid'],util[_0x845f('0x41')](_0xd7d789,{'showHidden':![],'depth':null}));if(this[_0x845f('0x10')][_0xd7d789[_0x845f('0x49')]]){var _0x4ee60a=_[_0x845f('0x7c')](this['queueReports'][_0xd7d789[_0x845f('0x49')]]);_0x4ee60a['queuecallercomplete']=!![];_0x4ee60a[_0x845f('0x4f')]=_0x845f('0x87');logger[_0x845f('0x77')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x4ee60a['queue'],_0x4ee60a[_0x845f('0x55')]);}}}catch(_0x7bdb54){logger['error'](_0x845f('0x86'),_0xd7d789[_0x845f('0x49')],util[_0x845f('0x41')](_0x7bdb54,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x1a35ac){try{if(this['isNotNull'](_0x1a35ac)){logger[_0x845f('0x48')](_0x845f('0x88'),_0x1a35ac[_0x845f('0x49')],util[_0x845f('0x41')](_0x1a35ac,{'showHidden':![],'depth':null}));if(this[_0x845f('0x10')][_0x1a35ac[_0x845f('0x49')]]){var _0xc56fb4=_[_0x845f('0x7c')](this[_0x845f('0x10')][_0x1a35ac['uniqueid']]);_0xc56fb4[_0x845f('0x20')]=![];_0xc56fb4[_0x845f('0x7e')]=null;_0xc56fb4[_0x845f('0x89')]=!![];_0xc56fb4['lastAssignedTo']=_0x1a35ac[_0x845f('0x8a')];_0xc56fb4[_0x845f('0x7d')]=_0x1a35ac[_0x845f('0x7d')];_0xc56fb4[_0x845f('0x38')]=!![];_0xc56fb4[_0x845f('0x8b')]=![];_0xc56fb4[_0x845f('0x8c')]=null;if(!_0xc56fb4[_0x845f('0x8d')]){if(_0x1a35ac[_0x845f('0x8e')]=='transfer'){_0xc56fb4[_0x845f('0x4f')]=_0x845f('0x8f');logger[_0x845f('0x77')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0xc56fb4['queue'],_0xc56fb4[_0x845f('0x55')]);}else{if(_[_0x845f('0x90')](_0x1a35ac[_0x845f('0x3c')]['toLowerCase'](),_0x845f('0x91'))){if(this[_0x845f('0x10')][_0x1a35ac['linkedid']]){var _0x395111=_[_0x845f('0x7c')](this[_0x845f('0x10')][_0x1a35ac['linkedid']]);_0x395111[_0x845f('0x38')]=![];_0x395111[_0x845f('0x8b')]=!![];_0x395111['queuecallerexitAt']=moment(_0xc56fb4[_0x845f('0x73')])[_0x845f('0x92')](_0x1a35ac[_0x845f('0x7d')],_0x845f('0x93'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x395111[_0x845f('0x4f')]=_0x845f('0x94');_0x395111['transfer']=!![];_0x395111[_0x845f('0x95')]=_0x845f('0x96');_0x395111[_0x845f('0x97')]=_0x1a35ac[_0x845f('0x98')];_0x395111['transferuniqueid']=_0x1a35ac[_0x845f('0x49')];logger[_0x845f('0x77')](_0x845f('0x99'),_0x395111[_0x845f('0x51')],_0x395111[_0x845f('0x55')]);var _0x4784ea=this[_0x845f('0x10')][_0x1a35ac[_0x845f('0x9a')]];this[_0x845f('0x10')][_0x1a35ac[_0x845f('0x9a')]]=this[_0x845f('0x10')][_0x1a35ac[_0x845f('0x49')]];this[_0x845f('0x10')][_0x1a35ac[_0x845f('0x49')]]=_0x4784ea;}}else{_0xc56fb4[_0x845f('0x4f')]=_0x845f('0x9b')+_0x1a35ac[_0x845f('0x8e')][_0x845f('0x9c')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0xc56fb4[_0x845f('0x51')],_0xc56fb4[_0x845f('0x55')],_0xc56fb4['queuecallerexitreason']);}}}this['channels'][_0x1a35ac[_0x845f('0x49')]]=_0xc56fb4;}}}catch(_0x21e9bd){logger['error'](_0x845f('0x88'),_0x1a35ac['uniqueid'],util[_0x845f('0x41')](_0x21e9bd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x845f('0xc')][_0x845f('0x25')]=function(_0x11006f){try{if(this[_0x845f('0x6b')](_0x11006f)){logger[_0x845f('0x48')](_0x845f('0x9d'),_0x11006f[_0x845f('0x49')],util[_0x845f('0x41')](_0x11006f,{'showHidden':![],'depth':null}));this[_0x845f('0x9e')](_0x11006f[_0x845f('0x49')],_[_0x845f('0x9f')](_0x11006f[_0x845f('0xa0')])[0x0],_0x11006f['value']);if(this['queueReports'][_0x11006f['uniqueid']]){var _0x440954=_['last'](this[_0x845f('0x10')][_0x11006f[_0x845f('0x49')]]);if(_0x440954){if(this[_0x845f('0x6b')](_0x11006f['variable'])&&this[_0x845f('0x6b')](_0x11006f['variable'][_0x845f('0x60')])){switch(_0x11006f['value']){case _0x845f('0xa1'):_0x440954['queuecallerexit']=![];_0x440954[_0x845f('0x8c')]=null;break;case _0x845f('0xa2'):_0x440954[_0x845f('0xa3')]=_0x845f('0xa4');_0x440954[_0x845f('0x8b')]=!![];_0x440954[_0x845f('0x8c')]=moment()[_0x845f('0x4a')](_0x845f('0x74'));_0x440954[_0x845f('0xa5')]=moment()['format'](_0x845f('0x74'));logger[_0x845f('0x48')](_0x845f('0xa6'),_0x11006f[_0x845f('0x49')],util[_0x845f('0x41')](_0x440954,{'showHidden':![],'depth':null}));ami['emit'](_0x845f('0xa7'),_0x440954);break;default:_0x440954['queuecallerexit']=!![];_0x440954['queuecallerexitAt']=moment()[_0x845f('0x4a')](_0x845f('0x74'));_0x440954['queuecallerleaveAt']=moment()[_0x845f('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');}_0x440954[_0x845f('0x20')]=![];_0x440954[_0x845f('0x7e')]=null;_0x440954[_0x845f('0x4f')]=_0x11006f['value'];this[_0x845f('0x12')][_0x11006f[_0x845f('0x49')]]=_0x440954;this['emitVoiceQueueChannelRemove'](_0x440954,_0x845f('0x24'));}else if(this['isNotNull'](_0x11006f[_0x845f('0xa0')])&&this[_0x845f('0x6b')](_0x11006f[_0x845f('0xa0')][_0x845f('0xa8')])){if(!_0x440954['queuecallerabandon']){_0x440954[_0x845f('0x8b')]=!![];_0x440954[_0x845f('0x8c')]=moment()[_0x845f('0x4a')](_0x845f('0x74'));_0x440954[_0x845f('0x4f')]='EXITWITHKEY';_0x440954[_0x845f('0xa5')]=moment()['format'](_0x845f('0x74'));this[_0x845f('0x12')][_0x11006f[_0x845f('0x49')]]=_0x440954;}}logger[_0x845f('0x77')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x11006f['uniqueid'],_0x440954['queue'],_0x440954[_0x845f('0x55')],_[_0x845f('0x9f')](_0x11006f[_0x845f('0xa0')])[0x0],_0x11006f[_0x845f('0xa9')]);_0x440954['variables']=this[_0x845f('0x17')][_0x11006f[_0x845f('0x49')]];}}}}catch(_0x432a79){logger['error'](_0x845f('0x9d'),_0x11006f['uniqueid'],util[_0x845f('0x41')](_0x432a79,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x845f('0xc')]['addVariable']=function(_0xd71206,_0x58983e,_0xde02a8){var _0x132e01=[_0x845f('0xaa'),'rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x845f('0xab'),'rtpaudioqoslossbridged',_0x845f('0xac'),_0x845f('0xad'),'sipcallid','sipuri',_0x845f('0xae'),_0x845f('0xaf'),_0x845f('0xb0'),'memberdynamic','memberinterface','memberlastcall',_0x845f('0x8a'),_0x845f('0xb1'),'memberrealtime'];if(!_[_0x845f('0x39')](_0x58983e)&&!_[_0x845f('0xb2')](_0x132e01,_0x58983e)){if(_[_0x845f('0x59')](this[_0x845f('0x17')][_0xd71206])){this[_0x845f('0x17')][_0xd71206]={};}this[_0x845f('0x17')][_0xd71206][_0x58983e]=_0xde02a8;}};VoiceQueueReport[_0x845f('0xc')][_0x845f('0xb3')]=function(_0x3a1445,_0xc28872,_0x2ad668){try{var _0x302718={};if(this['queueReports'][_0x3a1445]){for(var _0x20ecb5=0x0;_0x20ecb5<this[_0x845f('0x10')][_0x3a1445][_0x845f('0xb4')];_0x20ecb5+=0x1){_0x302718=this['queueReports'][_0x3a1445][_0x20ecb5];var _0x4934e2=this[_0x845f('0x14')][_0x302718[_0x845f('0x51')]];if(_0x4934e2){_0x4934e2[_0x845f('0xb5')]+=moment(_0x302718['queuecallerleaveAt'])['diff'](_0x302718[_0x845f('0x73')],_0x845f('0x93'))||0x0;if(_0x2ad668&&_0x302718['queuecallerexitreason']===_0x845f('0xb6')){_0x302718[_0x845f('0x4f')]=_0x845f('0x87');}if(_0x20ecb5===this[_0x845f('0x10')][_0x3a1445]['length']-0x1){_0x4934e2[_0x845f('0xb7')]+=moment()['milliseconds'](0x0)['diff'](_0x302718['queuecallerjoinAt'],_0x845f('0x93'));if(hasCallerLeftTheQueue(_0x302718)&&_0x302718['queuecallerexitreason']!==_0x845f('0xb6')){_0x4934e2[_0x845f('0xb8')]+=0x1;}if(_0x302718['queuecallercomplete']){_0x4934e2[_0x845f('0xb9')]+=0x1;_0x4934e2[_0x845f('0xba')]+=moment()[_0x845f('0xbb')](0x0)[_0x845f('0xbc')](_0x302718[_0x845f('0xa5')],_0x845f('0x93'));_0x302718[_0x845f('0xbd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x302718[_0x845f('0x8b')]=![];_0x302718[_0x845f('0x8c')]=null;}if(_0x302718[_0x845f('0x8b')]&&_0x302718[_0x845f('0x8d')]!=!![]){_0x4934e2[_0x845f('0xbe')]+=0x1;_0x302718[_0x845f('0xa3')]=_0x845f('0xbe');logger[_0x845f('0x48')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x3a1445,util[_0x845f('0x41')](_0x302718,{'showHidden':![],'depth':null}));ami[_0x845f('0x47')](_0x845f('0xbf'),_0x302718);}if(_0x302718[_0x845f('0x20')]){_0x4934e2[_0x845f('0xc0')]+=0x1;_0x302718['lastevent']=_0x845f('0xc0');logger['debug'](_0x845f('0xc1'),_0x3a1445,util[_0x845f('0x41')](_0x302718,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerabandon',_0x302718);}}else{_0x4934e2[_0x845f('0xb7')]+=_0x4934e2[_0x845f('0xb5')];}logger[_0x845f('0x77')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x3a1445,_0x302718['queue'],_0x302718['type'],_0xc28872);this[_0x845f('0x12')][_0x3a1445]=_0x302718;Object['assign'](this[_0x845f('0x14')][_0x302718['queue']],_0x4934e2);if(_0x302718[_0x845f('0xa5')]){this['emitVoiceQueueChannelRemove'](_0x302718,_0x845f('0x26'));}}}logger[_0x845f('0x48')](_0x845f('0xc2'),_0x3a1445,util[_0x845f('0x41')](this['queueReports'][_0x3a1445],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x302718)&&_0x302718[_0x845f('0x4f')]!=='ATTENDEDTRANSFER'){ami[_0x845f('0x47')](_0x845f('0xc3'),this[_0x845f('0x10')][_0x3a1445]);if(this[_0x845f('0x10')][_0x3a1445]){delete this[_0x845f('0x10')][_0x3a1445];}if(this[_0x845f('0x12')][_0x3a1445]){this['deleteChannelAfterTimeout'](_0x3a1445);}if(this[_0x845f('0x17')][_0x3a1445]){delete this[_0x845f('0x17')][_0x3a1445];}}}}catch(_0x21e590){logger['error']('[%s][voiceQueueReport][handleHangup]',_0x3a1445,util[_0x845f('0x41')](_0x21e590,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x845f('0xc')][_0x845f('0x27')]=function(_0x46f019){try{if(this['isNotNull'](_0x46f019)){logger[_0x845f('0x48')](_0x845f('0xc4'),_0x46f019[_0x845f('0x49')],util[_0x845f('0x41')](_0x46f019,{'showHidden':![],'depth':null}));if(this[_0x845f('0x10')][_0x46f019[_0x845f('0x49')]]){return this[_0x845f('0xb3')](_0x46f019[_0x845f('0x49')],_0x46f019[_0x845f('0xc5')],![]);}if(this[_0x845f('0x10')][_0x46f019[_0x845f('0x9a')]]){if(_0x46f019['cause']==='21'){return;}return this['handleHangup'](_0x46f019[_0x845f('0x9a')],_0x46f019[_0x845f('0xc5')],!![]);}var _0x4b69f8=Object[_0x845f('0x9f')](this['queueReports']);for(var _0x501cbd=0x0;_0x501cbd<_0x4b69f8[_0x845f('0xb4')];_0x501cbd++){var _0x209b54=_[_0x845f('0x7c')](this[_0x845f('0x10')][_0x4b69f8[_0x501cbd]]);if(_0x209b54&&_0x209b54[_0x845f('0xc6')]===_0x46f019[_0x845f('0x49')]){return this[_0x845f('0xb3')](_0x209b54['uniqueid'],_0x46f019[_0x845f('0xc5')],!![]);}}if(!this[_0x845f('0x10')][_0x46f019[_0x845f('0x49')]]){logger[_0x845f('0x48')]('[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed',_0x46f019[_0x845f('0x49')]);if(this[_0x845f('0x12')][_0x46f019[_0x845f('0x49')]]){this[_0x845f('0xc7')](_0x46f019['uniqueid']);}if(this[_0x845f('0x17')][_0x46f019[_0x845f('0x49')]]){delete this[_0x845f('0x17')][_0x46f019[_0x845f('0x49')]];}}}}catch(_0x2bf19b){logger[_0x845f('0x3f')](_0x845f('0xc4'),_0x46f019[_0x845f('0x49')],util[_0x845f('0x41')](_0x2bf19b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x845f('0xc')][_0x845f('0xc8')]=function(_0x4b03f9){try{if(this[_0x845f('0x6b')](_0x4b03f9)){logger[_0x845f('0x48')](_0x845f('0xc9'),_0x4b03f9[_0x845f('0x49')],util[_0x845f('0x41')](_0x4b03f9,{'showHidden':![],'depth':null}));var _0x561142;var _0x3d96ee;var _0x89ae70;if(this[_0x845f('0x10')][_0x4b03f9[_0x845f('0xca')]]){_0x561142=_[_0x845f('0x7c')](this[_0x845f('0x10')][_0x4b03f9[_0x845f('0xca')]]);_0x561142[_0x845f('0x97')]=_0x4b03f9[_0x845f('0xcb')];_0x561142[_0x845f('0xcc')]=_0x4b03f9[_0x845f('0xcd')];_0x561142[_0x845f('0x4f')]='ATTENDEDTRANSFER';_0x561142['transfer']=!![];_0x561142['transfertype']='ATTENDED';if(this[_0x845f('0x10')][_0x4b03f9[_0x845f('0xcd')]]){_0x89ae70=this['queueReports'][_0x4b03f9['secondtransfereruniqueid']];this[_0x845f('0x10')][_0x4b03f9[_0x845f('0xcd')]]=this[_0x845f('0x10')][_0x4b03f9[_0x845f('0xca')]];this[_0x845f('0x10')][_0x4b03f9['transfereeuniqueid']]=_0x89ae70;_0x3d96ee=_[_0x845f('0x7c')](this['queueReports'][_0x4b03f9['transfereeuniqueid']]);_0x3d96ee[_0x845f('0xce')]=!![];}logger['info'](_0x845f('0xcf'),_0x4b03f9['uniqueid'],_0x561142[_0x845f('0x51')],_0x561142[_0x845f('0x55')],_0x561142[_0x845f('0x97')],_0x561142['transferuniqueid']);}else if(this[_0x845f('0x10')][_0x4b03f9[_0x845f('0xd0')]]){_0x561142=_[_0x845f('0x7c')](this['queueReports'][_0x4b03f9[_0x845f('0xd0')]]);_0x561142['transferexten']=_0x4b03f9[_0x845f('0xd1')];_0x561142[_0x845f('0xcc')]=_0x4b03f9['origtransfereruniqueid'];_0x561142['queuecallerexitreason']=_0x845f('0xb6');_0x561142[_0x845f('0x8d')]=!![];_0x561142[_0x845f('0x95')]=_0x845f('0xd2');if(this[_0x845f('0x10')][_0x4b03f9['origtransfereruniqueid']]){_0x89ae70=this[_0x845f('0x10')][_0x4b03f9[_0x845f('0xd3')]];this[_0x845f('0x10')][_0x4b03f9[_0x845f('0xd3')]]=this[_0x845f('0x10')][_0x4b03f9[_0x845f('0xd0')]];this[_0x845f('0x10')][_0x4b03f9['transfertargetuniqueid']]=_0x89ae70;_0x3d96ee=_[_0x845f('0x7c')](this[_0x845f('0x10')][_0x4b03f9['transfertargetuniqueid']]);_0x3d96ee['switch']=!![];}logger[_0x845f('0x77')](_0x845f('0xcf'),_0x4b03f9[_0x845f('0x49')],_0x561142['queue'],_0x561142['type'],_0x561142[_0x845f('0x97')],_0x561142['transferuniqueid']);}else if(this[_0x845f('0x10')][_0x4b03f9[_0x845f('0xd3')]]){_0x561142=_[_0x845f('0x7c')](this[_0x845f('0x10')][_0x4b03f9[_0x845f('0xd3')]]);_0x561142[_0x845f('0x97')]=_0x4b03f9[_0x845f('0xd1')];_0x561142[_0x845f('0xcc')]=_0x4b03f9[_0x845f('0xd3')];_0x561142[_0x845f('0x4f')]=_0x845f('0xb6');_0x561142[_0x845f('0x8d')]=!![];_0x561142[_0x845f('0x95')]=_0x845f('0xd2');_0x561142[_0x845f('0xce')]=!![];_0x561142[_0x845f('0xc6')]=_0x4b03f9['transfereeuniqueid'];}else if(this[_0x845f('0x10')][_0x4b03f9[_0x845f('0xcd')]]){_0x561142=_[_0x845f('0x7c')](this['queueReports'][_0x4b03f9[_0x845f('0xcd')]]);_0x561142['transferexten']=_0x4b03f9[_0x845f('0xcb')];_0x561142[_0x845f('0xcc')]=_0x4b03f9[_0x845f('0xcd')];_0x561142[_0x845f('0x4f')]=_0x845f('0xb6');_0x561142['transfer']=!![];_0x561142['transfertype']=_0x845f('0xd2');_0x561142[_0x845f('0xce')]=!![];_0x561142[_0x845f('0xc6')]=_0x4b03f9['transfertargetuniqueid'];}}}catch(_0x444002){logger['error'](_0x845f('0xc9'),_0x4b03f9[_0x845f('0x49')],util['inspect'](_0x444002,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x845f('0x2f')]=function(_0x1d3a2b){try{if(this[_0x845f('0x6b')](_0x1d3a2b)){logger[_0x845f('0x48')](_0x845f('0xd4'),_0x1d3a2b[_0x845f('0x49')],util[_0x845f('0x41')](_0x1d3a2b,{'showHidden':![],'depth':null}));if(this[_0x845f('0x10')][_0x1d3a2b['transfereeuniqueid']]){var _0x5a04d9=_['last'](this[_0x845f('0x10')][_0x1d3a2b['transfereeuniqueid']]);_0x5a04d9['queuecallerexitreason']=_0x845f('0xd5');_0x5a04d9[_0x845f('0x8d')]=!![];_0x5a04d9[_0x845f('0x95')]=_0x845f('0xd6');_0x5a04d9['transferexten']=_0x1d3a2b['extension'];_0x5a04d9[_0x845f('0xcc')]=_0x1d3a2b['transfereeuniqueid'];logger['info'](_0x845f('0xd7'),_0x1d3a2b['uniqueid'],_0x5a04d9[_0x845f('0x51')],_0x5a04d9[_0x845f('0x55')],_0x5a04d9[_0x845f('0x97')],_0x5a04d9[_0x845f('0xcc')]);this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x1d3a2b[_0x845f('0xca')],'context':_0x1d3a2b['context'],'channel':_0x1d3a2b[_0x845f('0xd8')]});}}}catch(_0x2b581c){logger[_0x845f('0x3f')](_0x845f('0xd4'),_0x1d3a2b['uniqueid'],util['inspect'](_0x2b581c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x845f('0xc')]['syncMusicOnHoldStart']=function(_0x300aa3){try{if(this[_0x845f('0x6b')](_0x300aa3)){logger[_0x845f('0x48')](_0x845f('0xd9'),_0x300aa3['uniqueid'],util[_0x845f('0x41')](_0x300aa3,{'showHidden':![],'depth':null}));if(this[_0x845f('0x10')][_0x300aa3[_0x845f('0x49')]]){var _0x56a19a=_[_0x845f('0x7c')](this['queueReports'][_0x300aa3['uniqueid']]);if(!_[_0x845f('0x39')](_0x56a19a[_0x845f('0xa5')])){_0x56a19a[_0x845f('0xda')]=moment()[_0x845f('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');logger['info']('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x300aa3[_0x845f('0x49')],_0x56a19a[_0x845f('0xda')]);}}}}catch(_0x31cc93){logger[_0x845f('0x3f')]('[%s][voiceQueueReport][musiconholdstart]',_0x300aa3[_0x845f('0x49')],util[_0x845f('0x41')](_0x31cc93,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x845f('0xc')][_0x845f('0x2c')]=function(_0x6a355d){try{if(this[_0x845f('0x6b')](_0x6a355d)){logger[_0x845f('0x48')]('[%s][voiceQueueReport][musiconholdstop]',_0x6a355d[_0x845f('0x49')],util[_0x845f('0x41')](_0x6a355d,{'showHidden':![],'depth':null}));if(this[_0x845f('0x10')][_0x6a355d['uniqueid']]){var _0x5862e2=_[_0x845f('0x7c')](this[_0x845f('0x10')][_0x6a355d['uniqueid']]);if(!_['isNil'](_0x5862e2[_0x845f('0xda')])){_0x5862e2[_0x845f('0xdb')]+=moment()['milliseconds'](0x0)[_0x845f('0xbc')](_0x5862e2[_0x845f('0xda')],_0x845f('0x93'));logger[_0x845f('0x77')](_0x845f('0xdc'),_0x6a355d[_0x845f('0x49')],_0x5862e2[_0x845f('0xdb')]);delete _0x5862e2['mohstarttime'];}}}}catch(_0x78b832){logger[_0x845f('0x3f')](_0x845f('0xdd'),_0x6a355d[_0x845f('0x49')],util[_0x845f('0x41')](_0x78b832,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x845f('0xc')][_0x845f('0xde')]=function(_0x2f848a){try{if(this[_0x845f('0x6b')](_0x2f848a)){logger[_0x845f('0x48')](_0x845f('0xdf'),_0x2f848a['uniqueid'],util['inspect'](_0x2f848a,{'showHidden':![],'depth':null}));if(_0x2f848a['application'][_0x845f('0xe0')]()===_0x845f('0xe1')){_0x2f848a[_0x845f('0xe2')]=(_0x2f848a[_0x845f('0xe3')]||_0x2f848a[_0x845f('0xe2')])['toLowerCase']();if(_[_0x845f('0x90')](_0x2f848a['applicationdata'][_0x845f('0xe0')](),_0x845f('0xe4'))){logger[_0x845f('0x77')](_0x845f('0xe5'),_0x2f848a['uniqueid'],_0x2f848a[_0x845f('0xe6')],_0x2f848a[_0x845f('0xe2')]);if(_[_0x845f('0x59')](this[_0x845f('0x12')][_0x2f848a[_0x845f('0x49')]]))this[_0x845f('0x12')][_0x2f848a[_0x845f('0x49')]]={};var _0x494a6c=_0x2f848a[_0x845f('0xe2')][_0x845f('0xe7')]('=');var _0x94fff7=_0x494a6c[0x0][_0x845f('0xe0')]()[_0x845f('0xe8')](/cdr\((.*)\)/);if(_0x94fff7)this['channels'][_0x2f848a[_0x845f('0x49')]][_0x94fff7[0x1]]=_0x494a6c[0x1];}}}}catch(_0x15b3f5){logger[_0x845f('0x3f')](_0x845f('0xe9'),_0x2f848a['uniqueid'],util['inspect'](_0x15b3f5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x845f('0xc')]['deleteChannelAfterTimeout']=function(_0x410f12,_0x4e28be=0x2710){if(this[_0x845f('0x12')][_0x410f12]){setTimeout(()=>{delete this['channels'][_0x410f12];},_0x4e28be);}};module['exports']=VoiceQueueReport;