Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index 6dbc176..62a11c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5363=['[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','syncAgentConnect','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','assigned','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexit','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','destexten','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][agentcomplete]','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','CONTINUE','lastevent','timeout','custom:timeout','EXITWITHKEY','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','membername','memberpenalty','memberrealtime','includes','syncHangup','[%s][voiceQueueReport][hangup]','length','sumHoldTime','milliseconds','diff','answered','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','transferuniqueid','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','origtransfereruniqueid','transfertargetuniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','syncNewExten','applicationdata','CDR(routeAlias)','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','md5','ioredis','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','prototype','enqueue','tail','finally','sequence','queueReports','agents','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','varset','syncVarSet','fullybooted','syncFullyBooted','musiconholdstart','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','channels','switch','isNil','Action','status','channel','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%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','voice_queue_channel:save','voice_queue_presence:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','ATTENDEDTRANSFER','name','emitVoiceQueueSummary','type','inbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','unmanaged','abandoned','Trunk','active','Interval','stringify',']\x20sending\x20voice_queue:save\x20event:','isNotNull','isUndefined','catch','[voiceQueueReport][queues]','flagQueueSummary','then','queue','[voiceQueueReport][queuesummary]\x20name:%s','callers','toNumber','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummary]','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','pick','keys'];(function(_0x4c3607,_0x1088bf){var _0x130440=function(_0x843e43){while(--_0x843e43){_0x4c3607['push'](_0x4c3607['shift']());}};_0x130440(++_0x1088bf);}(_0x5363,0x15d));var _0x3536=function(_0x1de14f,_0x3563cb){_0x1de14f=_0x1de14f-0x0;var _0x512594=_0x5363[_0x1de14f];return _0x512594;};'use strict';var _=require(_0x3536('0x0'));var moment=require('moment');var util=require('util');var md5=require(_0x3536('0x1'));var Redis=require(_0x3536('0x2'));var config=require('../../../config/environment');var logger=require(_0x3536('0x3'))(_0x3536('0x4'));var ami=require(_0x3536('0x5'));var QueueReport=require(_0x3536('0x6'));config[_0x3536('0x7')]=_[_0x3536('0x8')](config[_0x3536('0x7')],{'host':_0x3536('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3536('0x7')]));var Sequence=function(){};Sequence[_0x3536('0xa')][_0x3536('0xb')]=function(_0xca6c18){this[_0x3536('0xc')]=this[_0x3536('0xc')]?this[_0x3536('0xc')][_0x3536('0xd')](_0xca6c18):_0xca6c18();};function VoiceQueueReport(_0x4f7644){this[_0x3536('0xe')]=new Sequence();this[_0x3536('0xf')]={};this[_0x3536('0x10')]=_0x4f7644[_0x3536('0x10')];this['channels']=_0x4f7644[_0x3536('0x11')];this[_0x3536('0x12')]=_0x4f7644[_0x3536('0x12')];this['flagQueueSummary']=!![];this[_0x3536('0x13')]=_0x4f7644[_0x3536('0x13')];this[_0x3536('0x14')]={};ami['on'](_0x3536('0x15'),this[_0x3536('0x16')][_0x3536('0x17')](this));ami['on'](_0x3536('0x18'),this[_0x3536('0x19')]['bind'](this));ami['on'](_0x3536('0x1a'),this[_0x3536('0x1b')]['bind'](this));ami['on'](_0x3536('0x1c'),this[_0x3536('0x1d')][_0x3536('0x17')](this));ami['on'](_0x3536('0x1e'),this[_0x3536('0x1f')]['bind'](this));ami['on'](_0x3536('0x20'),this['syncAgentComplete']['bind'](this));ami['on'](_0x3536('0x21'),this['syncAgentConnect'][_0x3536('0x17')](this));ami['on'](_0x3536('0x22'),this[_0x3536('0x23')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x3536('0x24'),this[_0x3536('0x25')][_0x3536('0x17')](this));ami['on'](_0x3536('0x26'),this['syncMusicOnHoldStart'][_0x3536('0x17')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x3536('0x17')](this));ami['on']('attendedtransfer',this[_0x3536('0x27')]['bind'](this));ami['on'](_0x3536('0x28'),this[_0x3536('0x29')][_0x3536('0x17')](this));this[_0x3536('0x2a')]();this[_0x3536('0x2b')]();}function clearChannels(_0x1a77c3){if(!_[_0x3536('0x2c')](_0x1a77c3)){for(var _0x5aa22e in _0x1a77c3){if(_0x1a77c3[_0x3536('0x2d')](_0x5aa22e)){delete _0x1a77c3[_0x5aa22e];}}}}function clearCampaigns(_0x17f7eb){if(!_['isEmpty'](_0x17f7eb)){for(var _0x30000a in _0x17f7eb){if(_0x17f7eb[_0x3536('0x2d')](_0x30000a)){_0x17f7eb[_0x30000a][_0x3536('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x16302d){if(!_['isEmpty'](_0x16302d)){for(var _0x32f9c7 in _0x16302d){if(_0x16302d['hasOwnProperty'](_0x32f9c7)){_0x16302d[_0x32f9c7][_0x3536('0x2e')]=0x0;_0x16302d[_0x32f9c7][_0x3536('0x2f')]=0x0;_0x16302d[_0x32f9c7]['pTalking']=0x0;_0x16302d[_0x32f9c7][_0x3536('0x30')]=0x0;_0x16302d[_0x32f9c7][_0x3536('0x31')]=!![];}}}}function clearAgentBooked(_0x4a81a6){if(!_['isEmpty'](_0x4a81a6)){for(var _0x9d43e in _0x4a81a6){if(_0x4a81a6[_0x3536('0x2d')](_0x9d43e)){_0x4a81a6[_0x9d43e][_0x3536('0x32')]=!![];}}}}VoiceQueueReport['prototype'][_0x3536('0x33')]=function(){var _0x45c441=this;for(var _0x3cc8f9 in this[_0x3536('0x34')]){if(this[_0x3536('0x34')][_0x3536('0x2d')](_0x3cc8f9)&&!this[_0x3536('0x34')][_0x3cc8f9][_0x3536('0x35')]){this[_0x3536('0xe')][_0x3536('0xb')](function(){if(!_[_0x3536('0x36')](_0x45c441[_0x3536('0x34')][_0x3cc8f9])){return ami[_0x3536('0x37')]({'action':_0x3536('0x38'),'channel':_0x45c441['channels'][_0x3cc8f9][_0x3536('0x39')]})['catch'](function(_0x501bbe){if(_0x501bbe[_0x3536('0x3a')]===_0x3536('0x3b')){setTimeout(function(){if(_0x45c441[_0x3536('0x34')][_0x3cc8f9]){delete _0x45c441['channels'][_0x3cc8f9];logger[_0x3536('0x3c')](_0x3536('0x3d'),_0x3cc8f9,util[_0x3536('0x3e')](_0x501bbe,{'showHidden':![],'depth':null}));}if(_0x45c441['queueReports'][_0x3cc8f9]){delete _0x45c441[_0x3536('0xf')][_0x3cc8f9];logger[_0x3536('0x3c')](_0x3536('0x3f'),_0x3cc8f9,util['inspect'](_0x501bbe,{'showHidden':![],'depth':null}));}if(_0x45c441[_0x3536('0x14')][_0x3cc8f9]){delete _0x45c441[_0x3536('0x14')][_0x3cc8f9];logger['error'](_0x3536('0x40'),_0x3cc8f9,util['inspect'](_0x501bbe,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x3536('0xa')][_0x3536('0x25')]=function(){logger[_0x3536('0x3c')](_0x3536('0x41'));clearChannels(this[_0x3536('0x34')]);this[_0x3536('0x42')](this['queueReports']);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x3536('0x12')]);clearCampaigns(this[_0x3536('0x13')]);};VoiceQueueReport[_0x3536('0xa')]['clearQueueReport']=function(_0x4f2b06){var _0x39f633=this;if(!_[_0x3536('0x2c')](_0x4f2b06)){for(var _0x4e35da in _0x4f2b06){if(_0x4f2b06[_0x3536('0x2d')](_0x4e35da)){_0x39f633[_0x3536('0x43')](_0x4f2b06[_0x4e35da],_0x3536('0x44'));delete _0x4f2b06[_0x4e35da];}}}};VoiceQueueReport[_0x3536('0xa')][_0x3536('0x45')]=function(_0x215e70,_0x4d31d1,_0x4f0880){io['to'](_0x215e70)[_0x3536('0x45')](_0x4d31d1,_0x4f0880);};VoiceQueueReport[_0x3536('0xa')][_0x3536('0x46')]=function(_0x550661,_0x55ca6b){logger['debug'](_0x3536('0x47')+_0x55ca6b+_0x3536('0x48'),_0x550661[_0x3536('0x49')],util[_0x3536('0x3e')](_0x550661,{'showHidden':![],'depth':null}));this[_0x3536('0x45')](util[_0x3536('0x4a')](_0x3536('0x4b'),_0x550661['name']),_0x3536('0x4c'),_0x550661);io[_0x3536('0x45')](_0x3536('0x4d'),_0x550661);};VoiceQueueReport[_0x3536('0xa')][_0x3536('0x43')]=function(_0x30f44a,_0x278582){logger[_0x3536('0x4e')](_0x3536('0x47')+_0x278582+_0x3536('0x4f'),_0x30f44a[_0x3536('0x49')],util[_0x3536('0x3e')](_0x30f44a,{'showHidden':![],'depth':null}));if(_0x30f44a['queuecallerexitreason']===_0x3536('0x50'))return;this[_0x3536('0x45')](util[_0x3536('0x4a')](_0x3536('0x4b'),_0x30f44a[_0x3536('0x51')]),'voice_queue_channel:remove',_0x30f44a);io[_0x3536('0x45')]('voice_queue_presence:remove',_0x30f44a);};VoiceQueueReport[_0x3536('0xa')][_0x3536('0x52')]=function(_0x5290c8,_0x39aef8){if(_0x5290c8[_0x3536('0x53')]===_0x3536('0x54')){var _0x200326={'id':_0x5290c8['id'],'name':_0x5290c8[_0x3536('0x51')],'strategy':_0x5290c8[_0x3536('0x55')],'answered':_0x5290c8['answered'],'available':_0x5290c8[_0x3536('0x56')],'loggedIn':_0x5290c8[_0x3536('0x57')],'pTalking':_0x5290c8[_0x3536('0x58')],'sumBillable':_0x5290c8[_0x3536('0x59')],'sumDuration':_0x5290c8[_0x3536('0x5a')],'sumHoldTime':_0x5290c8['sumHoldTime']||0x0,'talking':_0x5290c8[_0x3536('0x2f')],'total':_0x5290c8['total'],'type':_0x5290c8[_0x3536('0x53')],'unmanaged':_0x5290c8[_0x3536('0x5b')],'abandoned':_0x5290c8[_0x3536('0x5c')],'waiting':_0x5290c8[_0x3536('0x30')]};if(_0x5290c8['Trunk']){_0x200326[_0x3536('0x5d')]={'id':_0x5290c8[_0x3536('0x5d')]['id'],'name':_0x5290c8['Trunk'][_0x3536('0x51')],'active':_0x5290c8[_0x3536('0x5d')][_0x3536('0x5e')],'callerid':_0x5290c8[_0x3536('0x5d')]['callerid']};}if(_0x5290c8['Interval']){_0x200326[_0x3536('0x5f')]={'id':_0x5290c8[_0x3536('0x5f')]['id'],'name':_0x5290c8[_0x3536('0x5f')]['name']};}var _0x4b501f=md5(JSON[_0x3536('0x60')](_0x200326));if(_0x5290c8[_0x3536('0x1')]!==_0x4b501f){_0x5290c8[_0x3536('0x1')]=_0x4b501f;logger[_0x3536('0x4e')]('[voiceQueueReport]['+_0x39aef8+_0x3536('0x61'),util[_0x3536('0x3e')](_0x200326,{'showHidden':![],'depth':null}));this[_0x3536('0x45')](util['format']('voice:queue:%s',_0x200326[_0x3536('0x51')]),'voice_queue:save',_0x200326);}}};VoiceQueueReport[_0x3536('0xa')][_0x3536('0x62')]=function(_0x3e1bcd){return _0x3e1bcd!==null&&!_[_0x3536('0x63')](_0x3e1bcd);};VoiceQueueReport['prototype']['loopQueueShow']=function(){var _0x48aaac=this;setInterval(function(){_0x48aaac['clearZombieChannels']();ami[_0x3536('0x37')]({'action':'queues'})[_0x3536('0x64')](function(_0x59ec1e){logger[_0x3536('0x3c')](_0x3536('0x65'),util[_0x3536('0x3e')](_0x59ec1e,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x3536('0x2a')]=function(){var _0x3a2324=this;setInterval(function(){if(_0x3a2324[_0x3536('0x66')]){return ami[_0x3536('0x37')]({'action':_0x3536('0x15')})[_0x3536('0x67')](function(){_0x3a2324[_0x3536('0x66')]=![];})['catch'](function(_0x506d92){logger[_0x3536('0x3c')]('[voiceQueueReport][queuesummary]',util[_0x3536('0x3e')](_0x506d92,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x3536('0xa')][_0x3536('0x16')]=function(_0x5cb0dc){try{if(this[_0x3536('0x62')](_0x5cb0dc)&&this[_0x3536('0x62')](_0x5cb0dc['queue'])){logger[_0x3536('0x4e')]('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x5cb0dc,{'showHidden':![],'depth':null}));if(this[_0x3536('0x12')][_0x5cb0dc[_0x3536('0x68')]]){logger['info'](_0x3536('0x69'),_0x5cb0dc[_0x3536('0x68')]);var _0x57086a=_['countBy'](this['channels'],_0x3536('0x68'))[_0x5cb0dc['queue']]||0x0;var _0x3b0199=_0x57086a-_0x5cb0dc[_0x3536('0x6a')];if(this[_0x3536('0x12')][_0x5cb0dc[_0x3536('0x68')]][_0x3536('0x30')]!==_[_0x3536('0x6b')](_0x5cb0dc[_0x3536('0x6a')])||this[_0x3536('0x12')][_0x5cb0dc[_0x3536('0x68')]][_0x3536('0x57')]!==_['toNumber'](_0x5cb0dc[_0x3536('0x6c')])||this['voiceQueues'][_0x5cb0dc[_0x3536('0x68')]][_0x3536('0x56')]!==_[_0x3536('0x6b')](_0x5cb0dc[_0x3536('0x56')])||this['voiceQueues'][_0x5cb0dc[_0x3536('0x68')]][_0x3536('0x2f')]!==_0x3b0199){this['voiceQueues'][_0x5cb0dc[_0x3536('0x68')]]['waiting']=_[_0x3536('0x6b')](_0x5cb0dc['callers']);this['voiceQueues'][_0x5cb0dc['queue']][_0x3536('0x57')]=_[_0x3536('0x6b')](_0x5cb0dc['loggedin']);this['voiceQueues'][_0x5cb0dc['queue']][_0x3536('0x56')]=_['toNumber'](_0x5cb0dc[_0x3536('0x56')]);this[_0x3536('0x12')][_0x5cb0dc[_0x3536('0x68')]]['talking']=_0x3b0199>0x0?_0x3b0199:0x0;this['voiceQueues'][_0x5cb0dc['queue']][_0x3536('0x2f')]=this[_0x3536('0x12')][_0x5cb0dc[_0x3536('0x68')]][_0x3536('0x2f')]>_[_0x3536('0x6b')](_0x5cb0dc['loggedin'])?_[_0x3536('0x6b')](_0x5cb0dc[_0x3536('0x6c')]):this['voiceQueues'][_0x5cb0dc[_0x3536('0x68')]][_0x3536('0x2f')];this['emitVoiceQueueSummary'](this[_0x3536('0x12')][_0x5cb0dc['queue']],_0x3536('0x15'));}logger['debug'](_0x3536('0x6d'),util[_0x3536('0x3e')](this[_0x3536('0x12')][_0x5cb0dc[_0x3536('0x68')]],{'showHidden':![],'depth':null}));ami['emit'](_0x3536('0x6e'),this[_0x3536('0x12')][_0x5cb0dc[_0x3536('0x68')]]);}}}catch(_0x29f892){logger[_0x3536('0x3c')](_0x3536('0x6f'),util['inspect'](_0x29f892,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3536('0xa')]['syncQueueSummaryComplete']=function(_0x2799e8){logger[_0x3536('0x4e')]('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x3536('0x3e')](_0x2799e8,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0x3536('0x1b')]=function(_0x3dfd77){try{if(this[_0x3536('0x62')](_0x3dfd77)){logger['debug'](_0x3536('0x70'),_0x3dfd77[_0x3536('0x49')],util[_0x3536('0x3e')](_0x3dfd77,{'showHidden':![],'depth':null}));if(_[_0x3536('0x63')](this[_0x3536('0xf')][_0x3dfd77[_0x3536('0x49')]]))this['queueReports'][_0x3dfd77[_0x3536('0x49')]]=[];if(_[_0x3536('0x63')](this[_0x3536('0x34')][_0x3dfd77[_0x3536('0x49')]]))this[_0x3536('0x34')][_0x3dfd77[_0x3536('0x49')]]={};var _0x564143=new QueueReport();_0x564143[_0x3536('0x51')]=_0x3dfd77['queue'];_0x564143[_0x3536('0x53')]=this[_0x3536('0x12')][_0x564143['name']]&&this['voiceQueues'][_0x564143['name']][_0x3536('0x53')]?this[_0x3536('0x12')][_0x564143[_0x3536('0x51')]][_0x3536('0x53')]||'inbound':_0x3536('0x54');_0x564143[_0x3536('0x68')]=_0x3dfd77[_0x3536('0x68')];_0x564143[_0x3536('0x71')]=moment()[_0x3536('0x4a')](_0x3536('0x72'));_0x564143[_0x3536('0x73')]=_0x3dfd77[_0x3536('0x73')];_0x564143[_0x3536('0x74')]=_0x3dfd77[_0x3536('0x74')];_0x564143[_0x3536('0x49')]=_0x3dfd77['uniqueid'];_0x564143[_0x3536('0x75')]=this[_0x3536('0x34')][_0x3dfd77['uniqueid']][_0x3536('0x75')];logger[_0x3536('0x76')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x564143[_0x3536('0x51')],_0x564143[_0x3536('0x53')]);_['merge'](_0x564143,_[_0x3536('0x77')](_0x3dfd77,_[_0x3536('0x78')](_0x564143)));this['queueReports'][_0x3dfd77[_0x3536('0x49')]]['push'](_0x564143);this[_0x3536('0x34')][_0x3dfd77[_0x3536('0x49')]]=_0x564143;this[_0x3536('0x46')](_0x564143,'queuecallerjoin');}}catch(_0x37795f){logger[_0x3536('0x3c')](_0x3536('0x70'),_0x3dfd77['uniqueid'],util['inspect'](_0x37795f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3536('0x1d')]=function(_0x4f0c7d){try{if(this[_0x3536('0x62')](_0x4f0c7d)){logger[_0x3536('0x4e')](_0x3536('0x79'),_0x4f0c7d[_0x3536('0x49')],util[_0x3536('0x3e')](_0x4f0c7d,{'showHidden':![],'depth':null}));if(this[_0x3536('0xf')][_0x4f0c7d['uniqueid']]){var _0x46ef81=_[_0x3536('0x7a')](this[_0x3536('0xf')][_0x4f0c7d[_0x3536('0x49')]]);_0x46ef81[_0x3536('0x7b')]=![];_0x46ef81[_0x3536('0x7c')]=null;_0x46ef81[_0x3536('0x7d')]=_0x4f0c7d[_0x3536('0x7d')];_0x46ef81[_0x3536('0x7e')]=_0x4f0c7d[_0x3536('0x7e')];_0x46ef81[_0x3536('0x1c')]=!![];_0x46ef81[_0x3536('0x7f')]=moment()[_0x3536('0x4a')](_0x3536('0x72'));_0x46ef81[_0x3536('0x80')]=_0x3536('0x81');_0x46ef81[_0x3536('0x82')]=null;logger[_0x3536('0x76')](_0x3536('0x83'),_0x46ef81[_0x3536('0x51')],_0x46ef81[_0x3536('0x53')]);this[_0x3536('0x34')][_0x4f0c7d[_0x3536('0x49')]]=_0x46ef81;this['emitVoiceQueueChannelRemove'](_0x46ef81,_0x3536('0x1c'));}}}catch(_0x35b9b9){logger[_0x3536('0x3c')](_0x3536('0x79'),_0x4f0c7d[_0x3536('0x49')],util['inspect'](_0x35b9b9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3536('0x1f')]=function(_0x5c23fb){try{if(this[_0x3536('0x62')](_0x5c23fb)){logger[_0x3536('0x4e')](_0x3536('0x84'),_0x5c23fb[_0x3536('0x49')],util[_0x3536('0x3e')](_0x5c23fb,{'showHidden':![],'depth':null}));if(this[_0x3536('0xf')][_0x5c23fb[_0x3536('0x49')]]){var _0x136a31=_['last'](this[_0x3536('0xf')][_0x5c23fb[_0x3536('0x49')]]);_0x136a31[_0x3536('0x85')]=moment()[_0x3536('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x136a31[_0x3536('0x86')]=_0x5c23fb[_0x3536('0x86')];_0x136a31[_0x3536('0x87')]=_0x5c23fb['connectedlinename'];logger[_0x3536('0x76')](_0x3536('0x88'),_0x136a31['name'],_0x136a31[_0x3536('0x53')],_0x5c23fb['connectedlinenum'],_0x5c23fb[_0x3536('0x87')]);this[_0x3536('0x34')][_0x5c23fb[_0x3536('0x49')]]=_0x136a31;this[_0x3536('0x46')](_0x136a31,_0x3536('0x1e'));}}}catch(_0x37d076){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x5c23fb[_0x3536('0x49')],util[_0x3536('0x3e')](_0x37d076,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3536('0x89')]=function(_0x4e0142){try{if(this[_0x3536('0x62')](_0x4e0142)){logger[_0x3536('0x4e')]('[%s][voiceQueueReport][agentconnect]',_0x4e0142[_0x3536('0x49')],util['inspect'](_0x4e0142,{'showHidden':![],'depth':null}));if(this[_0x3536('0xf')][_0x4e0142[_0x3536('0x49')]]){var _0x3a9f61=_['last'](this['queueReports'][_0x4e0142[_0x3536('0x49')]]);_0x3a9f61[_0x3536('0x7b')]=!![];_0x3a9f61['queuecallerexitreason']=_0x3536('0x8a');logger[_0x3536('0x76')](_0x3536('0x8b'),_0x3a9f61[_0x3536('0x51')],_0x3a9f61[_0x3536('0x53')]);}}}catch(_0x2a2bb3){logger[_0x3536('0x3c')]('[%s][voiceQueueReport][agentconnect]',_0x4e0142[_0x3536('0x49')],util[_0x3536('0x3e')](_0x2a2bb3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3536('0xa')][_0x3536('0x8c')]=function(_0x13f14b){try{if(this['isNotNull'](_0x13f14b)){logger[_0x3536('0x4e')]('[%s][voiceQueueReport][agentcomplete]',_0x13f14b['uniqueid'],util[_0x3536('0x3e')](_0x13f14b,{'showHidden':![],'depth':null}));if(this[_0x3536('0xf')][_0x13f14b[_0x3536('0x49')]]){var _0x37c31f=_[_0x3536('0x7a')](this[_0x3536('0xf')][_0x13f14b[_0x3536('0x49')]]);_0x37c31f[_0x3536('0x1c')]=![];_0x37c31f['queuecallerabandonAt']=null;_0x37c31f[_0x3536('0x8d')]=!![];_0x37c31f[_0x3536('0x82')]=_0x13f14b['membername'];_0x37c31f[_0x3536('0x7d')]=_0x13f14b[_0x3536('0x7d')];_0x37c31f[_0x3536('0x7b')]=!![];_0x37c31f['queuecallerexit']=![];_0x37c31f[_0x3536('0x8e')]=null;if(!_0x37c31f[_0x3536('0x8f')]){if(_0x13f14b[_0x3536('0x90')]==_0x3536('0x8f')){_0x37c31f[_0x3536('0x80')]='COMPLETED';logger[_0x3536('0x76')](_0x3536('0x91'),_0x37c31f[_0x3536('0x51')],_0x37c31f['type']);}else{if(_[_0x3536('0x92')](_0x13f14b[_0x3536('0x39')][_0x3536('0x93')](),_0x3536('0x94'))){if(this[_0x3536('0xf')][_0x13f14b[_0x3536('0x95')]]){var _0x56d970=_['last'](this[_0x3536('0xf')][_0x13f14b[_0x3536('0x95')]]);_0x56d970[_0x3536('0x7b')]=![];_0x56d970[_0x3536('0x96')]=!![];_0x56d970['queuecallerexitAt']=moment(_0x37c31f[_0x3536('0x71')])[_0x3536('0x97')](_0x13f14b[_0x3536('0x7d')],_0x3536('0x98'))[_0x3536('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x56d970[_0x3536('0x80')]=_0x3536('0x99');_0x56d970[_0x3536('0x8f')]=!![];_0x56d970[_0x3536('0x9a')]=_0x3536('0x9b');_0x56d970['transferexten']=_0x13f14b[_0x3536('0x9c')];_0x56d970['transferuniqueid']=_0x13f14b['uniqueid'];logger[_0x3536('0x76')](_0x3536('0x9d'),_0x56d970[_0x3536('0x51')],_0x56d970[_0x3536('0x53')]);var _0x18c623=this[_0x3536('0xf')][_0x13f14b['linkedid']];this['queueReports'][_0x13f14b[_0x3536('0x95')]]=this['queueReports'][_0x13f14b['uniqueid']];this[_0x3536('0xf')][_0x13f14b['uniqueid']]=_0x18c623;}}else{_0x37c31f['queuecallerexitreason']=_0x3536('0x9e')+_0x13f14b[_0x3536('0x90')]['toUpperCase']();logger[_0x3536('0x76')](_0x3536('0x9f'),_0x37c31f[_0x3536('0x51')],_0x37c31f[_0x3536('0x53')],_0x37c31f[_0x3536('0x80')]);}}}this['channels'][_0x13f14b[_0x3536('0x49')]]=_0x37c31f;this[_0x3536('0x43')](_0x37c31f,_0x3536('0x20'));}}}catch(_0x3e1ae1){logger['error'](_0x3536('0xa0'),_0x13f14b[_0x3536('0x49')],util['inspect'](_0x3e1ae1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3536('0x23')]=function(_0x47892c){try{if(this['isNotNull'](_0x47892c)){logger[_0x3536('0x4e')](_0x3536('0xa1'),_0x47892c[_0x3536('0x49')],util[_0x3536('0x3e')](_0x47892c,{'showHidden':![],'depth':null}));this[_0x3536('0xa2')](_0x47892c[_0x3536('0x49')],_[_0x3536('0x78')](_0x47892c[_0x3536('0xa3')])[0x0],_0x47892c[_0x3536('0xa4')]);if(this['queueReports'][_0x47892c[_0x3536('0x49')]]){var _0x142145=_[_0x3536('0x7a')](this[_0x3536('0xf')][_0x47892c['uniqueid']]);if(_0x142145){if(this[_0x3536('0x62')](_0x47892c[_0x3536('0xa3')])&&this['isNotNull'](_0x47892c['variable'][_0x3536('0xa5')])){switch(_0x47892c[_0x3536('0xa4')]){case _0x3536('0xa6'):_0x142145[_0x3536('0x96')]=![];_0x142145[_0x3536('0x8e')]=null;break;case'TIMEOUT':_0x142145[_0x3536('0xa7')]=_0x3536('0xa8');_0x142145['queuecallerexit']=!![];_0x142145[_0x3536('0x8e')]=moment()['format'](_0x3536('0x72'));_0x142145[_0x3536('0x85')]=moment()['format'](_0x3536('0x72'));logger[_0x3536('0x4e')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x47892c['uniqueid'],util[_0x3536('0x3e')](_0x142145,{'showHidden':![],'depth':null}));ami['emit'](_0x3536('0xa9'),_0x142145);break;default:_0x142145[_0x3536('0x96')]=!![];_0x142145[_0x3536('0x8e')]=moment()['format'](_0x3536('0x72'));_0x142145[_0x3536('0x85')]=moment()[_0x3536('0x4a')](_0x3536('0x72'));}_0x142145[_0x3536('0x1c')]=![];_0x142145[_0x3536('0x7f')]=null;_0x142145[_0x3536('0x80')]=_0x47892c[_0x3536('0xa4')];this[_0x3536('0x34')][_0x47892c[_0x3536('0x49')]]=_0x142145;this[_0x3536('0x43')](_0x142145,_0x3536('0x22'));}else if(this[_0x3536('0x62')](_0x47892c[_0x3536('0xa3')])&&this[_0x3536('0x62')](_0x47892c[_0x3536('0xa3')]['queueposition'])){if(!_0x142145[_0x3536('0x1c')]){_0x142145['queuecallerexit']=!![];_0x142145['queuecallerexitAt']=moment()[_0x3536('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x142145[_0x3536('0x80')]=_0x3536('0xaa');_0x142145[_0x3536('0x85')]=moment()[_0x3536('0x4a')](_0x3536('0x72'));this[_0x3536('0x34')][_0x47892c[_0x3536('0x49')]]=_0x142145;}}logger[_0x3536('0x76')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x47892c[_0x3536('0x49')],_0x142145[_0x3536('0x51')],_0x142145[_0x3536('0x53')],_['keys'](_0x47892c[_0x3536('0xa3')])[0x0],_0x47892c[_0x3536('0xa4')]);_0x142145[_0x3536('0x14')]=this[_0x3536('0x14')][_0x47892c[_0x3536('0x49')]];}}}}catch(_0x4096c5){logger['error'](_0x3536('0xa1'),_0x47892c[_0x3536('0x49')],util[_0x3536('0x3e')](_0x4096c5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3536('0xa2')]=function(_0x9c1672,_0x3534ea,_0x49da9a){var _0x26286d=[_0x3536('0xab'),_0x3536('0xac'),_0x3536('0xad'),_0x3536('0xae'),_0x3536('0xaf'),_0x3536('0xb0'),_0x3536('0xb1'),_0x3536('0xb2'),_0x3536('0xb3'),_0x3536('0xb4'),_0x3536('0xb5'),_0x3536('0xb6'),'membercalls',_0x3536('0xb7'),_0x3536('0xb8'),'memberlastcall',_0x3536('0xb9'),_0x3536('0xba'),_0x3536('0xbb')];if(!_[_0x3536('0x36')](_0x3534ea)&&!_[_0x3536('0xbc')](_0x26286d,_0x3534ea)){if(_[_0x3536('0x63')](this['variables'][_0x9c1672])){this[_0x3536('0x14')][_0x9c1672]={};}this[_0x3536('0x14')][_0x9c1672][_0x3534ea]=_0x49da9a;}};VoiceQueueReport['prototype'][_0x3536('0xbd')]=function(_0x3da850){try{if(this[_0x3536('0x62')](_0x3da850)){logger['debug'](_0x3536('0xbe'),_0x3da850[_0x3536('0x49')],util[_0x3536('0x3e')](_0x3da850,{'showHidden':![],'depth':null}));if(this[_0x3536('0xf')][_0x3da850['uniqueid']]){for(var _0x272c8f=0x0,_0x2b5ac9={};_0x272c8f<this['queueReports'][_0x3da850[_0x3536('0x49')]][_0x3536('0xbf')];_0x272c8f+=0x1){_0x2b5ac9=this['queueReports'][_0x3da850['uniqueid']][_0x272c8f];if(this['voiceQueues'][_0x2b5ac9[_0x3536('0x68')]]){if(_0x2b5ac9[_0x3536('0x96')]&&_0x2b5ac9[_0x3536('0x8f')]!=!![]){this[_0x3536('0x12')][_0x2b5ac9[_0x3536('0x68')]]['unmanaged']+=0x1;}if(_0x2b5ac9[_0x3536('0x1c')]){this[_0x3536('0x12')][_0x2b5ac9['queue']]['abandoned']+=0x1;}this[_0x3536('0x12')][_0x2b5ac9[_0x3536('0x68')]][_0x3536('0xc0')]+=moment(_0x2b5ac9['queuecallerleaveAt'])['diff'](_0x2b5ac9[_0x3536('0x71')],_0x3536('0x98'))||0x0;if(_0x272c8f===this[_0x3536('0xf')][_0x3da850[_0x3536('0x49')]][_0x3536('0xbf')]-0x1){this[_0x3536('0x12')][_0x2b5ac9[_0x3536('0x68')]]['sumDuration']+=moment()[_0x3536('0xc1')](0x0)[_0x3536('0xc2')](_0x2b5ac9['queuecallerjoinAt'],_0x3536('0x98'));this['voiceQueues'][_0x2b5ac9['queue']]['total']+=0x1;if(_0x2b5ac9[_0x3536('0x7b')]){this[_0x3536('0x12')][_0x2b5ac9['queue']][_0x3536('0xc3')]+=0x1;this[_0x3536('0x12')][_0x2b5ac9[_0x3536('0x68')]][_0x3536('0x59')]+=moment()[_0x3536('0xc1')](0x0)[_0x3536('0xc2')](_0x2b5ac9[_0x3536('0x85')],_0x3536('0x98'));_0x2b5ac9[_0x3536('0x7c')]=moment()[_0x3536('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b5ac9[_0x3536('0x96')]=![];_0x2b5ac9[_0x3536('0x8e')]=null;}if(_0x2b5ac9['queuecallerexit']&&_0x2b5ac9[_0x3536('0x8f')]!=!![]){_0x2b5ac9[_0x3536('0xa7')]='unmanaged';logger[_0x3536('0x4e')](_0x3536('0xc4'),_0x3da850[_0x3536('0x49')],util['inspect'](_0x2b5ac9,{'showHidden':![],'depth':null}));ami[_0x3536('0x45')]('custom:queuecallerunmanaged',_0x2b5ac9);}if(_0x2b5ac9['queuecallerabandon']){_0x2b5ac9[_0x3536('0xa7')]=_0x3536('0x5c');logger[_0x3536('0x4e')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x3da850[_0x3536('0x49')],util['inspect'](_0x2b5ac9,{'showHidden':![],'depth':null}));ami[_0x3536('0x45')]('custom:queuecallerabandon',_0x2b5ac9);}}else{this['voiceQueues'][_0x2b5ac9['queue']]['sumDuration']+=this[_0x3536('0x12')][_0x2b5ac9[_0x3536('0x68')]][_0x3536('0xc0')];}logger[_0x3536('0x76')](_0x3536('0xc5'),_0x3da850[_0x3536('0x49')],_0x2b5ac9[_0x3536('0x51')],_0x2b5ac9[_0x3536('0x53')],_0x3da850[_0x3536('0xc6')]);this['channels'][_0x3da850[_0x3536('0x49')]]=_0x2b5ac9;this[_0x3536('0x43')](_0x2b5ac9,_0x3536('0xc7'));this[_0x3536('0x52')](this['voiceQueues'][_0x2b5ac9[_0x3536('0x68')]],_0x3536('0xc7'));}}logger[_0x3536('0x4e')](_0x3536('0xc8'),_0x3da850[_0x3536('0x49')],util[_0x3536('0x3e')](this['queueReports'][_0x3da850[_0x3536('0x49')]],{'showHidden':![],'depth':null}));ami['emit'](_0x3536('0xc9'),this[_0x3536('0xf')][_0x3da850[_0x3536('0x49')]]);if(_0x2b5ac9['queuecallerexitreason']===_0x3536('0x50'))return;delete this[_0x3536('0xf')][_0x3da850[_0x3536('0x49')]];delete this[_0x3536('0x34')][_0x3da850[_0x3536('0x49')]];}if(this[_0x3536('0x14')][_0x3da850[_0x3536('0x49')]]){delete this[_0x3536('0x14')][_0x3da850[_0x3536('0x49')]];}}}catch(_0x3707a0){logger[_0x3536('0x3c')](_0x3536('0xbe'),_0x3da850[_0x3536('0x49')],util['inspect'](_0x3707a0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3536('0xa')]['syncAttendedTransfer']=function(_0x10d078){try{if(this[_0x3536('0x62')](_0x10d078)){logger[_0x3536('0x4e')](_0x3536('0xca'),_0x10d078[_0x3536('0x49')],util[_0x3536('0x3e')](_0x10d078,{'showHidden':![],'depth':null}));var _0x55a998;var _0x146399;var _0x452f44;if(this[_0x3536('0xf')][_0x10d078[_0x3536('0xcb')]]){_0x55a998=_[_0x3536('0x7a')](this[_0x3536('0xf')][_0x10d078['transfereeuniqueid']]);_0x55a998[_0x3536('0xcc')]=_0x10d078['secondtransfererexten'];_0x55a998[_0x3536('0xcd')]=_0x10d078[_0x3536('0xce')];_0x55a998['queuecallerexitreason']=_0x3536('0x50');_0x55a998[_0x3536('0x8f')]=!![];_0x55a998[_0x3536('0x9a')]=_0x3536('0xcf');if(this[_0x3536('0xf')][_0x10d078[_0x3536('0xce')]]){_0x452f44=this[_0x3536('0xf')][_0x10d078[_0x3536('0xce')]];this[_0x3536('0xf')][_0x10d078['secondtransfereruniqueid']]=this[_0x3536('0xf')][_0x10d078['transfereeuniqueid']];this[_0x3536('0xf')][_0x10d078[_0x3536('0xcb')]]=_0x452f44;_0x146399=_[_0x3536('0x7a')](this[_0x3536('0xf')][_0x10d078[_0x3536('0xcb')]]);_0x146399[_0x3536('0x35')]=!![];}logger['info'](_0x3536('0xd0'),_0x10d078[_0x3536('0x49')],_0x55a998['name'],_0x55a998[_0x3536('0x53')],_0x55a998['transferexten'],_0x55a998[_0x3536('0xcd')]);}else if(this['queueReports'][_0x10d078['transfertargetuniqueid']]){_0x55a998=_[_0x3536('0x7a')](this[_0x3536('0xf')][_0x10d078['transfertargetuniqueid']]);_0x55a998[_0x3536('0xcc')]=_0x10d078['origtransfererexten'];_0x55a998[_0x3536('0xcd')]=_0x10d078['origtransfereruniqueid'];_0x55a998[_0x3536('0x80')]=_0x3536('0x50');_0x55a998[_0x3536('0x8f')]=!![];_0x55a998[_0x3536('0x9a')]=_0x3536('0xcf');if(this['queueReports'][_0x10d078[_0x3536('0xd1')]]){_0x452f44=this['queueReports'][_0x10d078[_0x3536('0xd1')]];this[_0x3536('0xf')][_0x10d078['origtransfereruniqueid']]=this[_0x3536('0xf')][_0x10d078[_0x3536('0xd2')]];this['queueReports'][_0x10d078[_0x3536('0xd2')]]=_0x452f44;_0x146399=_['last'](this[_0x3536('0xf')][_0x10d078[_0x3536('0xd2')]]);_0x146399[_0x3536('0x35')]=!![];}logger['info'](_0x3536('0xd0'),_0x10d078[_0x3536('0x49')],_0x55a998[_0x3536('0x51')],_0x55a998[_0x3536('0x53')],_0x55a998[_0x3536('0xcc')],_0x55a998['transferuniqueid']);}else if(this[_0x3536('0xf')][_0x10d078[_0x3536('0xd1')]]){_0x55a998=_[_0x3536('0x7a')](this[_0x3536('0xf')][_0x10d078[_0x3536('0xd1')]]);_0x55a998[_0x3536('0xcc')]=_0x10d078['origtransfererexten'];_0x55a998[_0x3536('0xcd')]=_0x10d078[_0x3536('0xd1')];_0x55a998[_0x3536('0x80')]='ATTENDEDTRANSFER';_0x55a998['transfer']=!![];_0x55a998[_0x3536('0x9a')]=_0x3536('0xcf');}else if(this[_0x3536('0xf')][_0x10d078[_0x3536('0xce')]]){_0x55a998=_[_0x3536('0x7a')](this[_0x3536('0xf')][_0x10d078[_0x3536('0xce')]]);_0x55a998[_0x3536('0xcc')]=_0x10d078['secondtransfererexten'];_0x55a998[_0x3536('0xcd')]=_0x10d078[_0x3536('0xce')];_0x55a998[_0x3536('0x80')]='ATTENDEDTRANSFER';_0x55a998[_0x3536('0x8f')]=!![];_0x55a998[_0x3536('0x9a')]=_0x3536('0xcf');}}}catch(_0x130c89){logger['error'](_0x3536('0xca'),_0x10d078['uniqueid'],util[_0x3536('0x3e')](_0x130c89,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3536('0xa')]['syncBlindTransfer']=function(_0x4ec53b){try{if(this[_0x3536('0x62')](_0x4ec53b)){logger[_0x3536('0x4e')](_0x3536('0xd3'),_0x4ec53b[_0x3536('0x49')],util[_0x3536('0x3e')](_0x4ec53b,{'showHidden':![],'depth':null}));if(this[_0x3536('0xf')][_0x4ec53b['transfereeuniqueid']]){var _0x380619=_['last'](this['queueReports'][_0x4ec53b[_0x3536('0xcb')]]);_0x380619[_0x3536('0x80')]=_0x3536('0xd4');_0x380619[_0x3536('0x8f')]=!![];_0x380619[_0x3536('0x9a')]=_0x3536('0xd5');_0x380619[_0x3536('0xcc')]=_0x4ec53b[_0x3536('0xd6')];_0x380619[_0x3536('0xcd')]=_0x4ec53b[_0x3536('0xcb')];logger[_0x3536('0x76')](_0x3536('0xd7'),_0x4ec53b[_0x3536('0x49')],_0x380619[_0x3536('0x51')],_0x380619[_0x3536('0x53')],_0x380619[_0x3536('0xcc')],_0x380619['transferuniqueid']);this[_0x3536('0xbd')]({'event':'BlindTransfer','uniqueid':_0x4ec53b['transfereeuniqueid'],'context':_0x4ec53b[_0x3536('0xd8')],'channel':_0x4ec53b['transfererchannel']});}}}catch(_0x71c18d){logger[_0x3536('0x3c')](_0x3536('0xd3'),_0x4ec53b[_0x3536('0x49')],util[_0x3536('0x3e')](_0x71c18d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3536('0xa')][_0x3536('0xd9')]=function(_0x34f733){try{if(this[_0x3536('0x62')](_0x34f733)){logger[_0x3536('0x4e')](_0x3536('0xda'),_0x34f733[_0x3536('0x49')],util[_0x3536('0x3e')](_0x34f733,{'showHidden':![],'depth':null}));if(this[_0x3536('0xf')][_0x34f733[_0x3536('0x49')]]){var _0x2b3d92=_['last'](this['queueReports'][_0x34f733[_0x3536('0x49')]]);if(!_[_0x3536('0x36')](_0x2b3d92[_0x3536('0x85')])){_0x2b3d92[_0x3536('0xdb')]=moment()[_0x3536('0x4a')](_0x3536('0x72'));logger[_0x3536('0x76')](_0x3536('0xdc'),_0x34f733[_0x3536('0x49')],_0x2b3d92['mohstarttime']);}}}}catch(_0x4f42da){logger[_0x3536('0x3c')]('[%s][voiceQueueReport][musiconholdstart]',_0x34f733[_0x3536('0x49')],util[_0x3536('0x3e')](_0x4f42da,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3536('0xa')]['syncMusicOnHoldStop']=function(_0x278e12){try{if(this[_0x3536('0x62')](_0x278e12)){logger[_0x3536('0x4e')](_0x3536('0xdd'),_0x278e12[_0x3536('0x49')],util[_0x3536('0x3e')](_0x278e12,{'showHidden':![],'depth':null}));if(this[_0x3536('0xf')][_0x278e12['uniqueid']]){var _0x2d1799=_['last'](this[_0x3536('0xf')][_0x278e12['uniqueid']]);if(!_['isNil'](_0x2d1799['mohstarttime'])){_0x2d1799['mohtime']+=moment()['milliseconds'](0x0)[_0x3536('0xc2')](_0x2d1799['mohstarttime'],_0x3536('0x98'));logger['info'](_0x3536('0xde'),_0x278e12[_0x3536('0x49')],_0x2d1799[_0x3536('0xdf')]);delete _0x2d1799[_0x3536('0xdb')];}}}}catch(_0x33c3a1){logger[_0x3536('0x3c')](_0x3536('0xdd'),_0x278e12['uniqueid'],util[_0x3536('0x3e')](_0x33c3a1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3536('0xa')][_0x3536('0xe0')]=function(_0xd7d0f0){try{if(this['isNotNull'](_0xd7d0f0)){logger[_0x3536('0x4e')]('[%s][voiceQueueReport][newexten]\x20event:',_0xd7d0f0[_0x3536('0x49')],util[_0x3536('0x3e')](_0xd7d0f0,{'showHidden':![],'depth':null}));if(_0xd7d0f0['application'][_0x3536('0x93')]()==='set'){_0xd7d0f0[_0x3536('0xe1')]=_0xd7d0f0['appdata']&&_0xd7d0f0['appdata'][_0x3536('0x92')](_0x3536('0xe2'))?_0xd7d0f0[_0x3536('0xe3')]:(_0xd7d0f0[_0x3536('0xe3')]||_0xd7d0f0[_0x3536('0xe1')])[_0x3536('0x93')]();if(_[_0x3536('0x92')](_0xd7d0f0[_0x3536('0xe1')][_0x3536('0x93')](),_0x3536('0xe4'))){logger[_0x3536('0x76')](_0x3536('0xe5'),_0xd7d0f0['uniqueid'],_0xd7d0f0[_0x3536('0xe6')],_0xd7d0f0['applicationdata']);if(_['isUndefined'](this['channels'][_0xd7d0f0[_0x3536('0x49')]]))this[_0x3536('0x34')][_0xd7d0f0[_0x3536('0x49')]]={};var _0x43f912=_0xd7d0f0[_0x3536('0xe1')][_0x3536('0xe7')]('=');var _0x283afe=_0x43f912[0x0][_0x3536('0x93')]()[_0x3536('0xe8')](/cdr\((.*)\)/);if(_0x283afe)this['channels'][_0xd7d0f0[_0x3536('0x49')]][_0x283afe[0x1]]=_0x43f912[0x1];}}}}catch(_0x1919d7){logger[_0x3536('0x3c')](_0x3536('0xe9'),_0xd7d0f0[_0x3536('0x49')],util[_0x3536('0x3e')](_0x1919d7,{'showHidden':![],'depth':null}));}};module[_0x3536('0xea')]=VoiceQueueReport;
\ No newline at end of file
+var _0xaf87=['../../../config/logger','ami','../ami','../model/queueReport','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','realtime','agents','queueChannels','voiceQueues','campaigns','summary','variables','syncQueueSummary','syncQueueSummaryComplete','bind','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','originated','hasOwnProperty','talking','pTalking','queueStatusComplete','unlockRR','queuecallerabandon','clearZombieChannels','channels','switch','sequence','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','inspect','queueReports','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','queue','voice_queue_presence:save','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','format','voice_queue_channel:remove','inbound','voice_queue:save','isUndefined','queues','[voiceQueueReport][queues]','isRunning','queuesummary','actionid','queuestatus','[voiceQueueReport][queuesummary]','name','summaryEvent','createQueueSummaryReport','compareToInboundQueue','assign','emitInboundVoiceQueueSummary','type','handleInboundQueueSummaryReport','outbound','custom:queuesummary','statusRequests','push','isNotNull','completeEvent','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','holdtime','originalposition','queuecallerabandonAt','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','last','connectedlinenum','connectedlinename','info','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','lastAssignedTo','membername','queuecallerexit','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','seconds','FORWARDTRANSFER','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','handleHangup','length','sumHoldTime','diff','sumDuration','milliseconds','total','answered','sumBillable','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','cause-txt','cause','transferid','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','transfertype','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]','exports','util','../../../config/environment'];(function(_0x4c6065,_0x209b7f){var _0x1dbcad=function(_0x5bc182){while(--_0x5bc182){_0x4c6065['push'](_0x4c6065['shift']());}};_0x1dbcad(++_0x209b7f);}(_0xaf87,0x1e2));var _0x7af8=function(_0x52aad7,_0x2a23c5){_0x52aad7=_0x52aad7-0x0;var _0x46c2b1=_0xaf87[_0x52aad7];return _0x46c2b1;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x7af8('0x0'));var Redis=require('ioredis');var config=require(_0x7af8('0x1'));var logger=require(_0x7af8('0x2'))(_0x7af8('0x3'));var ami=require(_0x7af8('0x4'));var QueueReport=require(_0x7af8('0x5'));var VoiceQueueSummary=require('../model/voiceQueueSummary');config['redis']=_[_0x7af8('0x6')](config[_0x7af8('0x7')],{'host':_0x7af8('0x8'),'port':0x18eb});var io=require(_0x7af8('0x9'))(new Redis(config[_0x7af8('0x7')]));var Sequence=function(){};Sequence[_0x7af8('0xa')][_0x7af8('0xb')]=function(_0x4cac69){this[_0x7af8('0xc')]=this[_0x7af8('0xc')]?this['tail'][_0x7af8('0xd')](_0x4cac69):_0x4cac69();};function VoiceQueueReport(_0x250ac9){this['sequence']=new Sequence();this['queueReports']={};this[_0x7af8('0xe')]=_0x250ac9;this[_0x7af8('0xf')]=_0x250ac9[_0x7af8('0xf')];this['channels']=_0x250ac9[_0x7af8('0x10')];this[_0x7af8('0x11')]=_0x250ac9['voiceQueues'];this['campaigns']=_0x250ac9[_0x7af8('0x12')];this[_0x7af8('0x13')]=initializeSummary();this[_0x7af8('0x14')]={};ami['on']('queuesummary',this[_0x7af8('0x15')]['bind'](this));ami['on']('queuesummarycomplete',this[_0x7af8('0x16')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x18'),this[_0x7af8('0x19')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x1a'),this[_0x7af8('0x1b')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x1c'),this[_0x7af8('0x1d')][_0x7af8('0x17')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x1e'),this[_0x7af8('0x1f')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x20'),this[_0x7af8('0x21')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x22'),this[_0x7af8('0x23')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x24'),this[_0x7af8('0x25')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x26'),this[_0x7af8('0x27')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x28'),this['syncFullyBooted'][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x29'),this[_0x7af8('0x2a')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x2b'),this[_0x7af8('0x2c')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x2d'),this['syncAttendedTransfer'][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x2e'),this[_0x7af8('0x2f')][_0x7af8('0x17')](this));this[_0x7af8('0x30')]();this[_0x7af8('0x31')]();}function clearChannels(_0x4e1aef){if(!_[_0x7af8('0x32')](_0x4e1aef)){for(var _0x3a64ab in _0x4e1aef){if(_0x4e1aef['hasOwnProperty'](_0x3a64ab)){delete _0x4e1aef[_0x3a64ab];}}}}function clearCampaigns(_0x3bd3aa){if(!_[_0x7af8('0x32')](_0x3bd3aa)){for(var _0x2e8a9d in _0x3bd3aa){if(_0x3bd3aa['hasOwnProperty'](_0x2e8a9d)){_0x3bd3aa[_0x2e8a9d][_0x7af8('0x33')]=0x0;}}}}function clearVoiceQueues(_0x2ff86c){if(!_[_0x7af8('0x32')](_0x2ff86c)){for(var _0x181ca2 in _0x2ff86c){if(_0x2ff86c[_0x7af8('0x34')](_0x181ca2)){_0x2ff86c[_0x181ca2][_0x7af8('0x33')]=0x0;_0x2ff86c[_0x181ca2][_0x7af8('0x35')]=0x0;_0x2ff86c[_0x181ca2][_0x7af8('0x36')]=0x0;_0x2ff86c[_0x181ca2]['waiting']=0x0;_0x2ff86c[_0x181ca2][_0x7af8('0x37')]=!![];}}}}function clearAgentBooked(_0x440bde){if(!_[_0x7af8('0x32')](_0x440bde)){for(var _0x5992f0 in _0x440bde){if(_0x440bde[_0x7af8('0x34')](_0x5992f0)){_0x440bde[_0x5992f0][_0x7af8('0x38')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x3e8f1c){return _0x3e8f1c['queuecallerexit']||_0x3e8f1c[_0x7af8('0x39')]||_0x3e8f1c['queuecallercomplete'];}VoiceQueueReport['prototype'][_0x7af8('0x3a')]=function(){var _0x3608b8=this;for(var _0x910a7c in this[_0x7af8('0x3b')]){if(this[_0x7af8('0x3b')]['hasOwnProperty'](_0x910a7c)&&!this['channels'][_0x910a7c][_0x7af8('0x3c')]){this[_0x7af8('0x3d')][_0x7af8('0xb')](function(){if(!_[_0x7af8('0x3e')](_0x3608b8[_0x7af8('0x3b')][_0x910a7c])){return ami[_0x7af8('0x3f')]({'action':_0x7af8('0x40'),'channel':_0x3608b8[_0x7af8('0x3b')][_0x910a7c][_0x7af8('0x41')]})[_0x7af8('0x42')](function(_0x17fedb){if(_0x17fedb[_0x7af8('0x43')]===_0x7af8('0x44')){setTimeout(function(){if(_0x3608b8[_0x7af8('0x3b')][_0x910a7c]){delete _0x3608b8[_0x7af8('0x3b')][_0x910a7c];logger[_0x7af8('0x45')]('[%s][voiceQueueReport][checkChannel]',_0x910a7c,util[_0x7af8('0x46')](_0x17fedb,{'showHidden':![],'depth':null}));}if(_0x3608b8[_0x7af8('0x47')][_0x910a7c]){delete _0x3608b8[_0x7af8('0x47')][_0x910a7c];logger[_0x7af8('0x45')]('[%s][voiceQueueReport][checkQueueReport]',_0x910a7c,util[_0x7af8('0x46')](_0x17fedb,{'showHidden':![],'depth':null}));}if(_0x3608b8['variables'][_0x910a7c]){delete _0x3608b8[_0x7af8('0x14')][_0x910a7c];logger[_0x7af8('0x45')](_0x7af8('0x48'),_0x910a7c,util[_0x7af8('0x46')](_0x17fedb,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x49')]=function(){logger['error'](_0x7af8('0x4a'));clearChannels(this[_0x7af8('0x3b')]);this[_0x7af8('0x4b')](this[_0x7af8('0x47')]);clearAgentBooked(this[_0x7af8('0xf')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this['campaigns']);this[_0x7af8('0x13')]=initializeSummary();};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x4b')]=function(_0x32e3cd){var _0x56f2e3=this;if(!_[_0x7af8('0x32')](_0x32e3cd)){for(var _0x31ad5a in _0x32e3cd){if(_0x32e3cd[_0x7af8('0x34')](_0x31ad5a)){_0x56f2e3[_0x7af8('0x4c')](_0x32e3cd[_0x31ad5a],_0x7af8('0x4d'));delete _0x32e3cd[_0x31ad5a];}}}};VoiceQueueReport['prototype'][_0x7af8('0x4e')]=function(_0x19c2d3,_0x59c2df,_0x618bae){io['to'](_0x19c2d3)[_0x7af8('0x4e')](_0x59c2df,_0x618bae);};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x4f')]=function(_0x1729f1,_0x5c329d){logger[_0x7af8('0x50')]('[%s][voiceQueueReport]['+_0x5c329d+_0x7af8('0x51'),_0x1729f1[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x1729f1,{'showHidden':![],'depth':null}));this[_0x7af8('0x4e')](util['format'](_0x7af8('0x53'),_0x1729f1[_0x7af8('0x54')]),'voice_queue_channel:save',_0x1729f1);io['emit'](_0x7af8('0x55'),_0x1729f1);};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x4c')]=function(_0x43a25f,_0xfd169e){logger['debug'](_0x7af8('0x56')+_0xfd169e+_0x7af8('0x57'),_0x43a25f[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x43a25f,{'showHidden':![],'depth':null}));if(_0x43a25f[_0x7af8('0x58')]===_0x7af8('0x59')){return;}this[_0x7af8('0x4e')](util[_0x7af8('0x5a')](_0x7af8('0x53'),_0x43a25f[_0x7af8('0x54')]),_0x7af8('0x5b'),_0x43a25f);io[_0x7af8('0x4e')]('voice_queue_presence:remove',_0x43a25f);};VoiceQueueReport['prototype']['emitInboundVoiceQueueSummary']=function(_0x169ad7){if(_0x169ad7['type']===_0x7af8('0x5c')){logger[_0x7af8('0x50')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x7af8('0x46')](_0x169ad7,{'showHidden':![],'depth':null}));this[_0x7af8('0x4e')](util['format'](_0x7af8('0x53'),_0x169ad7['name']),_0x7af8('0x5d'),_0x169ad7);}};VoiceQueueReport[_0x7af8('0xa')]['isNotNull']=function(_0x3da179){return _0x3da179!==null&&!_[_0x7af8('0x5e')](_0x3da179);};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x31')]=function(){var _0x3c0d97=this;setInterval(function(){_0x3c0d97[_0x7af8('0x3a')]();ami['Action']({'action':_0x7af8('0x5f')})['catch'](function(_0x45e3a3){logger[_0x7af8('0x45')](_0x7af8('0x60'),util[_0x7af8('0x46')](_0x45e3a3,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x30')]=function(){var _0x32fa10=this;setInterval(function(){if(!_0x32fa10[_0x7af8('0x13')][_0x7af8('0x61')]){return ami[_0x7af8('0x3f')]({'action':_0x7af8('0x62')})['then'](function(_0x15b0f1){_0x32fa10[_0x7af8('0x13')]['id']=_0x15b0f1[_0x7af8('0x63')];_0x32fa10[_0x7af8('0x13')]['isRunning']=!![];_0x32fa10[_0x7af8('0x13')][_0x7af8('0x64')][_0x15b0f1[_0x7af8('0x63')]]={};})[_0x7af8('0x42')](function(_0x2977b2){logger[_0x7af8('0x45')](_0x7af8('0x65'),util[_0x7af8('0x46')](_0x2977b2,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype']['createQueueSummaryReport']=function(_0x40fba5,_0xbe2344){var _0x5f3285;if(this[_0x7af8('0x13')]&&this['summary']['queues']&&this['summary'][_0x7af8('0x5f')][_0x40fba5[_0x7af8('0x66')]]){_0x5f3285=this[_0x7af8('0x13')][_0x7af8('0x5f')][_0x40fba5['name']][_0x7af8('0x67')];}var _0x388335=new VoiceQueueSummary(_0x40fba5);return _0x388335['createReport'](_0xbe2344[_0x7af8('0xf')],this[_0x7af8('0xf')],_0x5f3285,this[_0x7af8('0xe')][_0x7af8('0x3b')]);};VoiceQueueReport[_0x7af8('0xa')]['handleInboundQueueSummaryReport']=function(_0x11b64c,_0xf32d4a){var _0x305b5b=this[_0x7af8('0x68')](_0x11b64c,_0xf32d4a);var _0x3015e9=![];_0x3015e9=_0x305b5b[_0x7af8('0x69')](_0x11b64c);if(_0x3015e9){Object[_0x7af8('0x6a')](_0x11b64c,_0x305b5b);this[_0x7af8('0xe')][_0x7af8('0x11')][_0x11b64c[_0x7af8('0x66')]]=_0x11b64c;this[_0x7af8('0x6b')](_0x305b5b);}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x1b')]=function(_0x23c178){var _0x52f0b0=null;var _0x42edd9=this['summary']['id'];if(this[_0x7af8('0x13')][_0x7af8('0x64')][_0x42edd9]){_0x52f0b0=this[_0x7af8('0x13')][_0x7af8('0x64')][_0x42edd9][_0x23c178[_0x7af8('0x63')]];}if(!_0x52f0b0){this[_0x7af8('0x13')]=initializeSummary();return;}var _0x4d6ad3=this[_0x7af8('0x11')][_0x52f0b0[_0x7af8('0x54')]];if(_0x4d6ad3[_0x7af8('0x6c')]===_0x7af8('0x5c')){this[_0x7af8('0x6d')](_0x4d6ad3,_0x52f0b0);}else if(_0x4d6ad3[_0x7af8('0x6c')]===_0x7af8('0x6e')){var _0x586c2f=this[_0x7af8('0x68')](_0x4d6ad3,_0x52f0b0);ami[_0x7af8('0x4e')](_0x7af8('0x6f'),_0x586c2f);}this[_0x7af8('0x13')]['statusRequests']-=0x1;var _0x546bd0=this['summary'][_0x7af8('0x70')]>0x0?!![]:![];if(!_0x546bd0){return this['syncQueueSummaryComplete'](this[_0x7af8('0x13')]['completeEvent']);}};VoiceQueueReport[_0x7af8('0xa')]['syncQueueMember']=function(_0x21c3ca){var _0x2b9b13=this[_0x7af8('0x13')]['id'];if(this[_0x7af8('0x13')][_0x7af8('0x64')][_0x2b9b13]&&this[_0x7af8('0x13')][_0x7af8('0x64')][_0x2b9b13][_0x21c3ca[_0x7af8('0x63')]]){this[_0x7af8('0x13')][_0x7af8('0x64')][_0x2b9b13][_0x21c3ca[_0x7af8('0x63')]][_0x7af8('0xf')][_0x7af8('0x71')](_0x21c3ca);}};VoiceQueueReport['prototype'][_0x7af8('0x15')]=function(_0x298803){var _0x3c30ec=this;try{if(this['isNotNull'](_0x298803)&&this[_0x7af8('0x72')](_0x298803[_0x7af8('0x54')])){logger[_0x7af8('0x50')]('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x298803,{'showHidden':![],'depth':null}));var _0x428d6d=this[_0x7af8('0x11')][_0x298803[_0x7af8('0x54')]];if(_0x428d6d){logger['debug']('[voiceQueueReport][queuesummary]\x20name:%s',_0x428d6d['name']);this[_0x7af8('0x13')]['queues'][_0x428d6d[_0x7af8('0x66')]]={'summaryEvent':_0x298803};this['summary'][_0x7af8('0x70')]+=0x1;return ami['Action']({'action':_0x7af8('0x64'),'queue':_0x428d6d[_0x7af8('0x66')]})['then'](function(_0x122e67){if(!_0x3c30ec[_0x7af8('0x13')][_0x7af8('0x64')][_0x298803['actionid']]){_0x3c30ec['summary']['queuestatus'][_0x298803[_0x7af8('0x63')]]={};}_0x3c30ec[_0x7af8('0x13')]['queuestatus'][_0x298803[_0x7af8('0x63')]][_0x122e67['actionid']]={'queue':_0x428d6d[_0x7af8('0x66')],'agents':[]};})['catch'](function(_0x21f5d1){throw _0x21f5d1;});}}}catch(_0x31974b){logger[_0x7af8('0x45')](_0x7af8('0x65'),util[_0x7af8('0x46')](_0x31974b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x16')]=function(_0x1f186e){if(this[_0x7af8('0x13')][_0x7af8('0x70')]>0x0){this[_0x7af8('0x13')][_0x7af8('0x73')]=_0x1f186e;return;}logger[_0x7af8('0x50')](_0x7af8('0x74'),util[_0x7af8('0x46')](_0x1f186e,{'showHidden':![],'depth':null}));this[_0x7af8('0x13')]=initializeSummary();ami[_0x7af8('0x4e')](_0x7af8('0x75'),{});};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x1d')]=function(_0x103dcb){try{if(this[_0x7af8('0x72')](_0x103dcb)){logger[_0x7af8('0x50')](_0x7af8('0x76'),_0x103dcb[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x103dcb,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x7af8('0x47')][_0x103dcb['uniqueid']])){this[_0x7af8('0x47')][_0x103dcb[_0x7af8('0x52')]]=[];}if(_[_0x7af8('0x5e')](this[_0x7af8('0x3b')][_0x103dcb[_0x7af8('0x52')]])){this[_0x7af8('0x3b')][_0x103dcb[_0x7af8('0x52')]]={};}var _0x5842bd=new QueueReport();_0x5842bd[_0x7af8('0x54')]=_0x103dcb[_0x7af8('0x54')];_0x5842bd[_0x7af8('0x6c')]=this[_0x7af8('0x11')][_0x5842bd[_0x7af8('0x54')]]&&this[_0x7af8('0x11')][_0x5842bd[_0x7af8('0x54')]][_0x7af8('0x6c')]?this[_0x7af8('0x11')][_0x5842bd[_0x7af8('0x54')]][_0x7af8('0x6c')]||_0x7af8('0x5c'):_0x7af8('0x5c');_0x5842bd[_0x7af8('0x77')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0x5842bd[_0x7af8('0x79')]=_0x103dcb[_0x7af8('0x79')];_0x5842bd[_0x7af8('0x7a')]=_0x103dcb[_0x7af8('0x7a')];_0x5842bd[_0x7af8('0x52')]=_0x103dcb['uniqueid'];_0x5842bd[_0x7af8('0x7b')]=this[_0x7af8('0x3b')][_0x103dcb[_0x7af8('0x52')]]['routealias'];logger['info'](_0x7af8('0x7c'),_0x5842bd[_0x7af8('0x54')],_0x5842bd[_0x7af8('0x6c')]);Object[_0x7af8('0x6a')](_0x5842bd,_[_0x7af8('0x7d')](_0x103dcb,_['keys'](_0x5842bd)));this[_0x7af8('0x47')][_0x103dcb['uniqueid']][_0x7af8('0x71')](_0x5842bd);this[_0x7af8('0x3b')][_0x103dcb[_0x7af8('0x52')]]=_0x5842bd;this[_0x7af8('0x4f')](_0x5842bd,'queuecallerjoin');}}catch(_0x1191a3){logger['error'](_0x7af8('0x76'),_0x103dcb['uniqueid'],util[_0x7af8('0x46')](_0x1191a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7af8('0x7e')]=function(_0x29513e){try{if(this['isNotNull'](_0x29513e)){logger[_0x7af8('0x50')](_0x7af8('0x7f'),_0x29513e['uniqueid'],util[_0x7af8('0x46')](_0x29513e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x29513e[_0x7af8('0x52')]]){var _0xaeaaba=_['last'](this[_0x7af8('0x47')][_0x29513e['uniqueid']]);_0xaeaaba['queuecallercomplete']=![];_0xaeaaba['queuecallercompleteAt']=null;_0xaeaaba[_0x7af8('0x80')]=_0x29513e['holdtime'];_0xaeaaba['originalposition']=_0x29513e[_0x7af8('0x81')];_0xaeaaba['queuecallerabandon']=!![];_0xaeaaba[_0x7af8('0x82')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0xaeaaba[_0x7af8('0x58')]='ABANDONED';_0xaeaaba['lastAssignedTo']=null;logger['info'](_0x7af8('0x83'),_0xaeaaba['queue'],_0xaeaaba[_0x7af8('0x6c')]);this['channels'][_0x29513e[_0x7af8('0x52')]]=_0xaeaaba;this[_0x7af8('0x4c')](_0xaeaaba,_0x7af8('0x39'));}}}catch(_0xa22709){logger[_0x7af8('0x45')](_0x7af8('0x7f'),_0x29513e[_0x7af8('0x52')],util['inspect'](_0xa22709,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x1f')]=function(_0x1c768b){try{if(this[_0x7af8('0x72')](_0x1c768b)){logger[_0x7af8('0x50')](_0x7af8('0x84'),_0x1c768b[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x1c768b,{'showHidden':![],'depth':null}));if(this[_0x7af8('0x47')][_0x1c768b[_0x7af8('0x52')]]){var _0x3cb64a=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x1c768b[_0x7af8('0x52')]]);_0x3cb64a['queuecallerleaveAt']=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0x3cb64a[_0x7af8('0x86')]=_0x1c768b[_0x7af8('0x86')];_0x3cb64a[_0x7af8('0x87')]=_0x1c768b[_0x7af8('0x87')];logger[_0x7af8('0x88')](_0x7af8('0x89'),_0x3cb64a['queue'],_0x3cb64a[_0x7af8('0x6c')],_0x1c768b['connectedlinenum'],_0x1c768b['connectedlinename']);this[_0x7af8('0x3b')][_0x1c768b[_0x7af8('0x52')]]=_0x3cb64a;this[_0x7af8('0x4f')](_0x3cb64a,_0x7af8('0x1e'));}}}catch(_0x507215){logger[_0x7af8('0x45')]('[%s][voiceQueueReport][queuecallerleave]',_0x1c768b[_0x7af8('0x52')],util['inspect'](_0x507215,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7af8('0x23')]=function(_0x56d8e6){try{if(this[_0x7af8('0x72')](_0x56d8e6)){logger[_0x7af8('0x50')](_0x7af8('0x8a'),_0x56d8e6[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x56d8e6,{'showHidden':![],'depth':null}));if(this[_0x7af8('0x47')][_0x56d8e6['uniqueid']]){var _0x4f5c3c=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x56d8e6[_0x7af8('0x52')]]);_0x4f5c3c[_0x7af8('0x8b')]=!![];_0x4f5c3c[_0x7af8('0x58')]=_0x7af8('0x8c');logger[_0x7af8('0x88')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x4f5c3c[_0x7af8('0x54')],_0x4f5c3c[_0x7af8('0x6c')]);}}}catch(_0x328baf){logger[_0x7af8('0x45')](_0x7af8('0x8a'),_0x56d8e6[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x328baf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')]['syncAgentComplete']=function(_0x29b575){try{if(this['isNotNull'](_0x29b575)){logger[_0x7af8('0x50')](_0x7af8('0x8d'),_0x29b575[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x29b575,{'showHidden':![],'depth':null}));if(this[_0x7af8('0x47')][_0x29b575[_0x7af8('0x52')]]){var _0x5e959a=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x29b575[_0x7af8('0x52')]]);_0x5e959a[_0x7af8('0x39')]=![];_0x5e959a[_0x7af8('0x82')]=null;_0x5e959a[_0x7af8('0x8e')]=!![];_0x5e959a[_0x7af8('0x8f')]=_0x29b575[_0x7af8('0x90')];_0x5e959a['holdtime']=_0x29b575[_0x7af8('0x80')];_0x5e959a['queuecallercomplete']=!![];_0x5e959a[_0x7af8('0x91')]=![];_0x5e959a[_0x7af8('0x92')]=null;if(!_0x5e959a[_0x7af8('0x93')]){if(_0x29b575[_0x7af8('0x94')]==_0x7af8('0x93')){_0x5e959a[_0x7af8('0x58')]='COMPLETED';logger[_0x7af8('0x88')](_0x7af8('0x95'),_0x5e959a[_0x7af8('0x54')],_0x5e959a[_0x7af8('0x6c')]);}else{if(_[_0x7af8('0x96')](_0x29b575[_0x7af8('0x41')][_0x7af8('0x97')](),_0x7af8('0x98'))){if(this[_0x7af8('0x47')][_0x29b575[_0x7af8('0x99')]]){var _0x32cf54=_[_0x7af8('0x85')](this['queueReports'][_0x29b575[_0x7af8('0x99')]]);_0x32cf54[_0x7af8('0x8b')]=![];_0x32cf54[_0x7af8('0x91')]=!![];_0x32cf54['queuecallerexitAt']=moment(_0x5e959a[_0x7af8('0x77')])['add'](_0x29b575['holdtime'],_0x7af8('0x9a'))[_0x7af8('0x5a')](_0x7af8('0x78'));_0x32cf54[_0x7af8('0x58')]=_0x7af8('0x9b');_0x32cf54[_0x7af8('0x93')]=!![];_0x32cf54['transfertype']='FORWARD';_0x32cf54[_0x7af8('0x9c')]=_0x29b575[_0x7af8('0x9d')];_0x32cf54[_0x7af8('0x9e')]=_0x29b575[_0x7af8('0x52')];logger[_0x7af8('0x88')](_0x7af8('0x9f'),_0x32cf54[_0x7af8('0x54')],_0x32cf54[_0x7af8('0x6c')]);var _0x472974=this['queueReports'][_0x29b575[_0x7af8('0x99')]];this['queueReports'][_0x29b575[_0x7af8('0x99')]]=this[_0x7af8('0x47')][_0x29b575['uniqueid']];this[_0x7af8('0x47')][_0x29b575['uniqueid']]=_0x472974;}}else{_0x5e959a[_0x7af8('0x58')]='COMPLETEDBY'+_0x29b575['reason'][_0x7af8('0xa0')]();logger[_0x7af8('0x88')](_0x7af8('0xa1'),_0x5e959a[_0x7af8('0x54')],_0x5e959a['type'],_0x5e959a[_0x7af8('0x58')]);}}}this[_0x7af8('0x3b')][_0x29b575[_0x7af8('0x52')]]=_0x5e959a;}}}catch(_0x544488){logger[_0x7af8('0x45')](_0x7af8('0x8d'),_0x29b575[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x544488,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x25')]=function(_0x434e4f){try{if(this['isNotNull'](_0x434e4f)){logger['debug'](_0x7af8('0xa2'),_0x434e4f[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x434e4f,{'showHidden':![],'depth':null}));this[_0x7af8('0xa3')](_0x434e4f[_0x7af8('0x52')],_['keys'](_0x434e4f[_0x7af8('0xa4')])[0x0],_0x434e4f[_0x7af8('0xa5')]);if(this[_0x7af8('0x47')][_0x434e4f[_0x7af8('0x52')]]){var _0x5c857d=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x434e4f['uniqueid']]);if(_0x5c857d){if(this[_0x7af8('0x72')](_0x434e4f['variable'])&&this[_0x7af8('0x72')](_0x434e4f[_0x7af8('0xa4')][_0x7af8('0x64')])){switch(_0x434e4f[_0x7af8('0xa5')]){case _0x7af8('0xa6'):_0x5c857d['queuecallerexit']=![];_0x5c857d[_0x7af8('0x92')]=null;break;case _0x7af8('0xa7'):_0x5c857d[_0x7af8('0xa8')]=_0x7af8('0xa9');_0x5c857d[_0x7af8('0x91')]=!![];_0x5c857d[_0x7af8('0x92')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0x5c857d[_0x7af8('0xaa')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));logger['debug'](_0x7af8('0xab'),_0x434e4f[_0x7af8('0x52')],util['inspect'](_0x5c857d,{'showHidden':![],'depth':null}));ami[_0x7af8('0x4e')](_0x7af8('0xac'),_0x5c857d);break;default:_0x5c857d[_0x7af8('0x91')]=!![];_0x5c857d[_0x7af8('0x92')]=moment()['format'](_0x7af8('0x78'));_0x5c857d['queuecallerleaveAt']=moment()['format'](_0x7af8('0x78'));}_0x5c857d[_0x7af8('0x39')]=![];_0x5c857d[_0x7af8('0x82')]=null;_0x5c857d[_0x7af8('0x58')]=_0x434e4f['value'];this[_0x7af8('0x3b')][_0x434e4f[_0x7af8('0x52')]]=_0x5c857d;this['emitVoiceQueueChannelRemove'](_0x5c857d,'varset');}else if(this[_0x7af8('0x72')](_0x434e4f[_0x7af8('0xa4')])&&this['isNotNull'](_0x434e4f[_0x7af8('0xa4')]['queueposition'])){if(!_0x5c857d[_0x7af8('0x39')]){_0x5c857d['queuecallerexit']=!![];_0x5c857d[_0x7af8('0x92')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0x5c857d[_0x7af8('0x58')]=_0x7af8('0xad');_0x5c857d[_0x7af8('0xaa')]=moment()['format'](_0x7af8('0x78'));this['channels'][_0x434e4f['uniqueid']]=_0x5c857d;}}logger[_0x7af8('0x88')](_0x7af8('0xae'),_0x434e4f[_0x7af8('0x52')],_0x5c857d['queue'],_0x5c857d[_0x7af8('0x6c')],_['keys'](_0x434e4f[_0x7af8('0xa4')])[0x0],_0x434e4f['value']);_0x5c857d[_0x7af8('0x14')]=this[_0x7af8('0x14')][_0x434e4f[_0x7af8('0x52')]];}}}}catch(_0x4c1593){logger['error'](_0x7af8('0xa2'),_0x434e4f['uniqueid'],util[_0x7af8('0x46')](_0x4c1593,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0xa3')]=function(_0x4915f0,_0x31b419,_0x522fc7){var _0x400b42=[_0x7af8('0xaf'),_0x7af8('0xb0'),_0x7af8('0xb1'),_0x7af8('0xb2'),_0x7af8('0xb3'),_0x7af8('0xb4'),'rtpaudioqosrtt',_0x7af8('0xb5'),_0x7af8('0xb6'),_0x7af8('0xb7'),'bridgepeer',_0x7af8('0xb8'),_0x7af8('0xb9'),_0x7af8('0xba'),_0x7af8('0xbb'),'memberlastcall',_0x7af8('0x90'),_0x7af8('0xbc'),_0x7af8('0xbd')];if(!_[_0x7af8('0x3e')](_0x31b419)&&!_[_0x7af8('0xbe')](_0x400b42,_0x31b419)){if(_['isUndefined'](this[_0x7af8('0x14')][_0x4915f0])){this[_0x7af8('0x14')][_0x4915f0]={};}this['variables'][_0x4915f0][_0x31b419]=_0x522fc7;}};VoiceQueueReport['prototype'][_0x7af8('0xbf')]=function(_0x1fabfa,_0x47a85b,_0x326ff8){try{var _0x5debd7={};if(this[_0x7af8('0x47')][_0x1fabfa]){for(var _0x3d41e9=0x0;_0x3d41e9<this['queueReports'][_0x1fabfa][_0x7af8('0xc0')];_0x3d41e9+=0x1){_0x5debd7=this[_0x7af8('0x47')][_0x1fabfa][_0x3d41e9];var _0x48be92=this[_0x7af8('0x11')][_0x5debd7[_0x7af8('0x54')]];if(_0x48be92){_0x48be92[_0x7af8('0xc1')]+=moment(_0x5debd7[_0x7af8('0xaa')])[_0x7af8('0xc2')](_0x5debd7[_0x7af8('0x77')],_0x7af8('0x9a'))||0x0;if(_0x326ff8&&_0x5debd7['queuecallerexitreason']===_0x7af8('0x59')){_0x5debd7[_0x7af8('0x58')]=_0x7af8('0x8c');}if(_0x3d41e9===this['queueReports'][_0x1fabfa][_0x7af8('0xc0')]-0x1){_0x48be92[_0x7af8('0xc3')]+=moment()[_0x7af8('0xc4')](0x0)[_0x7af8('0xc2')](_0x5debd7[_0x7af8('0x77')],'seconds');if(hasCallerLeftTheQueue(_0x5debd7)&&_0x5debd7[_0x7af8('0x58')]!=='ATTENDEDTRANSFER'){_0x48be92[_0x7af8('0xc5')]+=0x1;}if(_0x5debd7[_0x7af8('0x8b')]){_0x48be92[_0x7af8('0xc6')]+=0x1;_0x48be92[_0x7af8('0xc7')]+=moment()['milliseconds'](0x0)['diff'](_0x5debd7['queuecallerleaveAt'],_0x7af8('0x9a'));_0x5debd7['queuecallercompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5debd7[_0x7af8('0x91')]=![];_0x5debd7['queuecallerexitAt']=null;}if(_0x5debd7[_0x7af8('0x91')]&&_0x5debd7[_0x7af8('0x93')]!=!![]){_0x48be92[_0x7af8('0xc8')]+=0x1;_0x5debd7[_0x7af8('0xa8')]=_0x7af8('0xc8');logger[_0x7af8('0x50')](_0x7af8('0xc9'),_0x1fabfa,util[_0x7af8('0x46')](_0x5debd7,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerunmanaged',_0x5debd7);}if(_0x5debd7['queuecallerabandon']){_0x48be92[_0x7af8('0xca')]+=0x1;_0x5debd7[_0x7af8('0xa8')]=_0x7af8('0xca');logger[_0x7af8('0x50')](_0x7af8('0xcb'),_0x1fabfa,util[_0x7af8('0x46')](_0x5debd7,{'showHidden':![],'depth':null}));ami[_0x7af8('0x4e')]('custom:queuecallerabandon',_0x5debd7);}}else{_0x48be92[_0x7af8('0xc3')]+=_0x48be92[_0x7af8('0xc1')];}logger[_0x7af8('0x88')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x1fabfa,_0x5debd7[_0x7af8('0x54')],_0x5debd7[_0x7af8('0x6c')],_0x47a85b);this[_0x7af8('0x3b')][_0x1fabfa]=_0x5debd7;Object['assign'](this[_0x7af8('0x11')][_0x5debd7[_0x7af8('0x54')]],_0x48be92);if(_0x5debd7[_0x7af8('0xaa')]){this[_0x7af8('0x4c')](_0x5debd7,'hangup');}}}logger[_0x7af8('0x50')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x1fabfa,util[_0x7af8('0x46')](this[_0x7af8('0x47')][_0x1fabfa],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x5debd7)&&_0x5debd7[_0x7af8('0x58')]!=='ATTENDEDTRANSFER'){ami[_0x7af8('0x4e')](_0x7af8('0xcc'),this[_0x7af8('0x47')][_0x1fabfa]);if(this[_0x7af8('0x47')][_0x1fabfa]){delete this[_0x7af8('0x47')][_0x1fabfa];}if(this['channels'][_0x1fabfa]){delete this[_0x7af8('0x3b')][_0x1fabfa];}if(this[_0x7af8('0x14')][_0x1fabfa]){delete this['variables'][_0x1fabfa];}}}}catch(_0x377a59){logger[_0x7af8('0x45')]('[%s][voiceQueueReport][handleHangup]',_0x1fabfa,util['inspect'](_0x377a59,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x27')]=function(_0x3a4244){try{if(this[_0x7af8('0x72')](_0x3a4244)){logger['debug'](_0x7af8('0xcd'),_0x3a4244[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x3a4244,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3a4244[_0x7af8('0x52')]]){return this[_0x7af8('0xbf')](_0x3a4244[_0x7af8('0x52')],_0x3a4244[_0x7af8('0xce')],![]);}if(this[_0x7af8('0x47')][_0x3a4244['linkedid']]){if(_0x3a4244[_0x7af8('0xcf')]==='21'){return;}return this[_0x7af8('0xbf')](_0x3a4244['linkedid'],_0x3a4244['cause-txt'],!![]);}var _0x465838=Object['keys'](this['queueReports']);for(var _0x5b7b57=0x0;_0x5b7b57<_0x465838[_0x7af8('0xc0')];_0x5b7b57++){var _0x296b90=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x465838[_0x5b7b57]]);if(_0x296b90&&_0x296b90[_0x7af8('0xd0')]===_0x3a4244[_0x7af8('0x52')]){return this[_0x7af8('0xbf')](_0x296b90[_0x7af8('0x52')],_0x3a4244[_0x7af8('0xce')],!![]);}}if(!this['queueReports'][_0x3a4244[_0x7af8('0x52')]]){logger[_0x7af8('0x50')](_0x7af8('0xd1'),_0x3a4244[_0x7af8('0x52')]);if(this[_0x7af8('0x3b')][_0x3a4244[_0x7af8('0x52')]]){delete this[_0x7af8('0x3b')][_0x3a4244[_0x7af8('0x52')]];}if(this[_0x7af8('0x14')][_0x3a4244[_0x7af8('0x52')]]){delete this[_0x7af8('0x14')][_0x3a4244[_0x7af8('0x52')]];}}}}catch(_0x20558a){logger[_0x7af8('0x45')](_0x7af8('0xcd'),_0x3a4244['uniqueid'],util[_0x7af8('0x46')](_0x20558a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0xd2')]=function(_0x586fe3){try{if(this[_0x7af8('0x72')](_0x586fe3)){logger[_0x7af8('0x50')](_0x7af8('0xd3'),_0x586fe3[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x586fe3,{'showHidden':![],'depth':null}));var _0x165972;var _0xda8b94;var _0x108040;if(this['queueReports'][_0x586fe3[_0x7af8('0xd4')]]){_0x165972=_[_0x7af8('0x85')](this['queueReports'][_0x586fe3['transfereeuniqueid']]);_0x165972[_0x7af8('0x9c')]=_0x586fe3[_0x7af8('0xd5')];_0x165972['transferuniqueid']=_0x586fe3[_0x7af8('0xd6')];_0x165972[_0x7af8('0x58')]='ATTENDEDTRANSFER';_0x165972[_0x7af8('0x93')]=!![];_0x165972[_0x7af8('0xd7')]=_0x7af8('0xd8');if(this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd6')]]){_0x108040=this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd6')]];this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd6')]]=this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd4')]];this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd4')]]=_0x108040;_0xda8b94=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd4')]]);_0xda8b94['switch']=!![];}logger[_0x7af8('0x88')](_0x7af8('0xd9'),_0x586fe3['uniqueid'],_0x165972['queue'],_0x165972['type'],_0x165972['transferexten'],_0x165972[_0x7af8('0x9e')]);}else if(this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xda')]]){_0x165972=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xda')]]);_0x165972[_0x7af8('0x9c')]=_0x586fe3[_0x7af8('0xdb')];_0x165972[_0x7af8('0x9e')]=_0x586fe3['origtransfereruniqueid'];_0x165972[_0x7af8('0x58')]=_0x7af8('0x59');_0x165972[_0x7af8('0x93')]=!![];_0x165972[_0x7af8('0xd7')]=_0x7af8('0xd8');if(this['queueReports'][_0x586fe3['origtransfereruniqueid']]){_0x108040=this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xdc')]];this[_0x7af8('0x47')][_0x586fe3['origtransfereruniqueid']]=this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xda')]];this[_0x7af8('0x47')][_0x586fe3['transfertargetuniqueid']]=_0x108040;_0xda8b94=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x586fe3['transfertargetuniqueid']]);_0xda8b94[_0x7af8('0x3c')]=!![];}logger[_0x7af8('0x88')](_0x7af8('0xd9'),_0x586fe3[_0x7af8('0x52')],_0x165972[_0x7af8('0x54')],_0x165972[_0x7af8('0x6c')],_0x165972[_0x7af8('0x9c')],_0x165972[_0x7af8('0x9e')]);}else if(this[_0x7af8('0x47')][_0x586fe3['origtransfereruniqueid']]){_0x165972=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xdc')]]);_0x165972['transferexten']=_0x586fe3[_0x7af8('0xdb')];_0x165972[_0x7af8('0x9e')]=_0x586fe3[_0x7af8('0xdc')];_0x165972[_0x7af8('0x58')]=_0x7af8('0x59');_0x165972[_0x7af8('0x93')]=!![];_0x165972[_0x7af8('0xd7')]=_0x7af8('0xd8');_0x165972[_0x7af8('0x3c')]=!![];_0x165972[_0x7af8('0xd0')]=_0x586fe3['transfereeuniqueid'];}else if(this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd6')]]){_0x165972=_['last'](this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd6')]]);_0x165972[_0x7af8('0x9c')]=_0x586fe3[_0x7af8('0xd5')];_0x165972[_0x7af8('0x9e')]=_0x586fe3[_0x7af8('0xd6')];_0x165972[_0x7af8('0x58')]=_0x7af8('0x59');_0x165972['transfer']=!![];_0x165972['transfertype']=_0x7af8('0xd8');_0x165972[_0x7af8('0x3c')]=!![];_0x165972['transferid']=_0x586fe3[_0x7af8('0xda')];}}}catch(_0x4b9f64){logger[_0x7af8('0x45')](_0x7af8('0xd3'),_0x586fe3['uniqueid'],util['inspect'](_0x4b9f64,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x2f')]=function(_0x1b5a3f){try{if(this[_0x7af8('0x72')](_0x1b5a3f)){logger[_0x7af8('0x50')]('[%s][voiceQueueReport][blindtransfer]',_0x1b5a3f[_0x7af8('0x52')],util['inspect'](_0x1b5a3f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1b5a3f[_0x7af8('0xd4')]]){var _0x53f63d=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x1b5a3f[_0x7af8('0xd4')]]);_0x53f63d[_0x7af8('0x58')]=_0x7af8('0xdd');_0x53f63d[_0x7af8('0x93')]=!![];_0x53f63d[_0x7af8('0xd7')]=_0x7af8('0xde');_0x53f63d[_0x7af8('0x9c')]=_0x1b5a3f[_0x7af8('0xdf')];_0x53f63d['transferuniqueid']=_0x1b5a3f[_0x7af8('0xd4')];logger['info'](_0x7af8('0xe0'),_0x1b5a3f[_0x7af8('0x52')],_0x53f63d[_0x7af8('0x54')],_0x53f63d[_0x7af8('0x6c')],_0x53f63d[_0x7af8('0x9c')],_0x53f63d[_0x7af8('0x9e')]);this[_0x7af8('0x27')]({'event':_0x7af8('0xe1'),'uniqueid':_0x1b5a3f['transfereeuniqueid'],'context':_0x1b5a3f[_0x7af8('0xe2')],'channel':_0x1b5a3f[_0x7af8('0xe3')]});}}}catch(_0x44294c){logger['error']('[%s][voiceQueueReport][blindtransfer]',_0x1b5a3f[_0x7af8('0x52')],util['inspect'](_0x44294c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x2a')]=function(_0x436424){try{if(this[_0x7af8('0x72')](_0x436424)){logger[_0x7af8('0x50')](_0x7af8('0xe4'),_0x436424[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x436424,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x436424[_0x7af8('0x52')]]){var _0x3a78e2=_['last'](this['queueReports'][_0x436424[_0x7af8('0x52')]]);if(!_[_0x7af8('0x3e')](_0x3a78e2[_0x7af8('0xaa')])){_0x3a78e2[_0x7af8('0xe5')]=moment()['format'](_0x7af8('0x78'));logger[_0x7af8('0x88')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x436424['uniqueid'],_0x3a78e2[_0x7af8('0xe5')]);}}}}catch(_0x485a72){logger['error'](_0x7af8('0xe4'),_0x436424['uniqueid'],util[_0x7af8('0x46')](_0x485a72,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x2c')]=function(_0xc71ee8){try{if(this[_0x7af8('0x72')](_0xc71ee8)){logger[_0x7af8('0x50')](_0x7af8('0xe6'),_0xc71ee8[_0x7af8('0x52')],util[_0x7af8('0x46')](_0xc71ee8,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xc71ee8[_0x7af8('0x52')]]){var _0x1441ec=_[_0x7af8('0x85')](this['queueReports'][_0xc71ee8[_0x7af8('0x52')]]);if(!_[_0x7af8('0x3e')](_0x1441ec[_0x7af8('0xe5')])){_0x1441ec[_0x7af8('0xe7')]+=moment()[_0x7af8('0xc4')](0x0)[_0x7af8('0xc2')](_0x1441ec[_0x7af8('0xe5')],'seconds');logger[_0x7af8('0x88')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0xc71ee8[_0x7af8('0x52')],_0x1441ec[_0x7af8('0xe7')]);delete _0x1441ec[_0x7af8('0xe5')];}}}}catch(_0x25bafd){logger[_0x7af8('0x45')](_0x7af8('0xe6'),_0xc71ee8[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x25bafd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0xe8')]=function(_0x11090f){try{if(this['isNotNull'](_0x11090f)){logger[_0x7af8('0x50')](_0x7af8('0xe9'),_0x11090f[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x11090f,{'showHidden':![],'depth':null}));if(_0x11090f[_0x7af8('0xea')][_0x7af8('0x97')]()===_0x7af8('0xeb')){_0x11090f[_0x7af8('0xec')]=_0x11090f['appdata']&&_0x11090f[_0x7af8('0xed')]['startsWith'](_0x7af8('0xee'))?_0x11090f[_0x7af8('0xed')]:(_0x11090f[_0x7af8('0xed')]||_0x11090f[_0x7af8('0xec')])[_0x7af8('0x97')]();if(_[_0x7af8('0x96')](_0x11090f[_0x7af8('0xec')]['toLowerCase'](),_0x7af8('0xef'))){logger[_0x7af8('0x88')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x11090f[_0x7af8('0x52')],_0x11090f[_0x7af8('0xea')],_0x11090f[_0x7af8('0xec')]);if(_[_0x7af8('0x5e')](this[_0x7af8('0x3b')][_0x11090f['uniqueid']]))this[_0x7af8('0x3b')][_0x11090f['uniqueid']]={};var _0x1a4cc5=_0x11090f[_0x7af8('0xec')]['split']('=');var _0x2d4bcc=_0x1a4cc5[0x0][_0x7af8('0x97')]()['match'](/cdr\((.*)\)/);if(_0x2d4bcc)this[_0x7af8('0x3b')][_0x11090f[_0x7af8('0x52')]][_0x2d4bcc[0x1]]=_0x1a4cc5[0x1];}}}}catch(_0x43bcb5){logger[_0x7af8('0x45')](_0x7af8('0xf0'),_0x11090f[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x43bcb5,{'showHidden':![],'depth':null}));}};module[_0x7af8('0xf1')]=VoiceQueueReport;
\ No newline at end of file