Built motion from commit 092f8824.|2.5.49
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index cb16af7..028804f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x693f=['uniqueid','format','name','voice_queue_presence:save','emitVoiceQueueChannelRemove','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','inbound','strategy','answered','loggedIn','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','Trunk','active','callerid','Interval','debug','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','[voiceQueueReport][queues]','loopQueueSummary','flagQueueSummary','[voiceQueueReport][queuesummary]','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','available','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueSummaryComplete','[voiceQueueReport][queuesummarycomplete]\x20event:','type','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerjoin]','syncQueueCallerAbandon','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','syncAgentConnect','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','value','variable','queuestatus','CONTINUE','TIMEOUT','timeout','queuecallerleaveAt','custom:timeout','queueposition','EXITWITHKEY','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','[%s][voiceQueueReport][hangup]','length','seconds','milliseconds','diff','queuecallercompleteAt','lastevent','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','secondtransfereruniqueid','ATTENDED','transfereeuniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','[%s][voiceQueueReport][blindtransfer]','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','mohtime','[%s][voiceQueueReport][musiconholdstop]','exports','lodash','moment','util','md5','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','prototype','tail','queueReports','agents','channels','queueChannels','voiceQueues','campaigns','variables','syncQueueSummary','bind','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','enqueue','isNil','Action','channel','catch','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearqueuereport','emit','emitVoiceQueueChannelSave',']\x20sending\x20voice_queue_channel:save\x20event:'];(function(_0x1ce52,_0x23f160){var _0x12f287=function(_0x3c6ebe){while(--_0x3c6ebe){_0x1ce52['push'](_0x1ce52['shift']());}};_0x12f287(++_0x23f160);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xf693('0x0'));var moment=require(_0xf693('0x1'));var util=require(_0xf693('0x2'));var md5=require(_0xf693('0x3'));var Redis=require('ioredis');var config=require(_0xf693('0x4'));var logger=require(_0xf693('0x5'))(_0xf693('0x6'));var ami=require(_0xf693('0x7'));var QueueReport=require(_0xf693('0x8'));config[_0xf693('0x9')]=_[_0xf693('0xa')](config['redis'],{'host':_0xf693('0xb'),'port':0x18eb});var io=require(_0xf693('0xc'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xf693('0xd')]['enqueue']=function(_0x38e78a){this['tail']=this[_0xf693('0xe')]?this[_0xf693('0xe')]['finally'](_0x38e78a):_0x38e78a();};function VoiceQueueReport(_0x4b09d6){this['sequence']=new Sequence();this[_0xf693('0xf')]={};this['agents']=_0x4b09d6[_0xf693('0x10')];this[_0xf693('0x11')]=_0x4b09d6[_0xf693('0x12')];this[_0xf693('0x13')]=_0x4b09d6[_0xf693('0x13')];this['flagQueueSummary']=!![];this['campaigns']=_0x4b09d6[_0xf693('0x14')];this[_0xf693('0x15')]={};ami['on']('queuesummary',this[_0xf693('0x16')][_0xf693('0x17')](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete'][_0xf693('0x17')](this));ami['on'](_0xf693('0x18'),this[_0xf693('0x19')][_0xf693('0x17')](this));ami['on'](_0xf693('0x1a'),this['syncQueueCallerAbandon'][_0xf693('0x17')](this));ami['on'](_0xf693('0x1b'),this[_0xf693('0x1c')][_0xf693('0x17')](this));ami['on'](_0xf693('0x1d'),this[_0xf693('0x1e')]['bind'](this));ami['on']('agentconnect',this['syncAgentConnect'][_0xf693('0x17')](this));ami['on'](_0xf693('0x1f'),this[_0xf693('0x20')][_0xf693('0x17')](this));ami['on'](_0xf693('0x21'),this['syncHangup'][_0xf693('0x17')](this));ami['on'](_0xf693('0x22'),this[_0xf693('0x23')][_0xf693('0x17')](this));ami['on'](_0xf693('0x24'),this[_0xf693('0x25')][_0xf693('0x17')](this));ami['on'](_0xf693('0x26'),this['syncMusicOnHoldStop'][_0xf693('0x17')](this));ami['on'](_0xf693('0x27'),this[_0xf693('0x28')][_0xf693('0x17')](this));ami['on'](_0xf693('0x29'),this[_0xf693('0x2a')][_0xf693('0x17')](this));this['loopQueueSummary']();this[_0xf693('0x2b')]();}function clearChannels(_0x11ff68){if(!_[_0xf693('0x2c')](_0x11ff68)){for(var _0x414a3f in _0x11ff68){if(_0x11ff68['hasOwnProperty'](_0x414a3f)){delete _0x11ff68[_0x414a3f];}}}}function clearCampaigns(_0x950632){if(!_[_0xf693('0x2c')](_0x950632)){for(var _0xe7a396 in _0x950632){if(_0x950632[_0xf693('0x2d')](_0xe7a396)){_0x950632[_0xe7a396][_0xf693('0x2e')]=0x0;}}}}function clearVoiceQueues(_0xbbbf29){if(!_[_0xf693('0x2c')](_0xbbbf29)){for(var _0x423cda in _0xbbbf29){if(_0xbbbf29[_0xf693('0x2d')](_0x423cda)){_0xbbbf29[_0x423cda][_0xf693('0x2e')]=0x0;_0xbbbf29[_0x423cda]['talking']=0x0;_0xbbbf29[_0x423cda][_0xf693('0x2f')]=0x0;_0xbbbf29[_0x423cda][_0xf693('0x30')]=0x0;_0xbbbf29[_0x423cda][_0xf693('0x31')]=!![];}}}}function clearAgentBooked(_0x405f94){if(!_[_0xf693('0x2c')](_0x405f94)){for(var _0x7fdc22 in _0x405f94){if(_0x405f94[_0xf693('0x2d')](_0x7fdc22)){_0x405f94[_0x7fdc22][_0xf693('0x32')]=!![];}}}}VoiceQueueReport['prototype'][_0xf693('0x33')]=function(){var _0x3e6570=this;for(var _0x3580c5 in this[_0xf693('0x11')]){if(this['channels']['hasOwnProperty'](_0x3580c5)&&!this[_0xf693('0x11')][_0x3580c5][_0xf693('0x34')]){this['sequence'][_0xf693('0x35')](function(){if(!_[_0xf693('0x36')](_0x3e6570[_0xf693('0x11')][_0x3580c5])){return ami[_0xf693('0x37')]({'action':'status','channel':_0x3e6570[_0xf693('0x11')][_0x3580c5][_0xf693('0x38')]})[_0xf693('0x39')](function(_0x3a2ced){if(_0x3a2ced[_0xf693('0x3a')]===_0xf693('0x3b')){setTimeout(function(){if(_0x3e6570[_0xf693('0x11')][_0x3580c5]){delete _0x3e6570[_0xf693('0x11')][_0x3580c5];logger['error'](_0xf693('0x3c'),_0x3580c5,util[_0xf693('0x3d')](_0x3a2ced,{'showHidden':![],'depth':null}));}if(_0x3e6570[_0xf693('0xf')][_0x3580c5]){delete _0x3e6570[_0xf693('0xf')][_0x3580c5];logger[_0xf693('0x3e')](_0xf693('0x3f'),_0x3580c5,util['inspect'](_0x3a2ced,{'showHidden':![],'depth':null}));}if(_0x3e6570['variables'][_0x3580c5]){delete _0x3e6570[_0xf693('0x15')][_0x3580c5];logger[_0xf693('0x3e')](_0xf693('0x40'),_0x3580c5,util['inspect'](_0x3a2ced,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x23')]=function(){logger[_0xf693('0x3e')](_0xf693('0x41'));clearChannels(this[_0xf693('0x11')]);this['clearQueueReport'](this[_0xf693('0xf')]);clearAgentBooked(this[_0xf693('0x10')]);clearVoiceQueues(this[_0xf693('0x13')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0xf693('0xd')]['clearQueueReport']=function(_0x424b00){var _0x500df0=this;if(!_[_0xf693('0x2c')](_0x424b00)){for(var _0x111ab6 in _0x424b00){if(_0x424b00[_0xf693('0x2d')](_0x111ab6)){_0x500df0['emitVoiceQueueChannelRemove'](_0x424b00[_0x111ab6],_0xf693('0x42'));delete _0x424b00[_0x111ab6];}}}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x43')]=function(_0x4033ae,_0x3ef95a,_0x24c5d4){io['to'](_0x4033ae)[_0xf693('0x43')](_0x3ef95a,_0x24c5d4);};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x44')]=function(_0x4b9234,_0x244b29){logger['debug']('[%s][voiceQueueReport]['+_0x244b29+_0xf693('0x45'),_0x4b9234[_0xf693('0x46')],util[_0xf693('0x3d')](_0x4b9234,{'showHidden':![],'depth':null}));this['emit'](util[_0xf693('0x47')]('voice:queue:%s',_0x4b9234[_0xf693('0x48')]),'voice_queue_channel:save',_0x4b9234);io[_0xf693('0x43')](_0xf693('0x49'),_0x4b9234);};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x4a')]=function(_0x307bdf,_0x47bc1b){logger['debug']('[%s][voiceQueueReport]['+_0x47bc1b+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x307bdf[_0xf693('0x46')],util[_0xf693('0x3d')](_0x307bdf,{'showHidden':![],'depth':null}));this['emit'](util['format']('voice:queue:%s',_0x307bdf[_0xf693('0x48')]),_0xf693('0x4b'),_0x307bdf);io[_0xf693('0x43')](_0xf693('0x4c'),_0x307bdf);};VoiceQueueReport['prototype'][_0xf693('0x4d')]=function(_0x20323a,_0x24c08c){if(_0x20323a['type']===_0xf693('0x4e')){var _0x41d60a={'id':_0x20323a['id'],'name':_0x20323a['name'],'strategy':_0x20323a[_0xf693('0x4f')],'answered':_0x20323a[_0xf693('0x50')],'available':_0x20323a['available'],'loggedIn':_0x20323a[_0xf693('0x51')],'pTalking':_0x20323a[_0xf693('0x2f')],'sumBillable':_0x20323a['sumBillable'],'sumDuration':_0x20323a[_0xf693('0x52')],'sumHoldTime':_0x20323a[_0xf693('0x53')]||0x0,'talking':_0x20323a[_0xf693('0x54')],'total':_0x20323a[_0xf693('0x55')],'type':_0x20323a['type'],'unmanaged':_0x20323a[_0xf693('0x56')],'abandoned':_0x20323a[_0xf693('0x57')],'waiting':_0x20323a[_0xf693('0x30')]};if(_0x20323a[_0xf693('0x58')]){_0x41d60a[_0xf693('0x58')]={'id':_0x20323a[_0xf693('0x58')]['id'],'name':_0x20323a['Trunk'][_0xf693('0x48')],'active':_0x20323a[_0xf693('0x58')][_0xf693('0x59')],'callerid':_0x20323a[_0xf693('0x58')][_0xf693('0x5a')]};}if(_0x20323a['Interval']){_0x41d60a[_0xf693('0x5b')]={'id':_0x20323a[_0xf693('0x5b')]['id'],'name':_0x20323a['Interval'][_0xf693('0x48')]};}var _0x48189a=md5(JSON['stringify'](_0x41d60a));if(_0x20323a['md5']!==_0x48189a){_0x20323a[_0xf693('0x3')]=_0x48189a;logger[_0xf693('0x5c')](_0xf693('0x5d')+_0x24c08c+_0xf693('0x5e'),util['inspect'](_0x41d60a,{'showHidden':![],'depth':null}));this['emit'](util[_0xf693('0x47')]('voice:queue:%s',_0x41d60a[_0xf693('0x48')]),_0xf693('0x5f'),_0x41d60a);}}};VoiceQueueReport[_0xf693('0xd')]['isNotNull']=function(_0x39bb51){return _0x39bb51!==null&&!_[_0xf693('0x60')](_0x39bb51);};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x2b')]=function(){var _0x150edb=this;setInterval(function(){_0x150edb[_0xf693('0x33')]();ami['Action']({'action':'queues'})[_0xf693('0x39')](function(_0x4c257c){logger['error'](_0xf693('0x61'),util[_0xf693('0x3d')](_0x4c257c,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype'][_0xf693('0x62')]=function(){var _0x283918=this;setInterval(function(){if(_0x283918[_0xf693('0x63')]){return ami[_0xf693('0x37')]({'action':'queuesummary'})['then'](function(_0x3717a1){_0x283918[_0xf693('0x63')]=![];})[_0xf693('0x39')](function(_0x3c26a9){logger['error'](_0xf693('0x64'),util[_0xf693('0x3d')](_0x3c26a9,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0xf693('0x16')]=function(_0xa59522){try{if(this[_0xf693('0x65')](_0xa59522)&&this[_0xf693('0x65')](_0xa59522[_0xf693('0x66')])){logger[_0xf693('0x5c')](_0xf693('0x67'),util[_0xf693('0x3d')](_0xa59522,{'showHidden':![],'depth':null}));if(this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]]){logger[_0xf693('0x68')](_0xf693('0x69'),_0xa59522['queue']);var _0x46af17=_[_0xf693('0x6a')](this[_0xf693('0x11')],_0xf693('0x66'))[_0xa59522[_0xf693('0x66')]]||0x0;var _0x266161=_0x46af17-_0xa59522[_0xf693('0x6b')];if(this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]][_0xf693('0x30')]!==_[_0xf693('0x6c')](_0xa59522[_0xf693('0x6b')])||this['voiceQueues'][_0xa59522[_0xf693('0x66')]][_0xf693('0x51')]!==_[_0xf693('0x6c')](_0xa59522[_0xf693('0x6d')])||this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]][_0xf693('0x6e')]!==_[_0xf693('0x6c')](_0xa59522[_0xf693('0x6e')])||this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]][_0xf693('0x54')]!==_0x266161){this['voiceQueues'][_0xa59522[_0xf693('0x66')]][_0xf693('0x30')]=_[_0xf693('0x6c')](_0xa59522[_0xf693('0x6b')]);this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]]['loggedIn']=_[_0xf693('0x6c')](_0xa59522[_0xf693('0x6d')]);this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]][_0xf693('0x6e')]=_[_0xf693('0x6c')](_0xa59522[_0xf693('0x6e')]);this['voiceQueues'][_0xa59522['queue']][_0xf693('0x54')]=_0x266161>0x0?_0x266161:0x0;this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]][_0xf693('0x54')]=this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]][_0xf693('0x54')]>_['toNumber'](_0xa59522['loggedin'])?_[_0xf693('0x6c')](_0xa59522['loggedin']):this['voiceQueues'][_0xa59522['queue']][_0xf693('0x54')];this[_0xf693('0x4d')](this[_0xf693('0x13')][_0xa59522[_0xf693('0x66')]],'queuesummary');}logger[_0xf693('0x5c')](_0xf693('0x6f'),util[_0xf693('0x3d')](this[_0xf693('0x13')][_0xa59522['queue']],{'showHidden':![],'depth':null}));ami[_0xf693('0x43')](_0xf693('0x70'),this[_0xf693('0x13')][_0xa59522['queue']]);}}}catch(_0x53b9d3){logger[_0xf693('0x3e')](_0xf693('0x64'),util[_0xf693('0x3d')](_0x53b9d3,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf693('0x71')]=function(_0x25874d){logger['debug'](_0xf693('0x72'),util[_0xf693('0x3d')](_0x25874d,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x19')]=function(_0x347fa4){try{if(this['isNotNull'](_0x347fa4)){logger['debug']('[%s][voiceQueueReport][queuecallerjoin]',_0x347fa4[_0xf693('0x46')],util['inspect'](_0x347fa4,{'showHidden':![],'depth':null}));if(_[_0xf693('0x60')](this[_0xf693('0xf')][_0x347fa4[_0xf693('0x46')]])){this[_0xf693('0xf')][_0x347fa4[_0xf693('0x46')]]=[];this[_0xf693('0x11')][_0x347fa4[_0xf693('0x46')]]={};}var _0x1dcf87=new QueueReport();_0x1dcf87[_0xf693('0x48')]=_0x347fa4[_0xf693('0x66')];_0x1dcf87[_0xf693('0x73')]=this[_0xf693('0x13')][_0x1dcf87[_0xf693('0x48')]]&&this[_0xf693('0x13')][_0x1dcf87[_0xf693('0x48')]][_0xf693('0x73')]?this[_0xf693('0x13')][_0x1dcf87[_0xf693('0x48')]][_0xf693('0x73')]||_0xf693('0x4e'):_0xf693('0x4e');_0x1dcf87[_0xf693('0x66')]=_0x347fa4[_0xf693('0x66')];_0x1dcf87[_0xf693('0x74')]=moment()[_0xf693('0x47')](_0xf693('0x75'));_0x1dcf87[_0xf693('0x76')]=_0x347fa4[_0xf693('0x76')];_0x1dcf87['count']=_0x347fa4[_0xf693('0x77')];_0x1dcf87['uniqueid']=_0x347fa4[_0xf693('0x46')];logger[_0xf693('0x68')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x1dcf87['name'],_0x1dcf87[_0xf693('0x73')]);_[_0xf693('0x78')](_0x1dcf87,_[_0xf693('0x79')](_0x347fa4,_[_0xf693('0x7a')](_0x1dcf87)));this[_0xf693('0xf')][_0x347fa4[_0xf693('0x46')]][_0xf693('0x7b')](_0x1dcf87);this['channels'][_0x347fa4['uniqueid']]=_0x1dcf87;this[_0xf693('0x44')](_0x1dcf87,_0xf693('0x18'));}}catch(_0x2e5711){logger[_0xf693('0x3e')](_0xf693('0x7c'),_0x347fa4[_0xf693('0x46')],util[_0xf693('0x3d')](_0x2e5711,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x7d')]=function(_0x7c960d){try{if(this[_0xf693('0x65')](_0x7c960d)){logger['debug'](_0xf693('0x7e'),_0x7c960d[_0xf693('0x46')],util['inspect'](_0x7c960d,{'showHidden':![],'depth':null}));if(this[_0xf693('0xf')][_0x7c960d[_0xf693('0x46')]]){var _0x1050a3=_[_0xf693('0x7f')](this['queueReports'][_0x7c960d[_0xf693('0x46')]]);_0x1050a3[_0xf693('0x80')]=![];_0x1050a3['queuecallercompleteAt']=null;_0x1050a3['holdtime']=_0x7c960d[_0xf693('0x81')];_0x1050a3[_0xf693('0x82')]=_0x7c960d[_0xf693('0x82')];_0x1050a3[_0xf693('0x1a')]=!![];_0x1050a3[_0xf693('0x83')]=moment()[_0xf693('0x47')](_0xf693('0x75'));_0x1050a3[_0xf693('0x84')]=_0xf693('0x85');_0x1050a3[_0xf693('0x86')]=null;logger[_0xf693('0x68')](_0xf693('0x87'),_0x1050a3[_0xf693('0x48')],_0x1050a3[_0xf693('0x73')]);this[_0xf693('0x11')][_0x7c960d[_0xf693('0x46')]]=_0x1050a3;this[_0xf693('0x4a')](_0x1050a3,_0xf693('0x1a'));}}}catch(_0x5b5d04){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x7c960d[_0xf693('0x46')],util[_0xf693('0x3d')](_0x5b5d04,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf693('0x1c')]=function(_0x5c6cd7){try{if(this[_0xf693('0x65')](_0x5c6cd7)){logger[_0xf693('0x5c')](_0xf693('0x88'),_0x5c6cd7[_0xf693('0x46')],util[_0xf693('0x3d')](_0x5c6cd7,{'showHidden':![],'depth':null}));if(this[_0xf693('0xf')][_0x5c6cd7[_0xf693('0x46')]]){var _0x2f316c=_[_0xf693('0x7f')](this['queueReports'][_0x5c6cd7['uniqueid']]);_0x2f316c['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2f316c[_0xf693('0x89')]=_0x5c6cd7[_0xf693('0x89')];_0x2f316c['connectedlinename']=_0x5c6cd7[_0xf693('0x8a')];logger[_0xf693('0x68')](_0xf693('0x8b'),_0x2f316c[_0xf693('0x48')],_0x2f316c[_0xf693('0x73')],_0x5c6cd7[_0xf693('0x89')],_0x5c6cd7[_0xf693('0x8a')]);this['channels'][_0x5c6cd7[_0xf693('0x46')]]=_0x2f316c;this[_0xf693('0x44')](_0x2f316c,_0xf693('0x1b'));}}}catch(_0x39c642){logger[_0xf693('0x3e')](_0xf693('0x88'),_0x5c6cd7[_0xf693('0x46')],util[_0xf693('0x3d')](_0x39c642,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf693('0x8c')]=function(_0x4e584d){try{if(this['isNotNull'](_0x4e584d)){logger[_0xf693('0x5c')]('[%s][voiceQueueReport][agentconnect]',_0x4e584d[_0xf693('0x46')],util[_0xf693('0x3d')](_0x4e584d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4e584d[_0xf693('0x46')]]){var _0x34ecdc=_['last'](this['queueReports'][_0x4e584d[_0xf693('0x46')]]);_0x34ecdc[_0xf693('0x80')]=!![];_0x34ecdc['queuecallerexitreason']=_0xf693('0x8d');logger['info'](_0xf693('0x8e'),_0x34ecdc[_0xf693('0x48')],_0x34ecdc[_0xf693('0x73')]);}}}catch(_0x18870b){logger[_0xf693('0x3e')]('[%s][voiceQueueReport][agentconnect]',_0x4e584d['uniqueid'],util['inspect'](_0x18870b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x1e')]=function(_0x2c14c2){try{if(this[_0xf693('0x65')](_0x2c14c2)){logger[_0xf693('0x5c')](_0xf693('0x8f'),_0x2c14c2[_0xf693('0x46')],util[_0xf693('0x3d')](_0x2c14c2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x2c14c2['uniqueid']]){var _0x4a3919=_[_0xf693('0x7f')](this[_0xf693('0xf')][_0x2c14c2[_0xf693('0x46')]]);_0x4a3919['queuecallerabandon']=![];_0x4a3919['queuecallerabandonAt']=null;_0x4a3919['assigned']=!![];_0x4a3919['lastAssignedTo']=_0x2c14c2['membername'];_0x4a3919[_0xf693('0x81')]=_0x2c14c2[_0xf693('0x81')];_0x4a3919['queuecallercomplete']=!![];_0x4a3919[_0xf693('0x90')]=![];_0x4a3919[_0xf693('0x91')]=null;if(!_0x4a3919[_0xf693('0x92')]){if(_0x2c14c2[_0xf693('0x93')]==_0xf693('0x92')){_0x4a3919[_0xf693('0x84')]=_0xf693('0x94');logger[_0xf693('0x68')](_0xf693('0x95'),_0x4a3919[_0xf693('0x48')],_0x4a3919[_0xf693('0x73')]);}else{if(_[_0xf693('0x96')](_0x2c14c2[_0xf693('0x38')][_0xf693('0x97')](),_0xf693('0x98'))){if(this[_0xf693('0xf')][_0x2c14c2[_0xf693('0x99')]]){var _0x1256b8=_['last'](this[_0xf693('0xf')][_0x2c14c2[_0xf693('0x99')]]);_0x1256b8[_0xf693('0x80')]=![];_0x1256b8[_0xf693('0x90')]=!![];_0x1256b8['queuecallerexitAt']=moment(_0x4a3919[_0xf693('0x74')])['add'](_0x2c14c2[_0xf693('0x81')],'seconds')[_0xf693('0x47')](_0xf693('0x75'));_0x1256b8[_0xf693('0x84')]=_0xf693('0x9a');_0x1256b8['transfer']=!![];_0x1256b8[_0xf693('0x9b')]=_0xf693('0x9c');_0x1256b8[_0xf693('0x9d')]=_0x2c14c2[_0xf693('0x9e')];_0x1256b8[_0xf693('0x9f')]=_0x2c14c2['uniqueid'];logger[_0xf693('0x68')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x1256b8['name'],_0x1256b8['type']);var _0x48561b=this['queueReports'][_0x2c14c2[_0xf693('0x99')]];this[_0xf693('0xf')][_0x2c14c2[_0xf693('0x99')]]=this[_0xf693('0xf')][_0x2c14c2['uniqueid']];this['queueReports'][_0x2c14c2['uniqueid']]=_0x48561b;}}else{_0x4a3919[_0xf693('0x84')]=_0xf693('0xa0')+_0x2c14c2[_0xf693('0x93')][_0xf693('0xa1')]();logger[_0xf693('0x68')](_0xf693('0xa2'),_0x4a3919['name'],_0x4a3919[_0xf693('0x73')],_0x4a3919[_0xf693('0x84')]);}}}this[_0xf693('0x11')][_0x2c14c2[_0xf693('0x46')]]=_0x4a3919;this[_0xf693('0x4a')](_0x4a3919,'agentcomplete');}}}catch(_0x20b687){logger[_0xf693('0x3e')](_0xf693('0x8f'),_0x2c14c2[_0xf693('0x46')],util[_0xf693('0x3d')](_0x20b687,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x20')]=function(_0x23489d){try{if(this[_0xf693('0x65')](_0x23489d)){logger['debug'](_0xf693('0xa3'),_0x23489d['uniqueid'],util[_0xf693('0x3d')](_0x23489d,{'showHidden':![],'depth':null}));this[_0xf693('0xa4')](_0x23489d[_0xf693('0x46')],_['keys'](_0x23489d['variable'])[0x0],_0x23489d[_0xf693('0xa5')]);if(this[_0xf693('0xf')][_0x23489d['uniqueid']]){var _0x1b5981=_[_0xf693('0x7f')](this[_0xf693('0xf')][_0x23489d['uniqueid']]);if(_0x1b5981){if(this[_0xf693('0x65')](_0x23489d[_0xf693('0xa6')])&&this[_0xf693('0x65')](_0x23489d['variable'][_0xf693('0xa7')])){switch(_0x23489d[_0xf693('0xa5')]){case _0xf693('0xa8'):_0x1b5981['queuecallerexit']=![];_0x1b5981['queuecallerexitAt']=null;break;case _0xf693('0xa9'):_0x1b5981['lastevent']=_0xf693('0xaa');_0x1b5981[_0xf693('0x90')]=!![];_0x1b5981['queuecallerexitAt']=moment()[_0xf693('0x47')](_0xf693('0x75'));_0x1b5981[_0xf693('0xab')]=moment()[_0xf693('0x47')](_0xf693('0x75'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x23489d[_0xf693('0x46')],util['inspect'](_0x1b5981,{'showHidden':![],'depth':null}));ami[_0xf693('0x43')](_0xf693('0xac'),_0x1b5981);break;default:_0x1b5981['queuecallerexit']=!![];_0x1b5981[_0xf693('0x91')]=moment()[_0xf693('0x47')](_0xf693('0x75'));_0x1b5981[_0xf693('0xab')]=moment()[_0xf693('0x47')](_0xf693('0x75'));}_0x1b5981['queuecallerabandon']=![];_0x1b5981['queuecallerabandonAt']=null;_0x1b5981['queuecallerexitreason']=_0x23489d[_0xf693('0xa5')];this[_0xf693('0x11')][_0x23489d[_0xf693('0x46')]]=_0x1b5981;this[_0xf693('0x4a')](_0x1b5981,_0xf693('0x1f'));}else if(this[_0xf693('0x65')](_0x23489d[_0xf693('0xa6')])&&this[_0xf693('0x65')](_0x23489d[_0xf693('0xa6')][_0xf693('0xad')])){if(!_0x1b5981['queuecallerabandon']){_0x1b5981['queuecallerexit']=!![];_0x1b5981['queuecallerexitAt']=moment()['format'](_0xf693('0x75'));_0x1b5981[_0xf693('0x84')]=_0xf693('0xae');_0x1b5981[_0xf693('0xab')]=moment()[_0xf693('0x47')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xf693('0x11')][_0x23489d[_0xf693('0x46')]]=_0x1b5981;}}logger[_0xf693('0x68')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x23489d[_0xf693('0x46')],_0x1b5981['name'],_0x1b5981['type'],_['keys'](_0x23489d[_0xf693('0xa6')])[0x0],_0x23489d[_0xf693('0xa5')]);_0x1b5981[_0xf693('0x15')]=this[_0xf693('0x15')][_0x23489d[_0xf693('0x46')]];}}}}catch(_0x4a61e){logger[_0xf693('0x3e')](_0xf693('0xa3'),_0x23489d[_0xf693('0x46')],util['inspect'](_0x4a61e,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf693('0xa4')]=function(_0x2e4088,_0x27ce3d,_0xe84196){var _0x18784b=[_0xf693('0xaf'),_0xf693('0xb0'),_0xf693('0xb1'),_0xf693('0xb2'),_0xf693('0xb3'),_0xf693('0xb4'),_0xf693('0xb5'),_0xf693('0xb6'),_0xf693('0xb7'),'sipuri',_0xf693('0xb8'),_0xf693('0xb9'),'membercalls',_0xf693('0xba'),_0xf693('0xbb'),_0xf693('0xbc'),'membername',_0xf693('0xbd'),_0xf693('0xbe')];if(!_[_0xf693('0x36')](_0x27ce3d)&&!_[_0xf693('0xbf')](_0x18784b,_0x27ce3d)){if(_[_0xf693('0x60')](this[_0xf693('0x15')][_0x2e4088])){this[_0xf693('0x15')][_0x2e4088]={};}this[_0xf693('0x15')][_0x2e4088][_0x27ce3d]=_0xe84196;}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0xc0')]=function(_0xf09d5){try{if(this['isNotNull'](_0xf09d5)){logger[_0xf693('0x5c')](_0xf693('0xc1'),_0xf09d5['uniqueid'],util[_0xf693('0x3d')](_0xf09d5,{'showHidden':![],'depth':null}));if(this['queueReports'][_0xf09d5[_0xf693('0x46')]]){for(var _0x2d1287=0x0,_0x1fcfdf={};_0x2d1287<this[_0xf693('0xf')][_0xf09d5['uniqueid']][_0xf693('0xc2')];_0x2d1287+=0x1){_0x1fcfdf=this['queueReports'][_0xf09d5[_0xf693('0x46')]][_0x2d1287];if(this['voiceQueues'][_0x1fcfdf[_0xf693('0x66')]]){if(_0x1fcfdf[_0xf693('0x90')]&&_0x1fcfdf[_0xf693('0x92')]!=!![]){this[_0xf693('0x13')][_0x1fcfdf[_0xf693('0x66')]][_0xf693('0x56')]+=0x1;}if(_0x1fcfdf['queuecallerabandon']){this['voiceQueues'][_0x1fcfdf[_0xf693('0x66')]][_0xf693('0x57')]+=0x1;}this[_0xf693('0x13')][_0x1fcfdf[_0xf693('0x66')]][_0xf693('0x53')]+=moment(_0x1fcfdf[_0xf693('0xab')])['diff'](_0x1fcfdf[_0xf693('0x74')],_0xf693('0xc3'))||0x0;if(_0x2d1287===this[_0xf693('0xf')][_0xf09d5[_0xf693('0x46')]][_0xf693('0xc2')]-0x1){this[_0xf693('0x13')][_0x1fcfdf[_0xf693('0x66')]][_0xf693('0x52')]+=moment()[_0xf693('0xc4')](0x0)[_0xf693('0xc5')](_0x1fcfdf[_0xf693('0x74')],'seconds');this[_0xf693('0x13')][_0x1fcfdf[_0xf693('0x66')]][_0xf693('0x55')]+=0x1;if(_0x1fcfdf[_0xf693('0x80')]){this[_0xf693('0x13')][_0x1fcfdf[_0xf693('0x66')]]['answered']+=0x1;this[_0xf693('0x13')][_0x1fcfdf['queue']]['sumBillable']+=moment()[_0xf693('0xc4')](0x0)['diff'](_0x1fcfdf['queuecallerleaveAt'],_0xf693('0xc3'));_0x1fcfdf[_0xf693('0xc6')]=moment()[_0xf693('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x1fcfdf[_0xf693('0x90')]=![];_0x1fcfdf[_0xf693('0x91')]=null;}if(_0x1fcfdf['queuecallerexit']&&_0x1fcfdf['transfer']!=!![]){_0x1fcfdf[_0xf693('0xc7')]=_0xf693('0x56');logger[_0xf693('0x5c')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0xf09d5[_0xf693('0x46')],util[_0xf693('0x3d')](_0x1fcfdf,{'showHidden':![],'depth':null}));ami[_0xf693('0x43')](_0xf693('0xc8'),_0x1fcfdf);}if(_0x1fcfdf['queuecallerabandon']){_0x1fcfdf[_0xf693('0xc7')]=_0xf693('0x57');logger[_0xf693('0x5c')](_0xf693('0xc9'),_0xf09d5['uniqueid'],util[_0xf693('0x3d')](_0x1fcfdf,{'showHidden':![],'depth':null}));ami['emit'](_0xf693('0xca'),_0x1fcfdf);}}else{this[_0xf693('0x13')][_0x1fcfdf[_0xf693('0x66')]][_0xf693('0x52')]+=this[_0xf693('0x13')][_0x1fcfdf[_0xf693('0x66')]][_0xf693('0x53')];}logger[_0xf693('0x68')](_0xf693('0xcb'),_0xf09d5[_0xf693('0x46')],_0x1fcfdf[_0xf693('0x48')],_0x1fcfdf[_0xf693('0x73')],_0xf09d5[_0xf693('0xcc')]);this[_0xf693('0x11')][_0xf09d5[_0xf693('0x46')]]=_0x1fcfdf;this['emitVoiceQueueChannelRemove'](_0x1fcfdf,'hangup');this[_0xf693('0x4d')](this[_0xf693('0x13')][_0x1fcfdf['queue']],_0xf693('0x21'));}}logger['debug']('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0xf09d5[_0xf693('0x46')],util[_0xf693('0x3d')](this[_0xf693('0xf')][_0xf09d5[_0xf693('0x46')]],{'showHidden':![],'depth':null}));ami[_0xf693('0x43')](_0xf693('0xcd'),this[_0xf693('0xf')][_0xf09d5[_0xf693('0x46')]]);delete this['queueReports'][_0xf09d5[_0xf693('0x46')]];delete this[_0xf693('0x11')][_0xf09d5['uniqueid']];}if(this[_0xf693('0x15')][_0xf09d5[_0xf693('0x46')]]){delete this['variables'][_0xf09d5['uniqueid']];}}}catch(_0x4d00cc){logger[_0xf693('0x3e')](_0xf693('0xc1'),_0xf09d5[_0xf693('0x46')],util[_0xf693('0x3d')](_0x4d00cc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x28')]=function(_0x2c03a7){try{if(this['isNotNull'](_0x2c03a7)){logger[_0xf693('0x5c')](_0xf693('0xce'),_0x2c03a7['uniqueid'],util[_0xf693('0x3d')](_0x2c03a7,{'showHidden':![],'depth':null}));var _0x48d7ee;if(this[_0xf693('0xf')][_0x2c03a7['transfereeuniqueid']]){_0x48d7ee=_[_0xf693('0x7f')](this[_0xf693('0xf')][_0x2c03a7['transfereeuniqueid']]);_0x48d7ee['transferexten']=_0x2c03a7['secondtransfererexten'];_0x48d7ee[_0xf693('0x9f')]=_0x2c03a7[_0xf693('0xcf')];_0x48d7ee[_0xf693('0x84')]='ATTENDEDTRANSFER';_0x48d7ee['transfer']=!![];_0x48d7ee[_0xf693('0x9b')]=_0xf693('0xd0');if(this['queueReports'][_0x2c03a7[_0xf693('0xcf')]]){var _0x34d9a7=this[_0xf693('0xf')][_0x2c03a7[_0xf693('0xcf')]];this[_0xf693('0xf')][_0x2c03a7['secondtransfereruniqueid']]=this[_0xf693('0xf')][_0x2c03a7[_0xf693('0xd1')]];this[_0xf693('0xf')][_0x2c03a7[_0xf693('0xd1')]]=_0x34d9a7;var _0x136132=_[_0xf693('0x7f')](this['queueReports'][_0x2c03a7['transfereeuniqueid']]);_0x136132['switch']=!![];}logger[_0xf693('0x68')](_0xf693('0xd2'),_0x2c03a7[_0xf693('0x46')],_0x48d7ee[_0xf693('0x48')],_0x48d7ee[_0xf693('0x73')],_0x48d7ee['transferexten'],_0x48d7ee['transferuniqueid']);}else if(this[_0xf693('0xf')][_0x2c03a7[_0xf693('0xd3')]]){_0x48d7ee=_[_0xf693('0x7f')](this[_0xf693('0xf')][_0x2c03a7[_0xf693('0xd3')]]);_0x48d7ee[_0xf693('0x9d')]=_0x2c03a7[_0xf693('0xd4')];_0x48d7ee[_0xf693('0x9f')]=_0x2c03a7[_0xf693('0xd5')];_0x48d7ee['queuecallerexitreason']=_0xf693('0xd6');_0x48d7ee[_0xf693('0x92')]=!![];_0x48d7ee[_0xf693('0x9b')]=_0xf693('0xd0');if(this[_0xf693('0xf')][_0x2c03a7['origtransfereruniqueid']]){var _0x34d9a7=this[_0xf693('0xf')][_0x2c03a7[_0xf693('0xd5')]];this[_0xf693('0xf')][_0x2c03a7['origtransfereruniqueid']]=this[_0xf693('0xf')][_0x2c03a7['transfertargetuniqueid']];this[_0xf693('0xf')][_0x2c03a7[_0xf693('0xd3')]]=_0x34d9a7;var _0x136132=_['last'](this['queueReports'][_0x2c03a7[_0xf693('0xd3')]]);_0x136132[_0xf693('0x34')]=!![];}logger['info']('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x2c03a7[_0xf693('0x46')],_0x48d7ee[_0xf693('0x48')],_0x48d7ee[_0xf693('0x73')],_0x48d7ee['transferexten'],_0x48d7ee[_0xf693('0x9f')]);}}}catch(_0x1bfad5){logger[_0xf693('0x3e')](_0xf693('0xce'),_0x2c03a7[_0xf693('0x46')],util[_0xf693('0x3d')](_0x1bfad5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf693('0xd')][_0xf693('0x2a')]=function(_0x1a2aa2){try{if(this['isNotNull'](_0x1a2aa2)){logger[_0xf693('0x5c')](_0xf693('0xd7'),_0x1a2aa2[_0xf693('0x46')],util[_0xf693('0x3d')](_0x1a2aa2,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1a2aa2[_0xf693('0xd1')]]){var _0x30e573=_[_0xf693('0x7f')](this['queueReports'][_0x1a2aa2[_0xf693('0xd1')]]);_0x30e573[_0xf693('0x84')]='BLINDTRANSFER';_0x30e573[_0xf693('0x92')]=!![];_0x30e573['transfertype']='BLIND';_0x30e573[_0xf693('0x9d')]=_0x1a2aa2[_0xf693('0xd8')];_0x30e573['transferuniqueid']=_0x1a2aa2[_0xf693('0xd1')];logger[_0xf693('0x68')](_0xf693('0xd9'),_0x1a2aa2['uniqueid'],_0x30e573[_0xf693('0x48')],_0x30e573[_0xf693('0x73')],_0x30e573[_0xf693('0x9d')],_0x30e573[_0xf693('0x9f')]);this[_0xf693('0xc0')]({'event':_0xf693('0xda'),'uniqueid':_0x1a2aa2[_0xf693('0xd1')],'context':_0x1a2aa2[_0xf693('0xdb')],'channel':_0x1a2aa2['transfererchannel']});}}}catch(_0x1e70b1){logger[_0xf693('0x3e')](_0xf693('0xd7'),_0x1a2aa2[_0xf693('0x46')],util['inspect'](_0x1e70b1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf693('0xd')]['syncMusicOnHoldStart']=function(_0x345116){try{if(this[_0xf693('0x65')](_0x345116)){logger['debug'](_0xf693('0xdc'),_0x345116[_0xf693('0x46')],util['inspect'](_0x345116,{'showHidden':![],'depth':null}));if(this[_0xf693('0xf')][_0x345116['uniqueid']]){var _0x212290=_[_0xf693('0x7f')](this[_0xf693('0xf')][_0x345116['uniqueid']]);if(!_['isNil'](_0x212290[_0xf693('0xab')])){_0x212290[_0xf693('0xdd')]=moment()[_0xf693('0x47')](_0xf693('0x75'));logger[_0xf693('0x68')](_0xf693('0xde'),_0x345116['uniqueid'],_0x212290[_0xf693('0xdd')]);}}}}catch(_0x4096ec){logger[_0xf693('0x3e')](_0xf693('0xdc'),_0x345116[_0xf693('0x46')],util['inspect'](_0x4096ec,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf693('0xdf')]=function(_0x44f352){try{if(this[_0xf693('0x65')](_0x44f352)){logger[_0xf693('0x5c')]('[%s][voiceQueueReport][musiconholdstop]',_0x44f352[_0xf693('0x46')],util[_0xf693('0x3d')](_0x44f352,{'showHidden':![],'depth':null}));if(this[_0xf693('0xf')][_0x44f352[_0xf693('0x46')]]){var _0x2d9bf6=_[_0xf693('0x7f')](this[_0xf693('0xf')][_0x44f352[_0xf693('0x46')]]);if(!_['isNil'](_0x2d9bf6['mohstarttime'])){_0x2d9bf6[_0xf693('0xe0')]+=moment()[_0xf693('0xc4')](0x0)[_0xf693('0xc5')](_0x2d9bf6[_0xf693('0xdd')],'seconds');logger['info']('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x44f352[_0xf693('0x46')],_0x2d9bf6['mohtime']);delete _0x2d9bf6[_0xf693('0xdd')];}}}}catch(_0x4947f4){logger['error'](_0xf693('0xe1'),_0x44f352[_0xf693('0x46')],util[_0xf693('0x3d')](_0x4947f4,{'showHidden':![],'depth':null}));}};module[_0xf693('0xe2')]=VoiceQueueReport;
\ No newline at end of file
+var _0xc9b2=['emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_presence:remove','type','inbound','answered','available','sumBillable','sumDuration','sumHoldTime','unmanaged','abandoned','waiting','Trunk','active','callerid','Interval','[voiceQueueReport][','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','callers','toNumber','loggedIn','loggedin','queuesummary','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerabandon]','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','assigned','queuecallerexit','queuecallerexitAt','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','add','FORWARDTRANSFER','transfer','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','[%s][voiceQueueReport][agentcomplete]','addVariable','variable','value','queuestatus','CONTINUE','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','varset','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberlastcall','membername','memberpenalty','length','seconds','milliseconds','total','diff','custom:queuecallerunmanaged','lastevent','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','emitVoiceQueueSummary','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','syncBlindTransfer','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','lodash','moment','md5','../../../config/logger','../ami','../model/queueReport','redis','localhost','prototype','enqueue','tail','finally','queueReports','agents','channels','voiceQueues','flagQueueSummary','variables','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','bind','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','agentconnect','syncAgentConnect','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','isEmpty','hasOwnProperty','originated','talking','pTalking','queueStatusComplete','unlockRR','clearZombieChannels','switch','sequence','isNil','Action','status','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','clearQueueReport','campaigns','emitVoiceQueueChannelRemove','clearqueuereport'];(function(_0x2b8f84,_0x357313){var _0x3700b1=function(_0x4fab4a){while(--_0x4fab4a){_0x2b8f84['push'](_0x2b8f84['shift']());}};_0x3700b1(++_0x357313);}(_0xc9b2,0xa7));var _0x2c9b=function(_0x5e9d42,_0x5119da){_0x5e9d42=_0x5e9d42-0x0;var _0x3afa7c=_0xc9b2[_0x5e9d42];return _0x3afa7c;};'use strict';var _=require(_0x2c9b('0x0'));var moment=require(_0x2c9b('0x1'));var util=require('util');var md5=require(_0x2c9b('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x2c9b('0x3'))('ami');var ami=require(_0x2c9b('0x4'));var QueueReport=require(_0x2c9b('0x5'));config[_0x2c9b('0x6')]=_['defaults'](config[_0x2c9b('0x6')],{'host':_0x2c9b('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x2c9b('0x6')]));var Sequence=function(){};Sequence[_0x2c9b('0x8')][_0x2c9b('0x9')]=function(_0x3d7173){this['tail']=this[_0x2c9b('0xa')]?this[_0x2c9b('0xa')][_0x2c9b('0xb')](_0x3d7173):_0x3d7173();};function VoiceQueueReport(_0x58dcb7){this['sequence']=new Sequence();this[_0x2c9b('0xc')]={};this['agents']=_0x58dcb7[_0x2c9b('0xd')];this[_0x2c9b('0xe')]=_0x58dcb7['queueChannels'];this['voiceQueues']=_0x58dcb7[_0x2c9b('0xf')];this[_0x2c9b('0x10')]=!![];this['campaigns']=_0x58dcb7['campaigns'];this[_0x2c9b('0x11')]={};ami['on']('queuesummary',this[_0x2c9b('0x12')]['bind'](this));ami['on'](_0x2c9b('0x13'),this[_0x2c9b('0x14')]['bind'](this));ami['on'](_0x2c9b('0x15'),this[_0x2c9b('0x16')][_0x2c9b('0x17')](this));ami['on'](_0x2c9b('0x18'),this[_0x2c9b('0x19')]['bind'](this));ami['on'](_0x2c9b('0x1a'),this[_0x2c9b('0x1b')][_0x2c9b('0x17')](this));ami['on']('agentcomplete',this[_0x2c9b('0x1c')]['bind'](this));ami['on'](_0x2c9b('0x1d'),this[_0x2c9b('0x1e')][_0x2c9b('0x17')](this));ami['on']('varset',this[_0x2c9b('0x1f')][_0x2c9b('0x17')](this));ami['on'](_0x2c9b('0x20'),this[_0x2c9b('0x21')][_0x2c9b('0x17')](this));ami['on']('fullybooted',this['syncFullyBooted'][_0x2c9b('0x17')](this));ami['on'](_0x2c9b('0x22'),this[_0x2c9b('0x23')]['bind'](this));ami['on'](_0x2c9b('0x24'),this[_0x2c9b('0x25')][_0x2c9b('0x17')](this));ami['on'](_0x2c9b('0x26'),this[_0x2c9b('0x27')][_0x2c9b('0x17')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x2c9b('0x17')](this));this['loopQueueSummary']();this['loopQueueShow']();}function clearChannels(_0xe00ce9){if(!_[_0x2c9b('0x28')](_0xe00ce9)){for(var _0x5e0bee in _0xe00ce9){if(_0xe00ce9[_0x2c9b('0x29')](_0x5e0bee)){delete _0xe00ce9[_0x5e0bee];}}}}function clearCampaigns(_0xb106d4){if(!_[_0x2c9b('0x28')](_0xb106d4)){for(var _0x4259cc in _0xb106d4){if(_0xb106d4[_0x2c9b('0x29')](_0x4259cc)){_0xb106d4[_0x4259cc]['originated']=0x0;}}}}function clearVoiceQueues(_0x716269){if(!_[_0x2c9b('0x28')](_0x716269)){for(var _0x42efa3 in _0x716269){if(_0x716269[_0x2c9b('0x29')](_0x42efa3)){_0x716269[_0x42efa3][_0x2c9b('0x2a')]=0x0;_0x716269[_0x42efa3][_0x2c9b('0x2b')]=0x0;_0x716269[_0x42efa3][_0x2c9b('0x2c')]=0x0;_0x716269[_0x42efa3]['waiting']=0x0;_0x716269[_0x42efa3][_0x2c9b('0x2d')]=!![];}}}}function clearAgentBooked(_0x36cd31){if(!_[_0x2c9b('0x28')](_0x36cd31)){for(var _0x21fdf0 in _0x36cd31){if(_0x36cd31[_0x2c9b('0x29')](_0x21fdf0)){_0x36cd31[_0x21fdf0][_0x2c9b('0x2e')]=!![];}}}}VoiceQueueReport[_0x2c9b('0x8')][_0x2c9b('0x2f')]=function(){var _0xd194f=this;for(var _0x1adbff in this[_0x2c9b('0xe')]){if(this[_0x2c9b('0xe')][_0x2c9b('0x29')](_0x1adbff)&&!this['channels'][_0x1adbff][_0x2c9b('0x30')]){this[_0x2c9b('0x31')][_0x2c9b('0x9')](function(){if(!_[_0x2c9b('0x32')](_0xd194f[_0x2c9b('0xe')][_0x1adbff])){return ami[_0x2c9b('0x33')]({'action':_0x2c9b('0x34'),'channel':_0xd194f[_0x2c9b('0xe')][_0x1adbff]['channel']})[_0x2c9b('0x35')](function(_0x815702){if(_0x815702[_0x2c9b('0x36')]===_0x2c9b('0x37')){setTimeout(function(){if(_0xd194f[_0x2c9b('0xe')][_0x1adbff]){delete _0xd194f[_0x2c9b('0xe')][_0x1adbff];logger[_0x2c9b('0x38')](_0x2c9b('0x39'),_0x1adbff,util[_0x2c9b('0x3a')](_0x815702,{'showHidden':![],'depth':null}));}if(_0xd194f[_0x2c9b('0xc')][_0x1adbff]){delete _0xd194f[_0x2c9b('0xc')][_0x1adbff];logger[_0x2c9b('0x38')](_0x2c9b('0x3b'),_0x1adbff,util[_0x2c9b('0x3a')](_0x815702,{'showHidden':![],'depth':null}));}if(_0xd194f['variables'][_0x1adbff]){delete _0xd194f[_0x2c9b('0x11')][_0x1adbff];logger[_0x2c9b('0x38')](_0x2c9b('0x3c'),_0x1adbff,util['inspect'](_0x815702,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x2c9b('0x8')][_0x2c9b('0x3d')]=function(){logger['error']('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x2c9b('0xe')]);this[_0x2c9b('0x3e')](this[_0x2c9b('0xc')]);clearAgentBooked(this[_0x2c9b('0xd')]);clearVoiceQueues(this[_0x2c9b('0xf')]);clearCampaigns(this[_0x2c9b('0x3f')]);};VoiceQueueReport[_0x2c9b('0x8')][_0x2c9b('0x3e')]=function(_0x1168e4){var _0x2ffbd7=this;if(!_[_0x2c9b('0x28')](_0x1168e4)){for(var _0x47c238 in _0x1168e4){if(_0x1168e4[_0x2c9b('0x29')](_0x47c238)){_0x2ffbd7[_0x2c9b('0x40')](_0x1168e4[_0x47c238],_0x2c9b('0x41'));delete _0x1168e4[_0x47c238];}}}};VoiceQueueReport[_0x2c9b('0x8')][_0x2c9b('0x42')]=function(_0x3234d3,_0x3f0608,_0x22a642){io['to'](_0x3234d3)[_0x2c9b('0x42')](_0x3f0608,_0x22a642);};VoiceQueueReport[_0x2c9b('0x8')][_0x2c9b('0x43')]=function(_0x354d0a,_0x564dbf){logger[_0x2c9b('0x44')](_0x2c9b('0x45')+_0x564dbf+_0x2c9b('0x46'),_0x354d0a[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x354d0a,{'showHidden':![],'depth':null}));this[_0x2c9b('0x42')](util[_0x2c9b('0x48')](_0x2c9b('0x49'),_0x354d0a[_0x2c9b('0x4a')]),_0x2c9b('0x4b'),_0x354d0a);io[_0x2c9b('0x42')](_0x2c9b('0x4c'),_0x354d0a);};VoiceQueueReport[_0x2c9b('0x8')][_0x2c9b('0x40')]=function(_0x207587,_0xb8d151){logger['debug'](_0x2c9b('0x45')+_0xb8d151+_0x2c9b('0x4d'),_0x207587[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x207587,{'showHidden':![],'depth':null}));if(_0x207587[_0x2c9b('0x4e')]===_0x2c9b('0x4f'))return;this[_0x2c9b('0x42')](util[_0x2c9b('0x48')](_0x2c9b('0x49'),_0x207587[_0x2c9b('0x4a')]),'voice_queue_channel:remove',_0x207587);io[_0x2c9b('0x42')](_0x2c9b('0x50'),_0x207587);};VoiceQueueReport[_0x2c9b('0x8')]['emitVoiceQueueSummary']=function(_0x4530db,_0x245263){if(_0x4530db[_0x2c9b('0x51')]===_0x2c9b('0x52')){var _0x3a4780={'id':_0x4530db['id'],'name':_0x4530db[_0x2c9b('0x4a')],'strategy':_0x4530db['strategy'],'answered':_0x4530db[_0x2c9b('0x53')],'available':_0x4530db[_0x2c9b('0x54')],'loggedIn':_0x4530db['loggedIn'],'pTalking':_0x4530db[_0x2c9b('0x2c')],'sumBillable':_0x4530db[_0x2c9b('0x55')],'sumDuration':_0x4530db[_0x2c9b('0x56')],'sumHoldTime':_0x4530db[_0x2c9b('0x57')]||0x0,'talking':_0x4530db[_0x2c9b('0x2b')],'total':_0x4530db['total'],'type':_0x4530db[_0x2c9b('0x51')],'unmanaged':_0x4530db[_0x2c9b('0x58')],'abandoned':_0x4530db[_0x2c9b('0x59')],'waiting':_0x4530db[_0x2c9b('0x5a')]};if(_0x4530db[_0x2c9b('0x5b')]){_0x3a4780[_0x2c9b('0x5b')]={'id':_0x4530db[_0x2c9b('0x5b')]['id'],'name':_0x4530db[_0x2c9b('0x5b')][_0x2c9b('0x4a')],'active':_0x4530db[_0x2c9b('0x5b')][_0x2c9b('0x5c')],'callerid':_0x4530db[_0x2c9b('0x5b')][_0x2c9b('0x5d')]};}if(_0x4530db[_0x2c9b('0x5e')]){_0x3a4780[_0x2c9b('0x5e')]={'id':_0x4530db['Interval']['id'],'name':_0x4530db[_0x2c9b('0x5e')]['name']};}var _0x2994a7=md5(JSON['stringify'](_0x3a4780));if(_0x4530db[_0x2c9b('0x2')]!==_0x2994a7){_0x4530db[_0x2c9b('0x2')]=_0x2994a7;logger[_0x2c9b('0x44')](_0x2c9b('0x5f')+_0x245263+']\x20sending\x20voice_queue:save\x20event:',util[_0x2c9b('0x3a')](_0x3a4780,{'showHidden':![],'depth':null}));this['emit'](util[_0x2c9b('0x48')](_0x2c9b('0x49'),_0x3a4780['name']),_0x2c9b('0x60'),_0x3a4780);}}};VoiceQueueReport[_0x2c9b('0x8')][_0x2c9b('0x61')]=function(_0x5b3aca){return _0x5b3aca!==null&&!_[_0x2c9b('0x62')](_0x5b3aca);};VoiceQueueReport[_0x2c9b('0x8')]['loopQueueShow']=function(){var _0x4e2ef2=this;setInterval(function(){_0x4e2ef2[_0x2c9b('0x2f')]();ami[_0x2c9b('0x33')]({'action':_0x2c9b('0x63')})[_0x2c9b('0x35')](function(_0x3260ba){logger[_0x2c9b('0x38')](_0x2c9b('0x64'),util[_0x2c9b('0x3a')](_0x3260ba,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype']['loopQueueSummary']=function(){var _0x29ade0=this;setInterval(function(){if(_0x29ade0[_0x2c9b('0x10')]){return ami[_0x2c9b('0x33')]({'action':'queuesummary'})[_0x2c9b('0x65')](function(){_0x29ade0[_0x2c9b('0x10')]=![];})[_0x2c9b('0x35')](function(_0x5c754e){logger[_0x2c9b('0x38')](_0x2c9b('0x66'),util[_0x2c9b('0x3a')](_0x5c754e,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x2c9b('0x8')][_0x2c9b('0x12')]=function(_0x2fb1b5){try{if(this[_0x2c9b('0x61')](_0x2fb1b5)&&this[_0x2c9b('0x61')](_0x2fb1b5[_0x2c9b('0x67')])){logger[_0x2c9b('0x44')](_0x2c9b('0x68'),util[_0x2c9b('0x3a')](_0x2fb1b5,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x2fb1b5[_0x2c9b('0x67')]]){logger[_0x2c9b('0x69')](_0x2c9b('0x6a'),_0x2fb1b5[_0x2c9b('0x67')]);var _0x2f75ff=_['countBy'](this[_0x2c9b('0xe')],_0x2c9b('0x67'))[_0x2fb1b5[_0x2c9b('0x67')]]||0x0;var _0x3a1c1e=_0x2f75ff-_0x2fb1b5[_0x2c9b('0x6b')];if(this[_0x2c9b('0xf')][_0x2fb1b5['queue']][_0x2c9b('0x5a')]!==_[_0x2c9b('0x6c')](_0x2fb1b5['callers'])||this[_0x2c9b('0xf')][_0x2fb1b5['queue']]['loggedIn']!==_[_0x2c9b('0x6c')](_0x2fb1b5['loggedin'])||this['voiceQueues'][_0x2fb1b5[_0x2c9b('0x67')]][_0x2c9b('0x54')]!==_[_0x2c9b('0x6c')](_0x2fb1b5[_0x2c9b('0x54')])||this['voiceQueues'][_0x2fb1b5[_0x2c9b('0x67')]][_0x2c9b('0x2b')]!==_0x3a1c1e){this[_0x2c9b('0xf')][_0x2fb1b5[_0x2c9b('0x67')]][_0x2c9b('0x5a')]=_[_0x2c9b('0x6c')](_0x2fb1b5[_0x2c9b('0x6b')]);this['voiceQueues'][_0x2fb1b5[_0x2c9b('0x67')]][_0x2c9b('0x6d')]=_['toNumber'](_0x2fb1b5[_0x2c9b('0x6e')]);this[_0x2c9b('0xf')][_0x2fb1b5[_0x2c9b('0x67')]][_0x2c9b('0x54')]=_[_0x2c9b('0x6c')](_0x2fb1b5[_0x2c9b('0x54')]);this[_0x2c9b('0xf')][_0x2fb1b5[_0x2c9b('0x67')]][_0x2c9b('0x2b')]=_0x3a1c1e>0x0?_0x3a1c1e:0x0;this[_0x2c9b('0xf')][_0x2fb1b5[_0x2c9b('0x67')]][_0x2c9b('0x2b')]=this['voiceQueues'][_0x2fb1b5[_0x2c9b('0x67')]][_0x2c9b('0x2b')]>_[_0x2c9b('0x6c')](_0x2fb1b5[_0x2c9b('0x6e')])?_[_0x2c9b('0x6c')](_0x2fb1b5[_0x2c9b('0x6e')]):this[_0x2c9b('0xf')][_0x2fb1b5[_0x2c9b('0x67')]][_0x2c9b('0x2b')];this['emitVoiceQueueSummary'](this[_0x2c9b('0xf')][_0x2fb1b5[_0x2c9b('0x67')]],_0x2c9b('0x6f'));}logger[_0x2c9b('0x44')](_0x2c9b('0x70'),util[_0x2c9b('0x3a')](this['voiceQueues'][_0x2fb1b5[_0x2c9b('0x67')]],{'showHidden':![],'depth':null}));ami[_0x2c9b('0x42')](_0x2c9b('0x71'),this[_0x2c9b('0xf')][_0x2fb1b5['queue']]);}}}catch(_0x3e894e){logger[_0x2c9b('0x38')](_0x2c9b('0x66'),util['inspect'](_0x3e894e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2c9b('0x8')][_0x2c9b('0x14')]=function(_0x3b4fa2){logger['debug'](_0x2c9b('0x72'),util['inspect'](_0x3b4fa2,{'showHidden':![],'depth':null}));this[_0x2c9b('0x10')]=!![];};VoiceQueueReport[_0x2c9b('0x8')][_0x2c9b('0x16')]=function(_0x1ae215){try{if(this[_0x2c9b('0x61')](_0x1ae215)){logger[_0x2c9b('0x44')](_0x2c9b('0x73'),_0x1ae215[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x1ae215,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x2c9b('0xc')][_0x1ae215[_0x2c9b('0x47')]]))this['queueReports'][_0x1ae215['uniqueid']]=[];if(_[_0x2c9b('0x62')](this[_0x2c9b('0xe')][_0x1ae215[_0x2c9b('0x47')]]))this[_0x2c9b('0xe')][_0x1ae215['uniqueid']]={};var _0x547a82=new QueueReport();_0x547a82[_0x2c9b('0x4a')]=_0x1ae215[_0x2c9b('0x67')];_0x547a82['type']=this['voiceQueues'][_0x547a82['name']]&&this[_0x2c9b('0xf')][_0x547a82[_0x2c9b('0x4a')]][_0x2c9b('0x51')]?this[_0x2c9b('0xf')][_0x547a82[_0x2c9b('0x4a')]][_0x2c9b('0x51')]||_0x2c9b('0x52'):_0x2c9b('0x52');_0x547a82['queue']=_0x1ae215[_0x2c9b('0x67')];_0x547a82[_0x2c9b('0x74')]=moment()[_0x2c9b('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x547a82[_0x2c9b('0x75')]=_0x1ae215[_0x2c9b('0x75')];_0x547a82[_0x2c9b('0x76')]=_0x1ae215[_0x2c9b('0x76')];_0x547a82[_0x2c9b('0x47')]=_0x1ae215[_0x2c9b('0x47')];_0x547a82[_0x2c9b('0x77')]=this['channels'][_0x1ae215['uniqueid']]['routealias'];logger['info'](_0x2c9b('0x78'),_0x547a82[_0x2c9b('0x4a')],_0x547a82[_0x2c9b('0x51')]);_[_0x2c9b('0x79')](_0x547a82,_[_0x2c9b('0x7a')](_0x1ae215,_[_0x2c9b('0x7b')](_0x547a82)));this['queueReports'][_0x1ae215['uniqueid']][_0x2c9b('0x7c')](_0x547a82);this[_0x2c9b('0xe')][_0x1ae215[_0x2c9b('0x47')]]=_0x547a82;this['emitVoiceQueueChannelSave'](_0x547a82,_0x2c9b('0x15'));}}catch(_0x2dc4e6){logger[_0x2c9b('0x38')](_0x2c9b('0x73'),_0x1ae215[_0x2c9b('0x47')],util['inspect'](_0x2dc4e6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2c9b('0x8')]['syncQueueCallerAbandon']=function(_0x39e654){try{if(this[_0x2c9b('0x61')](_0x39e654)){logger[_0x2c9b('0x44')]('[%s][voiceQueueReport][queuecallerabandon]',_0x39e654[_0x2c9b('0x47')],util['inspect'](_0x39e654,{'showHidden':![],'depth':null}));if(this[_0x2c9b('0xc')][_0x39e654[_0x2c9b('0x47')]]){var _0x3df568=_[_0x2c9b('0x7d')](this[_0x2c9b('0xc')][_0x39e654[_0x2c9b('0x47')]]);_0x3df568[_0x2c9b('0x7e')]=![];_0x3df568[_0x2c9b('0x7f')]=null;_0x3df568[_0x2c9b('0x80')]=_0x39e654[_0x2c9b('0x80')];_0x3df568[_0x2c9b('0x81')]=_0x39e654['originalposition'];_0x3df568[_0x2c9b('0x18')]=!![];_0x3df568[_0x2c9b('0x82')]=moment()[_0x2c9b('0x48')](_0x2c9b('0x83'));_0x3df568[_0x2c9b('0x4e')]='ABANDONED';_0x3df568[_0x2c9b('0x84')]=null;logger[_0x2c9b('0x69')](_0x2c9b('0x85'),_0x3df568[_0x2c9b('0x4a')],_0x3df568[_0x2c9b('0x51')]);this[_0x2c9b('0xe')][_0x39e654[_0x2c9b('0x47')]]=_0x3df568;this[_0x2c9b('0x40')](_0x3df568,'queuecallerabandon');}}}catch(_0x370486){logger['error'](_0x2c9b('0x86'),_0x39e654[_0x2c9b('0x47')],util['inspect'](_0x370486,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2c9b('0x8')]['syncQueueCallerLeave']=function(_0x32e85a){try{if(this[_0x2c9b('0x61')](_0x32e85a)){logger[_0x2c9b('0x44')](_0x2c9b('0x87'),_0x32e85a[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x32e85a,{'showHidden':![],'depth':null}));if(this[_0x2c9b('0xc')][_0x32e85a[_0x2c9b('0x47')]]){var _0x1880f4=_[_0x2c9b('0x7d')](this[_0x2c9b('0xc')][_0x32e85a[_0x2c9b('0x47')]]);_0x1880f4[_0x2c9b('0x88')]=moment()['format'](_0x2c9b('0x83'));_0x1880f4[_0x2c9b('0x89')]=_0x32e85a[_0x2c9b('0x89')];_0x1880f4['connectedlinename']=_0x32e85a['connectedlinename'];logger[_0x2c9b('0x69')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1880f4[_0x2c9b('0x4a')],_0x1880f4[_0x2c9b('0x51')],_0x32e85a[_0x2c9b('0x89')],_0x32e85a[_0x2c9b('0x8a')]);this[_0x2c9b('0xe')][_0x32e85a[_0x2c9b('0x47')]]=_0x1880f4;this[_0x2c9b('0x43')](_0x1880f4,'queuecallerleave');}}}catch(_0x33c999){logger[_0x2c9b('0x38')](_0x2c9b('0x87'),_0x32e85a[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x33c999,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2c9b('0x1e')]=function(_0x1add8e){try{if(this['isNotNull'](_0x1add8e)){logger[_0x2c9b('0x44')](_0x2c9b('0x8b'),_0x1add8e[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x1add8e,{'showHidden':![],'depth':null}));if(this[_0x2c9b('0xc')][_0x1add8e['uniqueid']]){var _0x5be62b=_[_0x2c9b('0x7d')](this[_0x2c9b('0xc')][_0x1add8e[_0x2c9b('0x47')]]);_0x5be62b[_0x2c9b('0x7e')]=!![];_0x5be62b[_0x2c9b('0x4e')]=_0x2c9b('0x8c');logger[_0x2c9b('0x69')](_0x2c9b('0x8d'),_0x5be62b[_0x2c9b('0x4a')],_0x5be62b[_0x2c9b('0x51')]);}}}catch(_0x45df19){logger[_0x2c9b('0x38')](_0x2c9b('0x8b'),_0x1add8e[_0x2c9b('0x47')],util['inspect'](_0x45df19,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2c9b('0x8')][_0x2c9b('0x1c')]=function(_0x3c911e){try{if(this[_0x2c9b('0x61')](_0x3c911e)){logger[_0x2c9b('0x44')]('[%s][voiceQueueReport][agentcomplete]',_0x3c911e['uniqueid'],util[_0x2c9b('0x3a')](_0x3c911e,{'showHidden':![],'depth':null}));if(this[_0x2c9b('0xc')][_0x3c911e[_0x2c9b('0x47')]]){var _0x3f227c=_[_0x2c9b('0x7d')](this[_0x2c9b('0xc')][_0x3c911e[_0x2c9b('0x47')]]);_0x3f227c[_0x2c9b('0x18')]=![];_0x3f227c[_0x2c9b('0x82')]=null;_0x3f227c[_0x2c9b('0x8e')]=!![];_0x3f227c[_0x2c9b('0x84')]=_0x3c911e['membername'];_0x3f227c[_0x2c9b('0x80')]=_0x3c911e[_0x2c9b('0x80')];_0x3f227c['queuecallercomplete']=!![];_0x3f227c[_0x2c9b('0x8f')]=![];_0x3f227c[_0x2c9b('0x90')]=null;if(!_0x3f227c['transfer']){if(_0x3c911e[_0x2c9b('0x91')]=='transfer'){_0x3f227c[_0x2c9b('0x4e')]='COMPLETED';logger[_0x2c9b('0x69')](_0x2c9b('0x92'),_0x3f227c[_0x2c9b('0x4a')],_0x3f227c[_0x2c9b('0x51')]);}else{if(_[_0x2c9b('0x93')](_0x3c911e[_0x2c9b('0x94')][_0x2c9b('0x95')](),_0x2c9b('0x96'))){if(this[_0x2c9b('0xc')][_0x3c911e[_0x2c9b('0x97')]]){var _0x1ea9b3=_[_0x2c9b('0x7d')](this[_0x2c9b('0xc')][_0x3c911e[_0x2c9b('0x97')]]);_0x1ea9b3[_0x2c9b('0x7e')]=![];_0x1ea9b3['queuecallerexit']=!![];_0x1ea9b3[_0x2c9b('0x90')]=moment(_0x3f227c[_0x2c9b('0x74')])[_0x2c9b('0x98')](_0x3c911e[_0x2c9b('0x80')],'seconds')[_0x2c9b('0x48')](_0x2c9b('0x83'));_0x1ea9b3[_0x2c9b('0x4e')]=_0x2c9b('0x99');_0x1ea9b3[_0x2c9b('0x9a')]=!![];_0x1ea9b3[_0x2c9b('0x9b')]=_0x2c9b('0x9c');_0x1ea9b3[_0x2c9b('0x9d')]=_0x3c911e[_0x2c9b('0x9e')];_0x1ea9b3[_0x2c9b('0x9f')]=_0x3c911e['uniqueid'];logger[_0x2c9b('0x69')](_0x2c9b('0xa0'),_0x1ea9b3[_0x2c9b('0x4a')],_0x1ea9b3[_0x2c9b('0x51')]);var _0x559f0b=this[_0x2c9b('0xc')][_0x3c911e[_0x2c9b('0x97')]];this[_0x2c9b('0xc')][_0x3c911e[_0x2c9b('0x97')]]=this[_0x2c9b('0xc')][_0x3c911e[_0x2c9b('0x47')]];this['queueReports'][_0x3c911e[_0x2c9b('0x47')]]=_0x559f0b;}}else{_0x3f227c[_0x2c9b('0x4e')]='COMPLETEDBY'+_0x3c911e['reason']['toUpperCase']();logger[_0x2c9b('0x69')](_0x2c9b('0xa1'),_0x3f227c['name'],_0x3f227c['type'],_0x3f227c[_0x2c9b('0x4e')]);}}}this[_0x2c9b('0xe')][_0x3c911e['uniqueid']]=_0x3f227c;this['emitVoiceQueueChannelRemove'](_0x3f227c,_0x2c9b('0xa2'));}}}catch(_0x7ef71){logger['error'](_0x2c9b('0xa3'),_0x3c911e['uniqueid'],util['inspect'](_0x7ef71,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2c9b('0x8')]['syncVarSet']=function(_0x2acb2b){try{if(this[_0x2c9b('0x61')](_0x2acb2b)){logger[_0x2c9b('0x44')]('[%s][voiceQueueReport][varset]',_0x2acb2b[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x2acb2b,{'showHidden':![],'depth':null}));this[_0x2c9b('0xa4')](_0x2acb2b[_0x2c9b('0x47')],_[_0x2c9b('0x7b')](_0x2acb2b[_0x2c9b('0xa5')])[0x0],_0x2acb2b[_0x2c9b('0xa6')]);if(this[_0x2c9b('0xc')][_0x2acb2b[_0x2c9b('0x47')]]){var _0x299f55=_[_0x2c9b('0x7d')](this[_0x2c9b('0xc')][_0x2acb2b[_0x2c9b('0x47')]]);if(_0x299f55){if(this[_0x2c9b('0x61')](_0x2acb2b[_0x2c9b('0xa5')])&&this[_0x2c9b('0x61')](_0x2acb2b[_0x2c9b('0xa5')][_0x2c9b('0xa7')])){switch(_0x2acb2b[_0x2c9b('0xa6')]){case _0x2c9b('0xa8'):_0x299f55['queuecallerexit']=![];_0x299f55['queuecallerexitAt']=null;break;case'TIMEOUT':_0x299f55['lastevent']=_0x2c9b('0xa9');_0x299f55['queuecallerexit']=!![];_0x299f55[_0x2c9b('0x90')]=moment()[_0x2c9b('0x48')](_0x2c9b('0x83'));_0x299f55[_0x2c9b('0x88')]=moment()[_0x2c9b('0x48')](_0x2c9b('0x83'));logger[_0x2c9b('0x44')](_0x2c9b('0xaa'),_0x2acb2b[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x299f55,{'showHidden':![],'depth':null}));ami[_0x2c9b('0x42')](_0x2c9b('0xab'),_0x299f55);break;default:_0x299f55[_0x2c9b('0x8f')]=!![];_0x299f55[_0x2c9b('0x90')]=moment()[_0x2c9b('0x48')](_0x2c9b('0x83'));_0x299f55['queuecallerleaveAt']=moment()['format'](_0x2c9b('0x83'));}_0x299f55[_0x2c9b('0x18')]=![];_0x299f55[_0x2c9b('0x82')]=null;_0x299f55[_0x2c9b('0x4e')]=_0x2acb2b[_0x2c9b('0xa6')];this[_0x2c9b('0xe')][_0x2acb2b['uniqueid']]=_0x299f55;this['emitVoiceQueueChannelRemove'](_0x299f55,_0x2c9b('0xac'));}else if(this[_0x2c9b('0x61')](_0x2acb2b[_0x2c9b('0xa5')])&&this[_0x2c9b('0x61')](_0x2acb2b[_0x2c9b('0xa5')][_0x2c9b('0xad')])){if(!_0x299f55[_0x2c9b('0x18')]){_0x299f55[_0x2c9b('0x8f')]=!![];_0x299f55[_0x2c9b('0x90')]=moment()[_0x2c9b('0x48')](_0x2c9b('0x83'));_0x299f55[_0x2c9b('0x4e')]=_0x2c9b('0xae');_0x299f55[_0x2c9b('0x88')]=moment()['format'](_0x2c9b('0x83'));this[_0x2c9b('0xe')][_0x2acb2b['uniqueid']]=_0x299f55;}}logger['info'](_0x2c9b('0xaf'),_0x2acb2b[_0x2c9b('0x47')],_0x299f55[_0x2c9b('0x4a')],_0x299f55[_0x2c9b('0x51')],_[_0x2c9b('0x7b')](_0x2acb2b[_0x2c9b('0xa5')])[0x0],_0x2acb2b[_0x2c9b('0xa6')]);_0x299f55[_0x2c9b('0x11')]=this['variables'][_0x2acb2b[_0x2c9b('0x47')]];}}}}catch(_0x32f9a0){logger[_0x2c9b('0x38')](_0x2c9b('0xb0'),_0x2acb2b[_0x2c9b('0x47')],util['inspect'](_0x32f9a0,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2c9b('0xa4')]=function(_0x105f1a,_0x10d7ce,_0xf4159d){var _0x34a0d0=[_0x2c9b('0xb1'),_0x2c9b('0xb2'),'rtpaudioqosjitter',_0x2c9b('0xb3'),_0x2c9b('0xb4'),_0x2c9b('0xb5'),'rtpaudioqosrtt',_0x2c9b('0xb6'),_0x2c9b('0xb7'),'sipuri',_0x2c9b('0xb8'),_0x2c9b('0xb9'),_0x2c9b('0xba'),'memberdynamic','memberinterface',_0x2c9b('0xbb'),_0x2c9b('0xbc'),_0x2c9b('0xbd'),'memberrealtime'];if(!_[_0x2c9b('0x32')](_0x10d7ce)&&!_['includes'](_0x34a0d0,_0x10d7ce)){if(_[_0x2c9b('0x62')](this[_0x2c9b('0x11')][_0x105f1a])){this[_0x2c9b('0x11')][_0x105f1a]={};}this[_0x2c9b('0x11')][_0x105f1a][_0x10d7ce]=_0xf4159d;}};VoiceQueueReport[_0x2c9b('0x8')]['syncHangup']=function(_0x4467cc){try{if(this['isNotNull'](_0x4467cc)){logger[_0x2c9b('0x44')]('[%s][voiceQueueReport][hangup]',_0x4467cc[_0x2c9b('0x47')],util['inspect'](_0x4467cc,{'showHidden':![],'depth':null}));if(this[_0x2c9b('0xc')][_0x4467cc['uniqueid']]){for(var _0x2d91ef=0x0,_0x25821e={};_0x2d91ef<this[_0x2c9b('0xc')][_0x4467cc['uniqueid']][_0x2c9b('0xbe')];_0x2d91ef+=0x1){_0x25821e=this[_0x2c9b('0xc')][_0x4467cc[_0x2c9b('0x47')]][_0x2d91ef];if(this['voiceQueues'][_0x25821e['queue']]){if(_0x25821e[_0x2c9b('0x8f')]&&_0x25821e[_0x2c9b('0x9a')]!=!![]){this[_0x2c9b('0xf')][_0x25821e[_0x2c9b('0x67')]][_0x2c9b('0x58')]+=0x1;}if(_0x25821e['queuecallerabandon']){this[_0x2c9b('0xf')][_0x25821e[_0x2c9b('0x67')]]['abandoned']+=0x1;}this[_0x2c9b('0xf')][_0x25821e[_0x2c9b('0x67')]][_0x2c9b('0x57')]+=moment(_0x25821e[_0x2c9b('0x88')])['diff'](_0x25821e[_0x2c9b('0x74')],_0x2c9b('0xbf'))||0x0;if(_0x2d91ef===this[_0x2c9b('0xc')][_0x4467cc[_0x2c9b('0x47')]][_0x2c9b('0xbe')]-0x1){this[_0x2c9b('0xf')][_0x25821e[_0x2c9b('0x67')]][_0x2c9b('0x56')]+=moment()[_0x2c9b('0xc0')](0x0)['diff'](_0x25821e[_0x2c9b('0x74')],_0x2c9b('0xbf'));this[_0x2c9b('0xf')][_0x25821e[_0x2c9b('0x67')]][_0x2c9b('0xc1')]+=0x1;if(_0x25821e['queuecallercomplete']){this[_0x2c9b('0xf')][_0x25821e[_0x2c9b('0x67')]][_0x2c9b('0x53')]+=0x1;this[_0x2c9b('0xf')][_0x25821e[_0x2c9b('0x67')]][_0x2c9b('0x55')]+=moment()['milliseconds'](0x0)[_0x2c9b('0xc2')](_0x25821e[_0x2c9b('0x88')],'seconds');_0x25821e[_0x2c9b('0x7f')]=moment()[_0x2c9b('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x25821e[_0x2c9b('0x8f')]=![];_0x25821e[_0x2c9b('0x90')]=null;}if(_0x25821e[_0x2c9b('0x8f')]&&_0x25821e[_0x2c9b('0x9a')]!=!![]){_0x25821e['lastevent']=_0x2c9b('0x58');logger[_0x2c9b('0x44')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x4467cc['uniqueid'],util[_0x2c9b('0x3a')](_0x25821e,{'showHidden':![],'depth':null}));ami[_0x2c9b('0x42')](_0x2c9b('0xc3'),_0x25821e);}if(_0x25821e[_0x2c9b('0x18')]){_0x25821e[_0x2c9b('0xc4')]='abandoned';logger[_0x2c9b('0x44')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x4467cc[_0x2c9b('0x47')],util['inspect'](_0x25821e,{'showHidden':![],'depth':null}));ami[_0x2c9b('0x42')]('custom:queuecallerabandon',_0x25821e);}}else{this[_0x2c9b('0xf')][_0x25821e[_0x2c9b('0x67')]][_0x2c9b('0x56')]+=this[_0x2c9b('0xf')][_0x25821e['queue']][_0x2c9b('0x57')];}logger[_0x2c9b('0x69')](_0x2c9b('0xc5'),_0x4467cc[_0x2c9b('0x47')],_0x25821e['name'],_0x25821e[_0x2c9b('0x51')],_0x4467cc[_0x2c9b('0xc6')]);this['channels'][_0x4467cc[_0x2c9b('0x47')]]=_0x25821e;this[_0x2c9b('0x40')](_0x25821e,'hangup');this[_0x2c9b('0xc7')](this['voiceQueues'][_0x25821e[_0x2c9b('0x67')]],'hangup');}}logger['debug'](_0x2c9b('0xc8'),_0x4467cc[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](this['queueReports'][_0x4467cc['uniqueid']],{'showHidden':![],'depth':null}));ami['emit'](_0x2c9b('0xc9'),this[_0x2c9b('0xc')][_0x4467cc[_0x2c9b('0x47')]]);if(_0x25821e['queuecallerexitreason']===_0x2c9b('0x4f'))return;delete this[_0x2c9b('0xc')][_0x4467cc[_0x2c9b('0x47')]];delete this[_0x2c9b('0xe')][_0x4467cc[_0x2c9b('0x47')]];}if(this[_0x2c9b('0x11')][_0x4467cc[_0x2c9b('0x47')]]){delete this[_0x2c9b('0x11')][_0x4467cc[_0x2c9b('0x47')]];}}}catch(_0x4fe50e){logger[_0x2c9b('0x38')](_0x2c9b('0xca'),_0x4467cc[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x4fe50e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2c9b('0x8')][_0x2c9b('0x27')]=function(_0x4d69a5){try{if(this['isNotNull'](_0x4d69a5)){logger[_0x2c9b('0x44')](_0x2c9b('0xcb'),_0x4d69a5[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x4d69a5,{'showHidden':![],'depth':null}));var _0x4948b1;var _0x2b0f83;var _0x113879;if(this[_0x2c9b('0xc')][_0x4d69a5[_0x2c9b('0xcc')]]){_0x4948b1=_[_0x2c9b('0x7d')](this[_0x2c9b('0xc')][_0x4d69a5[_0x2c9b('0xcc')]]);_0x4948b1['transferexten']=_0x4d69a5[_0x2c9b('0xcd')];_0x4948b1[_0x2c9b('0x9f')]=_0x4d69a5[_0x2c9b('0xce')];_0x4948b1[_0x2c9b('0x4e')]='ATTENDEDTRANSFER';_0x4948b1[_0x2c9b('0x9a')]=!![];_0x4948b1['transfertype']='ATTENDED';if(this['queueReports'][_0x4d69a5['secondtransfereruniqueid']]){_0x113879=this[_0x2c9b('0xc')][_0x4d69a5['secondtransfereruniqueid']];this[_0x2c9b('0xc')][_0x4d69a5[_0x2c9b('0xce')]]=this[_0x2c9b('0xc')][_0x4d69a5[_0x2c9b('0xcc')]];this[_0x2c9b('0xc')][_0x4d69a5[_0x2c9b('0xcc')]]=_0x113879;_0x2b0f83=_[_0x2c9b('0x7d')](this[_0x2c9b('0xc')][_0x4d69a5['transfereeuniqueid']]);_0x2b0f83[_0x2c9b('0x30')]=!![];}logger['info']('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x4d69a5['uniqueid'],_0x4948b1[_0x2c9b('0x4a')],_0x4948b1[_0x2c9b('0x51')],_0x4948b1[_0x2c9b('0x9d')],_0x4948b1[_0x2c9b('0x9f')]);}else if(this['queueReports'][_0x4d69a5[_0x2c9b('0xcf')]]){_0x4948b1=_[_0x2c9b('0x7d')](this['queueReports'][_0x4d69a5[_0x2c9b('0xcf')]]);_0x4948b1[_0x2c9b('0x9d')]=_0x4d69a5[_0x2c9b('0xd0')];_0x4948b1[_0x2c9b('0x9f')]=_0x4d69a5[_0x2c9b('0xd1')];_0x4948b1[_0x2c9b('0x4e')]=_0x2c9b('0x4f');_0x4948b1[_0x2c9b('0x9a')]=!![];_0x4948b1[_0x2c9b('0x9b')]=_0x2c9b('0xd2');if(this['queueReports'][_0x4d69a5[_0x2c9b('0xd1')]]){_0x113879=this['queueReports'][_0x4d69a5[_0x2c9b('0xd1')]];this[_0x2c9b('0xc')][_0x4d69a5[_0x2c9b('0xd1')]]=this[_0x2c9b('0xc')][_0x4d69a5['transfertargetuniqueid']];this[_0x2c9b('0xc')][_0x4d69a5[_0x2c9b('0xcf')]]=_0x113879;_0x2b0f83=_[_0x2c9b('0x7d')](this[_0x2c9b('0xc')][_0x4d69a5[_0x2c9b('0xcf')]]);_0x2b0f83['switch']=!![];}logger[_0x2c9b('0x69')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x4d69a5[_0x2c9b('0x47')],_0x4948b1[_0x2c9b('0x4a')],_0x4948b1['type'],_0x4948b1['transferexten'],_0x4948b1[_0x2c9b('0x9f')]);}else if(this[_0x2c9b('0xc')][_0x4d69a5[_0x2c9b('0xd1')]]){_0x4948b1=_[_0x2c9b('0x7d')](this[_0x2c9b('0xc')][_0x4d69a5['origtransfereruniqueid']]);_0x4948b1['transferexten']=_0x4d69a5[_0x2c9b('0xd0')];_0x4948b1[_0x2c9b('0x9f')]=_0x4d69a5[_0x2c9b('0xd1')];_0x4948b1[_0x2c9b('0x4e')]=_0x2c9b('0x4f');_0x4948b1[_0x2c9b('0x9a')]=!![];_0x4948b1['transfertype']=_0x2c9b('0xd2');}else if(this[_0x2c9b('0xc')][_0x4d69a5[_0x2c9b('0xce')]]){_0x4948b1=_[_0x2c9b('0x7d')](this['queueReports'][_0x4d69a5[_0x2c9b('0xce')]]);_0x4948b1[_0x2c9b('0x9d')]=_0x4d69a5['secondtransfererexten'];_0x4948b1[_0x2c9b('0x9f')]=_0x4d69a5[_0x2c9b('0xce')];_0x4948b1[_0x2c9b('0x4e')]=_0x2c9b('0x4f');_0x4948b1[_0x2c9b('0x9a')]=!![];_0x4948b1[_0x2c9b('0x9b')]='ATTENDED';}}}catch(_0x342dbc){logger['error'](_0x2c9b('0xcb'),_0x4d69a5[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x342dbc,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2c9b('0xd3')]=function(_0x1ab1e8){try{if(this[_0x2c9b('0x61')](_0x1ab1e8)){logger[_0x2c9b('0x44')](_0x2c9b('0xd4'),_0x1ab1e8['uniqueid'],util[_0x2c9b('0x3a')](_0x1ab1e8,{'showHidden':![],'depth':null}));if(this[_0x2c9b('0xc')][_0x1ab1e8[_0x2c9b('0xcc')]]){var _0x56a6eb=_[_0x2c9b('0x7d')](this[_0x2c9b('0xc')][_0x1ab1e8[_0x2c9b('0xcc')]]);_0x56a6eb[_0x2c9b('0x4e')]=_0x2c9b('0xd5');_0x56a6eb[_0x2c9b('0x9a')]=!![];_0x56a6eb[_0x2c9b('0x9b')]='BLIND';_0x56a6eb[_0x2c9b('0x9d')]=_0x1ab1e8[_0x2c9b('0xd6')];_0x56a6eb[_0x2c9b('0x9f')]=_0x1ab1e8[_0x2c9b('0xcc')];logger[_0x2c9b('0x69')](_0x2c9b('0xd7'),_0x1ab1e8[_0x2c9b('0x47')],_0x56a6eb[_0x2c9b('0x4a')],_0x56a6eb['type'],_0x56a6eb['transferexten'],_0x56a6eb[_0x2c9b('0x9f')]);this['syncHangup']({'event':'BlindTransfer','uniqueid':_0x1ab1e8['transfereeuniqueid'],'context':_0x1ab1e8[_0x2c9b('0xd8')],'channel':_0x1ab1e8['transfererchannel']});}}}catch(_0x39c492){logger[_0x2c9b('0x38')](_0x2c9b('0xd4'),_0x1ab1e8[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x39c492,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2c9b('0x8')][_0x2c9b('0x23')]=function(_0x37c9b0){try{if(this[_0x2c9b('0x61')](_0x37c9b0)){logger['debug'](_0x2c9b('0xd9'),_0x37c9b0[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x37c9b0,{'showHidden':![],'depth':null}));if(this[_0x2c9b('0xc')][_0x37c9b0['uniqueid']]){var _0x5c9cca=_['last'](this['queueReports'][_0x37c9b0['uniqueid']]);if(!_[_0x2c9b('0x32')](_0x5c9cca['queuecallerleaveAt'])){_0x5c9cca[_0x2c9b('0xda')]=moment()[_0x2c9b('0x48')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x2c9b('0x69')](_0x2c9b('0xdb'),_0x37c9b0['uniqueid'],_0x5c9cca[_0x2c9b('0xda')]);}}}}catch(_0x3e1ecd){logger[_0x2c9b('0x38')](_0x2c9b('0xd9'),_0x37c9b0[_0x2c9b('0x47')],util['inspect'](_0x3e1ecd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x2c9b('0x8')]['syncMusicOnHoldStop']=function(_0x3379fd){try{if(this[_0x2c9b('0x61')](_0x3379fd)){logger[_0x2c9b('0x44')](_0x2c9b('0xdc'),_0x3379fd[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0x3379fd,{'showHidden':![],'depth':null}));if(this[_0x2c9b('0xc')][_0x3379fd[_0x2c9b('0x47')]]){var _0x59f8fa=_[_0x2c9b('0x7d')](this[_0x2c9b('0xc')][_0x3379fd['uniqueid']]);if(!_[_0x2c9b('0x32')](_0x59f8fa[_0x2c9b('0xda')])){_0x59f8fa['mohtime']+=moment()[_0x2c9b('0xc0')](0x0)[_0x2c9b('0xc2')](_0x59f8fa[_0x2c9b('0xda')],_0x2c9b('0xbf'));logger[_0x2c9b('0x69')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x3379fd[_0x2c9b('0x47')],_0x59f8fa[_0x2c9b('0xdd')]);delete _0x59f8fa[_0x2c9b('0xda')];}}}}catch(_0xdce42b){logger[_0x2c9b('0x38')]('[%s][voiceQueueReport][musiconholdstop]',_0x3379fd[_0x2c9b('0x47')],util[_0x2c9b('0x3a')](_0xdce42b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x2c9b('0xde')]=function(_0x204035){try{if(this['isNotNull'](_0x204035)){logger['debug'](_0x2c9b('0xdf'),_0x204035['uniqueid'],util[_0x2c9b('0x3a')](_0x204035,{'showHidden':![],'depth':null}));if(_0x204035[_0x2c9b('0xe0')]['toLowerCase']()==='set'){_0x204035[_0x2c9b('0xe1')]=_0x204035[_0x2c9b('0xe2')]&&_0x204035['appdata'][_0x2c9b('0x93')](_0x2c9b('0xe3'))?_0x204035[_0x2c9b('0xe2')]:(_0x204035['appdata']||_0x204035[_0x2c9b('0xe1')])[_0x2c9b('0x95')]();if(_[_0x2c9b('0x93')](_0x204035['applicationdata'][_0x2c9b('0x95')](),_0x2c9b('0xe4'))){logger[_0x2c9b('0x69')](_0x2c9b('0xe5'),_0x204035[_0x2c9b('0x47')],_0x204035[_0x2c9b('0xe0')],_0x204035[_0x2c9b('0xe1')]);if(_[_0x2c9b('0x62')](this[_0x2c9b('0xe')][_0x204035[_0x2c9b('0x47')]]))this[_0x2c9b('0xe')][_0x204035[_0x2c9b('0x47')]]={};var _0x26bbfc=_0x204035[_0x2c9b('0xe1')][_0x2c9b('0xe6')]('=');var _0x576f19=_0x26bbfc[0x0][_0x2c9b('0x95')]()[_0x2c9b('0xe7')](/cdr\((.*)\)/);if(_0x576f19)this['channels'][_0x204035[_0x2c9b('0x47')]][_0x576f19[0x1]]=_0x26bbfc[0x1];}}}}catch(_0xdf9c3){logger[_0x2c9b('0x38')]('[%s][voiceQueueReport][newexten]',_0x204035['uniqueid'],util[_0x2c9b('0x3a')](_0xdf9c3,{'showHidden':![],'depth':null}));}};module[_0x2c9b('0xe8')]=VoiceQueueReport;
\ No newline at end of file