Built motion from commit da617fac.|2.6.6
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index 4a79340..1d991df 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf887=['agentconnect','syncAgentConnect','hangup','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','clearZombieChannels','channels','switch','enqueue','isNil','Action','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','[%s][voiceQueueReport][checkQueueReport]','inspect','[%s][voiceQueueReport][checkVariables]','clearQueueReport','emitVoiceQueueChannelRemove','emit','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','uniqueid','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','answered','available','sumHoldTime','total','unmanaged','abandoned','Trunk','callerid','Interval','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','[voiceQueueReport][queues]','then','[voiceQueueReport][queuesummary]','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedIn','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','syncQueueSummaryComplete','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','push','emitVoiceQueueChannelSave','[%s][voiceQueueReport][queuecallerabandon]','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitreason','ABANDONED','lastAssignedTo','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','membername','queuecallerexit','reason','transfer','COMPLETED','channel','toLowerCase','local/','linkedid','queuecallerexitAt','add','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','syncVarSet','[%s][voiceQueueReport][varset]','addVariable','keys','variable','value','queuestatus','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','varset','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','length','diff','seconds','sumDuration','sumBillable','milliseconds','lastevent','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','syncAttendedTransfer','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','syncHangup','BlindTransfer','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype','tail','finally','queueReports','agents','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','queuesummary','syncQueueSummary','queuecallerjoin','bind','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete'];(function(_0x2348db,_0x10b4a4){var _0x361978=function(_0x1c406c){while(--_0x1c406c){_0x2348db['push'](_0x2348db['shift']());}};_0x361978(++_0x10b4a4);}(_0xf887,0xd0));var _0x7f88=function(_0x5dea4b,_0x3992da){_0x5dea4b=_0x5dea4b-0x0;var _0x4d3a3b=_0xf887[_0x5dea4b];return _0x4d3a3b;};'use strict';var _=require(_0x7f88('0x0'));var moment=require('moment');var util=require(_0x7f88('0x1'));var md5=require(_0x7f88('0x2'));var Redis=require(_0x7f88('0x3'));var config=require(_0x7f88('0x4'));var logger=require(_0x7f88('0x5'))(_0x7f88('0x6'));var ami=require(_0x7f88('0x7'));var QueueReport=require(_0x7f88('0x8'));config[_0x7f88('0x9')]=_[_0x7f88('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x7f88('0xb'))(new Redis(config[_0x7f88('0x9')]));var Sequence=function(){};Sequence[_0x7f88('0xc')]['enqueue']=function(_0x58afa0){this[_0x7f88('0xd')]=this[_0x7f88('0xd')]?this[_0x7f88('0xd')][_0x7f88('0xe')](_0x58afa0):_0x58afa0();};function VoiceQueueReport(_0x4b0cd5){this['sequence']=new Sequence();this[_0x7f88('0xf')]={};this[_0x7f88('0x10')]=_0x4b0cd5[_0x7f88('0x10')];this['channels']=_0x4b0cd5[_0x7f88('0x11')];this[_0x7f88('0x12')]=_0x4b0cd5[_0x7f88('0x12')];this[_0x7f88('0x13')]=!![];this['campaigns']=_0x4b0cd5[_0x7f88('0x14')];this[_0x7f88('0x15')]={};ami['on'](_0x7f88('0x16'),this[_0x7f88('0x17')]['bind'](this));ami['on']('queuesummarycomplete',this['syncQueueSummaryComplete']['bind'](this));ami['on'](_0x7f88('0x18'),this['syncQueueCallerJoin'][_0x7f88('0x19')](this));ami['on'](_0x7f88('0x1a'),this[_0x7f88('0x1b')][_0x7f88('0x19')](this));ami['on'](_0x7f88('0x1c'),this[_0x7f88('0x1d')][_0x7f88('0x19')](this));ami['on'](_0x7f88('0x1e'),this[_0x7f88('0x1f')][_0x7f88('0x19')](this));ami['on'](_0x7f88('0x20'),this[_0x7f88('0x21')][_0x7f88('0x19')](this));ami['on']('varset',this['syncVarSet'][_0x7f88('0x19')](this));ami['on'](_0x7f88('0x22'),this['syncHangup'][_0x7f88('0x19')](this));ami['on']('fullybooted',this[_0x7f88('0x23')][_0x7f88('0x19')](this));ami['on']('musiconholdstart',this[_0x7f88('0x24')][_0x7f88('0x19')](this));ami['on'](_0x7f88('0x25'),this[_0x7f88('0x26')]['bind'](this));ami['on'](_0x7f88('0x27'),this['syncAttendedTransfer'][_0x7f88('0x19')](this));ami['on'](_0x7f88('0x28'),this[_0x7f88('0x29')]['bind'](this));this[_0x7f88('0x2a')]();this[_0x7f88('0x2b')]();}function clearChannels(_0x215feb){if(!_[_0x7f88('0x2c')](_0x215feb)){for(var _0x38c1ed in _0x215feb){if(_0x215feb[_0x7f88('0x2d')](_0x38c1ed)){delete _0x215feb[_0x38c1ed];}}}}function clearCampaigns(_0x42d496){if(!_[_0x7f88('0x2c')](_0x42d496)){for(var _0x14bd4b in _0x42d496){if(_0x42d496[_0x7f88('0x2d')](_0x14bd4b)){_0x42d496[_0x14bd4b][_0x7f88('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x38efc8){if(!_[_0x7f88('0x2c')](_0x38efc8)){for(var _0x52bcec in _0x38efc8){if(_0x38efc8[_0x7f88('0x2d')](_0x52bcec)){_0x38efc8[_0x52bcec][_0x7f88('0x2e')]=0x0;_0x38efc8[_0x52bcec][_0x7f88('0x2f')]=0x0;_0x38efc8[_0x52bcec][_0x7f88('0x30')]=0x0;_0x38efc8[_0x52bcec][_0x7f88('0x31')]=0x0;_0x38efc8[_0x52bcec][_0x7f88('0x32')]=!![];}}}}function clearAgentBooked(_0x29068b){if(!_[_0x7f88('0x2c')](_0x29068b)){for(var _0x2262dd in _0x29068b){if(_0x29068b[_0x7f88('0x2d')](_0x2262dd)){_0x29068b[_0x2262dd]['unlockRR']=!![];}}}}VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0x33')]=function(){var _0x207f35=this;for(var _0x249813 in this[_0x7f88('0x34')]){if(this[_0x7f88('0x34')]['hasOwnProperty'](_0x249813)&&!this['channels'][_0x249813][_0x7f88('0x35')]){this['sequence'][_0x7f88('0x36')](function(){if(!_[_0x7f88('0x37')](_0x207f35[_0x7f88('0x34')][_0x249813])){return ami[_0x7f88('0x38')]({'action':'status','channel':_0x207f35['channels'][_0x249813]['channel']})[_0x7f88('0x39')](function(_0x17ed43){if(_0x17ed43[_0x7f88('0x3a')]===_0x7f88('0x3b')){setTimeout(function(){if(_0x207f35['channels'][_0x249813]){delete _0x207f35[_0x7f88('0x34')][_0x249813];logger[_0x7f88('0x3c')](_0x7f88('0x3d'),_0x249813,util['inspect'](_0x17ed43,{'showHidden':![],'depth':null}));}if(_0x207f35['queueReports'][_0x249813]){delete _0x207f35[_0x7f88('0xf')][_0x249813];logger[_0x7f88('0x3c')](_0x7f88('0x3e'),_0x249813,util[_0x7f88('0x3f')](_0x17ed43,{'showHidden':![],'depth':null}));}if(_0x207f35[_0x7f88('0x15')][_0x249813]){delete _0x207f35[_0x7f88('0x15')][_0x249813];logger[_0x7f88('0x3c')](_0x7f88('0x40'),_0x249813,util['inspect'](_0x17ed43,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0x23')]=function(){logger['error']('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x7f88('0x34')]);this[_0x7f88('0x41')](this[_0x7f88('0xf')]);clearAgentBooked(this[_0x7f88('0x10')]);clearVoiceQueues(this[_0x7f88('0x12')]);clearCampaigns(this[_0x7f88('0x14')]);};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0x41')]=function(_0x50bcd2){var _0x4f61fe=this;if(!_[_0x7f88('0x2c')](_0x50bcd2)){for(var _0x2a79cd in _0x50bcd2){if(_0x50bcd2[_0x7f88('0x2d')](_0x2a79cd)){_0x4f61fe[_0x7f88('0x42')](_0x50bcd2[_0x2a79cd],'clearqueuereport');delete _0x50bcd2[_0x2a79cd];}}}};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0x43')]=function(_0x3dae23,_0x419469,_0x49fbc0){io['to'](_0x3dae23)[_0x7f88('0x43')](_0x419469,_0x49fbc0);};VoiceQueueReport[_0x7f88('0xc')]['emitVoiceQueueChannelSave']=function(_0x587529,_0x451310){logger[_0x7f88('0x44')](_0x7f88('0x45')+_0x451310+_0x7f88('0x46'),_0x587529['uniqueid'],util['inspect'](_0x587529,{'showHidden':![],'depth':null}));this[_0x7f88('0x43')](util[_0x7f88('0x47')](_0x7f88('0x48'),_0x587529[_0x7f88('0x49')]),_0x7f88('0x4a'),_0x587529);io[_0x7f88('0x43')](_0x7f88('0x4b'),_0x587529);};VoiceQueueReport['prototype'][_0x7f88('0x42')]=function(_0x43c76c,_0xece533){logger[_0x7f88('0x44')](_0x7f88('0x45')+_0xece533+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x43c76c[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x43c76c,{'showHidden':![],'depth':null}));this[_0x7f88('0x43')](util[_0x7f88('0x47')](_0x7f88('0x48'),_0x43c76c[_0x7f88('0x49')]),_0x7f88('0x4d'),_0x43c76c);io['emit'](_0x7f88('0x4e'),_0x43c76c);};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0x4f')]=function(_0xd2ded9,_0x2870ca){if(_0xd2ded9[_0x7f88('0x50')]===_0x7f88('0x51')){var _0x25ef74={'id':_0xd2ded9['id'],'name':_0xd2ded9[_0x7f88('0x49')],'strategy':_0xd2ded9['strategy'],'answered':_0xd2ded9[_0x7f88('0x52')],'available':_0xd2ded9[_0x7f88('0x53')],'loggedIn':_0xd2ded9['loggedIn'],'pTalking':_0xd2ded9['pTalking'],'sumBillable':_0xd2ded9['sumBillable'],'sumDuration':_0xd2ded9['sumDuration'],'sumHoldTime':_0xd2ded9[_0x7f88('0x54')]||0x0,'talking':_0xd2ded9[_0x7f88('0x2f')],'total':_0xd2ded9[_0x7f88('0x55')],'type':_0xd2ded9[_0x7f88('0x50')],'unmanaged':_0xd2ded9[_0x7f88('0x56')],'abandoned':_0xd2ded9[_0x7f88('0x57')],'waiting':_0xd2ded9['waiting']};if(_0xd2ded9[_0x7f88('0x58')]){_0x25ef74[_0x7f88('0x58')]={'id':_0xd2ded9[_0x7f88('0x58')]['id'],'name':_0xd2ded9[_0x7f88('0x58')]['name'],'active':_0xd2ded9[_0x7f88('0x58')]['active'],'callerid':_0xd2ded9['Trunk'][_0x7f88('0x59')]};}if(_0xd2ded9['Interval']){_0x25ef74[_0x7f88('0x5a')]={'id':_0xd2ded9[_0x7f88('0x5a')]['id'],'name':_0xd2ded9[_0x7f88('0x5a')][_0x7f88('0x49')]};}var _0x18d865=md5(JSON['stringify'](_0x25ef74));if(_0xd2ded9['md5']!==_0x18d865){_0xd2ded9[_0x7f88('0x2')]=_0x18d865;logger[_0x7f88('0x44')](_0x7f88('0x5b')+_0x2870ca+_0x7f88('0x5c'),util['inspect'](_0x25ef74,{'showHidden':![],'depth':null}));this[_0x7f88('0x43')](util[_0x7f88('0x47')](_0x7f88('0x48'),_0x25ef74[_0x7f88('0x49')]),_0x7f88('0x5d'),_0x25ef74);}}};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0x5e')]=function(_0xae1b19){return _0xae1b19!==null&&!_[_0x7f88('0x5f')](_0xae1b19);};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0x2b')]=function(){var _0x4af2ea=this;setInterval(function(){_0x4af2ea[_0x7f88('0x33')]();ami[_0x7f88('0x38')]({'action':'queues'})['catch'](function(_0x3a7396){logger[_0x7f88('0x3c')](_0x7f88('0x60'),util[_0x7f88('0x3f')](_0x3a7396,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x7f88('0xc')]['loopQueueSummary']=function(){var _0x5c6ac7=this;setInterval(function(){if(_0x5c6ac7[_0x7f88('0x13')]){return ami[_0x7f88('0x38')]({'action':'queuesummary'})[_0x7f88('0x61')](function(_0x26a906){_0x5c6ac7[_0x7f88('0x13')]=![];})[_0x7f88('0x39')](function(_0xba9ba0){logger[_0x7f88('0x3c')](_0x7f88('0x62'),util[_0x7f88('0x3f')](_0xba9ba0,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0x17')]=function(_0x2eecdc){try{if(this[_0x7f88('0x5e')](_0x2eecdc)&&this['isNotNull'](_0x2eecdc[_0x7f88('0x63')])){logger['debug'](_0x7f88('0x64'),util[_0x7f88('0x3f')](_0x2eecdc,{'showHidden':![],'depth':null}));if(this[_0x7f88('0x12')][_0x2eecdc[_0x7f88('0x63')]]){logger[_0x7f88('0x65')](_0x7f88('0x66'),_0x2eecdc['queue']);var _0x5a1a49=_[_0x7f88('0x67')](this['channels'],_0x7f88('0x63'))[_0x2eecdc[_0x7f88('0x63')]]||0x0;var _0x1e10cb=_0x5a1a49-_0x2eecdc[_0x7f88('0x68')];if(this[_0x7f88('0x12')][_0x2eecdc[_0x7f88('0x63')]][_0x7f88('0x31')]!==_['toNumber'](_0x2eecdc[_0x7f88('0x68')])||this[_0x7f88('0x12')][_0x2eecdc[_0x7f88('0x63')]]['loggedIn']!==_['toNumber'](_0x2eecdc['loggedin'])||this[_0x7f88('0x12')][_0x2eecdc[_0x7f88('0x63')]]['available']!==_['toNumber'](_0x2eecdc[_0x7f88('0x53')])||this[_0x7f88('0x12')][_0x2eecdc['queue']][_0x7f88('0x2f')]!==_0x1e10cb){this['voiceQueues'][_0x2eecdc[_0x7f88('0x63')]][_0x7f88('0x31')]=_[_0x7f88('0x69')](_0x2eecdc[_0x7f88('0x68')]);this[_0x7f88('0x12')][_0x2eecdc[_0x7f88('0x63')]][_0x7f88('0x6a')]=_[_0x7f88('0x69')](_0x2eecdc[_0x7f88('0x6b')]);this['voiceQueues'][_0x2eecdc['queue']][_0x7f88('0x53')]=_['toNumber'](_0x2eecdc[_0x7f88('0x53')]);this[_0x7f88('0x12')][_0x2eecdc[_0x7f88('0x63')]][_0x7f88('0x2f')]=_0x1e10cb>0x0?_0x1e10cb:0x0;this['voiceQueues'][_0x2eecdc[_0x7f88('0x63')]][_0x7f88('0x2f')]=this[_0x7f88('0x12')][_0x2eecdc[_0x7f88('0x63')]][_0x7f88('0x2f')]>_['toNumber'](_0x2eecdc['loggedin'])?_[_0x7f88('0x69')](_0x2eecdc[_0x7f88('0x6b')]):this[_0x7f88('0x12')][_0x2eecdc[_0x7f88('0x63')]]['talking'];this[_0x7f88('0x4f')](this[_0x7f88('0x12')][_0x2eecdc[_0x7f88('0x63')]],_0x7f88('0x16'));}logger[_0x7f88('0x44')](_0x7f88('0x6c'),util[_0x7f88('0x3f')](this[_0x7f88('0x12')][_0x2eecdc['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0x7f88('0x6d'),this['voiceQueues'][_0x2eecdc[_0x7f88('0x63')]]);}}}catch(_0x131041){logger[_0x7f88('0x3c')](_0x7f88('0x62'),util['inspect'](_0x131041,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0x6e')]=function(_0x31c890){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x7f88('0x3f')](_0x31c890,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x7f88('0xc')]['syncQueueCallerJoin']=function(_0x1b5d13){try{if(this[_0x7f88('0x5e')](_0x1b5d13)){logger['debug'](_0x7f88('0x6f'),_0x1b5d13[_0x7f88('0x4c')],util['inspect'](_0x1b5d13,{'showHidden':![],'depth':null}));if(_['isUndefined'](this['queueReports'][_0x1b5d13[_0x7f88('0x4c')]]))this[_0x7f88('0xf')][_0x1b5d13[_0x7f88('0x4c')]]=[];if(_['isUndefined'](this[_0x7f88('0x34')][_0x1b5d13['uniqueid']]))this['channels'][_0x1b5d13[_0x7f88('0x4c')]]={};var _0x5c4d33=new QueueReport();_0x5c4d33[_0x7f88('0x49')]=_0x1b5d13[_0x7f88('0x63')];_0x5c4d33[_0x7f88('0x50')]=this['voiceQueues'][_0x5c4d33[_0x7f88('0x49')]]&&this['voiceQueues'][_0x5c4d33[_0x7f88('0x49')]][_0x7f88('0x50')]?this['voiceQueues'][_0x5c4d33['name']][_0x7f88('0x50')]||_0x7f88('0x51'):'inbound';_0x5c4d33['queue']=_0x1b5d13['queue'];_0x5c4d33[_0x7f88('0x70')]=moment()[_0x7f88('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c4d33['position']=_0x1b5d13[_0x7f88('0x71')];_0x5c4d33[_0x7f88('0x72')]=_0x1b5d13[_0x7f88('0x72')];_0x5c4d33['uniqueid']=_0x1b5d13[_0x7f88('0x4c')];_0x5c4d33[_0x7f88('0x73')]=this[_0x7f88('0x34')][_0x1b5d13['uniqueid']][_0x7f88('0x73')];logger[_0x7f88('0x65')](_0x7f88('0x74'),_0x5c4d33[_0x7f88('0x49')],_0x5c4d33[_0x7f88('0x50')]);_[_0x7f88('0x75')](_0x5c4d33,_[_0x7f88('0x76')](_0x1b5d13,_['keys'](_0x5c4d33)));this[_0x7f88('0xf')][_0x1b5d13['uniqueid']][_0x7f88('0x77')](_0x5c4d33);this[_0x7f88('0x34')][_0x1b5d13['uniqueid']]=_0x5c4d33;this[_0x7f88('0x78')](_0x5c4d33,_0x7f88('0x18'));}}catch(_0x3158d2){logger[_0x7f88('0x3c')](_0x7f88('0x6f'),_0x1b5d13[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x3158d2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7f88('0xc')]['syncQueueCallerAbandon']=function(_0x573d7d){try{if(this[_0x7f88('0x5e')](_0x573d7d)){logger[_0x7f88('0x44')](_0x7f88('0x79'),_0x573d7d[_0x7f88('0x4c')],util['inspect'](_0x573d7d,{'showHidden':![],'depth':null}));if(this[_0x7f88('0xf')][_0x573d7d[_0x7f88('0x4c')]]){var _0x3cdc82=_['last'](this[_0x7f88('0xf')][_0x573d7d[_0x7f88('0x4c')]]);_0x3cdc82[_0x7f88('0x7a')]=![];_0x3cdc82[_0x7f88('0x7b')]=null;_0x3cdc82[_0x7f88('0x7c')]=_0x573d7d[_0x7f88('0x7c')];_0x3cdc82[_0x7f88('0x7d')]=_0x573d7d[_0x7f88('0x7d')];_0x3cdc82[_0x7f88('0x1a')]=!![];_0x3cdc82[_0x7f88('0x7e')]=moment()[_0x7f88('0x47')](_0x7f88('0x7f'));_0x3cdc82[_0x7f88('0x80')]=_0x7f88('0x81');_0x3cdc82[_0x7f88('0x82')]=null;logger['info']('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x3cdc82[_0x7f88('0x49')],_0x3cdc82[_0x7f88('0x50')]);this[_0x7f88('0x34')][_0x573d7d[_0x7f88('0x4c')]]=_0x3cdc82;this[_0x7f88('0x42')](_0x3cdc82,'queuecallerabandon');}}}catch(_0x1dc351){logger[_0x7f88('0x3c')](_0x7f88('0x79'),_0x573d7d['uniqueid'],util[_0x7f88('0x3f')](_0x1dc351,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7f88('0x1d')]=function(_0x55d9bb){try{if(this[_0x7f88('0x5e')](_0x55d9bb)){logger[_0x7f88('0x44')](_0x7f88('0x83'),_0x55d9bb[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x55d9bb,{'showHidden':![],'depth':null}));if(this[_0x7f88('0xf')][_0x55d9bb[_0x7f88('0x4c')]]){var _0x1b2a55=_[_0x7f88('0x84')](this['queueReports'][_0x55d9bb[_0x7f88('0x4c')]]);_0x1b2a55[_0x7f88('0x85')]=moment()[_0x7f88('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x1b2a55['connectedlinenum']=_0x55d9bb[_0x7f88('0x86')];_0x1b2a55[_0x7f88('0x87')]=_0x55d9bb[_0x7f88('0x87')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x1b2a55[_0x7f88('0x49')],_0x1b2a55[_0x7f88('0x50')],_0x55d9bb[_0x7f88('0x86')],_0x55d9bb['connectedlinename']);this[_0x7f88('0x34')][_0x55d9bb[_0x7f88('0x4c')]]=_0x1b2a55;this['emitVoiceQueueChannelSave'](_0x1b2a55,_0x7f88('0x1c'));}}}catch(_0x33db26){logger[_0x7f88('0x3c')](_0x7f88('0x83'),_0x55d9bb[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x33db26,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7f88('0x21')]=function(_0x3e0b7f){try{if(this[_0x7f88('0x5e')](_0x3e0b7f)){logger[_0x7f88('0x44')](_0x7f88('0x88'),_0x3e0b7f[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x3e0b7f,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3e0b7f[_0x7f88('0x4c')]]){var _0x4cc046=_['last'](this[_0x7f88('0xf')][_0x3e0b7f[_0x7f88('0x4c')]]);_0x4cc046['queuecallercomplete']=!![];_0x4cc046[_0x7f88('0x80')]=_0x7f88('0x89');logger[_0x7f88('0x65')](_0x7f88('0x8a'),_0x4cc046[_0x7f88('0x49')],_0x4cc046[_0x7f88('0x50')]);}}}catch(_0x556701){logger[_0x7f88('0x3c')](_0x7f88('0x88'),_0x3e0b7f[_0x7f88('0x4c')],util['inspect'](_0x556701,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0x1f')]=function(_0x58f388){try{if(this['isNotNull'](_0x58f388)){logger[_0x7f88('0x44')](_0x7f88('0x8b'),_0x58f388[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x58f388,{'showHidden':![],'depth':null}));if(this[_0x7f88('0xf')][_0x58f388[_0x7f88('0x4c')]]){var _0x6ade8f=_[_0x7f88('0x84')](this['queueReports'][_0x58f388[_0x7f88('0x4c')]]);_0x6ade8f[_0x7f88('0x1a')]=![];_0x6ade8f[_0x7f88('0x7e')]=null;_0x6ade8f['assigned']=!![];_0x6ade8f[_0x7f88('0x82')]=_0x58f388[_0x7f88('0x8c')];_0x6ade8f[_0x7f88('0x7c')]=_0x58f388['holdtime'];_0x6ade8f[_0x7f88('0x7a')]=!![];_0x6ade8f[_0x7f88('0x8d')]=![];_0x6ade8f['queuecallerexitAt']=null;if(!_0x6ade8f['transfer']){if(_0x58f388[_0x7f88('0x8e')]==_0x7f88('0x8f')){_0x6ade8f[_0x7f88('0x80')]=_0x7f88('0x90');logger[_0x7f88('0x65')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x6ade8f[_0x7f88('0x49')],_0x6ade8f[_0x7f88('0x50')]);}else{if(_['startsWith'](_0x58f388[_0x7f88('0x91')][_0x7f88('0x92')](),_0x7f88('0x93'))){if(this['queueReports'][_0x58f388[_0x7f88('0x94')]]){var _0x368413=_['last'](this[_0x7f88('0xf')][_0x58f388[_0x7f88('0x94')]]);_0x368413[_0x7f88('0x7a')]=![];_0x368413[_0x7f88('0x8d')]=!![];_0x368413[_0x7f88('0x95')]=moment(_0x6ade8f[_0x7f88('0x70')])[_0x7f88('0x96')](_0x58f388[_0x7f88('0x7c')],'seconds')[_0x7f88('0x47')](_0x7f88('0x7f'));_0x368413[_0x7f88('0x80')]=_0x7f88('0x97');_0x368413[_0x7f88('0x8f')]=!![];_0x368413[_0x7f88('0x98')]=_0x7f88('0x99');_0x368413['transferexten']=_0x58f388[_0x7f88('0x9a')];_0x368413[_0x7f88('0x9b')]=_0x58f388[_0x7f88('0x4c')];logger[_0x7f88('0x65')](_0x7f88('0x9c'),_0x368413[_0x7f88('0x49')],_0x368413[_0x7f88('0x50')]);var _0x1d44b9=this[_0x7f88('0xf')][_0x58f388[_0x7f88('0x94')]];this['queueReports'][_0x58f388['linkedid']]=this[_0x7f88('0xf')][_0x58f388[_0x7f88('0x4c')]];this[_0x7f88('0xf')][_0x58f388[_0x7f88('0x4c')]]=_0x1d44b9;}}else{_0x6ade8f[_0x7f88('0x80')]='COMPLETEDBY'+_0x58f388[_0x7f88('0x8e')][_0x7f88('0x9d')]();logger[_0x7f88('0x65')](_0x7f88('0x9e'),_0x6ade8f[_0x7f88('0x49')],_0x6ade8f[_0x7f88('0x50')],_0x6ade8f[_0x7f88('0x80')]);}}}this['channels'][_0x58f388['uniqueid']]=_0x6ade8f;this['emitVoiceQueueChannelRemove'](_0x6ade8f,'agentcomplete');}}}catch(_0x41c591){logger[_0x7f88('0x3c')]('[%s][voiceQueueReport][agentcomplete]',_0x58f388[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x41c591,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7f88('0x9f')]=function(_0x299a79){try{if(this[_0x7f88('0x5e')](_0x299a79)){logger[_0x7f88('0x44')](_0x7f88('0xa0'),_0x299a79['uniqueid'],util[_0x7f88('0x3f')](_0x299a79,{'showHidden':![],'depth':null}));this[_0x7f88('0xa1')](_0x299a79[_0x7f88('0x4c')],_[_0x7f88('0xa2')](_0x299a79[_0x7f88('0xa3')])[0x0],_0x299a79[_0x7f88('0xa4')]);if(this[_0x7f88('0xf')][_0x299a79['uniqueid']]){var _0x5db04d=_['last'](this[_0x7f88('0xf')][_0x299a79[_0x7f88('0x4c')]]);if(_0x5db04d){if(this[_0x7f88('0x5e')](_0x299a79[_0x7f88('0xa3')])&&this[_0x7f88('0x5e')](_0x299a79[_0x7f88('0xa3')][_0x7f88('0xa5')])){switch(_0x299a79[_0x7f88('0xa4')]){case'CONTINUE':_0x5db04d[_0x7f88('0x8d')]=![];_0x5db04d[_0x7f88('0x95')]=null;break;case'TIMEOUT':_0x5db04d['lastevent']=_0x7f88('0xa6');_0x5db04d['queuecallerexit']=!![];_0x5db04d[_0x7f88('0x95')]=moment()['format'](_0x7f88('0x7f'));_0x5db04d[_0x7f88('0x85')]=moment()[_0x7f88('0x47')](_0x7f88('0x7f'));logger['debug'](_0x7f88('0xa7'),_0x299a79['uniqueid'],util[_0x7f88('0x3f')](_0x5db04d,{'showHidden':![],'depth':null}));ami[_0x7f88('0x43')](_0x7f88('0xa8'),_0x5db04d);break;default:_0x5db04d[_0x7f88('0x8d')]=!![];_0x5db04d[_0x7f88('0x95')]=moment()[_0x7f88('0x47')](_0x7f88('0x7f'));_0x5db04d[_0x7f88('0x85')]=moment()[_0x7f88('0x47')]('YYYY-MM-DD\x20HH:mm:ss');}_0x5db04d[_0x7f88('0x1a')]=![];_0x5db04d[_0x7f88('0x7e')]=null;_0x5db04d['queuecallerexitreason']=_0x299a79['value'];this['channels'][_0x299a79[_0x7f88('0x4c')]]=_0x5db04d;this[_0x7f88('0x42')](_0x5db04d,_0x7f88('0xa9'));}else if(this['isNotNull'](_0x299a79[_0x7f88('0xa3')])&&this[_0x7f88('0x5e')](_0x299a79[_0x7f88('0xa3')][_0x7f88('0xaa')])){if(!_0x5db04d[_0x7f88('0x1a')]){_0x5db04d[_0x7f88('0x8d')]=!![];_0x5db04d[_0x7f88('0x95')]=moment()[_0x7f88('0x47')](_0x7f88('0x7f'));_0x5db04d['queuecallerexitreason']='EXITWITHKEY';_0x5db04d[_0x7f88('0x85')]=moment()[_0x7f88('0x47')](_0x7f88('0x7f'));this[_0x7f88('0x34')][_0x299a79[_0x7f88('0x4c')]]=_0x5db04d;}}logger[_0x7f88('0x65')](_0x7f88('0xab'),_0x299a79[_0x7f88('0x4c')],_0x5db04d[_0x7f88('0x49')],_0x5db04d[_0x7f88('0x50')],_['keys'](_0x299a79[_0x7f88('0xa3')])[0x0],_0x299a79[_0x7f88('0xa4')]);_0x5db04d[_0x7f88('0x15')]=this[_0x7f88('0x15')][_0x299a79['uniqueid']];}}}}catch(_0x9479){logger[_0x7f88('0x3c')]('[%s][voiceQueueReport][varset]',_0x299a79[_0x7f88('0x4c')],util['inspect'](_0x9479,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0xa1')]=function(_0x56d1cd,_0x59ae1f,_0x2ea78c){var _0x3dccf3=[_0x7f88('0xac'),_0x7f88('0xad'),_0x7f88('0xae'),_0x7f88('0xaf'),_0x7f88('0xb0'),_0x7f88('0xb1'),'rtpaudioqosrtt',_0x7f88('0xb2'),'sipcallid',_0x7f88('0xb3'),_0x7f88('0xb4'),_0x7f88('0xb5'),'membercalls',_0x7f88('0xb6'),_0x7f88('0xb7'),_0x7f88('0xb8'),_0x7f88('0x8c'),_0x7f88('0xb9'),_0x7f88('0xba')];if(!_[_0x7f88('0x37')](_0x59ae1f)&&!_[_0x7f88('0xbb')](_0x3dccf3,_0x59ae1f)){if(_[_0x7f88('0x5f')](this[_0x7f88('0x15')][_0x56d1cd])){this[_0x7f88('0x15')][_0x56d1cd]={};}this[_0x7f88('0x15')][_0x56d1cd][_0x59ae1f]=_0x2ea78c;}};VoiceQueueReport[_0x7f88('0xc')]['syncHangup']=function(_0x173408){try{if(this[_0x7f88('0x5e')](_0x173408)){logger[_0x7f88('0x44')](_0x7f88('0xbc'),_0x173408[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x173408,{'showHidden':![],'depth':null}));if(this[_0x7f88('0xf')][_0x173408['uniqueid']]){for(var _0x5705c4=0x0,_0x4d1e74={};_0x5705c4<this[_0x7f88('0xf')][_0x173408[_0x7f88('0x4c')]][_0x7f88('0xbd')];_0x5705c4+=0x1){_0x4d1e74=this['queueReports'][_0x173408['uniqueid']][_0x5705c4];if(this[_0x7f88('0x12')][_0x4d1e74[_0x7f88('0x63')]]){if(_0x4d1e74['queuecallerexit']&&_0x4d1e74[_0x7f88('0x8f')]!=!![]){this[_0x7f88('0x12')][_0x4d1e74[_0x7f88('0x63')]][_0x7f88('0x56')]+=0x1;}if(_0x4d1e74[_0x7f88('0x1a')]){this[_0x7f88('0x12')][_0x4d1e74[_0x7f88('0x63')]][_0x7f88('0x57')]+=0x1;}this[_0x7f88('0x12')][_0x4d1e74[_0x7f88('0x63')]][_0x7f88('0x54')]+=moment(_0x4d1e74[_0x7f88('0x85')])[_0x7f88('0xbe')](_0x4d1e74[_0x7f88('0x70')],_0x7f88('0xbf'))||0x0;if(_0x5705c4===this[_0x7f88('0xf')][_0x173408['uniqueid']][_0x7f88('0xbd')]-0x1){this['voiceQueues'][_0x4d1e74['queue']][_0x7f88('0xc0')]+=moment()['milliseconds'](0x0)['diff'](_0x4d1e74[_0x7f88('0x70')],'seconds');this[_0x7f88('0x12')][_0x4d1e74[_0x7f88('0x63')]]['total']+=0x1;if(_0x4d1e74[_0x7f88('0x7a')]){this['voiceQueues'][_0x4d1e74[_0x7f88('0x63')]]['answered']+=0x1;this[_0x7f88('0x12')][_0x4d1e74['queue']][_0x7f88('0xc1')]+=moment()[_0x7f88('0xc2')](0x0)[_0x7f88('0xbe')](_0x4d1e74[_0x7f88('0x85')],'seconds');_0x4d1e74['queuecallercompleteAt']=moment()[_0x7f88('0x47')](_0x7f88('0x7f'));_0x4d1e74[_0x7f88('0x8d')]=![];_0x4d1e74[_0x7f88('0x95')]=null;}if(_0x4d1e74[_0x7f88('0x8d')]&&_0x4d1e74[_0x7f88('0x8f')]!=!![]){_0x4d1e74[_0x7f88('0xc3')]='unmanaged';logger[_0x7f88('0x44')](_0x7f88('0xc4'),_0x173408[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x4d1e74,{'showHidden':![],'depth':null}));ami[_0x7f88('0x43')]('custom:queuecallerunmanaged',_0x4d1e74);}if(_0x4d1e74['queuecallerabandon']){_0x4d1e74[_0x7f88('0xc3')]=_0x7f88('0x57');logger[_0x7f88('0x44')](_0x7f88('0xc5'),_0x173408[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x4d1e74,{'showHidden':![],'depth':null}));ami[_0x7f88('0x43')](_0x7f88('0xc6'),_0x4d1e74);}}else{this['voiceQueues'][_0x4d1e74['queue']]['sumDuration']+=this[_0x7f88('0x12')][_0x4d1e74[_0x7f88('0x63')]][_0x7f88('0x54')];}logger[_0x7f88('0x65')](_0x7f88('0xc7'),_0x173408[_0x7f88('0x4c')],_0x4d1e74[_0x7f88('0x49')],_0x4d1e74[_0x7f88('0x50')],_0x173408[_0x7f88('0xc8')]);this['channels'][_0x173408[_0x7f88('0x4c')]]=_0x4d1e74;this[_0x7f88('0x42')](_0x4d1e74,_0x7f88('0x22'));this['emitVoiceQueueSummary'](this[_0x7f88('0x12')][_0x4d1e74[_0x7f88('0x63')]],'hangup');}}logger[_0x7f88('0x44')](_0x7f88('0xc9'),_0x173408[_0x7f88('0x4c')],util[_0x7f88('0x3f')](this['queueReports'][_0x173408[_0x7f88('0x4c')]],{'showHidden':![],'depth':null}));ami[_0x7f88('0x43')](_0x7f88('0xca'),this['queueReports'][_0x173408[_0x7f88('0x4c')]]);delete this['queueReports'][_0x173408[_0x7f88('0x4c')]];delete this[_0x7f88('0x34')][_0x173408[_0x7f88('0x4c')]];}if(this[_0x7f88('0x15')][_0x173408['uniqueid']]){delete this[_0x7f88('0x15')][_0x173408[_0x7f88('0x4c')]];}}}catch(_0x50b129){logger[_0x7f88('0x3c')](_0x7f88('0xbc'),_0x173408[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x50b129,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7f88('0xcb')]=function(_0x31e475){try{if(this['isNotNull'](_0x31e475)){logger[_0x7f88('0x44')](_0x7f88('0xcc'),_0x31e475[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x31e475,{'showHidden':![],'depth':null}));var _0xadd8d2;if(this['queueReports'][_0x31e475[_0x7f88('0xcd')]]){_0xadd8d2=_[_0x7f88('0x84')](this[_0x7f88('0xf')][_0x31e475[_0x7f88('0xcd')]]);_0xadd8d2[_0x7f88('0xce')]=_0x31e475[_0x7f88('0xcf')];_0xadd8d2['transferuniqueid']=_0x31e475[_0x7f88('0xd0')];_0xadd8d2['queuecallerexitreason']=_0x7f88('0xd1');_0xadd8d2['transfer']=!![];_0xadd8d2['transfertype']=_0x7f88('0xd2');if(this[_0x7f88('0xf')][_0x31e475['secondtransfereruniqueid']]){var _0x53a7b5=this['queueReports'][_0x31e475[_0x7f88('0xd0')]];this['queueReports'][_0x31e475[_0x7f88('0xd0')]]=this['queueReports'][_0x31e475[_0x7f88('0xcd')]];this[_0x7f88('0xf')][_0x31e475[_0x7f88('0xcd')]]=_0x53a7b5;var _0x401929=_[_0x7f88('0x84')](this['queueReports'][_0x31e475[_0x7f88('0xcd')]]);_0x401929[_0x7f88('0x35')]=!![];}logger[_0x7f88('0x65')](_0x7f88('0xd3'),_0x31e475[_0x7f88('0x4c')],_0xadd8d2[_0x7f88('0x49')],_0xadd8d2[_0x7f88('0x50')],_0xadd8d2[_0x7f88('0xce')],_0xadd8d2[_0x7f88('0x9b')]);}else if(this[_0x7f88('0xf')][_0x31e475[_0x7f88('0xd4')]]){_0xadd8d2=_['last'](this[_0x7f88('0xf')][_0x31e475['transfertargetuniqueid']]);_0xadd8d2[_0x7f88('0xce')]=_0x31e475[_0x7f88('0xd5')];_0xadd8d2['transferuniqueid']=_0x31e475['origtransfereruniqueid'];_0xadd8d2[_0x7f88('0x80')]=_0x7f88('0xd1');_0xadd8d2[_0x7f88('0x8f')]=!![];_0xadd8d2['transfertype']=_0x7f88('0xd2');if(this['queueReports'][_0x31e475[_0x7f88('0xd6')]]){var _0x53a7b5=this[_0x7f88('0xf')][_0x31e475['origtransfereruniqueid']];this[_0x7f88('0xf')][_0x31e475['origtransfereruniqueid']]=this['queueReports'][_0x31e475[_0x7f88('0xd4')]];this[_0x7f88('0xf')][_0x31e475[_0x7f88('0xd4')]]=_0x53a7b5;var _0x401929=_[_0x7f88('0x84')](this[_0x7f88('0xf')][_0x31e475[_0x7f88('0xd4')]]);_0x401929[_0x7f88('0x35')]=!![];}logger[_0x7f88('0x65')](_0x7f88('0xd3'),_0x31e475[_0x7f88('0x4c')],_0xadd8d2['name'],_0xadd8d2[_0x7f88('0x50')],_0xadd8d2[_0x7f88('0xce')],_0xadd8d2['transferuniqueid']);}}}catch(_0x4f3320){logger[_0x7f88('0x3c')](_0x7f88('0xcc'),_0x31e475['uniqueid'],util['inspect'](_0x4f3320,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7f88('0x29')]=function(_0x539da0){try{if(this['isNotNull'](_0x539da0)){logger['debug'](_0x7f88('0xd7'),_0x539da0[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x539da0,{'showHidden':![],'depth':null}));if(this[_0x7f88('0xf')][_0x539da0['transfereeuniqueid']]){var _0x1acad6=_[_0x7f88('0x84')](this[_0x7f88('0xf')][_0x539da0[_0x7f88('0xcd')]]);_0x1acad6['queuecallerexitreason']='BLINDTRANSFER';_0x1acad6[_0x7f88('0x8f')]=!![];_0x1acad6[_0x7f88('0x98')]='BLIND';_0x1acad6[_0x7f88('0xce')]=_0x539da0[_0x7f88('0xd8')];_0x1acad6['transferuniqueid']=_0x539da0[_0x7f88('0xcd')];logger[_0x7f88('0x65')](_0x7f88('0xd9'),_0x539da0[_0x7f88('0x4c')],_0x1acad6['name'],_0x1acad6['type'],_0x1acad6[_0x7f88('0xce')],_0x1acad6[_0x7f88('0x9b')]);this[_0x7f88('0xda')]({'event':_0x7f88('0xdb'),'uniqueid':_0x539da0[_0x7f88('0xcd')],'context':_0x539da0['context'],'channel':_0x539da0[_0x7f88('0xdc')]});}}}catch(_0x968495){logger[_0x7f88('0x3c')]('[%s][voiceQueueReport][blindtransfer]',_0x539da0[_0x7f88('0x4c')],util['inspect'](_0x968495,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7f88('0x24')]=function(_0x39b4a8){try{if(this[_0x7f88('0x5e')](_0x39b4a8)){logger[_0x7f88('0x44')](_0x7f88('0xdd'),_0x39b4a8[_0x7f88('0x4c')],util[_0x7f88('0x3f')](_0x39b4a8,{'showHidden':![],'depth':null}));if(this[_0x7f88('0xf')][_0x39b4a8[_0x7f88('0x4c')]]){var _0x1ed27a=_[_0x7f88('0x84')](this['queueReports'][_0x39b4a8[_0x7f88('0x4c')]]);if(!_['isNil'](_0x1ed27a[_0x7f88('0x85')])){_0x1ed27a[_0x7f88('0xde')]=moment()[_0x7f88('0x47')](_0x7f88('0x7f'));logger[_0x7f88('0x65')](_0x7f88('0xdf'),_0x39b4a8[_0x7f88('0x4c')],_0x1ed27a[_0x7f88('0xde')]);}}}}catch(_0xf2de4a){logger[_0x7f88('0x3c')]('[%s][voiceQueueReport][musiconholdstart]',_0x39b4a8[_0x7f88('0x4c')],util['inspect'](_0xf2de4a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7f88('0xc')]['syncMusicOnHoldStop']=function(_0x4e241b){try{if(this[_0x7f88('0x5e')](_0x4e241b)){logger[_0x7f88('0x44')]('[%s][voiceQueueReport][musiconholdstop]',_0x4e241b['uniqueid'],util['inspect'](_0x4e241b,{'showHidden':![],'depth':null}));if(this[_0x7f88('0xf')][_0x4e241b[_0x7f88('0x4c')]]){var _0x1df566=_[_0x7f88('0x84')](this[_0x7f88('0xf')][_0x4e241b[_0x7f88('0x4c')]]);if(!_['isNil'](_0x1df566[_0x7f88('0xde')])){_0x1df566['mohtime']+=moment()[_0x7f88('0xc2')](0x0)['diff'](_0x1df566[_0x7f88('0xde')],'seconds');logger[_0x7f88('0x65')](_0x7f88('0xe0'),_0x4e241b[_0x7f88('0x4c')],_0x1df566[_0x7f88('0xe1')]);delete _0x1df566[_0x7f88('0xde')];}}}}catch(_0x5dddae){logger[_0x7f88('0x3c')](_0x7f88('0xe2'),_0x4e241b['uniqueid'],util['inspect'](_0x5dddae,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7f88('0xc')][_0x7f88('0xe3')]=function(_0x272226){try{if(this[_0x7f88('0x5e')](_0x272226)){logger[_0x7f88('0x44')](_0x7f88('0xe4'),_0x272226[_0x7f88('0x4c')],util['inspect'](_0x272226,{'showHidden':![],'depth':null}));if(_0x272226[_0x7f88('0xe5')][_0x7f88('0x92')]()==='set'){_0x272226[_0x7f88('0xe6')]=_0x272226['appdata']&&_0x272226[_0x7f88('0xe7')][_0x7f88('0xe8')](_0x7f88('0xe9'))?_0x272226[_0x7f88('0xe7')]:(_0x272226['appdata']||_0x272226[_0x7f88('0xe6')])[_0x7f88('0x92')]();if(_['startsWith'](_0x272226['applicationdata'][_0x7f88('0x92')](),_0x7f88('0xea'))){logger['info'](_0x7f88('0xeb'),_0x272226['uniqueid'],_0x272226['application'],_0x272226[_0x7f88('0xe6')]);if(_[_0x7f88('0x5f')](this['channels'][_0x272226[_0x7f88('0x4c')]]))this['channels'][_0x272226['uniqueid']]={};var _0x49916e=_0x272226[_0x7f88('0xe6')][_0x7f88('0xec')]('=');var _0x69cb97=_0x49916e[0x0]['toLowerCase']()[_0x7f88('0xed')](/cdr\((.*)\)/);if(_0x69cb97)this[_0x7f88('0x34')][_0x272226[_0x7f88('0x4c')]][_0x69cb97[0x1]]=_0x49916e[0x1];}}}}catch(_0x1e0cc5){logger[_0x7f88('0x3c')](_0x7f88('0xee'),_0x272226[_0x7f88('0x4c')],util['inspect'](_0x1e0cc5,{'showHidden':![],'depth':null}));}};module[_0x7f88('0xef')]=VoiceQueueReport;
\ No newline at end of file
+var _0x0767=['[voiceQueueReport][queuesummary]\x20name:%s','callers','toNumber','loggedin','custom:queuesummary','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','isNotNull','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','inbound','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','merge','pick','push','queuecallerjoin','[%s][voiceQueueReport][queuecallerabandon]','queuecallercomplete','queuecallercompleteAt','originalposition','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','assigned','membername','holdtime','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','FORWARDTRANSFER','transfertype','transferexten','destexten','transferuniqueid','COMPLETEDBY','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','agentcomplete','[%s][voiceQueueReport][varset]','addVariable','variable','value','queuestatus','CONTINUE','TIMEOUT','lastevent','custom:timeout','varset','queueposition','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','keys','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberlastcall','memberpenalty','memberrealtime','includes','handleHangup','length','abandoned','diff','sumBillable','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','hangup','emitVoiceQueueSummary','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','cause-txt','cause','transferid','transfereeuniqueid','secondtransfereruniqueid','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','secondtransfererexten','[%s][voiceQueueReport][attendedtransfer]','[%s][voiceQueueReport][blindtransfer]','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][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','match','exports','lodash','moment','util','md5','../../../config/logger','ami','../ami','../model/queueReport','defaults','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','agents','channels','queueChannels','voiceQueues','flagQueueSummary','variables','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentconnect','syncAgentConnect','syncVarSet','syncHangup','syncFullyBooted','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','switch','isNil','channel','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','queueReports','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','campaigns','emitVoiceQueueChannelRemove','clearqueuereport','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','emit','format','voice_queue_channel:save','voice_queue_presence:save','ATTENDEDTRANSFER','voice:queue:%s','name','voice_queue_channel:remove','voice_queue_presence:remove','type','strategy','answered','available','loggedIn','sumDuration','sumHoldTime','total','unmanaged','Trunk','active','callerid','Interval','stringify','voice_queue:save','loopQueueShow','clearZombieChannels','Action','queues','catch','[voiceQueueReport][queues]','then','queue','[voiceQueueReport][queuesummary]\x20event:','info'];(function(_0x3c8324,_0x2e94a9){var _0x5399f5=function(_0x4acae6){while(--_0x4acae6){_0x3c8324['push'](_0x3c8324['shift']());}};_0x5399f5(++_0x2e94a9);}(_0x0767,0x85));var _0x7076=function(_0x2e737e,_0x296b8e){_0x2e737e=_0x2e737e-0x0;var _0x518258=_0x0767[_0x2e737e];return _0x518258;};'use strict';var _=require(_0x7076('0x0'));var moment=require(_0x7076('0x1'));var util=require(_0x7076('0x2'));var md5=require(_0x7076('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x7076('0x4'))(_0x7076('0x5'));var ami=require(_0x7076('0x6'));var QueueReport=require(_0x7076('0x7'));config['redis']=_[_0x7076('0x8')](config[_0x7076('0x9')],{'host':_0x7076('0xa'),'port':0x18eb});var io=require(_0x7076('0xb'))(new Redis(config[_0x7076('0x9')]));var Sequence=function(){};Sequence[_0x7076('0xc')][_0x7076('0xd')]=function(_0x16ee17){this['tail']=this['tail']?this[_0x7076('0xe')][_0x7076('0xf')](_0x16ee17):_0x16ee17();};function VoiceQueueReport(_0x1685e7){this['sequence']=new Sequence();this['queueReports']={};this[_0x7076('0x10')]=_0x1685e7[_0x7076('0x10')];this[_0x7076('0x11')]=_0x1685e7[_0x7076('0x12')];this['voiceQueues']=_0x1685e7[_0x7076('0x13')];this[_0x7076('0x14')]=!![];this['campaigns']=_0x1685e7['campaigns'];this[_0x7076('0x15')]={};ami['on'](_0x7076('0x16'),this[_0x7076('0x17')][_0x7076('0x18')](this));ami['on'](_0x7076('0x19'),this[_0x7076('0x1a')][_0x7076('0x18')](this));ami['on']('queuecallerjoin',this[_0x7076('0x1b')][_0x7076('0x18')](this));ami['on'](_0x7076('0x1c'),this[_0x7076('0x1d')][_0x7076('0x18')](this));ami['on'](_0x7076('0x1e'),this[_0x7076('0x1f')]['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x7076('0x18')](this));ami['on'](_0x7076('0x20'),this[_0x7076('0x21')][_0x7076('0x18')](this));ami['on']('varset',this[_0x7076('0x22')]['bind'](this));ami['on']('hangup',this[_0x7076('0x23')][_0x7076('0x18')](this));ami['on']('fullybooted',this[_0x7076('0x24')][_0x7076('0x18')](this));ami['on'](_0x7076('0x25'),this['syncMusicOnHoldStart'][_0x7076('0x18')](this));ami['on'](_0x7076('0x26'),this[_0x7076('0x27')][_0x7076('0x18')](this));ami['on'](_0x7076('0x28'),this[_0x7076('0x29')][_0x7076('0x18')](this));ami['on'](_0x7076('0x2a'),this[_0x7076('0x2b')][_0x7076('0x18')](this));this[_0x7076('0x2c')]();this['loopQueueShow']();}function clearChannels(_0x56654f){if(!_[_0x7076('0x2d')](_0x56654f)){for(var _0x10408a in _0x56654f){if(_0x56654f[_0x7076('0x2e')](_0x10408a)){delete _0x56654f[_0x10408a];}}}}function clearCampaigns(_0x2205c4){if(!_[_0x7076('0x2d')](_0x2205c4)){for(var _0x3df135 in _0x2205c4){if(_0x2205c4[_0x7076('0x2e')](_0x3df135)){_0x2205c4[_0x3df135][_0x7076('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x28660b){if(!_[_0x7076('0x2d')](_0x28660b)){for(var _0x37368e in _0x28660b){if(_0x28660b[_0x7076('0x2e')](_0x37368e)){_0x28660b[_0x37368e][_0x7076('0x2f')]=0x0;_0x28660b[_0x37368e][_0x7076('0x30')]=0x0;_0x28660b[_0x37368e][_0x7076('0x31')]=0x0;_0x28660b[_0x37368e][_0x7076('0x32')]=0x0;_0x28660b[_0x37368e][_0x7076('0x33')]=!![];}}}}function clearAgentBooked(_0x7083d2){if(!_[_0x7076('0x2d')](_0x7083d2)){for(var _0x1bd027 in _0x7083d2){if(_0x7083d2[_0x7076('0x2e')](_0x1bd027)){_0x7083d2[_0x1bd027][_0x7076('0x34')]=!![];}}}}VoiceQueueReport[_0x7076('0xc')]['clearZombieChannels']=function(){var _0x167ddf=this;for(var _0x11c037 in this[_0x7076('0x11')]){if(this[_0x7076('0x11')][_0x7076('0x2e')](_0x11c037)&&!this['channels'][_0x11c037][_0x7076('0x35')]){this['sequence']['enqueue'](function(){if(!_[_0x7076('0x36')](_0x167ddf[_0x7076('0x11')][_0x11c037])){return ami['Action']({'action':'status','channel':_0x167ddf[_0x7076('0x11')][_0x11c037][_0x7076('0x37')]})['catch'](function(_0x3dbbaf){if(_0x3dbbaf[_0x7076('0x38')]===_0x7076('0x39')){setTimeout(function(){if(_0x167ddf[_0x7076('0x11')][_0x11c037]){delete _0x167ddf[_0x7076('0x11')][_0x11c037];logger[_0x7076('0x3a')](_0x7076('0x3b'),_0x11c037,util[_0x7076('0x3c')](_0x3dbbaf,{'showHidden':![],'depth':null}));}if(_0x167ddf[_0x7076('0x3d')][_0x11c037]){delete _0x167ddf['queueReports'][_0x11c037];logger['error']('[%s][voiceQueueReport][checkQueueReport]',_0x11c037,util[_0x7076('0x3c')](_0x3dbbaf,{'showHidden':![],'depth':null}));}if(_0x167ddf[_0x7076('0x15')][_0x11c037]){delete _0x167ddf[_0x7076('0x15')][_0x11c037];logger[_0x7076('0x3a')](_0x7076('0x3e'),_0x11c037,util[_0x7076('0x3c')](_0x3dbbaf,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x24')]=function(){logger['error'](_0x7076('0x3f'));clearChannels(this[_0x7076('0x11')]);this[_0x7076('0x40')](this[_0x7076('0x3d')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x7076('0x13')]);clearCampaigns(this[_0x7076('0x41')]);};VoiceQueueReport[_0x7076('0xc')]['clearQueueReport']=function(_0x4df214){var _0x3e629d=this;if(!_[_0x7076('0x2d')](_0x4df214)){for(var _0x592074 in _0x4df214){if(_0x4df214[_0x7076('0x2e')](_0x592074)){_0x3e629d[_0x7076('0x42')](_0x4df214[_0x592074],_0x7076('0x43'));delete _0x4df214[_0x592074];}}}};VoiceQueueReport[_0x7076('0xc')]['emit']=function(_0x4c4649,_0x41ebb9,_0x143733){io['to'](_0x4c4649)['emit'](_0x41ebb9,_0x143733);};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x44')]=function(_0xeafbc7,_0x4841d8){logger[_0x7076('0x45')](_0x7076('0x46')+_0x4841d8+_0x7076('0x47'),_0xeafbc7[_0x7076('0x48')],util[_0x7076('0x3c')](_0xeafbc7,{'showHidden':![],'depth':null}));this[_0x7076('0x49')](util[_0x7076('0x4a')]('voice:queue:%s',_0xeafbc7['name']),_0x7076('0x4b'),_0xeafbc7);io[_0x7076('0x49')](_0x7076('0x4c'),_0xeafbc7);};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x42')]=function(_0x2fdd47,_0x935ffc){logger[_0x7076('0x45')](_0x7076('0x46')+_0x935ffc+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x2fdd47[_0x7076('0x48')],util[_0x7076('0x3c')](_0x2fdd47,{'showHidden':![],'depth':null}));if(_0x2fdd47['queuecallerexitreason']===_0x7076('0x4d'))return;this[_0x7076('0x49')](util[_0x7076('0x4a')](_0x7076('0x4e'),_0x2fdd47[_0x7076('0x4f')]),_0x7076('0x50'),_0x2fdd47);io[_0x7076('0x49')](_0x7076('0x51'),_0x2fdd47);};VoiceQueueReport[_0x7076('0xc')]['emitVoiceQueueSummary']=function(_0x4e9501,_0x1de28d){if(_0x4e9501[_0x7076('0x52')]==='inbound'){var _0x3ba668={'id':_0x4e9501['id'],'name':_0x4e9501['name'],'strategy':_0x4e9501[_0x7076('0x53')],'answered':_0x4e9501[_0x7076('0x54')],'available':_0x4e9501[_0x7076('0x55')],'loggedIn':_0x4e9501[_0x7076('0x56')],'pTalking':_0x4e9501[_0x7076('0x31')],'sumBillable':_0x4e9501['sumBillable'],'sumDuration':_0x4e9501[_0x7076('0x57')],'sumHoldTime':_0x4e9501[_0x7076('0x58')]||0x0,'talking':_0x4e9501[_0x7076('0x30')],'total':_0x4e9501[_0x7076('0x59')],'type':_0x4e9501['type'],'unmanaged':_0x4e9501[_0x7076('0x5a')],'abandoned':_0x4e9501['abandoned'],'waiting':_0x4e9501[_0x7076('0x32')]};if(_0x4e9501[_0x7076('0x5b')]){_0x3ba668[_0x7076('0x5b')]={'id':_0x4e9501[_0x7076('0x5b')]['id'],'name':_0x4e9501[_0x7076('0x5b')][_0x7076('0x4f')],'active':_0x4e9501[_0x7076('0x5b')][_0x7076('0x5c')],'callerid':_0x4e9501[_0x7076('0x5b')][_0x7076('0x5d')]};}if(_0x4e9501[_0x7076('0x5e')]){_0x3ba668[_0x7076('0x5e')]={'id':_0x4e9501['Interval']['id'],'name':_0x4e9501[_0x7076('0x5e')]['name']};}var _0x206d20=md5(JSON[_0x7076('0x5f')](_0x3ba668));if(_0x4e9501[_0x7076('0x3')]!==_0x206d20){_0x4e9501[_0x7076('0x3')]=_0x206d20;logger[_0x7076('0x45')]('[voiceQueueReport]['+_0x1de28d+']\x20sending\x20voice_queue:save\x20event:',util[_0x7076('0x3c')](_0x3ba668,{'showHidden':![],'depth':null}));this[_0x7076('0x49')](util['format'](_0x7076('0x4e'),_0x3ba668[_0x7076('0x4f')]),_0x7076('0x60'),_0x3ba668);}}};VoiceQueueReport['prototype']['isNotNull']=function(_0x1d2d5a){return _0x1d2d5a!==null&&!_['isUndefined'](_0x1d2d5a);};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x61')]=function(){var _0x538bcf=this;setInterval(function(){_0x538bcf[_0x7076('0x62')]();ami[_0x7076('0x63')]({'action':_0x7076('0x64')})[_0x7076('0x65')](function(_0x272674){logger[_0x7076('0x3a')](_0x7076('0x66'),util[_0x7076('0x3c')](_0x272674,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x7076('0xc')]['loopQueueSummary']=function(){var _0x1e2799=this;setInterval(function(){if(_0x1e2799['flagQueueSummary']){return ami[_0x7076('0x63')]({'action':_0x7076('0x16')})[_0x7076('0x67')](function(){_0x1e2799['flagQueueSummary']=![];})[_0x7076('0x65')](function(_0x51a4c1){logger[_0x7076('0x3a')]('[voiceQueueReport][queuesummary]',util['inspect'](_0x51a4c1,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x17')]=function(_0x3030e8){try{if(this['isNotNull'](_0x3030e8)&&this['isNotNull'](_0x3030e8[_0x7076('0x68')])){logger['debug'](_0x7076('0x69'),util['inspect'](_0x3030e8,{'showHidden':![],'depth':null}));if(this[_0x7076('0x13')][_0x3030e8[_0x7076('0x68')]]){logger[_0x7076('0x6a')](_0x7076('0x6b'),_0x3030e8[_0x7076('0x68')]);var _0x19710c=_['countBy'](this['channels'],_0x7076('0x68'))[_0x3030e8[_0x7076('0x68')]]||0x0;var _0xbe0a32=_0x19710c-_0x3030e8[_0x7076('0x6c')];if(this['voiceQueues'][_0x3030e8[_0x7076('0x68')]][_0x7076('0x32')]!==_[_0x7076('0x6d')](_0x3030e8['callers'])||this['voiceQueues'][_0x3030e8[_0x7076('0x68')]]['loggedIn']!==_[_0x7076('0x6d')](_0x3030e8[_0x7076('0x6e')])||this[_0x7076('0x13')][_0x3030e8[_0x7076('0x68')]][_0x7076('0x55')]!==_['toNumber'](_0x3030e8['available'])||this['voiceQueues'][_0x3030e8[_0x7076('0x68')]]['talking']!==_0xbe0a32){this[_0x7076('0x13')][_0x3030e8[_0x7076('0x68')]]['waiting']=_[_0x7076('0x6d')](_0x3030e8['callers']);this[_0x7076('0x13')][_0x3030e8['queue']][_0x7076('0x56')]=_[_0x7076('0x6d')](_0x3030e8[_0x7076('0x6e')]);this[_0x7076('0x13')][_0x3030e8[_0x7076('0x68')]][_0x7076('0x55')]=_[_0x7076('0x6d')](_0x3030e8[_0x7076('0x55')]);this[_0x7076('0x13')][_0x3030e8[_0x7076('0x68')]][_0x7076('0x30')]=_0xbe0a32>0x0?_0xbe0a32:0x0;this[_0x7076('0x13')][_0x3030e8[_0x7076('0x68')]][_0x7076('0x30')]=this['voiceQueues'][_0x3030e8[_0x7076('0x68')]][_0x7076('0x30')]>_[_0x7076('0x6d')](_0x3030e8[_0x7076('0x6e')])?_[_0x7076('0x6d')](_0x3030e8['loggedin']):this['voiceQueues'][_0x3030e8[_0x7076('0x68')]]['talking'];this['emitVoiceQueueSummary'](this[_0x7076('0x13')][_0x3030e8[_0x7076('0x68')]],'queuesummary');}logger[_0x7076('0x45')]('[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:',util[_0x7076('0x3c')](this[_0x7076('0x13')][_0x3030e8['queue']],{'showHidden':![],'depth':null}));ami[_0x7076('0x49')](_0x7076('0x6f'),this[_0x7076('0x13')][_0x3030e8['queue']]);}}}catch(_0x18ad08){logger['error'](_0x7076('0x70'),util[_0x7076('0x3c')](_0x18ad08,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7076('0x1a')]=function(_0x537f98){logger['debug'](_0x7076('0x71'),util[_0x7076('0x3c')](_0x537f98,{'showHidden':![],'depth':null}));ami[_0x7076('0x49')](_0x7076('0x72'),{});this['flagQueueSummary']=!![];};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x1b')]=function(_0x2d0b9b){try{if(this[_0x7076('0x73')](_0x2d0b9b)){logger[_0x7076('0x45')](_0x7076('0x74'),_0x2d0b9b[_0x7076('0x48')],util['inspect'](_0x2d0b9b,{'showHidden':![],'depth':null}));if(_[_0x7076('0x75')](this['queueReports'][_0x2d0b9b[_0x7076('0x48')]]))this[_0x7076('0x3d')][_0x2d0b9b[_0x7076('0x48')]]=[];if(_[_0x7076('0x75')](this[_0x7076('0x11')][_0x2d0b9b[_0x7076('0x48')]]))this[_0x7076('0x11')][_0x2d0b9b[_0x7076('0x48')]]={};var _0x14f166=new QueueReport();_0x14f166['name']=_0x2d0b9b['queue'];_0x14f166[_0x7076('0x52')]=this[_0x7076('0x13')][_0x14f166[_0x7076('0x4f')]]&&this['voiceQueues'][_0x14f166[_0x7076('0x4f')]][_0x7076('0x52')]?this[_0x7076('0x13')][_0x14f166[_0x7076('0x4f')]]['type']||_0x7076('0x76'):_0x7076('0x76');_0x14f166['queue']=_0x2d0b9b[_0x7076('0x68')];_0x14f166[_0x7076('0x77')]=moment()['format'](_0x7076('0x78'));_0x14f166[_0x7076('0x79')]=_0x2d0b9b[_0x7076('0x79')];_0x14f166[_0x7076('0x7a')]=_0x2d0b9b[_0x7076('0x7a')];_0x14f166[_0x7076('0x48')]=_0x2d0b9b[_0x7076('0x48')];_0x14f166[_0x7076('0x7b')]=this[_0x7076('0x11')][_0x2d0b9b[_0x7076('0x48')]]['routealias'];logger['info']('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x14f166[_0x7076('0x4f')],_0x14f166['type']);_[_0x7076('0x7c')](_0x14f166,_[_0x7076('0x7d')](_0x2d0b9b,_['keys'](_0x14f166)));this[_0x7076('0x3d')][_0x2d0b9b[_0x7076('0x48')]][_0x7076('0x7e')](_0x14f166);this[_0x7076('0x11')][_0x2d0b9b[_0x7076('0x48')]]=_0x14f166;this['emitVoiceQueueChannelSave'](_0x14f166,_0x7076('0x7f'));}}catch(_0x4c1cb7){logger[_0x7076('0x3a')](_0x7076('0x74'),_0x2d0b9b[_0x7076('0x48')],util[_0x7076('0x3c')](_0x4c1cb7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x1d')]=function(_0x1f7e12){try{if(this[_0x7076('0x73')](_0x1f7e12)){logger['debug'](_0x7076('0x80'),_0x1f7e12[_0x7076('0x48')],util[_0x7076('0x3c')](_0x1f7e12,{'showHidden':![],'depth':null}));if(this[_0x7076('0x3d')][_0x1f7e12[_0x7076('0x48')]]){var _0x35c041=_['last'](this[_0x7076('0x3d')][_0x1f7e12[_0x7076('0x48')]]);_0x35c041[_0x7076('0x81')]=![];_0x35c041[_0x7076('0x82')]=null;_0x35c041['holdtime']=_0x1f7e12['holdtime'];_0x35c041[_0x7076('0x83')]=_0x1f7e12[_0x7076('0x83')];_0x35c041[_0x7076('0x1c')]=!![];_0x35c041[_0x7076('0x84')]=moment()[_0x7076('0x4a')](_0x7076('0x78'));_0x35c041[_0x7076('0x85')]=_0x7076('0x86');_0x35c041[_0x7076('0x87')]=null;logger[_0x7076('0x6a')](_0x7076('0x88'),_0x35c041['name'],_0x35c041[_0x7076('0x52')]);this[_0x7076('0x11')][_0x1f7e12[_0x7076('0x48')]]=_0x35c041;this[_0x7076('0x42')](_0x35c041,'queuecallerabandon');}}}catch(_0x3cfac0){logger[_0x7076('0x3a')](_0x7076('0x80'),_0x1f7e12[_0x7076('0x48')],util[_0x7076('0x3c')](_0x3cfac0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')]['syncQueueCallerLeave']=function(_0x86e8cc){try{if(this[_0x7076('0x73')](_0x86e8cc)){logger[_0x7076('0x45')](_0x7076('0x89'),_0x86e8cc['uniqueid'],util['inspect'](_0x86e8cc,{'showHidden':![],'depth':null}));if(this[_0x7076('0x3d')][_0x86e8cc[_0x7076('0x48')]]){var _0x30245c=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x86e8cc[_0x7076('0x48')]]);_0x30245c[_0x7076('0x8b')]=moment()[_0x7076('0x4a')](_0x7076('0x78'));_0x30245c[_0x7076('0x8c')]=_0x86e8cc['connectedlinenum'];_0x30245c[_0x7076('0x8d')]=_0x86e8cc[_0x7076('0x8d')];logger[_0x7076('0x6a')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x30245c['name'],_0x30245c[_0x7076('0x52')],_0x86e8cc[_0x7076('0x8c')],_0x86e8cc[_0x7076('0x8d')]);this[_0x7076('0x11')][_0x86e8cc[_0x7076('0x48')]]=_0x30245c;this[_0x7076('0x44')](_0x30245c,'queuecallerleave');}}}catch(_0x74ffa8){logger['error'](_0x7076('0x89'),_0x86e8cc[_0x7076('0x48')],util[_0x7076('0x3c')](_0x74ffa8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x21')]=function(_0x54977c){try{if(this[_0x7076('0x73')](_0x54977c)){logger['debug'](_0x7076('0x8e'),_0x54977c[_0x7076('0x48')],util['inspect'](_0x54977c,{'showHidden':![],'depth':null}));if(this[_0x7076('0x3d')][_0x54977c['uniqueid']]){var _0x4a7ec1=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x54977c[_0x7076('0x48')]]);_0x4a7ec1['queuecallercomplete']=!![];_0x4a7ec1[_0x7076('0x85')]=_0x7076('0x8f');logger[_0x7076('0x6a')](_0x7076('0x90'),_0x4a7ec1[_0x7076('0x4f')],_0x4a7ec1[_0x7076('0x52')]);}}}catch(_0xe8d176){logger[_0x7076('0x3a')](_0x7076('0x8e'),_0x54977c[_0x7076('0x48')],util['inspect'](_0xe8d176,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x91')]=function(_0x4861fa){try{if(this[_0x7076('0x73')](_0x4861fa)){logger[_0x7076('0x45')](_0x7076('0x92'),_0x4861fa[_0x7076('0x48')],util['inspect'](_0x4861fa,{'showHidden':![],'depth':null}));if(this[_0x7076('0x3d')][_0x4861fa[_0x7076('0x48')]]){var _0x4fdb2d=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x4861fa[_0x7076('0x48')]]);_0x4fdb2d[_0x7076('0x1c')]=![];_0x4fdb2d['queuecallerabandonAt']=null;_0x4fdb2d[_0x7076('0x93')]=!![];_0x4fdb2d[_0x7076('0x87')]=_0x4861fa[_0x7076('0x94')];_0x4fdb2d[_0x7076('0x95')]=_0x4861fa[_0x7076('0x95')];_0x4fdb2d[_0x7076('0x81')]=!![];_0x4fdb2d[_0x7076('0x96')]=![];_0x4fdb2d[_0x7076('0x97')]=null;if(!_0x4fdb2d[_0x7076('0x98')]){if(_0x4861fa[_0x7076('0x99')]==_0x7076('0x98')){_0x4fdb2d[_0x7076('0x85')]=_0x7076('0x9a');logger[_0x7076('0x6a')](_0x7076('0x9b'),_0x4fdb2d[_0x7076('0x4f')],_0x4fdb2d[_0x7076('0x52')]);}else{if(_[_0x7076('0x9c')](_0x4861fa[_0x7076('0x37')][_0x7076('0x9d')](),_0x7076('0x9e'))){if(this[_0x7076('0x3d')][_0x4861fa[_0x7076('0x9f')]]){var _0x16bd9c=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x4861fa['linkedid']]);_0x16bd9c[_0x7076('0x81')]=![];_0x16bd9c[_0x7076('0x96')]=!![];_0x16bd9c[_0x7076('0x97')]=moment(_0x4fdb2d['queuecallerjoinAt'])[_0x7076('0xa0')](_0x4861fa['holdtime'],_0x7076('0xa1'))[_0x7076('0x4a')](_0x7076('0x78'));_0x16bd9c[_0x7076('0x85')]=_0x7076('0xa2');_0x16bd9c['transfer']=!![];_0x16bd9c[_0x7076('0xa3')]='FORWARD';_0x16bd9c[_0x7076('0xa4')]=_0x4861fa[_0x7076('0xa5')];_0x16bd9c[_0x7076('0xa6')]=_0x4861fa[_0x7076('0x48')];logger[_0x7076('0x6a')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x16bd9c[_0x7076('0x4f')],_0x16bd9c[_0x7076('0x52')]);var _0x45419f=this['queueReports'][_0x4861fa[_0x7076('0x9f')]];this[_0x7076('0x3d')][_0x4861fa['linkedid']]=this[_0x7076('0x3d')][_0x4861fa[_0x7076('0x48')]];this['queueReports'][_0x4861fa[_0x7076('0x48')]]=_0x45419f;}}else{_0x4fdb2d[_0x7076('0x85')]=_0x7076('0xa7')+_0x4861fa[_0x7076('0x99')]['toUpperCase']();logger[_0x7076('0x6a')](_0x7076('0xa8'),_0x4fdb2d[_0x7076('0x4f')],_0x4fdb2d['type'],_0x4fdb2d[_0x7076('0x85')]);}}}this[_0x7076('0x11')][_0x4861fa[_0x7076('0x48')]]=_0x4fdb2d;this[_0x7076('0x42')](_0x4fdb2d,_0x7076('0xa9'));}}}catch(_0x5ba851){logger[_0x7076('0x3a')](_0x7076('0x92'),_0x4861fa['uniqueid'],util[_0x7076('0x3c')](_0x5ba851,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x7076('0x22')]=function(_0x59a6b7){try{if(this['isNotNull'](_0x59a6b7)){logger['debug'](_0x7076('0xaa'),_0x59a6b7['uniqueid'],util[_0x7076('0x3c')](_0x59a6b7,{'showHidden':![],'depth':null}));this[_0x7076('0xab')](_0x59a6b7['uniqueid'],_['keys'](_0x59a6b7[_0x7076('0xac')])[0x0],_0x59a6b7[_0x7076('0xad')]);if(this['queueReports'][_0x59a6b7['uniqueid']]){var _0x121f42=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x59a6b7[_0x7076('0x48')]]);if(_0x121f42){if(this[_0x7076('0x73')](_0x59a6b7[_0x7076('0xac')])&&this[_0x7076('0x73')](_0x59a6b7[_0x7076('0xac')][_0x7076('0xae')])){switch(_0x59a6b7['value']){case _0x7076('0xaf'):_0x121f42[_0x7076('0x96')]=![];_0x121f42[_0x7076('0x97')]=null;break;case _0x7076('0xb0'):_0x121f42[_0x7076('0xb1')]='timeout';_0x121f42[_0x7076('0x96')]=!![];_0x121f42[_0x7076('0x97')]=moment()[_0x7076('0x4a')](_0x7076('0x78'));_0x121f42['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x7076('0x45')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x59a6b7[_0x7076('0x48')],util['inspect'](_0x121f42,{'showHidden':![],'depth':null}));ami[_0x7076('0x49')](_0x7076('0xb2'),_0x121f42);break;default:_0x121f42[_0x7076('0x96')]=!![];_0x121f42[_0x7076('0x97')]=moment()[_0x7076('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x121f42[_0x7076('0x8b')]=moment()[_0x7076('0x4a')](_0x7076('0x78'));}_0x121f42[_0x7076('0x1c')]=![];_0x121f42[_0x7076('0x84')]=null;_0x121f42[_0x7076('0x85')]=_0x59a6b7[_0x7076('0xad')];this[_0x7076('0x11')][_0x59a6b7[_0x7076('0x48')]]=_0x121f42;this[_0x7076('0x42')](_0x121f42,_0x7076('0xb3'));}else if(this[_0x7076('0x73')](_0x59a6b7['variable'])&&this['isNotNull'](_0x59a6b7['variable'][_0x7076('0xb4')])){if(!_0x121f42[_0x7076('0x1c')]){_0x121f42[_0x7076('0x96')]=!![];_0x121f42[_0x7076('0x97')]=moment()[_0x7076('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');_0x121f42[_0x7076('0x85')]='EXITWITHKEY';_0x121f42['queuecallerleaveAt']=moment()[_0x7076('0x4a')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7076('0x11')][_0x59a6b7[_0x7076('0x48')]]=_0x121f42;}}logger[_0x7076('0x6a')](_0x7076('0xb5'),_0x59a6b7[_0x7076('0x48')],_0x121f42['name'],_0x121f42['type'],_[_0x7076('0xb6')](_0x59a6b7[_0x7076('0xac')])[0x0],_0x59a6b7['value']);_0x121f42[_0x7076('0x15')]=this['variables'][_0x59a6b7[_0x7076('0x48')]];}}}}catch(_0x7427d8){logger[_0x7076('0x3a')](_0x7076('0xaa'),_0x59a6b7[_0x7076('0x48')],util[_0x7076('0x3c')](_0x7427d8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0xab')]=function(_0x59b867,_0x3ec449,_0x30875c){var _0x4e7ebc=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter',_0x7076('0xb7'),'rtpaudioqosloss',_0x7076('0xb8'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x7076('0xb9'),_0x7076('0xba'),_0x7076('0xbb'),_0x7076('0xbc'),'membercalls',_0x7076('0xbd'),'memberinterface',_0x7076('0xbe'),_0x7076('0x94'),_0x7076('0xbf'),_0x7076('0xc0')];if(!_['isNil'](_0x3ec449)&&!_[_0x7076('0xc1')](_0x4e7ebc,_0x3ec449)){if(_[_0x7076('0x75')](this['variables'][_0x59b867])){this[_0x7076('0x15')][_0x59b867]={};}this[_0x7076('0x15')][_0x59b867][_0x3ec449]=_0x30875c;}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0xc2')]=function(_0x1ada92,_0x5da54a,_0x3ab2d2){var _0x5b9153={};for(var _0x24c645=0x0;_0x24c645<this['queueReports'][_0x1ada92][_0x7076('0xc3')];_0x24c645+=0x1){_0x5b9153=this['queueReports'][_0x1ada92][_0x24c645];if(this[_0x7076('0x13')][_0x5b9153['queue']]){if(_0x5b9153[_0x7076('0x96')]&&_0x5b9153[_0x7076('0x98')]!=!![]){this['voiceQueues'][_0x5b9153['queue']][_0x7076('0x5a')]+=0x1;}if(_0x5b9153['queuecallerabandon']){this['voiceQueues'][_0x5b9153[_0x7076('0x68')]][_0x7076('0xc4')]+=0x1;}this[_0x7076('0x13')][_0x5b9153[_0x7076('0x68')]]['sumHoldTime']+=moment(_0x5b9153[_0x7076('0x8b')])['diff'](_0x5b9153['queuecallerjoinAt'],_0x7076('0xa1'))||0x0;if(_0x24c645===this[_0x7076('0x3d')][_0x1ada92]['length']-0x1){this['voiceQueues'][_0x5b9153[_0x7076('0x68')]][_0x7076('0x57')]+=moment()['milliseconds'](0x0)[_0x7076('0xc5')](_0x5b9153['queuecallerjoinAt'],_0x7076('0xa1'));this[_0x7076('0x13')][_0x5b9153[_0x7076('0x68')]][_0x7076('0x59')]+=0x1;if(_0x5b9153[_0x7076('0x81')]){this[_0x7076('0x13')][_0x5b9153[_0x7076('0x68')]][_0x7076('0x54')]+=0x1;this[_0x7076('0x13')][_0x5b9153[_0x7076('0x68')]][_0x7076('0xc6')]+=moment()['milliseconds'](0x0)[_0x7076('0xc5')](_0x5b9153[_0x7076('0x8b')],_0x7076('0xa1'));_0x5b9153[_0x7076('0x82')]=moment()['format'](_0x7076('0x78'));_0x5b9153[_0x7076('0x96')]=![];_0x5b9153[_0x7076('0x97')]=null;}if(_0x5b9153['queuecallerexit']&&_0x5b9153[_0x7076('0x98')]!=!![]){_0x5b9153[_0x7076('0xb1')]=_0x7076('0x5a');logger[_0x7076('0x45')](_0x7076('0xc7'),_0x1ada92,util[_0x7076('0x3c')](_0x5b9153,{'showHidden':![],'depth':null}));ami[_0x7076('0x49')](_0x7076('0xc8'),_0x5b9153);}if(_0x5b9153['queuecallerabandon']){_0x5b9153[_0x7076('0xb1')]=_0x7076('0xc4');logger[_0x7076('0x45')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x1ada92,util[_0x7076('0x3c')](_0x5b9153,{'showHidden':![],'depth':null}));ami['emit']('custom:queuecallerabandon',_0x5b9153);}}else{this['voiceQueues'][_0x5b9153[_0x7076('0x68')]]['sumDuration']+=this[_0x7076('0x13')][_0x5b9153['queue']][_0x7076('0x58')];}logger['info']('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x1ada92,_0x5b9153['name'],_0x5b9153[_0x7076('0x52')],_0x5da54a);if(_0x3ab2d2&&_0x5b9153[_0x7076('0x85')]===_0x7076('0x4d')){_0x5b9153[_0x7076('0x85')]=_0x7076('0x8f');}this[_0x7076('0x11')][_0x1ada92]=_0x5b9153;this['emitVoiceQueueChannelRemove'](_0x5b9153,_0x7076('0xc9'));this[_0x7076('0xca')](this[_0x7076('0x13')][_0x5b9153[_0x7076('0x68')]],_0x7076('0xc9'));}}logger[_0x7076('0x45')](_0x7076('0xcb'),_0x1ada92,util[_0x7076('0x3c')](this['queueReports'][_0x1ada92],{'showHidden':![],'depth':null}));ami[_0x7076('0x49')](_0x7076('0xcc'),this['queueReports'][_0x1ada92]);if(_0x5b9153[_0x7076('0x85')]==='ATTENDEDTRANSFER')return;delete this[_0x7076('0x3d')][_0x1ada92];delete this['channels'][_0x1ada92];if(this[_0x7076('0x15')][_0x1ada92]){delete this[_0x7076('0x15')][_0x1ada92];}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x23')]=function(_0x4d3832){try{if(this[_0x7076('0x73')](_0x4d3832)){logger[_0x7076('0x45')](_0x7076('0xcd'),_0x4d3832[_0x7076('0x48')],util[_0x7076('0x3c')](_0x4d3832,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4d3832[_0x7076('0x48')]]){return this[_0x7076('0xc2')](_0x4d3832[_0x7076('0x48')],_0x4d3832[_0x7076('0xce')]);}if(this[_0x7076('0x3d')][_0x4d3832[_0x7076('0x9f')]]){if(_0x4d3832[_0x7076('0xcf')]==='21'){return;}return this[_0x7076('0xc2')](_0x4d3832['linkedid'],_0x4d3832[_0x7076('0xce')],!![]);}var _0x3bc8fd=Object[_0x7076('0xb6')](this[_0x7076('0x3d')]);for(var _0x5522b6=0x0;_0x5522b6<_0x3bc8fd[_0x7076('0xc3')];_0x5522b6++){var _0x352102=_['last'](this[_0x7076('0x3d')][_0x3bc8fd[_0x5522b6]]);if(_0x352102&&_0x352102[_0x7076('0xd0')]===_0x4d3832[_0x7076('0x48')]){return this[_0x7076('0xc2')](_0x352102[_0x7076('0x48')],_0x4d3832[_0x7076('0xce')],!![]);}}}}catch(_0x5694ae){logger[_0x7076('0x3a')](_0x7076('0xcd'),_0x4d3832[_0x7076('0x48')],util[_0x7076('0x3c')](_0x5694ae,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x29')]=function(_0x939217){try{if(this[_0x7076('0x73')](_0x939217)){logger[_0x7076('0x45')]('[%s][voiceQueueReport][attendedtransfer]',_0x939217[_0x7076('0x48')],util['inspect'](_0x939217,{'showHidden':![],'depth':null}));var _0x545bfa;var _0x54b033;var _0x3f8b00;if(this['queueReports'][_0x939217[_0x7076('0xd1')]]){_0x545bfa=_[_0x7076('0x8a')](this['queueReports'][_0x939217[_0x7076('0xd1')]]);_0x545bfa[_0x7076('0xa4')]=_0x939217['secondtransfererexten'];_0x545bfa['transferuniqueid']=_0x939217[_0x7076('0xd2')];_0x545bfa['queuecallerexitreason']=_0x7076('0x4d');_0x545bfa[_0x7076('0x98')]=!![];_0x545bfa[_0x7076('0xa3')]=_0x7076('0xd3');if(this[_0x7076('0x3d')][_0x939217['secondtransfereruniqueid']]){_0x3f8b00=this[_0x7076('0x3d')][_0x939217[_0x7076('0xd2')]];this[_0x7076('0x3d')][_0x939217[_0x7076('0xd2')]]=this['queueReports'][_0x939217[_0x7076('0xd1')]];this['queueReports'][_0x939217[_0x7076('0xd1')]]=_0x3f8b00;_0x54b033=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x939217[_0x7076('0xd1')]]);_0x54b033[_0x7076('0x35')]=!![];}logger[_0x7076('0x6a')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x939217[_0x7076('0x48')],_0x545bfa[_0x7076('0x4f')],_0x545bfa[_0x7076('0x52')],_0x545bfa[_0x7076('0xa4')],_0x545bfa['transferuniqueid']);}else if(this[_0x7076('0x3d')][_0x939217[_0x7076('0xd4')]]){_0x545bfa=_['last'](this['queueReports'][_0x939217[_0x7076('0xd4')]]);_0x545bfa['transferexten']=_0x939217[_0x7076('0xd5')];_0x545bfa[_0x7076('0xa6')]=_0x939217[_0x7076('0xd6')];_0x545bfa[_0x7076('0x85')]=_0x7076('0x4d');_0x545bfa[_0x7076('0x98')]=!![];_0x545bfa[_0x7076('0xa3')]=_0x7076('0xd3');if(this[_0x7076('0x3d')][_0x939217[_0x7076('0xd6')]]){_0x3f8b00=this[_0x7076('0x3d')][_0x939217[_0x7076('0xd6')]];this[_0x7076('0x3d')][_0x939217['origtransfereruniqueid']]=this['queueReports'][_0x939217['transfertargetuniqueid']];this['queueReports'][_0x939217[_0x7076('0xd4')]]=_0x3f8b00;_0x54b033=_['last'](this[_0x7076('0x3d')][_0x939217[_0x7076('0xd4')]]);_0x54b033[_0x7076('0x35')]=!![];}logger[_0x7076('0x6a')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x939217['uniqueid'],_0x545bfa['name'],_0x545bfa[_0x7076('0x52')],_0x545bfa['transferexten'],_0x545bfa[_0x7076('0xa6')]);}else if(this[_0x7076('0x3d')][_0x939217[_0x7076('0xd6')]]){_0x545bfa=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x939217[_0x7076('0xd6')]]);_0x545bfa[_0x7076('0xa4')]=_0x939217[_0x7076('0xd5')];_0x545bfa[_0x7076('0xa6')]=_0x939217['origtransfereruniqueid'];_0x545bfa[_0x7076('0x85')]=_0x7076('0x4d');_0x545bfa[_0x7076('0x98')]=!![];_0x545bfa['transfertype']='ATTENDED';_0x545bfa[_0x7076('0x35')]=!![];_0x545bfa[_0x7076('0xd0')]=_0x939217[_0x7076('0xd1')];}else if(this[_0x7076('0x3d')][_0x939217['secondtransfereruniqueid']]){_0x545bfa=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x939217[_0x7076('0xd2')]]);_0x545bfa[_0x7076('0xa4')]=_0x939217[_0x7076('0xd7')];_0x545bfa[_0x7076('0xa6')]=_0x939217['secondtransfereruniqueid'];_0x545bfa[_0x7076('0x85')]='ATTENDEDTRANSFER';_0x545bfa[_0x7076('0x98')]=!![];_0x545bfa[_0x7076('0xa3')]='ATTENDED';_0x545bfa['switch']=!![];_0x545bfa['transferid']=_0x939217[_0x7076('0xd4')];}}}catch(_0x265b86){logger['error'](_0x7076('0xd8'),_0x939217[_0x7076('0x48')],util[_0x7076('0x3c')](_0x265b86,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')]['syncBlindTransfer']=function(_0x41a7b4){try{if(this[_0x7076('0x73')](_0x41a7b4)){logger[_0x7076('0x45')](_0x7076('0xd9'),_0x41a7b4['uniqueid'],util[_0x7076('0x3c')](_0x41a7b4,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x41a7b4[_0x7076('0xd1')]]){var _0x3357eb=_['last'](this[_0x7076('0x3d')][_0x41a7b4[_0x7076('0xd1')]]);_0x3357eb['queuecallerexitreason']=_0x7076('0xda');_0x3357eb[_0x7076('0x98')]=!![];_0x3357eb[_0x7076('0xa3')]=_0x7076('0xdb');_0x3357eb[_0x7076('0xa4')]=_0x41a7b4[_0x7076('0xdc')];_0x3357eb[_0x7076('0xa6')]=_0x41a7b4[_0x7076('0xd1')];logger['info'](_0x7076('0xdd'),_0x41a7b4[_0x7076('0x48')],_0x3357eb[_0x7076('0x4f')],_0x3357eb['type'],_0x3357eb[_0x7076('0xa4')],_0x3357eb[_0x7076('0xa6')]);this[_0x7076('0x23')]({'event':_0x7076('0xde'),'uniqueid':_0x41a7b4['transfereeuniqueid'],'context':_0x41a7b4['context'],'channel':_0x41a7b4[_0x7076('0xdf')]});}}}catch(_0x18dfba){logger['error'](_0x7076('0xd9'),_0x41a7b4[_0x7076('0x48')],util[_0x7076('0x3c')](_0x18dfba,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0xe0')]=function(_0xdd5d14){try{if(this['isNotNull'](_0xdd5d14)){logger[_0x7076('0x45')](_0x7076('0xe1'),_0xdd5d14['uniqueid'],util[_0x7076('0x3c')](_0xdd5d14,{'showHidden':![],'depth':null}));if(this[_0x7076('0x3d')][_0xdd5d14[_0x7076('0x48')]]){var _0x3fe9c3=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0xdd5d14['uniqueid']]);if(!_[_0x7076('0x36')](_0x3fe9c3['queuecallerleaveAt'])){_0x3fe9c3[_0x7076('0xe2')]=moment()[_0x7076('0x4a')](_0x7076('0x78'));logger[_0x7076('0x6a')](_0x7076('0xe3'),_0xdd5d14[_0x7076('0x48')],_0x3fe9c3[_0x7076('0xe2')]);}}}}catch(_0x8c9f7a){logger[_0x7076('0x3a')](_0x7076('0xe1'),_0xdd5d14[_0x7076('0x48')],util[_0x7076('0x3c')](_0x8c9f7a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')][_0x7076('0x27')]=function(_0x195a7f){try{if(this[_0x7076('0x73')](_0x195a7f)){logger[_0x7076('0x45')](_0x7076('0xe4'),_0x195a7f['uniqueid'],util[_0x7076('0x3c')](_0x195a7f,{'showHidden':![],'depth':null}));if(this[_0x7076('0x3d')][_0x195a7f['uniqueid']]){var _0x2e2dbe=_[_0x7076('0x8a')](this[_0x7076('0x3d')][_0x195a7f[_0x7076('0x48')]]);if(!_['isNil'](_0x2e2dbe['mohstarttime'])){_0x2e2dbe['mohtime']+=moment()['milliseconds'](0x0)['diff'](_0x2e2dbe['mohstarttime'],_0x7076('0xa1'));logger[_0x7076('0x6a')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x195a7f[_0x7076('0x48')],_0x2e2dbe[_0x7076('0xe5')]);delete _0x2e2dbe[_0x7076('0xe2')];}}}}catch(_0x28a344){logger['error']('[%s][voiceQueueReport][musiconholdstop]',_0x195a7f[_0x7076('0x48')],util[_0x7076('0x3c')](_0x28a344,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7076('0xc')]['syncNewExten']=function(_0x47d1de){try{if(this[_0x7076('0x73')](_0x47d1de)){logger[_0x7076('0x45')](_0x7076('0xe6'),_0x47d1de['uniqueid'],util['inspect'](_0x47d1de,{'showHidden':![],'depth':null}));if(_0x47d1de[_0x7076('0xe7')][_0x7076('0x9d')]()===_0x7076('0xe8')){_0x47d1de[_0x7076('0xe9')]=_0x47d1de[_0x7076('0xea')]&&_0x47d1de[_0x7076('0xea')][_0x7076('0x9c')](_0x7076('0xeb'))?_0x47d1de[_0x7076('0xea')]:(_0x47d1de[_0x7076('0xea')]||_0x47d1de['applicationdata'])[_0x7076('0x9d')]();if(_['startsWith'](_0x47d1de[_0x7076('0xe9')]['toLowerCase'](),_0x7076('0xec'))){logger[_0x7076('0x6a')](_0x7076('0xed'),_0x47d1de[_0x7076('0x48')],_0x47d1de['application'],_0x47d1de[_0x7076('0xe9')]);if(_[_0x7076('0x75')](this[_0x7076('0x11')][_0x47d1de[_0x7076('0x48')]]))this[_0x7076('0x11')][_0x47d1de[_0x7076('0x48')]]={};var _0x41fb4f=_0x47d1de['applicationdata']['split']('=');var _0x5974ff=_0x41fb4f[0x0]['toLowerCase']()[_0x7076('0xee')](/cdr\((.*)\)/);if(_0x5974ff)this[_0x7076('0x11')][_0x47d1de[_0x7076('0x48')]][_0x5974ff[0x1]]=_0x41fb4f[0x1];}}}}catch(_0x3ae314){logger['error']('[%s][voiceQueueReport][newexten]',_0x47d1de[_0x7076('0x48')],util[_0x7076('0x3c')](_0x3ae314,{'showHidden':![],'depth':null}));}};module[_0x7076('0xef')]=VoiceQueueReport;
\ No newline at end of file