Built motion from commit e02f907f.|2.6.14
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index 8091a57..b393a7d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9e72=['syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','pTalking','queueStatusComplete','switch','isNil','Action','status','catch','message','No\x20such\x20channel','error','inspect','[%s][voiceQueueReport][checkQueueReport]','variables','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','debug','[%s][voiceQueueReport][','uniqueid','emit','format','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','queue','voice_queue_channel:remove','emitInboundVoiceQueueSummary','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','voice:queue:%s','voice_queue:save','isUndefined','clearZombieChannels','queues','[voiceQueueReport][queues]','isRunning','then','actionid','queuestatus','[voiceQueueReport][queuesummary]','createQueueSummaryReport','name','summaryEvent','createReport','assign','type','inbound','handleInboundQueueSummaryReport','outbound','custom:queuesummary','statusRequests','completeEvent','isNotNull','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','queuecallerleave','[%s][voiceQueueReport][agentconnect]','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','lastAssignedTo','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','queuecallercomplete','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','addVariable','value','variable','CONTINUE','TIMEOUT','lastevent','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','handleHangup','length','unmanaged','abandoned','sumHoldTime','diff','sumDuration','milliseconds','total','sumBillable','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','ATTENDEDTRANSFER','COMPLETEDBYAGENT','cause-txt','cause','transferid','[%s][voiceQueueReport][hangup]','syncAttendedTransfer','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfereruniqueid','origtransfererexten','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','lodash','moment','ioredis','../../../config/logger','ami','../ami','../model/voiceQueueSummary','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','realtime','agents','channels','queueChannels','voiceQueues','campaigns','summary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','syncQueueCallerLeave','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart'];(function(_0x218b6f,_0x2a67cc){var _0x45c373=function(_0x3de60c){while(--_0x3de60c){_0x218b6f['push'](_0x218b6f['shift']());}};_0x45c373(++_0x2a67cc);}(_0x9e72,0xc7));var _0x29e7=function(_0x11de08,_0x43b2bf){_0x11de08=_0x11de08-0x0;var _0x5c5c32=_0x9e72[_0x11de08];return _0x5c5c32;};'use strict';var _=require(_0x29e7('0x0'));var moment=require(_0x29e7('0x1'));var util=require('util');var Redis=require(_0x29e7('0x2'));var config=require('../../../config/environment');var logger=require(_0x29e7('0x3'))(_0x29e7('0x4'));var ami=require(_0x29e7('0x5'));var QueueReport=require('../model/queueReport');var VoiceQueueSummary=require(_0x29e7('0x6'));config[_0x29e7('0x7')]=_[_0x29e7('0x8')](config['redis'],{'host':_0x29e7('0x9'),'port':0x18eb});var io=require(_0x29e7('0xa'))(new Redis(config[_0x29e7('0x7')]));var Sequence=function(){};Sequence[_0x29e7('0xb')][_0x29e7('0xc')]=function(_0x4cca44){this[_0x29e7('0xd')]=this[_0x29e7('0xd')]?this[_0x29e7('0xd')][_0x29e7('0xe')](_0x4cca44):_0x4cca44();};function VoiceQueueReport(_0x38fc00){this[_0x29e7('0xf')]=new Sequence();this[_0x29e7('0x10')]={};this[_0x29e7('0x11')]=_0x38fc00;this[_0x29e7('0x12')]=_0x38fc00[_0x29e7('0x12')];this[_0x29e7('0x13')]=_0x38fc00[_0x29e7('0x14')];this[_0x29e7('0x15')]=_0x38fc00['voiceQueues'];this['campaigns']=_0x38fc00[_0x29e7('0x16')];this[_0x29e7('0x17')]=initializeSummary();this['variables']={};ami['on']('queuesummary',this[_0x29e7('0x18')][_0x29e7('0x19')](this));ami['on'](_0x29e7('0x1a'),this[_0x29e7('0x1b')][_0x29e7('0x19')](this));ami['on']('queuemember',this[_0x29e7('0x1c')][_0x29e7('0x19')](this));ami['on'](_0x29e7('0x1d'),this[_0x29e7('0x1e')][_0x29e7('0x19')](this));ami['on'](_0x29e7('0x1f'),this[_0x29e7('0x20')][_0x29e7('0x19')](this));ami['on'](_0x29e7('0x21'),this[_0x29e7('0x22')]['bind'](this));ami['on']('queuecallerleave',this[_0x29e7('0x23')][_0x29e7('0x19')](this));ami['on']('agentcomplete',this[_0x29e7('0x24')][_0x29e7('0x19')](this));ami['on']('agentconnect',this[_0x29e7('0x25')][_0x29e7('0x19')](this));ami['on'](_0x29e7('0x26'),this[_0x29e7('0x27')]['bind'](this));ami['on'](_0x29e7('0x28'),this[_0x29e7('0x29')]['bind'](this));ami['on'](_0x29e7('0x2a'),this[_0x29e7('0x2b')]['bind'](this));ami['on'](_0x29e7('0x2c'),this['syncMusicOnHoldStart'][_0x29e7('0x19')](this));ami['on']('musiconholdstop',this[_0x29e7('0x2d')]['bind'](this));ami['on'](_0x29e7('0x2e'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x29e7('0x2f'),this[_0x29e7('0x30')]['bind'](this));this['loopQueueSummary']();this[_0x29e7('0x31')]();}function clearChannels(_0x37e4f8){if(!_['isEmpty'](_0x37e4f8)){for(var _0x35b174 in _0x37e4f8){if(_0x37e4f8[_0x29e7('0x32')](_0x35b174)){delete _0x37e4f8[_0x35b174];}}}}function clearCampaigns(_0x523f11){if(!_[_0x29e7('0x33')](_0x523f11)){for(var _0x316302 in _0x523f11){if(_0x523f11[_0x29e7('0x32')](_0x316302)){_0x523f11[_0x316302][_0x29e7('0x34')]=0x0;}}}}function clearVoiceQueues(_0x293ead){if(!_['isEmpty'](_0x293ead)){for(var _0x5b1ad0 in _0x293ead){if(_0x293ead['hasOwnProperty'](_0x5b1ad0)){_0x293ead[_0x5b1ad0][_0x29e7('0x34')]=0x0;_0x293ead[_0x5b1ad0][_0x29e7('0x35')]=0x0;_0x293ead[_0x5b1ad0][_0x29e7('0x36')]=0x0;_0x293ead[_0x5b1ad0]['waiting']=0x0;_0x293ead[_0x5b1ad0][_0x29e7('0x37')]=!![];}}}}function clearAgentBooked(_0x39976d){if(!_[_0x29e7('0x33')](_0x39976d)){for(var _0x393a9 in _0x39976d){if(_0x39976d[_0x29e7('0x32')](_0x393a9)){_0x39976d[_0x393a9]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}VoiceQueueReport[_0x29e7('0xb')]['clearZombieChannels']=function(){var _0x3c2ec4=this;for(var _0x240691 in this['channels']){if(this[_0x29e7('0x13')]['hasOwnProperty'](_0x240691)&&!this[_0x29e7('0x13')][_0x240691][_0x29e7('0x38')]){this[_0x29e7('0xf')][_0x29e7('0xc')](function(){if(!_[_0x29e7('0x39')](_0x3c2ec4[_0x29e7('0x13')][_0x240691])){return ami[_0x29e7('0x3a')]({'action':_0x29e7('0x3b'),'channel':_0x3c2ec4[_0x29e7('0x13')][_0x240691]['channel']})[_0x29e7('0x3c')](function(_0x47f08e){if(_0x47f08e[_0x29e7('0x3d')]===_0x29e7('0x3e')){setTimeout(function(){if(_0x3c2ec4[_0x29e7('0x13')][_0x240691]){delete _0x3c2ec4[_0x29e7('0x13')][_0x240691];logger[_0x29e7('0x3f')]('[%s][voiceQueueReport][checkChannel]',_0x240691,util[_0x29e7('0x40')](_0x47f08e,{'showHidden':![],'depth':null}));}if(_0x3c2ec4[_0x29e7('0x10')][_0x240691]){delete _0x3c2ec4[_0x29e7('0x10')][_0x240691];logger[_0x29e7('0x3f')](_0x29e7('0x41'),_0x240691,util[_0x29e7('0x40')](_0x47f08e,{'showHidden':![],'depth':null}));}if(_0x3c2ec4[_0x29e7('0x42')][_0x240691]){delete _0x3c2ec4[_0x29e7('0x42')][_0x240691];logger[_0x29e7('0x3f')](_0x29e7('0x43'),_0x240691,util[_0x29e7('0x40')](_0x47f08e,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x29e7('0xb')]['syncFullyBooted']=function(){logger['error'](_0x29e7('0x44'));clearChannels(this[_0x29e7('0x13')]);this['clearQueueReport'](this[_0x29e7('0x10')]);clearAgentBooked(this[_0x29e7('0x12')]);clearVoiceQueues(this[_0x29e7('0x15')]);clearCampaigns(this[_0x29e7('0x16')]);this[_0x29e7('0x17')]=initializeSummary();};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x45')]=function(_0x43b81c){var _0x5158d6=this;if(!_[_0x29e7('0x33')](_0x43b81c)){for(var _0x21e3ed in _0x43b81c){if(_0x43b81c[_0x29e7('0x32')](_0x21e3ed)){_0x5158d6[_0x29e7('0x46')](_0x43b81c[_0x21e3ed],'clearqueuereport');delete _0x43b81c[_0x21e3ed];}}}};VoiceQueueReport[_0x29e7('0xb')]['emit']=function(_0x3d9c4d,_0x45935b,_0x2ed4e8){io['to'](_0x3d9c4d)['emit'](_0x45935b,_0x2ed4e8);};VoiceQueueReport[_0x29e7('0xb')]['emitVoiceQueueChannelSave']=function(_0x22d50e,_0x2c823f){logger[_0x29e7('0x47')](_0x29e7('0x48')+_0x2c823f+']\x20sending\x20voice_queue_channel:save\x20event:',_0x22d50e[_0x29e7('0x49')],util[_0x29e7('0x40')](_0x22d50e,{'showHidden':![],'depth':null}));this[_0x29e7('0x4a')](util[_0x29e7('0x4b')]('voice:queue:%s',_0x22d50e['queue']),_0x29e7('0x4c'),_0x22d50e);io['emit'](_0x29e7('0x4d'),_0x22d50e);};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x46')]=function(_0x249859,_0x261f45){logger[_0x29e7('0x47')](_0x29e7('0x48')+_0x261f45+_0x29e7('0x4e'),_0x249859['uniqueid'],util[_0x29e7('0x40')](_0x249859,{'showHidden':![],'depth':null}));if(_0x249859[_0x29e7('0x4f')]==='ATTENDEDTRANSFER'){return;}this[_0x29e7('0x4a')](util[_0x29e7('0x4b')]('voice:queue:%s',_0x249859[_0x29e7('0x50')]),_0x29e7('0x51'),_0x249859);io[_0x29e7('0x4a')]('voice_queue_presence:remove',_0x249859);};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x52')]=function(_0x11c146){if(_0x11c146['type']==='inbound'){logger['debug'](_0x29e7('0x53'),util[_0x29e7('0x40')](_0x11c146,{'showHidden':![],'depth':null}));this[_0x29e7('0x4a')](util[_0x29e7('0x4b')](_0x29e7('0x54'),_0x11c146['name']),_0x29e7('0x55'),_0x11c146);}};VoiceQueueReport[_0x29e7('0xb')]['isNotNull']=function(_0x29f0c9){return _0x29f0c9!==null&&!_[_0x29e7('0x56')](_0x29f0c9);};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x31')]=function(){var _0x314bf4=this;setInterval(function(){_0x314bf4[_0x29e7('0x57')]();ami[_0x29e7('0x3a')]({'action':_0x29e7('0x58')})[_0x29e7('0x3c')](function(_0x18647a){logger[_0x29e7('0x3f')](_0x29e7('0x59'),util[_0x29e7('0x40')](_0x18647a,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x29e7('0xb')]['loopQueueSummary']=function(){var _0x11b9cf=this;setInterval(function(){if(!_0x11b9cf['summary'][_0x29e7('0x5a')]){return ami[_0x29e7('0x3a')]({'action':'queuesummary'})[_0x29e7('0x5b')](function(_0x1c7cf1){_0x11b9cf[_0x29e7('0x17')]['id']=_0x1c7cf1[_0x29e7('0x5c')];_0x11b9cf['summary'][_0x29e7('0x5a')]=!![];_0x11b9cf[_0x29e7('0x17')][_0x29e7('0x5d')][_0x1c7cf1[_0x29e7('0x5c')]]={};})[_0x29e7('0x3c')](function(_0x4c48aa){logger[_0x29e7('0x3f')](_0x29e7('0x5e'),util['inspect'](_0x4c48aa,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x5f')]=function(_0x1ba2ad,_0x37384b){var _0xc847e8=this[_0x29e7('0x17')][_0x29e7('0x58')][_0x1ba2ad[_0x29e7('0x60')]][_0x29e7('0x61')];var _0x299c5b=new VoiceQueueSummary(_0x1ba2ad);return _0x299c5b[_0x29e7('0x62')](_0x37384b['agents'],this[_0x29e7('0x12')],_0xc847e8,this[_0x29e7('0x11')][_0x29e7('0x13')]);};VoiceQueueReport[_0x29e7('0xb')]['handleInboundQueueSummaryReport']=function(_0x3ed6d0,_0x52c2c0){var _0x597622=this['createQueueSummaryReport'](_0x3ed6d0,_0x52c2c0);var _0x27e5b1=![];_0x27e5b1=_0x597622['compareToInboundQueue'](_0x3ed6d0);if(_0x27e5b1){Object[_0x29e7('0x63')](_0x3ed6d0,_0x597622);this[_0x29e7('0x11')]['voiceQueues'][_0x3ed6d0[_0x29e7('0x60')]]=_0x3ed6d0;this[_0x29e7('0x52')](_0x597622);}};VoiceQueueReport['prototype'][_0x29e7('0x1e')]=function(_0x4a4804){var _0x101ba6=null;var _0x59e79f=this[_0x29e7('0x17')]['id'];if(this['summary']['queuestatus'][_0x59e79f]){_0x101ba6=this[_0x29e7('0x17')][_0x29e7('0x5d')][_0x59e79f][_0x4a4804[_0x29e7('0x5c')]];}if(!_0x101ba6){this['summary']=initializeSummary();return;}var _0x2bc510=this[_0x29e7('0x15')][_0x101ba6[_0x29e7('0x50')]];if(_0x2bc510[_0x29e7('0x64')]===_0x29e7('0x65')){this[_0x29e7('0x66')](_0x2bc510,_0x101ba6);}else if(_0x2bc510['type']===_0x29e7('0x67')){var _0x547e93=this['createQueueSummaryReport'](_0x2bc510,_0x101ba6);ami[_0x29e7('0x4a')](_0x29e7('0x68'),_0x547e93);}this[_0x29e7('0x17')][_0x29e7('0x69')]-=0x1;var _0x4e4af2=this[_0x29e7('0x17')]['statusRequests']>0x0?!![]:![];if(!_0x4e4af2){return this[_0x29e7('0x1b')](this[_0x29e7('0x17')][_0x29e7('0x6a')]);}};VoiceQueueReport['prototype'][_0x29e7('0x1c')]=function(_0x58b668){var _0x1d3236=this[_0x29e7('0x17')]['id'];if(this[_0x29e7('0x17')][_0x29e7('0x5d')][_0x1d3236]&&this[_0x29e7('0x17')][_0x29e7('0x5d')][_0x1d3236][_0x58b668['actionid']]){this['summary'][_0x29e7('0x5d')][_0x1d3236][_0x58b668[_0x29e7('0x5c')]][_0x29e7('0x12')]['push'](_0x58b668);}};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x18')]=function(_0x1cb8de){var _0x4b19aa=this;try{if(this[_0x29e7('0x6b')](_0x1cb8de)&&this[_0x29e7('0x6b')](_0x1cb8de[_0x29e7('0x50')])){logger[_0x29e7('0x47')](_0x29e7('0x6c'),util['inspect'](_0x1cb8de,{'showHidden':![],'depth':null}));var _0x51c424=this['voiceQueues'][_0x1cb8de[_0x29e7('0x50')]];if(_0x51c424){logger[_0x29e7('0x6d')](_0x29e7('0x6e'),_0x51c424[_0x29e7('0x60')]);this[_0x29e7('0x17')]['queues'][_0x51c424['name']]={'summaryEvent':_0x1cb8de};this[_0x29e7('0x17')][_0x29e7('0x69')]+=0x1;return ami[_0x29e7('0x3a')]({'action':'queuestatus','queue':_0x51c424[_0x29e7('0x60')]})[_0x29e7('0x5b')](function(_0x46a8d8){if(!_0x4b19aa[_0x29e7('0x17')][_0x29e7('0x5d')][_0x1cb8de[_0x29e7('0x5c')]]){_0x4b19aa[_0x29e7('0x17')][_0x29e7('0x5d')][_0x1cb8de[_0x29e7('0x5c')]]={};}_0x4b19aa[_0x29e7('0x17')][_0x29e7('0x5d')][_0x1cb8de['actionid']][_0x46a8d8['actionid']]={'queue':_0x51c424[_0x29e7('0x60')],'agents':[]};})[_0x29e7('0x3c')](function(_0x3cb6a7){throw _0x3cb6a7;});}}}catch(_0xb23ea){logger[_0x29e7('0x3f')](_0x29e7('0x5e'),util[_0x29e7('0x40')](_0xb23ea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x1b')]=function(_0x52f5e){if(this['summary']['statusRequests']>0x0){this[_0x29e7('0x17')][_0x29e7('0x6a')]=_0x52f5e;return;}logger[_0x29e7('0x47')](_0x29e7('0x6f'),util['inspect'](_0x52f5e,{'showHidden':![],'depth':null}));this[_0x29e7('0x17')]=initializeSummary();ami[_0x29e7('0x4a')](_0x29e7('0x70'),{});};VoiceQueueReport[_0x29e7('0xb')]['syncQueueCallerJoin']=function(_0x401108){try{if(this[_0x29e7('0x6b')](_0x401108)){logger[_0x29e7('0x47')](_0x29e7('0x71'),_0x401108['uniqueid'],util[_0x29e7('0x40')](_0x401108,{'showHidden':![],'depth':null}));if(_[_0x29e7('0x56')](this[_0x29e7('0x10')][_0x401108[_0x29e7('0x49')]])){this['queueReports'][_0x401108[_0x29e7('0x49')]]=[];}if(_[_0x29e7('0x56')](this['channels'][_0x401108[_0x29e7('0x49')]])){this[_0x29e7('0x13')][_0x401108[_0x29e7('0x49')]]={};}var _0x267c73=new QueueReport();_0x267c73['queue']=_0x401108[_0x29e7('0x50')];_0x267c73[_0x29e7('0x64')]=this[_0x29e7('0x15')][_0x267c73[_0x29e7('0x50')]]&&this[_0x29e7('0x15')][_0x267c73[_0x29e7('0x50')]][_0x29e7('0x64')]?this[_0x29e7('0x15')][_0x267c73[_0x29e7('0x50')]][_0x29e7('0x64')]||'inbound':_0x29e7('0x65');_0x267c73[_0x29e7('0x72')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x267c73[_0x29e7('0x73')]=_0x401108[_0x29e7('0x73')];_0x267c73[_0x29e7('0x74')]=_0x401108[_0x29e7('0x74')];_0x267c73[_0x29e7('0x49')]=_0x401108[_0x29e7('0x49')];_0x267c73[_0x29e7('0x75')]=this[_0x29e7('0x13')][_0x401108[_0x29e7('0x49')]][_0x29e7('0x75')];logger['info'](_0x29e7('0x76'),_0x267c73['queue'],_0x267c73[_0x29e7('0x64')]);_[_0x29e7('0x77')](_0x267c73,_[_0x29e7('0x78')](_0x401108,_[_0x29e7('0x79')](_0x267c73)));this[_0x29e7('0x10')][_0x401108[_0x29e7('0x49')]][_0x29e7('0x7a')](_0x267c73);this['channels'][_0x401108[_0x29e7('0x49')]]=_0x267c73;this['emitVoiceQueueChannelSave'](_0x267c73,_0x29e7('0x1f'));}}catch(_0x311239){logger[_0x29e7('0x3f')](_0x29e7('0x71'),_0x401108['uniqueid'],util[_0x29e7('0x40')](_0x311239,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x22')]=function(_0x9e7c4b){try{if(this['isNotNull'](_0x9e7c4b)){logger[_0x29e7('0x47')](_0x29e7('0x7b'),_0x9e7c4b[_0x29e7('0x49')],util[_0x29e7('0x40')](_0x9e7c4b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x9e7c4b[_0x29e7('0x49')]]){var _0x42147b=_[_0x29e7('0x7c')](this[_0x29e7('0x10')][_0x9e7c4b[_0x29e7('0x49')]]);_0x42147b['queuecallercomplete']=![];_0x42147b[_0x29e7('0x7d')]=null;_0x42147b[_0x29e7('0x7e')]=_0x9e7c4b[_0x29e7('0x7e')];_0x42147b['originalposition']=_0x9e7c4b[_0x29e7('0x7f')];_0x42147b[_0x29e7('0x21')]=!![];_0x42147b[_0x29e7('0x80')]=moment()[_0x29e7('0x4b')](_0x29e7('0x81'));_0x42147b[_0x29e7('0x4f')]='ABANDONED';_0x42147b['lastAssignedTo']=null;logger[_0x29e7('0x6d')](_0x29e7('0x82'),_0x42147b[_0x29e7('0x50')],_0x42147b['type']);this[_0x29e7('0x13')][_0x9e7c4b['uniqueid']]=_0x42147b;this[_0x29e7('0x46')](_0x42147b,_0x29e7('0x21'));}}}catch(_0x4cf9d7){logger[_0x29e7('0x3f')](_0x29e7('0x7b'),_0x9e7c4b[_0x29e7('0x49')],util['inspect'](_0x4cf9d7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x23')]=function(_0x18297c){try{if(this[_0x29e7('0x6b')](_0x18297c)){logger[_0x29e7('0x47')](_0x29e7('0x83'),_0x18297c[_0x29e7('0x49')],util['inspect'](_0x18297c,{'showHidden':![],'depth':null}));if(this[_0x29e7('0x10')][_0x18297c[_0x29e7('0x49')]]){var _0x257efa=_[_0x29e7('0x7c')](this[_0x29e7('0x10')][_0x18297c[_0x29e7('0x49')]]);_0x257efa[_0x29e7('0x84')]=moment()[_0x29e7('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x257efa['connectedlinenum']=_0x18297c[_0x29e7('0x85')];_0x257efa[_0x29e7('0x86')]=_0x18297c[_0x29e7('0x86')];logger[_0x29e7('0x6d')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x257efa[_0x29e7('0x50')],_0x257efa[_0x29e7('0x64')],_0x18297c[_0x29e7('0x85')],_0x18297c['connectedlinename']);this[_0x29e7('0x13')][_0x18297c['uniqueid']]=_0x257efa;this['emitVoiceQueueChannelSave'](_0x257efa,_0x29e7('0x87'));}}}catch(_0x3994e7){logger['error'](_0x29e7('0x83'),_0x18297c[_0x29e7('0x49')],util[_0x29e7('0x40')](_0x3994e7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x25')]=function(_0x3b01f8){try{if(this[_0x29e7('0x6b')](_0x3b01f8)){logger[_0x29e7('0x47')](_0x29e7('0x88'),_0x3b01f8['uniqueid'],util['inspect'](_0x3b01f8,{'showHidden':![],'depth':null}));if(this[_0x29e7('0x10')][_0x3b01f8[_0x29e7('0x49')]]){var _0x12c857=_[_0x29e7('0x7c')](this[_0x29e7('0x10')][_0x3b01f8[_0x29e7('0x49')]]);_0x12c857['queuecallercomplete']=!![];_0x12c857[_0x29e7('0x4f')]='COMPLETEDBYAGENT';logger[_0x29e7('0x6d')](_0x29e7('0x89'),_0x12c857['queue'],_0x12c857[_0x29e7('0x64')]);}}}catch(_0x36a8a1){logger[_0x29e7('0x3f')]('[%s][voiceQueueReport][agentconnect]',_0x3b01f8[_0x29e7('0x49')],util[_0x29e7('0x40')](_0x36a8a1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x24')]=function(_0x3c409e){try{if(this['isNotNull'](_0x3c409e)){logger[_0x29e7('0x47')](_0x29e7('0x8a'),_0x3c409e[_0x29e7('0x49')],util[_0x29e7('0x40')](_0x3c409e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3c409e[_0x29e7('0x49')]]){var _0x3d34c2=_[_0x29e7('0x7c')](this[_0x29e7('0x10')][_0x3c409e[_0x29e7('0x49')]]);_0x3d34c2[_0x29e7('0x21')]=![];_0x3d34c2['queuecallerabandonAt']=null;_0x3d34c2['assigned']=!![];_0x3d34c2[_0x29e7('0x8b')]=_0x3c409e[_0x29e7('0x8c')];_0x3d34c2[_0x29e7('0x7e')]=_0x3c409e[_0x29e7('0x7e')];_0x3d34c2['queuecallercomplete']=!![];_0x3d34c2[_0x29e7('0x8d')]=![];_0x3d34c2[_0x29e7('0x8e')]=null;if(!_0x3d34c2[_0x29e7('0x8f')]){if(_0x3c409e[_0x29e7('0x90')]=='transfer'){_0x3d34c2[_0x29e7('0x4f')]=_0x29e7('0x91');logger[_0x29e7('0x6d')](_0x29e7('0x92'),_0x3d34c2[_0x29e7('0x50')],_0x3d34c2[_0x29e7('0x64')]);}else{if(_[_0x29e7('0x93')](_0x3c409e[_0x29e7('0x94')][_0x29e7('0x95')](),_0x29e7('0x96'))){if(this[_0x29e7('0x10')][_0x3c409e['linkedid']]){var _0x40c451=_['last'](this[_0x29e7('0x10')][_0x3c409e[_0x29e7('0x97')]]);_0x40c451[_0x29e7('0x98')]=![];_0x40c451['queuecallerexit']=!![];_0x40c451[_0x29e7('0x8e')]=moment(_0x3d34c2[_0x29e7('0x72')])[_0x29e7('0x99')](_0x3c409e[_0x29e7('0x7e')],_0x29e7('0x9a'))[_0x29e7('0x4b')](_0x29e7('0x81'));_0x40c451[_0x29e7('0x4f')]=_0x29e7('0x9b');_0x40c451['transfer']=!![];_0x40c451[_0x29e7('0x9c')]=_0x29e7('0x9d');_0x40c451['transferexten']=_0x3c409e[_0x29e7('0x9e')];_0x40c451[_0x29e7('0x9f')]=_0x3c409e[_0x29e7('0x49')];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x40c451['queue'],_0x40c451[_0x29e7('0x64')]);var _0x3f7c45=this[_0x29e7('0x10')][_0x3c409e[_0x29e7('0x97')]];this[_0x29e7('0x10')][_0x3c409e[_0x29e7('0x97')]]=this['queueReports'][_0x3c409e['uniqueid']];this[_0x29e7('0x10')][_0x3c409e[_0x29e7('0x49')]]=_0x3f7c45;}}else{_0x3d34c2[_0x29e7('0x4f')]=_0x29e7('0xa0')+_0x3c409e[_0x29e7('0x90')]['toUpperCase']();logger[_0x29e7('0x6d')](_0x29e7('0xa1'),_0x3d34c2[_0x29e7('0x50')],_0x3d34c2['type'],_0x3d34c2[_0x29e7('0x4f')]);}}}this['channels'][_0x3c409e[_0x29e7('0x49')]]=_0x3d34c2;}}}catch(_0x1fb60f){logger[_0x29e7('0x3f')]('[%s][voiceQueueReport][agentcomplete]',_0x3c409e['uniqueid'],util['inspect'](_0x1fb60f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x27')]=function(_0x526dd9){try{if(this[_0x29e7('0x6b')](_0x526dd9)){logger[_0x29e7('0x47')]('[%s][voiceQueueReport][varset]',_0x526dd9[_0x29e7('0x49')],util['inspect'](_0x526dd9,{'showHidden':![],'depth':null}));this[_0x29e7('0xa2')](_0x526dd9['uniqueid'],_['keys'](_0x526dd9['variable'])[0x0],_0x526dd9[_0x29e7('0xa3')]);if(this[_0x29e7('0x10')][_0x526dd9[_0x29e7('0x49')]]){var _0x4718cd=_[_0x29e7('0x7c')](this[_0x29e7('0x10')][_0x526dd9[_0x29e7('0x49')]]);if(_0x4718cd){if(this[_0x29e7('0x6b')](_0x526dd9[_0x29e7('0xa4')])&&this[_0x29e7('0x6b')](_0x526dd9['variable']['queuestatus'])){switch(_0x526dd9[_0x29e7('0xa3')]){case _0x29e7('0xa5'):_0x4718cd[_0x29e7('0x8d')]=![];_0x4718cd['queuecallerexitAt']=null;break;case _0x29e7('0xa6'):_0x4718cd[_0x29e7('0xa7')]='timeout';_0x4718cd[_0x29e7('0x8d')]=!![];_0x4718cd[_0x29e7('0x8e')]=moment()[_0x29e7('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x4718cd[_0x29e7('0x84')]=moment()['format'](_0x29e7('0x81'));logger[_0x29e7('0x47')](_0x29e7('0xa8'),_0x526dd9[_0x29e7('0x49')],util['inspect'](_0x4718cd,{'showHidden':![],'depth':null}));ami[_0x29e7('0x4a')](_0x29e7('0xa9'),_0x4718cd);break;default:_0x4718cd[_0x29e7('0x8d')]=!![];_0x4718cd['queuecallerexitAt']=moment()['format'](_0x29e7('0x81'));_0x4718cd[_0x29e7('0x84')]=moment()['format'](_0x29e7('0x81'));}_0x4718cd['queuecallerabandon']=![];_0x4718cd['queuecallerabandonAt']=null;_0x4718cd[_0x29e7('0x4f')]=_0x526dd9[_0x29e7('0xa3')];this[_0x29e7('0x13')][_0x526dd9[_0x29e7('0x49')]]=_0x4718cd;this[_0x29e7('0x46')](_0x4718cd,_0x29e7('0x26'));}else if(this[_0x29e7('0x6b')](_0x526dd9['variable'])&&this[_0x29e7('0x6b')](_0x526dd9[_0x29e7('0xa4')]['queueposition'])){if(!_0x4718cd['queuecallerabandon']){_0x4718cd[_0x29e7('0x8d')]=!![];_0x4718cd[_0x29e7('0x8e')]=moment()[_0x29e7('0x4b')](_0x29e7('0x81'));_0x4718cd[_0x29e7('0x4f')]='EXITWITHKEY';_0x4718cd['queuecallerleaveAt']=moment()[_0x29e7('0x4b')](_0x29e7('0x81'));this['channels'][_0x526dd9['uniqueid']]=_0x4718cd;}}logger[_0x29e7('0x6d')](_0x29e7('0xaa'),_0x526dd9[_0x29e7('0x49')],_0x4718cd[_0x29e7('0x50')],_0x4718cd[_0x29e7('0x64')],_[_0x29e7('0x79')](_0x526dd9[_0x29e7('0xa4')])[0x0],_0x526dd9[_0x29e7('0xa3')]);_0x4718cd[_0x29e7('0x42')]=this[_0x29e7('0x42')][_0x526dd9['uniqueid']];}}}}catch(_0x400ea8){logger[_0x29e7('0x3f')](_0x29e7('0xab'),_0x526dd9['uniqueid'],util[_0x29e7('0x40')](_0x400ea8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x29e7('0xa2')]=function(_0x4d7d30,_0x3e19eb,_0x34900b){var _0x305d58=['rtpaudioqos',_0x29e7('0xac'),_0x29e7('0xad'),_0x29e7('0xae'),_0x29e7('0xaf'),_0x29e7('0xb0'),_0x29e7('0xb1'),_0x29e7('0xb2'),_0x29e7('0xb3'),_0x29e7('0xb4'),'bridgepeer','bridgepvtcallid',_0x29e7('0xb5'),'memberdynamic',_0x29e7('0xb6'),_0x29e7('0xb7'),_0x29e7('0x8c'),_0x29e7('0xb8'),_0x29e7('0xb9')];if(!_['isNil'](_0x3e19eb)&&!_[_0x29e7('0xba')](_0x305d58,_0x3e19eb)){if(_[_0x29e7('0x56')](this[_0x29e7('0x42')][_0x4d7d30])){this[_0x29e7('0x42')][_0x4d7d30]={};}this[_0x29e7('0x42')][_0x4d7d30][_0x3e19eb]=_0x34900b;}};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0xbb')]=function(_0x3e3a3b,_0xadfc05,_0x1a8c7e){var _0x42fd1a={};for(var _0x1e904b=0x0;_0x1e904b<this[_0x29e7('0x10')][_0x3e3a3b][_0x29e7('0xbc')];_0x1e904b+=0x1){_0x42fd1a=this[_0x29e7('0x10')][_0x3e3a3b][_0x1e904b];if(this[_0x29e7('0x15')][_0x42fd1a[_0x29e7('0x50')]]){if(_0x42fd1a[_0x29e7('0x8d')]&&_0x42fd1a[_0x29e7('0x8f')]!=!![]){this[_0x29e7('0x15')][_0x42fd1a[_0x29e7('0x50')]][_0x29e7('0xbd')]+=0x1;}if(_0x42fd1a[_0x29e7('0x21')]){this['voiceQueues'][_0x42fd1a[_0x29e7('0x50')]][_0x29e7('0xbe')]+=0x1;}this[_0x29e7('0x15')][_0x42fd1a[_0x29e7('0x50')]][_0x29e7('0xbf')]+=moment(_0x42fd1a['queuecallerleaveAt'])[_0x29e7('0xc0')](_0x42fd1a[_0x29e7('0x72')],'seconds')||0x0;if(_0x1e904b===this[_0x29e7('0x10')][_0x3e3a3b][_0x29e7('0xbc')]-0x1){this[_0x29e7('0x15')][_0x42fd1a['queue']][_0x29e7('0xc1')]+=moment()[_0x29e7('0xc2')](0x0)['diff'](_0x42fd1a['queuecallerjoinAt'],_0x29e7('0x9a'));this['voiceQueues'][_0x42fd1a[_0x29e7('0x50')]][_0x29e7('0xc3')]+=0x1;if(_0x42fd1a[_0x29e7('0x98')]){this[_0x29e7('0x15')][_0x42fd1a['queue']]['answered']+=0x1;this[_0x29e7('0x15')][_0x42fd1a[_0x29e7('0x50')]][_0x29e7('0xc4')]+=moment()[_0x29e7('0xc2')](0x0)[_0x29e7('0xc0')](_0x42fd1a[_0x29e7('0x84')],_0x29e7('0x9a'));_0x42fd1a[_0x29e7('0x7d')]=moment()[_0x29e7('0x4b')](_0x29e7('0x81'));_0x42fd1a['queuecallerexit']=![];_0x42fd1a[_0x29e7('0x8e')]=null;}if(_0x42fd1a['queuecallerexit']&&_0x42fd1a[_0x29e7('0x8f')]!=!![]){_0x42fd1a[_0x29e7('0xa7')]=_0x29e7('0xbd');logger[_0x29e7('0x47')](_0x29e7('0xc5'),_0x3e3a3b,util['inspect'](_0x42fd1a,{'showHidden':![],'depth':null}));ami[_0x29e7('0x4a')]('custom:queuecallerunmanaged',_0x42fd1a);}if(_0x42fd1a[_0x29e7('0x21')]){_0x42fd1a[_0x29e7('0xa7')]=_0x29e7('0xbe');logger[_0x29e7('0x47')](_0x29e7('0xc6'),_0x3e3a3b,util[_0x29e7('0x40')](_0x42fd1a,{'showHidden':![],'depth':null}));ami[_0x29e7('0x4a')](_0x29e7('0xc7'),_0x42fd1a);}}else{this['voiceQueues'][_0x42fd1a[_0x29e7('0x50')]]['sumDuration']+=this['voiceQueues'][_0x42fd1a[_0x29e7('0x50')]][_0x29e7('0xbf')];}logger[_0x29e7('0x6d')](_0x29e7('0xc8'),_0x3e3a3b,_0x42fd1a[_0x29e7('0x50')],_0x42fd1a[_0x29e7('0x64')],_0xadfc05);if(_0x1a8c7e&&_0x42fd1a[_0x29e7('0x4f')]===_0x29e7('0xc9')){_0x42fd1a['queuecallerexitreason']=_0x29e7('0xca');}this[_0x29e7('0x13')][_0x3e3a3b]=_0x42fd1a;if(_0x42fd1a[_0x29e7('0x84')]){this['emitVoiceQueueChannelRemove'](_0x42fd1a,_0x29e7('0x28'));}}}logger[_0x29e7('0x47')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x3e3a3b,util[_0x29e7('0x40')](this['queueReports'][_0x3e3a3b],{'showHidden':![],'depth':null}));ami[_0x29e7('0x4a')]('custom:voiceQueueReport',this[_0x29e7('0x10')][_0x3e3a3b]);if(_0x42fd1a[_0x29e7('0x4f')]===_0x29e7('0xc9')||_0x42fd1a[_0x29e7('0x84')]===null){return;}if(_0x42fd1a[_0x29e7('0x8d')]||_0x42fd1a[_0x29e7('0x21')]||_0x42fd1a['queuecallercomplete']){delete this['queueReports'][_0x3e3a3b];delete this['channels'][_0x3e3a3b];if(this[_0x29e7('0x42')][_0x3e3a3b]){delete this[_0x29e7('0x42')][_0x3e3a3b];}}};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x29')]=function(_0x2696cf){try{if(this[_0x29e7('0x6b')](_0x2696cf)){logger[_0x29e7('0x47')]('[%s][voiceQueueReport][hangup]',_0x2696cf[_0x29e7('0x49')],util[_0x29e7('0x40')](_0x2696cf,{'showHidden':![],'depth':null}));if(this[_0x29e7('0x10')][_0x2696cf[_0x29e7('0x49')]]){return this[_0x29e7('0xbb')](_0x2696cf['uniqueid'],_0x2696cf[_0x29e7('0xcb')],![]);}if(this[_0x29e7('0x10')][_0x2696cf[_0x29e7('0x97')]]){if(_0x2696cf[_0x29e7('0xcc')]==='21'){return;}return this['handleHangup'](_0x2696cf['linkedid'],_0x2696cf[_0x29e7('0xcb')],!![]);}var _0x376acc=Object[_0x29e7('0x79')](this[_0x29e7('0x10')]);for(var _0x4de010=0x0;_0x4de010<_0x376acc['length'];_0x4de010++){var _0x4658d3=_[_0x29e7('0x7c')](this['queueReports'][_0x376acc[_0x4de010]]);if(_0x4658d3&&_0x4658d3[_0x29e7('0xcd')]===_0x2696cf[_0x29e7('0x49')]){return this['handleHangup'](_0x4658d3['uniqueid'],_0x2696cf['cause-txt'],!![]);}}}}catch(_0x25edd1){logger[_0x29e7('0x3f')](_0x29e7('0xce'),_0x2696cf[_0x29e7('0x49')],util[_0x29e7('0x40')](_0x25edd1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0xcf')]=function(_0x2aa1c9){try{if(this[_0x29e7('0x6b')](_0x2aa1c9)){logger[_0x29e7('0x47')]('[%s][voiceQueueReport][attendedtransfer]',_0x2aa1c9[_0x29e7('0x49')],util[_0x29e7('0x40')](_0x2aa1c9,{'showHidden':![],'depth':null}));var _0x64954;var _0xb2f649;var _0x51263d;if(this[_0x29e7('0x10')][_0x2aa1c9[_0x29e7('0xd0')]]){_0x64954=_['last'](this['queueReports'][_0x2aa1c9[_0x29e7('0xd0')]]);_0x64954[_0x29e7('0xd1')]=_0x2aa1c9[_0x29e7('0xd2')];_0x64954[_0x29e7('0x9f')]=_0x2aa1c9[_0x29e7('0xd3')];_0x64954['queuecallerexitreason']=_0x29e7('0xc9');_0x64954[_0x29e7('0x8f')]=!![];_0x64954[_0x29e7('0x9c')]=_0x29e7('0xd4');if(this[_0x29e7('0x10')][_0x2aa1c9[_0x29e7('0xd3')]]){_0x51263d=this['queueReports'][_0x2aa1c9['secondtransfereruniqueid']];this[_0x29e7('0x10')][_0x2aa1c9['secondtransfereruniqueid']]=this[_0x29e7('0x10')][_0x2aa1c9[_0x29e7('0xd0')]];this['queueReports'][_0x2aa1c9[_0x29e7('0xd0')]]=_0x51263d;_0xb2f649=_[_0x29e7('0x7c')](this[_0x29e7('0x10')][_0x2aa1c9[_0x29e7('0xd0')]]);_0xb2f649[_0x29e7('0x38')]=!![];}logger[_0x29e7('0x6d')](_0x29e7('0xd5'),_0x2aa1c9[_0x29e7('0x49')],_0x64954[_0x29e7('0x50')],_0x64954[_0x29e7('0x64')],_0x64954[_0x29e7('0xd1')],_0x64954[_0x29e7('0x9f')]);}else if(this[_0x29e7('0x10')][_0x2aa1c9['transfertargetuniqueid']]){_0x64954=_[_0x29e7('0x7c')](this[_0x29e7('0x10')][_0x2aa1c9[_0x29e7('0xd6')]]);_0x64954[_0x29e7('0xd1')]=_0x2aa1c9['origtransfererexten'];_0x64954[_0x29e7('0x9f')]=_0x2aa1c9[_0x29e7('0xd7')];_0x64954[_0x29e7('0x4f')]='ATTENDEDTRANSFER';_0x64954[_0x29e7('0x8f')]=!![];_0x64954[_0x29e7('0x9c')]=_0x29e7('0xd4');if(this[_0x29e7('0x10')][_0x2aa1c9[_0x29e7('0xd7')]]){_0x51263d=this[_0x29e7('0x10')][_0x2aa1c9[_0x29e7('0xd7')]];this[_0x29e7('0x10')][_0x2aa1c9[_0x29e7('0xd7')]]=this[_0x29e7('0x10')][_0x2aa1c9[_0x29e7('0xd6')]];this['queueReports'][_0x2aa1c9[_0x29e7('0xd6')]]=_0x51263d;_0xb2f649=_[_0x29e7('0x7c')](this['queueReports'][_0x2aa1c9[_0x29e7('0xd6')]]);_0xb2f649[_0x29e7('0x38')]=!![];}logger['info']('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x2aa1c9[_0x29e7('0x49')],_0x64954[_0x29e7('0x50')],_0x64954[_0x29e7('0x64')],_0x64954['transferexten'],_0x64954[_0x29e7('0x9f')]);}else if(this[_0x29e7('0x10')][_0x2aa1c9['origtransfereruniqueid']]){_0x64954=_[_0x29e7('0x7c')](this[_0x29e7('0x10')][_0x2aa1c9[_0x29e7('0xd7')]]);_0x64954[_0x29e7('0xd1')]=_0x2aa1c9[_0x29e7('0xd8')];_0x64954['transferuniqueid']=_0x2aa1c9['origtransfereruniqueid'];_0x64954[_0x29e7('0x4f')]=_0x29e7('0xc9');_0x64954[_0x29e7('0x8f')]=!![];_0x64954[_0x29e7('0x9c')]='ATTENDED';_0x64954[_0x29e7('0x38')]=!![];_0x64954[_0x29e7('0xcd')]=_0x2aa1c9[_0x29e7('0xd0')];}else if(this[_0x29e7('0x10')][_0x2aa1c9[_0x29e7('0xd3')]]){_0x64954=_[_0x29e7('0x7c')](this[_0x29e7('0x10')][_0x2aa1c9[_0x29e7('0xd3')]]);_0x64954['transferexten']=_0x2aa1c9['secondtransfererexten'];_0x64954[_0x29e7('0x9f')]=_0x2aa1c9[_0x29e7('0xd3')];_0x64954[_0x29e7('0x4f')]=_0x29e7('0xc9');_0x64954[_0x29e7('0x8f')]=!![];_0x64954[_0x29e7('0x9c')]=_0x29e7('0xd4');_0x64954[_0x29e7('0x38')]=!![];_0x64954['transferid']=_0x2aa1c9[_0x29e7('0xd6')];}}}catch(_0x57ed62){logger[_0x29e7('0x3f')](_0x29e7('0xd9'),_0x2aa1c9['uniqueid'],util[_0x29e7('0x40')](_0x57ed62,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0x30')]=function(_0x2ddf55){try{if(this[_0x29e7('0x6b')](_0x2ddf55)){logger['debug'](_0x29e7('0xda'),_0x2ddf55['uniqueid'],util[_0x29e7('0x40')](_0x2ddf55,{'showHidden':![],'depth':null}));if(this[_0x29e7('0x10')][_0x2ddf55[_0x29e7('0xd0')]]){var _0x44f053=_[_0x29e7('0x7c')](this[_0x29e7('0x10')][_0x2ddf55['transfereeuniqueid']]);_0x44f053[_0x29e7('0x4f')]=_0x29e7('0xdb');_0x44f053[_0x29e7('0x8f')]=!![];_0x44f053[_0x29e7('0x9c')]=_0x29e7('0xdc');_0x44f053[_0x29e7('0xd1')]=_0x2ddf55[_0x29e7('0xdd')];_0x44f053['transferuniqueid']=_0x2ddf55[_0x29e7('0xd0')];logger[_0x29e7('0x6d')](_0x29e7('0xde'),_0x2ddf55['uniqueid'],_0x44f053[_0x29e7('0x50')],_0x44f053[_0x29e7('0x64')],_0x44f053[_0x29e7('0xd1')],_0x44f053['transferuniqueid']);this[_0x29e7('0x29')]({'event':_0x29e7('0xdf'),'uniqueid':_0x2ddf55[_0x29e7('0xd0')],'context':_0x2ddf55[_0x29e7('0xe0')],'channel':_0x2ddf55[_0x29e7('0xe1')]});}}}catch(_0x2c7343){logger['error']('[%s][voiceQueueReport][blindtransfer]',_0x2ddf55[_0x29e7('0x49')],util[_0x29e7('0x40')](_0x2c7343,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0xe2')]=function(_0x485877){try{if(this[_0x29e7('0x6b')](_0x485877)){logger[_0x29e7('0x47')](_0x29e7('0xe3'),_0x485877[_0x29e7('0x49')],util[_0x29e7('0x40')](_0x485877,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x485877[_0x29e7('0x49')]]){var _0x50393e=_['last'](this[_0x29e7('0x10')][_0x485877[_0x29e7('0x49')]]);if(!_[_0x29e7('0x39')](_0x50393e[_0x29e7('0x84')])){_0x50393e[_0x29e7('0xe4')]=moment()[_0x29e7('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');logger['info'](_0x29e7('0xe5'),_0x485877[_0x29e7('0x49')],_0x50393e[_0x29e7('0xe4')]);}}}}catch(_0x3915bf){logger['error']('[%s][voiceQueueReport][musiconholdstart]',_0x485877['uniqueid'],util[_0x29e7('0x40')](_0x3915bf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x29e7('0xb')]['syncMusicOnHoldStop']=function(_0x33ca4a){try{if(this[_0x29e7('0x6b')](_0x33ca4a)){logger[_0x29e7('0x47')](_0x29e7('0xe6'),_0x33ca4a[_0x29e7('0x49')],util[_0x29e7('0x40')](_0x33ca4a,{'showHidden':![],'depth':null}));if(this[_0x29e7('0x10')][_0x33ca4a['uniqueid']]){var _0x11f9f0=_[_0x29e7('0x7c')](this[_0x29e7('0x10')][_0x33ca4a[_0x29e7('0x49')]]);if(!_['isNil'](_0x11f9f0[_0x29e7('0xe4')])){_0x11f9f0['mohtime']+=moment()['milliseconds'](0x0)['diff'](_0x11f9f0[_0x29e7('0xe4')],_0x29e7('0x9a'));logger[_0x29e7('0x6d')](_0x29e7('0xe7'),_0x33ca4a[_0x29e7('0x49')],_0x11f9f0['mohtime']);delete _0x11f9f0[_0x29e7('0xe4')];}}}}catch(_0x509291){logger['error'](_0x29e7('0xe6'),_0x33ca4a['uniqueid'],util[_0x29e7('0x40')](_0x509291,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x29e7('0xb')][_0x29e7('0xe8')]=function(_0x59f9d0){try{if(this[_0x29e7('0x6b')](_0x59f9d0)){logger['debug'](_0x29e7('0xe9'),_0x59f9d0[_0x29e7('0x49')],util[_0x29e7('0x40')](_0x59f9d0,{'showHidden':![],'depth':null}));if(_0x59f9d0[_0x29e7('0xea')]['toLowerCase']()===_0x29e7('0xeb')){_0x59f9d0[_0x29e7('0xec')]=_0x59f9d0['appdata']&&_0x59f9d0[_0x29e7('0xed')]['startsWith'](_0x29e7('0xee'))?_0x59f9d0[_0x29e7('0xed')]:(_0x59f9d0[_0x29e7('0xed')]||_0x59f9d0[_0x29e7('0xec')])[_0x29e7('0x95')]();if(_[_0x29e7('0x93')](_0x59f9d0[_0x29e7('0xec')][_0x29e7('0x95')](),_0x29e7('0xef'))){logger['info'](_0x29e7('0xf0'),_0x59f9d0['uniqueid'],_0x59f9d0[_0x29e7('0xea')],_0x59f9d0['applicationdata']);if(_['isUndefined'](this[_0x29e7('0x13')][_0x59f9d0[_0x29e7('0x49')]]))this[_0x29e7('0x13')][_0x59f9d0[_0x29e7('0x49')]]={};var _0x3fd128=_0x59f9d0['applicationdata'][_0x29e7('0xf1')]('=');var _0x2eb477=_0x3fd128[0x0]['toLowerCase']()[_0x29e7('0xf2')](/cdr\((.*)\)/);if(_0x2eb477)this[_0x29e7('0x13')][_0x59f9d0['uniqueid']][_0x2eb477[0x1]]=_0x3fd128[0x1];}}}}catch(_0x3bfa0d){logger[_0x29e7('0x3f')](_0x29e7('0xf3'),_0x59f9d0[_0x29e7('0x49')],util[_0x29e7('0x40')](_0x3bfa0d,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
+var _0x8b4e=['queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','emitVoiceQueueChannelRemove','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','membername','queuecallerexit','reason','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','channel','toLowerCase','linkedid','add','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','toUpperCase','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','queuecallerexitAt','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','memberdynamic','memberinterface','memberlastcall','memberpenalty','includes','length','diff','COMPLETEDBYAGENT','sumDuration','total','answered','sumBillable','queuecallercompleteAt','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','cause-txt','cause','handleHangup','transferid','[%s][voiceQueueReport][attendedtransfer]','secondtransfererexten','ATTENDED','secondtransfereruniqueid','transfereeuniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','extension','BlindTransfer','context','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','milliseconds','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','startsWith','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','socket.io-emitter','prototype','enqueue','tail','queueReports','agents','channels','campaigns','summary','variables','queuesummary','bind','syncQueueSummaryComplete','queuemember','syncQueueMember','syncQueueStatusComplete','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','originated','hasOwnProperty','pTalking','queueStatusComplete','unlockRR','queuecallerabandon','queuecallercomplete','clearZombieChannels','switch','isNil','Action','status','message','No\x20such\x20channel','error','inspect','[FullyBooted]\x20clear\x20realtime','voiceQueues','clearQueueReport','emit','emitVoiceQueueChannelSave',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','type','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isNotNull','isUndefined','queues','catch','[voiceQueueReport][queues]','then','isRunning','queuestatus','actionid','createQueueSummaryReport','summaryEvent','createReport','realtime','handleInboundQueueSummaryReport','assign','emitInboundVoiceQueueSummary','statusRequests','completeEvent','push','syncQueueSummary','queue','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','info','pick','keys','[%s][voiceQueueReport][queuecallerabandon]','last','holdtime','originalposition'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8b4e,0x158));var _0xe8b4=function(_0x331821,_0x2eff7c){_0x331821=_0x331821-0x0;var _0x26d374=_0x8b4e[_0x331821];return _0x26d374;};'use strict';var _=require(_0xe8b4('0x0'));var moment=require(_0xe8b4('0x1'));var util=require('util');var Redis=require(_0xe8b4('0x2'));var config=require(_0xe8b4('0x3'));var logger=require(_0xe8b4('0x4'))(_0xe8b4('0x5'));var ami=require('../ami');var QueueReport=require(_0xe8b4('0x6'));var VoiceQueueSummary=require(_0xe8b4('0x7'));config[_0xe8b4('0x8')]=_[_0xe8b4('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xe8b4('0xa'))(new Redis(config[_0xe8b4('0x8')]));var Sequence=function(){};Sequence[_0xe8b4('0xb')][_0xe8b4('0xc')]=function(_0x5f1e3a){this[_0xe8b4('0xd')]=this[_0xe8b4('0xd')]?this[_0xe8b4('0xd')]['finally'](_0x5f1e3a):_0x5f1e3a();};function VoiceQueueReport(_0x5d8dd7){this['sequence']=new Sequence();this[_0xe8b4('0xe')]={};this['realtime']=_0x5d8dd7;this[_0xe8b4('0xf')]=_0x5d8dd7['agents'];this[_0xe8b4('0x10')]=_0x5d8dd7['queueChannels'];this['voiceQueues']=_0x5d8dd7['voiceQueues'];this['campaigns']=_0x5d8dd7[_0xe8b4('0x11')];this[_0xe8b4('0x12')]=initializeSummary();this[_0xe8b4('0x13')]={};ami['on'](_0xe8b4('0x14'),this['syncQueueSummary'][_0xe8b4('0x15')](this));ami['on']('queuesummarycomplete',this[_0xe8b4('0x16')][_0xe8b4('0x15')](this));ami['on'](_0xe8b4('0x17'),this[_0xe8b4('0x18')][_0xe8b4('0x15')](this));ami['on']('queuestatuscomplete',this[_0xe8b4('0x19')][_0xe8b4('0x15')](this));ami['on']('queuecallerjoin',this['syncQueueCallerJoin'][_0xe8b4('0x15')](this));ami['on']('queuecallerabandon',this[_0xe8b4('0x1a')]['bind'](this));ami['on'](_0xe8b4('0x1b'),this[_0xe8b4('0x1c')][_0xe8b4('0x15')](this));ami['on'](_0xe8b4('0x1d'),this[_0xe8b4('0x1e')]['bind'](this));ami['on'](_0xe8b4('0x1f'),this[_0xe8b4('0x20')][_0xe8b4('0x15')](this));ami['on'](_0xe8b4('0x21'),this[_0xe8b4('0x22')][_0xe8b4('0x15')](this));ami['on'](_0xe8b4('0x23'),this[_0xe8b4('0x24')][_0xe8b4('0x15')](this));ami['on'](_0xe8b4('0x25'),this['syncFullyBooted'][_0xe8b4('0x15')](this));ami['on'](_0xe8b4('0x26'),this[_0xe8b4('0x27')][_0xe8b4('0x15')](this));ami['on'](_0xe8b4('0x28'),this[_0xe8b4('0x29')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xe8b4('0x15')](this));ami['on'](_0xe8b4('0x2a'),this[_0xe8b4('0x2b')][_0xe8b4('0x15')](this));this[_0xe8b4('0x2c')]();this[_0xe8b4('0x2d')]();}function clearChannels(_0x2e78cd){if(!_[_0xe8b4('0x2e')](_0x2e78cd)){for(var _0x5de5b4 in _0x2e78cd){if(_0x2e78cd['hasOwnProperty'](_0x5de5b4)){delete _0x2e78cd[_0x5de5b4];}}}}function clearCampaigns(_0x16159d){if(!_['isEmpty'](_0x16159d)){for(var _0x1fe0dc in _0x16159d){if(_0x16159d['hasOwnProperty'](_0x1fe0dc)){_0x16159d[_0x1fe0dc][_0xe8b4('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x6edb4c){if(!_[_0xe8b4('0x2e')](_0x6edb4c)){for(var _0x47e308 in _0x6edb4c){if(_0x6edb4c[_0xe8b4('0x30')](_0x47e308)){_0x6edb4c[_0x47e308][_0xe8b4('0x2f')]=0x0;_0x6edb4c[_0x47e308]['talking']=0x0;_0x6edb4c[_0x47e308][_0xe8b4('0x31')]=0x0;_0x6edb4c[_0x47e308]['waiting']=0x0;_0x6edb4c[_0x47e308][_0xe8b4('0x32')]=!![];}}}}function clearAgentBooked(_0x36cdf8){if(!_[_0xe8b4('0x2e')](_0x36cdf8)){for(var _0x3345c2 in _0x36cdf8){if(_0x36cdf8[_0xe8b4('0x30')](_0x3345c2)){_0x36cdf8[_0x3345c2][_0xe8b4('0x33')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x40edb8){return _0x40edb8['queuecallerexit']||_0x40edb8[_0xe8b4('0x34')]||_0x40edb8[_0xe8b4('0x35')];}VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x36')]=function(){var _0xcee291=this;for(var _0x21b410 in this['channels']){if(this['channels'][_0xe8b4('0x30')](_0x21b410)&&!this[_0xe8b4('0x10')][_0x21b410][_0xe8b4('0x37')]){this['sequence']['enqueue'](function(){if(!_[_0xe8b4('0x38')](_0xcee291[_0xe8b4('0x10')][_0x21b410])){return ami[_0xe8b4('0x39')]({'action':_0xe8b4('0x3a'),'channel':_0xcee291[_0xe8b4('0x10')][_0x21b410]['channel']})['catch'](function(_0x110d72){if(_0x110d72[_0xe8b4('0x3b')]===_0xe8b4('0x3c')){setTimeout(function(){if(_0xcee291['channels'][_0x21b410]){delete _0xcee291[_0xe8b4('0x10')][_0x21b410];logger['error']('[%s][voiceQueueReport][checkChannel]',_0x21b410,util['inspect'](_0x110d72,{'showHidden':![],'depth':null}));}if(_0xcee291['queueReports'][_0x21b410]){delete _0xcee291[_0xe8b4('0xe')][_0x21b410];logger['error']('[%s][voiceQueueReport][checkQueueReport]',_0x21b410,util['inspect'](_0x110d72,{'showHidden':![],'depth':null}));}if(_0xcee291[_0xe8b4('0x13')][_0x21b410]){delete _0xcee291[_0xe8b4('0x13')][_0x21b410];logger[_0xe8b4('0x3d')]('[%s][voiceQueueReport][checkVariables]',_0x21b410,util[_0xe8b4('0x3e')](_0x110d72,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xe8b4('0xb')]['syncFullyBooted']=function(){logger[_0xe8b4('0x3d')](_0xe8b4('0x3f'));clearChannels(this[_0xe8b4('0x10')]);this['clearQueueReport'](this[_0xe8b4('0xe')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0xe8b4('0x40')]);clearCampaigns(this[_0xe8b4('0x11')]);this[_0xe8b4('0x12')]=initializeSummary();};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x41')]=function(_0x489a8e){var _0x13c339=this;if(!_[_0xe8b4('0x2e')](_0x489a8e)){for(var _0x4dd698 in _0x489a8e){if(_0x489a8e[_0xe8b4('0x30')](_0x4dd698)){_0x13c339['emitVoiceQueueChannelRemove'](_0x489a8e[_0x4dd698],'clearqueuereport');delete _0x489a8e[_0x4dd698];}}}};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x42')]=function(_0x4ccb8e,_0x390854,_0xe70749){io['to'](_0x4ccb8e)[_0xe8b4('0x42')](_0x390854,_0xe70749);};VoiceQueueReport['prototype'][_0xe8b4('0x43')]=function(_0x41ff38,_0x31079e){logger['debug']('[%s][voiceQueueReport]['+_0x31079e+_0xe8b4('0x44'),_0x41ff38[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x41ff38,{'showHidden':![],'depth':null}));this[_0xe8b4('0x42')](util[_0xe8b4('0x46')](_0xe8b4('0x47'),_0x41ff38['queue']),_0xe8b4('0x48'),_0x41ff38);io[_0xe8b4('0x42')](_0xe8b4('0x49'),_0x41ff38);};VoiceQueueReport['prototype']['emitVoiceQueueChannelRemove']=function(_0x27c42d,_0x4eda69){logger[_0xe8b4('0x4a')](_0xe8b4('0x4b')+_0x4eda69+_0xe8b4('0x4c'),_0x27c42d[_0xe8b4('0x45')],util['inspect'](_0x27c42d,{'showHidden':![],'depth':null}));if(_0x27c42d[_0xe8b4('0x4d')]===_0xe8b4('0x4e')){return;}this[_0xe8b4('0x42')](util[_0xe8b4('0x46')](_0xe8b4('0x47'),_0x27c42d['queue']),_0xe8b4('0x4f'),_0x27c42d);io[_0xe8b4('0x42')](_0xe8b4('0x50'),_0x27c42d);};VoiceQueueReport[_0xe8b4('0xb')]['emitInboundVoiceQueueSummary']=function(_0xea5fa0){if(_0xea5fa0[_0xe8b4('0x51')]===_0xe8b4('0x52')){logger[_0xe8b4('0x4a')](_0xe8b4('0x53'),util[_0xe8b4('0x3e')](_0xea5fa0,{'showHidden':![],'depth':null}));this[_0xe8b4('0x42')](util['format']('voice:queue:%s',_0xea5fa0[_0xe8b4('0x54')]),_0xe8b4('0x55'),_0xea5fa0);}};VoiceQueueReport['prototype'][_0xe8b4('0x56')]=function(_0xd37925){return _0xd37925!==null&&!_[_0xe8b4('0x57')](_0xd37925);};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x2d')]=function(){var _0x4bb00d=this;setInterval(function(){_0x4bb00d['clearZombieChannels']();ami['Action']({'action':_0xe8b4('0x58')})[_0xe8b4('0x59')](function(_0x23d9e8){logger[_0xe8b4('0x3d')](_0xe8b4('0x5a'),util[_0xe8b4('0x3e')](_0x23d9e8,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x2c')]=function(){var _0x190c9a=this;setInterval(function(){if(!_0x190c9a['summary']['isRunning']){return ami['Action']({'action':'queuesummary'})[_0xe8b4('0x5b')](function(_0x30ed68){_0x190c9a[_0xe8b4('0x12')]['id']=_0x30ed68['actionid'];_0x190c9a[_0xe8b4('0x12')][_0xe8b4('0x5c')]=!![];_0x190c9a['summary'][_0xe8b4('0x5d')][_0x30ed68[_0xe8b4('0x5e')]]={};})[_0xe8b4('0x59')](function(_0x58cc65){logger[_0xe8b4('0x3d')]('[voiceQueueReport][queuesummary]',util[_0xe8b4('0x3e')](_0x58cc65,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x5f')]=function(_0x14d2e7,_0x4b1cf2){var _0x2f0db0=this[_0xe8b4('0x12')][_0xe8b4('0x58')][_0x14d2e7[_0xe8b4('0x54')]][_0xe8b4('0x60')];var _0x4c37b5=new VoiceQueueSummary(_0x14d2e7);return _0x4c37b5[_0xe8b4('0x61')](_0x4b1cf2['agents'],this['agents'],_0x2f0db0,this[_0xe8b4('0x62')][_0xe8b4('0x10')]);};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x63')]=function(_0x2f7e5d,_0x353b78){var _0x46d3fe=this[_0xe8b4('0x5f')](_0x2f7e5d,_0x353b78);var _0x4f197f=![];_0x4f197f=_0x46d3fe['compareToInboundQueue'](_0x2f7e5d);if(_0x4f197f){Object[_0xe8b4('0x64')](_0x2f7e5d,_0x46d3fe);this[_0xe8b4('0x62')][_0xe8b4('0x40')][_0x2f7e5d[_0xe8b4('0x54')]]=_0x2f7e5d;this[_0xe8b4('0x65')](_0x46d3fe);}};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x19')]=function(_0x394dd3){var _0x593096=null;var _0x4b6ac0=this[_0xe8b4('0x12')]['id'];if(this[_0xe8b4('0x12')][_0xe8b4('0x5d')][_0x4b6ac0]){_0x593096=this[_0xe8b4('0x12')][_0xe8b4('0x5d')][_0x4b6ac0][_0x394dd3['actionid']];}if(!_0x593096){this['summary']=initializeSummary();return;}var _0x4f9fa7=this[_0xe8b4('0x40')][_0x593096['queue']];if(_0x4f9fa7[_0xe8b4('0x51')]==='inbound'){this[_0xe8b4('0x63')](_0x4f9fa7,_0x593096);}else if(_0x4f9fa7[_0xe8b4('0x51')]==='outbound'){var _0x5b43cb=this[_0xe8b4('0x5f')](_0x4f9fa7,_0x593096);ami['emit']('custom:queuesummary',_0x5b43cb);}this[_0xe8b4('0x12')][_0xe8b4('0x66')]-=0x1;var _0x1b5ee=this[_0xe8b4('0x12')][_0xe8b4('0x66')]>0x0?!![]:![];if(!_0x1b5ee){return this[_0xe8b4('0x16')](this[_0xe8b4('0x12')][_0xe8b4('0x67')]);}};VoiceQueueReport['prototype'][_0xe8b4('0x18')]=function(_0x191e47){var _0x3c6d7b=this['summary']['id'];if(this[_0xe8b4('0x12')]['queuestatus'][_0x3c6d7b]&&this[_0xe8b4('0x12')][_0xe8b4('0x5d')][_0x3c6d7b][_0x191e47['actionid']]){this[_0xe8b4('0x12')][_0xe8b4('0x5d')][_0x3c6d7b][_0x191e47['actionid']][_0xe8b4('0xf')][_0xe8b4('0x68')](_0x191e47);}};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x69')]=function(_0x4c9db7){var _0x15ac73=this;try{if(this['isNotNull'](_0x4c9db7)&&this[_0xe8b4('0x56')](_0x4c9db7[_0xe8b4('0x6a')])){logger['debug']('[voiceQueueReport][queuesummary]\x20event:',util[_0xe8b4('0x3e')](_0x4c9db7,{'showHidden':![],'depth':null}));var _0x5ed28a=this[_0xe8b4('0x40')][_0x4c9db7[_0xe8b4('0x6a')]];if(_0x5ed28a){logger[_0xe8b4('0x4a')]('[voiceQueueReport][queuesummary]\x20name:%s',_0x5ed28a[_0xe8b4('0x54')]);this['summary'][_0xe8b4('0x58')][_0x5ed28a['name']]={'summaryEvent':_0x4c9db7};this['summary'][_0xe8b4('0x66')]+=0x1;return ami[_0xe8b4('0x39')]({'action':_0xe8b4('0x5d'),'queue':_0x5ed28a[_0xe8b4('0x54')]})[_0xe8b4('0x5b')](function(_0x25600d){if(!_0x15ac73[_0xe8b4('0x12')]['queuestatus'][_0x4c9db7['actionid']]){_0x15ac73[_0xe8b4('0x12')][_0xe8b4('0x5d')][_0x4c9db7[_0xe8b4('0x5e')]]={};}_0x15ac73[_0xe8b4('0x12')][_0xe8b4('0x5d')][_0x4c9db7['actionid']][_0x25600d['actionid']]={'queue':_0x5ed28a[_0xe8b4('0x54')],'agents':[]};})[_0xe8b4('0x59')](function(_0x3c6e25){throw _0x3c6e25;});}}}catch(_0x39906f){logger['error'](_0xe8b4('0x6b'),util['inspect'](_0x39906f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x16')]=function(_0x76f9c5){if(this[_0xe8b4('0x12')][_0xe8b4('0x66')]>0x0){this['summary'][_0xe8b4('0x67')]=_0x76f9c5;return;}logger[_0xe8b4('0x4a')](_0xe8b4('0x6c'),util[_0xe8b4('0x3e')](_0x76f9c5,{'showHidden':![],'depth':null}));this[_0xe8b4('0x12')]=initializeSummary();ami[_0xe8b4('0x42')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x6d')]=function(_0xe64766){try{if(this['isNotNull'](_0xe64766)){logger[_0xe8b4('0x4a')](_0xe8b4('0x6e'),_0xe64766[_0xe8b4('0x45')],util['inspect'](_0xe64766,{'showHidden':![],'depth':null}));if(_[_0xe8b4('0x57')](this[_0xe8b4('0xe')][_0xe64766[_0xe8b4('0x45')]])){this[_0xe8b4('0xe')][_0xe64766[_0xe8b4('0x45')]]=[];}if(_[_0xe8b4('0x57')](this['channels'][_0xe64766[_0xe8b4('0x45')]])){this[_0xe8b4('0x10')][_0xe64766[_0xe8b4('0x45')]]={};}var _0x17c693=new QueueReport();_0x17c693['queue']=_0xe64766['queue'];_0x17c693[_0xe8b4('0x51')]=this[_0xe8b4('0x40')][_0x17c693[_0xe8b4('0x6a')]]&&this[_0xe8b4('0x40')][_0x17c693[_0xe8b4('0x6a')]][_0xe8b4('0x51')]?this[_0xe8b4('0x40')][_0x17c693[_0xe8b4('0x6a')]]['type']||'inbound':_0xe8b4('0x52');_0x17c693[_0xe8b4('0x6f')]=moment()[_0xe8b4('0x46')](_0xe8b4('0x70'));_0x17c693['position']=_0xe64766[_0xe8b4('0x71')];_0x17c693[_0xe8b4('0x72')]=_0xe64766[_0xe8b4('0x72')];_0x17c693['uniqueid']=_0xe64766[_0xe8b4('0x45')];_0x17c693['routealias']=this[_0xe8b4('0x10')][_0xe64766[_0xe8b4('0x45')]]['routealias'];logger[_0xe8b4('0x73')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x17c693['queue'],_0x17c693[_0xe8b4('0x51')]);Object[_0xe8b4('0x64')](_0x17c693,_[_0xe8b4('0x74')](_0xe64766,_[_0xe8b4('0x75')](_0x17c693)));this[_0xe8b4('0xe')][_0xe64766[_0xe8b4('0x45')]][_0xe8b4('0x68')](_0x17c693);this['channels'][_0xe64766[_0xe8b4('0x45')]]=_0x17c693;this[_0xe8b4('0x43')](_0x17c693,'queuecallerjoin');}}catch(_0x587dfd){logger[_0xe8b4('0x3d')](_0xe8b4('0x6e'),_0xe64766[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x587dfd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x1a')]=function(_0x42a46c){try{if(this[_0xe8b4('0x56')](_0x42a46c)){logger[_0xe8b4('0x4a')](_0xe8b4('0x76'),_0x42a46c['uniqueid'],util['inspect'](_0x42a46c,{'showHidden':![],'depth':null}));if(this[_0xe8b4('0xe')][_0x42a46c[_0xe8b4('0x45')]]){var _0xfe9b80=_[_0xe8b4('0x77')](this[_0xe8b4('0xe')][_0x42a46c['uniqueid']]);_0xfe9b80['queuecallercomplete']=![];_0xfe9b80['queuecallercompleteAt']=null;_0xfe9b80['holdtime']=_0x42a46c[_0xe8b4('0x78')];_0xfe9b80['originalposition']=_0x42a46c[_0xe8b4('0x79')];_0xfe9b80[_0xe8b4('0x34')]=!![];_0xfe9b80[_0xe8b4('0x7a')]=moment()[_0xe8b4('0x46')](_0xe8b4('0x70'));_0xfe9b80[_0xe8b4('0x4d')]=_0xe8b4('0x7b');_0xfe9b80[_0xe8b4('0x7c')]=null;logger['info'](_0xe8b4('0x7d'),_0xfe9b80['queue'],_0xfe9b80[_0xe8b4('0x51')]);this[_0xe8b4('0x10')][_0x42a46c[_0xe8b4('0x45')]]=_0xfe9b80;this[_0xe8b4('0x7e')](_0xfe9b80,_0xe8b4('0x34'));}}}catch(_0x48ef5d){logger[_0xe8b4('0x3d')](_0xe8b4('0x76'),_0x42a46c[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x48ef5d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe8b4('0x1c')]=function(_0x3b8f44){try{if(this[_0xe8b4('0x56')](_0x3b8f44)){logger['debug'](_0xe8b4('0x7f'),_0x3b8f44[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x3b8f44,{'showHidden':![],'depth':null}));if(this[_0xe8b4('0xe')][_0x3b8f44[_0xe8b4('0x45')]]){var _0x198b60=_[_0xe8b4('0x77')](this[_0xe8b4('0xe')][_0x3b8f44[_0xe8b4('0x45')]]);_0x198b60['queuecallerleaveAt']=moment()[_0xe8b4('0x46')](_0xe8b4('0x70'));_0x198b60[_0xe8b4('0x80')]=_0x3b8f44[_0xe8b4('0x80')];_0x198b60[_0xe8b4('0x81')]=_0x3b8f44['connectedlinename'];logger[_0xe8b4('0x73')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x198b60[_0xe8b4('0x6a')],_0x198b60[_0xe8b4('0x51')],_0x3b8f44[_0xe8b4('0x80')],_0x3b8f44[_0xe8b4('0x81')]);this['channels'][_0x3b8f44[_0xe8b4('0x45')]]=_0x198b60;this[_0xe8b4('0x43')](_0x198b60,_0xe8b4('0x1b'));}}}catch(_0x3f78d0){logger[_0xe8b4('0x3d')](_0xe8b4('0x7f'),_0x3b8f44[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x3f78d0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe8b4('0xb')]['syncAgentConnect']=function(_0x408bab){try{if(this[_0xe8b4('0x56')](_0x408bab)){logger[_0xe8b4('0x4a')]('[%s][voiceQueueReport][agentconnect]',_0x408bab['uniqueid'],util[_0xe8b4('0x3e')](_0x408bab,{'showHidden':![],'depth':null}));if(this[_0xe8b4('0xe')][_0x408bab[_0xe8b4('0x45')]]){var _0x1c369f=_[_0xe8b4('0x77')](this[_0xe8b4('0xe')][_0x408bab[_0xe8b4('0x45')]]);_0x1c369f[_0xe8b4('0x35')]=!![];_0x1c369f[_0xe8b4('0x4d')]='COMPLETEDBYAGENT';logger['info'](_0xe8b4('0x82'),_0x1c369f['queue'],_0x1c369f[_0xe8b4('0x51')]);}}}catch(_0x2f7558){logger[_0xe8b4('0x3d')](_0xe8b4('0x83'),_0x408bab['uniqueid'],util[_0xe8b4('0x3e')](_0x2f7558,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xe8b4('0x1e')]=function(_0xd2bc2e){try{if(this['isNotNull'](_0xd2bc2e)){logger[_0xe8b4('0x4a')](_0xe8b4('0x84'),_0xd2bc2e[_0xe8b4('0x45')],util['inspect'](_0xd2bc2e,{'showHidden':![],'depth':null}));if(this[_0xe8b4('0xe')][_0xd2bc2e[_0xe8b4('0x45')]]){var _0x1d4e27=_[_0xe8b4('0x77')](this['queueReports'][_0xd2bc2e[_0xe8b4('0x45')]]);_0x1d4e27['queuecallerabandon']=![];_0x1d4e27[_0xe8b4('0x7a')]=null;_0x1d4e27['assigned']=!![];_0x1d4e27[_0xe8b4('0x7c')]=_0xd2bc2e[_0xe8b4('0x85')];_0x1d4e27[_0xe8b4('0x78')]=_0xd2bc2e[_0xe8b4('0x78')];_0x1d4e27['queuecallercomplete']=!![];_0x1d4e27[_0xe8b4('0x86')]=![];_0x1d4e27['queuecallerexitAt']=null;if(!_0x1d4e27['transfer']){if(_0xd2bc2e[_0xe8b4('0x87')]==_0xe8b4('0x88')){_0x1d4e27[_0xe8b4('0x4d')]=_0xe8b4('0x89');logger[_0xe8b4('0x73')](_0xe8b4('0x8a'),_0x1d4e27['queue'],_0x1d4e27[_0xe8b4('0x51')]);}else{if(_['startsWith'](_0xd2bc2e[_0xe8b4('0x8b')][_0xe8b4('0x8c')](),'local/')){if(this[_0xe8b4('0xe')][_0xd2bc2e['linkedid']]){var _0x4fd441=_[_0xe8b4('0x77')](this[_0xe8b4('0xe')][_0xd2bc2e[_0xe8b4('0x8d')]]);_0x4fd441[_0xe8b4('0x35')]=![];_0x4fd441[_0xe8b4('0x86')]=!![];_0x4fd441['queuecallerexitAt']=moment(_0x1d4e27[_0xe8b4('0x6f')])[_0xe8b4('0x8e')](_0xd2bc2e[_0xe8b4('0x78')],_0xe8b4('0x8f'))[_0xe8b4('0x46')](_0xe8b4('0x70'));_0x4fd441[_0xe8b4('0x4d')]=_0xe8b4('0x90');_0x4fd441[_0xe8b4('0x88')]=!![];_0x4fd441[_0xe8b4('0x91')]='FORWARD';_0x4fd441[_0xe8b4('0x92')]=_0xd2bc2e[_0xe8b4('0x93')];_0x4fd441[_0xe8b4('0x94')]=_0xd2bc2e['uniqueid'];logger[_0xe8b4('0x73')](_0xe8b4('0x95'),_0x4fd441['queue'],_0x4fd441[_0xe8b4('0x51')]);var _0x34b94e=this[_0xe8b4('0xe')][_0xd2bc2e[_0xe8b4('0x8d')]];this[_0xe8b4('0xe')][_0xd2bc2e[_0xe8b4('0x8d')]]=this['queueReports'][_0xd2bc2e[_0xe8b4('0x45')]];this[_0xe8b4('0xe')][_0xd2bc2e['uniqueid']]=_0x34b94e;}}else{_0x1d4e27[_0xe8b4('0x4d')]='COMPLETEDBY'+_0xd2bc2e[_0xe8b4('0x87')][_0xe8b4('0x96')]();logger[_0xe8b4('0x73')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x1d4e27[_0xe8b4('0x6a')],_0x1d4e27[_0xe8b4('0x51')],_0x1d4e27[_0xe8b4('0x4d')]);}}}this[_0xe8b4('0x10')][_0xd2bc2e[_0xe8b4('0x45')]]=_0x1d4e27;}}}catch(_0x4e3862){logger[_0xe8b4('0x3d')]('[%s][voiceQueueReport][agentcomplete]',_0xd2bc2e[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x4e3862,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x22')]=function(_0x30b4d7){try{if(this[_0xe8b4('0x56')](_0x30b4d7)){logger['debug'](_0xe8b4('0x97'),_0x30b4d7[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x30b4d7,{'showHidden':![],'depth':null}));this[_0xe8b4('0x98')](_0x30b4d7['uniqueid'],_[_0xe8b4('0x75')](_0x30b4d7[_0xe8b4('0x99')])[0x0],_0x30b4d7[_0xe8b4('0x9a')]);if(this[_0xe8b4('0xe')][_0x30b4d7[_0xe8b4('0x45')]]){var _0xb5737a=_[_0xe8b4('0x77')](this['queueReports'][_0x30b4d7[_0xe8b4('0x45')]]);if(_0xb5737a){if(this['isNotNull'](_0x30b4d7[_0xe8b4('0x99')])&&this[_0xe8b4('0x56')](_0x30b4d7[_0xe8b4('0x99')][_0xe8b4('0x5d')])){switch(_0x30b4d7['value']){case _0xe8b4('0x9b'):_0xb5737a[_0xe8b4('0x86')]=![];_0xb5737a[_0xe8b4('0x9c')]=null;break;case _0xe8b4('0x9d'):_0xb5737a[_0xe8b4('0x9e')]=_0xe8b4('0x9f');_0xb5737a[_0xe8b4('0x86')]=!![];_0xb5737a[_0xe8b4('0x9c')]=moment()[_0xe8b4('0x46')](_0xe8b4('0x70'));_0xb5737a[_0xe8b4('0xa0')]=moment()['format'](_0xe8b4('0x70'));logger[_0xe8b4('0x4a')](_0xe8b4('0xa1'),_0x30b4d7[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0xb5737a,{'showHidden':![],'depth':null}));ami[_0xe8b4('0x42')](_0xe8b4('0xa2'),_0xb5737a);break;default:_0xb5737a[_0xe8b4('0x86')]=!![];_0xb5737a[_0xe8b4('0x9c')]=moment()['format'](_0xe8b4('0x70'));_0xb5737a[_0xe8b4('0xa0')]=moment()[_0xe8b4('0x46')]('YYYY-MM-DD\x20HH:mm:ss');}_0xb5737a[_0xe8b4('0x34')]=![];_0xb5737a[_0xe8b4('0x7a')]=null;_0xb5737a[_0xe8b4('0x4d')]=_0x30b4d7[_0xe8b4('0x9a')];this[_0xe8b4('0x10')][_0x30b4d7[_0xe8b4('0x45')]]=_0xb5737a;this[_0xe8b4('0x7e')](_0xb5737a,_0xe8b4('0x21'));}else if(this['isNotNull'](_0x30b4d7[_0xe8b4('0x99')])&&this[_0xe8b4('0x56')](_0x30b4d7[_0xe8b4('0x99')][_0xe8b4('0xa3')])){if(!_0xb5737a[_0xe8b4('0x34')]){_0xb5737a[_0xe8b4('0x86')]=!![];_0xb5737a[_0xe8b4('0x9c')]=moment()[_0xe8b4('0x46')](_0xe8b4('0x70'));_0xb5737a[_0xe8b4('0x4d')]=_0xe8b4('0xa4');_0xb5737a[_0xe8b4('0xa0')]=moment()[_0xe8b4('0x46')](_0xe8b4('0x70'));this[_0xe8b4('0x10')][_0x30b4d7[_0xe8b4('0x45')]]=_0xb5737a;}}logger[_0xe8b4('0x73')](_0xe8b4('0xa5'),_0x30b4d7[_0xe8b4('0x45')],_0xb5737a[_0xe8b4('0x6a')],_0xb5737a[_0xe8b4('0x51')],_['keys'](_0x30b4d7[_0xe8b4('0x99')])[0x0],_0x30b4d7[_0xe8b4('0x9a')]);_0xb5737a[_0xe8b4('0x13')]=this[_0xe8b4('0x13')][_0x30b4d7['uniqueid']];}}}}catch(_0x2b7b99){logger[_0xe8b4('0x3d')](_0xe8b4('0x97'),_0x30b4d7[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x2b7b99,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x98')]=function(_0x51e59d,_0x114d12,_0x1f8c14){var _0x28844a=[_0xe8b4('0xa6'),_0xe8b4('0xa7'),_0xe8b4('0xa8'),_0xe8b4('0xa9'),'rtpaudioqosloss',_0xe8b4('0xaa'),_0xe8b4('0xab'),_0xe8b4('0xac'),_0xe8b4('0xad'),_0xe8b4('0xae'),_0xe8b4('0xaf'),'bridgepvtcallid','membercalls',_0xe8b4('0xb0'),_0xe8b4('0xb1'),_0xe8b4('0xb2'),'membername',_0xe8b4('0xb3'),'memberrealtime'];if(!_['isNil'](_0x114d12)&&!_[_0xe8b4('0xb4')](_0x28844a,_0x114d12)){if(_['isUndefined'](this[_0xe8b4('0x13')][_0x51e59d])){this[_0xe8b4('0x13')][_0x51e59d]={};}this[_0xe8b4('0x13')][_0x51e59d][_0x114d12]=_0x1f8c14;}};VoiceQueueReport[_0xe8b4('0xb')]['handleHangup']=function(_0x21a4f6,_0x11fa2e,_0x552a9b){var _0x1970a6={};for(var _0x27d4da=0x0;_0x27d4da<this['queueReports'][_0x21a4f6][_0xe8b4('0xb5')];_0x27d4da+=0x1){_0x1970a6=this[_0xe8b4('0xe')][_0x21a4f6][_0x27d4da];var _0x3bce1d=this[_0xe8b4('0x40')][_0x1970a6['queue']];if(_0x3bce1d){_0x3bce1d['sumHoldTime']+=moment(_0x1970a6[_0xe8b4('0xa0')])[_0xe8b4('0xb6')](_0x1970a6['queuecallerjoinAt'],_0xe8b4('0x8f'))||0x0;if(_0x552a9b&&_0x1970a6['queuecallerexitreason']===_0xe8b4('0x4e')){_0x1970a6['queuecallerexitreason']=_0xe8b4('0xb7');}if(_0x27d4da===this[_0xe8b4('0xe')][_0x21a4f6][_0xe8b4('0xb5')]-0x1){_0x3bce1d[_0xe8b4('0xb8')]+=moment()['milliseconds'](0x0)['diff'](_0x1970a6[_0xe8b4('0x6f')],_0xe8b4('0x8f'));if(hasCallerLeftTheQueue(_0x1970a6)&&_0x1970a6[_0xe8b4('0x4d')]!==_0xe8b4('0x4e')){_0x3bce1d[_0xe8b4('0xb9')]+=0x1;}if(_0x1970a6[_0xe8b4('0x35')]){_0x3bce1d[_0xe8b4('0xba')]+=0x1;_0x3bce1d[_0xe8b4('0xbb')]+=moment()['milliseconds'](0x0)[_0xe8b4('0xb6')](_0x1970a6['queuecallerleaveAt'],_0xe8b4('0x8f'));_0x1970a6[_0xe8b4('0xbc')]=moment()[_0xe8b4('0x46')](_0xe8b4('0x70'));_0x1970a6[_0xe8b4('0x86')]=![];_0x1970a6['queuecallerexitAt']=null;}if(_0x1970a6['queuecallerexit']&&_0x1970a6[_0xe8b4('0x88')]!=!![]){_0x3bce1d['unmanaged']+=0x1;_0x1970a6[_0xe8b4('0x9e')]=_0xe8b4('0xbd');logger[_0xe8b4('0x4a')](_0xe8b4('0xbe'),_0x21a4f6,util['inspect'](_0x1970a6,{'showHidden':![],'depth':null}));ami[_0xe8b4('0x42')](_0xe8b4('0xbf'),_0x1970a6);}if(_0x1970a6['queuecallerabandon']){_0x3bce1d[_0xe8b4('0xc0')]+=0x1;_0x1970a6['lastevent']=_0xe8b4('0xc0');logger[_0xe8b4('0x4a')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x21a4f6,util[_0xe8b4('0x3e')](_0x1970a6,{'showHidden':![],'depth':null}));ami['emit'](_0xe8b4('0xc1'),_0x1970a6);}}else{_0x3bce1d['sumDuration']+=_0x3bce1d['sumHoldTime'];}logger[_0xe8b4('0x73')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x21a4f6,_0x1970a6['queue'],_0x1970a6['type'],_0x11fa2e);this['channels'][_0x21a4f6]=_0x1970a6;Object['assign'](this[_0xe8b4('0x40')][_0x1970a6[_0xe8b4('0x6a')]],_0x3bce1d);if(_0x1970a6[_0xe8b4('0xa0')]){this['emitVoiceQueueChannelRemove'](_0x1970a6,_0xe8b4('0x23'));}}}logger[_0xe8b4('0x4a')](_0xe8b4('0xc2'),_0x21a4f6,util[_0xe8b4('0x3e')](this[_0xe8b4('0xe')][_0x21a4f6],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x1970a6)&&_0x1970a6[_0xe8b4('0x4d')]!=='ATTENDEDTRANSFER'){ami[_0xe8b4('0x42')](_0xe8b4('0xc3'),this['queueReports'][_0x21a4f6]);delete this['queueReports'][_0x21a4f6];delete this[_0xe8b4('0x10')][_0x21a4f6];if(this[_0xe8b4('0x13')][_0x21a4f6]){delete this[_0xe8b4('0x13')][_0x21a4f6];}}};VoiceQueueReport['prototype'][_0xe8b4('0x24')]=function(_0x623fe5){try{if(this[_0xe8b4('0x56')](_0x623fe5)){logger['debug'](_0xe8b4('0xc4'),_0x623fe5[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x623fe5,{'showHidden':![],'depth':null}));if(this[_0xe8b4('0xe')][_0x623fe5[_0xe8b4('0x45')]]){return this['handleHangup'](_0x623fe5['uniqueid'],_0x623fe5[_0xe8b4('0xc5')],![]);}if(this[_0xe8b4('0xe')][_0x623fe5[_0xe8b4('0x8d')]]){if(_0x623fe5[_0xe8b4('0xc6')]==='21'){return;}return this[_0xe8b4('0xc7')](_0x623fe5[_0xe8b4('0x8d')],_0x623fe5[_0xe8b4('0xc5')],!![]);}var _0x47584d=Object[_0xe8b4('0x75')](this[_0xe8b4('0xe')]);for(var _0x264ad5=0x0;_0x264ad5<_0x47584d['length'];_0x264ad5++){var _0x1c4a7f=_[_0xe8b4('0x77')](this[_0xe8b4('0xe')][_0x47584d[_0x264ad5]]);if(_0x1c4a7f&&_0x1c4a7f[_0xe8b4('0xc8')]===_0x623fe5[_0xe8b4('0x45')]){return this[_0xe8b4('0xc7')](_0x1c4a7f['uniqueid'],_0x623fe5[_0xe8b4('0xc5')],!![]);}}}}catch(_0x3a6488){logger['error']('[%s][voiceQueueReport][hangup]',_0x623fe5[_0xe8b4('0x45')],util['inspect'](_0x3a6488,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe8b4('0xb')]['syncAttendedTransfer']=function(_0x1dc1e0){try{if(this['isNotNull'](_0x1dc1e0)){logger[_0xe8b4('0x4a')](_0xe8b4('0xc9'),_0x1dc1e0[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x1dc1e0,{'showHidden':![],'depth':null}));var _0x22332e;var _0x4d6a74;var _0x284a95;if(this['queueReports'][_0x1dc1e0['transfereeuniqueid']]){_0x22332e=_[_0xe8b4('0x77')](this[_0xe8b4('0xe')][_0x1dc1e0['transfereeuniqueid']]);_0x22332e[_0xe8b4('0x92')]=_0x1dc1e0[_0xe8b4('0xca')];_0x22332e[_0xe8b4('0x94')]=_0x1dc1e0['secondtransfereruniqueid'];_0x22332e['queuecallerexitreason']=_0xe8b4('0x4e');_0x22332e['transfer']=!![];_0x22332e['transfertype']=_0xe8b4('0xcb');if(this[_0xe8b4('0xe')][_0x1dc1e0[_0xe8b4('0xcc')]]){_0x284a95=this[_0xe8b4('0xe')][_0x1dc1e0['secondtransfereruniqueid']];this['queueReports'][_0x1dc1e0[_0xe8b4('0xcc')]]=this[_0xe8b4('0xe')][_0x1dc1e0[_0xe8b4('0xcd')]];this['queueReports'][_0x1dc1e0[_0xe8b4('0xcd')]]=_0x284a95;_0x4d6a74=_['last'](this[_0xe8b4('0xe')][_0x1dc1e0[_0xe8b4('0xcd')]]);_0x4d6a74[_0xe8b4('0x37')]=!![];}logger[_0xe8b4('0x73')](_0xe8b4('0xce'),_0x1dc1e0['uniqueid'],_0x22332e['queue'],_0x22332e[_0xe8b4('0x51')],_0x22332e[_0xe8b4('0x92')],_0x22332e[_0xe8b4('0x94')]);}else if(this[_0xe8b4('0xe')][_0x1dc1e0[_0xe8b4('0xcf')]]){_0x22332e=_[_0xe8b4('0x77')](this['queueReports'][_0x1dc1e0[_0xe8b4('0xcf')]]);_0x22332e[_0xe8b4('0x92')]=_0x1dc1e0[_0xe8b4('0xd0')];_0x22332e[_0xe8b4('0x94')]=_0x1dc1e0['origtransfereruniqueid'];_0x22332e['queuecallerexitreason']=_0xe8b4('0x4e');_0x22332e[_0xe8b4('0x88')]=!![];_0x22332e['transfertype']=_0xe8b4('0xcb');if(this[_0xe8b4('0xe')][_0x1dc1e0['origtransfereruniqueid']]){_0x284a95=this[_0xe8b4('0xe')][_0x1dc1e0['origtransfereruniqueid']];this[_0xe8b4('0xe')][_0x1dc1e0[_0xe8b4('0xd1')]]=this['queueReports'][_0x1dc1e0[_0xe8b4('0xcf')]];this['queueReports'][_0x1dc1e0[_0xe8b4('0xcf')]]=_0x284a95;_0x4d6a74=_['last'](this['queueReports'][_0x1dc1e0[_0xe8b4('0xcf')]]);_0x4d6a74[_0xe8b4('0x37')]=!![];}logger[_0xe8b4('0x73')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x1dc1e0['uniqueid'],_0x22332e[_0xe8b4('0x6a')],_0x22332e[_0xe8b4('0x51')],_0x22332e[_0xe8b4('0x92')],_0x22332e['transferuniqueid']);}else if(this[_0xe8b4('0xe')][_0x1dc1e0[_0xe8b4('0xd1')]]){_0x22332e=_[_0xe8b4('0x77')](this[_0xe8b4('0xe')][_0x1dc1e0[_0xe8b4('0xd1')]]);_0x22332e[_0xe8b4('0x92')]=_0x1dc1e0[_0xe8b4('0xd0')];_0x22332e[_0xe8b4('0x94')]=_0x1dc1e0[_0xe8b4('0xd1')];_0x22332e[_0xe8b4('0x4d')]='ATTENDEDTRANSFER';_0x22332e[_0xe8b4('0x88')]=!![];_0x22332e[_0xe8b4('0x91')]=_0xe8b4('0xcb');_0x22332e['switch']=!![];_0x22332e[_0xe8b4('0xc8')]=_0x1dc1e0[_0xe8b4('0xcd')];}else if(this['queueReports'][_0x1dc1e0[_0xe8b4('0xcc')]]){_0x22332e=_[_0xe8b4('0x77')](this[_0xe8b4('0xe')][_0x1dc1e0[_0xe8b4('0xcc')]]);_0x22332e[_0xe8b4('0x92')]=_0x1dc1e0[_0xe8b4('0xca')];_0x22332e[_0xe8b4('0x94')]=_0x1dc1e0[_0xe8b4('0xcc')];_0x22332e[_0xe8b4('0x4d')]=_0xe8b4('0x4e');_0x22332e[_0xe8b4('0x88')]=!![];_0x22332e['transfertype']=_0xe8b4('0xcb');_0x22332e[_0xe8b4('0x37')]=!![];_0x22332e[_0xe8b4('0xc8')]=_0x1dc1e0['transfertargetuniqueid'];}}}catch(_0x56d901){logger['error']('[%s][voiceQueueReport][attendedtransfer]',_0x1dc1e0[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x56d901,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe8b4('0xb')]['syncBlindTransfer']=function(_0x123c51){try{if(this[_0xe8b4('0x56')](_0x123c51)){logger[_0xe8b4('0x4a')](_0xe8b4('0xd2'),_0x123c51['uniqueid'],util[_0xe8b4('0x3e')](_0x123c51,{'showHidden':![],'depth':null}));if(this[_0xe8b4('0xe')][_0x123c51[_0xe8b4('0xcd')]]){var _0x355ac8=_[_0xe8b4('0x77')](this[_0xe8b4('0xe')][_0x123c51[_0xe8b4('0xcd')]]);_0x355ac8['queuecallerexitreason']=_0xe8b4('0xd3');_0x355ac8['transfer']=!![];_0x355ac8[_0xe8b4('0x91')]='BLIND';_0x355ac8['transferexten']=_0x123c51[_0xe8b4('0xd4')];_0x355ac8['transferuniqueid']=_0x123c51[_0xe8b4('0xcd')];logger[_0xe8b4('0x73')]('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x123c51[_0xe8b4('0x45')],_0x355ac8['queue'],_0x355ac8[_0xe8b4('0x51')],_0x355ac8[_0xe8b4('0x92')],_0x355ac8[_0xe8b4('0x94')]);this[_0xe8b4('0x24')]({'event':_0xe8b4('0xd5'),'uniqueid':_0x123c51[_0xe8b4('0xcd')],'context':_0x123c51[_0xe8b4('0xd6')],'channel':_0x123c51['transfererchannel']});}}}catch(_0x15ac5d){logger[_0xe8b4('0x3d')](_0xe8b4('0xd2'),_0x123c51[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x15ac5d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe8b4('0xb')]['syncMusicOnHoldStart']=function(_0x524a46){try{if(this[_0xe8b4('0x56')](_0x524a46)){logger[_0xe8b4('0x4a')](_0xe8b4('0xd7'),_0x524a46[_0xe8b4('0x45')],util['inspect'](_0x524a46,{'showHidden':![],'depth':null}));if(this[_0xe8b4('0xe')][_0x524a46[_0xe8b4('0x45')]]){var _0x1d6f98=_[_0xe8b4('0x77')](this[_0xe8b4('0xe')][_0x524a46[_0xe8b4('0x45')]]);if(!_[_0xe8b4('0x38')](_0x1d6f98[_0xe8b4('0xa0')])){_0x1d6f98[_0xe8b4('0xd8')]=moment()['format'](_0xe8b4('0x70'));logger[_0xe8b4('0x73')](_0xe8b4('0xd9'),_0x524a46[_0xe8b4('0x45')],_0x1d6f98[_0xe8b4('0xd8')]);}}}}catch(_0x4fb6bf){logger[_0xe8b4('0x3d')](_0xe8b4('0xd7'),_0x524a46[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x4fb6bf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0x29')]=function(_0x2d6d6b){try{if(this[_0xe8b4('0x56')](_0x2d6d6b)){logger[_0xe8b4('0x4a')](_0xe8b4('0xda'),_0x2d6d6b[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x2d6d6b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2d6d6b[_0xe8b4('0x45')]]){var _0x241e83=_[_0xe8b4('0x77')](this[_0xe8b4('0xe')][_0x2d6d6b[_0xe8b4('0x45')]]);if(!_[_0xe8b4('0x38')](_0x241e83[_0xe8b4('0xd8')])){_0x241e83[_0xe8b4('0xdb')]+=moment()[_0xe8b4('0xdc')](0x0)['diff'](_0x241e83[_0xe8b4('0xd8')],_0xe8b4('0x8f'));logger[_0xe8b4('0x73')](_0xe8b4('0xdd'),_0x2d6d6b['uniqueid'],_0x241e83[_0xe8b4('0xdb')]);delete _0x241e83[_0xe8b4('0xd8')];}}}}catch(_0x5bf754){logger[_0xe8b4('0x3d')]('[%s][voiceQueueReport][musiconholdstop]',_0x2d6d6b[_0xe8b4('0x45')],util[_0xe8b4('0x3e')](_0x5bf754,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xe8b4('0xb')][_0xe8b4('0xde')]=function(_0xc812d6){try{if(this['isNotNull'](_0xc812d6)){logger[_0xe8b4('0x4a')](_0xe8b4('0xdf'),_0xc812d6['uniqueid'],util['inspect'](_0xc812d6,{'showHidden':![],'depth':null}));if(_0xc812d6[_0xe8b4('0xe0')]['toLowerCase']()===_0xe8b4('0xe1')){_0xc812d6[_0xe8b4('0xe2')]=_0xc812d6[_0xe8b4('0xe3')]&&_0xc812d6[_0xe8b4('0xe3')][_0xe8b4('0xe4')]('CDR(routeAlias)')?_0xc812d6['appdata']:(_0xc812d6[_0xe8b4('0xe3')]||_0xc812d6['applicationdata'])[_0xe8b4('0x8c')]();if(_[_0xe8b4('0xe4')](_0xc812d6[_0xe8b4('0xe2')][_0xe8b4('0x8c')](),'cdr(')){logger['info'](_0xe8b4('0xe5'),_0xc812d6['uniqueid'],_0xc812d6[_0xe8b4('0xe0')],_0xc812d6['applicationdata']);if(_[_0xe8b4('0x57')](this[_0xe8b4('0x10')][_0xc812d6['uniqueid']]))this[_0xe8b4('0x10')][_0xc812d6['uniqueid']]={};var _0x311324=_0xc812d6['applicationdata'][_0xe8b4('0xe6')]('=');var _0x1af64e=_0x311324[0x0][_0xe8b4('0x8c')]()[_0xe8b4('0xe7')](/cdr\((.*)\)/);if(_0x1af64e)this['channels'][_0xc812d6['uniqueid']][_0x1af64e[0x1]]=_0x311324[0x1];}}}}catch(_0x17d893){logger['error']('[%s][voiceQueueReport][newexten]',_0xc812d6[_0xe8b4('0x45')],util['inspect'](_0x17d893,{'showHidden':![],'depth':null}));}};module[_0xe8b4('0xe8')]=VoiceQueueReport;
\ No newline at end of file