Built motion from commit (unavailable).|2.6.0
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index d15a081..827ff84 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x39cb=['bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','queueStatusComplete','unlockRR','clearZombieChannels','sequence','isNil','Action','status','channel','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','answered','available','sumBillable','total','unmanaged','abandoned','waiting','Trunk','active','callerid','Interval','stringify','md5','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','queues','catch','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedIn','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','local/','linkedid','queuecallerexit','add','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','variable','value','queuestatus','CONTINUE','TIMEOUT','custom:timeout','varset','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','membercalls','memberdynamic','memberlastcall','memberpenalty','includes','[%s][voiceQueueReport][hangup]','length','sumHoldTime','diff','sumDuration','milliseconds','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedtransfer]','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','moment','util','ioredis','../../../config/environment','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete'];(function(_0x2b4834,_0x293d85){var _0xe63e8a=function(_0x3dee20){while(--_0x3dee20){_0x2b4834['push'](_0x2b4834['shift']());}};_0xe63e8a(++_0x293d85);}(_0x39cb,0x1bd));var _0xb39c=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x39cb[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var moment=require(_0xb39c('0x0'));var util=require(_0xb39c('0x1'));var md5=require('md5');var Redis=require(_0xb39c('0x2'));var config=require(_0xb39c('0x3'));var logger=require('../../../config/logger')(_0xb39c('0x4'));var ami=require(_0xb39c('0x5'));var QueueReport=require(_0xb39c('0x6'));config[_0xb39c('0x7')]=_[_0xb39c('0x8')](config['redis'],{'host':_0xb39c('0x9'),'port':0x18eb});var io=require(_0xb39c('0xa'))(new Redis(config[_0xb39c('0x7')]));var Sequence=function(){};Sequence[_0xb39c('0xb')]['enqueue']=function(_0x5ae14a){this[_0xb39c('0xc')]=this[_0xb39c('0xc')]?this[_0xb39c('0xc')][_0xb39c('0xd')](_0x5ae14a):_0x5ae14a();};function VoiceQueueReport(_0x5402b2){this['sequence']=new Sequence();this['queueReports']={};this[_0xb39c('0xe')]=_0x5402b2[_0xb39c('0xe')];this[_0xb39c('0xf')]=_0x5402b2[_0xb39c('0x10')];this[_0xb39c('0x11')]=_0x5402b2[_0xb39c('0x11')];this[_0xb39c('0x12')]=!![];this[_0xb39c('0x13')]=_0x5402b2['campaigns'];this[_0xb39c('0x14')]={};ami['on'](_0xb39c('0x15'),this[_0xb39c('0x16')]['bind'](this));ami['on'](_0xb39c('0x17'),this[_0xb39c('0x18')][_0xb39c('0x19')](this));ami['on'](_0xb39c('0x1a'),this[_0xb39c('0x1b')][_0xb39c('0x19')](this));ami['on'](_0xb39c('0x1c'),this['syncQueueCallerAbandon'][_0xb39c('0x19')](this));ami['on'](_0xb39c('0x1d'),this[_0xb39c('0x1e')][_0xb39c('0x19')](this));ami['on'](_0xb39c('0x1f'),this[_0xb39c('0x20')][_0xb39c('0x19')](this));ami['on'](_0xb39c('0x21'),this[_0xb39c('0x22')][_0xb39c('0x19')](this));ami['on']('varset',this[_0xb39c('0x23')][_0xb39c('0x19')](this));ami['on'](_0xb39c('0x24'),this[_0xb39c('0x25')]['bind'](this));ami['on'](_0xb39c('0x26'),this[_0xb39c('0x27')]['bind'](this));ami['on'](_0xb39c('0x28'),this[_0xb39c('0x29')][_0xb39c('0x19')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0xb39c('0x19')](this));ami['on'](_0xb39c('0x2a'),this[_0xb39c('0x2b')]['bind'](this));ami['on'](_0xb39c('0x2c'),this[_0xb39c('0x2d')][_0xb39c('0x19')](this));this[_0xb39c('0x2e')]();this[_0xb39c('0x2f')]();}function clearChannels(_0x4a32f6){if(!_[_0xb39c('0x30')](_0x4a32f6)){for(var _0xbeab7e in _0x4a32f6){if(_0x4a32f6['hasOwnProperty'](_0xbeab7e)){delete _0x4a32f6[_0xbeab7e];}}}}function clearCampaigns(_0x1fd145){if(!_[_0xb39c('0x30')](_0x1fd145)){for(var _0x39116b in _0x1fd145){if(_0x1fd145[_0xb39c('0x31')](_0x39116b)){_0x1fd145[_0x39116b][_0xb39c('0x32')]=0x0;}}}}function clearVoiceQueues(_0x5453a6){if(!_[_0xb39c('0x30')](_0x5453a6)){for(var _0x299c27 in _0x5453a6){if(_0x5453a6[_0xb39c('0x31')](_0x299c27)){_0x5453a6[_0x299c27]['originated']=0x0;_0x5453a6[_0x299c27][_0xb39c('0x33')]=0x0;_0x5453a6[_0x299c27][_0xb39c('0x34')]=0x0;_0x5453a6[_0x299c27]['waiting']=0x0;_0x5453a6[_0x299c27][_0xb39c('0x35')]=!![];}}}}function clearAgentBooked(_0x4b4458){if(!_[_0xb39c('0x30')](_0x4b4458)){for(var _0x4e9672 in _0x4b4458){if(_0x4b4458[_0xb39c('0x31')](_0x4e9672)){_0x4b4458[_0x4e9672][_0xb39c('0x36')]=!![];}}}}VoiceQueueReport['prototype'][_0xb39c('0x37')]=function(){var _0x501708=this;for(var _0x8e2d7 in this[_0xb39c('0xf')]){if(this[_0xb39c('0xf')][_0xb39c('0x31')](_0x8e2d7)&&!this[_0xb39c('0xf')][_0x8e2d7]['switch']){this[_0xb39c('0x38')]['enqueue'](function(){if(!_[_0xb39c('0x39')](_0x501708['channels'][_0x8e2d7])){return ami[_0xb39c('0x3a')]({'action':_0xb39c('0x3b'),'channel':_0x501708[_0xb39c('0xf')][_0x8e2d7][_0xb39c('0x3c')]})['catch'](function(_0x47f58f){if(_0x47f58f[_0xb39c('0x3d')]===_0xb39c('0x3e')){setTimeout(function(){if(_0x501708['channels'][_0x8e2d7]){delete _0x501708[_0xb39c('0xf')][_0x8e2d7];logger[_0xb39c('0x3f')](_0xb39c('0x40'),_0x8e2d7,util[_0xb39c('0x41')](_0x47f58f,{'showHidden':![],'depth':null}));}if(_0x501708[_0xb39c('0x42')][_0x8e2d7]){delete _0x501708[_0xb39c('0x42')][_0x8e2d7];logger[_0xb39c('0x3f')](_0xb39c('0x43'),_0x8e2d7,util[_0xb39c('0x41')](_0x47f58f,{'showHidden':![],'depth':null}));}if(_0x501708[_0xb39c('0x14')][_0x8e2d7]){delete _0x501708[_0xb39c('0x14')][_0x8e2d7];logger[_0xb39c('0x3f')](_0xb39c('0x44'),_0x8e2d7,util[_0xb39c('0x41')](_0x47f58f,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xb39c('0xb')][_0xb39c('0x27')]=function(){logger[_0xb39c('0x3f')](_0xb39c('0x45'));clearChannels(this[_0xb39c('0xf')]);this['clearQueueReport'](this[_0xb39c('0x42')]);clearAgentBooked(this[_0xb39c('0xe')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this['campaigns']);};VoiceQueueReport['prototype'][_0xb39c('0x46')]=function(_0x33e468){var _0xe6bc2e=this;if(!_['isEmpty'](_0x33e468)){for(var _0x3071dd in _0x33e468){if(_0x33e468[_0xb39c('0x31')](_0x3071dd)){_0xe6bc2e[_0xb39c('0x47')](_0x33e468[_0x3071dd],_0xb39c('0x48'));delete _0x33e468[_0x3071dd];}}}};VoiceQueueReport[_0xb39c('0xb')]['emit']=function(_0x3cdeeb,_0x3000d7,_0x51b489){io['to'](_0x3cdeeb)[_0xb39c('0x49')](_0x3000d7,_0x51b489);};VoiceQueueReport['prototype'][_0xb39c('0x4a')]=function(_0xc6e494,_0x3eaf96){logger['debug'](_0xb39c('0x4b')+_0x3eaf96+_0xb39c('0x4c'),_0xc6e494[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0xc6e494,{'showHidden':![],'depth':null}));this[_0xb39c('0x49')](util[_0xb39c('0x4e')](_0xb39c('0x4f'),_0xc6e494[_0xb39c('0x50')]),_0xb39c('0x51'),_0xc6e494);io[_0xb39c('0x49')](_0xb39c('0x52'),_0xc6e494);};VoiceQueueReport[_0xb39c('0xb')]['emitVoiceQueueChannelRemove']=function(_0x38e8ba,_0xbeb7b3){logger[_0xb39c('0x53')](_0xb39c('0x4b')+_0xbeb7b3+_0xb39c('0x54'),_0x38e8ba[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x38e8ba,{'showHidden':![],'depth':null}));this[_0xb39c('0x49')](util[_0xb39c('0x4e')]('voice:queue:%s',_0x38e8ba['name']),_0xb39c('0x55'),_0x38e8ba);io[_0xb39c('0x49')]('voice_queue_presence:remove',_0x38e8ba);};VoiceQueueReport['prototype'][_0xb39c('0x56')]=function(_0x4dc175,_0x34c223){if(_0x4dc175[_0xb39c('0x57')]===_0xb39c('0x58')){var _0x271867={'id':_0x4dc175['id'],'name':_0x4dc175[_0xb39c('0x50')],'strategy':_0x4dc175['strategy'],'answered':_0x4dc175[_0xb39c('0x59')],'available':_0x4dc175[_0xb39c('0x5a')],'loggedIn':_0x4dc175['loggedIn'],'pTalking':_0x4dc175['pTalking'],'sumBillable':_0x4dc175[_0xb39c('0x5b')],'sumDuration':_0x4dc175['sumDuration'],'sumHoldTime':_0x4dc175['sumHoldTime']||0x0,'talking':_0x4dc175[_0xb39c('0x33')],'total':_0x4dc175[_0xb39c('0x5c')],'type':_0x4dc175[_0xb39c('0x57')],'unmanaged':_0x4dc175[_0xb39c('0x5d')],'abandoned':_0x4dc175[_0xb39c('0x5e')],'waiting':_0x4dc175[_0xb39c('0x5f')]};if(_0x4dc175[_0xb39c('0x60')]){_0x271867[_0xb39c('0x60')]={'id':_0x4dc175[_0xb39c('0x60')]['id'],'name':_0x4dc175[_0xb39c('0x60')]['name'],'active':_0x4dc175[_0xb39c('0x60')][_0xb39c('0x61')],'callerid':_0x4dc175[_0xb39c('0x60')][_0xb39c('0x62')]};}if(_0x4dc175[_0xb39c('0x63')]){_0x271867[_0xb39c('0x63')]={'id':_0x4dc175[_0xb39c('0x63')]['id'],'name':_0x4dc175[_0xb39c('0x63')][_0xb39c('0x50')]};}var _0x1ae2cb=md5(JSON[_0xb39c('0x64')](_0x271867));if(_0x4dc175[_0xb39c('0x65')]!==_0x1ae2cb){_0x4dc175[_0xb39c('0x65')]=_0x1ae2cb;logger[_0xb39c('0x53')](_0xb39c('0x66')+_0x34c223+_0xb39c('0x67'),util['inspect'](_0x271867,{'showHidden':![],'depth':null}));this[_0xb39c('0x49')](util[_0xb39c('0x4e')](_0xb39c('0x4f'),_0x271867[_0xb39c('0x50')]),_0xb39c('0x68'),_0x271867);}}};VoiceQueueReport[_0xb39c('0xb')][_0xb39c('0x69')]=function(_0xc20a16){return _0xc20a16!==null&&!_['isUndefined'](_0xc20a16);};VoiceQueueReport['prototype'][_0xb39c('0x2f')]=function(){var _0x210d2a=this;setInterval(function(){_0x210d2a['clearZombieChannels']();ami['Action']({'action':_0xb39c('0x6a')})[_0xb39c('0x6b')](function(_0x538258){logger[_0xb39c('0x3f')]('[voiceQueueReport][queues]',util['inspect'](_0x538258,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xb39c('0xb')]['loopQueueSummary']=function(){var _0x2c5434=this;setInterval(function(){if(_0x2c5434[_0xb39c('0x12')]){return ami[_0xb39c('0x3a')]({'action':_0xb39c('0x15')})[_0xb39c('0x6c')](function(_0x97f170){_0x2c5434['flagQueueSummary']=![];})[_0xb39c('0x6b')](function(_0x127b60){logger[_0xb39c('0x3f')](_0xb39c('0x6d'),util[_0xb39c('0x41')](_0x127b60,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xb39c('0x16')]=function(_0x4ab58e){try{if(this[_0xb39c('0x69')](_0x4ab58e)&&this[_0xb39c('0x69')](_0x4ab58e[_0xb39c('0x6e')])){logger[_0xb39c('0x53')](_0xb39c('0x6f'),util[_0xb39c('0x41')](_0x4ab58e,{'showHidden':![],'depth':null}));if(this[_0xb39c('0x11')][_0x4ab58e[_0xb39c('0x6e')]]){logger[_0xb39c('0x70')](_0xb39c('0x71'),_0x4ab58e[_0xb39c('0x6e')]);var _0x260fbf=_[_0xb39c('0x72')](this[_0xb39c('0xf')],_0xb39c('0x6e'))[_0x4ab58e[_0xb39c('0x6e')]]||0x0;var _0xc7238e=_0x260fbf-_0x4ab58e[_0xb39c('0x73')];if(this[_0xb39c('0x11')][_0x4ab58e['queue']]['waiting']!==_[_0xb39c('0x74')](_0x4ab58e[_0xb39c('0x73')])||this['voiceQueues'][_0x4ab58e[_0xb39c('0x6e')]][_0xb39c('0x75')]!==_['toNumber'](_0x4ab58e[_0xb39c('0x76')])||this[_0xb39c('0x11')][_0x4ab58e[_0xb39c('0x6e')]][_0xb39c('0x5a')]!==_[_0xb39c('0x74')](_0x4ab58e[_0xb39c('0x5a')])||this['voiceQueues'][_0x4ab58e[_0xb39c('0x6e')]][_0xb39c('0x33')]!==_0xc7238e){this[_0xb39c('0x11')][_0x4ab58e[_0xb39c('0x6e')]][_0xb39c('0x5f')]=_[_0xb39c('0x74')](_0x4ab58e[_0xb39c('0x73')]);this['voiceQueues'][_0x4ab58e[_0xb39c('0x6e')]][_0xb39c('0x75')]=_[_0xb39c('0x74')](_0x4ab58e[_0xb39c('0x76')]);this[_0xb39c('0x11')][_0x4ab58e['queue']]['available']=_[_0xb39c('0x74')](_0x4ab58e[_0xb39c('0x5a')]);this[_0xb39c('0x11')][_0x4ab58e['queue']][_0xb39c('0x33')]=_0xc7238e>0x0?_0xc7238e:0x0;this['voiceQueues'][_0x4ab58e[_0xb39c('0x6e')]]['talking']=this[_0xb39c('0x11')][_0x4ab58e[_0xb39c('0x6e')]][_0xb39c('0x33')]>_['toNumber'](_0x4ab58e[_0xb39c('0x76')])?_[_0xb39c('0x74')](_0x4ab58e[_0xb39c('0x76')]):this[_0xb39c('0x11')][_0x4ab58e[_0xb39c('0x6e')]][_0xb39c('0x33')];this[_0xb39c('0x56')](this[_0xb39c('0x11')][_0x4ab58e[_0xb39c('0x6e')]],_0xb39c('0x15'));}logger[_0xb39c('0x53')](_0xb39c('0x77'),util[_0xb39c('0x41')](this[_0xb39c('0x11')][_0x4ab58e[_0xb39c('0x6e')]],{'showHidden':![],'depth':null}));ami[_0xb39c('0x49')](_0xb39c('0x78'),this['voiceQueues'][_0x4ab58e[_0xb39c('0x6e')]]);}}}catch(_0x2b3f85){logger[_0xb39c('0x3f')]('[voiceQueueReport][queuesummary]',util[_0xb39c('0x41')](_0x2b3f85,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x8d8f59){logger[_0xb39c('0x53')](_0xb39c('0x79'),util[_0xb39c('0x41')](_0x8d8f59,{'showHidden':![],'depth':null}));this[_0xb39c('0x12')]=!![];};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x26d08c){try{if(this[_0xb39c('0x69')](_0x26d08c)){logger['debug'](_0xb39c('0x7a'),_0x26d08c[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x26d08c,{'showHidden':![],'depth':null}));if(_[_0xb39c('0x7b')](this[_0xb39c('0x42')][_0x26d08c[_0xb39c('0x4d')]])){this[_0xb39c('0x42')][_0x26d08c[_0xb39c('0x4d')]]=[];this[_0xb39c('0xf')][_0x26d08c[_0xb39c('0x4d')]]={};}var _0xb5e7fb=new QueueReport();_0xb5e7fb[_0xb39c('0x50')]=_0x26d08c[_0xb39c('0x6e')];_0xb5e7fb[_0xb39c('0x57')]=this[_0xb39c('0x11')][_0xb5e7fb['name']]&&this[_0xb39c('0x11')][_0xb5e7fb['name']][_0xb39c('0x57')]?this[_0xb39c('0x11')][_0xb5e7fb['name']][_0xb39c('0x57')]||_0xb39c('0x58'):_0xb39c('0x58');_0xb5e7fb[_0xb39c('0x6e')]=_0x26d08c[_0xb39c('0x6e')];_0xb5e7fb[_0xb39c('0x7c')]=moment()['format'](_0xb39c('0x7d'));_0xb5e7fb[_0xb39c('0x7e')]=_0x26d08c[_0xb39c('0x7e')];_0xb5e7fb[_0xb39c('0x7f')]=_0x26d08c[_0xb39c('0x7f')];_0xb5e7fb[_0xb39c('0x4d')]=_0x26d08c[_0xb39c('0x4d')];logger[_0xb39c('0x70')](_0xb39c('0x80'),_0xb5e7fb['name'],_0xb5e7fb[_0xb39c('0x57')]);_[_0xb39c('0x81')](_0xb5e7fb,_[_0xb39c('0x82')](_0x26d08c,_[_0xb39c('0x83')](_0xb5e7fb)));this[_0xb39c('0x42')][_0x26d08c[_0xb39c('0x4d')]][_0xb39c('0x84')](_0xb5e7fb);this['channels'][_0x26d08c[_0xb39c('0x4d')]]=_0xb5e7fb;this[_0xb39c('0x4a')](_0xb5e7fb,_0xb39c('0x1a'));}}catch(_0x205329){logger[_0xb39c('0x3f')](_0xb39c('0x7a'),_0x26d08c[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x205329,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb39c('0x85')]=function(_0x52cb9d){try{if(this[_0xb39c('0x69')](_0x52cb9d)){logger[_0xb39c('0x53')](_0xb39c('0x86'),_0x52cb9d[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x52cb9d,{'showHidden':![],'depth':null}));if(this[_0xb39c('0x42')][_0x52cb9d[_0xb39c('0x4d')]]){var _0x3784fe=_['last'](this[_0xb39c('0x42')][_0x52cb9d[_0xb39c('0x4d')]]);_0x3784fe[_0xb39c('0x87')]=![];_0x3784fe[_0xb39c('0x88')]=null;_0x3784fe[_0xb39c('0x89')]=_0x52cb9d[_0xb39c('0x89')];_0x3784fe[_0xb39c('0x8a')]=_0x52cb9d[_0xb39c('0x8a')];_0x3784fe[_0xb39c('0x1c')]=!![];_0x3784fe[_0xb39c('0x8b')]=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));_0x3784fe[_0xb39c('0x8c')]=_0xb39c('0x8d');_0x3784fe[_0xb39c('0x8e')]=null;logger[_0xb39c('0x70')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x3784fe['name'],_0x3784fe[_0xb39c('0x57')]);this[_0xb39c('0xf')][_0x52cb9d[_0xb39c('0x4d')]]=_0x3784fe;this['emitVoiceQueueChannelRemove'](_0x3784fe,_0xb39c('0x1c'));}}}catch(_0x74411){logger[_0xb39c('0x3f')](_0xb39c('0x86'),_0x52cb9d[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x74411,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')]['syncQueueCallerLeave']=function(_0x41d28f){try{if(this[_0xb39c('0x69')](_0x41d28f)){logger['debug'](_0xb39c('0x8f'),_0x41d28f['uniqueid'],util[_0xb39c('0x41')](_0x41d28f,{'showHidden':![],'depth':null}));if(this[_0xb39c('0x42')][_0x41d28f[_0xb39c('0x4d')]]){var _0x5649af=_[_0xb39c('0x90')](this[_0xb39c('0x42')][_0x41d28f['uniqueid']]);_0x5649af[_0xb39c('0x91')]=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));_0x5649af[_0xb39c('0x92')]=_0x41d28f[_0xb39c('0x92')];_0x5649af[_0xb39c('0x93')]=_0x41d28f[_0xb39c('0x93')];logger[_0xb39c('0x70')](_0xb39c('0x94'),_0x5649af[_0xb39c('0x50')],_0x5649af[_0xb39c('0x57')],_0x41d28f[_0xb39c('0x92')],_0x41d28f[_0xb39c('0x93')]);this[_0xb39c('0xf')][_0x41d28f[_0xb39c('0x4d')]]=_0x5649af;this[_0xb39c('0x4a')](_0x5649af,_0xb39c('0x1d'));}}}catch(_0x24dcc8){logger[_0xb39c('0x3f')](_0xb39c('0x8f'),_0x41d28f[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x24dcc8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')]['syncAgentConnect']=function(_0xa87e5c){try{if(this[_0xb39c('0x69')](_0xa87e5c)){logger[_0xb39c('0x53')](_0xb39c('0x95'),_0xa87e5c['uniqueid'],util[_0xb39c('0x41')](_0xa87e5c,{'showHidden':![],'depth':null}));if(this[_0xb39c('0x42')][_0xa87e5c['uniqueid']]){var _0x3ab209=_[_0xb39c('0x90')](this[_0xb39c('0x42')][_0xa87e5c[_0xb39c('0x4d')]]);_0x3ab209[_0xb39c('0x87')]=!![];_0x3ab209['queuecallerexitreason']=_0xb39c('0x96');logger[_0xb39c('0x70')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x3ab209[_0xb39c('0x50')],_0x3ab209[_0xb39c('0x57')]);}}}catch(_0x80cead){logger[_0xb39c('0x3f')](_0xb39c('0x95'),_0xa87e5c[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x80cead,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')][_0xb39c('0x20')]=function(_0x155972){try{if(this['isNotNull'](_0x155972)){logger[_0xb39c('0x53')](_0xb39c('0x97'),_0x155972[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x155972,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x155972[_0xb39c('0x4d')]]){var _0x49c2a2=_[_0xb39c('0x90')](this[_0xb39c('0x42')][_0x155972['uniqueid']]);_0x49c2a2[_0xb39c('0x1c')]=![];_0x49c2a2[_0xb39c('0x8b')]=null;_0x49c2a2[_0xb39c('0x98')]=!![];_0x49c2a2[_0xb39c('0x8e')]=_0x155972[_0xb39c('0x99')];_0x49c2a2[_0xb39c('0x89')]=_0x155972[_0xb39c('0x89')];_0x49c2a2[_0xb39c('0x87')]=!![];_0x49c2a2['queuecallerexit']=![];_0x49c2a2[_0xb39c('0x9a')]=null;if(!_0x49c2a2[_0xb39c('0x9b')]){if(_0x155972[_0xb39c('0x9c')]==_0xb39c('0x9b')){_0x49c2a2[_0xb39c('0x8c')]=_0xb39c('0x9d');logger[_0xb39c('0x70')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x49c2a2['name'],_0x49c2a2[_0xb39c('0x57')]);}else{if(_[_0xb39c('0x9e')](_0x155972[_0xb39c('0x3c')]['toLowerCase'](),_0xb39c('0x9f'))){if(this[_0xb39c('0x42')][_0x155972[_0xb39c('0xa0')]]){var _0x10b7e9=_[_0xb39c('0x90')](this['queueReports'][_0x155972[_0xb39c('0xa0')]]);_0x10b7e9[_0xb39c('0x87')]=![];_0x10b7e9[_0xb39c('0xa1')]=!![];_0x10b7e9[_0xb39c('0x9a')]=moment(_0x49c2a2[_0xb39c('0x7c')])[_0xb39c('0xa2')](_0x155972[_0xb39c('0x89')],_0xb39c('0xa3'))['format'](_0xb39c('0x7d'));_0x10b7e9[_0xb39c('0x8c')]=_0xb39c('0xa4');_0x10b7e9[_0xb39c('0x9b')]=!![];_0x10b7e9[_0xb39c('0xa5')]='FORWARD';_0x10b7e9[_0xb39c('0xa6')]=_0x155972[_0xb39c('0xa7')];_0x10b7e9[_0xb39c('0xa8')]=_0x155972[_0xb39c('0x4d')];logger[_0xb39c('0x70')](_0xb39c('0xa9'),_0x10b7e9[_0xb39c('0x50')],_0x10b7e9['type']);var _0x29419d=this[_0xb39c('0x42')][_0x155972['linkedid']];this['queueReports'][_0x155972[_0xb39c('0xa0')]]=this['queueReports'][_0x155972[_0xb39c('0x4d')]];this['queueReports'][_0x155972[_0xb39c('0x4d')]]=_0x29419d;}}else{_0x49c2a2['queuecallerexitreason']=_0xb39c('0xaa')+_0x155972[_0xb39c('0x9c')][_0xb39c('0xab')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x49c2a2[_0xb39c('0x50')],_0x49c2a2[_0xb39c('0x57')],_0x49c2a2['queuecallerexitreason']);}}}this[_0xb39c('0xf')][_0x155972[_0xb39c('0x4d')]]=_0x49c2a2;this['emitVoiceQueueChannelRemove'](_0x49c2a2,_0xb39c('0x1f'));}}}catch(_0x214adc){logger[_0xb39c('0x3f')]('[%s][voiceQueueReport][agentcomplete]',_0x155972[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x214adc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')][_0xb39c('0x23')]=function(_0x3d84ff){try{if(this[_0xb39c('0x69')](_0x3d84ff)){logger[_0xb39c('0x53')]('[%s][voiceQueueReport][varset]',_0x3d84ff[_0xb39c('0x4d')],util['inspect'](_0x3d84ff,{'showHidden':![],'depth':null}));this['addVariable'](_0x3d84ff[_0xb39c('0x4d')],_[_0xb39c('0x83')](_0x3d84ff[_0xb39c('0xac')])[0x0],_0x3d84ff[_0xb39c('0xad')]);if(this[_0xb39c('0x42')][_0x3d84ff[_0xb39c('0x4d')]]){var _0xac1d01=_[_0xb39c('0x90')](this[_0xb39c('0x42')][_0x3d84ff['uniqueid']]);if(_0xac1d01){if(this[_0xb39c('0x69')](_0x3d84ff['variable'])&&this[_0xb39c('0x69')](_0x3d84ff['variable'][_0xb39c('0xae')])){switch(_0x3d84ff[_0xb39c('0xad')]){case _0xb39c('0xaf'):_0xac1d01['queuecallerexit']=![];_0xac1d01['queuecallerexitAt']=null;break;case _0xb39c('0xb0'):_0xac1d01['lastevent']='timeout';_0xac1d01[_0xb39c('0xa1')]=!![];_0xac1d01[_0xb39c('0x9a')]=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));_0xac1d01[_0xb39c('0x91')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x3d84ff['uniqueid'],util[_0xb39c('0x41')](_0xac1d01,{'showHidden':![],'depth':null}));ami[_0xb39c('0x49')](_0xb39c('0xb1'),_0xac1d01);break;default:_0xac1d01[_0xb39c('0xa1')]=!![];_0xac1d01['queuecallerexitAt']=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));_0xac1d01[_0xb39c('0x91')]=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));}_0xac1d01[_0xb39c('0x1c')]=![];_0xac1d01[_0xb39c('0x8b')]=null;_0xac1d01['queuecallerexitreason']=_0x3d84ff[_0xb39c('0xad')];this['channels'][_0x3d84ff[_0xb39c('0x4d')]]=_0xac1d01;this['emitVoiceQueueChannelRemove'](_0xac1d01,_0xb39c('0xb2'));}else if(this[_0xb39c('0x69')](_0x3d84ff[_0xb39c('0xac')])&&this[_0xb39c('0x69')](_0x3d84ff[_0xb39c('0xac')][_0xb39c('0xb3')])){if(!_0xac1d01[_0xb39c('0x1c')]){_0xac1d01[_0xb39c('0xa1')]=!![];_0xac1d01[_0xb39c('0x9a')]=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));_0xac1d01[_0xb39c('0x8c')]=_0xb39c('0xb4');_0xac1d01[_0xb39c('0x91')]=moment()[_0xb39c('0x4e')](_0xb39c('0x7d'));this['channels'][_0x3d84ff[_0xb39c('0x4d')]]=_0xac1d01;}}logger[_0xb39c('0x70')](_0xb39c('0xb5'),_0x3d84ff[_0xb39c('0x4d')],_0xac1d01['name'],_0xac1d01[_0xb39c('0x57')],_['keys'](_0x3d84ff['variable'])[0x0],_0x3d84ff[_0xb39c('0xad')]);_0xac1d01[_0xb39c('0x14')]=this[_0xb39c('0x14')][_0x3d84ff[_0xb39c('0x4d')]];}}}}catch(_0x4db8a9){logger[_0xb39c('0x3f')](_0xb39c('0xb6'),_0x3d84ff[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x4db8a9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')][_0xb39c('0xb7')]=function(_0x2af4fe,_0x1ea296,_0x55d99a){var _0x390790=[_0xb39c('0xb8'),_0xb39c('0xb9'),_0xb39c('0xba'),_0xb39c('0xbb'),_0xb39c('0xbc'),_0xb39c('0xbd'),_0xb39c('0xbe'),_0xb39c('0xbf'),_0xb39c('0xc0'),_0xb39c('0xc1'),'bridgepeer','bridgepvtcallid',_0xb39c('0xc2'),_0xb39c('0xc3'),'memberinterface',_0xb39c('0xc4'),_0xb39c('0x99'),_0xb39c('0xc5'),'memberrealtime'];if(!_[_0xb39c('0x39')](_0x1ea296)&&!_[_0xb39c('0xc6')](_0x390790,_0x1ea296)){if(_[_0xb39c('0x7b')](this[_0xb39c('0x14')][_0x2af4fe])){this[_0xb39c('0x14')][_0x2af4fe]={};}this[_0xb39c('0x14')][_0x2af4fe][_0x1ea296]=_0x55d99a;}};VoiceQueueReport[_0xb39c('0xb')][_0xb39c('0x25')]=function(_0x433384){try{if(this[_0xb39c('0x69')](_0x433384)){logger[_0xb39c('0x53')](_0xb39c('0xc7'),_0x433384[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x433384,{'showHidden':![],'depth':null}));if(this[_0xb39c('0x42')][_0x433384['uniqueid']]){for(var _0x341140=0x0,_0x1340bd={};_0x341140<this[_0xb39c('0x42')][_0x433384[_0xb39c('0x4d')]][_0xb39c('0xc8')];_0x341140+=0x1){_0x1340bd=this[_0xb39c('0x42')][_0x433384[_0xb39c('0x4d')]][_0x341140];if(this[_0xb39c('0x11')][_0x1340bd[_0xb39c('0x6e')]]){if(_0x1340bd[_0xb39c('0xa1')]&&_0x1340bd[_0xb39c('0x9b')]!=!![]){this['voiceQueues'][_0x1340bd[_0xb39c('0x6e')]][_0xb39c('0x5d')]+=0x1;}if(_0x1340bd[_0xb39c('0x1c')]){this[_0xb39c('0x11')][_0x1340bd[_0xb39c('0x6e')]]['abandoned']+=0x1;}this['voiceQueues'][_0x1340bd[_0xb39c('0x6e')]][_0xb39c('0xc9')]+=moment(_0x1340bd['queuecallerleaveAt'])[_0xb39c('0xca')](_0x1340bd[_0xb39c('0x7c')],_0xb39c('0xa3'))||0x0;if(_0x341140===this[_0xb39c('0x42')][_0x433384[_0xb39c('0x4d')]]['length']-0x1){this['voiceQueues'][_0x1340bd[_0xb39c('0x6e')]][_0xb39c('0xcb')]+=moment()[_0xb39c('0xcc')](0x0)[_0xb39c('0xca')](_0x1340bd[_0xb39c('0x7c')],_0xb39c('0xa3'));this[_0xb39c('0x11')][_0x1340bd[_0xb39c('0x6e')]][_0xb39c('0x5c')]+=0x1;if(_0x1340bd['queuecallercomplete']){this['voiceQueues'][_0x1340bd[_0xb39c('0x6e')]]['answered']+=0x1;this[_0xb39c('0x11')][_0x1340bd[_0xb39c('0x6e')]][_0xb39c('0x5b')]+=moment()[_0xb39c('0xcc')](0x0)[_0xb39c('0xca')](_0x1340bd[_0xb39c('0x91')],_0xb39c('0xa3'));_0x1340bd['queuecallercompleteAt']=moment()['format'](_0xb39c('0x7d'));_0x1340bd[_0xb39c('0xa1')]=![];_0x1340bd[_0xb39c('0x9a')]=null;}if(_0x1340bd[_0xb39c('0xa1')]&&_0x1340bd['transfer']!=!![]){_0x1340bd[_0xb39c('0xcd')]=_0xb39c('0x5d');logger[_0xb39c('0x53')](_0xb39c('0xce'),_0x433384['uniqueid'],util[_0xb39c('0x41')](_0x1340bd,{'showHidden':![],'depth':null}));ami[_0xb39c('0x49')](_0xb39c('0xcf'),_0x1340bd);}if(_0x1340bd[_0xb39c('0x1c')]){_0x1340bd[_0xb39c('0xcd')]=_0xb39c('0x5e');logger['debug'](_0xb39c('0xd0'),_0x433384[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x1340bd,{'showHidden':![],'depth':null}));ami[_0xb39c('0x49')]('custom:queuecallerabandon',_0x1340bd);}}else{this[_0xb39c('0x11')][_0x1340bd[_0xb39c('0x6e')]][_0xb39c('0xcb')]+=this['voiceQueues'][_0x1340bd['queue']]['sumHoldTime'];}logger[_0xb39c('0x70')](_0xb39c('0xd1'),_0x433384[_0xb39c('0x4d')],_0x1340bd[_0xb39c('0x50')],_0x1340bd[_0xb39c('0x57')],_0x433384[_0xb39c('0xd2')]);this[_0xb39c('0xf')][_0x433384[_0xb39c('0x4d')]]=_0x1340bd;this[_0xb39c('0x47')](_0x1340bd,_0xb39c('0x24'));this[_0xb39c('0x56')](this[_0xb39c('0x11')][_0x1340bd[_0xb39c('0x6e')]],_0xb39c('0x24'));}}logger[_0xb39c('0x53')](_0xb39c('0xd3'),_0x433384[_0xb39c('0x4d')],util[_0xb39c('0x41')](this['queueReports'][_0x433384['uniqueid']],{'showHidden':![],'depth':null}));ami[_0xb39c('0x49')](_0xb39c('0xd4'),this[_0xb39c('0x42')][_0x433384[_0xb39c('0x4d')]]);delete this[_0xb39c('0x42')][_0x433384['uniqueid']];delete this['channels'][_0x433384['uniqueid']];}if(this[_0xb39c('0x14')][_0x433384['uniqueid']]){delete this['variables'][_0x433384[_0xb39c('0x4d')]];}}}catch(_0x32aeb9){logger[_0xb39c('0x3f')](_0xb39c('0xc7'),_0x433384['uniqueid'],util[_0xb39c('0x41')](_0x32aeb9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')][_0xb39c('0x2b')]=function(_0x7b092){try{if(this['isNotNull'](_0x7b092)){logger[_0xb39c('0x53')]('[%s][voiceQueueReport][attendedtransfer]',_0x7b092[_0xb39c('0x4d')],util['inspect'](_0x7b092,{'showHidden':![],'depth':null}));var _0x1e338b;if(this[_0xb39c('0x42')][_0x7b092[_0xb39c('0xd5')]]){_0x1e338b=_[_0xb39c('0x90')](this[_0xb39c('0x42')][_0x7b092[_0xb39c('0xd5')]]);_0x1e338b['transferexten']=_0x7b092[_0xb39c('0xd6')];_0x1e338b[_0xb39c('0xa8')]=_0x7b092[_0xb39c('0xd7')];_0x1e338b['queuecallerexitreason']=_0xb39c('0xd8');_0x1e338b[_0xb39c('0x9b')]=!![];_0x1e338b[_0xb39c('0xa5')]=_0xb39c('0xd9');if(this[_0xb39c('0x42')][_0x7b092[_0xb39c('0xd7')]]){var _0x40f39a=this[_0xb39c('0x42')][_0x7b092[_0xb39c('0xd7')]];this[_0xb39c('0x42')][_0x7b092[_0xb39c('0xd7')]]=this[_0xb39c('0x42')][_0x7b092[_0xb39c('0xd5')]];this[_0xb39c('0x42')][_0x7b092['transfereeuniqueid']]=_0x40f39a;var _0xc2d81b=_[_0xb39c('0x90')](this[_0xb39c('0x42')][_0x7b092['transfereeuniqueid']]);_0xc2d81b[_0xb39c('0xda')]=!![];}logger[_0xb39c('0x70')](_0xb39c('0xdb'),_0x7b092['uniqueid'],_0x1e338b[_0xb39c('0x50')],_0x1e338b[_0xb39c('0x57')],_0x1e338b[_0xb39c('0xa6')],_0x1e338b[_0xb39c('0xa8')]);}else if(this[_0xb39c('0x42')][_0x7b092[_0xb39c('0xdc')]]){_0x1e338b=_[_0xb39c('0x90')](this[_0xb39c('0x42')][_0x7b092[_0xb39c('0xdc')]]);_0x1e338b[_0xb39c('0xa6')]=_0x7b092[_0xb39c('0xdd')];_0x1e338b['transferuniqueid']=_0x7b092[_0xb39c('0xde')];_0x1e338b['queuecallerexitreason']=_0xb39c('0xd8');_0x1e338b[_0xb39c('0x9b')]=!![];_0x1e338b[_0xb39c('0xa5')]=_0xb39c('0xd9');if(this[_0xb39c('0x42')][_0x7b092['origtransfereruniqueid']]){var _0x40f39a=this[_0xb39c('0x42')][_0x7b092[_0xb39c('0xde')]];this['queueReports'][_0x7b092[_0xb39c('0xde')]]=this['queueReports'][_0x7b092[_0xb39c('0xdc')]];this[_0xb39c('0x42')][_0x7b092[_0xb39c('0xdc')]]=_0x40f39a;var _0xc2d81b=_['last'](this[_0xb39c('0x42')][_0x7b092[_0xb39c('0xdc')]]);_0xc2d81b[_0xb39c('0xda')]=!![];}logger[_0xb39c('0x70')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x7b092[_0xb39c('0x4d')],_0x1e338b[_0xb39c('0x50')],_0x1e338b[_0xb39c('0x57')],_0x1e338b['transferexten'],_0x1e338b[_0xb39c('0xa8')]);}}}catch(_0x20b411){logger[_0xb39c('0x3f')](_0xb39c('0xdf'),_0x7b092[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x20b411,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')][_0xb39c('0x2d')]=function(_0x420b40){try{if(this[_0xb39c('0x69')](_0x420b40)){logger[_0xb39c('0x53')]('[%s][voiceQueueReport][blindtransfer]',_0x420b40['uniqueid'],util[_0xb39c('0x41')](_0x420b40,{'showHidden':![],'depth':null}));if(this[_0xb39c('0x42')][_0x420b40[_0xb39c('0xd5')]]){var _0x3ccf84=_[_0xb39c('0x90')](this[_0xb39c('0x42')][_0x420b40[_0xb39c('0xd5')]]);_0x3ccf84['queuecallerexitreason']='BLINDTRANSFER';_0x3ccf84[_0xb39c('0x9b')]=!![];_0x3ccf84['transfertype']=_0xb39c('0xe0');_0x3ccf84[_0xb39c('0xa6')]=_0x420b40['extension'];_0x3ccf84[_0xb39c('0xa8')]=_0x420b40['transfereeuniqueid'];logger[_0xb39c('0x70')](_0xb39c('0xe1'),_0x420b40['uniqueid'],_0x3ccf84['name'],_0x3ccf84[_0xb39c('0x57')],_0x3ccf84[_0xb39c('0xa6')],_0x3ccf84[_0xb39c('0xa8')]);this[_0xb39c('0x25')]({'event':'BlindTransfer','uniqueid':_0x420b40[_0xb39c('0xd5')],'context':_0x420b40[_0xb39c('0xe2')],'channel':_0x420b40['transfererchannel']});}}}catch(_0x1b2dc8){logger[_0xb39c('0x3f')](_0xb39c('0xe3'),_0x420b40[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x1b2dc8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')]['syncMusicOnHoldStart']=function(_0x2a73ab){try{if(this[_0xb39c('0x69')](_0x2a73ab)){logger[_0xb39c('0x53')](_0xb39c('0xe4'),_0x2a73ab[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x2a73ab,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2a73ab[_0xb39c('0x4d')]]){var _0x36801f=_[_0xb39c('0x90')](this[_0xb39c('0x42')][_0x2a73ab[_0xb39c('0x4d')]]);if(!_['isNil'](_0x36801f[_0xb39c('0x91')])){_0x36801f[_0xb39c('0xe5')]=moment()[_0xb39c('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xb39c('0x70')](_0xb39c('0xe6'),_0x2a73ab[_0xb39c('0x4d')],_0x36801f[_0xb39c('0xe5')]);}}}}catch(_0x646344){logger[_0xb39c('0x3f')](_0xb39c('0xe4'),_0x2a73ab[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x646344,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb39c('0xb')][_0xb39c('0xe7')]=function(_0x37f362){try{if(this[_0xb39c('0x69')](_0x37f362)){logger[_0xb39c('0x53')](_0xb39c('0xe8'),_0x37f362['uniqueid'],util[_0xb39c('0x41')](_0x37f362,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x37f362[_0xb39c('0x4d')]]){var _0x2f129a=_['last'](this[_0xb39c('0x42')][_0x37f362[_0xb39c('0x4d')]]);if(!_[_0xb39c('0x39')](_0x2f129a['mohstarttime'])){_0x2f129a[_0xb39c('0xe9')]+=moment()[_0xb39c('0xcc')](0x0)[_0xb39c('0xca')](_0x2f129a[_0xb39c('0xe5')],_0xb39c('0xa3'));logger[_0xb39c('0x70')](_0xb39c('0xea'),_0x37f362['uniqueid'],_0x2f129a[_0xb39c('0xe9')]);delete _0x2f129a[_0xb39c('0xe5')];}}}}catch(_0x36b3ac){logger[_0xb39c('0x3f')](_0xb39c('0xe8'),_0x37f362[_0xb39c('0x4d')],util[_0xb39c('0x41')](_0x36b3ac,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
+var _0xc368=['[voiceQueueReport][','isNotNull','isUndefined','clearZombieChannels','queues','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedIn','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','local/','linkedid','queuecallerexit','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferuniqueid','COMPLETEDBY','toUpperCase','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','custom:timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','length','diff','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','syncBlindTransfer','BLINDTRANSFER','BLIND','BlindTransfer','transfererchannel','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','exports','moment','md5','ioredis','../../../config/environment','../../../config/logger','ami','../model/queueReport','redis','defaults','prototype','enqueue','tail','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','loopQueueSummary','loopQueueShow','isEmpty','originated','talking','pTalking','hasOwnProperty','unlockRR','switch','isNil','Action','status','channel','catch','message','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','name','voice_queue_channel:save','voice_queue_presence:save','uniqueid','format','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','Trunk','active','Interval','stringify'];(function(_0x29a8b9,_0x515957){var _0x138a27=function(_0x47f639){while(--_0x47f639){_0x29a8b9['push'](_0x29a8b9['shift']());}};_0x138a27(++_0x515957);}(_0xc368,0x7b));var _0x8c36=function(_0x2feae2,_0x119b62){_0x2feae2=_0x2feae2-0x0;var _0x43630b=_0xc368[_0x2feae2];return _0x43630b;};'use strict';var _=require('lodash');var moment=require(_0x8c36('0x0'));var util=require('util');var md5=require(_0x8c36('0x1'));var Redis=require(_0x8c36('0x2'));var config=require(_0x8c36('0x3'));var logger=require(_0x8c36('0x4'))(_0x8c36('0x5'));var ami=require('../ami');var QueueReport=require(_0x8c36('0x6'));config[_0x8c36('0x7')]=_[_0x8c36('0x8')](config[_0x8c36('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8c36('0x7')]));var Sequence=function(){};Sequence[_0x8c36('0x9')][_0x8c36('0xa')]=function(_0x26bad1){this[_0x8c36('0xb')]=this[_0x8c36('0xb')]?this['tail']['finally'](_0x26bad1):_0x26bad1();};function VoiceQueueReport(_0x49f227){this[_0x8c36('0xc')]=new Sequence();this[_0x8c36('0xd')]={};this['agents']=_0x49f227[_0x8c36('0xe')];this[_0x8c36('0xf')]=_0x49f227[_0x8c36('0x10')];this[_0x8c36('0x11')]=_0x49f227[_0x8c36('0x11')];this[_0x8c36('0x12')]=!![];this[_0x8c36('0x13')]=_0x49f227[_0x8c36('0x13')];this[_0x8c36('0x14')]={};ami['on'](_0x8c36('0x15'),this[_0x8c36('0x16')][_0x8c36('0x17')](this));ami['on'](_0x8c36('0x18'),this[_0x8c36('0x19')]['bind'](this));ami['on'](_0x8c36('0x1a'),this['syncQueueCallerJoin'][_0x8c36('0x17')](this));ami['on'](_0x8c36('0x1b'),this[_0x8c36('0x1c')][_0x8c36('0x17')](this));ami['on'](_0x8c36('0x1d'),this[_0x8c36('0x1e')][_0x8c36('0x17')](this));ami['on'](_0x8c36('0x1f'),this[_0x8c36('0x20')]['bind'](this));ami['on'](_0x8c36('0x21'),this[_0x8c36('0x22')][_0x8c36('0x17')](this));ami['on'](_0x8c36('0x23'),this[_0x8c36('0x24')]['bind'](this));ami['on'](_0x8c36('0x25'),this[_0x8c36('0x26')][_0x8c36('0x17')](this));ami['on'](_0x8c36('0x27'),this[_0x8c36('0x28')][_0x8c36('0x17')](this));ami['on'](_0x8c36('0x29'),this[_0x8c36('0x2a')][_0x8c36('0x17')](this));ami['on'](_0x8c36('0x2b'),this[_0x8c36('0x2c')][_0x8c36('0x17')](this));ami['on'](_0x8c36('0x2d'),this['syncAttendedTransfer']['bind'](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x8c36('0x17')](this));this[_0x8c36('0x2e')]();this[_0x8c36('0x2f')]();}function clearChannels(_0x2c9e9a){if(!_[_0x8c36('0x30')](_0x2c9e9a)){for(var _0x27c0df in _0x2c9e9a){if(_0x2c9e9a['hasOwnProperty'](_0x27c0df)){delete _0x2c9e9a[_0x27c0df];}}}}function clearCampaigns(_0x1d39ca){if(!_['isEmpty'](_0x1d39ca)){for(var _0x40b66f in _0x1d39ca){if(_0x1d39ca['hasOwnProperty'](_0x40b66f)){_0x1d39ca[_0x40b66f][_0x8c36('0x31')]=0x0;}}}}function clearVoiceQueues(_0x1afee4){if(!_[_0x8c36('0x30')](_0x1afee4)){for(var _0x1010c8 in _0x1afee4){if(_0x1afee4['hasOwnProperty'](_0x1010c8)){_0x1afee4[_0x1010c8]['originated']=0x0;_0x1afee4[_0x1010c8][_0x8c36('0x32')]=0x0;_0x1afee4[_0x1010c8][_0x8c36('0x33')]=0x0;_0x1afee4[_0x1010c8]['waiting']=0x0;_0x1afee4[_0x1010c8]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x418663){if(!_[_0x8c36('0x30')](_0x418663)){for(var _0x502fa3 in _0x418663){if(_0x418663[_0x8c36('0x34')](_0x502fa3)){_0x418663[_0x502fa3][_0x8c36('0x35')]=!![];}}}}VoiceQueueReport[_0x8c36('0x9')]['clearZombieChannels']=function(){var _0x49b737=this;for(var _0x46b72f in this[_0x8c36('0xf')]){if(this[_0x8c36('0xf')][_0x8c36('0x34')](_0x46b72f)&&!this[_0x8c36('0xf')][_0x46b72f][_0x8c36('0x36')]){this[_0x8c36('0xc')][_0x8c36('0xa')](function(){if(!_[_0x8c36('0x37')](_0x49b737[_0x8c36('0xf')][_0x46b72f])){return ami[_0x8c36('0x38')]({'action':_0x8c36('0x39'),'channel':_0x49b737[_0x8c36('0xf')][_0x46b72f][_0x8c36('0x3a')]})[_0x8c36('0x3b')](function(_0x239fa3){if(_0x239fa3[_0x8c36('0x3c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x49b737['channels'][_0x46b72f]){delete _0x49b737['channels'][_0x46b72f];logger[_0x8c36('0x3d')](_0x8c36('0x3e'),_0x46b72f,util[_0x8c36('0x3f')](_0x239fa3,{'showHidden':![],'depth':null}));}if(_0x49b737[_0x8c36('0xd')][_0x46b72f]){delete _0x49b737[_0x8c36('0xd')][_0x46b72f];logger[_0x8c36('0x3d')](_0x8c36('0x40'),_0x46b72f,util['inspect'](_0x239fa3,{'showHidden':![],'depth':null}));}if(_0x49b737[_0x8c36('0x14')][_0x46b72f]){delete _0x49b737['variables'][_0x46b72f];logger[_0x8c36('0x3d')]('[%s][voiceQueueReport][checkVariables]',_0x46b72f,util[_0x8c36('0x3f')](_0x239fa3,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x8c36('0x9')][_0x8c36('0x28')]=function(){logger['error'](_0x8c36('0x41'));clearChannels(this[_0x8c36('0xf')]);this[_0x8c36('0x42')](this[_0x8c36('0xd')]);clearAgentBooked(this[_0x8c36('0xe')]);clearVoiceQueues(this[_0x8c36('0x11')]);clearCampaigns(this[_0x8c36('0x13')]);};VoiceQueueReport[_0x8c36('0x9')][_0x8c36('0x42')]=function(_0x3fc603){var _0x4719de=this;if(!_[_0x8c36('0x30')](_0x3fc603)){for(var _0xed5495 in _0x3fc603){if(_0x3fc603[_0x8c36('0x34')](_0xed5495)){_0x4719de[_0x8c36('0x43')](_0x3fc603[_0xed5495],_0x8c36('0x44'));delete _0x3fc603[_0xed5495];}}}};VoiceQueueReport[_0x8c36('0x9')]['emit']=function(_0x318d7f,_0x5ee15b,_0x51960e){io['to'](_0x318d7f)[_0x8c36('0x45')](_0x5ee15b,_0x51960e);};VoiceQueueReport[_0x8c36('0x9')][_0x8c36('0x46')]=function(_0x4da574,_0x5a50d6){logger[_0x8c36('0x47')](_0x8c36('0x48')+_0x5a50d6+_0x8c36('0x49'),_0x4da574['uniqueid'],util['inspect'](_0x4da574,{'showHidden':![],'depth':null}));this[_0x8c36('0x45')](util['format']('voice:queue:%s',_0x4da574[_0x8c36('0x4a')]),_0x8c36('0x4b'),_0x4da574);io[_0x8c36('0x45')](_0x8c36('0x4c'),_0x4da574);};VoiceQueueReport[_0x8c36('0x9')][_0x8c36('0x43')]=function(_0x3033fd,_0x343be6){logger[_0x8c36('0x47')](_0x8c36('0x48')+_0x343be6+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x3033fd[_0x8c36('0x4d')],util[_0x8c36('0x3f')](_0x3033fd,{'showHidden':![],'depth':null}));this[_0x8c36('0x45')](util[_0x8c36('0x4e')](_0x8c36('0x4f'),_0x3033fd['name']),_0x8c36('0x50'),_0x3033fd);io[_0x8c36('0x45')](_0x8c36('0x51'),_0x3033fd);};VoiceQueueReport[_0x8c36('0x9')][_0x8c36('0x52')]=function(_0x1cad2,_0x47d210){if(_0x1cad2[_0x8c36('0x53')]===_0x8c36('0x54')){var _0x475ba8={'id':_0x1cad2['id'],'name':_0x1cad2[_0x8c36('0x4a')],'strategy':_0x1cad2[_0x8c36('0x55')],'answered':_0x1cad2[_0x8c36('0x56')],'available':_0x1cad2[_0x8c36('0x57')],'loggedIn':_0x1cad2['loggedIn'],'pTalking':_0x1cad2[_0x8c36('0x33')],'sumBillable':_0x1cad2[_0x8c36('0x58')],'sumDuration':_0x1cad2[_0x8c36('0x59')],'sumHoldTime':_0x1cad2[_0x8c36('0x5a')]||0x0,'talking':_0x1cad2[_0x8c36('0x32')],'total':_0x1cad2[_0x8c36('0x5b')],'type':_0x1cad2[_0x8c36('0x53')],'unmanaged':_0x1cad2[_0x8c36('0x5c')],'abandoned':_0x1cad2[_0x8c36('0x5d')],'waiting':_0x1cad2[_0x8c36('0x5e')]};if(_0x1cad2[_0x8c36('0x5f')]){_0x475ba8[_0x8c36('0x5f')]={'id':_0x1cad2['Trunk']['id'],'name':_0x1cad2['Trunk'][_0x8c36('0x4a')],'active':_0x1cad2[_0x8c36('0x5f')][_0x8c36('0x60')],'callerid':_0x1cad2[_0x8c36('0x5f')]['callerid']};}if(_0x1cad2[_0x8c36('0x61')]){_0x475ba8[_0x8c36('0x61')]={'id':_0x1cad2['Interval']['id'],'name':_0x1cad2['Interval']['name']};}var _0xb4ebae=md5(JSON[_0x8c36('0x62')](_0x475ba8));if(_0x1cad2[_0x8c36('0x1')]!==_0xb4ebae){_0x1cad2[_0x8c36('0x1')]=_0xb4ebae;logger[_0x8c36('0x47')](_0x8c36('0x63')+_0x47d210+']\x20sending\x20voice_queue:save\x20event:',util[_0x8c36('0x3f')](_0x475ba8,{'showHidden':![],'depth':null}));this[_0x8c36('0x45')](util[_0x8c36('0x4e')](_0x8c36('0x4f'),_0x475ba8['name']),'voice_queue:save',_0x475ba8);}}};VoiceQueueReport['prototype'][_0x8c36('0x64')]=function(_0x3e4b78){return _0x3e4b78!==null&&!_[_0x8c36('0x65')](_0x3e4b78);};VoiceQueueReport[_0x8c36('0x9')][_0x8c36('0x2f')]=function(){var _0x3d5e0d=this;setInterval(function(){_0x3d5e0d[_0x8c36('0x66')]();ami[_0x8c36('0x38')]({'action':_0x8c36('0x67')})['catch'](function(_0x4cba50){logger[_0x8c36('0x3d')]('[voiceQueueReport][queues]',util['inspect'](_0x4cba50,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x8c36('0x9')]['loopQueueSummary']=function(){var _0x273dcd=this;setInterval(function(){if(_0x273dcd[_0x8c36('0x12')]){return ami['Action']({'action':_0x8c36('0x15')})['then'](function(_0x31fbde){_0x273dcd[_0x8c36('0x12')]=![];})[_0x8c36('0x3b')](function(_0x52726e){logger[_0x8c36('0x3d')](_0x8c36('0x68'),util[_0x8c36('0x3f')](_0x52726e,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x8c36('0x9')][_0x8c36('0x16')]=function(_0x1505f3){try{if(this[_0x8c36('0x64')](_0x1505f3)&&this[_0x8c36('0x64')](_0x1505f3[_0x8c36('0x69')])){logger['debug']('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x1505f3,{'showHidden':![],'depth':null}));if(this[_0x8c36('0x11')][_0x1505f3['queue']]){logger['info'](_0x8c36('0x6a'),_0x1505f3[_0x8c36('0x69')]);var _0x366f0c=_[_0x8c36('0x6b')](this[_0x8c36('0xf')],'queue')[_0x1505f3['queue']]||0x0;var _0x54c675=_0x366f0c-_0x1505f3[_0x8c36('0x6c')];if(this[_0x8c36('0x11')][_0x1505f3['queue']][_0x8c36('0x5e')]!==_[_0x8c36('0x6d')](_0x1505f3[_0x8c36('0x6c')])||this[_0x8c36('0x11')][_0x1505f3[_0x8c36('0x69')]][_0x8c36('0x6e')]!==_[_0x8c36('0x6d')](_0x1505f3[_0x8c36('0x6f')])||this[_0x8c36('0x11')][_0x1505f3['queue']]['available']!==_['toNumber'](_0x1505f3[_0x8c36('0x57')])||this[_0x8c36('0x11')][_0x1505f3[_0x8c36('0x69')]][_0x8c36('0x32')]!==_0x54c675){this[_0x8c36('0x11')][_0x1505f3[_0x8c36('0x69')]]['waiting']=_[_0x8c36('0x6d')](_0x1505f3['callers']);this[_0x8c36('0x11')][_0x1505f3[_0x8c36('0x69')]][_0x8c36('0x6e')]=_['toNumber'](_0x1505f3[_0x8c36('0x6f')]);this['voiceQueues'][_0x1505f3[_0x8c36('0x69')]][_0x8c36('0x57')]=_[_0x8c36('0x6d')](_0x1505f3[_0x8c36('0x57')]);this[_0x8c36('0x11')][_0x1505f3['queue']][_0x8c36('0x32')]=_0x54c675>0x0?_0x54c675:0x0;this['voiceQueues'][_0x1505f3[_0x8c36('0x69')]][_0x8c36('0x32')]=this['voiceQueues'][_0x1505f3[_0x8c36('0x69')]][_0x8c36('0x32')]>_[_0x8c36('0x6d')](_0x1505f3['loggedin'])?_[_0x8c36('0x6d')](_0x1505f3[_0x8c36('0x6f')]):this[_0x8c36('0x11')][_0x1505f3[_0x8c36('0x69')]]['talking'];this[_0x8c36('0x52')](this[_0x8c36('0x11')][_0x1505f3['queue']],_0x8c36('0x15'));}logger[_0x8c36('0x47')](_0x8c36('0x70'),util['inspect'](this[_0x8c36('0x11')][_0x1505f3[_0x8c36('0x69')]],{'showHidden':![],'depth':null}));ami['emit'](_0x8c36('0x71'),this[_0x8c36('0x11')][_0x1505f3[_0x8c36('0x69')]]);}}}catch(_0x1ffa82){logger['error'](_0x8c36('0x68'),util['inspect'](_0x1ffa82,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c36('0x9')][_0x8c36('0x19')]=function(_0x5a820a){logger[_0x8c36('0x47')](_0x8c36('0x72'),util[_0x8c36('0x3f')](_0x5a820a,{'showHidden':![],'depth':null}));this[_0x8c36('0x12')]=!![];};VoiceQueueReport[_0x8c36('0x9')][_0x8c36('0x73')]=function(_0x19bd1c){try{if(this[_0x8c36('0x64')](_0x19bd1c)){logger['debug'](_0x8c36('0x74'),_0x19bd1c[_0x8c36('0x4d')],util[_0x8c36('0x3f')](_0x19bd1c,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x8c36('0xd')][_0x19bd1c[_0x8c36('0x4d')]])){this[_0x8c36('0xd')][_0x19bd1c[_0x8c36('0x4d')]]=[];this[_0x8c36('0xf')][_0x19bd1c['uniqueid']]={};}var _0x291a1f=new QueueReport();_0x291a1f[_0x8c36('0x4a')]=_0x19bd1c[_0x8c36('0x69')];_0x291a1f['type']=this[_0x8c36('0x11')][_0x291a1f[_0x8c36('0x4a')]]&&this[_0x8c36('0x11')][_0x291a1f[_0x8c36('0x4a')]][_0x8c36('0x53')]?this['voiceQueues'][_0x291a1f[_0x8c36('0x4a')]][_0x8c36('0x53')]||_0x8c36('0x54'):'inbound';_0x291a1f[_0x8c36('0x69')]=_0x19bd1c[_0x8c36('0x69')];_0x291a1f[_0x8c36('0x75')]=moment()[_0x8c36('0x4e')](_0x8c36('0x76'));_0x291a1f[_0x8c36('0x77')]=_0x19bd1c[_0x8c36('0x77')];_0x291a1f['count']=_0x19bd1c['count'];_0x291a1f['uniqueid']=_0x19bd1c[_0x8c36('0x4d')];logger[_0x8c36('0x78')](_0x8c36('0x79'),_0x291a1f[_0x8c36('0x4a')],_0x291a1f[_0x8c36('0x53')]);_[_0x8c36('0x7a')](_0x291a1f,_[_0x8c36('0x7b')](_0x19bd1c,_[_0x8c36('0x7c')](_0x291a1f)));this[_0x8c36('0xd')][_0x19bd1c[_0x8c36('0x4d')]][_0x8c36('0x7d')](_0x291a1f);this[_0x8c36('0xf')][_0x19bd1c[_0x8c36('0x4d')]]=_0x291a1f;this[_0x8c36('0x46')](_0x291a1f,_0x8c36('0x1a'));}}catch(_0xbb35c){logger[_0x8c36('0x3d')](_0x8c36('0x74'),_0x19bd1c['uniqueid'],util[_0x8c36('0x3f')](_0xbb35c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x319bfe){try{if(this['isNotNull'](_0x319bfe)){logger[_0x8c36('0x47')](_0x8c36('0x7e'),_0x319bfe[_0x8c36('0x4d')],util[_0x8c36('0x3f')](_0x319bfe,{'showHidden':![],'depth':null}));if(this[_0x8c36('0xd')][_0x319bfe[_0x8c36('0x4d')]]){var _0xf6760b=_['last'](this['queueReports'][_0x319bfe[_0x8c36('0x4d')]]);_0xf6760b[_0x8c36('0x7f')]=![];_0xf6760b['queuecallercompleteAt']=null;_0xf6760b[_0x8c36('0x80')]=_0x319bfe[_0x8c36('0x80')];_0xf6760b[_0x8c36('0x81')]=_0x319bfe[_0x8c36('0x81')];_0xf6760b['queuecallerabandon']=!![];_0xf6760b[_0x8c36('0x82')]=moment()[_0x8c36('0x4e')](_0x8c36('0x76'));_0xf6760b[_0x8c36('0x83')]=_0x8c36('0x84');_0xf6760b[_0x8c36('0x85')]=null;logger['info'](_0x8c36('0x86'),_0xf6760b[_0x8c36('0x4a')],_0xf6760b[_0x8c36('0x53')]);this[_0x8c36('0xf')][_0x319bfe[_0x8c36('0x4d')]]=_0xf6760b;this[_0x8c36('0x43')](_0xf6760b,_0x8c36('0x1b'));}}}catch(_0x1dd208){logger[_0x8c36('0x3d')](_0x8c36('0x7e'),_0x319bfe['uniqueid'],util['inspect'](_0x1dd208,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c36('0x9')]['syncQueueCallerLeave']=function(_0x4dbf66){try{if(this[_0x8c36('0x64')](_0x4dbf66)){logger[_0x8c36('0x47')]('[%s][voiceQueueReport][queuecallerleave]',_0x4dbf66[_0x8c36('0x4d')],util[_0x8c36('0x3f')](_0x4dbf66,{'showHidden':![],'depth':null}));if(this[_0x8c36('0xd')][_0x4dbf66[_0x8c36('0x4d')]]){var _0x1e6059=_[_0x8c36('0x87')](this['queueReports'][_0x4dbf66['uniqueid']]);_0x1e6059[_0x8c36('0x88')]=moment()[_0x8c36('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e6059[_0x8c36('0x89')]=_0x4dbf66[_0x8c36('0x89')];_0x1e6059[_0x8c36('0x8a')]=_0x4dbf66[_0x8c36('0x8a')];logger[_0x8c36('0x78')](_0x8c36('0x8b'),_0x1e6059['name'],_0x1e6059[_0x8c36('0x53')],_0x4dbf66[_0x8c36('0x89')],_0x4dbf66[_0x8c36('0x8a')]);this[_0x8c36('0xf')][_0x4dbf66[_0x8c36('0x4d')]]=_0x1e6059;this[_0x8c36('0x46')](_0x1e6059,'queuecallerleave');}}}catch(_0x4822cb){logger[_0x8c36('0x3d')](_0x8c36('0x8c'),_0x4dbf66[_0x8c36('0x4d')],util[_0x8c36('0x3f')](_0x4822cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c36('0x9')]['syncAgentConnect']=function(_0x53278d){try{if(this[_0x8c36('0x64')](_0x53278d)){logger[_0x8c36('0x47')](_0x8c36('0x8d'),_0x53278d['uniqueid'],util[_0x8c36('0x3f')](_0x53278d,{'showHidden':![],'depth':null}));if(this[_0x8c36('0xd')][_0x53278d[_0x8c36('0x4d')]]){var _0x1a7211=_[_0x8c36('0x87')](this[_0x8c36('0xd')][_0x53278d[_0x8c36('0x4d')]]);_0x1a7211[_0x8c36('0x7f')]=!![];_0x1a7211[_0x8c36('0x83')]=_0x8c36('0x8e');logger[_0x8c36('0x78')](_0x8c36('0x8f'),_0x1a7211['name'],_0x1a7211[_0x8c36('0x53')]);}}}catch(_0x50539b){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x53278d[_0x8c36('0x4d')],util[_0x8c36('0x3f')](_0x50539b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c36('0x9')]['syncAgentComplete']=function(_0x7d675c){try{if(this[_0x8c36('0x64')](_0x7d675c)){logger[_0x8c36('0x47')](_0x8c36('0x90'),_0x7d675c['uniqueid'],util[_0x8c36('0x3f')](_0x7d675c,{'showHidden':![],'depth':null}));if(this[_0x8c36('0xd')][_0x7d675c['uniqueid']]){var _0x3e1fa3=_[_0x8c36('0x87')](this['queueReports'][_0x7d675c[_0x8c36('0x4d')]]);_0x3e1fa3[_0x8c36('0x1b')]=![];_0x3e1fa3[_0x8c36('0x82')]=null;_0x3e1fa3[_0x8c36('0x91')]=!![];_0x3e1fa3[_0x8c36('0x85')]=_0x7d675c[_0x8c36('0x92')];_0x3e1fa3[_0x8c36('0x80')]=_0x7d675c['holdtime'];_0x3e1fa3['queuecallercomplete']=!![];_0x3e1fa3['queuecallerexit']=![];_0x3e1fa3[_0x8c36('0x93')]=null;if(!_0x3e1fa3[_0x8c36('0x94')]){if(_0x7d675c[_0x8c36('0x95')]==_0x8c36('0x94')){_0x3e1fa3[_0x8c36('0x83')]=_0x8c36('0x96');logger['info'](_0x8c36('0x97'),_0x3e1fa3[_0x8c36('0x4a')],_0x3e1fa3[_0x8c36('0x53')]);}else{if(_[_0x8c36('0x98')](_0x7d675c['channel']['toLowerCase'](),_0x8c36('0x99'))){if(this[_0x8c36('0xd')][_0x7d675c[_0x8c36('0x9a')]]){var _0x4926ef=_[_0x8c36('0x87')](this[_0x8c36('0xd')][_0x7d675c[_0x8c36('0x9a')]]);_0x4926ef['queuecallercomplete']=![];_0x4926ef[_0x8c36('0x9b')]=!![];_0x4926ef['queuecallerexitAt']=moment(_0x3e1fa3[_0x8c36('0x75')])[_0x8c36('0x9c')](_0x7d675c['holdtime'],_0x8c36('0x9d'))[_0x8c36('0x4e')](_0x8c36('0x76'));_0x4926ef[_0x8c36('0x83')]=_0x8c36('0x9e');_0x4926ef[_0x8c36('0x94')]=!![];_0x4926ef[_0x8c36('0x9f')]=_0x8c36('0xa0');_0x4926ef['transferexten']=_0x7d675c['destexten'];_0x4926ef[_0x8c36('0xa1')]=_0x7d675c[_0x8c36('0x4d')];logger[_0x8c36('0x78')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x4926ef[_0x8c36('0x4a')],_0x4926ef[_0x8c36('0x53')]);var _0x50c9d7=this['queueReports'][_0x7d675c[_0x8c36('0x9a')]];this[_0x8c36('0xd')][_0x7d675c['linkedid']]=this[_0x8c36('0xd')][_0x7d675c[_0x8c36('0x4d')]];this[_0x8c36('0xd')][_0x7d675c[_0x8c36('0x4d')]]=_0x50c9d7;}}else{_0x3e1fa3['queuecallerexitreason']=_0x8c36('0xa2')+_0x7d675c[_0x8c36('0x95')][_0x8c36('0xa3')]();logger[_0x8c36('0x78')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x3e1fa3[_0x8c36('0x4a')],_0x3e1fa3[_0x8c36('0x53')],_0x3e1fa3[_0x8c36('0x83')]);}}}this[_0x8c36('0xf')][_0x7d675c[_0x8c36('0x4d')]]=_0x3e1fa3;this['emitVoiceQueueChannelRemove'](_0x3e1fa3,_0x8c36('0x1f'));}}}catch(_0x44a5d4){logger[_0x8c36('0x3d')]('[%s][voiceQueueReport][agentcomplete]',_0x7d675c[_0x8c36('0x4d')],util[_0x8c36('0x3f')](_0x44a5d4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c36('0x9')]['syncVarSet']=function(_0x4be6a3){try{if(this['isNotNull'](_0x4be6a3)){logger['debug'](_0x8c36('0xa4'),_0x4be6a3['uniqueid'],util['inspect'](_0x4be6a3,{'showHidden':![],'depth':null}));this[_0x8c36('0xa5')](_0x4be6a3['uniqueid'],_[_0x8c36('0x7c')](_0x4be6a3[_0x8c36('0xa6')])[0x0],_0x4be6a3[_0x8c36('0xa7')]);if(this[_0x8c36('0xd')][_0x4be6a3['uniqueid']]){var _0x36b1c9=_[_0x8c36('0x87')](this[_0x8c36('0xd')][_0x4be6a3['uniqueid']]);if(_0x36b1c9){if(this[_0x8c36('0x64')](_0x4be6a3[_0x8c36('0xa6')])&&this[_0x8c36('0x64')](_0x4be6a3[_0x8c36('0xa6')][_0x8c36('0xa8')])){switch(_0x4be6a3[_0x8c36('0xa7')]){case _0x8c36('0xa9'):_0x36b1c9['queuecallerexit']=![];_0x36b1c9[_0x8c36('0x93')]=null;break;case _0x8c36('0xaa'):_0x36b1c9[_0x8c36('0xab')]=_0x8c36('0xac');_0x36b1c9[_0x8c36('0x9b')]=!![];_0x36b1c9[_0x8c36('0x93')]=moment()[_0x8c36('0x4e')](_0x8c36('0x76'));_0x36b1c9[_0x8c36('0x88')]=moment()[_0x8c36('0x4e')](_0x8c36('0x76'));logger[_0x8c36('0x47')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x4be6a3['uniqueid'],util[_0x8c36('0x3f')](_0x36b1c9,{'showHidden':![],'depth':null}));ami[_0x8c36('0x45')](_0x8c36('0xad'),_0x36b1c9);break;default:_0x36b1c9[_0x8c36('0x9b')]=!![];_0x36b1c9[_0x8c36('0x93')]=moment()[_0x8c36('0x4e')](_0x8c36('0x76'));_0x36b1c9['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x36b1c9[_0x8c36('0x1b')]=![];_0x36b1c9[_0x8c36('0x82')]=null;_0x36b1c9[_0x8c36('0x83')]=_0x4be6a3[_0x8c36('0xa7')];this['channels'][_0x4be6a3[_0x8c36('0x4d')]]=_0x36b1c9;this[_0x8c36('0x43')](_0x36b1c9,_0x8c36('0x23'));}else if(this[_0x8c36('0x64')](_0x4be6a3[_0x8c36('0xa6')])&&this[_0x8c36('0x64')](_0x4be6a3[_0x8c36('0xa6')]['queueposition'])){if(!_0x36b1c9[_0x8c36('0x1b')]){_0x36b1c9[_0x8c36('0x9b')]=!![];_0x36b1c9[_0x8c36('0x93')]=moment()[_0x8c36('0x4e')](_0x8c36('0x76'));_0x36b1c9[_0x8c36('0x83')]=_0x8c36('0xae');_0x36b1c9[_0x8c36('0x88')]=moment()['format'](_0x8c36('0x76'));this[_0x8c36('0xf')][_0x4be6a3[_0x8c36('0x4d')]]=_0x36b1c9;}}logger[_0x8c36('0x78')](_0x8c36('0xaf'),_0x4be6a3['uniqueid'],_0x36b1c9[_0x8c36('0x4a')],_0x36b1c9[_0x8c36('0x53')],_[_0x8c36('0x7c')](_0x4be6a3[_0x8c36('0xa6')])[0x0],_0x4be6a3[_0x8c36('0xa7')]);_0x36b1c9[_0x8c36('0x14')]=this[_0x8c36('0x14')][_0x4be6a3[_0x8c36('0x4d')]];}}}}catch(_0x56c11f){logger[_0x8c36('0x3d')]('[%s][voiceQueueReport][varset]',_0x4be6a3['uniqueid'],util['inspect'](_0x56c11f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c36('0x9')][_0x8c36('0xa5')]=function(_0x36e76b,_0x58b524,_0x101b04){var _0x1d8d2c=[_0x8c36('0xb0'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x8c36('0xb1'),'rtpaudioqosloss',_0x8c36('0xb2'),_0x8c36('0xb3'),_0x8c36('0xb4'),'sipcallid',_0x8c36('0xb5'),_0x8c36('0xb6'),_0x8c36('0xb7'),'membercalls',_0x8c36('0xb8'),_0x8c36('0xb9'),_0x8c36('0xba'),_0x8c36('0x92'),_0x8c36('0xbb'),_0x8c36('0xbc')];if(!_['isNil'](_0x58b524)&&!_[_0x8c36('0xbd')](_0x1d8d2c,_0x58b524)){if(_[_0x8c36('0x65')](this[_0x8c36('0x14')][_0x36e76b])){this[_0x8c36('0x14')][_0x36e76b]={};}this[_0x8c36('0x14')][_0x36e76b][_0x58b524]=_0x101b04;}};VoiceQueueReport['prototype']['syncHangup']=function(_0x4f8653){try{if(this['isNotNull'](_0x4f8653)){logger[_0x8c36('0x47')]('[%s][voiceQueueReport][hangup]',_0x4f8653[_0x8c36('0x4d')],util[_0x8c36('0x3f')](_0x4f8653,{'showHidden':![],'depth':null}));if(this[_0x8c36('0xd')][_0x4f8653['uniqueid']]){for(var _0x10ed2c=0x0,_0x4d7474={};_0x10ed2c<this[_0x8c36('0xd')][_0x4f8653[_0x8c36('0x4d')]][_0x8c36('0xbe')];_0x10ed2c+=0x1){_0x4d7474=this[_0x8c36('0xd')][_0x4f8653[_0x8c36('0x4d')]][_0x10ed2c];if(this[_0x8c36('0x11')][_0x4d7474[_0x8c36('0x69')]]){if(_0x4d7474[_0x8c36('0x9b')]&&_0x4d7474['transfer']!=!![]){this[_0x8c36('0x11')][_0x4d7474['queue']][_0x8c36('0x5c')]+=0x1;}if(_0x4d7474['queuecallerabandon']){this['voiceQueues'][_0x4d7474['queue']][_0x8c36('0x5d')]+=0x1;}this['voiceQueues'][_0x4d7474[_0x8c36('0x69')]]['sumHoldTime']+=moment(_0x4d7474[_0x8c36('0x88')])[_0x8c36('0xbf')](_0x4d7474[_0x8c36('0x75')],_0x8c36('0x9d'))||0x0;if(_0x10ed2c===this[_0x8c36('0xd')][_0x4f8653[_0x8c36('0x4d')]][_0x8c36('0xbe')]-0x1){this['voiceQueues'][_0x4d7474['queue']][_0x8c36('0x59')]+=moment()[_0x8c36('0xc0')](0x0)[_0x8c36('0xbf')](_0x4d7474[_0x8c36('0x75')],_0x8c36('0x9d'));this['voiceQueues'][_0x4d7474['queue']][_0x8c36('0x5b')]+=0x1;if(_0x4d7474['queuecallercomplete']){this[_0x8c36('0x11')][_0x4d7474[_0x8c36('0x69')]][_0x8c36('0x56')]+=0x1;this[_0x8c36('0x11')][_0x4d7474['queue']][_0x8c36('0x58')]+=moment()[_0x8c36('0xc0')](0x0)[_0x8c36('0xbf')](_0x4d7474[_0x8c36('0x88')],_0x8c36('0x9d'));_0x4d7474['queuecallercompleteAt']=moment()[_0x8c36('0x4e')](_0x8c36('0x76'));_0x4d7474['queuecallerexit']=![];_0x4d7474[_0x8c36('0x93')]=null;}if(_0x4d7474[_0x8c36('0x9b')]&&_0x4d7474[_0x8c36('0x94')]!=!![]){_0x4d7474[_0x8c36('0xab')]=_0x8c36('0x5c');logger[_0x8c36('0x47')](_0x8c36('0xc1'),_0x4f8653[_0x8c36('0x4d')],util[_0x8c36('0x3f')](_0x4d7474,{'showHidden':![],'depth':null}));ami[_0x8c36('0x45')](_0x8c36('0xc2'),_0x4d7474);}if(_0x4d7474[_0x8c36('0x1b')]){_0x4d7474[_0x8c36('0xab')]='abandoned';logger['debug']('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x4f8653['uniqueid'],util[_0x8c36('0x3f')](_0x4d7474,{'showHidden':![],'depth':null}));ami[_0x8c36('0x45')](_0x8c36('0xc3'),_0x4d7474);}}else{this['voiceQueues'][_0x4d7474[_0x8c36('0x69')]][_0x8c36('0x59')]+=this[_0x8c36('0x11')][_0x4d7474['queue']][_0x8c36('0x5a')];}logger[_0x8c36('0x78')](_0x8c36('0xc4'),_0x4f8653[_0x8c36('0x4d')],_0x4d7474[_0x8c36('0x4a')],_0x4d7474[_0x8c36('0x53')],_0x4f8653['cause-txt']);this[_0x8c36('0xf')][_0x4f8653[_0x8c36('0x4d')]]=_0x4d7474;this['emitVoiceQueueChannelRemove'](_0x4d7474,_0x8c36('0x25'));this[_0x8c36('0x52')](this[_0x8c36('0x11')][_0x4d7474[_0x8c36('0x69')]],_0x8c36('0x25'));}}logger[_0x8c36('0x47')](_0x8c36('0xc5'),_0x4f8653['uniqueid'],util[_0x8c36('0x3f')](this[_0x8c36('0xd')][_0x4f8653['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x8c36('0x45')]('custom:voiceQueueReport',this[_0x8c36('0xd')][_0x4f8653[_0x8c36('0x4d')]]);delete this[_0x8c36('0xd')][_0x4f8653[_0x8c36('0x4d')]];delete this[_0x8c36('0xf')][_0x4f8653[_0x8c36('0x4d')]];}if(this[_0x8c36('0x14')][_0x4f8653[_0x8c36('0x4d')]]){delete this[_0x8c36('0x14')][_0x4f8653[_0x8c36('0x4d')]];}}}catch(_0x2aecc2){logger['error']('[%s][voiceQueueReport][hangup]',_0x4f8653[_0x8c36('0x4d')],util[_0x8c36('0x3f')](_0x2aecc2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c36('0x9')]['syncAttendedTransfer']=function(_0xe5a50){try{if(this[_0x8c36('0x64')](_0xe5a50)){logger['debug'](_0x8c36('0xc6'),_0xe5a50['uniqueid'],util[_0x8c36('0x3f')](_0xe5a50,{'showHidden':![],'depth':null}));var _0x4cd9d1;if(this[_0x8c36('0xd')][_0xe5a50[_0x8c36('0xc7')]]){_0x4cd9d1=_['last'](this[_0x8c36('0xd')][_0xe5a50[_0x8c36('0xc7')]]);_0x4cd9d1[_0x8c36('0xc8')]=_0xe5a50[_0x8c36('0xc9')];_0x4cd9d1[_0x8c36('0xa1')]=_0xe5a50[_0x8c36('0xca')];_0x4cd9d1['queuecallerexitreason']=_0x8c36('0xcb');_0x4cd9d1['transfer']=!![];_0x4cd9d1[_0x8c36('0x9f')]='ATTENDED';if(this[_0x8c36('0xd')][_0xe5a50[_0x8c36('0xca')]]){var _0x5a732c=this[_0x8c36('0xd')][_0xe5a50['secondtransfereruniqueid']];this[_0x8c36('0xd')][_0xe5a50[_0x8c36('0xca')]]=this['queueReports'][_0xe5a50[_0x8c36('0xc7')]];this[_0x8c36('0xd')][_0xe5a50[_0x8c36('0xc7')]]=_0x5a732c;var _0x1a896d=_[_0x8c36('0x87')](this[_0x8c36('0xd')][_0xe5a50[_0x8c36('0xc7')]]);_0x1a896d[_0x8c36('0x36')]=!![];}logger[_0x8c36('0x78')](_0x8c36('0xcc'),_0xe5a50[_0x8c36('0x4d')],_0x4cd9d1['name'],_0x4cd9d1['type'],_0x4cd9d1[_0x8c36('0xc8')],_0x4cd9d1[_0x8c36('0xa1')]);}else if(this[_0x8c36('0xd')][_0xe5a50[_0x8c36('0xcd')]]){_0x4cd9d1=_['last'](this[_0x8c36('0xd')][_0xe5a50[_0x8c36('0xcd')]]);_0x4cd9d1['transferexten']=_0xe5a50[_0x8c36('0xce')];_0x4cd9d1['transferuniqueid']=_0xe5a50[_0x8c36('0xcf')];_0x4cd9d1[_0x8c36('0x83')]=_0x8c36('0xcb');_0x4cd9d1[_0x8c36('0x94')]=!![];_0x4cd9d1['transfertype']=_0x8c36('0xd0');if(this[_0x8c36('0xd')][_0xe5a50[_0x8c36('0xcf')]]){var _0x5a732c=this[_0x8c36('0xd')][_0xe5a50[_0x8c36('0xcf')]];this['queueReports'][_0xe5a50[_0x8c36('0xcf')]]=this[_0x8c36('0xd')][_0xe5a50[_0x8c36('0xcd')]];this['queueReports'][_0xe5a50[_0x8c36('0xcd')]]=_0x5a732c;var _0x1a896d=_['last'](this[_0x8c36('0xd')][_0xe5a50[_0x8c36('0xcd')]]);_0x1a896d[_0x8c36('0x36')]=!![];}logger['info']('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0xe5a50[_0x8c36('0x4d')],_0x4cd9d1[_0x8c36('0x4a')],_0x4cd9d1[_0x8c36('0x53')],_0x4cd9d1[_0x8c36('0xc8')],_0x4cd9d1[_0x8c36('0xa1')]);}}}catch(_0x5afa8d){logger[_0x8c36('0x3d')](_0x8c36('0xc6'),_0xe5a50[_0x8c36('0x4d')],util['inspect'](_0x5afa8d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x8c36('0x9')][_0x8c36('0xd1')]=function(_0x4df13e){try{if(this['isNotNull'](_0x4df13e)){logger['debug']('[%s][voiceQueueReport][blindtransfer]',_0x4df13e[_0x8c36('0x4d')],util['inspect'](_0x4df13e,{'showHidden':![],'depth':null}));if(this[_0x8c36('0xd')][_0x4df13e[_0x8c36('0xc7')]]){var _0x4b9754=_[_0x8c36('0x87')](this[_0x8c36('0xd')][_0x4df13e[_0x8c36('0xc7')]]);_0x4b9754[_0x8c36('0x83')]=_0x8c36('0xd2');_0x4b9754[_0x8c36('0x94')]=!![];_0x4b9754['transfertype']=_0x8c36('0xd3');_0x4b9754['transferexten']=_0x4df13e['extension'];_0x4b9754[_0x8c36('0xa1')]=_0x4df13e[_0x8c36('0xc7')];logger[_0x8c36('0x78')]('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x4df13e[_0x8c36('0x4d')],_0x4b9754[_0x8c36('0x4a')],_0x4b9754['type'],_0x4b9754['transferexten'],_0x4b9754['transferuniqueid']);this[_0x8c36('0x26')]({'event':_0x8c36('0xd4'),'uniqueid':_0x4df13e[_0x8c36('0xc7')],'context':_0x4df13e['context'],'channel':_0x4df13e[_0x8c36('0xd5')]});}}}catch(_0x103d4b){logger['error'](_0x8c36('0xd6'),_0x4df13e[_0x8c36('0x4d')],util[_0x8c36('0x3f')](_0x103d4b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8c36('0x2a')]=function(_0x4282f1){try{if(this[_0x8c36('0x64')](_0x4282f1)){logger['debug'](_0x8c36('0xd7'),_0x4282f1['uniqueid'],util['inspect'](_0x4282f1,{'showHidden':![],'depth':null}));if(this[_0x8c36('0xd')][_0x4282f1['uniqueid']]){var _0x4e8e93=_[_0x8c36('0x87')](this['queueReports'][_0x4282f1['uniqueid']]);if(!_[_0x8c36('0x37')](_0x4e8e93[_0x8c36('0x88')])){_0x4e8e93[_0x8c36('0xd8')]=moment()[_0x8c36('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x8c36('0x78')](_0x8c36('0xd9'),_0x4282f1[_0x8c36('0x4d')],_0x4e8e93['mohstarttime']);}}}}catch(_0x1b49c7){logger[_0x8c36('0x3d')](_0x8c36('0xd7'),_0x4282f1[_0x8c36('0x4d')],util['inspect'](_0x1b49c7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x8c36('0x2c')]=function(_0x17bead){try{if(this['isNotNull'](_0x17bead)){logger[_0x8c36('0x47')]('[%s][voiceQueueReport][musiconholdstop]',_0x17bead[_0x8c36('0x4d')],util[_0x8c36('0x3f')](_0x17bead,{'showHidden':![],'depth':null}));if(this[_0x8c36('0xd')][_0x17bead['uniqueid']]){var _0x2b84ea=_[_0x8c36('0x87')](this[_0x8c36('0xd')][_0x17bead[_0x8c36('0x4d')]]);if(!_['isNil'](_0x2b84ea['mohstarttime'])){_0x2b84ea[_0x8c36('0xda')]+=moment()[_0x8c36('0xc0')](0x0)[_0x8c36('0xbf')](_0x2b84ea[_0x8c36('0xd8')],_0x8c36('0x9d'));logger['info'](_0x8c36('0xdb'),_0x17bead[_0x8c36('0x4d')],_0x2b84ea[_0x8c36('0xda')]);delete _0x2b84ea[_0x8c36('0xd8')];}}}}catch(_0x10f3ef){logger[_0x8c36('0x3d')](_0x8c36('0xdc'),_0x17bead[_0x8c36('0x4d')],util['inspect'](_0x10f3ef,{'showHidden':![],'depth':null}));}};module[_0x8c36('0xdd')]=VoiceQueueReport;
\ No newline at end of file