Built motion from commit 1fa89557.|2.6.10
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index eed722c..3568ef5 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf19e=['[%s][voiceQueueReport][checkVariables]','clearQueueReport','voiceQueues','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','name','strategy','answered','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','Trunk','active','callerid','Interval','stringify','md5','voice_queue:save','isNotNull','queues','[voiceQueueReport][queues]','flagQueueSummary','then','[voiceQueueReport][queuesummary]','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','available','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueSummaryComplete','custom:queuesummarycomplete','syncQueueCallerJoin','isUndefined','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinename','connectedlinenum','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexitAt','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','custom:timeout','queueposition','EXITWITHKEY','keys','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberpenalty','includes','handleHangup','diff','length','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','cause-txt','cause','transferid','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstop]','mohtime','syncNewExten','set','applicationdata','appdata','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','[%s][voiceQueueReport][newexten]','exports','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype','tail','finally','sequence','agents','channels','campaigns','queuesummary','syncQueueSummary','bind','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','agentconnect','varset','syncVarSet','hangup','syncHangup','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','enqueue','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','queueReports','inspect','variables'];(function(_0x483fe0,_0x5772a7){var _0x2d8d74=function(_0x57c7bb){while(--_0x57c7bb){_0x483fe0['push'](_0x483fe0['shift']());}};_0x2d8d74(++_0x5772a7);}(_0xf19e,0x19d));var _0xef19=function(_0x9fcf2b,_0x5ab939){_0x9fcf2b=_0x9fcf2b-0x0;var _0x4b3a07=_0xf19e[_0x9fcf2b];return _0x4b3a07;};'use strict';var _=require('lodash');var moment=require(_0xef19('0x0'));var util=require('util');var md5=require('md5');var Redis=require(_0xef19('0x1'));var config=require(_0xef19('0x2'));var logger=require(_0xef19('0x3'))(_0xef19('0x4'));var ami=require(_0xef19('0x5'));var QueueReport=require(_0xef19('0x6'));config[_0xef19('0x7')]=_[_0xef19('0x8')](config[_0xef19('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xef19('0x9'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xef19('0xa')]['enqueue']=function(_0x4a1763){this[_0xef19('0xb')]=this[_0xef19('0xb')]?this[_0xef19('0xb')][_0xef19('0xc')](_0x4a1763):_0x4a1763();};function VoiceQueueReport(_0x33106b){this[_0xef19('0xd')]=new Sequence();this['queueReports']={};this[_0xef19('0xe')]=_0x33106b[_0xef19('0xe')];this[_0xef19('0xf')]=_0x33106b['queueChannels'];this['voiceQueues']=_0x33106b['voiceQueues'];this['flagQueueSummary']=!![];this[_0xef19('0x10')]=_0x33106b[_0xef19('0x10')];this['variables']={};ami['on'](_0xef19('0x11'),this[_0xef19('0x12')][_0xef19('0x13')](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete'][_0xef19('0x13')](this));ami['on'](_0xef19('0x14'),this['syncQueueCallerJoin'][_0xef19('0x13')](this));ami['on'](_0xef19('0x15'),this[_0xef19('0x16')][_0xef19('0x13')](this));ami['on'](_0xef19('0x17'),this[_0xef19('0x18')]['bind'](this));ami['on']('agentcomplete',this[_0xef19('0x19')][_0xef19('0x13')](this));ami['on'](_0xef19('0x1a'),this['syncAgentConnect'][_0xef19('0x13')](this));ami['on'](_0xef19('0x1b'),this[_0xef19('0x1c')][_0xef19('0x13')](this));ami['on'](_0xef19('0x1d'),this[_0xef19('0x1e')][_0xef19('0x13')](this));ami['on']('fullybooted',this[_0xef19('0x1f')][_0xef19('0x13')](this));ami['on']('musiconholdstart',this[_0xef19('0x20')][_0xef19('0x13')](this));ami['on'](_0xef19('0x21'),this[_0xef19('0x22')][_0xef19('0x13')](this));ami['on'](_0xef19('0x23'),this[_0xef19('0x24')][_0xef19('0x13')](this));ami['on']('blindtransfer',this[_0xef19('0x25')][_0xef19('0x13')](this));this[_0xef19('0x26')]();this[_0xef19('0x27')]();}function clearChannels(_0x5f3ec2){if(!_['isEmpty'](_0x5f3ec2)){for(var _0x14c4be in _0x5f3ec2){if(_0x5f3ec2['hasOwnProperty'](_0x14c4be)){delete _0x5f3ec2[_0x14c4be];}}}}function clearCampaigns(_0x53eb8b){if(!_[_0xef19('0x28')](_0x53eb8b)){for(var _0x2cc5fd in _0x53eb8b){if(_0x53eb8b[_0xef19('0x29')](_0x2cc5fd)){_0x53eb8b[_0x2cc5fd][_0xef19('0x2a')]=0x0;}}}}function clearVoiceQueues(_0x339094){if(!_[_0xef19('0x28')](_0x339094)){for(var _0x140c1d in _0x339094){if(_0x339094[_0xef19('0x29')](_0x140c1d)){_0x339094[_0x140c1d]['originated']=0x0;_0x339094[_0x140c1d]['talking']=0x0;_0x339094[_0x140c1d][_0xef19('0x2b')]=0x0;_0x339094[_0x140c1d][_0xef19('0x2c')]=0x0;_0x339094[_0x140c1d][_0xef19('0x2d')]=!![];}}}}function clearAgentBooked(_0x1f46d6){if(!_[_0xef19('0x28')](_0x1f46d6)){for(var _0x26d91 in _0x1f46d6){if(_0x1f46d6['hasOwnProperty'](_0x26d91)){_0x1f46d6[_0x26d91][_0xef19('0x2e')]=!![];}}}}VoiceQueueReport[_0xef19('0xa')][_0xef19('0x2f')]=function(){var _0x501ed1=this;for(var _0x363e80 in this['channels']){if(this[_0xef19('0xf')]['hasOwnProperty'](_0x363e80)&&!this[_0xef19('0xf')][_0x363e80][_0xef19('0x30')]){this['sequence'][_0xef19('0x31')](function(){if(!_[_0xef19('0x32')](_0x501ed1[_0xef19('0xf')][_0x363e80])){return ami[_0xef19('0x33')]({'action':_0xef19('0x34'),'channel':_0x501ed1[_0xef19('0xf')][_0x363e80][_0xef19('0x35')]})[_0xef19('0x36')](function(_0x58bc67){if(_0x58bc67[_0xef19('0x37')]===_0xef19('0x38')){setTimeout(function(){if(_0x501ed1[_0xef19('0xf')][_0x363e80]){delete _0x501ed1[_0xef19('0xf')][_0x363e80];logger[_0xef19('0x39')]('[%s][voiceQueueReport][checkChannel]',_0x363e80,util['inspect'](_0x58bc67,{'showHidden':![],'depth':null}));}if(_0x501ed1[_0xef19('0x3a')][_0x363e80]){delete _0x501ed1[_0xef19('0x3a')][_0x363e80];logger[_0xef19('0x39')]('[%s][voiceQueueReport][checkQueueReport]',_0x363e80,util[_0xef19('0x3b')](_0x58bc67,{'showHidden':![],'depth':null}));}if(_0x501ed1['variables'][_0x363e80]){delete _0x501ed1[_0xef19('0x3c')][_0x363e80];logger['error'](_0xef19('0x3d'),_0x363e80,util['inspect'](_0x58bc67,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x1f')]=function(){logger[_0xef19('0x39')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xef19('0xf')]);this[_0xef19('0x3e')](this[_0xef19('0x3a')]);clearAgentBooked(this[_0xef19('0xe')]);clearVoiceQueues(this[_0xef19('0x3f')]);clearCampaigns(this[_0xef19('0x10')]);};VoiceQueueReport['prototype'][_0xef19('0x3e')]=function(_0x22bf7e){var _0x25de80=this;if(!_[_0xef19('0x28')](_0x22bf7e)){for(var _0x140565 in _0x22bf7e){if(_0x22bf7e[_0xef19('0x29')](_0x140565)){_0x25de80[_0xef19('0x40')](_0x22bf7e[_0x140565],_0xef19('0x41'));delete _0x22bf7e[_0x140565];}}}};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x42')]=function(_0x53ae97,_0xeb740c,_0x4c950d){io['to'](_0x53ae97)[_0xef19('0x42')](_0xeb740c,_0x4c950d);};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x43')]=function(_0x3939bd,_0x2313e4){logger[_0xef19('0x44')](_0xef19('0x45')+_0x2313e4+_0xef19('0x46'),_0x3939bd[_0xef19('0x47')],util[_0xef19('0x3b')](_0x3939bd,{'showHidden':![],'depth':null}));this[_0xef19('0x42')](util[_0xef19('0x48')](_0xef19('0x49'),_0x3939bd['name']),_0xef19('0x4a'),_0x3939bd);io['emit'](_0xef19('0x4b'),_0x3939bd);};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x40')]=function(_0x803fcb,_0x229cd6){logger[_0xef19('0x44')](_0xef19('0x45')+_0x229cd6+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x803fcb['uniqueid'],util[_0xef19('0x3b')](_0x803fcb,{'showHidden':![],'depth':null}));if(_0x803fcb[_0xef19('0x4c')]===_0xef19('0x4d'))return;this[_0xef19('0x42')](util['format'](_0xef19('0x49'),_0x803fcb['name']),_0xef19('0x4e'),_0x803fcb);io[_0xef19('0x42')]('voice_queue_presence:remove',_0x803fcb);};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x4f')]=function(_0x661364,_0x41521b){if(_0x661364[_0xef19('0x50')]===_0xef19('0x51')){var _0x3fed0a={'id':_0x661364['id'],'name':_0x661364[_0xef19('0x52')],'strategy':_0x661364[_0xef19('0x53')],'answered':_0x661364[_0xef19('0x54')],'available':_0x661364['available'],'loggedIn':_0x661364[_0xef19('0x55')],'pTalking':_0x661364[_0xef19('0x2b')],'sumBillable':_0x661364[_0xef19('0x56')],'sumDuration':_0x661364[_0xef19('0x57')],'sumHoldTime':_0x661364[_0xef19('0x58')]||0x0,'talking':_0x661364[_0xef19('0x59')],'total':_0x661364[_0xef19('0x5a')],'type':_0x661364[_0xef19('0x50')],'unmanaged':_0x661364[_0xef19('0x5b')],'abandoned':_0x661364[_0xef19('0x5c')],'waiting':_0x661364[_0xef19('0x2c')]};if(_0x661364['Trunk']){_0x3fed0a[_0xef19('0x5d')]={'id':_0x661364['Trunk']['id'],'name':_0x661364['Trunk']['name'],'active':_0x661364[_0xef19('0x5d')][_0xef19('0x5e')],'callerid':_0x661364[_0xef19('0x5d')][_0xef19('0x5f')]};}if(_0x661364['Interval']){_0x3fed0a[_0xef19('0x60')]={'id':_0x661364['Interval']['id'],'name':_0x661364[_0xef19('0x60')][_0xef19('0x52')]};}var _0x9901d=md5(JSON[_0xef19('0x61')](_0x3fed0a));if(_0x661364[_0xef19('0x62')]!==_0x9901d){_0x661364[_0xef19('0x62')]=_0x9901d;logger[_0xef19('0x44')]('[voiceQueueReport]['+_0x41521b+']\x20sending\x20voice_queue:save\x20event:',util[_0xef19('0x3b')](_0x3fed0a,{'showHidden':![],'depth':null}));this[_0xef19('0x42')](util[_0xef19('0x48')](_0xef19('0x49'),_0x3fed0a[_0xef19('0x52')]),_0xef19('0x63'),_0x3fed0a);}}};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x64')]=function(_0x356fff){return _0x356fff!==null&&!_['isUndefined'](_0x356fff);};VoiceQueueReport[_0xef19('0xa')]['loopQueueShow']=function(){var _0x11b66b=this;setInterval(function(){_0x11b66b[_0xef19('0x2f')]();ami['Action']({'action':_0xef19('0x65')})['catch'](function(_0x2449d5){logger[_0xef19('0x39')](_0xef19('0x66'),util['inspect'](_0x2449d5,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0xef19('0x26')]=function(){var _0x643e1c=this;setInterval(function(){if(_0x643e1c[_0xef19('0x67')]){return ami[_0xef19('0x33')]({'action':_0xef19('0x11')})[_0xef19('0x68')](function(){_0x643e1c[_0xef19('0x67')]=![];})['catch'](function(_0x1824db){logger['error'](_0xef19('0x69'),util[_0xef19('0x3b')](_0x1824db,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x12')]=function(_0x7293d){try{if(this[_0xef19('0x64')](_0x7293d)&&this[_0xef19('0x64')](_0x7293d[_0xef19('0x6a')])){logger[_0xef19('0x44')]('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x7293d,{'showHidden':![],'depth':null}));if(this[_0xef19('0x3f')][_0x7293d[_0xef19('0x6a')]]){logger[_0xef19('0x6b')](_0xef19('0x6c'),_0x7293d[_0xef19('0x6a')]);var _0x215166=_[_0xef19('0x6d')](this['channels'],_0xef19('0x6a'))[_0x7293d[_0xef19('0x6a')]]||0x0;var _0x2a3894=_0x215166-_0x7293d[_0xef19('0x6e')];if(this[_0xef19('0x3f')][_0x7293d[_0xef19('0x6a')]][_0xef19('0x2c')]!==_[_0xef19('0x6f')](_0x7293d[_0xef19('0x6e')])||this[_0xef19('0x3f')][_0x7293d[_0xef19('0x6a')]][_0xef19('0x55')]!==_[_0xef19('0x6f')](_0x7293d[_0xef19('0x70')])||this[_0xef19('0x3f')][_0x7293d[_0xef19('0x6a')]][_0xef19('0x71')]!==_[_0xef19('0x6f')](_0x7293d['available'])||this[_0xef19('0x3f')][_0x7293d[_0xef19('0x6a')]][_0xef19('0x59')]!==_0x2a3894){this[_0xef19('0x3f')][_0x7293d[_0xef19('0x6a')]][_0xef19('0x2c')]=_[_0xef19('0x6f')](_0x7293d[_0xef19('0x6e')]);this[_0xef19('0x3f')][_0x7293d[_0xef19('0x6a')]][_0xef19('0x55')]=_[_0xef19('0x6f')](_0x7293d[_0xef19('0x70')]);this[_0xef19('0x3f')][_0x7293d[_0xef19('0x6a')]][_0xef19('0x71')]=_[_0xef19('0x6f')](_0x7293d['available']);this[_0xef19('0x3f')][_0x7293d[_0xef19('0x6a')]][_0xef19('0x59')]=_0x2a3894>0x0?_0x2a3894:0x0;this['voiceQueues'][_0x7293d['queue']][_0xef19('0x59')]=this[_0xef19('0x3f')][_0x7293d[_0xef19('0x6a')]][_0xef19('0x59')]>_[_0xef19('0x6f')](_0x7293d[_0xef19('0x70')])?_[_0xef19('0x6f')](_0x7293d['loggedin']):this[_0xef19('0x3f')][_0x7293d['queue']]['talking'];this[_0xef19('0x4f')](this[_0xef19('0x3f')][_0x7293d[_0xef19('0x6a')]],'queuesummary');}logger['debug'](_0xef19('0x72'),util[_0xef19('0x3b')](this[_0xef19('0x3f')][_0x7293d['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0xef19('0x73'),this[_0xef19('0x3f')][_0x7293d[_0xef19('0x6a')]]);}}}catch(_0x3152fa){logger[_0xef19('0x39')]('[voiceQueueReport][queuesummary]',util[_0xef19('0x3b')](_0x3152fa,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x74')]=function(_0xa2c2b2){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0xef19('0x3b')](_0xa2c2b2,{'showHidden':![],'depth':null}));ami[_0xef19('0x42')](_0xef19('0x75'),{});this[_0xef19('0x67')]=!![];};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x76')]=function(_0x5b965d){try{if(this[_0xef19('0x64')](_0x5b965d)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x5b965d[_0xef19('0x47')],util[_0xef19('0x3b')](_0x5b965d,{'showHidden':![],'depth':null}));if(_[_0xef19('0x77')](this[_0xef19('0x3a')][_0x5b965d[_0xef19('0x47')]]))this['queueReports'][_0x5b965d[_0xef19('0x47')]]=[];if(_[_0xef19('0x77')](this['channels'][_0x5b965d[_0xef19('0x47')]]))this['channels'][_0x5b965d['uniqueid']]={};var _0x183dcb=new QueueReport();_0x183dcb[_0xef19('0x52')]=_0x5b965d[_0xef19('0x6a')];_0x183dcb[_0xef19('0x50')]=this[_0xef19('0x3f')][_0x183dcb[_0xef19('0x52')]]&&this[_0xef19('0x3f')][_0x183dcb[_0xef19('0x52')]][_0xef19('0x50')]?this[_0xef19('0x3f')][_0x183dcb[_0xef19('0x52')]][_0xef19('0x50')]||_0xef19('0x51'):_0xef19('0x51');_0x183dcb[_0xef19('0x6a')]=_0x5b965d[_0xef19('0x6a')];_0x183dcb['queuecallerjoinAt']=moment()[_0xef19('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x183dcb[_0xef19('0x78')]=_0x5b965d[_0xef19('0x78')];_0x183dcb[_0xef19('0x79')]=_0x5b965d[_0xef19('0x79')];_0x183dcb['uniqueid']=_0x5b965d['uniqueid'];_0x183dcb[_0xef19('0x7a')]=this[_0xef19('0xf')][_0x5b965d[_0xef19('0x47')]][_0xef19('0x7a')];logger[_0xef19('0x6b')](_0xef19('0x7b'),_0x183dcb['name'],_0x183dcb[_0xef19('0x50')]);_[_0xef19('0x7c')](_0x183dcb,_['pick'](_0x5b965d,_['keys'](_0x183dcb)));this[_0xef19('0x3a')][_0x5b965d['uniqueid']]['push'](_0x183dcb);this[_0xef19('0xf')][_0x5b965d[_0xef19('0x47')]]=_0x183dcb;this['emitVoiceQueueChannelSave'](_0x183dcb,'queuecallerjoin');}}catch(_0x39d113){logger['error'](_0xef19('0x7d'),_0x5b965d[_0xef19('0x47')],util[_0xef19('0x3b')](_0x39d113,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x16')]=function(_0x28e9de){try{if(this[_0xef19('0x64')](_0x28e9de)){logger['debug'](_0xef19('0x7e'),_0x28e9de['uniqueid'],util[_0xef19('0x3b')](_0x28e9de,{'showHidden':![],'depth':null}));if(this[_0xef19('0x3a')][_0x28e9de[_0xef19('0x47')]]){var _0x4c3e8f=_['last'](this[_0xef19('0x3a')][_0x28e9de[_0xef19('0x47')]]);_0x4c3e8f['queuecallercomplete']=![];_0x4c3e8f[_0xef19('0x7f')]=null;_0x4c3e8f['holdtime']=_0x28e9de[_0xef19('0x80')];_0x4c3e8f[_0xef19('0x81')]=_0x28e9de[_0xef19('0x81')];_0x4c3e8f['queuecallerabandon']=!![];_0x4c3e8f[_0xef19('0x82')]=moment()['format'](_0xef19('0x83'));_0x4c3e8f[_0xef19('0x4c')]=_0xef19('0x84');_0x4c3e8f[_0xef19('0x85')]=null;logger[_0xef19('0x6b')](_0xef19('0x86'),_0x4c3e8f['name'],_0x4c3e8f[_0xef19('0x50')]);this[_0xef19('0xf')][_0x28e9de[_0xef19('0x47')]]=_0x4c3e8f;this[_0xef19('0x40')](_0x4c3e8f,_0xef19('0x15'));}}}catch(_0x575b9a){logger[_0xef19('0x39')](_0xef19('0x7e'),_0x28e9de[_0xef19('0x47')],util[_0xef19('0x3b')](_0x575b9a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x18')]=function(_0x22bc23){try{if(this[_0xef19('0x64')](_0x22bc23)){logger[_0xef19('0x44')](_0xef19('0x87'),_0x22bc23['uniqueid'],util['inspect'](_0x22bc23,{'showHidden':![],'depth':null}));if(this[_0xef19('0x3a')][_0x22bc23[_0xef19('0x47')]]){var _0x22fc7d=_[_0xef19('0x88')](this['queueReports'][_0x22bc23[_0xef19('0x47')]]);_0x22fc7d[_0xef19('0x89')]=moment()[_0xef19('0x48')](_0xef19('0x83'));_0x22fc7d['connectedlinenum']=_0x22bc23['connectedlinenum'];_0x22fc7d['connectedlinename']=_0x22bc23[_0xef19('0x8a')];logger[_0xef19('0x6b')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x22fc7d[_0xef19('0x52')],_0x22fc7d[_0xef19('0x50')],_0x22bc23[_0xef19('0x8b')],_0x22bc23[_0xef19('0x8a')]);this[_0xef19('0xf')][_0x22bc23[_0xef19('0x47')]]=_0x22fc7d;this[_0xef19('0x43')](_0x22fc7d,_0xef19('0x17'));}}}catch(_0x2ce2a3){logger[_0xef19('0x39')](_0xef19('0x87'),_0x22bc23[_0xef19('0x47')],util[_0xef19('0x3b')](_0x2ce2a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xef19('0x8c')]=function(_0x48dd7a){try{if(this[_0xef19('0x64')](_0x48dd7a)){logger[_0xef19('0x44')](_0xef19('0x8d'),_0x48dd7a[_0xef19('0x47')],util[_0xef19('0x3b')](_0x48dd7a,{'showHidden':![],'depth':null}));if(this[_0xef19('0x3a')][_0x48dd7a['uniqueid']]){var _0x4a0bd7=_[_0xef19('0x88')](this['queueReports'][_0x48dd7a['uniqueid']]);_0x4a0bd7[_0xef19('0x8e')]=!![];_0x4a0bd7['queuecallerexitreason']=_0xef19('0x8f');logger[_0xef19('0x6b')](_0xef19('0x90'),_0x4a0bd7[_0xef19('0x52')],_0x4a0bd7[_0xef19('0x50')]);}}}catch(_0x53d8d1){logger['error']('[%s][voiceQueueReport][agentconnect]',_0x48dd7a['uniqueid'],util[_0xef19('0x3b')](_0x53d8d1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xef19('0xa')]['syncAgentComplete']=function(_0xe8e200){try{if(this[_0xef19('0x64')](_0xe8e200)){logger[_0xef19('0x44')](_0xef19('0x91'),_0xe8e200[_0xef19('0x47')],util[_0xef19('0x3b')](_0xe8e200,{'showHidden':![],'depth':null}));if(this[_0xef19('0x3a')][_0xe8e200[_0xef19('0x47')]]){var _0x393b94=_[_0xef19('0x88')](this[_0xef19('0x3a')][_0xe8e200[_0xef19('0x47')]]);_0x393b94[_0xef19('0x15')]=![];_0x393b94[_0xef19('0x82')]=null;_0x393b94[_0xef19('0x92')]=!![];_0x393b94[_0xef19('0x85')]=_0xe8e200[_0xef19('0x93')];_0x393b94[_0xef19('0x80')]=_0xe8e200[_0xef19('0x80')];_0x393b94['queuecallercomplete']=!![];_0x393b94[_0xef19('0x94')]=![];_0x393b94['queuecallerexitAt']=null;if(!_0x393b94[_0xef19('0x95')]){if(_0xe8e200[_0xef19('0x96')]==_0xef19('0x95')){_0x393b94[_0xef19('0x4c')]=_0xef19('0x97');logger[_0xef19('0x6b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x393b94[_0xef19('0x52')],_0x393b94['type']);}else{if(_[_0xef19('0x98')](_0xe8e200[_0xef19('0x35')][_0xef19('0x99')](),_0xef19('0x9a'))){if(this[_0xef19('0x3a')][_0xe8e200[_0xef19('0x9b')]]){var _0x3f0b1c=_[_0xef19('0x88')](this[_0xef19('0x3a')][_0xe8e200[_0xef19('0x9b')]]);_0x3f0b1c['queuecallercomplete']=![];_0x3f0b1c[_0xef19('0x94')]=!![];_0x3f0b1c[_0xef19('0x9c')]=moment(_0x393b94[_0xef19('0x9d')])[_0xef19('0x9e')](_0xe8e200['holdtime'],_0xef19('0x9f'))[_0xef19('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x3f0b1c['queuecallerexitreason']=_0xef19('0xa0');_0x3f0b1c[_0xef19('0x95')]=!![];_0x3f0b1c[_0xef19('0xa1')]=_0xef19('0xa2');_0x3f0b1c['transferexten']=_0xe8e200[_0xef19('0xa3')];_0x3f0b1c[_0xef19('0xa4')]=_0xe8e200[_0xef19('0x47')];logger[_0xef19('0x6b')](_0xef19('0xa5'),_0x3f0b1c[_0xef19('0x52')],_0x3f0b1c[_0xef19('0x50')]);var _0xc6aca2=this[_0xef19('0x3a')][_0xe8e200['linkedid']];this['queueReports'][_0xe8e200[_0xef19('0x9b')]]=this[_0xef19('0x3a')][_0xe8e200[_0xef19('0x47')]];this[_0xef19('0x3a')][_0xe8e200['uniqueid']]=_0xc6aca2;}}else{_0x393b94[_0xef19('0x4c')]=_0xef19('0xa6')+_0xe8e200[_0xef19('0x96')][_0xef19('0xa7')]();logger[_0xef19('0x6b')](_0xef19('0xa8'),_0x393b94[_0xef19('0x52')],_0x393b94['type'],_0x393b94[_0xef19('0x4c')]);}}}this[_0xef19('0xf')][_0xe8e200[_0xef19('0x47')]]=_0x393b94;this[_0xef19('0x40')](_0x393b94,'agentcomplete');}}}catch(_0x9bb8f4){logger[_0xef19('0x39')](_0xef19('0x91'),_0xe8e200['uniqueid'],util['inspect'](_0x9bb8f4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncVarSet']=function(_0x11a198){try{if(this[_0xef19('0x64')](_0x11a198)){logger[_0xef19('0x44')](_0xef19('0xa9'),_0x11a198[_0xef19('0x47')],util['inspect'](_0x11a198,{'showHidden':![],'depth':null}));this[_0xef19('0xaa')](_0x11a198[_0xef19('0x47')],_['keys'](_0x11a198[_0xef19('0xab')])[0x0],_0x11a198[_0xef19('0xac')]);if(this['queueReports'][_0x11a198[_0xef19('0x47')]]){var _0x5b9981=_[_0xef19('0x88')](this[_0xef19('0x3a')][_0x11a198[_0xef19('0x47')]]);if(_0x5b9981){if(this[_0xef19('0x64')](_0x11a198[_0xef19('0xab')])&&this[_0xef19('0x64')](_0x11a198[_0xef19('0xab')][_0xef19('0xad')])){switch(_0x11a198['value']){case _0xef19('0xae'):_0x5b9981[_0xef19('0x94')]=![];_0x5b9981[_0xef19('0x9c')]=null;break;case _0xef19('0xaf'):_0x5b9981[_0xef19('0xb0')]=_0xef19('0xb1');_0x5b9981[_0xef19('0x94')]=!![];_0x5b9981[_0xef19('0x9c')]=moment()[_0xef19('0x48')](_0xef19('0x83'));_0x5b9981['queuecallerleaveAt']=moment()[_0xef19('0x48')](_0xef19('0x83'));logger[_0xef19('0x44')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x11a198[_0xef19('0x47')],util[_0xef19('0x3b')](_0x5b9981,{'showHidden':![],'depth':null}));ami[_0xef19('0x42')](_0xef19('0xb2'),_0x5b9981);break;default:_0x5b9981[_0xef19('0x94')]=!![];_0x5b9981[_0xef19('0x9c')]=moment()[_0xef19('0x48')](_0xef19('0x83'));_0x5b9981[_0xef19('0x89')]=moment()[_0xef19('0x48')](_0xef19('0x83'));}_0x5b9981[_0xef19('0x15')]=![];_0x5b9981[_0xef19('0x82')]=null;_0x5b9981[_0xef19('0x4c')]=_0x11a198[_0xef19('0xac')];this['channels'][_0x11a198[_0xef19('0x47')]]=_0x5b9981;this[_0xef19('0x40')](_0x5b9981,_0xef19('0x1b'));}else if(this[_0xef19('0x64')](_0x11a198['variable'])&&this[_0xef19('0x64')](_0x11a198['variable'][_0xef19('0xb3')])){if(!_0x5b9981[_0xef19('0x15')]){_0x5b9981[_0xef19('0x94')]=!![];_0x5b9981['queuecallerexitAt']=moment()[_0xef19('0x48')](_0xef19('0x83'));_0x5b9981[_0xef19('0x4c')]=_0xef19('0xb4');_0x5b9981[_0xef19('0x89')]=moment()[_0xef19('0x48')](_0xef19('0x83'));this['channels'][_0x11a198[_0xef19('0x47')]]=_0x5b9981;}}logger[_0xef19('0x6b')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x11a198[_0xef19('0x47')],_0x5b9981[_0xef19('0x52')],_0x5b9981[_0xef19('0x50')],_[_0xef19('0xb5')](_0x11a198['variable'])[0x0],_0x11a198[_0xef19('0xac')]);_0x5b9981[_0xef19('0x3c')]=this[_0xef19('0x3c')][_0x11a198['uniqueid']];}}}}catch(_0x5c76f2){logger['error'](_0xef19('0xa9'),_0x11a198[_0xef19('0x47')],util[_0xef19('0x3b')](_0x5c76f2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xef19('0xa')][_0xef19('0xaa')]=function(_0x5cfe57,_0x16ea43,_0x1caf2c){var _0x1fd3f6=[_0xef19('0xb6'),_0xef19('0xb7'),_0xef19('0xb8'),'rtpaudioqosjitterbridged',_0xef19('0xb9'),_0xef19('0xba'),_0xef19('0xbb'),'rtpaudioqosrttbridged',_0xef19('0xbc'),_0xef19('0xbd'),'bridgepeer',_0xef19('0xbe'),_0xef19('0xbf'),_0xef19('0xc0'),'memberinterface','memberlastcall',_0xef19('0x93'),_0xef19('0xc1'),'memberrealtime'];if(!_[_0xef19('0x32')](_0x16ea43)&&!_[_0xef19('0xc2')](_0x1fd3f6,_0x16ea43)){if(_['isUndefined'](this[_0xef19('0x3c')][_0x5cfe57])){this[_0xef19('0x3c')][_0x5cfe57]={};}this[_0xef19('0x3c')][_0x5cfe57][_0x16ea43]=_0x1caf2c;}};VoiceQueueReport[_0xef19('0xa')][_0xef19('0xc3')]=function(_0x434e00,_0x152695,_0x2a9641){var _0x39031f={};for(var _0x178cc8=0x0;_0x178cc8<this[_0xef19('0x3a')][_0x434e00]['length'];_0x178cc8+=0x1){_0x39031f=this['queueReports'][_0x434e00][_0x178cc8];if(this[_0xef19('0x3f')][_0x39031f['queue']]){if(_0x39031f[_0xef19('0x94')]&&_0x39031f[_0xef19('0x95')]!=!![]){this[_0xef19('0x3f')][_0x39031f[_0xef19('0x6a')]]['unmanaged']+=0x1;}if(_0x39031f['queuecallerabandon']){this['voiceQueues'][_0x39031f[_0xef19('0x6a')]][_0xef19('0x5c')]+=0x1;}this[_0xef19('0x3f')][_0x39031f[_0xef19('0x6a')]][_0xef19('0x58')]+=moment(_0x39031f[_0xef19('0x89')])[_0xef19('0xc4')](_0x39031f['queuecallerjoinAt'],'seconds')||0x0;if(_0x178cc8===this[_0xef19('0x3a')][_0x434e00][_0xef19('0xc5')]-0x1){this[_0xef19('0x3f')][_0x39031f[_0xef19('0x6a')]]['sumDuration']+=moment()[_0xef19('0xc6')](0x0)[_0xef19('0xc4')](_0x39031f['queuecallerjoinAt'],_0xef19('0x9f'));this[_0xef19('0x3f')][_0x39031f['queue']][_0xef19('0x5a')]+=0x1;if(_0x39031f[_0xef19('0x8e')]){this[_0xef19('0x3f')][_0x39031f[_0xef19('0x6a')]][_0xef19('0x54')]+=0x1;this[_0xef19('0x3f')][_0x39031f['queue']][_0xef19('0x56')]+=moment()[_0xef19('0xc6')](0x0)[_0xef19('0xc4')](_0x39031f['queuecallerleaveAt'],_0xef19('0x9f'));_0x39031f[_0xef19('0x7f')]=moment()[_0xef19('0x48')](_0xef19('0x83'));_0x39031f['queuecallerexit']=![];_0x39031f[_0xef19('0x9c')]=null;}if(_0x39031f[_0xef19('0x94')]&&_0x39031f['transfer']!=!![]){_0x39031f['lastevent']=_0xef19('0x5b');logger[_0xef19('0x44')](_0xef19('0xc7'),_0x434e00,util['inspect'](_0x39031f,{'showHidden':![],'depth':null}));ami['emit'](_0xef19('0xc8'),_0x39031f);}if(_0x39031f[_0xef19('0x15')]){_0x39031f[_0xef19('0xb0')]=_0xef19('0x5c');logger[_0xef19('0x44')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x434e00,util[_0xef19('0x3b')](_0x39031f,{'showHidden':![],'depth':null}));ami[_0xef19('0x42')](_0xef19('0xc9'),_0x39031f);}}else{this['voiceQueues'][_0x39031f[_0xef19('0x6a')]][_0xef19('0x57')]+=this['voiceQueues'][_0x39031f[_0xef19('0x6a')]][_0xef19('0x58')];}logger[_0xef19('0x6b')](_0xef19('0xca'),_0x434e00,_0x39031f[_0xef19('0x52')],_0x39031f['type'],_0x152695);if(_0x2a9641&&_0x39031f[_0xef19('0x4c')]===_0xef19('0x4d')){_0x39031f['queuecallerexitreason']=_0xef19('0x8f');}this[_0xef19('0xf')][_0x434e00]=_0x39031f;this[_0xef19('0x40')](_0x39031f,_0xef19('0x1d'));this[_0xef19('0x4f')](this[_0xef19('0x3f')][_0x39031f['queue']],_0xef19('0x1d'));}}logger[_0xef19('0x44')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x434e00,util[_0xef19('0x3b')](this[_0xef19('0x3a')][_0x434e00],{'showHidden':![],'depth':null}));ami[_0xef19('0x42')](_0xef19('0xcb'),this['queueReports'][_0x434e00]);if(_0x39031f['queuecallerexitreason']===_0xef19('0x4d'))return;delete this[_0xef19('0x3a')][_0x434e00];delete this[_0xef19('0xf')][_0x434e00];if(this['variables'][_0x434e00]){delete this[_0xef19('0x3c')][_0x434e00];}};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x1e')]=function(_0x524fe8){try{if(this[_0xef19('0x64')](_0x524fe8)){logger[_0xef19('0x44')](_0xef19('0xcc'),_0x524fe8['uniqueid'],util[_0xef19('0x3b')](_0x524fe8,{'showHidden':![],'depth':null}));if(this[_0xef19('0x3a')][_0x524fe8[_0xef19('0x47')]]){return this[_0xef19('0xc3')](_0x524fe8[_0xef19('0x47')],_0x524fe8[_0xef19('0xcd')]);}if(this[_0xef19('0x3a')][_0x524fe8[_0xef19('0x9b')]]){if(_0x524fe8[_0xef19('0xce')]==='21'){return;}return this[_0xef19('0xc3')](_0x524fe8['linkedid'],_0x524fe8['cause-txt'],!![]);}var _0x2cb0b0=Object[_0xef19('0xb5')](this[_0xef19('0x3a')]);for(var _0x1e0c77=0x0;_0x1e0c77<_0x2cb0b0[_0xef19('0xc5')];_0x1e0c77++){var _0x2e3b37=_[_0xef19('0x88')](this['queueReports'][_0x2cb0b0[_0x1e0c77]]);if(_0x2e3b37&&_0x2e3b37[_0xef19('0xcf')]===_0x524fe8[_0xef19('0x47')]){return this[_0xef19('0xc3')](_0x2e3b37[_0xef19('0x47')],_0x524fe8[_0xef19('0xcd')],!![]);}}}}catch(_0x5a2a81){logger[_0xef19('0x39')](_0xef19('0xcc'),_0x524fe8[_0xef19('0x47')],util[_0xef19('0x3b')](_0x5a2a81,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x24')]=function(_0x1cfbdc){try{if(this[_0xef19('0x64')](_0x1cfbdc)){logger[_0xef19('0x44')](_0xef19('0xd0'),_0x1cfbdc[_0xef19('0x47')],util[_0xef19('0x3b')](_0x1cfbdc,{'showHidden':![],'depth':null}));var _0x2ac823;var _0x20579e;var _0x5b87b5;if(this[_0xef19('0x3a')][_0x1cfbdc[_0xef19('0xd1')]]){_0x2ac823=_['last'](this[_0xef19('0x3a')][_0x1cfbdc['transfereeuniqueid']]);_0x2ac823[_0xef19('0xd2')]=_0x1cfbdc[_0xef19('0xd3')];_0x2ac823[_0xef19('0xa4')]=_0x1cfbdc[_0xef19('0xd4')];_0x2ac823[_0xef19('0x4c')]=_0xef19('0x4d');_0x2ac823[_0xef19('0x95')]=!![];_0x2ac823[_0xef19('0xa1')]=_0xef19('0xd5');if(this[_0xef19('0x3a')][_0x1cfbdc['secondtransfereruniqueid']]){_0x5b87b5=this['queueReports'][_0x1cfbdc['secondtransfereruniqueid']];this[_0xef19('0x3a')][_0x1cfbdc[_0xef19('0xd4')]]=this[_0xef19('0x3a')][_0x1cfbdc[_0xef19('0xd1')]];this[_0xef19('0x3a')][_0x1cfbdc[_0xef19('0xd1')]]=_0x5b87b5;_0x20579e=_[_0xef19('0x88')](this[_0xef19('0x3a')][_0x1cfbdc[_0xef19('0xd1')]]);_0x20579e[_0xef19('0x30')]=!![];}logger[_0xef19('0x6b')](_0xef19('0xd6'),_0x1cfbdc[_0xef19('0x47')],_0x2ac823['name'],_0x2ac823['type'],_0x2ac823[_0xef19('0xd2')],_0x2ac823[_0xef19('0xa4')]);}else if(this[_0xef19('0x3a')][_0x1cfbdc['transfertargetuniqueid']]){_0x2ac823=_[_0xef19('0x88')](this['queueReports'][_0x1cfbdc[_0xef19('0xd7')]]);_0x2ac823[_0xef19('0xd2')]=_0x1cfbdc[_0xef19('0xd8')];_0x2ac823[_0xef19('0xa4')]=_0x1cfbdc[_0xef19('0xd9')];_0x2ac823[_0xef19('0x4c')]=_0xef19('0x4d');_0x2ac823[_0xef19('0x95')]=!![];_0x2ac823[_0xef19('0xa1')]=_0xef19('0xd5');if(this[_0xef19('0x3a')][_0x1cfbdc[_0xef19('0xd9')]]){_0x5b87b5=this[_0xef19('0x3a')][_0x1cfbdc['origtransfereruniqueid']];this['queueReports'][_0x1cfbdc[_0xef19('0xd9')]]=this[_0xef19('0x3a')][_0x1cfbdc[_0xef19('0xd7')]];this[_0xef19('0x3a')][_0x1cfbdc[_0xef19('0xd7')]]=_0x5b87b5;_0x20579e=_[_0xef19('0x88')](this[_0xef19('0x3a')][_0x1cfbdc[_0xef19('0xd7')]]);_0x20579e[_0xef19('0x30')]=!![];}logger[_0xef19('0x6b')](_0xef19('0xd6'),_0x1cfbdc[_0xef19('0x47')],_0x2ac823[_0xef19('0x52')],_0x2ac823[_0xef19('0x50')],_0x2ac823[_0xef19('0xd2')],_0x2ac823['transferuniqueid']);}else if(this[_0xef19('0x3a')][_0x1cfbdc[_0xef19('0xd9')]]){_0x2ac823=_[_0xef19('0x88')](this[_0xef19('0x3a')][_0x1cfbdc[_0xef19('0xd9')]]);_0x2ac823[_0xef19('0xd2')]=_0x1cfbdc['origtransfererexten'];_0x2ac823[_0xef19('0xa4')]=_0x1cfbdc[_0xef19('0xd9')];_0x2ac823[_0xef19('0x4c')]='ATTENDEDTRANSFER';_0x2ac823[_0xef19('0x95')]=!![];_0x2ac823[_0xef19('0xa1')]=_0xef19('0xd5');_0x2ac823[_0xef19('0x30')]=!![];_0x2ac823['transferid']=_0x1cfbdc['transfereeuniqueid'];}else if(this[_0xef19('0x3a')][_0x1cfbdc['secondtransfereruniqueid']]){_0x2ac823=_[_0xef19('0x88')](this[_0xef19('0x3a')][_0x1cfbdc[_0xef19('0xd4')]]);_0x2ac823[_0xef19('0xd2')]=_0x1cfbdc[_0xef19('0xd3')];_0x2ac823['transferuniqueid']=_0x1cfbdc['secondtransfereruniqueid'];_0x2ac823['queuecallerexitreason']=_0xef19('0x4d');_0x2ac823['transfer']=!![];_0x2ac823['transfertype']=_0xef19('0xd5');_0x2ac823[_0xef19('0x30')]=!![];_0x2ac823['transferid']=_0x1cfbdc[_0xef19('0xd7')];}}}catch(_0x2ff006){logger[_0xef19('0x39')](_0xef19('0xd0'),_0x1cfbdc[_0xef19('0x47')],util[_0xef19('0x3b')](_0x2ff006,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xef19('0xa')][_0xef19('0x25')]=function(_0x18c4cb){try{if(this[_0xef19('0x64')](_0x18c4cb)){logger[_0xef19('0x44')](_0xef19('0xda'),_0x18c4cb[_0xef19('0x47')],util[_0xef19('0x3b')](_0x18c4cb,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x18c4cb['transfereeuniqueid']]){var _0x2a29e2=_[_0xef19('0x88')](this[_0xef19('0x3a')][_0x18c4cb[_0xef19('0xd1')]]);_0x2a29e2[_0xef19('0x4c')]=_0xef19('0xdb');_0x2a29e2['transfer']=!![];_0x2a29e2[_0xef19('0xa1')]='BLIND';_0x2a29e2['transferexten']=_0x18c4cb['extension'];_0x2a29e2[_0xef19('0xa4')]=_0x18c4cb[_0xef19('0xd1')];logger[_0xef19('0x6b')](_0xef19('0xdc'),_0x18c4cb[_0xef19('0x47')],_0x2a29e2[_0xef19('0x52')],_0x2a29e2['type'],_0x2a29e2[_0xef19('0xd2')],_0x2a29e2[_0xef19('0xa4')]);this[_0xef19('0x1e')]({'event':'BlindTransfer','uniqueid':_0x18c4cb[_0xef19('0xd1')],'context':_0x18c4cb['context'],'channel':_0x18c4cb['transfererchannel']});}}}catch(_0x20a6f5){logger[_0xef19('0x39')]('[%s][voiceQueueReport][blindtransfer]',_0x18c4cb[_0xef19('0x47')],util[_0xef19('0x3b')](_0x20a6f5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xef19('0x20')]=function(_0x3c8db6){try{if(this[_0xef19('0x64')](_0x3c8db6)){logger[_0xef19('0x44')]('[%s][voiceQueueReport][musiconholdstart]',_0x3c8db6[_0xef19('0x47')],util[_0xef19('0x3b')](_0x3c8db6,{'showHidden':![],'depth':null}));if(this[_0xef19('0x3a')][_0x3c8db6[_0xef19('0x47')]]){var _0x2f1d7c=_[_0xef19('0x88')](this['queueReports'][_0x3c8db6[_0xef19('0x47')]]);if(!_[_0xef19('0x32')](_0x2f1d7c[_0xef19('0x89')])){_0x2f1d7c[_0xef19('0xdd')]=moment()[_0xef19('0x48')](_0xef19('0x83'));logger['info'](_0xef19('0xde'),_0x3c8db6[_0xef19('0x47')],_0x2f1d7c[_0xef19('0xdd')]);}}}}catch(_0x14991f){logger['error'](_0xef19('0xdf'),_0x3c8db6[_0xef19('0x47')],util['inspect'](_0x14991f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xef19('0xa')]['syncMusicOnHoldStop']=function(_0x5d6275){try{if(this[_0xef19('0x64')](_0x5d6275)){logger[_0xef19('0x44')](_0xef19('0xe0'),_0x5d6275[_0xef19('0x47')],util[_0xef19('0x3b')](_0x5d6275,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5d6275[_0xef19('0x47')]]){var _0x20c491=_[_0xef19('0x88')](this['queueReports'][_0x5d6275['uniqueid']]);if(!_[_0xef19('0x32')](_0x20c491[_0xef19('0xdd')])){_0x20c491[_0xef19('0xe1')]+=moment()[_0xef19('0xc6')](0x0)['diff'](_0x20c491[_0xef19('0xdd')],_0xef19('0x9f'));logger[_0xef19('0x6b')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x5d6275[_0xef19('0x47')],_0x20c491[_0xef19('0xe1')]);delete _0x20c491[_0xef19('0xdd')];}}}}catch(_0xd19d84){logger['error']('[%s][voiceQueueReport][musiconholdstop]',_0x5d6275['uniqueid'],util['inspect'](_0xd19d84,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xef19('0xe2')]=function(_0x3be873){try{if(this[_0xef19('0x64')](_0x3be873)){logger[_0xef19('0x44')]('[%s][voiceQueueReport][newexten]\x20event:',_0x3be873[_0xef19('0x47')],util[_0xef19('0x3b')](_0x3be873,{'showHidden':![],'depth':null}));if(_0x3be873['application'][_0xef19('0x99')]()===_0xef19('0xe3')){_0x3be873[_0xef19('0xe4')]=_0x3be873['appdata']&&_0x3be873[_0xef19('0xe5')][_0xef19('0x98')]('CDR(routeAlias)')?_0x3be873[_0xef19('0xe5')]:(_0x3be873[_0xef19('0xe5')]||_0x3be873['applicationdata'])[_0xef19('0x99')]();if(_[_0xef19('0x98')](_0x3be873['applicationdata'][_0xef19('0x99')](),_0xef19('0xe6'))){logger[_0xef19('0x6b')](_0xef19('0xe7'),_0x3be873['uniqueid'],_0x3be873[_0xef19('0xe8')],_0x3be873['applicationdata']);if(_[_0xef19('0x77')](this['channels'][_0x3be873[_0xef19('0x47')]]))this['channels'][_0x3be873[_0xef19('0x47')]]={};var _0x2742d7=_0x3be873['applicationdata'][_0xef19('0xe9')]('=');var _0x3f991f=_0x2742d7[0x0][_0xef19('0x99')]()[_0xef19('0xea')](/cdr\((.*)\)/);if(_0x3f991f)this['channels'][_0x3be873['uniqueid']][_0x3f991f[0x1]]=_0x2742d7[0x1];}}}}catch(_0x2c910b){logger['error'](_0xef19('0xeb'),_0x3be873['uniqueid'],util[_0xef19('0x3b')](_0x2c910b,{'showHidden':![],'depth':null}));}};module[_0xef19('0xec')]=VoiceQueueReport;
\ No newline at end of file
+var _0x9e75=['emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','emit','format','voice:queue:%s','name','voice_queue_presence:save','emitVoiceQueueChannelRemove',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','waiting','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','isUndefined','loopQueueShow','queues','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','toNumber','callers','loggedin','talking','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','push','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerabandonAt','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','local/','linkedid','seconds','FORWARDTRANSFER','transfertype','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','keys','variable','value','queuestatus','CONTINUE','TIMEOUT','timeout','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','variables','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','memberpenalty','memberrealtime','includes','handleHangup','length','diff','milliseconds','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','syncHangup','[%s][voiceQueueReport][hangup]','cause-txt','cause','transferid','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','switch','[%s][voiceQueueReport][blindtransfer]','extension','BlindTransfer','context','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][newexten]\x20event:','application','toLowerCase','appdata','startsWith','CDR(routeAlias)','applicationdata','cdr(','split','match','exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','ami','../model/queueReport','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','fullybooted','syncFullyBooted','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','isEmpty','originated','pTalking','queueStatusComplete','hasOwnProperty','unlockRR','clearZombieChannels','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport'];(function(_0x138b7b,_0xe6121f){var _0x5d7261=function(_0x1e58a4){while(--_0x1e58a4){_0x138b7b['push'](_0x138b7b['shift']());}};_0x5d7261(++_0xe6121f);}(_0x9e75,0xb5));var _0x59e7=function(_0x2c6f82,_0xb8b700){_0x2c6f82=_0x2c6f82-0x0;var _0x1b0c69=_0x9e75[_0x2c6f82];return _0x1b0c69;};'use strict';var _=require(_0x59e7('0x0'));var moment=require(_0x59e7('0x1'));var util=require('util');var md5=require(_0x59e7('0x2'));var Redis=require(_0x59e7('0x3'));var config=require(_0x59e7('0x4'));var logger=require(_0x59e7('0x5'))(_0x59e7('0x6'));var ami=require('../ami');var QueueReport=require(_0x59e7('0x7'));config[_0x59e7('0x8')]=_['defaults'](config['redis'],{'host':_0x59e7('0x9'),'port':0x18eb});var io=require(_0x59e7('0xa'))(new Redis(config[_0x59e7('0x8')]));var Sequence=function(){};Sequence[_0x59e7('0xb')][_0x59e7('0xc')]=function(_0xac04e2){this['tail']=this[_0x59e7('0xd')]?this[_0x59e7('0xd')][_0x59e7('0xe')](_0xac04e2):_0xac04e2();};function VoiceQueueReport(_0x5760f8){this[_0x59e7('0xf')]=new Sequence();this[_0x59e7('0x10')]={};this[_0x59e7('0x11')]=_0x5760f8[_0x59e7('0x11')];this[_0x59e7('0x12')]=_0x5760f8[_0x59e7('0x13')];this[_0x59e7('0x14')]=_0x5760f8[_0x59e7('0x14')];this[_0x59e7('0x15')]=!![];this[_0x59e7('0x16')]=_0x5760f8[_0x59e7('0x16')];this['variables']={};ami['on'](_0x59e7('0x17'),this[_0x59e7('0x18')][_0x59e7('0x19')](this));ami['on'](_0x59e7('0x1a'),this[_0x59e7('0x1b')]['bind'](this));ami['on'](_0x59e7('0x1c'),this[_0x59e7('0x1d')][_0x59e7('0x19')](this));ami['on'](_0x59e7('0x1e'),this[_0x59e7('0x1f')]['bind'](this));ami['on'](_0x59e7('0x20'),this[_0x59e7('0x21')]['bind'](this));ami['on'](_0x59e7('0x22'),this[_0x59e7('0x23')]['bind'](this));ami['on'](_0x59e7('0x24'),this[_0x59e7('0x25')]['bind'](this));ami['on'](_0x59e7('0x26'),this[_0x59e7('0x27')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0x59e7('0x28'),this[_0x59e7('0x29')][_0x59e7('0x19')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x59e7('0x19')](this));ami['on'](_0x59e7('0x2a'),this[_0x59e7('0x2b')][_0x59e7('0x19')](this));ami['on'](_0x59e7('0x2c'),this[_0x59e7('0x2d')][_0x59e7('0x19')](this));ami['on'](_0x59e7('0x2e'),this[_0x59e7('0x2f')][_0x59e7('0x19')](this));this[_0x59e7('0x30')]();this['loopQueueShow']();}function clearChannels(_0x2cd7d9){if(!_[_0x59e7('0x31')](_0x2cd7d9)){for(var _0x555b70 in _0x2cd7d9){if(_0x2cd7d9['hasOwnProperty'](_0x555b70)){delete _0x2cd7d9[_0x555b70];}}}}function clearCampaigns(_0xe7a7b9){if(!_[_0x59e7('0x31')](_0xe7a7b9)){for(var _0x34fb1a in _0xe7a7b9){if(_0xe7a7b9['hasOwnProperty'](_0x34fb1a)){_0xe7a7b9[_0x34fb1a][_0x59e7('0x32')]=0x0;}}}}function clearVoiceQueues(_0x5f41ee){if(!_[_0x59e7('0x31')](_0x5f41ee)){for(var _0x5ac45a in _0x5f41ee){if(_0x5f41ee['hasOwnProperty'](_0x5ac45a)){_0x5f41ee[_0x5ac45a][_0x59e7('0x32')]=0x0;_0x5f41ee[_0x5ac45a]['talking']=0x0;_0x5f41ee[_0x5ac45a][_0x59e7('0x33')]=0x0;_0x5f41ee[_0x5ac45a]['waiting']=0x0;_0x5f41ee[_0x5ac45a][_0x59e7('0x34')]=!![];}}}}function clearAgentBooked(_0x38e4eb){if(!_[_0x59e7('0x31')](_0x38e4eb)){for(var _0x22f376 in _0x38e4eb){if(_0x38e4eb[_0x59e7('0x35')](_0x22f376)){_0x38e4eb[_0x22f376][_0x59e7('0x36')]=!![];}}}}VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0x37')]=function(){var _0x9488c8=this;for(var _0x56ca8b in this['channels']){if(this[_0x59e7('0x12')][_0x59e7('0x35')](_0x56ca8b)&&!this[_0x59e7('0x12')][_0x56ca8b]['switch']){this['sequence']['enqueue'](function(){if(!_[_0x59e7('0x38')](_0x9488c8['channels'][_0x56ca8b])){return ami[_0x59e7('0x39')]({'action':_0x59e7('0x3a'),'channel':_0x9488c8[_0x59e7('0x12')][_0x56ca8b][_0x59e7('0x3b')]})[_0x59e7('0x3c')](function(_0xefafbc){if(_0xefafbc[_0x59e7('0x3d')]===_0x59e7('0x3e')){setTimeout(function(){if(_0x9488c8[_0x59e7('0x12')][_0x56ca8b]){delete _0x9488c8[_0x59e7('0x12')][_0x56ca8b];logger[_0x59e7('0x3f')](_0x59e7('0x40'),_0x56ca8b,util['inspect'](_0xefafbc,{'showHidden':![],'depth':null}));}if(_0x9488c8[_0x59e7('0x10')][_0x56ca8b]){delete _0x9488c8[_0x59e7('0x10')][_0x56ca8b];logger['error']('[%s][voiceQueueReport][checkQueueReport]',_0x56ca8b,util['inspect'](_0xefafbc,{'showHidden':![],'depth':null}));}if(_0x9488c8['variables'][_0x56ca8b]){delete _0x9488c8['variables'][_0x56ca8b];logger['error']('[%s][voiceQueueReport][checkVariables]',_0x56ca8b,util[_0x59e7('0x41')](_0xefafbc,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x59e7('0xb')]['syncFullyBooted']=function(){logger[_0x59e7('0x3f')](_0x59e7('0x42'));clearChannels(this[_0x59e7('0x12')]);this[_0x59e7('0x43')](this[_0x59e7('0x10')]);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x59e7('0x16')]);};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0x43')]=function(_0x5425be){var _0x453e4c=this;if(!_[_0x59e7('0x31')](_0x5425be)){for(var _0x59eff8 in _0x5425be){if(_0x5425be[_0x59e7('0x35')](_0x59eff8)){_0x453e4c['emitVoiceQueueChannelRemove'](_0x5425be[_0x59eff8],_0x59e7('0x44'));delete _0x5425be[_0x59eff8];}}}};VoiceQueueReport['prototype']['emit']=function(_0x57e961,_0x6e069c,_0x1aeeb7){io['to'](_0x57e961)['emit'](_0x6e069c,_0x1aeeb7);};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0x45')]=function(_0x26d23a,_0x1b37a3){logger[_0x59e7('0x46')](_0x59e7('0x47')+_0x1b37a3+_0x59e7('0x48'),_0x26d23a[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x26d23a,{'showHidden':![],'depth':null}));this[_0x59e7('0x4a')](util[_0x59e7('0x4b')](_0x59e7('0x4c'),_0x26d23a[_0x59e7('0x4d')]),'voice_queue_channel:save',_0x26d23a);io['emit'](_0x59e7('0x4e'),_0x26d23a);};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0x4f')]=function(_0x1a4816,_0x319519){logger[_0x59e7('0x46')](_0x59e7('0x47')+_0x319519+_0x59e7('0x50'),_0x1a4816[_0x59e7('0x49')],util['inspect'](_0x1a4816,{'showHidden':![],'depth':null}));if(_0x1a4816[_0x59e7('0x51')]===_0x59e7('0x52'))return;this[_0x59e7('0x4a')](util[_0x59e7('0x4b')]('voice:queue:%s',_0x1a4816[_0x59e7('0x4d')]),_0x59e7('0x53'),_0x1a4816);io[_0x59e7('0x4a')](_0x59e7('0x54'),_0x1a4816);};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0x55')]=function(_0x162b30,_0x5b2709){if(_0x162b30[_0x59e7('0x56')]===_0x59e7('0x57')){var _0x14412e={'id':_0x162b30['id'],'name':_0x162b30[_0x59e7('0x4d')],'strategy':_0x162b30[_0x59e7('0x58')],'answered':_0x162b30[_0x59e7('0x59')],'available':_0x162b30[_0x59e7('0x5a')],'loggedIn':_0x162b30[_0x59e7('0x5b')],'pTalking':_0x162b30[_0x59e7('0x33')],'sumBillable':_0x162b30[_0x59e7('0x5c')],'sumDuration':_0x162b30[_0x59e7('0x5d')],'sumHoldTime':_0x162b30[_0x59e7('0x5e')]||0x0,'talking':_0x162b30['talking'],'total':_0x162b30[_0x59e7('0x5f')],'type':_0x162b30['type'],'unmanaged':_0x162b30[_0x59e7('0x60')],'abandoned':_0x162b30[_0x59e7('0x61')],'waiting':_0x162b30[_0x59e7('0x62')]};if(_0x162b30[_0x59e7('0x63')]){_0x14412e[_0x59e7('0x63')]={'id':_0x162b30[_0x59e7('0x63')]['id'],'name':_0x162b30['Trunk']['name'],'active':_0x162b30[_0x59e7('0x63')][_0x59e7('0x64')],'callerid':_0x162b30[_0x59e7('0x63')][_0x59e7('0x65')]};}if(_0x162b30[_0x59e7('0x66')]){_0x14412e[_0x59e7('0x66')]={'id':_0x162b30['Interval']['id'],'name':_0x162b30['Interval']['name']};}var _0x5755f8=md5(JSON[_0x59e7('0x67')](_0x14412e));if(_0x162b30[_0x59e7('0x2')]!==_0x5755f8){_0x162b30[_0x59e7('0x2')]=_0x5755f8;logger['debug'](_0x59e7('0x68')+_0x5b2709+_0x59e7('0x69'),util[_0x59e7('0x41')](_0x14412e,{'showHidden':![],'depth':null}));this[_0x59e7('0x4a')](util['format'](_0x59e7('0x4c'),_0x14412e['name']),'voice_queue:save',_0x14412e);}}};VoiceQueueReport[_0x59e7('0xb')]['isNotNull']=function(_0x1312f8){return _0x1312f8!==null&&!_[_0x59e7('0x6a')](_0x1312f8);};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0x6b')]=function(){var _0x3b18e3=this;setInterval(function(){_0x3b18e3[_0x59e7('0x37')]();ami[_0x59e7('0x39')]({'action':_0x59e7('0x6c')})[_0x59e7('0x3c')](function(_0x54ff1d){logger[_0x59e7('0x3f')](_0x59e7('0x6d'),util[_0x59e7('0x41')](_0x54ff1d,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0x30')]=function(){var _0x2347c1=this;setInterval(function(){if(_0x2347c1[_0x59e7('0x15')]){return ami[_0x59e7('0x39')]({'action':'queuesummary'})[_0x59e7('0x6e')](function(){_0x2347c1[_0x59e7('0x15')]=![];})[_0x59e7('0x3c')](function(_0x388445){logger['error'](_0x59e7('0x6f'),util[_0x59e7('0x41')](_0x388445,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x59e7('0xb')]['syncQueueSummary']=function(_0x5f9415){try{if(this[_0x59e7('0x70')](_0x5f9415)&&this['isNotNull'](_0x5f9415[_0x59e7('0x71')])){logger[_0x59e7('0x46')](_0x59e7('0x72'),util['inspect'](_0x5f9415,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x5f9415[_0x59e7('0x71')]]){logger[_0x59e7('0x73')](_0x59e7('0x74'),_0x5f9415[_0x59e7('0x71')]);var _0x429c88=_['countBy'](this['channels'],'queue')[_0x5f9415['queue']]||0x0;var _0x1b4d8d=_0x429c88-_0x5f9415['callers'];if(this[_0x59e7('0x14')][_0x5f9415[_0x59e7('0x71')]][_0x59e7('0x62')]!==_[_0x59e7('0x75')](_0x5f9415['callers'])||this[_0x59e7('0x14')][_0x5f9415[_0x59e7('0x71')]][_0x59e7('0x5b')]!==_[_0x59e7('0x75')](_0x5f9415['loggedin'])||this[_0x59e7('0x14')][_0x5f9415[_0x59e7('0x71')]][_0x59e7('0x5a')]!==_[_0x59e7('0x75')](_0x5f9415[_0x59e7('0x5a')])||this[_0x59e7('0x14')][_0x5f9415['queue']]['talking']!==_0x1b4d8d){this['voiceQueues'][_0x5f9415[_0x59e7('0x71')]][_0x59e7('0x62')]=_[_0x59e7('0x75')](_0x5f9415[_0x59e7('0x76')]);this['voiceQueues'][_0x5f9415[_0x59e7('0x71')]][_0x59e7('0x5b')]=_[_0x59e7('0x75')](_0x5f9415[_0x59e7('0x77')]);this['voiceQueues'][_0x5f9415[_0x59e7('0x71')]][_0x59e7('0x5a')]=_['toNumber'](_0x5f9415[_0x59e7('0x5a')]);this[_0x59e7('0x14')][_0x5f9415[_0x59e7('0x71')]][_0x59e7('0x78')]=_0x1b4d8d>0x0?_0x1b4d8d:0x0;this[_0x59e7('0x14')][_0x5f9415[_0x59e7('0x71')]]['talking']=this['voiceQueues'][_0x5f9415['queue']][_0x59e7('0x78')]>_[_0x59e7('0x75')](_0x5f9415['loggedin'])?_[_0x59e7('0x75')](_0x5f9415[_0x59e7('0x77')]):this['voiceQueues'][_0x5f9415[_0x59e7('0x71')]][_0x59e7('0x78')];this[_0x59e7('0x55')](this[_0x59e7('0x14')][_0x5f9415[_0x59e7('0x71')]],_0x59e7('0x17'));}logger[_0x59e7('0x46')](_0x59e7('0x79'),util[_0x59e7('0x41')](this['voiceQueues'][_0x5f9415['queue']],{'showHidden':![],'depth':null}));ami[_0x59e7('0x4a')](_0x59e7('0x7a'),this[_0x59e7('0x14')][_0x5f9415[_0x59e7('0x71')]]);}}}catch(_0x3484da){logger[_0x59e7('0x3f')](_0x59e7('0x6f'),util[_0x59e7('0x41')](_0x3484da,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59e7('0xb')]['syncQueueSummaryComplete']=function(_0x24d34b){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x59e7('0x41')](_0x24d34b,{'showHidden':![],'depth':null}));ami['emit'](_0x59e7('0x7b'),{});this['flagQueueSummary']=!![];};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0x1d')]=function(_0x2be221){try{if(this[_0x59e7('0x70')](_0x2be221)){logger[_0x59e7('0x46')](_0x59e7('0x7c'),_0x2be221[_0x59e7('0x49')],util['inspect'](_0x2be221,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x59e7('0x10')][_0x2be221['uniqueid']]))this[_0x59e7('0x10')][_0x2be221[_0x59e7('0x49')]]=[];if(_[_0x59e7('0x6a')](this[_0x59e7('0x12')][_0x2be221[_0x59e7('0x49')]]))this[_0x59e7('0x12')][_0x2be221[_0x59e7('0x49')]]={};var _0x337a50=new QueueReport();_0x337a50['name']=_0x2be221['queue'];_0x337a50['type']=this[_0x59e7('0x14')][_0x337a50[_0x59e7('0x4d')]]&&this['voiceQueues'][_0x337a50[_0x59e7('0x4d')]][_0x59e7('0x56')]?this[_0x59e7('0x14')][_0x337a50[_0x59e7('0x4d')]][_0x59e7('0x56')]||'inbound':_0x59e7('0x57');_0x337a50[_0x59e7('0x71')]=_0x2be221[_0x59e7('0x71')];_0x337a50[_0x59e7('0x7d')]=moment()[_0x59e7('0x4b')](_0x59e7('0x7e'));_0x337a50['position']=_0x2be221[_0x59e7('0x7f')];_0x337a50[_0x59e7('0x80')]=_0x2be221[_0x59e7('0x80')];_0x337a50['uniqueid']=_0x2be221[_0x59e7('0x49')];_0x337a50[_0x59e7('0x81')]=this[_0x59e7('0x12')][_0x2be221[_0x59e7('0x49')]][_0x59e7('0x81')];logger[_0x59e7('0x73')](_0x59e7('0x82'),_0x337a50[_0x59e7('0x4d')],_0x337a50[_0x59e7('0x56')]);_[_0x59e7('0x83')](_0x337a50,_[_0x59e7('0x84')](_0x2be221,_['keys'](_0x337a50)));this[_0x59e7('0x10')][_0x2be221[_0x59e7('0x49')]][_0x59e7('0x85')](_0x337a50);this[_0x59e7('0x12')][_0x2be221[_0x59e7('0x49')]]=_0x337a50;this[_0x59e7('0x45')](_0x337a50,_0x59e7('0x1c'));}}catch(_0x57ae51){logger[_0x59e7('0x3f')](_0x59e7('0x7c'),_0x2be221['uniqueid'],util[_0x59e7('0x41')](_0x57ae51,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x59e7('0x1f')]=function(_0x230250){try{if(this[_0x59e7('0x70')](_0x230250)){logger[_0x59e7('0x46')]('[%s][voiceQueueReport][queuecallerabandon]',_0x230250[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x230250,{'showHidden':![],'depth':null}));if(this[_0x59e7('0x10')][_0x230250[_0x59e7('0x49')]]){var _0x45b6c8=_[_0x59e7('0x86')](this[_0x59e7('0x10')][_0x230250[_0x59e7('0x49')]]);_0x45b6c8[_0x59e7('0x87')]=![];_0x45b6c8[_0x59e7('0x88')]=null;_0x45b6c8['holdtime']=_0x230250[_0x59e7('0x89')];_0x45b6c8['originalposition']=_0x230250[_0x59e7('0x8a')];_0x45b6c8[_0x59e7('0x1e')]=!![];_0x45b6c8['queuecallerabandonAt']=moment()[_0x59e7('0x4b')](_0x59e7('0x7e'));_0x45b6c8[_0x59e7('0x51')]=_0x59e7('0x8b');_0x45b6c8[_0x59e7('0x8c')]=null;logger[_0x59e7('0x73')](_0x59e7('0x8d'),_0x45b6c8['name'],_0x45b6c8['type']);this['channels'][_0x230250[_0x59e7('0x49')]]=_0x45b6c8;this['emitVoiceQueueChannelRemove'](_0x45b6c8,_0x59e7('0x1e'));}}}catch(_0x2b9c6a){logger[_0x59e7('0x3f')](_0x59e7('0x8e'),_0x230250[_0x59e7('0x49')],util['inspect'](_0x2b9c6a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0x21')]=function(_0x5bfa30){try{if(this[_0x59e7('0x70')](_0x5bfa30)){logger[_0x59e7('0x46')]('[%s][voiceQueueReport][queuecallerleave]',_0x5bfa30['uniqueid'],util[_0x59e7('0x41')](_0x5bfa30,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5bfa30[_0x59e7('0x49')]]){var _0x148509=_[_0x59e7('0x86')](this[_0x59e7('0x10')][_0x5bfa30[_0x59e7('0x49')]]);_0x148509[_0x59e7('0x8f')]=moment()[_0x59e7('0x4b')](_0x59e7('0x7e'));_0x148509['connectedlinenum']=_0x5bfa30[_0x59e7('0x90')];_0x148509[_0x59e7('0x91')]=_0x5bfa30['connectedlinename'];logger['info'](_0x59e7('0x92'),_0x148509[_0x59e7('0x4d')],_0x148509[_0x59e7('0x56')],_0x5bfa30[_0x59e7('0x90')],_0x5bfa30[_0x59e7('0x91')]);this[_0x59e7('0x12')][_0x5bfa30['uniqueid']]=_0x148509;this[_0x59e7('0x45')](_0x148509,'queuecallerleave');}}}catch(_0x2f6a34){logger[_0x59e7('0x3f')]('[%s][voiceQueueReport][queuecallerleave]',_0x5bfa30[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x2f6a34,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59e7('0xb')]['syncAgentConnect']=function(_0x1bd4e9){try{if(this[_0x59e7('0x70')](_0x1bd4e9)){logger[_0x59e7('0x46')](_0x59e7('0x93'),_0x1bd4e9[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x1bd4e9,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1bd4e9['uniqueid']]){var _0x32d6f8=_['last'](this['queueReports'][_0x1bd4e9[_0x59e7('0x49')]]);_0x32d6f8[_0x59e7('0x87')]=!![];_0x32d6f8[_0x59e7('0x51')]=_0x59e7('0x94');logger[_0x59e7('0x73')](_0x59e7('0x95'),_0x32d6f8[_0x59e7('0x4d')],_0x32d6f8['type']);}}}catch(_0x2da56e){logger[_0x59e7('0x3f')]('[%s][voiceQueueReport][agentconnect]',_0x1bd4e9[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x2da56e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0x23')]=function(_0x505eca){try{if(this['isNotNull'](_0x505eca)){logger[_0x59e7('0x46')](_0x59e7('0x96'),_0x505eca[_0x59e7('0x49')],util['inspect'](_0x505eca,{'showHidden':![],'depth':null}));if(this[_0x59e7('0x10')][_0x505eca[_0x59e7('0x49')]]){var _0x3b189a=_['last'](this[_0x59e7('0x10')][_0x505eca[_0x59e7('0x49')]]);_0x3b189a['queuecallerabandon']=![];_0x3b189a[_0x59e7('0x97')]=null;_0x3b189a[_0x59e7('0x98')]=!![];_0x3b189a[_0x59e7('0x8c')]=_0x505eca[_0x59e7('0x99')];_0x3b189a[_0x59e7('0x89')]=_0x505eca[_0x59e7('0x89')];_0x3b189a[_0x59e7('0x87')]=!![];_0x3b189a[_0x59e7('0x9a')]=![];_0x3b189a[_0x59e7('0x9b')]=null;if(!_0x3b189a[_0x59e7('0x9c')]){if(_0x505eca['reason']=='transfer'){_0x3b189a[_0x59e7('0x51')]=_0x59e7('0x9d');logger[_0x59e7('0x73')](_0x59e7('0x9e'),_0x3b189a[_0x59e7('0x4d')],_0x3b189a[_0x59e7('0x56')]);}else{if(_['startsWith'](_0x505eca['channel']['toLowerCase'](),_0x59e7('0x9f'))){if(this[_0x59e7('0x10')][_0x505eca[_0x59e7('0xa0')]]){var _0x5aff85=_[_0x59e7('0x86')](this['queueReports'][_0x505eca['linkedid']]);_0x5aff85[_0x59e7('0x87')]=![];_0x5aff85[_0x59e7('0x9a')]=!![];_0x5aff85[_0x59e7('0x9b')]=moment(_0x3b189a[_0x59e7('0x7d')])['add'](_0x505eca['holdtime'],_0x59e7('0xa1'))['format'](_0x59e7('0x7e'));_0x5aff85[_0x59e7('0x51')]=_0x59e7('0xa2');_0x5aff85[_0x59e7('0x9c')]=!![];_0x5aff85[_0x59e7('0xa3')]='FORWARD';_0x5aff85['transferexten']=_0x505eca[_0x59e7('0xa4')];_0x5aff85[_0x59e7('0xa5')]=_0x505eca[_0x59e7('0x49')];logger[_0x59e7('0x73')](_0x59e7('0xa6'),_0x5aff85[_0x59e7('0x4d')],_0x5aff85[_0x59e7('0x56')]);var _0x224492=this['queueReports'][_0x505eca[_0x59e7('0xa0')]];this[_0x59e7('0x10')][_0x505eca['linkedid']]=this[_0x59e7('0x10')][_0x505eca[_0x59e7('0x49')]];this['queueReports'][_0x505eca[_0x59e7('0x49')]]=_0x224492;}}else{_0x3b189a[_0x59e7('0x51')]=_0x59e7('0xa7')+_0x505eca[_0x59e7('0xa8')][_0x59e7('0xa9')]();logger[_0x59e7('0x73')](_0x59e7('0xaa'),_0x3b189a['name'],_0x3b189a[_0x59e7('0x56')],_0x3b189a[_0x59e7('0x51')]);}}}this['channels'][_0x505eca[_0x59e7('0x49')]]=_0x3b189a;this['emitVoiceQueueChannelRemove'](_0x3b189a,_0x59e7('0x22'));}}}catch(_0x1e3495){logger['error'](_0x59e7('0x96'),_0x505eca[_0x59e7('0x49')],util['inspect'](_0x1e3495,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0x27')]=function(_0x4d2679){try{if(this[_0x59e7('0x70')](_0x4d2679)){logger[_0x59e7('0x46')](_0x59e7('0xab'),_0x4d2679[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x4d2679,{'showHidden':![],'depth':null}));this[_0x59e7('0xac')](_0x4d2679[_0x59e7('0x49')],_[_0x59e7('0xad')](_0x4d2679[_0x59e7('0xae')])[0x0],_0x4d2679[_0x59e7('0xaf')]);if(this[_0x59e7('0x10')][_0x4d2679[_0x59e7('0x49')]]){var _0x198581=_[_0x59e7('0x86')](this[_0x59e7('0x10')][_0x4d2679[_0x59e7('0x49')]]);if(_0x198581){if(this[_0x59e7('0x70')](_0x4d2679[_0x59e7('0xae')])&&this[_0x59e7('0x70')](_0x4d2679[_0x59e7('0xae')][_0x59e7('0xb0')])){switch(_0x4d2679[_0x59e7('0xaf')]){case _0x59e7('0xb1'):_0x198581[_0x59e7('0x9a')]=![];_0x198581['queuecallerexitAt']=null;break;case _0x59e7('0xb2'):_0x198581['lastevent']=_0x59e7('0xb3');_0x198581[_0x59e7('0x9a')]=!![];_0x198581[_0x59e7('0x9b')]=moment()[_0x59e7('0x4b')](_0x59e7('0x7e'));_0x198581[_0x59e7('0x8f')]=moment()[_0x59e7('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x4d2679[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x198581,{'showHidden':![],'depth':null}));ami[_0x59e7('0x4a')](_0x59e7('0xb4'),_0x198581);break;default:_0x198581[_0x59e7('0x9a')]=!![];_0x198581[_0x59e7('0x9b')]=moment()[_0x59e7('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x198581[_0x59e7('0x8f')]=moment()[_0x59e7('0x4b')](_0x59e7('0x7e'));}_0x198581[_0x59e7('0x1e')]=![];_0x198581[_0x59e7('0x97')]=null;_0x198581[_0x59e7('0x51')]=_0x4d2679[_0x59e7('0xaf')];this[_0x59e7('0x12')][_0x4d2679[_0x59e7('0x49')]]=_0x198581;this[_0x59e7('0x4f')](_0x198581,_0x59e7('0x26'));}else if(this[_0x59e7('0x70')](_0x4d2679[_0x59e7('0xae')])&&this['isNotNull'](_0x4d2679['variable'][_0x59e7('0xb5')])){if(!_0x198581['queuecallerabandon']){_0x198581[_0x59e7('0x9a')]=!![];_0x198581[_0x59e7('0x9b')]=moment()[_0x59e7('0x4b')](_0x59e7('0x7e'));_0x198581['queuecallerexitreason']=_0x59e7('0xb6');_0x198581['queuecallerleaveAt']=moment()[_0x59e7('0x4b')](_0x59e7('0x7e'));this['channels'][_0x4d2679[_0x59e7('0x49')]]=_0x198581;}}logger[_0x59e7('0x73')](_0x59e7('0xb7'),_0x4d2679[_0x59e7('0x49')],_0x198581[_0x59e7('0x4d')],_0x198581[_0x59e7('0x56')],_[_0x59e7('0xad')](_0x4d2679[_0x59e7('0xae')])[0x0],_0x4d2679[_0x59e7('0xaf')]);_0x198581[_0x59e7('0xb8')]=this['variables'][_0x4d2679[_0x59e7('0x49')]];}}}}catch(_0x106e4a){logger[_0x59e7('0x3f')](_0x59e7('0xab'),_0x4d2679[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x106e4a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0xac')]=function(_0x10848e,_0x3bcb49,_0x10b03a){var _0x41fc7c=[_0x59e7('0xb9'),_0x59e7('0xba'),_0x59e7('0xbb'),_0x59e7('0xbc'),'rtpaudioqosloss',_0x59e7('0xbd'),_0x59e7('0xbe'),_0x59e7('0xbf'),_0x59e7('0xc0'),_0x59e7('0xc1'),_0x59e7('0xc2'),_0x59e7('0xc3'),_0x59e7('0xc4'),'memberdynamic','memberinterface',_0x59e7('0xc5'),_0x59e7('0x99'),_0x59e7('0xc6'),_0x59e7('0xc7')];if(!_[_0x59e7('0x38')](_0x3bcb49)&&!_[_0x59e7('0xc8')](_0x41fc7c,_0x3bcb49)){if(_[_0x59e7('0x6a')](this[_0x59e7('0xb8')][_0x10848e])){this[_0x59e7('0xb8')][_0x10848e]={};}this[_0x59e7('0xb8')][_0x10848e][_0x3bcb49]=_0x10b03a;}};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0xc9')]=function(_0x30f89c,_0x576736,_0x50542b){var _0x5e324d={};for(var _0x5ba5f1=0x0;_0x5ba5f1<this[_0x59e7('0x10')][_0x30f89c][_0x59e7('0xca')];_0x5ba5f1+=0x1){_0x5e324d=this[_0x59e7('0x10')][_0x30f89c][_0x5ba5f1];if(this[_0x59e7('0x14')][_0x5e324d['queue']]){if(_0x5e324d[_0x59e7('0x9a')]&&_0x5e324d['transfer']!=!![]){this['voiceQueues'][_0x5e324d[_0x59e7('0x71')]]['unmanaged']+=0x1;}if(_0x5e324d[_0x59e7('0x1e')]){this[_0x59e7('0x14')][_0x5e324d['queue']][_0x59e7('0x61')]+=0x1;}this[_0x59e7('0x14')][_0x5e324d[_0x59e7('0x71')]]['sumHoldTime']+=moment(_0x5e324d[_0x59e7('0x8f')])[_0x59e7('0xcb')](_0x5e324d[_0x59e7('0x7d')],_0x59e7('0xa1'))||0x0;if(_0x5ba5f1===this[_0x59e7('0x10')][_0x30f89c]['length']-0x1){this['voiceQueues'][_0x5e324d[_0x59e7('0x71')]]['sumDuration']+=moment()['milliseconds'](0x0)['diff'](_0x5e324d['queuecallerjoinAt'],'seconds');this[_0x59e7('0x14')][_0x5e324d['queue']][_0x59e7('0x5f')]+=0x1;if(_0x5e324d[_0x59e7('0x87')]){this['voiceQueues'][_0x5e324d[_0x59e7('0x71')]][_0x59e7('0x59')]+=0x1;this[_0x59e7('0x14')][_0x5e324d[_0x59e7('0x71')]][_0x59e7('0x5c')]+=moment()[_0x59e7('0xcc')](0x0)[_0x59e7('0xcb')](_0x5e324d[_0x59e7('0x8f')],_0x59e7('0xa1'));_0x5e324d['queuecallercompleteAt']=moment()[_0x59e7('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e324d[_0x59e7('0x9a')]=![];_0x5e324d[_0x59e7('0x9b')]=null;}if(_0x5e324d[_0x59e7('0x9a')]&&_0x5e324d[_0x59e7('0x9c')]!=!![]){_0x5e324d[_0x59e7('0xcd')]=_0x59e7('0x60');logger['debug'](_0x59e7('0xce'),_0x30f89c,util['inspect'](_0x5e324d,{'showHidden':![],'depth':null}));ami['emit'](_0x59e7('0xcf'),_0x5e324d);}if(_0x5e324d['queuecallerabandon']){_0x5e324d[_0x59e7('0xcd')]=_0x59e7('0x61');logger[_0x59e7('0x46')](_0x59e7('0xd0'),_0x30f89c,util[_0x59e7('0x41')](_0x5e324d,{'showHidden':![],'depth':null}));ami[_0x59e7('0x4a')](_0x59e7('0xd1'),_0x5e324d);}}else{this['voiceQueues'][_0x5e324d['queue']][_0x59e7('0x5d')]+=this[_0x59e7('0x14')][_0x5e324d[_0x59e7('0x71')]][_0x59e7('0x5e')];}logger[_0x59e7('0x73')](_0x59e7('0xd2'),_0x30f89c,_0x5e324d[_0x59e7('0x4d')],_0x5e324d[_0x59e7('0x56')],_0x576736);if(_0x50542b&&_0x5e324d['queuecallerexitreason']===_0x59e7('0x52')){_0x5e324d[_0x59e7('0x51')]='COMPLETEDBYAGENT';}this[_0x59e7('0x12')][_0x30f89c]=_0x5e324d;this[_0x59e7('0x4f')](_0x5e324d,_0x59e7('0xd3'));this[_0x59e7('0x55')](this[_0x59e7('0x14')][_0x5e324d['queue']],_0x59e7('0xd3'));}}logger[_0x59e7('0x46')](_0x59e7('0xd4'),_0x30f89c,util[_0x59e7('0x41')](this[_0x59e7('0x10')][_0x30f89c],{'showHidden':![],'depth':null}));ami['emit'](_0x59e7('0xd5'),this[_0x59e7('0x10')][_0x30f89c]);if(_0x5e324d[_0x59e7('0x51')]===_0x59e7('0x52'))return;delete this[_0x59e7('0x10')][_0x30f89c];delete this[_0x59e7('0x12')][_0x30f89c];if(this[_0x59e7('0xb8')][_0x30f89c]){delete this[_0x59e7('0xb8')][_0x30f89c];}};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0xd6')]=function(_0x3c974e){try{if(this['isNotNull'](_0x3c974e)){logger[_0x59e7('0x46')](_0x59e7('0xd7'),_0x3c974e[_0x59e7('0x49')],util['inspect'](_0x3c974e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3c974e[_0x59e7('0x49')]]){return this[_0x59e7('0xc9')](_0x3c974e[_0x59e7('0x49')],_0x3c974e[_0x59e7('0xd8')]);}if(this[_0x59e7('0x10')][_0x3c974e[_0x59e7('0xa0')]]){if(_0x3c974e[_0x59e7('0xd9')]==='21'){return;}return this[_0x59e7('0xc9')](_0x3c974e[_0x59e7('0xa0')],_0x3c974e[_0x59e7('0xd8')],!![]);}var _0x5010af=Object['keys'](this[_0x59e7('0x10')]);for(var _0x12a757=0x0;_0x12a757<_0x5010af['length'];_0x12a757++){var _0x763a58=_[_0x59e7('0x86')](this[_0x59e7('0x10')][_0x5010af[_0x12a757]]);if(_0x763a58&&_0x763a58[_0x59e7('0xda')]===_0x3c974e[_0x59e7('0x49')]){return this['handleHangup'](_0x763a58['uniqueid'],_0x3c974e[_0x59e7('0xd8')],!![]);}}}}catch(_0x1f1919){logger[_0x59e7('0x3f')](_0x59e7('0xd7'),_0x3c974e[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x1f1919,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59e7('0xb')]['syncAttendedTransfer']=function(_0x28ef32){try{if(this[_0x59e7('0x70')](_0x28ef32)){logger[_0x59e7('0x46')](_0x59e7('0xdb'),_0x28ef32[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x28ef32,{'showHidden':![],'depth':null}));var _0x5277e8;var _0x609a7f;var _0x19bac4;if(this[_0x59e7('0x10')][_0x28ef32[_0x59e7('0xdc')]]){_0x5277e8=_[_0x59e7('0x86')](this['queueReports'][_0x28ef32[_0x59e7('0xdc')]]);_0x5277e8[_0x59e7('0xdd')]=_0x28ef32['secondtransfererexten'];_0x5277e8[_0x59e7('0xa5')]=_0x28ef32[_0x59e7('0xde')];_0x5277e8['queuecallerexitreason']=_0x59e7('0x52');_0x5277e8[_0x59e7('0x9c')]=!![];_0x5277e8['transfertype']=_0x59e7('0xdf');if(this[_0x59e7('0x10')][_0x28ef32['secondtransfereruniqueid']]){_0x19bac4=this[_0x59e7('0x10')][_0x28ef32[_0x59e7('0xde')]];this[_0x59e7('0x10')][_0x28ef32[_0x59e7('0xde')]]=this[_0x59e7('0x10')][_0x28ef32['transfereeuniqueid']];this['queueReports'][_0x28ef32[_0x59e7('0xdc')]]=_0x19bac4;_0x609a7f=_[_0x59e7('0x86')](this[_0x59e7('0x10')][_0x28ef32[_0x59e7('0xdc')]]);_0x609a7f['switch']=!![];}logger[_0x59e7('0x73')](_0x59e7('0xe0'),_0x28ef32['uniqueid'],_0x5277e8[_0x59e7('0x4d')],_0x5277e8[_0x59e7('0x56')],_0x5277e8[_0x59e7('0xdd')],_0x5277e8[_0x59e7('0xa5')]);}else if(this[_0x59e7('0x10')][_0x28ef32[_0x59e7('0xe1')]]){_0x5277e8=_[_0x59e7('0x86')](this['queueReports'][_0x28ef32[_0x59e7('0xe1')]]);_0x5277e8[_0x59e7('0xdd')]=_0x28ef32[_0x59e7('0xe2')];_0x5277e8[_0x59e7('0xa5')]=_0x28ef32[_0x59e7('0xe3')];_0x5277e8[_0x59e7('0x51')]=_0x59e7('0x52');_0x5277e8[_0x59e7('0x9c')]=!![];_0x5277e8[_0x59e7('0xa3')]=_0x59e7('0xdf');if(this[_0x59e7('0x10')][_0x28ef32[_0x59e7('0xe3')]]){_0x19bac4=this[_0x59e7('0x10')][_0x28ef32['origtransfereruniqueid']];this[_0x59e7('0x10')][_0x28ef32[_0x59e7('0xe3')]]=this[_0x59e7('0x10')][_0x28ef32['transfertargetuniqueid']];this[_0x59e7('0x10')][_0x28ef32[_0x59e7('0xe1')]]=_0x19bac4;_0x609a7f=_['last'](this[_0x59e7('0x10')][_0x28ef32['transfertargetuniqueid']]);_0x609a7f[_0x59e7('0xe4')]=!![];}logger[_0x59e7('0x73')](_0x59e7('0xe0'),_0x28ef32[_0x59e7('0x49')],_0x5277e8[_0x59e7('0x4d')],_0x5277e8[_0x59e7('0x56')],_0x5277e8[_0x59e7('0xdd')],_0x5277e8[_0x59e7('0xa5')]);}else if(this[_0x59e7('0x10')][_0x28ef32['origtransfereruniqueid']]){_0x5277e8=_[_0x59e7('0x86')](this[_0x59e7('0x10')][_0x28ef32[_0x59e7('0xe3')]]);_0x5277e8[_0x59e7('0xdd')]=_0x28ef32[_0x59e7('0xe2')];_0x5277e8['transferuniqueid']=_0x28ef32[_0x59e7('0xe3')];_0x5277e8['queuecallerexitreason']=_0x59e7('0x52');_0x5277e8[_0x59e7('0x9c')]=!![];_0x5277e8[_0x59e7('0xa3')]=_0x59e7('0xdf');_0x5277e8['switch']=!![];_0x5277e8[_0x59e7('0xda')]=_0x28ef32[_0x59e7('0xdc')];}else if(this[_0x59e7('0x10')][_0x28ef32[_0x59e7('0xde')]]){_0x5277e8=_['last'](this['queueReports'][_0x28ef32[_0x59e7('0xde')]]);_0x5277e8['transferexten']=_0x28ef32['secondtransfererexten'];_0x5277e8['transferuniqueid']=_0x28ef32[_0x59e7('0xde')];_0x5277e8['queuecallerexitreason']=_0x59e7('0x52');_0x5277e8[_0x59e7('0x9c')]=!![];_0x5277e8['transfertype']='ATTENDED';_0x5277e8[_0x59e7('0xe4')]=!![];_0x5277e8[_0x59e7('0xda')]=_0x28ef32['transfertargetuniqueid'];}}}catch(_0x40185f){logger['error']('[%s][voiceQueueReport][attendedtransfer]',_0x28ef32[_0x59e7('0x49')],util['inspect'](_0x40185f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0x2f')]=function(_0x3fdfa0){try{if(this[_0x59e7('0x70')](_0x3fdfa0)){logger[_0x59e7('0x46')](_0x59e7('0xe5'),_0x3fdfa0[_0x59e7('0x49')],util['inspect'](_0x3fdfa0,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3fdfa0[_0x59e7('0xdc')]]){var _0x53b342=_[_0x59e7('0x86')](this['queueReports'][_0x3fdfa0['transfereeuniqueid']]);_0x53b342['queuecallerexitreason']='BLINDTRANSFER';_0x53b342[_0x59e7('0x9c')]=!![];_0x53b342['transfertype']='BLIND';_0x53b342[_0x59e7('0xdd')]=_0x3fdfa0[_0x59e7('0xe6')];_0x53b342[_0x59e7('0xa5')]=_0x3fdfa0[_0x59e7('0xdc')];logger['info']('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x3fdfa0['uniqueid'],_0x53b342[_0x59e7('0x4d')],_0x53b342[_0x59e7('0x56')],_0x53b342[_0x59e7('0xdd')],_0x53b342['transferuniqueid']);this[_0x59e7('0xd6')]({'event':_0x59e7('0xe7'),'uniqueid':_0x3fdfa0[_0x59e7('0xdc')],'context':_0x3fdfa0[_0x59e7('0xe8')],'channel':_0x3fdfa0[_0x59e7('0xe9')]});}}}catch(_0x454665){logger['error'](_0x59e7('0xe5'),_0x3fdfa0[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x454665,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0xea')]=function(_0x434027){try{if(this[_0x59e7('0x70')](_0x434027)){logger[_0x59e7('0x46')](_0x59e7('0xeb'),_0x434027[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x434027,{'showHidden':![],'depth':null}));if(this[_0x59e7('0x10')][_0x434027[_0x59e7('0x49')]]){var _0x2cd7a9=_[_0x59e7('0x86')](this['queueReports'][_0x434027[_0x59e7('0x49')]]);if(!_[_0x59e7('0x38')](_0x2cd7a9['queuecallerleaveAt'])){_0x2cd7a9[_0x59e7('0xec')]=moment()[_0x59e7('0x4b')](_0x59e7('0x7e'));logger[_0x59e7('0x73')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x434027['uniqueid'],_0x2cd7a9[_0x59e7('0xec')]);}}}}catch(_0x2c4a47){logger[_0x59e7('0x3f')](_0x59e7('0xeb'),_0x434027[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x2c4a47,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59e7('0xb')][_0x59e7('0x2b')]=function(_0x134f63){try{if(this['isNotNull'](_0x134f63)){logger[_0x59e7('0x46')](_0x59e7('0xed'),_0x134f63[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x134f63,{'showHidden':![],'depth':null}));if(this[_0x59e7('0x10')][_0x134f63['uniqueid']]){var _0x315c76=_[_0x59e7('0x86')](this[_0x59e7('0x10')][_0x134f63['uniqueid']]);if(!_[_0x59e7('0x38')](_0x315c76[_0x59e7('0xec')])){_0x315c76[_0x59e7('0xee')]+=moment()['milliseconds'](0x0)['diff'](_0x315c76[_0x59e7('0xec')],'seconds');logger['info']('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x134f63[_0x59e7('0x49')],_0x315c76[_0x59e7('0xee')]);delete _0x315c76['mohstarttime'];}}}}catch(_0x5073ad){logger[_0x59e7('0x3f')](_0x59e7('0xed'),_0x134f63[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x5073ad,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x59e7('0xb')]['syncNewExten']=function(_0xe4111d){try{if(this[_0x59e7('0x70')](_0xe4111d)){logger[_0x59e7('0x46')](_0x59e7('0xef'),_0xe4111d[_0x59e7('0x49')],util[_0x59e7('0x41')](_0xe4111d,{'showHidden':![],'depth':null}));if(_0xe4111d[_0x59e7('0xf0')][_0x59e7('0xf1')]()==='set'){_0xe4111d['applicationdata']=_0xe4111d[_0x59e7('0xf2')]&&_0xe4111d[_0x59e7('0xf2')][_0x59e7('0xf3')](_0x59e7('0xf4'))?_0xe4111d[_0x59e7('0xf2')]:(_0xe4111d['appdata']||_0xe4111d[_0x59e7('0xf5')])['toLowerCase']();if(_[_0x59e7('0xf3')](_0xe4111d[_0x59e7('0xf5')][_0x59e7('0xf1')](),_0x59e7('0xf6'))){logger[_0x59e7('0x73')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0xe4111d[_0x59e7('0x49')],_0xe4111d[_0x59e7('0xf0')],_0xe4111d[_0x59e7('0xf5')]);if(_['isUndefined'](this['channels'][_0xe4111d['uniqueid']]))this['channels'][_0xe4111d['uniqueid']]={};var _0xb0cefb=_0xe4111d[_0x59e7('0xf5')][_0x59e7('0xf7')]('=');var _0x19e474=_0xb0cefb[0x0][_0x59e7('0xf1')]()[_0x59e7('0xf8')](/cdr\((.*)\)/);if(_0x19e474)this['channels'][_0xe4111d[_0x59e7('0x49')]][_0x19e474[0x1]]=_0xb0cefb[0x1];}}}}catch(_0x134282){logger['error']('[%s][voiceQueueReport][newexten]',_0xe4111d[_0x59e7('0x49')],util[_0x59e7('0x41')](_0x134282,{'showHidden':![],'depth':null}));}};module[_0x59e7('0xf9')]=VoiceQueueReport;
\ No newline at end of file