Built motion from commit d5e4af8c.|2.6.23
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index 692ca45..62a11c0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x6baa=['queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','emitVoiceQueueChannelSave','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexit','queuecallerexitAt','transfer','startsWith','toLowerCase','local/','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','linkedid','COMPLETEDBY','reason','[%s][voiceQueueReport][varset]','addVariable','keys','variable','value','lastevent','timeout','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','[%s][voiceQueueReport][hangup]','length','unmanaged','sumHoldTime','diff','sumDuration','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BLINDTRANSFER','BLIND','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][musiconholdstop]','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','bind','queuesummarycomplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncBlindTransfer','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','waiting','queueStatusComplete','clearZombieChannels','switch','isNil','Action','status','channel','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','error','[%s][voiceQueueReport][checkQueueReport]','inspect','variables','syncFullyBooted','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','format','voice:queue:%s','name','voice_queue_channel:remove','type','inbound','strategy','available','loggedIn','pTalking','sumBillable','total','abandoned','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','queues','catch','[voiceQueueReport][queues]','loopQueueSummary','queuesummary','then','[voiceQueueReport][queuesummary]','syncQueueSummary','queue','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','toNumber','callers','loggedin','emitVoiceQueueSummary','custom:queuesummary','syncQueueSummaryComplete','[voiceQueueReport][queuesummarycomplete]\x20event:','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','push','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','last'];(function(_0x39be76,_0x5bf653){var _0x1c163d=function(_0x352d7b){while(--_0x352d7b){_0x39be76['push'](_0x39be76['shift']());}};_0x1c163d(++_0x5bf653);}(_0x6baa,0x13a));var _0xa6ba=function(_0x79fd4e,_0x461a91){_0x79fd4e=_0x79fd4e-0x0;var _0x442810=_0x6baa[_0x79fd4e];return _0x442810;};'use strict';var _=require(_0xa6ba('0x0'));var moment=require(_0xa6ba('0x1'));var util=require('util');var md5=require(_0xa6ba('0x2'));var Redis=require(_0xa6ba('0x3'));var config=require(_0xa6ba('0x4'));var logger=require(_0xa6ba('0x5'))(_0xa6ba('0x6'));var ami=require(_0xa6ba('0x7'));var QueueReport=require(_0xa6ba('0x8'));config[_0xa6ba('0x9')]=_['defaults'](config[_0xa6ba('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0xa6ba('0xa'))(new Redis(config[_0xa6ba('0x9')]));var Sequence=function(){};Sequence[_0xa6ba('0xb')][_0xa6ba('0xc')]=function(_0xde68b4){this[_0xa6ba('0xd')]=this[_0xa6ba('0xd')]?this['tail'][_0xa6ba('0xe')](_0xde68b4):_0xde68b4();};function VoiceQueueReport(_0x28153d){this[_0xa6ba('0xf')]=new Sequence();this[_0xa6ba('0x10')]={};this[_0xa6ba('0x11')]=_0x28153d[_0xa6ba('0x11')];this[_0xa6ba('0x12')]=_0x28153d[_0xa6ba('0x13')];this['voiceQueues']=_0x28153d[_0xa6ba('0x14')];this[_0xa6ba('0x15')]=!![];this[_0xa6ba('0x16')]=_0x28153d[_0xa6ba('0x16')];this['variables']={};ami['on']('queuesummary',this['syncQueueSummary'][_0xa6ba('0x17')](this));ami['on'](_0xa6ba('0x18'),this['syncQueueSummaryComplete'][_0xa6ba('0x17')](this));ami['on'](_0xa6ba('0x19'),this[_0xa6ba('0x1a')][_0xa6ba('0x17')](this));ami['on'](_0xa6ba('0x1b'),this[_0xa6ba('0x1c')][_0xa6ba('0x17')](this));ami['on'](_0xa6ba('0x1d'),this[_0xa6ba('0x1e')][_0xa6ba('0x17')](this));ami['on'](_0xa6ba('0x1f'),this[_0xa6ba('0x20')][_0xa6ba('0x17')](this));ami['on'](_0xa6ba('0x21'),this[_0xa6ba('0x22')][_0xa6ba('0x17')](this));ami['on'](_0xa6ba('0x23'),this[_0xa6ba('0x24')]['bind'](this));ami['on'](_0xa6ba('0x25'),this[_0xa6ba('0x26')][_0xa6ba('0x17')](this));ami['on']('fullybooted',this['syncFullyBooted']['bind'](this));ami['on'](_0xa6ba('0x27'),this[_0xa6ba('0x28')][_0xa6ba('0x17')](this));ami['on'](_0xa6ba('0x29'),this[_0xa6ba('0x2a')][_0xa6ba('0x17')](this));ami['on'](_0xa6ba('0x2b'),this['syncAttendedTransfer'][_0xa6ba('0x17')](this));ami['on']('blindtransfer',this[_0xa6ba('0x2c')]['bind'](this));this['loopQueueSummary']();this[_0xa6ba('0x2d')]();}function clearChannels(_0x5d651a){if(!_['isEmpty'](_0x5d651a)){for(var _0x5442da in _0x5d651a){if(_0x5d651a[_0xa6ba('0x2e')](_0x5442da)){delete _0x5d651a[_0x5442da];}}}}function clearCampaigns(_0x5400e1){if(!_[_0xa6ba('0x2f')](_0x5400e1)){for(var _0x44beec in _0x5400e1){if(_0x5400e1[_0xa6ba('0x2e')](_0x44beec)){_0x5400e1[_0x44beec]['originated']=0x0;}}}}function clearVoiceQueues(_0x41afaa){if(!_[_0xa6ba('0x2f')](_0x41afaa)){for(var _0x3ab780 in _0x41afaa){if(_0x41afaa[_0xa6ba('0x2e')](_0x3ab780)){_0x41afaa[_0x3ab780][_0xa6ba('0x30')]=0x0;_0x41afaa[_0x3ab780][_0xa6ba('0x31')]=0x0;_0x41afaa[_0x3ab780]['pTalking']=0x0;_0x41afaa[_0x3ab780][_0xa6ba('0x32')]=0x0;_0x41afaa[_0x3ab780][_0xa6ba('0x33')]=!![];}}}}function clearAgentBooked(_0x595b5c){if(!_['isEmpty'](_0x595b5c)){for(var _0x3e2259 in _0x595b5c){if(_0x595b5c[_0xa6ba('0x2e')](_0x3e2259)){_0x595b5c[_0x3e2259]['unlockRR']=!![];}}}}VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x34')]=function(){var _0x4220b7=this;for(var _0x51cf01 in this[_0xa6ba('0x12')]){if(this[_0xa6ba('0x12')]['hasOwnProperty'](_0x51cf01)&&!this[_0xa6ba('0x12')][_0x51cf01][_0xa6ba('0x35')]){this[_0xa6ba('0xf')][_0xa6ba('0xc')](function(){if(!_[_0xa6ba('0x36')](_0x4220b7[_0xa6ba('0x12')][_0x51cf01])){return ami[_0xa6ba('0x37')]({'action':_0xa6ba('0x38'),'channel':_0x4220b7[_0xa6ba('0x12')][_0x51cf01][_0xa6ba('0x39')]})['catch'](function(_0x770f0d){if(_0x770f0d[_0xa6ba('0x3a')]===_0xa6ba('0x3b')){setTimeout(function(){if(_0x4220b7['channels'][_0x51cf01]){delete _0x4220b7['channels'][_0x51cf01];logger['error'](_0xa6ba('0x3c'),_0x51cf01,util['inspect'](_0x770f0d,{'showHidden':![],'depth':null}));}if(_0x4220b7[_0xa6ba('0x10')][_0x51cf01]){delete _0x4220b7[_0xa6ba('0x10')][_0x51cf01];logger[_0xa6ba('0x3d')](_0xa6ba('0x3e'),_0x51cf01,util[_0xa6ba('0x3f')](_0x770f0d,{'showHidden':![],'depth':null}));}if(_0x4220b7[_0xa6ba('0x40')][_0x51cf01]){delete _0x4220b7[_0xa6ba('0x40')][_0x51cf01];logger[_0xa6ba('0x3d')]('[%s][voiceQueueReport][checkVariables]',_0x51cf01,util[_0xa6ba('0x3f')](_0x770f0d,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x41')]=function(){logger[_0xa6ba('0x3d')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0xa6ba('0x12')]);this['clearQueueReport'](this[_0xa6ba('0x10')]);clearAgentBooked(this[_0xa6ba('0x11')]);clearVoiceQueues(this[_0xa6ba('0x14')]);clearCampaigns(this[_0xa6ba('0x16')]);};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x42')]=function(_0x2fb529){var _0x2cf569=this;if(!_['isEmpty'](_0x2fb529)){for(var _0x16bf09 in _0x2fb529){if(_0x2fb529['hasOwnProperty'](_0x16bf09)){_0x2cf569[_0xa6ba('0x43')](_0x2fb529[_0x16bf09],_0xa6ba('0x44'));delete _0x2fb529[_0x16bf09];}}}};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x45')]=function(_0x1e8ddb,_0x24ca38,_0x5495e0){io['to'](_0x1e8ddb)['emit'](_0x24ca38,_0x5495e0);};VoiceQueueReport[_0xa6ba('0xb')]['emitVoiceQueueChannelSave']=function(_0x28c87b,_0x4c628b){logger['debug']('[%s][voiceQueueReport]['+_0x4c628b+_0xa6ba('0x46'),_0x28c87b[_0xa6ba('0x47')],util['inspect'](_0x28c87b,{'showHidden':![],'depth':null}));this['emit'](util['format']('voice:queue:%s',_0x28c87b['name']),'voice_queue_channel:save',_0x28c87b);};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x43')]=function(_0x47fba1,_0x5b0a63){logger[_0xa6ba('0x48')](_0xa6ba('0x49')+_0x5b0a63+_0xa6ba('0x4a'),_0x47fba1['uniqueid'],util[_0xa6ba('0x3f')](_0x47fba1,{'showHidden':![],'depth':null}));this['emit'](util[_0xa6ba('0x4b')](_0xa6ba('0x4c'),_0x47fba1[_0xa6ba('0x4d')]),_0xa6ba('0x4e'),_0x47fba1);};VoiceQueueReport['prototype']['emitVoiceQueueSummary']=function(_0x1228e8,_0x214d90){if(_0x1228e8[_0xa6ba('0x4f')]===_0xa6ba('0x50')){var _0x4967d9={'id':_0x1228e8['id'],'name':_0x1228e8[_0xa6ba('0x4d')],'strategy':_0x1228e8[_0xa6ba('0x51')],'answered':_0x1228e8['answered'],'available':_0x1228e8[_0xa6ba('0x52')],'loggedIn':_0x1228e8[_0xa6ba('0x53')],'pTalking':_0x1228e8[_0xa6ba('0x54')],'sumBillable':_0x1228e8[_0xa6ba('0x55')],'sumDuration':_0x1228e8['sumDuration'],'sumHoldTime':_0x1228e8['sumHoldTime']||0x0,'talking':_0x1228e8['talking'],'total':_0x1228e8[_0xa6ba('0x56')],'type':_0x1228e8[_0xa6ba('0x4f')],'unmanaged':_0x1228e8['unmanaged'],'abandoned':_0x1228e8[_0xa6ba('0x57')],'waiting':_0x1228e8['waiting']};if(_0x1228e8[_0xa6ba('0x58')]){_0x4967d9[_0xa6ba('0x58')]={'id':_0x1228e8[_0xa6ba('0x58')]['id'],'name':_0x1228e8[_0xa6ba('0x58')][_0xa6ba('0x4d')],'active':_0x1228e8['Trunk'][_0xa6ba('0x59')],'callerid':_0x1228e8['Trunk'][_0xa6ba('0x5a')]};}if(_0x1228e8[_0xa6ba('0x5b')]){_0x4967d9[_0xa6ba('0x5b')]={'id':_0x1228e8[_0xa6ba('0x5b')]['id'],'name':_0x1228e8['Interval'][_0xa6ba('0x4d')]};}var _0x3fb5aa=md5(JSON[_0xa6ba('0x5c')](_0x4967d9));if(_0x1228e8['md5']!==_0x3fb5aa){_0x1228e8['md5']=_0x3fb5aa;logger['debug'](_0xa6ba('0x5d')+_0x214d90+_0xa6ba('0x5e'),util[_0xa6ba('0x3f')](_0x4967d9,{'showHidden':![],'depth':null}));this[_0xa6ba('0x45')](util['format'](_0xa6ba('0x4c'),_0x4967d9[_0xa6ba('0x4d')]),_0xa6ba('0x5f'),_0x4967d9);}}};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x60')]=function(_0x2afda7){return _0x2afda7!==null&&!_[_0xa6ba('0x61')](_0x2afda7);};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x2d')]=function(){var _0x1cde36=this;setInterval(function(){_0x1cde36[_0xa6ba('0x34')]();ami[_0xa6ba('0x37')]({'action':_0xa6ba('0x62')})[_0xa6ba('0x63')](function(_0x337cae){logger[_0xa6ba('0x3d')](_0xa6ba('0x64'),util['inspect'](_0x337cae,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x65')]=function(){var _0x47dd9a=this;setInterval(function(){if(_0x47dd9a[_0xa6ba('0x15')]){return ami['Action']({'action':_0xa6ba('0x66')})[_0xa6ba('0x67')](function(_0x5e1c2c){_0x47dd9a[_0xa6ba('0x15')]=![];})[_0xa6ba('0x63')](function(_0x2f7e64){logger['error'](_0xa6ba('0x68'),util[_0xa6ba('0x3f')](_0x2f7e64,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xa6ba('0x69')]=function(_0x5216fc){try{if(this[_0xa6ba('0x60')](_0x5216fc)&&this['isNotNull'](_0x5216fc['queue'])){logger[_0xa6ba('0x48')]('[voiceQueueReport][queuesummary]\x20event:',util[_0xa6ba('0x3f')](_0x5216fc,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x5216fc[_0xa6ba('0x6a')]]){logger[_0xa6ba('0x6b')](_0xa6ba('0x6c'),_0x5216fc[_0xa6ba('0x6a')]);var _0x672ad8=_[_0xa6ba('0x6d')](this[_0xa6ba('0x12')],'queue')[_0x5216fc[_0xa6ba('0x6a')]]||0x0;var _0x202191=_0x672ad8-_0x5216fc['callers'];if(this['voiceQueues'][_0x5216fc['queue']][_0xa6ba('0x32')]!==_[_0xa6ba('0x6e')](_0x5216fc[_0xa6ba('0x6f')])||this['voiceQueues'][_0x5216fc[_0xa6ba('0x6a')]][_0xa6ba('0x53')]!==_[_0xa6ba('0x6e')](_0x5216fc[_0xa6ba('0x70')])||this[_0xa6ba('0x14')][_0x5216fc[_0xa6ba('0x6a')]][_0xa6ba('0x52')]!==_[_0xa6ba('0x6e')](_0x5216fc[_0xa6ba('0x52')])||this[_0xa6ba('0x14')][_0x5216fc[_0xa6ba('0x6a')]][_0xa6ba('0x31')]!==_0x202191){this[_0xa6ba('0x14')][_0x5216fc[_0xa6ba('0x6a')]]['waiting']=_[_0xa6ba('0x6e')](_0x5216fc['callers']);this[_0xa6ba('0x14')][_0x5216fc['queue']][_0xa6ba('0x53')]=_[_0xa6ba('0x6e')](_0x5216fc[_0xa6ba('0x70')]);this[_0xa6ba('0x14')][_0x5216fc[_0xa6ba('0x6a')]][_0xa6ba('0x52')]=_[_0xa6ba('0x6e')](_0x5216fc[_0xa6ba('0x52')]);this[_0xa6ba('0x14')][_0x5216fc[_0xa6ba('0x6a')]][_0xa6ba('0x31')]=_0x202191>0x0?_0x202191:0x0;this[_0xa6ba('0x14')][_0x5216fc['queue']][_0xa6ba('0x31')]=this[_0xa6ba('0x14')][_0x5216fc[_0xa6ba('0x6a')]][_0xa6ba('0x31')]>_['toNumber'](_0x5216fc[_0xa6ba('0x70')])?_['toNumber'](_0x5216fc[_0xa6ba('0x70')]):this[_0xa6ba('0x14')][_0x5216fc[_0xa6ba('0x6a')]]['talking'];this[_0xa6ba('0x71')](this['voiceQueues'][_0x5216fc[_0xa6ba('0x6a')]],_0xa6ba('0x66'));}logger['debug']('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0xa6ba('0x3f')](this[_0xa6ba('0x14')][_0x5216fc[_0xa6ba('0x6a')]],{'showHidden':![],'depth':null}));ami[_0xa6ba('0x45')](_0xa6ba('0x72'),this['voiceQueues'][_0x5216fc[_0xa6ba('0x6a')]]);}}}catch(_0x27997e){logger['error'](_0xa6ba('0x68'),util['inspect'](_0x27997e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x73')]=function(_0x19529a){logger[_0xa6ba('0x48')](_0xa6ba('0x74'),util[_0xa6ba('0x3f')](_0x19529a,{'showHidden':![],'depth':null}));this[_0xa6ba('0x15')]=!![];};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x1a')]=function(_0x3e0296){try{if(this[_0xa6ba('0x60')](_0x3e0296)){logger[_0xa6ba('0x48')]('[%s][voiceQueueReport][queuecallerjoin]',_0x3e0296[_0xa6ba('0x47')],util[_0xa6ba('0x3f')](_0x3e0296,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0xa6ba('0x10')][_0x3e0296[_0xa6ba('0x47')]])){this[_0xa6ba('0x10')][_0x3e0296[_0xa6ba('0x47')]]=[];this[_0xa6ba('0x12')][_0x3e0296[_0xa6ba('0x47')]]={};}var _0xa2f7ad=new QueueReport();_0xa2f7ad[_0xa6ba('0x4d')]=_0x3e0296['queue'];_0xa2f7ad[_0xa6ba('0x4f')]=this[_0xa6ba('0x14')][_0xa2f7ad[_0xa6ba('0x4d')]]&&this['voiceQueues'][_0xa2f7ad[_0xa6ba('0x4d')]][_0xa6ba('0x4f')]?this['voiceQueues'][_0xa2f7ad[_0xa6ba('0x4d')]]['type']||'inbound':_0xa6ba('0x50');_0xa2f7ad[_0xa6ba('0x6a')]=_0x3e0296[_0xa6ba('0x6a')];_0xa2f7ad[_0xa6ba('0x75')]=moment()[_0xa6ba('0x4b')](_0xa6ba('0x76'));_0xa2f7ad[_0xa6ba('0x77')]=_0x3e0296[_0xa6ba('0x77')];_0xa2f7ad[_0xa6ba('0x78')]=_0x3e0296[_0xa6ba('0x78')];_0xa2f7ad['uniqueid']=_0x3e0296[_0xa6ba('0x47')];logger[_0xa6ba('0x6b')](_0xa6ba('0x79'),_0xa2f7ad[_0xa6ba('0x4d')],_0xa2f7ad[_0xa6ba('0x4f')]);_[_0xa6ba('0x7a')](_0xa2f7ad,_[_0xa6ba('0x7b')](_0x3e0296,_['keys'](_0xa2f7ad)));this[_0xa6ba('0x10')][_0x3e0296[_0xa6ba('0x47')]][_0xa6ba('0x7c')](_0xa2f7ad);this[_0xa6ba('0x12')][_0x3e0296[_0xa6ba('0x47')]]=_0xa2f7ad;this['emitVoiceQueueChannelSave'](_0xa2f7ad,_0xa6ba('0x19'));}}catch(_0x30be25){logger[_0xa6ba('0x3d')](_0xa6ba('0x7d'),_0x3e0296[_0xa6ba('0x47')],util['inspect'](_0x30be25,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x1c')]=function(_0xbf4d61){try{if(this[_0xa6ba('0x60')](_0xbf4d61)){logger[_0xa6ba('0x48')](_0xa6ba('0x7e'),_0xbf4d61['uniqueid'],util[_0xa6ba('0x3f')](_0xbf4d61,{'showHidden':![],'depth':null}));if(this[_0xa6ba('0x10')][_0xbf4d61[_0xa6ba('0x47')]]){var _0x18adb6=_[_0xa6ba('0x7f')](this['queueReports'][_0xbf4d61[_0xa6ba('0x47')]]);_0x18adb6[_0xa6ba('0x80')]=![];_0x18adb6[_0xa6ba('0x81')]=null;_0x18adb6[_0xa6ba('0x82')]=_0xbf4d61['holdtime'];_0x18adb6[_0xa6ba('0x83')]=_0xbf4d61[_0xa6ba('0x83')];_0x18adb6['queuecallerabandon']=!![];_0x18adb6[_0xa6ba('0x84')]=moment()[_0xa6ba('0x4b')](_0xa6ba('0x76'));_0x18adb6[_0xa6ba('0x85')]='ABANDONED';_0x18adb6[_0xa6ba('0x86')]=null;logger['info'](_0xa6ba('0x87'),_0x18adb6[_0xa6ba('0x4d')],_0x18adb6[_0xa6ba('0x4f')]);this[_0xa6ba('0x12')][_0xbf4d61[_0xa6ba('0x47')]]=_0x18adb6;this[_0xa6ba('0x43')](_0x18adb6,_0xa6ba('0x1b'));}}}catch(_0x51cdad){logger[_0xa6ba('0x3d')](_0xa6ba('0x7e'),_0xbf4d61[_0xa6ba('0x47')],util[_0xa6ba('0x3f')](_0x51cdad,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x1e')]=function(_0x209849){try{if(this['isNotNull'](_0x209849)){logger[_0xa6ba('0x48')](_0xa6ba('0x88'),_0x209849[_0xa6ba('0x47')],util[_0xa6ba('0x3f')](_0x209849,{'showHidden':![],'depth':null}));if(this[_0xa6ba('0x10')][_0x209849[_0xa6ba('0x47')]]){var _0x2cf1b6=_['last'](this[_0xa6ba('0x10')][_0x209849[_0xa6ba('0x47')]]);_0x2cf1b6[_0xa6ba('0x89')]=moment()['format'](_0xa6ba('0x76'));_0x2cf1b6[_0xa6ba('0x8a')]=_0x209849[_0xa6ba('0x8a')];_0x2cf1b6[_0xa6ba('0x8b')]=_0x209849[_0xa6ba('0x8b')];logger[_0xa6ba('0x6b')](_0xa6ba('0x8c'),_0x2cf1b6['name'],_0x2cf1b6['type'],_0x209849[_0xa6ba('0x8a')],_0x209849[_0xa6ba('0x8b')]);this['channels'][_0x209849[_0xa6ba('0x47')]]=_0x2cf1b6;this[_0xa6ba('0x8d')](_0x2cf1b6,_0xa6ba('0x1d'));}}}catch(_0x38cebb){logger[_0xa6ba('0x3d')](_0xa6ba('0x88'),_0x209849[_0xa6ba('0x47')],util[_0xa6ba('0x3f')](_0x38cebb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ba('0xb')]['syncAgentConnect']=function(_0x29a02d){try{if(this[_0xa6ba('0x60')](_0x29a02d)){logger[_0xa6ba('0x48')]('[%s][voiceQueueReport][agentconnect]',_0x29a02d[_0xa6ba('0x47')],util[_0xa6ba('0x3f')](_0x29a02d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x29a02d['uniqueid']]){var _0x1872fa=_['last'](this[_0xa6ba('0x10')][_0x29a02d['uniqueid']]);_0x1872fa['queuecallercomplete']=!![];_0x1872fa[_0xa6ba('0x85')]='COMPLETEDBYAGENT';logger[_0xa6ba('0x6b')](_0xa6ba('0x8e'),_0x1872fa['name'],_0x1872fa['type']);}}}catch(_0x339fc1){logger[_0xa6ba('0x3d')](_0xa6ba('0x8f'),_0x29a02d['uniqueid'],util['inspect'](_0x339fc1,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xa6ba('0x20')]=function(_0x11abd5){try{if(this[_0xa6ba('0x60')](_0x11abd5)){logger[_0xa6ba('0x48')](_0xa6ba('0x90'),_0x11abd5['uniqueid'],util[_0xa6ba('0x3f')](_0x11abd5,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x11abd5[_0xa6ba('0x47')]]){var _0x29824f=_[_0xa6ba('0x7f')](this[_0xa6ba('0x10')][_0x11abd5[_0xa6ba('0x47')]]);_0x29824f[_0xa6ba('0x1b')]=![];_0x29824f['queuecallerabandonAt']=null;_0x29824f[_0xa6ba('0x91')]=!![];_0x29824f[_0xa6ba('0x86')]=_0x11abd5[_0xa6ba('0x92')];_0x29824f[_0xa6ba('0x82')]=_0x11abd5[_0xa6ba('0x82')];_0x29824f[_0xa6ba('0x80')]=!![];_0x29824f[_0xa6ba('0x93')]=![];_0x29824f[_0xa6ba('0x94')]=null;if(!_0x29824f[_0xa6ba('0x95')]){if(_0x11abd5['reason']==_0xa6ba('0x95')){_0x29824f['queuecallerexitreason']='COMPLETED';logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x29824f['name'],_0x29824f[_0xa6ba('0x4f')]);}else{if(_[_0xa6ba('0x96')](_0x11abd5[_0xa6ba('0x39')][_0xa6ba('0x97')](),_0xa6ba('0x98'))){if(this[_0xa6ba('0x10')][_0x11abd5['linkedid']]){var _0x558c6a=_[_0xa6ba('0x7f')](this['queueReports'][_0x11abd5['linkedid']]);_0x558c6a['queuecallercomplete']=![];_0x558c6a['queuecallerexit']=!![];_0x558c6a['queuecallerexitAt']=moment(_0x29824f[_0xa6ba('0x75')])[_0xa6ba('0x99')](_0x11abd5[_0xa6ba('0x82')],_0xa6ba('0x9a'))[_0xa6ba('0x4b')](_0xa6ba('0x76'));_0x558c6a['queuecallerexitreason']=_0xa6ba('0x9b');_0x558c6a[_0xa6ba('0x95')]=!![];_0x558c6a[_0xa6ba('0x9c')]=_0xa6ba('0x9d');_0x558c6a['transferexten']=_0x11abd5[_0xa6ba('0x9e')];_0x558c6a[_0xa6ba('0x9f')]=_0x11abd5['uniqueid'];logger[_0xa6ba('0x6b')](_0xa6ba('0xa0'),_0x558c6a[_0xa6ba('0x4d')],_0x558c6a[_0xa6ba('0x4f')]);var _0x1bee0d=this['queueReports'][_0x11abd5[_0xa6ba('0xa1')]];this[_0xa6ba('0x10')][_0x11abd5['linkedid']]=this[_0xa6ba('0x10')][_0x11abd5[_0xa6ba('0x47')]];this[_0xa6ba('0x10')][_0x11abd5[_0xa6ba('0x47')]]=_0x1bee0d;}}else{_0x29824f[_0xa6ba('0x85')]=_0xa6ba('0xa2')+_0x11abd5[_0xa6ba('0xa3')]['toUpperCase']();logger[_0xa6ba('0x6b')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x29824f['name'],_0x29824f[_0xa6ba('0x4f')],_0x29824f[_0xa6ba('0x85')]);}}}this[_0xa6ba('0x12')][_0x11abd5[_0xa6ba('0x47')]]=_0x29824f;this['emitVoiceQueueChannelRemove'](_0x29824f,'agentcomplete');}}}catch(_0x50bcf2){logger[_0xa6ba('0x3d')](_0xa6ba('0x90'),_0x11abd5[_0xa6ba('0x47')],util[_0xa6ba('0x3f')](_0x50bcf2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x24')]=function(_0x333976){try{if(this['isNotNull'](_0x333976)){logger[_0xa6ba('0x48')](_0xa6ba('0xa4'),_0x333976[_0xa6ba('0x47')],util['inspect'](_0x333976,{'showHidden':![],'depth':null}));this[_0xa6ba('0xa5')](_0x333976['uniqueid'],_[_0xa6ba('0xa6')](_0x333976[_0xa6ba('0xa7')])[0x0],_0x333976['value']);if(this[_0xa6ba('0x10')][_0x333976[_0xa6ba('0x47')]]){var _0x39e772=_[_0xa6ba('0x7f')](this[_0xa6ba('0x10')][_0x333976[_0xa6ba('0x47')]]);if(_0x39e772){if(this[_0xa6ba('0x60')](_0x333976['variable'])&&this[_0xa6ba('0x60')](_0x333976[_0xa6ba('0xa7')]['queuestatus'])){switch(_0x333976[_0xa6ba('0xa8')]){case'CONTINUE':_0x39e772[_0xa6ba('0x93')]=![];_0x39e772[_0xa6ba('0x94')]=null;break;case'TIMEOUT':_0x39e772[_0xa6ba('0xa9')]=_0xa6ba('0xaa');_0x39e772[_0xa6ba('0x93')]=!![];_0x39e772[_0xa6ba('0x94')]=moment()[_0xa6ba('0x4b')](_0xa6ba('0x76'));_0x39e772[_0xa6ba('0x89')]=moment()['format'](_0xa6ba('0x76'));logger[_0xa6ba('0x48')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x333976['uniqueid'],util['inspect'](_0x39e772,{'showHidden':![],'depth':null}));ami['emit']('custom:timeout',_0x39e772);break;default:_0x39e772[_0xa6ba('0x93')]=!![];_0x39e772[_0xa6ba('0x94')]=moment()['format'](_0xa6ba('0x76'));_0x39e772['queuecallerleaveAt']=moment()[_0xa6ba('0x4b')](_0xa6ba('0x76'));}_0x39e772[_0xa6ba('0x1b')]=![];_0x39e772[_0xa6ba('0x84')]=null;_0x39e772[_0xa6ba('0x85')]=_0x333976[_0xa6ba('0xa8')];this[_0xa6ba('0x12')][_0x333976[_0xa6ba('0x47')]]=_0x39e772;this[_0xa6ba('0x43')](_0x39e772,'varset');}else if(this['isNotNull'](_0x333976[_0xa6ba('0xa7')])&&this['isNotNull'](_0x333976[_0xa6ba('0xa7')][_0xa6ba('0xab')])){if(!_0x39e772[_0xa6ba('0x1b')]){_0x39e772[_0xa6ba('0x93')]=!![];_0x39e772[_0xa6ba('0x94')]=moment()['format'](_0xa6ba('0x76'));_0x39e772['queuecallerexitreason']='EXITWITHKEY';_0x39e772['queuecallerleaveAt']=moment()[_0xa6ba('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xa6ba('0x12')][_0x333976[_0xa6ba('0x47')]]=_0x39e772;}}logger[_0xa6ba('0x6b')](_0xa6ba('0xac'),_0x333976[_0xa6ba('0x47')],_0x39e772['name'],_0x39e772[_0xa6ba('0x4f')],_[_0xa6ba('0xa6')](_0x333976[_0xa6ba('0xa7')])[0x0],_0x333976['value']);_0x39e772[_0xa6ba('0x40')]=this[_0xa6ba('0x40')][_0x333976['uniqueid']];}}}}catch(_0x4989f4){logger[_0xa6ba('0x3d')](_0xa6ba('0xa4'),_0x333976[_0xa6ba('0x47')],util[_0xa6ba('0x3f')](_0x4989f4,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ba('0xb')]['addVariable']=function(_0x4ce67d,_0x39ac22,_0x151398){var _0x1479c6=[_0xa6ba('0xad'),'rtpaudioqosbridged',_0xa6ba('0xae'),'rtpaudioqosjitterbridged',_0xa6ba('0xaf'),_0xa6ba('0xb0'),_0xa6ba('0xb1'),_0xa6ba('0xb2'),'sipcallid',_0xa6ba('0xb3'),_0xa6ba('0xb4'),_0xa6ba('0xb5'),'membercalls',_0xa6ba('0xb6'),_0xa6ba('0xb7'),_0xa6ba('0xb8'),'membername',_0xa6ba('0xb9'),_0xa6ba('0xba')];if(!_[_0xa6ba('0x36')](_0x39ac22)&&!_['includes'](_0x1479c6,_0x39ac22)){if(_[_0xa6ba('0x61')](this[_0xa6ba('0x40')][_0x4ce67d])){this[_0xa6ba('0x40')][_0x4ce67d]={};}this[_0xa6ba('0x40')][_0x4ce67d][_0x39ac22]=_0x151398;}};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x26')]=function(_0x5cd668){try{if(this['isNotNull'](_0x5cd668)){logger[_0xa6ba('0x48')](_0xa6ba('0xbb'),_0x5cd668[_0xa6ba('0x47')],util['inspect'](_0x5cd668,{'showHidden':![],'depth':null}));if(this[_0xa6ba('0x10')][_0x5cd668[_0xa6ba('0x47')]]){for(var _0x5b0644=0x0,_0x4c7aca={};_0x5b0644<this[_0xa6ba('0x10')][_0x5cd668[_0xa6ba('0x47')]][_0xa6ba('0xbc')];_0x5b0644+=0x1){_0x4c7aca=this['queueReports'][_0x5cd668[_0xa6ba('0x47')]][_0x5b0644];if(this['voiceQueues'][_0x4c7aca[_0xa6ba('0x6a')]]){if(_0x4c7aca['queuecallerexit']&&_0x4c7aca[_0xa6ba('0x95')]!=!![]){this[_0xa6ba('0x14')][_0x4c7aca[_0xa6ba('0x6a')]][_0xa6ba('0xbd')]+=0x1;}if(_0x4c7aca[_0xa6ba('0x1b')]){this[_0xa6ba('0x14')][_0x4c7aca['queue']][_0xa6ba('0x57')]+=0x1;}this[_0xa6ba('0x14')][_0x4c7aca[_0xa6ba('0x6a')]][_0xa6ba('0xbe')]+=moment(_0x4c7aca[_0xa6ba('0x89')])[_0xa6ba('0xbf')](_0x4c7aca['queuecallerjoinAt'],_0xa6ba('0x9a'))||0x0;if(_0x5b0644===this[_0xa6ba('0x10')][_0x5cd668[_0xa6ba('0x47')]][_0xa6ba('0xbc')]-0x1){this[_0xa6ba('0x14')][_0x4c7aca['queue']][_0xa6ba('0xc0')]+=moment()[_0xa6ba('0xc1')](0x0)['diff'](_0x4c7aca[_0xa6ba('0x75')],_0xa6ba('0x9a'));this[_0xa6ba('0x14')][_0x4c7aca[_0xa6ba('0x6a')]][_0xa6ba('0x56')]+=0x1;if(_0x4c7aca['queuecallercomplete']){this[_0xa6ba('0x14')][_0x4c7aca[_0xa6ba('0x6a')]]['answered']+=0x1;this[_0xa6ba('0x14')][_0x4c7aca[_0xa6ba('0x6a')]][_0xa6ba('0x55')]+=moment()[_0xa6ba('0xc1')](0x0)[_0xa6ba('0xbf')](_0x4c7aca[_0xa6ba('0x89')],_0xa6ba('0x9a'));_0x4c7aca[_0xa6ba('0x81')]=moment()[_0xa6ba('0x4b')](_0xa6ba('0x76'));_0x4c7aca['queuecallerexit']=![];_0x4c7aca[_0xa6ba('0x94')]=null;}if(_0x4c7aca[_0xa6ba('0x93')]&&_0x4c7aca[_0xa6ba('0x95')]!=!![]){_0x4c7aca[_0xa6ba('0xa9')]=_0xa6ba('0xbd');logger[_0xa6ba('0x48')](_0xa6ba('0xc2'),_0x5cd668['uniqueid'],util[_0xa6ba('0x3f')](_0x4c7aca,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerunmanaged',_0x4c7aca);}if(_0x4c7aca[_0xa6ba('0x1b')]){_0x4c7aca[_0xa6ba('0xa9')]=_0xa6ba('0x57');logger[_0xa6ba('0x48')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x5cd668['uniqueid'],util[_0xa6ba('0x3f')](_0x4c7aca,{'showHidden':![],'depth':null}));ami[_0xa6ba('0x45')]('custom:queuecallerabandon',_0x4c7aca);}}else{this[_0xa6ba('0x14')][_0x4c7aca[_0xa6ba('0x6a')]][_0xa6ba('0xc0')]+=this[_0xa6ba('0x14')][_0x4c7aca[_0xa6ba('0x6a')]][_0xa6ba('0xbe')];}logger[_0xa6ba('0x6b')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x5cd668[_0xa6ba('0x47')],_0x4c7aca[_0xa6ba('0x4d')],_0x4c7aca[_0xa6ba('0x4f')],_0x5cd668[_0xa6ba('0xc3')]);this[_0xa6ba('0x12')][_0x5cd668['uniqueid']]=_0x4c7aca;this['emitVoiceQueueChannelRemove'](_0x4c7aca,'hangup');this[_0xa6ba('0x71')](this[_0xa6ba('0x14')][_0x4c7aca[_0xa6ba('0x6a')]],'hangup');}}logger['debug'](_0xa6ba('0xc4'),_0x5cd668['uniqueid'],util['inspect'](this['queueReports'][_0x5cd668[_0xa6ba('0x47')]],{'showHidden':![],'depth':null}));ami['emit']('custom:voiceQueueReport',this[_0xa6ba('0x10')][_0x5cd668[_0xa6ba('0x47')]]);delete this['queueReports'][_0x5cd668[_0xa6ba('0x47')]];delete this[_0xa6ba('0x12')][_0x5cd668[_0xa6ba('0x47')]];}if(this[_0xa6ba('0x40')][_0x5cd668['uniqueid']]){delete this[_0xa6ba('0x40')][_0x5cd668['uniqueid']];}}}catch(_0x37bb9a){logger['error'](_0xa6ba('0xbb'),_0x5cd668['uniqueid'],util['inspect'](_0x37bb9a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0xc5')]=function(_0x564c47){try{if(this[_0xa6ba('0x60')](_0x564c47)){logger[_0xa6ba('0x48')](_0xa6ba('0xc6'),_0x564c47['uniqueid'],util[_0xa6ba('0x3f')](_0x564c47,{'showHidden':![],'depth':null}));var _0x54dca9;if(this['queueReports'][_0x564c47[_0xa6ba('0xc7')]]){_0x54dca9=_[_0xa6ba('0x7f')](this[_0xa6ba('0x10')][_0x564c47[_0xa6ba('0xc7')]]);_0x54dca9[_0xa6ba('0xc8')]=_0x564c47[_0xa6ba('0xc9')];_0x54dca9[_0xa6ba('0x9f')]=_0x564c47[_0xa6ba('0xca')];_0x54dca9[_0xa6ba('0x85')]=_0xa6ba('0xcb');_0x54dca9['transfer']=!![];_0x54dca9[_0xa6ba('0x9c')]=_0xa6ba('0xcc');if(this[_0xa6ba('0x10')][_0x564c47[_0xa6ba('0xca')]]){var _0x4d14a5=this[_0xa6ba('0x10')][_0x564c47[_0xa6ba('0xca')]];this[_0xa6ba('0x10')][_0x564c47['secondtransfereruniqueid']]=this[_0xa6ba('0x10')][_0x564c47[_0xa6ba('0xc7')]];this[_0xa6ba('0x10')][_0x564c47[_0xa6ba('0xc7')]]=_0x4d14a5;var _0x386298=_[_0xa6ba('0x7f')](this[_0xa6ba('0x10')][_0x564c47[_0xa6ba('0xc7')]]);_0x386298[_0xa6ba('0x35')]=!![];}logger['info']('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x564c47['uniqueid'],_0x54dca9[_0xa6ba('0x4d')],_0x54dca9[_0xa6ba('0x4f')],_0x54dca9[_0xa6ba('0xc8')],_0x54dca9[_0xa6ba('0x9f')]);}else if(this['queueReports'][_0x564c47[_0xa6ba('0xcd')]]){_0x54dca9=_[_0xa6ba('0x7f')](this[_0xa6ba('0x10')][_0x564c47[_0xa6ba('0xcd')]]);_0x54dca9[_0xa6ba('0xc8')]=_0x564c47[_0xa6ba('0xce')];_0x54dca9['transferuniqueid']=_0x564c47[_0xa6ba('0xcf')];_0x54dca9[_0xa6ba('0x85')]=_0xa6ba('0xcb');_0x54dca9[_0xa6ba('0x95')]=!![];_0x54dca9['transfertype']='ATTENDED';if(this[_0xa6ba('0x10')][_0x564c47[_0xa6ba('0xcf')]]){var _0x4d14a5=this[_0xa6ba('0x10')][_0x564c47[_0xa6ba('0xcf')]];this['queueReports'][_0x564c47[_0xa6ba('0xcf')]]=this[_0xa6ba('0x10')][_0x564c47[_0xa6ba('0xcd')]];this[_0xa6ba('0x10')][_0x564c47[_0xa6ba('0xcd')]]=_0x4d14a5;var _0x386298=_[_0xa6ba('0x7f')](this['queueReports'][_0x564c47[_0xa6ba('0xcd')]]);_0x386298[_0xa6ba('0x35')]=!![];}logger[_0xa6ba('0x6b')](_0xa6ba('0xd0'),_0x564c47[_0xa6ba('0x47')],_0x54dca9[_0xa6ba('0x4d')],_0x54dca9['type'],_0x54dca9[_0xa6ba('0xc8')],_0x54dca9[_0xa6ba('0x9f')]);}}}catch(_0x2baff7){logger[_0xa6ba('0x3d')]('[%s][voiceQueueReport][attendedtransfer]',_0x564c47['uniqueid'],util[_0xa6ba('0x3f')](_0x2baff7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x2c')]=function(_0x3b0c7d){try{if(this[_0xa6ba('0x60')](_0x3b0c7d)){logger['debug']('[%s][voiceQueueReport][blindtransfer]',_0x3b0c7d['uniqueid'],util[_0xa6ba('0x3f')](_0x3b0c7d,{'showHidden':![],'depth':null}));if(this[_0xa6ba('0x10')][_0x3b0c7d[_0xa6ba('0xc7')]]){var _0x5c0149=_['last'](this['queueReports'][_0x3b0c7d[_0xa6ba('0xc7')]]);_0x5c0149[_0xa6ba('0x85')]=_0xa6ba('0xd1');_0x5c0149['transfer']=!![];_0x5c0149[_0xa6ba('0x9c')]=_0xa6ba('0xd2');_0x5c0149[_0xa6ba('0xc8')]=_0x3b0c7d['extension'];_0x5c0149[_0xa6ba('0x9f')]=_0x3b0c7d[_0xa6ba('0xc7')];logger['info']('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x3b0c7d[_0xa6ba('0x47')],_0x5c0149[_0xa6ba('0x4d')],_0x5c0149[_0xa6ba('0x4f')],_0x5c0149['transferexten'],_0x5c0149['transferuniqueid']);this[_0xa6ba('0x26')]({'event':_0xa6ba('0xd3'),'uniqueid':_0x3b0c7d[_0xa6ba('0xc7')],'context':_0x3b0c7d[_0xa6ba('0xd4')],'channel':_0x3b0c7d[_0xa6ba('0xd5')]});}}}catch(_0x496220){logger['error'](_0xa6ba('0xd6'),_0x3b0c7d[_0xa6ba('0x47')],util[_0xa6ba('0x3f')](_0x496220,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x28')]=function(_0x4e80fc){try{if(this[_0xa6ba('0x60')](_0x4e80fc)){logger[_0xa6ba('0x48')](_0xa6ba('0xd7'),_0x4e80fc[_0xa6ba('0x47')],util[_0xa6ba('0x3f')](_0x4e80fc,{'showHidden':![],'depth':null}));if(this[_0xa6ba('0x10')][_0x4e80fc[_0xa6ba('0x47')]]){var _0xe3aa6b=_[_0xa6ba('0x7f')](this[_0xa6ba('0x10')][_0x4e80fc['uniqueid']]);if(!_[_0xa6ba('0x36')](_0xe3aa6b[_0xa6ba('0x89')])){_0xe3aa6b['mohstarttime']=moment()[_0xa6ba('0x4b')](_0xa6ba('0x76'));logger['info'](_0xa6ba('0xd8'),_0x4e80fc[_0xa6ba('0x47')],_0xe3aa6b[_0xa6ba('0xd9')]);}}}}catch(_0x4a7a1c){logger[_0xa6ba('0x3d')](_0xa6ba('0xd7'),_0x4e80fc[_0xa6ba('0x47')],util[_0xa6ba('0x3f')](_0x4a7a1c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xa6ba('0xb')][_0xa6ba('0x2a')]=function(_0x5726e5){try{if(this['isNotNull'](_0x5726e5)){logger[_0xa6ba('0x48')]('[%s][voiceQueueReport][musiconholdstop]',_0x5726e5['uniqueid'],util[_0xa6ba('0x3f')](_0x5726e5,{'showHidden':![],'depth':null}));if(this[_0xa6ba('0x10')][_0x5726e5['uniqueid']]){var _0x28f517=_[_0xa6ba('0x7f')](this[_0xa6ba('0x10')][_0x5726e5[_0xa6ba('0x47')]]);if(!_[_0xa6ba('0x36')](_0x28f517[_0xa6ba('0xd9')])){_0x28f517[_0xa6ba('0xda')]+=moment()[_0xa6ba('0xc1')](0x0)[_0xa6ba('0xbf')](_0x28f517[_0xa6ba('0xd9')],_0xa6ba('0x9a'));logger['info'](_0xa6ba('0xdb'),_0x5726e5[_0xa6ba('0x47')],_0x28f517[_0xa6ba('0xda')]);delete _0x28f517[_0xa6ba('0xd9')];}}}}catch(_0x5223ea){logger[_0xa6ba('0x3d')](_0xa6ba('0xdc'),_0x5726e5[_0xa6ba('0x47')],util[_0xa6ba('0x3f')](_0x5223ea,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;
\ No newline at end of file
+var _0xaf87=['../../../config/logger','ami','../ami','../model/queueReport','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','realtime','agents','queueChannels','voiceQueues','campaigns','summary','variables','syncQueueSummary','syncQueueSummaryComplete','bind','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','originated','hasOwnProperty','talking','pTalking','queueStatusComplete','unlockRR','queuecallerabandon','clearZombieChannels','channels','switch','sequence','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','inspect','queueReports','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','voice:queue:%s','queue','voice_queue_presence:save','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','format','voice_queue_channel:remove','inbound','voice_queue:save','isUndefined','queues','[voiceQueueReport][queues]','isRunning','queuesummary','actionid','queuestatus','[voiceQueueReport][queuesummary]','name','summaryEvent','createQueueSummaryReport','compareToInboundQueue','assign','emitInboundVoiceQueueSummary','type','handleInboundQueueSummaryReport','outbound','custom:queuesummary','statusRequests','push','isNotNull','completeEvent','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','holdtime','originalposition','queuecallerabandonAt','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','last','connectedlinenum','connectedlinename','info','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','lastAssignedTo','membername','queuecallerexit','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','seconds','FORWARDTRANSFER','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','variable','value','CONTINUE','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','handleHangup','length','sumHoldTime','diff','sumDuration','milliseconds','total','answered','sumBillable','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','cause-txt','cause','transferid','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','transfertype','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','BLINDTRANSFER','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]','exports','util','../../../config/environment'];(function(_0x4c6065,_0x209b7f){var _0x1dbcad=function(_0x5bc182){while(--_0x5bc182){_0x4c6065['push'](_0x4c6065['shift']());}};_0x1dbcad(++_0x209b7f);}(_0xaf87,0x1e2));var _0x7af8=function(_0x52aad7,_0x2a23c5){_0x52aad7=_0x52aad7-0x0;var _0x46c2b1=_0xaf87[_0x52aad7];return _0x46c2b1;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x7af8('0x0'));var Redis=require('ioredis');var config=require(_0x7af8('0x1'));var logger=require(_0x7af8('0x2'))(_0x7af8('0x3'));var ami=require(_0x7af8('0x4'));var QueueReport=require(_0x7af8('0x5'));var VoiceQueueSummary=require('../model/voiceQueueSummary');config['redis']=_[_0x7af8('0x6')](config[_0x7af8('0x7')],{'host':_0x7af8('0x8'),'port':0x18eb});var io=require(_0x7af8('0x9'))(new Redis(config[_0x7af8('0x7')]));var Sequence=function(){};Sequence[_0x7af8('0xa')][_0x7af8('0xb')]=function(_0x4cac69){this[_0x7af8('0xc')]=this[_0x7af8('0xc')]?this['tail'][_0x7af8('0xd')](_0x4cac69):_0x4cac69();};function VoiceQueueReport(_0x250ac9){this['sequence']=new Sequence();this['queueReports']={};this[_0x7af8('0xe')]=_0x250ac9;this[_0x7af8('0xf')]=_0x250ac9[_0x7af8('0xf')];this['channels']=_0x250ac9[_0x7af8('0x10')];this[_0x7af8('0x11')]=_0x250ac9['voiceQueues'];this['campaigns']=_0x250ac9[_0x7af8('0x12')];this[_0x7af8('0x13')]=initializeSummary();this[_0x7af8('0x14')]={};ami['on']('queuesummary',this[_0x7af8('0x15')]['bind'](this));ami['on']('queuesummarycomplete',this[_0x7af8('0x16')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x18'),this[_0x7af8('0x19')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x1a'),this[_0x7af8('0x1b')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x1c'),this[_0x7af8('0x1d')][_0x7af8('0x17')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x1e'),this[_0x7af8('0x1f')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x20'),this[_0x7af8('0x21')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x22'),this[_0x7af8('0x23')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x24'),this[_0x7af8('0x25')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x26'),this[_0x7af8('0x27')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x28'),this['syncFullyBooted'][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x29'),this[_0x7af8('0x2a')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x2b'),this[_0x7af8('0x2c')][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x2d'),this['syncAttendedTransfer'][_0x7af8('0x17')](this));ami['on'](_0x7af8('0x2e'),this[_0x7af8('0x2f')][_0x7af8('0x17')](this));this[_0x7af8('0x30')]();this[_0x7af8('0x31')]();}function clearChannels(_0x4e1aef){if(!_[_0x7af8('0x32')](_0x4e1aef)){for(var _0x3a64ab in _0x4e1aef){if(_0x4e1aef['hasOwnProperty'](_0x3a64ab)){delete _0x4e1aef[_0x3a64ab];}}}}function clearCampaigns(_0x3bd3aa){if(!_[_0x7af8('0x32')](_0x3bd3aa)){for(var _0x2e8a9d in _0x3bd3aa){if(_0x3bd3aa['hasOwnProperty'](_0x2e8a9d)){_0x3bd3aa[_0x2e8a9d][_0x7af8('0x33')]=0x0;}}}}function clearVoiceQueues(_0x2ff86c){if(!_[_0x7af8('0x32')](_0x2ff86c)){for(var _0x181ca2 in _0x2ff86c){if(_0x2ff86c[_0x7af8('0x34')](_0x181ca2)){_0x2ff86c[_0x181ca2][_0x7af8('0x33')]=0x0;_0x2ff86c[_0x181ca2][_0x7af8('0x35')]=0x0;_0x2ff86c[_0x181ca2][_0x7af8('0x36')]=0x0;_0x2ff86c[_0x181ca2]['waiting']=0x0;_0x2ff86c[_0x181ca2][_0x7af8('0x37')]=!![];}}}}function clearAgentBooked(_0x440bde){if(!_[_0x7af8('0x32')](_0x440bde)){for(var _0x5992f0 in _0x440bde){if(_0x440bde[_0x7af8('0x34')](_0x5992f0)){_0x440bde[_0x5992f0][_0x7af8('0x38')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x3e8f1c){return _0x3e8f1c['queuecallerexit']||_0x3e8f1c[_0x7af8('0x39')]||_0x3e8f1c['queuecallercomplete'];}VoiceQueueReport['prototype'][_0x7af8('0x3a')]=function(){var _0x3608b8=this;for(var _0x910a7c in this[_0x7af8('0x3b')]){if(this[_0x7af8('0x3b')]['hasOwnProperty'](_0x910a7c)&&!this['channels'][_0x910a7c][_0x7af8('0x3c')]){this[_0x7af8('0x3d')][_0x7af8('0xb')](function(){if(!_[_0x7af8('0x3e')](_0x3608b8[_0x7af8('0x3b')][_0x910a7c])){return ami[_0x7af8('0x3f')]({'action':_0x7af8('0x40'),'channel':_0x3608b8[_0x7af8('0x3b')][_0x910a7c][_0x7af8('0x41')]})[_0x7af8('0x42')](function(_0x17fedb){if(_0x17fedb[_0x7af8('0x43')]===_0x7af8('0x44')){setTimeout(function(){if(_0x3608b8[_0x7af8('0x3b')][_0x910a7c]){delete _0x3608b8[_0x7af8('0x3b')][_0x910a7c];logger[_0x7af8('0x45')]('[%s][voiceQueueReport][checkChannel]',_0x910a7c,util[_0x7af8('0x46')](_0x17fedb,{'showHidden':![],'depth':null}));}if(_0x3608b8[_0x7af8('0x47')][_0x910a7c]){delete _0x3608b8[_0x7af8('0x47')][_0x910a7c];logger[_0x7af8('0x45')]('[%s][voiceQueueReport][checkQueueReport]',_0x910a7c,util[_0x7af8('0x46')](_0x17fedb,{'showHidden':![],'depth':null}));}if(_0x3608b8['variables'][_0x910a7c]){delete _0x3608b8[_0x7af8('0x14')][_0x910a7c];logger[_0x7af8('0x45')](_0x7af8('0x48'),_0x910a7c,util[_0x7af8('0x46')](_0x17fedb,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x49')]=function(){logger['error'](_0x7af8('0x4a'));clearChannels(this[_0x7af8('0x3b')]);this[_0x7af8('0x4b')](this[_0x7af8('0x47')]);clearAgentBooked(this[_0x7af8('0xf')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this['campaigns']);this[_0x7af8('0x13')]=initializeSummary();};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x4b')]=function(_0x32e3cd){var _0x56f2e3=this;if(!_[_0x7af8('0x32')](_0x32e3cd)){for(var _0x31ad5a in _0x32e3cd){if(_0x32e3cd[_0x7af8('0x34')](_0x31ad5a)){_0x56f2e3[_0x7af8('0x4c')](_0x32e3cd[_0x31ad5a],_0x7af8('0x4d'));delete _0x32e3cd[_0x31ad5a];}}}};VoiceQueueReport['prototype'][_0x7af8('0x4e')]=function(_0x19c2d3,_0x59c2df,_0x618bae){io['to'](_0x19c2d3)[_0x7af8('0x4e')](_0x59c2df,_0x618bae);};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x4f')]=function(_0x1729f1,_0x5c329d){logger[_0x7af8('0x50')]('[%s][voiceQueueReport]['+_0x5c329d+_0x7af8('0x51'),_0x1729f1[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x1729f1,{'showHidden':![],'depth':null}));this[_0x7af8('0x4e')](util['format'](_0x7af8('0x53'),_0x1729f1[_0x7af8('0x54')]),'voice_queue_channel:save',_0x1729f1);io['emit'](_0x7af8('0x55'),_0x1729f1);};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x4c')]=function(_0x43a25f,_0xfd169e){logger['debug'](_0x7af8('0x56')+_0xfd169e+_0x7af8('0x57'),_0x43a25f[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x43a25f,{'showHidden':![],'depth':null}));if(_0x43a25f[_0x7af8('0x58')]===_0x7af8('0x59')){return;}this[_0x7af8('0x4e')](util[_0x7af8('0x5a')](_0x7af8('0x53'),_0x43a25f[_0x7af8('0x54')]),_0x7af8('0x5b'),_0x43a25f);io[_0x7af8('0x4e')]('voice_queue_presence:remove',_0x43a25f);};VoiceQueueReport['prototype']['emitInboundVoiceQueueSummary']=function(_0x169ad7){if(_0x169ad7['type']===_0x7af8('0x5c')){logger[_0x7af8('0x50')]('[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:',util[_0x7af8('0x46')](_0x169ad7,{'showHidden':![],'depth':null}));this[_0x7af8('0x4e')](util['format'](_0x7af8('0x53'),_0x169ad7['name']),_0x7af8('0x5d'),_0x169ad7);}};VoiceQueueReport[_0x7af8('0xa')]['isNotNull']=function(_0x3da179){return _0x3da179!==null&&!_[_0x7af8('0x5e')](_0x3da179);};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x31')]=function(){var _0x3c0d97=this;setInterval(function(){_0x3c0d97[_0x7af8('0x3a')]();ami['Action']({'action':_0x7af8('0x5f')})['catch'](function(_0x45e3a3){logger[_0x7af8('0x45')](_0x7af8('0x60'),util[_0x7af8('0x46')](_0x45e3a3,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x30')]=function(){var _0x32fa10=this;setInterval(function(){if(!_0x32fa10[_0x7af8('0x13')][_0x7af8('0x61')]){return ami[_0x7af8('0x3f')]({'action':_0x7af8('0x62')})['then'](function(_0x15b0f1){_0x32fa10[_0x7af8('0x13')]['id']=_0x15b0f1[_0x7af8('0x63')];_0x32fa10[_0x7af8('0x13')]['isRunning']=!![];_0x32fa10[_0x7af8('0x13')][_0x7af8('0x64')][_0x15b0f1[_0x7af8('0x63')]]={};})[_0x7af8('0x42')](function(_0x2977b2){logger[_0x7af8('0x45')](_0x7af8('0x65'),util[_0x7af8('0x46')](_0x2977b2,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype']['createQueueSummaryReport']=function(_0x40fba5,_0xbe2344){var _0x5f3285;if(this[_0x7af8('0x13')]&&this['summary']['queues']&&this['summary'][_0x7af8('0x5f')][_0x40fba5[_0x7af8('0x66')]]){_0x5f3285=this[_0x7af8('0x13')][_0x7af8('0x5f')][_0x40fba5['name']][_0x7af8('0x67')];}var _0x388335=new VoiceQueueSummary(_0x40fba5);return _0x388335['createReport'](_0xbe2344[_0x7af8('0xf')],this[_0x7af8('0xf')],_0x5f3285,this[_0x7af8('0xe')][_0x7af8('0x3b')]);};VoiceQueueReport[_0x7af8('0xa')]['handleInboundQueueSummaryReport']=function(_0x11b64c,_0xf32d4a){var _0x305b5b=this[_0x7af8('0x68')](_0x11b64c,_0xf32d4a);var _0x3015e9=![];_0x3015e9=_0x305b5b[_0x7af8('0x69')](_0x11b64c);if(_0x3015e9){Object[_0x7af8('0x6a')](_0x11b64c,_0x305b5b);this[_0x7af8('0xe')][_0x7af8('0x11')][_0x11b64c[_0x7af8('0x66')]]=_0x11b64c;this[_0x7af8('0x6b')](_0x305b5b);}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x1b')]=function(_0x23c178){var _0x52f0b0=null;var _0x42edd9=this['summary']['id'];if(this[_0x7af8('0x13')][_0x7af8('0x64')][_0x42edd9]){_0x52f0b0=this[_0x7af8('0x13')][_0x7af8('0x64')][_0x42edd9][_0x23c178[_0x7af8('0x63')]];}if(!_0x52f0b0){this[_0x7af8('0x13')]=initializeSummary();return;}var _0x4d6ad3=this[_0x7af8('0x11')][_0x52f0b0[_0x7af8('0x54')]];if(_0x4d6ad3[_0x7af8('0x6c')]===_0x7af8('0x5c')){this[_0x7af8('0x6d')](_0x4d6ad3,_0x52f0b0);}else if(_0x4d6ad3[_0x7af8('0x6c')]===_0x7af8('0x6e')){var _0x586c2f=this[_0x7af8('0x68')](_0x4d6ad3,_0x52f0b0);ami[_0x7af8('0x4e')](_0x7af8('0x6f'),_0x586c2f);}this[_0x7af8('0x13')]['statusRequests']-=0x1;var _0x546bd0=this['summary'][_0x7af8('0x70')]>0x0?!![]:![];if(!_0x546bd0){return this['syncQueueSummaryComplete'](this[_0x7af8('0x13')]['completeEvent']);}};VoiceQueueReport[_0x7af8('0xa')]['syncQueueMember']=function(_0x21c3ca){var _0x2b9b13=this[_0x7af8('0x13')]['id'];if(this[_0x7af8('0x13')][_0x7af8('0x64')][_0x2b9b13]&&this[_0x7af8('0x13')][_0x7af8('0x64')][_0x2b9b13][_0x21c3ca[_0x7af8('0x63')]]){this[_0x7af8('0x13')][_0x7af8('0x64')][_0x2b9b13][_0x21c3ca[_0x7af8('0x63')]][_0x7af8('0xf')][_0x7af8('0x71')](_0x21c3ca);}};VoiceQueueReport['prototype'][_0x7af8('0x15')]=function(_0x298803){var _0x3c30ec=this;try{if(this['isNotNull'](_0x298803)&&this[_0x7af8('0x72')](_0x298803[_0x7af8('0x54')])){logger[_0x7af8('0x50')]('[voiceQueueReport][queuesummary]\x20event:',util['inspect'](_0x298803,{'showHidden':![],'depth':null}));var _0x428d6d=this[_0x7af8('0x11')][_0x298803[_0x7af8('0x54')]];if(_0x428d6d){logger['debug']('[voiceQueueReport][queuesummary]\x20name:%s',_0x428d6d['name']);this[_0x7af8('0x13')]['queues'][_0x428d6d[_0x7af8('0x66')]]={'summaryEvent':_0x298803};this['summary'][_0x7af8('0x70')]+=0x1;return ami['Action']({'action':_0x7af8('0x64'),'queue':_0x428d6d[_0x7af8('0x66')]})['then'](function(_0x122e67){if(!_0x3c30ec[_0x7af8('0x13')][_0x7af8('0x64')][_0x298803['actionid']]){_0x3c30ec['summary']['queuestatus'][_0x298803[_0x7af8('0x63')]]={};}_0x3c30ec[_0x7af8('0x13')]['queuestatus'][_0x298803[_0x7af8('0x63')]][_0x122e67['actionid']]={'queue':_0x428d6d[_0x7af8('0x66')],'agents':[]};})['catch'](function(_0x21f5d1){throw _0x21f5d1;});}}}catch(_0x31974b){logger[_0x7af8('0x45')](_0x7af8('0x65'),util[_0x7af8('0x46')](_0x31974b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x16')]=function(_0x1f186e){if(this[_0x7af8('0x13')][_0x7af8('0x70')]>0x0){this[_0x7af8('0x13')][_0x7af8('0x73')]=_0x1f186e;return;}logger[_0x7af8('0x50')](_0x7af8('0x74'),util[_0x7af8('0x46')](_0x1f186e,{'showHidden':![],'depth':null}));this[_0x7af8('0x13')]=initializeSummary();ami[_0x7af8('0x4e')](_0x7af8('0x75'),{});};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x1d')]=function(_0x103dcb){try{if(this[_0x7af8('0x72')](_0x103dcb)){logger[_0x7af8('0x50')](_0x7af8('0x76'),_0x103dcb[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x103dcb,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x7af8('0x47')][_0x103dcb['uniqueid']])){this[_0x7af8('0x47')][_0x103dcb[_0x7af8('0x52')]]=[];}if(_[_0x7af8('0x5e')](this[_0x7af8('0x3b')][_0x103dcb[_0x7af8('0x52')]])){this[_0x7af8('0x3b')][_0x103dcb[_0x7af8('0x52')]]={};}var _0x5842bd=new QueueReport();_0x5842bd[_0x7af8('0x54')]=_0x103dcb[_0x7af8('0x54')];_0x5842bd[_0x7af8('0x6c')]=this[_0x7af8('0x11')][_0x5842bd[_0x7af8('0x54')]]&&this[_0x7af8('0x11')][_0x5842bd[_0x7af8('0x54')]][_0x7af8('0x6c')]?this[_0x7af8('0x11')][_0x5842bd[_0x7af8('0x54')]][_0x7af8('0x6c')]||_0x7af8('0x5c'):_0x7af8('0x5c');_0x5842bd[_0x7af8('0x77')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0x5842bd[_0x7af8('0x79')]=_0x103dcb[_0x7af8('0x79')];_0x5842bd[_0x7af8('0x7a')]=_0x103dcb[_0x7af8('0x7a')];_0x5842bd[_0x7af8('0x52')]=_0x103dcb['uniqueid'];_0x5842bd[_0x7af8('0x7b')]=this[_0x7af8('0x3b')][_0x103dcb[_0x7af8('0x52')]]['routealias'];logger['info'](_0x7af8('0x7c'),_0x5842bd[_0x7af8('0x54')],_0x5842bd[_0x7af8('0x6c')]);Object[_0x7af8('0x6a')](_0x5842bd,_[_0x7af8('0x7d')](_0x103dcb,_['keys'](_0x5842bd)));this[_0x7af8('0x47')][_0x103dcb['uniqueid']][_0x7af8('0x71')](_0x5842bd);this[_0x7af8('0x3b')][_0x103dcb[_0x7af8('0x52')]]=_0x5842bd;this[_0x7af8('0x4f')](_0x5842bd,'queuecallerjoin');}}catch(_0x1191a3){logger['error'](_0x7af8('0x76'),_0x103dcb['uniqueid'],util[_0x7af8('0x46')](_0x1191a3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7af8('0x7e')]=function(_0x29513e){try{if(this['isNotNull'](_0x29513e)){logger[_0x7af8('0x50')](_0x7af8('0x7f'),_0x29513e['uniqueid'],util[_0x7af8('0x46')](_0x29513e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x29513e[_0x7af8('0x52')]]){var _0xaeaaba=_['last'](this[_0x7af8('0x47')][_0x29513e['uniqueid']]);_0xaeaaba['queuecallercomplete']=![];_0xaeaaba['queuecallercompleteAt']=null;_0xaeaaba[_0x7af8('0x80')]=_0x29513e['holdtime'];_0xaeaaba['originalposition']=_0x29513e[_0x7af8('0x81')];_0xaeaaba['queuecallerabandon']=!![];_0xaeaaba[_0x7af8('0x82')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0xaeaaba[_0x7af8('0x58')]='ABANDONED';_0xaeaaba['lastAssignedTo']=null;logger['info'](_0x7af8('0x83'),_0xaeaaba['queue'],_0xaeaaba[_0x7af8('0x6c')]);this['channels'][_0x29513e[_0x7af8('0x52')]]=_0xaeaaba;this[_0x7af8('0x4c')](_0xaeaaba,_0x7af8('0x39'));}}}catch(_0xa22709){logger[_0x7af8('0x45')](_0x7af8('0x7f'),_0x29513e[_0x7af8('0x52')],util['inspect'](_0xa22709,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x1f')]=function(_0x1c768b){try{if(this[_0x7af8('0x72')](_0x1c768b)){logger[_0x7af8('0x50')](_0x7af8('0x84'),_0x1c768b[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x1c768b,{'showHidden':![],'depth':null}));if(this[_0x7af8('0x47')][_0x1c768b[_0x7af8('0x52')]]){var _0x3cb64a=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x1c768b[_0x7af8('0x52')]]);_0x3cb64a['queuecallerleaveAt']=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0x3cb64a[_0x7af8('0x86')]=_0x1c768b[_0x7af8('0x86')];_0x3cb64a[_0x7af8('0x87')]=_0x1c768b[_0x7af8('0x87')];logger[_0x7af8('0x88')](_0x7af8('0x89'),_0x3cb64a['queue'],_0x3cb64a[_0x7af8('0x6c')],_0x1c768b['connectedlinenum'],_0x1c768b['connectedlinename']);this[_0x7af8('0x3b')][_0x1c768b[_0x7af8('0x52')]]=_0x3cb64a;this[_0x7af8('0x4f')](_0x3cb64a,_0x7af8('0x1e'));}}}catch(_0x507215){logger[_0x7af8('0x45')]('[%s][voiceQueueReport][queuecallerleave]',_0x1c768b[_0x7af8('0x52')],util['inspect'](_0x507215,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7af8('0x23')]=function(_0x56d8e6){try{if(this[_0x7af8('0x72')](_0x56d8e6)){logger[_0x7af8('0x50')](_0x7af8('0x8a'),_0x56d8e6[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x56d8e6,{'showHidden':![],'depth':null}));if(this[_0x7af8('0x47')][_0x56d8e6['uniqueid']]){var _0x4f5c3c=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x56d8e6[_0x7af8('0x52')]]);_0x4f5c3c[_0x7af8('0x8b')]=!![];_0x4f5c3c[_0x7af8('0x58')]=_0x7af8('0x8c');logger[_0x7af8('0x88')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x4f5c3c[_0x7af8('0x54')],_0x4f5c3c[_0x7af8('0x6c')]);}}}catch(_0x328baf){logger[_0x7af8('0x45')](_0x7af8('0x8a'),_0x56d8e6[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x328baf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')]['syncAgentComplete']=function(_0x29b575){try{if(this['isNotNull'](_0x29b575)){logger[_0x7af8('0x50')](_0x7af8('0x8d'),_0x29b575[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x29b575,{'showHidden':![],'depth':null}));if(this[_0x7af8('0x47')][_0x29b575[_0x7af8('0x52')]]){var _0x5e959a=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x29b575[_0x7af8('0x52')]]);_0x5e959a[_0x7af8('0x39')]=![];_0x5e959a[_0x7af8('0x82')]=null;_0x5e959a[_0x7af8('0x8e')]=!![];_0x5e959a[_0x7af8('0x8f')]=_0x29b575[_0x7af8('0x90')];_0x5e959a['holdtime']=_0x29b575[_0x7af8('0x80')];_0x5e959a['queuecallercomplete']=!![];_0x5e959a[_0x7af8('0x91')]=![];_0x5e959a[_0x7af8('0x92')]=null;if(!_0x5e959a[_0x7af8('0x93')]){if(_0x29b575[_0x7af8('0x94')]==_0x7af8('0x93')){_0x5e959a[_0x7af8('0x58')]='COMPLETED';logger[_0x7af8('0x88')](_0x7af8('0x95'),_0x5e959a[_0x7af8('0x54')],_0x5e959a[_0x7af8('0x6c')]);}else{if(_[_0x7af8('0x96')](_0x29b575[_0x7af8('0x41')][_0x7af8('0x97')](),_0x7af8('0x98'))){if(this[_0x7af8('0x47')][_0x29b575[_0x7af8('0x99')]]){var _0x32cf54=_[_0x7af8('0x85')](this['queueReports'][_0x29b575[_0x7af8('0x99')]]);_0x32cf54[_0x7af8('0x8b')]=![];_0x32cf54[_0x7af8('0x91')]=!![];_0x32cf54['queuecallerexitAt']=moment(_0x5e959a[_0x7af8('0x77')])['add'](_0x29b575['holdtime'],_0x7af8('0x9a'))[_0x7af8('0x5a')](_0x7af8('0x78'));_0x32cf54[_0x7af8('0x58')]=_0x7af8('0x9b');_0x32cf54[_0x7af8('0x93')]=!![];_0x32cf54['transfertype']='FORWARD';_0x32cf54[_0x7af8('0x9c')]=_0x29b575[_0x7af8('0x9d')];_0x32cf54[_0x7af8('0x9e')]=_0x29b575[_0x7af8('0x52')];logger[_0x7af8('0x88')](_0x7af8('0x9f'),_0x32cf54[_0x7af8('0x54')],_0x32cf54[_0x7af8('0x6c')]);var _0x472974=this['queueReports'][_0x29b575[_0x7af8('0x99')]];this['queueReports'][_0x29b575[_0x7af8('0x99')]]=this[_0x7af8('0x47')][_0x29b575['uniqueid']];this[_0x7af8('0x47')][_0x29b575['uniqueid']]=_0x472974;}}else{_0x5e959a[_0x7af8('0x58')]='COMPLETEDBY'+_0x29b575['reason'][_0x7af8('0xa0')]();logger[_0x7af8('0x88')](_0x7af8('0xa1'),_0x5e959a[_0x7af8('0x54')],_0x5e959a['type'],_0x5e959a[_0x7af8('0x58')]);}}}this[_0x7af8('0x3b')][_0x29b575[_0x7af8('0x52')]]=_0x5e959a;}}}catch(_0x544488){logger[_0x7af8('0x45')](_0x7af8('0x8d'),_0x29b575[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x544488,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x25')]=function(_0x434e4f){try{if(this['isNotNull'](_0x434e4f)){logger['debug'](_0x7af8('0xa2'),_0x434e4f[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x434e4f,{'showHidden':![],'depth':null}));this[_0x7af8('0xa3')](_0x434e4f[_0x7af8('0x52')],_['keys'](_0x434e4f[_0x7af8('0xa4')])[0x0],_0x434e4f[_0x7af8('0xa5')]);if(this[_0x7af8('0x47')][_0x434e4f[_0x7af8('0x52')]]){var _0x5c857d=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x434e4f['uniqueid']]);if(_0x5c857d){if(this[_0x7af8('0x72')](_0x434e4f['variable'])&&this[_0x7af8('0x72')](_0x434e4f[_0x7af8('0xa4')][_0x7af8('0x64')])){switch(_0x434e4f[_0x7af8('0xa5')]){case _0x7af8('0xa6'):_0x5c857d['queuecallerexit']=![];_0x5c857d[_0x7af8('0x92')]=null;break;case _0x7af8('0xa7'):_0x5c857d[_0x7af8('0xa8')]=_0x7af8('0xa9');_0x5c857d[_0x7af8('0x91')]=!![];_0x5c857d[_0x7af8('0x92')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0x5c857d[_0x7af8('0xaa')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));logger['debug'](_0x7af8('0xab'),_0x434e4f[_0x7af8('0x52')],util['inspect'](_0x5c857d,{'showHidden':![],'depth':null}));ami[_0x7af8('0x4e')](_0x7af8('0xac'),_0x5c857d);break;default:_0x5c857d[_0x7af8('0x91')]=!![];_0x5c857d[_0x7af8('0x92')]=moment()['format'](_0x7af8('0x78'));_0x5c857d['queuecallerleaveAt']=moment()['format'](_0x7af8('0x78'));}_0x5c857d[_0x7af8('0x39')]=![];_0x5c857d[_0x7af8('0x82')]=null;_0x5c857d[_0x7af8('0x58')]=_0x434e4f['value'];this[_0x7af8('0x3b')][_0x434e4f[_0x7af8('0x52')]]=_0x5c857d;this['emitVoiceQueueChannelRemove'](_0x5c857d,'varset');}else if(this[_0x7af8('0x72')](_0x434e4f[_0x7af8('0xa4')])&&this['isNotNull'](_0x434e4f[_0x7af8('0xa4')]['queueposition'])){if(!_0x5c857d[_0x7af8('0x39')]){_0x5c857d['queuecallerexit']=!![];_0x5c857d[_0x7af8('0x92')]=moment()[_0x7af8('0x5a')](_0x7af8('0x78'));_0x5c857d[_0x7af8('0x58')]=_0x7af8('0xad');_0x5c857d[_0x7af8('0xaa')]=moment()['format'](_0x7af8('0x78'));this['channels'][_0x434e4f['uniqueid']]=_0x5c857d;}}logger[_0x7af8('0x88')](_0x7af8('0xae'),_0x434e4f[_0x7af8('0x52')],_0x5c857d['queue'],_0x5c857d[_0x7af8('0x6c')],_['keys'](_0x434e4f[_0x7af8('0xa4')])[0x0],_0x434e4f['value']);_0x5c857d[_0x7af8('0x14')]=this[_0x7af8('0x14')][_0x434e4f[_0x7af8('0x52')]];}}}}catch(_0x4c1593){logger['error'](_0x7af8('0xa2'),_0x434e4f['uniqueid'],util[_0x7af8('0x46')](_0x4c1593,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0xa3')]=function(_0x4915f0,_0x31b419,_0x522fc7){var _0x400b42=[_0x7af8('0xaf'),_0x7af8('0xb0'),_0x7af8('0xb1'),_0x7af8('0xb2'),_0x7af8('0xb3'),_0x7af8('0xb4'),'rtpaudioqosrtt',_0x7af8('0xb5'),_0x7af8('0xb6'),_0x7af8('0xb7'),'bridgepeer',_0x7af8('0xb8'),_0x7af8('0xb9'),_0x7af8('0xba'),_0x7af8('0xbb'),'memberlastcall',_0x7af8('0x90'),_0x7af8('0xbc'),_0x7af8('0xbd')];if(!_[_0x7af8('0x3e')](_0x31b419)&&!_[_0x7af8('0xbe')](_0x400b42,_0x31b419)){if(_['isUndefined'](this[_0x7af8('0x14')][_0x4915f0])){this[_0x7af8('0x14')][_0x4915f0]={};}this['variables'][_0x4915f0][_0x31b419]=_0x522fc7;}};VoiceQueueReport['prototype'][_0x7af8('0xbf')]=function(_0x1fabfa,_0x47a85b,_0x326ff8){try{var _0x5debd7={};if(this[_0x7af8('0x47')][_0x1fabfa]){for(var _0x3d41e9=0x0;_0x3d41e9<this['queueReports'][_0x1fabfa][_0x7af8('0xc0')];_0x3d41e9+=0x1){_0x5debd7=this[_0x7af8('0x47')][_0x1fabfa][_0x3d41e9];var _0x48be92=this[_0x7af8('0x11')][_0x5debd7[_0x7af8('0x54')]];if(_0x48be92){_0x48be92[_0x7af8('0xc1')]+=moment(_0x5debd7[_0x7af8('0xaa')])[_0x7af8('0xc2')](_0x5debd7[_0x7af8('0x77')],_0x7af8('0x9a'))||0x0;if(_0x326ff8&&_0x5debd7['queuecallerexitreason']===_0x7af8('0x59')){_0x5debd7[_0x7af8('0x58')]=_0x7af8('0x8c');}if(_0x3d41e9===this['queueReports'][_0x1fabfa][_0x7af8('0xc0')]-0x1){_0x48be92[_0x7af8('0xc3')]+=moment()[_0x7af8('0xc4')](0x0)[_0x7af8('0xc2')](_0x5debd7[_0x7af8('0x77')],'seconds');if(hasCallerLeftTheQueue(_0x5debd7)&&_0x5debd7[_0x7af8('0x58')]!=='ATTENDEDTRANSFER'){_0x48be92[_0x7af8('0xc5')]+=0x1;}if(_0x5debd7[_0x7af8('0x8b')]){_0x48be92[_0x7af8('0xc6')]+=0x1;_0x48be92[_0x7af8('0xc7')]+=moment()['milliseconds'](0x0)['diff'](_0x5debd7['queuecallerleaveAt'],_0x7af8('0x9a'));_0x5debd7['queuecallercompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5debd7[_0x7af8('0x91')]=![];_0x5debd7['queuecallerexitAt']=null;}if(_0x5debd7[_0x7af8('0x91')]&&_0x5debd7[_0x7af8('0x93')]!=!![]){_0x48be92[_0x7af8('0xc8')]+=0x1;_0x5debd7[_0x7af8('0xa8')]=_0x7af8('0xc8');logger[_0x7af8('0x50')](_0x7af8('0xc9'),_0x1fabfa,util[_0x7af8('0x46')](_0x5debd7,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerunmanaged',_0x5debd7);}if(_0x5debd7['queuecallerabandon']){_0x48be92[_0x7af8('0xca')]+=0x1;_0x5debd7[_0x7af8('0xa8')]=_0x7af8('0xca');logger[_0x7af8('0x50')](_0x7af8('0xcb'),_0x1fabfa,util[_0x7af8('0x46')](_0x5debd7,{'showHidden':![],'depth':null}));ami[_0x7af8('0x4e')]('custom:queuecallerabandon',_0x5debd7);}}else{_0x48be92[_0x7af8('0xc3')]+=_0x48be92[_0x7af8('0xc1')];}logger[_0x7af8('0x88')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x1fabfa,_0x5debd7[_0x7af8('0x54')],_0x5debd7[_0x7af8('0x6c')],_0x47a85b);this[_0x7af8('0x3b')][_0x1fabfa]=_0x5debd7;Object['assign'](this[_0x7af8('0x11')][_0x5debd7[_0x7af8('0x54')]],_0x48be92);if(_0x5debd7[_0x7af8('0xaa')]){this[_0x7af8('0x4c')](_0x5debd7,'hangup');}}}logger[_0x7af8('0x50')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x1fabfa,util[_0x7af8('0x46')](this[_0x7af8('0x47')][_0x1fabfa],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x5debd7)&&_0x5debd7[_0x7af8('0x58')]!=='ATTENDEDTRANSFER'){ami[_0x7af8('0x4e')](_0x7af8('0xcc'),this[_0x7af8('0x47')][_0x1fabfa]);if(this[_0x7af8('0x47')][_0x1fabfa]){delete this[_0x7af8('0x47')][_0x1fabfa];}if(this['channels'][_0x1fabfa]){delete this[_0x7af8('0x3b')][_0x1fabfa];}if(this[_0x7af8('0x14')][_0x1fabfa]){delete this['variables'][_0x1fabfa];}}}}catch(_0x377a59){logger[_0x7af8('0x45')]('[%s][voiceQueueReport][handleHangup]',_0x1fabfa,util['inspect'](_0x377a59,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x27')]=function(_0x3a4244){try{if(this[_0x7af8('0x72')](_0x3a4244)){logger['debug'](_0x7af8('0xcd'),_0x3a4244[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x3a4244,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3a4244[_0x7af8('0x52')]]){return this[_0x7af8('0xbf')](_0x3a4244[_0x7af8('0x52')],_0x3a4244[_0x7af8('0xce')],![]);}if(this[_0x7af8('0x47')][_0x3a4244['linkedid']]){if(_0x3a4244[_0x7af8('0xcf')]==='21'){return;}return this[_0x7af8('0xbf')](_0x3a4244['linkedid'],_0x3a4244['cause-txt'],!![]);}var _0x465838=Object['keys'](this['queueReports']);for(var _0x5b7b57=0x0;_0x5b7b57<_0x465838[_0x7af8('0xc0')];_0x5b7b57++){var _0x296b90=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x465838[_0x5b7b57]]);if(_0x296b90&&_0x296b90[_0x7af8('0xd0')]===_0x3a4244[_0x7af8('0x52')]){return this[_0x7af8('0xbf')](_0x296b90[_0x7af8('0x52')],_0x3a4244[_0x7af8('0xce')],!![]);}}if(!this['queueReports'][_0x3a4244[_0x7af8('0x52')]]){logger[_0x7af8('0x50')](_0x7af8('0xd1'),_0x3a4244[_0x7af8('0x52')]);if(this[_0x7af8('0x3b')][_0x3a4244[_0x7af8('0x52')]]){delete this[_0x7af8('0x3b')][_0x3a4244[_0x7af8('0x52')]];}if(this[_0x7af8('0x14')][_0x3a4244[_0x7af8('0x52')]]){delete this[_0x7af8('0x14')][_0x3a4244[_0x7af8('0x52')]];}}}}catch(_0x20558a){logger[_0x7af8('0x45')](_0x7af8('0xcd'),_0x3a4244['uniqueid'],util[_0x7af8('0x46')](_0x20558a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0xd2')]=function(_0x586fe3){try{if(this[_0x7af8('0x72')](_0x586fe3)){logger[_0x7af8('0x50')](_0x7af8('0xd3'),_0x586fe3[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x586fe3,{'showHidden':![],'depth':null}));var _0x165972;var _0xda8b94;var _0x108040;if(this['queueReports'][_0x586fe3[_0x7af8('0xd4')]]){_0x165972=_[_0x7af8('0x85')](this['queueReports'][_0x586fe3['transfereeuniqueid']]);_0x165972[_0x7af8('0x9c')]=_0x586fe3[_0x7af8('0xd5')];_0x165972['transferuniqueid']=_0x586fe3[_0x7af8('0xd6')];_0x165972[_0x7af8('0x58')]='ATTENDEDTRANSFER';_0x165972[_0x7af8('0x93')]=!![];_0x165972[_0x7af8('0xd7')]=_0x7af8('0xd8');if(this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd6')]]){_0x108040=this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd6')]];this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd6')]]=this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd4')]];this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd4')]]=_0x108040;_0xda8b94=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd4')]]);_0xda8b94['switch']=!![];}logger[_0x7af8('0x88')](_0x7af8('0xd9'),_0x586fe3['uniqueid'],_0x165972['queue'],_0x165972['type'],_0x165972['transferexten'],_0x165972[_0x7af8('0x9e')]);}else if(this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xda')]]){_0x165972=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xda')]]);_0x165972[_0x7af8('0x9c')]=_0x586fe3[_0x7af8('0xdb')];_0x165972[_0x7af8('0x9e')]=_0x586fe3['origtransfereruniqueid'];_0x165972[_0x7af8('0x58')]=_0x7af8('0x59');_0x165972[_0x7af8('0x93')]=!![];_0x165972[_0x7af8('0xd7')]=_0x7af8('0xd8');if(this['queueReports'][_0x586fe3['origtransfereruniqueid']]){_0x108040=this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xdc')]];this[_0x7af8('0x47')][_0x586fe3['origtransfereruniqueid']]=this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xda')]];this[_0x7af8('0x47')][_0x586fe3['transfertargetuniqueid']]=_0x108040;_0xda8b94=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x586fe3['transfertargetuniqueid']]);_0xda8b94[_0x7af8('0x3c')]=!![];}logger[_0x7af8('0x88')](_0x7af8('0xd9'),_0x586fe3[_0x7af8('0x52')],_0x165972[_0x7af8('0x54')],_0x165972[_0x7af8('0x6c')],_0x165972[_0x7af8('0x9c')],_0x165972[_0x7af8('0x9e')]);}else if(this[_0x7af8('0x47')][_0x586fe3['origtransfereruniqueid']]){_0x165972=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xdc')]]);_0x165972['transferexten']=_0x586fe3[_0x7af8('0xdb')];_0x165972[_0x7af8('0x9e')]=_0x586fe3[_0x7af8('0xdc')];_0x165972[_0x7af8('0x58')]=_0x7af8('0x59');_0x165972[_0x7af8('0x93')]=!![];_0x165972[_0x7af8('0xd7')]=_0x7af8('0xd8');_0x165972[_0x7af8('0x3c')]=!![];_0x165972[_0x7af8('0xd0')]=_0x586fe3['transfereeuniqueid'];}else if(this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd6')]]){_0x165972=_['last'](this[_0x7af8('0x47')][_0x586fe3[_0x7af8('0xd6')]]);_0x165972[_0x7af8('0x9c')]=_0x586fe3[_0x7af8('0xd5')];_0x165972[_0x7af8('0x9e')]=_0x586fe3[_0x7af8('0xd6')];_0x165972[_0x7af8('0x58')]=_0x7af8('0x59');_0x165972['transfer']=!![];_0x165972['transfertype']=_0x7af8('0xd8');_0x165972[_0x7af8('0x3c')]=!![];_0x165972['transferid']=_0x586fe3[_0x7af8('0xda')];}}}catch(_0x4b9f64){logger[_0x7af8('0x45')](_0x7af8('0xd3'),_0x586fe3['uniqueid'],util['inspect'](_0x4b9f64,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x2f')]=function(_0x1b5a3f){try{if(this[_0x7af8('0x72')](_0x1b5a3f)){logger[_0x7af8('0x50')]('[%s][voiceQueueReport][blindtransfer]',_0x1b5a3f[_0x7af8('0x52')],util['inspect'](_0x1b5a3f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1b5a3f[_0x7af8('0xd4')]]){var _0x53f63d=_[_0x7af8('0x85')](this[_0x7af8('0x47')][_0x1b5a3f[_0x7af8('0xd4')]]);_0x53f63d[_0x7af8('0x58')]=_0x7af8('0xdd');_0x53f63d[_0x7af8('0x93')]=!![];_0x53f63d[_0x7af8('0xd7')]=_0x7af8('0xde');_0x53f63d[_0x7af8('0x9c')]=_0x1b5a3f[_0x7af8('0xdf')];_0x53f63d['transferuniqueid']=_0x1b5a3f[_0x7af8('0xd4')];logger['info'](_0x7af8('0xe0'),_0x1b5a3f[_0x7af8('0x52')],_0x53f63d[_0x7af8('0x54')],_0x53f63d[_0x7af8('0x6c')],_0x53f63d[_0x7af8('0x9c')],_0x53f63d[_0x7af8('0x9e')]);this[_0x7af8('0x27')]({'event':_0x7af8('0xe1'),'uniqueid':_0x1b5a3f['transfereeuniqueid'],'context':_0x1b5a3f[_0x7af8('0xe2')],'channel':_0x1b5a3f[_0x7af8('0xe3')]});}}}catch(_0x44294c){logger['error']('[%s][voiceQueueReport][blindtransfer]',_0x1b5a3f[_0x7af8('0x52')],util['inspect'](_0x44294c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x2a')]=function(_0x436424){try{if(this[_0x7af8('0x72')](_0x436424)){logger[_0x7af8('0x50')](_0x7af8('0xe4'),_0x436424[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x436424,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x436424[_0x7af8('0x52')]]){var _0x3a78e2=_['last'](this['queueReports'][_0x436424[_0x7af8('0x52')]]);if(!_[_0x7af8('0x3e')](_0x3a78e2[_0x7af8('0xaa')])){_0x3a78e2[_0x7af8('0xe5')]=moment()['format'](_0x7af8('0x78'));logger[_0x7af8('0x88')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x436424['uniqueid'],_0x3a78e2[_0x7af8('0xe5')]);}}}}catch(_0x485a72){logger['error'](_0x7af8('0xe4'),_0x436424['uniqueid'],util[_0x7af8('0x46')](_0x485a72,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0x2c')]=function(_0xc71ee8){try{if(this[_0x7af8('0x72')](_0xc71ee8)){logger[_0x7af8('0x50')](_0x7af8('0xe6'),_0xc71ee8[_0x7af8('0x52')],util[_0x7af8('0x46')](_0xc71ee8,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xc71ee8[_0x7af8('0x52')]]){var _0x1441ec=_[_0x7af8('0x85')](this['queueReports'][_0xc71ee8[_0x7af8('0x52')]]);if(!_[_0x7af8('0x3e')](_0x1441ec[_0x7af8('0xe5')])){_0x1441ec[_0x7af8('0xe7')]+=moment()[_0x7af8('0xc4')](0x0)[_0x7af8('0xc2')](_0x1441ec[_0x7af8('0xe5')],'seconds');logger[_0x7af8('0x88')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0xc71ee8[_0x7af8('0x52')],_0x1441ec[_0x7af8('0xe7')]);delete _0x1441ec[_0x7af8('0xe5')];}}}}catch(_0x25bafd){logger[_0x7af8('0x45')](_0x7af8('0xe6'),_0xc71ee8[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x25bafd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7af8('0xa')][_0x7af8('0xe8')]=function(_0x11090f){try{if(this['isNotNull'](_0x11090f)){logger[_0x7af8('0x50')](_0x7af8('0xe9'),_0x11090f[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x11090f,{'showHidden':![],'depth':null}));if(_0x11090f[_0x7af8('0xea')][_0x7af8('0x97')]()===_0x7af8('0xeb')){_0x11090f[_0x7af8('0xec')]=_0x11090f['appdata']&&_0x11090f[_0x7af8('0xed')]['startsWith'](_0x7af8('0xee'))?_0x11090f[_0x7af8('0xed')]:(_0x11090f[_0x7af8('0xed')]||_0x11090f[_0x7af8('0xec')])[_0x7af8('0x97')]();if(_[_0x7af8('0x96')](_0x11090f[_0x7af8('0xec')]['toLowerCase'](),_0x7af8('0xef'))){logger[_0x7af8('0x88')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x11090f[_0x7af8('0x52')],_0x11090f[_0x7af8('0xea')],_0x11090f[_0x7af8('0xec')]);if(_[_0x7af8('0x5e')](this[_0x7af8('0x3b')][_0x11090f['uniqueid']]))this[_0x7af8('0x3b')][_0x11090f['uniqueid']]={};var _0x1a4cc5=_0x11090f[_0x7af8('0xec')]['split']('=');var _0x2d4bcc=_0x1a4cc5[0x0][_0x7af8('0x97')]()['match'](/cdr\((.*)\)/);if(_0x2d4bcc)this[_0x7af8('0x3b')][_0x11090f[_0x7af8('0x52')]][_0x2d4bcc[0x1]]=_0x1a4cc5[0x1];}}}}catch(_0x43bcb5){logger[_0x7af8('0x45')](_0x7af8('0xf0'),_0x11090f[_0x7af8('0x52')],util[_0x7af8('0x46')](_0x43bcb5,{'showHidden':![],'depth':null}));}};module[_0x7af8('0xf1')]=VoiceQueueReport;
\ No newline at end of file