Built motion from commit 43538d75.|2.5.35
[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 _0x4e34=['channels','switch','isNil','Action','status','channel','catch','No\x20such\x20channel','error','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','name','voice_queue_channel:save','voice_queue_channel:remove','type','inbound','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','format','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','toNumber','talking','loggedin','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','queuecallerjoin','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','ABANDONED','lastAssignedTo','[%s][voiceQueueReport][queuecallerabandon]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][queuecallerleave]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','linkedid','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][agentcomplete]','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','varset','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberrealtime','syncHangup','diff','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','util','md5','../../../config/logger','../ami','../model/queueReport','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','syncVarSet','hangup','fullybooted','syncFullyBooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','blindtransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels'];(function(_0x1dd41d,_0x159aa3){var _0x566752=function(_0xfd530f){while(--_0xfd530f){_0x1dd41d['push'](_0x1dd41d['shift']());}};_0x566752(++_0x159aa3);}(_0x4e34,0x19e));var _0x44e3=function(_0x5dfed6,_0x15bbc3){_0x5dfed6=_0x5dfed6-0x0;var _0x1d5f31=_0x4e34[_0x5dfed6];return _0x1d5f31;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x44e3('0x0'));var md5=require(_0x44e3('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x44e3('0x2'))('ami');var ami=require(_0x44e3('0x3'));var QueueReport=require(_0x44e3('0x4'));config[_0x44e3('0x5')]=_['defaults'](config['redis'],{'host':_0x44e3('0x6'),'port':0x18eb});var io=require(_0x44e3('0x7'))(new Redis(config[_0x44e3('0x5')]));var Sequence=function(){};Sequence[_0x44e3('0x8')][_0x44e3('0x9')]=function(_0x196941){this[_0x44e3('0xa')]=this['tail']?this[_0x44e3('0xa')][_0x44e3('0xb')](_0x196941):_0x196941();};function VoiceQueueReport(_0x4eb230){this['sequence']=new Sequence();this[_0x44e3('0xc')]={};this[_0x44e3('0xd')]=_0x4eb230['agents'];this['channels']=_0x4eb230[_0x44e3('0xe')];this[_0x44e3('0xf')]=_0x4eb230[_0x44e3('0xf')];this[_0x44e3('0x10')]=!![];this['campaigns']=_0x4eb230[_0x44e3('0x11')];this[_0x44e3('0x12')]={};ami['on'](_0x44e3('0x13'),this[_0x44e3('0x14')][_0x44e3('0x15')](this));ami['on'](_0x44e3('0x16'),this[_0x44e3('0x17')][_0x44e3('0x15')](this));ami['on']('queuecallerjoin',this[_0x44e3('0x18')]['bind'](this));ami['on'](_0x44e3('0x19'),this[_0x44e3('0x1a')]['bind'](this));ami['on'](_0x44e3('0x1b'),this[_0x44e3('0x1c')][_0x44e3('0x15')](this));ami['on'](_0x44e3('0x1d'),this[_0x44e3('0x1e')][_0x44e3('0x15')](this));ami['on'](_0x44e3('0x1f'),this[_0x44e3('0x20')][_0x44e3('0x15')](this));ami['on']('varset',this[_0x44e3('0x21')]['bind'](this));ami['on'](_0x44e3('0x22'),this['syncHangup'][_0x44e3('0x15')](this));ami['on'](_0x44e3('0x23'),this[_0x44e3('0x24')][_0x44e3('0x15')](this));ami['on'](_0x44e3('0x25'),this[_0x44e3('0x26')][_0x44e3('0x15')](this));ami['on'](_0x44e3('0x27'),this[_0x44e3('0x28')][_0x44e3('0x15')](this));ami['on'](_0x44e3('0x29'),this['syncMusicOnHoldStop']['bind'](this));ami['on'](_0x44e3('0x2a'),this['syncAttendedTransfer'][_0x44e3('0x15')](this));ami['on'](_0x44e3('0x2b'),this['syncBlindTransfer'][_0x44e3('0x15')](this));this[_0x44e3('0x2c')]();this[_0x44e3('0x2d')]();}function clearChannels(_0x3f620a){if(!_['isEmpty'](_0x3f620a)){for(var _0x3787c8 in _0x3f620a){if(_0x3f620a[_0x44e3('0x2e')](_0x3787c8)){delete _0x3f620a[_0x3787c8];}}}}function clearCampaigns(_0x574e04){if(!_[_0x44e3('0x2f')](_0x574e04)){for(var _0x22b788 in _0x574e04){if(_0x574e04[_0x44e3('0x2e')](_0x22b788)){_0x574e04[_0x22b788][_0x44e3('0x30')]=0x0;}}}}function clearVoiceQueues(_0x5f361e){if(!_['isEmpty'](_0x5f361e)){for(var _0xe9043f in _0x5f361e){if(_0x5f361e[_0x44e3('0x2e')](_0xe9043f)){_0x5f361e[_0xe9043f][_0x44e3('0x30')]=0x0;_0x5f361e[_0xe9043f]['talking']=0x0;_0x5f361e[_0xe9043f][_0x44e3('0x31')]=0x0;_0x5f361e[_0xe9043f][_0x44e3('0x32')]=0x0;_0x5f361e[_0xe9043f][_0x44e3('0x33')]=!![];}}}}function clearAgentBooked(_0x3659af){if(!_[_0x44e3('0x2f')](_0x3659af)){for(var _0x36ed4d in _0x3659af){if(_0x3659af[_0x44e3('0x2e')](_0x36ed4d)){_0x3659af[_0x36ed4d][_0x44e3('0x34')]=!![];}}}}VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0x35')]=function(){var _0x4b1bd8=this;for(var _0x44dee2 in this[_0x44e3('0x36')]){if(this[_0x44e3('0x36')][_0x44e3('0x2e')](_0x44dee2)&&!this[_0x44e3('0x36')][_0x44dee2][_0x44e3('0x37')]){this['sequence'][_0x44e3('0x9')](function(){if(!_[_0x44e3('0x38')](_0x4b1bd8['channels'][_0x44dee2])){return ami[_0x44e3('0x39')]({'action':_0x44e3('0x3a'),'channel':_0x4b1bd8['channels'][_0x44dee2][_0x44e3('0x3b')]})[_0x44e3('0x3c')](function(_0x38eb34){if(_0x38eb34['message']===_0x44e3('0x3d')){setTimeout(function(){if(_0x4b1bd8[_0x44e3('0x36')][_0x44dee2]){delete _0x4b1bd8[_0x44e3('0x36')][_0x44dee2];logger[_0x44e3('0x3e')]('[%s][voiceQueueReport][checkChannel]',_0x44dee2,util[_0x44e3('0x3f')](_0x38eb34,{'showHidden':![],'depth':null}));}if(_0x4b1bd8['queueReports'][_0x44dee2]){delete _0x4b1bd8[_0x44e3('0xc')][_0x44dee2];logger[_0x44e3('0x3e')](_0x44e3('0x40'),_0x44dee2,util[_0x44e3('0x3f')](_0x38eb34,{'showHidden':![],'depth':null}));}if(_0x4b1bd8[_0x44e3('0x12')][_0x44dee2]){delete _0x4b1bd8['variables'][_0x44dee2];logger[_0x44e3('0x3e')](_0x44e3('0x41'),_0x44dee2,util[_0x44e3('0x3f')](_0x38eb34,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0x24')]=function(){logger[_0x44e3('0x3e')](_0x44e3('0x42'));clearChannels(this[_0x44e3('0x36')]);this['clearQueueReport'](this[_0x44e3('0xc')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x44e3('0xf')]);clearCampaigns(this[_0x44e3('0x11')]);};VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0x43')]=function(_0x5c3b4f){var _0x6d78f8=this;if(!_[_0x44e3('0x2f')](_0x5c3b4f)){for(var _0x4bd7ac in _0x5c3b4f){if(_0x5c3b4f[_0x44e3('0x2e')](_0x4bd7ac)){_0x6d78f8[_0x44e3('0x44')](_0x5c3b4f[_0x4bd7ac],'clearqueuereport');delete _0x5c3b4f[_0x4bd7ac];}}}};VoiceQueueReport[_0x44e3('0x8')]['emit']=function(_0x28b628,_0x29d0fb,_0x5ee394){io['to'](_0x28b628)[_0x44e3('0x45')](_0x29d0fb,_0x5ee394);};VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0x46')]=function(_0x4ce979,_0xb75e47){logger[_0x44e3('0x47')](_0x44e3('0x48')+_0xb75e47+_0x44e3('0x49'),_0x4ce979[_0x44e3('0x4a')],util['inspect'](_0x4ce979,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x44e3('0x4b'),_0x4ce979[_0x44e3('0x4c')]),_0x44e3('0x4d'),_0x4ce979);io[_0x44e3('0x45')]('voice_queue_presence:save',_0x4ce979);};VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0x44')]=function(_0x3b5615,_0x4df091){logger[_0x44e3('0x47')](_0x44e3('0x48')+_0x4df091+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x3b5615['uniqueid'],util[_0x44e3('0x3f')](_0x3b5615,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x44e3('0x4b'),_0x3b5615[_0x44e3('0x4c')]),_0x44e3('0x4e'),_0x3b5615);io[_0x44e3('0x45')]('voice_queue_presence:remove',_0x3b5615);};VoiceQueueReport['prototype']['emitVoiceQueueSummary']=function(_0x44dbae,_0x26484e){if(_0x44dbae[_0x44e3('0x4f')]===_0x44e3('0x50')){var _0x1288de={'id':_0x44dbae['id'],'name':_0x44dbae[_0x44e3('0x4c')],'strategy':_0x44dbae[_0x44e3('0x51')],'answered':_0x44dbae[_0x44e3('0x52')],'available':_0x44dbae[_0x44e3('0x53')],'loggedIn':_0x44dbae[_0x44e3('0x54')],'pTalking':_0x44dbae[_0x44e3('0x31')],'sumBillable':_0x44dbae['sumBillable'],'sumDuration':_0x44dbae[_0x44e3('0x55')],'sumHoldTime':_0x44dbae[_0x44e3('0x56')]||0x0,'talking':_0x44dbae['talking'],'total':_0x44dbae['total'],'type':_0x44dbae[_0x44e3('0x4f')],'unmanaged':_0x44dbae[_0x44e3('0x57')],'abandoned':_0x44dbae[_0x44e3('0x58')],'waiting':_0x44dbae['waiting']};if(_0x44dbae[_0x44e3('0x59')]){_0x1288de[_0x44e3('0x59')]={'id':_0x44dbae[_0x44e3('0x59')]['id'],'name':_0x44dbae[_0x44e3('0x59')][_0x44e3('0x4c')],'active':_0x44dbae[_0x44e3('0x59')][_0x44e3('0x5a')],'callerid':_0x44dbae['Trunk'][_0x44e3('0x5b')]};}if(_0x44dbae[_0x44e3('0x5c')]){_0x1288de['Interval']={'id':_0x44dbae['Interval']['id'],'name':_0x44dbae[_0x44e3('0x5c')][_0x44e3('0x4c')]};}var _0x4af225=md5(JSON[_0x44e3('0x5d')](_0x1288de));if(_0x44dbae[_0x44e3('0x1')]!==_0x4af225){_0x44dbae[_0x44e3('0x1')]=_0x4af225;logger[_0x44e3('0x47')](_0x44e3('0x5e')+_0x26484e+_0x44e3('0x5f'),util['inspect'](_0x1288de,{'showHidden':![],'depth':null}));this[_0x44e3('0x45')](util[_0x44e3('0x60')](_0x44e3('0x4b'),_0x1288de[_0x44e3('0x4c')]),_0x44e3('0x61'),_0x1288de);}}};VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0x62')]=function(_0x49994b){return _0x49994b!==null&&!_[_0x44e3('0x63')](_0x49994b);};VoiceQueueReport['prototype'][_0x44e3('0x2d')]=function(){var _0x2ac352=this;setInterval(function(){_0x2ac352[_0x44e3('0x35')]();ami[_0x44e3('0x39')]({'action':_0x44e3('0x64')})[_0x44e3('0x3c')](function(_0x42ef05){logger['error'](_0x44e3('0x65'),util[_0x44e3('0x3f')](_0x42ef05,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0x2c')]=function(){var _0xb63748=this;setInterval(function(){if(_0xb63748['flagQueueSummary']){return ami['Action']({'action':_0x44e3('0x13')})[_0x44e3('0x66')](function(_0x224d85){_0xb63748[_0x44e3('0x10')]=![];})['catch'](function(_0x124f3e){logger['error'](_0x44e3('0x67'),util[_0x44e3('0x3f')](_0x124f3e,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0x14')]=function(_0x2fcaec){try{if(this['isNotNull'](_0x2fcaec)&&this[_0x44e3('0x62')](_0x2fcaec[_0x44e3('0x68')])){logger[_0x44e3('0x47')](_0x44e3('0x69'),util[_0x44e3('0x3f')](_0x2fcaec,{'showHidden':![],'depth':null}));if(this[_0x44e3('0xf')][_0x2fcaec[_0x44e3('0x68')]]){logger['info'](_0x44e3('0x6a'),_0x2fcaec[_0x44e3('0x68')]);var _0xaa0d74=_['countBy'](this['channels'],'queue')[_0x2fcaec['queue']]||0x0;var _0x3a2e2d=_0xaa0d74-_0x2fcaec['callers'];if(this['voiceQueues'][_0x2fcaec[_0x44e3('0x68')]][_0x44e3('0x32')]!==_[_0x44e3('0x6b')](_0x2fcaec['callers'])||this[_0x44e3('0xf')][_0x2fcaec[_0x44e3('0x68')]][_0x44e3('0x54')]!==_[_0x44e3('0x6b')](_0x2fcaec['loggedin'])||this[_0x44e3('0xf')][_0x2fcaec[_0x44e3('0x68')]][_0x44e3('0x53')]!==_['toNumber'](_0x2fcaec[_0x44e3('0x53')])||this[_0x44e3('0xf')][_0x2fcaec[_0x44e3('0x68')]][_0x44e3('0x6c')]!==_0x3a2e2d){this[_0x44e3('0xf')][_0x2fcaec['queue']][_0x44e3('0x32')]=_[_0x44e3('0x6b')](_0x2fcaec['callers']);this['voiceQueues'][_0x2fcaec[_0x44e3('0x68')]]['loggedIn']=_[_0x44e3('0x6b')](_0x2fcaec[_0x44e3('0x6d')]);this[_0x44e3('0xf')][_0x2fcaec[_0x44e3('0x68')]][_0x44e3('0x53')]=_[_0x44e3('0x6b')](_0x2fcaec[_0x44e3('0x53')]);this[_0x44e3('0xf')][_0x2fcaec[_0x44e3('0x68')]][_0x44e3('0x6c')]=_0x3a2e2d>0x0?_0x3a2e2d:0x0;this[_0x44e3('0xf')][_0x2fcaec[_0x44e3('0x68')]]['talking']=this[_0x44e3('0xf')][_0x2fcaec['queue']][_0x44e3('0x6c')]>_[_0x44e3('0x6b')](_0x2fcaec[_0x44e3('0x6d')])?_[_0x44e3('0x6b')](_0x2fcaec[_0x44e3('0x6d')]):this[_0x44e3('0xf')][_0x2fcaec[_0x44e3('0x68')]]['talking'];this['emitVoiceQueueSummary'](this[_0x44e3('0xf')][_0x2fcaec[_0x44e3('0x68')]],_0x44e3('0x13'));}logger[_0x44e3('0x47')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x44e3('0x3f')](this['voiceQueues'][_0x2fcaec[_0x44e3('0x68')]],{'showHidden':![],'depth':null}));ami[_0x44e3('0x45')]('custom:queuesummary',this['voiceQueues'][_0x2fcaec[_0x44e3('0x68')]]);}}}catch(_0x5c463d){logger[_0x44e3('0x3e')](_0x44e3('0x67'),util[_0x44e3('0x3f')](_0x5c463d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x22772d){logger[_0x44e3('0x47')](_0x44e3('0x6e'),util[_0x44e3('0x3f')](_0x22772d,{'showHidden':![],'depth':null}));this[_0x44e3('0x10')]=!![];};VoiceQueueReport['prototype'][_0x44e3('0x18')]=function(_0x20eae4){try{if(this[_0x44e3('0x62')](_0x20eae4)){logger[_0x44e3('0x47')](_0x44e3('0x6f'),_0x20eae4[_0x44e3('0x4a')],util['inspect'](_0x20eae4,{'showHidden':![],'depth':null}));if(_[_0x44e3('0x63')](this[_0x44e3('0xc')][_0x20eae4[_0x44e3('0x4a')]]))this[_0x44e3('0xc')][_0x20eae4['uniqueid']]=[];if(_[_0x44e3('0x63')](this[_0x44e3('0x36')][_0x20eae4[_0x44e3('0x4a')]]))this[_0x44e3('0x36')][_0x20eae4[_0x44e3('0x4a')]]={};var _0x4ddc00=new QueueReport();_0x4ddc00[_0x44e3('0x4c')]=_0x20eae4['queue'];_0x4ddc00[_0x44e3('0x4f')]=this[_0x44e3('0xf')][_0x4ddc00[_0x44e3('0x4c')]]&&this[_0x44e3('0xf')][_0x4ddc00['name']][_0x44e3('0x4f')]?this[_0x44e3('0xf')][_0x4ddc00[_0x44e3('0x4c')]]['type']||_0x44e3('0x50'):_0x44e3('0x50');_0x4ddc00[_0x44e3('0x68')]=_0x20eae4[_0x44e3('0x68')];_0x4ddc00['queuecallerjoinAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4ddc00[_0x44e3('0x70')]=_0x20eae4[_0x44e3('0x70')];_0x4ddc00[_0x44e3('0x71')]=_0x20eae4[_0x44e3('0x71')];_0x4ddc00['uniqueid']=_0x20eae4[_0x44e3('0x4a')];_0x4ddc00[_0x44e3('0x72')]=this['channels'][_0x20eae4[_0x44e3('0x4a')]]['routealias'];logger[_0x44e3('0x73')](_0x44e3('0x74'),_0x4ddc00[_0x44e3('0x4c')],_0x4ddc00[_0x44e3('0x4f')]);_[_0x44e3('0x75')](_0x4ddc00,_[_0x44e3('0x76')](_0x20eae4,_[_0x44e3('0x77')](_0x4ddc00)));this['queueReports'][_0x20eae4[_0x44e3('0x4a')]]['push'](_0x4ddc00);this[_0x44e3('0x36')][_0x20eae4[_0x44e3('0x4a')]]=_0x4ddc00;this[_0x44e3('0x46')](_0x4ddc00,_0x44e3('0x78'));}}catch(_0x5a2553){logger[_0x44e3('0x3e')]('[%s][voiceQueueReport][queuecallerjoin]',_0x20eae4['uniqueid'],util[_0x44e3('0x3f')](_0x5a2553,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0x1a')]=function(_0x1a3af4){try{if(this[_0x44e3('0x62')](_0x1a3af4)){logger[_0x44e3('0x47')]('[%s][voiceQueueReport][queuecallerabandon]',_0x1a3af4[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x1a3af4,{'showHidden':![],'depth':null}));if(this[_0x44e3('0xc')][_0x1a3af4[_0x44e3('0x4a')]]){var _0x467c08=_[_0x44e3('0x79')](this[_0x44e3('0xc')][_0x1a3af4[_0x44e3('0x4a')]]);_0x467c08[_0x44e3('0x7a')]=![];_0x467c08[_0x44e3('0x7b')]=null;_0x467c08[_0x44e3('0x7c')]=_0x1a3af4['holdtime'];_0x467c08[_0x44e3('0x7d')]=_0x1a3af4[_0x44e3('0x7d')];_0x467c08[_0x44e3('0x19')]=!![];_0x467c08[_0x44e3('0x7e')]=moment()[_0x44e3('0x60')](_0x44e3('0x7f'));_0x467c08[_0x44e3('0x80')]=_0x44e3('0x81');_0x467c08[_0x44e3('0x82')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x467c08[_0x44e3('0x4c')],_0x467c08[_0x44e3('0x4f')]);this[_0x44e3('0x36')][_0x1a3af4[_0x44e3('0x4a')]]=_0x467c08;this[_0x44e3('0x44')](_0x467c08,_0x44e3('0x19'));}}}catch(_0x188183){logger[_0x44e3('0x3e')](_0x44e3('0x83'),_0x1a3af4[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x188183,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x44e3('0x1c')]=function(_0x512f40){try{if(this[_0x44e3('0x62')](_0x512f40)){logger[_0x44e3('0x47')]('[%s][voiceQueueReport][queuecallerleave]',_0x512f40[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x512f40,{'showHidden':![],'depth':null}));if(this[_0x44e3('0xc')][_0x512f40[_0x44e3('0x4a')]]){var _0x28ab10=_[_0x44e3('0x79')](this[_0x44e3('0xc')][_0x512f40[_0x44e3('0x4a')]]);_0x28ab10[_0x44e3('0x84')]=moment()[_0x44e3('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0x28ab10['connectedlinenum']=_0x512f40[_0x44e3('0x85')];_0x28ab10[_0x44e3('0x86')]=_0x512f40[_0x44e3('0x86')];logger['info'](_0x44e3('0x87'),_0x28ab10[_0x44e3('0x4c')],_0x28ab10[_0x44e3('0x4f')],_0x512f40[_0x44e3('0x85')],_0x512f40[_0x44e3('0x86')]);this[_0x44e3('0x36')][_0x512f40['uniqueid']]=_0x28ab10;this[_0x44e3('0x46')](_0x28ab10,_0x44e3('0x1b'));}}}catch(_0x5be7e0){logger[_0x44e3('0x3e')](_0x44e3('0x88'),_0x512f40['uniqueid'],util['inspect'](_0x5be7e0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0x20')]=function(_0x31d88f){try{if(this[_0x44e3('0x62')](_0x31d88f)){logger[_0x44e3('0x47')]('[%s][voiceQueueReport][agentconnect]',_0x31d88f['uniqueid'],util[_0x44e3('0x3f')](_0x31d88f,{'showHidden':![],'depth':null}));if(this[_0x44e3('0xc')][_0x31d88f['uniqueid']]){var _0x46cece=_[_0x44e3('0x79')](this['queueReports'][_0x31d88f[_0x44e3('0x4a')]]);_0x46cece[_0x44e3('0x7a')]=!![];_0x46cece[_0x44e3('0x80')]=_0x44e3('0x89');logger[_0x44e3('0x73')](_0x44e3('0x8a'),_0x46cece[_0x44e3('0x4c')],_0x46cece[_0x44e3('0x4f')]);}}}catch(_0x5c032c){logger[_0x44e3('0x3e')](_0x44e3('0x8b'),_0x31d88f[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x5c032c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0x1e')]=function(_0x218c3b){try{if(this['isNotNull'](_0x218c3b)){logger[_0x44e3('0x47')]('[%s][voiceQueueReport][agentcomplete]',_0x218c3b['uniqueid'],util['inspect'](_0x218c3b,{'showHidden':![],'depth':null}));if(this[_0x44e3('0xc')][_0x218c3b['uniqueid']]){var _0x694e24=_[_0x44e3('0x79')](this['queueReports'][_0x218c3b['uniqueid']]);_0x694e24[_0x44e3('0x19')]=![];_0x694e24['queuecallerabandonAt']=null;_0x694e24[_0x44e3('0x8c')]=!![];_0x694e24[_0x44e3('0x82')]=_0x218c3b[_0x44e3('0x8d')];_0x694e24['holdtime']=_0x218c3b[_0x44e3('0x7c')];_0x694e24['queuecallercomplete']=!![];_0x694e24[_0x44e3('0x8e')]=![];_0x694e24[_0x44e3('0x8f')]=null;if(!_0x694e24[_0x44e3('0x90')]){if(_0x218c3b[_0x44e3('0x91')]==_0x44e3('0x90')){_0x694e24['queuecallerexitreason']=_0x44e3('0x92');logger[_0x44e3('0x73')](_0x44e3('0x93'),_0x694e24[_0x44e3('0x4c')],_0x694e24[_0x44e3('0x4f')]);}else{if(_[_0x44e3('0x94')](_0x218c3b[_0x44e3('0x3b')][_0x44e3('0x95')](),'local/')){if(this['queueReports'][_0x218c3b[_0x44e3('0x96')]]){var _0xc92166=_[_0x44e3('0x79')](this[_0x44e3('0xc')][_0x218c3b[_0x44e3('0x96')]]);_0xc92166[_0x44e3('0x7a')]=![];_0xc92166[_0x44e3('0x8e')]=!![];_0xc92166[_0x44e3('0x8f')]=moment(_0x694e24[_0x44e3('0x97')])[_0x44e3('0x98')](_0x218c3b[_0x44e3('0x7c')],_0x44e3('0x99'))[_0x44e3('0x60')](_0x44e3('0x7f'));_0xc92166[_0x44e3('0x80')]=_0x44e3('0x9a');_0xc92166[_0x44e3('0x90')]=!![];_0xc92166[_0x44e3('0x9b')]=_0x44e3('0x9c');_0xc92166[_0x44e3('0x9d')]=_0x218c3b['destexten'];_0xc92166[_0x44e3('0x9e')]=_0x218c3b[_0x44e3('0x4a')];logger['info'](_0x44e3('0x9f'),_0xc92166['name'],_0xc92166[_0x44e3('0x4f')]);var _0x1a7d73=this[_0x44e3('0xc')][_0x218c3b[_0x44e3('0x96')]];this['queueReports'][_0x218c3b[_0x44e3('0x96')]]=this[_0x44e3('0xc')][_0x218c3b[_0x44e3('0x4a')]];this[_0x44e3('0xc')][_0x218c3b['uniqueid']]=_0x1a7d73;}}else{_0x694e24[_0x44e3('0x80')]=_0x44e3('0xa0')+_0x218c3b[_0x44e3('0x91')]['toUpperCase']();logger[_0x44e3('0x73')](_0x44e3('0xa1'),_0x694e24[_0x44e3('0x4c')],_0x694e24['type'],_0x694e24[_0x44e3('0x80')]);}}}this[_0x44e3('0x36')][_0x218c3b[_0x44e3('0x4a')]]=_0x694e24;this[_0x44e3('0x44')](_0x694e24,_0x44e3('0x1d'));}}}catch(_0x3bd60e){logger[_0x44e3('0x3e')](_0x44e3('0xa2'),_0x218c3b[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x3bd60e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x44e3('0x21')]=function(_0x21bf46){try{if(this['isNotNull'](_0x21bf46)){logger['debug'](_0x44e3('0xa3'),_0x21bf46[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x21bf46,{'showHidden':![],'depth':null}));this[_0x44e3('0xa4')](_0x21bf46[_0x44e3('0x4a')],_[_0x44e3('0x77')](_0x21bf46[_0x44e3('0xa5')])[0x0],_0x21bf46[_0x44e3('0xa6')]);if(this[_0x44e3('0xc')][_0x21bf46['uniqueid']]){var _0x96a913=_['last'](this[_0x44e3('0xc')][_0x21bf46[_0x44e3('0x4a')]]);if(_0x96a913){if(this[_0x44e3('0x62')](_0x21bf46['variable'])&&this['isNotNull'](_0x21bf46[_0x44e3('0xa5')][_0x44e3('0xa7')])){switch(_0x21bf46['value']){case _0x44e3('0xa8'):_0x96a913['queuecallerexit']=![];_0x96a913[_0x44e3('0x8f')]=null;break;case _0x44e3('0xa9'):_0x96a913[_0x44e3('0xaa')]=_0x44e3('0xab');_0x96a913[_0x44e3('0x8e')]=!![];_0x96a913[_0x44e3('0x8f')]=moment()[_0x44e3('0x60')](_0x44e3('0x7f'));_0x96a913[_0x44e3('0x84')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x44e3('0x47')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x21bf46['uniqueid'],util[_0x44e3('0x3f')](_0x96a913,{'showHidden':![],'depth':null}));ami[_0x44e3('0x45')]('custom:timeout',_0x96a913);break;default:_0x96a913['queuecallerexit']=!![];_0x96a913['queuecallerexitAt']=moment()[_0x44e3('0x60')](_0x44e3('0x7f'));_0x96a913[_0x44e3('0x84')]=moment()[_0x44e3('0x60')](_0x44e3('0x7f'));}_0x96a913[_0x44e3('0x19')]=![];_0x96a913[_0x44e3('0x7e')]=null;_0x96a913['queuecallerexitreason']=_0x21bf46[_0x44e3('0xa6')];this[_0x44e3('0x36')][_0x21bf46[_0x44e3('0x4a')]]=_0x96a913;this[_0x44e3('0x44')](_0x96a913,_0x44e3('0xac'));}else if(this['isNotNull'](_0x21bf46[_0x44e3('0xa5')])&&this[_0x44e3('0x62')](_0x21bf46[_0x44e3('0xa5')][_0x44e3('0xad')])){if(!_0x96a913[_0x44e3('0x19')]){_0x96a913[_0x44e3('0x8e')]=!![];_0x96a913[_0x44e3('0x8f')]=moment()[_0x44e3('0x60')](_0x44e3('0x7f'));_0x96a913[_0x44e3('0x80')]=_0x44e3('0xae');_0x96a913[_0x44e3('0x84')]=moment()[_0x44e3('0x60')](_0x44e3('0x7f'));this[_0x44e3('0x36')][_0x21bf46[_0x44e3('0x4a')]]=_0x96a913;}}logger[_0x44e3('0x73')](_0x44e3('0xaf'),_0x21bf46[_0x44e3('0x4a')],_0x96a913[_0x44e3('0x4c')],_0x96a913[_0x44e3('0x4f')],_[_0x44e3('0x77')](_0x21bf46[_0x44e3('0xa5')])[0x0],_0x21bf46[_0x44e3('0xa6')]);_0x96a913[_0x44e3('0x12')]=this[_0x44e3('0x12')][_0x21bf46['uniqueid']];}}}}catch(_0x264f6e){logger[_0x44e3('0x3e')](_0x44e3('0xa3'),_0x21bf46[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x264f6e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0xa4')]=function(_0x3d2543,_0x258230,_0x163fa8){var _0x579541=[_0x44e3('0xb0'),_0x44e3('0xb1'),'rtpaudioqosjitter',_0x44e3('0xb2'),_0x44e3('0xb3'),_0x44e3('0xb4'),_0x44e3('0xb5'),_0x44e3('0xb6'),'sipcallid','sipuri',_0x44e3('0xb7'),_0x44e3('0xb8'),_0x44e3('0xb9'),'memberdynamic','memberinterface',_0x44e3('0xba'),_0x44e3('0x8d'),'memberpenalty',_0x44e3('0xbb')];if(!_['isNil'](_0x258230)&&!_['includes'](_0x579541,_0x258230)){if(_[_0x44e3('0x63')](this['variables'][_0x3d2543])){this[_0x44e3('0x12')][_0x3d2543]={};}this[_0x44e3('0x12')][_0x3d2543][_0x258230]=_0x163fa8;}};VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0xbc')]=function(_0x7511e5){try{if(this[_0x44e3('0x62')](_0x7511e5)){logger[_0x44e3('0x47')]('[%s][voiceQueueReport][hangup]',_0x7511e5[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x7511e5,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x7511e5[_0x44e3('0x4a')]]){for(var _0x2d69e9=0x0,_0x883fbc={};_0x2d69e9<this[_0x44e3('0xc')][_0x7511e5['uniqueid']]['length'];_0x2d69e9+=0x1){_0x883fbc=this[_0x44e3('0xc')][_0x7511e5[_0x44e3('0x4a')]][_0x2d69e9];if(this[_0x44e3('0xf')][_0x883fbc[_0x44e3('0x68')]]){if(_0x883fbc['queuecallerexit']&&_0x883fbc[_0x44e3('0x90')]!=!![]){this[_0x44e3('0xf')][_0x883fbc[_0x44e3('0x68')]][_0x44e3('0x57')]+=0x1;}if(_0x883fbc[_0x44e3('0x19')]){this[_0x44e3('0xf')][_0x883fbc[_0x44e3('0x68')]]['abandoned']+=0x1;}this[_0x44e3('0xf')][_0x883fbc[_0x44e3('0x68')]]['sumHoldTime']+=moment(_0x883fbc[_0x44e3('0x84')])[_0x44e3('0xbd')](_0x883fbc[_0x44e3('0x97')],_0x44e3('0x99'))||0x0;if(_0x2d69e9===this[_0x44e3('0xc')][_0x7511e5[_0x44e3('0x4a')]]['length']-0x1){this[_0x44e3('0xf')][_0x883fbc['queue']][_0x44e3('0x55')]+=moment()[_0x44e3('0xbe')](0x0)['diff'](_0x883fbc[_0x44e3('0x97')],_0x44e3('0x99'));this[_0x44e3('0xf')][_0x883fbc[_0x44e3('0x68')]]['total']+=0x1;if(_0x883fbc[_0x44e3('0x7a')]){this[_0x44e3('0xf')][_0x883fbc['queue']]['answered']+=0x1;this['voiceQueues'][_0x883fbc[_0x44e3('0x68')]]['sumBillable']+=moment()[_0x44e3('0xbe')](0x0)[_0x44e3('0xbd')](_0x883fbc[_0x44e3('0x84')],'seconds');_0x883fbc[_0x44e3('0x7b')]=moment()['format'](_0x44e3('0x7f'));_0x883fbc[_0x44e3('0x8e')]=![];_0x883fbc[_0x44e3('0x8f')]=null;}if(_0x883fbc[_0x44e3('0x8e')]&&_0x883fbc[_0x44e3('0x90')]!=!![]){_0x883fbc[_0x44e3('0xaa')]=_0x44e3('0x57');logger['debug'](_0x44e3('0xbf'),_0x7511e5[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x883fbc,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerunmanaged',_0x883fbc);}if(_0x883fbc[_0x44e3('0x19')]){_0x883fbc['lastevent']='abandoned';logger[_0x44e3('0x47')](_0x44e3('0xc0'),_0x7511e5[_0x44e3('0x4a')],util['inspect'](_0x883fbc,{'showHidden':![],'depth':null}));ami['emit'](_0x44e3('0xc1'),_0x883fbc);}}else{this[_0x44e3('0xf')][_0x883fbc[_0x44e3('0x68')]][_0x44e3('0x55')]+=this[_0x44e3('0xf')][_0x883fbc['queue']][_0x44e3('0x56')];}logger[_0x44e3('0x73')](_0x44e3('0xc2'),_0x7511e5['uniqueid'],_0x883fbc['name'],_0x883fbc[_0x44e3('0x4f')],_0x7511e5[_0x44e3('0xc3')]);this[_0x44e3('0x36')][_0x7511e5[_0x44e3('0x4a')]]=_0x883fbc;this[_0x44e3('0x44')](_0x883fbc,_0x44e3('0x22'));this['emitVoiceQueueSummary'](this[_0x44e3('0xf')][_0x883fbc[_0x44e3('0x68')]],_0x44e3('0x22'));}}logger['debug'](_0x44e3('0xc4'),_0x7511e5[_0x44e3('0x4a')],util[_0x44e3('0x3f')](this['queueReports'][_0x7511e5[_0x44e3('0x4a')]],{'showHidden':![],'depth':null}));ami[_0x44e3('0x45')](_0x44e3('0xc5'),this[_0x44e3('0xc')][_0x7511e5[_0x44e3('0x4a')]]);delete this[_0x44e3('0xc')][_0x7511e5[_0x44e3('0x4a')]];delete this[_0x44e3('0x36')][_0x7511e5[_0x44e3('0x4a')]];}if(this[_0x44e3('0x12')][_0x7511e5[_0x44e3('0x4a')]]){delete this[_0x44e3('0x12')][_0x7511e5[_0x44e3('0x4a')]];}}}catch(_0x4aa270){logger[_0x44e3('0x3e')](_0x44e3('0xc6'),_0x7511e5[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x4aa270,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x44e3('0x8')][_0x44e3('0xc7')]=function(_0x641a94){try{if(this[_0x44e3('0x62')](_0x641a94)){logger[_0x44e3('0x47')](_0x44e3('0xc8'),_0x641a94[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x641a94,{'showHidden':![],'depth':null}));var _0xb11fdc;if(this[_0x44e3('0xc')][_0x641a94[_0x44e3('0xc9')]]){_0xb11fdc=_[_0x44e3('0x79')](this[_0x44e3('0xc')][_0x641a94[_0x44e3('0xc9')]]);_0xb11fdc[_0x44e3('0x9d')]=_0x641a94[_0x44e3('0xca')];_0xb11fdc[_0x44e3('0x9e')]=_0x641a94[_0x44e3('0xcb')];_0xb11fdc[_0x44e3('0x80')]='ATTENDEDTRANSFER';_0xb11fdc[_0x44e3('0x90')]=!![];_0xb11fdc[_0x44e3('0x9b')]=_0x44e3('0xcc');if(this[_0x44e3('0xc')][_0x641a94[_0x44e3('0xcb')]]){var _0x2dcb0b=this[_0x44e3('0xc')][_0x641a94[_0x44e3('0xcb')]];this['queueReports'][_0x641a94[_0x44e3('0xcb')]]=this['queueReports'][_0x641a94['transfereeuniqueid']];this[_0x44e3('0xc')][_0x641a94[_0x44e3('0xc9')]]=_0x2dcb0b;var _0x8fd2d2=_[_0x44e3('0x79')](this[_0x44e3('0xc')][_0x641a94[_0x44e3('0xc9')]]);_0x8fd2d2[_0x44e3('0x37')]=!![];}logger[_0x44e3('0x73')](_0x44e3('0xcd'),_0x641a94[_0x44e3('0x4a')],_0xb11fdc[_0x44e3('0x4c')],_0xb11fdc[_0x44e3('0x4f')],_0xb11fdc[_0x44e3('0x9d')],_0xb11fdc[_0x44e3('0x9e')]);}else if(this[_0x44e3('0xc')][_0x641a94[_0x44e3('0xce')]]){_0xb11fdc=_[_0x44e3('0x79')](this[_0x44e3('0xc')][_0x641a94[_0x44e3('0xce')]]);_0xb11fdc['transferexten']=_0x641a94[_0x44e3('0xcf')];_0xb11fdc[_0x44e3('0x9e')]=_0x641a94[_0x44e3('0xd0')];_0xb11fdc[_0x44e3('0x80')]=_0x44e3('0xd1');_0xb11fdc['transfer']=!![];_0xb11fdc[_0x44e3('0x9b')]=_0x44e3('0xcc');if(this[_0x44e3('0xc')][_0x641a94['origtransfereruniqueid']]){var _0x2dcb0b=this[_0x44e3('0xc')][_0x641a94['origtransfereruniqueid']];this['queueReports'][_0x641a94[_0x44e3('0xd0')]]=this[_0x44e3('0xc')][_0x641a94['transfertargetuniqueid']];this[_0x44e3('0xc')][_0x641a94[_0x44e3('0xce')]]=_0x2dcb0b;var _0x8fd2d2=_[_0x44e3('0x79')](this[_0x44e3('0xc')][_0x641a94['transfertargetuniqueid']]);_0x8fd2d2['switch']=!![];}logger[_0x44e3('0x73')](_0x44e3('0xcd'),_0x641a94[_0x44e3('0x4a')],_0xb11fdc[_0x44e3('0x4c')],_0xb11fdc['type'],_0xb11fdc['transferexten'],_0xb11fdc[_0x44e3('0x9e')]);}}}catch(_0xc8d786){logger[_0x44e3('0x3e')](_0x44e3('0xc8'),_0x641a94[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0xc8d786,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x44e3('0xd2')]=function(_0x3711d2){try{if(this[_0x44e3('0x62')](_0x3711d2)){logger['debug'](_0x44e3('0xd3'),_0x3711d2[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x3711d2,{'showHidden':![],'depth':null}));if(this[_0x44e3('0xc')][_0x3711d2[_0x44e3('0xc9')]]){var _0x1ae31b=_[_0x44e3('0x79')](this['queueReports'][_0x3711d2['transfereeuniqueid']]);_0x1ae31b['queuecallerexitreason']='BLINDTRANSFER';_0x1ae31b[_0x44e3('0x90')]=!![];_0x1ae31b[_0x44e3('0x9b')]=_0x44e3('0xd4');_0x1ae31b[_0x44e3('0x9d')]=_0x3711d2['extension'];_0x1ae31b[_0x44e3('0x9e')]=_0x3711d2['transfereeuniqueid'];logger[_0x44e3('0x73')](_0x44e3('0xd5'),_0x3711d2['uniqueid'],_0x1ae31b[_0x44e3('0x4c')],_0x1ae31b[_0x44e3('0x4f')],_0x1ae31b[_0x44e3('0x9d')],_0x1ae31b[_0x44e3('0x9e')]);this[_0x44e3('0xbc')]({'event':'BlindTransfer','uniqueid':_0x3711d2[_0x44e3('0xc9')],'context':_0x3711d2[_0x44e3('0xd6')],'channel':_0x3711d2[_0x44e3('0xd7')]});}}}catch(_0x5d6701){logger[_0x44e3('0x3e')](_0x44e3('0xd3'),_0x3711d2[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x5d6701,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x44e3('0x28')]=function(_0x245ff6){try{if(this[_0x44e3('0x62')](_0x245ff6)){logger['debug'](_0x44e3('0xd8'),_0x245ff6[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x245ff6,{'showHidden':![],'depth':null}));if(this[_0x44e3('0xc')][_0x245ff6[_0x44e3('0x4a')]]){var _0x3bcfbb=_[_0x44e3('0x79')](this[_0x44e3('0xc')][_0x245ff6[_0x44e3('0x4a')]]);if(!_['isNil'](_0x3bcfbb[_0x44e3('0x84')])){_0x3bcfbb[_0x44e3('0xd9')]=moment()['format'](_0x44e3('0x7f'));logger[_0x44e3('0x73')](_0x44e3('0xda'),_0x245ff6[_0x44e3('0x4a')],_0x3bcfbb[_0x44e3('0xd9')]);}}}}catch(_0x2bbe2a){logger[_0x44e3('0x3e')](_0x44e3('0xd8'),_0x245ff6[_0x44e3('0x4a')],util['inspect'](_0x2bbe2a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x44e3('0x8')]['syncMusicOnHoldStop']=function(_0x300683){try{if(this[_0x44e3('0x62')](_0x300683)){logger[_0x44e3('0x47')](_0x44e3('0xdb'),_0x300683['uniqueid'],util[_0x44e3('0x3f')](_0x300683,{'showHidden':![],'depth':null}));if(this[_0x44e3('0xc')][_0x300683['uniqueid']]){var _0x33238b=_[_0x44e3('0x79')](this[_0x44e3('0xc')][_0x300683[_0x44e3('0x4a')]]);if(!_[_0x44e3('0x38')](_0x33238b[_0x44e3('0xd9')])){_0x33238b[_0x44e3('0xdc')]+=moment()[_0x44e3('0xbe')](0x0)[_0x44e3('0xbd')](_0x33238b[_0x44e3('0xd9')],_0x44e3('0x99'));logger[_0x44e3('0x73')](_0x44e3('0xdd'),_0x300683[_0x44e3('0x4a')],_0x33238b[_0x44e3('0xdc')]);delete _0x33238b[_0x44e3('0xd9')];}}}}catch(_0x5ca065){logger['error'](_0x44e3('0xdb'),_0x300683[_0x44e3('0x4a')],util[_0x44e3('0x3f')](_0x5ca065,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x44e3('0x26')]=function(_0x599bbb){try{if(this[_0x44e3('0x62')](_0x599bbb)){logger[_0x44e3('0x47')](_0x44e3('0xde'),_0x599bbb[_0x44e3('0x4a')],util['inspect'](_0x599bbb,{'showHidden':![],'depth':null}));if(_0x599bbb[_0x44e3('0xdf')]['toLowerCase']()===_0x44e3('0xe0')){_0x599bbb[_0x44e3('0xe1')]=_0x599bbb[_0x44e3('0xe2')]&&_0x599bbb[_0x44e3('0xe2')][_0x44e3('0x94')](_0x44e3('0xe3'))?_0x599bbb['appdata']:(_0x599bbb[_0x44e3('0xe2')]||_0x599bbb[_0x44e3('0xe1')])['toLowerCase']();if(_[_0x44e3('0x94')](_0x599bbb['applicationdata'][_0x44e3('0x95')](),_0x44e3('0xe4'))){logger[_0x44e3('0x73')](_0x44e3('0xe5'),_0x599bbb[_0x44e3('0x4a')],_0x599bbb[_0x44e3('0xdf')],_0x599bbb[_0x44e3('0xe1')]);if(_[_0x44e3('0x63')](this[_0x44e3('0x36')][_0x599bbb[_0x44e3('0x4a')]]))this[_0x44e3('0x36')][_0x599bbb['uniqueid']]={};var _0x5ba19b=_0x599bbb[_0x44e3('0xe1')][_0x44e3('0xe6')]('=');var _0x5e927f=_0x5ba19b[0x0]['toLowerCase']()[_0x44e3('0xe7')](/cdr\((.*)\)/);if(_0x5e927f)this[_0x44e3('0x36')][_0x599bbb[_0x44e3('0x4a')]][_0x5e927f[0x1]]=_0x5ba19b[0x1];}}}}catch(_0x352535){logger['error'](_0x44e3('0xe8'),_0x599bbb[_0x44e3('0x4a')],util['inspect'](_0x352535,{'showHidden':![],'depth':null}));}};module[_0x44e3('0xe9')]=VoiceQueueReport;