Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index 622f1fe..8c57f0d 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x9ba1=['isRunning','queuestatus','[voiceQueueReport][queuesummary]','createQueueSummaryReport','name','createReport','handleInboundQueueSummaryReport','compareToInboundQueue','assign','type','outbound','custom:queuesummary','statusRequests','syncQueueSummaryComplete','completeEvent','push','isNotNull','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','then','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','syncQueueCallerLeave','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','membername','holdtime','queuecallerexitAt','reason','transfer','COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','TIMEOUT','timeout','[%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','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberrealtime','includes','handleHangup','length','sumHoldTime','diff','sumDuration','milliseconds','answered','sumBillable','lastevent','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][handleHangup]','cause-txt','transferid','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','ATTENDED','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','secondtransfererexten','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','mohtime','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','[%s][voiceQueueReport][newexten]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','../model/voiceQueueSummary','redis','socket.io-emitter','prototype','enqueue','tail','finally','sequence','realtime','agents','channels','voiceQueues','campaigns','summary','queuesummary','syncQueueSummary','bind','queuesummarycomplete','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','queuecallerexit','queuecallercomplete','clearZombieChannels','switch','isNil','channel','catch','message','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkQueueReport]','variables','[%s][voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','queue','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','format','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','loopQueueShow','Action','queues','[voiceQueueReport][queues]','actionid'];(function(_0x4b0f02,_0xe741d2){var _0x18731f=function(_0xb411a8){while(--_0xb411a8){_0x4b0f02['push'](_0x4b0f02['shift']());}};_0x18731f(++_0xe741d2);}(_0x9ba1,0x184));var _0x19ba=function(_0x3b48ee,_0x47ff10){_0x3b48ee=_0x3b48ee-0x0;var _0x50023d=_0x9ba1[_0x3b48ee];return _0x50023d;};'use strict';var _=require('lodash');var moment=require(_0x19ba('0x0'));var util=require(_0x19ba('0x1'));var Redis=require(_0x19ba('0x2'));var config=require(_0x19ba('0x3'));var logger=require(_0x19ba('0x4'))('ami');var ami=require(_0x19ba('0x5'));var QueueReport=require('../model/queueReport');var VoiceQueueSummary=require(_0x19ba('0x6'));config[_0x19ba('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x19ba('0x8'))(new Redis(config[_0x19ba('0x7')]));var Sequence=function(){};Sequence[_0x19ba('0x9')][_0x19ba('0xa')]=function(_0x5b831f){this[_0x19ba('0xb')]=this[_0x19ba('0xb')]?this[_0x19ba('0xb')][_0x19ba('0xc')](_0x5b831f):_0x5b831f();};function VoiceQueueReport(_0x3c94ea){this[_0x19ba('0xd')]=new Sequence();this['queueReports']={};this[_0x19ba('0xe')]=_0x3c94ea;this[_0x19ba('0xf')]=_0x3c94ea[_0x19ba('0xf')];this[_0x19ba('0x10')]=_0x3c94ea['queueChannels'];this[_0x19ba('0x11')]=_0x3c94ea[_0x19ba('0x11')];this['campaigns']=_0x3c94ea[_0x19ba('0x12')];this[_0x19ba('0x13')]=initializeSummary();this['variables']={};ami['on'](_0x19ba('0x14'),this[_0x19ba('0x15')][_0x19ba('0x16')](this));ami['on'](_0x19ba('0x17'),this['syncQueueSummaryComplete'][_0x19ba('0x16')](this));ami['on'](_0x19ba('0x18'),this[_0x19ba('0x19')][_0x19ba('0x16')](this));ami['on'](_0x19ba('0x1a'),this[_0x19ba('0x1b')][_0x19ba('0x16')](this));ami['on'](_0x19ba('0x1c'),this[_0x19ba('0x1d')]['bind'](this));ami['on'](_0x19ba('0x1e'),this[_0x19ba('0x1f')]['bind'](this));ami['on'](_0x19ba('0x20'),this['syncQueueCallerLeave'][_0x19ba('0x16')](this));ami['on'](_0x19ba('0x21'),this[_0x19ba('0x22')]['bind'](this));ami['on']('agentconnect',this[_0x19ba('0x23')][_0x19ba('0x16')](this));ami['on'](_0x19ba('0x24'),this[_0x19ba('0x25')][_0x19ba('0x16')](this));ami['on'](_0x19ba('0x26'),this[_0x19ba('0x27')][_0x19ba('0x16')](this));ami['on'](_0x19ba('0x28'),this[_0x19ba('0x29')][_0x19ba('0x16')](this));ami['on']('musiconholdstart',this[_0x19ba('0x2a')][_0x19ba('0x16')](this));ami['on'](_0x19ba('0x2b'),this['syncMusicOnHoldStop'][_0x19ba('0x16')](this));ami['on'](_0x19ba('0x2c'),this[_0x19ba('0x2d')][_0x19ba('0x16')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x19ba('0x16')](this));this[_0x19ba('0x2e')]();this['loopQueueShow']();}function clearChannels(_0x20223){if(!_[_0x19ba('0x2f')](_0x20223)){for(var _0x45f803 in _0x20223){if(_0x20223[_0x19ba('0x30')](_0x45f803)){delete _0x20223[_0x45f803];}}}}function clearCampaigns(_0x3294ba){if(!_[_0x19ba('0x2f')](_0x3294ba)){for(var _0x41f7bc in _0x3294ba){if(_0x3294ba[_0x19ba('0x30')](_0x41f7bc)){_0x3294ba[_0x41f7bc]['originated']=0x0;}}}}function clearVoiceQueues(_0x23d99d){if(!_[_0x19ba('0x2f')](_0x23d99d)){for(var _0xe628d6 in _0x23d99d){if(_0x23d99d[_0x19ba('0x30')](_0xe628d6)){_0x23d99d[_0xe628d6][_0x19ba('0x31')]=0x0;_0x23d99d[_0xe628d6]['talking']=0x0;_0x23d99d[_0xe628d6][_0x19ba('0x32')]=0x0;_0x23d99d[_0xe628d6][_0x19ba('0x33')]=0x0;_0x23d99d[_0xe628d6][_0x19ba('0x34')]=!![];}}}}function clearAgentBooked(_0xb7ad9b){if(!_[_0x19ba('0x2f')](_0xb7ad9b)){for(var _0x4cdb8f in _0xb7ad9b){if(_0xb7ad9b[_0x19ba('0x30')](_0x4cdb8f)){_0xb7ad9b[_0x4cdb8f]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x455ab6){return _0x455ab6[_0x19ba('0x35')]||_0x455ab6['queuecallerabandon']||_0x455ab6[_0x19ba('0x36')];}VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x37')]=function(){var _0x582f24=this;for(var _0x5f145b in this[_0x19ba('0x10')]){if(this[_0x19ba('0x10')][_0x19ba('0x30')](_0x5f145b)&&!this[_0x19ba('0x10')][_0x5f145b][_0x19ba('0x38')]){this[_0x19ba('0xd')]['enqueue'](function(){if(!_[_0x19ba('0x39')](_0x582f24['channels'][_0x5f145b])){return ami['Action']({'action':'status','channel':_0x582f24['channels'][_0x5f145b][_0x19ba('0x3a')]})[_0x19ba('0x3b')](function(_0x367b1b){if(_0x367b1b[_0x19ba('0x3c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x582f24[_0x19ba('0x10')][_0x5f145b]){delete _0x582f24[_0x19ba('0x10')][_0x5f145b];logger[_0x19ba('0x3d')](_0x19ba('0x3e'),_0x5f145b,util[_0x19ba('0x3f')](_0x367b1b,{'showHidden':![],'depth':null}));}if(_0x582f24['queueReports'][_0x5f145b]){delete _0x582f24[_0x19ba('0x40')][_0x5f145b];logger[_0x19ba('0x3d')](_0x19ba('0x41'),_0x5f145b,util[_0x19ba('0x3f')](_0x367b1b,{'showHidden':![],'depth':null}));}if(_0x582f24['variables'][_0x5f145b]){delete _0x582f24[_0x19ba('0x42')][_0x5f145b];logger[_0x19ba('0x3d')](_0x19ba('0x43'),_0x5f145b,util['inspect'](_0x367b1b,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x19ba('0x9')]['syncFullyBooted']=function(){logger[_0x19ba('0x3d')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x19ba('0x10')]);this[_0x19ba('0x44')](this['queueReports']);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this['campaigns']);this['summary']=initializeSummary();};VoiceQueueReport['prototype']['clearQueueReport']=function(_0xb8296){var _0x1453ab=this;if(!_['isEmpty'](_0xb8296)){for(var _0x3fc09d in _0xb8296){if(_0xb8296[_0x19ba('0x30')](_0x3fc09d)){_0x1453ab[_0x19ba('0x45')](_0xb8296[_0x3fc09d],'clearqueuereport');delete _0xb8296[_0x3fc09d];}}}};VoiceQueueReport[_0x19ba('0x9')]['emit']=function(_0x3fcb05,_0x5dcaeb,_0x54017a){io['to'](_0x3fcb05)[_0x19ba('0x46')](_0x5dcaeb,_0x54017a);};VoiceQueueReport['prototype'][_0x19ba('0x47')]=function(_0x2cc8e6,_0x4d30a3){logger[_0x19ba('0x48')](_0x19ba('0x49')+_0x4d30a3+_0x19ba('0x4a'),_0x2cc8e6[_0x19ba('0x4b')],util['inspect'](_0x2cc8e6,{'showHidden':![],'depth':null}));this[_0x19ba('0x46')](util['format'](_0x19ba('0x4c'),_0x2cc8e6[_0x19ba('0x4d')]),_0x19ba('0x4e'),_0x2cc8e6);io[_0x19ba('0x46')](_0x19ba('0x4f'),_0x2cc8e6);};VoiceQueueReport[_0x19ba('0x9')]['emitVoiceQueueChannelRemove']=function(_0x474c85,_0x4cf719){logger[_0x19ba('0x48')](_0x19ba('0x49')+_0x4cf719+_0x19ba('0x50'),_0x474c85['uniqueid'],util[_0x19ba('0x3f')](_0x474c85,{'showHidden':![],'depth':null}));if(_0x474c85[_0x19ba('0x51')]===_0x19ba('0x52')){return;}this[_0x19ba('0x46')](util[_0x19ba('0x53')]('voice:queue:%s',_0x474c85[_0x19ba('0x4d')]),_0x19ba('0x54'),_0x474c85);io[_0x19ba('0x46')](_0x19ba('0x55'),_0x474c85);};VoiceQueueReport['prototype'][_0x19ba('0x56')]=function(_0x2d1753){if(_0x2d1753['type']===_0x19ba('0x57')){logger[_0x19ba('0x48')](_0x19ba('0x58'),util[_0x19ba('0x3f')](_0x2d1753,{'showHidden':![],'depth':null}));this[_0x19ba('0x46')](util[_0x19ba('0x53')](_0x19ba('0x4c'),_0x2d1753['name']),_0x19ba('0x59'),_0x2d1753);}};VoiceQueueReport[_0x19ba('0x9')]['isNotNull']=function(_0x3110e9){return _0x3110e9!==null&&!_[_0x19ba('0x5a')](_0x3110e9);};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x5b')]=function(){var _0xcc8bed=this;setInterval(function(){_0xcc8bed[_0x19ba('0x37')]();ami[_0x19ba('0x5c')]({'action':_0x19ba('0x5d')})[_0x19ba('0x3b')](function(_0x2c5e23){logger[_0x19ba('0x3d')](_0x19ba('0x5e'),util['inspect'](_0x2c5e23,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x19ba('0x2e')]=function(){var _0x351f0f=this;setInterval(function(){if(!_0x351f0f[_0x19ba('0x13')]['isRunning']){return ami[_0x19ba('0x5c')]({'action':_0x19ba('0x14')})['then'](function(_0x25affc){_0x351f0f['summary']['id']=_0x25affc[_0x19ba('0x5f')];_0x351f0f[_0x19ba('0x13')][_0x19ba('0x60')]=!![];_0x351f0f[_0x19ba('0x13')][_0x19ba('0x61')][_0x25affc[_0x19ba('0x5f')]]={};})[_0x19ba('0x3b')](function(_0x2de2d0){logger[_0x19ba('0x3d')](_0x19ba('0x62'),util[_0x19ba('0x3f')](_0x2de2d0,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x63')]=function(_0x334993,_0x452204){var _0x17e437;if(this[_0x19ba('0x13')]&&this[_0x19ba('0x13')][_0x19ba('0x5d')]&&this[_0x19ba('0x13')][_0x19ba('0x5d')][_0x334993[_0x19ba('0x64')]]){_0x17e437=this[_0x19ba('0x13')]['queues'][_0x334993[_0x19ba('0x64')]]['summaryEvent'];}var _0xfec6f7=new VoiceQueueSummary(_0x334993);return _0xfec6f7[_0x19ba('0x65')](_0x452204['agents'],this[_0x19ba('0xf')],_0x17e437,this[_0x19ba('0xe')][_0x19ba('0x10')]);};VoiceQueueReport['prototype'][_0x19ba('0x66')]=function(_0x7b689f,_0x329187){var _0x28e73f=this[_0x19ba('0x63')](_0x7b689f,_0x329187);var _0x4ff14f=![];_0x4ff14f=_0x28e73f[_0x19ba('0x67')](_0x7b689f);if(_0x4ff14f){Object[_0x19ba('0x68')](_0x7b689f,_0x28e73f);this['realtime'][_0x19ba('0x11')][_0x7b689f[_0x19ba('0x64')]]=_0x7b689f;this[_0x19ba('0x56')](_0x28e73f);}};VoiceQueueReport['prototype'][_0x19ba('0x1b')]=function(_0x517fc3){var _0x2c9b99=null;var _0x56db85=this[_0x19ba('0x13')]['id'];if(this[_0x19ba('0x13')][_0x19ba('0x61')][_0x56db85]){_0x2c9b99=this['summary'][_0x19ba('0x61')][_0x56db85][_0x517fc3[_0x19ba('0x5f')]];}if(!_0x2c9b99){this[_0x19ba('0x13')]=initializeSummary();return;}var _0x41dce6=this['voiceQueues'][_0x2c9b99[_0x19ba('0x4d')]];if(_0x41dce6[_0x19ba('0x69')]===_0x19ba('0x57')){this[_0x19ba('0x66')](_0x41dce6,_0x2c9b99);}else if(_0x41dce6[_0x19ba('0x69')]===_0x19ba('0x6a')){var _0x538ac9=this[_0x19ba('0x63')](_0x41dce6,_0x2c9b99);ami[_0x19ba('0x46')](_0x19ba('0x6b'),_0x538ac9);}this[_0x19ba('0x13')][_0x19ba('0x6c')]-=0x1;var _0x8757d4=this[_0x19ba('0x13')]['statusRequests']>0x0?!![]:![];if(!_0x8757d4){return this[_0x19ba('0x6d')](this[_0x19ba('0x13')][_0x19ba('0x6e')]);}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x19')]=function(_0x12d44c){var _0x4ea823=this[_0x19ba('0x13')]['id'];if(this['summary'][_0x19ba('0x61')][_0x4ea823]&&this[_0x19ba('0x13')][_0x19ba('0x61')][_0x4ea823][_0x12d44c[_0x19ba('0x5f')]]){this['summary'][_0x19ba('0x61')][_0x4ea823][_0x12d44c[_0x19ba('0x5f')]]['agents'][_0x19ba('0x6f')](_0x12d44c);}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x15')]=function(_0x39bff0){var _0x2159dd=this;try{if(this['isNotNull'](_0x39bff0)&&this[_0x19ba('0x70')](_0x39bff0[_0x19ba('0x4d')])){logger[_0x19ba('0x48')](_0x19ba('0x71'),util[_0x19ba('0x3f')](_0x39bff0,{'showHidden':![],'depth':null}));var _0x4a4dac=this[_0x19ba('0x11')][_0x39bff0[_0x19ba('0x4d')]];if(_0x4a4dac){logger['debug'](_0x19ba('0x72'),_0x4a4dac[_0x19ba('0x64')]);this['summary']['queues'][_0x4a4dac['name']]={'summaryEvent':_0x39bff0};this[_0x19ba('0x13')][_0x19ba('0x6c')]+=0x1;return ami[_0x19ba('0x5c')]({'action':_0x19ba('0x61'),'queue':_0x4a4dac['name']})[_0x19ba('0x73')](function(_0x40a244){if(!_0x2159dd['summary'][_0x19ba('0x61')][_0x39bff0[_0x19ba('0x5f')]]){_0x2159dd['summary']['queuestatus'][_0x39bff0['actionid']]={};}_0x2159dd['summary'][_0x19ba('0x61')][_0x39bff0[_0x19ba('0x5f')]][_0x40a244[_0x19ba('0x5f')]]={'queue':_0x4a4dac[_0x19ba('0x64')],'agents':[]};})[_0x19ba('0x3b')](function(_0x4618c4){throw _0x4618c4;});}}}catch(_0x127ce6){logger['error'](_0x19ba('0x62'),util[_0x19ba('0x3f')](_0x127ce6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x6d')]=function(_0x41a38c){if(this[_0x19ba('0x13')][_0x19ba('0x6c')]>0x0){this[_0x19ba('0x13')][_0x19ba('0x6e')]=_0x41a38c;return;}logger[_0x19ba('0x48')](_0x19ba('0x74'),util[_0x19ba('0x3f')](_0x41a38c,{'showHidden':![],'depth':null}));this[_0x19ba('0x13')]=initializeSummary();ami[_0x19ba('0x46')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x19ba('0x9')]['syncQueueCallerJoin']=function(_0xfbbfdf){try{if(this[_0x19ba('0x70')](_0xfbbfdf)){logger[_0x19ba('0x48')](_0x19ba('0x75'),_0xfbbfdf[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0xfbbfdf,{'showHidden':![],'depth':null}));if(_[_0x19ba('0x5a')](this[_0x19ba('0x40')][_0xfbbfdf[_0x19ba('0x4b')]])){this[_0x19ba('0x40')][_0xfbbfdf[_0x19ba('0x4b')]]=[];}if(_[_0x19ba('0x5a')](this[_0x19ba('0x10')][_0xfbbfdf[_0x19ba('0x4b')]])){this['channels'][_0xfbbfdf[_0x19ba('0x4b')]]={};}var _0x354e2e=new QueueReport();_0x354e2e[_0x19ba('0x4d')]=_0xfbbfdf[_0x19ba('0x4d')];_0x354e2e['type']=this[_0x19ba('0x11')][_0x354e2e['queue']]&&this['voiceQueues'][_0x354e2e[_0x19ba('0x4d')]][_0x19ba('0x69')]?this[_0x19ba('0x11')][_0x354e2e[_0x19ba('0x4d')]][_0x19ba('0x69')]||'inbound':'inbound';_0x354e2e[_0x19ba('0x76')]=moment()[_0x19ba('0x53')](_0x19ba('0x77'));_0x354e2e['position']=_0xfbbfdf[_0x19ba('0x78')];_0x354e2e['count']=_0xfbbfdf[_0x19ba('0x79')];_0x354e2e[_0x19ba('0x4b')]=_0xfbbfdf[_0x19ba('0x4b')];_0x354e2e['routealias']=this[_0x19ba('0x10')][_0xfbbfdf['uniqueid']][_0x19ba('0x7a')];logger[_0x19ba('0x7b')](_0x19ba('0x7c'),_0x354e2e[_0x19ba('0x4d')],_0x354e2e[_0x19ba('0x69')]);Object[_0x19ba('0x68')](_0x354e2e,_[_0x19ba('0x7d')](_0xfbbfdf,_['keys'](_0x354e2e)));this[_0x19ba('0x40')][_0xfbbfdf[_0x19ba('0x4b')]]['push'](_0x354e2e);this[_0x19ba('0x10')][_0xfbbfdf['uniqueid']]=_0x354e2e;this['emitVoiceQueueChannelSave'](_0x354e2e,'queuecallerjoin');}}catch(_0x2c2c00){logger['error'](_0x19ba('0x75'),_0xfbbfdf[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x2c2c00,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')]['syncQueueCallerAbandon']=function(_0xfb9aed){try{if(this[_0x19ba('0x70')](_0xfb9aed)){logger[_0x19ba('0x48')](_0x19ba('0x7e'),_0xfb9aed[_0x19ba('0x4b')],util['inspect'](_0xfb9aed,{'showHidden':![],'depth':null}));if(this[_0x19ba('0x40')][_0xfb9aed[_0x19ba('0x4b')]]){var _0x4b4947=_[_0x19ba('0x7f')](this[_0x19ba('0x40')][_0xfb9aed[_0x19ba('0x4b')]]);_0x4b4947[_0x19ba('0x36')]=![];_0x4b4947[_0x19ba('0x80')]=null;_0x4b4947['holdtime']=_0xfb9aed['holdtime'];_0x4b4947[_0x19ba('0x81')]=_0xfb9aed[_0x19ba('0x81')];_0x4b4947[_0x19ba('0x1e')]=!![];_0x4b4947[_0x19ba('0x82')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4b4947[_0x19ba('0x51')]=_0x19ba('0x83');_0x4b4947[_0x19ba('0x84')]=null;logger[_0x19ba('0x7b')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x4b4947[_0x19ba('0x4d')],_0x4b4947[_0x19ba('0x69')]);this[_0x19ba('0x10')][_0xfb9aed[_0x19ba('0x4b')]]=_0x4b4947;this['emitVoiceQueueChannelRemove'](_0x4b4947,_0x19ba('0x1e'));}}}catch(_0x503ad6){logger['error'](_0x19ba('0x7e'),_0xfb9aed['uniqueid'],util[_0x19ba('0x3f')](_0x503ad6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x85')]=function(_0x2e1834){try{if(this[_0x19ba('0x70')](_0x2e1834)){logger[_0x19ba('0x48')]('[%s][voiceQueueReport][queuecallerleave]',_0x2e1834['uniqueid'],util[_0x19ba('0x3f')](_0x2e1834,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2e1834[_0x19ba('0x4b')]]){var _0x12a69b=_[_0x19ba('0x7f')](this[_0x19ba('0x40')][_0x2e1834['uniqueid']]);_0x12a69b[_0x19ba('0x86')]=moment()[_0x19ba('0x53')](_0x19ba('0x77'));_0x12a69b[_0x19ba('0x87')]=_0x2e1834[_0x19ba('0x87')];_0x12a69b[_0x19ba('0x88')]=_0x2e1834[_0x19ba('0x88')];logger['info'](_0x19ba('0x89'),_0x12a69b[_0x19ba('0x4d')],_0x12a69b[_0x19ba('0x69')],_0x2e1834[_0x19ba('0x87')],_0x2e1834[_0x19ba('0x88')]);this[_0x19ba('0x10')][_0x2e1834[_0x19ba('0x4b')]]=_0x12a69b;this[_0x19ba('0x47')](_0x12a69b,_0x19ba('0x20'));}}}catch(_0x1863a5){logger[_0x19ba('0x3d')](_0x19ba('0x8a'),_0x2e1834['uniqueid'],util[_0x19ba('0x3f')](_0x1863a5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')]['syncAgentConnect']=function(_0x5bb0f0){try{if(this[_0x19ba('0x70')](_0x5bb0f0)){logger['debug'](_0x19ba('0x8b'),_0x5bb0f0[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x5bb0f0,{'showHidden':![],'depth':null}));if(this[_0x19ba('0x40')][_0x5bb0f0[_0x19ba('0x4b')]]){var _0x576fb1=_[_0x19ba('0x7f')](this[_0x19ba('0x40')][_0x5bb0f0['uniqueid']]);_0x576fb1['queuecallercomplete']=!![];_0x576fb1['queuecallerexitreason']=_0x19ba('0x8c');logger['info'](_0x19ba('0x8d'),_0x576fb1['queue'],_0x576fb1[_0x19ba('0x69')]);}}}catch(_0x9d8746){logger[_0x19ba('0x3d')]('[%s][voiceQueueReport][agentconnect]',_0x5bb0f0[_0x19ba('0x4b')],util['inspect'](_0x9d8746,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x19ba('0x22')]=function(_0x2f7316){try{if(this[_0x19ba('0x70')](_0x2f7316)){logger[_0x19ba('0x48')](_0x19ba('0x8e'),_0x2f7316[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x2f7316,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2f7316[_0x19ba('0x4b')]]){var _0x58286b=_['last'](this[_0x19ba('0x40')][_0x2f7316['uniqueid']]);_0x58286b[_0x19ba('0x1e')]=![];_0x58286b[_0x19ba('0x82')]=null;_0x58286b['assigned']=!![];_0x58286b[_0x19ba('0x84')]=_0x2f7316[_0x19ba('0x8f')];_0x58286b['holdtime']=_0x2f7316[_0x19ba('0x90')];_0x58286b[_0x19ba('0x36')]=!![];_0x58286b[_0x19ba('0x35')]=![];_0x58286b[_0x19ba('0x91')]=null;if(!_0x58286b['transfer']){if(_0x2f7316[_0x19ba('0x92')]==_0x19ba('0x93')){_0x58286b[_0x19ba('0x51')]=_0x19ba('0x94');logger[_0x19ba('0x7b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x58286b[_0x19ba('0x4d')],_0x58286b[_0x19ba('0x69')]);}else{if(_[_0x19ba('0x95')](_0x2f7316['channel'][_0x19ba('0x96')](),_0x19ba('0x97'))){if(this[_0x19ba('0x40')][_0x2f7316[_0x19ba('0x98')]]){var _0x430759=_[_0x19ba('0x7f')](this['queueReports'][_0x2f7316[_0x19ba('0x98')]]);_0x430759[_0x19ba('0x36')]=![];_0x430759[_0x19ba('0x35')]=!![];_0x430759[_0x19ba('0x91')]=moment(_0x58286b['queuecallerjoinAt'])[_0x19ba('0x99')](_0x2f7316[_0x19ba('0x90')],_0x19ba('0x9a'))['format'](_0x19ba('0x77'));_0x430759[_0x19ba('0x51')]=_0x19ba('0x9b');_0x430759[_0x19ba('0x93')]=!![];_0x430759[_0x19ba('0x9c')]=_0x19ba('0x9d');_0x430759[_0x19ba('0x9e')]=_0x2f7316[_0x19ba('0x9f')];_0x430759[_0x19ba('0xa0')]=_0x2f7316[_0x19ba('0x4b')];logger[_0x19ba('0x7b')](_0x19ba('0xa1'),_0x430759[_0x19ba('0x4d')],_0x430759[_0x19ba('0x69')]);var _0x3a2a5a=this['queueReports'][_0x2f7316['linkedid']];this['queueReports'][_0x2f7316[_0x19ba('0x98')]]=this[_0x19ba('0x40')][_0x2f7316[_0x19ba('0x4b')]];this[_0x19ba('0x40')][_0x2f7316['uniqueid']]=_0x3a2a5a;}}else{_0x58286b[_0x19ba('0x51')]='COMPLETEDBY'+_0x2f7316[_0x19ba('0x92')]['toUpperCase']();logger[_0x19ba('0x7b')](_0x19ba('0xa2'),_0x58286b['queue'],_0x58286b[_0x19ba('0x69')],_0x58286b['queuecallerexitreason']);}}}this['channels'][_0x2f7316[_0x19ba('0x4b')]]=_0x58286b;}}}catch(_0x10dea5){logger[_0x19ba('0x3d')](_0x19ba('0x8e'),_0x2f7316[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x10dea5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x25')]=function(_0xfe7355){try{if(this['isNotNull'](_0xfe7355)){logger[_0x19ba('0x48')](_0x19ba('0xa3'),_0xfe7355[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0xfe7355,{'showHidden':![],'depth':null}));this[_0x19ba('0xa4')](_0xfe7355['uniqueid'],_['keys'](_0xfe7355[_0x19ba('0xa5')])[0x0],_0xfe7355[_0x19ba('0xa6')]);if(this['queueReports'][_0xfe7355[_0x19ba('0x4b')]]){var _0x5d01a4=_['last'](this['queueReports'][_0xfe7355[_0x19ba('0x4b')]]);if(_0x5d01a4){if(this[_0x19ba('0x70')](_0xfe7355['variable'])&&this['isNotNull'](_0xfe7355[_0x19ba('0xa5')][_0x19ba('0x61')])){switch(_0xfe7355[_0x19ba('0xa6')]){case _0x19ba('0xa7'):_0x5d01a4[_0x19ba('0x35')]=![];_0x5d01a4[_0x19ba('0x91')]=null;break;case _0x19ba('0xa8'):_0x5d01a4['lastevent']=_0x19ba('0xa9');_0x5d01a4[_0x19ba('0x35')]=!![];_0x5d01a4['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5d01a4[_0x19ba('0x86')]=moment()[_0x19ba('0x53')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug'](_0x19ba('0xaa'),_0xfe7355['uniqueid'],util[_0x19ba('0x3f')](_0x5d01a4,{'showHidden':![],'depth':null}));ami['emit'](_0x19ba('0xab'),_0x5d01a4);break;default:_0x5d01a4[_0x19ba('0x35')]=!![];_0x5d01a4[_0x19ba('0x91')]=moment()[_0x19ba('0x53')](_0x19ba('0x77'));_0x5d01a4['queuecallerleaveAt']=moment()[_0x19ba('0x53')](_0x19ba('0x77'));}_0x5d01a4['queuecallerabandon']=![];_0x5d01a4[_0x19ba('0x82')]=null;_0x5d01a4['queuecallerexitreason']=_0xfe7355[_0x19ba('0xa6')];this[_0x19ba('0x10')][_0xfe7355[_0x19ba('0x4b')]]=_0x5d01a4;this[_0x19ba('0x45')](_0x5d01a4,_0x19ba('0x24'));}else if(this[_0x19ba('0x70')](_0xfe7355[_0x19ba('0xa5')])&&this[_0x19ba('0x70')](_0xfe7355[_0x19ba('0xa5')][_0x19ba('0xac')])){if(!_0x5d01a4[_0x19ba('0x1e')]){_0x5d01a4[_0x19ba('0x35')]=!![];_0x5d01a4['queuecallerexitAt']=moment()[_0x19ba('0x53')]('YYYY-MM-DD\x20HH:mm:ss');_0x5d01a4[_0x19ba('0x51')]=_0x19ba('0xad');_0x5d01a4[_0x19ba('0x86')]=moment()[_0x19ba('0x53')](_0x19ba('0x77'));this['channels'][_0xfe7355[_0x19ba('0x4b')]]=_0x5d01a4;}}logger['info'](_0x19ba('0xae'),_0xfe7355['uniqueid'],_0x5d01a4['queue'],_0x5d01a4['type'],_['keys'](_0xfe7355['variable'])[0x0],_0xfe7355['value']);_0x5d01a4['variables']=this[_0x19ba('0x42')][_0xfe7355[_0x19ba('0x4b')]];}}}}catch(_0x45497f){logger[_0x19ba('0x3d')](_0x19ba('0xa3'),_0xfe7355[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x45497f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0xa4')]=function(_0x17a045,_0x44a996,_0x2c985e){var _0x345939=[_0x19ba('0xaf'),_0x19ba('0xb0'),_0x19ba('0xb1'),_0x19ba('0xb2'),'rtpaudioqosloss',_0x19ba('0xb3'),_0x19ba('0xb4'),'rtpaudioqosrttbridged',_0x19ba('0xb5'),'sipuri',_0x19ba('0xb6'),_0x19ba('0xb7'),_0x19ba('0xb8'),_0x19ba('0xb9'),_0x19ba('0xba'),'memberlastcall',_0x19ba('0x8f'),'memberpenalty',_0x19ba('0xbb')];if(!_[_0x19ba('0x39')](_0x44a996)&&!_[_0x19ba('0xbc')](_0x345939,_0x44a996)){if(_[_0x19ba('0x5a')](this['variables'][_0x17a045])){this[_0x19ba('0x42')][_0x17a045]={};}this[_0x19ba('0x42')][_0x17a045][_0x44a996]=_0x2c985e;}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0xbd')]=function(_0x4dc3cf,_0x41150f,_0x2cab9a){try{var _0x1404c0={};if(this[_0x19ba('0x40')][_0x4dc3cf]){for(var _0xbb41cd=0x0;_0xbb41cd<this[_0x19ba('0x40')][_0x4dc3cf][_0x19ba('0xbe')];_0xbb41cd+=0x1){_0x1404c0=this[_0x19ba('0x40')][_0x4dc3cf][_0xbb41cd];var _0x3f5e57=this['voiceQueues'][_0x1404c0[_0x19ba('0x4d')]];if(_0x3f5e57){_0x3f5e57[_0x19ba('0xbf')]+=moment(_0x1404c0[_0x19ba('0x86')])[_0x19ba('0xc0')](_0x1404c0[_0x19ba('0x76')],_0x19ba('0x9a'))||0x0;if(_0x2cab9a&&_0x1404c0[_0x19ba('0x51')]===_0x19ba('0x52')){_0x1404c0['queuecallerexitreason']=_0x19ba('0x8c');}if(_0xbb41cd===this[_0x19ba('0x40')][_0x4dc3cf][_0x19ba('0xbe')]-0x1){_0x3f5e57[_0x19ba('0xc1')]+=moment()[_0x19ba('0xc2')](0x0)['diff'](_0x1404c0[_0x19ba('0x76')],_0x19ba('0x9a'));if(hasCallerLeftTheQueue(_0x1404c0)&&_0x1404c0[_0x19ba('0x51')]!==_0x19ba('0x52')){_0x3f5e57['total']+=0x1;}if(_0x1404c0['queuecallercomplete']){_0x3f5e57[_0x19ba('0xc3')]+=0x1;_0x3f5e57[_0x19ba('0xc4')]+=moment()[_0x19ba('0xc2')](0x0)['diff'](_0x1404c0['queuecallerleaveAt'],_0x19ba('0x9a'));_0x1404c0[_0x19ba('0x80')]=moment()[_0x19ba('0x53')](_0x19ba('0x77'));_0x1404c0['queuecallerexit']=![];_0x1404c0[_0x19ba('0x91')]=null;}if(_0x1404c0[_0x19ba('0x35')]&&_0x1404c0[_0x19ba('0x93')]!=!![]){_0x3f5e57['unmanaged']+=0x1;_0x1404c0[_0x19ba('0xc5')]=_0x19ba('0xc6');logger['debug'](_0x19ba('0xc7'),_0x4dc3cf,util[_0x19ba('0x3f')](_0x1404c0,{'showHidden':![],'depth':null}));ami[_0x19ba('0x46')](_0x19ba('0xc8'),_0x1404c0);}if(_0x1404c0['queuecallerabandon']){_0x3f5e57[_0x19ba('0xc9')]+=0x1;_0x1404c0[_0x19ba('0xc5')]=_0x19ba('0xc9');logger[_0x19ba('0x48')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x4dc3cf,util['inspect'](_0x1404c0,{'showHidden':![],'depth':null}));ami[_0x19ba('0x46')]('custom:queuecallerabandon',_0x1404c0);}}else{_0x3f5e57[_0x19ba('0xc1')]+=_0x3f5e57[_0x19ba('0xbf')];}logger['info']('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x4dc3cf,_0x1404c0[_0x19ba('0x4d')],_0x1404c0['type'],_0x41150f);this[_0x19ba('0x10')][_0x4dc3cf]=_0x1404c0;Object[_0x19ba('0x68')](this['voiceQueues'][_0x1404c0[_0x19ba('0x4d')]],_0x3f5e57);if(_0x1404c0['queuecallerleaveAt']){this[_0x19ba('0x45')](_0x1404c0,_0x19ba('0x26'));}}}logger[_0x19ba('0x48')](_0x19ba('0xca'),_0x4dc3cf,util[_0x19ba('0x3f')](this[_0x19ba('0x40')][_0x4dc3cf],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x1404c0)&&_0x1404c0['queuecallerexitreason']!==_0x19ba('0x52')){ami[_0x19ba('0x46')](_0x19ba('0xcb'),this['queueReports'][_0x4dc3cf]);if(this[_0x19ba('0x40')][_0x4dc3cf]){delete this[_0x19ba('0x40')][_0x4dc3cf];}if(this[_0x19ba('0x10')][_0x4dc3cf]){delete this[_0x19ba('0x10')][_0x4dc3cf];}if(this[_0x19ba('0x42')][_0x4dc3cf]){delete this[_0x19ba('0x42')][_0x4dc3cf];}}}}catch(_0x296019){logger[_0x19ba('0x3d')](_0x19ba('0xcc'),_0x4dc3cf,util[_0x19ba('0x3f')](_0x296019,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')]['syncHangup']=function(_0x4c8713){try{if(this[_0x19ba('0x70')](_0x4c8713)){logger[_0x19ba('0x48')]('[%s][voiceQueueReport][hangup]',_0x4c8713['uniqueid'],util[_0x19ba('0x3f')](_0x4c8713,{'showHidden':![],'depth':null}));if(this[_0x19ba('0x40')][_0x4c8713[_0x19ba('0x4b')]]){return this[_0x19ba('0xbd')](_0x4c8713[_0x19ba('0x4b')],_0x4c8713[_0x19ba('0xcd')],![]);}if(this[_0x19ba('0x40')][_0x4c8713[_0x19ba('0x98')]]){if(_0x4c8713['cause']==='21'){return;}return this[_0x19ba('0xbd')](_0x4c8713['linkedid'],_0x4c8713[_0x19ba('0xcd')],!![]);}var _0x48afe9=Object['keys'](this[_0x19ba('0x40')]);for(var _0x2ced72=0x0;_0x2ced72<_0x48afe9[_0x19ba('0xbe')];_0x2ced72++){var _0x46482a=_['last'](this[_0x19ba('0x40')][_0x48afe9[_0x2ced72]]);if(_0x46482a&&_0x46482a[_0x19ba('0xce')]===_0x4c8713[_0x19ba('0x4b')]){return this[_0x19ba('0xbd')](_0x46482a[_0x19ba('0x4b')],_0x4c8713[_0x19ba('0xcd')],!![]);}}if(!this[_0x19ba('0x40')][_0x4c8713['uniqueid']]){logger[_0x19ba('0x48')](_0x19ba('0xcf'),_0x4c8713[_0x19ba('0x4b')]);if(this[_0x19ba('0x10')][_0x4c8713[_0x19ba('0x4b')]]){delete this[_0x19ba('0x10')][_0x4c8713['uniqueid']];}if(this['variables'][_0x4c8713[_0x19ba('0x4b')]]){delete this[_0x19ba('0x42')][_0x4c8713['uniqueid']];}}}}catch(_0x136461){logger[_0x19ba('0x3d')](_0x19ba('0xd0'),_0x4c8713[_0x19ba('0x4b')],util['inspect'](_0x136461,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')]['syncAttendedTransfer']=function(_0x28612a){try{if(this[_0x19ba('0x70')](_0x28612a)){logger[_0x19ba('0x48')](_0x19ba('0xd1'),_0x28612a[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x28612a,{'showHidden':![],'depth':null}));var _0x42fec3;var _0x4f268a;var _0x4f0e9b;if(this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd2')]]){_0x42fec3=_[_0x19ba('0x7f')](this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd2')]]);_0x42fec3[_0x19ba('0x9e')]=_0x28612a['secondtransfererexten'];_0x42fec3[_0x19ba('0xa0')]=_0x28612a['secondtransfereruniqueid'];_0x42fec3[_0x19ba('0x51')]=_0x19ba('0x52');_0x42fec3['transfer']=!![];_0x42fec3[_0x19ba('0x9c')]=_0x19ba('0xd3');if(this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd4')]]){_0x4f0e9b=this[_0x19ba('0x40')][_0x28612a['secondtransfereruniqueid']];this['queueReports'][_0x28612a[_0x19ba('0xd4')]]=this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd2')]];this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd2')]]=_0x4f0e9b;_0x4f268a=_['last'](this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd2')]]);_0x4f268a[_0x19ba('0x38')]=!![];}logger[_0x19ba('0x7b')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x28612a[_0x19ba('0x4b')],_0x42fec3['queue'],_0x42fec3[_0x19ba('0x69')],_0x42fec3[_0x19ba('0x9e')],_0x42fec3[_0x19ba('0xa0')]);}else if(this['queueReports'][_0x28612a[_0x19ba('0xd5')]]){_0x42fec3=_[_0x19ba('0x7f')](this['queueReports'][_0x28612a['transfertargetuniqueid']]);_0x42fec3[_0x19ba('0x9e')]=_0x28612a[_0x19ba('0xd6')];_0x42fec3[_0x19ba('0xa0')]=_0x28612a['origtransfereruniqueid'];_0x42fec3[_0x19ba('0x51')]=_0x19ba('0x52');_0x42fec3[_0x19ba('0x93')]=!![];_0x42fec3['transfertype']=_0x19ba('0xd3');if(this['queueReports'][_0x28612a[_0x19ba('0xd7')]]){_0x4f0e9b=this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd7')]];this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd7')]]=this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd5')]];this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd5')]]=_0x4f0e9b;_0x4f268a=_['last'](this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd5')]]);_0x4f268a['switch']=!![];}logger[_0x19ba('0x7b')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x28612a[_0x19ba('0x4b')],_0x42fec3[_0x19ba('0x4d')],_0x42fec3[_0x19ba('0x69')],_0x42fec3['transferexten'],_0x42fec3['transferuniqueid']);}else if(this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd7')]]){_0x42fec3=_['last'](this['queueReports'][_0x28612a['origtransfereruniqueid']]);_0x42fec3['transferexten']=_0x28612a[_0x19ba('0xd6')];_0x42fec3[_0x19ba('0xa0')]=_0x28612a[_0x19ba('0xd7')];_0x42fec3[_0x19ba('0x51')]=_0x19ba('0x52');_0x42fec3[_0x19ba('0x93')]=!![];_0x42fec3['transfertype']=_0x19ba('0xd3');_0x42fec3['switch']=!![];_0x42fec3[_0x19ba('0xce')]=_0x28612a[_0x19ba('0xd2')];}else if(this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd4')]]){_0x42fec3=_[_0x19ba('0x7f')](this[_0x19ba('0x40')][_0x28612a[_0x19ba('0xd4')]]);_0x42fec3['transferexten']=_0x28612a[_0x19ba('0xd8')];_0x42fec3[_0x19ba('0xa0')]=_0x28612a[_0x19ba('0xd4')];_0x42fec3[_0x19ba('0x51')]=_0x19ba('0x52');_0x42fec3[_0x19ba('0x93')]=!![];_0x42fec3['transfertype']=_0x19ba('0xd3');_0x42fec3['switch']=!![];_0x42fec3['transferid']=_0x28612a['transfertargetuniqueid'];}}}catch(_0x42dd01){logger[_0x19ba('0x3d')](_0x19ba('0xd1'),_0x28612a[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x42dd01,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0xd9')]=function(_0x26b2d0){try{if(this[_0x19ba('0x70')](_0x26b2d0)){logger['debug'](_0x19ba('0xda'),_0x26b2d0[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x26b2d0,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x26b2d0[_0x19ba('0xd2')]]){var _0x541e59=_[_0x19ba('0x7f')](this[_0x19ba('0x40')][_0x26b2d0[_0x19ba('0xd2')]]);_0x541e59[_0x19ba('0x51')]='BLINDTRANSFER';_0x541e59[_0x19ba('0x93')]=!![];_0x541e59[_0x19ba('0x9c')]='BLIND';_0x541e59[_0x19ba('0x9e')]=_0x26b2d0[_0x19ba('0xdb')];_0x541e59[_0x19ba('0xa0')]=_0x26b2d0['transfereeuniqueid'];logger[_0x19ba('0x7b')](_0x19ba('0xdc'),_0x26b2d0['uniqueid'],_0x541e59[_0x19ba('0x4d')],_0x541e59[_0x19ba('0x69')],_0x541e59[_0x19ba('0x9e')],_0x541e59[_0x19ba('0xa0')]);this[_0x19ba('0x27')]({'event':_0x19ba('0xdd'),'uniqueid':_0x26b2d0[_0x19ba('0xd2')],'context':_0x26b2d0[_0x19ba('0xde')],'channel':_0x26b2d0[_0x19ba('0xdf')]});}}}catch(_0x45c21e){logger['error'](_0x19ba('0xda'),_0x26b2d0[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x45c21e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0x2a')]=function(_0x265475){try{if(this[_0x19ba('0x70')](_0x265475)){logger[_0x19ba('0x48')](_0x19ba('0xe0'),_0x265475[_0x19ba('0x4b')],util['inspect'](_0x265475,{'showHidden':![],'depth':null}));if(this[_0x19ba('0x40')][_0x265475['uniqueid']]){var _0x2be454=_[_0x19ba('0x7f')](this['queueReports'][_0x265475[_0x19ba('0x4b')]]);if(!_[_0x19ba('0x39')](_0x2be454[_0x19ba('0x86')])){_0x2be454[_0x19ba('0xe1')]=moment()[_0x19ba('0x53')](_0x19ba('0x77'));logger[_0x19ba('0x7b')](_0x19ba('0xe2'),_0x265475[_0x19ba('0x4b')],_0x2be454[_0x19ba('0xe1')]);}}}}catch(_0x28b5bf){logger[_0x19ba('0x3d')]('[%s][voiceQueueReport][musiconholdstart]',_0x265475[_0x19ba('0x4b')],util['inspect'](_0x28b5bf,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x19ba('0xe3')]=function(_0x39bba7){try{if(this[_0x19ba('0x70')](_0x39bba7)){logger[_0x19ba('0x48')]('[%s][voiceQueueReport][musiconholdstop]',_0x39bba7[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x39bba7,{'showHidden':![],'depth':null}));if(this[_0x19ba('0x40')][_0x39bba7[_0x19ba('0x4b')]]){var _0x27168e=_['last'](this[_0x19ba('0x40')][_0x39bba7[_0x19ba('0x4b')]]);if(!_[_0x19ba('0x39')](_0x27168e[_0x19ba('0xe1')])){_0x27168e[_0x19ba('0xe4')]+=moment()[_0x19ba('0xc2')](0x0)[_0x19ba('0xc0')](_0x27168e[_0x19ba('0xe1')],_0x19ba('0x9a'));logger[_0x19ba('0x7b')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x39bba7[_0x19ba('0x4b')],_0x27168e[_0x19ba('0xe4')]);delete _0x27168e[_0x19ba('0xe1')];}}}}catch(_0x1d4791){logger[_0x19ba('0x3d')](_0x19ba('0xe5'),_0x39bba7[_0x19ba('0x4b')],util[_0x19ba('0x3f')](_0x1d4791,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x19ba('0x9')][_0x19ba('0xe6')]=function(_0x3da3e1){try{if(this['isNotNull'](_0x3da3e1)){logger[_0x19ba('0x48')]('[%s][voiceQueueReport][newexten]\x20event:',_0x3da3e1['uniqueid'],util['inspect'](_0x3da3e1,{'showHidden':![],'depth':null}));if(_0x3da3e1['application'][_0x19ba('0x96')]()===_0x19ba('0xe7')){_0x3da3e1[_0x19ba('0xe8')]=_0x3da3e1['appdata']&&_0x3da3e1[_0x19ba('0xe9')][_0x19ba('0x95')](_0x19ba('0xea'))?_0x3da3e1[_0x19ba('0xe9')]:(_0x3da3e1[_0x19ba('0xe9')]||_0x3da3e1[_0x19ba('0xe8')])[_0x19ba('0x96')]();if(_['startsWith'](_0x3da3e1[_0x19ba('0xe8')][_0x19ba('0x96')](),_0x19ba('0xeb'))){logger['info'](_0x19ba('0xec'),_0x3da3e1['uniqueid'],_0x3da3e1[_0x19ba('0xed')],_0x3da3e1['applicationdata']);if(_[_0x19ba('0x5a')](this[_0x19ba('0x10')][_0x3da3e1[_0x19ba('0x4b')]]))this[_0x19ba('0x10')][_0x3da3e1['uniqueid']]={};var _0x30633a=_0x3da3e1[_0x19ba('0xe8')][_0x19ba('0xee')]('=');var _0x42d544=_0x30633a[0x0][_0x19ba('0x96')]()[_0x19ba('0xef')](/cdr\((.*)\)/);if(_0x42d544)this[_0x19ba('0x10')][_0x3da3e1['uniqueid']][_0x42d544[0x1]]=_0x30633a[0x1];}}}}catch(_0x2e0ea2){logger[_0x19ba('0x3d')](_0x19ba('0xf0'),_0x3da3e1['uniqueid'],util[_0x19ba('0x3f')](_0x2e0ea2,{'showHidden':![],'depth':null}));}};module[_0x19ba('0xf1')]=VoiceQueueReport;
\ No newline at end of file
+var _0x6f7f=['assigned','membername','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','local/','seconds','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','linkedid','COMPLETEDBY','reason','[%s][voiceQueueReport][agentcomplete]','[%s][voiceQueueReport][varset]','addVariable','variable','value','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','varset','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','includes','handleHangup','length','sumHoldTime','diff','queuecallerjoinAt','milliseconds','total','answered','sumBillable','unmanaged','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','sumDuration','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','custom:voiceQueueReport','[%s][voiceQueueReport][handleHangup]','syncHangup','[%s][voiceQueueReport][hangup]','cause-txt','cause','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','ATTENDED','origtransfereruniqueid','transferid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','mohstarttime','[%s][voiceQueueReport][musiconholdstart]','syncMusicOnHoldStop','mohtime','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','toLowerCase','applicationdata','appdata','startsWith','cdr(','split','match','util','ioredis','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','localhost','socket.io-emitter','enqueue','tail','queueReports','agents','channels','voiceQueues','campaigns','queuesummary','queuesummarycomplete','syncQueueSummaryComplete','queuemember','syncQueueMember','bind','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','syncVarSet','hangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','unlockRR','queuecallerexit','queuecallercomplete','prototype','clearZombieChannels','sequence','status','channel','catch','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','variables','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','queue','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','emitInboundVoiceQueueSummary','type','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','Action','queues','[voiceQueueReport][queues]','summary','isRunning','then','actionid','queuestatus','[voiceQueueReport][queuesummary]','createQueueSummaryReport','name','summaryEvent','realtime','handleInboundQueueSummaryReport','compareToInboundQueue','outbound','custom:queuesummary','statusRequests','push','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','completeEvent','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','assign','pick','keys','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT'];(function(_0x3a7d31,_0x2edaa3){var _0xd99fcd=function(_0x3b4bb1){while(--_0x3b4bb1){_0x3a7d31['push'](_0x3a7d31['shift']());}};_0xd99fcd(++_0x2edaa3);}(_0x6f7f,0x159));var _0xf6f7=function(_0x19ebb8,_0x1e0cff){_0x19ebb8=_0x19ebb8-0x0;var _0x280a6d=_0x6f7f[_0x19ebb8];return _0x280a6d;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0xf6f7('0x0'));var Redis=require(_0xf6f7('0x1'));var config=require('../../../config/environment');var logger=require(_0xf6f7('0x2'))(_0xf6f7('0x3'));var ami=require(_0xf6f7('0x4'));var QueueReport=require(_0xf6f7('0x5'));var VoiceQueueSummary=require(_0xf6f7('0x6'));config[_0xf6f7('0x7')]=_[_0xf6f7('0x8')](config[_0xf6f7('0x7')],{'host':_0xf6f7('0x9'),'port':0x18eb});var io=require(_0xf6f7('0xa'))(new Redis(config['redis']));var Sequence=function(){};Sequence['prototype'][_0xf6f7('0xb')]=function(_0x4f5377){this[_0xf6f7('0xc')]=this['tail']?this[_0xf6f7('0xc')]['finally'](_0x4f5377):_0x4f5377();};function VoiceQueueReport(_0x2e982c){this['sequence']=new Sequence();this[_0xf6f7('0xd')]={};this['realtime']=_0x2e982c;this['agents']=_0x2e982c[_0xf6f7('0xe')];this[_0xf6f7('0xf')]=_0x2e982c['queueChannels'];this[_0xf6f7('0x10')]=_0x2e982c[_0xf6f7('0x10')];this['campaigns']=_0x2e982c[_0xf6f7('0x11')];this['summary']=initializeSummary();this['variables']={};ami['on'](_0xf6f7('0x12'),this['syncQueueSummary']['bind'](this));ami['on'](_0xf6f7('0x13'),this[_0xf6f7('0x14')]['bind'](this));ami['on'](_0xf6f7('0x15'),this[_0xf6f7('0x16')][_0xf6f7('0x17')](this));ami['on'](_0xf6f7('0x18'),this[_0xf6f7('0x19')][_0xf6f7('0x17')](this));ami['on'](_0xf6f7('0x1a'),this['syncQueueCallerJoin']['bind'](this));ami['on'](_0xf6f7('0x1b'),this[_0xf6f7('0x1c')]['bind'](this));ami['on'](_0xf6f7('0x1d'),this[_0xf6f7('0x1e')]['bind'](this));ami['on'](_0xf6f7('0x1f'),this[_0xf6f7('0x20')][_0xf6f7('0x17')](this));ami['on'](_0xf6f7('0x21'),this[_0xf6f7('0x22')]['bind'](this));ami['on']('varset',this[_0xf6f7('0x23')][_0xf6f7('0x17')](this));ami['on'](_0xf6f7('0x24'),this['syncHangup'][_0xf6f7('0x17')](this));ami['on'](_0xf6f7('0x25'),this[_0xf6f7('0x26')][_0xf6f7('0x17')](this));ami['on']('musiconholdstart',this[_0xf6f7('0x27')][_0xf6f7('0x17')](this));ami['on'](_0xf6f7('0x28'),this['syncMusicOnHoldStop'][_0xf6f7('0x17')](this));ami['on'](_0xf6f7('0x29'),this[_0xf6f7('0x2a')][_0xf6f7('0x17')](this));ami['on'](_0xf6f7('0x2b'),this[_0xf6f7('0x2c')]['bind'](this));this[_0xf6f7('0x2d')]();this[_0xf6f7('0x2e')]();}function clearChannels(_0x28e60d){if(!_[_0xf6f7('0x2f')](_0x28e60d)){for(var _0x2c3d7f in _0x28e60d){if(_0x28e60d[_0xf6f7('0x30')](_0x2c3d7f)){delete _0x28e60d[_0x2c3d7f];}}}}function clearCampaigns(_0xca0574){if(!_['isEmpty'](_0xca0574)){for(var _0x3a75c2 in _0xca0574){if(_0xca0574[_0xf6f7('0x30')](_0x3a75c2)){_0xca0574[_0x3a75c2][_0xf6f7('0x31')]=0x0;}}}}function clearVoiceQueues(_0x301ccc){if(!_[_0xf6f7('0x2f')](_0x301ccc)){for(var _0x52bcb3 in _0x301ccc){if(_0x301ccc[_0xf6f7('0x30')](_0x52bcb3)){_0x301ccc[_0x52bcb3]['originated']=0x0;_0x301ccc[_0x52bcb3]['talking']=0x0;_0x301ccc[_0x52bcb3][_0xf6f7('0x32')]=0x0;_0x301ccc[_0x52bcb3][_0xf6f7('0x33')]=0x0;_0x301ccc[_0x52bcb3][_0xf6f7('0x34')]=!![];}}}}function clearAgentBooked(_0x31eb86){if(!_['isEmpty'](_0x31eb86)){for(var _0x4927ef in _0x31eb86){if(_0x31eb86['hasOwnProperty'](_0x4927ef)){_0x31eb86[_0x4927ef][_0xf6f7('0x35')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0xe74dd6){return _0xe74dd6[_0xf6f7('0x36')]||_0xe74dd6['queuecallerabandon']||_0xe74dd6[_0xf6f7('0x37')];}VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x39')]=function(){var _0x278628=this;for(var _0x56386b in this[_0xf6f7('0xf')]){if(this[_0xf6f7('0xf')][_0xf6f7('0x30')](_0x56386b)&&!this[_0xf6f7('0xf')][_0x56386b]['switch']){this[_0xf6f7('0x3a')]['enqueue'](function(){if(!_['isNil'](_0x278628[_0xf6f7('0xf')][_0x56386b])){return ami['Action']({'action':_0xf6f7('0x3b'),'channel':_0x278628[_0xf6f7('0xf')][_0x56386b][_0xf6f7('0x3c')]})[_0xf6f7('0x3d')](function(_0x29c2a6){if(_0x29c2a6['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x278628[_0xf6f7('0xf')][_0x56386b]){delete _0x278628[_0xf6f7('0xf')][_0x56386b];logger[_0xf6f7('0x3e')](_0xf6f7('0x3f'),_0x56386b,util[_0xf6f7('0x40')](_0x29c2a6,{'showHidden':![],'depth':null}));}if(_0x278628[_0xf6f7('0xd')][_0x56386b]){delete _0x278628[_0xf6f7('0xd')][_0x56386b];logger[_0xf6f7('0x3e')](_0xf6f7('0x41'),_0x56386b,util['inspect'](_0x29c2a6,{'showHidden':![],'depth':null}));}if(_0x278628[_0xf6f7('0x42')][_0x56386b]){delete _0x278628[_0xf6f7('0x42')][_0x56386b];logger['error'](_0xf6f7('0x43'),_0x56386b,util[_0xf6f7('0x40')](_0x29c2a6,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x26')]=function(){logger['error'](_0xf6f7('0x44'));clearChannels(this[_0xf6f7('0xf')]);this['clearQueueReport'](this[_0xf6f7('0xd')]);clearAgentBooked(this[_0xf6f7('0xe')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this['campaigns']);this['summary']=initializeSummary();};VoiceQueueReport['prototype'][_0xf6f7('0x45')]=function(_0xd45bd3){var _0x49a01=this;if(!_[_0xf6f7('0x2f')](_0xd45bd3)){for(var _0x539dae in _0xd45bd3){if(_0xd45bd3['hasOwnProperty'](_0x539dae)){_0x49a01[_0xf6f7('0x46')](_0xd45bd3[_0x539dae],'clearqueuereport');delete _0xd45bd3[_0x539dae];}}}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x47')]=function(_0x52fbe8,_0x470e3f,_0xd04d65){io['to'](_0x52fbe8)[_0xf6f7('0x47')](_0x470e3f,_0xd04d65);};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x48')]=function(_0x343c30,_0x57ee51){logger[_0xf6f7('0x49')](_0xf6f7('0x4a')+_0x57ee51+_0xf6f7('0x4b'),_0x343c30[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x343c30,{'showHidden':![],'depth':null}));this[_0xf6f7('0x47')](util[_0xf6f7('0x4d')](_0xf6f7('0x4e'),_0x343c30[_0xf6f7('0x4f')]),'voice_queue_channel:save',_0x343c30);io[_0xf6f7('0x47')](_0xf6f7('0x50'),_0x343c30);};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x46')]=function(_0x2a51b2,_0x1b6f7e){logger[_0xf6f7('0x49')](_0xf6f7('0x4a')+_0x1b6f7e+_0xf6f7('0x51'),_0x2a51b2[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x2a51b2,{'showHidden':![],'depth':null}));if(_0x2a51b2[_0xf6f7('0x52')]===_0xf6f7('0x53')){return;}this[_0xf6f7('0x47')](util[_0xf6f7('0x4d')](_0xf6f7('0x4e'),_0x2a51b2[_0xf6f7('0x4f')]),_0xf6f7('0x54'),_0x2a51b2);io[_0xf6f7('0x47')]('voice_queue_presence:remove',_0x2a51b2);};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x55')]=function(_0x3afa17){if(_0x3afa17[_0xf6f7('0x56')]===_0xf6f7('0x57')){logger['debug'](_0xf6f7('0x58'),util[_0xf6f7('0x40')](_0x3afa17,{'showHidden':![],'depth':null}));this['emit'](util[_0xf6f7('0x4d')](_0xf6f7('0x4e'),_0x3afa17['name']),_0xf6f7('0x59'),_0x3afa17);}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x5a')]=function(_0x4b297a){return _0x4b297a!==null&&!_[_0xf6f7('0x5b')](_0x4b297a);};VoiceQueueReport['prototype']['loopQueueShow']=function(){var _0x316894=this;setInterval(function(){_0x316894[_0xf6f7('0x39')]();ami[_0xf6f7('0x5c')]({'action':_0xf6f7('0x5d')})['catch'](function(_0x2f2026){logger[_0xf6f7('0x3e')](_0xf6f7('0x5e'),util[_0xf6f7('0x40')](_0x2f2026,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x2d')]=function(){var _0x5b46a0=this;setInterval(function(){if(!_0x5b46a0[_0xf6f7('0x5f')][_0xf6f7('0x60')]){return ami[_0xf6f7('0x5c')]({'action':_0xf6f7('0x12')})[_0xf6f7('0x61')](function(_0x3de9ef){_0x5b46a0[_0xf6f7('0x5f')]['id']=_0x3de9ef[_0xf6f7('0x62')];_0x5b46a0[_0xf6f7('0x5f')]['isRunning']=!![];_0x5b46a0[_0xf6f7('0x5f')][_0xf6f7('0x63')][_0x3de9ef[_0xf6f7('0x62')]]={};})['catch'](function(_0x2d1748){logger[_0xf6f7('0x3e')](_0xf6f7('0x64'),util['inspect'](_0x2d1748,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x65')]=function(_0xa67cd7,_0x1a27fa){var _0x2e3270;if(this[_0xf6f7('0x5f')]&&this[_0xf6f7('0x5f')][_0xf6f7('0x5d')]&&this[_0xf6f7('0x5f')][_0xf6f7('0x5d')][_0xa67cd7[_0xf6f7('0x66')]]){_0x2e3270=this[_0xf6f7('0x5f')][_0xf6f7('0x5d')][_0xa67cd7[_0xf6f7('0x66')]][_0xf6f7('0x67')];}var _0x17aef9=new VoiceQueueSummary(_0xa67cd7);return _0x17aef9['createReport'](_0x1a27fa['agents'],this[_0xf6f7('0xe')],_0x2e3270,this[_0xf6f7('0x68')][_0xf6f7('0xf')]);};VoiceQueueReport['prototype'][_0xf6f7('0x69')]=function(_0x1800f6,_0x236f73){var _0x1ea4f9=this['createQueueSummaryReport'](_0x1800f6,_0x236f73);var _0x558491=![];_0x558491=_0x1ea4f9[_0xf6f7('0x6a')](_0x1800f6);if(_0x558491){Object['assign'](_0x1800f6,_0x1ea4f9);this['realtime']['voiceQueues'][_0x1800f6[_0xf6f7('0x66')]]=_0x1800f6;this[_0xf6f7('0x55')](_0x1ea4f9);}};VoiceQueueReport[_0xf6f7('0x38')]['syncQueueStatusComplete']=function(_0x181eae){var _0x2a8201=null;var _0x563804=this['summary']['id'];if(this[_0xf6f7('0x5f')][_0xf6f7('0x63')][_0x563804]){_0x2a8201=this[_0xf6f7('0x5f')]['queuestatus'][_0x563804][_0x181eae[_0xf6f7('0x62')]];}if(!_0x2a8201){this[_0xf6f7('0x5f')]=initializeSummary();return;}var _0x5c96c3=this[_0xf6f7('0x10')][_0x2a8201[_0xf6f7('0x4f')]];if(_0x5c96c3['type']==='inbound'){this['handleInboundQueueSummaryReport'](_0x5c96c3,_0x2a8201);}else if(_0x5c96c3['type']===_0xf6f7('0x6b')){var _0x22a2cf=this[_0xf6f7('0x65')](_0x5c96c3,_0x2a8201);ami['emit'](_0xf6f7('0x6c'),_0x22a2cf);}this[_0xf6f7('0x5f')]['statusRequests']-=0x1;var _0x12b5cc=this[_0xf6f7('0x5f')][_0xf6f7('0x6d')]>0x0?!![]:![];if(!_0x12b5cc){return this['syncQueueSummaryComplete'](this['summary']['completeEvent']);}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x16')]=function(_0x2f62a7){var _0x31529=this[_0xf6f7('0x5f')]['id'];if(this['summary'][_0xf6f7('0x63')][_0x31529]&&this['summary']['queuestatus'][_0x31529][_0x2f62a7[_0xf6f7('0x62')]]){this[_0xf6f7('0x5f')]['queuestatus'][_0x31529][_0x2f62a7['actionid']]['agents'][_0xf6f7('0x6e')](_0x2f62a7);}};VoiceQueueReport[_0xf6f7('0x38')]['syncQueueSummary']=function(_0x8727b7){var _0x11ab00=this;try{if(this[_0xf6f7('0x5a')](_0x8727b7)&&this['isNotNull'](_0x8727b7[_0xf6f7('0x4f')])){logger['debug'](_0xf6f7('0x6f'),util[_0xf6f7('0x40')](_0x8727b7,{'showHidden':![],'depth':null}));var _0x57a7ac=this['voiceQueues'][_0x8727b7[_0xf6f7('0x4f')]];if(_0x57a7ac){logger[_0xf6f7('0x49')](_0xf6f7('0x70'),_0x57a7ac['name']);this[_0xf6f7('0x5f')][_0xf6f7('0x5d')][_0x57a7ac[_0xf6f7('0x66')]]={'summaryEvent':_0x8727b7};this[_0xf6f7('0x5f')][_0xf6f7('0x6d')]+=0x1;return ami['Action']({'action':_0xf6f7('0x63'),'queue':_0x57a7ac[_0xf6f7('0x66')]})[_0xf6f7('0x61')](function(_0x3a0ae1){if(!_0x11ab00['summary']['queuestatus'][_0x8727b7[_0xf6f7('0x62')]]){_0x11ab00['summary'][_0xf6f7('0x63')][_0x8727b7[_0xf6f7('0x62')]]={};}_0x11ab00[_0xf6f7('0x5f')][_0xf6f7('0x63')][_0x8727b7[_0xf6f7('0x62')]][_0x3a0ae1[_0xf6f7('0x62')]]={'queue':_0x57a7ac[_0xf6f7('0x66')],'agents':[]};})['catch'](function(_0x530012){throw _0x530012;});}}}catch(_0x53e6a5){logger[_0xf6f7('0x3e')](_0xf6f7('0x64'),util[_0xf6f7('0x40')](_0x53e6a5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x14')]=function(_0x330358){if(this[_0xf6f7('0x5f')][_0xf6f7('0x6d')]>0x0){this[_0xf6f7('0x5f')][_0xf6f7('0x71')]=_0x330358;return;}logger[_0xf6f7('0x49')](_0xf6f7('0x72'),util['inspect'](_0x330358,{'showHidden':![],'depth':null}));this[_0xf6f7('0x5f')]=initializeSummary();ami[_0xf6f7('0x47')](_0xf6f7('0x73'),{});};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x425d20){try{if(this['isNotNull'](_0x425d20)){logger[_0xf6f7('0x49')]('[%s][voiceQueueReport][queuecallerjoin]',_0x425d20[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x425d20,{'showHidden':![],'depth':null}));if(_[_0xf6f7('0x5b')](this['queueReports'][_0x425d20[_0xf6f7('0x4c')]])){this[_0xf6f7('0xd')][_0x425d20[_0xf6f7('0x4c')]]=[];}if(_[_0xf6f7('0x5b')](this[_0xf6f7('0xf')][_0x425d20[_0xf6f7('0x4c')]])){this['channels'][_0x425d20[_0xf6f7('0x4c')]]={};}var _0x1f8c90=new QueueReport();_0x1f8c90[_0xf6f7('0x4f')]=_0x425d20[_0xf6f7('0x4f')];_0x1f8c90[_0xf6f7('0x56')]=this[_0xf6f7('0x10')][_0x1f8c90[_0xf6f7('0x4f')]]&&this['voiceQueues'][_0x1f8c90['queue']]['type']?this[_0xf6f7('0x10')][_0x1f8c90[_0xf6f7('0x4f')]][_0xf6f7('0x56')]||'inbound':_0xf6f7('0x57');_0x1f8c90['queuecallerjoinAt']=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));_0x1f8c90[_0xf6f7('0x75')]=_0x425d20[_0xf6f7('0x75')];_0x1f8c90[_0xf6f7('0x76')]=_0x425d20[_0xf6f7('0x76')];_0x1f8c90[_0xf6f7('0x4c')]=_0x425d20['uniqueid'];_0x1f8c90[_0xf6f7('0x77')]=this[_0xf6f7('0xf')][_0x425d20['uniqueid']][_0xf6f7('0x77')];logger[_0xf6f7('0x78')](_0xf6f7('0x79'),_0x1f8c90[_0xf6f7('0x4f')],_0x1f8c90[_0xf6f7('0x56')]);Object[_0xf6f7('0x7a')](_0x1f8c90,_[_0xf6f7('0x7b')](_0x425d20,_[_0xf6f7('0x7c')](_0x1f8c90)));this[_0xf6f7('0xd')][_0x425d20[_0xf6f7('0x4c')]][_0xf6f7('0x6e')](_0x1f8c90);this[_0xf6f7('0xf')][_0x425d20[_0xf6f7('0x4c')]]=_0x1f8c90;this['emitVoiceQueueChannelSave'](_0x1f8c90,_0xf6f7('0x1a'));}}catch(_0x57ea7f){logger[_0xf6f7('0x3e')](_0xf6f7('0x7d'),_0x425d20[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x57ea7f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x1c')]=function(_0x564c6a){try{if(this[_0xf6f7('0x5a')](_0x564c6a)){logger[_0xf6f7('0x49')](_0xf6f7('0x7e'),_0x564c6a[_0xf6f7('0x4c')],util['inspect'](_0x564c6a,{'showHidden':![],'depth':null}));if(this[_0xf6f7('0xd')][_0x564c6a[_0xf6f7('0x4c')]]){var _0x4de57e=_[_0xf6f7('0x7f')](this['queueReports'][_0x564c6a[_0xf6f7('0x4c')]]);_0x4de57e[_0xf6f7('0x37')]=![];_0x4de57e[_0xf6f7('0x80')]=null;_0x4de57e['holdtime']=_0x564c6a[_0xf6f7('0x81')];_0x4de57e[_0xf6f7('0x82')]=_0x564c6a['originalposition'];_0x4de57e[_0xf6f7('0x1b')]=!![];_0x4de57e[_0xf6f7('0x83')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4de57e['queuecallerexitreason']=_0xf6f7('0x84');_0x4de57e[_0xf6f7('0x85')]=null;logger[_0xf6f7('0x78')](_0xf6f7('0x86'),_0x4de57e[_0xf6f7('0x4f')],_0x4de57e['type']);this[_0xf6f7('0xf')][_0x564c6a[_0xf6f7('0x4c')]]=_0x4de57e;this[_0xf6f7('0x46')](_0x4de57e,'queuecallerabandon');}}}catch(_0x39205d){logger[_0xf6f7('0x3e')](_0xf6f7('0x7e'),_0x564c6a[_0xf6f7('0x4c')],util['inspect'](_0x39205d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x1e')]=function(_0x1be53d){try{if(this[_0xf6f7('0x5a')](_0x1be53d)){logger['debug'](_0xf6f7('0x87'),_0x1be53d[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x1be53d,{'showHidden':![],'depth':null}));if(this[_0xf6f7('0xd')][_0x1be53d['uniqueid']]){var _0xde7a6a=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x1be53d[_0xf6f7('0x4c')]]);_0xde7a6a[_0xf6f7('0x88')]=moment()['format'](_0xf6f7('0x74'));_0xde7a6a['connectedlinenum']=_0x1be53d['connectedlinenum'];_0xde7a6a['connectedlinename']=_0x1be53d[_0xf6f7('0x89')];logger[_0xf6f7('0x78')](_0xf6f7('0x8a'),_0xde7a6a[_0xf6f7('0x4f')],_0xde7a6a[_0xf6f7('0x56')],_0x1be53d[_0xf6f7('0x8b')],_0x1be53d[_0xf6f7('0x89')]);this[_0xf6f7('0xf')][_0x1be53d[_0xf6f7('0x4c')]]=_0xde7a6a;this[_0xf6f7('0x48')](_0xde7a6a,'queuecallerleave');}}}catch(_0x59e8a6){logger[_0xf6f7('0x3e')](_0xf6f7('0x87'),_0x1be53d[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x59e8a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf6f7('0x22')]=function(_0x2996ff){try{if(this[_0xf6f7('0x5a')](_0x2996ff)){logger[_0xf6f7('0x49')](_0xf6f7('0x8c'),_0x2996ff[_0xf6f7('0x4c')],util['inspect'](_0x2996ff,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2996ff['uniqueid']]){var _0x5bf8d5=_['last'](this[_0xf6f7('0xd')][_0x2996ff[_0xf6f7('0x4c')]]);_0x5bf8d5[_0xf6f7('0x37')]=!![];_0x5bf8d5[_0xf6f7('0x52')]=_0xf6f7('0x8d');logger[_0xf6f7('0x78')](_0xf6f7('0x8e'),_0x5bf8d5[_0xf6f7('0x4f')],_0x5bf8d5['type']);}}}catch(_0x273007){logger[_0xf6f7('0x3e')]('[%s][voiceQueueReport][agentconnect]',_0x2996ff[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x273007,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf6f7('0x20')]=function(_0x371565){try{if(this[_0xf6f7('0x5a')](_0x371565)){logger[_0xf6f7('0x49')]('[%s][voiceQueueReport][agentcomplete]',_0x371565[_0xf6f7('0x4c')],util['inspect'](_0x371565,{'showHidden':![],'depth':null}));if(this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x4c')]]){var _0x5af29b=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x4c')]]);_0x5af29b['queuecallerabandon']=![];_0x5af29b[_0xf6f7('0x83')]=null;_0x5af29b[_0xf6f7('0x8f')]=!![];_0x5af29b[_0xf6f7('0x85')]=_0x371565[_0xf6f7('0x90')];_0x5af29b[_0xf6f7('0x81')]=_0x371565[_0xf6f7('0x81')];_0x5af29b[_0xf6f7('0x37')]=!![];_0x5af29b[_0xf6f7('0x36')]=![];_0x5af29b[_0xf6f7('0x91')]=null;if(!_0x5af29b['transfer']){if(_0x371565['reason']==_0xf6f7('0x92')){_0x5af29b[_0xf6f7('0x52')]=_0xf6f7('0x93');logger[_0xf6f7('0x78')](_0xf6f7('0x94'),_0x5af29b[_0xf6f7('0x4f')],_0x5af29b[_0xf6f7('0x56')]);}else{if(_['startsWith'](_0x371565[_0xf6f7('0x3c')]['toLowerCase'](),_0xf6f7('0x95'))){if(this[_0xf6f7('0xd')][_0x371565['linkedid']]){var _0x25dfff=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x371565['linkedid']]);_0x25dfff[_0xf6f7('0x37')]=![];_0x25dfff['queuecallerexit']=!![];_0x25dfff[_0xf6f7('0x91')]=moment(_0x5af29b['queuecallerjoinAt'])['add'](_0x371565[_0xf6f7('0x81')],_0xf6f7('0x96'))[_0xf6f7('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x25dfff[_0xf6f7('0x52')]=_0xf6f7('0x97');_0x25dfff[_0xf6f7('0x92')]=!![];_0x25dfff[_0xf6f7('0x98')]=_0xf6f7('0x99');_0x25dfff['transferexten']=_0x371565[_0xf6f7('0x9a')];_0x25dfff[_0xf6f7('0x9b')]=_0x371565[_0xf6f7('0x4c')];logger[_0xf6f7('0x78')](_0xf6f7('0x9c'),_0x25dfff[_0xf6f7('0x4f')],_0x25dfff[_0xf6f7('0x56')]);var _0x1b2776=this[_0xf6f7('0xd')][_0x371565['linkedid']];this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x9d')]]=this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x4c')]];this[_0xf6f7('0xd')][_0x371565[_0xf6f7('0x4c')]]=_0x1b2776;}}else{_0x5af29b[_0xf6f7('0x52')]=_0xf6f7('0x9e')+_0x371565[_0xf6f7('0x9f')]['toUpperCase']();logger[_0xf6f7('0x78')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x5af29b[_0xf6f7('0x4f')],_0x5af29b[_0xf6f7('0x56')],_0x5af29b['queuecallerexitreason']);}}}this[_0xf6f7('0xf')][_0x371565['uniqueid']]=_0x5af29b;}}}catch(_0x8ed821){logger['error'](_0xf6f7('0xa0'),_0x371565[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x8ed821,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf6f7('0x23')]=function(_0x4aad8b){try{if(this[_0xf6f7('0x5a')](_0x4aad8b)){logger['debug'](_0xf6f7('0xa1'),_0x4aad8b[_0xf6f7('0x4c')],util['inspect'](_0x4aad8b,{'showHidden':![],'depth':null}));this[_0xf6f7('0xa2')](_0x4aad8b[_0xf6f7('0x4c')],_['keys'](_0x4aad8b[_0xf6f7('0xa3')])[0x0],_0x4aad8b[_0xf6f7('0xa4')]);if(this[_0xf6f7('0xd')][_0x4aad8b[_0xf6f7('0x4c')]]){var _0x13fd86=_['last'](this[_0xf6f7('0xd')][_0x4aad8b[_0xf6f7('0x4c')]]);if(_0x13fd86){if(this[_0xf6f7('0x5a')](_0x4aad8b[_0xf6f7('0xa3')])&&this[_0xf6f7('0x5a')](_0x4aad8b['variable'][_0xf6f7('0x63')])){switch(_0x4aad8b[_0xf6f7('0xa4')]){case'CONTINUE':_0x13fd86['queuecallerexit']=![];_0x13fd86[_0xf6f7('0x91')]=null;break;case _0xf6f7('0xa5'):_0x13fd86[_0xf6f7('0xa6')]=_0xf6f7('0xa7');_0x13fd86[_0xf6f7('0x36')]=!![];_0x13fd86[_0xf6f7('0x91')]=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));_0x13fd86['queuecallerleaveAt']=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));logger[_0xf6f7('0x49')](_0xf6f7('0xa8'),_0x4aad8b[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x13fd86,{'showHidden':![],'depth':null}));ami[_0xf6f7('0x47')](_0xf6f7('0xa9'),_0x13fd86);break;default:_0x13fd86[_0xf6f7('0x36')]=!![];_0x13fd86[_0xf6f7('0x91')]=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));_0x13fd86[_0xf6f7('0x88')]=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));}_0x13fd86['queuecallerabandon']=![];_0x13fd86['queuecallerabandonAt']=null;_0x13fd86['queuecallerexitreason']=_0x4aad8b[_0xf6f7('0xa4')];this[_0xf6f7('0xf')][_0x4aad8b[_0xf6f7('0x4c')]]=_0x13fd86;this[_0xf6f7('0x46')](_0x13fd86,_0xf6f7('0xaa'));}else if(this[_0xf6f7('0x5a')](_0x4aad8b[_0xf6f7('0xa3')])&&this['isNotNull'](_0x4aad8b[_0xf6f7('0xa3')][_0xf6f7('0xab')])){if(!_0x13fd86[_0xf6f7('0x1b')]){_0x13fd86[_0xf6f7('0x36')]=!![];_0x13fd86[_0xf6f7('0x91')]=moment()['format'](_0xf6f7('0x74'));_0x13fd86[_0xf6f7('0x52')]=_0xf6f7('0xac');_0x13fd86['queuecallerleaveAt']=moment()['format'](_0xf6f7('0x74'));this['channels'][_0x4aad8b[_0xf6f7('0x4c')]]=_0x13fd86;}}logger[_0xf6f7('0x78')](_0xf6f7('0xad'),_0x4aad8b[_0xf6f7('0x4c')],_0x13fd86[_0xf6f7('0x4f')],_0x13fd86[_0xf6f7('0x56')],_[_0xf6f7('0x7c')](_0x4aad8b['variable'])[0x0],_0x4aad8b['value']);_0x13fd86[_0xf6f7('0x42')]=this[_0xf6f7('0x42')][_0x4aad8b['uniqueid']];}}}}catch(_0x44ffef){logger[_0xf6f7('0x3e')](_0xf6f7('0xa1'),_0x4aad8b[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x44ffef,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')]['addVariable']=function(_0x3dbe71,_0x14463a,_0x1d4ddb){var _0x51072f=[_0xf6f7('0xae'),_0xf6f7('0xaf'),_0xf6f7('0xb0'),_0xf6f7('0xb1'),_0xf6f7('0xb2'),_0xf6f7('0xb3'),_0xf6f7('0xb4'),_0xf6f7('0xb5'),'sipcallid',_0xf6f7('0xb6'),'bridgepeer',_0xf6f7('0xb7'),_0xf6f7('0xb8'),_0xf6f7('0xb9'),_0xf6f7('0xba'),_0xf6f7('0xbb'),_0xf6f7('0x90'),_0xf6f7('0xbc'),_0xf6f7('0xbd')];if(!_[_0xf6f7('0xbe')](_0x14463a)&&!_[_0xf6f7('0xbf')](_0x51072f,_0x14463a)){if(_[_0xf6f7('0x5b')](this[_0xf6f7('0x42')][_0x3dbe71])){this[_0xf6f7('0x42')][_0x3dbe71]={};}this[_0xf6f7('0x42')][_0x3dbe71][_0x14463a]=_0x1d4ddb;}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0xc0')]=function(_0x1b0839,_0x2ec4df,_0x51001e){try{var _0x4b8fcd={};if(this['queueReports'][_0x1b0839]){for(var _0xb2616=0x0;_0xb2616<this[_0xf6f7('0xd')][_0x1b0839][_0xf6f7('0xc1')];_0xb2616+=0x1){_0x4b8fcd=this[_0xf6f7('0xd')][_0x1b0839][_0xb2616];var _0x373407=this[_0xf6f7('0x10')][_0x4b8fcd['queue']];if(_0x373407){_0x373407[_0xf6f7('0xc2')]+=moment(_0x4b8fcd['queuecallerleaveAt'])[_0xf6f7('0xc3')](_0x4b8fcd[_0xf6f7('0xc4')],_0xf6f7('0x96'))||0x0;if(_0x51001e&&_0x4b8fcd[_0xf6f7('0x52')]==='ATTENDEDTRANSFER'){_0x4b8fcd[_0xf6f7('0x52')]=_0xf6f7('0x8d');}if(_0xb2616===this[_0xf6f7('0xd')][_0x1b0839][_0xf6f7('0xc1')]-0x1){_0x373407['sumDuration']+=moment()[_0xf6f7('0xc5')](0x0)[_0xf6f7('0xc3')](_0x4b8fcd['queuecallerjoinAt'],_0xf6f7('0x96'));if(hasCallerLeftTheQueue(_0x4b8fcd)&&_0x4b8fcd[_0xf6f7('0x52')]!=='ATTENDEDTRANSFER'){_0x373407[_0xf6f7('0xc6')]+=0x1;}if(_0x4b8fcd['queuecallercomplete']){_0x373407[_0xf6f7('0xc7')]+=0x1;_0x373407[_0xf6f7('0xc8')]+=moment()[_0xf6f7('0xc5')](0x0)[_0xf6f7('0xc3')](_0x4b8fcd[_0xf6f7('0x88')],_0xf6f7('0x96'));_0x4b8fcd[_0xf6f7('0x80')]=moment()[_0xf6f7('0x4d')](_0xf6f7('0x74'));_0x4b8fcd[_0xf6f7('0x36')]=![];_0x4b8fcd[_0xf6f7('0x91')]=null;}if(_0x4b8fcd[_0xf6f7('0x36')]&&_0x4b8fcd[_0xf6f7('0x92')]!=!![]){_0x373407[_0xf6f7('0xc9')]+=0x1;_0x4b8fcd[_0xf6f7('0xa6')]='unmanaged';logger[_0xf6f7('0x49')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x1b0839,util[_0xf6f7('0x40')](_0x4b8fcd,{'showHidden':![],'depth':null}));ami[_0xf6f7('0x47')]('custom:queuecallerunmanaged',_0x4b8fcd);}if(_0x4b8fcd[_0xf6f7('0x1b')]){_0x373407[_0xf6f7('0xca')]+=0x1;_0x4b8fcd[_0xf6f7('0xa6')]=_0xf6f7('0xca');logger[_0xf6f7('0x49')](_0xf6f7('0xcb'),_0x1b0839,util[_0xf6f7('0x40')](_0x4b8fcd,{'showHidden':![],'depth':null}));ami[_0xf6f7('0x47')]('custom:queuecallerabandon',_0x4b8fcd);}}else{_0x373407[_0xf6f7('0xcc')]+=_0x373407[_0xf6f7('0xc2')];}logger[_0xf6f7('0x78')](_0xf6f7('0xcd'),_0x1b0839,_0x4b8fcd[_0xf6f7('0x4f')],_0x4b8fcd[_0xf6f7('0x56')],_0x2ec4df);this[_0xf6f7('0xf')][_0x1b0839]=_0x4b8fcd;Object[_0xf6f7('0x7a')](this[_0xf6f7('0x10')][_0x4b8fcd[_0xf6f7('0x4f')]],_0x373407);if(_0x4b8fcd[_0xf6f7('0x88')]){this[_0xf6f7('0x46')](_0x4b8fcd,_0xf6f7('0x24'));}}}logger[_0xf6f7('0x49')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x1b0839,util[_0xf6f7('0x40')](this[_0xf6f7('0xd')][_0x1b0839],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x4b8fcd)&&_0x4b8fcd[_0xf6f7('0x52')]!==_0xf6f7('0x53')){ami[_0xf6f7('0x47')](_0xf6f7('0xce'),this[_0xf6f7('0xd')][_0x1b0839]);if(this[_0xf6f7('0xd')][_0x1b0839]){delete this[_0xf6f7('0xd')][_0x1b0839];}if(this[_0xf6f7('0xf')][_0x1b0839]){delete this[_0xf6f7('0xf')][_0x1b0839];}if(this['variables'][_0x1b0839]){delete this['variables'][_0x1b0839];}}}}catch(_0x3166d6){logger[_0xf6f7('0x3e')](_0xf6f7('0xcf'),_0x1b0839,util['inspect'](_0x3166d6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0xd0')]=function(_0x86fb8f){try{if(this[_0xf6f7('0x5a')](_0x86fb8f)){logger[_0xf6f7('0x49')](_0xf6f7('0xd1'),_0x86fb8f[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x86fb8f,{'showHidden':![],'depth':null}));if(this[_0xf6f7('0xd')][_0x86fb8f['uniqueid']]){return this[_0xf6f7('0xc0')](_0x86fb8f[_0xf6f7('0x4c')],_0x86fb8f[_0xf6f7('0xd2')],![]);}if(this[_0xf6f7('0xd')][_0x86fb8f['linkedid']]){if(_0x86fb8f[_0xf6f7('0xd3')]==='21'){return;}return this['handleHangup'](_0x86fb8f[_0xf6f7('0x9d')],_0x86fb8f[_0xf6f7('0xd2')],!![]);}var _0x49bcd5=Object[_0xf6f7('0x7c')](this[_0xf6f7('0xd')]);for(var _0x4f270e=0x0;_0x4f270e<_0x49bcd5[_0xf6f7('0xc1')];_0x4f270e++){var _0x9a2def=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x49bcd5[_0x4f270e]]);if(_0x9a2def&&_0x9a2def['transferid']===_0x86fb8f[_0xf6f7('0x4c')]){return this[_0xf6f7('0xc0')](_0x9a2def[_0xf6f7('0x4c')],_0x86fb8f[_0xf6f7('0xd2')],!![]);}}if(!this['queueReports'][_0x86fb8f['uniqueid']]){logger[_0xf6f7('0x49')](_0xf6f7('0xd4'),_0x86fb8f[_0xf6f7('0x4c')]);if(this[_0xf6f7('0xf')][_0x86fb8f[_0xf6f7('0x4c')]]){delete this['channels'][_0x86fb8f[_0xf6f7('0x4c')]];}if(this[_0xf6f7('0x42')][_0x86fb8f[_0xf6f7('0x4c')]]){delete this[_0xf6f7('0x42')][_0x86fb8f[_0xf6f7('0x4c')]];}}}}catch(_0xa7b63e){logger[_0xf6f7('0x3e')]('[%s][voiceQueueReport][hangup]',_0x86fb8f[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0xa7b63e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x2a')]=function(_0x20e2e1){try{if(this['isNotNull'](_0x20e2e1)){logger['debug'](_0xf6f7('0xd5'),_0x20e2e1[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x20e2e1,{'showHidden':![],'depth':null}));var _0x4fa2d8;var _0x53da8e;var _0x3e2377;if(this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xd6')]]){_0x4fa2d8=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xd6')]]);_0x4fa2d8[_0xf6f7('0xd7')]=_0x20e2e1[_0xf6f7('0xd8')];_0x4fa2d8[_0xf6f7('0x9b')]=_0x20e2e1[_0xf6f7('0xd9')];_0x4fa2d8[_0xf6f7('0x52')]='ATTENDEDTRANSFER';_0x4fa2d8[_0xf6f7('0x92')]=!![];_0x4fa2d8[_0xf6f7('0x98')]='ATTENDED';if(this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xd9')]]){_0x3e2377=this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xd9')]];this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xd9')]]=this['queueReports'][_0x20e2e1[_0xf6f7('0xd6')]];this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xd6')]]=_0x3e2377;_0x53da8e=_['last'](this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xd6')]]);_0x53da8e[_0xf6f7('0xda')]=!![];}logger[_0xf6f7('0x78')](_0xf6f7('0xdb'),_0x20e2e1[_0xf6f7('0x4c')],_0x4fa2d8[_0xf6f7('0x4f')],_0x4fa2d8['type'],_0x4fa2d8[_0xf6f7('0xd7')],_0x4fa2d8[_0xf6f7('0x9b')]);}else if(this['queueReports'][_0x20e2e1['transfertargetuniqueid']]){_0x4fa2d8=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xdc')]]);_0x4fa2d8[_0xf6f7('0xd7')]=_0x20e2e1[_0xf6f7('0xdd')];_0x4fa2d8[_0xf6f7('0x9b')]=_0x20e2e1['origtransfereruniqueid'];_0x4fa2d8[_0xf6f7('0x52')]=_0xf6f7('0x53');_0x4fa2d8[_0xf6f7('0x92')]=!![];_0x4fa2d8['transfertype']=_0xf6f7('0xde');if(this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xdf')]]){_0x3e2377=this[_0xf6f7('0xd')][_0x20e2e1['origtransfereruniqueid']];this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xdf')]]=this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xdc')]];this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xdc')]]=_0x3e2377;_0x53da8e=_[_0xf6f7('0x7f')](this['queueReports'][_0x20e2e1[_0xf6f7('0xdc')]]);_0x53da8e[_0xf6f7('0xda')]=!![];}logger[_0xf6f7('0x78')](_0xf6f7('0xdb'),_0x20e2e1[_0xf6f7('0x4c')],_0x4fa2d8[_0xf6f7('0x4f')],_0x4fa2d8[_0xf6f7('0x56')],_0x4fa2d8[_0xf6f7('0xd7')],_0x4fa2d8[_0xf6f7('0x9b')]);}else if(this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xdf')]]){_0x4fa2d8=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xdf')]]);_0x4fa2d8[_0xf6f7('0xd7')]=_0x20e2e1[_0xf6f7('0xdd')];_0x4fa2d8[_0xf6f7('0x9b')]=_0x20e2e1['origtransfereruniqueid'];_0x4fa2d8[_0xf6f7('0x52')]=_0xf6f7('0x53');_0x4fa2d8[_0xf6f7('0x92')]=!![];_0x4fa2d8[_0xf6f7('0x98')]=_0xf6f7('0xde');_0x4fa2d8[_0xf6f7('0xda')]=!![];_0x4fa2d8[_0xf6f7('0xe0')]=_0x20e2e1[_0xf6f7('0xd6')];}else if(this[_0xf6f7('0xd')][_0x20e2e1['secondtransfereruniqueid']]){_0x4fa2d8=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x20e2e1[_0xf6f7('0xd9')]]);_0x4fa2d8[_0xf6f7('0xd7')]=_0x20e2e1[_0xf6f7('0xd8')];_0x4fa2d8[_0xf6f7('0x9b')]=_0x20e2e1['secondtransfereruniqueid'];_0x4fa2d8[_0xf6f7('0x52')]=_0xf6f7('0x53');_0x4fa2d8[_0xf6f7('0x92')]=!![];_0x4fa2d8['transfertype']=_0xf6f7('0xde');_0x4fa2d8[_0xf6f7('0xda')]=!![];_0x4fa2d8[_0xf6f7('0xe0')]=_0x20e2e1[_0xf6f7('0xdc')];}}}catch(_0x8cbd0a){logger[_0xf6f7('0x3e')](_0xf6f7('0xd5'),_0x20e2e1[_0xf6f7('0x4c')],util['inspect'](_0x8cbd0a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x2c')]=function(_0x383f68){try{if(this[_0xf6f7('0x5a')](_0x383f68)){logger['debug'](_0xf6f7('0xe1'),_0x383f68[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x383f68,{'showHidden':![],'depth':null}));if(this[_0xf6f7('0xd')][_0x383f68[_0xf6f7('0xd6')]]){var _0x54f75f=_['last'](this[_0xf6f7('0xd')][_0x383f68['transfereeuniqueid']]);_0x54f75f[_0xf6f7('0x52')]=_0xf6f7('0xe2');_0x54f75f['transfer']=!![];_0x54f75f[_0xf6f7('0x98')]='BLIND';_0x54f75f[_0xf6f7('0xd7')]=_0x383f68[_0xf6f7('0xe3')];_0x54f75f[_0xf6f7('0x9b')]=_0x383f68['transfereeuniqueid'];logger[_0xf6f7('0x78')](_0xf6f7('0xe4'),_0x383f68[_0xf6f7('0x4c')],_0x54f75f['queue'],_0x54f75f['type'],_0x54f75f[_0xf6f7('0xd7')],_0x54f75f[_0xf6f7('0x9b')]);this[_0xf6f7('0xd0')]({'event':'BlindTransfer','uniqueid':_0x383f68[_0xf6f7('0xd6')],'context':_0x383f68[_0xf6f7('0xe5')],'channel':_0x383f68['transfererchannel']});}}}catch(_0x1f5ab6){logger[_0xf6f7('0x3e')](_0xf6f7('0xe1'),_0x383f68['uniqueid'],util[_0xf6f7('0x40')](_0x1f5ab6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0x27')]=function(_0x4e9eda){try{if(this[_0xf6f7('0x5a')](_0x4e9eda)){logger['debug']('[%s][voiceQueueReport][musiconholdstart]',_0x4e9eda[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x4e9eda,{'showHidden':![],'depth':null}));if(this[_0xf6f7('0xd')][_0x4e9eda[_0xf6f7('0x4c')]]){var _0x2ae9b4=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x4e9eda[_0xf6f7('0x4c')]]);if(!_['isNil'](_0x2ae9b4[_0xf6f7('0x88')])){_0x2ae9b4[_0xf6f7('0xe6')]=moment()['format'](_0xf6f7('0x74'));logger['info']('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x4e9eda[_0xf6f7('0x4c')],_0x2ae9b4[_0xf6f7('0xe6')]);}}}}catch(_0x1020e4){logger['error'](_0xf6f7('0xe7'),_0x4e9eda[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x1020e4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0xe8')]=function(_0x9ff121){try{if(this[_0xf6f7('0x5a')](_0x9ff121)){logger['debug']('[%s][voiceQueueReport][musiconholdstop]',_0x9ff121['uniqueid'],util[_0xf6f7('0x40')](_0x9ff121,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x9ff121[_0xf6f7('0x4c')]]){var _0xa22915=_[_0xf6f7('0x7f')](this[_0xf6f7('0xd')][_0x9ff121[_0xf6f7('0x4c')]]);if(!_[_0xf6f7('0xbe')](_0xa22915['mohstarttime'])){_0xa22915[_0xf6f7('0xe9')]+=moment()[_0xf6f7('0xc5')](0x0)[_0xf6f7('0xc3')](_0xa22915[_0xf6f7('0xe6')],_0xf6f7('0x96'));logger[_0xf6f7('0x78')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x9ff121['uniqueid'],_0xa22915[_0xf6f7('0xe9')]);delete _0xa22915['mohstarttime'];}}}}catch(_0x3389d8){logger['error']('[%s][voiceQueueReport][musiconholdstop]',_0x9ff121[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x3389d8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf6f7('0x38')][_0xf6f7('0xea')]=function(_0x113594){try{if(this[_0xf6f7('0x5a')](_0x113594)){logger[_0xf6f7('0x49')](_0xf6f7('0xeb'),_0x113594[_0xf6f7('0x4c')],util[_0xf6f7('0x40')](_0x113594,{'showHidden':![],'depth':null}));if(_0x113594[_0xf6f7('0xec')][_0xf6f7('0xed')]()==='set'){_0x113594[_0xf6f7('0xee')]=_0x113594[_0xf6f7('0xef')]&&_0x113594['appdata']['startsWith']('CDR(routeAlias)')?_0x113594['appdata']:(_0x113594[_0xf6f7('0xef')]||_0x113594[_0xf6f7('0xee')])[_0xf6f7('0xed')]();if(_[_0xf6f7('0xf0')](_0x113594['applicationdata']['toLowerCase'](),_0xf6f7('0xf1'))){logger[_0xf6f7('0x78')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x113594[_0xf6f7('0x4c')],_0x113594[_0xf6f7('0xec')],_0x113594[_0xf6f7('0xee')]);if(_['isUndefined'](this[_0xf6f7('0xf')][_0x113594['uniqueid']]))this[_0xf6f7('0xf')][_0x113594[_0xf6f7('0x4c')]]={};var _0x16698d=_0x113594[_0xf6f7('0xee')][_0xf6f7('0xf2')]('=');var _0x4b67df=_0x16698d[0x0][_0xf6f7('0xed')]()[_0xf6f7('0xf3')](/cdr\((.*)\)/);if(_0x4b67df)this[_0xf6f7('0xf')][_0x113594['uniqueid']][_0x4b67df[0x1]]=_0x16698d[0x1];}}}}catch(_0x8aadbc){logger[_0xf6f7('0x3e')]('[%s][voiceQueueReport][newexten]',_0x113594['uniqueid'],util['inspect'](_0x8aadbc,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file