Built motion from commit eddce310.|2.6.12
[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 _0x745c=['syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','switch','sequence','status','channel','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkQueueReport]','inspect','variables','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice_queue_channel:save','voice_queue_presence:save','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','type','inbound','name','isNotNull','clearZombieChannels','Action','queues','isRunning','queuestatus','catch','[voiceQueueReport][queuesummary]','createQueueSummaryReport','summaryEvent','handleInboundQueueSummaryReport','assign','actionid','queue','custom:queuesummary','statusRequests','syncQueueSummaryComplete','completeEvent','push','[voiceQueueReport][queuesummary]\x20name:%s','then','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','merge','keys','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','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','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','queuecallerexitAt','reason','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[%s][voiceQueueReport][varset]','variable','CONTINUE','TIMEOUT','lastevent','timeout','custom:timeout','value','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','includes','handleHangup','length','unmanaged','abandoned','sumHoldTime','diff','sumDuration','milliseconds','total','sumBillable','custom:queuecallerunmanaged','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','cause-txt','cause','transferid','[%s][voiceQueueReport][hangup]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','context','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','toLowerCase','appdata','CDR(routeAlias)','applicationdata','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','queueReports','realtime','agents','channels','queueChannels','voiceQueues','campaigns','summary','queuesummary','syncQueueSummary','bind','queuesummarycomplete','queuemember','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon'];(function(_0x35181c,_0x82694a){var _0xe14bf9=function(_0x2be9b7){while(--_0x2be9b7){_0x35181c['push'](_0x35181c['shift']());}};_0xe14bf9(++_0x82694a);}(_0x745c,0x1c0));var _0xc745=function(_0x17c938,_0x557096){_0x17c938=_0x17c938-0x0;var _0x2d22b2=_0x745c[_0x17c938];return _0x2d22b2;};'use strict';var _=require(_0xc745('0x0'));var moment=require(_0xc745('0x1'));var util=require(_0xc745('0x2'));var Redis=require('ioredis');var config=require(_0xc745('0x3'));var logger=require(_0xc745('0x4'))(_0xc745('0x5'));var ami=require(_0xc745('0x6'));var QueueReport=require(_0xc745('0x7'));var VoiceQueueSummary=require(_0xc745('0x8'));config[_0xc745('0x9')]=_[_0xc745('0xa')](config[_0xc745('0x9')],{'host':_0xc745('0xb'),'port':0x18eb});var io=require(_0xc745('0xc'))(new Redis(config[_0xc745('0x9')]));var Sequence=function(){};Sequence[_0xc745('0xd')][_0xc745('0xe')]=function(_0x445da3){this[_0xc745('0xf')]=this['tail']?this[_0xc745('0xf')][_0xc745('0x10')](_0x445da3):_0x445da3();};function VoiceQueueReport(_0x2eb71a){this['sequence']=new Sequence();this[_0xc745('0x11')]={};this[_0xc745('0x12')]=_0x2eb71a;this[_0xc745('0x13')]=_0x2eb71a[_0xc745('0x13')];this[_0xc745('0x14')]=_0x2eb71a[_0xc745('0x15')];this[_0xc745('0x16')]=_0x2eb71a['voiceQueues'];this[_0xc745('0x17')]=_0x2eb71a[_0xc745('0x17')];this[_0xc745('0x18')]=initializeSummary();this['variables']={};ami['on'](_0xc745('0x19'),this[_0xc745('0x1a')][_0xc745('0x1b')](this));ami['on'](_0xc745('0x1c'),this['syncQueueSummaryComplete'][_0xc745('0x1b')](this));ami['on'](_0xc745('0x1d'),this['syncQueueMember']['bind'](this));ami['on']('queuestatuscomplete',this[_0xc745('0x1e')][_0xc745('0x1b')](this));ami['on'](_0xc745('0x1f'),this[_0xc745('0x20')][_0xc745('0x1b')](this));ami['on'](_0xc745('0x21'),this[_0xc745('0x22')][_0xc745('0x1b')](this));ami['on'](_0xc745('0x23'),this[_0xc745('0x24')][_0xc745('0x1b')](this));ami['on']('agentcomplete',this[_0xc745('0x25')][_0xc745('0x1b')](this));ami['on'](_0xc745('0x26'),this[_0xc745('0x27')][_0xc745('0x1b')](this));ami['on'](_0xc745('0x28'),this[_0xc745('0x29')][_0xc745('0x1b')](this));ami['on'](_0xc745('0x2a'),this[_0xc745('0x2b')][_0xc745('0x1b')](this));ami['on']('fullybooted',this[_0xc745('0x2c')]['bind'](this));ami['on'](_0xc745('0x2d'),this[_0xc745('0x2e')][_0xc745('0x1b')](this));ami['on']('musiconholdstop',this[_0xc745('0x2f')][_0xc745('0x1b')](this));ami['on']('attendedtransfer',this[_0xc745('0x30')][_0xc745('0x1b')](this));ami['on'](_0xc745('0x31'),this[_0xc745('0x32')][_0xc745('0x1b')](this));this[_0xc745('0x33')]();this[_0xc745('0x34')]();}function clearChannels(_0x4ad2c1){if(!_['isEmpty'](_0x4ad2c1)){for(var _0x1c909a in _0x4ad2c1){if(_0x4ad2c1[_0xc745('0x35')](_0x1c909a)){delete _0x4ad2c1[_0x1c909a];}}}}function clearCampaigns(_0x217257){if(!_[_0xc745('0x36')](_0x217257)){for(var _0x3c8e67 in _0x217257){if(_0x217257[_0xc745('0x35')](_0x3c8e67)){_0x217257[_0x3c8e67][_0xc745('0x37')]=0x0;}}}}function clearVoiceQueues(_0x2e3c40){if(!_[_0xc745('0x36')](_0x2e3c40)){for(var _0x514306 in _0x2e3c40){if(_0x2e3c40[_0xc745('0x35')](_0x514306)){_0x2e3c40[_0x514306][_0xc745('0x37')]=0x0;_0x2e3c40[_0x514306][_0xc745('0x38')]=0x0;_0x2e3c40[_0x514306][_0xc745('0x39')]=0x0;_0x2e3c40[_0x514306][_0xc745('0x3a')]=0x0;_0x2e3c40[_0x514306][_0xc745('0x3b')]=!![];}}}}function clearAgentBooked(_0xe92f11){if(!_['isEmpty'](_0xe92f11)){for(var _0x390c9d in _0xe92f11){if(_0xe92f11[_0xc745('0x35')](_0x390c9d)){_0xe92f11[_0x390c9d][_0xc745('0x3c')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}VoiceQueueReport[_0xc745('0xd')]['clearZombieChannels']=function(){var _0x1bf458=this;for(var _0x4b8051 in this[_0xc745('0x14')]){if(this[_0xc745('0x14')]['hasOwnProperty'](_0x4b8051)&&!this['channels'][_0x4b8051][_0xc745('0x3d')]){this[_0xc745('0x3e')]['enqueue'](function(){if(!_['isNil'](_0x1bf458[_0xc745('0x14')][_0x4b8051])){return ami['Action']({'action':_0xc745('0x3f'),'channel':_0x1bf458[_0xc745('0x14')][_0x4b8051][_0xc745('0x40')]})['catch'](function(_0x30978b){if(_0x30978b[_0xc745('0x41')]===_0xc745('0x42')){setTimeout(function(){if(_0x1bf458[_0xc745('0x14')][_0x4b8051]){delete _0x1bf458['channels'][_0x4b8051];logger[_0xc745('0x43')]('[%s][voiceQueueReport][checkChannel]',_0x4b8051,util['inspect'](_0x30978b,{'showHidden':![],'depth':null}));}if(_0x1bf458[_0xc745('0x11')][_0x4b8051]){delete _0x1bf458[_0xc745('0x11')][_0x4b8051];logger[_0xc745('0x43')](_0xc745('0x44'),_0x4b8051,util[_0xc745('0x45')](_0x30978b,{'showHidden':![],'depth':null}));}if(_0x1bf458[_0xc745('0x46')][_0x4b8051]){delete _0x1bf458[_0xc745('0x46')][_0x4b8051];logger[_0xc745('0x43')](_0xc745('0x47'),_0x4b8051,util[_0xc745('0x45')](_0x30978b,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x2c')]=function(){logger['error'](_0xc745('0x48'));clearChannels(this['channels']);this['clearQueueReport'](this['queueReports']);clearAgentBooked(this[_0xc745('0x13')]);clearVoiceQueues(this[_0xc745('0x16')]);clearCampaigns(this['campaigns']);this['summary']=initializeSummary();};VoiceQueueReport['prototype'][_0xc745('0x49')]=function(_0x321240){var _0x1b57fe=this;if(!_[_0xc745('0x36')](_0x321240)){for(var _0x2d3823 in _0x321240){if(_0x321240[_0xc745('0x35')](_0x2d3823)){_0x1b57fe[_0xc745('0x4a')](_0x321240[_0x2d3823],'clearqueuereport');delete _0x321240[_0x2d3823];}}}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x4b')]=function(_0x355221,_0x53bb38,_0x2e67fc){io['to'](_0x355221)[_0xc745('0x4b')](_0x53bb38,_0x2e67fc);};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x4c')]=function(_0x349216,_0x773680){logger[_0xc745('0x4d')]('[%s][voiceQueueReport]['+_0x773680+_0xc745('0x4e'),_0x349216[_0xc745('0x4f')],util['inspect'](_0x349216,{'showHidden':![],'depth':null}));this[_0xc745('0x4b')](util['format']('voice:queue:%s',_0x349216['queue']),_0xc745('0x50'),_0x349216);io[_0xc745('0x4b')](_0xc745('0x51'),_0x349216);};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x4a')]=function(_0x2e4d6e,_0x5eb52b){logger['debug'](_0xc745('0x52')+_0x5eb52b+_0xc745('0x53'),_0x2e4d6e[_0xc745('0x4f')],util[_0xc745('0x45')](_0x2e4d6e,{'showHidden':![],'depth':null}));if(_0x2e4d6e[_0xc745('0x54')]==='ATTENDEDTRANSFER'){return;}this[_0xc745('0x4b')](util[_0xc745('0x55')](_0xc745('0x56'),_0x2e4d6e['queue']),_0xc745('0x57'),_0x2e4d6e);io['emit'](_0xc745('0x58'),_0x2e4d6e);};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x59')]=function(_0x415b56){if(_0x415b56[_0xc745('0x5a')]===_0xc745('0x5b')){logger[_0xc745('0x4d')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0xc745('0x45')](_0x415b56,{'showHidden':![],'depth':null}));this[_0xc745('0x4b')](util[_0xc745('0x55')](_0xc745('0x56'),_0x415b56[_0xc745('0x5c')]),'voice_queue:save',_0x415b56);}};VoiceQueueReport['prototype'][_0xc745('0x5d')]=function(_0x5759c2){return _0x5759c2!==null&&!_['isUndefined'](_0x5759c2);};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x34')]=function(){var _0x210cbc=this;setInterval(function(){_0x210cbc[_0xc745('0x5e')]();ami[_0xc745('0x5f')]({'action':_0xc745('0x60')})['catch'](function(_0x5514ac){logger['error']('[voiceQueueReport][queues]',util[_0xc745('0x45')](_0x5514ac,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x33')]=function(){var _0x2f6e67=this;setInterval(function(){if(!_0x2f6e67[_0xc745('0x18')][_0xc745('0x61')]){return ami[_0xc745('0x5f')]({'action':_0xc745('0x19')})['then'](function(_0x1902ab){_0x2f6e67['summary']['id']=_0x1902ab['actionid'];_0x2f6e67[_0xc745('0x18')][_0xc745('0x61')]=!![];_0x2f6e67[_0xc745('0x18')][_0xc745('0x62')][_0x1902ab['actionid']]={};})[_0xc745('0x63')](function(_0x769350){logger['error'](_0xc745('0x64'),util[_0xc745('0x45')](_0x769350,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xc745('0x65')]=function(_0x7a32c8,_0x57c64a){var _0x48417e=this[_0xc745('0x18')][_0xc745('0x60')][_0x7a32c8[_0xc745('0x5c')]][_0xc745('0x66')];var _0x1233cd=new VoiceQueueSummary(_0x7a32c8);return _0x1233cd['createReport'](_0x57c64a[_0xc745('0x13')],this[_0xc745('0x13')],_0x48417e,this['realtime'][_0xc745('0x14')]);};VoiceQueueReport['prototype'][_0xc745('0x67')]=function(_0x51309f,_0x9cd393){var _0x3fae26=this[_0xc745('0x65')](_0x51309f,_0x9cd393);var _0x50dcbc=![];_0x50dcbc=_0x3fae26['compareToInboundQueue'](_0x51309f);if(_0x50dcbc){Object[_0xc745('0x68')](_0x51309f,_0x3fae26);this['realtime']['voiceQueues'][_0x51309f[_0xc745('0x5c')]]=_0x51309f;this[_0xc745('0x59')](_0x3fae26);}};VoiceQueueReport[_0xc745('0xd')]['syncQueueStatusComplete']=function(_0x754e1d){var _0x48dcd8=null;var _0x2a76c5=this[_0xc745('0x18')]['id'];if(this[_0xc745('0x18')]['queuestatus'][_0x2a76c5]){_0x48dcd8=this['summary']['queuestatus'][_0x2a76c5][_0x754e1d[_0xc745('0x69')]];}if(!_0x48dcd8){this[_0xc745('0x18')]=initializeSummary();return;}var _0x13ecae=this[_0xc745('0x16')][_0x48dcd8[_0xc745('0x6a')]];if(_0x13ecae[_0xc745('0x5a')]===_0xc745('0x5b')){this[_0xc745('0x67')](_0x13ecae,_0x48dcd8);}else if(_0x13ecae[_0xc745('0x5a')]==='outbound'){var _0x2e412a=this[_0xc745('0x65')](_0x13ecae,_0x48dcd8);ami['emit'](_0xc745('0x6b'),_0x2e412a);}this[_0xc745('0x18')][_0xc745('0x6c')]-=0x1;var _0xfd2104=this[_0xc745('0x18')]['statusRequests']>0x0?!![]:![];if(!_0xfd2104){return this[_0xc745('0x6d')](this['summary'][_0xc745('0x6e')]);}};VoiceQueueReport['prototype']['syncQueueMember']=function(_0x58ad7d){var _0x4e7a6f=this[_0xc745('0x18')]['id'];if(this[_0xc745('0x18')][_0xc745('0x62')][_0x4e7a6f]&&this[_0xc745('0x18')]['queuestatus'][_0x4e7a6f][_0x58ad7d[_0xc745('0x69')]]){this[_0xc745('0x18')]['queuestatus'][_0x4e7a6f][_0x58ad7d[_0xc745('0x69')]]['agents'][_0xc745('0x6f')](_0x58ad7d);}};VoiceQueueReport['prototype']['syncQueueSummary']=function(_0x238853){var _0x15483d=this;try{if(this[_0xc745('0x5d')](_0x238853)&&this[_0xc745('0x5d')](_0x238853[_0xc745('0x6a')])){logger[_0xc745('0x4d')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xc745('0x45')](_0x238853,{'showHidden':![],'depth':null}));var _0x8407d4=this[_0xc745('0x16')][_0x238853[_0xc745('0x6a')]];if(_0x8407d4){logger['info'](_0xc745('0x70'),_0x8407d4[_0xc745('0x5c')]);this[_0xc745('0x18')][_0xc745('0x60')][_0x8407d4[_0xc745('0x5c')]]={'summaryEvent':_0x238853};this[_0xc745('0x18')][_0xc745('0x6c')]+=0x1;return ami[_0xc745('0x5f')]({'action':_0xc745('0x62'),'queue':_0x8407d4['name']})[_0xc745('0x71')](function(_0x31de67){if(!_0x15483d['summary'][_0xc745('0x62')][_0x238853['actionid']]){_0x15483d[_0xc745('0x18')][_0xc745('0x62')][_0x238853[_0xc745('0x69')]]={};}_0x15483d['summary'][_0xc745('0x62')][_0x238853[_0xc745('0x69')]][_0x31de67['actionid']]={'queue':_0x8407d4[_0xc745('0x5c')],'agents':[]};})[_0xc745('0x63')](function(_0x4ad818){throw _0x4ad818;});}}}catch(_0x1da397){logger['error'](_0xc745('0x64'),util[_0xc745('0x45')](_0x1da397,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')]['syncQueueSummaryComplete']=function(_0x4d5fb2){if(this[_0xc745('0x18')][_0xc745('0x6c')]>0x0){this['summary']['completeEvent']=_0x4d5fb2;return;}logger[_0xc745('0x4d')](_0xc745('0x72'),util['inspect'](_0x4d5fb2,{'showHidden':![],'depth':null}));this[_0xc745('0x18')]=initializeSummary();ami[_0xc745('0x4b')](_0xc745('0x73'),{});};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x20')]=function(_0x22d692){try{if(this[_0xc745('0x5d')](_0x22d692)){logger[_0xc745('0x4d')]('[%s][voiceQueueReport][queuecallerjoin]',_0x22d692[_0xc745('0x4f')],util[_0xc745('0x45')](_0x22d692,{'showHidden':![],'depth':null}));if(_[_0xc745('0x74')](this[_0xc745('0x11')][_0x22d692['uniqueid']])){this[_0xc745('0x11')][_0x22d692[_0xc745('0x4f')]]=[];}if(_['isUndefined'](this[_0xc745('0x14')][_0x22d692[_0xc745('0x4f')]])){this[_0xc745('0x14')][_0x22d692['uniqueid']]={};}var _0x62a68f=new QueueReport();_0x62a68f['queue']=_0x22d692[_0xc745('0x6a')];_0x62a68f['type']=this[_0xc745('0x16')][_0x62a68f[_0xc745('0x6a')]]&&this[_0xc745('0x16')][_0x62a68f[_0xc745('0x6a')]][_0xc745('0x5a')]?this[_0xc745('0x16')][_0x62a68f[_0xc745('0x6a')]][_0xc745('0x5a')]||_0xc745('0x5b'):'inbound';_0x62a68f[_0xc745('0x75')]=moment()[_0xc745('0x55')](_0xc745('0x76'));_0x62a68f[_0xc745('0x77')]=_0x22d692['position'];_0x62a68f[_0xc745('0x78')]=_0x22d692[_0xc745('0x78')];_0x62a68f[_0xc745('0x4f')]=_0x22d692[_0xc745('0x4f')];_0x62a68f['routealias']=this[_0xc745('0x14')][_0x22d692['uniqueid']][_0xc745('0x79')];logger[_0xc745('0x7a')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x62a68f[_0xc745('0x6a')],_0x62a68f[_0xc745('0x5a')]);_[_0xc745('0x7b')](_0x62a68f,_['pick'](_0x22d692,_[_0xc745('0x7c')](_0x62a68f)));this[_0xc745('0x11')][_0x22d692['uniqueid']]['push'](_0x62a68f);this[_0xc745('0x14')][_0x22d692[_0xc745('0x4f')]]=_0x62a68f;this['emitVoiceQueueChannelSave'](_0x62a68f,_0xc745('0x1f'));}}catch(_0x5e15b7){logger['error'](_0xc745('0x7d'),_0x22d692[_0xc745('0x4f')],util[_0xc745('0x45')](_0x5e15b7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x22')]=function(_0x18cf89){try{if(this[_0xc745('0x5d')](_0x18cf89)){logger['debug'](_0xc745('0x7e'),_0x18cf89[_0xc745('0x4f')],util[_0xc745('0x45')](_0x18cf89,{'showHidden':![],'depth':null}));if(this[_0xc745('0x11')][_0x18cf89[_0xc745('0x4f')]]){var _0x47f137=_[_0xc745('0x7f')](this[_0xc745('0x11')][_0x18cf89['uniqueid']]);_0x47f137[_0xc745('0x80')]=![];_0x47f137[_0xc745('0x81')]=null;_0x47f137[_0xc745('0x82')]=_0x18cf89[_0xc745('0x82')];_0x47f137['originalposition']=_0x18cf89['originalposition'];_0x47f137['queuecallerabandon']=!![];_0x47f137[_0xc745('0x83')]=moment()[_0xc745('0x55')](_0xc745('0x76'));_0x47f137['queuecallerexitreason']=_0xc745('0x84');_0x47f137[_0xc745('0x85')]=null;logger[_0xc745('0x7a')](_0xc745('0x86'),_0x47f137[_0xc745('0x6a')],_0x47f137['type']);this[_0xc745('0x14')][_0x18cf89['uniqueid']]=_0x47f137;this[_0xc745('0x4a')](_0x47f137,_0xc745('0x21'));}}}catch(_0x3e1845){logger[_0xc745('0x43')](_0xc745('0x7e'),_0x18cf89[_0xc745('0x4f')],util['inspect'](_0x3e1845,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc745('0x24')]=function(_0x295980){try{if(this[_0xc745('0x5d')](_0x295980)){logger[_0xc745('0x4d')](_0xc745('0x87'),_0x295980['uniqueid'],util[_0xc745('0x45')](_0x295980,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x295980['uniqueid']]){var _0x319a52=_[_0xc745('0x7f')](this['queueReports'][_0x295980['uniqueid']]);_0x319a52[_0xc745('0x88')]=moment()[_0xc745('0x55')](_0xc745('0x76'));_0x319a52[_0xc745('0x89')]=_0x295980['connectedlinenum'];_0x319a52[_0xc745('0x8a')]=_0x295980['connectedlinename'];logger[_0xc745('0x7a')](_0xc745('0x8b'),_0x319a52[_0xc745('0x6a')],_0x319a52[_0xc745('0x5a')],_0x295980['connectedlinenum'],_0x295980[_0xc745('0x8a')]);this[_0xc745('0x14')][_0x295980[_0xc745('0x4f')]]=_0x319a52;this[_0xc745('0x4c')](_0x319a52,'queuecallerleave');}}}catch(_0x3ccc3e){logger[_0xc745('0x43')](_0xc745('0x87'),_0x295980[_0xc745('0x4f')],util['inspect'](_0x3ccc3e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')]['syncAgentConnect']=function(_0x25976e){try{if(this[_0xc745('0x5d')](_0x25976e)){logger[_0xc745('0x4d')]('[%s][voiceQueueReport][agentconnect]',_0x25976e[_0xc745('0x4f')],util[_0xc745('0x45')](_0x25976e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x25976e['uniqueid']]){var _0x3fec3b=_['last'](this[_0xc745('0x11')][_0x25976e['uniqueid']]);_0x3fec3b[_0xc745('0x80')]=!![];_0x3fec3b[_0xc745('0x54')]='COMPLETEDBYAGENT';logger[_0xc745('0x7a')](_0xc745('0x8c'),_0x3fec3b[_0xc745('0x6a')],_0x3fec3b['type']);}}}catch(_0x5ae0da){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x25976e[_0xc745('0x4f')],util[_0xc745('0x45')](_0x5ae0da,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x25')]=function(_0x57c1c1){try{if(this[_0xc745('0x5d')](_0x57c1c1)){logger[_0xc745('0x4d')](_0xc745('0x8d'),_0x57c1c1['uniqueid'],util[_0xc745('0x45')](_0x57c1c1,{'showHidden':![],'depth':null}));if(this[_0xc745('0x11')][_0x57c1c1[_0xc745('0x4f')]]){var _0x3b50a7=_[_0xc745('0x7f')](this[_0xc745('0x11')][_0x57c1c1['uniqueid']]);_0x3b50a7[_0xc745('0x21')]=![];_0x3b50a7[_0xc745('0x83')]=null;_0x3b50a7[_0xc745('0x8e')]=!![];_0x3b50a7[_0xc745('0x85')]=_0x57c1c1[_0xc745('0x8f')];_0x3b50a7[_0xc745('0x82')]=_0x57c1c1['holdtime'];_0x3b50a7['queuecallercomplete']=!![];_0x3b50a7[_0xc745('0x90')]=![];_0x3b50a7[_0xc745('0x91')]=null;if(!_0x3b50a7['transfer']){if(_0x57c1c1[_0xc745('0x92')]==_0xc745('0x93')){_0x3b50a7['queuecallerexitreason']=_0xc745('0x94');logger[_0xc745('0x7a')](_0xc745('0x95'),_0x3b50a7[_0xc745('0x6a')],_0x3b50a7[_0xc745('0x5a')]);}else{if(_[_0xc745('0x96')](_0x57c1c1[_0xc745('0x40')]['toLowerCase'](),_0xc745('0x97'))){if(this[_0xc745('0x11')][_0x57c1c1[_0xc745('0x98')]]){var _0x5b19f3=_['last'](this['queueReports'][_0x57c1c1[_0xc745('0x98')]]);_0x5b19f3[_0xc745('0x80')]=![];_0x5b19f3[_0xc745('0x90')]=!![];_0x5b19f3[_0xc745('0x91')]=moment(_0x3b50a7[_0xc745('0x75')])[_0xc745('0x99')](_0x57c1c1[_0xc745('0x82')],_0xc745('0x9a'))[_0xc745('0x55')](_0xc745('0x76'));_0x5b19f3[_0xc745('0x54')]=_0xc745('0x9b');_0x5b19f3['transfer']=!![];_0x5b19f3[_0xc745('0x9c')]=_0xc745('0x9d');_0x5b19f3[_0xc745('0x9e')]=_0x57c1c1[_0xc745('0x9f')];_0x5b19f3[_0xc745('0xa0')]=_0x57c1c1[_0xc745('0x4f')];logger[_0xc745('0x7a')](_0xc745('0xa1'),_0x5b19f3[_0xc745('0x6a')],_0x5b19f3['type']);var _0x4b1116=this[_0xc745('0x11')][_0x57c1c1[_0xc745('0x98')]];this[_0xc745('0x11')][_0x57c1c1[_0xc745('0x98')]]=this[_0xc745('0x11')][_0x57c1c1[_0xc745('0x4f')]];this[_0xc745('0x11')][_0x57c1c1[_0xc745('0x4f')]]=_0x4b1116;}}else{_0x3b50a7[_0xc745('0x54')]=_0xc745('0xa2')+_0x57c1c1[_0xc745('0x92')][_0xc745('0xa3')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x3b50a7[_0xc745('0x6a')],_0x3b50a7[_0xc745('0x5a')],_0x3b50a7[_0xc745('0x54')]);}}}this[_0xc745('0x14')][_0x57c1c1[_0xc745('0x4f')]]=_0x3b50a7;this['emitVoiceQueueChannelRemove'](_0x3b50a7,'agentcomplete');}}}catch(_0x1165bc){logger['error'](_0xc745('0x8d'),_0x57c1c1['uniqueid'],util[_0xc745('0x45')](_0x1165bc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x29')]=function(_0x22c8e4){try{if(this['isNotNull'](_0x22c8e4)){logger['debug'](_0xc745('0xa4'),_0x22c8e4['uniqueid'],util[_0xc745('0x45')](_0x22c8e4,{'showHidden':![],'depth':null}));this['addVariable'](_0x22c8e4[_0xc745('0x4f')],_[_0xc745('0x7c')](_0x22c8e4[_0xc745('0xa5')])[0x0],_0x22c8e4['value']);if(this['queueReports'][_0x22c8e4[_0xc745('0x4f')]]){var _0x44a07f=_[_0xc745('0x7f')](this[_0xc745('0x11')][_0x22c8e4['uniqueid']]);if(_0x44a07f){if(this[_0xc745('0x5d')](_0x22c8e4[_0xc745('0xa5')])&&this[_0xc745('0x5d')](_0x22c8e4[_0xc745('0xa5')]['queuestatus'])){switch(_0x22c8e4['value']){case _0xc745('0xa6'):_0x44a07f[_0xc745('0x90')]=![];_0x44a07f[_0xc745('0x91')]=null;break;case _0xc745('0xa7'):_0x44a07f[_0xc745('0xa8')]=_0xc745('0xa9');_0x44a07f[_0xc745('0x90')]=!![];_0x44a07f[_0xc745('0x91')]=moment()[_0xc745('0x55')](_0xc745('0x76'));_0x44a07f['queuecallerleaveAt']=moment()[_0xc745('0x55')](_0xc745('0x76'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x22c8e4[_0xc745('0x4f')],util[_0xc745('0x45')](_0x44a07f,{'showHidden':![],'depth':null}));ami[_0xc745('0x4b')](_0xc745('0xaa'),_0x44a07f);break;default:_0x44a07f[_0xc745('0x90')]=!![];_0x44a07f[_0xc745('0x91')]=moment()[_0xc745('0x55')](_0xc745('0x76'));_0x44a07f[_0xc745('0x88')]=moment()[_0xc745('0x55')](_0xc745('0x76'));}_0x44a07f[_0xc745('0x21')]=![];_0x44a07f[_0xc745('0x83')]=null;_0x44a07f[_0xc745('0x54')]=_0x22c8e4[_0xc745('0xab')];this['channels'][_0x22c8e4['uniqueid']]=_0x44a07f;this[_0xc745('0x4a')](_0x44a07f,_0xc745('0x28'));}else if(this[_0xc745('0x5d')](_0x22c8e4[_0xc745('0xa5')])&&this[_0xc745('0x5d')](_0x22c8e4[_0xc745('0xa5')][_0xc745('0xac')])){if(!_0x44a07f[_0xc745('0x21')]){_0x44a07f[_0xc745('0x90')]=!![];_0x44a07f[_0xc745('0x91')]=moment()['format'](_0xc745('0x76'));_0x44a07f[_0xc745('0x54')]='EXITWITHKEY';_0x44a07f[_0xc745('0x88')]=moment()[_0xc745('0x55')](_0xc745('0x76'));this[_0xc745('0x14')][_0x22c8e4[_0xc745('0x4f')]]=_0x44a07f;}}logger[_0xc745('0x7a')](_0xc745('0xad'),_0x22c8e4[_0xc745('0x4f')],_0x44a07f['queue'],_0x44a07f[_0xc745('0x5a')],_['keys'](_0x22c8e4[_0xc745('0xa5')])[0x0],_0x22c8e4[_0xc745('0xab')]);_0x44a07f[_0xc745('0x46')]=this['variables'][_0x22c8e4[_0xc745('0x4f')]];}}}}catch(_0x1d4d7e){logger[_0xc745('0x43')](_0xc745('0xa4'),_0x22c8e4[_0xc745('0x4f')],util[_0xc745('0x45')](_0x1d4d7e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xc745('0xae')]=function(_0x38e7be,_0x516b8b,_0x21e1eb){var _0x3cd8f7=[_0xc745('0xaf'),_0xc745('0xb0'),'rtpaudioqosjitter',_0xc745('0xb1'),_0xc745('0xb2'),_0xc745('0xb3'),_0xc745('0xb4'),'rtpaudioqosrttbridged',_0xc745('0xb5'),'sipuri',_0xc745('0xb6'),_0xc745('0xb7'),_0xc745('0xb8'),_0xc745('0xb9'),_0xc745('0xba'),'memberlastcall',_0xc745('0x8f'),_0xc745('0xbb'),_0xc745('0xbc')];if(!_[_0xc745('0xbd')](_0x516b8b)&&!_[_0xc745('0xbe')](_0x3cd8f7,_0x516b8b)){if(_[_0xc745('0x74')](this[_0xc745('0x46')][_0x38e7be])){this[_0xc745('0x46')][_0x38e7be]={};}this[_0xc745('0x46')][_0x38e7be][_0x516b8b]=_0x21e1eb;}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0xbf')]=function(_0x2f45ee,_0x4942d9,_0x102816){var _0x56c555={};for(var _0x492b2a=0x0;_0x492b2a<this[_0xc745('0x11')][_0x2f45ee][_0xc745('0xc0')];_0x492b2a+=0x1){_0x56c555=this['queueReports'][_0x2f45ee][_0x492b2a];if(this[_0xc745('0x16')][_0x56c555[_0xc745('0x6a')]]){if(_0x56c555[_0xc745('0x90')]&&_0x56c555[_0xc745('0x93')]!=!![]){this[_0xc745('0x16')][_0x56c555[_0xc745('0x6a')]][_0xc745('0xc1')]+=0x1;}if(_0x56c555[_0xc745('0x21')]){this[_0xc745('0x16')][_0x56c555[_0xc745('0x6a')]][_0xc745('0xc2')]+=0x1;}this[_0xc745('0x16')][_0x56c555[_0xc745('0x6a')]][_0xc745('0xc3')]+=moment(_0x56c555[_0xc745('0x88')])[_0xc745('0xc4')](_0x56c555[_0xc745('0x75')],_0xc745('0x9a'))||0x0;if(_0x492b2a===this[_0xc745('0x11')][_0x2f45ee][_0xc745('0xc0')]-0x1){this['voiceQueues'][_0x56c555['queue']][_0xc745('0xc5')]+=moment()[_0xc745('0xc6')](0x0)[_0xc745('0xc4')](_0x56c555[_0xc745('0x75')],'seconds');this[_0xc745('0x16')][_0x56c555[_0xc745('0x6a')]][_0xc745('0xc7')]+=0x1;if(_0x56c555[_0xc745('0x80')]){this[_0xc745('0x16')][_0x56c555[_0xc745('0x6a')]]['answered']+=0x1;this[_0xc745('0x16')][_0x56c555[_0xc745('0x6a')]][_0xc745('0xc8')]+=moment()['milliseconds'](0x0)[_0xc745('0xc4')](_0x56c555[_0xc745('0x88')],_0xc745('0x9a'));_0x56c555[_0xc745('0x81')]=moment()['format'](_0xc745('0x76'));_0x56c555[_0xc745('0x90')]=![];_0x56c555[_0xc745('0x91')]=null;}if(_0x56c555[_0xc745('0x90')]&&_0x56c555[_0xc745('0x93')]!=!![]){_0x56c555[_0xc745('0xa8')]=_0xc745('0xc1');logger['debug']('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x2f45ee,util[_0xc745('0x45')](_0x56c555,{'showHidden':![],'depth':null}));ami['emit'](_0xc745('0xc9'),_0x56c555);}if(_0x56c555[_0xc745('0x21')]){_0x56c555[_0xc745('0xa8')]=_0xc745('0xc2');logger['debug']('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x2f45ee,util[_0xc745('0x45')](_0x56c555,{'showHidden':![],'depth':null}));ami[_0xc745('0x4b')](_0xc745('0xca'),_0x56c555);}}else{this['voiceQueues'][_0x56c555[_0xc745('0x6a')]][_0xc745('0xc5')]+=this['voiceQueues'][_0x56c555[_0xc745('0x6a')]][_0xc745('0xc3')];}logger[_0xc745('0x7a')](_0xc745('0xcb'),_0x2f45ee,_0x56c555[_0xc745('0x6a')],_0x56c555[_0xc745('0x5a')],_0x4942d9);if(_0x102816&&_0x56c555[_0xc745('0x54')]==='ATTENDEDTRANSFER'){_0x56c555[_0xc745('0x54')]='COMPLETEDBYAGENT';}this[_0xc745('0x14')][_0x2f45ee]=_0x56c555;this['emitVoiceQueueChannelRemove'](_0x56c555,'hangup');}}logger[_0xc745('0x4d')](_0xc745('0xcc'),_0x2f45ee,util[_0xc745('0x45')](this[_0xc745('0x11')][_0x2f45ee],{'showHidden':![],'depth':null}));ami[_0xc745('0x4b')](_0xc745('0xcd'),this[_0xc745('0x11')][_0x2f45ee]);if(_0x56c555['queuecallerexitreason']==='ATTENDEDTRANSFER'){return;}if(_0x56c555[_0xc745('0x90')]||_0x56c555[_0xc745('0x21')]||_0x56c555[_0xc745('0x80')]){delete this[_0xc745('0x11')][_0x2f45ee];delete this[_0xc745('0x14')][_0x2f45ee];if(this[_0xc745('0x46')][_0x2f45ee]){delete this['variables'][_0x2f45ee];}}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x2b')]=function(_0x28f43b){try{if(this[_0xc745('0x5d')](_0x28f43b)){logger[_0xc745('0x4d')]('[%s][voiceQueueReport][hangup]',_0x28f43b[_0xc745('0x4f')],util[_0xc745('0x45')](_0x28f43b,{'showHidden':![],'depth':null}));if(this[_0xc745('0x11')][_0x28f43b['uniqueid']]){return this[_0xc745('0xbf')](_0x28f43b['uniqueid'],_0x28f43b[_0xc745('0xce')],![]);}if(this[_0xc745('0x11')][_0x28f43b[_0xc745('0x98')]]){if(_0x28f43b[_0xc745('0xcf')]==='21'){return;}return this[_0xc745('0xbf')](_0x28f43b['linkedid'],_0x28f43b[_0xc745('0xce')],!![]);}var _0x3bbf3d=Object[_0xc745('0x7c')](this[_0xc745('0x11')]);for(var _0x4c24c7=0x0;_0x4c24c7<_0x3bbf3d[_0xc745('0xc0')];_0x4c24c7++){var _0x30fe81=_['last'](this[_0xc745('0x11')][_0x3bbf3d[_0x4c24c7]]);if(_0x30fe81&&_0x30fe81[_0xc745('0xd0')]===_0x28f43b[_0xc745('0x4f')]){return this[_0xc745('0xbf')](_0x30fe81[_0xc745('0x4f')],_0x28f43b[_0xc745('0xce')],!![]);}}}}catch(_0x9cc1f1){logger[_0xc745('0x43')](_0xc745('0xd1'),_0x28f43b[_0xc745('0x4f')],util['inspect'](_0x9cc1f1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')]['syncAttendedTransfer']=function(_0x2aa402){try{if(this[_0xc745('0x5d')](_0x2aa402)){logger[_0xc745('0x4d')]('[%s][voiceQueueReport][attendedtransfer]',_0x2aa402[_0xc745('0x4f')],util[_0xc745('0x45')](_0x2aa402,{'showHidden':![],'depth':null}));var _0x2806be;var _0x296c49;var _0x2acc21;if(this['queueReports'][_0x2aa402[_0xc745('0xd2')]]){_0x2806be=_['last'](this[_0xc745('0x11')][_0x2aa402[_0xc745('0xd2')]]);_0x2806be['transferexten']=_0x2aa402[_0xc745('0xd3')];_0x2806be[_0xc745('0xa0')]=_0x2aa402[_0xc745('0xd4')];_0x2806be[_0xc745('0x54')]=_0xc745('0xd5');_0x2806be[_0xc745('0x93')]=!![];_0x2806be[_0xc745('0x9c')]='ATTENDED';if(this[_0xc745('0x11')][_0x2aa402['secondtransfereruniqueid']]){_0x2acc21=this[_0xc745('0x11')][_0x2aa402['secondtransfereruniqueid']];this[_0xc745('0x11')][_0x2aa402[_0xc745('0xd4')]]=this[_0xc745('0x11')][_0x2aa402[_0xc745('0xd2')]];this[_0xc745('0x11')][_0x2aa402[_0xc745('0xd2')]]=_0x2acc21;_0x296c49=_['last'](this[_0xc745('0x11')][_0x2aa402[_0xc745('0xd2')]]);_0x296c49[_0xc745('0x3d')]=!![];}logger[_0xc745('0x7a')](_0xc745('0xd6'),_0x2aa402[_0xc745('0x4f')],_0x2806be[_0xc745('0x6a')],_0x2806be['type'],_0x2806be[_0xc745('0x9e')],_0x2806be[_0xc745('0xa0')]);}else if(this['queueReports'][_0x2aa402[_0xc745('0xd7')]]){_0x2806be=_[_0xc745('0x7f')](this[_0xc745('0x11')][_0x2aa402['transfertargetuniqueid']]);_0x2806be[_0xc745('0x9e')]=_0x2aa402[_0xc745('0xd8')];_0x2806be['transferuniqueid']=_0x2aa402[_0xc745('0xd9')];_0x2806be[_0xc745('0x54')]=_0xc745('0xd5');_0x2806be['transfer']=!![];_0x2806be['transfertype']=_0xc745('0xda');if(this['queueReports'][_0x2aa402['origtransfereruniqueid']]){_0x2acc21=this[_0xc745('0x11')][_0x2aa402['origtransfereruniqueid']];this[_0xc745('0x11')][_0x2aa402[_0xc745('0xd9')]]=this[_0xc745('0x11')][_0x2aa402['transfertargetuniqueid']];this[_0xc745('0x11')][_0x2aa402[_0xc745('0xd7')]]=_0x2acc21;_0x296c49=_['last'](this[_0xc745('0x11')][_0x2aa402[_0xc745('0xd7')]]);_0x296c49[_0xc745('0x3d')]=!![];}logger[_0xc745('0x7a')](_0xc745('0xd6'),_0x2aa402['uniqueid'],_0x2806be[_0xc745('0x6a')],_0x2806be[_0xc745('0x5a')],_0x2806be[_0xc745('0x9e')],_0x2806be[_0xc745('0xa0')]);}else if(this[_0xc745('0x11')][_0x2aa402[_0xc745('0xd9')]]){_0x2806be=_[_0xc745('0x7f')](this['queueReports'][_0x2aa402['origtransfereruniqueid']]);_0x2806be[_0xc745('0x9e')]=_0x2aa402[_0xc745('0xd8')];_0x2806be[_0xc745('0xa0')]=_0x2aa402[_0xc745('0xd9')];_0x2806be[_0xc745('0x54')]=_0xc745('0xd5');_0x2806be['transfer']=!![];_0x2806be[_0xc745('0x9c')]='ATTENDED';_0x2806be[_0xc745('0x3d')]=!![];_0x2806be['transferid']=_0x2aa402['transfereeuniqueid'];}else if(this['queueReports'][_0x2aa402[_0xc745('0xd4')]]){_0x2806be=_[_0xc745('0x7f')](this[_0xc745('0x11')][_0x2aa402[_0xc745('0xd4')]]);_0x2806be[_0xc745('0x9e')]=_0x2aa402['secondtransfererexten'];_0x2806be[_0xc745('0xa0')]=_0x2aa402[_0xc745('0xd4')];_0x2806be['queuecallerexitreason']=_0xc745('0xd5');_0x2806be[_0xc745('0x93')]=!![];_0x2806be[_0xc745('0x9c')]=_0xc745('0xda');_0x2806be[_0xc745('0x3d')]=!![];_0x2806be['transferid']=_0x2aa402[_0xc745('0xd7')];}}}catch(_0x255c5b){logger[_0xc745('0x43')](_0xc745('0xdb'),_0x2aa402[_0xc745('0x4f')],util['inspect'](_0x255c5b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x32')]=function(_0x5c535d){try{if(this['isNotNull'](_0x5c535d)){logger[_0xc745('0x4d')](_0xc745('0xdc'),_0x5c535d[_0xc745('0x4f')],util['inspect'](_0x5c535d,{'showHidden':![],'depth':null}));if(this[_0xc745('0x11')][_0x5c535d[_0xc745('0xd2')]]){var _0x2ffb00=_[_0xc745('0x7f')](this[_0xc745('0x11')][_0x5c535d['transfereeuniqueid']]);_0x2ffb00[_0xc745('0x54')]=_0xc745('0xdd');_0x2ffb00['transfer']=!![];_0x2ffb00[_0xc745('0x9c')]=_0xc745('0xde');_0x2ffb00[_0xc745('0x9e')]=_0x5c535d[_0xc745('0xdf')];_0x2ffb00[_0xc745('0xa0')]=_0x5c535d[_0xc745('0xd2')];logger[_0xc745('0x7a')]('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x5c535d[_0xc745('0x4f')],_0x2ffb00[_0xc745('0x6a')],_0x2ffb00['type'],_0x2ffb00[_0xc745('0x9e')],_0x2ffb00[_0xc745('0xa0')]);this[_0xc745('0x2b')]({'event':'BlindTransfer','uniqueid':_0x5c535d['transfereeuniqueid'],'context':_0x5c535d[_0xc745('0xe0')],'channel':_0x5c535d['transfererchannel']});}}}catch(_0x15ad4f){logger[_0xc745('0x43')](_0xc745('0xdc'),_0x5c535d[_0xc745('0x4f')],util[_0xc745('0x45')](_0x15ad4f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')]['syncMusicOnHoldStart']=function(_0x3eb9e3){try{if(this['isNotNull'](_0x3eb9e3)){logger['debug'](_0xc745('0xe1'),_0x3eb9e3[_0xc745('0x4f')],util[_0xc745('0x45')](_0x3eb9e3,{'showHidden':![],'depth':null}));if(this[_0xc745('0x11')][_0x3eb9e3[_0xc745('0x4f')]]){var _0x2b6c48=_[_0xc745('0x7f')](this['queueReports'][_0x3eb9e3['uniqueid']]);if(!_['isNil'](_0x2b6c48[_0xc745('0x88')])){_0x2b6c48[_0xc745('0xe2')]=moment()[_0xc745('0x55')]('YYYY-MM-DD\x20HH:mm:ss');logger['info'](_0xc745('0xe3'),_0x3eb9e3[_0xc745('0x4f')],_0x2b6c48[_0xc745('0xe2')]);}}}}catch(_0x446604){logger[_0xc745('0x43')]('[%s][voiceQueueReport][musiconholdstart]',_0x3eb9e3[_0xc745('0x4f')],util[_0xc745('0x45')](_0x446604,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0x2f')]=function(_0x5b4a13){try{if(this['isNotNull'](_0x5b4a13)){logger[_0xc745('0x4d')]('[%s][voiceQueueReport][musiconholdstop]',_0x5b4a13[_0xc745('0x4f')],util['inspect'](_0x5b4a13,{'showHidden':![],'depth':null}));if(this[_0xc745('0x11')][_0x5b4a13[_0xc745('0x4f')]]){var _0x582e0c=_['last'](this['queueReports'][_0x5b4a13['uniqueid']]);if(!_['isNil'](_0x582e0c[_0xc745('0xe2')])){_0x582e0c[_0xc745('0xe4')]+=moment()[_0xc745('0xc6')](0x0)[_0xc745('0xc4')](_0x582e0c[_0xc745('0xe2')],_0xc745('0x9a'));logger[_0xc745('0x7a')](_0xc745('0xe5'),_0x5b4a13[_0xc745('0x4f')],_0x582e0c[_0xc745('0xe4')]);delete _0x582e0c[_0xc745('0xe2')];}}}}catch(_0x2d2923){logger[_0xc745('0x43')]('[%s][voiceQueueReport][musiconholdstop]',_0x5b4a13['uniqueid'],util[_0xc745('0x45')](_0x2d2923,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc745('0xd')][_0xc745('0xe6')]=function(_0x46121c){try{if(this[_0xc745('0x5d')](_0x46121c)){logger[_0xc745('0x4d')](_0xc745('0xe7'),_0x46121c[_0xc745('0x4f')],util[_0xc745('0x45')](_0x46121c,{'showHidden':![],'depth':null}));if(_0x46121c[_0xc745('0xe8')][_0xc745('0xe9')]()==='set'){_0x46121c['applicationdata']=_0x46121c[_0xc745('0xea')]&&_0x46121c[_0xc745('0xea')][_0xc745('0x96')](_0xc745('0xeb'))?_0x46121c[_0xc745('0xea')]:(_0x46121c[_0xc745('0xea')]||_0x46121c['applicationdata'])[_0xc745('0xe9')]();if(_['startsWith'](_0x46121c[_0xc745('0xec')][_0xc745('0xe9')](),'cdr(')){logger[_0xc745('0x7a')](_0xc745('0xed'),_0x46121c[_0xc745('0x4f')],_0x46121c[_0xc745('0xe8')],_0x46121c[_0xc745('0xec')]);if(_['isUndefined'](this[_0xc745('0x14')][_0x46121c['uniqueid']]))this['channels'][_0x46121c[_0xc745('0x4f')]]={};var _0xf43016=_0x46121c[_0xc745('0xec')][_0xc745('0xee')]('=');var _0x45bd23=_0xf43016[0x0][_0xc745('0xe9')]()['match'](/cdr\((.*)\)/);if(_0x45bd23)this[_0xc745('0x14')][_0x46121c[_0xc745('0x4f')]][_0x45bd23[0x1]]=_0xf43016[0x1];}}}}catch(_0x2ea01a){logger[_0xc745('0x43')](_0xc745('0xef'),_0x46121c[_0xc745('0x4f')],util[_0xc745('0x45')](_0x2ea01a,{'showHidden':![],'depth':null}));}};module[_0xc745('0xf0')]=VoiceQueueReport;