Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index e36d4cd..ff15702 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5c2b=['name','voice_queue_presence:remove','emitVoiceQueueSummary','inbound','strategy','answered','available','loggedIn','sumBillable','sumDuration','talking','unmanaged','Trunk','Interval','stringify','debug','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','isNotNull','loopQueueShow','Action','queues','catch','[voiceQueueReport][queues]','flagQueueSummary','then','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','queue','countBy','toNumber','callers','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','type','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','pick','[%s][voiceQueueReport][queuecallerabandon]','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','emitVoiceQueueChannelRemove','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','queuecallerabandon','assigned','membername','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','toLowerCase','local/','linkedid','queuecallerexit','queuecallerexitAt','add','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','[%s][voiceQueueReport][agentcomplete]','[%s][voiceQueueReport][varset]','addVariable','variable','value','TIMEOUT','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','keys','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','memberinterface','memberlastcall','memberpenalty','includes','length','abandoned','sumHoldTime','diff','milliseconds','total','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedtransfer]','syncBlindTransfer','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','mohstarttime','[%s][voiceQueueReport][musiconholdstart]','syncMusicOnHoldStop','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','exports','lodash','moment','util','md5','ioredis','../../../config/environment','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','tail','finally','sequence','queueReports','agents','channels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncMusicOnHoldStart','attendedtransfer','syncAttendedTransfer','blindtransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','clearZombieChannels','enqueue','isNil','status','channel','message','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','error','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER'];(function(_0x6b7cef,_0x1257b8){var _0x42bf71=function(_0x130162){while(--_0x130162){_0x6b7cef['push'](_0x6b7cef['shift']());}};_0x42bf71(++_0x1257b8);}(_0x5c2b,0x9f));var _0xb5c2=function(_0x3d61a0,_0x45e0a9){_0x3d61a0=_0x3d61a0-0x0;var _0x4abee0=_0x5c2b[_0x3d61a0];return _0x4abee0;};'use strict';var _=require(_0xb5c2('0x0'));var moment=require(_0xb5c2('0x1'));var util=require(_0xb5c2('0x2'));var md5=require(_0xb5c2('0x3'));var Redis=require(_0xb5c2('0x4'));var config=require(_0xb5c2('0x5'));var logger=require('../../../config/logger')(_0xb5c2('0x6'));var ami=require(_0xb5c2('0x7'));var QueueReport=require(_0xb5c2('0x8'));config[_0xb5c2('0x9')]=_[_0xb5c2('0xa')](config[_0xb5c2('0x9')],{'host':_0xb5c2('0xb'),'port':0x18eb});var io=require(_0xb5c2('0xc'))(new Redis(config[_0xb5c2('0x9')]));var Sequence=function(){};Sequence[_0xb5c2('0xd')]['enqueue']=function(_0x17992a){this['tail']=this[_0xb5c2('0xe')]?this['tail'][_0xb5c2('0xf')](_0x17992a):_0x17992a();};function VoiceQueueReport(_0x28a022){this[_0xb5c2('0x10')]=new Sequence();this[_0xb5c2('0x11')]={};this[_0xb5c2('0x12')]=_0x28a022['agents'];this[_0xb5c2('0x13')]=_0x28a022['queueChannels'];this[_0xb5c2('0x14')]=_0x28a022[_0xb5c2('0x14')];this['flagQueueSummary']=!![];this['campaigns']=_0x28a022[_0xb5c2('0x15')];this[_0xb5c2('0x16')]={};ami['on'](_0xb5c2('0x17'),this[_0xb5c2('0x18')][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x1a'),this[_0xb5c2('0x1b')][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x1c'),this['syncQueueCallerJoin'][_0xb5c2('0x19')](this));ami['on']('queuecallerabandon',this[_0xb5c2('0x1d')][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x1e'),this[_0xb5c2('0x1f')][_0xb5c2('0x19')](this));ami['on']('agentcomplete',this[_0xb5c2('0x20')][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x21'),this[_0xb5c2('0x22')]['bind'](this));ami['on'](_0xb5c2('0x23'),this[_0xb5c2('0x24')][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x25'),this[_0xb5c2('0x26')]['bind'](this));ami['on'](_0xb5c2('0x27'),this['syncFullyBooted'][_0xb5c2('0x19')](this));ami['on']('musiconholdstart',this[_0xb5c2('0x28')][_0xb5c2('0x19')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x29'),this[_0xb5c2('0x2a')][_0xb5c2('0x19')](this));ami['on'](_0xb5c2('0x2b'),this['syncBlindTransfer'][_0xb5c2('0x19')](this));this[_0xb5c2('0x2c')]();this['loopQueueShow']();}function clearChannels(_0x5b1b83){if(!_[_0xb5c2('0x2d')](_0x5b1b83)){for(var _0x166a11 in _0x5b1b83){if(_0x5b1b83[_0xb5c2('0x2e')](_0x166a11)){delete _0x5b1b83[_0x166a11];}}}}function clearCampaigns(_0x49a61e){if(!_[_0xb5c2('0x2d')](_0x49a61e)){for(var _0x24500f in _0x49a61e){if(_0x49a61e[_0xb5c2('0x2e')](_0x24500f)){_0x49a61e[_0x24500f][_0xb5c2('0x2f')]=0x0;}}}}function clearVoiceQueues(_0xff11d0){if(!_['isEmpty'](_0xff11d0)){for(var _0x44fcae in _0xff11d0){if(_0xff11d0[_0xb5c2('0x2e')](_0x44fcae)){_0xff11d0[_0x44fcae][_0xb5c2('0x2f')]=0x0;_0xff11d0[_0x44fcae]['talking']=0x0;_0xff11d0[_0x44fcae][_0xb5c2('0x30')]=0x0;_0xff11d0[_0x44fcae][_0xb5c2('0x31')]=0x0;_0xff11d0[_0x44fcae][_0xb5c2('0x32')]=!![];}}}}function clearAgentBooked(_0x42be33){if(!_[_0xb5c2('0x2d')](_0x42be33)){for(var _0x1242d5 in _0x42be33){if(_0x42be33[_0xb5c2('0x2e')](_0x1242d5)){_0x42be33[_0x1242d5]['unlockRR']=!![];}}}}VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x33')]=function(){var _0xb34418=this;for(var _0x5e77fe in this[_0xb5c2('0x13')]){if(this[_0xb5c2('0x13')]['hasOwnProperty'](_0x5e77fe)&&!this[_0xb5c2('0x13')][_0x5e77fe]['switch']){this['sequence'][_0xb5c2('0x34')](function(){if(!_[_0xb5c2('0x35')](_0xb34418[_0xb5c2('0x13')][_0x5e77fe])){return ami['Action']({'action':_0xb5c2('0x36'),'channel':_0xb34418[_0xb5c2('0x13')][_0x5e77fe][_0xb5c2('0x37')]})['catch'](function(_0x5851d0){if(_0x5851d0[_0xb5c2('0x38')]==='No\x20such\x20channel'){setTimeout(function(){if(_0xb34418[_0xb5c2('0x13')][_0x5e77fe]){delete _0xb34418['channels'][_0x5e77fe];logger['error'](_0xb5c2('0x39'),_0x5e77fe,util[_0xb5c2('0x3a')](_0x5851d0,{'showHidden':![],'depth':null}));}if(_0xb34418['queueReports'][_0x5e77fe]){delete _0xb34418[_0xb5c2('0x11')][_0x5e77fe];logger['error'](_0xb5c2('0x3b'),_0x5e77fe,util[_0xb5c2('0x3a')](_0x5851d0,{'showHidden':![],'depth':null}));}if(_0xb34418[_0xb5c2('0x16')][_0x5e77fe]){delete _0xb34418[_0xb5c2('0x16')][_0x5e77fe];logger[_0xb5c2('0x3c')](_0xb5c2('0x3d'),_0x5e77fe,util[_0xb5c2('0x3a')](_0x5851d0,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x3e')]=function(){logger[_0xb5c2('0x3c')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xb5c2('0x13')]);this[_0xb5c2('0x3f')](this[_0xb5c2('0x11')]);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xb5c2('0x15')]);};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x3f')]=function(_0x1b6c02){var _0x4dfae6=this;if(!_['isEmpty'](_0x1b6c02)){for(var _0x45f4b6 in _0x1b6c02){if(_0x1b6c02[_0xb5c2('0x2e')](_0x45f4b6)){_0x4dfae6['emitVoiceQueueChannelRemove'](_0x1b6c02[_0x45f4b6],_0xb5c2('0x40'));delete _0x1b6c02[_0x45f4b6];}}}};VoiceQueueReport['prototype']['emit']=function(_0x59ed73,_0x5aaf58,_0x2b04ce){io['to'](_0x59ed73)[_0xb5c2('0x41')](_0x5aaf58,_0x2b04ce);};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x42')]=function(_0x54b7dc,_0x5c3c05){logger['debug'](_0xb5c2('0x43')+_0x5c3c05+_0xb5c2('0x44'),_0x54b7dc[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x54b7dc,{'showHidden':![],'depth':null}));this[_0xb5c2('0x41')](util[_0xb5c2('0x46')](_0xb5c2('0x47'),_0x54b7dc['name']),_0xb5c2('0x48'),_0x54b7dc);io[_0xb5c2('0x41')](_0xb5c2('0x49'),_0x54b7dc);};VoiceQueueReport[_0xb5c2('0xd')]['emitVoiceQueueChannelRemove']=function(_0x1d7409,_0x749d71){logger['debug'](_0xb5c2('0x43')+_0x749d71+_0xb5c2('0x4a'),_0x1d7409[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x1d7409,{'showHidden':![],'depth':null}));if(_0x1d7409[_0xb5c2('0x4b')]===_0xb5c2('0x4c'))return;this[_0xb5c2('0x41')](util[_0xb5c2('0x46')]('voice:queue:%s',_0x1d7409[_0xb5c2('0x4d')]),'voice_queue_channel:remove',_0x1d7409);io[_0xb5c2('0x41')](_0xb5c2('0x4e'),_0x1d7409);};VoiceQueueReport['prototype'][_0xb5c2('0x4f')]=function(_0x244f8c,_0x4a637d){if(_0x244f8c['type']===_0xb5c2('0x50')){var _0xc11fe5={'id':_0x244f8c['id'],'name':_0x244f8c['name'],'strategy':_0x244f8c[_0xb5c2('0x51')],'answered':_0x244f8c[_0xb5c2('0x52')],'available':_0x244f8c[_0xb5c2('0x53')],'loggedIn':_0x244f8c[_0xb5c2('0x54')],'pTalking':_0x244f8c[_0xb5c2('0x30')],'sumBillable':_0x244f8c[_0xb5c2('0x55')],'sumDuration':_0x244f8c[_0xb5c2('0x56')],'sumHoldTime':_0x244f8c['sumHoldTime']||0x0,'talking':_0x244f8c[_0xb5c2('0x57')],'total':_0x244f8c['total'],'type':_0x244f8c['type'],'unmanaged':_0x244f8c[_0xb5c2('0x58')],'abandoned':_0x244f8c['abandoned'],'waiting':_0x244f8c[_0xb5c2('0x31')]};if(_0x244f8c[_0xb5c2('0x59')]){_0xc11fe5[_0xb5c2('0x59')]={'id':_0x244f8c['Trunk']['id'],'name':_0x244f8c[_0xb5c2('0x59')]['name'],'active':_0x244f8c[_0xb5c2('0x59')]['active'],'callerid':_0x244f8c[_0xb5c2('0x59')]['callerid']};}if(_0x244f8c[_0xb5c2('0x5a')]){_0xc11fe5[_0xb5c2('0x5a')]={'id':_0x244f8c[_0xb5c2('0x5a')]['id'],'name':_0x244f8c['Interval'][_0xb5c2('0x4d')]};}var _0x20a8d6=md5(JSON[_0xb5c2('0x5b')](_0xc11fe5));if(_0x244f8c[_0xb5c2('0x3')]!==_0x20a8d6){_0x244f8c[_0xb5c2('0x3')]=_0x20a8d6;logger[_0xb5c2('0x5c')](_0xb5c2('0x5d')+_0x4a637d+_0xb5c2('0x5e'),util[_0xb5c2('0x3a')](_0xc11fe5,{'showHidden':![],'depth':null}));this[_0xb5c2('0x41')](util[_0xb5c2('0x46')](_0xb5c2('0x47'),_0xc11fe5[_0xb5c2('0x4d')]),'voice_queue:save',_0xc11fe5);}}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x5f')]=function(_0x4c4fa7){return _0x4c4fa7!==null&&!_['isUndefined'](_0x4c4fa7);};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x60')]=function(){var _0xe5dcc6=this;setInterval(function(){_0xe5dcc6['clearZombieChannels']();ami[_0xb5c2('0x61')]({'action':_0xb5c2('0x62')})[_0xb5c2('0x63')](function(_0x5dd831){logger['error'](_0xb5c2('0x64'),util[_0xb5c2('0x3a')](_0x5dd831,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x2c')]=function(){var _0x2be541=this;setInterval(function(){if(_0x2be541[_0xb5c2('0x65')]){return ami[_0xb5c2('0x61')]({'action':_0xb5c2('0x17')})[_0xb5c2('0x66')](function(){_0x2be541[_0xb5c2('0x65')]=![];})[_0xb5c2('0x63')](function(_0x41aa3a){logger[_0xb5c2('0x3c')](_0xb5c2('0x67'),util[_0xb5c2('0x3a')](_0x41aa3a,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x18')]=function(_0x80ffe7){try{if(this[_0xb5c2('0x5f')](_0x80ffe7)&&this[_0xb5c2('0x5f')](_0x80ffe7['queue'])){logger['debug'](_0xb5c2('0x68'),util[_0xb5c2('0x3a')](_0x80ffe7,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x14')][_0x80ffe7['queue']]){logger[_0xb5c2('0x69')](_0xb5c2('0x6a'),_0x80ffe7[_0xb5c2('0x6b')]);var _0x428f6a=_[_0xb5c2('0x6c')](this[_0xb5c2('0x13')],_0xb5c2('0x6b'))[_0x80ffe7[_0xb5c2('0x6b')]]||0x0;var _0xc8cb4c=_0x428f6a-_0x80ffe7['callers'];if(this['voiceQueues'][_0x80ffe7['queue']][_0xb5c2('0x31')]!==_[_0xb5c2('0x6d')](_0x80ffe7[_0xb5c2('0x6e')])||this['voiceQueues'][_0x80ffe7[_0xb5c2('0x6b')]]['loggedIn']!==_[_0xb5c2('0x6d')](_0x80ffe7[_0xb5c2('0x6f')])||this[_0xb5c2('0x14')][_0x80ffe7[_0xb5c2('0x6b')]][_0xb5c2('0x53')]!==_[_0xb5c2('0x6d')](_0x80ffe7[_0xb5c2('0x53')])||this['voiceQueues'][_0x80ffe7[_0xb5c2('0x6b')]][_0xb5c2('0x57')]!==_0xc8cb4c){this[_0xb5c2('0x14')][_0x80ffe7[_0xb5c2('0x6b')]]['waiting']=_[_0xb5c2('0x6d')](_0x80ffe7['callers']);this[_0xb5c2('0x14')][_0x80ffe7[_0xb5c2('0x6b')]]['loggedIn']=_['toNumber'](_0x80ffe7[_0xb5c2('0x6f')]);this['voiceQueues'][_0x80ffe7['queue']][_0xb5c2('0x53')]=_[_0xb5c2('0x6d')](_0x80ffe7[_0xb5c2('0x53')]);this['voiceQueues'][_0x80ffe7[_0xb5c2('0x6b')]]['talking']=_0xc8cb4c>0x0?_0xc8cb4c:0x0;this[_0xb5c2('0x14')][_0x80ffe7[_0xb5c2('0x6b')]]['talking']=this['voiceQueues'][_0x80ffe7[_0xb5c2('0x6b')]]['talking']>_[_0xb5c2('0x6d')](_0x80ffe7[_0xb5c2('0x6f')])?_['toNumber'](_0x80ffe7[_0xb5c2('0x6f')]):this[_0xb5c2('0x14')][_0x80ffe7[_0xb5c2('0x6b')]][_0xb5c2('0x57')];this[_0xb5c2('0x4f')](this[_0xb5c2('0x14')][_0x80ffe7[_0xb5c2('0x6b')]],_0xb5c2('0x17'));}logger[_0xb5c2('0x5c')](_0xb5c2('0x70'),util[_0xb5c2('0x3a')](this['voiceQueues'][_0x80ffe7[_0xb5c2('0x6b')]],{'showHidden':![],'depth':null}));ami[_0xb5c2('0x41')](_0xb5c2('0x71'),this[_0xb5c2('0x14')][_0x80ffe7['queue']]);}}}catch(_0x2678cb){logger[_0xb5c2('0x3c')](_0xb5c2('0x67'),util[_0xb5c2('0x3a')](_0x2678cb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x1b')]=function(_0x43b3be){logger[_0xb5c2('0x5c')](_0xb5c2('0x72'),util[_0xb5c2('0x3a')](_0x43b3be,{'showHidden':![],'depth':null}));this[_0xb5c2('0x65')]=!![];};VoiceQueueReport['prototype'][_0xb5c2('0x73')]=function(_0x51ee5d){try{if(this['isNotNull'](_0x51ee5d)){logger[_0xb5c2('0x5c')](_0xb5c2('0x74'),_0x51ee5d['uniqueid'],util['inspect'](_0x51ee5d,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x51ee5d[_0xb5c2('0x45')]]))this[_0xb5c2('0x11')][_0x51ee5d[_0xb5c2('0x45')]]=[];if(_[_0xb5c2('0x75')](this[_0xb5c2('0x13')][_0x51ee5d[_0xb5c2('0x45')]]))this[_0xb5c2('0x13')][_0x51ee5d[_0xb5c2('0x45')]]={};var _0xc61b88=new QueueReport();_0xc61b88[_0xb5c2('0x4d')]=_0x51ee5d[_0xb5c2('0x6b')];_0xc61b88[_0xb5c2('0x76')]=this[_0xb5c2('0x14')][_0xc61b88[_0xb5c2('0x4d')]]&&this['voiceQueues'][_0xc61b88[_0xb5c2('0x4d')]][_0xb5c2('0x76')]?this[_0xb5c2('0x14')][_0xc61b88['name']][_0xb5c2('0x76')]||'inbound':_0xb5c2('0x50');_0xc61b88[_0xb5c2('0x6b')]=_0x51ee5d[_0xb5c2('0x6b')];_0xc61b88[_0xb5c2('0x77')]=moment()['format'](_0xb5c2('0x78'));_0xc61b88[_0xb5c2('0x79')]=_0x51ee5d['position'];_0xc61b88[_0xb5c2('0x7a')]=_0x51ee5d[_0xb5c2('0x7a')];_0xc61b88[_0xb5c2('0x45')]=_0x51ee5d['uniqueid'];_0xc61b88['routealias']=this[_0xb5c2('0x13')][_0x51ee5d[_0xb5c2('0x45')]]['routealias'];logger[_0xb5c2('0x69')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0xc61b88[_0xb5c2('0x4d')],_0xc61b88['type']);_['merge'](_0xc61b88,_[_0xb5c2('0x7b')](_0x51ee5d,_['keys'](_0xc61b88)));this[_0xb5c2('0x11')][_0x51ee5d[_0xb5c2('0x45')]]['push'](_0xc61b88);this['channels'][_0x51ee5d[_0xb5c2('0x45')]]=_0xc61b88;this[_0xb5c2('0x42')](_0xc61b88,_0xb5c2('0x1c'));}}catch(_0x51ee96){logger[_0xb5c2('0x3c')]('[%s][voiceQueueReport][queuecallerjoin]',_0x51ee5d[_0xb5c2('0x45')],util['inspect'](_0x51ee96,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x1d')]=function(_0x484637){try{if(this[_0xb5c2('0x5f')](_0x484637)){logger[_0xb5c2('0x5c')](_0xb5c2('0x7c'),_0x484637[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x484637,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x11')][_0x484637[_0xb5c2('0x45')]]){var _0x29121f=_['last'](this[_0xb5c2('0x11')][_0x484637[_0xb5c2('0x45')]]);_0x29121f['queuecallercomplete']=![];_0x29121f[_0xb5c2('0x7d')]=null;_0x29121f[_0xb5c2('0x7e')]=_0x484637['holdtime'];_0x29121f[_0xb5c2('0x7f')]=_0x484637[_0xb5c2('0x7f')];_0x29121f['queuecallerabandon']=!![];_0x29121f[_0xb5c2('0x80')]=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));_0x29121f['queuecallerexitreason']=_0xb5c2('0x81');_0x29121f[_0xb5c2('0x82')]=null;logger[_0xb5c2('0x69')](_0xb5c2('0x83'),_0x29121f[_0xb5c2('0x4d')],_0x29121f[_0xb5c2('0x76')]);this[_0xb5c2('0x13')][_0x484637[_0xb5c2('0x45')]]=_0x29121f;this[_0xb5c2('0x84')](_0x29121f,'queuecallerabandon');}}}catch(_0x6d2af6){logger[_0xb5c2('0x3c')](_0xb5c2('0x7c'),_0x484637[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x6d2af6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')]['syncQueueCallerLeave']=function(_0x2d7274){try{if(this[_0xb5c2('0x5f')](_0x2d7274)){logger['debug'](_0xb5c2('0x85'),_0x2d7274[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x2d7274,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x11')][_0x2d7274[_0xb5c2('0x45')]]){var _0x2ecc74=_[_0xb5c2('0x86')](this['queueReports'][_0x2d7274[_0xb5c2('0x45')]]);_0x2ecc74[_0xb5c2('0x87')]=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));_0x2ecc74[_0xb5c2('0x88')]=_0x2d7274['connectedlinenum'];_0x2ecc74[_0xb5c2('0x89')]=_0x2d7274[_0xb5c2('0x89')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x2ecc74[_0xb5c2('0x4d')],_0x2ecc74[_0xb5c2('0x76')],_0x2d7274[_0xb5c2('0x88')],_0x2d7274[_0xb5c2('0x89')]);this[_0xb5c2('0x13')][_0x2d7274[_0xb5c2('0x45')]]=_0x2ecc74;this[_0xb5c2('0x42')](_0x2ecc74,'queuecallerleave');}}}catch(_0x371a2c){logger[_0xb5c2('0x3c')](_0xb5c2('0x85'),_0x2d7274[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x371a2c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x22')]=function(_0x18bed8){try{if(this[_0xb5c2('0x5f')](_0x18bed8)){logger[_0xb5c2('0x5c')](_0xb5c2('0x8a'),_0x18bed8['uniqueid'],util['inspect'](_0x18bed8,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x11')][_0x18bed8[_0xb5c2('0x45')]]){var _0x5b067f=_[_0xb5c2('0x86')](this['queueReports'][_0x18bed8[_0xb5c2('0x45')]]);_0x5b067f[_0xb5c2('0x8b')]=!![];_0x5b067f[_0xb5c2('0x4b')]='COMPLETEDBYAGENT';logger[_0xb5c2('0x69')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x5b067f[_0xb5c2('0x4d')],_0x5b067f['type']);}}}catch(_0x260776){logger[_0xb5c2('0x3c')](_0xb5c2('0x8a'),_0x18bed8[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x260776,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x1a1d9a){try{if(this[_0xb5c2('0x5f')](_0x1a1d9a)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x1a1d9a['uniqueid'],util[_0xb5c2('0x3a')](_0x1a1d9a,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x11')][_0x1a1d9a[_0xb5c2('0x45')]]){var _0x11e82d=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x1a1d9a[_0xb5c2('0x45')]]);_0x11e82d[_0xb5c2('0x8c')]=![];_0x11e82d[_0xb5c2('0x80')]=null;_0x11e82d[_0xb5c2('0x8d')]=!![];_0x11e82d[_0xb5c2('0x82')]=_0x1a1d9a[_0xb5c2('0x8e')];_0x11e82d[_0xb5c2('0x7e')]=_0x1a1d9a['holdtime'];_0x11e82d[_0xb5c2('0x8b')]=!![];_0x11e82d['queuecallerexit']=![];_0x11e82d['queuecallerexitAt']=null;if(!_0x11e82d[_0xb5c2('0x8f')]){if(_0x1a1d9a[_0xb5c2('0x90')]==_0xb5c2('0x8f')){_0x11e82d[_0xb5c2('0x4b')]=_0xb5c2('0x91');logger[_0xb5c2('0x69')](_0xb5c2('0x92'),_0x11e82d[_0xb5c2('0x4d')],_0x11e82d[_0xb5c2('0x76')]);}else{if(_['startsWith'](_0x1a1d9a[_0xb5c2('0x37')][_0xb5c2('0x93')](),_0xb5c2('0x94'))){if(this[_0xb5c2('0x11')][_0x1a1d9a[_0xb5c2('0x95')]]){var _0xcfcb8b=_['last'](this[_0xb5c2('0x11')][_0x1a1d9a[_0xb5c2('0x95')]]);_0xcfcb8b['queuecallercomplete']=![];_0xcfcb8b[_0xb5c2('0x96')]=!![];_0xcfcb8b[_0xb5c2('0x97')]=moment(_0x11e82d[_0xb5c2('0x77')])[_0xb5c2('0x98')](_0x1a1d9a[_0xb5c2('0x7e')],_0xb5c2('0x99'))[_0xb5c2('0x46')](_0xb5c2('0x78'));_0xcfcb8b['queuecallerexitreason']=_0xb5c2('0x9a');_0xcfcb8b[_0xb5c2('0x8f')]=!![];_0xcfcb8b[_0xb5c2('0x9b')]='FORWARD';_0xcfcb8b[_0xb5c2('0x9c')]=_0x1a1d9a[_0xb5c2('0x9d')];_0xcfcb8b[_0xb5c2('0x9e')]=_0x1a1d9a[_0xb5c2('0x45')];logger[_0xb5c2('0x69')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0xcfcb8b['name'],_0xcfcb8b[_0xb5c2('0x76')]);var _0x5a38c4=this[_0xb5c2('0x11')][_0x1a1d9a[_0xb5c2('0x95')]];this[_0xb5c2('0x11')][_0x1a1d9a['linkedid']]=this[_0xb5c2('0x11')][_0x1a1d9a[_0xb5c2('0x45')]];this[_0xb5c2('0x11')][_0x1a1d9a['uniqueid']]=_0x5a38c4;}}else{_0x11e82d[_0xb5c2('0x4b')]=_0xb5c2('0x9f')+_0x1a1d9a['reason']['toUpperCase']();logger[_0xb5c2('0x69')](_0xb5c2('0xa0'),_0x11e82d[_0xb5c2('0x4d')],_0x11e82d[_0xb5c2('0x76')],_0x11e82d[_0xb5c2('0x4b')]);}}}this[_0xb5c2('0x13')][_0x1a1d9a[_0xb5c2('0x45')]]=_0x11e82d;this[_0xb5c2('0x84')](_0x11e82d,_0xb5c2('0xa1'));}}}catch(_0xd0b72b){logger['error'](_0xb5c2('0xa2'),_0x1a1d9a['uniqueid'],util[_0xb5c2('0x3a')](_0xd0b72b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x24')]=function(_0x430f08){try{if(this['isNotNull'](_0x430f08)){logger['debug'](_0xb5c2('0xa3'),_0x430f08[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x430f08,{'showHidden':![],'depth':null}));this[_0xb5c2('0xa4')](_0x430f08['uniqueid'],_['keys'](_0x430f08['variable'])[0x0],_0x430f08['value']);if(this[_0xb5c2('0x11')][_0x430f08['uniqueid']]){var _0x422410=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x430f08[_0xb5c2('0x45')]]);if(_0x422410){if(this[_0xb5c2('0x5f')](_0x430f08[_0xb5c2('0xa5')])&&this[_0xb5c2('0x5f')](_0x430f08[_0xb5c2('0xa5')]['queuestatus'])){switch(_0x430f08[_0xb5c2('0xa6')]){case'CONTINUE':_0x422410['queuecallerexit']=![];_0x422410[_0xb5c2('0x97')]=null;break;case _0xb5c2('0xa7'):_0x422410['lastevent']=_0xb5c2('0xa8');_0x422410['queuecallerexit']=!![];_0x422410['queuecallerexitAt']=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));_0x422410['queuecallerleaveAt']=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));logger[_0xb5c2('0x5c')](_0xb5c2('0xa9'),_0x430f08[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x422410,{'showHidden':![],'depth':null}));ami[_0xb5c2('0x41')](_0xb5c2('0xaa'),_0x422410);break;default:_0x422410[_0xb5c2('0x96')]=!![];_0x422410[_0xb5c2('0x97')]=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));_0x422410[_0xb5c2('0x87')]=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));}_0x422410[_0xb5c2('0x8c')]=![];_0x422410[_0xb5c2('0x80')]=null;_0x422410['queuecallerexitreason']=_0x430f08['value'];this[_0xb5c2('0x13')][_0x430f08[_0xb5c2('0x45')]]=_0x422410;this[_0xb5c2('0x84')](_0x422410,_0xb5c2('0x23'));}else if(this[_0xb5c2('0x5f')](_0x430f08['variable'])&&this[_0xb5c2('0x5f')](_0x430f08[_0xb5c2('0xa5')][_0xb5c2('0xab')])){if(!_0x422410['queuecallerabandon']){_0x422410[_0xb5c2('0x96')]=!![];_0x422410[_0xb5c2('0x97')]=moment()[_0xb5c2('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x422410[_0xb5c2('0x4b')]=_0xb5c2('0xac');_0x422410[_0xb5c2('0x87')]=moment()['format'](_0xb5c2('0x78'));this[_0xb5c2('0x13')][_0x430f08[_0xb5c2('0x45')]]=_0x422410;}}logger[_0xb5c2('0x69')](_0xb5c2('0xad'),_0x430f08[_0xb5c2('0x45')],_0x422410['name'],_0x422410[_0xb5c2('0x76')],_[_0xb5c2('0xae')](_0x430f08['variable'])[0x0],_0x430f08[_0xb5c2('0xa6')]);_0x422410[_0xb5c2('0x16')]=this['variables'][_0x430f08['uniqueid']];}}}}catch(_0xf3ac7c){logger[_0xb5c2('0x3c')](_0xb5c2('0xa3'),_0x430f08[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0xf3ac7c,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb5c2('0xa4')]=function(_0x9338a0,_0x1c3b6e,_0x227fe4){var _0x2c3936=[_0xb5c2('0xaf'),_0xb5c2('0xb0'),_0xb5c2('0xb1'),_0xb5c2('0xb2'),'rtpaudioqosloss',_0xb5c2('0xb3'),_0xb5c2('0xb4'),_0xb5c2('0xb5'),_0xb5c2('0xb6'),'sipuri',_0xb5c2('0xb7'),'bridgepvtcallid','membercalls','memberdynamic',_0xb5c2('0xb8'),_0xb5c2('0xb9'),_0xb5c2('0x8e'),_0xb5c2('0xba'),'memberrealtime'];if(!_['isNil'](_0x1c3b6e)&&!_[_0xb5c2('0xbb')](_0x2c3936,_0x1c3b6e)){if(_[_0xb5c2('0x75')](this[_0xb5c2('0x16')][_0x9338a0])){this[_0xb5c2('0x16')][_0x9338a0]={};}this['variables'][_0x9338a0][_0x1c3b6e]=_0x227fe4;}};VoiceQueueReport['prototype'][_0xb5c2('0x26')]=function(_0x19c402){try{if(this['isNotNull'](_0x19c402)){logger[_0xb5c2('0x5c')]('[%s][voiceQueueReport][hangup]',_0x19c402[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x19c402,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x11')][_0x19c402['uniqueid']]){for(var _0x542087=0x0,_0x555304={};_0x542087<this[_0xb5c2('0x11')][_0x19c402[_0xb5c2('0x45')]][_0xb5c2('0xbc')];_0x542087+=0x1){_0x555304=this[_0xb5c2('0x11')][_0x19c402['uniqueid']][_0x542087];if(this['voiceQueues'][_0x555304[_0xb5c2('0x6b')]]){if(_0x555304[_0xb5c2('0x96')]&&_0x555304[_0xb5c2('0x8f')]!=!![]){this['voiceQueues'][_0x555304[_0xb5c2('0x6b')]]['unmanaged']+=0x1;}if(_0x555304['queuecallerabandon']){this[_0xb5c2('0x14')][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0xbd')]+=0x1;}this[_0xb5c2('0x14')][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0xbe')]+=moment(_0x555304[_0xb5c2('0x87')])[_0xb5c2('0xbf')](_0x555304[_0xb5c2('0x77')],_0xb5c2('0x99'))||0x0;if(_0x542087===this[_0xb5c2('0x11')][_0x19c402[_0xb5c2('0x45')]][_0xb5c2('0xbc')]-0x1){this[_0xb5c2('0x14')][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0x56')]+=moment()[_0xb5c2('0xc0')](0x0)[_0xb5c2('0xbf')](_0x555304[_0xb5c2('0x77')],_0xb5c2('0x99'));this[_0xb5c2('0x14')][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0xc1')]+=0x1;if(_0x555304['queuecallercomplete']){this[_0xb5c2('0x14')][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0x52')]+=0x1;this[_0xb5c2('0x14')][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0x55')]+=moment()[_0xb5c2('0xc0')](0x0)[_0xb5c2('0xbf')](_0x555304[_0xb5c2('0x87')],'seconds');_0x555304[_0xb5c2('0x7d')]=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));_0x555304[_0xb5c2('0x96')]=![];_0x555304[_0xb5c2('0x97')]=null;}if(_0x555304[_0xb5c2('0x96')]&&_0x555304[_0xb5c2('0x8f')]!=!![]){_0x555304[_0xb5c2('0xc2')]=_0xb5c2('0x58');logger[_0xb5c2('0x5c')](_0xb5c2('0xc3'),_0x19c402[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x555304,{'showHidden':![],'depth':null}));ami[_0xb5c2('0x41')](_0xb5c2('0xc4'),_0x555304);}if(_0x555304[_0xb5c2('0x8c')]){_0x555304['lastevent']=_0xb5c2('0xbd');logger['debug']('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x19c402[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x555304,{'showHidden':![],'depth':null}));ami[_0xb5c2('0x41')](_0xb5c2('0xc5'),_0x555304);}}else{this[_0xb5c2('0x14')][_0x555304['queue']][_0xb5c2('0x56')]+=this['voiceQueues'][_0x555304[_0xb5c2('0x6b')]][_0xb5c2('0xbe')];}logger[_0xb5c2('0x69')](_0xb5c2('0xc6'),_0x19c402[_0xb5c2('0x45')],_0x555304[_0xb5c2('0x4d')],_0x555304[_0xb5c2('0x76')],_0x19c402['cause-txt']);this[_0xb5c2('0x13')][_0x19c402[_0xb5c2('0x45')]]=_0x555304;this['emitVoiceQueueChannelRemove'](_0x555304,_0xb5c2('0x25'));this[_0xb5c2('0x4f')](this['voiceQueues'][_0x555304[_0xb5c2('0x6b')]],'hangup');}}logger[_0xb5c2('0x5c')](_0xb5c2('0xc7'),_0x19c402['uniqueid'],util[_0xb5c2('0x3a')](this[_0xb5c2('0x11')][_0x19c402[_0xb5c2('0x45')]],{'showHidden':![],'depth':null}));ami[_0xb5c2('0x41')](_0xb5c2('0xc8'),this['queueReports'][_0x19c402[_0xb5c2('0x45')]]);if(_0x555304[_0xb5c2('0x4b')]==='ATTENDEDTRANSFER')return;delete this[_0xb5c2('0x11')][_0x19c402[_0xb5c2('0x45')]];delete this['channels'][_0x19c402['uniqueid']];}if(this['variables'][_0x19c402[_0xb5c2('0x45')]]){delete this[_0xb5c2('0x16')][_0x19c402[_0xb5c2('0x45')]];}}}catch(_0x8eea49){logger[_0xb5c2('0x3c')](_0xb5c2('0xc9'),_0x19c402['uniqueid'],util[_0xb5c2('0x3a')](_0x8eea49,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAttendedTransfer']=function(_0x4324b5){try{if(this[_0xb5c2('0x5f')](_0x4324b5)){logger[_0xb5c2('0x5c')]('[%s][voiceQueueReport][attendedtransfer]',_0x4324b5[_0xb5c2('0x45')],util['inspect'](_0x4324b5,{'showHidden':![],'depth':null}));var _0x2ceb97;var _0x2c449e;var _0xaf8ad8;if(this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xca')]]){_0x2ceb97=_[_0xb5c2('0x86')](this['queueReports'][_0x4324b5['transfereeuniqueid']]);_0x2ceb97[_0xb5c2('0x9c')]=_0x4324b5[_0xb5c2('0xcb')];_0x2ceb97[_0xb5c2('0x9e')]=_0x4324b5[_0xb5c2('0xcc')];_0x2ceb97[_0xb5c2('0x4b')]=_0xb5c2('0x4c');_0x2ceb97[_0xb5c2('0x8f')]=!![];_0x2ceb97[_0xb5c2('0x9b')]=_0xb5c2('0xcd');if(this[_0xb5c2('0x11')][_0x4324b5['secondtransfereruniqueid']]){_0xaf8ad8=this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xcc')]];this['queueReports'][_0x4324b5[_0xb5c2('0xcc')]]=this[_0xb5c2('0x11')][_0x4324b5['transfereeuniqueid']];this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xca')]]=_0xaf8ad8;_0x2c449e=_['last'](this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xca')]]);_0x2c449e[_0xb5c2('0xce')]=!![];}logger[_0xb5c2('0x69')](_0xb5c2('0xcf'),_0x4324b5[_0xb5c2('0x45')],_0x2ceb97['name'],_0x2ceb97[_0xb5c2('0x76')],_0x2ceb97['transferexten'],_0x2ceb97[_0xb5c2('0x9e')]);}else if(this[_0xb5c2('0x11')][_0x4324b5['transfertargetuniqueid']]){_0x2ceb97=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xd0')]]);_0x2ceb97[_0xb5c2('0x9c')]=_0x4324b5[_0xb5c2('0xd1')];_0x2ceb97[_0xb5c2('0x9e')]=_0x4324b5['origtransfereruniqueid'];_0x2ceb97[_0xb5c2('0x4b')]='ATTENDEDTRANSFER';_0x2ceb97[_0xb5c2('0x8f')]=!![];_0x2ceb97[_0xb5c2('0x9b')]='ATTENDED';if(this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xd2')]]){_0xaf8ad8=this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xd2')]];this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xd2')]]=this['queueReports'][_0x4324b5[_0xb5c2('0xd0')]];this['queueReports'][_0x4324b5['transfertargetuniqueid']]=_0xaf8ad8;_0x2c449e=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xd0')]]);_0x2c449e[_0xb5c2('0xce')]=!![];}logger['info'](_0xb5c2('0xcf'),_0x4324b5[_0xb5c2('0x45')],_0x2ceb97[_0xb5c2('0x4d')],_0x2ceb97[_0xb5c2('0x76')],_0x2ceb97[_0xb5c2('0x9c')],_0x2ceb97[_0xb5c2('0x9e')]);}else if(this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xd2')]]){_0x2ceb97=_[_0xb5c2('0x86')](this['queueReports'][_0x4324b5[_0xb5c2('0xd2')]]);_0x2ceb97[_0xb5c2('0x9c')]=_0x4324b5[_0xb5c2('0xd1')];_0x2ceb97[_0xb5c2('0x9e')]=_0x4324b5[_0xb5c2('0xd2')];_0x2ceb97[_0xb5c2('0x4b')]=_0xb5c2('0x4c');_0x2ceb97[_0xb5c2('0x8f')]=!![];_0x2ceb97[_0xb5c2('0x9b')]=_0xb5c2('0xcd');}else if(this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xcc')]]){_0x2ceb97=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x4324b5[_0xb5c2('0xcc')]]);_0x2ceb97[_0xb5c2('0x9c')]=_0x4324b5[_0xb5c2('0xcb')];_0x2ceb97[_0xb5c2('0x9e')]=_0x4324b5[_0xb5c2('0xcc')];_0x2ceb97[_0xb5c2('0x4b')]='ATTENDEDTRANSFER';_0x2ceb97[_0xb5c2('0x8f')]=!![];_0x2ceb97[_0xb5c2('0x9b')]='ATTENDED';}}}catch(_0x1ea123){logger[_0xb5c2('0x3c')](_0xb5c2('0xd3'),_0x4324b5[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x1ea123,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0xd4')]=function(_0x33964f){try{if(this[_0xb5c2('0x5f')](_0x33964f)){logger['debug']('[%s][voiceQueueReport][blindtransfer]',_0x33964f[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x33964f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x33964f[_0xb5c2('0xca')]]){var _0x494284=_[_0xb5c2('0x86')](this['queueReports'][_0x33964f[_0xb5c2('0xca')]]);_0x494284['queuecallerexitreason']=_0xb5c2('0xd5');_0x494284[_0xb5c2('0x8f')]=!![];_0x494284[_0xb5c2('0x9b')]=_0xb5c2('0xd6');_0x494284[_0xb5c2('0x9c')]=_0x33964f[_0xb5c2('0xd7')];_0x494284[_0xb5c2('0x9e')]=_0x33964f[_0xb5c2('0xca')];logger[_0xb5c2('0x69')](_0xb5c2('0xd8'),_0x33964f[_0xb5c2('0x45')],_0x494284['name'],_0x494284[_0xb5c2('0x76')],_0x494284['transferexten'],_0x494284[_0xb5c2('0x9e')]);this[_0xb5c2('0x26')]({'event':_0xb5c2('0xd9'),'uniqueid':_0x33964f[_0xb5c2('0xca')],'context':_0x33964f[_0xb5c2('0xda')],'channel':_0x33964f[_0xb5c2('0xdb')]});}}}catch(_0x4b3c9a){logger[_0xb5c2('0x3c')]('[%s][voiceQueueReport][blindtransfer]',_0x33964f['uniqueid'],util[_0xb5c2('0x3a')](_0x4b3c9a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0x28')]=function(_0x1f31c8){try{if(this['isNotNull'](_0x1f31c8)){logger[_0xb5c2('0x5c')]('[%s][voiceQueueReport][musiconholdstart]',_0x1f31c8[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x1f31c8,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1f31c8[_0xb5c2('0x45')]]){var _0x458556=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x1f31c8['uniqueid']]);if(!_[_0xb5c2('0x35')](_0x458556['queuecallerleaveAt'])){_0x458556[_0xb5c2('0xdc')]=moment()[_0xb5c2('0x46')](_0xb5c2('0x78'));logger[_0xb5c2('0x69')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x1f31c8[_0xb5c2('0x45')],_0x458556[_0xb5c2('0xdc')]);}}}}catch(_0x43257d){logger[_0xb5c2('0x3c')](_0xb5c2('0xdd'),_0x1f31c8[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x43257d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xb5c2('0xd')][_0xb5c2('0xde')]=function(_0x172ac0){try{if(this[_0xb5c2('0x5f')](_0x172ac0)){logger['debug']('[%s][voiceQueueReport][musiconholdstop]',_0x172ac0[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x172ac0,{'showHidden':![],'depth':null}));if(this[_0xb5c2('0x11')][_0x172ac0[_0xb5c2('0x45')]]){var _0x50eb79=_[_0xb5c2('0x86')](this[_0xb5c2('0x11')][_0x172ac0[_0xb5c2('0x45')]]);if(!_['isNil'](_0x50eb79['mohstarttime'])){_0x50eb79[_0xb5c2('0xdf')]+=moment()[_0xb5c2('0xc0')](0x0)[_0xb5c2('0xbf')](_0x50eb79[_0xb5c2('0xdc')],_0xb5c2('0x99'));logger[_0xb5c2('0x69')](_0xb5c2('0xe0'),_0x172ac0[_0xb5c2('0x45')],_0x50eb79['mohtime']);delete _0x50eb79[_0xb5c2('0xdc')];}}}}catch(_0x2848c9){logger[_0xb5c2('0x3c')](_0xb5c2('0xe1'),_0x172ac0[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x2848c9,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xb5c2('0xe2')]=function(_0x22fc61){try{if(this['isNotNull'](_0x22fc61)){logger[_0xb5c2('0x5c')](_0xb5c2('0xe3'),_0x22fc61[_0xb5c2('0x45')],util['inspect'](_0x22fc61,{'showHidden':![],'depth':null}));if(_0x22fc61[_0xb5c2('0xe4')]['toLowerCase']()==='set'){_0x22fc61[_0xb5c2('0xe5')]=_0x22fc61[_0xb5c2('0xe6')]&&_0x22fc61['appdata'][_0xb5c2('0xe7')]('CDR(routeAlias)')?_0x22fc61[_0xb5c2('0xe6')]:(_0x22fc61['appdata']||_0x22fc61[_0xb5c2('0xe5')])[_0xb5c2('0x93')]();if(_[_0xb5c2('0xe7')](_0x22fc61[_0xb5c2('0xe5')][_0xb5c2('0x93')](),_0xb5c2('0xe8'))){logger[_0xb5c2('0x69')](_0xb5c2('0xe9'),_0x22fc61[_0xb5c2('0x45')],_0x22fc61[_0xb5c2('0xe4')],_0x22fc61[_0xb5c2('0xe5')]);if(_[_0xb5c2('0x75')](this[_0xb5c2('0x13')][_0x22fc61[_0xb5c2('0x45')]]))this[_0xb5c2('0x13')][_0x22fc61['uniqueid']]={};var _0x4347b5=_0x22fc61[_0xb5c2('0xe5')][_0xb5c2('0xea')]('=');var _0x58b8a5=_0x4347b5[0x0]['toLowerCase']()['match'](/cdr\((.*)\)/);if(_0x58b8a5)this['channels'][_0x22fc61[_0xb5c2('0x45')]][_0x58b8a5[0x1]]=_0x4347b5[0x1];}}}}catch(_0x41a686){logger['error']('[%s][voiceQueueReport][newexten]',_0x22fc61[_0xb5c2('0x45')],util[_0xb5c2('0x3a')](_0x41a686,{'showHidden':![],'depth':null}));}};module[_0xb5c2('0xeb')]=VoiceQueueReport;
\ No newline at end of file
+var _0xb2b0=['assign','syncQueueStatusComplete','type','inbound','outbound','custom:queuesummary','statusRequests','completeEvent','syncQueueMember','push','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','emitVoiceQueueChannelSave','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','addVariable','keys','value','variable','CONTINUE','TIMEOUT','lastevent','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','membername','memberpenalty','isNil','includes','length','sumHoldTime','diff','sumDuration','seconds','total','answered','sumBillable','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][handleHangup]','[%s][voiceQueueReport][hangup]','handleHangup','cause-txt','cause','transferid','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfereruniqueid','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','ATTENDED','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','milliseconds','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','split','match','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../model/voiceQueueSummary','defaults','redis','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','realtime','agents','queueChannels','voiceQueues','campaigns','summary','variables','queuesummary','bind','syncQueueSummaryComplete','queuestatuscomplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentconnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','waiting','queuecallerexit','queuecallercomplete','clearZombieChannels','channels','Action','status','channel','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','[%s][voiceQueueReport][','format','voice:queue:%s','queue','voice_queue_channel:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','isNotNull','isUndefined','queues','catch','[voiceQueueReport][queues]','loopQueueSummary','isRunning','actionid','queuestatus','[voiceQueueReport][queuesummary]','createQueueSummaryReport','summaryEvent','createReport','handleInboundQueueSummaryReport','compareToInboundQueue'];(function(_0x1278aa,_0x53cc06){var _0x11cbc8=function(_0x1e7d63){while(--_0x1e7d63){_0x1278aa['push'](_0x1278aa['shift']());}};_0x11cbc8(++_0x53cc06);}(_0xb2b0,0x8f));var _0x0b2b=function(_0x5e69f1,_0x2d1835){_0x5e69f1=_0x5e69f1-0x0;var _0x3ff8d0=_0xb2b0[_0x5e69f1];return _0x3ff8d0;};'use strict';var _=require(_0x0b2b('0x0'));var moment=require(_0x0b2b('0x1'));var util=require(_0x0b2b('0x2'));var Redis=require('ioredis');var config=require(_0x0b2b('0x3'));var logger=require(_0x0b2b('0x4'))(_0x0b2b('0x5'));var ami=require('../ami');var QueueReport=require('../model/queueReport');var VoiceQueueSummary=require(_0x0b2b('0x6'));config['redis']=_[_0x0b2b('0x7')](config[_0x0b2b('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x0b2b('0x9'))(new Redis(config[_0x0b2b('0x8')]));var Sequence=function(){};Sequence[_0x0b2b('0xa')][_0x0b2b('0xb')]=function(_0x114178){this['tail']=this[_0x0b2b('0xc')]?this[_0x0b2b('0xc')][_0x0b2b('0xd')](_0x114178):_0x114178();};function VoiceQueueReport(_0x1c06c6){this[_0x0b2b('0xe')]=new Sequence();this[_0x0b2b('0xf')]={};this[_0x0b2b('0x10')]=_0x1c06c6;this['agents']=_0x1c06c6[_0x0b2b('0x11')];this['channels']=_0x1c06c6[_0x0b2b('0x12')];this[_0x0b2b('0x13')]=_0x1c06c6[_0x0b2b('0x13')];this[_0x0b2b('0x14')]=_0x1c06c6[_0x0b2b('0x14')];this[_0x0b2b('0x15')]=initializeSummary();this[_0x0b2b('0x16')]={};ami['on'](_0x0b2b('0x17'),this['syncQueueSummary'][_0x0b2b('0x18')](this));ami['on']('queuesummarycomplete',this[_0x0b2b('0x19')][_0x0b2b('0x18')](this));ami['on']('queuemember',this['syncQueueMember']['bind'](this));ami['on'](_0x0b2b('0x1a'),this['syncQueueStatusComplete'][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x1b'),this['syncQueueCallerJoin'][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x1c'),this[_0x0b2b('0x1d')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x1e'),this[_0x0b2b('0x1f')]['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x20'),this['syncAgentConnect']['bind'](this));ami['on'](_0x0b2b('0x21'),this[_0x0b2b('0x22')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x23'),this[_0x0b2b('0x24')]['bind'](this));ami['on'](_0x0b2b('0x25'),this['syncFullyBooted']['bind'](this));ami['on']('musiconholdstart',this[_0x0b2b('0x26')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x27'),this[_0x0b2b('0x28')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x29'),this[_0x0b2b('0x2a')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x2b'),this[_0x0b2b('0x2c')][_0x0b2b('0x18')](this));this['loopQueueSummary']();this[_0x0b2b('0x2d')]();}function clearChannels(_0x455eed){if(!_[_0x0b2b('0x2e')](_0x455eed)){for(var _0x4cacf2 in _0x455eed){if(_0x455eed[_0x0b2b('0x2f')](_0x4cacf2)){delete _0x455eed[_0x4cacf2];}}}}function clearCampaigns(_0x539b95){if(!_[_0x0b2b('0x2e')](_0x539b95)){for(var _0x3229c2 in _0x539b95){if(_0x539b95[_0x0b2b('0x2f')](_0x3229c2)){_0x539b95[_0x3229c2][_0x0b2b('0x30')]=0x0;}}}}function clearVoiceQueues(_0x5ec306){if(!_[_0x0b2b('0x2e')](_0x5ec306)){for(var _0x151bf7 in _0x5ec306){if(_0x5ec306['hasOwnProperty'](_0x151bf7)){_0x5ec306[_0x151bf7][_0x0b2b('0x30')]=0x0;_0x5ec306[_0x151bf7]['talking']=0x0;_0x5ec306[_0x151bf7]['pTalking']=0x0;_0x5ec306[_0x151bf7][_0x0b2b('0x31')]=0x0;_0x5ec306[_0x151bf7]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x3396c1){if(!_['isEmpty'](_0x3396c1)){for(var _0x2ded99 in _0x3396c1){if(_0x3396c1[_0x0b2b('0x2f')](_0x2ded99)){_0x3396c1[_0x2ded99]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x528111){return _0x528111[_0x0b2b('0x32')]||_0x528111[_0x0b2b('0x1c')]||_0x528111[_0x0b2b('0x33')];}VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x34')]=function(){var _0x5d06d8=this;for(var _0x4d7a88 in this['channels']){if(this[_0x0b2b('0x35')][_0x0b2b('0x2f')](_0x4d7a88)&&!this[_0x0b2b('0x35')][_0x4d7a88]['switch']){this[_0x0b2b('0xe')]['enqueue'](function(){if(!_['isNil'](_0x5d06d8[_0x0b2b('0x35')][_0x4d7a88])){return ami[_0x0b2b('0x36')]({'action':_0x0b2b('0x37'),'channel':_0x5d06d8['channels'][_0x4d7a88][_0x0b2b('0x38')]})['catch'](function(_0x5bd9aa){if(_0x5bd9aa[_0x0b2b('0x39')]===_0x0b2b('0x3a')){setTimeout(function(){if(_0x5d06d8[_0x0b2b('0x35')][_0x4d7a88]){delete _0x5d06d8[_0x0b2b('0x35')][_0x4d7a88];logger['error'](_0x0b2b('0x3b'),_0x4d7a88,util[_0x0b2b('0x3c')](_0x5bd9aa,{'showHidden':![],'depth':null}));}if(_0x5d06d8[_0x0b2b('0xf')][_0x4d7a88]){delete _0x5d06d8[_0x0b2b('0xf')][_0x4d7a88];logger[_0x0b2b('0x3d')](_0x0b2b('0x3e'),_0x4d7a88,util['inspect'](_0x5bd9aa,{'showHidden':![],'depth':null}));}if(_0x5d06d8[_0x0b2b('0x16')][_0x4d7a88]){delete _0x5d06d8[_0x0b2b('0x16')][_0x4d7a88];logger['error'](_0x0b2b('0x3f'),_0x4d7a88,util[_0x0b2b('0x3c')](_0x5bd9aa,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x40')]=function(){logger[_0x0b2b('0x3d')](_0x0b2b('0x41'));clearChannels(this['channels']);this[_0x0b2b('0x42')](this[_0x0b2b('0xf')]);clearAgentBooked(this[_0x0b2b('0x11')]);clearVoiceQueues(this[_0x0b2b('0x13')]);clearCampaigns(this[_0x0b2b('0x14')]);this['summary']=initializeSummary();};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x42')]=function(_0x4da1b7){var _0x406fe4=this;if(!_['isEmpty'](_0x4da1b7)){for(var _0x26be49 in _0x4da1b7){if(_0x4da1b7[_0x0b2b('0x2f')](_0x26be49)){_0x406fe4[_0x0b2b('0x43')](_0x4da1b7[_0x26be49],_0x0b2b('0x44'));delete _0x4da1b7[_0x26be49];}}}};VoiceQueueReport['prototype'][_0x0b2b('0x45')]=function(_0x48bebc,_0x5c2559,_0x38a233){io['to'](_0x48bebc)[_0x0b2b('0x45')](_0x5c2559,_0x38a233);};VoiceQueueReport[_0x0b2b('0xa')]['emitVoiceQueueChannelSave']=function(_0x1359bc,_0x5e3bf9){logger['debug'](_0x0b2b('0x46')+_0x5e3bf9+']\x20sending\x20voice_queue_channel:save\x20event:',_0x1359bc['uniqueid'],util['inspect'](_0x1359bc,{'showHidden':![],'depth':null}));this[_0x0b2b('0x45')](util[_0x0b2b('0x47')](_0x0b2b('0x48'),_0x1359bc[_0x0b2b('0x49')]),_0x0b2b('0x4a'),_0x1359bc);io[_0x0b2b('0x45')]('voice_queue_presence:save',_0x1359bc);};VoiceQueueReport[_0x0b2b('0xa')]['emitVoiceQueueChannelRemove']=function(_0x238506,_0x4be6f2){logger[_0x0b2b('0x4b')](_0x0b2b('0x46')+_0x4be6f2+_0x0b2b('0x4c'),_0x238506[_0x0b2b('0x4d')],util['inspect'](_0x238506,{'showHidden':![],'depth':null}));if(_0x238506[_0x0b2b('0x4e')]===_0x0b2b('0x4f')){return;}this[_0x0b2b('0x45')](util['format']('voice:queue:%s',_0x238506[_0x0b2b('0x49')]),_0x0b2b('0x50'),_0x238506);io[_0x0b2b('0x45')](_0x0b2b('0x51'),_0x238506);};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x52')]=function(_0x1085c7){if(_0x1085c7['type']==='inbound'){logger[_0x0b2b('0x4b')](_0x0b2b('0x53'),util[_0x0b2b('0x3c')](_0x1085c7,{'showHidden':![],'depth':null}));this[_0x0b2b('0x45')](util[_0x0b2b('0x47')](_0x0b2b('0x48'),_0x1085c7[_0x0b2b('0x54')]),'voice_queue:save',_0x1085c7);}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x55')]=function(_0x113cac){return _0x113cac!==null&&!_[_0x0b2b('0x56')](_0x113cac);};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x2d')]=function(){var _0x58dd8c=this;setInterval(function(){_0x58dd8c[_0x0b2b('0x34')]();ami[_0x0b2b('0x36')]({'action':_0x0b2b('0x57')})[_0x0b2b('0x58')](function(_0x22025e){logger[_0x0b2b('0x3d')](_0x0b2b('0x59'),util[_0x0b2b('0x3c')](_0x22025e,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x5a')]=function(){var _0x8831a=this;setInterval(function(){if(!_0x8831a[_0x0b2b('0x15')][_0x0b2b('0x5b')]){return ami[_0x0b2b('0x36')]({'action':_0x0b2b('0x17')})['then'](function(_0x43b12a){_0x8831a[_0x0b2b('0x15')]['id']=_0x43b12a[_0x0b2b('0x5c')];_0x8831a[_0x0b2b('0x15')][_0x0b2b('0x5b')]=!![];_0x8831a[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x43b12a[_0x0b2b('0x5c')]]={};})[_0x0b2b('0x58')](function(_0x577300){logger['error'](_0x0b2b('0x5e'),util['inspect'](_0x577300,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x5f')]=function(_0x5373d3,_0x5df03d){var _0x29add9;if(this[_0x0b2b('0x15')]&&this['summary'][_0x0b2b('0x57')]&&this[_0x0b2b('0x15')][_0x0b2b('0x57')][_0x5373d3[_0x0b2b('0x54')]]){_0x29add9=this[_0x0b2b('0x15')]['queues'][_0x5373d3[_0x0b2b('0x54')]][_0x0b2b('0x60')];}var _0x80ad92=new VoiceQueueSummary(_0x5373d3);return _0x80ad92[_0x0b2b('0x61')](_0x5df03d[_0x0b2b('0x11')],this[_0x0b2b('0x11')],_0x29add9,this[_0x0b2b('0x10')][_0x0b2b('0x35')]);};VoiceQueueReport['prototype'][_0x0b2b('0x62')]=function(_0x78eecb,_0x2857f6){var _0x44077c=this[_0x0b2b('0x5f')](_0x78eecb,_0x2857f6);var _0x38702d=![];_0x38702d=_0x44077c[_0x0b2b('0x63')](_0x78eecb);if(_0x38702d){Object[_0x0b2b('0x64')](_0x78eecb,_0x44077c);this[_0x0b2b('0x10')][_0x0b2b('0x13')][_0x78eecb['name']]=_0x78eecb;this['emitInboundVoiceQueueSummary'](_0x44077c);}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x65')]=function(_0x1989b3){var _0x2dba6e=null;var _0x1b14e8=this['summary']['id'];if(this[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x1b14e8]){_0x2dba6e=this[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x1b14e8][_0x1989b3['actionid']];}if(!_0x2dba6e){this['summary']=initializeSummary();return;}var _0xed5871=this[_0x0b2b('0x13')][_0x2dba6e[_0x0b2b('0x49')]];if(_0xed5871[_0x0b2b('0x66')]===_0x0b2b('0x67')){this['handleInboundQueueSummaryReport'](_0xed5871,_0x2dba6e);}else if(_0xed5871[_0x0b2b('0x66')]===_0x0b2b('0x68')){var _0x22981d=this[_0x0b2b('0x5f')](_0xed5871,_0x2dba6e);ami[_0x0b2b('0x45')](_0x0b2b('0x69'),_0x22981d);}this[_0x0b2b('0x15')][_0x0b2b('0x6a')]-=0x1;var _0x3bcbb9=this['summary'][_0x0b2b('0x6a')]>0x0?!![]:![];if(!_0x3bcbb9){return this[_0x0b2b('0x19')](this[_0x0b2b('0x15')][_0x0b2b('0x6b')]);}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x6c')]=function(_0x582c62){var _0x8d3c5f=this['summary']['id'];if(this[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x8d3c5f]&&this[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x8d3c5f][_0x582c62['actionid']]){this['summary'][_0x0b2b('0x5d')][_0x8d3c5f][_0x582c62['actionid']][_0x0b2b('0x11')][_0x0b2b('0x6d')](_0x582c62);}};VoiceQueueReport[_0x0b2b('0xa')]['syncQueueSummary']=function(_0x1adb4f){var _0x197d80=this;try{if(this['isNotNull'](_0x1adb4f)&&this[_0x0b2b('0x55')](_0x1adb4f[_0x0b2b('0x49')])){logger[_0x0b2b('0x4b')](_0x0b2b('0x6e'),util[_0x0b2b('0x3c')](_0x1adb4f,{'showHidden':![],'depth':null}));var _0x17a3f4=this[_0x0b2b('0x13')][_0x1adb4f['queue']];if(_0x17a3f4){logger[_0x0b2b('0x4b')](_0x0b2b('0x6f'),_0x17a3f4[_0x0b2b('0x54')]);this[_0x0b2b('0x15')][_0x0b2b('0x57')][_0x17a3f4[_0x0b2b('0x54')]]={'summaryEvent':_0x1adb4f};this[_0x0b2b('0x15')][_0x0b2b('0x6a')]+=0x1;return ami[_0x0b2b('0x36')]({'action':_0x0b2b('0x5d'),'queue':_0x17a3f4[_0x0b2b('0x54')]})['then'](function(_0x55fbb3){if(!_0x197d80['summary'][_0x0b2b('0x5d')][_0x1adb4f[_0x0b2b('0x5c')]]){_0x197d80[_0x0b2b('0x15')]['queuestatus'][_0x1adb4f['actionid']]={};}_0x197d80['summary'][_0x0b2b('0x5d')][_0x1adb4f[_0x0b2b('0x5c')]][_0x55fbb3[_0x0b2b('0x5c')]]={'queue':_0x17a3f4['name'],'agents':[]};})['catch'](function(_0xb02d15){throw _0xb02d15;});}}}catch(_0x40ce9f){logger[_0x0b2b('0x3d')](_0x0b2b('0x5e'),util['inspect'](_0x40ce9f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0b2b('0x19')]=function(_0x955376){if(this[_0x0b2b('0x15')]['statusRequests']>0x0){this[_0x0b2b('0x15')][_0x0b2b('0x6b')]=_0x955376;return;}logger['debug'](_0x0b2b('0x70'),util['inspect'](_0x955376,{'showHidden':![],'depth':null}));this[_0x0b2b('0x15')]=initializeSummary();ami[_0x0b2b('0x45')](_0x0b2b('0x71'),{});};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x72')]=function(_0x3ae799){try{if(this['isNotNull'](_0x3ae799)){logger[_0x0b2b('0x4b')](_0x0b2b('0x73'),_0x3ae799['uniqueid'],util[_0x0b2b('0x3c')](_0x3ae799,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x0b2b('0xf')][_0x3ae799[_0x0b2b('0x4d')]])){this[_0x0b2b('0xf')][_0x3ae799[_0x0b2b('0x4d')]]=[];}if(_[_0x0b2b('0x56')](this[_0x0b2b('0x35')][_0x3ae799[_0x0b2b('0x4d')]])){this['channels'][_0x3ae799['uniqueid']]={};}var _0x1e9ae5=new QueueReport();_0x1e9ae5['queue']=_0x3ae799[_0x0b2b('0x49')];_0x1e9ae5[_0x0b2b('0x66')]=this[_0x0b2b('0x13')][_0x1e9ae5[_0x0b2b('0x49')]]&&this['voiceQueues'][_0x1e9ae5[_0x0b2b('0x49')]][_0x0b2b('0x66')]?this[_0x0b2b('0x13')][_0x1e9ae5[_0x0b2b('0x49')]]['type']||_0x0b2b('0x67'):'inbound';_0x1e9ae5[_0x0b2b('0x74')]=moment()[_0x0b2b('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e9ae5[_0x0b2b('0x75')]=_0x3ae799['position'];_0x1e9ae5[_0x0b2b('0x76')]=_0x3ae799[_0x0b2b('0x76')];_0x1e9ae5[_0x0b2b('0x4d')]=_0x3ae799['uniqueid'];_0x1e9ae5['routealias']=this[_0x0b2b('0x35')][_0x3ae799['uniqueid']]['routealias'];logger[_0x0b2b('0x77')](_0x0b2b('0x78'),_0x1e9ae5[_0x0b2b('0x49')],_0x1e9ae5[_0x0b2b('0x66')]);Object['assign'](_0x1e9ae5,_[_0x0b2b('0x79')](_0x3ae799,_['keys'](_0x1e9ae5)));this[_0x0b2b('0xf')][_0x3ae799[_0x0b2b('0x4d')]][_0x0b2b('0x6d')](_0x1e9ae5);this[_0x0b2b('0x35')][_0x3ae799[_0x0b2b('0x4d')]]=_0x1e9ae5;this[_0x0b2b('0x7a')](_0x1e9ae5,_0x0b2b('0x1b'));}}catch(_0x17a139){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x3ae799[_0x0b2b('0x4d')],util['inspect'](_0x17a139,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')]['syncQueueCallerAbandon']=function(_0x185588){try{if(this[_0x0b2b('0x55')](_0x185588)){logger[_0x0b2b('0x4b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x185588['uniqueid'],util[_0x0b2b('0x3c')](_0x185588,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x185588[_0x0b2b('0x4d')]]){var _0x11a56f=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x185588['uniqueid']]);_0x11a56f[_0x0b2b('0x33')]=![];_0x11a56f[_0x0b2b('0x7c')]=null;_0x11a56f[_0x0b2b('0x7d')]=_0x185588[_0x0b2b('0x7d')];_0x11a56f[_0x0b2b('0x7e')]=_0x185588[_0x0b2b('0x7e')];_0x11a56f[_0x0b2b('0x1c')]=!![];_0x11a56f[_0x0b2b('0x7f')]=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x11a56f[_0x0b2b('0x4e')]=_0x0b2b('0x81');_0x11a56f[_0x0b2b('0x82')]=null;logger[_0x0b2b('0x77')](_0x0b2b('0x83'),_0x11a56f['queue'],_0x11a56f[_0x0b2b('0x66')]);this['channels'][_0x185588[_0x0b2b('0x4d')]]=_0x11a56f;this[_0x0b2b('0x43')](_0x11a56f,_0x0b2b('0x1c'));}}}catch(_0x2279a0){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x185588[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x2279a0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')]['syncQueueCallerLeave']=function(_0x417323){try{if(this['isNotNull'](_0x417323)){logger['debug'](_0x0b2b('0x84'),_0x417323[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x417323,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x417323['uniqueid']]){var _0x362819=_[_0x0b2b('0x7b')](this['queueReports'][_0x417323[_0x0b2b('0x4d')]]);_0x362819[_0x0b2b('0x85')]=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x362819[_0x0b2b('0x86')]=_0x417323[_0x0b2b('0x86')];_0x362819[_0x0b2b('0x87')]=_0x417323[_0x0b2b('0x87')];logger[_0x0b2b('0x77')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x362819['queue'],_0x362819['type'],_0x417323[_0x0b2b('0x86')],_0x417323[_0x0b2b('0x87')]);this[_0x0b2b('0x35')][_0x417323[_0x0b2b('0x4d')]]=_0x362819;this[_0x0b2b('0x7a')](_0x362819,_0x0b2b('0x1e'));}}}catch(_0x2f5b16){logger[_0x0b2b('0x3d')](_0x0b2b('0x84'),_0x417323['uniqueid'],util['inspect'](_0x2f5b16,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0b2b('0x88')]=function(_0x3e7384){try{if(this['isNotNull'](_0x3e7384)){logger[_0x0b2b('0x4b')](_0x0b2b('0x89'),_0x3e7384[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x3e7384,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3e7384[_0x0b2b('0x4d')]]){var _0x534dc0=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x3e7384[_0x0b2b('0x4d')]]);_0x534dc0[_0x0b2b('0x33')]=!![];_0x534dc0[_0x0b2b('0x4e')]=_0x0b2b('0x8a');logger[_0x0b2b('0x77')](_0x0b2b('0x8b'),_0x534dc0[_0x0b2b('0x49')],_0x534dc0[_0x0b2b('0x66')]);}}}catch(_0xbfba8e){logger[_0x0b2b('0x3d')](_0x0b2b('0x89'),_0x3e7384[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0xbfba8e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x8c')]=function(_0x4ba56f){try{if(this[_0x0b2b('0x55')](_0x4ba56f)){logger[_0x0b2b('0x4b')](_0x0b2b('0x8d'),_0x4ba56f['uniqueid'],util[_0x0b2b('0x3c')](_0x4ba56f,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x4ba56f[_0x0b2b('0x4d')]]){var _0x5f3caf=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x4ba56f[_0x0b2b('0x4d')]]);_0x5f3caf[_0x0b2b('0x1c')]=![];_0x5f3caf['queuecallerabandonAt']=null;_0x5f3caf['assigned']=!![];_0x5f3caf[_0x0b2b('0x82')]=_0x4ba56f['membername'];_0x5f3caf[_0x0b2b('0x7d')]=_0x4ba56f[_0x0b2b('0x7d')];_0x5f3caf[_0x0b2b('0x33')]=!![];_0x5f3caf[_0x0b2b('0x32')]=![];_0x5f3caf[_0x0b2b('0x8e')]=null;if(!_0x5f3caf[_0x0b2b('0x8f')]){if(_0x4ba56f[_0x0b2b('0x90')]==_0x0b2b('0x8f')){_0x5f3caf[_0x0b2b('0x4e')]=_0x0b2b('0x91');logger[_0x0b2b('0x77')](_0x0b2b('0x92'),_0x5f3caf['queue'],_0x5f3caf['type']);}else{if(_[_0x0b2b('0x93')](_0x4ba56f[_0x0b2b('0x38')][_0x0b2b('0x94')](),_0x0b2b('0x95'))){if(this[_0x0b2b('0xf')][_0x4ba56f[_0x0b2b('0x96')]]){var _0x1b3bad=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x4ba56f['linkedid']]);_0x1b3bad[_0x0b2b('0x33')]=![];_0x1b3bad[_0x0b2b('0x32')]=!![];_0x1b3bad['queuecallerexitAt']=moment(_0x5f3caf[_0x0b2b('0x74')])['add'](_0x4ba56f[_0x0b2b('0x7d')],'seconds')[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x1b3bad[_0x0b2b('0x4e')]=_0x0b2b('0x97');_0x1b3bad['transfer']=!![];_0x1b3bad[_0x0b2b('0x98')]=_0x0b2b('0x99');_0x1b3bad[_0x0b2b('0x9a')]=_0x4ba56f[_0x0b2b('0x9b')];_0x1b3bad[_0x0b2b('0x9c')]=_0x4ba56f['uniqueid'];logger[_0x0b2b('0x77')](_0x0b2b('0x9d'),_0x1b3bad[_0x0b2b('0x49')],_0x1b3bad[_0x0b2b('0x66')]);var _0x7693c8=this['queueReports'][_0x4ba56f['linkedid']];this['queueReports'][_0x4ba56f[_0x0b2b('0x96')]]=this[_0x0b2b('0xf')][_0x4ba56f[_0x0b2b('0x4d')]];this['queueReports'][_0x4ba56f[_0x0b2b('0x4d')]]=_0x7693c8;}}else{_0x5f3caf['queuecallerexitreason']=_0x0b2b('0x9e')+_0x4ba56f[_0x0b2b('0x90')][_0x0b2b('0x9f')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x5f3caf['queue'],_0x5f3caf[_0x0b2b('0x66')],_0x5f3caf[_0x0b2b('0x4e')]);}}}this[_0x0b2b('0x35')][_0x4ba56f['uniqueid']]=_0x5f3caf;}}}catch(_0x3db38e){logger[_0x0b2b('0x3d')]('[%s][voiceQueueReport][agentcomplete]',_0x4ba56f[_0x0b2b('0x4d')],util['inspect'](_0x3db38e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x22')]=function(_0x121717){try{if(this[_0x0b2b('0x55')](_0x121717)){logger['debug']('[%s][voiceQueueReport][varset]',_0x121717[_0x0b2b('0x4d')],util['inspect'](_0x121717,{'showHidden':![],'depth':null}));this[_0x0b2b('0xa0')](_0x121717[_0x0b2b('0x4d')],_[_0x0b2b('0xa1')](_0x121717['variable'])[0x0],_0x121717[_0x0b2b('0xa2')]);if(this[_0x0b2b('0xf')][_0x121717[_0x0b2b('0x4d')]]){var _0x5a6a2e=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x121717['uniqueid']]);if(_0x5a6a2e){if(this[_0x0b2b('0x55')](_0x121717['variable'])&&this[_0x0b2b('0x55')](_0x121717[_0x0b2b('0xa3')]['queuestatus'])){switch(_0x121717[_0x0b2b('0xa2')]){case _0x0b2b('0xa4'):_0x5a6a2e[_0x0b2b('0x32')]=![];_0x5a6a2e[_0x0b2b('0x8e')]=null;break;case _0x0b2b('0xa5'):_0x5a6a2e[_0x0b2b('0xa6')]='timeout';_0x5a6a2e[_0x0b2b('0x32')]=!![];_0x5a6a2e[_0x0b2b('0x8e')]=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x5a6a2e[_0x0b2b('0x85')]=moment()[_0x0b2b('0x47')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x0b2b('0x4b')](_0x0b2b('0xa7'),_0x121717[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x5a6a2e,{'showHidden':![],'depth':null}));ami[_0x0b2b('0x45')](_0x0b2b('0xa8'),_0x5a6a2e);break;default:_0x5a6a2e['queuecallerexit']=!![];_0x5a6a2e['queuecallerexitAt']=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x5a6a2e[_0x0b2b('0x85')]=moment()['format'](_0x0b2b('0x80'));}_0x5a6a2e['queuecallerabandon']=![];_0x5a6a2e[_0x0b2b('0x7f')]=null;_0x5a6a2e[_0x0b2b('0x4e')]=_0x121717[_0x0b2b('0xa2')];this['channels'][_0x121717['uniqueid']]=_0x5a6a2e;this['emitVoiceQueueChannelRemove'](_0x5a6a2e,_0x0b2b('0x21'));}else if(this[_0x0b2b('0x55')](_0x121717[_0x0b2b('0xa3')])&&this[_0x0b2b('0x55')](_0x121717[_0x0b2b('0xa3')]['queueposition'])){if(!_0x5a6a2e[_0x0b2b('0x1c')]){_0x5a6a2e[_0x0b2b('0x32')]=!![];_0x5a6a2e[_0x0b2b('0x8e')]=moment()['format'](_0x0b2b('0x80'));_0x5a6a2e[_0x0b2b('0x4e')]='EXITWITHKEY';_0x5a6a2e[_0x0b2b('0x85')]=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));this[_0x0b2b('0x35')][_0x121717[_0x0b2b('0x4d')]]=_0x5a6a2e;}}logger[_0x0b2b('0x77')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x121717['uniqueid'],_0x5a6a2e[_0x0b2b('0x49')],_0x5a6a2e[_0x0b2b('0x66')],_[_0x0b2b('0xa1')](_0x121717['variable'])[0x0],_0x121717[_0x0b2b('0xa2')]);_0x5a6a2e[_0x0b2b('0x16')]=this[_0x0b2b('0x16')][_0x121717[_0x0b2b('0x4d')]];}}}}catch(_0x3547f0){logger[_0x0b2b('0x3d')](_0x0b2b('0xa9'),_0x121717[_0x0b2b('0x4d')],util['inspect'](_0x3547f0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0xa0')]=function(_0x362ce2,_0x573112,_0x3d4e76){var _0x2d6f52=[_0x0b2b('0xaa'),_0x0b2b('0xab'),_0x0b2b('0xac'),'rtpaudioqosjitterbridged',_0x0b2b('0xad'),_0x0b2b('0xae'),_0x0b2b('0xaf'),'rtpaudioqosrttbridged',_0x0b2b('0xb0'),_0x0b2b('0xb1'),_0x0b2b('0xb2'),_0x0b2b('0xb3'),'membercalls','memberdynamic',_0x0b2b('0xb4'),_0x0b2b('0xb5'),_0x0b2b('0xb6'),_0x0b2b('0xb7'),'memberrealtime'];if(!_[_0x0b2b('0xb8')](_0x573112)&&!_[_0x0b2b('0xb9')](_0x2d6f52,_0x573112)){if(_[_0x0b2b('0x56')](this[_0x0b2b('0x16')][_0x362ce2])){this[_0x0b2b('0x16')][_0x362ce2]={};}this[_0x0b2b('0x16')][_0x362ce2][_0x573112]=_0x3d4e76;}};VoiceQueueReport['prototype']['handleHangup']=function(_0x2e8149,_0x4ce2a5,_0x3e299f){try{var _0xe9ddb={};if(this[_0x0b2b('0xf')][_0x2e8149]){for(var _0x2aab18=0x0;_0x2aab18<this[_0x0b2b('0xf')][_0x2e8149][_0x0b2b('0xba')];_0x2aab18+=0x1){_0xe9ddb=this['queueReports'][_0x2e8149][_0x2aab18];var _0x2674dd=this[_0x0b2b('0x13')][_0xe9ddb['queue']];if(_0x2674dd){_0x2674dd[_0x0b2b('0xbb')]+=moment(_0xe9ddb['queuecallerleaveAt'])[_0x0b2b('0xbc')](_0xe9ddb[_0x0b2b('0x74')],'seconds')||0x0;if(_0x3e299f&&_0xe9ddb['queuecallerexitreason']===_0x0b2b('0x4f')){_0xe9ddb['queuecallerexitreason']='COMPLETEDBYAGENT';}if(_0x2aab18===this[_0x0b2b('0xf')][_0x2e8149][_0x0b2b('0xba')]-0x1){_0x2674dd[_0x0b2b('0xbd')]+=moment()['milliseconds'](0x0)[_0x0b2b('0xbc')](_0xe9ddb[_0x0b2b('0x74')],_0x0b2b('0xbe'));if(hasCallerLeftTheQueue(_0xe9ddb)&&_0xe9ddb[_0x0b2b('0x4e')]!==_0x0b2b('0x4f')){_0x2674dd[_0x0b2b('0xbf')]+=0x1;}if(_0xe9ddb[_0x0b2b('0x33')]){_0x2674dd[_0x0b2b('0xc0')]+=0x1;_0x2674dd[_0x0b2b('0xc1')]+=moment()['milliseconds'](0x0)['diff'](_0xe9ddb[_0x0b2b('0x85')],'seconds');_0xe9ddb['queuecallercompleteAt']=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0xe9ddb[_0x0b2b('0x32')]=![];_0xe9ddb[_0x0b2b('0x8e')]=null;}if(_0xe9ddb['queuecallerexit']&&_0xe9ddb['transfer']!=!![]){_0x2674dd[_0x0b2b('0xc2')]+=0x1;_0xe9ddb[_0x0b2b('0xa6')]=_0x0b2b('0xc2');logger[_0x0b2b('0x4b')](_0x0b2b('0xc3'),_0x2e8149,util[_0x0b2b('0x3c')](_0xe9ddb,{'showHidden':![],'depth':null}));ami['emit'](_0x0b2b('0xc4'),_0xe9ddb);}if(_0xe9ddb['queuecallerabandon']){_0x2674dd[_0x0b2b('0xc5')]+=0x1;_0xe9ddb[_0x0b2b('0xa6')]=_0x0b2b('0xc5');logger[_0x0b2b('0x4b')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x2e8149,util[_0x0b2b('0x3c')](_0xe9ddb,{'showHidden':![],'depth':null}));ami['emit'](_0x0b2b('0xc6'),_0xe9ddb);}}else{_0x2674dd[_0x0b2b('0xbd')]+=_0x2674dd[_0x0b2b('0xbb')];}logger[_0x0b2b('0x77')](_0x0b2b('0xc7'),_0x2e8149,_0xe9ddb[_0x0b2b('0x49')],_0xe9ddb[_0x0b2b('0x66')],_0x4ce2a5);this['channels'][_0x2e8149]=_0xe9ddb;Object[_0x0b2b('0x64')](this['voiceQueues'][_0xe9ddb[_0x0b2b('0x49')]],_0x2674dd);if(_0xe9ddb['queuecallerleaveAt']){this[_0x0b2b('0x43')](_0xe9ddb,_0x0b2b('0x23'));}}}logger[_0x0b2b('0x4b')](_0x0b2b('0xc8'),_0x2e8149,util['inspect'](this[_0x0b2b('0xf')][_0x2e8149],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0xe9ddb)&&_0xe9ddb[_0x0b2b('0x4e')]!==_0x0b2b('0x4f')){ami[_0x0b2b('0x45')](_0x0b2b('0xc9'),this[_0x0b2b('0xf')][_0x2e8149]);if(this[_0x0b2b('0xf')][_0x2e8149]){delete this['queueReports'][_0x2e8149];}if(this[_0x0b2b('0x35')][_0x2e8149]){delete this[_0x0b2b('0x35')][_0x2e8149];}if(this[_0x0b2b('0x16')][_0x2e8149]){delete this[_0x0b2b('0x16')][_0x2e8149];}}}}catch(_0x5d5eb2){logger[_0x0b2b('0x3d')](_0x0b2b('0xca'),_0x2e8149,util[_0x0b2b('0x3c')](_0x5d5eb2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x24')]=function(_0x5873af){try{if(this[_0x0b2b('0x55')](_0x5873af)){logger[_0x0b2b('0x4b')](_0x0b2b('0xcb'),_0x5873af[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x5873af,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x5873af[_0x0b2b('0x4d')]]){return this[_0x0b2b('0xcc')](_0x5873af['uniqueid'],_0x5873af[_0x0b2b('0xcd')],![]);}if(this[_0x0b2b('0xf')][_0x5873af[_0x0b2b('0x96')]]){if(_0x5873af[_0x0b2b('0xce')]==='21'){return;}return this[_0x0b2b('0xcc')](_0x5873af[_0x0b2b('0x96')],_0x5873af[_0x0b2b('0xcd')],!![]);}var _0xdfdebc=Object[_0x0b2b('0xa1')](this[_0x0b2b('0xf')]);for(var _0x10e86a=0x0;_0x10e86a<_0xdfdebc[_0x0b2b('0xba')];_0x10e86a++){var _0x2150ae=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0xdfdebc[_0x10e86a]]);if(_0x2150ae&&_0x2150ae[_0x0b2b('0xcf')]===_0x5873af['uniqueid']){return this['handleHangup'](_0x2150ae[_0x0b2b('0x4d')],_0x5873af['cause-txt'],!![]);}}if(!this[_0x0b2b('0xf')][_0x5873af[_0x0b2b('0x4d')]]){logger[_0x0b2b('0x4b')](_0x0b2b('0xd0'),_0x5873af[_0x0b2b('0x4d')]);if(this[_0x0b2b('0x35')][_0x5873af[_0x0b2b('0x4d')]]){delete this[_0x0b2b('0x35')][_0x5873af['uniqueid']];}if(this[_0x0b2b('0x16')][_0x5873af[_0x0b2b('0x4d')]]){delete this['variables'][_0x5873af[_0x0b2b('0x4d')]];}}}}catch(_0x313638){logger['error']('[%s][voiceQueueReport][hangup]',_0x5873af['uniqueid'],util[_0x0b2b('0x3c')](_0x313638,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')]['syncAttendedTransfer']=function(_0x3c22cb){try{if(this[_0x0b2b('0x55')](_0x3c22cb)){logger['debug'](_0x0b2b('0xd1'),_0x3c22cb['uniqueid'],util[_0x0b2b('0x3c')](_0x3c22cb,{'showHidden':![],'depth':null}));var _0x164a13;var _0x558ecc;var _0x43499f;if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd2')]]){_0x164a13=_['last'](this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd2')]]);_0x164a13[_0x0b2b('0x9a')]=_0x3c22cb['secondtransfererexten'];_0x164a13[_0x0b2b('0x9c')]=_0x3c22cb[_0x0b2b('0xd3')];_0x164a13[_0x0b2b('0x4e')]=_0x0b2b('0x4f');_0x164a13[_0x0b2b('0x8f')]=!![];_0x164a13[_0x0b2b('0x98')]='ATTENDED';if(this['queueReports'][_0x3c22cb[_0x0b2b('0xd3')]]){_0x43499f=this[_0x0b2b('0xf')][_0x3c22cb['secondtransfereruniqueid']];this['queueReports'][_0x3c22cb[_0x0b2b('0xd3')]]=this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd2')]];this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd2')]]=_0x43499f;_0x558ecc=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x3c22cb['transfereeuniqueid']]);_0x558ecc[_0x0b2b('0xd4')]=!![];}logger[_0x0b2b('0x77')](_0x0b2b('0xd5'),_0x3c22cb['uniqueid'],_0x164a13[_0x0b2b('0x49')],_0x164a13['type'],_0x164a13[_0x0b2b('0x9a')],_0x164a13[_0x0b2b('0x9c')]);}else if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd6')]]){_0x164a13=_['last'](this[_0x0b2b('0xf')][_0x3c22cb['transfertargetuniqueid']]);_0x164a13[_0x0b2b('0x9a')]=_0x3c22cb[_0x0b2b('0xd7')];_0x164a13[_0x0b2b('0x9c')]=_0x3c22cb['origtransfereruniqueid'];_0x164a13[_0x0b2b('0x4e')]=_0x0b2b('0x4f');_0x164a13['transfer']=!![];_0x164a13[_0x0b2b('0x98')]=_0x0b2b('0xd8');if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd9')]]){_0x43499f=this['queueReports'][_0x3c22cb['origtransfereruniqueid']];this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd9')]]=this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd6')]];this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd6')]]=_0x43499f;_0x558ecc=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd6')]]);_0x558ecc[_0x0b2b('0xd4')]=!![];}logger['info'](_0x0b2b('0xd5'),_0x3c22cb[_0x0b2b('0x4d')],_0x164a13[_0x0b2b('0x49')],_0x164a13[_0x0b2b('0x66')],_0x164a13[_0x0b2b('0x9a')],_0x164a13[_0x0b2b('0x9c')]);}else if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd9')]]){_0x164a13=_[_0x0b2b('0x7b')](this['queueReports'][_0x3c22cb['origtransfereruniqueid']]);_0x164a13[_0x0b2b('0x9a')]=_0x3c22cb['origtransfererexten'];_0x164a13[_0x0b2b('0x9c')]=_0x3c22cb[_0x0b2b('0xd9')];_0x164a13[_0x0b2b('0x4e')]='ATTENDEDTRANSFER';_0x164a13['transfer']=!![];_0x164a13[_0x0b2b('0x98')]='ATTENDED';_0x164a13[_0x0b2b('0xd4')]=!![];_0x164a13[_0x0b2b('0xcf')]=_0x3c22cb[_0x0b2b('0xd2')];}else if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd3')]]){_0x164a13=_['last'](this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd3')]]);_0x164a13[_0x0b2b('0x9a')]=_0x3c22cb['secondtransfererexten'];_0x164a13[_0x0b2b('0x9c')]=_0x3c22cb[_0x0b2b('0xd3')];_0x164a13[_0x0b2b('0x4e')]=_0x0b2b('0x4f');_0x164a13[_0x0b2b('0x8f')]=!![];_0x164a13[_0x0b2b('0x98')]=_0x0b2b('0xd8');_0x164a13['switch']=!![];_0x164a13[_0x0b2b('0xcf')]=_0x3c22cb[_0x0b2b('0xd6')];}}}catch(_0x4153d3){logger[_0x0b2b('0x3d')](_0x0b2b('0xd1'),_0x3c22cb[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x4153d3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x2c')]=function(_0x6d8e7b){try{if(this['isNotNull'](_0x6d8e7b)){logger[_0x0b2b('0x4b')](_0x0b2b('0xda'),_0x6d8e7b['uniqueid'],util[_0x0b2b('0x3c')](_0x6d8e7b,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x6d8e7b[_0x0b2b('0xd2')]]){var _0x2c7bf4=_['last'](this[_0x0b2b('0xf')][_0x6d8e7b[_0x0b2b('0xd2')]]);_0x2c7bf4[_0x0b2b('0x4e')]=_0x0b2b('0xdb');_0x2c7bf4[_0x0b2b('0x8f')]=!![];_0x2c7bf4[_0x0b2b('0x98')]=_0x0b2b('0xdc');_0x2c7bf4['transferexten']=_0x6d8e7b[_0x0b2b('0xdd')];_0x2c7bf4[_0x0b2b('0x9c')]=_0x6d8e7b['transfereeuniqueid'];logger['info'](_0x0b2b('0xde'),_0x6d8e7b[_0x0b2b('0x4d')],_0x2c7bf4[_0x0b2b('0x49')],_0x2c7bf4[_0x0b2b('0x66')],_0x2c7bf4[_0x0b2b('0x9a')],_0x2c7bf4[_0x0b2b('0x9c')]);this[_0x0b2b('0x24')]({'event':_0x0b2b('0xdf'),'uniqueid':_0x6d8e7b[_0x0b2b('0xd2')],'context':_0x6d8e7b[_0x0b2b('0xe0')],'channel':_0x6d8e7b[_0x0b2b('0xe1')]});}}}catch(_0x3a1b1d){logger[_0x0b2b('0x3d')](_0x0b2b('0xda'),_0x6d8e7b['uniqueid'],util['inspect'](_0x3a1b1d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncMusicOnHoldStart']=function(_0x5a1ab9){try{if(this[_0x0b2b('0x55')](_0x5a1ab9)){logger[_0x0b2b('0x4b')](_0x0b2b('0xe2'),_0x5a1ab9[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x5a1ab9,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x5a1ab9[_0x0b2b('0x4d')]]){var _0x50f3d1=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x5a1ab9[_0x0b2b('0x4d')]]);if(!_[_0x0b2b('0xb8')](_0x50f3d1[_0x0b2b('0x85')])){_0x50f3d1[_0x0b2b('0xe3')]=moment()['format'](_0x0b2b('0x80'));logger['info'](_0x0b2b('0xe4'),_0x5a1ab9[_0x0b2b('0x4d')],_0x50f3d1[_0x0b2b('0xe3')]);}}}}catch(_0x570436){logger['error'](_0x0b2b('0xe2'),_0x5a1ab9[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x570436,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x28')]=function(_0x309d39){try{if(this[_0x0b2b('0x55')](_0x309d39)){logger['debug'](_0x0b2b('0xe5'),_0x309d39[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x309d39,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x309d39[_0x0b2b('0x4d')]]){var _0x42250d=_['last'](this[_0x0b2b('0xf')][_0x309d39['uniqueid']]);if(!_[_0x0b2b('0xb8')](_0x42250d[_0x0b2b('0xe3')])){_0x42250d[_0x0b2b('0xe6')]+=moment()[_0x0b2b('0xe7')](0x0)[_0x0b2b('0xbc')](_0x42250d[_0x0b2b('0xe3')],_0x0b2b('0xbe'));logger[_0x0b2b('0x77')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x309d39[_0x0b2b('0x4d')],_0x42250d[_0x0b2b('0xe6')]);delete _0x42250d['mohstarttime'];}}}}catch(_0x174ddf){logger[_0x0b2b('0x3d')]('[%s][voiceQueueReport][musiconholdstop]',_0x309d39[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x174ddf,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0b2b('0xe8')]=function(_0x56af54){try{if(this['isNotNull'](_0x56af54)){logger[_0x0b2b('0x4b')](_0x0b2b('0xe9'),_0x56af54[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x56af54,{'showHidden':![],'depth':null}));if(_0x56af54[_0x0b2b('0xea')]['toLowerCase']()===_0x0b2b('0xeb')){_0x56af54[_0x0b2b('0xec')]=_0x56af54[_0x0b2b('0xed')]&&_0x56af54[_0x0b2b('0xed')][_0x0b2b('0x93')](_0x0b2b('0xee'))?_0x56af54[_0x0b2b('0xed')]:(_0x56af54[_0x0b2b('0xed')]||_0x56af54[_0x0b2b('0xec')])[_0x0b2b('0x94')]();if(_[_0x0b2b('0x93')](_0x56af54['applicationdata'][_0x0b2b('0x94')](),_0x0b2b('0xef'))){logger[_0x0b2b('0x77')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x56af54['uniqueid'],_0x56af54[_0x0b2b('0xea')],_0x56af54[_0x0b2b('0xec')]);if(_[_0x0b2b('0x56')](this['channels'][_0x56af54[_0x0b2b('0x4d')]]))this[_0x0b2b('0x35')][_0x56af54[_0x0b2b('0x4d')]]={};var _0x1c134d=_0x56af54[_0x0b2b('0xec')][_0x0b2b('0xf0')]('=');var _0xc6ed53=_0x1c134d[0x0][_0x0b2b('0x94')]()[_0x0b2b('0xf1')](/cdr\((.*)\)/);if(_0xc6ed53)this[_0x0b2b('0x35')][_0x56af54[_0x0b2b('0x4d')]][_0xc6ed53[0x1]]=_0x1c134d[0x1];}}}}catch(_0xf62ade){logger['error']('[%s][voiceQueueReport][newexten]',_0x56af54['uniqueid'],util['inspect'](_0xf62ade,{'showHidden':![],'depth':null}));}};module[_0x0b2b('0xf2')]=VoiceQueueReport;
\ No newline at end of file