05816302862a690ee7a8eebf6c23cb2db5a8b989
[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 _0x28e8=['merge','pick','keys','push','[%s][voiceQueueReport][queuecallerjoin]','queuecallercompleteAt','holdtime','originalposition','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','last','queuecallercomplete','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','lastAssignedTo','membername','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','toLowerCase','local/','linkedid','queuecallerexit','add','FORWARDTRANSFER','transfertype','FORWARD','transferexten','transferuniqueid','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','syncVarSet','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberpenalty','memberrealtime','length','unmanaged','diff','seconds','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','handleHangup','cause-txt','cause','transferid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','switch','origtransfererexten','origtransfereruniqueid','transfertargetuniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstop]','mohtime','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','startsWith','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','prototype','clearZombieChannels','isNil','Action','status','catch','message','error','[%s][voiceQueueReport][checkChannel]','[%s][voiceQueueReport][checkQueueReport]','inspect','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','emitVoiceQueueChannelRemove',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','total','abandoned','Trunk','active','callerid','Interval','stringify','md5','debug','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s'];(function(_0x340fc7,_0x12a901){var _0x586c93=function(_0xc3a679){while(--_0xc3a679){_0x340fc7['push'](_0x340fc7['shift']());}};_0x586c93(++_0x12a901);}(_0x28e8,0x77));var _0x828e=function(_0x336712,_0x4ad2f0){_0x336712=_0x336712-0x0;var _0x4ae857=_0x28e8[_0x336712];return _0x4ae857;};'use strict';var _=require(_0x828e('0x0'));var moment=require(_0x828e('0x1'));var util=require(_0x828e('0x2'));var md5=require('md5');var Redis=require(_0x828e('0x3'));var config=require(_0x828e('0x4'));var logger=require(_0x828e('0x5'))(_0x828e('0x6'));var ami=require(_0x828e('0x7'));var QueueReport=require(_0x828e('0x8'));config[_0x828e('0x9')]=_[_0x828e('0xa')](config[_0x828e('0x9')],{'host':_0x828e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x828e('0x9')]));var Sequence=function(){};Sequence['prototype'][_0x828e('0xc')]=function(_0x59a3af){this['tail']=this[_0x828e('0xd')]?this['tail'][_0x828e('0xe')](_0x59a3af):_0x59a3af();};function VoiceQueueReport(_0x5a2f23){this[_0x828e('0xf')]=new Sequence();this[_0x828e('0x10')]={};this[_0x828e('0x11')]=_0x5a2f23['agents'];this[_0x828e('0x12')]=_0x5a2f23[_0x828e('0x13')];this[_0x828e('0x14')]=_0x5a2f23[_0x828e('0x14')];this[_0x828e('0x15')]=!![];this[_0x828e('0x16')]=_0x5a2f23[_0x828e('0x16')];this[_0x828e('0x17')]={};ami['on'](_0x828e('0x18'),this[_0x828e('0x19')][_0x828e('0x1a')](this));ami['on']('queuesummarycomplete',this[_0x828e('0x1b')]['bind'](this));ami['on']('queuecallerjoin',this[_0x828e('0x1c')]['bind'](this));ami['on'](_0x828e('0x1d'),this[_0x828e('0x1e')]['bind'](this));ami['on'](_0x828e('0x1f'),this[_0x828e('0x20')][_0x828e('0x1a')](this));ami['on'](_0x828e('0x21'),this[_0x828e('0x22')][_0x828e('0x1a')](this));ami['on'](_0x828e('0x23'),this['syncAgentConnect'][_0x828e('0x1a')](this));ami['on'](_0x828e('0x24'),this['syncVarSet'][_0x828e('0x1a')](this));ami['on'](_0x828e('0x25'),this[_0x828e('0x26')][_0x828e('0x1a')](this));ami['on'](_0x828e('0x27'),this[_0x828e('0x28')]['bind'](this));ami['on'](_0x828e('0x29'),this[_0x828e('0x2a')][_0x828e('0x1a')](this));ami['on'](_0x828e('0x2b'),this[_0x828e('0x2c')][_0x828e('0x1a')](this));ami['on'](_0x828e('0x2d'),this[_0x828e('0x2e')][_0x828e('0x1a')](this));ami['on'](_0x828e('0x2f'),this[_0x828e('0x30')]['bind'](this));this[_0x828e('0x31')]();this[_0x828e('0x32')]();}function clearChannels(_0x48250a){if(!_[_0x828e('0x33')](_0x48250a)){for(var _0x129cdb in _0x48250a){if(_0x48250a[_0x828e('0x34')](_0x129cdb)){delete _0x48250a[_0x129cdb];}}}}function clearCampaigns(_0x595c8f){if(!_[_0x828e('0x33')](_0x595c8f)){for(var _0x15550f in _0x595c8f){if(_0x595c8f['hasOwnProperty'](_0x15550f)){_0x595c8f[_0x15550f][_0x828e('0x35')]=0x0;}}}}function clearVoiceQueues(_0x11907d){if(!_[_0x828e('0x33')](_0x11907d)){for(var _0x4b68cd in _0x11907d){if(_0x11907d[_0x828e('0x34')](_0x4b68cd)){_0x11907d[_0x4b68cd]['originated']=0x0;_0x11907d[_0x4b68cd][_0x828e('0x36')]=0x0;_0x11907d[_0x4b68cd][_0x828e('0x37')]=0x0;_0x11907d[_0x4b68cd][_0x828e('0x38')]=0x0;_0x11907d[_0x4b68cd][_0x828e('0x39')]=!![];}}}}function clearAgentBooked(_0x4e5aa7){if(!_[_0x828e('0x33')](_0x4e5aa7)){for(var _0x1c1996 in _0x4e5aa7){if(_0x4e5aa7[_0x828e('0x34')](_0x1c1996)){_0x4e5aa7[_0x1c1996][_0x828e('0x3a')]=!![];}}}}VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x3c')]=function(){var _0xd4869d=this;for(var _0x48feef in this[_0x828e('0x12')]){if(this[_0x828e('0x12')][_0x828e('0x34')](_0x48feef)&&!this[_0x828e('0x12')][_0x48feef]['switch']){this[_0x828e('0xf')][_0x828e('0xc')](function(){if(!_[_0x828e('0x3d')](_0xd4869d[_0x828e('0x12')][_0x48feef])){return ami[_0x828e('0x3e')]({'action':_0x828e('0x3f'),'channel':_0xd4869d['channels'][_0x48feef]['channel']})[_0x828e('0x40')](function(_0xaa9624){if(_0xaa9624[_0x828e('0x41')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xd4869d[_0x828e('0x12')][_0x48feef]){delete _0xd4869d[_0x828e('0x12')][_0x48feef];logger[_0x828e('0x42')](_0x828e('0x43'),_0x48feef,util['inspect'](_0xaa9624,{'showHidden':![],'depth':null}));}if(_0xd4869d[_0x828e('0x10')][_0x48feef]){delete _0xd4869d[_0x828e('0x10')][_0x48feef];logger[_0x828e('0x42')](_0x828e('0x44'),_0x48feef,util[_0x828e('0x45')](_0xaa9624,{'showHidden':![],'depth':null}));}if(_0xd4869d['variables'][_0x48feef]){delete _0xd4869d[_0x828e('0x17')][_0x48feef];logger[_0x828e('0x42')](_0x828e('0x46'),_0x48feef,util[_0x828e('0x45')](_0xaa9624,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x28')]=function(){logger['error'](_0x828e('0x47'));clearChannels(this[_0x828e('0x12')]);this['clearQueueReport'](this[_0x828e('0x10')]);clearAgentBooked(this[_0x828e('0x11')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x828e('0x16')]);};VoiceQueueReport['prototype']['clearQueueReport']=function(_0x2ec370){var _0xc2f4c0=this;if(!_[_0x828e('0x33')](_0x2ec370)){for(var _0x1a100c in _0x2ec370){if(_0x2ec370['hasOwnProperty'](_0x1a100c)){_0xc2f4c0['emitVoiceQueueChannelRemove'](_0x2ec370[_0x1a100c],'clearqueuereport');delete _0x2ec370[_0x1a100c];}}}};VoiceQueueReport['prototype']['emit']=function(_0xff06a,_0x12553b,_0x3b54a9){io['to'](_0xff06a)[_0x828e('0x48')](_0x12553b,_0x3b54a9);};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x49')]=function(_0x108ad2,_0x1569e1){logger['debug'](_0x828e('0x4a')+_0x1569e1+_0x828e('0x4b'),_0x108ad2[_0x828e('0x4c')],util[_0x828e('0x45')](_0x108ad2,{'showHidden':![],'depth':null}));this['emit'](util[_0x828e('0x4d')](_0x828e('0x4e'),_0x108ad2[_0x828e('0x4f')]),'voice_queue_channel:save',_0x108ad2);io[_0x828e('0x48')]('voice_queue_presence:save',_0x108ad2);};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x50')]=function(_0x1608fc,_0x2051fa){logger['debug'](_0x828e('0x4a')+_0x2051fa+_0x828e('0x51'),_0x1608fc['uniqueid'],util[_0x828e('0x45')](_0x1608fc,{'showHidden':![],'depth':null}));if(_0x1608fc[_0x828e('0x52')]===_0x828e('0x53'))return;this[_0x828e('0x48')](util[_0x828e('0x4d')]('voice:queue:%s',_0x1608fc[_0x828e('0x4f')]),_0x828e('0x54'),_0x1608fc);io[_0x828e('0x48')](_0x828e('0x55'),_0x1608fc);};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x56')]=function(_0x47bd26,_0x15e407){if(_0x47bd26[_0x828e('0x57')]===_0x828e('0x58')){var _0x1bff74={'id':_0x47bd26['id'],'name':_0x47bd26[_0x828e('0x4f')],'strategy':_0x47bd26[_0x828e('0x59')],'answered':_0x47bd26[_0x828e('0x5a')],'available':_0x47bd26[_0x828e('0x5b')],'loggedIn':_0x47bd26[_0x828e('0x5c')],'pTalking':_0x47bd26[_0x828e('0x37')],'sumBillable':_0x47bd26[_0x828e('0x5d')],'sumDuration':_0x47bd26['sumDuration'],'sumHoldTime':_0x47bd26[_0x828e('0x5e')]||0x0,'talking':_0x47bd26[_0x828e('0x36')],'total':_0x47bd26[_0x828e('0x5f')],'type':_0x47bd26['type'],'unmanaged':_0x47bd26['unmanaged'],'abandoned':_0x47bd26[_0x828e('0x60')],'waiting':_0x47bd26[_0x828e('0x38')]};if(_0x47bd26[_0x828e('0x61')]){_0x1bff74[_0x828e('0x61')]={'id':_0x47bd26[_0x828e('0x61')]['id'],'name':_0x47bd26[_0x828e('0x61')][_0x828e('0x4f')],'active':_0x47bd26[_0x828e('0x61')][_0x828e('0x62')],'callerid':_0x47bd26[_0x828e('0x61')][_0x828e('0x63')]};}if(_0x47bd26[_0x828e('0x64')]){_0x1bff74[_0x828e('0x64')]={'id':_0x47bd26[_0x828e('0x64')]['id'],'name':_0x47bd26[_0x828e('0x64')][_0x828e('0x4f')]};}var _0x38f6a6=md5(JSON[_0x828e('0x65')](_0x1bff74));if(_0x47bd26[_0x828e('0x66')]!==_0x38f6a6){_0x47bd26[_0x828e('0x66')]=_0x38f6a6;logger[_0x828e('0x67')](_0x828e('0x68')+_0x15e407+_0x828e('0x69'),util[_0x828e('0x45')](_0x1bff74,{'showHidden':![],'depth':null}));this['emit'](util[_0x828e('0x4d')](_0x828e('0x4e'),_0x1bff74['name']),_0x828e('0x6a'),_0x1bff74);}}};VoiceQueueReport['prototype'][_0x828e('0x6b')]=function(_0x4fb774){return _0x4fb774!==null&&!_[_0x828e('0x6c')](_0x4fb774);};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x32')]=function(){var _0x2f7e79=this;setInterval(function(){_0x2f7e79[_0x828e('0x3c')]();ami[_0x828e('0x3e')]({'action':_0x828e('0x6d')})[_0x828e('0x40')](function(_0x4c822e){logger[_0x828e('0x42')](_0x828e('0x6e'),util['inspect'](_0x4c822e,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x31')]=function(){var _0x2e27fd=this;setInterval(function(){if(_0x2e27fd['flagQueueSummary']){return ami[_0x828e('0x3e')]({'action':_0x828e('0x18')})[_0x828e('0x6f')](function(){_0x2e27fd[_0x828e('0x15')]=![];})['catch'](function(_0x673131){logger['error'](_0x828e('0x70'),util['inspect'](_0x673131,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x19')]=function(_0xb2315){try{if(this[_0x828e('0x6b')](_0xb2315)&&this[_0x828e('0x6b')](_0xb2315[_0x828e('0x71')])){logger[_0x828e('0x67')]('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0xb2315,{'showHidden':![],'depth':null}));if(this[_0x828e('0x14')][_0xb2315[_0x828e('0x71')]]){logger[_0x828e('0x72')](_0x828e('0x73'),_0xb2315[_0x828e('0x71')]);var _0x16ce63=_[_0x828e('0x74')](this[_0x828e('0x12')],_0x828e('0x71'))[_0xb2315[_0x828e('0x71')]]||0x0;var _0x1acc39=_0x16ce63-_0xb2315[_0x828e('0x75')];if(this[_0x828e('0x14')][_0xb2315['queue']]['waiting']!==_[_0x828e('0x76')](_0xb2315[_0x828e('0x75')])||this[_0x828e('0x14')][_0xb2315[_0x828e('0x71')]][_0x828e('0x5c')]!==_[_0x828e('0x76')](_0xb2315['loggedin'])||this[_0x828e('0x14')][_0xb2315[_0x828e('0x71')]]['available']!==_[_0x828e('0x76')](_0xb2315[_0x828e('0x5b')])||this[_0x828e('0x14')][_0xb2315[_0x828e('0x71')]]['talking']!==_0x1acc39){this[_0x828e('0x14')][_0xb2315['queue']][_0x828e('0x38')]=_[_0x828e('0x76')](_0xb2315['callers']);this['voiceQueues'][_0xb2315[_0x828e('0x71')]]['loggedIn']=_['toNumber'](_0xb2315[_0x828e('0x77')]);this[_0x828e('0x14')][_0xb2315[_0x828e('0x71')]][_0x828e('0x5b')]=_[_0x828e('0x76')](_0xb2315[_0x828e('0x5b')]);this['voiceQueues'][_0xb2315[_0x828e('0x71')]][_0x828e('0x36')]=_0x1acc39>0x0?_0x1acc39:0x0;this[_0x828e('0x14')][_0xb2315[_0x828e('0x71')]][_0x828e('0x36')]=this[_0x828e('0x14')][_0xb2315['queue']][_0x828e('0x36')]>_[_0x828e('0x76')](_0xb2315['loggedin'])?_[_0x828e('0x76')](_0xb2315[_0x828e('0x77')]):this[_0x828e('0x14')][_0xb2315['queue']][_0x828e('0x36')];this[_0x828e('0x56')](this['voiceQueues'][_0xb2315[_0x828e('0x71')]],_0x828e('0x18'));}logger['debug'](_0x828e('0x78'),util[_0x828e('0x45')](this[_0x828e('0x14')][_0xb2315[_0x828e('0x71')]],{'showHidden':![],'depth':null}));ami['emit'](_0x828e('0x79'),this[_0x828e('0x14')][_0xb2315[_0x828e('0x71')]]);}}}catch(_0x55bd50){logger['error'](_0x828e('0x70'),util[_0x828e('0x45')](_0x55bd50,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x828e('0x3b')]['syncQueueSummaryComplete']=function(_0x2b3221){logger['debug'](_0x828e('0x7a'),util[_0x828e('0x45')](_0x2b3221,{'showHidden':![],'depth':null}));ami[_0x828e('0x48')](_0x828e('0x7b'),{});this[_0x828e('0x15')]=!![];};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x1c')]=function(_0x25e7cf){try{if(this[_0x828e('0x6b')](_0x25e7cf)){logger[_0x828e('0x67')]('[%s][voiceQueueReport][queuecallerjoin]',_0x25e7cf[_0x828e('0x4c')],util['inspect'](_0x25e7cf,{'showHidden':![],'depth':null}));if(_[_0x828e('0x6c')](this[_0x828e('0x10')][_0x25e7cf[_0x828e('0x4c')]]))this['queueReports'][_0x25e7cf[_0x828e('0x4c')]]=[];if(_[_0x828e('0x6c')](this[_0x828e('0x12')][_0x25e7cf[_0x828e('0x4c')]]))this['channels'][_0x25e7cf[_0x828e('0x4c')]]={};var _0x2a26d6=new QueueReport();_0x2a26d6[_0x828e('0x4f')]=_0x25e7cf['queue'];_0x2a26d6[_0x828e('0x57')]=this[_0x828e('0x14')][_0x2a26d6['name']]&&this[_0x828e('0x14')][_0x2a26d6[_0x828e('0x4f')]][_0x828e('0x57')]?this[_0x828e('0x14')][_0x2a26d6['name']][_0x828e('0x57')]||_0x828e('0x58'):_0x828e('0x58');_0x2a26d6[_0x828e('0x71')]=_0x25e7cf[_0x828e('0x71')];_0x2a26d6[_0x828e('0x7c')]=moment()[_0x828e('0x4d')](_0x828e('0x7d'));_0x2a26d6[_0x828e('0x7e')]=_0x25e7cf['position'];_0x2a26d6[_0x828e('0x7f')]=_0x25e7cf['count'];_0x2a26d6['uniqueid']=_0x25e7cf[_0x828e('0x4c')];_0x2a26d6[_0x828e('0x80')]=this[_0x828e('0x12')][_0x25e7cf['uniqueid']]['routealias'];logger[_0x828e('0x72')](_0x828e('0x81'),_0x2a26d6[_0x828e('0x4f')],_0x2a26d6[_0x828e('0x57')]);_[_0x828e('0x82')](_0x2a26d6,_[_0x828e('0x83')](_0x25e7cf,_[_0x828e('0x84')](_0x2a26d6)));this[_0x828e('0x10')][_0x25e7cf[_0x828e('0x4c')]][_0x828e('0x85')](_0x2a26d6);this[_0x828e('0x12')][_0x25e7cf[_0x828e('0x4c')]]=_0x2a26d6;this[_0x828e('0x49')](_0x2a26d6,'queuecallerjoin');}}catch(_0xddebf3){logger['error'](_0x828e('0x86'),_0x25e7cf[_0x828e('0x4c')],util[_0x828e('0x45')](_0xddebf3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x1e')]=function(_0x44c55f){try{if(this[_0x828e('0x6b')](_0x44c55f)){logger[_0x828e('0x67')]('[%s][voiceQueueReport][queuecallerabandon]',_0x44c55f['uniqueid'],util[_0x828e('0x45')](_0x44c55f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x44c55f['uniqueid']]){var _0x4ba44f=_['last'](this['queueReports'][_0x44c55f[_0x828e('0x4c')]]);_0x4ba44f['queuecallercomplete']=![];_0x4ba44f[_0x828e('0x87')]=null;_0x4ba44f['holdtime']=_0x44c55f[_0x828e('0x88')];_0x4ba44f[_0x828e('0x89')]=_0x44c55f[_0x828e('0x89')];_0x4ba44f[_0x828e('0x1d')]=!![];_0x4ba44f['queuecallerabandonAt']=moment()[_0x828e('0x4d')](_0x828e('0x7d'));_0x4ba44f[_0x828e('0x52')]=_0x828e('0x8a');_0x4ba44f['lastAssignedTo']=null;logger[_0x828e('0x72')](_0x828e('0x8b'),_0x4ba44f[_0x828e('0x4f')],_0x4ba44f[_0x828e('0x57')]);this['channels'][_0x44c55f['uniqueid']]=_0x4ba44f;this['emitVoiceQueueChannelRemove'](_0x4ba44f,_0x828e('0x1d'));}}}catch(_0x34a50f){logger[_0x828e('0x42')](_0x828e('0x8c'),_0x44c55f[_0x828e('0x4c')],util[_0x828e('0x45')](_0x34a50f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x20')]=function(_0x18631c){try{if(this[_0x828e('0x6b')](_0x18631c)){logger['debug'](_0x828e('0x8d'),_0x18631c[_0x828e('0x4c')],util['inspect'](_0x18631c,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x18631c[_0x828e('0x4c')]]){var _0x512379=_['last'](this[_0x828e('0x10')][_0x18631c[_0x828e('0x4c')]]);_0x512379[_0x828e('0x8e')]=moment()['format'](_0x828e('0x7d'));_0x512379[_0x828e('0x8f')]=_0x18631c[_0x828e('0x8f')];_0x512379[_0x828e('0x90')]=_0x18631c[_0x828e('0x90')];logger['info'](_0x828e('0x91'),_0x512379[_0x828e('0x4f')],_0x512379[_0x828e('0x57')],_0x18631c[_0x828e('0x8f')],_0x18631c[_0x828e('0x90')]);this['channels'][_0x18631c[_0x828e('0x4c')]]=_0x512379;this['emitVoiceQueueChannelSave'](_0x512379,_0x828e('0x1f'));}}}catch(_0x5f5c1e){logger[_0x828e('0x42')](_0x828e('0x8d'),_0x18631c[_0x828e('0x4c')],util['inspect'](_0x5f5c1e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x828e('0x92')]=function(_0xae5e75){try{if(this[_0x828e('0x6b')](_0xae5e75)){logger[_0x828e('0x67')](_0x828e('0x93'),_0xae5e75[_0x828e('0x4c')],util['inspect'](_0xae5e75,{'showHidden':![],'depth':null}));if(this[_0x828e('0x10')][_0xae5e75['uniqueid']]){var _0x364547=_[_0x828e('0x94')](this[_0x828e('0x10')][_0xae5e75[_0x828e('0x4c')]]);_0x364547[_0x828e('0x95')]=!![];_0x364547['queuecallerexitreason']='COMPLETEDBYAGENT';logger[_0x828e('0x72')](_0x828e('0x96'),_0x364547[_0x828e('0x4f')],_0x364547['type']);}}}catch(_0x20e043){logger[_0x828e('0x42')](_0x828e('0x93'),_0xae5e75[_0x828e('0x4c')],util[_0x828e('0x45')](_0x20e043,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x831777){try{if(this['isNotNull'](_0x831777)){logger['debug'](_0x828e('0x97'),_0x831777[_0x828e('0x4c')],util['inspect'](_0x831777,{'showHidden':![],'depth':null}));if(this[_0x828e('0x10')][_0x831777['uniqueid']]){var _0x2da7c0=_[_0x828e('0x94')](this[_0x828e('0x10')][_0x831777[_0x828e('0x4c')]]);_0x2da7c0[_0x828e('0x1d')]=![];_0x2da7c0[_0x828e('0x98')]=null;_0x2da7c0['assigned']=!![];_0x2da7c0[_0x828e('0x99')]=_0x831777[_0x828e('0x9a')];_0x2da7c0[_0x828e('0x88')]=_0x831777[_0x828e('0x88')];_0x2da7c0[_0x828e('0x95')]=!![];_0x2da7c0['queuecallerexit']=![];_0x2da7c0[_0x828e('0x9b')]=null;if(!_0x2da7c0[_0x828e('0x9c')]){if(_0x831777[_0x828e('0x9d')]=='transfer'){_0x2da7c0[_0x828e('0x52')]='COMPLETED';logger['info'](_0x828e('0x9e'),_0x2da7c0['name'],_0x2da7c0[_0x828e('0x57')]);}else{if(_['startsWith'](_0x831777['channel'][_0x828e('0x9f')](),_0x828e('0xa0'))){if(this[_0x828e('0x10')][_0x831777[_0x828e('0xa1')]]){var _0x1a75c1=_['last'](this[_0x828e('0x10')][_0x831777[_0x828e('0xa1')]]);_0x1a75c1['queuecallercomplete']=![];_0x1a75c1[_0x828e('0xa2')]=!![];_0x1a75c1[_0x828e('0x9b')]=moment(_0x2da7c0[_0x828e('0x7c')])[_0x828e('0xa3')](_0x831777[_0x828e('0x88')],'seconds')[_0x828e('0x4d')](_0x828e('0x7d'));_0x1a75c1[_0x828e('0x52')]=_0x828e('0xa4');_0x1a75c1['transfer']=!![];_0x1a75c1[_0x828e('0xa5')]=_0x828e('0xa6');_0x1a75c1[_0x828e('0xa7')]=_0x831777['destexten'];_0x1a75c1[_0x828e('0xa8')]=_0x831777['uniqueid'];logger[_0x828e('0x72')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x1a75c1['name'],_0x1a75c1[_0x828e('0x57')]);var _0x322c9d=this[_0x828e('0x10')][_0x831777[_0x828e('0xa1')]];this[_0x828e('0x10')][_0x831777['linkedid']]=this[_0x828e('0x10')][_0x831777[_0x828e('0x4c')]];this[_0x828e('0x10')][_0x831777[_0x828e('0x4c')]]=_0x322c9d;}}else{_0x2da7c0[_0x828e('0x52')]=_0x828e('0xa9')+_0x831777[_0x828e('0x9d')][_0x828e('0xaa')]();logger['info'](_0x828e('0xab'),_0x2da7c0[_0x828e('0x4f')],_0x2da7c0['type'],_0x2da7c0['queuecallerexitreason']);}}}this[_0x828e('0x12')][_0x831777[_0x828e('0x4c')]]=_0x2da7c0;this[_0x828e('0x50')](_0x2da7c0,_0x828e('0x21'));}}}catch(_0x2ad942){logger[_0x828e('0x42')](_0x828e('0x97'),_0x831777[_0x828e('0x4c')],util[_0x828e('0x45')](_0x2ad942,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0xac')]=function(_0x27ff2f){try{if(this['isNotNull'](_0x27ff2f)){logger[_0x828e('0x67')](_0x828e('0xad'),_0x27ff2f[_0x828e('0x4c')],util['inspect'](_0x27ff2f,{'showHidden':![],'depth':null}));this[_0x828e('0xae')](_0x27ff2f['uniqueid'],_['keys'](_0x27ff2f[_0x828e('0xaf')])[0x0],_0x27ff2f[_0x828e('0xb0')]);if(this[_0x828e('0x10')][_0x27ff2f[_0x828e('0x4c')]]){var _0x5e541d=_[_0x828e('0x94')](this['queueReports'][_0x27ff2f[_0x828e('0x4c')]]);if(_0x5e541d){if(this['isNotNull'](_0x27ff2f[_0x828e('0xaf')])&&this['isNotNull'](_0x27ff2f['variable'][_0x828e('0xb1')])){switch(_0x27ff2f[_0x828e('0xb0')]){case _0x828e('0xb2'):_0x5e541d[_0x828e('0xa2')]=![];_0x5e541d[_0x828e('0x9b')]=null;break;case _0x828e('0xb3'):_0x5e541d[_0x828e('0xb4')]=_0x828e('0xb5');_0x5e541d[_0x828e('0xa2')]=!![];_0x5e541d['queuecallerexitAt']=moment()[_0x828e('0x4d')](_0x828e('0x7d'));_0x5e541d[_0x828e('0x8e')]=moment()['format'](_0x828e('0x7d'));logger[_0x828e('0x67')](_0x828e('0xb6'),_0x27ff2f[_0x828e('0x4c')],util[_0x828e('0x45')](_0x5e541d,{'showHidden':![],'depth':null}));ami[_0x828e('0x48')]('custom:timeout',_0x5e541d);break;default:_0x5e541d[_0x828e('0xa2')]=!![];_0x5e541d['queuecallerexitAt']=moment()[_0x828e('0x4d')](_0x828e('0x7d'));_0x5e541d[_0x828e('0x8e')]=moment()[_0x828e('0x4d')](_0x828e('0x7d'));}_0x5e541d[_0x828e('0x1d')]=![];_0x5e541d[_0x828e('0x98')]=null;_0x5e541d[_0x828e('0x52')]=_0x27ff2f[_0x828e('0xb0')];this[_0x828e('0x12')][_0x27ff2f[_0x828e('0x4c')]]=_0x5e541d;this[_0x828e('0x50')](_0x5e541d,'varset');}else if(this[_0x828e('0x6b')](_0x27ff2f[_0x828e('0xaf')])&&this['isNotNull'](_0x27ff2f[_0x828e('0xaf')]['queueposition'])){if(!_0x5e541d[_0x828e('0x1d')]){_0x5e541d[_0x828e('0xa2')]=!![];_0x5e541d['queuecallerexitAt']=moment()[_0x828e('0x4d')](_0x828e('0x7d'));_0x5e541d['queuecallerexitreason']=_0x828e('0xb7');_0x5e541d[_0x828e('0x8e')]=moment()['format'](_0x828e('0x7d'));this[_0x828e('0x12')][_0x27ff2f[_0x828e('0x4c')]]=_0x5e541d;}}logger[_0x828e('0x72')](_0x828e('0xb8'),_0x27ff2f[_0x828e('0x4c')],_0x5e541d[_0x828e('0x4f')],_0x5e541d[_0x828e('0x57')],_[_0x828e('0x84')](_0x27ff2f[_0x828e('0xaf')])[0x0],_0x27ff2f['value']);_0x5e541d[_0x828e('0x17')]=this[_0x828e('0x17')][_0x27ff2f[_0x828e('0x4c')]];}}}}catch(_0x3eadd6){logger['error'](_0x828e('0xad'),_0x27ff2f[_0x828e('0x4c')],util['inspect'](_0x3eadd6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x828e('0xae')]=function(_0x2d8c66,_0x53e4a1,_0x45addd){var _0x14de53=[_0x828e('0xb9'),_0x828e('0xba'),_0x828e('0xbb'),_0x828e('0xbc'),_0x828e('0xbd'),'rtpaudioqoslossbridged',_0x828e('0xbe'),_0x828e('0xbf'),_0x828e('0xc0'),_0x828e('0xc1'),_0x828e('0xc2'),_0x828e('0xc3'),_0x828e('0xc4'),_0x828e('0xc5'),'memberinterface','memberlastcall',_0x828e('0x9a'),_0x828e('0xc6'),_0x828e('0xc7')];if(!_[_0x828e('0x3d')](_0x53e4a1)&&!_['includes'](_0x14de53,_0x53e4a1)){if(_[_0x828e('0x6c')](this[_0x828e('0x17')][_0x2d8c66])){this['variables'][_0x2d8c66]={};}this[_0x828e('0x17')][_0x2d8c66][_0x53e4a1]=_0x45addd;}};VoiceQueueReport[_0x828e('0x3b')]['handleHangup']=function(_0x386be0,_0x27870d,_0x11fce5){var _0x397ac0={};for(var _0x477b6c=0x0;_0x477b6c<this[_0x828e('0x10')][_0x386be0][_0x828e('0xc8')];_0x477b6c+=0x1){_0x397ac0=this[_0x828e('0x10')][_0x386be0][_0x477b6c];if(this['voiceQueues'][_0x397ac0[_0x828e('0x71')]]){if(_0x397ac0[_0x828e('0xa2')]&&_0x397ac0['transfer']!=!![]){this['voiceQueues'][_0x397ac0['queue']][_0x828e('0xc9')]+=0x1;}if(_0x397ac0[_0x828e('0x1d')]){this['voiceQueues'][_0x397ac0[_0x828e('0x71')]][_0x828e('0x60')]+=0x1;}this[_0x828e('0x14')][_0x397ac0[_0x828e('0x71')]]['sumHoldTime']+=moment(_0x397ac0[_0x828e('0x8e')])[_0x828e('0xca')](_0x397ac0[_0x828e('0x7c')],_0x828e('0xcb'))||0x0;if(_0x477b6c===this[_0x828e('0x10')][_0x386be0][_0x828e('0xc8')]-0x1){this[_0x828e('0x14')][_0x397ac0[_0x828e('0x71')]]['sumDuration']+=moment()[_0x828e('0xcc')](0x0)[_0x828e('0xca')](_0x397ac0[_0x828e('0x7c')],_0x828e('0xcb'));this['voiceQueues'][_0x397ac0[_0x828e('0x71')]][_0x828e('0x5f')]+=0x1;if(_0x397ac0['queuecallercomplete']){this['voiceQueues'][_0x397ac0[_0x828e('0x71')]]['answered']+=0x1;this[_0x828e('0x14')][_0x397ac0['queue']][_0x828e('0x5d')]+=moment()[_0x828e('0xcc')](0x0)['diff'](_0x397ac0[_0x828e('0x8e')],_0x828e('0xcb'));_0x397ac0['queuecallercompleteAt']=moment()[_0x828e('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x397ac0[_0x828e('0xa2')]=![];_0x397ac0[_0x828e('0x9b')]=null;}if(_0x397ac0[_0x828e('0xa2')]&&_0x397ac0[_0x828e('0x9c')]!=!![]){_0x397ac0[_0x828e('0xb4')]=_0x828e('0xc9');logger[_0x828e('0x67')](_0x828e('0xcd'),_0x386be0,util[_0x828e('0x45')](_0x397ac0,{'showHidden':![],'depth':null}));ami[_0x828e('0x48')](_0x828e('0xce'),_0x397ac0);}if(_0x397ac0[_0x828e('0x1d')]){_0x397ac0[_0x828e('0xb4')]='abandoned';logger[_0x828e('0x67')](_0x828e('0xcf'),_0x386be0,util[_0x828e('0x45')](_0x397ac0,{'showHidden':![],'depth':null}));ami[_0x828e('0x48')](_0x828e('0xd0'),_0x397ac0);}}else{this[_0x828e('0x14')][_0x397ac0['queue']]['sumDuration']+=this[_0x828e('0x14')][_0x397ac0[_0x828e('0x71')]][_0x828e('0x5e')];}logger['info']('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x386be0,_0x397ac0['name'],_0x397ac0['type'],_0x27870d);if(_0x11fce5&&_0x397ac0[_0x828e('0x52')]==='ATTENDEDTRANSFER'){_0x397ac0[_0x828e('0x52')]='COMPLETEDBYAGENT';}this[_0x828e('0x12')][_0x386be0]=_0x397ac0;this[_0x828e('0x50')](_0x397ac0,_0x828e('0x25'));this[_0x828e('0x56')](this[_0x828e('0x14')][_0x397ac0[_0x828e('0x71')]],_0x828e('0x25'));}}logger[_0x828e('0x67')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x386be0,util['inspect'](this[_0x828e('0x10')][_0x386be0],{'showHidden':![],'depth':null}));ami[_0x828e('0x48')](_0x828e('0xd1'),this[_0x828e('0x10')][_0x386be0]);if(_0x397ac0[_0x828e('0x52')]===_0x828e('0x53'))return;delete this[_0x828e('0x10')][_0x386be0];delete this['channels'][_0x386be0];if(this['variables'][_0x386be0]){delete this[_0x828e('0x17')][_0x386be0];}};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x26')]=function(_0x6a5b1){try{if(this['isNotNull'](_0x6a5b1)){logger[_0x828e('0x67')](_0x828e('0xd2'),_0x6a5b1[_0x828e('0x4c')],util[_0x828e('0x45')](_0x6a5b1,{'showHidden':![],'depth':null}));if(this[_0x828e('0x10')][_0x6a5b1['uniqueid']]){return this[_0x828e('0xd3')](_0x6a5b1[_0x828e('0x4c')],_0x6a5b1[_0x828e('0xd4')]);}if(this['queueReports'][_0x6a5b1[_0x828e('0xa1')]]){if(_0x6a5b1[_0x828e('0xd5')]==='21'){return;}return this[_0x828e('0xd3')](_0x6a5b1[_0x828e('0xa1')],_0x6a5b1[_0x828e('0xd4')],!![]);}var _0x1254d6=Object['keys'](this[_0x828e('0x10')]);for(var _0x452db4=0x0;_0x452db4<_0x1254d6[_0x828e('0xc8')];_0x452db4++){var _0x376d3f=_[_0x828e('0x94')](this[_0x828e('0x10')][_0x1254d6[_0x452db4]]);if(_0x376d3f&&_0x376d3f[_0x828e('0xd6')]===_0x6a5b1[_0x828e('0x4c')]){return this[_0x828e('0xd3')](_0x376d3f['uniqueid'],_0x6a5b1['cause-txt'],!![]);}}}}catch(_0x1eb0a5){logger[_0x828e('0x42')]('[%s][voiceQueueReport][hangup]',_0x6a5b1['uniqueid'],util[_0x828e('0x45')](_0x1eb0a5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x828e('0x2e')]=function(_0x281590){try{if(this['isNotNull'](_0x281590)){logger[_0x828e('0x67')]('[%s][voiceQueueReport][attendedtransfer]',_0x281590[_0x828e('0x4c')],util[_0x828e('0x45')](_0x281590,{'showHidden':![],'depth':null}));var _0x32ab2b;var _0x3acd2f;var _0x252dbb;if(this[_0x828e('0x10')][_0x281590['transfereeuniqueid']]){_0x32ab2b=_[_0x828e('0x94')](this[_0x828e('0x10')][_0x281590['transfereeuniqueid']]);_0x32ab2b[_0x828e('0xa7')]=_0x281590[_0x828e('0xd7')];_0x32ab2b['transferuniqueid']=_0x281590[_0x828e('0xd8')];_0x32ab2b['queuecallerexitreason']=_0x828e('0x53');_0x32ab2b[_0x828e('0x9c')]=!![];_0x32ab2b['transfertype']=_0x828e('0xd9');if(this['queueReports'][_0x281590['secondtransfereruniqueid']]){_0x252dbb=this[_0x828e('0x10')][_0x281590[_0x828e('0xd8')]];this[_0x828e('0x10')][_0x281590[_0x828e('0xd8')]]=this['queueReports'][_0x281590[_0x828e('0xda')]];this['queueReports'][_0x281590[_0x828e('0xda')]]=_0x252dbb;_0x3acd2f=_[_0x828e('0x94')](this[_0x828e('0x10')][_0x281590[_0x828e('0xda')]]);_0x3acd2f[_0x828e('0xdb')]=!![];}logger[_0x828e('0x72')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x281590[_0x828e('0x4c')],_0x32ab2b[_0x828e('0x4f')],_0x32ab2b['type'],_0x32ab2b[_0x828e('0xa7')],_0x32ab2b[_0x828e('0xa8')]);}else if(this[_0x828e('0x10')][_0x281590['transfertargetuniqueid']]){_0x32ab2b=_[_0x828e('0x94')](this[_0x828e('0x10')][_0x281590['transfertargetuniqueid']]);_0x32ab2b[_0x828e('0xa7')]=_0x281590[_0x828e('0xdc')];_0x32ab2b[_0x828e('0xa8')]=_0x281590[_0x828e('0xdd')];_0x32ab2b['queuecallerexitreason']=_0x828e('0x53');_0x32ab2b[_0x828e('0x9c')]=!![];_0x32ab2b[_0x828e('0xa5')]=_0x828e('0xd9');if(this[_0x828e('0x10')][_0x281590[_0x828e('0xdd')]]){_0x252dbb=this[_0x828e('0x10')][_0x281590[_0x828e('0xdd')]];this['queueReports'][_0x281590['origtransfereruniqueid']]=this[_0x828e('0x10')][_0x281590[_0x828e('0xde')]];this[_0x828e('0x10')][_0x281590[_0x828e('0xde')]]=_0x252dbb;_0x3acd2f=_['last'](this[_0x828e('0x10')][_0x281590['transfertargetuniqueid']]);_0x3acd2f['switch']=!![];}logger[_0x828e('0x72')](_0x828e('0xdf'),_0x281590[_0x828e('0x4c')],_0x32ab2b['name'],_0x32ab2b[_0x828e('0x57')],_0x32ab2b['transferexten'],_0x32ab2b['transferuniqueid']);}else if(this['queueReports'][_0x281590[_0x828e('0xdd')]]){_0x32ab2b=_[_0x828e('0x94')](this['queueReports'][_0x281590[_0x828e('0xdd')]]);_0x32ab2b[_0x828e('0xa7')]=_0x281590['origtransfererexten'];_0x32ab2b[_0x828e('0xa8')]=_0x281590[_0x828e('0xdd')];_0x32ab2b[_0x828e('0x52')]='ATTENDEDTRANSFER';_0x32ab2b[_0x828e('0x9c')]=!![];_0x32ab2b[_0x828e('0xa5')]=_0x828e('0xd9');_0x32ab2b[_0x828e('0xdb')]=!![];_0x32ab2b[_0x828e('0xd6')]=_0x281590[_0x828e('0xda')];}else if(this[_0x828e('0x10')][_0x281590[_0x828e('0xd8')]]){_0x32ab2b=_['last'](this[_0x828e('0x10')][_0x281590['secondtransfereruniqueid']]);_0x32ab2b['transferexten']=_0x281590[_0x828e('0xd7')];_0x32ab2b[_0x828e('0xa8')]=_0x281590[_0x828e('0xd8')];_0x32ab2b[_0x828e('0x52')]=_0x828e('0x53');_0x32ab2b[_0x828e('0x9c')]=!![];_0x32ab2b[_0x828e('0xa5')]=_0x828e('0xd9');_0x32ab2b[_0x828e('0xdb')]=!![];_0x32ab2b['transferid']=_0x281590[_0x828e('0xde')];}}}catch(_0x3029fb){logger[_0x828e('0x42')](_0x828e('0xe0'),_0x281590[_0x828e('0x4c')],util[_0x828e('0x45')](_0x3029fb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x30')]=function(_0x44d0d6){try{if(this[_0x828e('0x6b')](_0x44d0d6)){logger[_0x828e('0x67')](_0x828e('0xe1'),_0x44d0d6[_0x828e('0x4c')],util[_0x828e('0x45')](_0x44d0d6,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x44d0d6[_0x828e('0xda')]]){var _0x393113=_[_0x828e('0x94')](this[_0x828e('0x10')][_0x44d0d6[_0x828e('0xda')]]);_0x393113[_0x828e('0x52')]=_0x828e('0xe2');_0x393113[_0x828e('0x9c')]=!![];_0x393113[_0x828e('0xa5')]=_0x828e('0xe3');_0x393113[_0x828e('0xa7')]=_0x44d0d6[_0x828e('0xe4')];_0x393113['transferuniqueid']=_0x44d0d6['transfereeuniqueid'];logger[_0x828e('0x72')](_0x828e('0xe5'),_0x44d0d6[_0x828e('0x4c')],_0x393113['name'],_0x393113[_0x828e('0x57')],_0x393113[_0x828e('0xa7')],_0x393113[_0x828e('0xa8')]);this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x44d0d6[_0x828e('0xda')],'context':_0x44d0d6[_0x828e('0xe6')],'channel':_0x44d0d6[_0x828e('0xe7')]});}}}catch(_0x12c017){logger[_0x828e('0x42')](_0x828e('0xe1'),_0x44d0d6['uniqueid'],util[_0x828e('0x45')](_0x12c017,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x2a')]=function(_0x4b1069){try{if(this[_0x828e('0x6b')](_0x4b1069)){logger['debug']('[%s][voiceQueueReport][musiconholdstart]',_0x4b1069[_0x828e('0x4c')],util['inspect'](_0x4b1069,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4b1069[_0x828e('0x4c')]]){var _0x49d7e4=_[_0x828e('0x94')](this[_0x828e('0x10')][_0x4b1069['uniqueid']]);if(!_[_0x828e('0x3d')](_0x49d7e4['queuecallerleaveAt'])){_0x49d7e4['mohstarttime']=moment()[_0x828e('0x4d')](_0x828e('0x7d'));logger['info'](_0x828e('0xe8'),_0x4b1069[_0x828e('0x4c')],_0x49d7e4[_0x828e('0xe9')]);}}}}catch(_0x4024b9){logger[_0x828e('0x42')](_0x828e('0xea'),_0x4b1069[_0x828e('0x4c')],util['inspect'](_0x4024b9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0x2c')]=function(_0x279dc2){try{if(this[_0x828e('0x6b')](_0x279dc2)){logger[_0x828e('0x67')](_0x828e('0xeb'),_0x279dc2['uniqueid'],util['inspect'](_0x279dc2,{'showHidden':![],'depth':null}));if(this[_0x828e('0x10')][_0x279dc2[_0x828e('0x4c')]]){var _0x2162be=_[_0x828e('0x94')](this[_0x828e('0x10')][_0x279dc2[_0x828e('0x4c')]]);if(!_['isNil'](_0x2162be[_0x828e('0xe9')])){_0x2162be[_0x828e('0xec')]+=moment()[_0x828e('0xcc')](0x0)['diff'](_0x2162be['mohstarttime'],_0x828e('0xcb'));logger[_0x828e('0x72')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x279dc2[_0x828e('0x4c')],_0x2162be['mohtime']);delete _0x2162be[_0x828e('0xe9')];}}}}catch(_0x3754d9){logger[_0x828e('0x42')](_0x828e('0xeb'),_0x279dc2[_0x828e('0x4c')],util['inspect'](_0x3754d9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x828e('0x3b')][_0x828e('0xed')]=function(_0x3b74ab){try{if(this[_0x828e('0x6b')](_0x3b74ab)){logger[_0x828e('0x67')](_0x828e('0xee'),_0x3b74ab[_0x828e('0x4c')],util[_0x828e('0x45')](_0x3b74ab,{'showHidden':![],'depth':null}));if(_0x3b74ab[_0x828e('0xef')][_0x828e('0x9f')]()===_0x828e('0xf0')){_0x3b74ab[_0x828e('0xf1')]=_0x3b74ab[_0x828e('0xf2')]&&_0x3b74ab['appdata'][_0x828e('0xf3')]('CDR(routeAlias)')?_0x3b74ab[_0x828e('0xf2')]:(_0x3b74ab[_0x828e('0xf2')]||_0x3b74ab[_0x828e('0xf1')])['toLowerCase']();if(_[_0x828e('0xf3')](_0x3b74ab[_0x828e('0xf1')]['toLowerCase'](),_0x828e('0xf4'))){logger[_0x828e('0x72')](_0x828e('0xf5'),_0x3b74ab[_0x828e('0x4c')],_0x3b74ab[_0x828e('0xef')],_0x3b74ab['applicationdata']);if(_[_0x828e('0x6c')](this[_0x828e('0x12')][_0x3b74ab['uniqueid']]))this[_0x828e('0x12')][_0x3b74ab['uniqueid']]={};var _0x5f4ff2=_0x3b74ab[_0x828e('0xf1')][_0x828e('0xf6')]('=');var _0x2d5278=_0x5f4ff2[0x0][_0x828e('0x9f')]()[_0x828e('0xf7')](/cdr\((.*)\)/);if(_0x2d5278)this[_0x828e('0x12')][_0x3b74ab[_0x828e('0x4c')]][_0x2d5278[0x1]]=_0x5f4ff2[0x1];}}}}catch(_0x15dbab){logger[_0x828e('0x42')]('[%s][voiceQueueReport][newexten]',_0x3b74ab[_0x828e('0x4c')],util[_0x828e('0x45')](_0x15dbab,{'showHidden':![],'depth':null}));}};module[_0x828e('0xf8')]=VoiceQueueReport;