Built motion from commit 85328c08.|2.5.50
[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 _0x5c2b=['name','voice_queue_presence:remove','emitVoiceQueueSummary','inbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','talking','unmanaged','Trunk','Interval','stringify','debug','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','isNotNull','loopQueueShow','Action','queues','catch','[voiceQueueReport][queues]','flagQueueSummary','then','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','queue','countBy','toNumber','callers','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','type','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','pick','[%s][voiceQueueReport][queuecallerabandon]','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','emitVoiceQueueChannelRemove','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','queuecallerabandon','assigned','membername','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','toLowerCase','local/','linkedid','queuecallerexit','queuecallerexitAt','add','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','[%s][voiceQueueReport][agentcomplete]','[%s][voiceQueueReport][varset]','addVariable','variable','value','TIMEOUT','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','keys','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','memberinterface','memberlastcall','memberpenalty','includes','length','abandoned','sumHoldTime','diff','milliseconds','total','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedtransfer]','syncBlindTransfer','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','mohstarttime','[%s][voiceQueueReport][musiconholdstart]','syncMusicOnHoldStop','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','exports','lodash','moment','util','md5','ioredis','../../../config/environment','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','queueReports','agents','channels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncMusicOnHoldStart','attendedtransfer','syncAttendedTransfer','blindtransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','clearZombieChannels','enqueue','isNil','status','channel','message','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','error','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER'];(function(_0x6b7cef,_0x1257b8){var _0x42bf71=function(_0x130162){while(--_0x130162){_0x6b7cef['push'](_0x6b7cef['shift']());}};_0x42bf71(++_0x1257b8);}(_0x5c2b,0x9f));var _0xb5c2=function(_0x3d61a0,_0x45e0a9){_0x3d61a0=_0x3d61a0-0x0;var _0x4abee0=_0x5c2b[_0x3d61a0];return _0x4abee0;};'use strict';var _=require(_0xb5c2('0x0'));var moment=require(_0xb5c2('0x1'));var util=require(_0xb5c2('0x2'));var md5=require(_0xb5c2('0x3'));var Redis=require(_0xb5c2('0x4'));var config=require(_0xb5c2('0x5'));var logger=require('../../../config/logger')(_0xb5c2('0x6'));var ami=require(_0xb5c2('0x7'));var QueueReport=require(_0xb5c2('0x8'));config[_0xb5c2('0x9')]=_[_0xb5c2('0xa')](config[_0xb5c2('0x9')],{'host':_0xb5c2('0xb'),'port':0x18eb});var io=require(_0xb5c2('0xc'))(new Redis(config[_0xb5c2('0x9')]));var Sequence=function(){};Sequence[_0xb5c2('0xd')]['enqueue']=function(_0x17992a){this['tail']=this[_0xb5c2('0xe')]?this['tail'][_0xb5c2('0xf')](_0x17992a):_0x17992a();};function VoiceQueueReport(_0x28a022){this[_0xb5c2('0x10')]=new Sequence();this[_0xb5c2('0x11')]={};this[_0xb5c2('0x12')]=_0x28a022['agents'];this[_0xb5c2('0x13')]=_0x28a022['queueChannels'];this[_0xb5c2('0x14')]=_0x28a022[_0xb5c2('0x14')];this['flagQueueSummary']=!![];this['campaigns']=_0x28a022[_0xb5c2('0x15')];this[_0xb5c2('0x16')]={};ami['on'](_0xb5c2('0x17'),this[_0xb5c2('0x18')][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x1a'),this[_0xb5c2('0x1b')][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x1c'),this['syncQueueCallerJoin'][_0xb5c2('0x19')](this));ami['on']('queuecallerabandon',this[_0xb5c2('0x1d')][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x1e'),this[_0xb5c2('0x1f')][_0xb5c2('0x19')](this));ami['on']('agentcomplete',this[_0xb5c2('0x20')][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x21'),this[_0xb5c2('0x22')]['bind'](this));ami['on'](_0xb5c2('0x23'),this[_0xb5c2('0x24')][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x25'),this[_0xb5c2('0x26')]['bind'](this));ami['on'](_0xb5c2('0x27'),this['syncFullyBooted'][_0xb5c2('0x19')](this));ami['on']('musiconholdstart',this[_0xb5c2('0x28')][_0xb5c2('0x19')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x29'),this[_0xb5c2('0x2a')][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x2b'),this['syncBlindTransfer'][_0xb5c2('0x19')](this));this[_0xb5c2('0x2c')]();this['loopQueueShow']();}function clearChannels(_0x5b1b83){if(!_[_0xb5c2('0x2d')](_0x5b1b83)){for(var _0x166a11 in _0x5b1b83){if(_0x5b1b83[_0xb5c2('0x2e')](_0x166a11)){delete _0x5b1b83[_0x166a11];}}}}function clearCampaigns(_0x49a61e){if(!_[_0xb5c2('0x2d')](_0x49a61e)){for(var _0x24500f in _0x49a61e){if(_0x49a61e[_0xb5c2('0x2e')](_0x24500f)){_0x49a61e[_0x24500f][_0xb5c2('0x2f')]=0x0;}}}}function clearVoiceQueues(_0xff11d0){if(!_['isEmpty'](_0xff11d0)){for(var _0x44fcae in _0xff11d0){if(_0xff11d0[_0xb5c2('0x2e')](_0x44fcae)){_0xff11d0[_0x44fcae][_0xb5c2('0x2f')]=0x0;_0xff11d0[_0x44fcae]['talking']=0x0;_0xff11d0[_0x44fcae][_0xb5c2('0x30')]=0x0;_0xff11d0[_0x44fcae][_0xb5c2('0x31')]=0x0;_0xff11d0[_0x44fcae][_0xb5c2('0x32')]=!![];}}}}function clearAgentBooked(_0x42be33){if(!_[_0xb5c2('0x2d')](_0x42be33)){for(var _0x1242d5 in _0x42be33){if(_0x42be33[_0xb5c2('0x2e')](_0x1242d5)){_0x42be33[_0x1242d5]['unlockRR']=!![];}}}}VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x33')]=function(){var _0xb34418=this;for(var _0x5e77fe in this[_0xb5c2('0x13')]){if(this[_0xb5c2('0x13')]['hasOwnProperty'](_0x5e77fe)&&!this[_0xb5c2('0x13')][_0x5e77fe]['switch']){this['sequence'][_0xb5c2('0x34')](function(){if(!_[_0xb5c2('0x35')](_0xb34418[_0xb5c2('0x13')][_0x5e77fe])){return ami['Action']({'action':_0xb5c2('0x36'),'channel':_0xb34418[_0xb5c2('0x13')][_0x5e77fe][_0xb5c2('0x37')]})['catch'](function(_0x5851d0){if(_0x5851d0[_0xb5c2('0x38')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xb34418[_0xb5c2('0x13')][_0x5e77fe]){delete _0xb34418['channels'][_0x5e77fe];logger['error'](_0xb5c2('0x39'),_0x5e77fe,util[_0xb5c2('0x3a')](_0x5851d0,{'showHidden':![],'depth':null}));}if(_0xb34418['queueReports'][_0x5e77fe]){delete _0xb34418[_0xb5c2('0x11')][_0x5e77fe];logger['error'](_0xb5c2('0x3b'),_0x5e77fe,util[_0xb5c2('0x3a')](_0x5851d0,{'showHidden':![],'depth':null}));}if(_0xb34418[_0xb5c2('0x16')][_0x5e77fe]){delete _0xb34418[_0xb5c2('0x16')][_0x5e77fe];logger[_0xb5c2('0x3c')](_0xb5c2('0x3d'),_0x5e77fe,util[_0xb5c2('0x3a')](_0x5851d0,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x3e')]=function(){logger[_0xb5c2('0x3c')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xb5c2('0x13')]);this[_0xb5c2('0x3f')](this[_0xb5c2('0x11')]);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xb5c2('0x15')]);};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x3f')]=function(_0x1b6c02){var _0x4dfae6=this;if(!_['isEmpty'](_0x1b6c02)){for(var _0x45f4b6 in _0x1b6c02){if(_0x1b6c02[_0xb5c2('0x2e')](_0x45f4b6)){_0x4dfae6['emitVoiceQueueChannelRemove'](_0x1b6c02[_0x45f4b6],_0xb5c2('0x40'));delete _0x1b6c02[_0x45f4b6];}}}};VoiceQueueReport['prototype']['emit']=function(_0x59ed73,_0x5aaf58,_0x2b04ce){io['to'](_0x59ed73)[_0xb5c2('0x41')](_0x5aaf58,_0x2b04ce);};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x42')]=function(_0x54b7dc,_0x5c3c05){logger['debug'](_0xb5c2('0x43')+_0x5c3c05+_0xb5c2('0x44'),_0x54b7dc[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x54b7dc,{'showHidden':![],'depth':null}));this[_0xb5c2('0x41')](util[_0xb5c2('0x46')](_0xb5c2('0x47'),_0x54b7dc['name']),_0xb5c2('0x48'),_0x54b7dc);io[_0xb5c2('0x41')](_0xb5c2('0x49'),_0x54b7dc);};VoiceQueueReport[_0xb5c2('0xd')]['emitVoiceQueueChannelRemove']=function(_0x1d7409,_0x749d71){logger['debug'](_0xb5c2('0x43')+_0x749d71+_0xb5c2('0x4a'),_0x1d7409[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x1d7409,{'showHidden':![],'depth':null}));if(_0x1d7409[_0xb5c2('0x4b')]===_0xb5c2('0x4c'))return;this[_0xb5c2('0x41')](util[_0xb5c2('0x46')]('voice:queue:%s',_0x1d7409[_0xb5c2('0x4d')]),'voice_queue_channel:remove',_0x1d7409);io[_0xb5c2('0x41')](_0xb5c2('0x4e'),_0x1d7409);};VoiceQueueReport['prototype'][_0xb5c2('0x4f')]=function(_0x244f8c,_0x4a637d){if(_0x244f8c['type']===_0xb5c2('0x50')){var _0xc11fe5={'id':_0x244f8c['id'],'name':_0x244f8c['name'],'strategy':_0x244f8c[_0xb5c2('0x51')],'answered':_0x244f8c[_0xb5c2('0x52')],'available':_0x244f8c[_0xb5c2('0x53')],'loggedIn':_0x244f8c[_0xb5c2('0x54')],'pTalking':_0x244f8c[_0xb5c2('0x30')],'sumBillable':_0x244f8c[_0xb5c2('0x55')],'sumDuration':_0x244f8c[_0xb5c2('0x56')],'sumHoldTime':_0x244f8c['sumHoldTime']||0x0,'talking':_0x244f8c[_0xb5c2('0x57')],'total':_0x244f8c['total'],'type':_0x244f8c['type'],'unmanaged':_0x244f8c[_0xb5c2('0x58')],'abandoned':_0x244f8c['abandoned'],'waiting':_0x244f8c[_0xb5c2('0x31')]};if(_0x244f8c[_0xb5c2('0x59')]){_0xc11fe5[_0xb5c2('0x59')]={'id':_0x244f8c['Trunk']['id'],'name':_0x244f8c[_0xb5c2('0x59')]['name'],'active':_0x244f8c[_0xb5c2('0x59')]['active'],'callerid':_0x244f8c[_0xb5c2('0x59')]['callerid']};}if(_0x244f8c[_0xb5c2('0x5a')]){_0xc11fe5[_0xb5c2('0x5a')]={'id':_0x244f8c[_0xb5c2('0x5a')]['id'],'name':_0x244f8c['Interval'][_0xb5c2('0x4d')]};}var _0x20a8d6=md5(JSON[_0xb5c2('0x5b')](_0xc11fe5));if(_0x244f8c[_0xb5c2('0x3')]!==_0x20a8d6){_0x244f8c[_0xb5c2('0x3')]=_0x20a8d6;logger[_0xb5c2('0x5c')](_0xb5c2('0x5d')+_0x4a637d+_0xb5c2('0x5e'),util[_0xb5c2('0x3a')](_0xc11fe5,{'showHidden':![],'depth':null}));this[_0xb5c2('0x41')](util[_0xb5c2('0x46')](_0xb5c2('0x47'),_0xc11fe5[_0xb5c2('0x4d')]),'voice_queue:save',_0xc11fe5);}}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x5f')]=function(_0x4c4fa7){return _0x4c4fa7!==null&&!_['isUndefined'](_0x4c4fa7);};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x60')]=function(){var _0xe5dcc6=this;setInterval(function(){_0xe5dcc6['clearZombieChannels']();ami[_0xb5c2('0x61')]({'action':_0xb5c2('0x62')})[_0xb5c2('0x63')](function(_0x5dd831){logger['error'](_0xb5c2('0x64'),util[_0xb5c2('0x3a')](_0x5dd831,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x2c')]=function(){var _0x2be541=this;setInterval(function(){if(_0x2be541[_0xb5c2('0x65')]){return ami[_0xb5c2('0x61')]({'action':_0xb5c2('0x17')})[_0xb5c2('0x66')](function(){_0x2be541[_0xb5c2('0x65')]=![];})[_0xb5c2('0x63')](function(_0x41aa3a){logger[_0xb5c2('0x3c')](_0xb5c2('0x67'),util[_0xb5c2('0x3a')](_0x41aa3a,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x18')]=function(_0x80ffe7){try{if(this[_0xb5c2('0x5f')](_0x80ffe7)&&this[_0xb5c2('0x5f')](_0x80ffe7['queue'])){logger['debug'](_0xb5c2('0x68'),util[_0xb5c2('0x3a')](_0x80ffe7,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x14')][_0x80ffe7['queue']]){logger[_0xb5c2('0x69')](_0xb5c2('0x6a'),_0x80ffe7[_0xb5c2('0x6b')]);var _0x428f6a=_[_0xb5c2('0x6c')](this[_0xb5c2('0x13')],_0xb5c2('0x6b'))[_0x80ffe7[_0xb5c2('0x6b')]]||0x0;var _0xc8cb4c=_0x428f6a-_0x80ffe7['callers'];if(this['voiceQueues'][_0x80ffe7['queue']][_0xb5c2('0x31')]!==_[_0xb5c2('0x6d')](_0x80ffe7[_0xb5c2('0x6e')])||this['voiceQueues'][_0x80ffe7[_0xb5c2('0x6b')]]['loggedIn']!==_[_0xb5c2('0x6d')](_0x80ffe7[_0xb5c2('0x6f')])||this[_0xb5c2('0x14')][_0x80ffe7[_0xb5c2('0x6b')]][_0xb5c2('0x53')]!==_[_0xb5c2('0x6d')](_0x80ffe7[_0xb5c2('0x53')])||this['voiceQueues'][_0x80ffe7[_0xb5c2('0x6b')]][_0xb5c2('0x57')]!==_0xc8cb4c){this[_0xb5c2('0x14')][_0x80ffe7[_0xb5c2('0x6b')]]['waiting']=_[_0xb5c2('0x6d')](_0x80ffe7['callers']);this[_0xb5c2('0x14')][_0x80ffe7[_0xb5c2('0x6b')]]['loggedIn']=_['toNumber'](_0x80ffe7[_0xb5c2('0x6f')]);this['voiceQueues'][_0x80ffe7['queue']][_0xb5c2('0x53')]=_[_0xb5c2('0x6d')](_0x80ffe7[_0xb5c2('0x53')]);this['voiceQueues'][_0x80ffe7[_0xb5c2('0x6b')]]['talking']=_0xc8cb4c>0x0?_0xc8cb4c:0x0;this[_0xb5c2('0x14')][_0x80ffe7[_0xb5c2('0x6b')]]['talking']=this['voiceQueues'][_0x80ffe7[_0xb5c2('0x6b')]]['talking']>_[_0xb5c2('0x6d')](_0x80ffe7[_0xb5c2('0x6f')])?_['toNumber'](_0x80ffe7[_0xb5c2('0x6f')]):this[_0xb5c2('0x14')][_0x80ffe7[_0xb5c2('0x6b')]][_0xb5c2('0x57')];this[_0xb5c2('0x4f')](this[_0xb5c2('0x14')][_0x80ffe7[_0xb5c2('0x6b')]],_0xb5c2('0x17'));}logger[_0xb5c2('0x5c')](_0xb5c2('0x70'),util[_0xb5c2('0x3a')](this['voiceQueues'][_0x80ffe7[_0xb5c2('0x6b')]],{'showHidden':![],'depth':null}));ami[_0xb5c2('0x41')](_0xb5c2('0x71'),this[_0xb5c2('0x14')][_0x80ffe7['queue']]);}}}catch(_0x2678cb){logger[_0xb5c2('0x3c')](_0xb5c2('0x67'),util[_0xb5c2('0x3a')](_0x2678cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x1b')]=function(_0x43b3be){logger[_0xb5c2('0x5c')](_0xb5c2('0x72'),util[_0xb5c2('0x3a')](_0x43b3be,{'showHidden':![],'depth':null}));this[_0xb5c2('0x65')]=!![];};VoiceQueueReport['prototype'][_0xb5c2('0x73')]=function(_0x51ee5d){try{if(this['isNotNull'](_0x51ee5d)){logger[_0xb5c2('0x5c')](_0xb5c2('0x74'),_0x51ee5d['uniqueid'],util['inspect'](_0x51ee5d,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x51ee5d[_0xb5c2('0x45')]]))this[_0xb5c2('0x11')][_0x51ee5d[_0xb5c2('0x45')]]=[];if(_[_0xb5c2('0x75')](this[_0xb5c2('0x13')][_0x51ee5d[_0xb5c2('0x45')]]))this[_0xb5c2('0x13')][_0x51ee5d[_0xb5c2('0x45')]]={};var _0xc61b88=new QueueReport();_0xc61b88[_0xb5c2('0x4d')]=_0x51ee5d[_0xb5c2('0x6b')];_0xc61b88[_0xb5c2('0x76')]=this[_0xb5c2('0x14')][_0xc61b88[_0xb5c2('0x4d')]]&&this['voiceQueues'][_0xc61b88[_0xb5c2('0x4d')]][_0xb5c2('0x76')]?this[_0xb5c2('0x14')][_0xc61b88['name']][_0xb5c2('0x76')]||'inbound':_0xb5c2('0x50');_0xc61b88[_0xb5c2('0x6b')]=_0x51ee5d[_0xb5c2('0x6b')];_0xc61b88[_0xb5c2('0x77')]=moment()['format'](_0xb5c2('0x78'));_0xc61b88[_0xb5c2('0x79')]=_0x51ee5d['position'];_0xc61b88[_0xb5c2('0x7a')]=_0x51ee5d[_0xb5c2('0x7a')];_0xc61b88[_0xb5c2('0x45')]=_0x51ee5d['uniqueid'];_0xc61b88['routealias']=this[_0xb5c2('0x13')][_0x51ee5d[_0xb5c2('0x45')]]['routealias'];logger[_0xb5c2('0x69')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0xc61b88[_0xb5c2('0x4d')],_0xc61b88['type']);_['merge'](_0xc61b88,_[_0xb5c2('0x7b')](_0x51ee5d,_['keys'](_0xc61b88)));this[_0xb5c2('0x11')][_0x51ee5d[_0xb5c2('0x45')]]['push'](_0xc61b88);this['channels'][_0x51ee5d[_0xb5c2('0x45')]]=_0xc61b88;this[_0xb5c2('0x42')](_0xc61b88,_0xb5c2('0x1c'));}}catch(_0x51ee96){logger[_0xb5c2('0x3c')]('[%s][voiceQueueReport][queuecallerjoin]',_0x51ee5d[_0xb5c2('0x45')],util['inspect'](_0x51ee96,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x1d')]=function(_0x484637){try{if(this[_0xb5c2('0x5f')](_0x484637)){logger[_0xb5c2('0x5c')](_0xb5c2('0x7c'),_0x484637[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x484637,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x11')][_0x484637[_0xb5c2('0x45')]]){var _0x29121f=_['last'](this[_0xb5c2('0x11')][_0x484637[_0xb5c2('0x45')]]);_0x29121f['queuecallercomplete']=![];_0x29121f[_0xb5c2('0x7d')]=null;_0x29121f[_0xb5c2('0x7e')]=_0x484637['holdtime'];_0x29121f[_0xb5c2('0x7f')]=_0x484637[_0xb5c2('0x7f')];_0x29121f['queuecallerabandon']=!![];_0x29121f[_0xb5c2('0x80')]=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));_0x29121f['queuecallerexitreason']=_0xb5c2('0x81');_0x29121f[_0xb5c2('0x82')]=null;logger[_0xb5c2('0x69')](_0xb5c2('0x83'),_0x29121f[_0xb5c2('0x4d')],_0x29121f[_0xb5c2('0x76')]);this[_0xb5c2('0x13')][_0x484637[_0xb5c2('0x45')]]=_0x29121f;this[_0xb5c2('0x84')](_0x29121f,'queuecallerabandon');}}}catch(_0x6d2af6){logger[_0xb5c2('0x3c')](_0xb5c2('0x7c'),_0x484637[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x6d2af6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')]['syncQueueCallerLeave']=function(_0x2d7274){try{if(this[_0xb5c2('0x5f')](_0x2d7274)){logger['debug'](_0xb5c2('0x85'),_0x2d7274[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x2d7274,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x11')][_0x2d7274[_0xb5c2('0x45')]]){var _0x2ecc74=_[_0xb5c2('0x86')](this['queueReports'][_0x2d7274[_0xb5c2('0x45')]]);_0x2ecc74[_0xb5c2('0x87')]=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));_0x2ecc74[_0xb5c2('0x88')]=_0x2d7274['connectedlinenum'];_0x2ecc74[_0xb5c2('0x89')]=_0x2d7274[_0xb5c2('0x89')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2ecc74[_0xb5c2('0x4d')],_0x2ecc74[_0xb5c2('0x76')],_0x2d7274[_0xb5c2('0x88')],_0x2d7274[_0xb5c2('0x89')]);this[_0xb5c2('0x13')][_0x2d7274[_0xb5c2('0x45')]]=_0x2ecc74;this[_0xb5c2('0x42')](_0x2ecc74,'queuecallerleave');}}}catch(_0x371a2c){logger[_0xb5c2('0x3c')](_0xb5c2('0x85'),_0x2d7274[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x371a2c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x22')]=function(_0x18bed8){try{if(this[_0xb5c2('0x5f')](_0x18bed8)){logger[_0xb5c2('0x5c')](_0xb5c2('0x8a'),_0x18bed8['uniqueid'],util['inspect'](_0x18bed8,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x11')][_0x18bed8[_0xb5c2('0x45')]]){var _0x5b067f=_[_0xb5c2('0x86')](this['queueReports'][_0x18bed8[_0xb5c2('0x45')]]);_0x5b067f[_0xb5c2('0x8b')]=!![];_0x5b067f[_0xb5c2('0x4b')]='COMPLETEDBYAGENT';logger[_0xb5c2('0x69')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x5b067f[_0xb5c2('0x4d')],_0x5b067f['type']);}}}catch(_0x260776){logger[_0xb5c2('0x3c')](_0xb5c2('0x8a'),_0x18bed8[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x260776,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x1a1d9a){try{if(this[_0xb5c2('0x5f')](_0x1a1d9a)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x1a1d9a['uniqueid'],util[_0xb5c2('0x3a')](_0x1a1d9a,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x11')][_0x1a1d9a[_0xb5c2('0x45')]]){var _0x11e82d=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x1a1d9a[_0xb5c2('0x45')]]);_0x11e82d[_0xb5c2('0x8c')]=![];_0x11e82d[_0xb5c2('0x80')]=null;_0x11e82d[_0xb5c2('0x8d')]=!![];_0x11e82d[_0xb5c2('0x82')]=_0x1a1d9a[_0xb5c2('0x8e')];_0x11e82d[_0xb5c2('0x7e')]=_0x1a1d9a['holdtime'];_0x11e82d[_0xb5c2('0x8b')]=!![];_0x11e82d['queuecallerexit']=![];_0x11e82d['queuecallerexitAt']=null;if(!_0x11e82d[_0xb5c2('0x8f')]){if(_0x1a1d9a[_0xb5c2('0x90')]==_0xb5c2('0x8f')){_0x11e82d[_0xb5c2('0x4b')]=_0xb5c2('0x91');logger[_0xb5c2('0x69')](_0xb5c2('0x92'),_0x11e82d[_0xb5c2('0x4d')],_0x11e82d[_0xb5c2('0x76')]);}else{if(_['startsWith'](_0x1a1d9a[_0xb5c2('0x37')][_0xb5c2('0x93')](),_0xb5c2('0x94'))){if(this[_0xb5c2('0x11')][_0x1a1d9a[_0xb5c2('0x95')]]){var _0xcfcb8b=_['last'](this[_0xb5c2('0x11')][_0x1a1d9a[_0xb5c2('0x95')]]);_0xcfcb8b['queuecallercomplete']=![];_0xcfcb8b[_0xb5c2('0x96')]=!![];_0xcfcb8b[_0xb5c2('0x97')]=moment(_0x11e82d[_0xb5c2('0x77')])[_0xb5c2('0x98')](_0x1a1d9a[_0xb5c2('0x7e')],_0xb5c2('0x99'))[_0xb5c2('0x46')](_0xb5c2('0x78'));_0xcfcb8b['queuecallerexitreason']=_0xb5c2('0x9a');_0xcfcb8b[_0xb5c2('0x8f')]=!![];_0xcfcb8b[_0xb5c2('0x9b')]='FORWARD';_0xcfcb8b[_0xb5c2('0x9c')]=_0x1a1d9a[_0xb5c2('0x9d')];_0xcfcb8b[_0xb5c2('0x9e')]=_0x1a1d9a[_0xb5c2('0x45')];logger[_0xb5c2('0x69')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0xcfcb8b['name'],_0xcfcb8b[_0xb5c2('0x76')]);var _0x5a38c4=this[_0xb5c2('0x11')][_0x1a1d9a[_0xb5c2('0x95')]];this[_0xb5c2('0x11')][_0x1a1d9a['linkedid']]=this[_0xb5c2('0x11')][_0x1a1d9a[_0xb5c2('0x45')]];this[_0xb5c2('0x11')][_0x1a1d9a['uniqueid']]=_0x5a38c4;}}else{_0x11e82d[_0xb5c2('0x4b')]=_0xb5c2('0x9f')+_0x1a1d9a['reason']['toUpperCase']();logger[_0xb5c2('0x69')](_0xb5c2('0xa0'),_0x11e82d[_0xb5c2('0x4d')],_0x11e82d[_0xb5c2('0x76')],_0x11e82d[_0xb5c2('0x4b')]);}}}this[_0xb5c2('0x13')][_0x1a1d9a[_0xb5c2('0x45')]]=_0x11e82d;this[_0xb5c2('0x84')](_0x11e82d,_0xb5c2('0xa1'));}}}catch(_0xd0b72b){logger['error'](_0xb5c2('0xa2'),_0x1a1d9a['uniqueid'],util[_0xb5c2('0x3a')](_0xd0b72b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x24')]=function(_0x430f08){try{if(this['isNotNull'](_0x430f08)){logger['debug'](_0xb5c2('0xa3'),_0x430f08[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x430f08,{'showHidden':![],'depth':null}));this[_0xb5c2('0xa4')](_0x430f08['uniqueid'],_['keys'](_0x430f08['variable'])[0x0],_0x430f08['value']);if(this[_0xb5c2('0x11')][_0x430f08['uniqueid']]){var _0x422410=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x430f08[_0xb5c2('0x45')]]);if(_0x422410){if(this[_0xb5c2('0x5f')](_0x430f08[_0xb5c2('0xa5')])&&this[_0xb5c2('0x5f')](_0x430f08[_0xb5c2('0xa5')]['queuestatus'])){switch(_0x430f08[_0xb5c2('0xa6')]){case'CONTINUE':_0x422410['queuecallerexit']=![];_0x422410[_0xb5c2('0x97')]=null;break;case _0xb5c2('0xa7'):_0x422410['lastevent']=_0xb5c2('0xa8');_0x422410['queuecallerexit']=!![];_0x422410['queuecallerexitAt']=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));_0x422410['queuecallerleaveAt']=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));logger[_0xb5c2('0x5c')](_0xb5c2('0xa9'),_0x430f08[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x422410,{'showHidden':![],'depth':null}));ami[_0xb5c2('0x41')](_0xb5c2('0xaa'),_0x422410);break;default:_0x422410[_0xb5c2('0x96')]=!![];_0x422410[_0xb5c2('0x97')]=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));_0x422410[_0xb5c2('0x87')]=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));}_0x422410[_0xb5c2('0x8c')]=![];_0x422410[_0xb5c2('0x80')]=null;_0x422410['queuecallerexitreason']=_0x430f08['value'];this[_0xb5c2('0x13')][_0x430f08[_0xb5c2('0x45')]]=_0x422410;this[_0xb5c2('0x84')](_0x422410,_0xb5c2('0x23'));}else if(this[_0xb5c2('0x5f')](_0x430f08['variable'])&&this[_0xb5c2('0x5f')](_0x430f08[_0xb5c2('0xa5')][_0xb5c2('0xab')])){if(!_0x422410['queuecallerabandon']){_0x422410[_0xb5c2('0x96')]=!![];_0x422410[_0xb5c2('0x97')]=moment()[_0xb5c2('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x422410[_0xb5c2('0x4b')]=_0xb5c2('0xac');_0x422410[_0xb5c2('0x87')]=moment()['format'](_0xb5c2('0x78'));this[_0xb5c2('0x13')][_0x430f08[_0xb5c2('0x45')]]=_0x422410;}}logger[_0xb5c2('0x69')](_0xb5c2('0xad'),_0x430f08[_0xb5c2('0x45')],_0x422410['name'],_0x422410[_0xb5c2('0x76')],_[_0xb5c2('0xae')](_0x430f08['variable'])[0x0],_0x430f08[_0xb5c2('0xa6')]);_0x422410[_0xb5c2('0x16')]=this['variables'][_0x430f08['uniqueid']];}}}}catch(_0xf3ac7c){logger[_0xb5c2('0x3c')](_0xb5c2('0xa3'),_0x430f08[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0xf3ac7c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb5c2('0xa4')]=function(_0x9338a0,_0x1c3b6e,_0x227fe4){var _0x2c3936=[_0xb5c2('0xaf'),_0xb5c2('0xb0'),_0xb5c2('0xb1'),_0xb5c2('0xb2'),'rtpaudioqosloss',_0xb5c2('0xb3'),_0xb5c2('0xb4'),_0xb5c2('0xb5'),_0xb5c2('0xb6'),'sipuri',_0xb5c2('0xb7'),'bridgepvtcallid','membercalls','memberdynamic',_0xb5c2('0xb8'),_0xb5c2('0xb9'),_0xb5c2('0x8e'),_0xb5c2('0xba'),'memberrealtime'];if(!_['isNil'](_0x1c3b6e)&&!_[_0xb5c2('0xbb')](_0x2c3936,_0x1c3b6e)){if(_[_0xb5c2('0x75')](this[_0xb5c2('0x16')][_0x9338a0])){this[_0xb5c2('0x16')][_0x9338a0]={};}this['variables'][_0x9338a0][_0x1c3b6e]=_0x227fe4;}};VoiceQueueReport['prototype'][_0xb5c2('0x26')]=function(_0x19c402){try{if(this['isNotNull'](_0x19c402)){logger[_0xb5c2('0x5c')]('[%s][voiceQueueReport][hangup]',_0x19c402[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x19c402,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x11')][_0x19c402['uniqueid']]){for(var _0x542087=0x0,_0x555304={};_0x542087<this[_0xb5c2('0x11')][_0x19c402[_0xb5c2('0x45')]][_0xb5c2('0xbc')];_0x542087+=0x1){_0x555304=this[_0xb5c2('0x11')][_0x19c402['uniqueid']][_0x542087];if(this['voiceQueues'][_0x555304[_0xb5c2('0x6b')]]){if(_0x555304[_0xb5c2('0x96')]&&_0x555304[_0xb5c2('0x8f')]!=!![]){this['voiceQueues'][_0x555304[_0xb5c2('0x6b')]]['unmanaged']+=0x1;}if(_0x555304['queuecallerabandon']){this[_0xb5c2('0x14')][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0xbd')]+=0x1;}this[_0xb5c2('0x14')][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0xbe')]+=moment(_0x555304[_0xb5c2('0x87')])[_0xb5c2('0xbf')](_0x555304[_0xb5c2('0x77')],_0xb5c2('0x99'))||0x0;if(_0x542087===this[_0xb5c2('0x11')][_0x19c402[_0xb5c2('0x45')]][_0xb5c2('0xbc')]-0x1){this[_0xb5c2('0x14')][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0x56')]+=moment()[_0xb5c2('0xc0')](0x0)[_0xb5c2('0xbf')](_0x555304[_0xb5c2('0x77')],_0xb5c2('0x99'));this[_0xb5c2('0x14')][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0xc1')]+=0x1;if(_0x555304['queuecallercomplete']){this[_0xb5c2('0x14')][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0x52')]+=0x1;this[_0xb5c2('0x14')][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0x55')]+=moment()[_0xb5c2('0xc0')](0x0)[_0xb5c2('0xbf')](_0x555304[_0xb5c2('0x87')],'seconds');_0x555304[_0xb5c2('0x7d')]=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));_0x555304[_0xb5c2('0x96')]=![];_0x555304[_0xb5c2('0x97')]=null;}if(_0x555304[_0xb5c2('0x96')]&&_0x555304[_0xb5c2('0x8f')]!=!![]){_0x555304[_0xb5c2('0xc2')]=_0xb5c2('0x58');logger[_0xb5c2('0x5c')](_0xb5c2('0xc3'),_0x19c402[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x555304,{'showHidden':![],'depth':null}));ami[_0xb5c2('0x41')](_0xb5c2('0xc4'),_0x555304);}if(_0x555304[_0xb5c2('0x8c')]){_0x555304['lastevent']=_0xb5c2('0xbd');logger['debug']('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x19c402[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x555304,{'showHidden':![],'depth':null}));ami[_0xb5c2('0x41')](_0xb5c2('0xc5'),_0x555304);}}else{this[_0xb5c2('0x14')][_0x555304['queue']][_0xb5c2('0x56')]+=this['voiceQueues'][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0xbe')];}logger[_0xb5c2('0x69')](_0xb5c2('0xc6'),_0x19c402[_0xb5c2('0x45')],_0x555304[_0xb5c2('0x4d')],_0x555304[_0xb5c2('0x76')],_0x19c402['cause-txt']);this[_0xb5c2('0x13')][_0x19c402[_0xb5c2('0x45')]]=_0x555304;this['emitVoiceQueueChannelRemove'](_0x555304,_0xb5c2('0x25'));this[_0xb5c2('0x4f')](this['voiceQueues'][_0x555304[_0xb5c2('0x6b')]],'hangup');}}logger[_0xb5c2('0x5c')](_0xb5c2('0xc7'),_0x19c402['uniqueid'],util[_0xb5c2('0x3a')](this[_0xb5c2('0x11')][_0x19c402[_0xb5c2('0x45')]],{'showHidden':![],'depth':null}));ami[_0xb5c2('0x41')](_0xb5c2('0xc8'),this['queueReports'][_0x19c402[_0xb5c2('0x45')]]);if(_0x555304[_0xb5c2('0x4b')]==='ATTENDEDTRANSFER')return;delete this[_0xb5c2('0x11')][_0x19c402[_0xb5c2('0x45')]];delete this['channels'][_0x19c402['uniqueid']];}if(this['variables'][_0x19c402[_0xb5c2('0x45')]]){delete this[_0xb5c2('0x16')][_0x19c402[_0xb5c2('0x45')]];}}}catch(_0x8eea49){logger[_0xb5c2('0x3c')](_0xb5c2('0xc9'),_0x19c402['uniqueid'],util[_0xb5c2('0x3a')](_0x8eea49,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAttendedTransfer']=function(_0x4324b5){try{if(this[_0xb5c2('0x5f')](_0x4324b5)){logger[_0xb5c2('0x5c')]('[%s][voiceQueueReport][attendedtransfer]',_0x4324b5[_0xb5c2('0x45')],util['inspect'](_0x4324b5,{'showHidden':![],'depth':null}));var _0x2ceb97;var _0x2c449e;var _0xaf8ad8;if(this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xca')]]){_0x2ceb97=_[_0xb5c2('0x86')](this['queueReports'][_0x4324b5['transfereeuniqueid']]);_0x2ceb97[_0xb5c2('0x9c')]=_0x4324b5[_0xb5c2('0xcb')];_0x2ceb97[_0xb5c2('0x9e')]=_0x4324b5[_0xb5c2('0xcc')];_0x2ceb97[_0xb5c2('0x4b')]=_0xb5c2('0x4c');_0x2ceb97[_0xb5c2('0x8f')]=!![];_0x2ceb97[_0xb5c2('0x9b')]=_0xb5c2('0xcd');if(this[_0xb5c2('0x11')][_0x4324b5['secondtransfereruniqueid']]){_0xaf8ad8=this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xcc')]];this['queueReports'][_0x4324b5[_0xb5c2('0xcc')]]=this[_0xb5c2('0x11')][_0x4324b5['transfereeuniqueid']];this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xca')]]=_0xaf8ad8;_0x2c449e=_['last'](this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xca')]]);_0x2c449e[_0xb5c2('0xce')]=!![];}logger[_0xb5c2('0x69')](_0xb5c2('0xcf'),_0x4324b5[_0xb5c2('0x45')],_0x2ceb97['name'],_0x2ceb97[_0xb5c2('0x76')],_0x2ceb97['transferexten'],_0x2ceb97[_0xb5c2('0x9e')]);}else if(this[_0xb5c2('0x11')][_0x4324b5['transfertargetuniqueid']]){_0x2ceb97=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xd0')]]);_0x2ceb97[_0xb5c2('0x9c')]=_0x4324b5[_0xb5c2('0xd1')];_0x2ceb97[_0xb5c2('0x9e')]=_0x4324b5['origtransfereruniqueid'];_0x2ceb97[_0xb5c2('0x4b')]='ATTENDEDTRANSFER';_0x2ceb97[_0xb5c2('0x8f')]=!![];_0x2ceb97[_0xb5c2('0x9b')]='ATTENDED';if(this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xd2')]]){_0xaf8ad8=this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xd2')]];this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xd2')]]=this['queueReports'][_0x4324b5[_0xb5c2('0xd0')]];this['queueReports'][_0x4324b5['transfertargetuniqueid']]=_0xaf8ad8;_0x2c449e=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xd0')]]);_0x2c449e[_0xb5c2('0xce')]=!![];}logger['info'](_0xb5c2('0xcf'),_0x4324b5[_0xb5c2('0x45')],_0x2ceb97[_0xb5c2('0x4d')],_0x2ceb97[_0xb5c2('0x76')],_0x2ceb97[_0xb5c2('0x9c')],_0x2ceb97[_0xb5c2('0x9e')]);}else if(this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xd2')]]){_0x2ceb97=_[_0xb5c2('0x86')](this['queueReports'][_0x4324b5[_0xb5c2('0xd2')]]);_0x2ceb97[_0xb5c2('0x9c')]=_0x4324b5[_0xb5c2('0xd1')];_0x2ceb97[_0xb5c2('0x9e')]=_0x4324b5[_0xb5c2('0xd2')];_0x2ceb97[_0xb5c2('0x4b')]=_0xb5c2('0x4c');_0x2ceb97[_0xb5c2('0x8f')]=!![];_0x2ceb97[_0xb5c2('0x9b')]=_0xb5c2('0xcd');}else if(this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xcc')]]){_0x2ceb97=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xcc')]]);_0x2ceb97[_0xb5c2('0x9c')]=_0x4324b5[_0xb5c2('0xcb')];_0x2ceb97[_0xb5c2('0x9e')]=_0x4324b5[_0xb5c2('0xcc')];_0x2ceb97[_0xb5c2('0x4b')]='ATTENDEDTRANSFER';_0x2ceb97[_0xb5c2('0x8f')]=!![];_0x2ceb97[_0xb5c2('0x9b')]='ATTENDED';}}}catch(_0x1ea123){logger[_0xb5c2('0x3c')](_0xb5c2('0xd3'),_0x4324b5[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x1ea123,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0xd4')]=function(_0x33964f){try{if(this[_0xb5c2('0x5f')](_0x33964f)){logger['debug']('[%s][voiceQueueReport][blindtransfer]',_0x33964f[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x33964f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x33964f[_0xb5c2('0xca')]]){var _0x494284=_[_0xb5c2('0x86')](this['queueReports'][_0x33964f[_0xb5c2('0xca')]]);_0x494284['queuecallerexitreason']=_0xb5c2('0xd5');_0x494284[_0xb5c2('0x8f')]=!![];_0x494284[_0xb5c2('0x9b')]=_0xb5c2('0xd6');_0x494284[_0xb5c2('0x9c')]=_0x33964f[_0xb5c2('0xd7')];_0x494284[_0xb5c2('0x9e')]=_0x33964f[_0xb5c2('0xca')];logger[_0xb5c2('0x69')](_0xb5c2('0xd8'),_0x33964f[_0xb5c2('0x45')],_0x494284['name'],_0x494284[_0xb5c2('0x76')],_0x494284['transferexten'],_0x494284[_0xb5c2('0x9e')]);this[_0xb5c2('0x26')]({'event':_0xb5c2('0xd9'),'uniqueid':_0x33964f[_0xb5c2('0xca')],'context':_0x33964f[_0xb5c2('0xda')],'channel':_0x33964f[_0xb5c2('0xdb')]});}}}catch(_0x4b3c9a){logger[_0xb5c2('0x3c')]('[%s][voiceQueueReport][blindtransfer]',_0x33964f['uniqueid'],util[_0xb5c2('0x3a')](_0x4b3c9a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x28')]=function(_0x1f31c8){try{if(this['isNotNull'](_0x1f31c8)){logger[_0xb5c2('0x5c')]('[%s][voiceQueueReport][musiconholdstart]',_0x1f31c8[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x1f31c8,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1f31c8[_0xb5c2('0x45')]]){var _0x458556=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x1f31c8['uniqueid']]);if(!_[_0xb5c2('0x35')](_0x458556['queuecallerleaveAt'])){_0x458556[_0xb5c2('0xdc')]=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));logger[_0xb5c2('0x69')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x1f31c8[_0xb5c2('0x45')],_0x458556[_0xb5c2('0xdc')]);}}}}catch(_0x43257d){logger[_0xb5c2('0x3c')](_0xb5c2('0xdd'),_0x1f31c8[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x43257d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0xde')]=function(_0x172ac0){try{if(this[_0xb5c2('0x5f')](_0x172ac0)){logger['debug']('[%s][voiceQueueReport][musiconholdstop]',_0x172ac0[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x172ac0,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x11')][_0x172ac0[_0xb5c2('0x45')]]){var _0x50eb79=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x172ac0[_0xb5c2('0x45')]]);if(!_['isNil'](_0x50eb79['mohstarttime'])){_0x50eb79[_0xb5c2('0xdf')]+=moment()[_0xb5c2('0xc0')](0x0)[_0xb5c2('0xbf')](_0x50eb79[_0xb5c2('0xdc')],_0xb5c2('0x99'));logger[_0xb5c2('0x69')](_0xb5c2('0xe0'),_0x172ac0[_0xb5c2('0x45')],_0x50eb79['mohtime']);delete _0x50eb79[_0xb5c2('0xdc')];}}}}catch(_0x2848c9){logger[_0xb5c2('0x3c')](_0xb5c2('0xe1'),_0x172ac0[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x2848c9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb5c2('0xe2')]=function(_0x22fc61){try{if(this['isNotNull'](_0x22fc61)){logger[_0xb5c2('0x5c')](_0xb5c2('0xe3'),_0x22fc61[_0xb5c2('0x45')],util['inspect'](_0x22fc61,{'showHidden':![],'depth':null}));if(_0x22fc61[_0xb5c2('0xe4')]['toLowerCase']()==='set'){_0x22fc61[_0xb5c2('0xe5')]=_0x22fc61[_0xb5c2('0xe6')]&&_0x22fc61['appdata'][_0xb5c2('0xe7')]('CDR(routeAlias)')?_0x22fc61[_0xb5c2('0xe6')]:(_0x22fc61['appdata']||_0x22fc61[_0xb5c2('0xe5')])[_0xb5c2('0x93')]();if(_[_0xb5c2('0xe7')](_0x22fc61[_0xb5c2('0xe5')][_0xb5c2('0x93')](),_0xb5c2('0xe8'))){logger[_0xb5c2('0x69')](_0xb5c2('0xe9'),_0x22fc61[_0xb5c2('0x45')],_0x22fc61[_0xb5c2('0xe4')],_0x22fc61[_0xb5c2('0xe5')]);if(_[_0xb5c2('0x75')](this[_0xb5c2('0x13')][_0x22fc61[_0xb5c2('0x45')]]))this[_0xb5c2('0x13')][_0x22fc61['uniqueid']]={};var _0x4347b5=_0x22fc61[_0xb5c2('0xe5')][_0xb5c2('0xea')]('=');var _0x58b8a5=_0x4347b5[0x0]['toLowerCase']()['match'](/cdr\((.*)\)/);if(_0x58b8a5)this['channels'][_0x22fc61[_0xb5c2('0x45')]][_0x58b8a5[0x1]]=_0x4347b5[0x1];}}}}catch(_0x41a686){logger['error']('[%s][voiceQueueReport][newexten]',_0x22fc61[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x41a686,{'showHidden':![],'depth':null}));}};module[_0xb5c2('0xeb')]=VoiceQueueReport;