Built motion from commit 25580385.|2.6.2
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index 90d2861..84e7df2 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x8c34=['queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','length','diff','sumDuration','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','secondtransfererexten','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','syncMusicOnHoldStart','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','appdata','CDR(routeAlias)','cdr(','application','applicationdata','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','md5','ioredis','../../../config/environment','../ami','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','queueReports','agents','channels','voiceQueues','flagQueueSummary','campaigns','queuesummary','bind','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','syncFullyBooted','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','variables','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','uniqueid','ATTENDEDTRANSFER','voice_queue_channel:remove','type','inbound','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','total','unmanaged','abandoned','Trunk','active','callerid','Interval','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','loopQueueShow','clearZombieChannels','queues','loopQueueSummary','then','[voiceQueueReport][queuesummary]','syncQueueSummary','isNotNull','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','loggedin','toNumber','emitVoiceQueueSummary','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','ABANDONED','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','queuecallerleave','[%s][voiceQueueReport][agentconnect]','queuecallerexitreason','queuecallerabandonAt','assigned','lastAssignedTo','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','toLowerCase','linkedid','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','[%s][voiceQueueReport][varset]','value','variable','queuestatus','lastevent','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queuecallerleaveAt'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8c34,0x121));var _0x48c3=function(_0x49823c,_0x3f4b6b){_0x49823c=_0x49823c-0x0;var _0x14a2e5=_0x8c34[_0x49823c];return _0x14a2e5;};'use strict';var _=require(_0x48c3('0x0'));var moment=require(_0x48c3('0x1'));var util=require('util');var md5=require(_0x48c3('0x2'));var Redis=require(_0x48c3('0x3'));var config=require(_0x48c3('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x48c3('0x5'));var QueueReport=require('../model/queueReport');config[_0x48c3('0x6')]=_[_0x48c3('0x7')](config[_0x48c3('0x6')],{'host':_0x48c3('0x8'),'port':0x18eb});var io=require(_0x48c3('0x9'))(new Redis(config[_0x48c3('0x6')]));var Sequence=function(){};Sequence[_0x48c3('0xa')][_0x48c3('0xb')]=function(_0x3dae00){this[_0x48c3('0xc')]=this[_0x48c3('0xc')]?this['tail']['finally'](_0x3dae00):_0x3dae00();};function VoiceQueueReport(_0x386460){this[_0x48c3('0xd')]=new Sequence();this[_0x48c3('0xe')]={};this['agents']=_0x386460[_0x48c3('0xf')];this[_0x48c3('0x10')]=_0x386460['queueChannels'];this[_0x48c3('0x11')]=_0x386460[_0x48c3('0x11')];this[_0x48c3('0x12')]=!![];this['campaigns']=_0x386460[_0x48c3('0x13')];this['variables']={};ami['on'](_0x48c3('0x14'),this['syncQueueSummary'][_0x48c3('0x15')](this));ami['on']('queuesummarycomplete',this[_0x48c3('0x16')][_0x48c3('0x15')](this));ami['on'](_0x48c3('0x17'),this[_0x48c3('0x18')][_0x48c3('0x15')](this));ami['on'](_0x48c3('0x19'),this['syncQueueCallerAbandon'][_0x48c3('0x15')](this));ami['on']('queuecallerleave',this[_0x48c3('0x1a')]['bind'](this));ami['on'](_0x48c3('0x1b'),this[_0x48c3('0x1c')][_0x48c3('0x15')](this));ami['on'](_0x48c3('0x1d'),this[_0x48c3('0x1e')][_0x48c3('0x15')](this));ami['on'](_0x48c3('0x1f'),this[_0x48c3('0x20')]['bind'](this));ami['on'](_0x48c3('0x21'),this[_0x48c3('0x22')]['bind'](this));ami['on']('fullybooted',this[_0x48c3('0x23')]['bind'](this));ami['on'](_0x48c3('0x24'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0x48c3('0x25'),this[_0x48c3('0x26')][_0x48c3('0x15')](this));ami['on']('attendedtransfer',this[_0x48c3('0x27')][_0x48c3('0x15')](this));ami['on'](_0x48c3('0x28'),this['syncBlindTransfer'][_0x48c3('0x15')](this));this['loopQueueSummary']();this['loopQueueShow']();}function clearChannels(_0x25e7e1){if(!_[_0x48c3('0x29')](_0x25e7e1)){for(var _0x4d50da in _0x25e7e1){if(_0x25e7e1[_0x48c3('0x2a')](_0x4d50da)){delete _0x25e7e1[_0x4d50da];}}}}function clearCampaigns(_0x5b95dc){if(!_[_0x48c3('0x29')](_0x5b95dc)){for(var _0x4f5c1d in _0x5b95dc){if(_0x5b95dc[_0x48c3('0x2a')](_0x4f5c1d)){_0x5b95dc[_0x4f5c1d]['originated']=0x0;}}}}function clearVoiceQueues(_0x59f4ff){if(!_[_0x48c3('0x29')](_0x59f4ff)){for(var _0x4502a1 in _0x59f4ff){if(_0x59f4ff[_0x48c3('0x2a')](_0x4502a1)){_0x59f4ff[_0x4502a1][_0x48c3('0x2b')]=0x0;_0x59f4ff[_0x4502a1][_0x48c3('0x2c')]=0x0;_0x59f4ff[_0x4502a1][_0x48c3('0x2d')]=0x0;_0x59f4ff[_0x4502a1][_0x48c3('0x2e')]=0x0;_0x59f4ff[_0x4502a1]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x5dcce7){if(!_[_0x48c3('0x29')](_0x5dcce7)){for(var _0x49c189 in _0x5dcce7){if(_0x5dcce7['hasOwnProperty'](_0x49c189)){_0x5dcce7[_0x49c189]['unlockRR']=!![];}}}}VoiceQueueReport[_0x48c3('0xa')]['clearZombieChannels']=function(){var _0x8ffe9e=this;for(var _0x2cf90c in this['channels']){if(this[_0x48c3('0x10')][_0x48c3('0x2a')](_0x2cf90c)&&!this['channels'][_0x2cf90c][_0x48c3('0x2f')]){this[_0x48c3('0xd')][_0x48c3('0xb')](function(){if(!_[_0x48c3('0x30')](_0x8ffe9e['channels'][_0x2cf90c])){return ami[_0x48c3('0x31')]({'action':_0x48c3('0x32'),'channel':_0x8ffe9e[_0x48c3('0x10')][_0x2cf90c][_0x48c3('0x33')]})[_0x48c3('0x34')](function(_0x676815){if(_0x676815[_0x48c3('0x35')]===_0x48c3('0x36')){setTimeout(function(){if(_0x8ffe9e[_0x48c3('0x10')][_0x2cf90c]){delete _0x8ffe9e[_0x48c3('0x10')][_0x2cf90c];logger[_0x48c3('0x37')](_0x48c3('0x38'),_0x2cf90c,util[_0x48c3('0x39')](_0x676815,{'showHidden':![],'depth':null}));}if(_0x8ffe9e[_0x48c3('0xe')][_0x2cf90c]){delete _0x8ffe9e[_0x48c3('0xe')][_0x2cf90c];logger['error'](_0x48c3('0x3a'),_0x2cf90c,util[_0x48c3('0x39')](_0x676815,{'showHidden':![],'depth':null}));}if(_0x8ffe9e[_0x48c3('0x3b')][_0x2cf90c]){delete _0x8ffe9e[_0x48c3('0x3b')][_0x2cf90c];logger[_0x48c3('0x37')](_0x48c3('0x3c'),_0x2cf90c,util[_0x48c3('0x39')](_0x676815,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0x23')]=function(){logger['error'](_0x48c3('0x3d'));clearChannels(this['channels']);this[_0x48c3('0x3e')](this[_0x48c3('0xe')]);clearAgentBooked(this[_0x48c3('0xf')]);clearVoiceQueues(this[_0x48c3('0x11')]);clearCampaigns(this[_0x48c3('0x13')]);};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0x3e')]=function(_0xb41e4f){var _0x40c41e=this;if(!_['isEmpty'](_0xb41e4f)){for(var _0x2aa56c in _0xb41e4f){if(_0xb41e4f[_0x48c3('0x2a')](_0x2aa56c)){_0x40c41e[_0x48c3('0x3f')](_0xb41e4f[_0x2aa56c],_0x48c3('0x40'));delete _0xb41e4f[_0x2aa56c];}}}};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0x41')]=function(_0x39ab08,_0x4645b4,_0x22f97d){io['to'](_0x39ab08)['emit'](_0x4645b4,_0x22f97d);};VoiceQueueReport['prototype'][_0x48c3('0x42')]=function(_0x5dcc6d,_0x625e2d){logger[_0x48c3('0x43')](_0x48c3('0x44')+_0x625e2d+_0x48c3('0x45'),_0x5dcc6d['uniqueid'],util[_0x48c3('0x39')](_0x5dcc6d,{'showHidden':![],'depth':null}));this['emit'](util[_0x48c3('0x46')](_0x48c3('0x47'),_0x5dcc6d[_0x48c3('0x48')]),_0x48c3('0x49'),_0x5dcc6d);io[_0x48c3('0x41')](_0x48c3('0x4a'),_0x5dcc6d);};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0x3f')]=function(_0xe8c80f,_0x5c18c3){logger[_0x48c3('0x43')](_0x48c3('0x44')+_0x5c18c3+']\x20sending\x20voice_queue_channel:remove\x20event:',_0xe8c80f[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0xe8c80f,{'showHidden':![],'depth':null}));if(_0xe8c80f['queuecallerexitreason']===_0x48c3('0x4c'))return;this['emit'](util[_0x48c3('0x46')]('voice:queue:%s',_0xe8c80f[_0x48c3('0x48')]),_0x48c3('0x4d'),_0xe8c80f);io[_0x48c3('0x41')]('voice_queue_presence:remove',_0xe8c80f);};VoiceQueueReport[_0x48c3('0xa')]['emitVoiceQueueSummary']=function(_0x218cf1,_0x357150){if(_0x218cf1[_0x48c3('0x4e')]===_0x48c3('0x4f')){var _0x1b63b0={'id':_0x218cf1['id'],'name':_0x218cf1['name'],'strategy':_0x218cf1[_0x48c3('0x50')],'answered':_0x218cf1[_0x48c3('0x51')],'available':_0x218cf1[_0x48c3('0x52')],'loggedIn':_0x218cf1[_0x48c3('0x53')],'pTalking':_0x218cf1[_0x48c3('0x2d')],'sumBillable':_0x218cf1[_0x48c3('0x54')],'sumDuration':_0x218cf1['sumDuration'],'sumHoldTime':_0x218cf1[_0x48c3('0x55')]||0x0,'talking':_0x218cf1[_0x48c3('0x2c')],'total':_0x218cf1[_0x48c3('0x56')],'type':_0x218cf1[_0x48c3('0x4e')],'unmanaged':_0x218cf1[_0x48c3('0x57')],'abandoned':_0x218cf1[_0x48c3('0x58')],'waiting':_0x218cf1[_0x48c3('0x2e')]};if(_0x218cf1[_0x48c3('0x59')]){_0x1b63b0['Trunk']={'id':_0x218cf1[_0x48c3('0x59')]['id'],'name':_0x218cf1[_0x48c3('0x59')]['name'],'active':_0x218cf1[_0x48c3('0x59')][_0x48c3('0x5a')],'callerid':_0x218cf1[_0x48c3('0x59')][_0x48c3('0x5b')]};}if(_0x218cf1[_0x48c3('0x5c')]){_0x1b63b0['Interval']={'id':_0x218cf1[_0x48c3('0x5c')]['id'],'name':_0x218cf1[_0x48c3('0x5c')]['name']};}var _0x45cbd9=md5(JSON['stringify'](_0x1b63b0));if(_0x218cf1[_0x48c3('0x2')]!==_0x45cbd9){_0x218cf1[_0x48c3('0x2')]=_0x45cbd9;logger[_0x48c3('0x43')](_0x48c3('0x5d')+_0x357150+_0x48c3('0x5e'),util['inspect'](_0x1b63b0,{'showHidden':![],'depth':null}));this['emit'](util[_0x48c3('0x46')](_0x48c3('0x47'),_0x1b63b0[_0x48c3('0x48')]),'voice_queue:save',_0x1b63b0);}}};VoiceQueueReport[_0x48c3('0xa')]['isNotNull']=function(_0x5bff5d){return _0x5bff5d!==null&&!_['isUndefined'](_0x5bff5d);};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0x5f')]=function(){var _0x50d95a=this;setInterval(function(){_0x50d95a[_0x48c3('0x60')]();ami[_0x48c3('0x31')]({'action':_0x48c3('0x61')})[_0x48c3('0x34')](function(_0x373174){logger[_0x48c3('0x37')]('[voiceQueueReport][queues]',util[_0x48c3('0x39')](_0x373174,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0x62')]=function(){var _0x39f0ba=this;setInterval(function(){if(_0x39f0ba[_0x48c3('0x12')]){return ami[_0x48c3('0x31')]({'action':_0x48c3('0x14')})[_0x48c3('0x63')](function(){_0x39f0ba[_0x48c3('0x12')]=![];})['catch'](function(_0x3fc221){logger['error'](_0x48c3('0x64'),util[_0x48c3('0x39')](_0x3fc221,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0x65')]=function(_0x5ade3b){try{if(this['isNotNull'](_0x5ade3b)&&this[_0x48c3('0x66')](_0x5ade3b[_0x48c3('0x67')])){logger[_0x48c3('0x43')](_0x48c3('0x68'),util[_0x48c3('0x39')](_0x5ade3b,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x5ade3b[_0x48c3('0x67')]]){logger[_0x48c3('0x69')](_0x48c3('0x6a'),_0x5ade3b[_0x48c3('0x67')]);var _0x21cdce=_[_0x48c3('0x6b')](this[_0x48c3('0x10')],'queue')[_0x5ade3b[_0x48c3('0x67')]]||0x0;var _0x3b431d=_0x21cdce-_0x5ade3b[_0x48c3('0x6c')];if(this['voiceQueues'][_0x5ade3b[_0x48c3('0x67')]][_0x48c3('0x2e')]!==_['toNumber'](_0x5ade3b[_0x48c3('0x6c')])||this[_0x48c3('0x11')][_0x5ade3b['queue']][_0x48c3('0x53')]!==_['toNumber'](_0x5ade3b[_0x48c3('0x6d')])||this[_0x48c3('0x11')][_0x5ade3b[_0x48c3('0x67')]][_0x48c3('0x52')]!==_[_0x48c3('0x6e')](_0x5ade3b[_0x48c3('0x52')])||this[_0x48c3('0x11')][_0x5ade3b['queue']][_0x48c3('0x2c')]!==_0x3b431d){this['voiceQueues'][_0x5ade3b['queue']][_0x48c3('0x2e')]=_[_0x48c3('0x6e')](_0x5ade3b[_0x48c3('0x6c')]);this[_0x48c3('0x11')][_0x5ade3b[_0x48c3('0x67')]][_0x48c3('0x53')]=_[_0x48c3('0x6e')](_0x5ade3b[_0x48c3('0x6d')]);this[_0x48c3('0x11')][_0x5ade3b[_0x48c3('0x67')]][_0x48c3('0x52')]=_[_0x48c3('0x6e')](_0x5ade3b[_0x48c3('0x52')]);this[_0x48c3('0x11')][_0x5ade3b[_0x48c3('0x67')]][_0x48c3('0x2c')]=_0x3b431d>0x0?_0x3b431d:0x0;this[_0x48c3('0x11')][_0x5ade3b[_0x48c3('0x67')]][_0x48c3('0x2c')]=this[_0x48c3('0x11')][_0x5ade3b['queue']][_0x48c3('0x2c')]>_['toNumber'](_0x5ade3b[_0x48c3('0x6d')])?_[_0x48c3('0x6e')](_0x5ade3b['loggedin']):this[_0x48c3('0x11')][_0x5ade3b[_0x48c3('0x67')]]['talking'];this[_0x48c3('0x6f')](this[_0x48c3('0x11')][_0x5ade3b['queue']],'queuesummary');}logger['debug'](_0x48c3('0x70'),util[_0x48c3('0x39')](this[_0x48c3('0x11')][_0x5ade3b['queue']],{'showHidden':![],'depth':null}));ami[_0x48c3('0x41')](_0x48c3('0x71'),this['voiceQueues'][_0x5ade3b[_0x48c3('0x67')]]);}}}catch(_0xd4fde0){logger[_0x48c3('0x37')](_0x48c3('0x64'),util[_0x48c3('0x39')](_0xd4fde0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x48c3('0xa')]['syncQueueSummaryComplete']=function(_0x4150db){logger[_0x48c3('0x43')](_0x48c3('0x72'),util[_0x48c3('0x39')](_0x4150db,{'showHidden':![],'depth':null}));this[_0x48c3('0x12')]=!![];};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0x18')]=function(_0x1b8e2d){try{if(this['isNotNull'](_0x1b8e2d)){logger[_0x48c3('0x43')](_0x48c3('0x73'),_0x1b8e2d[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x1b8e2d,{'showHidden':![],'depth':null}));if(_[_0x48c3('0x74')](this[_0x48c3('0xe')][_0x1b8e2d['uniqueid']]))this['queueReports'][_0x1b8e2d[_0x48c3('0x4b')]]=[];if(_[_0x48c3('0x74')](this[_0x48c3('0x10')][_0x1b8e2d['uniqueid']]))this['channels'][_0x1b8e2d[_0x48c3('0x4b')]]={};var _0x52bb87=new QueueReport();_0x52bb87[_0x48c3('0x48')]=_0x1b8e2d[_0x48c3('0x67')];_0x52bb87['type']=this['voiceQueues'][_0x52bb87[_0x48c3('0x48')]]&&this[_0x48c3('0x11')][_0x52bb87['name']][_0x48c3('0x4e')]?this[_0x48c3('0x11')][_0x52bb87[_0x48c3('0x48')]][_0x48c3('0x4e')]||_0x48c3('0x4f'):_0x48c3('0x4f');_0x52bb87[_0x48c3('0x67')]=_0x1b8e2d[_0x48c3('0x67')];_0x52bb87[_0x48c3('0x75')]=moment()[_0x48c3('0x46')](_0x48c3('0x76'));_0x52bb87[_0x48c3('0x77')]=_0x1b8e2d['position'];_0x52bb87[_0x48c3('0x78')]=_0x1b8e2d['count'];_0x52bb87[_0x48c3('0x4b')]=_0x1b8e2d[_0x48c3('0x4b')];_0x52bb87[_0x48c3('0x79')]=this['channels'][_0x1b8e2d['uniqueid']][_0x48c3('0x79')];logger[_0x48c3('0x69')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x52bb87[_0x48c3('0x48')],_0x52bb87['type']);_['merge'](_0x52bb87,_[_0x48c3('0x7a')](_0x1b8e2d,_[_0x48c3('0x7b')](_0x52bb87)));this[_0x48c3('0xe')][_0x1b8e2d[_0x48c3('0x4b')]][_0x48c3('0x7c')](_0x52bb87);this['channels'][_0x1b8e2d[_0x48c3('0x4b')]]=_0x52bb87;this[_0x48c3('0x42')](_0x52bb87,_0x48c3('0x17'));}}catch(_0x4059c4){logger[_0x48c3('0x37')](_0x48c3('0x73'),_0x1b8e2d['uniqueid'],util['inspect'](_0x4059c4,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x1f165f){try{if(this[_0x48c3('0x66')](_0x1f165f)){logger['debug'](_0x48c3('0x7d'),_0x1f165f[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x1f165f,{'showHidden':![],'depth':null}));if(this[_0x48c3('0xe')][_0x1f165f['uniqueid']]){var _0x361d2b=_[_0x48c3('0x7e')](this[_0x48c3('0xe')][_0x1f165f['uniqueid']]);_0x361d2b[_0x48c3('0x7f')]=![];_0x361d2b[_0x48c3('0x80')]=null;_0x361d2b[_0x48c3('0x81')]=_0x1f165f['holdtime'];_0x361d2b[_0x48c3('0x82')]=_0x1f165f[_0x48c3('0x82')];_0x361d2b['queuecallerabandon']=!![];_0x361d2b['queuecallerabandonAt']=moment()[_0x48c3('0x46')](_0x48c3('0x76'));_0x361d2b['queuecallerexitreason']=_0x48c3('0x83');_0x361d2b['lastAssignedTo']=null;logger[_0x48c3('0x69')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x361d2b[_0x48c3('0x48')],_0x361d2b[_0x48c3('0x4e')]);this[_0x48c3('0x10')][_0x1f165f['uniqueid']]=_0x361d2b;this[_0x48c3('0x3f')](_0x361d2b,_0x48c3('0x19'));}}}catch(_0x5966fc){logger['error'](_0x48c3('0x7d'),_0x1f165f[_0x48c3('0x4b')],util['inspect'](_0x5966fc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0x1a')]=function(_0x5ab506){try{if(this[_0x48c3('0x66')](_0x5ab506)){logger['debug'](_0x48c3('0x84'),_0x5ab506['uniqueid'],util[_0x48c3('0x39')](_0x5ab506,{'showHidden':![],'depth':null}));if(this[_0x48c3('0xe')][_0x5ab506[_0x48c3('0x4b')]]){var _0x509bfb=_[_0x48c3('0x7e')](this['queueReports'][_0x5ab506[_0x48c3('0x4b')]]);_0x509bfb['queuecallerleaveAt']=moment()[_0x48c3('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x509bfb[_0x48c3('0x85')]=_0x5ab506[_0x48c3('0x85')];_0x509bfb['connectedlinename']=_0x5ab506[_0x48c3('0x86')];logger[_0x48c3('0x69')](_0x48c3('0x87'),_0x509bfb['name'],_0x509bfb[_0x48c3('0x4e')],_0x5ab506['connectedlinenum'],_0x5ab506[_0x48c3('0x86')]);this[_0x48c3('0x10')][_0x5ab506[_0x48c3('0x4b')]]=_0x509bfb;this['emitVoiceQueueChannelSave'](_0x509bfb,_0x48c3('0x88'));}}}catch(_0x2190b5){logger[_0x48c3('0x37')](_0x48c3('0x84'),_0x5ab506[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x2190b5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x5c2d26){try{if(this[_0x48c3('0x66')](_0x5c2d26)){logger['debug'](_0x48c3('0x89'),_0x5c2d26[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x5c2d26,{'showHidden':![],'depth':null}));if(this[_0x48c3('0xe')][_0x5c2d26[_0x48c3('0x4b')]]){var _0x349c5a=_[_0x48c3('0x7e')](this[_0x48c3('0xe')][_0x5c2d26[_0x48c3('0x4b')]]);_0x349c5a[_0x48c3('0x7f')]=!![];_0x349c5a[_0x48c3('0x8a')]='COMPLETEDBYAGENT';logger[_0x48c3('0x69')]('[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT',_0x349c5a[_0x48c3('0x48')],_0x349c5a[_0x48c3('0x4e')]);}}}catch(_0x3870d7){logger[_0x48c3('0x37')](_0x48c3('0x89'),_0x5c2d26[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x3870d7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0x1c')]=function(_0x254861){try{if(this[_0x48c3('0x66')](_0x254861)){logger[_0x48c3('0x43')]('[%s][voiceQueueReport][agentcomplete]',_0x254861['uniqueid'],util[_0x48c3('0x39')](_0x254861,{'showHidden':![],'depth':null}));if(this[_0x48c3('0xe')][_0x254861[_0x48c3('0x4b')]]){var _0x3be25a=_['last'](this[_0x48c3('0xe')][_0x254861['uniqueid']]);_0x3be25a['queuecallerabandon']=![];_0x3be25a[_0x48c3('0x8b')]=null;_0x3be25a[_0x48c3('0x8c')]=!![];_0x3be25a[_0x48c3('0x8d')]=_0x254861[_0x48c3('0x8e')];_0x3be25a[_0x48c3('0x81')]=_0x254861['holdtime'];_0x3be25a[_0x48c3('0x7f')]=!![];_0x3be25a[_0x48c3('0x8f')]=![];_0x3be25a[_0x48c3('0x90')]=null;if(!_0x3be25a[_0x48c3('0x91')]){if(_0x254861[_0x48c3('0x92')]==_0x48c3('0x91')){_0x3be25a['queuecallerexitreason']=_0x48c3('0x93');logger[_0x48c3('0x69')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x3be25a[_0x48c3('0x48')],_0x3be25a['type']);}else{if(_[_0x48c3('0x94')](_0x254861[_0x48c3('0x33')][_0x48c3('0x95')](),'local/')){if(this[_0x48c3('0xe')][_0x254861[_0x48c3('0x96')]]){var _0x16fd8c=_[_0x48c3('0x7e')](this[_0x48c3('0xe')][_0x254861[_0x48c3('0x96')]]);_0x16fd8c[_0x48c3('0x7f')]=![];_0x16fd8c[_0x48c3('0x8f')]=!![];_0x16fd8c[_0x48c3('0x90')]=moment(_0x3be25a[_0x48c3('0x75')])[_0x48c3('0x97')](_0x254861[_0x48c3('0x81')],_0x48c3('0x98'))['format'](_0x48c3('0x76'));_0x16fd8c[_0x48c3('0x8a')]=_0x48c3('0x99');_0x16fd8c[_0x48c3('0x91')]=!![];_0x16fd8c[_0x48c3('0x9a')]=_0x48c3('0x9b');_0x16fd8c[_0x48c3('0x9c')]=_0x254861[_0x48c3('0x9d')];_0x16fd8c[_0x48c3('0x9e')]=_0x254861['uniqueid'];logger['info'](_0x48c3('0x9f'),_0x16fd8c[_0x48c3('0x48')],_0x16fd8c[_0x48c3('0x4e')]);var _0x12e916=this[_0x48c3('0xe')][_0x254861[_0x48c3('0x96')]];this['queueReports'][_0x254861[_0x48c3('0x96')]]=this['queueReports'][_0x254861[_0x48c3('0x4b')]];this[_0x48c3('0xe')][_0x254861[_0x48c3('0x4b')]]=_0x12e916;}}else{_0x3be25a[_0x48c3('0x8a')]=_0x48c3('0xa0')+_0x254861[_0x48c3('0x92')]['toUpperCase']();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x3be25a[_0x48c3('0x48')],_0x3be25a['type'],_0x3be25a[_0x48c3('0x8a')]);}}}this[_0x48c3('0x10')][_0x254861['uniqueid']]=_0x3be25a;this[_0x48c3('0x3f')](_0x3be25a,'agentcomplete');}}}catch(_0x13eb11){logger[_0x48c3('0x37')]('[%s][voiceQueueReport][agentcomplete]',_0x254861['uniqueid'],util[_0x48c3('0x39')](_0x13eb11,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x48c3('0x20')]=function(_0x3e4f00){try{if(this[_0x48c3('0x66')](_0x3e4f00)){logger[_0x48c3('0x43')](_0x48c3('0xa1'),_0x3e4f00[_0x48c3('0x4b')],util['inspect'](_0x3e4f00,{'showHidden':![],'depth':null}));this['addVariable'](_0x3e4f00['uniqueid'],_[_0x48c3('0x7b')](_0x3e4f00['variable'])[0x0],_0x3e4f00[_0x48c3('0xa2')]);if(this['queueReports'][_0x3e4f00['uniqueid']]){var _0x22d0ca=_[_0x48c3('0x7e')](this[_0x48c3('0xe')][_0x3e4f00['uniqueid']]);if(_0x22d0ca){if(this[_0x48c3('0x66')](_0x3e4f00[_0x48c3('0xa3')])&&this[_0x48c3('0x66')](_0x3e4f00[_0x48c3('0xa3')][_0x48c3('0xa4')])){switch(_0x3e4f00[_0x48c3('0xa2')]){case'CONTINUE':_0x22d0ca[_0x48c3('0x8f')]=![];_0x22d0ca[_0x48c3('0x90')]=null;break;case'TIMEOUT':_0x22d0ca[_0x48c3('0xa5')]='timeout';_0x22d0ca[_0x48c3('0x8f')]=!![];_0x22d0ca[_0x48c3('0x90')]=moment()[_0x48c3('0x46')](_0x48c3('0x76'));_0x22d0ca['queuecallerleaveAt']=moment()[_0x48c3('0x46')](_0x48c3('0x76'));logger[_0x48c3('0x43')](_0x48c3('0xa6'),_0x3e4f00[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x22d0ca,{'showHidden':![],'depth':null}));ami['emit'](_0x48c3('0xa7'),_0x22d0ca);break;default:_0x22d0ca[_0x48c3('0x8f')]=!![];_0x22d0ca[_0x48c3('0x90')]=moment()['format'](_0x48c3('0x76'));_0x22d0ca[_0x48c3('0xa8')]=moment()['format'](_0x48c3('0x76'));}_0x22d0ca[_0x48c3('0x19')]=![];_0x22d0ca['queuecallerabandonAt']=null;_0x22d0ca['queuecallerexitreason']=_0x3e4f00[_0x48c3('0xa2')];this[_0x48c3('0x10')][_0x3e4f00['uniqueid']]=_0x22d0ca;this['emitVoiceQueueChannelRemove'](_0x22d0ca,_0x48c3('0x1f'));}else if(this[_0x48c3('0x66')](_0x3e4f00[_0x48c3('0xa3')])&&this[_0x48c3('0x66')](_0x3e4f00[_0x48c3('0xa3')][_0x48c3('0xa9')])){if(!_0x22d0ca[_0x48c3('0x19')]){_0x22d0ca[_0x48c3('0x8f')]=!![];_0x22d0ca[_0x48c3('0x90')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x22d0ca[_0x48c3('0x8a')]='EXITWITHKEY';_0x22d0ca['queuecallerleaveAt']=moment()[_0x48c3('0x46')](_0x48c3('0x76'));this['channels'][_0x3e4f00[_0x48c3('0x4b')]]=_0x22d0ca;}}logger[_0x48c3('0x69')](_0x48c3('0xaa'),_0x3e4f00[_0x48c3('0x4b')],_0x22d0ca[_0x48c3('0x48')],_0x22d0ca[_0x48c3('0x4e')],_[_0x48c3('0x7b')](_0x3e4f00[_0x48c3('0xa3')])[0x0],_0x3e4f00[_0x48c3('0xa2')]);_0x22d0ca[_0x48c3('0x3b')]=this[_0x48c3('0x3b')][_0x3e4f00[_0x48c3('0x4b')]];}}}}catch(_0x2e10f7){logger[_0x48c3('0x37')](_0x48c3('0xa1'),_0x3e4f00['uniqueid'],util[_0x48c3('0x39')](_0x2e10f7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0xab')]=function(_0x3999d1,_0x580108,_0x27174d){var _0x49c014=['rtpaudioqos',_0x48c3('0xac'),_0x48c3('0xad'),_0x48c3('0xae'),_0x48c3('0xaf'),_0x48c3('0xb0'),_0x48c3('0xb1'),_0x48c3('0xb2'),_0x48c3('0xb3'),_0x48c3('0xb4'),_0x48c3('0xb5'),'bridgepvtcallid',_0x48c3('0xb6'),_0x48c3('0xb7'),_0x48c3('0xb8'),_0x48c3('0xb9'),_0x48c3('0x8e'),_0x48c3('0xba'),_0x48c3('0xbb')];if(!_['isNil'](_0x580108)&&!_['includes'](_0x49c014,_0x580108)){if(_[_0x48c3('0x74')](this[_0x48c3('0x3b')][_0x3999d1])){this[_0x48c3('0x3b')][_0x3999d1]={};}this[_0x48c3('0x3b')][_0x3999d1][_0x580108]=_0x27174d;}};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0x22')]=function(_0x25f5ba){try{if(this[_0x48c3('0x66')](_0x25f5ba)){logger[_0x48c3('0x43')]('[%s][voiceQueueReport][hangup]',_0x25f5ba[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x25f5ba,{'showHidden':![],'depth':null}));if(this[_0x48c3('0xe')][_0x25f5ba[_0x48c3('0x4b')]]){for(var _0x42413f=0x0,_0x57f764={};_0x42413f<this[_0x48c3('0xe')][_0x25f5ba['uniqueid']][_0x48c3('0xbc')];_0x42413f+=0x1){_0x57f764=this['queueReports'][_0x25f5ba[_0x48c3('0x4b')]][_0x42413f];if(this[_0x48c3('0x11')][_0x57f764[_0x48c3('0x67')]]){if(_0x57f764[_0x48c3('0x8f')]&&_0x57f764[_0x48c3('0x91')]!=!![]){this[_0x48c3('0x11')][_0x57f764['queue']]['unmanaged']+=0x1;}if(_0x57f764[_0x48c3('0x19')]){this['voiceQueues'][_0x57f764[_0x48c3('0x67')]]['abandoned']+=0x1;}this[_0x48c3('0x11')][_0x57f764[_0x48c3('0x67')]][_0x48c3('0x55')]+=moment(_0x57f764[_0x48c3('0xa8')])[_0x48c3('0xbd')](_0x57f764['queuecallerjoinAt'],_0x48c3('0x98'))||0x0;if(_0x42413f===this[_0x48c3('0xe')][_0x25f5ba[_0x48c3('0x4b')]][_0x48c3('0xbc')]-0x1){this['voiceQueues'][_0x57f764[_0x48c3('0x67')]][_0x48c3('0xbe')]+=moment()[_0x48c3('0xbf')](0x0)['diff'](_0x57f764[_0x48c3('0x75')],_0x48c3('0x98'));this[_0x48c3('0x11')][_0x57f764[_0x48c3('0x67')]][_0x48c3('0x56')]+=0x1;if(_0x57f764[_0x48c3('0x7f')]){this[_0x48c3('0x11')][_0x57f764['queue']][_0x48c3('0x51')]+=0x1;this[_0x48c3('0x11')][_0x57f764[_0x48c3('0x67')]][_0x48c3('0x54')]+=moment()[_0x48c3('0xbf')](0x0)['diff'](_0x57f764[_0x48c3('0xa8')],'seconds');_0x57f764[_0x48c3('0x80')]=moment()[_0x48c3('0x46')]('YYYY-MM-DD\x20HH:mm:ss');_0x57f764[_0x48c3('0x8f')]=![];_0x57f764[_0x48c3('0x90')]=null;}if(_0x57f764['queuecallerexit']&&_0x57f764[_0x48c3('0x91')]!=!![]){_0x57f764['lastevent']='unmanaged';logger[_0x48c3('0x43')](_0x48c3('0xc0'),_0x25f5ba[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x57f764,{'showHidden':![],'depth':null}));ami[_0x48c3('0x41')]('custom:queuecallerunmanaged',_0x57f764);}if(_0x57f764[_0x48c3('0x19')]){_0x57f764[_0x48c3('0xa5')]=_0x48c3('0x58');logger[_0x48c3('0x43')](_0x48c3('0xc1'),_0x25f5ba[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x57f764,{'showHidden':![],'depth':null}));ami[_0x48c3('0x41')]('custom:queuecallerabandon',_0x57f764);}}else{this[_0x48c3('0x11')][_0x57f764['queue']][_0x48c3('0xbe')]+=this[_0x48c3('0x11')][_0x57f764['queue']][_0x48c3('0x55')];}logger[_0x48c3('0x69')](_0x48c3('0xc2'),_0x25f5ba[_0x48c3('0x4b')],_0x57f764[_0x48c3('0x48')],_0x57f764[_0x48c3('0x4e')],_0x25f5ba[_0x48c3('0xc3')]);this[_0x48c3('0x10')][_0x25f5ba[_0x48c3('0x4b')]]=_0x57f764;this['emitVoiceQueueChannelRemove'](_0x57f764,_0x48c3('0x21'));this[_0x48c3('0x6f')](this['voiceQueues'][_0x57f764['queue']],_0x48c3('0x21'));}}logger[_0x48c3('0x43')]('[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:',_0x25f5ba[_0x48c3('0x4b')],util[_0x48c3('0x39')](this[_0x48c3('0xe')][_0x25f5ba['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x48c3('0x41')]('custom:voiceQueueReport',this[_0x48c3('0xe')][_0x25f5ba['uniqueid']]);if(_0x57f764[_0x48c3('0x8a')]===_0x48c3('0x4c'))return;delete this[_0x48c3('0xe')][_0x25f5ba[_0x48c3('0x4b')]];delete this[_0x48c3('0x10')][_0x25f5ba['uniqueid']];}if(this[_0x48c3('0x3b')][_0x25f5ba[_0x48c3('0x4b')]]){delete this[_0x48c3('0x3b')][_0x25f5ba[_0x48c3('0x4b')]];}}}catch(_0x3287a1){logger[_0x48c3('0x37')](_0x48c3('0xc4'),_0x25f5ba[_0x48c3('0x4b')],util['inspect'](_0x3287a1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0x27')]=function(_0x331fb4){try{if(this[_0x48c3('0x66')](_0x331fb4)){logger[_0x48c3('0x43')]('[%s][voiceQueueReport][attendedtransfer]',_0x331fb4[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x331fb4,{'showHidden':![],'depth':null}));var _0x1baec8;var _0xb23332;var _0x222ea0;if(this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc5')]]){_0x1baec8=_['last'](this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc5')]]);_0x1baec8[_0x48c3('0x9c')]=_0x331fb4['secondtransfererexten'];_0x1baec8[_0x48c3('0x9e')]=_0x331fb4[_0x48c3('0xc6')];_0x1baec8['queuecallerexitreason']=_0x48c3('0x4c');_0x1baec8[_0x48c3('0x91')]=!![];_0x1baec8[_0x48c3('0x9a')]='ATTENDED';if(this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc6')]]){_0x222ea0=this['queueReports'][_0x331fb4['secondtransfereruniqueid']];this['queueReports'][_0x331fb4[_0x48c3('0xc6')]]=this[_0x48c3('0xe')][_0x331fb4['transfereeuniqueid']];this['queueReports'][_0x331fb4[_0x48c3('0xc5')]]=_0x222ea0;_0xb23332=_[_0x48c3('0x7e')](this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc5')]]);_0xb23332['switch']=!![];}logger[_0x48c3('0x69')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x331fb4[_0x48c3('0x4b')],_0x1baec8[_0x48c3('0x48')],_0x1baec8[_0x48c3('0x4e')],_0x1baec8['transferexten'],_0x1baec8[_0x48c3('0x9e')]);}else if(this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc7')]]){_0x1baec8=_[_0x48c3('0x7e')](this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc7')]]);_0x1baec8[_0x48c3('0x9c')]=_0x331fb4[_0x48c3('0xc8')];_0x1baec8['transferuniqueid']=_0x331fb4[_0x48c3('0xc9')];_0x1baec8[_0x48c3('0x8a')]=_0x48c3('0x4c');_0x1baec8[_0x48c3('0x91')]=!![];_0x1baec8[_0x48c3('0x9a')]=_0x48c3('0xca');if(this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc9')]]){_0x222ea0=this[_0x48c3('0xe')][_0x331fb4['origtransfereruniqueid']];this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc9')]]=this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc7')]];this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc7')]]=_0x222ea0;_0xb23332=_[_0x48c3('0x7e')](this['queueReports'][_0x331fb4['transfertargetuniqueid']]);_0xb23332[_0x48c3('0x2f')]=!![];}logger[_0x48c3('0x69')](_0x48c3('0xcb'),_0x331fb4[_0x48c3('0x4b')],_0x1baec8[_0x48c3('0x48')],_0x1baec8['type'],_0x1baec8[_0x48c3('0x9c')],_0x1baec8[_0x48c3('0x9e')]);}else if(this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc9')]]){_0x1baec8=_[_0x48c3('0x7e')](this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc9')]]);_0x1baec8['transferexten']=_0x331fb4[_0x48c3('0xc8')];_0x1baec8['transferuniqueid']=_0x331fb4['origtransfereruniqueid'];_0x1baec8[_0x48c3('0x8a')]=_0x48c3('0x4c');_0x1baec8[_0x48c3('0x91')]=!![];_0x1baec8[_0x48c3('0x9a')]='ATTENDED';}else if(this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc6')]]){_0x1baec8=_[_0x48c3('0x7e')](this[_0x48c3('0xe')][_0x331fb4[_0x48c3('0xc6')]]);_0x1baec8[_0x48c3('0x9c')]=_0x331fb4[_0x48c3('0xcc')];_0x1baec8[_0x48c3('0x9e')]=_0x331fb4[_0x48c3('0xc6')];_0x1baec8[_0x48c3('0x8a')]=_0x48c3('0x4c');_0x1baec8['transfer']=!![];_0x1baec8['transfertype']=_0x48c3('0xca');}}}catch(_0x8c1a90){logger[_0x48c3('0x37')](_0x48c3('0xcd'),_0x331fb4[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x8c1a90,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x48c3('0xa')]['syncBlindTransfer']=function(_0x10d5ba){try{if(this[_0x48c3('0x66')](_0x10d5ba)){logger['debug'](_0x48c3('0xce'),_0x10d5ba[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x10d5ba,{'showHidden':![],'depth':null}));if(this[_0x48c3('0xe')][_0x10d5ba[_0x48c3('0xc5')]]){var _0x5dae9e=_['last'](this[_0x48c3('0xe')][_0x10d5ba[_0x48c3('0xc5')]]);_0x5dae9e['queuecallerexitreason']='BLINDTRANSFER';_0x5dae9e[_0x48c3('0x91')]=!![];_0x5dae9e['transfertype']=_0x48c3('0xcf');_0x5dae9e[_0x48c3('0x9c')]=_0x10d5ba[_0x48c3('0xd0')];_0x5dae9e[_0x48c3('0x9e')]=_0x10d5ba[_0x48c3('0xc5')];logger[_0x48c3('0x69')](_0x48c3('0xd1'),_0x10d5ba[_0x48c3('0x4b')],_0x5dae9e[_0x48c3('0x48')],_0x5dae9e[_0x48c3('0x4e')],_0x5dae9e[_0x48c3('0x9c')],_0x5dae9e[_0x48c3('0x9e')]);this[_0x48c3('0x22')]({'event':_0x48c3('0xd2'),'uniqueid':_0x10d5ba[_0x48c3('0xc5')],'context':_0x10d5ba['context'],'channel':_0x10d5ba[_0x48c3('0xd3')]});}}}catch(_0x57037d){logger[_0x48c3('0x37')](_0x48c3('0xce'),_0x10d5ba[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x57037d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0xd4')]=function(_0x7b83ee){try{if(this[_0x48c3('0x66')](_0x7b83ee)){logger[_0x48c3('0x43')](_0x48c3('0xd5'),_0x7b83ee[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x7b83ee,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x7b83ee[_0x48c3('0x4b')]]){var _0x420c87=_[_0x48c3('0x7e')](this[_0x48c3('0xe')][_0x7b83ee[_0x48c3('0x4b')]]);if(!_[_0x48c3('0x30')](_0x420c87['queuecallerleaveAt'])){_0x420c87[_0x48c3('0xd6')]=moment()[_0x48c3('0x46')](_0x48c3('0x76'));logger['info'](_0x48c3('0xd7'),_0x7b83ee['uniqueid'],_0x420c87[_0x48c3('0xd6')]);}}}}catch(_0x172357){logger[_0x48c3('0x37')](_0x48c3('0xd5'),_0x7b83ee[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x172357,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x48c3('0xa')]['syncMusicOnHoldStop']=function(_0x400076){try{if(this[_0x48c3('0x66')](_0x400076)){logger[_0x48c3('0x43')](_0x48c3('0xd8'),_0x400076[_0x48c3('0x4b')],util[_0x48c3('0x39')](_0x400076,{'showHidden':![],'depth':null}));if(this[_0x48c3('0xe')][_0x400076[_0x48c3('0x4b')]]){var _0x24d0ce=_['last'](this[_0x48c3('0xe')][_0x400076[_0x48c3('0x4b')]]);if(!_['isNil'](_0x24d0ce[_0x48c3('0xd6')])){_0x24d0ce[_0x48c3('0xd9')]+=moment()[_0x48c3('0xbf')](0x0)[_0x48c3('0xbd')](_0x24d0ce[_0x48c3('0xd6')],_0x48c3('0x98'));logger[_0x48c3('0x69')](_0x48c3('0xda'),_0x400076[_0x48c3('0x4b')],_0x24d0ce[_0x48c3('0xd9')]);delete _0x24d0ce[_0x48c3('0xd6')];}}}}catch(_0x58ce36){logger[_0x48c3('0x37')]('[%s][voiceQueueReport][musiconholdstop]',_0x400076[_0x48c3('0x4b')],util['inspect'](_0x58ce36,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x48c3('0xa')][_0x48c3('0xdb')]=function(_0x504182){try{if(this['isNotNull'](_0x504182)){logger['debug']('[%s][voiceQueueReport][newexten]\x20event:',_0x504182[_0x48c3('0x4b')],util['inspect'](_0x504182,{'showHidden':![],'depth':null}));if(_0x504182['application'][_0x48c3('0x95')]()==='set'){_0x504182['applicationdata']=_0x504182[_0x48c3('0xdc')]&&_0x504182[_0x48c3('0xdc')][_0x48c3('0x94')](_0x48c3('0xdd'))?_0x504182['appdata']:(_0x504182[_0x48c3('0xdc')]||_0x504182['applicationdata'])[_0x48c3('0x95')]();if(_[_0x48c3('0x94')](_0x504182['applicationdata'][_0x48c3('0x95')](),_0x48c3('0xde'))){logger['info']('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x504182['uniqueid'],_0x504182[_0x48c3('0xdf')],_0x504182[_0x48c3('0xe0')]);if(_[_0x48c3('0x74')](this[_0x48c3('0x10')][_0x504182[_0x48c3('0x4b')]]))this[_0x48c3('0x10')][_0x504182[_0x48c3('0x4b')]]={};var _0x10e254=_0x504182[_0x48c3('0xe0')][_0x48c3('0xe1')]('=');var _0x396b2f=_0x10e254[0x0][_0x48c3('0x95')]()[_0x48c3('0xe2')](/cdr\((.*)\)/);if(_0x396b2f)this[_0x48c3('0x10')][_0x504182[_0x48c3('0x4b')]][_0x396b2f[0x1]]=_0x10e254[0x1];}}}}catch(_0x4b6c57){logger['error'](_0x48c3('0xe3'),_0x504182[_0x48c3('0x4b')],util['inspect'](_0x4b6c57,{'showHidden':![],'depth':null}));}};module[_0x48c3('0xe4')]=VoiceQueueReport;
\ No newline at end of file
+var _0xff39=['syncMusicOnHoldStart','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','unlockRR','clearZombieChannels','switch','sequence','isNil','Action','catch','message','inspect','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','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_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','strategy','available','loggedIn','sumBillable','sumDuration','total','unmanaged','abandoned','waiting','Trunk','active','callerid','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isUndefined','queues','[voiceQueueReport][queues]','queuesummary','isNotNull','[voiceQueueReport][queuesummary]\x20event:','queue','countBy','toNumber','callers','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','inbound','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerjoin]','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','queuecallerabandonAt','assigned','membername','queuecallerexit','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','channel','local/','linkedid','queuecallerexitAt','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][agentcomplete]','value','variable','queuestatus','CONTINUE','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','includes','syncHangup','length','sumHoldTime','diff','answered','milliseconds','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfereruniqueid','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][newexten]\x20event:','application','set','appdata','CDR(routeAlias)','applicationdata','toLowerCase','startsWith','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','lodash','moment','util','md5','../../../config/environment','../../../config/logger','ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','hangup','fullybooted','syncFullyBooted'];(function(_0x4ac59c,_0x5304a4){var _0x4c00cc=function(_0x11b1c6){while(--_0x11b1c6){_0x4ac59c['push'](_0x4ac59c['shift']());}};_0x4c00cc(++_0x5304a4);}(_0xff39,0xcb));var _0x9ff3=function(_0x4d9f63,_0x115c88){_0x4d9f63=_0x4d9f63-0x0;var _0xa6dcfe=_0xff39[_0x4d9f63];return _0xa6dcfe;};'use strict';var _=require(_0x9ff3('0x0'));var moment=require(_0x9ff3('0x1'));var util=require(_0x9ff3('0x2'));var md5=require(_0x9ff3('0x3'));var Redis=require('ioredis');var config=require(_0x9ff3('0x4'));var logger=require(_0x9ff3('0x5'))(_0x9ff3('0x6'));var ami=require('../ami');var QueueReport=require(_0x9ff3('0x7'));config[_0x9ff3('0x8')]=_[_0x9ff3('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x9ff3('0xa'))(new Redis(config[_0x9ff3('0x8')]));var Sequence=function(){};Sequence[_0x9ff3('0xb')][_0x9ff3('0xc')]=function(_0x3e7b81){this[_0x9ff3('0xd')]=this[_0x9ff3('0xd')]?this[_0x9ff3('0xd')][_0x9ff3('0xe')](_0x3e7b81):_0x3e7b81();};function VoiceQueueReport(_0x52e02e){this['sequence']=new Sequence();this[_0x9ff3('0xf')]={};this[_0x9ff3('0x10')]=_0x52e02e[_0x9ff3('0x10')];this[_0x9ff3('0x11')]=_0x52e02e[_0x9ff3('0x12')];this[_0x9ff3('0x13')]=_0x52e02e[_0x9ff3('0x13')];this[_0x9ff3('0x14')]=!![];this[_0x9ff3('0x15')]=_0x52e02e[_0x9ff3('0x15')];this[_0x9ff3('0x16')]={};ami['on']('queuesummary',this[_0x9ff3('0x17')][_0x9ff3('0x18')](this));ami['on'](_0x9ff3('0x19'),this[_0x9ff3('0x1a')][_0x9ff3('0x18')](this));ami['on'](_0x9ff3('0x1b'),this[_0x9ff3('0x1c')][_0x9ff3('0x18')](this));ami['on']('queuecallerabandon',this[_0x9ff3('0x1d')]['bind'](this));ami['on'](_0x9ff3('0x1e'),this[_0x9ff3('0x1f')]['bind'](this));ami['on'](_0x9ff3('0x20'),this[_0x9ff3('0x21')][_0x9ff3('0x18')](this));ami['on']('agentconnect',this[_0x9ff3('0x22')]['bind'](this));ami['on'](_0x9ff3('0x23'),this[_0x9ff3('0x24')][_0x9ff3('0x18')](this));ami['on'](_0x9ff3('0x25'),this['syncHangup'][_0x9ff3('0x18')](this));ami['on'](_0x9ff3('0x26'),this[_0x9ff3('0x27')][_0x9ff3('0x18')](this));ami['on']('musiconholdstart',this[_0x9ff3('0x28')][_0x9ff3('0x18')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop'][_0x9ff3('0x18')](this));ami['on'](_0x9ff3('0x29'),this[_0x9ff3('0x2a')][_0x9ff3('0x18')](this));ami['on'](_0x9ff3('0x2b'),this[_0x9ff3('0x2c')][_0x9ff3('0x18')](this));this[_0x9ff3('0x2d')]();this['loopQueueShow']();}function clearChannels(_0x3abf03){if(!_[_0x9ff3('0x2e')](_0x3abf03)){for(var _0x16c28a in _0x3abf03){if(_0x3abf03[_0x9ff3('0x2f')](_0x16c28a)){delete _0x3abf03[_0x16c28a];}}}}function clearCampaigns(_0x1d5c53){if(!_[_0x9ff3('0x2e')](_0x1d5c53)){for(var _0x597304 in _0x1d5c53){if(_0x1d5c53[_0x9ff3('0x2f')](_0x597304)){_0x1d5c53[_0x597304][_0x9ff3('0x30')]=0x0;}}}}function clearVoiceQueues(_0x42fc4d){if(!_['isEmpty'](_0x42fc4d)){for(var _0x56bee1 in _0x42fc4d){if(_0x42fc4d['hasOwnProperty'](_0x56bee1)){_0x42fc4d[_0x56bee1][_0x9ff3('0x30')]=0x0;_0x42fc4d[_0x56bee1][_0x9ff3('0x31')]=0x0;_0x42fc4d[_0x56bee1]['pTalking']=0x0;_0x42fc4d[_0x56bee1]['waiting']=0x0;_0x42fc4d[_0x56bee1]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x227bbb){if(!_[_0x9ff3('0x2e')](_0x227bbb)){for(var _0x39032f in _0x227bbb){if(_0x227bbb['hasOwnProperty'](_0x39032f)){_0x227bbb[_0x39032f][_0x9ff3('0x32')]=!![];}}}}VoiceQueueReport[_0x9ff3('0xb')][_0x9ff3('0x33')]=function(){var _0x2219af=this;for(var _0x73f27e in this['channels']){if(this[_0x9ff3('0x11')][_0x9ff3('0x2f')](_0x73f27e)&&!this[_0x9ff3('0x11')][_0x73f27e][_0x9ff3('0x34')]){this[_0x9ff3('0x35')][_0x9ff3('0xc')](function(){if(!_[_0x9ff3('0x36')](_0x2219af[_0x9ff3('0x11')][_0x73f27e])){return ami[_0x9ff3('0x37')]({'action':'status','channel':_0x2219af[_0x9ff3('0x11')][_0x73f27e]['channel']})[_0x9ff3('0x38')](function(_0x300a49){if(_0x300a49[_0x9ff3('0x39')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x2219af[_0x9ff3('0x11')][_0x73f27e]){delete _0x2219af[_0x9ff3('0x11')][_0x73f27e];logger['error']('[%s][voiceQueueReport][checkChannel]',_0x73f27e,util[_0x9ff3('0x3a')](_0x300a49,{'showHidden':![],'depth':null}));}if(_0x2219af[_0x9ff3('0xf')][_0x73f27e]){delete _0x2219af[_0x9ff3('0xf')][_0x73f27e];logger[_0x9ff3('0x3b')](_0x9ff3('0x3c'),_0x73f27e,util[_0x9ff3('0x3a')](_0x300a49,{'showHidden':![],'depth':null}));}if(_0x2219af[_0x9ff3('0x16')][_0x73f27e]){delete _0x2219af[_0x9ff3('0x16')][_0x73f27e];logger['error'](_0x9ff3('0x3d'),_0x73f27e,util[_0x9ff3('0x3a')](_0x300a49,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x9ff3('0xb')][_0x9ff3('0x27')]=function(){logger['error'](_0x9ff3('0x3e'));clearChannels(this[_0x9ff3('0x11')]);this[_0x9ff3('0x3f')](this[_0x9ff3('0xf')]);clearAgentBooked(this[_0x9ff3('0x10')]);clearVoiceQueues(this[_0x9ff3('0x13')]);clearCampaigns(this[_0x9ff3('0x15')]);};VoiceQueueReport[_0x9ff3('0xb')]['clearQueueReport']=function(_0x32bcb4){var _0x2841f4=this;if(!_[_0x9ff3('0x2e')](_0x32bcb4)){for(var _0x11b3bd in _0x32bcb4){if(_0x32bcb4[_0x9ff3('0x2f')](_0x11b3bd)){_0x2841f4[_0x9ff3('0x40')](_0x32bcb4[_0x11b3bd],_0x9ff3('0x41'));delete _0x32bcb4[_0x11b3bd];}}}};VoiceQueueReport[_0x9ff3('0xb')][_0x9ff3('0x42')]=function(_0x3bc5e0,_0x174645,_0x431692){io['to'](_0x3bc5e0)[_0x9ff3('0x42')](_0x174645,_0x431692);};VoiceQueueReport[_0x9ff3('0xb')][_0x9ff3('0x43')]=function(_0x5e93d4,_0x4a1043){logger[_0x9ff3('0x44')](_0x9ff3('0x45')+_0x4a1043+_0x9ff3('0x46'),_0x5e93d4[_0x9ff3('0x47')],util['inspect'](_0x5e93d4,{'showHidden':![],'depth':null}));this[_0x9ff3('0x42')](util[_0x9ff3('0x48')](_0x9ff3('0x49'),_0x5e93d4[_0x9ff3('0x4a')]),_0x9ff3('0x4b'),_0x5e93d4);io['emit'](_0x9ff3('0x4c'),_0x5e93d4);};VoiceQueueReport[_0x9ff3('0xb')]['emitVoiceQueueChannelRemove']=function(_0x5bd28a,_0x51209e){logger[_0x9ff3('0x44')](_0x9ff3('0x45')+_0x51209e+_0x9ff3('0x4d'),_0x5bd28a[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x5bd28a,{'showHidden':![],'depth':null}));if(_0x5bd28a[_0x9ff3('0x4e')]===_0x9ff3('0x4f'))return;this[_0x9ff3('0x42')](util[_0x9ff3('0x48')]('voice:queue:%s',_0x5bd28a[_0x9ff3('0x4a')]),_0x9ff3('0x50'),_0x5bd28a);io[_0x9ff3('0x42')](_0x9ff3('0x51'),_0x5bd28a);};VoiceQueueReport[_0x9ff3('0xb')][_0x9ff3('0x52')]=function(_0x493bbd,_0x203150){if(_0x493bbd[_0x9ff3('0x53')]==='inbound'){var _0x5ccef7={'id':_0x493bbd['id'],'name':_0x493bbd[_0x9ff3('0x4a')],'strategy':_0x493bbd[_0x9ff3('0x54')],'answered':_0x493bbd['answered'],'available':_0x493bbd[_0x9ff3('0x55')],'loggedIn':_0x493bbd[_0x9ff3('0x56')],'pTalking':_0x493bbd['pTalking'],'sumBillable':_0x493bbd[_0x9ff3('0x57')],'sumDuration':_0x493bbd[_0x9ff3('0x58')],'sumHoldTime':_0x493bbd['sumHoldTime']||0x0,'talking':_0x493bbd[_0x9ff3('0x31')],'total':_0x493bbd[_0x9ff3('0x59')],'type':_0x493bbd[_0x9ff3('0x53')],'unmanaged':_0x493bbd[_0x9ff3('0x5a')],'abandoned':_0x493bbd[_0x9ff3('0x5b')],'waiting':_0x493bbd[_0x9ff3('0x5c')]};if(_0x493bbd[_0x9ff3('0x5d')]){_0x5ccef7[_0x9ff3('0x5d')]={'id':_0x493bbd[_0x9ff3('0x5d')]['id'],'name':_0x493bbd['Trunk'][_0x9ff3('0x4a')],'active':_0x493bbd['Trunk'][_0x9ff3('0x5e')],'callerid':_0x493bbd['Trunk'][_0x9ff3('0x5f')]};}if(_0x493bbd[_0x9ff3('0x60')]){_0x5ccef7[_0x9ff3('0x60')]={'id':_0x493bbd[_0x9ff3('0x60')]['id'],'name':_0x493bbd[_0x9ff3('0x60')]['name']};}var _0x9a56ed=md5(JSON[_0x9ff3('0x61')](_0x5ccef7));if(_0x493bbd[_0x9ff3('0x3')]!==_0x9a56ed){_0x493bbd['md5']=_0x9a56ed;logger[_0x9ff3('0x44')](_0x9ff3('0x62')+_0x203150+_0x9ff3('0x63'),util[_0x9ff3('0x3a')](_0x5ccef7,{'showHidden':![],'depth':null}));this[_0x9ff3('0x42')](util['format'](_0x9ff3('0x49'),_0x5ccef7[_0x9ff3('0x4a')]),_0x9ff3('0x64'),_0x5ccef7);}}};VoiceQueueReport[_0x9ff3('0xb')]['isNotNull']=function(_0x4bb1f8){return _0x4bb1f8!==null&&!_[_0x9ff3('0x65')](_0x4bb1f8);};VoiceQueueReport[_0x9ff3('0xb')]['loopQueueShow']=function(){var _0x31428b=this;setInterval(function(){_0x31428b['clearZombieChannels']();ami[_0x9ff3('0x37')]({'action':_0x9ff3('0x66')})[_0x9ff3('0x38')](function(_0x52faa4){logger[_0x9ff3('0x3b')](_0x9ff3('0x67'),util[_0x9ff3('0x3a')](_0x52faa4,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x9ff3('0xb')][_0x9ff3('0x2d')]=function(){var _0x1bb867=this;setInterval(function(){if(_0x1bb867[_0x9ff3('0x14')]){return ami[_0x9ff3('0x37')]({'action':_0x9ff3('0x68')})['then'](function(){_0x1bb867['flagQueueSummary']=![];})[_0x9ff3('0x38')](function(_0x228656){logger[_0x9ff3('0x3b')]('[voiceQueueReport][queuesummary]',util[_0x9ff3('0x3a')](_0x228656,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x9ff3('0xb')][_0x9ff3('0x17')]=function(_0x34e8cd){try{if(this[_0x9ff3('0x69')](_0x34e8cd)&&this[_0x9ff3('0x69')](_0x34e8cd['queue'])){logger['debug'](_0x9ff3('0x6a'),util[_0x9ff3('0x3a')](_0x34e8cd,{'showHidden':![],'depth':null}));if(this[_0x9ff3('0x13')][_0x34e8cd['queue']]){logger['info']('[voiceQueueReport][queuesummary]\x20name:%s',_0x34e8cd[_0x9ff3('0x6b')]);var _0x318d1f=_[_0x9ff3('0x6c')](this[_0x9ff3('0x11')],_0x9ff3('0x6b'))[_0x34e8cd[_0x9ff3('0x6b')]]||0x0;var _0xb25ec4=_0x318d1f-_0x34e8cd['callers'];if(this['voiceQueues'][_0x34e8cd[_0x9ff3('0x6b')]][_0x9ff3('0x5c')]!==_[_0x9ff3('0x6d')](_0x34e8cd[_0x9ff3('0x6e')])||this[_0x9ff3('0x13')][_0x34e8cd['queue']][_0x9ff3('0x56')]!==_[_0x9ff3('0x6d')](_0x34e8cd[_0x9ff3('0x6f')])||this[_0x9ff3('0x13')][_0x34e8cd['queue']][_0x9ff3('0x55')]!==_[_0x9ff3('0x6d')](_0x34e8cd['available'])||this[_0x9ff3('0x13')][_0x34e8cd[_0x9ff3('0x6b')]][_0x9ff3('0x31')]!==_0xb25ec4){this[_0x9ff3('0x13')][_0x34e8cd[_0x9ff3('0x6b')]][_0x9ff3('0x5c')]=_[_0x9ff3('0x6d')](_0x34e8cd['callers']);this['voiceQueues'][_0x34e8cd[_0x9ff3('0x6b')]][_0x9ff3('0x56')]=_[_0x9ff3('0x6d')](_0x34e8cd[_0x9ff3('0x6f')]);this[_0x9ff3('0x13')][_0x34e8cd['queue']][_0x9ff3('0x55')]=_[_0x9ff3('0x6d')](_0x34e8cd['available']);this[_0x9ff3('0x13')][_0x34e8cd[_0x9ff3('0x6b')]][_0x9ff3('0x31')]=_0xb25ec4>0x0?_0xb25ec4:0x0;this[_0x9ff3('0x13')][_0x34e8cd[_0x9ff3('0x6b')]][_0x9ff3('0x31')]=this[_0x9ff3('0x13')][_0x34e8cd[_0x9ff3('0x6b')]]['talking']>_[_0x9ff3('0x6d')](_0x34e8cd[_0x9ff3('0x6f')])?_['toNumber'](_0x34e8cd['loggedin']):this['voiceQueues'][_0x34e8cd[_0x9ff3('0x6b')]][_0x9ff3('0x31')];this['emitVoiceQueueSummary'](this[_0x9ff3('0x13')][_0x34e8cd['queue']],'queuesummary');}logger[_0x9ff3('0x44')](_0x9ff3('0x70'),util['inspect'](this['voiceQueues'][_0x34e8cd[_0x9ff3('0x6b')]],{'showHidden':![],'depth':null}));ami[_0x9ff3('0x42')](_0x9ff3('0x71'),this[_0x9ff3('0x13')][_0x34e8cd[_0x9ff3('0x6b')]]);}}}catch(_0x3eeba6){logger[_0x9ff3('0x3b')](_0x9ff3('0x72'),util[_0x9ff3('0x3a')](_0x3eeba6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ff3('0xb')][_0x9ff3('0x1a')]=function(_0x252fa8){logger['debug'](_0x9ff3('0x73'),util['inspect'](_0x252fa8,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x2c180b){try{if(this['isNotNull'](_0x2c180b)){logger[_0x9ff3('0x44')]('[%s][voiceQueueReport][queuecallerjoin]',_0x2c180b['uniqueid'],util[_0x9ff3('0x3a')](_0x2c180b,{'showHidden':![],'depth':null}));if(_[_0x9ff3('0x65')](this[_0x9ff3('0xf')][_0x2c180b[_0x9ff3('0x47')]]))this[_0x9ff3('0xf')][_0x2c180b[_0x9ff3('0x47')]]=[];if(_[_0x9ff3('0x65')](this['channels'][_0x2c180b[_0x9ff3('0x47')]]))this[_0x9ff3('0x11')][_0x2c180b[_0x9ff3('0x47')]]={};var _0x523f6a=new QueueReport();_0x523f6a[_0x9ff3('0x4a')]=_0x2c180b[_0x9ff3('0x6b')];_0x523f6a[_0x9ff3('0x53')]=this[_0x9ff3('0x13')][_0x523f6a[_0x9ff3('0x4a')]]&&this[_0x9ff3('0x13')][_0x523f6a[_0x9ff3('0x4a')]]['type']?this[_0x9ff3('0x13')][_0x523f6a[_0x9ff3('0x4a')]][_0x9ff3('0x53')]||_0x9ff3('0x74'):'inbound';_0x523f6a[_0x9ff3('0x6b')]=_0x2c180b[_0x9ff3('0x6b')];_0x523f6a['queuecallerjoinAt']=moment()[_0x9ff3('0x48')](_0x9ff3('0x75'));_0x523f6a[_0x9ff3('0x76')]=_0x2c180b['position'];_0x523f6a[_0x9ff3('0x77')]=_0x2c180b[_0x9ff3('0x77')];_0x523f6a[_0x9ff3('0x47')]=_0x2c180b[_0x9ff3('0x47')];_0x523f6a['routealias']=this['channels'][_0x2c180b[_0x9ff3('0x47')]][_0x9ff3('0x78')];logger[_0x9ff3('0x79')](_0x9ff3('0x7a'),_0x523f6a[_0x9ff3('0x4a')],_0x523f6a[_0x9ff3('0x53')]);_[_0x9ff3('0x7b')](_0x523f6a,_[_0x9ff3('0x7c')](_0x2c180b,_[_0x9ff3('0x7d')](_0x523f6a)));this['queueReports'][_0x2c180b['uniqueid']][_0x9ff3('0x7e')](_0x523f6a);this['channels'][_0x2c180b['uniqueid']]=_0x523f6a;this[_0x9ff3('0x43')](_0x523f6a,'queuecallerjoin');}}catch(_0x3197ee){logger[_0x9ff3('0x3b')](_0x9ff3('0x7f'),_0x2c180b[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x3197ee,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9ff3('0x1d')]=function(_0x5e6a87){try{if(this[_0x9ff3('0x69')](_0x5e6a87)){logger['debug'](_0x9ff3('0x80'),_0x5e6a87[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x5e6a87,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x5e6a87[_0x9ff3('0x47')]]){var _0x22bf35=_[_0x9ff3('0x81')](this[_0x9ff3('0xf')][_0x5e6a87[_0x9ff3('0x47')]]);_0x22bf35[_0x9ff3('0x82')]=![];_0x22bf35[_0x9ff3('0x83')]=null;_0x22bf35[_0x9ff3('0x84')]=_0x5e6a87[_0x9ff3('0x84')];_0x22bf35[_0x9ff3('0x85')]=_0x5e6a87['originalposition'];_0x22bf35[_0x9ff3('0x86')]=!![];_0x22bf35['queuecallerabandonAt']=moment()[_0x9ff3('0x48')](_0x9ff3('0x75'));_0x22bf35[_0x9ff3('0x4e')]=_0x9ff3('0x87');_0x22bf35[_0x9ff3('0x88')]=null;logger[_0x9ff3('0x79')](_0x9ff3('0x89'),_0x22bf35[_0x9ff3('0x4a')],_0x22bf35['type']);this[_0x9ff3('0x11')][_0x5e6a87[_0x9ff3('0x47')]]=_0x22bf35;this[_0x9ff3('0x40')](_0x22bf35,'queuecallerabandon');}}}catch(_0x13556c){logger[_0x9ff3('0x3b')](_0x9ff3('0x80'),_0x5e6a87['uniqueid'],util[_0x9ff3('0x3a')](_0x13556c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ff3('0xb')][_0x9ff3('0x1f')]=function(_0x3f1ea3){try{if(this[_0x9ff3('0x69')](_0x3f1ea3)){logger[_0x9ff3('0x44')](_0x9ff3('0x8a'),_0x3f1ea3[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x3f1ea3,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3f1ea3[_0x9ff3('0x47')]]){var _0x388c1f=_[_0x9ff3('0x81')](this['queueReports'][_0x3f1ea3[_0x9ff3('0x47')]]);_0x388c1f['queuecallerleaveAt']=moment()[_0x9ff3('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x388c1f[_0x9ff3('0x8b')]=_0x3f1ea3[_0x9ff3('0x8b')];_0x388c1f[_0x9ff3('0x8c')]=_0x3f1ea3[_0x9ff3('0x8c')];logger[_0x9ff3('0x79')](_0x9ff3('0x8d'),_0x388c1f[_0x9ff3('0x4a')],_0x388c1f[_0x9ff3('0x53')],_0x3f1ea3['connectedlinenum'],_0x3f1ea3['connectedlinename']);this[_0x9ff3('0x11')][_0x3f1ea3['uniqueid']]=_0x388c1f;this['emitVoiceQueueChannelSave'](_0x388c1f,_0x9ff3('0x1e'));}}}catch(_0x9dc51f){logger[_0x9ff3('0x3b')](_0x9ff3('0x8a'),_0x3f1ea3['uniqueid'],util[_0x9ff3('0x3a')](_0x9dc51f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ff3('0xb')]['syncAgentConnect']=function(_0x35a6a7){try{if(this['isNotNull'](_0x35a6a7)){logger[_0x9ff3('0x44')](_0x9ff3('0x8e'),_0x35a6a7['uniqueid'],util[_0x9ff3('0x3a')](_0x35a6a7,{'showHidden':![],'depth':null}));if(this[_0x9ff3('0xf')][_0x35a6a7['uniqueid']]){var _0xc673e9=_['last'](this[_0x9ff3('0xf')][_0x35a6a7[_0x9ff3('0x47')]]);_0xc673e9[_0x9ff3('0x82')]=!![];_0xc673e9[_0x9ff3('0x4e')]=_0x9ff3('0x8f');logger['info'](_0x9ff3('0x90'),_0xc673e9[_0x9ff3('0x4a')],_0xc673e9['type']);}}}catch(_0x454795){logger[_0x9ff3('0x3b')](_0x9ff3('0x8e'),_0x35a6a7[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x454795,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ff3('0xb')]['syncAgentComplete']=function(_0x22e618){try{if(this[_0x9ff3('0x69')](_0x22e618)){logger[_0x9ff3('0x44')]('[%s][voiceQueueReport][agentcomplete]',_0x22e618[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x22e618,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x22e618[_0x9ff3('0x47')]]){var _0x217d1b=_[_0x9ff3('0x81')](this['queueReports'][_0x22e618[_0x9ff3('0x47')]]);_0x217d1b['queuecallerabandon']=![];_0x217d1b[_0x9ff3('0x91')]=null;_0x217d1b[_0x9ff3('0x92')]=!![];_0x217d1b[_0x9ff3('0x88')]=_0x22e618[_0x9ff3('0x93')];_0x217d1b['holdtime']=_0x22e618[_0x9ff3('0x84')];_0x217d1b[_0x9ff3('0x82')]=!![];_0x217d1b[_0x9ff3('0x94')]=![];_0x217d1b['queuecallerexitAt']=null;if(!_0x217d1b[_0x9ff3('0x95')]){if(_0x22e618[_0x9ff3('0x96')]==_0x9ff3('0x95')){_0x217d1b[_0x9ff3('0x4e')]=_0x9ff3('0x97');logger['info'](_0x9ff3('0x98'),_0x217d1b[_0x9ff3('0x4a')],_0x217d1b[_0x9ff3('0x53')]);}else{if(_['startsWith'](_0x22e618[_0x9ff3('0x99')]['toLowerCase'](),_0x9ff3('0x9a'))){if(this[_0x9ff3('0xf')][_0x22e618[_0x9ff3('0x9b')]]){var _0x177061=_[_0x9ff3('0x81')](this[_0x9ff3('0xf')][_0x22e618[_0x9ff3('0x9b')]]);_0x177061[_0x9ff3('0x82')]=![];_0x177061[_0x9ff3('0x94')]=!![];_0x177061[_0x9ff3('0x9c')]=moment(_0x217d1b[_0x9ff3('0x9d')])[_0x9ff3('0x9e')](_0x22e618[_0x9ff3('0x84')],_0x9ff3('0x9f'))[_0x9ff3('0x48')](_0x9ff3('0x75'));_0x177061[_0x9ff3('0x4e')]=_0x9ff3('0xa0');_0x177061[_0x9ff3('0x95')]=!![];_0x177061[_0x9ff3('0xa1')]=_0x9ff3('0xa2');_0x177061[_0x9ff3('0xa3')]=_0x22e618[_0x9ff3('0xa4')];_0x177061[_0x9ff3('0xa5')]=_0x22e618[_0x9ff3('0x47')];logger[_0x9ff3('0x79')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x177061[_0x9ff3('0x4a')],_0x177061[_0x9ff3('0x53')]);var _0x24f53d=this[_0x9ff3('0xf')][_0x22e618[_0x9ff3('0x9b')]];this[_0x9ff3('0xf')][_0x22e618[_0x9ff3('0x9b')]]=this[_0x9ff3('0xf')][_0x22e618[_0x9ff3('0x47')]];this['queueReports'][_0x22e618['uniqueid']]=_0x24f53d;}}else{_0x217d1b[_0x9ff3('0x4e')]='COMPLETEDBY'+_0x22e618[_0x9ff3('0x96')][_0x9ff3('0xa6')]();logger[_0x9ff3('0x79')](_0x9ff3('0xa7'),_0x217d1b[_0x9ff3('0x4a')],_0x217d1b[_0x9ff3('0x53')],_0x217d1b[_0x9ff3('0x4e')]);}}}this[_0x9ff3('0x11')][_0x22e618['uniqueid']]=_0x217d1b;this[_0x9ff3('0x40')](_0x217d1b,'agentcomplete');}}}catch(_0xaa345){logger[_0x9ff3('0x3b')](_0x9ff3('0xa8'),_0x22e618[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0xaa345,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9ff3('0x24')]=function(_0x58b966){try{if(this[_0x9ff3('0x69')](_0x58b966)){logger[_0x9ff3('0x44')]('[%s][voiceQueueReport][varset]',_0x58b966[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x58b966,{'showHidden':![],'depth':null}));this['addVariable'](_0x58b966['uniqueid'],_[_0x9ff3('0x7d')](_0x58b966['variable'])[0x0],_0x58b966[_0x9ff3('0xa9')]);if(this[_0x9ff3('0xf')][_0x58b966[_0x9ff3('0x47')]]){var _0x1f1663=_[_0x9ff3('0x81')](this['queueReports'][_0x58b966[_0x9ff3('0x47')]]);if(_0x1f1663){if(this[_0x9ff3('0x69')](_0x58b966[_0x9ff3('0xaa')])&&this['isNotNull'](_0x58b966[_0x9ff3('0xaa')][_0x9ff3('0xab')])){switch(_0x58b966[_0x9ff3('0xa9')]){case _0x9ff3('0xac'):_0x1f1663[_0x9ff3('0x94')]=![];_0x1f1663[_0x9ff3('0x9c')]=null;break;case _0x9ff3('0xad'):_0x1f1663[_0x9ff3('0xae')]=_0x9ff3('0xaf');_0x1f1663['queuecallerexit']=!![];_0x1f1663[_0x9ff3('0x9c')]=moment()[_0x9ff3('0x48')](_0x9ff3('0x75'));_0x1f1663[_0x9ff3('0xb0')]=moment()[_0x9ff3('0x48')](_0x9ff3('0x75'));logger[_0x9ff3('0x44')](_0x9ff3('0xb1'),_0x58b966[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x1f1663,{'showHidden':![],'depth':null}));ami['emit'](_0x9ff3('0xb2'),_0x1f1663);break;default:_0x1f1663[_0x9ff3('0x94')]=!![];_0x1f1663[_0x9ff3('0x9c')]=moment()[_0x9ff3('0x48')](_0x9ff3('0x75'));_0x1f1663[_0x9ff3('0xb0')]=moment()[_0x9ff3('0x48')](_0x9ff3('0x75'));}_0x1f1663[_0x9ff3('0x86')]=![];_0x1f1663[_0x9ff3('0x91')]=null;_0x1f1663[_0x9ff3('0x4e')]=_0x58b966[_0x9ff3('0xa9')];this[_0x9ff3('0x11')][_0x58b966[_0x9ff3('0x47')]]=_0x1f1663;this[_0x9ff3('0x40')](_0x1f1663,'varset');}else if(this['isNotNull'](_0x58b966[_0x9ff3('0xaa')])&&this[_0x9ff3('0x69')](_0x58b966[_0x9ff3('0xaa')][_0x9ff3('0xb3')])){if(!_0x1f1663['queuecallerabandon']){_0x1f1663[_0x9ff3('0x94')]=!![];_0x1f1663[_0x9ff3('0x9c')]=moment()[_0x9ff3('0x48')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f1663['queuecallerexitreason']=_0x9ff3('0xb4');_0x1f1663[_0x9ff3('0xb0')]=moment()[_0x9ff3('0x48')](_0x9ff3('0x75'));this[_0x9ff3('0x11')][_0x58b966[_0x9ff3('0x47')]]=_0x1f1663;}}logger[_0x9ff3('0x79')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x58b966[_0x9ff3('0x47')],_0x1f1663[_0x9ff3('0x4a')],_0x1f1663[_0x9ff3('0x53')],_[_0x9ff3('0x7d')](_0x58b966['variable'])[0x0],_0x58b966['value']);_0x1f1663[_0x9ff3('0x16')]=this['variables'][_0x58b966['uniqueid']];}}}}catch(_0x183228){logger[_0x9ff3('0x3b')](_0x9ff3('0xb5'),_0x58b966[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x183228,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ff3('0xb')][_0x9ff3('0xb6')]=function(_0x3896c7,_0x228422,_0x1da6ca){var _0x1975d1=[_0x9ff3('0xb7'),_0x9ff3('0xb8'),_0x9ff3('0xb9'),_0x9ff3('0xba'),_0x9ff3('0xbb'),_0x9ff3('0xbc'),'rtpaudioqosrtt',_0x9ff3('0xbd'),_0x9ff3('0xbe'),_0x9ff3('0xbf'),_0x9ff3('0xc0'),_0x9ff3('0xc1'),_0x9ff3('0xc2'),_0x9ff3('0xc3'),'memberinterface',_0x9ff3('0xc4'),_0x9ff3('0x93'),_0x9ff3('0xc5'),_0x9ff3('0xc6')];if(!_[_0x9ff3('0x36')](_0x228422)&&!_[_0x9ff3('0xc7')](_0x1975d1,_0x228422)){if(_[_0x9ff3('0x65')](this['variables'][_0x3896c7])){this[_0x9ff3('0x16')][_0x3896c7]={};}this[_0x9ff3('0x16')][_0x3896c7][_0x228422]=_0x1da6ca;}};VoiceQueueReport[_0x9ff3('0xb')][_0x9ff3('0xc8')]=function(_0x1c7f46){try{if(this[_0x9ff3('0x69')](_0x1c7f46)){logger[_0x9ff3('0x44')]('[%s][voiceQueueReport][hangup]',_0x1c7f46[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x1c7f46,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1c7f46[_0x9ff3('0x47')]]){for(var _0x2ba2bd=0x0,_0x4f8958={};_0x2ba2bd<this[_0x9ff3('0xf')][_0x1c7f46[_0x9ff3('0x47')]][_0x9ff3('0xc9')];_0x2ba2bd+=0x1){_0x4f8958=this[_0x9ff3('0xf')][_0x1c7f46[_0x9ff3('0x47')]][_0x2ba2bd];if(this['voiceQueues'][_0x4f8958[_0x9ff3('0x6b')]]){if(_0x4f8958[_0x9ff3('0x94')]&&_0x4f8958[_0x9ff3('0x95')]!=!![]){this['voiceQueues'][_0x4f8958[_0x9ff3('0x6b')]][_0x9ff3('0x5a')]+=0x1;}if(_0x4f8958[_0x9ff3('0x86')]){this[_0x9ff3('0x13')][_0x4f8958['queue']][_0x9ff3('0x5b')]+=0x1;}this['voiceQueues'][_0x4f8958[_0x9ff3('0x6b')]][_0x9ff3('0xca')]+=moment(_0x4f8958[_0x9ff3('0xb0')])[_0x9ff3('0xcb')](_0x4f8958[_0x9ff3('0x9d')],_0x9ff3('0x9f'))||0x0;if(_0x2ba2bd===this['queueReports'][_0x1c7f46[_0x9ff3('0x47')]]['length']-0x1){this[_0x9ff3('0x13')][_0x4f8958[_0x9ff3('0x6b')]][_0x9ff3('0x58')]+=moment()['milliseconds'](0x0)['diff'](_0x4f8958[_0x9ff3('0x9d')],'seconds');this[_0x9ff3('0x13')][_0x4f8958['queue']][_0x9ff3('0x59')]+=0x1;if(_0x4f8958['queuecallercomplete']){this[_0x9ff3('0x13')][_0x4f8958[_0x9ff3('0x6b')]][_0x9ff3('0xcc')]+=0x1;this[_0x9ff3('0x13')][_0x4f8958[_0x9ff3('0x6b')]][_0x9ff3('0x57')]+=moment()[_0x9ff3('0xcd')](0x0)[_0x9ff3('0xcb')](_0x4f8958[_0x9ff3('0xb0')],'seconds');_0x4f8958[_0x9ff3('0x83')]=moment()[_0x9ff3('0x48')](_0x9ff3('0x75'));_0x4f8958[_0x9ff3('0x94')]=![];_0x4f8958[_0x9ff3('0x9c')]=null;}if(_0x4f8958[_0x9ff3('0x94')]&&_0x4f8958[_0x9ff3('0x95')]!=!![]){_0x4f8958[_0x9ff3('0xae')]=_0x9ff3('0x5a');logger['debug']('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x1c7f46[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x4f8958,{'showHidden':![],'depth':null}));ami[_0x9ff3('0x42')](_0x9ff3('0xce'),_0x4f8958);}if(_0x4f8958[_0x9ff3('0x86')]){_0x4f8958[_0x9ff3('0xae')]=_0x9ff3('0x5b');logger[_0x9ff3('0x44')](_0x9ff3('0xcf'),_0x1c7f46[_0x9ff3('0x47')],util['inspect'](_0x4f8958,{'showHidden':![],'depth':null}));ami['emit'](_0x9ff3('0xd0'),_0x4f8958);}}else{this[_0x9ff3('0x13')][_0x4f8958['queue']][_0x9ff3('0x58')]+=this[_0x9ff3('0x13')][_0x4f8958[_0x9ff3('0x6b')]][_0x9ff3('0xca')];}logger[_0x9ff3('0x79')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x1c7f46[_0x9ff3('0x47')],_0x4f8958[_0x9ff3('0x4a')],_0x4f8958['type'],_0x1c7f46[_0x9ff3('0xd1')]);this[_0x9ff3('0x11')][_0x1c7f46[_0x9ff3('0x47')]]=_0x4f8958;this[_0x9ff3('0x40')](_0x4f8958,_0x9ff3('0x25'));this[_0x9ff3('0x52')](this[_0x9ff3('0x13')][_0x4f8958['queue']],_0x9ff3('0x25'));}}logger['debug'](_0x9ff3('0xd2'),_0x1c7f46[_0x9ff3('0x47')],util['inspect'](this[_0x9ff3('0xf')][_0x1c7f46[_0x9ff3('0x47')]],{'showHidden':![],'depth':null}));ami[_0x9ff3('0x42')](_0x9ff3('0xd3'),this[_0x9ff3('0xf')][_0x1c7f46[_0x9ff3('0x47')]]);if(_0x4f8958['queuecallerexitreason']===_0x9ff3('0x4f'))return;delete this[_0x9ff3('0xf')][_0x1c7f46[_0x9ff3('0x47')]];delete this[_0x9ff3('0x11')][_0x1c7f46[_0x9ff3('0x47')]];}if(this[_0x9ff3('0x16')][_0x1c7f46[_0x9ff3('0x47')]]){delete this['variables'][_0x1c7f46[_0x9ff3('0x47')]];}}}catch(_0x2f828b){logger[_0x9ff3('0x3b')]('[%s][voiceQueueReport][hangup]',_0x1c7f46[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x2f828b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ff3('0xb')]['syncAttendedTransfer']=function(_0x54ecf6){try{if(this[_0x9ff3('0x69')](_0x54ecf6)){logger['debug'](_0x9ff3('0xd4'),_0x54ecf6['uniqueid'],util[_0x9ff3('0x3a')](_0x54ecf6,{'showHidden':![],'depth':null}));var _0x52d5ab;var _0x1c42ba;var _0x115db2;if(this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xd5')]]){_0x52d5ab=_[_0x9ff3('0x81')](this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xd5')]]);_0x52d5ab[_0x9ff3('0xa3')]=_0x54ecf6['secondtransfererexten'];_0x52d5ab['transferuniqueid']=_0x54ecf6[_0x9ff3('0xd6')];_0x52d5ab[_0x9ff3('0x4e')]=_0x9ff3('0x4f');_0x52d5ab[_0x9ff3('0x95')]=!![];_0x52d5ab[_0x9ff3('0xa1')]=_0x9ff3('0xd7');if(this['queueReports'][_0x54ecf6[_0x9ff3('0xd6')]]){_0x115db2=this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xd6')]];this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xd6')]]=this[_0x9ff3('0xf')][_0x54ecf6['transfereeuniqueid']];this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xd5')]]=_0x115db2;_0x1c42ba=_[_0x9ff3('0x81')](this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xd5')]]);_0x1c42ba[_0x9ff3('0x34')]=!![];}logger[_0x9ff3('0x79')](_0x9ff3('0xd8'),_0x54ecf6[_0x9ff3('0x47')],_0x52d5ab[_0x9ff3('0x4a')],_0x52d5ab[_0x9ff3('0x53')],_0x52d5ab[_0x9ff3('0xa3')],_0x52d5ab[_0x9ff3('0xa5')]);}else if(this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xd9')]]){_0x52d5ab=_[_0x9ff3('0x81')](this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xd9')]]);_0x52d5ab[_0x9ff3('0xa3')]=_0x54ecf6[_0x9ff3('0xda')];_0x52d5ab[_0x9ff3('0xa5')]=_0x54ecf6[_0x9ff3('0xdb')];_0x52d5ab[_0x9ff3('0x4e')]='ATTENDEDTRANSFER';_0x52d5ab[_0x9ff3('0x95')]=!![];_0x52d5ab[_0x9ff3('0xa1')]=_0x9ff3('0xd7');if(this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xdb')]]){_0x115db2=this['queueReports'][_0x54ecf6[_0x9ff3('0xdb')]];this['queueReports'][_0x54ecf6['origtransfereruniqueid']]=this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xd9')]];this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xd9')]]=_0x115db2;_0x1c42ba=_['last'](this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xd9')]]);_0x1c42ba[_0x9ff3('0x34')]=!![];}logger[_0x9ff3('0x79')](_0x9ff3('0xd8'),_0x54ecf6[_0x9ff3('0x47')],_0x52d5ab[_0x9ff3('0x4a')],_0x52d5ab['type'],_0x52d5ab['transferexten'],_0x52d5ab[_0x9ff3('0xa5')]);}else if(this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xdb')]]){_0x52d5ab=_['last'](this[_0x9ff3('0xf')][_0x54ecf6['origtransfereruniqueid']]);_0x52d5ab[_0x9ff3('0xa3')]=_0x54ecf6[_0x9ff3('0xda')];_0x52d5ab[_0x9ff3('0xa5')]=_0x54ecf6[_0x9ff3('0xdb')];_0x52d5ab['queuecallerexitreason']=_0x9ff3('0x4f');_0x52d5ab['transfer']=!![];_0x52d5ab['transfertype']=_0x9ff3('0xd7');}else if(this[_0x9ff3('0xf')][_0x54ecf6[_0x9ff3('0xd6')]]){_0x52d5ab=_[_0x9ff3('0x81')](this[_0x9ff3('0xf')][_0x54ecf6['secondtransfereruniqueid']]);_0x52d5ab[_0x9ff3('0xa3')]=_0x54ecf6['secondtransfererexten'];_0x52d5ab[_0x9ff3('0xa5')]=_0x54ecf6['secondtransfereruniqueid'];_0x52d5ab[_0x9ff3('0x4e')]='ATTENDEDTRANSFER';_0x52d5ab[_0x9ff3('0x95')]=!![];_0x52d5ab[_0x9ff3('0xa1')]=_0x9ff3('0xd7');}}}catch(_0xdc2453){logger[_0x9ff3('0x3b')](_0x9ff3('0xd4'),_0x54ecf6[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0xdc2453,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ff3('0xb')][_0x9ff3('0x2c')]=function(_0x42ddd0){try{if(this[_0x9ff3('0x69')](_0x42ddd0)){logger[_0x9ff3('0x44')](_0x9ff3('0xdc'),_0x42ddd0[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x42ddd0,{'showHidden':![],'depth':null}));if(this[_0x9ff3('0xf')][_0x42ddd0['transfereeuniqueid']]){var _0x3651d3=_[_0x9ff3('0x81')](this[_0x9ff3('0xf')][_0x42ddd0['transfereeuniqueid']]);_0x3651d3['queuecallerexitreason']=_0x9ff3('0xdd');_0x3651d3[_0x9ff3('0x95')]=!![];_0x3651d3[_0x9ff3('0xa1')]='BLIND';_0x3651d3[_0x9ff3('0xa3')]=_0x42ddd0['extension'];_0x3651d3[_0x9ff3('0xa5')]=_0x42ddd0[_0x9ff3('0xd5')];logger[_0x9ff3('0x79')](_0x9ff3('0xde'),_0x42ddd0[_0x9ff3('0x47')],_0x3651d3[_0x9ff3('0x4a')],_0x3651d3[_0x9ff3('0x53')],_0x3651d3['transferexten'],_0x3651d3[_0x9ff3('0xa5')]);this[_0x9ff3('0xc8')]({'event':_0x9ff3('0xdf'),'uniqueid':_0x42ddd0[_0x9ff3('0xd5')],'context':_0x42ddd0['context'],'channel':_0x42ddd0[_0x9ff3('0xe0')]});}}}catch(_0x3d998d){logger['error']('[%s][voiceQueueReport][blindtransfer]',_0x42ddd0[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x3d998d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncMusicOnHoldStart']=function(_0x533d0e){try{if(this[_0x9ff3('0x69')](_0x533d0e)){logger[_0x9ff3('0x44')](_0x9ff3('0xe1'),_0x533d0e['uniqueid'],util[_0x9ff3('0x3a')](_0x533d0e,{'showHidden':![],'depth':null}));if(this[_0x9ff3('0xf')][_0x533d0e[_0x9ff3('0x47')]]){var _0x4a5cc4=_[_0x9ff3('0x81')](this[_0x9ff3('0xf')][_0x533d0e[_0x9ff3('0x47')]]);if(!_[_0x9ff3('0x36')](_0x4a5cc4[_0x9ff3('0xb0')])){_0x4a5cc4['mohstarttime']=moment()[_0x9ff3('0x48')](_0x9ff3('0x75'));logger[_0x9ff3('0x79')](_0x9ff3('0xe2'),_0x533d0e[_0x9ff3('0x47')],_0x4a5cc4[_0x9ff3('0xe3')]);}}}}catch(_0x552175){logger[_0x9ff3('0x3b')](_0x9ff3('0xe1'),_0x533d0e['uniqueid'],util['inspect'](_0x552175,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ff3('0xb')]['syncMusicOnHoldStop']=function(_0x450a57){try{if(this[_0x9ff3('0x69')](_0x450a57)){logger['debug'](_0x9ff3('0xe4'),_0x450a57[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x450a57,{'showHidden':![],'depth':null}));if(this[_0x9ff3('0xf')][_0x450a57['uniqueid']]){var _0x10bd7a=_[_0x9ff3('0x81')](this[_0x9ff3('0xf')][_0x450a57[_0x9ff3('0x47')]]);if(!_[_0x9ff3('0x36')](_0x10bd7a[_0x9ff3('0xe3')])){_0x10bd7a['mohtime']+=moment()['milliseconds'](0x0)[_0x9ff3('0xcb')](_0x10bd7a[_0x9ff3('0xe3')],'seconds');logger['info'](_0x9ff3('0xe5'),_0x450a57[_0x9ff3('0x47')],_0x10bd7a[_0x9ff3('0xe6')]);delete _0x10bd7a['mohstarttime'];}}}}catch(_0x1861e1){logger[_0x9ff3('0x3b')](_0x9ff3('0xe4'),_0x450a57[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x1861e1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9ff3('0xb')]['syncNewExten']=function(_0x24a719){try{if(this[_0x9ff3('0x69')](_0x24a719)){logger[_0x9ff3('0x44')](_0x9ff3('0xe7'),_0x24a719[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x24a719,{'showHidden':![],'depth':null}));if(_0x24a719[_0x9ff3('0xe8')]['toLowerCase']()===_0x9ff3('0xe9')){_0x24a719['applicationdata']=_0x24a719[_0x9ff3('0xea')]&&_0x24a719[_0x9ff3('0xea')]['startsWith'](_0x9ff3('0xeb'))?_0x24a719['appdata']:(_0x24a719[_0x9ff3('0xea')]||_0x24a719[_0x9ff3('0xec')])[_0x9ff3('0xed')]();if(_[_0x9ff3('0xee')](_0x24a719[_0x9ff3('0xec')][_0x9ff3('0xed')](),'cdr(')){logger['info'](_0x9ff3('0xef'),_0x24a719['uniqueid'],_0x24a719[_0x9ff3('0xe8')],_0x24a719[_0x9ff3('0xec')]);if(_['isUndefined'](this[_0x9ff3('0x11')][_0x24a719[_0x9ff3('0x47')]]))this[_0x9ff3('0x11')][_0x24a719[_0x9ff3('0x47')]]={};var _0x2a627f=_0x24a719[_0x9ff3('0xec')][_0x9ff3('0xf0')]('=');var _0x2bfbf8=_0x2a627f[0x0][_0x9ff3('0xed')]()[_0x9ff3('0xf1')](/cdr\((.*)\)/);if(_0x2bfbf8)this[_0x9ff3('0x11')][_0x24a719[_0x9ff3('0x47')]][_0x2bfbf8[0x1]]=_0x2a627f[0x1];}}}}catch(_0x46cbae){logger['error']('[%s][voiceQueueReport][newexten]',_0x24a719[_0x9ff3('0x47')],util[_0x9ff3('0x3a')](_0x46cbae,{'showHidden':![],'depth':null}));}};module[_0x9ff3('0xf2')]=VoiceQueueReport;
\ No newline at end of file