Built motion from commit (unavailable).|2.5.19
[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 _0xadf9=['includes','[%s][voiceQueueReport][hangup]','length','unmanaged','milliseconds','diff','sumBillable','queuecallercompleteAt','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','transfereeuniqueid','ATTENDEDTRANSFER','transfertype','ATTENDED','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][blindtransfer]','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','isNil','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','exports','lodash','moment','util','md5','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype','enqueue','tail','sequence','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','pTalking','waiting','unlockRR','clearZombieChannels','channels','switch','Action','status','channel','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','variables','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','name',']\x20sending\x20voice_queue_channel:remove\x20event:','voice:queue:%s','type','inbound','answered','loggedIn','sumDuration','talking','total','abandoned','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','loopQueueShow','queues','catch','then','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','toNumber','callers','loggedin','available','emitVoiceQueueSummary','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','queuecallerjoin','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','originalposition','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','emitVoiceQueueChannelRemove','syncQueueCallerLeave','queuecallerleaveAt','connectedlinenum','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][queuecallerleave]','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','queuecallerexitreason','COMPLETEDBYAGENT','queuecallerabandonAt','queuecallerexitAt','transfer','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','linkedid','queuecallerexit','add','seconds','FORWARDTRANSFER','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','variable','queuestatus','value','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xadf9,0x10b));var _0x9adf=function(_0x41ea62,_0x50e50d){_0x41ea62=_0x41ea62-0x0;var _0x35b5dd=_0xadf9[_0x41ea62];return _0x35b5dd;};'use strict';var _=require(_0x9adf('0x0'));var moment=require(_0x9adf('0x1'));var util=require(_0x9adf('0x2'));var md5=require(_0x9adf('0x3'));var Redis=require('ioredis');var config=require(_0x9adf('0x4'));var logger=require(_0x9adf('0x5'))(_0x9adf('0x6'));var ami=require(_0x9adf('0x7'));var QueueReport=require(_0x9adf('0x8'));config[_0x9adf('0x9')]=_[_0x9adf('0xa')](config[_0x9adf('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x9adf('0xb'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x9adf('0xc')][_0x9adf('0xd')]=function(_0x18c41a){this[_0x9adf('0xe')]=this[_0x9adf('0xe')]?this[_0x9adf('0xe')]['finally'](_0x18c41a):_0x18c41a();};function VoiceQueueReport(_0x28f9f5){this[_0x9adf('0xf')]=new Sequence();this['queueReports']={};this[_0x9adf('0x10')]=_0x28f9f5[_0x9adf('0x10')];this['channels']=_0x28f9f5[_0x9adf('0x11')];this['voiceQueues']=_0x28f9f5[_0x9adf('0x12')];this[_0x9adf('0x13')]=!![];this[_0x9adf('0x14')]=_0x28f9f5[_0x9adf('0x14')];this['variables']={};ami['on'](_0x9adf('0x15'),this[_0x9adf('0x16')][_0x9adf('0x17')](this));ami['on'](_0x9adf('0x18'),this[_0x9adf('0x19')][_0x9adf('0x17')](this));ami['on']('queuecallerjoin',this['syncQueueCallerJoin'][_0x9adf('0x17')](this));ami['on'](_0x9adf('0x1a'),this[_0x9adf('0x1b')][_0x9adf('0x17')](this));ami['on'](_0x9adf('0x1c'),this['syncQueueCallerLeave'][_0x9adf('0x17')](this));ami['on'](_0x9adf('0x1d'),this[_0x9adf('0x1e')]['bind'](this));ami['on'](_0x9adf('0x1f'),this['syncAgentConnect'][_0x9adf('0x17')](this));ami['on'](_0x9adf('0x20'),this[_0x9adf('0x21')][_0x9adf('0x17')](this));ami['on'](_0x9adf('0x22'),this[_0x9adf('0x23')][_0x9adf('0x17')](this));ami['on'](_0x9adf('0x24'),this[_0x9adf('0x25')][_0x9adf('0x17')](this));ami['on'](_0x9adf('0x26'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x9adf('0x27'),this[_0x9adf('0x28')][_0x9adf('0x17')](this));ami['on'](_0x9adf('0x29'),this[_0x9adf('0x2a')][_0x9adf('0x17')](this));ami['on'](_0x9adf('0x2b'),this[_0x9adf('0x2c')][_0x9adf('0x17')](this));this[_0x9adf('0x2d')]();this['loopQueueShow']();}function clearChannels(_0x3cfcfa){if(!_[_0x9adf('0x2e')](_0x3cfcfa)){for(var _0x341d1b in _0x3cfcfa){if(_0x3cfcfa[_0x9adf('0x2f')](_0x341d1b)){delete _0x3cfcfa[_0x341d1b];}}}}function clearCampaigns(_0x3912b3){if(!_[_0x9adf('0x2e')](_0x3912b3)){for(var _0x1ebf3f in _0x3912b3){if(_0x3912b3['hasOwnProperty'](_0x1ebf3f)){_0x3912b3[_0x1ebf3f][_0x9adf('0x30')]=0x0;}}}}function clearVoiceQueues(_0xffee63){if(!_[_0x9adf('0x2e')](_0xffee63)){for(var _0x33030b in _0xffee63){if(_0xffee63[_0x9adf('0x2f')](_0x33030b)){_0xffee63[_0x33030b]['originated']=0x0;_0xffee63[_0x33030b]['talking']=0x0;_0xffee63[_0x33030b][_0x9adf('0x31')]=0x0;_0xffee63[_0x33030b][_0x9adf('0x32')]=0x0;_0xffee63[_0x33030b]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x10bf5c){if(!_[_0x9adf('0x2e')](_0x10bf5c)){for(var _0x4beb8b in _0x10bf5c){if(_0x10bf5c[_0x9adf('0x2f')](_0x4beb8b)){_0x10bf5c[_0x4beb8b][_0x9adf('0x33')]=!![];}}}}VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x34')]=function(){var _0x326f91=this;for(var _0x36b894 in this[_0x9adf('0x35')]){if(this[_0x9adf('0x35')][_0x9adf('0x2f')](_0x36b894)&&!this[_0x9adf('0x35')][_0x36b894][_0x9adf('0x36')]){this['sequence'][_0x9adf('0xd')](function(){if(!_['isNil'](_0x326f91['channels'][_0x36b894])){return ami[_0x9adf('0x37')]({'action':_0x9adf('0x38'),'channel':_0x326f91[_0x9adf('0x35')][_0x36b894][_0x9adf('0x39')]})['catch'](function(_0x476d60){if(_0x476d60[_0x9adf('0x3a')]===_0x9adf('0x3b')){setTimeout(function(){if(_0x326f91[_0x9adf('0x35')][_0x36b894]){delete _0x326f91['channels'][_0x36b894];logger[_0x9adf('0x3c')](_0x9adf('0x3d'),_0x36b894,util[_0x9adf('0x3e')](_0x476d60,{'showHidden':![],'depth':null}));}if(_0x326f91[_0x9adf('0x3f')][_0x36b894]){delete _0x326f91['queueReports'][_0x36b894];logger['error'](_0x9adf('0x40'),_0x36b894,util[_0x9adf('0x3e')](_0x476d60,{'showHidden':![],'depth':null}));}if(_0x326f91[_0x9adf('0x41')][_0x36b894]){delete _0x326f91['variables'][_0x36b894];logger[_0x9adf('0x3c')](_0x9adf('0x42'),_0x36b894,util[_0x9adf('0x3e')](_0x476d60,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x25')]=function(){logger[_0x9adf('0x3c')](_0x9adf('0x43'));clearChannels(this[_0x9adf('0x35')]);this[_0x9adf('0x44')](this[_0x9adf('0x3f')]);clearAgentBooked(this[_0x9adf('0x10')]);clearVoiceQueues(this[_0x9adf('0x12')]);clearCampaigns(this[_0x9adf('0x14')]);};VoiceQueueReport['prototype'][_0x9adf('0x44')]=function(_0x5ace7d){var _0x3ba508=this;if(!_[_0x9adf('0x2e')](_0x5ace7d)){for(var _0x1d5f69 in _0x5ace7d){if(_0x5ace7d[_0x9adf('0x2f')](_0x1d5f69)){_0x3ba508['emitVoiceQueueChannelRemove'](_0x5ace7d[_0x1d5f69],_0x9adf('0x45'));delete _0x5ace7d[_0x1d5f69];}}}};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x46')]=function(_0x3249f9,_0x5365e4,_0x16132e){io['to'](_0x3249f9)[_0x9adf('0x46')](_0x5365e4,_0x16132e);};VoiceQueueReport['prototype'][_0x9adf('0x47')]=function(_0x5c715b,_0x33c315){logger[_0x9adf('0x48')](_0x9adf('0x49')+_0x33c315+_0x9adf('0x4a'),_0x5c715b[_0x9adf('0x4b')],util['inspect'](_0x5c715b,{'showHidden':![],'depth':null}));this['emit'](util[_0x9adf('0x4c')]('voice:queue:%s',_0x5c715b[_0x9adf('0x4d')]),'voice_queue_channel:save',_0x5c715b);};VoiceQueueReport[_0x9adf('0xc')]['emitVoiceQueueChannelRemove']=function(_0xcec0ec,_0x41747d){logger['debug'](_0x9adf('0x49')+_0x41747d+_0x9adf('0x4e'),_0xcec0ec[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0xcec0ec,{'showHidden':![],'depth':null}));this[_0x9adf('0x46')](util[_0x9adf('0x4c')](_0x9adf('0x4f'),_0xcec0ec[_0x9adf('0x4d')]),'voice_queue_channel:remove',_0xcec0ec);};VoiceQueueReport[_0x9adf('0xc')]['emitVoiceQueueSummary']=function(_0x15edac,_0x346d85){if(_0x15edac[_0x9adf('0x50')]===_0x9adf('0x51')){var _0x3f59f4={'id':_0x15edac['id'],'name':_0x15edac[_0x9adf('0x4d')],'strategy':_0x15edac['strategy'],'answered':_0x15edac[_0x9adf('0x52')],'available':_0x15edac['available'],'loggedIn':_0x15edac[_0x9adf('0x53')],'pTalking':_0x15edac['pTalking'],'sumBillable':_0x15edac['sumBillable'],'sumDuration':_0x15edac[_0x9adf('0x54')],'sumHoldTime':_0x15edac['sumHoldTime']||0x0,'talking':_0x15edac[_0x9adf('0x55')],'total':_0x15edac[_0x9adf('0x56')],'type':_0x15edac[_0x9adf('0x50')],'unmanaged':_0x15edac['unmanaged'],'abandoned':_0x15edac[_0x9adf('0x57')],'waiting':_0x15edac[_0x9adf('0x32')]};if(_0x15edac[_0x9adf('0x58')]){_0x3f59f4['Trunk']={'id':_0x15edac['Trunk']['id'],'name':_0x15edac['Trunk']['name'],'active':_0x15edac['Trunk'][_0x9adf('0x59')],'callerid':_0x15edac['Trunk'][_0x9adf('0x5a')]};}if(_0x15edac[_0x9adf('0x5b')]){_0x3f59f4[_0x9adf('0x5b')]={'id':_0x15edac['Interval']['id'],'name':_0x15edac[_0x9adf('0x5b')][_0x9adf('0x4d')]};}var _0x429430=md5(JSON[_0x9adf('0x5c')](_0x3f59f4));if(_0x15edac[_0x9adf('0x3')]!==_0x429430){_0x15edac['md5']=_0x429430;logger[_0x9adf('0x48')](_0x9adf('0x5d')+_0x346d85+_0x9adf('0x5e'),util['inspect'](_0x3f59f4,{'showHidden':![],'depth':null}));this[_0x9adf('0x46')](util[_0x9adf('0x4c')](_0x9adf('0x4f'),_0x3f59f4['name']),_0x9adf('0x5f'),_0x3f59f4);}}};VoiceQueueReport[_0x9adf('0xc')]['isNotNull']=function(_0xebddbb){return _0xebddbb!==null&&!_[_0x9adf('0x60')](_0xebddbb);};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x61')]=function(){var _0x1a1bf0=this;setInterval(function(){_0x1a1bf0[_0x9adf('0x34')]();ami[_0x9adf('0x37')]({'action':_0x9adf('0x62')})[_0x9adf('0x63')](function(_0x2a21a1){logger[_0x9adf('0x3c')]('[voiceQueueReport][queues]',util[_0x9adf('0x3e')](_0x2a21a1,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x2d')]=function(){var _0x290efc=this;setInterval(function(){if(_0x290efc['flagQueueSummary']){return ami['Action']({'action':'queuesummary'})[_0x9adf('0x64')](function(_0x154747){_0x290efc[_0x9adf('0x13')]=![];})[_0x9adf('0x63')](function(_0x384f4c){logger[_0x9adf('0x3c')](_0x9adf('0x65'),util[_0x9adf('0x3e')](_0x384f4c,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x16')]=function(_0x4f2ba7){try{if(this[_0x9adf('0x66')](_0x4f2ba7)&&this[_0x9adf('0x66')](_0x4f2ba7[_0x9adf('0x67')])){logger['debug'](_0x9adf('0x68'),util[_0x9adf('0x3e')](_0x4f2ba7,{'showHidden':![],'depth':null}));if(this[_0x9adf('0x12')][_0x4f2ba7[_0x9adf('0x67')]]){logger[_0x9adf('0x69')](_0x9adf('0x6a'),_0x4f2ba7[_0x9adf('0x67')]);var _0x17dc88=_[_0x9adf('0x6b')](this[_0x9adf('0x35')],_0x9adf('0x67'))[_0x4f2ba7['queue']]||0x0;var _0x4cde2f=_0x17dc88-_0x4f2ba7['callers'];if(this[_0x9adf('0x12')][_0x4f2ba7['queue']][_0x9adf('0x32')]!==_[_0x9adf('0x6c')](_0x4f2ba7[_0x9adf('0x6d')])||this[_0x9adf('0x12')][_0x4f2ba7['queue']][_0x9adf('0x53')]!==_[_0x9adf('0x6c')](_0x4f2ba7[_0x9adf('0x6e')])||this[_0x9adf('0x12')][_0x4f2ba7[_0x9adf('0x67')]][_0x9adf('0x6f')]!==_['toNumber'](_0x4f2ba7[_0x9adf('0x6f')])||this[_0x9adf('0x12')][_0x4f2ba7['queue']]['talking']!==_0x4cde2f){this['voiceQueues'][_0x4f2ba7[_0x9adf('0x67')]][_0x9adf('0x32')]=_['toNumber'](_0x4f2ba7[_0x9adf('0x6d')]);this[_0x9adf('0x12')][_0x4f2ba7[_0x9adf('0x67')]][_0x9adf('0x53')]=_[_0x9adf('0x6c')](_0x4f2ba7[_0x9adf('0x6e')]);this['voiceQueues'][_0x4f2ba7[_0x9adf('0x67')]]['available']=_[_0x9adf('0x6c')](_0x4f2ba7[_0x9adf('0x6f')]);this[_0x9adf('0x12')][_0x4f2ba7['queue']][_0x9adf('0x55')]=_0x4cde2f>0x0?_0x4cde2f:0x0;this[_0x9adf('0x12')][_0x4f2ba7[_0x9adf('0x67')]][_0x9adf('0x55')]=this['voiceQueues'][_0x4f2ba7[_0x9adf('0x67')]][_0x9adf('0x55')]>_[_0x9adf('0x6c')](_0x4f2ba7[_0x9adf('0x6e')])?_[_0x9adf('0x6c')](_0x4f2ba7[_0x9adf('0x6e')]):this[_0x9adf('0x12')][_0x4f2ba7[_0x9adf('0x67')]][_0x9adf('0x55')];this[_0x9adf('0x70')](this[_0x9adf('0x12')][_0x4f2ba7[_0x9adf('0x67')]],_0x9adf('0x15'));}logger[_0x9adf('0x48')](_0x9adf('0x71'),util['inspect'](this[_0x9adf('0x12')][_0x4f2ba7[_0x9adf('0x67')]],{'showHidden':![],'depth':null}));ami[_0x9adf('0x46')](_0x9adf('0x72'),this['voiceQueues'][_0x4f2ba7[_0x9adf('0x67')]]);}}}catch(_0x1b999c){logger['error'](_0x9adf('0x65'),util[_0x9adf('0x3e')](_0x1b999c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x19')]=function(_0x58411c){logger[_0x9adf('0x48')](_0x9adf('0x73'),util[_0x9adf('0x3e')](_0x58411c,{'showHidden':![],'depth':null}));this[_0x9adf('0x13')]=!![];};VoiceQueueReport['prototype'][_0x9adf('0x74')]=function(_0xd326b2){try{if(this[_0x9adf('0x66')](_0xd326b2)){logger[_0x9adf('0x48')](_0x9adf('0x75'),_0xd326b2[_0x9adf('0x4b')],util['inspect'](_0xd326b2,{'showHidden':![],'depth':null}));if(_[_0x9adf('0x60')](this[_0x9adf('0x3f')][_0xd326b2[_0x9adf('0x4b')]])){this[_0x9adf('0x3f')][_0xd326b2[_0x9adf('0x4b')]]=[];this[_0x9adf('0x35')][_0xd326b2[_0x9adf('0x4b')]]={};}var _0x4a1fe1=new QueueReport();_0x4a1fe1[_0x9adf('0x4d')]=_0xd326b2[_0x9adf('0x67')];_0x4a1fe1[_0x9adf('0x50')]=this[_0x9adf('0x12')][_0x4a1fe1[_0x9adf('0x4d')]]&&this[_0x9adf('0x12')][_0x4a1fe1[_0x9adf('0x4d')]][_0x9adf('0x50')]?this[_0x9adf('0x12')][_0x4a1fe1[_0x9adf('0x4d')]]['type']||_0x9adf('0x51'):_0x9adf('0x51');_0x4a1fe1[_0x9adf('0x67')]=_0xd326b2['queue'];_0x4a1fe1[_0x9adf('0x76')]=moment()[_0x9adf('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x4a1fe1[_0x9adf('0x77')]=_0xd326b2['position'];_0x4a1fe1[_0x9adf('0x78')]=_0xd326b2[_0x9adf('0x78')];_0x4a1fe1['uniqueid']=_0xd326b2[_0x9adf('0x4b')];logger[_0x9adf('0x69')](_0x9adf('0x79'),_0x4a1fe1[_0x9adf('0x4d')],_0x4a1fe1['type']);_[_0x9adf('0x7a')](_0x4a1fe1,_[_0x9adf('0x7b')](_0xd326b2,_[_0x9adf('0x7c')](_0x4a1fe1)));this['queueReports'][_0xd326b2[_0x9adf('0x4b')]]['push'](_0x4a1fe1);this[_0x9adf('0x35')][_0xd326b2[_0x9adf('0x4b')]]=_0x4a1fe1;this[_0x9adf('0x47')](_0x4a1fe1,_0x9adf('0x7d'));}}catch(_0x6a8af2){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0xd326b2[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x6a8af2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x1b')]=function(_0x2582fe){try{if(this[_0x9adf('0x66')](_0x2582fe)){logger[_0x9adf('0x48')](_0x9adf('0x7e'),_0x2582fe['uniqueid'],util[_0x9adf('0x3e')](_0x2582fe,{'showHidden':![],'depth':null}));if(this[_0x9adf('0x3f')][_0x2582fe[_0x9adf('0x4b')]]){var _0x250a60=_[_0x9adf('0x7f')](this[_0x9adf('0x3f')][_0x2582fe[_0x9adf('0x4b')]]);_0x250a60[_0x9adf('0x80')]=![];_0x250a60['queuecallercompleteAt']=null;_0x250a60['holdtime']=_0x2582fe[_0x9adf('0x81')];_0x250a60['originalposition']=_0x2582fe[_0x9adf('0x82')];_0x250a60[_0x9adf('0x1a')]=!![];_0x250a60['queuecallerabandonAt']=moment()['format'](_0x9adf('0x83'));_0x250a60['queuecallerexitreason']=_0x9adf('0x84');_0x250a60['lastAssignedTo']=null;logger[_0x9adf('0x69')](_0x9adf('0x85'),_0x250a60[_0x9adf('0x4d')],_0x250a60['type']);this[_0x9adf('0x35')][_0x2582fe['uniqueid']]=_0x250a60;this[_0x9adf('0x86')](_0x250a60,_0x9adf('0x1a'));}}}catch(_0x856eb2){logger[_0x9adf('0x3c')](_0x9adf('0x7e'),_0x2582fe[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x856eb2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x87')]=function(_0x5f1648){try{if(this[_0x9adf('0x66')](_0x5f1648)){logger['debug']('[%s][voiceQueueReport][queuecallerleave]',_0x5f1648[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x5f1648,{'showHidden':![],'depth':null}));if(this[_0x9adf('0x3f')][_0x5f1648[_0x9adf('0x4b')]]){var _0x945bbd=_['last'](this[_0x9adf('0x3f')][_0x5f1648[_0x9adf('0x4b')]]);_0x945bbd[_0x9adf('0x88')]=moment()[_0x9adf('0x4c')](_0x9adf('0x83'));_0x945bbd[_0x9adf('0x89')]=_0x5f1648[_0x9adf('0x89')];_0x945bbd['connectedlinename']=_0x5f1648['connectedlinename'];logger['info'](_0x9adf('0x8a'),_0x945bbd[_0x9adf('0x4d')],_0x945bbd[_0x9adf('0x50')],_0x5f1648['connectedlinenum'],_0x5f1648['connectedlinename']);this[_0x9adf('0x35')][_0x5f1648[_0x9adf('0x4b')]]=_0x945bbd;this['emitVoiceQueueChannelSave'](_0x945bbd,_0x9adf('0x1c'));}}}catch(_0x52bb16){logger['error'](_0x9adf('0x8b'),_0x5f1648[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x52bb16,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x8c')]=function(_0x5997e3){try{if(this[_0x9adf('0x66')](_0x5997e3)){logger[_0x9adf('0x48')](_0x9adf('0x8d'),_0x5997e3[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x5997e3,{'showHidden':![],'depth':null}));if(this[_0x9adf('0x3f')][_0x5997e3['uniqueid']]){var _0x5933d0=_[_0x9adf('0x7f')](this[_0x9adf('0x3f')][_0x5997e3[_0x9adf('0x4b')]]);_0x5933d0['queuecallercomplete']=!![];_0x5933d0[_0x9adf('0x8e')]=_0x9adf('0x8f');logger[_0x9adf('0x69')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x5933d0[_0x9adf('0x4d')],_0x5933d0[_0x9adf('0x50')]);}}}catch(_0x277c2a){logger[_0x9adf('0x3c')](_0x9adf('0x8d'),_0x5997e3[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x277c2a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x1e')]=function(_0x2454a6){try{if(this['isNotNull'](_0x2454a6)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x2454a6[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x2454a6,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2454a6[_0x9adf('0x4b')]]){var _0x71b99=_[_0x9adf('0x7f')](this[_0x9adf('0x3f')][_0x2454a6['uniqueid']]);_0x71b99[_0x9adf('0x1a')]=![];_0x71b99[_0x9adf('0x90')]=null;_0x71b99['assigned']=!![];_0x71b99['lastAssignedTo']=_0x2454a6['membername'];_0x71b99[_0x9adf('0x81')]=_0x2454a6[_0x9adf('0x81')];_0x71b99[_0x9adf('0x80')]=!![];_0x71b99['queuecallerexit']=![];_0x71b99[_0x9adf('0x91')]=null;if(!_0x71b99[_0x9adf('0x92')]){if(_0x2454a6['reason']=='transfer'){_0x71b99[_0x9adf('0x8e')]='COMPLETED';logger[_0x9adf('0x69')](_0x9adf('0x93'),_0x71b99['name'],_0x71b99[_0x9adf('0x50')]);}else{if(_[_0x9adf('0x94')](_0x2454a6[_0x9adf('0x39')][_0x9adf('0x95')](),'local/')){if(this[_0x9adf('0x3f')][_0x2454a6[_0x9adf('0x96')]]){var _0x223351=_[_0x9adf('0x7f')](this[_0x9adf('0x3f')][_0x2454a6['linkedid']]);_0x223351[_0x9adf('0x80')]=![];_0x223351[_0x9adf('0x97')]=!![];_0x223351[_0x9adf('0x91')]=moment(_0x71b99[_0x9adf('0x76')])[_0x9adf('0x98')](_0x2454a6[_0x9adf('0x81')],_0x9adf('0x99'))[_0x9adf('0x4c')](_0x9adf('0x83'));_0x223351[_0x9adf('0x8e')]=_0x9adf('0x9a');_0x223351[_0x9adf('0x92')]=!![];_0x223351['transfertype']=_0x9adf('0x9b');_0x223351[_0x9adf('0x9c')]=_0x2454a6[_0x9adf('0x9d')];_0x223351[_0x9adf('0x9e')]=_0x2454a6[_0x9adf('0x4b')];logger[_0x9adf('0x69')](_0x9adf('0x9f'),_0x223351[_0x9adf('0x4d')],_0x223351[_0x9adf('0x50')]);var _0x1c3815=this['queueReports'][_0x2454a6['linkedid']];this[_0x9adf('0x3f')][_0x2454a6[_0x9adf('0x96')]]=this[_0x9adf('0x3f')][_0x2454a6[_0x9adf('0x4b')]];this['queueReports'][_0x2454a6[_0x9adf('0x4b')]]=_0x1c3815;}}else{_0x71b99['queuecallerexitreason']=_0x9adf('0xa0')+_0x2454a6[_0x9adf('0xa1')][_0x9adf('0xa2')]();logger[_0x9adf('0x69')](_0x9adf('0xa3'),_0x71b99[_0x9adf('0x4d')],_0x71b99['type'],_0x71b99[_0x9adf('0x8e')]);}}}this['channels'][_0x2454a6['uniqueid']]=_0x71b99;this['emitVoiceQueueChannelRemove'](_0x71b99,_0x9adf('0x1d'));}}}catch(_0x39ee8d){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x2454a6[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x39ee8d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x21')]=function(_0x46c81d){try{if(this[_0x9adf('0x66')](_0x46c81d)){logger['debug'](_0x9adf('0xa4'),_0x46c81d['uniqueid'],util[_0x9adf('0x3e')](_0x46c81d,{'showHidden':![],'depth':null}));this['addVariable'](_0x46c81d[_0x9adf('0x4b')],_[_0x9adf('0x7c')](_0x46c81d[_0x9adf('0xa5')])[0x0],_0x46c81d['value']);if(this[_0x9adf('0x3f')][_0x46c81d[_0x9adf('0x4b')]]){var _0x15f639=_[_0x9adf('0x7f')](this[_0x9adf('0x3f')][_0x46c81d['uniqueid']]);if(_0x15f639){if(this[_0x9adf('0x66')](_0x46c81d[_0x9adf('0xa5')])&&this['isNotNull'](_0x46c81d['variable'][_0x9adf('0xa6')])){switch(_0x46c81d[_0x9adf('0xa7')]){case'CONTINUE':_0x15f639[_0x9adf('0x97')]=![];_0x15f639[_0x9adf('0x91')]=null;break;case _0x9adf('0xa8'):_0x15f639[_0x9adf('0xa9')]=_0x9adf('0xaa');_0x15f639['queuecallerexit']=!![];_0x15f639[_0x9adf('0x91')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x15f639[_0x9adf('0x88')]=moment()[_0x9adf('0x4c')](_0x9adf('0x83'));logger[_0x9adf('0x48')](_0x9adf('0xab'),_0x46c81d[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x15f639,{'showHidden':![],'depth':null}));ami['emit'](_0x9adf('0xac'),_0x15f639);break;default:_0x15f639[_0x9adf('0x97')]=!![];_0x15f639['queuecallerexitAt']=moment()[_0x9adf('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');_0x15f639['queuecallerleaveAt']=moment()[_0x9adf('0x4c')](_0x9adf('0x83'));}_0x15f639[_0x9adf('0x1a')]=![];_0x15f639[_0x9adf('0x90')]=null;_0x15f639['queuecallerexitreason']=_0x46c81d[_0x9adf('0xa7')];this['channels'][_0x46c81d[_0x9adf('0x4b')]]=_0x15f639;this[_0x9adf('0x86')](_0x15f639,_0x9adf('0x20'));}else if(this[_0x9adf('0x66')](_0x46c81d[_0x9adf('0xa5')])&&this['isNotNull'](_0x46c81d[_0x9adf('0xa5')][_0x9adf('0xad')])){if(!_0x15f639['queuecallerabandon']){_0x15f639[_0x9adf('0x97')]=!![];_0x15f639['queuecallerexitAt']=moment()[_0x9adf('0x4c')](_0x9adf('0x83'));_0x15f639[_0x9adf('0x8e')]=_0x9adf('0xae');_0x15f639[_0x9adf('0x88')]=moment()[_0x9adf('0x4c')](_0x9adf('0x83'));this['channels'][_0x46c81d['uniqueid']]=_0x15f639;}}logger[_0x9adf('0x69')](_0x9adf('0xaf'),_0x46c81d[_0x9adf('0x4b')],_0x15f639[_0x9adf('0x4d')],_0x15f639[_0x9adf('0x50')],_[_0x9adf('0x7c')](_0x46c81d[_0x9adf('0xa5')])[0x0],_0x46c81d[_0x9adf('0xa7')]);_0x15f639[_0x9adf('0x41')]=this['variables'][_0x46c81d[_0x9adf('0x4b')]];}}}}catch(_0x5883a4){logger[_0x9adf('0x3c')](_0x9adf('0xa4'),_0x46c81d['uniqueid'],util[_0x9adf('0x3e')](_0x5883a4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0xb0')]=function(_0x3e8c71,_0x40b709,_0x330bbc){var _0xe23fd9=[_0x9adf('0xb1'),'rtpaudioqosbridged',_0x9adf('0xb2'),_0x9adf('0xb3'),'rtpaudioqosloss',_0x9adf('0xb4'),_0x9adf('0xb5'),_0x9adf('0xb6'),'sipcallid',_0x9adf('0xb7'),_0x9adf('0xb8'),_0x9adf('0xb9'),_0x9adf('0xba'),_0x9adf('0xbb'),_0x9adf('0xbc'),_0x9adf('0xbd'),_0x9adf('0xbe'),_0x9adf('0xbf'),_0x9adf('0xc0')];if(!_['isNil'](_0x40b709)&&!_[_0x9adf('0xc1')](_0xe23fd9,_0x40b709)){if(_[_0x9adf('0x60')](this['variables'][_0x3e8c71])){this[_0x9adf('0x41')][_0x3e8c71]={};}this[_0x9adf('0x41')][_0x3e8c71][_0x40b709]=_0x330bbc;}};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x23')]=function(_0x29ff48){try{if(this[_0x9adf('0x66')](_0x29ff48)){logger['debug'](_0x9adf('0xc2'),_0x29ff48[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x29ff48,{'showHidden':![],'depth':null}));if(this[_0x9adf('0x3f')][_0x29ff48[_0x9adf('0x4b')]]){for(var _0x511321=0x0,_0x2f1694={};_0x511321<this[_0x9adf('0x3f')][_0x29ff48[_0x9adf('0x4b')]][_0x9adf('0xc3')];_0x511321+=0x1){_0x2f1694=this[_0x9adf('0x3f')][_0x29ff48[_0x9adf('0x4b')]][_0x511321];if(this[_0x9adf('0x12')][_0x2f1694[_0x9adf('0x67')]]){if(_0x2f1694['queuecallerexit']&&_0x2f1694[_0x9adf('0x92')]!=!![]){this[_0x9adf('0x12')][_0x2f1694['queue']][_0x9adf('0xc4')]+=0x1;}if(_0x2f1694[_0x9adf('0x1a')]){this[_0x9adf('0x12')][_0x2f1694[_0x9adf('0x67')]][_0x9adf('0x57')]+=0x1;}this[_0x9adf('0x12')][_0x2f1694[_0x9adf('0x67')]]['sumHoldTime']+=moment(_0x2f1694[_0x9adf('0x88')])['diff'](_0x2f1694['queuecallerjoinAt'],_0x9adf('0x99'))||0x0;if(_0x511321===this[_0x9adf('0x3f')][_0x29ff48[_0x9adf('0x4b')]][_0x9adf('0xc3')]-0x1){this[_0x9adf('0x12')][_0x2f1694[_0x9adf('0x67')]]['sumDuration']+=moment()[_0x9adf('0xc5')](0x0)[_0x9adf('0xc6')](_0x2f1694['queuecallerjoinAt'],_0x9adf('0x99'));this[_0x9adf('0x12')][_0x2f1694['queue']][_0x9adf('0x56')]+=0x1;if(_0x2f1694['queuecallercomplete']){this['voiceQueues'][_0x2f1694[_0x9adf('0x67')]][_0x9adf('0x52')]+=0x1;this[_0x9adf('0x12')][_0x2f1694[_0x9adf('0x67')]][_0x9adf('0xc7')]+=moment()[_0x9adf('0xc5')](0x0)['diff'](_0x2f1694['queuecallerleaveAt'],'seconds');_0x2f1694[_0x9adf('0xc8')]=moment()['format'](_0x9adf('0x83'));_0x2f1694[_0x9adf('0x97')]=![];_0x2f1694[_0x9adf('0x91')]=null;}if(_0x2f1694['queuecallerexit']&&_0x2f1694[_0x9adf('0x92')]!=!![]){_0x2f1694['lastevent']='unmanaged';logger[_0x9adf('0x48')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x29ff48[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x2f1694,{'showHidden':![],'depth':null}));ami[_0x9adf('0x46')]('custom:queuecallerunmanaged',_0x2f1694);}if(_0x2f1694['queuecallerabandon']){_0x2f1694[_0x9adf('0xa9')]='abandoned';logger[_0x9adf('0x48')](_0x9adf('0xc9'),_0x29ff48[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x2f1694,{'showHidden':![],'depth':null}));ami[_0x9adf('0x46')](_0x9adf('0xca'),_0x2f1694);}}else{this['voiceQueues'][_0x2f1694['queue']][_0x9adf('0x54')]+=this[_0x9adf('0x12')][_0x2f1694['queue']]['sumHoldTime'];}logger[_0x9adf('0x69')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x29ff48[_0x9adf('0x4b')],_0x2f1694[_0x9adf('0x4d')],_0x2f1694[_0x9adf('0x50')],_0x29ff48[_0x9adf('0xcb')]);this[_0x9adf('0x35')][_0x29ff48[_0x9adf('0x4b')]]=_0x2f1694;this[_0x9adf('0x86')](_0x2f1694,_0x9adf('0x22'));this[_0x9adf('0x70')](this[_0x9adf('0x12')][_0x2f1694[_0x9adf('0x67')]],_0x9adf('0x22'));}}logger[_0x9adf('0x48')](_0x9adf('0xcc'),_0x29ff48[_0x9adf('0x4b')],util[_0x9adf('0x3e')](this[_0x9adf('0x3f')][_0x29ff48[_0x9adf('0x4b')]],{'showHidden':![],'depth':null}));ami[_0x9adf('0x46')](_0x9adf('0xcd'),this[_0x9adf('0x3f')][_0x29ff48[_0x9adf('0x4b')]]);delete this[_0x9adf('0x3f')][_0x29ff48['uniqueid']];delete this[_0x9adf('0x35')][_0x29ff48[_0x9adf('0x4b')]];}if(this[_0x9adf('0x41')][_0x29ff48[_0x9adf('0x4b')]]){delete this['variables'][_0x29ff48['uniqueid']];}}}catch(_0x2af36e){logger[_0x9adf('0x3c')](_0x9adf('0xc2'),_0x29ff48['uniqueid'],util[_0x9adf('0x3e')](_0x2af36e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x2a')]=function(_0x929240){try{if(this['isNotNull'](_0x929240)){logger[_0x9adf('0x48')]('[%s][voiceQueueReport][attendedtransfer]',_0x929240[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x929240,{'showHidden':![],'depth':null}));var _0xaafc62;if(this[_0x9adf('0x3f')][_0x929240[_0x9adf('0xce')]]){_0xaafc62=_[_0x9adf('0x7f')](this['queueReports'][_0x929240[_0x9adf('0xce')]]);_0xaafc62[_0x9adf('0x9c')]=_0x929240['secondtransfererexten'];_0xaafc62[_0x9adf('0x9e')]=_0x929240['secondtransfereruniqueid'];_0xaafc62[_0x9adf('0x8e')]=_0x9adf('0xcf');_0xaafc62[_0x9adf('0x92')]=!![];_0xaafc62[_0x9adf('0xd0')]=_0x9adf('0xd1');if(this[_0x9adf('0x3f')][_0x929240[_0x9adf('0xd2')]]){var _0x39033b=this['queueReports'][_0x929240[_0x9adf('0xd2')]];this[_0x9adf('0x3f')][_0x929240[_0x9adf('0xd2')]]=this[_0x9adf('0x3f')][_0x929240[_0x9adf('0xce')]];this[_0x9adf('0x3f')][_0x929240['transfereeuniqueid']]=_0x39033b;var _0x3cca57=_[_0x9adf('0x7f')](this[_0x9adf('0x3f')][_0x929240[_0x9adf('0xce')]]);_0x3cca57[_0x9adf('0x36')]=!![];}logger['info']('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x929240[_0x9adf('0x4b')],_0xaafc62[_0x9adf('0x4d')],_0xaafc62[_0x9adf('0x50')],_0xaafc62['transferexten'],_0xaafc62[_0x9adf('0x9e')]);}else if(this[_0x9adf('0x3f')][_0x929240[_0x9adf('0xd3')]]){_0xaafc62=_['last'](this[_0x9adf('0x3f')][_0x929240[_0x9adf('0xd3')]]);_0xaafc62[_0x9adf('0x9c')]=_0x929240[_0x9adf('0xd4')];_0xaafc62[_0x9adf('0x9e')]=_0x929240['origtransfereruniqueid'];_0xaafc62[_0x9adf('0x8e')]='ATTENDEDTRANSFER';_0xaafc62['transfer']=!![];_0xaafc62[_0x9adf('0xd0')]=_0x9adf('0xd1');if(this['queueReports'][_0x929240[_0x9adf('0xd5')]]){var _0x39033b=this[_0x9adf('0x3f')][_0x929240[_0x9adf('0xd5')]];this['queueReports'][_0x929240['origtransfereruniqueid']]=this[_0x9adf('0x3f')][_0x929240[_0x9adf('0xd3')]];this['queueReports'][_0x929240['transfertargetuniqueid']]=_0x39033b;var _0x3cca57=_[_0x9adf('0x7f')](this[_0x9adf('0x3f')][_0x929240[_0x9adf('0xd3')]]);_0x3cca57[_0x9adf('0x36')]=!![];}logger[_0x9adf('0x69')](_0x9adf('0xd6'),_0x929240[_0x9adf('0x4b')],_0xaafc62[_0x9adf('0x4d')],_0xaafc62[_0x9adf('0x50')],_0xaafc62[_0x9adf('0x9c')],_0xaafc62[_0x9adf('0x9e')]);}}}catch(_0xdb4469){logger[_0x9adf('0x3c')]('[%s][voiceQueueReport][attendedtransfer]',_0x929240[_0x9adf('0x4b')],util['inspect'](_0xdb4469,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9adf('0xc')]['syncBlindTransfer']=function(_0x1bd925){try{if(this[_0x9adf('0x66')](_0x1bd925)){logger[_0x9adf('0x48')]('[%s][voiceQueueReport][blindtransfer]',_0x1bd925[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x1bd925,{'showHidden':![],'depth':null}));if(this[_0x9adf('0x3f')][_0x1bd925[_0x9adf('0xce')]]){var _0x6f3e1c=_[_0x9adf('0x7f')](this['queueReports'][_0x1bd925['transfereeuniqueid']]);_0x6f3e1c[_0x9adf('0x8e')]='BLINDTRANSFER';_0x6f3e1c[_0x9adf('0x92')]=!![];_0x6f3e1c['transfertype']='BLIND';_0x6f3e1c['transferexten']=_0x1bd925[_0x9adf('0xd7')];_0x6f3e1c['transferuniqueid']=_0x1bd925[_0x9adf('0xce')];logger[_0x9adf('0x69')](_0x9adf('0xd8'),_0x1bd925[_0x9adf('0x4b')],_0x6f3e1c[_0x9adf('0x4d')],_0x6f3e1c[_0x9adf('0x50')],_0x6f3e1c[_0x9adf('0x9c')],_0x6f3e1c[_0x9adf('0x9e')]);this['syncHangup']({'event':_0x9adf('0xd9'),'uniqueid':_0x1bd925[_0x9adf('0xce')],'context':_0x1bd925[_0x9adf('0xda')],'channel':_0x1bd925[_0x9adf('0xdb')]});}}}catch(_0x2e1478){logger[_0x9adf('0x3c')](_0x9adf('0xdc'),_0x1bd925[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x2e1478,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0xdd')]=function(_0x3a6a2d){try{if(this[_0x9adf('0x66')](_0x3a6a2d)){logger[_0x9adf('0x48')](_0x9adf('0xde'),_0x3a6a2d[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x3a6a2d,{'showHidden':![],'depth':null}));if(this[_0x9adf('0x3f')][_0x3a6a2d[_0x9adf('0x4b')]]){var _0x32a6c9=_['last'](this['queueReports'][_0x3a6a2d['uniqueid']]);if(!_['isNil'](_0x32a6c9['queuecallerleaveAt'])){_0x32a6c9['mohstarttime']=moment()[_0x9adf('0x4c')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x9adf('0x69')](_0x9adf('0xdf'),_0x3a6a2d[_0x9adf('0x4b')],_0x32a6c9[_0x9adf('0xe0')]);}}}}catch(_0x499707){logger['error'](_0x9adf('0xde'),_0x3a6a2d[_0x9adf('0x4b')],util['inspect'](_0x499707,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9adf('0xc')][_0x9adf('0x28')]=function(_0x16b2a2){try{if(this['isNotNull'](_0x16b2a2)){logger[_0x9adf('0x48')]('[%s][voiceQueueReport][musiconholdstop]',_0x16b2a2[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x16b2a2,{'showHidden':![],'depth':null}));if(this[_0x9adf('0x3f')][_0x16b2a2[_0x9adf('0x4b')]]){var _0xec0bbb=_['last'](this[_0x9adf('0x3f')][_0x16b2a2[_0x9adf('0x4b')]]);if(!_[_0x9adf('0xe1')](_0xec0bbb['mohstarttime'])){_0xec0bbb[_0x9adf('0xe2')]+=moment()[_0x9adf('0xc5')](0x0)['diff'](_0xec0bbb['mohstarttime'],_0x9adf('0x99'));logger['info'](_0x9adf('0xe3'),_0x16b2a2[_0x9adf('0x4b')],_0xec0bbb[_0x9adf('0xe2')]);delete _0xec0bbb[_0x9adf('0xe0')];}}}}catch(_0x2ea9b4){logger[_0x9adf('0x3c')](_0x9adf('0xe4'),_0x16b2a2[_0x9adf('0x4b')],util[_0x9adf('0x3e')](_0x2ea9b4,{'showHidden':![],'depth':null}));}};module[_0x9adf('0xe5')]=VoiceQueueReport;