Built motion from commit 97153652.|2.6.26
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index 67342b4..15e1889 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xcd56=[']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','queue','voice_queue_channel:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','format','voice_queue_channel:remove','voice_queue_presence:remove','type','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isUndefined','queues','catch','[voiceQueueReport][queues]','isRunning','then','actionid','queuestatus','[voiceQueueReport][queuesummary]','createReport','handleInboundQueueSummaryReport','createQueueSummaryReport','compareToInboundQueue','assign','emitInboundVoiceQueueSummary','outbound','custom:queuesummary','statusRequests','completeEvent','push','isNotNull','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','keys','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','emitVoiceQueueChannelRemove','syncQueueCallerLeave','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][queuecallerleave]','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','add','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','syncVarSet','addVariable','variable','value','CONTINUE','TIMEOUT','lastevent','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queuecallerabandonAt','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','handleHangup','length','sumHoldTime','seconds','sumDuration','milliseconds','diff','ATTENDEDTRANSFER','total','answered','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','cause','cause-txt','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','ATTENDED','origtransfereruniqueid','transferid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','[%s][voiceQueueReport][musiconholdstart]','syncMusicOnHoldStop','isNil','mohstarttime','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','util','../../../config/logger','../ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','realtime','agents','channels','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','hangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','queueStatusComplete','queuecallercomplete','clearZombieChannels','Action','channel','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','queueReports','[%s][voiceQueueReport][checkQueueReport]','inspect','clearQueueReport','summary','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport]['];(function(_0xe7f5d6,_0x5d191c){var _0x146e0b=function(_0x1f2c8a){while(--_0x1f2c8a){_0xe7f5d6['push'](_0xe7f5d6['shift']());}};_0x146e0b(++_0x5d191c);}(_0xcd56,0xb4));var _0x6cd5=function(_0x2ca789,_0x3c107d){_0x2ca789=_0x2ca789-0x0;var _0x250a19=_0xcd56[_0x2ca789];return _0x250a19;};'use strict';var _=require(_0x6cd5('0x0'));var moment=require('moment');var util=require(_0x6cd5('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x6cd5('0x2'))('ami');var ami=require(_0x6cd5('0x3'));var QueueReport=require(_0x6cd5('0x4'));var VoiceQueueSummary=require(_0x6cd5('0x5'));config[_0x6cd5('0x6')]=_[_0x6cd5('0x7')](config[_0x6cd5('0x6')],{'host':_0x6cd5('0x8'),'port':0x18eb});var io=require(_0x6cd5('0x9'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x6cd5('0xa')][_0x6cd5('0xb')]=function(_0xece5c2){this[_0x6cd5('0xc')]=this[_0x6cd5('0xc')]?this[_0x6cd5('0xc')][_0x6cd5('0xd')](_0xece5c2):_0xece5c2();};function VoiceQueueReport(_0x49702a){this[_0x6cd5('0xe')]=new Sequence();this['queueReports']={};this[_0x6cd5('0xf')]=_0x49702a;this[_0x6cd5('0x10')]=_0x49702a[_0x6cd5('0x10')];this[_0x6cd5('0x11')]=_0x49702a[_0x6cd5('0x12')];this[_0x6cd5('0x13')]=_0x49702a[_0x6cd5('0x13')];this['campaigns']=_0x49702a[_0x6cd5('0x14')];this['summary']=initializeSummary();this[_0x6cd5('0x15')]={};ami['on'](_0x6cd5('0x16'),this[_0x6cd5('0x17')][_0x6cd5('0x18')](this));ami['on'](_0x6cd5('0x19'),this[_0x6cd5('0x1a')][_0x6cd5('0x18')](this));ami['on'](_0x6cd5('0x1b'),this[_0x6cd5('0x1c')][_0x6cd5('0x18')](this));ami['on'](_0x6cd5('0x1d'),this[_0x6cd5('0x1e')]['bind'](this));ami['on'](_0x6cd5('0x1f'),this['syncQueueCallerJoin'][_0x6cd5('0x18')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x6cd5('0x18')](this));ami['on'](_0x6cd5('0x20'),this['syncQueueCallerLeave'][_0x6cd5('0x18')](this));ami['on'](_0x6cd5('0x21'),this[_0x6cd5('0x22')]['bind'](this));ami['on'](_0x6cd5('0x23'),this[_0x6cd5('0x24')][_0x6cd5('0x18')](this));ami['on'](_0x6cd5('0x25'),this['syncVarSet'][_0x6cd5('0x18')](this));ami['on'](_0x6cd5('0x26'),this['syncHangup'][_0x6cd5('0x18')](this));ami['on'](_0x6cd5('0x27'),this[_0x6cd5('0x28')]['bind'](this));ami['on'](_0x6cd5('0x29'),this[_0x6cd5('0x2a')]['bind'](this));ami['on'](_0x6cd5('0x2b'),this['syncMusicOnHoldStop'][_0x6cd5('0x18')](this));ami['on']('attendedtransfer',this[_0x6cd5('0x2c')][_0x6cd5('0x18')](this));ami['on'](_0x6cd5('0x2d'),this[_0x6cd5('0x2e')][_0x6cd5('0x18')](this));this[_0x6cd5('0x2f')]();this[_0x6cd5('0x30')]();}function clearChannels(_0x4c9fb2){if(!_[_0x6cd5('0x31')](_0x4c9fb2)){for(var _0x389499 in _0x4c9fb2){if(_0x4c9fb2['hasOwnProperty'](_0x389499)){delete _0x4c9fb2[_0x389499];}}}}function clearCampaigns(_0x4ef338){if(!_['isEmpty'](_0x4ef338)){for(var _0x2319b8 in _0x4ef338){if(_0x4ef338[_0x6cd5('0x32')](_0x2319b8)){_0x4ef338[_0x2319b8]['originated']=0x0;}}}}function clearVoiceQueues(_0x113a22){if(!_['isEmpty'](_0x113a22)){for(var _0x17d220 in _0x113a22){if(_0x113a22[_0x6cd5('0x32')](_0x17d220)){_0x113a22[_0x17d220][_0x6cd5('0x33')]=0x0;_0x113a22[_0x17d220][_0x6cd5('0x34')]=0x0;_0x113a22[_0x17d220]['pTalking']=0x0;_0x113a22[_0x17d220]['waiting']=0x0;_0x113a22[_0x17d220][_0x6cd5('0x35')]=!![];}}}}function clearAgentBooked(_0x5e5f62){if(!_[_0x6cd5('0x31')](_0x5e5f62)){for(var _0x2a948d in _0x5e5f62){if(_0x5e5f62[_0x6cd5('0x32')](_0x2a948d)){_0x5e5f62[_0x2a948d]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x3f30a7){return _0x3f30a7['queuecallerexit']||_0x3f30a7['queuecallerabandon']||_0x3f30a7[_0x6cd5('0x36')];}VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x37')]=function(){var _0xb9113a=this;for(var _0x21bdf2 in this['channels']){if(this['channels'][_0x6cd5('0x32')](_0x21bdf2)&&!this[_0x6cd5('0x11')][_0x21bdf2]['switch']){this[_0x6cd5('0xe')][_0x6cd5('0xb')](function(){if(!_['isNil'](_0xb9113a['channels'][_0x21bdf2])){return ami[_0x6cd5('0x38')]({'action':'status','channel':_0xb9113a[_0x6cd5('0x11')][_0x21bdf2][_0x6cd5('0x39')]})['catch'](function(_0x111e8b){if(_0x111e8b[_0x6cd5('0x3a')]===_0x6cd5('0x3b')){setTimeout(function(){if(_0xb9113a['channels'][_0x21bdf2]){delete _0xb9113a['channels'][_0x21bdf2];logger[_0x6cd5('0x3c')](_0x6cd5('0x3d'),_0x21bdf2,util['inspect'](_0x111e8b,{'showHidden':![],'depth':null}));}if(_0xb9113a[_0x6cd5('0x3e')][_0x21bdf2]){delete _0xb9113a[_0x6cd5('0x3e')][_0x21bdf2];logger['error'](_0x6cd5('0x3f'),_0x21bdf2,util[_0x6cd5('0x40')](_0x111e8b,{'showHidden':![],'depth':null}));}if(_0xb9113a['variables'][_0x21bdf2]){delete _0xb9113a[_0x6cd5('0x15')][_0x21bdf2];logger['error']('[%s][voiceQueueReport][checkVariables]',_0x21bdf2,util[_0x6cd5('0x40')](_0x111e8b,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x28')]=function(){logger[_0x6cd5('0x3c')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x6cd5('0x11')]);this[_0x6cd5('0x41')](this[_0x6cd5('0x3e')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x6cd5('0x13')]);clearCampaigns(this['campaigns']);this[_0x6cd5('0x42')]=initializeSummary();};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x41')]=function(_0x4cb012){var _0x392ec6=this;if(!_[_0x6cd5('0x31')](_0x4cb012)){for(var _0x583d27 in _0x4cb012){if(_0x4cb012[_0x6cd5('0x32')](_0x583d27)){_0x392ec6['emitVoiceQueueChannelRemove'](_0x4cb012[_0x583d27],'clearqueuereport');delete _0x4cb012[_0x583d27];}}}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x43')]=function(_0x5a2690,_0x55cbd7,_0xb67f36){io['to'](_0x5a2690)[_0x6cd5('0x43')](_0x55cbd7,_0xb67f36);};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x44')]=function(_0x69d083,_0x486e37){logger[_0x6cd5('0x45')](_0x6cd5('0x46')+_0x486e37+_0x6cd5('0x47'),_0x69d083[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x69d083,{'showHidden':![],'depth':null}));this[_0x6cd5('0x43')](util['format'](_0x6cd5('0x49'),_0x69d083[_0x6cd5('0x4a')]),_0x6cd5('0x4b'),_0x69d083);io[_0x6cd5('0x43')]('voice_queue_presence:save',_0x69d083);};VoiceQueueReport[_0x6cd5('0xa')]['emitVoiceQueueChannelRemove']=function(_0x545f87,_0x52c648){logger['debug'](_0x6cd5('0x46')+_0x52c648+_0x6cd5('0x4c'),_0x545f87[_0x6cd5('0x48')],util['inspect'](_0x545f87,{'showHidden':![],'depth':null}));if(_0x545f87[_0x6cd5('0x4d')]==='ATTENDEDTRANSFER'){return;}this[_0x6cd5('0x43')](util[_0x6cd5('0x4e')](_0x6cd5('0x49'),_0x545f87[_0x6cd5('0x4a')]),_0x6cd5('0x4f'),_0x545f87);io[_0x6cd5('0x43')](_0x6cd5('0x50'),_0x545f87);};VoiceQueueReport[_0x6cd5('0xa')]['emitInboundVoiceQueueSummary']=function(_0x3712af){if(_0x3712af[_0x6cd5('0x51')]==='inbound'){logger['debug'](_0x6cd5('0x52'),util[_0x6cd5('0x40')](_0x3712af,{'showHidden':![],'depth':null}));this[_0x6cd5('0x43')](util[_0x6cd5('0x4e')]('voice:queue:%s',_0x3712af[_0x6cd5('0x53')]),_0x6cd5('0x54'),_0x3712af);}};VoiceQueueReport[_0x6cd5('0xa')]['isNotNull']=function(_0xdc8ee1){return _0xdc8ee1!==null&&!_[_0x6cd5('0x55')](_0xdc8ee1);};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x30')]=function(){var _0x1d8e88=this;setInterval(function(){_0x1d8e88[_0x6cd5('0x37')]();ami[_0x6cd5('0x38')]({'action':_0x6cd5('0x56')})[_0x6cd5('0x57')](function(_0x196e62){logger[_0x6cd5('0x3c')](_0x6cd5('0x58'),util[_0x6cd5('0x40')](_0x196e62,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0x6cd5('0x2f')]=function(){var _0x2c4467=this;setInterval(function(){if(!_0x2c4467[_0x6cd5('0x42')][_0x6cd5('0x59')]){return ami[_0x6cd5('0x38')]({'action':'queuesummary'})[_0x6cd5('0x5a')](function(_0x5c0196){_0x2c4467[_0x6cd5('0x42')]['id']=_0x5c0196[_0x6cd5('0x5b')];_0x2c4467['summary']['isRunning']=!![];_0x2c4467[_0x6cd5('0x42')][_0x6cd5('0x5c')][_0x5c0196[_0x6cd5('0x5b')]]={};})[_0x6cd5('0x57')](function(_0x390d59){logger[_0x6cd5('0x3c')](_0x6cd5('0x5d'),util[_0x6cd5('0x40')](_0x390d59,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x6cd5('0xa')]['createQueueSummaryReport']=function(_0x5bfe64,_0x1dc738){var _0x1664cb;if(this[_0x6cd5('0x42')]&&this[_0x6cd5('0x42')]['queues']&&this['summary'][_0x6cd5('0x56')][_0x5bfe64[_0x6cd5('0x53')]]){_0x1664cb=this[_0x6cd5('0x42')][_0x6cd5('0x56')][_0x5bfe64[_0x6cd5('0x53')]]['summaryEvent'];}var _0x517f1f=new VoiceQueueSummary(_0x5bfe64);return _0x517f1f[_0x6cd5('0x5e')](_0x1dc738['agents'],this[_0x6cd5('0x10')],_0x1664cb,this[_0x6cd5('0xf')][_0x6cd5('0x11')]);};VoiceQueueReport['prototype'][_0x6cd5('0x5f')]=function(_0x358497,_0x4825d4){var _0x332719=this[_0x6cd5('0x60')](_0x358497,_0x4825d4);var _0x1b43e4=![];_0x1b43e4=_0x332719[_0x6cd5('0x61')](_0x358497);if(_0x1b43e4){Object[_0x6cd5('0x62')](_0x358497,_0x332719);this[_0x6cd5('0xf')][_0x6cd5('0x13')][_0x358497[_0x6cd5('0x53')]]=_0x358497;this[_0x6cd5('0x63')](_0x332719);}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x1e')]=function(_0x20f244){var _0x55cb11=null;var _0x3d2851=this[_0x6cd5('0x42')]['id'];if(this[_0x6cd5('0x42')][_0x6cd5('0x5c')][_0x3d2851]){_0x55cb11=this[_0x6cd5('0x42')][_0x6cd5('0x5c')][_0x3d2851][_0x20f244['actionid']];}if(!_0x55cb11){this[_0x6cd5('0x42')]=initializeSummary();return;}var _0x30aa6e=this[_0x6cd5('0x13')][_0x55cb11['queue']];if(_0x30aa6e['type']==='inbound'){this[_0x6cd5('0x5f')](_0x30aa6e,_0x55cb11);}else if(_0x30aa6e[_0x6cd5('0x51')]===_0x6cd5('0x64')){var _0x272d11=this['createQueueSummaryReport'](_0x30aa6e,_0x55cb11);ami[_0x6cd5('0x43')](_0x6cd5('0x65'),_0x272d11);}this['summary'][_0x6cd5('0x66')]-=0x1;var _0x5a4dee=this[_0x6cd5('0x42')]['statusRequests']>0x0?!![]:![];if(!_0x5a4dee){return this[_0x6cd5('0x1a')](this[_0x6cd5('0x42')][_0x6cd5('0x67')]);}};VoiceQueueReport[_0x6cd5('0xa')]['syncQueueMember']=function(_0x25610a){var _0x42232f=this[_0x6cd5('0x42')]['id'];if(this[_0x6cd5('0x42')][_0x6cd5('0x5c')][_0x42232f]&&this[_0x6cd5('0x42')][_0x6cd5('0x5c')][_0x42232f][_0x25610a['actionid']]){this[_0x6cd5('0x42')][_0x6cd5('0x5c')][_0x42232f][_0x25610a[_0x6cd5('0x5b')]][_0x6cd5('0x10')][_0x6cd5('0x68')](_0x25610a);}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x17')]=function(_0x1b8a5b){var _0x139a3f=this;try{if(this[_0x6cd5('0x69')](_0x1b8a5b)&&this[_0x6cd5('0x69')](_0x1b8a5b['queue'])){logger[_0x6cd5('0x45')](_0x6cd5('0x6a'),util['inspect'](_0x1b8a5b,{'showHidden':![],'depth':null}));var _0x24e896=this[_0x6cd5('0x13')][_0x1b8a5b[_0x6cd5('0x4a')]];if(_0x24e896){logger['debug']('[voiceQueueReport][queuesummary]\x20name:%s',_0x24e896['name']);this[_0x6cd5('0x42')]['queues'][_0x24e896[_0x6cd5('0x53')]]={'summaryEvent':_0x1b8a5b};this[_0x6cd5('0x42')][_0x6cd5('0x66')]+=0x1;return ami[_0x6cd5('0x38')]({'action':_0x6cd5('0x5c'),'queue':_0x24e896[_0x6cd5('0x53')]})[_0x6cd5('0x5a')](function(_0x1eecd0){if(!_0x139a3f[_0x6cd5('0x42')][_0x6cd5('0x5c')][_0x1b8a5b[_0x6cd5('0x5b')]]){_0x139a3f[_0x6cd5('0x42')][_0x6cd5('0x5c')][_0x1b8a5b[_0x6cd5('0x5b')]]={};}_0x139a3f[_0x6cd5('0x42')][_0x6cd5('0x5c')][_0x1b8a5b[_0x6cd5('0x5b')]][_0x1eecd0[_0x6cd5('0x5b')]]={'queue':_0x24e896['name'],'agents':[]};})[_0x6cd5('0x57')](function(_0x3e3db0){throw _0x3e3db0;});}}}catch(_0x2d0b79){logger[_0x6cd5('0x3c')](_0x6cd5('0x5d'),util[_0x6cd5('0x40')](_0x2d0b79,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x1a')]=function(_0x26fcf5){if(this[_0x6cd5('0x42')]['statusRequests']>0x0){this[_0x6cd5('0x42')]['completeEvent']=_0x26fcf5;return;}logger[_0x6cd5('0x45')](_0x6cd5('0x6b'),util[_0x6cd5('0x40')](_0x26fcf5,{'showHidden':![],'depth':null}));this[_0x6cd5('0x42')]=initializeSummary();ami[_0x6cd5('0x43')](_0x6cd5('0x6c'),{});};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x6d')]=function(_0x467754){try{if(this[_0x6cd5('0x69')](_0x467754)){logger['debug'](_0x6cd5('0x6e'),_0x467754[_0x6cd5('0x48')],util['inspect'](_0x467754,{'showHidden':![],'depth':null}));if(_[_0x6cd5('0x55')](this[_0x6cd5('0x3e')][_0x467754[_0x6cd5('0x48')]])){this[_0x6cd5('0x3e')][_0x467754[_0x6cd5('0x48')]]=[];}if(_[_0x6cd5('0x55')](this[_0x6cd5('0x11')][_0x467754[_0x6cd5('0x48')]])){this['channels'][_0x467754[_0x6cd5('0x48')]]={};}var _0x10a768=new QueueReport();_0x10a768[_0x6cd5('0x4a')]=_0x467754[_0x6cd5('0x4a')];_0x10a768['type']=this[_0x6cd5('0x13')][_0x10a768['queue']]&&this['voiceQueues'][_0x10a768[_0x6cd5('0x4a')]][_0x6cd5('0x51')]?this[_0x6cd5('0x13')][_0x10a768[_0x6cd5('0x4a')]]['type']||'inbound':_0x6cd5('0x6f');_0x10a768[_0x6cd5('0x70')]=moment()[_0x6cd5('0x4e')](_0x6cd5('0x71'));_0x10a768['position']=_0x467754[_0x6cd5('0x72')];_0x10a768[_0x6cd5('0x73')]=_0x467754[_0x6cd5('0x73')];_0x10a768[_0x6cd5('0x48')]=_0x467754[_0x6cd5('0x48')];_0x10a768[_0x6cd5('0x74')]=this[_0x6cd5('0x11')][_0x467754[_0x6cd5('0x48')]][_0x6cd5('0x74')];logger[_0x6cd5('0x75')](_0x6cd5('0x76'),_0x10a768['queue'],_0x10a768[_0x6cd5('0x51')]);Object[_0x6cd5('0x62')](_0x10a768,_[_0x6cd5('0x77')](_0x467754,_[_0x6cd5('0x78')](_0x10a768)));this['queueReports'][_0x467754[_0x6cd5('0x48')]]['push'](_0x10a768);this[_0x6cd5('0x11')][_0x467754[_0x6cd5('0x48')]]=_0x10a768;this['emitVoiceQueueChannelSave'](_0x10a768,_0x6cd5('0x1f'));}}catch(_0x24afdd){logger['error'](_0x6cd5('0x6e'),_0x467754['uniqueid'],util['inspect'](_0x24afdd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x79')]=function(_0xbc4397){try{if(this['isNotNull'](_0xbc4397)){logger[_0x6cd5('0x45')](_0x6cd5('0x7a'),_0xbc4397[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0xbc4397,{'showHidden':![],'depth':null}));if(this[_0x6cd5('0x3e')][_0xbc4397[_0x6cd5('0x48')]]){var _0x216f19=_['last'](this['queueReports'][_0xbc4397[_0x6cd5('0x48')]]);_0x216f19[_0x6cd5('0x36')]=![];_0x216f19[_0x6cd5('0x7b')]=null;_0x216f19[_0x6cd5('0x7c')]=_0xbc4397[_0x6cd5('0x7c')];_0x216f19[_0x6cd5('0x7d')]=_0xbc4397[_0x6cd5('0x7d')];_0x216f19[_0x6cd5('0x7e')]=!![];_0x216f19['queuecallerabandonAt']=moment()['format'](_0x6cd5('0x71'));_0x216f19[_0x6cd5('0x4d')]=_0x6cd5('0x7f');_0x216f19[_0x6cd5('0x80')]=null;logger[_0x6cd5('0x75')](_0x6cd5('0x81'),_0x216f19[_0x6cd5('0x4a')],_0x216f19[_0x6cd5('0x51')]);this[_0x6cd5('0x11')][_0xbc4397[_0x6cd5('0x48')]]=_0x216f19;this[_0x6cd5('0x82')](_0x216f19,_0x6cd5('0x7e'));}}}catch(_0x99e2e6){logger[_0x6cd5('0x3c')](_0x6cd5('0x7a'),_0xbc4397[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x99e2e6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x83')]=function(_0x1ca638){try{if(this['isNotNull'](_0x1ca638)){logger[_0x6cd5('0x45')]('[%s][voiceQueueReport][queuecallerleave]',_0x1ca638['uniqueid'],util[_0x6cd5('0x40')](_0x1ca638,{'showHidden':![],'depth':null}));if(this[_0x6cd5('0x3e')][_0x1ca638[_0x6cd5('0x48')]]){var _0x385e32=_[_0x6cd5('0x84')](this[_0x6cd5('0x3e')][_0x1ca638[_0x6cd5('0x48')]]);_0x385e32[_0x6cd5('0x85')]=moment()[_0x6cd5('0x4e')](_0x6cd5('0x71'));_0x385e32[_0x6cd5('0x86')]=_0x1ca638[_0x6cd5('0x86')];_0x385e32[_0x6cd5('0x87')]=_0x1ca638[_0x6cd5('0x87')];logger[_0x6cd5('0x75')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x385e32['queue'],_0x385e32['type'],_0x1ca638[_0x6cd5('0x86')],_0x1ca638[_0x6cd5('0x87')]);this['channels'][_0x1ca638[_0x6cd5('0x48')]]=_0x385e32;this[_0x6cd5('0x44')](_0x385e32,_0x6cd5('0x20'));}}}catch(_0x564837){logger[_0x6cd5('0x3c')](_0x6cd5('0x88'),_0x1ca638[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x564837,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x24')]=function(_0x2e47e9){try{if(this[_0x6cd5('0x69')](_0x2e47e9)){logger[_0x6cd5('0x45')](_0x6cd5('0x89'),_0x2e47e9[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x2e47e9,{'showHidden':![],'depth':null}));if(this[_0x6cd5('0x3e')][_0x2e47e9[_0x6cd5('0x48')]]){var _0x3b0117=_[_0x6cd5('0x84')](this[_0x6cd5('0x3e')][_0x2e47e9[_0x6cd5('0x48')]]);_0x3b0117[_0x6cd5('0x36')]=!![];_0x3b0117[_0x6cd5('0x4d')]=_0x6cd5('0x8a');logger[_0x6cd5('0x75')](_0x6cd5('0x8b'),_0x3b0117[_0x6cd5('0x4a')],_0x3b0117['type']);}}}catch(_0x40a397){logger[_0x6cd5('0x3c')](_0x6cd5('0x89'),_0x2e47e9['uniqueid'],util[_0x6cd5('0x40')](_0x40a397,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x22')]=function(_0x2f8b18){try{if(this[_0x6cd5('0x69')](_0x2f8b18)){logger[_0x6cd5('0x45')](_0x6cd5('0x8c'),_0x2f8b18[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x2f8b18,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2f8b18[_0x6cd5('0x48')]]){var _0x52b800=_[_0x6cd5('0x84')](this[_0x6cd5('0x3e')][_0x2f8b18[_0x6cd5('0x48')]]);_0x52b800[_0x6cd5('0x7e')]=![];_0x52b800['queuecallerabandonAt']=null;_0x52b800[_0x6cd5('0x8d')]=!![];_0x52b800[_0x6cd5('0x80')]=_0x2f8b18[_0x6cd5('0x8e')];_0x52b800[_0x6cd5('0x7c')]=_0x2f8b18['holdtime'];_0x52b800[_0x6cd5('0x36')]=!![];_0x52b800[_0x6cd5('0x8f')]=![];_0x52b800[_0x6cd5('0x90')]=null;if(!_0x52b800[_0x6cd5('0x91')]){if(_0x2f8b18[_0x6cd5('0x92')]==_0x6cd5('0x91')){_0x52b800[_0x6cd5('0x4d')]=_0x6cd5('0x93');logger[_0x6cd5('0x75')](_0x6cd5('0x94'),_0x52b800[_0x6cd5('0x4a')],_0x52b800[_0x6cd5('0x51')]);}else{if(_[_0x6cd5('0x95')](_0x2f8b18[_0x6cd5('0x39')][_0x6cd5('0x96')](),_0x6cd5('0x97'))){if(this[_0x6cd5('0x3e')][_0x2f8b18[_0x6cd5('0x98')]]){var _0x24f7fd=_[_0x6cd5('0x84')](this['queueReports'][_0x2f8b18['linkedid']]);_0x24f7fd['queuecallercomplete']=![];_0x24f7fd[_0x6cd5('0x8f')]=!![];_0x24f7fd[_0x6cd5('0x90')]=moment(_0x52b800[_0x6cd5('0x70')])[_0x6cd5('0x99')](_0x2f8b18[_0x6cd5('0x7c')],'seconds')[_0x6cd5('0x4e')](_0x6cd5('0x71'));_0x24f7fd[_0x6cd5('0x4d')]=_0x6cd5('0x9a');_0x24f7fd['transfer']=!![];_0x24f7fd[_0x6cd5('0x9b')]=_0x6cd5('0x9c');_0x24f7fd[_0x6cd5('0x9d')]=_0x2f8b18[_0x6cd5('0x9e')];_0x24f7fd[_0x6cd5('0x9f')]=_0x2f8b18[_0x6cd5('0x48')];logger[_0x6cd5('0x75')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x24f7fd[_0x6cd5('0x4a')],_0x24f7fd[_0x6cd5('0x51')]);var _0x44539c=this[_0x6cd5('0x3e')][_0x2f8b18[_0x6cd5('0x98')]];this[_0x6cd5('0x3e')][_0x2f8b18[_0x6cd5('0x98')]]=this['queueReports'][_0x2f8b18[_0x6cd5('0x48')]];this['queueReports'][_0x2f8b18[_0x6cd5('0x48')]]=_0x44539c;}}else{_0x52b800['queuecallerexitreason']=_0x6cd5('0xa0')+_0x2f8b18['reason'][_0x6cd5('0xa1')]();logger['info'](_0x6cd5('0xa2'),_0x52b800['queue'],_0x52b800['type'],_0x52b800[_0x6cd5('0x4d')]);}}}this[_0x6cd5('0x11')][_0x2f8b18[_0x6cd5('0x48')]]=_0x52b800;}}}catch(_0x5a99ef){logger[_0x6cd5('0x3c')](_0x6cd5('0x8c'),_0x2f8b18[_0x6cd5('0x48')],util['inspect'](_0x5a99ef,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0xa3')]=function(_0x4477bc){try{if(this[_0x6cd5('0x69')](_0x4477bc)){logger[_0x6cd5('0x45')]('[%s][voiceQueueReport][varset]',_0x4477bc[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x4477bc,{'showHidden':![],'depth':null}));this[_0x6cd5('0xa4')](_0x4477bc[_0x6cd5('0x48')],_['keys'](_0x4477bc['variable'])[0x0],_0x4477bc['value']);if(this['queueReports'][_0x4477bc['uniqueid']]){var _0x2a9c05=_[_0x6cd5('0x84')](this[_0x6cd5('0x3e')][_0x4477bc['uniqueid']]);if(_0x2a9c05){if(this[_0x6cd5('0x69')](_0x4477bc[_0x6cd5('0xa5')])&&this[_0x6cd5('0x69')](_0x4477bc['variable'][_0x6cd5('0x5c')])){switch(_0x4477bc[_0x6cd5('0xa6')]){case _0x6cd5('0xa7'):_0x2a9c05[_0x6cd5('0x8f')]=![];_0x2a9c05[_0x6cd5('0x90')]=null;break;case _0x6cd5('0xa8'):_0x2a9c05[_0x6cd5('0xa9')]='timeout';_0x2a9c05[_0x6cd5('0x8f')]=!![];_0x2a9c05['queuecallerexitAt']=moment()[_0x6cd5('0x4e')](_0x6cd5('0x71'));_0x2a9c05['queuecallerleaveAt']=moment()['format'](_0x6cd5('0x71'));logger['debug'](_0x6cd5('0xaa'),_0x4477bc[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x2a9c05,{'showHidden':![],'depth':null}));ami[_0x6cd5('0x43')]('custom:timeout',_0x2a9c05);break;default:_0x2a9c05['queuecallerexit']=!![];_0x2a9c05[_0x6cd5('0x90')]=moment()['format'](_0x6cd5('0x71'));_0x2a9c05[_0x6cd5('0x85')]=moment()[_0x6cd5('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2a9c05[_0x6cd5('0x7e')]=![];_0x2a9c05[_0x6cd5('0xab')]=null;_0x2a9c05[_0x6cd5('0x4d')]=_0x4477bc['value'];this['channels'][_0x4477bc[_0x6cd5('0x48')]]=_0x2a9c05;this['emitVoiceQueueChannelRemove'](_0x2a9c05,_0x6cd5('0x25'));}else if(this[_0x6cd5('0x69')](_0x4477bc['variable'])&&this[_0x6cd5('0x69')](_0x4477bc[_0x6cd5('0xa5')][_0x6cd5('0xac')])){if(!_0x2a9c05['queuecallerabandon']){_0x2a9c05[_0x6cd5('0x8f')]=!![];_0x2a9c05[_0x6cd5('0x90')]=moment()['format'](_0x6cd5('0x71'));_0x2a9c05['queuecallerexitreason']=_0x6cd5('0xad');_0x2a9c05[_0x6cd5('0x85')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x6cd5('0x11')][_0x4477bc[_0x6cd5('0x48')]]=_0x2a9c05;}}logger['info']('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x4477bc[_0x6cd5('0x48')],_0x2a9c05[_0x6cd5('0x4a')],_0x2a9c05[_0x6cd5('0x51')],_[_0x6cd5('0x78')](_0x4477bc[_0x6cd5('0xa5')])[0x0],_0x4477bc[_0x6cd5('0xa6')]);_0x2a9c05[_0x6cd5('0x15')]=this[_0x6cd5('0x15')][_0x4477bc[_0x6cd5('0x48')]];}}}}catch(_0x32a546){logger['error'](_0x6cd5('0xae'),_0x4477bc[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x32a546,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6cd5('0xa')]['addVariable']=function(_0x287d65,_0x4d3fe2,_0x34ab35){var _0x5aa97f=[_0x6cd5('0xaf'),_0x6cd5('0xb0'),_0x6cd5('0xb1'),_0x6cd5('0xb2'),_0x6cd5('0xb3'),_0x6cd5('0xb4'),_0x6cd5('0xb5'),_0x6cd5('0xb6'),_0x6cd5('0xb7'),_0x6cd5('0xb8'),_0x6cd5('0xb9'),_0x6cd5('0xba'),_0x6cd5('0xbb'),_0x6cd5('0xbc'),_0x6cd5('0xbd'),_0x6cd5('0xbe'),'membername',_0x6cd5('0xbf'),_0x6cd5('0xc0')];if(!_['isNil'](_0x4d3fe2)&&!_[_0x6cd5('0xc1')](_0x5aa97f,_0x4d3fe2)){if(_[_0x6cd5('0x55')](this[_0x6cd5('0x15')][_0x287d65])){this[_0x6cd5('0x15')][_0x287d65]={};}this['variables'][_0x287d65][_0x4d3fe2]=_0x34ab35;}};VoiceQueueReport['prototype'][_0x6cd5('0xc2')]=function(_0x381229,_0x49f51a,_0x43a7dd){try{var _0x6fb618={};if(this['queueReports'][_0x381229]){for(var _0x336f12=0x0;_0x336f12<this[_0x6cd5('0x3e')][_0x381229][_0x6cd5('0xc3')];_0x336f12+=0x1){_0x6fb618=this['queueReports'][_0x381229][_0x336f12];var _0x21b828=this[_0x6cd5('0x13')][_0x6fb618[_0x6cd5('0x4a')]];if(_0x21b828){_0x21b828[_0x6cd5('0xc4')]+=moment(_0x6fb618[_0x6cd5('0x85')])['diff'](_0x6fb618[_0x6cd5('0x70')],_0x6cd5('0xc5'))||0x0;if(_0x43a7dd&&_0x6fb618[_0x6cd5('0x4d')]==='ATTENDEDTRANSFER'){_0x6fb618[_0x6cd5('0x4d')]=_0x6cd5('0x8a');}if(_0x336f12===this['queueReports'][_0x381229][_0x6cd5('0xc3')]-0x1){_0x21b828[_0x6cd5('0xc6')]+=moment()[_0x6cd5('0xc7')](0x0)[_0x6cd5('0xc8')](_0x6fb618['queuecallerjoinAt'],'seconds');if(hasCallerLeftTheQueue(_0x6fb618)&&_0x6fb618[_0x6cd5('0x4d')]!==_0x6cd5('0xc9')){_0x21b828[_0x6cd5('0xca')]+=0x1;}if(_0x6fb618[_0x6cd5('0x36')]){_0x21b828[_0x6cd5('0xcb')]+=0x1;_0x21b828['sumBillable']+=moment()[_0x6cd5('0xc7')](0x0)[_0x6cd5('0xc8')](_0x6fb618[_0x6cd5('0x85')],'seconds');_0x6fb618[_0x6cd5('0x7b')]=moment()[_0x6cd5('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');_0x6fb618[_0x6cd5('0x8f')]=![];_0x6fb618[_0x6cd5('0x90')]=null;}if(_0x6fb618[_0x6cd5('0x8f')]&&_0x6fb618[_0x6cd5('0x91')]!=!![]){_0x21b828['unmanaged']+=0x1;_0x6fb618[_0x6cd5('0xa9')]=_0x6cd5('0xcc');logger[_0x6cd5('0x45')](_0x6cd5('0xcd'),_0x381229,util[_0x6cd5('0x40')](_0x6fb618,{'showHidden':![],'depth':null}));ami[_0x6cd5('0x43')](_0x6cd5('0xce'),_0x6fb618);}if(_0x6fb618[_0x6cd5('0x7e')]){_0x21b828[_0x6cd5('0xcf')]+=0x1;_0x6fb618[_0x6cd5('0xa9')]=_0x6cd5('0xcf');logger[_0x6cd5('0x45')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x381229,util['inspect'](_0x6fb618,{'showHidden':![],'depth':null}));ami['emit'](_0x6cd5('0xd0'),_0x6fb618);}}else{_0x21b828[_0x6cd5('0xc6')]+=_0x21b828[_0x6cd5('0xc4')];}logger[_0x6cd5('0x75')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x381229,_0x6fb618['queue'],_0x6fb618[_0x6cd5('0x51')],_0x49f51a);this[_0x6cd5('0x11')][_0x381229]=_0x6fb618;Object[_0x6cd5('0x62')](this[_0x6cd5('0x13')][_0x6fb618[_0x6cd5('0x4a')]],_0x21b828);if(_0x6fb618[_0x6cd5('0x85')]){this['emitVoiceQueueChannelRemove'](_0x6fb618,_0x6cd5('0x26'));}}}logger[_0x6cd5('0x45')](_0x6cd5('0xd1'),_0x381229,util['inspect'](this[_0x6cd5('0x3e')][_0x381229],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x6fb618)&&_0x6fb618['queuecallerexitreason']!==_0x6cd5('0xc9')){ami['emit']('custom:voiceQueueReport',this[_0x6cd5('0x3e')][_0x381229]);if(this['queueReports'][_0x381229]){delete this['queueReports'][_0x381229];}if(this[_0x6cd5('0x11')][_0x381229]){delete this['channels'][_0x381229];}if(this[_0x6cd5('0x15')][_0x381229]){delete this[_0x6cd5('0x15')][_0x381229];}}}}catch(_0xf91b58){logger[_0x6cd5('0x3c')]('[%s][voiceQueueReport][handleHangup]',_0x381229,util[_0x6cd5('0x40')](_0xf91b58,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6cd5('0xa')]['syncHangup']=function(_0x50c211){try{if(this[_0x6cd5('0x69')](_0x50c211)){logger[_0x6cd5('0x45')]('[%s][voiceQueueReport][hangup]',_0x50c211[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x50c211,{'showHidden':![],'depth':null}));if(this[_0x6cd5('0x3e')][_0x50c211[_0x6cd5('0x48')]]){return this[_0x6cd5('0xc2')](_0x50c211['uniqueid'],_0x50c211['cause-txt'],![]);}if(this[_0x6cd5('0x3e')][_0x50c211['linkedid']]){if(_0x50c211[_0x6cd5('0xd2')]==='21'){return;}return this['handleHangup'](_0x50c211[_0x6cd5('0x98')],_0x50c211[_0x6cd5('0xd3')],!![]);}var _0x1830a0=Object['keys'](this[_0x6cd5('0x3e')]);for(var _0x4e7409=0x0;_0x4e7409<_0x1830a0[_0x6cd5('0xc3')];_0x4e7409++){var _0xf1ff94=_['last'](this['queueReports'][_0x1830a0[_0x4e7409]]);if(_0xf1ff94&&_0xf1ff94['transferid']===_0x50c211[_0x6cd5('0x48')]){return this[_0x6cd5('0xc2')](_0xf1ff94['uniqueid'],_0x50c211[_0x6cd5('0xd3')],!![]);}}if(!this[_0x6cd5('0x3e')][_0x50c211[_0x6cd5('0x48')]]){logger[_0x6cd5('0x45')](_0x6cd5('0xd4'),_0x50c211['uniqueid']);if(this['channels'][_0x50c211[_0x6cd5('0x48')]]){delete this[_0x6cd5('0x11')][_0x50c211['uniqueid']];}if(this[_0x6cd5('0x15')][_0x50c211[_0x6cd5('0x48')]]){delete this[_0x6cd5('0x15')][_0x50c211[_0x6cd5('0x48')]];}}}}catch(_0x57cd71){logger[_0x6cd5('0x3c')](_0x6cd5('0xd5'),_0x50c211[_0x6cd5('0x48')],util['inspect'](_0x57cd71,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x2c')]=function(_0x258fe7){try{if(this[_0x6cd5('0x69')](_0x258fe7)){logger[_0x6cd5('0x45')](_0x6cd5('0xd6'),_0x258fe7[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x258fe7,{'showHidden':![],'depth':null}));var _0x559a0e;var _0xda42a2;var _0x1c7544;if(this[_0x6cd5('0x3e')][_0x258fe7['transfereeuniqueid']]){_0x559a0e=_[_0x6cd5('0x84')](this[_0x6cd5('0x3e')][_0x258fe7[_0x6cd5('0xd7')]]);_0x559a0e[_0x6cd5('0x9d')]=_0x258fe7[_0x6cd5('0xd8')];_0x559a0e[_0x6cd5('0x9f')]=_0x258fe7[_0x6cd5('0xd9')];_0x559a0e[_0x6cd5('0x4d')]=_0x6cd5('0xc9');_0x559a0e[_0x6cd5('0x91')]=!![];_0x559a0e[_0x6cd5('0x9b')]='ATTENDED';if(this[_0x6cd5('0x3e')][_0x258fe7[_0x6cd5('0xd9')]]){_0x1c7544=this[_0x6cd5('0x3e')][_0x258fe7[_0x6cd5('0xd9')]];this['queueReports'][_0x258fe7[_0x6cd5('0xd9')]]=this[_0x6cd5('0x3e')][_0x258fe7['transfereeuniqueid']];this['queueReports'][_0x258fe7[_0x6cd5('0xd7')]]=_0x1c7544;_0xda42a2=_[_0x6cd5('0x84')](this[_0x6cd5('0x3e')][_0x258fe7['transfereeuniqueid']]);_0xda42a2[_0x6cd5('0xda')]=!![];}logger[_0x6cd5('0x75')](_0x6cd5('0xdb'),_0x258fe7[_0x6cd5('0x48')],_0x559a0e['queue'],_0x559a0e[_0x6cd5('0x51')],_0x559a0e[_0x6cd5('0x9d')],_0x559a0e[_0x6cd5('0x9f')]);}else if(this[_0x6cd5('0x3e')][_0x258fe7[_0x6cd5('0xdc')]]){_0x559a0e=_['last'](this[_0x6cd5('0x3e')][_0x258fe7[_0x6cd5('0xdc')]]);_0x559a0e[_0x6cd5('0x9d')]=_0x258fe7[_0x6cd5('0xdd')];_0x559a0e[_0x6cd5('0x9f')]=_0x258fe7['origtransfereruniqueid'];_0x559a0e[_0x6cd5('0x4d')]=_0x6cd5('0xc9');_0x559a0e[_0x6cd5('0x91')]=!![];_0x559a0e[_0x6cd5('0x9b')]=_0x6cd5('0xde');if(this['queueReports'][_0x258fe7[_0x6cd5('0xdf')]]){_0x1c7544=this[_0x6cd5('0x3e')][_0x258fe7['origtransfereruniqueid']];this[_0x6cd5('0x3e')][_0x258fe7[_0x6cd5('0xdf')]]=this['queueReports'][_0x258fe7[_0x6cd5('0xdc')]];this[_0x6cd5('0x3e')][_0x258fe7['transfertargetuniqueid']]=_0x1c7544;_0xda42a2=_[_0x6cd5('0x84')](this[_0x6cd5('0x3e')][_0x258fe7['transfertargetuniqueid']]);_0xda42a2[_0x6cd5('0xda')]=!![];}logger[_0x6cd5('0x75')](_0x6cd5('0xdb'),_0x258fe7[_0x6cd5('0x48')],_0x559a0e['queue'],_0x559a0e[_0x6cd5('0x51')],_0x559a0e['transferexten'],_0x559a0e[_0x6cd5('0x9f')]);}else if(this[_0x6cd5('0x3e')][_0x258fe7[_0x6cd5('0xdf')]]){_0x559a0e=_['last'](this[_0x6cd5('0x3e')][_0x258fe7[_0x6cd5('0xdf')]]);_0x559a0e[_0x6cd5('0x9d')]=_0x258fe7[_0x6cd5('0xdd')];_0x559a0e['transferuniqueid']=_0x258fe7['origtransfereruniqueid'];_0x559a0e[_0x6cd5('0x4d')]=_0x6cd5('0xc9');_0x559a0e[_0x6cd5('0x91')]=!![];_0x559a0e[_0x6cd5('0x9b')]=_0x6cd5('0xde');_0x559a0e[_0x6cd5('0xda')]=!![];_0x559a0e[_0x6cd5('0xe0')]=_0x258fe7[_0x6cd5('0xd7')];}else if(this[_0x6cd5('0x3e')][_0x258fe7['secondtransfereruniqueid']]){_0x559a0e=_[_0x6cd5('0x84')](this[_0x6cd5('0x3e')][_0x258fe7[_0x6cd5('0xd9')]]);_0x559a0e['transferexten']=_0x258fe7[_0x6cd5('0xd8')];_0x559a0e[_0x6cd5('0x9f')]=_0x258fe7['secondtransfereruniqueid'];_0x559a0e[_0x6cd5('0x4d')]=_0x6cd5('0xc9');_0x559a0e[_0x6cd5('0x91')]=!![];_0x559a0e[_0x6cd5('0x9b')]=_0x6cd5('0xde');_0x559a0e['switch']=!![];_0x559a0e[_0x6cd5('0xe0')]=_0x258fe7[_0x6cd5('0xdc')];}}}catch(_0x52009a){logger[_0x6cd5('0x3c')]('[%s][voiceQueueReport][attendedtransfer]',_0x258fe7[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x52009a,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncBlindTransfer']=function(_0x511d85){try{if(this[_0x6cd5('0x69')](_0x511d85)){logger[_0x6cd5('0x45')](_0x6cd5('0xe1'),_0x511d85[_0x6cd5('0x48')],util['inspect'](_0x511d85,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x511d85['transfereeuniqueid']]){var _0x3723ad=_[_0x6cd5('0x84')](this[_0x6cd5('0x3e')][_0x511d85[_0x6cd5('0xd7')]]);_0x3723ad['queuecallerexitreason']=_0x6cd5('0xe2');_0x3723ad[_0x6cd5('0x91')]=!![];_0x3723ad[_0x6cd5('0x9b')]=_0x6cd5('0xe3');_0x3723ad[_0x6cd5('0x9d')]=_0x511d85[_0x6cd5('0xe4')];_0x3723ad[_0x6cd5('0x9f')]=_0x511d85['transfereeuniqueid'];logger[_0x6cd5('0x75')](_0x6cd5('0xe5'),_0x511d85['uniqueid'],_0x3723ad[_0x6cd5('0x4a')],_0x3723ad['type'],_0x3723ad[_0x6cd5('0x9d')],_0x3723ad[_0x6cd5('0x9f')]);this['syncHangup']({'event':_0x6cd5('0xe6'),'uniqueid':_0x511d85['transfereeuniqueid'],'context':_0x511d85[_0x6cd5('0xe7')],'channel':_0x511d85['transfererchannel']});}}}catch(_0x8cf87f){logger[_0x6cd5('0x3c')](_0x6cd5('0xe1'),_0x511d85['uniqueid'],util['inspect'](_0x8cf87f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0x2a')]=function(_0x22f060){try{if(this['isNotNull'](_0x22f060)){logger['debug'](_0x6cd5('0xe8'),_0x22f060['uniqueid'],util[_0x6cd5('0x40')](_0x22f060,{'showHidden':![],'depth':null}));if(this[_0x6cd5('0x3e')][_0x22f060[_0x6cd5('0x48')]]){var _0x57b38c=_[_0x6cd5('0x84')](this[_0x6cd5('0x3e')][_0x22f060['uniqueid']]);if(!_['isNil'](_0x57b38c[_0x6cd5('0x85')])){_0x57b38c['mohstarttime']=moment()[_0x6cd5('0x4e')]('YYYY-MM-DD\x20HH:mm:ss');logger['info']('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x22f060[_0x6cd5('0x48')],_0x57b38c['mohstarttime']);}}}}catch(_0x598127){logger[_0x6cd5('0x3c')](_0x6cd5('0xe8'),_0x22f060[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x598127,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0xe9')]=function(_0x4c123c){try{if(this[_0x6cd5('0x69')](_0x4c123c)){logger[_0x6cd5('0x45')]('[%s][voiceQueueReport][musiconholdstop]',_0x4c123c[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x4c123c,{'showHidden':![],'depth':null}));if(this[_0x6cd5('0x3e')][_0x4c123c['uniqueid']]){var _0x77be4a=_['last'](this['queueReports'][_0x4c123c[_0x6cd5('0x48')]]);if(!_[_0x6cd5('0xea')](_0x77be4a[_0x6cd5('0xeb')])){_0x77be4a[_0x6cd5('0xec')]+=moment()[_0x6cd5('0xc7')](0x0)[_0x6cd5('0xc8')](_0x77be4a['mohstarttime'],_0x6cd5('0xc5'));logger[_0x6cd5('0x75')](_0x6cd5('0xed'),_0x4c123c[_0x6cd5('0x48')],_0x77be4a[_0x6cd5('0xec')]);delete _0x77be4a[_0x6cd5('0xeb')];}}}}catch(_0xd61a26){logger[_0x6cd5('0x3c')](_0x6cd5('0xee'),_0x4c123c[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0xd61a26,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x6cd5('0xa')][_0x6cd5('0xef')]=function(_0x40f5c2){try{if(this[_0x6cd5('0x69')](_0x40f5c2)){logger[_0x6cd5('0x45')]('[%s][voiceQueueReport][newexten]\x20event:',_0x40f5c2[_0x6cd5('0x48')],util['inspect'](_0x40f5c2,{'showHidden':![],'depth':null}));if(_0x40f5c2[_0x6cd5('0xf0')][_0x6cd5('0x96')]()===_0x6cd5('0xf1')){_0x40f5c2[_0x6cd5('0xf2')]=_0x40f5c2[_0x6cd5('0xf3')]&&_0x40f5c2['appdata'][_0x6cd5('0x95')](_0x6cd5('0xf4'))?_0x40f5c2[_0x6cd5('0xf3')]:(_0x40f5c2['appdata']||_0x40f5c2[_0x6cd5('0xf2')])['toLowerCase']();if(_[_0x6cd5('0x95')](_0x40f5c2['applicationdata'][_0x6cd5('0x96')](),_0x6cd5('0xf5'))){logger[_0x6cd5('0x75')](_0x6cd5('0xf6'),_0x40f5c2['uniqueid'],_0x40f5c2[_0x6cd5('0xf0')],_0x40f5c2['applicationdata']);if(_[_0x6cd5('0x55')](this[_0x6cd5('0x11')][_0x40f5c2[_0x6cd5('0x48')]]))this['channels'][_0x40f5c2[_0x6cd5('0x48')]]={};var _0x170362=_0x40f5c2[_0x6cd5('0xf2')][_0x6cd5('0xf7')]('=');var _0x2279d0=_0x170362[0x0][_0x6cd5('0x96')]()[_0x6cd5('0xf8')](/cdr\((.*)\)/);if(_0x2279d0)this[_0x6cd5('0x11')][_0x40f5c2['uniqueid']][_0x2279d0[0x1]]=_0x170362[0x1];}}}}catch(_0x19a7f3){logger[_0x6cd5('0x3c')](_0x6cd5('0xf9'),_0x40f5c2[_0x6cd5('0x48')],util[_0x6cd5('0x40')](_0x19a7f3,{'showHidden':![],'depth':null}));}};module[_0x6cd5('0xfa')]=VoiceQueueReport;
\ No newline at end of file
+var _0xa7cf=['loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','pTalking','waiting','queueStatusComplete','unlockRR','queuecallerexit','queuecallercomplete','prototype','clearZombieChannels','channels','switch','isNil','Action','status','channel','catch','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','queue','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove','[%s][voiceQueueReport][','queuecallerexitreason','voice_queue_channel:remove','emitInboundVoiceQueueSummary','type','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','voice_queue:save','isNotNull','isUndefined','[voiceQueueReport][queues]','then','actionid','isRunning','queuestatus','[voiceQueueReport][queuesummary]','queues','summaryEvent','createReport','realtime','handleInboundQueueSummaryReport','createQueueSummaryReport','compareToInboundQueue','assign','outbound','custom:queuesummary','statusRequests','completeEvent','push','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','pick','keys','queuecallerjoin','syncQueueCallerAbandon','last','holdtime','originalposition','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinename','connectedlinenum','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','membername','queuecallerexitAt','transfer','COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','TIMEOUT','lastevent','timeout','custom:timeout','varset','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','handleHangup','length','sumHoldTime','diff','ATTENDEDTRANSFER','sumDuration','milliseconds','total','answered','sumBillable','queuecallercompleteAt','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][handleHangup]','syncHangup','cause','cause-txt','transferid','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','socket.io-emitter','enqueue','tail','finally','sequence','queueReports','agents','voiceQueues','campaigns','summary','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuemember','queuestatuscomplete','syncQueueStatusComplete','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','syncVarSet','hangup','fullybooted','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer'];(function(_0x41cf10,_0x4559eb){var _0x2d7556=function(_0x39ab14){while(--_0x39ab14){_0x41cf10['push'](_0x41cf10['shift']());}};_0x2d7556(++_0x4559eb);}(_0xa7cf,0xc9));var _0xfa7c=function(_0x4c05da,_0x414720){_0x4c05da=_0x4c05da-0x0;var _0x1614db=_0xa7cf[_0x4c05da];return _0x1614db;};'use strict';var _=require(_0xfa7c('0x0'));var moment=require('moment');var util=require(_0xfa7c('0x1'));var Redis=require(_0xfa7c('0x2'));var config=require(_0xfa7c('0x3'));var logger=require(_0xfa7c('0x4'))(_0xfa7c('0x5'));var ami=require(_0xfa7c('0x6'));var QueueReport=require(_0xfa7c('0x7'));var VoiceQueueSummary=require(_0xfa7c('0x8'));config[_0xfa7c('0x9')]=_[_0xfa7c('0xa')](config[_0xfa7c('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xfa7c('0xb'))(new Redis(config[_0xfa7c('0x9')]));var Sequence=function(){};Sequence['prototype'][_0xfa7c('0xc')]=function(_0x259e89){this['tail']=this[_0xfa7c('0xd')]?this[_0xfa7c('0xd')][_0xfa7c('0xe')](_0x259e89):_0x259e89();};function VoiceQueueReport(_0x315ad4){this[_0xfa7c('0xf')]=new Sequence();this[_0xfa7c('0x10')]={};this['realtime']=_0x315ad4;this['agents']=_0x315ad4[_0xfa7c('0x11')];this['channels']=_0x315ad4['queueChannels'];this[_0xfa7c('0x12')]=_0x315ad4['voiceQueues'];this['campaigns']=_0x315ad4[_0xfa7c('0x13')];this[_0xfa7c('0x14')]=initializeSummary();this[_0xfa7c('0x15')]={};ami['on'](_0xfa7c('0x16'),this[_0xfa7c('0x17')][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x19'),this[_0xfa7c('0x1a')]['bind'](this));ami['on'](_0xfa7c('0x1b'),this['syncQueueMember'][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x1c'),this[_0xfa7c('0x1d')][_0xfa7c('0x18')](this));ami['on']('queuecallerjoin',this[_0xfa7c('0x1e')][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x1f'),this['syncQueueCallerAbandon'][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x20'),this['syncQueueCallerLeave']['bind'](this));ami['on'](_0xfa7c('0x21'),this[_0xfa7c('0x22')][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x23'),this[_0xfa7c('0x24')]['bind'](this));ami['on']('varset',this[_0xfa7c('0x25')][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x26'),this['syncHangup'][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x27'),this['syncFullyBooted'][_0xfa7c('0x18')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x28'),this['syncMusicOnHoldStop'][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x29'),this[_0xfa7c('0x2a')][_0xfa7c('0x18')](this));ami['on'](_0xfa7c('0x2b'),this[_0xfa7c('0x2c')][_0xfa7c('0x18')](this));this[_0xfa7c('0x2d')]();this[_0xfa7c('0x2e')]();}function clearChannels(_0x4c0488){if(!_[_0xfa7c('0x2f')](_0x4c0488)){for(var _0xc45427 in _0x4c0488){if(_0x4c0488[_0xfa7c('0x30')](_0xc45427)){delete _0x4c0488[_0xc45427];}}}}function clearCampaigns(_0x4d5de2){if(!_[_0xfa7c('0x2f')](_0x4d5de2)){for(var _0x4f71db in _0x4d5de2){if(_0x4d5de2['hasOwnProperty'](_0x4f71db)){_0x4d5de2[_0x4f71db]['originated']=0x0;}}}}function clearVoiceQueues(_0x3396a2){if(!_[_0xfa7c('0x2f')](_0x3396a2)){for(var _0x26efc9 in _0x3396a2){if(_0x3396a2[_0xfa7c('0x30')](_0x26efc9)){_0x3396a2[_0x26efc9]['originated']=0x0;_0x3396a2[_0x26efc9]['talking']=0x0;_0x3396a2[_0x26efc9][_0xfa7c('0x31')]=0x0;_0x3396a2[_0x26efc9][_0xfa7c('0x32')]=0x0;_0x3396a2[_0x26efc9][_0xfa7c('0x33')]=!![];}}}}function clearAgentBooked(_0x3f15a0){if(!_[_0xfa7c('0x2f')](_0x3f15a0)){for(var _0x36bbfe in _0x3f15a0){if(_0x3f15a0[_0xfa7c('0x30')](_0x36bbfe)){_0x3f15a0[_0x36bbfe][_0xfa7c('0x34')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0xd64902){return _0xd64902[_0xfa7c('0x35')]||_0xd64902[_0xfa7c('0x1f')]||_0xd64902[_0xfa7c('0x36')];}VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x38')]=function(){var _0x11ddf1=this;for(var _0x57f298 in this[_0xfa7c('0x39')]){if(this[_0xfa7c('0x39')][_0xfa7c('0x30')](_0x57f298)&&!this['channels'][_0x57f298][_0xfa7c('0x3a')]){this[_0xfa7c('0xf')][_0xfa7c('0xc')](function(){if(!_[_0xfa7c('0x3b')](_0x11ddf1['channels'][_0x57f298])){return ami[_0xfa7c('0x3c')]({'action':_0xfa7c('0x3d'),'channel':_0x11ddf1[_0xfa7c('0x39')][_0x57f298][_0xfa7c('0x3e')]})[_0xfa7c('0x3f')](function(_0x4de0bd){if(_0x4de0bd['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x11ddf1[_0xfa7c('0x39')][_0x57f298]){delete _0x11ddf1[_0xfa7c('0x39')][_0x57f298];logger[_0xfa7c('0x40')](_0xfa7c('0x41'),_0x57f298,util[_0xfa7c('0x42')](_0x4de0bd,{'showHidden':![],'depth':null}));}if(_0x11ddf1['queueReports'][_0x57f298]){delete _0x11ddf1[_0xfa7c('0x10')][_0x57f298];logger[_0xfa7c('0x40')](_0xfa7c('0x43'),_0x57f298,util[_0xfa7c('0x42')](_0x4de0bd,{'showHidden':![],'depth':null}));}if(_0x11ddf1[_0xfa7c('0x15')][_0x57f298]){delete _0x11ddf1[_0xfa7c('0x15')][_0x57f298];logger['error']('[%s][voiceQueueReport][checkVariables]',_0x57f298,util[_0xfa7c('0x42')](_0x4de0bd,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x44')]=function(){logger['error'](_0xfa7c('0x45'));clearChannels(this[_0xfa7c('0x39')]);this['clearQueueReport'](this[_0xfa7c('0x10')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0xfa7c('0x12')]);clearCampaigns(this[_0xfa7c('0x13')]);this[_0xfa7c('0x14')]=initializeSummary();};VoiceQueueReport['prototype'][_0xfa7c('0x46')]=function(_0x409649){var _0x40830b=this;if(!_['isEmpty'](_0x409649)){for(var _0x1334e0 in _0x409649){if(_0x409649[_0xfa7c('0x30')](_0x1334e0)){_0x40830b['emitVoiceQueueChannelRemove'](_0x409649[_0x1334e0],_0xfa7c('0x47'));delete _0x409649[_0x1334e0];}}}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x48')]=function(_0x34407d,_0x1a9722,_0x5516cc){io['to'](_0x34407d)[_0xfa7c('0x48')](_0x1a9722,_0x5516cc);};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x49')]=function(_0x3bfad3,_0x15dea0){logger[_0xfa7c('0x4a')]('[%s][voiceQueueReport]['+_0x15dea0+_0xfa7c('0x4b'),_0x3bfad3[_0xfa7c('0x4c')],util['inspect'](_0x3bfad3,{'showHidden':![],'depth':null}));this[_0xfa7c('0x48')](util[_0xfa7c('0x4d')](_0xfa7c('0x4e'),_0x3bfad3[_0xfa7c('0x4f')]),_0xfa7c('0x50'),_0x3bfad3);io['emit'](_0xfa7c('0x51'),_0x3bfad3);};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x52')]=function(_0x192e8c,_0x5a0417){logger[_0xfa7c('0x4a')](_0xfa7c('0x53')+_0x5a0417+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x192e8c[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x192e8c,{'showHidden':![],'depth':null}));if(_0x192e8c[_0xfa7c('0x54')]==='ATTENDEDTRANSFER'){return;}this[_0xfa7c('0x48')](util['format'](_0xfa7c('0x4e'),_0x192e8c[_0xfa7c('0x4f')]),_0xfa7c('0x55'),_0x192e8c);io[_0xfa7c('0x48')]('voice_queue_presence:remove',_0x192e8c);};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x56')]=function(_0x22ce00){if(_0x22ce00[_0xfa7c('0x57')]===_0xfa7c('0x58')){logger[_0xfa7c('0x4a')](_0xfa7c('0x59'),util['inspect'](_0x22ce00,{'showHidden':![],'depth':null}));this[_0xfa7c('0x48')](util[_0xfa7c('0x4d')]('voice:queue:%s',_0x22ce00[_0xfa7c('0x5a')]),_0xfa7c('0x5b'),_0x22ce00);}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x5c')]=function(_0x58ffb7){return _0x58ffb7!==null&&!_[_0xfa7c('0x5d')](_0x58ffb7);};VoiceQueueReport['prototype'][_0xfa7c('0x2e')]=function(){var _0x378aba=this;setInterval(function(){_0x378aba[_0xfa7c('0x38')]();ami[_0xfa7c('0x3c')]({'action':'queues'})['catch'](function(_0xe0956c){logger[_0xfa7c('0x40')](_0xfa7c('0x5e'),util[_0xfa7c('0x42')](_0xe0956c,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype']['loopQueueSummary']=function(){var _0x1414e1=this;setInterval(function(){if(!_0x1414e1[_0xfa7c('0x14')]['isRunning']){return ami['Action']({'action':_0xfa7c('0x16')})[_0xfa7c('0x5f')](function(_0x1d4cb5){_0x1414e1[_0xfa7c('0x14')]['id']=_0x1d4cb5[_0xfa7c('0x60')];_0x1414e1[_0xfa7c('0x14')][_0xfa7c('0x61')]=!![];_0x1414e1[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x1d4cb5[_0xfa7c('0x60')]]={};})[_0xfa7c('0x3f')](function(_0x5d9531){logger['error'](_0xfa7c('0x63'),util['inspect'](_0x5d9531,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xfa7c('0x37')]['createQueueSummaryReport']=function(_0x4e61bb,_0x126b2f){var _0x3d6e40;if(this[_0xfa7c('0x14')]&&this[_0xfa7c('0x14')][_0xfa7c('0x64')]&&this[_0xfa7c('0x14')][_0xfa7c('0x64')][_0x4e61bb[_0xfa7c('0x5a')]]){_0x3d6e40=this['summary'][_0xfa7c('0x64')][_0x4e61bb[_0xfa7c('0x5a')]][_0xfa7c('0x65')];}var _0x5a11d7=new VoiceQueueSummary(_0x4e61bb);return _0x5a11d7[_0xfa7c('0x66')](_0x126b2f[_0xfa7c('0x11')],this[_0xfa7c('0x11')],_0x3d6e40,this[_0xfa7c('0x67')][_0xfa7c('0x39')]);};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x68')]=function(_0x231c72,_0x5148f5){var _0x30265b=this[_0xfa7c('0x69')](_0x231c72,_0x5148f5);var _0x499f2c=![];_0x499f2c=_0x30265b[_0xfa7c('0x6a')](_0x231c72);if(_0x499f2c){Object[_0xfa7c('0x6b')](_0x231c72,_0x30265b);this[_0xfa7c('0x67')][_0xfa7c('0x12')][_0x231c72['name']]=_0x231c72;this['emitInboundVoiceQueueSummary'](_0x30265b);}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x1d')]=function(_0x387da3){var _0x947a51=null;var _0x5df609=this['summary']['id'];if(this[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x5df609]){_0x947a51=this['summary'][_0xfa7c('0x62')][_0x5df609][_0x387da3[_0xfa7c('0x60')]];}if(!_0x947a51){this[_0xfa7c('0x14')]=initializeSummary();return;}var _0x3d04e2=this[_0xfa7c('0x12')][_0x947a51[_0xfa7c('0x4f')]];if(_0x3d04e2[_0xfa7c('0x57')]===_0xfa7c('0x58')){this['handleInboundQueueSummaryReport'](_0x3d04e2,_0x947a51);}else if(_0x3d04e2[_0xfa7c('0x57')]===_0xfa7c('0x6c')){var _0xe4d256=this[_0xfa7c('0x69')](_0x3d04e2,_0x947a51);ami[_0xfa7c('0x48')](_0xfa7c('0x6d'),_0xe4d256);}this[_0xfa7c('0x14')][_0xfa7c('0x6e')]-=0x1;var _0x19795c=this[_0xfa7c('0x14')]['statusRequests']>0x0?!![]:![];if(!_0x19795c){return this[_0xfa7c('0x1a')](this[_0xfa7c('0x14')][_0xfa7c('0x6f')]);}};VoiceQueueReport[_0xfa7c('0x37')]['syncQueueMember']=function(_0x2390b4){var _0x88887=this[_0xfa7c('0x14')]['id'];if(this[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x88887]&&this[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x88887][_0x2390b4[_0xfa7c('0x60')]]){this[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x88887][_0x2390b4[_0xfa7c('0x60')]][_0xfa7c('0x11')][_0xfa7c('0x70')](_0x2390b4);}};VoiceQueueReport[_0xfa7c('0x37')]['syncQueueSummary']=function(_0x231591){var _0x40dac8=this;try{if(this[_0xfa7c('0x5c')](_0x231591)&&this[_0xfa7c('0x5c')](_0x231591[_0xfa7c('0x4f')])){logger[_0xfa7c('0x4a')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xfa7c('0x42')](_0x231591,{'showHidden':![],'depth':null}));var _0x16a14e=this[_0xfa7c('0x12')][_0x231591[_0xfa7c('0x4f')]];if(_0x16a14e){logger[_0xfa7c('0x4a')](_0xfa7c('0x71'),_0x16a14e['name']);this['summary'][_0xfa7c('0x64')][_0x16a14e[_0xfa7c('0x5a')]]={'summaryEvent':_0x231591};this[_0xfa7c('0x14')][_0xfa7c('0x6e')]+=0x1;return ami[_0xfa7c('0x3c')]({'action':_0xfa7c('0x62'),'queue':_0x16a14e[_0xfa7c('0x5a')]})[_0xfa7c('0x5f')](function(_0x327729){if(!_0x40dac8[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x231591['actionid']]){_0x40dac8[_0xfa7c('0x14')]['queuestatus'][_0x231591[_0xfa7c('0x60')]]={};}_0x40dac8[_0xfa7c('0x14')][_0xfa7c('0x62')][_0x231591['actionid']][_0x327729['actionid']]={'queue':_0x16a14e[_0xfa7c('0x5a')],'agents':[]};})[_0xfa7c('0x3f')](function(_0xe6e478){throw _0xe6e478;});}}}catch(_0x57d71b){logger[_0xfa7c('0x40')](_0xfa7c('0x63'),util['inspect'](_0x57d71b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x1a')]=function(_0xff23c2){if(this[_0xfa7c('0x14')]['statusRequests']>0x0){this[_0xfa7c('0x14')]['completeEvent']=_0xff23c2;return;}logger[_0xfa7c('0x4a')](_0xfa7c('0x72'),util[_0xfa7c('0x42')](_0xff23c2,{'showHidden':![],'depth':null}));this[_0xfa7c('0x14')]=initializeSummary();ami['emit'](_0xfa7c('0x73'),{});};VoiceQueueReport[_0xfa7c('0x37')]['syncQueueCallerJoin']=function(_0xb167ce){try{if(this['isNotNull'](_0xb167ce)){logger['debug'](_0xfa7c('0x74'),_0xb167ce['uniqueid'],util[_0xfa7c('0x42')](_0xb167ce,{'showHidden':![],'depth':null}));if(_[_0xfa7c('0x5d')](this[_0xfa7c('0x10')][_0xb167ce[_0xfa7c('0x4c')]])){this[_0xfa7c('0x10')][_0xb167ce['uniqueid']]=[];}if(_[_0xfa7c('0x5d')](this[_0xfa7c('0x39')][_0xb167ce[_0xfa7c('0x4c')]])){this['channels'][_0xb167ce['uniqueid']]={};}var _0xc444a9=new QueueReport();_0xc444a9[_0xfa7c('0x4f')]=_0xb167ce[_0xfa7c('0x4f')];_0xc444a9[_0xfa7c('0x57')]=this[_0xfa7c('0x12')][_0xc444a9[_0xfa7c('0x4f')]]&&this[_0xfa7c('0x12')][_0xc444a9[_0xfa7c('0x4f')]][_0xfa7c('0x57')]?this[_0xfa7c('0x12')][_0xc444a9['queue']][_0xfa7c('0x57')]||_0xfa7c('0x58'):_0xfa7c('0x58');_0xc444a9[_0xfa7c('0x75')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0xc444a9[_0xfa7c('0x77')]=_0xb167ce[_0xfa7c('0x77')];_0xc444a9[_0xfa7c('0x78')]=_0xb167ce[_0xfa7c('0x78')];_0xc444a9[_0xfa7c('0x4c')]=_0xb167ce[_0xfa7c('0x4c')];_0xc444a9[_0xfa7c('0x79')]=this[_0xfa7c('0x39')][_0xb167ce[_0xfa7c('0x4c')]][_0xfa7c('0x79')];logger[_0xfa7c('0x7a')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0xc444a9[_0xfa7c('0x4f')],_0xc444a9[_0xfa7c('0x57')]);Object['assign'](_0xc444a9,_[_0xfa7c('0x7b')](_0xb167ce,_[_0xfa7c('0x7c')](_0xc444a9)));this[_0xfa7c('0x10')][_0xb167ce[_0xfa7c('0x4c')]]['push'](_0xc444a9);this[_0xfa7c('0x39')][_0xb167ce[_0xfa7c('0x4c')]]=_0xc444a9;this[_0xfa7c('0x49')](_0xc444a9,_0xfa7c('0x7d'));}}catch(_0x18a6ab){logger[_0xfa7c('0x40')](_0xfa7c('0x74'),_0xb167ce[_0xfa7c('0x4c')],util['inspect'](_0x18a6ab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x7e')]=function(_0x4d79d2){try{if(this[_0xfa7c('0x5c')](_0x4d79d2)){logger[_0xfa7c('0x4a')]('[%s][voiceQueueReport][queuecallerabandon]',_0x4d79d2['uniqueid'],util[_0xfa7c('0x42')](_0x4d79d2,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x4d79d2[_0xfa7c('0x4c')]]){var _0x11ec77=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0x4d79d2['uniqueid']]);_0x11ec77['queuecallercomplete']=![];_0x11ec77['queuecallercompleteAt']=null;_0x11ec77[_0xfa7c('0x80')]=_0x4d79d2[_0xfa7c('0x80')];_0x11ec77[_0xfa7c('0x81')]=_0x4d79d2[_0xfa7c('0x81')];_0x11ec77[_0xfa7c('0x1f')]=!![];_0x11ec77['queuecallerabandonAt']=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x11ec77['queuecallerexitreason']=_0xfa7c('0x82');_0x11ec77['lastAssignedTo']=null;logger[_0xfa7c('0x7a')](_0xfa7c('0x83'),_0x11ec77[_0xfa7c('0x4f')],_0x11ec77['type']);this['channels'][_0x4d79d2['uniqueid']]=_0x11ec77;this[_0xfa7c('0x52')](_0x11ec77,_0xfa7c('0x1f'));}}}catch(_0x35d2cd){logger[_0xfa7c('0x40')](_0xfa7c('0x84'),_0x4d79d2[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x35d2cd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x5c549d){try{if(this['isNotNull'](_0x5c549d)){logger[_0xfa7c('0x4a')](_0xfa7c('0x85'),_0x5c549d[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x5c549d,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x5c549d[_0xfa7c('0x4c')]]){var _0x411217=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0x5c549d['uniqueid']]);_0x411217[_0xfa7c('0x86')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x411217['connectedlinenum']=_0x5c549d['connectedlinenum'];_0x411217[_0xfa7c('0x87')]=_0x5c549d[_0xfa7c('0x87')];logger[_0xfa7c('0x7a')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x411217[_0xfa7c('0x4f')],_0x411217[_0xfa7c('0x57')],_0x5c549d[_0xfa7c('0x88')],_0x5c549d[_0xfa7c('0x87')]);this[_0xfa7c('0x39')][_0x5c549d[_0xfa7c('0x4c')]]=_0x411217;this[_0xfa7c('0x49')](_0x411217,_0xfa7c('0x20'));}}}catch(_0x1a061a){logger[_0xfa7c('0x40')](_0xfa7c('0x85'),_0x5c549d[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x1a061a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')]['syncAgentConnect']=function(_0x3d60ea){try{if(this[_0xfa7c('0x5c')](_0x3d60ea)){logger[_0xfa7c('0x4a')](_0xfa7c('0x89'),_0x3d60ea[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x3d60ea,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x3d60ea[_0xfa7c('0x4c')]]){var _0x3ea157=_['last'](this['queueReports'][_0x3d60ea[_0xfa7c('0x4c')]]);_0x3ea157[_0xfa7c('0x36')]=!![];_0x3ea157[_0xfa7c('0x54')]=_0xfa7c('0x8a');logger[_0xfa7c('0x7a')](_0xfa7c('0x8b'),_0x3ea157[_0xfa7c('0x4f')],_0x3ea157[_0xfa7c('0x57')]);}}}catch(_0x5168da){logger[_0xfa7c('0x40')](_0xfa7c('0x89'),_0x3d60ea[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x5168da,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x22')]=function(_0x44cf49){try{if(this[_0xfa7c('0x5c')](_0x44cf49)){logger[_0xfa7c('0x4a')](_0xfa7c('0x8c'),_0x44cf49[_0xfa7c('0x4c')],util['inspect'](_0x44cf49,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x44cf49[_0xfa7c('0x4c')]]){var _0x3a97e7=_['last'](this['queueReports'][_0x44cf49['uniqueid']]);_0x3a97e7['queuecallerabandon']=![];_0x3a97e7[_0xfa7c('0x8d')]=null;_0x3a97e7['assigned']=!![];_0x3a97e7['lastAssignedTo']=_0x44cf49[_0xfa7c('0x8e')];_0x3a97e7[_0xfa7c('0x80')]=_0x44cf49[_0xfa7c('0x80')];_0x3a97e7['queuecallercomplete']=!![];_0x3a97e7[_0xfa7c('0x35')]=![];_0x3a97e7[_0xfa7c('0x8f')]=null;if(!_0x3a97e7['transfer']){if(_0x44cf49['reason']==_0xfa7c('0x90')){_0x3a97e7[_0xfa7c('0x54')]=_0xfa7c('0x91');logger[_0xfa7c('0x7a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x3a97e7[_0xfa7c('0x4f')],_0x3a97e7[_0xfa7c('0x57')]);}else{if(_[_0xfa7c('0x92')](_0x44cf49[_0xfa7c('0x3e')][_0xfa7c('0x93')](),_0xfa7c('0x94'))){if(this[_0xfa7c('0x10')][_0x44cf49['linkedid']]){var _0x3f574d=_[_0xfa7c('0x7f')](this['queueReports'][_0x44cf49[_0xfa7c('0x95')]]);_0x3f574d[_0xfa7c('0x36')]=![];_0x3f574d[_0xfa7c('0x35')]=!![];_0x3f574d['queuecallerexitAt']=moment(_0x3a97e7[_0xfa7c('0x75')])[_0xfa7c('0x96')](_0x44cf49['holdtime'],_0xfa7c('0x97'))[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x3f574d[_0xfa7c('0x54')]=_0xfa7c('0x98');_0x3f574d[_0xfa7c('0x90')]=!![];_0x3f574d[_0xfa7c('0x99')]=_0xfa7c('0x9a');_0x3f574d[_0xfa7c('0x9b')]=_0x44cf49[_0xfa7c('0x9c')];_0x3f574d[_0xfa7c('0x9d')]=_0x44cf49[_0xfa7c('0x4c')];logger[_0xfa7c('0x7a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x3f574d[_0xfa7c('0x4f')],_0x3f574d['type']);var _0x58ea14=this['queueReports'][_0x44cf49[_0xfa7c('0x95')]];this['queueReports'][_0x44cf49[_0xfa7c('0x95')]]=this[_0xfa7c('0x10')][_0x44cf49[_0xfa7c('0x4c')]];this[_0xfa7c('0x10')][_0x44cf49[_0xfa7c('0x4c')]]=_0x58ea14;}}else{_0x3a97e7[_0xfa7c('0x54')]='COMPLETEDBY'+_0x44cf49[_0xfa7c('0x9e')][_0xfa7c('0x9f')]();logger[_0xfa7c('0x7a')](_0xfa7c('0xa0'),_0x3a97e7['queue'],_0x3a97e7[_0xfa7c('0x57')],_0x3a97e7[_0xfa7c('0x54')]);}}}this[_0xfa7c('0x39')][_0x44cf49[_0xfa7c('0x4c')]]=_0x3a97e7;}}}catch(_0x155dbf){logger[_0xfa7c('0x40')](_0xfa7c('0x8c'),_0x44cf49[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x155dbf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x25')]=function(_0x202d17){try{if(this[_0xfa7c('0x5c')](_0x202d17)){logger['debug'](_0xfa7c('0xa1'),_0x202d17[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x202d17,{'showHidden':![],'depth':null}));this[_0xfa7c('0xa2')](_0x202d17[_0xfa7c('0x4c')],_[_0xfa7c('0x7c')](_0x202d17[_0xfa7c('0xa3')])[0x0],_0x202d17[_0xfa7c('0xa4')]);if(this[_0xfa7c('0x10')][_0x202d17['uniqueid']]){var _0x5d2d29=_['last'](this['queueReports'][_0x202d17[_0xfa7c('0x4c')]]);if(_0x5d2d29){if(this[_0xfa7c('0x5c')](_0x202d17['variable'])&&this[_0xfa7c('0x5c')](_0x202d17[_0xfa7c('0xa3')][_0xfa7c('0x62')])){switch(_0x202d17['value']){case _0xfa7c('0xa5'):_0x5d2d29[_0xfa7c('0x35')]=![];_0x5d2d29[_0xfa7c('0x8f')]=null;break;case _0xfa7c('0xa6'):_0x5d2d29[_0xfa7c('0xa7')]=_0xfa7c('0xa8');_0x5d2d29[_0xfa7c('0x35')]=!![];_0x5d2d29[_0xfa7c('0x8f')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x5d2d29[_0xfa7c('0x86')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x202d17['uniqueid'],util[_0xfa7c('0x42')](_0x5d2d29,{'showHidden':![],'depth':null}));ami['emit'](_0xfa7c('0xa9'),_0x5d2d29);break;default:_0x5d2d29[_0xfa7c('0x35')]=!![];_0x5d2d29[_0xfa7c('0x8f')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x5d2d29['queuecallerleaveAt']=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));}_0x5d2d29[_0xfa7c('0x1f')]=![];_0x5d2d29[_0xfa7c('0x8d')]=null;_0x5d2d29['queuecallerexitreason']=_0x202d17['value'];this[_0xfa7c('0x39')][_0x202d17[_0xfa7c('0x4c')]]=_0x5d2d29;this[_0xfa7c('0x52')](_0x5d2d29,_0xfa7c('0xaa'));}else if(this[_0xfa7c('0x5c')](_0x202d17['variable'])&&this[_0xfa7c('0x5c')](_0x202d17['variable']['queueposition'])){if(!_0x5d2d29[_0xfa7c('0x1f')]){_0x5d2d29[_0xfa7c('0x35')]=!![];_0x5d2d29[_0xfa7c('0x8f')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x5d2d29[_0xfa7c('0x54')]=_0xfa7c('0xab');_0x5d2d29['queuecallerleaveAt']=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));this['channels'][_0x202d17['uniqueid']]=_0x5d2d29;}}logger[_0xfa7c('0x7a')](_0xfa7c('0xac'),_0x202d17['uniqueid'],_0x5d2d29['queue'],_0x5d2d29[_0xfa7c('0x57')],_['keys'](_0x202d17[_0xfa7c('0xa3')])[0x0],_0x202d17['value']);_0x5d2d29[_0xfa7c('0x15')]=this['variables'][_0x202d17[_0xfa7c('0x4c')]];}}}}catch(_0x15c821){logger[_0xfa7c('0x40')](_0xfa7c('0xa1'),_0x202d17[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x15c821,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0xa2')]=function(_0x1ca1a3,_0xed3cd8,_0x1ccfe4){var _0xe12134=[_0xfa7c('0xad'),_0xfa7c('0xae'),_0xfa7c('0xaf'),_0xfa7c('0xb0'),'rtpaudioqosloss',_0xfa7c('0xb1'),'rtpaudioqosrtt',_0xfa7c('0xb2'),'sipcallid','sipuri',_0xfa7c('0xb3'),_0xfa7c('0xb4'),_0xfa7c('0xb5'),_0xfa7c('0xb6'),_0xfa7c('0xb7'),_0xfa7c('0xb8'),_0xfa7c('0x8e'),_0xfa7c('0xb9'),_0xfa7c('0xba')];if(!_[_0xfa7c('0x3b')](_0xed3cd8)&&!_['includes'](_0xe12134,_0xed3cd8)){if(_[_0xfa7c('0x5d')](this[_0xfa7c('0x15')][_0x1ca1a3])){this[_0xfa7c('0x15')][_0x1ca1a3]={};}this[_0xfa7c('0x15')][_0x1ca1a3][_0xed3cd8]=_0x1ccfe4;}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0xbb')]=function(_0x6e90f6,_0x2ce986,_0x5e6987){try{var _0x2f2aa6={};if(this['queueReports'][_0x6e90f6]){for(var _0x233a72=0x0;_0x233a72<this['queueReports'][_0x6e90f6][_0xfa7c('0xbc')];_0x233a72+=0x1){_0x2f2aa6=this[_0xfa7c('0x10')][_0x6e90f6][_0x233a72];var _0x1d43e1=this[_0xfa7c('0x12')][_0x2f2aa6[_0xfa7c('0x4f')]];if(_0x1d43e1){_0x1d43e1[_0xfa7c('0xbd')]+=moment(_0x2f2aa6[_0xfa7c('0x86')])[_0xfa7c('0xbe')](_0x2f2aa6[_0xfa7c('0x75')],'seconds')||0x0;if(_0x5e6987&&_0x2f2aa6['queuecallerexitreason']===_0xfa7c('0xbf')){_0x2f2aa6[_0xfa7c('0x54')]=_0xfa7c('0x8a');}if(_0x233a72===this[_0xfa7c('0x10')][_0x6e90f6][_0xfa7c('0xbc')]-0x1){_0x1d43e1[_0xfa7c('0xc0')]+=moment()[_0xfa7c('0xc1')](0x0)[_0xfa7c('0xbe')](_0x2f2aa6['queuecallerjoinAt'],_0xfa7c('0x97'));if(hasCallerLeftTheQueue(_0x2f2aa6)&&_0x2f2aa6[_0xfa7c('0x54')]!==_0xfa7c('0xbf')){_0x1d43e1[_0xfa7c('0xc2')]+=0x1;}if(_0x2f2aa6[_0xfa7c('0x36')]){_0x1d43e1[_0xfa7c('0xc3')]+=0x1;_0x1d43e1[_0xfa7c('0xc4')]+=moment()[_0xfa7c('0xc1')](0x0)['diff'](_0x2f2aa6[_0xfa7c('0x86')],_0xfa7c('0x97'));_0x2f2aa6[_0xfa7c('0xc5')]=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));_0x2f2aa6[_0xfa7c('0x35')]=![];_0x2f2aa6[_0xfa7c('0x8f')]=null;}if(_0x2f2aa6[_0xfa7c('0x35')]&&_0x2f2aa6[_0xfa7c('0x90')]!=!![]){_0x1d43e1['unmanaged']+=0x1;_0x2f2aa6[_0xfa7c('0xa7')]='unmanaged';logger[_0xfa7c('0x4a')](_0xfa7c('0xc6'),_0x6e90f6,util[_0xfa7c('0x42')](_0x2f2aa6,{'showHidden':![],'depth':null}));ami[_0xfa7c('0x48')](_0xfa7c('0xc7'),_0x2f2aa6);}if(_0x2f2aa6[_0xfa7c('0x1f')]){_0x1d43e1[_0xfa7c('0xc8')]+=0x1;_0x2f2aa6['lastevent']='abandoned';logger[_0xfa7c('0x4a')](_0xfa7c('0xc9'),_0x6e90f6,util[_0xfa7c('0x42')](_0x2f2aa6,{'showHidden':![],'depth':null}));ami[_0xfa7c('0x48')]('custom:queuecallerabandon',_0x2f2aa6);}}else{_0x1d43e1[_0xfa7c('0xc0')]+=_0x1d43e1['sumHoldTime'];}logger[_0xfa7c('0x7a')](_0xfa7c('0xca'),_0x6e90f6,_0x2f2aa6[_0xfa7c('0x4f')],_0x2f2aa6[_0xfa7c('0x57')],_0x2ce986);this[_0xfa7c('0x39')][_0x6e90f6]=_0x2f2aa6;Object['assign'](this[_0xfa7c('0x12')][_0x2f2aa6[_0xfa7c('0x4f')]],_0x1d43e1);if(_0x2f2aa6[_0xfa7c('0x86')]){this['emitVoiceQueueChannelRemove'](_0x2f2aa6,_0xfa7c('0x26'));}}}logger['debug'](_0xfa7c('0xcb'),_0x6e90f6,util[_0xfa7c('0x42')](this[_0xfa7c('0x10')][_0x6e90f6],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x2f2aa6)&&_0x2f2aa6[_0xfa7c('0x54')]!==_0xfa7c('0xbf')){ami[_0xfa7c('0x48')](_0xfa7c('0xcc'),this['queueReports'][_0x6e90f6]);if(this['queueReports'][_0x6e90f6]){delete this[_0xfa7c('0x10')][_0x6e90f6];}if(this[_0xfa7c('0x39')][_0x6e90f6]){delete this[_0xfa7c('0x39')][_0x6e90f6];}if(this[_0xfa7c('0x15')][_0x6e90f6]){delete this[_0xfa7c('0x15')][_0x6e90f6];}}}}catch(_0x137e19){logger[_0xfa7c('0x40')](_0xfa7c('0xcd'),_0x6e90f6,util[_0xfa7c('0x42')](_0x137e19,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0xce')]=function(_0xaa1ec0){try{if(this[_0xfa7c('0x5c')](_0xaa1ec0)){logger[_0xfa7c('0x4a')]('[%s][voiceQueueReport][hangup]',_0xaa1ec0[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0xaa1ec0,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0xaa1ec0[_0xfa7c('0x4c')]]){return this[_0xfa7c('0xbb')](_0xaa1ec0[_0xfa7c('0x4c')],_0xaa1ec0['cause-txt'],![]);}if(this[_0xfa7c('0x10')][_0xaa1ec0[_0xfa7c('0x95')]]){if(_0xaa1ec0[_0xfa7c('0xcf')]==='21'){return;}return this['handleHangup'](_0xaa1ec0[_0xfa7c('0x95')],_0xaa1ec0[_0xfa7c('0xd0')],!![]);}var _0x308b65=Object[_0xfa7c('0x7c')](this[_0xfa7c('0x10')]);for(var _0x991bc4=0x0;_0x991bc4<_0x308b65[_0xfa7c('0xbc')];_0x991bc4++){var _0x20d0e3=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0x308b65[_0x991bc4]]);if(_0x20d0e3&&_0x20d0e3[_0xfa7c('0xd1')]===_0xaa1ec0[_0xfa7c('0x4c')]){return this[_0xfa7c('0xbb')](_0x20d0e3[_0xfa7c('0x4c')],_0xaa1ec0[_0xfa7c('0xd0')],!![]);}}if(!this[_0xfa7c('0x10')][_0xaa1ec0[_0xfa7c('0x4c')]]){logger[_0xfa7c('0x4a')]('[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed',_0xaa1ec0[_0xfa7c('0x4c')]);if(this[_0xfa7c('0x39')][_0xaa1ec0['uniqueid']]){delete this[_0xfa7c('0x39')][_0xaa1ec0[_0xfa7c('0x4c')]];}if(this['variables'][_0xaa1ec0['uniqueid']]){delete this['variables'][_0xaa1ec0[_0xfa7c('0x4c')]];}}}}catch(_0x304521){logger['error'](_0xfa7c('0xd2'),_0xaa1ec0['uniqueid'],util[_0xfa7c('0x42')](_0x304521,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x2a')]=function(_0xc8c75c){try{if(this[_0xfa7c('0x5c')](_0xc8c75c)){logger[_0xfa7c('0x4a')](_0xfa7c('0xd3'),_0xc8c75c['uniqueid'],util['inspect'](_0xc8c75c,{'showHidden':![],'depth':null}));var _0x14b9f0;var _0x30d4cb;var _0x47d52f;if(this['queueReports'][_0xc8c75c[_0xfa7c('0xd4')]]){_0x14b9f0=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd4')]]);_0x14b9f0[_0xfa7c('0x9b')]=_0xc8c75c[_0xfa7c('0xd5')];_0x14b9f0[_0xfa7c('0x9d')]=_0xc8c75c[_0xfa7c('0xd6')];_0x14b9f0[_0xfa7c('0x54')]=_0xfa7c('0xbf');_0x14b9f0[_0xfa7c('0x90')]=!![];_0x14b9f0[_0xfa7c('0x99')]=_0xfa7c('0xd7');if(this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd6')]]){_0x47d52f=this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd6')]];this['queueReports'][_0xc8c75c[_0xfa7c('0xd6')]]=this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd4')]];this['queueReports'][_0xc8c75c['transfereeuniqueid']]=_0x47d52f;_0x30d4cb=_['last'](this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd4')]]);_0x30d4cb[_0xfa7c('0x3a')]=!![];}logger[_0xfa7c('0x7a')](_0xfa7c('0xd8'),_0xc8c75c['uniqueid'],_0x14b9f0[_0xfa7c('0x4f')],_0x14b9f0[_0xfa7c('0x57')],_0x14b9f0[_0xfa7c('0x9b')],_0x14b9f0[_0xfa7c('0x9d')]);}else if(this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd9')]]){_0x14b9f0=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xd9')]]);_0x14b9f0['transferexten']=_0xc8c75c[_0xfa7c('0xda')];_0x14b9f0[_0xfa7c('0x9d')]=_0xc8c75c[_0xfa7c('0xdb')];_0x14b9f0[_0xfa7c('0x54')]=_0xfa7c('0xbf');_0x14b9f0['transfer']=!![];_0x14b9f0[_0xfa7c('0x99')]=_0xfa7c('0xd7');if(this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xdb')]]){_0x47d52f=this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xdb')]];this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xdb')]]=this['queueReports'][_0xc8c75c['transfertargetuniqueid']];this['queueReports'][_0xc8c75c[_0xfa7c('0xd9')]]=_0x47d52f;_0x30d4cb=_[_0xfa7c('0x7f')](this[_0xfa7c('0x10')][_0xc8c75c['transfertargetuniqueid']]);_0x30d4cb[_0xfa7c('0x3a')]=!![];}logger[_0xfa7c('0x7a')](_0xfa7c('0xd8'),_0xc8c75c[_0xfa7c('0x4c')],_0x14b9f0[_0xfa7c('0x4f')],_0x14b9f0[_0xfa7c('0x57')],_0x14b9f0[_0xfa7c('0x9b')],_0x14b9f0[_0xfa7c('0x9d')]);}else if(this['queueReports'][_0xc8c75c[_0xfa7c('0xdb')]]){_0x14b9f0=_['last'](this[_0xfa7c('0x10')][_0xc8c75c[_0xfa7c('0xdb')]]);_0x14b9f0[_0xfa7c('0x9b')]=_0xc8c75c[_0xfa7c('0xda')];_0x14b9f0[_0xfa7c('0x9d')]=_0xc8c75c[_0xfa7c('0xdb')];_0x14b9f0['queuecallerexitreason']='ATTENDEDTRANSFER';_0x14b9f0[_0xfa7c('0x90')]=!![];_0x14b9f0[_0xfa7c('0x99')]='ATTENDED';_0x14b9f0[_0xfa7c('0x3a')]=!![];_0x14b9f0[_0xfa7c('0xd1')]=_0xc8c75c[_0xfa7c('0xd4')];}else if(this[_0xfa7c('0x10')][_0xc8c75c['secondtransfereruniqueid']]){_0x14b9f0=_['last'](this[_0xfa7c('0x10')][_0xc8c75c['secondtransfereruniqueid']]);_0x14b9f0[_0xfa7c('0x9b')]=_0xc8c75c['secondtransfererexten'];_0x14b9f0['transferuniqueid']=_0xc8c75c[_0xfa7c('0xd6')];_0x14b9f0[_0xfa7c('0x54')]=_0xfa7c('0xbf');_0x14b9f0[_0xfa7c('0x90')]=!![];_0x14b9f0[_0xfa7c('0x99')]='ATTENDED';_0x14b9f0[_0xfa7c('0x3a')]=!![];_0x14b9f0['transferid']=_0xc8c75c[_0xfa7c('0xd9')];}}}catch(_0x41960d){logger[_0xfa7c('0x40')](_0xfa7c('0xd3'),_0xc8c75c[_0xfa7c('0x4c')],util['inspect'](_0x41960d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0x2c')]=function(_0x2c82c9){try{if(this[_0xfa7c('0x5c')](_0x2c82c9)){logger[_0xfa7c('0x4a')](_0xfa7c('0xdc'),_0x2c82c9[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x2c82c9,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x2c82c9['transfereeuniqueid']]){var _0x2cbd68=_['last'](this[_0xfa7c('0x10')][_0x2c82c9[_0xfa7c('0xd4')]]);_0x2cbd68[_0xfa7c('0x54')]=_0xfa7c('0xdd');_0x2cbd68[_0xfa7c('0x90')]=!![];_0x2cbd68['transfertype']=_0xfa7c('0xde');_0x2cbd68[_0xfa7c('0x9b')]=_0x2c82c9[_0xfa7c('0xdf')];_0x2cbd68[_0xfa7c('0x9d')]=_0x2c82c9['transfereeuniqueid'];logger['info'](_0xfa7c('0xe0'),_0x2c82c9['uniqueid'],_0x2cbd68['queue'],_0x2cbd68[_0xfa7c('0x57')],_0x2cbd68[_0xfa7c('0x9b')],_0x2cbd68[_0xfa7c('0x9d')]);this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x2c82c9[_0xfa7c('0xd4')],'context':_0x2c82c9[_0xfa7c('0xe1')],'channel':_0x2c82c9[_0xfa7c('0xe2')]});}}}catch(_0x3f65ac){logger[_0xfa7c('0x40')](_0xfa7c('0xdc'),_0x2c82c9[_0xfa7c('0x4c')],util['inspect'](_0x3f65ac,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xfa7c('0xe3')]=function(_0x41f850){try{if(this[_0xfa7c('0x5c')](_0x41f850)){logger[_0xfa7c('0x4a')](_0xfa7c('0xe4'),_0x41f850[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x41f850,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x41f850[_0xfa7c('0x4c')]]){var _0x1f8ae7=_['last'](this['queueReports'][_0x41f850['uniqueid']]);if(!_[_0xfa7c('0x3b')](_0x1f8ae7[_0xfa7c('0x86')])){_0x1f8ae7['mohstarttime']=moment()[_0xfa7c('0x4d')](_0xfa7c('0x76'));logger[_0xfa7c('0x7a')](_0xfa7c('0xe5'),_0x41f850[_0xfa7c('0x4c')],_0x1f8ae7[_0xfa7c('0xe6')]);}}}}catch(_0x4f337b){logger[_0xfa7c('0x40')](_0xfa7c('0xe4'),_0x41f850[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x4f337b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfa7c('0x37')][_0xfa7c('0xe7')]=function(_0x5b82f7){try{if(this[_0xfa7c('0x5c')](_0x5b82f7)){logger[_0xfa7c('0x4a')](_0xfa7c('0xe8'),_0x5b82f7[_0xfa7c('0x4c')],util['inspect'](_0x5b82f7,{'showHidden':![],'depth':null}));if(this[_0xfa7c('0x10')][_0x5b82f7['uniqueid']]){var _0x15132b=_['last'](this[_0xfa7c('0x10')][_0x5b82f7[_0xfa7c('0x4c')]]);if(!_[_0xfa7c('0x3b')](_0x15132b[_0xfa7c('0xe6')])){_0x15132b['mohtime']+=moment()[_0xfa7c('0xc1')](0x0)[_0xfa7c('0xbe')](_0x15132b[_0xfa7c('0xe6')],_0xfa7c('0x97'));logger[_0xfa7c('0x7a')](_0xfa7c('0xe9'),_0x5b82f7[_0xfa7c('0x4c')],_0x15132b['mohtime']);delete _0x15132b['mohstarttime'];}}}}catch(_0x4e5cd5){logger['error'](_0xfa7c('0xe8'),_0x5b82f7['uniqueid'],util['inspect'](_0x4e5cd5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xfa7c('0xea')]=function(_0x54ed24){try{if(this['isNotNull'](_0x54ed24)){logger['debug'](_0xfa7c('0xeb'),_0x54ed24[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x54ed24,{'showHidden':![],'depth':null}));if(_0x54ed24[_0xfa7c('0xec')][_0xfa7c('0x93')]()===_0xfa7c('0xed')){_0x54ed24[_0xfa7c('0xee')]=_0x54ed24['appdata']&&_0x54ed24[_0xfa7c('0xef')][_0xfa7c('0x92')]('CDR(routeAlias)')?_0x54ed24[_0xfa7c('0xef')]:(_0x54ed24[_0xfa7c('0xef')]||_0x54ed24['applicationdata'])[_0xfa7c('0x93')]();if(_['startsWith'](_0x54ed24[_0xfa7c('0xee')][_0xfa7c('0x93')](),_0xfa7c('0xf0'))){logger[_0xfa7c('0x7a')](_0xfa7c('0xf1'),_0x54ed24[_0xfa7c('0x4c')],_0x54ed24[_0xfa7c('0xec')],_0x54ed24['applicationdata']);if(_[_0xfa7c('0x5d')](this[_0xfa7c('0x39')][_0x54ed24[_0xfa7c('0x4c')]]))this['channels'][_0x54ed24[_0xfa7c('0x4c')]]={};var _0x5535c0=_0x54ed24[_0xfa7c('0xee')][_0xfa7c('0xf2')]('=');var _0x54994c=_0x5535c0[0x0][_0xfa7c('0x93')]()[_0xfa7c('0xf3')](/cdr\((.*)\)/);if(_0x54994c)this['channels'][_0x54ed24['uniqueid']][_0x54994c[0x1]]=_0x5535c0[0x1];}}}}catch(_0x4a7bef){logger[_0xfa7c('0x40')](_0xfa7c('0xf4'),_0x54ed24[_0xfa7c('0x4c')],util[_0xfa7c('0x42')](_0x4a7bef,{'showHidden':![],'depth':null}));}};module[_0xfa7c('0xf5')]=VoiceQueueReport;
\ No newline at end of file