Built motion from commit e6806ed6.|2.6.0
[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 _0x2305=['uniqueid','format','voice:queue:%s','name',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','total','type','abandoned','waiting','Trunk','callerid','Interval','stringify','debug','voice_queue:save','isNotNull','isUndefined','flagQueueSummary','queue','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','toNumber','callers','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','inbound','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','pick','keys','push','queuecallerjoin','[%s][voiceQueueReport][queuecallerabandon]','last','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','COMPLETEDBYAGENT','assigned','membername','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexit','queuecallerjoinAt','seconds','FORWARDTRANSFER','transfertype','FORWARD','destexten','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','queuestatus','CONTINUE','TIMEOUT','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','varset','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','diff','length','milliseconds','queuecallercompleteAt','lastevent','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','ATTENDED','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transferexten','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','syncBlindTransfer','BLINDTRANSFER','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','md5','ioredis','../../../config/environment','ami','../ami','../model/queueReport','redis','prototype','tail','finally','sequence','queueReports','channels','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','syncVarSet','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','queueStatusComplete','unlockRR','switch','enqueue','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','agents','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:'];(function(_0x2b9f34,_0x2775b3){var _0x5597e1=function(_0x263e4e){while(--_0x263e4e){_0x2b9f34['push'](_0x2b9f34['shift']());}};_0x5597e1(++_0x2775b3);}(_0x2305,0x18f));var _0x5230=function(_0x58fbb0,_0xe497b5){_0x58fbb0=_0x58fbb0-0x0;var _0x1783d2=_0x2305[_0x58fbb0];return _0x1783d2;};'use strict';var _=require(_0x5230('0x0'));var moment=require(_0x5230('0x1'));var util=require(_0x5230('0x2'));var md5=require(_0x5230('0x3'));var Redis=require(_0x5230('0x4'));var config=require(_0x5230('0x5'));var logger=require('../../../config/logger')(_0x5230('0x6'));var ami=require(_0x5230('0x7'));var QueueReport=require(_0x5230('0x8'));config[_0x5230('0x9')]=_['defaults'](config[_0x5230('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5230('0x9')]));var Sequence=function(){};Sequence[_0x5230('0xa')]['enqueue']=function(_0x172eaa){this[_0x5230('0xb')]=this[_0x5230('0xb')]?this[_0x5230('0xb')][_0x5230('0xc')](_0x172eaa):_0x172eaa();};function VoiceQueueReport(_0x1f21e4){this[_0x5230('0xd')]=new Sequence();this[_0x5230('0xe')]={};this['agents']=_0x1f21e4['agents'];this[_0x5230('0xf')]=_0x1f21e4[_0x5230('0x10')];this['voiceQueues']=_0x1f21e4[_0x5230('0x11')];this['flagQueueSummary']=!![];this['campaigns']=_0x1f21e4[_0x5230('0x12')];this[_0x5230('0x13')]={};ami['on'](_0x5230('0x14'),this[_0x5230('0x15')][_0x5230('0x16')](this));ami['on'](_0x5230('0x17'),this[_0x5230('0x18')]['bind'](this));ami['on']('queuecallerjoin',this[_0x5230('0x19')][_0x5230('0x16')](this));ami['on'](_0x5230('0x1a'),this[_0x5230('0x1b')][_0x5230('0x16')](this));ami['on']('queuecallerleave',this[_0x5230('0x1c')][_0x5230('0x16')](this));ami['on'](_0x5230('0x1d'),this[_0x5230('0x1e')]['bind'](this));ami['on'](_0x5230('0x1f'),this[_0x5230('0x20')]['bind'](this));ami['on']('varset',this[_0x5230('0x21')][_0x5230('0x16')](this));ami['on']('hangup',this[_0x5230('0x22')][_0x5230('0x16')](this));ami['on'](_0x5230('0x23'),this[_0x5230('0x24')]['bind'](this));ami['on'](_0x5230('0x25'),this[_0x5230('0x26')][_0x5230('0x16')](this));ami['on'](_0x5230('0x27'),this['syncMusicOnHoldStop']['bind'](this));ami['on'](_0x5230('0x28'),this[_0x5230('0x29')][_0x5230('0x16')](this));ami['on'](_0x5230('0x2a'),this['syncBlindTransfer'][_0x5230('0x16')](this));this[_0x5230('0x2b')]();this[_0x5230('0x2c')]();}function clearChannels(_0x5a1791){if(!_['isEmpty'](_0x5a1791)){for(var _0x9641e9 in _0x5a1791){if(_0x5a1791['hasOwnProperty'](_0x9641e9)){delete _0x5a1791[_0x9641e9];}}}}function clearCampaigns(_0x1973d3){if(!_[_0x5230('0x2d')](_0x1973d3)){for(var _0x309a06 in _0x1973d3){if(_0x1973d3[_0x5230('0x2e')](_0x309a06)){_0x1973d3[_0x309a06][_0x5230('0x2f')]=0x0;}}}}function clearVoiceQueues(_0xdf7830){if(!_[_0x5230('0x2d')](_0xdf7830)){for(var _0x175ca4 in _0xdf7830){if(_0xdf7830[_0x5230('0x2e')](_0x175ca4)){_0xdf7830[_0x175ca4][_0x5230('0x2f')]=0x0;_0xdf7830[_0x175ca4][_0x5230('0x30')]=0x0;_0xdf7830[_0x175ca4][_0x5230('0x31')]=0x0;_0xdf7830[_0x175ca4]['waiting']=0x0;_0xdf7830[_0x175ca4][_0x5230('0x32')]=!![];}}}}function clearAgentBooked(_0x112b59){if(!_[_0x5230('0x2d')](_0x112b59)){for(var _0x2a0e3b in _0x112b59){if(_0x112b59[_0x5230('0x2e')](_0x2a0e3b)){_0x112b59[_0x2a0e3b][_0x5230('0x33')]=!![];}}}}VoiceQueueReport[_0x5230('0xa')]['clearZombieChannels']=function(){var _0x3416ac=this;for(var _0x1faf79 in this[_0x5230('0xf')]){if(this[_0x5230('0xf')][_0x5230('0x2e')](_0x1faf79)&&!this[_0x5230('0xf')][_0x1faf79][_0x5230('0x34')]){this['sequence'][_0x5230('0x35')](function(){if(!_[_0x5230('0x36')](_0x3416ac[_0x5230('0xf')][_0x1faf79])){return ami[_0x5230('0x37')]({'action':_0x5230('0x38'),'channel':_0x3416ac[_0x5230('0xf')][_0x1faf79][_0x5230('0x39')]})[_0x5230('0x3a')](function(_0x43b003){if(_0x43b003[_0x5230('0x3b')]===_0x5230('0x3c')){setTimeout(function(){if(_0x3416ac['channels'][_0x1faf79]){delete _0x3416ac[_0x5230('0xf')][_0x1faf79];logger[_0x5230('0x3d')](_0x5230('0x3e'),_0x1faf79,util[_0x5230('0x3f')](_0x43b003,{'showHidden':![],'depth':null}));}if(_0x3416ac[_0x5230('0xe')][_0x1faf79]){delete _0x3416ac['queueReports'][_0x1faf79];logger[_0x5230('0x3d')](_0x5230('0x40'),_0x1faf79,util[_0x5230('0x3f')](_0x43b003,{'showHidden':![],'depth':null}));}if(_0x3416ac['variables'][_0x1faf79]){delete _0x3416ac['variables'][_0x1faf79];logger[_0x5230('0x3d')]('[%s][voiceQueueReport][checkVariables]',_0x1faf79,util['inspect'](_0x43b003,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x24')]=function(){logger[_0x5230('0x3d')](_0x5230('0x41'));clearChannels(this[_0x5230('0xf')]);this[_0x5230('0x42')](this['queueReports']);clearAgentBooked(this[_0x5230('0x43')]);clearVoiceQueues(this[_0x5230('0x11')]);clearCampaigns(this[_0x5230('0x12')]);};VoiceQueueReport['prototype'][_0x5230('0x42')]=function(_0x7273a8){var _0x4ec078=this;if(!_[_0x5230('0x2d')](_0x7273a8)){for(var _0x248aa7 in _0x7273a8){if(_0x7273a8[_0x5230('0x2e')](_0x248aa7)){_0x4ec078[_0x5230('0x44')](_0x7273a8[_0x248aa7],'clearqueuereport');delete _0x7273a8[_0x248aa7];}}}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x45')]=function(_0x40ad08,_0x14404f,_0x3970b9){io['to'](_0x40ad08)[_0x5230('0x45')](_0x14404f,_0x3970b9);};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x46')]=function(_0x1f2ff4,_0x421252){logger['debug'](_0x5230('0x47')+_0x421252+_0x5230('0x48'),_0x1f2ff4[_0x5230('0x49')],util[_0x5230('0x3f')](_0x1f2ff4,{'showHidden':![],'depth':null}));this[_0x5230('0x45')](util[_0x5230('0x4a')](_0x5230('0x4b'),_0x1f2ff4[_0x5230('0x4c')]),'voice_queue_channel:save',_0x1f2ff4);io[_0x5230('0x45')]('voice_queue_presence:save',_0x1f2ff4);};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x44')]=function(_0x59d6fb,_0x12be06){logger['debug'](_0x5230('0x47')+_0x12be06+_0x5230('0x4d'),_0x59d6fb['uniqueid'],util['inspect'](_0x59d6fb,{'showHidden':![],'depth':null}));if(_0x59d6fb[_0x5230('0x4e')]===_0x5230('0x4f'))return;this[_0x5230('0x45')](util[_0x5230('0x4a')](_0x5230('0x4b'),_0x59d6fb[_0x5230('0x4c')]),_0x5230('0x50'),_0x59d6fb);io[_0x5230('0x45')](_0x5230('0x51'),_0x59d6fb);};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x52')]=function(_0x1df44c,_0x20d3d2){if(_0x1df44c['type']==='inbound'){var _0x49e3ab={'id':_0x1df44c['id'],'name':_0x1df44c['name'],'strategy':_0x1df44c[_0x5230('0x53')],'answered':_0x1df44c[_0x5230('0x54')],'available':_0x1df44c[_0x5230('0x55')],'loggedIn':_0x1df44c[_0x5230('0x56')],'pTalking':_0x1df44c['pTalking'],'sumBillable':_0x1df44c['sumBillable'],'sumDuration':_0x1df44c[_0x5230('0x57')],'sumHoldTime':_0x1df44c[_0x5230('0x58')]||0x0,'talking':_0x1df44c[_0x5230('0x30')],'total':_0x1df44c[_0x5230('0x59')],'type':_0x1df44c[_0x5230('0x5a')],'unmanaged':_0x1df44c['unmanaged'],'abandoned':_0x1df44c[_0x5230('0x5b')],'waiting':_0x1df44c[_0x5230('0x5c')]};if(_0x1df44c[_0x5230('0x5d')]){_0x49e3ab['Trunk']={'id':_0x1df44c[_0x5230('0x5d')]['id'],'name':_0x1df44c[_0x5230('0x5d')][_0x5230('0x4c')],'active':_0x1df44c[_0x5230('0x5d')]['active'],'callerid':_0x1df44c['Trunk'][_0x5230('0x5e')]};}if(_0x1df44c[_0x5230('0x5f')]){_0x49e3ab[_0x5230('0x5f')]={'id':_0x1df44c[_0x5230('0x5f')]['id'],'name':_0x1df44c[_0x5230('0x5f')][_0x5230('0x4c')]};}var _0x1ac544=md5(JSON[_0x5230('0x60')](_0x49e3ab));if(_0x1df44c[_0x5230('0x3')]!==_0x1ac544){_0x1df44c['md5']=_0x1ac544;logger[_0x5230('0x61')]('[voiceQueueReport]['+_0x20d3d2+']\x20sending\x20voice_queue:save\x20event:',util['inspect'](_0x49e3ab,{'showHidden':![],'depth':null}));this[_0x5230('0x45')](util[_0x5230('0x4a')](_0x5230('0x4b'),_0x49e3ab[_0x5230('0x4c')]),_0x5230('0x62'),_0x49e3ab);}}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x63')]=function(_0x513e76){return _0x513e76!==null&&!_[_0x5230('0x64')](_0x513e76);};VoiceQueueReport['prototype'][_0x5230('0x2c')]=function(){var _0xbea9de=this;setInterval(function(){_0xbea9de['clearZombieChannels']();ami['Action']({'action':'queues'})[_0x5230('0x3a')](function(_0xf88f80){logger[_0x5230('0x3d')]('[voiceQueueReport][queues]',util[_0x5230('0x3f')](_0xf88f80,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x2b')]=function(){var _0x1017ad=this;setInterval(function(){if(_0x1017ad[_0x5230('0x65')]){return ami[_0x5230('0x37')]({'action':_0x5230('0x14')})['then'](function(){_0x1017ad[_0x5230('0x65')]=![];})['catch'](function(_0x5ad252){logger[_0x5230('0x3d')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x5ad252,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0x5230('0x15')]=function(_0x1736ac){try{if(this['isNotNull'](_0x1736ac)&&this[_0x5230('0x63')](_0x1736ac[_0x5230('0x66')])){logger['debug'](_0x5230('0x67'),util[_0x5230('0x3f')](_0x1736ac,{'showHidden':![],'depth':null}));if(this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]]){logger['info'](_0x5230('0x68'),_0x1736ac[_0x5230('0x66')]);var _0x2cff71=_['countBy'](this['channels'],'queue')[_0x1736ac[_0x5230('0x66')]]||0x0;var _0xb83ca2=_0x2cff71-_0x1736ac['callers'];if(this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]]['waiting']!==_[_0x5230('0x69')](_0x1736ac[_0x5230('0x6a')])||this[_0x5230('0x11')][_0x1736ac['queue']][_0x5230('0x56')]!==_[_0x5230('0x69')](_0x1736ac[_0x5230('0x6b')])||this['voiceQueues'][_0x1736ac['queue']][_0x5230('0x55')]!==_[_0x5230('0x69')](_0x1736ac[_0x5230('0x55')])||this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]][_0x5230('0x30')]!==_0xb83ca2){this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]]['waiting']=_[_0x5230('0x69')](_0x1736ac[_0x5230('0x6a')]);this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]][_0x5230('0x56')]=_[_0x5230('0x69')](_0x1736ac[_0x5230('0x6b')]);this[_0x5230('0x11')][_0x1736ac['queue']]['available']=_[_0x5230('0x69')](_0x1736ac[_0x5230('0x55')]);this['voiceQueues'][_0x1736ac[_0x5230('0x66')]][_0x5230('0x30')]=_0xb83ca2>0x0?_0xb83ca2:0x0;this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]][_0x5230('0x30')]=this[_0x5230('0x11')][_0x1736ac['queue']][_0x5230('0x30')]>_['toNumber'](_0x1736ac[_0x5230('0x6b')])?_[_0x5230('0x69')](_0x1736ac['loggedin']):this['voiceQueues'][_0x1736ac[_0x5230('0x66')]][_0x5230('0x30')];this[_0x5230('0x52')](this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]],'queuesummary');}logger[_0x5230('0x61')](_0x5230('0x6c'),util[_0x5230('0x3f')](this[_0x5230('0x11')][_0x1736ac[_0x5230('0x66')]],{'showHidden':![],'depth':null}));ami[_0x5230('0x45')](_0x5230('0x6d'),this[_0x5230('0x11')][_0x1736ac['queue']]);}}}catch(_0x5146e5){logger[_0x5230('0x3d')](_0x5230('0x6e'),util[_0x5230('0x3f')](_0x5146e5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x18')]=function(_0x44c9fb){logger[_0x5230('0x61')](_0x5230('0x6f'),util['inspect'](_0x44c9fb,{'showHidden':![],'depth':null}));this[_0x5230('0x65')]=!![];};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x19')]=function(_0xf48d03){try{if(this[_0x5230('0x63')](_0xf48d03)){logger[_0x5230('0x61')](_0x5230('0x70'),_0xf48d03['uniqueid'],util['inspect'](_0xf48d03,{'showHidden':![],'depth':null}));if(_[_0x5230('0x64')](this[_0x5230('0xe')][_0xf48d03[_0x5230('0x49')]]))this[_0x5230('0xe')][_0xf48d03[_0x5230('0x49')]]=[];if(_[_0x5230('0x64')](this[_0x5230('0xf')][_0xf48d03[_0x5230('0x49')]]))this['channels'][_0xf48d03[_0x5230('0x49')]]={};var _0x5e66b6=new QueueReport();_0x5e66b6[_0x5230('0x4c')]=_0xf48d03[_0x5230('0x66')];_0x5e66b6[_0x5230('0x5a')]=this['voiceQueues'][_0x5e66b6[_0x5230('0x4c')]]&&this['voiceQueues'][_0x5e66b6[_0x5230('0x4c')]]['type']?this[_0x5230('0x11')][_0x5e66b6[_0x5230('0x4c')]]['type']||_0x5230('0x71'):_0x5230('0x71');_0x5e66b6['queue']=_0xf48d03[_0x5230('0x66')];_0x5e66b6['queuecallerjoinAt']=moment()['format'](_0x5230('0x72'));_0x5e66b6['position']=_0xf48d03[_0x5230('0x73')];_0x5e66b6[_0x5230('0x74')]=_0xf48d03[_0x5230('0x74')];_0x5e66b6[_0x5230('0x49')]=_0xf48d03[_0x5230('0x49')];_0x5e66b6[_0x5230('0x75')]=this[_0x5230('0xf')][_0xf48d03[_0x5230('0x49')]][_0x5230('0x75')];logger[_0x5230('0x76')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x5e66b6[_0x5230('0x4c')],_0x5e66b6[_0x5230('0x5a')]);_['merge'](_0x5e66b6,_[_0x5230('0x77')](_0xf48d03,_[_0x5230('0x78')](_0x5e66b6)));this[_0x5230('0xe')][_0xf48d03[_0x5230('0x49')]][_0x5230('0x79')](_0x5e66b6);this[_0x5230('0xf')][_0xf48d03['uniqueid']]=_0x5e66b6;this['emitVoiceQueueChannelSave'](_0x5e66b6,_0x5230('0x7a'));}}catch(_0x59e226){logger[_0x5230('0x3d')]('[%s][voiceQueueReport][queuecallerjoin]',_0xf48d03[_0x5230('0x49')],util['inspect'](_0x59e226,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5230('0x1b')]=function(_0xa19b9c){try{if(this['isNotNull'](_0xa19b9c)){logger[_0x5230('0x61')](_0x5230('0x7b'),_0xa19b9c[_0x5230('0x49')],util['inspect'](_0xa19b9c,{'showHidden':![],'depth':null}));if(this[_0x5230('0xe')][_0xa19b9c[_0x5230('0x49')]]){var _0x274fcf=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0xa19b9c[_0x5230('0x49')]]);_0x274fcf['queuecallercomplete']=![];_0x274fcf['queuecallercompleteAt']=null;_0x274fcf[_0x5230('0x7d')]=_0xa19b9c[_0x5230('0x7d')];_0x274fcf['originalposition']=_0xa19b9c[_0x5230('0x7e')];_0x274fcf[_0x5230('0x1a')]=!![];_0x274fcf[_0x5230('0x7f')]=moment()[_0x5230('0x4a')](_0x5230('0x72'));_0x274fcf[_0x5230('0x4e')]=_0x5230('0x80');_0x274fcf[_0x5230('0x81')]=null;logger[_0x5230('0x76')](_0x5230('0x82'),_0x274fcf[_0x5230('0x4c')],_0x274fcf[_0x5230('0x5a')]);this[_0x5230('0xf')][_0xa19b9c['uniqueid']]=_0x274fcf;this['emitVoiceQueueChannelRemove'](_0x274fcf,'queuecallerabandon');}}}catch(_0x289555){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0xa19b9c[_0x5230('0x49')],util['inspect'](_0x289555,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')]['syncQueueCallerLeave']=function(_0x2d7932){try{if(this[_0x5230('0x63')](_0x2d7932)){logger[_0x5230('0x61')](_0x5230('0x83'),_0x2d7932[_0x5230('0x49')],util[_0x5230('0x3f')](_0x2d7932,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2d7932[_0x5230('0x49')]]){var _0x8a8e49=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x2d7932[_0x5230('0x49')]]);_0x8a8e49[_0x5230('0x84')]=moment()[_0x5230('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x8a8e49[_0x5230('0x85')]=_0x2d7932[_0x5230('0x85')];_0x8a8e49[_0x5230('0x86')]=_0x2d7932['connectedlinename'];logger[_0x5230('0x76')](_0x5230('0x87'),_0x8a8e49['name'],_0x8a8e49['type'],_0x2d7932[_0x5230('0x85')],_0x2d7932['connectedlinename']);this[_0x5230('0xf')][_0x2d7932['uniqueid']]=_0x8a8e49;this[_0x5230('0x46')](_0x8a8e49,'queuecallerleave');}}}catch(_0x37cb5e){logger[_0x5230('0x3d')](_0x5230('0x83'),_0x2d7932[_0x5230('0x49')],util[_0x5230('0x3f')](_0x37cb5e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x20')]=function(_0x37332e){try{if(this['isNotNull'](_0x37332e)){logger[_0x5230('0x61')](_0x5230('0x88'),_0x37332e['uniqueid'],util['inspect'](_0x37332e,{'showHidden':![],'depth':null}));if(this[_0x5230('0xe')][_0x37332e[_0x5230('0x49')]]){var _0x40be96=_['last'](this['queueReports'][_0x37332e['uniqueid']]);_0x40be96[_0x5230('0x89')]=!![];_0x40be96[_0x5230('0x4e')]=_0x5230('0x8a');logger[_0x5230('0x76')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x40be96[_0x5230('0x4c')],_0x40be96[_0x5230('0x5a')]);}}}catch(_0xdb5d96){logger[_0x5230('0x3d')](_0x5230('0x88'),_0x37332e['uniqueid'],util['inspect'](_0xdb5d96,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5230('0x1e')]=function(_0x465e4f){try{if(this[_0x5230('0x63')](_0x465e4f)){logger[_0x5230('0x61')]('[%s][voiceQueueReport][agentcomplete]',_0x465e4f[_0x5230('0x49')],util['inspect'](_0x465e4f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x465e4f[_0x5230('0x49')]]){var _0x184a50=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x465e4f[_0x5230('0x49')]]);_0x184a50['queuecallerabandon']=![];_0x184a50[_0x5230('0x7f')]=null;_0x184a50[_0x5230('0x8b')]=!![];_0x184a50[_0x5230('0x81')]=_0x465e4f[_0x5230('0x8c')];_0x184a50[_0x5230('0x7d')]=_0x465e4f[_0x5230('0x7d')];_0x184a50[_0x5230('0x89')]=!![];_0x184a50['queuecallerexit']=![];_0x184a50[_0x5230('0x8d')]=null;if(!_0x184a50[_0x5230('0x8e')]){if(_0x465e4f[_0x5230('0x8f')]=='transfer'){_0x184a50[_0x5230('0x4e')]='COMPLETED';logger[_0x5230('0x76')](_0x5230('0x90'),_0x184a50[_0x5230('0x4c')],_0x184a50['type']);}else{if(_[_0x5230('0x91')](_0x465e4f[_0x5230('0x39')][_0x5230('0x92')](),_0x5230('0x93'))){if(this[_0x5230('0xe')][_0x465e4f[_0x5230('0x94')]]){var _0x7b8266=_[_0x5230('0x7c')](this['queueReports'][_0x465e4f[_0x5230('0x94')]]);_0x7b8266[_0x5230('0x89')]=![];_0x7b8266[_0x5230('0x95')]=!![];_0x7b8266['queuecallerexitAt']=moment(_0x184a50[_0x5230('0x96')])['add'](_0x465e4f['holdtime'],_0x5230('0x97'))['format'](_0x5230('0x72'));_0x7b8266[_0x5230('0x4e')]=_0x5230('0x98');_0x7b8266[_0x5230('0x8e')]=!![];_0x7b8266[_0x5230('0x99')]=_0x5230('0x9a');_0x7b8266['transferexten']=_0x465e4f[_0x5230('0x9b')];_0x7b8266[_0x5230('0x9c')]=_0x465e4f[_0x5230('0x49')];logger[_0x5230('0x76')](_0x5230('0x9d'),_0x7b8266[_0x5230('0x4c')],_0x7b8266[_0x5230('0x5a')]);var _0x5634e8=this[_0x5230('0xe')][_0x465e4f[_0x5230('0x94')]];this[_0x5230('0xe')][_0x465e4f[_0x5230('0x94')]]=this[_0x5230('0xe')][_0x465e4f[_0x5230('0x49')]];this[_0x5230('0xe')][_0x465e4f[_0x5230('0x49')]]=_0x5634e8;}}else{_0x184a50[_0x5230('0x4e')]=_0x5230('0x9e')+_0x465e4f[_0x5230('0x8f')][_0x5230('0x9f')]();logger[_0x5230('0x76')](_0x5230('0xa0'),_0x184a50['name'],_0x184a50['type'],_0x184a50[_0x5230('0x4e')]);}}}this[_0x5230('0xf')][_0x465e4f[_0x5230('0x49')]]=_0x184a50;this[_0x5230('0x44')](_0x184a50,'agentcomplete');}}}catch(_0xf9a97d){logger[_0x5230('0x3d')]('[%s][voiceQueueReport][agentcomplete]',_0x465e4f[_0x5230('0x49')],util[_0x5230('0x3f')](_0xf9a97d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')]['syncVarSet']=function(_0x53cbf6){try{if(this['isNotNull'](_0x53cbf6)){logger[_0x5230('0x61')](_0x5230('0xa1'),_0x53cbf6[_0x5230('0x49')],util[_0x5230('0x3f')](_0x53cbf6,{'showHidden':![],'depth':null}));this[_0x5230('0xa2')](_0x53cbf6[_0x5230('0x49')],_['keys'](_0x53cbf6[_0x5230('0xa3')])[0x0],_0x53cbf6[_0x5230('0xa4')]);if(this[_0x5230('0xe')][_0x53cbf6[_0x5230('0x49')]]){var _0x500f03=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x53cbf6[_0x5230('0x49')]]);if(_0x500f03){if(this[_0x5230('0x63')](_0x53cbf6[_0x5230('0xa3')])&&this['isNotNull'](_0x53cbf6[_0x5230('0xa3')][_0x5230('0xa5')])){switch(_0x53cbf6[_0x5230('0xa4')]){case _0x5230('0xa6'):_0x500f03[_0x5230('0x95')]=![];_0x500f03[_0x5230('0x8d')]=null;break;case _0x5230('0xa7'):_0x500f03['lastevent']=_0x5230('0xa8');_0x500f03[_0x5230('0x95')]=!![];_0x500f03['queuecallerexitAt']=moment()[_0x5230('0x4a')](_0x5230('0x72'));_0x500f03[_0x5230('0x84')]=moment()[_0x5230('0x4a')](_0x5230('0x72'));logger[_0x5230('0x61')](_0x5230('0xa9'),_0x53cbf6[_0x5230('0x49')],util['inspect'](_0x500f03,{'showHidden':![],'depth':null}));ami['emit'](_0x5230('0xaa'),_0x500f03);break;default:_0x500f03[_0x5230('0x95')]=!![];_0x500f03['queuecallerexitAt']=moment()['format'](_0x5230('0x72'));_0x500f03[_0x5230('0x84')]=moment()[_0x5230('0x4a')](_0x5230('0x72'));}_0x500f03['queuecallerabandon']=![];_0x500f03[_0x5230('0x7f')]=null;_0x500f03[_0x5230('0x4e')]=_0x53cbf6['value'];this['channels'][_0x53cbf6[_0x5230('0x49')]]=_0x500f03;this[_0x5230('0x44')](_0x500f03,_0x5230('0xab'));}else if(this['isNotNull'](_0x53cbf6['variable'])&&this[_0x5230('0x63')](_0x53cbf6[_0x5230('0xa3')][_0x5230('0xac')])){if(!_0x500f03['queuecallerabandon']){_0x500f03[_0x5230('0x95')]=!![];_0x500f03[_0x5230('0x8d')]=moment()[_0x5230('0x4a')](_0x5230('0x72'));_0x500f03[_0x5230('0x4e')]=_0x5230('0xad');_0x500f03[_0x5230('0x84')]=moment()[_0x5230('0x4a')](_0x5230('0x72'));this[_0x5230('0xf')][_0x53cbf6[_0x5230('0x49')]]=_0x500f03;}}logger[_0x5230('0x76')](_0x5230('0xae'),_0x53cbf6[_0x5230('0x49')],_0x500f03[_0x5230('0x4c')],_0x500f03[_0x5230('0x5a')],_['keys'](_0x53cbf6[_0x5230('0xa3')])[0x0],_0x53cbf6[_0x5230('0xa4')]);_0x500f03[_0x5230('0x13')]=this[_0x5230('0x13')][_0x53cbf6[_0x5230('0x49')]];}}}}catch(_0x124377){logger[_0x5230('0x3d')](_0x5230('0xa1'),_0x53cbf6[_0x5230('0x49')],util[_0x5230('0x3f')](_0x124377,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0xa2')]=function(_0x20f5aa,_0x1f61fe,_0x5170ca){var _0x345f64=[_0x5230('0xaf'),'rtpaudioqosbridged',_0x5230('0xb0'),'rtpaudioqosjitterbridged',_0x5230('0xb1'),_0x5230('0xb2'),'rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri',_0x5230('0xb3'),'bridgepvtcallid',_0x5230('0xb4'),_0x5230('0xb5'),_0x5230('0xb6'),_0x5230('0xb7'),_0x5230('0x8c'),_0x5230('0xb8'),_0x5230('0xb9')];if(!_[_0x5230('0x36')](_0x1f61fe)&&!_[_0x5230('0xba')](_0x345f64,_0x1f61fe)){if(_['isUndefined'](this[_0x5230('0x13')][_0x20f5aa])){this[_0x5230('0x13')][_0x20f5aa]={};}this[_0x5230('0x13')][_0x20f5aa][_0x1f61fe]=_0x5170ca;}};VoiceQueueReport['prototype'][_0x5230('0x22')]=function(_0x54f770){try{if(this[_0x5230('0x63')](_0x54f770)){logger[_0x5230('0x61')]('[%s][voiceQueueReport][hangup]',_0x54f770['uniqueid'],util['inspect'](_0x54f770,{'showHidden':![],'depth':null}));if(this[_0x5230('0xe')][_0x54f770['uniqueid']]){for(var _0x57f0d7=0x0,_0x4bda8c={};_0x57f0d7<this[_0x5230('0xe')][_0x54f770[_0x5230('0x49')]]['length'];_0x57f0d7+=0x1){_0x4bda8c=this[_0x5230('0xe')][_0x54f770[_0x5230('0x49')]][_0x57f0d7];if(this[_0x5230('0x11')][_0x4bda8c['queue']]){if(_0x4bda8c[_0x5230('0x95')]&&_0x4bda8c[_0x5230('0x8e')]!=!![]){this[_0x5230('0x11')][_0x4bda8c[_0x5230('0x66')]]['unmanaged']+=0x1;}if(_0x4bda8c[_0x5230('0x1a')]){this[_0x5230('0x11')][_0x4bda8c['queue']]['abandoned']+=0x1;}this[_0x5230('0x11')][_0x4bda8c[_0x5230('0x66')]][_0x5230('0x58')]+=moment(_0x4bda8c[_0x5230('0x84')])[_0x5230('0xbb')](_0x4bda8c['queuecallerjoinAt'],'seconds')||0x0;if(_0x57f0d7===this[_0x5230('0xe')][_0x54f770['uniqueid']][_0x5230('0xbc')]-0x1){this['voiceQueues'][_0x4bda8c[_0x5230('0x66')]][_0x5230('0x57')]+=moment()[_0x5230('0xbd')](0x0)[_0x5230('0xbb')](_0x4bda8c[_0x5230('0x96')],_0x5230('0x97'));this['voiceQueues'][_0x4bda8c['queue']][_0x5230('0x59')]+=0x1;if(_0x4bda8c[_0x5230('0x89')]){this[_0x5230('0x11')][_0x4bda8c[_0x5230('0x66')]][_0x5230('0x54')]+=0x1;this[_0x5230('0x11')][_0x4bda8c[_0x5230('0x66')]]['sumBillable']+=moment()[_0x5230('0xbd')](0x0)['diff'](_0x4bda8c[_0x5230('0x84')],'seconds');_0x4bda8c[_0x5230('0xbe')]=moment()[_0x5230('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x4bda8c[_0x5230('0x95')]=![];_0x4bda8c[_0x5230('0x8d')]=null;}if(_0x4bda8c[_0x5230('0x95')]&&_0x4bda8c[_0x5230('0x8e')]!=!![]){_0x4bda8c[_0x5230('0xbf')]=_0x5230('0xc0');logger['debug'](_0x5230('0xc1'),_0x54f770[_0x5230('0x49')],util[_0x5230('0x3f')](_0x4bda8c,{'showHidden':![],'depth':null}));ami[_0x5230('0x45')]('custom:queuecallerunmanaged',_0x4bda8c);}if(_0x4bda8c[_0x5230('0x1a')]){_0x4bda8c[_0x5230('0xbf')]=_0x5230('0x5b');logger[_0x5230('0x61')](_0x5230('0xc2'),_0x54f770[_0x5230('0x49')],util[_0x5230('0x3f')](_0x4bda8c,{'showHidden':![],'depth':null}));ami['emit'](_0x5230('0xc3'),_0x4bda8c);}}else{this[_0x5230('0x11')][_0x4bda8c['queue']][_0x5230('0x57')]+=this[_0x5230('0x11')][_0x4bda8c[_0x5230('0x66')]][_0x5230('0x58')];}logger[_0x5230('0x76')](_0x5230('0xc4'),_0x54f770[_0x5230('0x49')],_0x4bda8c['name'],_0x4bda8c[_0x5230('0x5a')],_0x54f770[_0x5230('0xc5')]);this[_0x5230('0xf')][_0x54f770[_0x5230('0x49')]]=_0x4bda8c;this[_0x5230('0x44')](_0x4bda8c,_0x5230('0xc6'));this['emitVoiceQueueSummary'](this[_0x5230('0x11')][_0x4bda8c[_0x5230('0x66')]],_0x5230('0xc6'));}}logger[_0x5230('0x61')](_0x5230('0xc7'),_0x54f770['uniqueid'],util[_0x5230('0x3f')](this['queueReports'][_0x54f770['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x5230('0x45')](_0x5230('0xc8'),this[_0x5230('0xe')][_0x54f770[_0x5230('0x49')]]);if(_0x4bda8c[_0x5230('0x4e')]===_0x5230('0x4f'))return;delete this[_0x5230('0xe')][_0x54f770[_0x5230('0x49')]];delete this[_0x5230('0xf')][_0x54f770[_0x5230('0x49')]];}if(this[_0x5230('0x13')][_0x54f770['uniqueid']]){delete this[_0x5230('0x13')][_0x54f770[_0x5230('0x49')]];}}}catch(_0x35d538){logger[_0x5230('0x3d')](_0x5230('0xc9'),_0x54f770[_0x5230('0x49')],util[_0x5230('0x3f')](_0x35d538,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x29')]=function(_0x2f40f8){try{if(this[_0x5230('0x63')](_0x2f40f8)){logger[_0x5230('0x61')](_0x5230('0xca'),_0x2f40f8[_0x5230('0x49')],util[_0x5230('0x3f')](_0x2f40f8,{'showHidden':![],'depth':null}));var _0x538fe7;var _0x32ad7b;var _0x18abd6;if(this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xcb')]]){_0x538fe7=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xcb')]]);_0x538fe7['transferexten']=_0x2f40f8[_0x5230('0xcc')];_0x538fe7[_0x5230('0x9c')]=_0x2f40f8['secondtransfereruniqueid'];_0x538fe7[_0x5230('0x4e')]=_0x5230('0x4f');_0x538fe7['transfer']=!![];_0x538fe7[_0x5230('0x99')]=_0x5230('0xcd');if(this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xce')]]){_0x18abd6=this['queueReports'][_0x2f40f8[_0x5230('0xce')]];this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xce')]]=this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xcb')]];this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xcb')]]=_0x18abd6;_0x32ad7b=_[_0x5230('0x7c')](this['queueReports'][_0x2f40f8[_0x5230('0xcb')]]);_0x32ad7b[_0x5230('0x34')]=!![];}logger[_0x5230('0x76')](_0x5230('0xcf'),_0x2f40f8[_0x5230('0x49')],_0x538fe7[_0x5230('0x4c')],_0x538fe7['type'],_0x538fe7[_0x5230('0xd0')],_0x538fe7['transferuniqueid']);}else if(this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd1')]]){_0x538fe7=_['last'](this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd1')]]);_0x538fe7['transferexten']=_0x2f40f8[_0x5230('0xd2')];_0x538fe7[_0x5230('0x9c')]=_0x2f40f8[_0x5230('0xd3')];_0x538fe7[_0x5230('0x4e')]=_0x5230('0x4f');_0x538fe7[_0x5230('0x8e')]=!![];_0x538fe7[_0x5230('0x99')]='ATTENDED';if(this['queueReports'][_0x2f40f8[_0x5230('0xd3')]]){_0x18abd6=this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd3')]];this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd3')]]=this[_0x5230('0xe')][_0x2f40f8['transfertargetuniqueid']];this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd1')]]=_0x18abd6;_0x32ad7b=_['last'](this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd1')]]);_0x32ad7b[_0x5230('0x34')]=!![];}logger[_0x5230('0x76')](_0x5230('0xcf'),_0x2f40f8[_0x5230('0x49')],_0x538fe7[_0x5230('0x4c')],_0x538fe7['type'],_0x538fe7[_0x5230('0xd0')],_0x538fe7['transferuniqueid']);}else if(this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd3')]]){_0x538fe7=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xd3')]]);_0x538fe7['transferexten']=_0x2f40f8[_0x5230('0xd2')];_0x538fe7[_0x5230('0x9c')]=_0x2f40f8[_0x5230('0xd3')];_0x538fe7['queuecallerexitreason']=_0x5230('0x4f');_0x538fe7[_0x5230('0x8e')]=!![];_0x538fe7[_0x5230('0x99')]=_0x5230('0xcd');}else if(this[_0x5230('0xe')][_0x2f40f8['secondtransfereruniqueid']]){_0x538fe7=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x2f40f8[_0x5230('0xce')]]);_0x538fe7['transferexten']=_0x2f40f8['secondtransfererexten'];_0x538fe7[_0x5230('0x9c')]=_0x2f40f8['secondtransfereruniqueid'];_0x538fe7['queuecallerexitreason']=_0x5230('0x4f');_0x538fe7[_0x5230('0x8e')]=!![];_0x538fe7[_0x5230('0x99')]=_0x5230('0xcd');}}}catch(_0x170585){logger[_0x5230('0x3d')](_0x5230('0xca'),_0x2f40f8[_0x5230('0x49')],util[_0x5230('0x3f')](_0x170585,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0xd4')]=function(_0x18a89a){try{if(this[_0x5230('0x63')](_0x18a89a)){logger[_0x5230('0x61')]('[%s][voiceQueueReport][blindtransfer]',_0x18a89a[_0x5230('0x49')],util[_0x5230('0x3f')](_0x18a89a,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x18a89a[_0x5230('0xcb')]]){var _0x5ac549=_['last'](this[_0x5230('0xe')][_0x18a89a[_0x5230('0xcb')]]);_0x5ac549[_0x5230('0x4e')]=_0x5230('0xd5');_0x5ac549[_0x5230('0x8e')]=!![];_0x5ac549[_0x5230('0x99')]=_0x5230('0xd6');_0x5ac549[_0x5230('0xd0')]=_0x18a89a['extension'];_0x5ac549[_0x5230('0x9c')]=_0x18a89a['transfereeuniqueid'];logger[_0x5230('0x76')](_0x5230('0xd7'),_0x18a89a[_0x5230('0x49')],_0x5ac549[_0x5230('0x4c')],_0x5ac549['type'],_0x5ac549[_0x5230('0xd0')],_0x5ac549[_0x5230('0x9c')]);this[_0x5230('0x22')]({'event':'BlindTransfer','uniqueid':_0x18a89a[_0x5230('0xcb')],'context':_0x18a89a[_0x5230('0xd8')],'channel':_0x18a89a['transfererchannel']});}}}catch(_0x3a0a85){logger[_0x5230('0x3d')](_0x5230('0xd9'),_0x18a89a[_0x5230('0x49')],util[_0x5230('0x3f')](_0x3a0a85,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0x26')]=function(_0x9bb555){try{if(this['isNotNull'](_0x9bb555)){logger['debug'](_0x5230('0xda'),_0x9bb555[_0x5230('0x49')],util['inspect'](_0x9bb555,{'showHidden':![],'depth':null}));if(this[_0x5230('0xe')][_0x9bb555[_0x5230('0x49')]]){var _0x8cbf72=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x9bb555[_0x5230('0x49')]]);if(!_[_0x5230('0x36')](_0x8cbf72[_0x5230('0x84')])){_0x8cbf72['mohstarttime']=moment()[_0x5230('0x4a')](_0x5230('0x72'));logger[_0x5230('0x76')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x9bb555[_0x5230('0x49')],_0x8cbf72[_0x5230('0xdb')]);}}}}catch(_0x415832){logger[_0x5230('0x3d')]('[%s][voiceQueueReport][musiconholdstart]',_0x9bb555[_0x5230('0x49')],util[_0x5230('0x3f')](_0x415832,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')][_0x5230('0xdc')]=function(_0x5351ab){try{if(this[_0x5230('0x63')](_0x5351ab)){logger[_0x5230('0x61')](_0x5230('0xdd'),_0x5351ab['uniqueid'],util[_0x5230('0x3f')](_0x5351ab,{'showHidden':![],'depth':null}));if(this[_0x5230('0xe')][_0x5351ab[_0x5230('0x49')]]){var _0x2187bf=_[_0x5230('0x7c')](this[_0x5230('0xe')][_0x5351ab[_0x5230('0x49')]]);if(!_[_0x5230('0x36')](_0x2187bf['mohstarttime'])){_0x2187bf['mohtime']+=moment()[_0x5230('0xbd')](0x0)[_0x5230('0xbb')](_0x2187bf[_0x5230('0xdb')],_0x5230('0x97'));logger[_0x5230('0x76')](_0x5230('0xde'),_0x5351ab[_0x5230('0x49')],_0x2187bf[_0x5230('0xdf')]);delete _0x2187bf['mohstarttime'];}}}}catch(_0x8fdb1e){logger['error'](_0x5230('0xdd'),_0x5351ab[_0x5230('0x49')],util['inspect'](_0x8fdb1e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5230('0xa')]['syncNewExten']=function(_0x1fa404){try{if(this[_0x5230('0x63')](_0x1fa404)){logger[_0x5230('0x61')](_0x5230('0xe0'),_0x1fa404[_0x5230('0x49')],util[_0x5230('0x3f')](_0x1fa404,{'showHidden':![],'depth':null}));if(_0x1fa404[_0x5230('0xe1')]['toLowerCase']()===_0x5230('0xe2')){_0x1fa404[_0x5230('0xe3')]=_0x1fa404[_0x5230('0xe4')]&&_0x1fa404[_0x5230('0xe4')][_0x5230('0x91')](_0x5230('0xe5'))?_0x1fa404[_0x5230('0xe4')]:(_0x1fa404[_0x5230('0xe4')]||_0x1fa404[_0x5230('0xe3')])[_0x5230('0x92')]();if(_[_0x5230('0x91')](_0x1fa404[_0x5230('0xe3')][_0x5230('0x92')](),_0x5230('0xe6'))){logger[_0x5230('0x76')](_0x5230('0xe7'),_0x1fa404[_0x5230('0x49')],_0x1fa404[_0x5230('0xe1')],_0x1fa404[_0x5230('0xe3')]);if(_[_0x5230('0x64')](this[_0x5230('0xf')][_0x1fa404[_0x5230('0x49')]]))this[_0x5230('0xf')][_0x1fa404[_0x5230('0x49')]]={};var _0x4beb43=_0x1fa404['applicationdata'][_0x5230('0xe8')]('=');var _0x50da77=_0x4beb43[0x0][_0x5230('0x92')]()[_0x5230('0xe9')](/cdr\((.*)\)/);if(_0x50da77)this['channels'][_0x1fa404[_0x5230('0x49')]][_0x50da77[0x1]]=_0x4beb43[0x1];}}}}catch(_0x2ade3e){logger['error'](_0x5230('0xea'),_0x1fa404[_0x5230('0x49')],util['inspect'](_0x2ade3e,{'showHidden':![],'depth':null}));}};module[_0x5230('0xeb')]=VoiceQueueReport;