Built motion from commit f7863d46.|2.5.41
[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 _0xe361=['callers','toNumber','loggedIn','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','isUndefined','position','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','lastAssignedTo','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','YYYY-MM-DD\x20HH:mm:ss','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','queuestatus','CONTINUE','TIMEOUT','lastevent','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','includes','syncHangup','[%s][voiceQueueReport][hangup]','length','sumHoldTime','diff','milliseconds','answered','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','abandoned','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertype','ATTENDED','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfererchannel','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceQueueReport][musiconholdstart]','syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]','mohtime','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','CDR(routeAlias)','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','[%s][voiceQueueReport][newexten]','exports','moment','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','channels','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','agentconnect','varset','syncVarSet','syncFullyBooted','musiconholdstart','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','waiting','clearZombieChannels','switch','isNil','Action','catch','message','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','agents','clearQueueReport','clearqueuereport','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','available','sumDuration','talking','total','unmanaged','Trunk','active','Interval','md5',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','[voiceQueueReport][queues]','flagQueueSummary','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy'];(function(_0x3b823f,_0x59e58f){var _0x15ebb4=function(_0x32b0c2){while(--_0x32b0c2){_0x3b823f['push'](_0x3b823f['shift']());}};_0x15ebb4(++_0x59e58f);}(_0xe361,0x7e));var _0x1e36=function(_0x1af98d,_0x3c608e){_0x1af98d=_0x1af98d-0x0;var _0x3553ea=_0xe361[_0x1af98d];return _0x3553ea;};'use strict';var _=require('lodash');var moment=require(_0x1e36('0x0'));var util=require('util');var md5=require('md5');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x1e36('0x1'));var ami=require(_0x1e36('0x2'));var QueueReport=require(_0x1e36('0x3'));config[_0x1e36('0x4')]=_[_0x1e36('0x5')](config[_0x1e36('0x4')],{'host':_0x1e36('0x6'),'port':0x18eb});var io=require(_0x1e36('0x7'))(new Redis(config[_0x1e36('0x4')]));var Sequence=function(){};Sequence[_0x1e36('0x8')][_0x1e36('0x9')]=function(_0x26a99d){this[_0x1e36('0xa')]=this[_0x1e36('0xa')]?this['tail'][_0x1e36('0xb')](_0x26a99d):_0x26a99d();};function VoiceQueueReport(_0x48369f){this[_0x1e36('0xc')]=new Sequence();this[_0x1e36('0xd')]={};this['agents']=_0x48369f['agents'];this[_0x1e36('0xe')]=_0x48369f[_0x1e36('0xf')];this[_0x1e36('0x10')]=_0x48369f['voiceQueues'];this['flagQueueSummary']=!![];this[_0x1e36('0x11')]=_0x48369f['campaigns'];this[_0x1e36('0x12')]={};ami['on'](_0x1e36('0x13'),this[_0x1e36('0x14')][_0x1e36('0x15')](this));ami['on'](_0x1e36('0x16'),this[_0x1e36('0x17')]['bind'](this));ami['on'](_0x1e36('0x18'),this[_0x1e36('0x19')][_0x1e36('0x15')](this));ami['on'](_0x1e36('0x1a'),this[_0x1e36('0x1b')][_0x1e36('0x15')](this));ami['on']('queuecallerleave',this['syncQueueCallerLeave'][_0x1e36('0x15')](this));ami['on'](_0x1e36('0x1c'),this[_0x1e36('0x1d')][_0x1e36('0x15')](this));ami['on'](_0x1e36('0x1e'),this['syncAgentConnect'][_0x1e36('0x15')](this));ami['on'](_0x1e36('0x1f'),this[_0x1e36('0x20')][_0x1e36('0x15')](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on']('fullybooted',this[_0x1e36('0x21')][_0x1e36('0x15')](this));ami['on'](_0x1e36('0x22'),this['syncMusicOnHoldStart'][_0x1e36('0x15')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x1e36('0x15')](this));ami['on']('attendedtransfer',this[_0x1e36('0x23')][_0x1e36('0x15')](this));ami['on'](_0x1e36('0x24'),this[_0x1e36('0x25')]['bind'](this));this[_0x1e36('0x26')]();this[_0x1e36('0x27')]();}function clearChannels(_0x5e10a1){if(!_[_0x1e36('0x28')](_0x5e10a1)){for(var _0x3341e0 in _0x5e10a1){if(_0x5e10a1[_0x1e36('0x29')](_0x3341e0)){delete _0x5e10a1[_0x3341e0];}}}}function clearCampaigns(_0x3cfb87){if(!_[_0x1e36('0x28')](_0x3cfb87)){for(var _0x337287 in _0x3cfb87){if(_0x3cfb87['hasOwnProperty'](_0x337287)){_0x3cfb87[_0x337287][_0x1e36('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x1fbddf){if(!_[_0x1e36('0x28')](_0x1fbddf)){for(var _0x27c94f in _0x1fbddf){if(_0x1fbddf[_0x1e36('0x29')](_0x27c94f)){_0x1fbddf[_0x27c94f][_0x1e36('0x2a')]=0x0;_0x1fbddf[_0x27c94f]['talking']=0x0;_0x1fbddf[_0x27c94f]['pTalking']=0x0;_0x1fbddf[_0x27c94f][_0x1e36('0x2b')]=0x0;_0x1fbddf[_0x27c94f]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x455037){if(!_[_0x1e36('0x28')](_0x455037)){for(var _0x1f4fb4 in _0x455037){if(_0x455037[_0x1e36('0x29')](_0x1f4fb4)){_0x455037[_0x1f4fb4]['unlockRR']=!![];}}}}VoiceQueueReport[_0x1e36('0x8')][_0x1e36('0x2c')]=function(){var _0x37af05=this;for(var _0x1f813a in this[_0x1e36('0xe')]){if(this[_0x1e36('0xe')][_0x1e36('0x29')](_0x1f813a)&&!this[_0x1e36('0xe')][_0x1f813a][_0x1e36('0x2d')]){this[_0x1e36('0xc')][_0x1e36('0x9')](function(){if(!_[_0x1e36('0x2e')](_0x37af05[_0x1e36('0xe')][_0x1f813a])){return ami[_0x1e36('0x2f')]({'action':'status','channel':_0x37af05['channels'][_0x1f813a]['channel']})[_0x1e36('0x30')](function(_0x2990f6){if(_0x2990f6[_0x1e36('0x31')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x37af05[_0x1e36('0xe')][_0x1f813a]){delete _0x37af05['channels'][_0x1f813a];logger[_0x1e36('0x32')](_0x1e36('0x33'),_0x1f813a,util[_0x1e36('0x34')](_0x2990f6,{'showHidden':![],'depth':null}));}if(_0x37af05[_0x1e36('0xd')][_0x1f813a]){delete _0x37af05['queueReports'][_0x1f813a];logger['error'](_0x1e36('0x35'),_0x1f813a,util[_0x1e36('0x34')](_0x2990f6,{'showHidden':![],'depth':null}));}if(_0x37af05[_0x1e36('0x12')][_0x1f813a]){delete _0x37af05[_0x1e36('0x12')][_0x1f813a];logger['error'](_0x1e36('0x36'),_0x1f813a,util['inspect'](_0x2990f6,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0x1e36('0x21')]=function(){logger[_0x1e36('0x32')](_0x1e36('0x37'));clearChannels(this[_0x1e36('0xe')]);this['clearQueueReport'](this[_0x1e36('0xd')]);clearAgentBooked(this[_0x1e36('0x38')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x1e36('0x11')]);};VoiceQueueReport[_0x1e36('0x8')][_0x1e36('0x39')]=function(_0xd3c459){var _0x444cfa=this;if(!_[_0x1e36('0x28')](_0xd3c459)){for(var _0x43cc65 in _0xd3c459){if(_0xd3c459[_0x1e36('0x29')](_0x43cc65)){_0x444cfa['emitVoiceQueueChannelRemove'](_0xd3c459[_0x43cc65],_0x1e36('0x3a'));delete _0xd3c459[_0x43cc65];}}}};VoiceQueueReport[_0x1e36('0x8')][_0x1e36('0x3b')]=function(_0x1b09a7,_0x54d47d,_0x569cff){io['to'](_0x1b09a7)[_0x1e36('0x3b')](_0x54d47d,_0x569cff);};VoiceQueueReport[_0x1e36('0x8')]['emitVoiceQueueChannelSave']=function(_0x493f70,_0xa11dba){logger[_0x1e36('0x3c')](_0x1e36('0x3d')+_0xa11dba+_0x1e36('0x3e'),_0x493f70[_0x1e36('0x3f')],util['inspect'](_0x493f70,{'showHidden':![],'depth':null}));this[_0x1e36('0x3b')](util[_0x1e36('0x40')](_0x1e36('0x41'),_0x493f70[_0x1e36('0x42')]),_0x1e36('0x43'),_0x493f70);io[_0x1e36('0x3b')](_0x1e36('0x44'),_0x493f70);};VoiceQueueReport[_0x1e36('0x8')][_0x1e36('0x45')]=function(_0x452d3f,_0x4f4365){logger['debug'](_0x1e36('0x3d')+_0x4f4365+_0x1e36('0x46'),_0x452d3f[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0x452d3f,{'showHidden':![],'depth':null}));this['emit'](util[_0x1e36('0x40')](_0x1e36('0x41'),_0x452d3f[_0x1e36('0x42')]),'voice_queue_channel:remove',_0x452d3f);io['emit'](_0x1e36('0x47'),_0x452d3f);};VoiceQueueReport['prototype'][_0x1e36('0x48')]=function(_0x15bb13,_0x2cd95e){if(_0x15bb13[_0x1e36('0x49')]===_0x1e36('0x4a')){var _0x3687bf={'id':_0x15bb13['id'],'name':_0x15bb13['name'],'strategy':_0x15bb13[_0x1e36('0x4b')],'answered':_0x15bb13['answered'],'available':_0x15bb13[_0x1e36('0x4c')],'loggedIn':_0x15bb13['loggedIn'],'pTalking':_0x15bb13['pTalking'],'sumBillable':_0x15bb13['sumBillable'],'sumDuration':_0x15bb13[_0x1e36('0x4d')],'sumHoldTime':_0x15bb13['sumHoldTime']||0x0,'talking':_0x15bb13[_0x1e36('0x4e')],'total':_0x15bb13[_0x1e36('0x4f')],'type':_0x15bb13[_0x1e36('0x49')],'unmanaged':_0x15bb13[_0x1e36('0x50')],'abandoned':_0x15bb13['abandoned'],'waiting':_0x15bb13[_0x1e36('0x2b')]};if(_0x15bb13['Trunk']){_0x3687bf[_0x1e36('0x51')]={'id':_0x15bb13[_0x1e36('0x51')]['id'],'name':_0x15bb13[_0x1e36('0x51')][_0x1e36('0x42')],'active':_0x15bb13[_0x1e36('0x51')][_0x1e36('0x52')],'callerid':_0x15bb13[_0x1e36('0x51')]['callerid']};}if(_0x15bb13[_0x1e36('0x53')]){_0x3687bf['Interval']={'id':_0x15bb13[_0x1e36('0x53')]['id'],'name':_0x15bb13[_0x1e36('0x53')][_0x1e36('0x42')]};}var _0x39c252=md5(JSON['stringify'](_0x3687bf));if(_0x15bb13[_0x1e36('0x54')]!==_0x39c252){_0x15bb13[_0x1e36('0x54')]=_0x39c252;logger[_0x1e36('0x3c')]('[voiceQueueReport]['+_0x2cd95e+_0x1e36('0x55'),util[_0x1e36('0x34')](_0x3687bf,{'showHidden':![],'depth':null}));this[_0x1e36('0x3b')](util[_0x1e36('0x40')](_0x1e36('0x41'),_0x3687bf[_0x1e36('0x42')]),_0x1e36('0x56'),_0x3687bf);}}};VoiceQueueReport['prototype'][_0x1e36('0x57')]=function(_0x40c7bd){return _0x40c7bd!==null&&!_['isUndefined'](_0x40c7bd);};VoiceQueueReport[_0x1e36('0x8')][_0x1e36('0x27')]=function(){var _0x1364fe=this;setInterval(function(){_0x1364fe[_0x1e36('0x2c')]();ami['Action']({'action':'queues'})[_0x1e36('0x30')](function(_0x244f84){logger['error'](_0x1e36('0x58'),util[_0x1e36('0x34')](_0x244f84,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x1e36('0x8')][_0x1e36('0x26')]=function(){var _0x3bc7c0=this;setInterval(function(){if(_0x3bc7c0[_0x1e36('0x59')]){return ami['Action']({'action':'queuesummary'})['then'](function(_0x5b06b8){_0x3bc7c0[_0x1e36('0x59')]=![];})[_0x1e36('0x30')](function(_0x2e9262){logger[_0x1e36('0x32')](_0x1e36('0x5a'),util[_0x1e36('0x34')](_0x2e9262,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x1e36('0x8')]['syncQueueSummary']=function(_0x56bfe3){try{if(this[_0x1e36('0x57')](_0x56bfe3)&&this[_0x1e36('0x57')](_0x56bfe3[_0x1e36('0x5b')])){logger[_0x1e36('0x3c')](_0x1e36('0x5c'),util[_0x1e36('0x34')](_0x56bfe3,{'showHidden':![],'depth':null}));if(this[_0x1e36('0x10')][_0x56bfe3[_0x1e36('0x5b')]]){logger[_0x1e36('0x5d')](_0x1e36('0x5e'),_0x56bfe3[_0x1e36('0x5b')]);var _0x59af77=_[_0x1e36('0x5f')](this[_0x1e36('0xe')],_0x1e36('0x5b'))[_0x56bfe3[_0x1e36('0x5b')]]||0x0;var _0x55970f=_0x59af77-_0x56bfe3[_0x1e36('0x60')];if(this[_0x1e36('0x10')][_0x56bfe3[_0x1e36('0x5b')]][_0x1e36('0x2b')]!==_[_0x1e36('0x61')](_0x56bfe3['callers'])||this['voiceQueues'][_0x56bfe3[_0x1e36('0x5b')]][_0x1e36('0x62')]!==_[_0x1e36('0x61')](_0x56bfe3[_0x1e36('0x63')])||this[_0x1e36('0x10')][_0x56bfe3[_0x1e36('0x5b')]][_0x1e36('0x4c')]!==_[_0x1e36('0x61')](_0x56bfe3[_0x1e36('0x4c')])||this['voiceQueues'][_0x56bfe3['queue']]['talking']!==_0x55970f){this['voiceQueues'][_0x56bfe3[_0x1e36('0x5b')]][_0x1e36('0x2b')]=_[_0x1e36('0x61')](_0x56bfe3['callers']);this[_0x1e36('0x10')][_0x56bfe3[_0x1e36('0x5b')]][_0x1e36('0x62')]=_[_0x1e36('0x61')](_0x56bfe3[_0x1e36('0x63')]);this['voiceQueues'][_0x56bfe3[_0x1e36('0x5b')]]['available']=_[_0x1e36('0x61')](_0x56bfe3['available']);this[_0x1e36('0x10')][_0x56bfe3['queue']]['talking']=_0x55970f>0x0?_0x55970f:0x0;this[_0x1e36('0x10')][_0x56bfe3['queue']][_0x1e36('0x4e')]=this['voiceQueues'][_0x56bfe3[_0x1e36('0x5b')]][_0x1e36('0x4e')]>_['toNumber'](_0x56bfe3[_0x1e36('0x63')])?_[_0x1e36('0x61')](_0x56bfe3['loggedin']):this[_0x1e36('0x10')][_0x56bfe3[_0x1e36('0x5b')]][_0x1e36('0x4e')];this[_0x1e36('0x48')](this[_0x1e36('0x10')][_0x56bfe3[_0x1e36('0x5b')]],_0x1e36('0x13'));}logger[_0x1e36('0x3c')](_0x1e36('0x64'),util['inspect'](this['voiceQueues'][_0x56bfe3[_0x1e36('0x5b')]],{'showHidden':![],'depth':null}));ami[_0x1e36('0x3b')](_0x1e36('0x65'),this[_0x1e36('0x10')][_0x56bfe3[_0x1e36('0x5b')]]);}}}catch(_0x228811){logger['error']('[voiceQueueReport][queuesummary]',util[_0x1e36('0x34')](_0x228811,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e36('0x8')][_0x1e36('0x17')]=function(_0x1b71ab){logger[_0x1e36('0x3c')](_0x1e36('0x66'),util[_0x1e36('0x34')](_0x1b71ab,{'showHidden':![],'depth':null}));this[_0x1e36('0x59')]=!![];};VoiceQueueReport[_0x1e36('0x8')][_0x1e36('0x19')]=function(_0x486e1c){try{if(this[_0x1e36('0x57')](_0x486e1c)){logger[_0x1e36('0x3c')]('[%s][voiceQueueReport][queuecallerjoin]',_0x486e1c[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0x486e1c,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x486e1c[_0x1e36('0x3f')]]))this[_0x1e36('0xd')][_0x486e1c['uniqueid']]=[];if(_[_0x1e36('0x67')](this[_0x1e36('0xe')][_0x486e1c[_0x1e36('0x3f')]]))this[_0x1e36('0xe')][_0x486e1c[_0x1e36('0x3f')]]={};var _0x1692ac=new QueueReport();_0x1692ac[_0x1e36('0x42')]=_0x486e1c[_0x1e36('0x5b')];_0x1692ac[_0x1e36('0x49')]=this['voiceQueues'][_0x1692ac[_0x1e36('0x42')]]&&this['voiceQueues'][_0x1692ac[_0x1e36('0x42')]][_0x1e36('0x49')]?this['voiceQueues'][_0x1692ac['name']]['type']||_0x1e36('0x4a'):'inbound';_0x1692ac[_0x1e36('0x5b')]=_0x486e1c[_0x1e36('0x5b')];_0x1692ac['queuecallerjoinAt']=moment()[_0x1e36('0x40')]('YYYY-MM-DD\x20HH:mm:ss');_0x1692ac[_0x1e36('0x68')]=_0x486e1c[_0x1e36('0x68')];_0x1692ac['count']=_0x486e1c['count'];_0x1692ac[_0x1e36('0x3f')]=_0x486e1c['uniqueid'];_0x1692ac[_0x1e36('0x69')]=this[_0x1e36('0xe')][_0x486e1c[_0x1e36('0x3f')]][_0x1e36('0x69')];logger[_0x1e36('0x5d')](_0x1e36('0x6a'),_0x1692ac[_0x1e36('0x42')],_0x1692ac[_0x1e36('0x49')]);_[_0x1e36('0x6b')](_0x1692ac,_[_0x1e36('0x6c')](_0x486e1c,_[_0x1e36('0x6d')](_0x1692ac)));this['queueReports'][_0x486e1c[_0x1e36('0x3f')]][_0x1e36('0x6e')](_0x1692ac);this[_0x1e36('0xe')][_0x486e1c[_0x1e36('0x3f')]]=_0x1692ac;this[_0x1e36('0x6f')](_0x1692ac,_0x1e36('0x18'));}}catch(_0x3366c1){logger[_0x1e36('0x32')](_0x1e36('0x70'),_0x486e1c[_0x1e36('0x3f')],util['inspect'](_0x3366c1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e36('0x8')][_0x1e36('0x1b')]=function(_0x317b10){try{if(this[_0x1e36('0x57')](_0x317b10)){logger['debug'](_0x1e36('0x71'),_0x317b10['uniqueid'],util[_0x1e36('0x34')](_0x317b10,{'showHidden':![],'depth':null}));if(this[_0x1e36('0xd')][_0x317b10['uniqueid']]){var _0x177a7a=_[_0x1e36('0x72')](this['queueReports'][_0x317b10[_0x1e36('0x3f')]]);_0x177a7a[_0x1e36('0x73')]=![];_0x177a7a[_0x1e36('0x74')]=null;_0x177a7a[_0x1e36('0x75')]=_0x317b10[_0x1e36('0x75')];_0x177a7a[_0x1e36('0x76')]=_0x317b10[_0x1e36('0x76')];_0x177a7a[_0x1e36('0x1a')]=!![];_0x177a7a[_0x1e36('0x77')]=moment()[_0x1e36('0x40')]('YYYY-MM-DD\x20HH:mm:ss');_0x177a7a[_0x1e36('0x78')]='ABANDONED';_0x177a7a[_0x1e36('0x79')]=null;logger[_0x1e36('0x5d')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x177a7a[_0x1e36('0x42')],_0x177a7a[_0x1e36('0x49')]);this[_0x1e36('0xe')][_0x317b10['uniqueid']]=_0x177a7a;this['emitVoiceQueueChannelRemove'](_0x177a7a,_0x1e36('0x1a'));}}}catch(_0x29138a){logger[_0x1e36('0x32')]('[%s][voiceQueueReport][queuecallerabandon]',_0x317b10['uniqueid'],util[_0x1e36('0x34')](_0x29138a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e36('0x8')]['syncQueueCallerLeave']=function(_0x3a3e19){try{if(this[_0x1e36('0x57')](_0x3a3e19)){logger[_0x1e36('0x3c')](_0x1e36('0x7a'),_0x3a3e19[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0x3a3e19,{'showHidden':![],'depth':null}));if(this[_0x1e36('0xd')][_0x3a3e19[_0x1e36('0x3f')]]){var _0x29bcb3=_[_0x1e36('0x72')](this['queueReports'][_0x3a3e19['uniqueid']]);_0x29bcb3[_0x1e36('0x7b')]=moment()[_0x1e36('0x40')](_0x1e36('0x7c'));_0x29bcb3[_0x1e36('0x7d')]=_0x3a3e19[_0x1e36('0x7d')];_0x29bcb3[_0x1e36('0x7e')]=_0x3a3e19[_0x1e36('0x7e')];logger[_0x1e36('0x5d')](_0x1e36('0x7f'),_0x29bcb3[_0x1e36('0x42')],_0x29bcb3[_0x1e36('0x49')],_0x3a3e19[_0x1e36('0x7d')],_0x3a3e19[_0x1e36('0x7e')]);this[_0x1e36('0xe')][_0x3a3e19[_0x1e36('0x3f')]]=_0x29bcb3;this[_0x1e36('0x6f')](_0x29bcb3,'queuecallerleave');}}}catch(_0xd3bfdb){logger[_0x1e36('0x32')]('[%s][voiceQueueReport][queuecallerleave]',_0x3a3e19['uniqueid'],util[_0x1e36('0x34')](_0xd3bfdb,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x2a1994){try{if(this['isNotNull'](_0x2a1994)){logger[_0x1e36('0x3c')](_0x1e36('0x80'),_0x2a1994[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0x2a1994,{'showHidden':![],'depth':null}));if(this[_0x1e36('0xd')][_0x2a1994[_0x1e36('0x3f')]]){var _0x3eacea=_[_0x1e36('0x72')](this[_0x1e36('0xd')][_0x2a1994['uniqueid']]);_0x3eacea['queuecallercomplete']=!![];_0x3eacea[_0x1e36('0x78')]=_0x1e36('0x81');logger[_0x1e36('0x5d')](_0x1e36('0x82'),_0x3eacea[_0x1e36('0x42')],_0x3eacea['type']);}}}catch(_0xd0d754){logger[_0x1e36('0x32')](_0x1e36('0x80'),_0x2a1994[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0xd0d754,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e36('0x8')][_0x1e36('0x1d')]=function(_0x5174d9){try{if(this['isNotNull'](_0x5174d9)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x5174d9[_0x1e36('0x3f')],util['inspect'](_0x5174d9,{'showHidden':![],'depth':null}));if(this[_0x1e36('0xd')][_0x5174d9[_0x1e36('0x3f')]]){var _0x405ca5=_['last'](this[_0x1e36('0xd')][_0x5174d9[_0x1e36('0x3f')]]);_0x405ca5[_0x1e36('0x1a')]=![];_0x405ca5[_0x1e36('0x77')]=null;_0x405ca5['assigned']=!![];_0x405ca5[_0x1e36('0x79')]=_0x5174d9['membername'];_0x405ca5[_0x1e36('0x75')]=_0x5174d9['holdtime'];_0x405ca5[_0x1e36('0x73')]=!![];_0x405ca5[_0x1e36('0x83')]=![];_0x405ca5[_0x1e36('0x84')]=null;if(!_0x405ca5[_0x1e36('0x85')]){if(_0x5174d9[_0x1e36('0x86')]=='transfer'){_0x405ca5[_0x1e36('0x78')]=_0x1e36('0x87');logger[_0x1e36('0x5d')](_0x1e36('0x88'),_0x405ca5[_0x1e36('0x42')],_0x405ca5[_0x1e36('0x49')]);}else{if(_[_0x1e36('0x89')](_0x5174d9[_0x1e36('0x8a')][_0x1e36('0x8b')](),_0x1e36('0x8c'))){if(this[_0x1e36('0xd')][_0x5174d9[_0x1e36('0x8d')]]){var _0x309763=_[_0x1e36('0x72')](this[_0x1e36('0xd')][_0x5174d9[_0x1e36('0x8d')]]);_0x309763[_0x1e36('0x73')]=![];_0x309763['queuecallerexit']=!![];_0x309763[_0x1e36('0x84')]=moment(_0x405ca5[_0x1e36('0x8e')])[_0x1e36('0x8f')](_0x5174d9[_0x1e36('0x75')],_0x1e36('0x90'))[_0x1e36('0x40')](_0x1e36('0x7c'));_0x309763[_0x1e36('0x78')]=_0x1e36('0x91');_0x309763['transfer']=!![];_0x309763['transfertype']=_0x1e36('0x92');_0x309763[_0x1e36('0x93')]=_0x5174d9[_0x1e36('0x94')];_0x309763[_0x1e36('0x95')]=_0x5174d9['uniqueid'];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x309763[_0x1e36('0x42')],_0x309763[_0x1e36('0x49')]);var _0x7798ab=this[_0x1e36('0xd')][_0x5174d9[_0x1e36('0x8d')]];this[_0x1e36('0xd')][_0x5174d9['linkedid']]=this[_0x1e36('0xd')][_0x5174d9[_0x1e36('0x3f')]];this[_0x1e36('0xd')][_0x5174d9[_0x1e36('0x3f')]]=_0x7798ab;}}else{_0x405ca5[_0x1e36('0x78')]=_0x1e36('0x96')+_0x5174d9[_0x1e36('0x86')][_0x1e36('0x97')]();logger[_0x1e36('0x5d')](_0x1e36('0x98'),_0x405ca5[_0x1e36('0x42')],_0x405ca5[_0x1e36('0x49')],_0x405ca5['queuecallerexitreason']);}}}this[_0x1e36('0xe')][_0x5174d9['uniqueid']]=_0x405ca5;this[_0x1e36('0x45')](_0x405ca5,_0x1e36('0x1c'));}}}catch(_0x212fde){logger[_0x1e36('0x32')]('[%s][voiceQueueReport][agentcomplete]',_0x5174d9['uniqueid'],util[_0x1e36('0x34')](_0x212fde,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e36('0x8')]['syncVarSet']=function(_0x2cda17){try{if(this['isNotNull'](_0x2cda17)){logger[_0x1e36('0x3c')](_0x1e36('0x99'),_0x2cda17[_0x1e36('0x3f')],util['inspect'](_0x2cda17,{'showHidden':![],'depth':null}));this[_0x1e36('0x9a')](_0x2cda17[_0x1e36('0x3f')],_[_0x1e36('0x6d')](_0x2cda17['variable'])[0x0],_0x2cda17['value']);if(this['queueReports'][_0x2cda17[_0x1e36('0x3f')]]){var _0xf42646=_[_0x1e36('0x72')](this['queueReports'][_0x2cda17[_0x1e36('0x3f')]]);if(_0xf42646){if(this['isNotNull'](_0x2cda17[_0x1e36('0x9b')])&&this[_0x1e36('0x57')](_0x2cda17[_0x1e36('0x9b')][_0x1e36('0x9c')])){switch(_0x2cda17['value']){case _0x1e36('0x9d'):_0xf42646[_0x1e36('0x83')]=![];_0xf42646[_0x1e36('0x84')]=null;break;case _0x1e36('0x9e'):_0xf42646[_0x1e36('0x9f')]='timeout';_0xf42646[_0x1e36('0x83')]=!![];_0xf42646[_0x1e36('0x84')]=moment()[_0x1e36('0x40')](_0x1e36('0x7c'));_0xf42646[_0x1e36('0x7b')]=moment()[_0x1e36('0x40')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x1e36('0x3c')](_0x1e36('0xa0'),_0x2cda17[_0x1e36('0x3f')],util['inspect'](_0xf42646,{'showHidden':![],'depth':null}));ami[_0x1e36('0x3b')]('custom:timeout',_0xf42646);break;default:_0xf42646['queuecallerexit']=!![];_0xf42646[_0x1e36('0x84')]=moment()[_0x1e36('0x40')](_0x1e36('0x7c'));_0xf42646['queuecallerleaveAt']=moment()[_0x1e36('0x40')](_0x1e36('0x7c'));}_0xf42646[_0x1e36('0x1a')]=![];_0xf42646[_0x1e36('0x77')]=null;_0xf42646[_0x1e36('0x78')]=_0x2cda17['value'];this[_0x1e36('0xe')][_0x2cda17[_0x1e36('0x3f')]]=_0xf42646;this[_0x1e36('0x45')](_0xf42646,'varset');}else if(this['isNotNull'](_0x2cda17[_0x1e36('0x9b')])&&this[_0x1e36('0x57')](_0x2cda17[_0x1e36('0x9b')][_0x1e36('0xa1')])){if(!_0xf42646['queuecallerabandon']){_0xf42646['queuecallerexit']=!![];_0xf42646[_0x1e36('0x84')]=moment()['format'](_0x1e36('0x7c'));_0xf42646[_0x1e36('0x78')]='EXITWITHKEY';_0xf42646[_0x1e36('0x7b')]=moment()[_0x1e36('0x40')](_0x1e36('0x7c'));this[_0x1e36('0xe')][_0x2cda17[_0x1e36('0x3f')]]=_0xf42646;}}logger[_0x1e36('0x5d')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x2cda17[_0x1e36('0x3f')],_0xf42646['name'],_0xf42646[_0x1e36('0x49')],_['keys'](_0x2cda17[_0x1e36('0x9b')])[0x0],_0x2cda17[_0x1e36('0xa2')]);_0xf42646[_0x1e36('0x12')]=this[_0x1e36('0x12')][_0x2cda17[_0x1e36('0x3f')]];}}}}catch(_0xb337ec){logger[_0x1e36('0x32')](_0x1e36('0x99'),_0x2cda17[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0xb337ec,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1e36('0x9a')]=function(_0x30bde9,_0x12340d,_0x502440){var _0x2abcc7=[_0x1e36('0xa3'),_0x1e36('0xa4'),_0x1e36('0xa5'),'rtpaudioqosjitterbridged',_0x1e36('0xa6'),_0x1e36('0xa7'),_0x1e36('0xa8'),'rtpaudioqosrttbridged',_0x1e36('0xa9'),'sipuri',_0x1e36('0xaa'),_0x1e36('0xab'),_0x1e36('0xac'),_0x1e36('0xad'),_0x1e36('0xae'),_0x1e36('0xaf'),'membername','memberpenalty',_0x1e36('0xb0')];if(!_[_0x1e36('0x2e')](_0x12340d)&&!_[_0x1e36('0xb1')](_0x2abcc7,_0x12340d)){if(_['isUndefined'](this[_0x1e36('0x12')][_0x30bde9])){this[_0x1e36('0x12')][_0x30bde9]={};}this[_0x1e36('0x12')][_0x30bde9][_0x12340d]=_0x502440;}};VoiceQueueReport['prototype'][_0x1e36('0xb2')]=function(_0xad56bc){try{if(this['isNotNull'](_0xad56bc)){logger[_0x1e36('0x3c')](_0x1e36('0xb3'),_0xad56bc[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0xad56bc,{'showHidden':![],'depth':null}));if(this[_0x1e36('0xd')][_0xad56bc[_0x1e36('0x3f')]]){for(var _0x12f523=0x0,_0x32e171={};_0x12f523<this[_0x1e36('0xd')][_0xad56bc[_0x1e36('0x3f')]][_0x1e36('0xb4')];_0x12f523+=0x1){_0x32e171=this['queueReports'][_0xad56bc[_0x1e36('0x3f')]][_0x12f523];if(this[_0x1e36('0x10')][_0x32e171['queue']]){if(_0x32e171[_0x1e36('0x83')]&&_0x32e171['transfer']!=!![]){this['voiceQueues'][_0x32e171['queue']][_0x1e36('0x50')]+=0x1;}if(_0x32e171[_0x1e36('0x1a')]){this[_0x1e36('0x10')][_0x32e171['queue']]['abandoned']+=0x1;}this[_0x1e36('0x10')][_0x32e171[_0x1e36('0x5b')]][_0x1e36('0xb5')]+=moment(_0x32e171[_0x1e36('0x7b')])[_0x1e36('0xb6')](_0x32e171[_0x1e36('0x8e')],_0x1e36('0x90'))||0x0;if(_0x12f523===this[_0x1e36('0xd')][_0xad56bc[_0x1e36('0x3f')]][_0x1e36('0xb4')]-0x1){this['voiceQueues'][_0x32e171[_0x1e36('0x5b')]][_0x1e36('0x4d')]+=moment()[_0x1e36('0xb7')](0x0)['diff'](_0x32e171[_0x1e36('0x8e')],_0x1e36('0x90'));this[_0x1e36('0x10')][_0x32e171[_0x1e36('0x5b')]][_0x1e36('0x4f')]+=0x1;if(_0x32e171[_0x1e36('0x73')]){this['voiceQueues'][_0x32e171['queue']][_0x1e36('0xb8')]+=0x1;this[_0x1e36('0x10')][_0x32e171[_0x1e36('0x5b')]]['sumBillable']+=moment()[_0x1e36('0xb7')](0x0)['diff'](_0x32e171[_0x1e36('0x7b')],_0x1e36('0x90'));_0x32e171['queuecallercompleteAt']=moment()[_0x1e36('0x40')](_0x1e36('0x7c'));_0x32e171[_0x1e36('0x83')]=![];_0x32e171[_0x1e36('0x84')]=null;}if(_0x32e171[_0x1e36('0x83')]&&_0x32e171[_0x1e36('0x85')]!=!![]){_0x32e171[_0x1e36('0x9f')]=_0x1e36('0x50');logger[_0x1e36('0x3c')](_0x1e36('0xb9'),_0xad56bc['uniqueid'],util[_0x1e36('0x34')](_0x32e171,{'showHidden':![],'depth':null}));ami[_0x1e36('0x3b')]('custom:queuecallerunmanaged',_0x32e171);}if(_0x32e171[_0x1e36('0x1a')]){_0x32e171[_0x1e36('0x9f')]=_0x1e36('0xba');logger[_0x1e36('0x3c')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0xad56bc['uniqueid'],util[_0x1e36('0x34')](_0x32e171,{'showHidden':![],'depth':null}));ami[_0x1e36('0x3b')]('custom:queuecallerabandon',_0x32e171);}}else{this[_0x1e36('0x10')][_0x32e171['queue']]['sumDuration']+=this[_0x1e36('0x10')][_0x32e171['queue']][_0x1e36('0xb5')];}logger[_0x1e36('0x5d')](_0x1e36('0xbb'),_0xad56bc[_0x1e36('0x3f')],_0x32e171[_0x1e36('0x42')],_0x32e171[_0x1e36('0x49')],_0xad56bc[_0x1e36('0xbc')]);this[_0x1e36('0xe')][_0xad56bc['uniqueid']]=_0x32e171;this[_0x1e36('0x45')](_0x32e171,'hangup');this[_0x1e36('0x48')](this[_0x1e36('0x10')][_0x32e171['queue']],_0x1e36('0xbd'));}}logger[_0x1e36('0x3c')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0xad56bc['uniqueid'],util[_0x1e36('0x34')](this[_0x1e36('0xd')][_0xad56bc['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x1e36('0x3b')]('custom:voiceQueueReport',this[_0x1e36('0xd')][_0xad56bc['uniqueid']]);delete this[_0x1e36('0xd')][_0xad56bc[_0x1e36('0x3f')]];delete this[_0x1e36('0xe')][_0xad56bc[_0x1e36('0x3f')]];}if(this[_0x1e36('0x12')][_0xad56bc[_0x1e36('0x3f')]]){delete this[_0x1e36('0x12')][_0xad56bc['uniqueid']];}}}catch(_0x16e6e6){logger[_0x1e36('0x32')](_0x1e36('0xb3'),_0xad56bc[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0x16e6e6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e36('0x8')]['syncAttendedTransfer']=function(_0x37c542){try{if(this['isNotNull'](_0x37c542)){logger['debug'](_0x1e36('0xbe'),_0x37c542[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0x37c542,{'showHidden':![],'depth':null}));var _0x430969;if(this[_0x1e36('0xd')][_0x37c542[_0x1e36('0xbf')]]){_0x430969=_['last'](this[_0x1e36('0xd')][_0x37c542[_0x1e36('0xbf')]]);_0x430969[_0x1e36('0x93')]=_0x37c542[_0x1e36('0xc0')];_0x430969[_0x1e36('0x95')]=_0x37c542['secondtransfereruniqueid'];_0x430969[_0x1e36('0x78')]=_0x1e36('0xc1');_0x430969[_0x1e36('0x85')]=!![];_0x430969[_0x1e36('0xc2')]=_0x1e36('0xc3');if(this[_0x1e36('0xd')][_0x37c542[_0x1e36('0xc4')]]){var _0x211c36=this[_0x1e36('0xd')][_0x37c542[_0x1e36('0xc4')]];this[_0x1e36('0xd')][_0x37c542[_0x1e36('0xc4')]]=this['queueReports'][_0x37c542[_0x1e36('0xbf')]];this[_0x1e36('0xd')][_0x37c542['transfereeuniqueid']]=_0x211c36;var _0x235164=_['last'](this[_0x1e36('0xd')][_0x37c542[_0x1e36('0xbf')]]);_0x235164[_0x1e36('0x2d')]=!![];}logger[_0x1e36('0x5d')](_0x1e36('0xc5'),_0x37c542[_0x1e36('0x3f')],_0x430969[_0x1e36('0x42')],_0x430969[_0x1e36('0x49')],_0x430969[_0x1e36('0x93')],_0x430969['transferuniqueid']);}else if(this[_0x1e36('0xd')][_0x37c542[_0x1e36('0xc6')]]){_0x430969=_['last'](this[_0x1e36('0xd')][_0x37c542[_0x1e36('0xc6')]]);_0x430969[_0x1e36('0x93')]=_0x37c542['origtransfererexten'];_0x430969['transferuniqueid']=_0x37c542[_0x1e36('0xc7')];_0x430969[_0x1e36('0x78')]=_0x1e36('0xc1');_0x430969[_0x1e36('0x85')]=!![];_0x430969['transfertype']=_0x1e36('0xc3');if(this[_0x1e36('0xd')][_0x37c542['origtransfereruniqueid']]){var _0x211c36=this[_0x1e36('0xd')][_0x37c542[_0x1e36('0xc7')]];this[_0x1e36('0xd')][_0x37c542[_0x1e36('0xc7')]]=this[_0x1e36('0xd')][_0x37c542[_0x1e36('0xc6')]];this[_0x1e36('0xd')][_0x37c542['transfertargetuniqueid']]=_0x211c36;var _0x235164=_['last'](this[_0x1e36('0xd')][_0x37c542[_0x1e36('0xc6')]]);_0x235164['switch']=!![];}logger[_0x1e36('0x5d')](_0x1e36('0xc5'),_0x37c542[_0x1e36('0x3f')],_0x430969[_0x1e36('0x42')],_0x430969['type'],_0x430969[_0x1e36('0x93')],_0x430969['transferuniqueid']);}}}catch(_0x3cb9b0){logger['error'](_0x1e36('0xbe'),_0x37c542[_0x1e36('0x3f')],util['inspect'](_0x3cb9b0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e36('0x8')][_0x1e36('0x25')]=function(_0x2a30ba){try{if(this[_0x1e36('0x57')](_0x2a30ba)){logger['debug']('[%s][voiceQueueReport][blindtransfer]',_0x2a30ba[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0x2a30ba,{'showHidden':![],'depth':null}));if(this[_0x1e36('0xd')][_0x2a30ba[_0x1e36('0xbf')]]){var _0x23b714=_[_0x1e36('0x72')](this[_0x1e36('0xd')][_0x2a30ba[_0x1e36('0xbf')]]);_0x23b714['queuecallerexitreason']='BLINDTRANSFER';_0x23b714[_0x1e36('0x85')]=!![];_0x23b714[_0x1e36('0xc2')]=_0x1e36('0xc8');_0x23b714['transferexten']=_0x2a30ba['extension'];_0x23b714[_0x1e36('0x95')]=_0x2a30ba[_0x1e36('0xbf')];logger[_0x1e36('0x5d')](_0x1e36('0xc9'),_0x2a30ba['uniqueid'],_0x23b714[_0x1e36('0x42')],_0x23b714[_0x1e36('0x49')],_0x23b714[_0x1e36('0x93')],_0x23b714[_0x1e36('0x95')]);this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x2a30ba['transfereeuniqueid'],'context':_0x2a30ba['context'],'channel':_0x2a30ba[_0x1e36('0xca')]});}}}catch(_0x45a094){logger[_0x1e36('0x32')](_0x1e36('0xcb'),_0x2a30ba[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0x45a094,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e36('0x8')]['syncMusicOnHoldStart']=function(_0x5758c9){try{if(this[_0x1e36('0x57')](_0x5758c9)){logger[_0x1e36('0x3c')]('[%s][voiceQueueReport][musiconholdstart]',_0x5758c9[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0x5758c9,{'showHidden':![],'depth':null}));if(this[_0x1e36('0xd')][_0x5758c9[_0x1e36('0x3f')]]){var _0x58d653=_['last'](this[_0x1e36('0xd')][_0x5758c9[_0x1e36('0x3f')]]);if(!_[_0x1e36('0x2e')](_0x58d653[_0x1e36('0x7b')])){_0x58d653['mohstarttime']=moment()[_0x1e36('0x40')](_0x1e36('0x7c'));logger[_0x1e36('0x5d')](_0x1e36('0xcc'),_0x5758c9[_0x1e36('0x3f')],_0x58d653[_0x1e36('0xcd')]);}}}}catch(_0x3a2a9a){logger['error'](_0x1e36('0xce'),_0x5758c9[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0x3a2a9a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1e36('0xcf')]=function(_0x184b31){try{if(this[_0x1e36('0x57')](_0x184b31)){logger[_0x1e36('0x3c')](_0x1e36('0xd0'),_0x184b31[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0x184b31,{'showHidden':![],'depth':null}));if(this[_0x1e36('0xd')][_0x184b31[_0x1e36('0x3f')]]){var _0x560f63=_[_0x1e36('0x72')](this[_0x1e36('0xd')][_0x184b31['uniqueid']]);if(!_[_0x1e36('0x2e')](_0x560f63[_0x1e36('0xcd')])){_0x560f63[_0x1e36('0xd1')]+=moment()[_0x1e36('0xb7')](0x0)[_0x1e36('0xb6')](_0x560f63[_0x1e36('0xcd')],_0x1e36('0x90'));logger['info']('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x184b31[_0x1e36('0x3f')],_0x560f63['mohtime']);delete _0x560f63[_0x1e36('0xcd')];}}}}catch(_0x58440f){logger[_0x1e36('0x32')](_0x1e36('0xd0'),_0x184b31[_0x1e36('0x3f')],util['inspect'](_0x58440f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1e36('0x8')][_0x1e36('0xd2')]=function(_0x2c6f9c){try{if(this[_0x1e36('0x57')](_0x2c6f9c)){logger['debug'](_0x1e36('0xd3'),_0x2c6f9c[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0x2c6f9c,{'showHidden':![],'depth':null}));if(_0x2c6f9c[_0x1e36('0xd4')]['toLowerCase']()===_0x1e36('0xd5')){_0x2c6f9c[_0x1e36('0xd6')]=_0x2c6f9c['appdata']&&_0x2c6f9c['appdata']['startsWith'](_0x1e36('0xd7'))?_0x2c6f9c[_0x1e36('0xd8')]:(_0x2c6f9c[_0x1e36('0xd8')]||_0x2c6f9c[_0x1e36('0xd6')])['toLowerCase']();if(_[_0x1e36('0x89')](_0x2c6f9c[_0x1e36('0xd6')][_0x1e36('0x8b')](),_0x1e36('0xd9'))){logger[_0x1e36('0x5d')](_0x1e36('0xda'),_0x2c6f9c[_0x1e36('0x3f')],_0x2c6f9c[_0x1e36('0xd4')],_0x2c6f9c['applicationdata']);if(_[_0x1e36('0x67')](this['channels'][_0x2c6f9c[_0x1e36('0x3f')]]))this[_0x1e36('0xe')][_0x2c6f9c['uniqueid']]={};var _0x24ec80=_0x2c6f9c[_0x1e36('0xd6')]['split']('=');var _0xf32836=_0x24ec80[0x0][_0x1e36('0x8b')]()[_0x1e36('0xdb')](/cdr\((.*)\)/);if(_0xf32836)this['channels'][_0x2c6f9c['uniqueid']][_0xf32836[0x1]]=_0x24ec80[0x1];}}}}catch(_0xf84de){logger[_0x1e36('0x32')](_0x1e36('0xdc'),_0x2c6f9c[_0x1e36('0x3f')],util[_0x1e36('0x34')](_0xf84de,{'showHidden':![],'depth':null}));}};module[_0x1e36('0xdd')]=VoiceQueueReport;