Built motion from commit (unavailable).|2.5.16
[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 _0x30cf=['loggedIn','sumBillable','sumDuration','sumHoldTime','unmanaged','abandoned','Trunk','Interval','stringify',']\x20sending\x20voice_queue:save\x20event:','isNotNull','isUndefined','Action','queues','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummary]\x20name:%s','queue','countBy','callers','toNumber','loggedin','available','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','syncQueueCallerJoin','queuecallerjoinAt','position','count','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','keys','push','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerjoin]','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','syncQueueCallerLeave','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','queuecallerexitreason','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','lastAssignedTo','membername','queuecallerexit','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','transfertype','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','agentcomplete','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','queuecallerexitAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','includes','syncHangup','[%s][voiceQueueReport][hangup]','length','diff','milliseconds','total','answered','BLINDTRANSFER','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','[%s][voiceQueueReport][blindtransfer]','BLIND','extension','BlindTransfer','context','transfererchannel','mohstarttime','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstop]','isNil','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','exports','lodash','moment','util','md5','../../../config/environment','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','enqueue','tail','finally','sequence','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','queuesummarycomplete','queuecallerjoin','queuecallerabandon','queuecallerleave','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','talking','pTalking','waiting','queueStatusComplete','unlockRR','prototype','clearZombieChannels','channels','switch','status','channel','catch','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','variables','error','[%s][voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','voice:queue:%s','name','voice_queue_channel:save',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','format','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0x30cf,0x93));var _0xf30c=function(_0xb8ddd9,_0x4e2eea){_0xb8ddd9=_0xb8ddd9-0x0;var _0x50d205=_0x30cf[_0xb8ddd9];return _0x50d205;};'use strict';var _=require(_0xf30c('0x0'));var moment=require(_0xf30c('0x1'));var util=require(_0xf30c('0x2'));var md5=require(_0xf30c('0x3'));var Redis=require('ioredis');var config=require(_0xf30c('0x4'));var logger=require('../../../config/logger')(_0xf30c('0x5'));var ami=require(_0xf30c('0x6'));var QueueReport=require(_0xf30c('0x7'));config[_0xf30c('0x8')]=_[_0xf30c('0x9')](config[_0xf30c('0x8')],{'host':_0xf30c('0xa'),'port':0x18eb});var io=require(_0xf30c('0xb'))(new Redis(config[_0xf30c('0x8')]));var Sequence=function(){};Sequence['prototype'][_0xf30c('0xc')]=function(_0x5456c6){this[_0xf30c('0xd')]=this[_0xf30c('0xd')]?this[_0xf30c('0xd')][_0xf30c('0xe')](_0x5456c6):_0x5456c6();};function VoiceQueueReport(_0x5c90ff){this[_0xf30c('0xf')]=new Sequence();this[_0xf30c('0x10')]={};this[_0xf30c('0x11')]=_0x5c90ff['agents'];this['channels']=_0x5c90ff[_0xf30c('0x12')];this[_0xf30c('0x13')]=_0x5c90ff[_0xf30c('0x13')];this[_0xf30c('0x14')]=!![];this[_0xf30c('0x15')]=_0x5c90ff[_0xf30c('0x15')];this['variables']={};ami['on'](_0xf30c('0x16'),this[_0xf30c('0x17')][_0xf30c('0x18')](this));ami['on'](_0xf30c('0x19'),this['syncQueueSummaryComplete'][_0xf30c('0x18')](this));ami['on'](_0xf30c('0x1a'),this['syncQueueCallerJoin'][_0xf30c('0x18')](this));ami['on'](_0xf30c('0x1b'),this['syncQueueCallerAbandon'][_0xf30c('0x18')](this));ami['on'](_0xf30c('0x1c'),this['syncQueueCallerLeave'][_0xf30c('0x18')](this));ami['on']('agentcomplete',this[_0xf30c('0x1d')][_0xf30c('0x18')](this));ami['on'](_0xf30c('0x1e'),this[_0xf30c('0x1f')][_0xf30c('0x18')](this));ami['on'](_0xf30c('0x20'),this[_0xf30c('0x21')][_0xf30c('0x18')](this));ami['on'](_0xf30c('0x22'),this['syncHangup'][_0xf30c('0x18')](this));ami['on']('fullybooted',this[_0xf30c('0x23')][_0xf30c('0x18')](this));ami['on'](_0xf30c('0x24'),this[_0xf30c('0x25')][_0xf30c('0x18')](this));ami['on'](_0xf30c('0x26'),this[_0xf30c('0x27')][_0xf30c('0x18')](this));ami['on'](_0xf30c('0x28'),this[_0xf30c('0x29')][_0xf30c('0x18')](this));ami['on'](_0xf30c('0x2a'),this[_0xf30c('0x2b')][_0xf30c('0x18')](this));this[_0xf30c('0x2c')]();this[_0xf30c('0x2d')]();}function clearChannels(_0x53cfa0){if(!_[_0xf30c('0x2e')](_0x53cfa0)){for(var _0x579e9d in _0x53cfa0){if(_0x53cfa0[_0xf30c('0x2f')](_0x579e9d)){delete _0x53cfa0[_0x579e9d];}}}}function clearCampaigns(_0x50317f){if(!_[_0xf30c('0x2e')](_0x50317f)){for(var _0x405b87 in _0x50317f){if(_0x50317f[_0xf30c('0x2f')](_0x405b87)){_0x50317f[_0x405b87]['originated']=0x0;}}}}function clearVoiceQueues(_0x2fe13){if(!_[_0xf30c('0x2e')](_0x2fe13)){for(var _0xfd4b22 in _0x2fe13){if(_0x2fe13[_0xf30c('0x2f')](_0xfd4b22)){_0x2fe13[_0xfd4b22]['originated']=0x0;_0x2fe13[_0xfd4b22][_0xf30c('0x30')]=0x0;_0x2fe13[_0xfd4b22][_0xf30c('0x31')]=0x0;_0x2fe13[_0xfd4b22][_0xf30c('0x32')]=0x0;_0x2fe13[_0xfd4b22][_0xf30c('0x33')]=!![];}}}}function clearAgentBooked(_0xfdb573){if(!_[_0xf30c('0x2e')](_0xfdb573)){for(var _0x31edab in _0xfdb573){if(_0xfdb573[_0xf30c('0x2f')](_0x31edab)){_0xfdb573[_0x31edab][_0xf30c('0x34')]=!![];}}}}VoiceQueueReport[_0xf30c('0x35')][_0xf30c('0x36')]=function(){var _0xf1d9d9=this;for(var _0x20f212 in this[_0xf30c('0x37')]){if(this[_0xf30c('0x37')]['hasOwnProperty'](_0x20f212)&&!this[_0xf30c('0x37')][_0x20f212][_0xf30c('0x38')]){this[_0xf30c('0xf')][_0xf30c('0xc')](function(){if(!_['isNil'](_0xf1d9d9[_0xf30c('0x37')][_0x20f212])){return ami['Action']({'action':_0xf30c('0x39'),'channel':_0xf1d9d9[_0xf30c('0x37')][_0x20f212][_0xf30c('0x3a')]})[_0xf30c('0x3b')](function(_0x589f87){if(_0x589f87[_0xf30c('0x3c')]===_0xf30c('0x3d')){setTimeout(function(){if(_0xf1d9d9[_0xf30c('0x37')][_0x20f212]){delete _0xf1d9d9[_0xf30c('0x37')][_0x20f212];logger['error'](_0xf30c('0x3e'),_0x20f212,util[_0xf30c('0x3f')](_0x589f87,{'showHidden':![],'depth':null}));}if(_0xf1d9d9['queueReports'][_0x20f212]){delete _0xf1d9d9['queueReports'][_0x20f212];logger['error'](_0xf30c('0x40'),_0x20f212,util[_0xf30c('0x3f')](_0x589f87,{'showHidden':![],'depth':null}));}if(_0xf1d9d9[_0xf30c('0x41')][_0x20f212]){delete _0xf1d9d9[_0xf30c('0x41')][_0x20f212];logger[_0xf30c('0x42')](_0xf30c('0x43'),_0x20f212,util['inspect'](_0x589f87,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xf30c('0x35')][_0xf30c('0x23')]=function(){logger[_0xf30c('0x42')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xf30c('0x37')]);this[_0xf30c('0x44')](this['queueReports']);clearAgentBooked(this[_0xf30c('0x11')]);clearVoiceQueues(this[_0xf30c('0x13')]);clearCampaigns(this[_0xf30c('0x15')]);};VoiceQueueReport['prototype'][_0xf30c('0x44')]=function(_0x1a15e4){var _0x2f2963=this;if(!_[_0xf30c('0x2e')](_0x1a15e4)){for(var _0x554d90 in _0x1a15e4){if(_0x1a15e4[_0xf30c('0x2f')](_0x554d90)){_0x2f2963[_0xf30c('0x45')](_0x1a15e4[_0x554d90],'clearqueuereport');delete _0x1a15e4[_0x554d90];}}}};VoiceQueueReport[_0xf30c('0x35')][_0xf30c('0x46')]=function(_0x423872,_0x45696e,_0x271605){io['to'](_0x423872)[_0xf30c('0x46')](_0x45696e,_0x271605);};VoiceQueueReport['prototype']['emitVoiceQueueChannelSave']=function(_0x26febc,_0x5f4a38){logger[_0xf30c('0x47')](_0xf30c('0x48')+_0x5f4a38+_0xf30c('0x49'),_0x26febc['uniqueid'],util[_0xf30c('0x3f')](_0x26febc,{'showHidden':![],'depth':null}));this['emit'](util['format'](_0xf30c('0x4a'),_0x26febc[_0xf30c('0x4b')]),_0xf30c('0x4c'),_0x26febc);};VoiceQueueReport[_0xf30c('0x35')]['emitVoiceQueueChannelRemove']=function(_0x517abc,_0x24fa96){logger[_0xf30c('0x47')]('[%s][voiceQueueReport]['+_0x24fa96+_0xf30c('0x4d'),_0x517abc[_0xf30c('0x4e')],util['inspect'](_0x517abc,{'showHidden':![],'depth':null}));this[_0xf30c('0x46')](util[_0xf30c('0x4f')](_0xf30c('0x4a'),_0x517abc[_0xf30c('0x4b')]),_0xf30c('0x50'),_0x517abc);};VoiceQueueReport[_0xf30c('0x35')][_0xf30c('0x51')]=function(_0x2f1c96,_0x30429a){if(_0x2f1c96[_0xf30c('0x52')]===_0xf30c('0x53')){var _0xe279c6={'id':_0x2f1c96['id'],'name':_0x2f1c96[_0xf30c('0x4b')],'strategy':_0x2f1c96[_0xf30c('0x54')],'answered':_0x2f1c96['answered'],'available':_0x2f1c96['available'],'loggedIn':_0x2f1c96[_0xf30c('0x55')],'pTalking':_0x2f1c96['pTalking'],'sumBillable':_0x2f1c96[_0xf30c('0x56')],'sumDuration':_0x2f1c96[_0xf30c('0x57')],'sumHoldTime':_0x2f1c96[_0xf30c('0x58')]||0x0,'talking':_0x2f1c96[_0xf30c('0x30')],'total':_0x2f1c96['total'],'type':_0x2f1c96['type'],'unmanaged':_0x2f1c96[_0xf30c('0x59')],'abandoned':_0x2f1c96[_0xf30c('0x5a')],'waiting':_0x2f1c96[_0xf30c('0x32')]};if(_0x2f1c96[_0xf30c('0x5b')]){_0xe279c6[_0xf30c('0x5b')]={'id':_0x2f1c96[_0xf30c('0x5b')]['id'],'name':_0x2f1c96[_0xf30c('0x5b')][_0xf30c('0x4b')],'active':_0x2f1c96['Trunk']['active'],'callerid':_0x2f1c96[_0xf30c('0x5b')]['callerid']};}if(_0x2f1c96[_0xf30c('0x5c')]){_0xe279c6[_0xf30c('0x5c')]={'id':_0x2f1c96[_0xf30c('0x5c')]['id'],'name':_0x2f1c96['Interval'][_0xf30c('0x4b')]};}var _0x1c7295=md5(JSON[_0xf30c('0x5d')](_0xe279c6));if(_0x2f1c96['md5']!==_0x1c7295){_0x2f1c96[_0xf30c('0x3')]=_0x1c7295;logger[_0xf30c('0x47')]('[voiceQueueReport]['+_0x30429a+_0xf30c('0x5e'),util['inspect'](_0xe279c6,{'showHidden':![],'depth':null}));this[_0xf30c('0x46')](util['format'](_0xf30c('0x4a'),_0xe279c6[_0xf30c('0x4b')]),'voice_queue:save',_0xe279c6);}}};VoiceQueueReport[_0xf30c('0x35')][_0xf30c('0x5f')]=function(_0xb77f41){return _0xb77f41!==null&&!_[_0xf30c('0x60')](_0xb77f41);};VoiceQueueReport[_0xf30c('0x35')][_0xf30c('0x2d')]=function(){var _0x48f2d8=this;setInterval(function(){_0x48f2d8[_0xf30c('0x36')]();ami[_0xf30c('0x61')]({'action':_0xf30c('0x62')})['catch'](function(_0x59801b){logger[_0xf30c('0x42')](_0xf30c('0x63'),util['inspect'](_0x59801b,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xf30c('0x35')]['loopQueueSummary']=function(){var _0x2e3ce8=this;setInterval(function(){if(_0x2e3ce8[_0xf30c('0x14')]){return ami[_0xf30c('0x61')]({'action':'queuesummary'})[_0xf30c('0x64')](function(_0x539c4d){_0x2e3ce8[_0xf30c('0x14')]=![];})[_0xf30c('0x3b')](function(_0x4ac7c2){logger[_0xf30c('0x42')](_0xf30c('0x65'),util[_0xf30c('0x3f')](_0x4ac7c2,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xf30c('0x35')]['syncQueueSummary']=function(_0x2bb958){try{if(this[_0xf30c('0x5f')](_0x2bb958)&&this[_0xf30c('0x5f')](_0x2bb958['queue'])){logger[_0xf30c('0x47')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xf30c('0x3f')](_0x2bb958,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x2bb958['queue']]){logger['info'](_0xf30c('0x66'),_0x2bb958[_0xf30c('0x67')]);var _0x481da3=_[_0xf30c('0x68')](this['channels'],_0xf30c('0x67'))[_0x2bb958[_0xf30c('0x67')]]||0x0;var _0x1c5faf=_0x481da3-_0x2bb958[_0xf30c('0x69')];if(this[_0xf30c('0x13')][_0x2bb958['queue']][_0xf30c('0x32')]!==_[_0xf30c('0x6a')](_0x2bb958[_0xf30c('0x69')])||this[_0xf30c('0x13')][_0x2bb958[_0xf30c('0x67')]][_0xf30c('0x55')]!==_['toNumber'](_0x2bb958[_0xf30c('0x6b')])||this[_0xf30c('0x13')][_0x2bb958[_0xf30c('0x67')]][_0xf30c('0x6c')]!==_[_0xf30c('0x6a')](_0x2bb958[_0xf30c('0x6c')])||this[_0xf30c('0x13')][_0x2bb958[_0xf30c('0x67')]]['talking']!==_0x1c5faf){this[_0xf30c('0x13')][_0x2bb958[_0xf30c('0x67')]][_0xf30c('0x32')]=_['toNumber'](_0x2bb958[_0xf30c('0x69')]);this[_0xf30c('0x13')][_0x2bb958[_0xf30c('0x67')]][_0xf30c('0x55')]=_[_0xf30c('0x6a')](_0x2bb958[_0xf30c('0x6b')]);this[_0xf30c('0x13')][_0x2bb958[_0xf30c('0x67')]]['available']=_[_0xf30c('0x6a')](_0x2bb958[_0xf30c('0x6c')]);this[_0xf30c('0x13')][_0x2bb958[_0xf30c('0x67')]][_0xf30c('0x30')]=_0x1c5faf>0x0?_0x1c5faf:0x0;this['voiceQueues'][_0x2bb958[_0xf30c('0x67')]]['talking']=this[_0xf30c('0x13')][_0x2bb958['queue']][_0xf30c('0x30')]>_[_0xf30c('0x6a')](_0x2bb958[_0xf30c('0x6b')])?_[_0xf30c('0x6a')](_0x2bb958['loggedin']):this[_0xf30c('0x13')][_0x2bb958[_0xf30c('0x67')]]['talking'];this[_0xf30c('0x51')](this['voiceQueues'][_0x2bb958[_0xf30c('0x67')]],_0xf30c('0x16'));}logger[_0xf30c('0x47')](_0xf30c('0x6d'),util['inspect'](this[_0xf30c('0x13')][_0x2bb958[_0xf30c('0x67')]],{'showHidden':![],'depth':null}));ami[_0xf30c('0x46')]('custom:queuesummary',this[_0xf30c('0x13')][_0x2bb958[_0xf30c('0x67')]]);}}}catch(_0x2be690){logger[_0xf30c('0x42')](_0xf30c('0x65'),util[_0xf30c('0x3f')](_0x2be690,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf30c('0x35')]['syncQueueSummaryComplete']=function(_0x36708a){logger[_0xf30c('0x47')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xf30c('0x3f')](_0x36708a,{'showHidden':![],'depth':null}));this[_0xf30c('0x14')]=!![];};VoiceQueueReport[_0xf30c('0x35')][_0xf30c('0x6e')]=function(_0x1f896d){try{if(this[_0xf30c('0x5f')](_0x1f896d)){logger[_0xf30c('0x47')]('[%s][voiceQueueReport][queuecallerjoin]',_0x1f896d[_0xf30c('0x4e')],util['inspect'](_0x1f896d,{'showHidden':![],'depth':null}));if(_[_0xf30c('0x60')](this[_0xf30c('0x10')][_0x1f896d[_0xf30c('0x4e')]])){this['queueReports'][_0x1f896d['uniqueid']]=[];this[_0xf30c('0x37')][_0x1f896d['uniqueid']]={};}var _0x5baa6a=new QueueReport();_0x5baa6a[_0xf30c('0x4b')]=_0x1f896d[_0xf30c('0x67')];_0x5baa6a['type']=this[_0xf30c('0x13')][_0x5baa6a[_0xf30c('0x4b')]]&&this[_0xf30c('0x13')][_0x5baa6a[_0xf30c('0x4b')]][_0xf30c('0x52')]?this[_0xf30c('0x13')][_0x5baa6a[_0xf30c('0x4b')]]['type']||_0xf30c('0x53'):'inbound';_0x5baa6a[_0xf30c('0x67')]=_0x1f896d[_0xf30c('0x67')];_0x5baa6a[_0xf30c('0x6f')]=moment()[_0xf30c('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x5baa6a[_0xf30c('0x70')]=_0x1f896d['position'];_0x5baa6a['count']=_0x1f896d[_0xf30c('0x71')];_0x5baa6a['uniqueid']=_0x1f896d[_0xf30c('0x4e')];logger[_0xf30c('0x72')](_0xf30c('0x73'),_0x5baa6a[_0xf30c('0x4b')],_0x5baa6a['type']);_['merge'](_0x5baa6a,_[_0xf30c('0x74')](_0x1f896d,_[_0xf30c('0x75')](_0x5baa6a)));this[_0xf30c('0x10')][_0x1f896d['uniqueid']][_0xf30c('0x76')](_0x5baa6a);this[_0xf30c('0x37')][_0x1f896d[_0xf30c('0x4e')]]=_0x5baa6a;this[_0xf30c('0x77')](_0x5baa6a,_0xf30c('0x1a'));}}catch(_0x1e50b1){logger[_0xf30c('0x42')](_0xf30c('0x78'),_0x1f896d[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0x1e50b1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf30c('0x79')]=function(_0x46efc2){try{if(this[_0xf30c('0x5f')](_0x46efc2)){logger[_0xf30c('0x47')](_0xf30c('0x7a'),_0x46efc2[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0x46efc2,{'showHidden':![],'depth':null}));if(this[_0xf30c('0x10')][_0x46efc2[_0xf30c('0x4e')]]){var _0x4107d2=_[_0xf30c('0x7b')](this[_0xf30c('0x10')][_0x46efc2['uniqueid']]);_0x4107d2['queuecallercomplete']=![];_0x4107d2[_0xf30c('0x7c')]=null;_0x4107d2['holdtime']=_0x46efc2[_0xf30c('0x7d')];_0x4107d2[_0xf30c('0x7e')]=_0x46efc2[_0xf30c('0x7e')];_0x4107d2[_0xf30c('0x1b')]=!![];_0x4107d2[_0xf30c('0x7f')]=moment()['format'](_0xf30c('0x80'));_0x4107d2['queuecallerexitreason']='ABANDONED';_0x4107d2['lastAssignedTo']=null;logger[_0xf30c('0x72')](_0xf30c('0x81'),_0x4107d2[_0xf30c('0x4b')],_0x4107d2[_0xf30c('0x52')]);this[_0xf30c('0x37')][_0x46efc2['uniqueid']]=_0x4107d2;this[_0xf30c('0x45')](_0x4107d2,'queuecallerabandon');}}}catch(_0x41fe67){logger[_0xf30c('0x42')](_0xf30c('0x7a'),_0x46efc2[_0xf30c('0x4e')],util['inspect'](_0x41fe67,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf30c('0x35')][_0xf30c('0x82')]=function(_0x267222){try{if(this[_0xf30c('0x5f')](_0x267222)){logger[_0xf30c('0x47')](_0xf30c('0x83'),_0x267222[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0x267222,{'showHidden':![],'depth':null}));if(this[_0xf30c('0x10')][_0x267222[_0xf30c('0x4e')]]){var _0xa2037c=_[_0xf30c('0x7b')](this[_0xf30c('0x10')][_0x267222[_0xf30c('0x4e')]]);_0xa2037c[_0xf30c('0x84')]=moment()[_0xf30c('0x4f')](_0xf30c('0x80'));_0xa2037c[_0xf30c('0x85')]=_0x267222[_0xf30c('0x85')];_0xa2037c[_0xf30c('0x86')]=_0x267222[_0xf30c('0x86')];logger[_0xf30c('0x72')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0xa2037c[_0xf30c('0x4b')],_0xa2037c[_0xf30c('0x52')],_0x267222[_0xf30c('0x85')],_0x267222[_0xf30c('0x86')]);this[_0xf30c('0x37')][_0x267222['uniqueid']]=_0xa2037c;this['emitVoiceQueueChannelSave'](_0xa2037c,'queuecallerleave');}}}catch(_0x469b7c){logger[_0xf30c('0x42')](_0xf30c('0x83'),_0x267222[_0xf30c('0x4e')],util['inspect'](_0x469b7c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf30c('0x1f')]=function(_0x2101f9){try{if(this[_0xf30c('0x5f')](_0x2101f9)){logger[_0xf30c('0x47')](_0xf30c('0x87'),_0x2101f9[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0x2101f9,{'showHidden':![],'depth':null}));if(this[_0xf30c('0x10')][_0x2101f9['uniqueid']]){var _0x63c3c6=_[_0xf30c('0x7b')](this[_0xf30c('0x10')][_0x2101f9[_0xf30c('0x4e')]]);_0x63c3c6[_0xf30c('0x88')]=!![];_0x63c3c6[_0xf30c('0x89')]=_0xf30c('0x8a');logger[_0xf30c('0x72')](_0xf30c('0x8b'),_0x63c3c6[_0xf30c('0x4b')],_0x63c3c6[_0xf30c('0x52')]);}}}catch(_0x2c3718){logger['error'](_0xf30c('0x87'),_0x2101f9[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0x2c3718,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x146c4d){try{if(this[_0xf30c('0x5f')](_0x146c4d)){logger[_0xf30c('0x47')](_0xf30c('0x8c'),_0x146c4d[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0x146c4d,{'showHidden':![],'depth':null}));if(this[_0xf30c('0x10')][_0x146c4d[_0xf30c('0x4e')]]){var _0x470d25=_['last'](this[_0xf30c('0x10')][_0x146c4d[_0xf30c('0x4e')]]);_0x470d25[_0xf30c('0x1b')]=![];_0x470d25[_0xf30c('0x7f')]=null;_0x470d25[_0xf30c('0x8d')]=!![];_0x470d25[_0xf30c('0x8e')]=_0x146c4d[_0xf30c('0x8f')];_0x470d25[_0xf30c('0x7d')]=_0x146c4d[_0xf30c('0x7d')];_0x470d25['queuecallercomplete']=!![];_0x470d25[_0xf30c('0x90')]=![];_0x470d25['queuecallerexitAt']=null;if(!_0x470d25[_0xf30c('0x91')]){if(_0x146c4d[_0xf30c('0x92')]==_0xf30c('0x91')){_0x470d25[_0xf30c('0x89')]=_0xf30c('0x93');logger['info'](_0xf30c('0x94'),_0x470d25[_0xf30c('0x4b')],_0x470d25['type']);}else{if(_[_0xf30c('0x95')](_0x146c4d[_0xf30c('0x3a')][_0xf30c('0x96')](),_0xf30c('0x97'))){if(this[_0xf30c('0x10')][_0x146c4d[_0xf30c('0x98')]]){var _0x5cf592=_[_0xf30c('0x7b')](this['queueReports'][_0x146c4d['linkedid']]);_0x5cf592['queuecallercomplete']=![];_0x5cf592[_0xf30c('0x90')]=!![];_0x5cf592['queuecallerexitAt']=moment(_0x470d25[_0xf30c('0x6f')])[_0xf30c('0x99')](_0x146c4d[_0xf30c('0x7d')],_0xf30c('0x9a'))[_0xf30c('0x4f')](_0xf30c('0x80'));_0x5cf592[_0xf30c('0x89')]='FORWARDTRANSFER';_0x5cf592[_0xf30c('0x91')]=!![];_0x5cf592[_0xf30c('0x9b')]=_0xf30c('0x9c');_0x5cf592[_0xf30c('0x9d')]=_0x146c4d[_0xf30c('0x9e')];_0x5cf592[_0xf30c('0x9f')]=_0x146c4d[_0xf30c('0x4e')];logger[_0xf30c('0x72')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x5cf592[_0xf30c('0x4b')],_0x5cf592[_0xf30c('0x52')]);var _0xefa1d6=this[_0xf30c('0x10')][_0x146c4d[_0xf30c('0x98')]];this['queueReports'][_0x146c4d[_0xf30c('0x98')]]=this['queueReports'][_0x146c4d['uniqueid']];this[_0xf30c('0x10')][_0x146c4d[_0xf30c('0x4e')]]=_0xefa1d6;}}else{_0x470d25['queuecallerexitreason']=_0xf30c('0xa0')+_0x146c4d[_0xf30c('0x92')][_0xf30c('0xa1')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x470d25[_0xf30c('0x4b')],_0x470d25['type'],_0x470d25[_0xf30c('0x89')]);}}}this['channels'][_0x146c4d[_0xf30c('0x4e')]]=_0x470d25;this[_0xf30c('0x45')](_0x470d25,_0xf30c('0xa2'));}}}catch(_0x4601ac){logger[_0xf30c('0x42')](_0xf30c('0x8c'),_0x146c4d[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0x4601ac,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf30c('0x35')][_0xf30c('0x21')]=function(_0xce0b03){try{if(this[_0xf30c('0x5f')](_0xce0b03)){logger[_0xf30c('0x47')](_0xf30c('0xa3'),_0xce0b03[_0xf30c('0x4e')],util['inspect'](_0xce0b03,{'showHidden':![],'depth':null}));this[_0xf30c('0xa4')](_0xce0b03[_0xf30c('0x4e')],_['keys'](_0xce0b03[_0xf30c('0xa5')])[0x0],_0xce0b03[_0xf30c('0xa6')]);if(this['queueReports'][_0xce0b03['uniqueid']]){var _0x516932=_['last'](this[_0xf30c('0x10')][_0xce0b03[_0xf30c('0x4e')]]);if(_0x516932){if(this[_0xf30c('0x5f')](_0xce0b03[_0xf30c('0xa5')])&&this[_0xf30c('0x5f')](_0xce0b03[_0xf30c('0xa5')][_0xf30c('0xa7')])){switch(_0xce0b03[_0xf30c('0xa6')]){case _0xf30c('0xa8'):_0x516932['queuecallerexit']=![];_0x516932['queuecallerexitAt']=null;break;case _0xf30c('0xa9'):_0x516932[_0xf30c('0xaa')]=_0xf30c('0xab');_0x516932[_0xf30c('0x90')]=!![];_0x516932[_0xf30c('0xac')]=moment()[_0xf30c('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x516932[_0xf30c('0x84')]=moment()[_0xf30c('0x4f')](_0xf30c('0x80'));logger[_0xf30c('0x47')](_0xf30c('0xad'),_0xce0b03[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0x516932,{'showHidden':![],'depth':null}));ami[_0xf30c('0x46')]('custom:timeout',_0x516932);break;default:_0x516932[_0xf30c('0x90')]=!![];_0x516932[_0xf30c('0xac')]=moment()['format'](_0xf30c('0x80'));_0x516932[_0xf30c('0x84')]=moment()[_0xf30c('0x4f')](_0xf30c('0x80'));}_0x516932[_0xf30c('0x1b')]=![];_0x516932[_0xf30c('0x7f')]=null;_0x516932[_0xf30c('0x89')]=_0xce0b03[_0xf30c('0xa6')];this['channels'][_0xce0b03[_0xf30c('0x4e')]]=_0x516932;this[_0xf30c('0x45')](_0x516932,_0xf30c('0x20'));}else if(this[_0xf30c('0x5f')](_0xce0b03['variable'])&&this[_0xf30c('0x5f')](_0xce0b03['variable'][_0xf30c('0xae')])){if(!_0x516932['queuecallerabandon']){_0x516932[_0xf30c('0x90')]=!![];_0x516932[_0xf30c('0xac')]=moment()[_0xf30c('0x4f')](_0xf30c('0x80'));_0x516932[_0xf30c('0x89')]=_0xf30c('0xaf');_0x516932[_0xf30c('0x84')]=moment()[_0xf30c('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0xce0b03[_0xf30c('0x4e')]]=_0x516932;}}logger[_0xf30c('0x72')](_0xf30c('0xb0'),_0xce0b03['uniqueid'],_0x516932[_0xf30c('0x4b')],_0x516932['type'],_['keys'](_0xce0b03[_0xf30c('0xa5')])[0x0],_0xce0b03[_0xf30c('0xa6')]);_0x516932[_0xf30c('0x41')]=this[_0xf30c('0x41')][_0xce0b03[_0xf30c('0x4e')]];}}}}catch(_0x3c5dea){logger[_0xf30c('0x42')](_0xf30c('0xa3'),_0xce0b03[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0x3c5dea,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf30c('0xa4')]=function(_0x45e8de,_0x1280f3,_0x2c7808){var _0x1d77d3=[_0xf30c('0xb1'),_0xf30c('0xb2'),_0xf30c('0xb3'),_0xf30c('0xb4'),_0xf30c('0xb5'),_0xf30c('0xb6'),_0xf30c('0xb7'),_0xf30c('0xb8'),_0xf30c('0xb9'),_0xf30c('0xba'),_0xf30c('0xbb'),_0xf30c('0xbc'),_0xf30c('0xbd'),_0xf30c('0xbe'),_0xf30c('0xbf'),_0xf30c('0xc0'),_0xf30c('0x8f'),'memberpenalty','memberrealtime'];if(!_['isNil'](_0x1280f3)&&!_[_0xf30c('0xc1')](_0x1d77d3,_0x1280f3)){if(_[_0xf30c('0x60')](this[_0xf30c('0x41')][_0x45e8de])){this[_0xf30c('0x41')][_0x45e8de]={};}this['variables'][_0x45e8de][_0x1280f3]=_0x2c7808;}};VoiceQueueReport[_0xf30c('0x35')][_0xf30c('0xc2')]=function(_0xf5100a){try{if(this['isNotNull'](_0xf5100a)){logger[_0xf30c('0x47')](_0xf30c('0xc3'),_0xf5100a[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0xf5100a,{'showHidden':![],'depth':null}));if(this[_0xf30c('0x10')][_0xf5100a[_0xf30c('0x4e')]]){for(var _0x436875=0x0,_0x294974={};_0x436875<this[_0xf30c('0x10')][_0xf5100a[_0xf30c('0x4e')]][_0xf30c('0xc4')];_0x436875+=0x1){_0x294974=this[_0xf30c('0x10')][_0xf5100a[_0xf30c('0x4e')]][_0x436875];if(this[_0xf30c('0x13')][_0x294974[_0xf30c('0x67')]]){if(_0x294974[_0xf30c('0x90')]&&_0x294974[_0xf30c('0x89')]!=='BLINDTRANSFER'){this[_0xf30c('0x13')][_0x294974['queue']]['unmanaged']+=0x1;}if(_0x294974[_0xf30c('0x1b')]){this['voiceQueues'][_0x294974[_0xf30c('0x67')]]['abandoned']+=0x1;}this[_0xf30c('0x13')][_0x294974['queue']][_0xf30c('0x58')]+=moment(_0x294974[_0xf30c('0x84')])[_0xf30c('0xc5')](_0x294974[_0xf30c('0x6f')],_0xf30c('0x9a'))||0x0;if(_0x436875===this[_0xf30c('0x10')][_0xf5100a[_0xf30c('0x4e')]]['length']-0x1){this[_0xf30c('0x13')][_0x294974[_0xf30c('0x67')]][_0xf30c('0x57')]+=moment()[_0xf30c('0xc6')](0x0)[_0xf30c('0xc5')](_0x294974[_0xf30c('0x6f')],_0xf30c('0x9a'));this[_0xf30c('0x13')][_0x294974[_0xf30c('0x67')]][_0xf30c('0xc7')]+=0x1;if(_0x294974[_0xf30c('0x88')]){this['voiceQueues'][_0x294974[_0xf30c('0x67')]][_0xf30c('0xc8')]+=0x1;this['voiceQueues'][_0x294974[_0xf30c('0x67')]][_0xf30c('0x56')]+=moment()['milliseconds'](0x0)[_0xf30c('0xc5')](_0x294974[_0xf30c('0x84')],'seconds');_0x294974[_0xf30c('0x7c')]=moment()[_0xf30c('0x4f')]('YYYY-MM-DD\x20HH:mm:ss');_0x294974[_0xf30c('0x90')]=![];_0x294974['queuecallerexitAt']=null;}if(_0x294974[_0xf30c('0x90')]&&_0x294974[_0xf30c('0x89')]!==_0xf30c('0xc9')){_0x294974['lastevent']='unmanaged';logger['debug'](_0xf30c('0xca'),_0xf5100a[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0x294974,{'showHidden':![],'depth':null}));ami[_0xf30c('0x46')](_0xf30c('0xcb'),_0x294974);}if(_0x294974[_0xf30c('0x1b')]){_0x294974[_0xf30c('0xaa')]=_0xf30c('0x5a');logger[_0xf30c('0x47')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0xf5100a[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0x294974,{'showHidden':![],'depth':null}));ami[_0xf30c('0x46')](_0xf30c('0xcc'),_0x294974);}}else{this[_0xf30c('0x13')][_0x294974[_0xf30c('0x67')]][_0xf30c('0x57')]+=this[_0xf30c('0x13')][_0x294974['queue']][_0xf30c('0x58')];}logger[_0xf30c('0x72')](_0xf30c('0xcd'),_0xf5100a[_0xf30c('0x4e')],_0x294974[_0xf30c('0x4b')],_0x294974[_0xf30c('0x52')],_0xf5100a[_0xf30c('0xce')]);this[_0xf30c('0x37')][_0xf5100a[_0xf30c('0x4e')]]=_0x294974;this['emitVoiceQueueChannelRemove'](_0x294974,_0xf30c('0x22'));this[_0xf30c('0x51')](this[_0xf30c('0x13')][_0x294974[_0xf30c('0x67')]],'hangup');}}logger['debug'](_0xf30c('0xcf'),_0xf5100a['uniqueid'],util['inspect'](this[_0xf30c('0x10')][_0xf5100a[_0xf30c('0x4e')]],{'showHidden':![],'depth':null}));ami[_0xf30c('0x46')](_0xf30c('0xd0'),this[_0xf30c('0x10')][_0xf5100a[_0xf30c('0x4e')]]);delete this[_0xf30c('0x10')][_0xf5100a[_0xf30c('0x4e')]];delete this['channels'][_0xf5100a[_0xf30c('0x4e')]];}if(this[_0xf30c('0x41')][_0xf5100a['uniqueid']]){delete this[_0xf30c('0x41')][_0xf5100a['uniqueid']];}}}catch(_0xf511ee){logger['error'](_0xf30c('0xc3'),_0xf5100a[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0xf511ee,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf30c('0x29')]=function(_0x54085c){try{if(this[_0xf30c('0x5f')](_0x54085c)){logger[_0xf30c('0x47')](_0xf30c('0xd1'),_0x54085c['uniqueid'],util['inspect'](_0x54085c,{'showHidden':![],'depth':null}));var _0x42b47c;if(this[_0xf30c('0x10')][_0x54085c[_0xf30c('0xd2')]]){_0x42b47c=_[_0xf30c('0x7b')](this[_0xf30c('0x10')][_0x54085c['transfereeuniqueid']]);_0x42b47c[_0xf30c('0x9d')]=_0x54085c[_0xf30c('0xd3')];_0x42b47c['transferuniqueid']=_0x54085c[_0xf30c('0xd4')];_0x42b47c[_0xf30c('0x89')]=_0xf30c('0xd5');_0x42b47c[_0xf30c('0x91')]=!![];_0x42b47c[_0xf30c('0x9b')]=_0xf30c('0xd6');if(this[_0xf30c('0x10')][_0x54085c[_0xf30c('0xd4')]]){var _0x3ec36e=this[_0xf30c('0x10')][_0x54085c[_0xf30c('0xd4')]];this[_0xf30c('0x10')][_0x54085c[_0xf30c('0xd4')]]=this['queueReports'][_0x54085c['transfereeuniqueid']];this['queueReports'][_0x54085c['transfereeuniqueid']]=_0x3ec36e;var _0x3a56d6=_['last'](this[_0xf30c('0x10')][_0x54085c[_0xf30c('0xd2')]]);_0x3a56d6[_0xf30c('0x38')]=!![];}logger[_0xf30c('0x72')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x54085c[_0xf30c('0x4e')],_0x42b47c[_0xf30c('0x4b')],_0x42b47c[_0xf30c('0x52')],_0x42b47c['transferexten'],_0x42b47c['transferuniqueid']);}else if(this[_0xf30c('0x10')][_0x54085c[_0xf30c('0xd7')]]){_0x42b47c=_[_0xf30c('0x7b')](this[_0xf30c('0x10')][_0x54085c[_0xf30c('0xd7')]]);_0x42b47c[_0xf30c('0x9d')]=_0x54085c[_0xf30c('0xd8')];_0x42b47c['transferuniqueid']=_0x54085c['origtransfereruniqueid'];_0x42b47c[_0xf30c('0x89')]=_0xf30c('0xd5');_0x42b47c[_0xf30c('0x91')]=!![];_0x42b47c[_0xf30c('0x9b')]=_0xf30c('0xd6');if(this['queueReports'][_0x54085c[_0xf30c('0xd9')]]){var _0x3ec36e=this[_0xf30c('0x10')][_0x54085c[_0xf30c('0xd9')]];this[_0xf30c('0x10')][_0x54085c[_0xf30c('0xd9')]]=this['queueReports'][_0x54085c[_0xf30c('0xd7')]];this[_0xf30c('0x10')][_0x54085c['transfertargetuniqueid']]=_0x3ec36e;var _0x3a56d6=_[_0xf30c('0x7b')](this['queueReports'][_0x54085c[_0xf30c('0xd7')]]);_0x3a56d6[_0xf30c('0x38')]=!![];}logger[_0xf30c('0x72')](_0xf30c('0xda'),_0x54085c['uniqueid'],_0x42b47c[_0xf30c('0x4b')],_0x42b47c[_0xf30c('0x52')],_0x42b47c[_0xf30c('0x9d')],_0x42b47c[_0xf30c('0x9f')]);}}}catch(_0x44264e){logger[_0xf30c('0x42')](_0xf30c('0xd1'),_0x54085c[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0x44264e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf30c('0x35')]['syncBlindTransfer']=function(_0x1979a2){try{if(this['isNotNull'](_0x1979a2)){logger[_0xf30c('0x47')](_0xf30c('0xdb'),_0x1979a2[_0xf30c('0x4e')],util[_0xf30c('0x3f')](_0x1979a2,{'showHidden':![],'depth':null}));if(this[_0xf30c('0x10')][_0x1979a2[_0xf30c('0xd2')]]){var _0x2ca04f=_[_0xf30c('0x7b')](this[_0xf30c('0x10')][_0x1979a2['transfereeuniqueid']]);_0x2ca04f['queuecallerexitreason']='BLINDTRANSFER';_0x2ca04f[_0xf30c('0x91')]=!![];_0x2ca04f[_0xf30c('0x9b')]=_0xf30c('0xdc');_0x2ca04f[_0xf30c('0x9d')]=_0x1979a2[_0xf30c('0xdd')];_0x2ca04f['transferuniqueid']=_0x1979a2[_0xf30c('0xd2')];logger['info']('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x1979a2[_0xf30c('0x4e')],_0x2ca04f[_0xf30c('0x4b')],_0x2ca04f[_0xf30c('0x52')],_0x2ca04f[_0xf30c('0x9d')],_0x2ca04f[_0xf30c('0x9f')]);this[_0xf30c('0xc2')]({'event':_0xf30c('0xde'),'uniqueid':_0x1979a2[_0xf30c('0xd2')],'context':_0x1979a2[_0xf30c('0xdf')],'channel':_0x1979a2[_0xf30c('0xe0')]});}}}catch(_0x21582f){logger['error'](_0xf30c('0xdb'),_0x1979a2['uniqueid'],util['inspect'](_0x21582f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf30c('0x25')]=function(_0xa84334){try{if(this[_0xf30c('0x5f')](_0xa84334)){logger[_0xf30c('0x47')]('[%s][voiceQueueReport][musiconholdstart]',_0xa84334['uniqueid'],util[_0xf30c('0x3f')](_0xa84334,{'showHidden':![],'depth':null}));if(this[_0xf30c('0x10')][_0xa84334[_0xf30c('0x4e')]]){var _0x51d262=_[_0xf30c('0x7b')](this[_0xf30c('0x10')][_0xa84334[_0xf30c('0x4e')]]);if(!_['isNil'](_0x51d262['queuecallerleaveAt'])){_0x51d262[_0xf30c('0xe1')]=moment()['format'](_0xf30c('0x80'));logger[_0xf30c('0x72')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0xa84334[_0xf30c('0x4e')],_0x51d262['mohstarttime']);}}}}catch(_0x5f1bbe){logger[_0xf30c('0x42')](_0xf30c('0xe2'),_0xa84334['uniqueid'],util[_0xf30c('0x3f')](_0x5f1bbe,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf30c('0x27')]=function(_0x3e0354){try{if(this[_0xf30c('0x5f')](_0x3e0354)){logger[_0xf30c('0x47')](_0xf30c('0xe3'),_0x3e0354[_0xf30c('0x4e')],util['inspect'](_0x3e0354,{'showHidden':![],'depth':null}));if(this[_0xf30c('0x10')][_0x3e0354['uniqueid']]){var _0x4ad023=_['last'](this['queueReports'][_0x3e0354[_0xf30c('0x4e')]]);if(!_[_0xf30c('0xe4')](_0x4ad023[_0xf30c('0xe1')])){_0x4ad023[_0xf30c('0xe5')]+=moment()[_0xf30c('0xc6')](0x0)[_0xf30c('0xc5')](_0x4ad023[_0xf30c('0xe1')],_0xf30c('0x9a'));logger['info'](_0xf30c('0xe6'),_0x3e0354[_0xf30c('0x4e')],_0x4ad023[_0xf30c('0xe5')]);delete _0x4ad023[_0xf30c('0xe1')];}}}}catch(_0x35b4b4){logger[_0xf30c('0x42')]('[%s][voiceQueueReport][musiconholdstop]',_0x3e0354['uniqueid'],util[_0xf30c('0x3f')](_0x35b4b4,{'showHidden':![],'depth':null}));}};module[_0xf30c('0xe7')]=VoiceQueueReport;