43de5677f506e3d511fce8a97314cd7b5adb595d
[motion2.git] / server / services / ami / report / voiceQueueReport.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x6075=['exports','lodash','moment','md5','ioredis','../../../config/environment','../../../config/logger','ami','redis','defaults','socket.io-emitter','prototype','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','syncMusicOnHoldStart','musiconholdstop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','originated','hasOwnProperty','talking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','switch','enqueue','isNil','Action','catch','message','error','[%s][voiceQueueReport][checkChannel]','inspect','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','format','voice:queue:%s','voice_queue_channel:save','emitVoiceQueueChannelRemove',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','name','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','total','unmanaged','abandoned','Trunk','active','Interval','stringify','[voiceQueueReport][',']\x20sending\x20voice_queue:save\x20event:','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','queuesummary','[voiceQueueReport][queuesummary]','syncQueueSummary','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','ABANDONED','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','queuecallercomplete','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentcomplete]','assigned','lastAssignedTo','membername','queuecallerexitAt','transfer','queuecallerexitreason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','toLowerCase','local/','linkedid','queuecallerexit','FORWARDTRANSFER','transfertype','FORWARD','destexten','transferuniqueid','COMPLETEDBY','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','syncVarSet','variable','value','CONTINUE','TIMEOUT','lastevent','custom:timeout','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','keys','[%s][voiceQueueReport][varset]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','[%s][voiceQueueReport][hangup]','length','sumHoldTime','seconds','milliseconds','diff','sumBillable','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferexten','secondtransfererexten','ATTENDEDTRANSFER','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','[%s][voiceQueueReport][blindtransfer]','BLIND','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','context','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','syncMusicOnHoldStop','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','application','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]'];(function(_0x1bcdde,_0xd6a3fa){var _0x8086c=function(_0x392473){while(--_0x392473){_0x1bcdde['push'](_0x1bcdde['shift']());}};_0x8086c(++_0xd6a3fa);}(_0x6075,0xf0));var _0x5607=function(_0x432434,_0x2be8d4){_0x432434=_0x432434-0x0;var _0x13976f=_0x6075[_0x432434];return _0x13976f;};'use strict';var _=require(_0x5607('0x0'));var moment=require(_0x5607('0x1'));var util=require('util');var md5=require(_0x5607('0x2'));var Redis=require(_0x5607('0x3'));var config=require(_0x5607('0x4'));var logger=require(_0x5607('0x5'))(_0x5607('0x6'));var ami=require('../ami');var QueueReport=require('../model/queueReport');config[_0x5607('0x7')]=_[_0x5607('0x8')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5607('0x9'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0x5607('0xa')]['enqueue']=function(_0x3fafb2){this['tail']=this[_0x5607('0xb')]?this[_0x5607('0xb')][_0x5607('0xc')](_0x3fafb2):_0x3fafb2();};function VoiceQueueReport(_0x4d3df8){this[_0x5607('0xd')]=new Sequence();this[_0x5607('0xe')]={};this[_0x5607('0xf')]=_0x4d3df8[_0x5607('0xf')];this[_0x5607('0x10')]=_0x4d3df8[_0x5607('0x11')];this[_0x5607('0x12')]=_0x4d3df8[_0x5607('0x12')];this[_0x5607('0x13')]=!![];this[_0x5607('0x14')]=_0x4d3df8[_0x5607('0x14')];this[_0x5607('0x15')]={};ami['on']('queuesummary',this['syncQueueSummary'][_0x5607('0x16')](this));ami['on'](_0x5607('0x17'),this[_0x5607('0x18')][_0x5607('0x16')](this));ami['on'](_0x5607('0x19'),this[_0x5607('0x1a')][_0x5607('0x16')](this));ami['on'](_0x5607('0x1b'),this[_0x5607('0x1c')][_0x5607('0x16')](this));ami['on'](_0x5607('0x1d'),this['syncQueueCallerLeave'][_0x5607('0x16')](this));ami['on'](_0x5607('0x1e'),this[_0x5607('0x1f')][_0x5607('0x16')](this));ami['on'](_0x5607('0x20'),this[_0x5607('0x21')]['bind'](this));ami['on'](_0x5607('0x22'),this['syncVarSet']['bind'](this));ami['on'](_0x5607('0x23'),this[_0x5607('0x24')][_0x5607('0x16')](this));ami['on'](_0x5607('0x25'),this[_0x5607('0x26')][_0x5607('0x16')](this));ami['on']('musiconholdstart',this[_0x5607('0x27')][_0x5607('0x16')](this));ami['on'](_0x5607('0x28'),this['syncMusicOnHoldStop'][_0x5607('0x16')](this));ami['on'](_0x5607('0x29'),this[_0x5607('0x2a')][_0x5607('0x16')](this));ami['on']('blindtransfer',this[_0x5607('0x2b')][_0x5607('0x16')](this));this[_0x5607('0x2c')]();this[_0x5607('0x2d')]();}function clearChannels(_0x1cced2){if(!_['isEmpty'](_0x1cced2)){for(var _0x2ec194 in _0x1cced2){if(_0x1cced2['hasOwnProperty'](_0x2ec194)){delete _0x1cced2[_0x2ec194];}}}}function clearCampaigns(_0x1d6f1c){if(!_[_0x5607('0x2e')](_0x1d6f1c)){for(var _0x457c8b in _0x1d6f1c){if(_0x1d6f1c['hasOwnProperty'](_0x457c8b)){_0x1d6f1c[_0x457c8b][_0x5607('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x379b71){if(!_['isEmpty'](_0x379b71)){for(var _0x478848 in _0x379b71){if(_0x379b71[_0x5607('0x30')](_0x478848)){_0x379b71[_0x478848][_0x5607('0x2f')]=0x0;_0x379b71[_0x478848][_0x5607('0x31')]=0x0;_0x379b71[_0x478848]['pTalking']=0x0;_0x379b71[_0x478848][_0x5607('0x32')]=0x0;_0x379b71[_0x478848][_0x5607('0x33')]=!![];}}}}function clearAgentBooked(_0x15a1eb){if(!_[_0x5607('0x2e')](_0x15a1eb)){for(var _0x43ed98 in _0x15a1eb){if(_0x15a1eb[_0x5607('0x30')](_0x43ed98)){_0x15a1eb[_0x43ed98][_0x5607('0x34')]=!![];}}}}VoiceQueueReport[_0x5607('0xa')][_0x5607('0x35')]=function(){var _0x311b63=this;for(var _0x42b281 in this['channels']){if(this[_0x5607('0x10')][_0x5607('0x30')](_0x42b281)&&!this[_0x5607('0x10')][_0x42b281][_0x5607('0x36')]){this[_0x5607('0xd')][_0x5607('0x37')](function(){if(!_[_0x5607('0x38')](_0x311b63['channels'][_0x42b281])){return ami[_0x5607('0x39')]({'action':'status','channel':_0x311b63['channels'][_0x42b281]['channel']})[_0x5607('0x3a')](function(_0x49c4b1){if(_0x49c4b1[_0x5607('0x3b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x311b63[_0x5607('0x10')][_0x42b281]){delete _0x311b63[_0x5607('0x10')][_0x42b281];logger[_0x5607('0x3c')](_0x5607('0x3d'),_0x42b281,util[_0x5607('0x3e')](_0x49c4b1,{'showHidden':![],'depth':null}));}if(_0x311b63[_0x5607('0xe')][_0x42b281]){delete _0x311b63[_0x5607('0xe')][_0x42b281];logger[_0x5607('0x3c')]('[%s][voiceQueueReport][checkQueueReport]',_0x42b281,util['inspect'](_0x49c4b1,{'showHidden':![],'depth':null}));}if(_0x311b63[_0x5607('0x15')][_0x42b281]){delete _0x311b63['variables'][_0x42b281];logger['error']('[%s][voiceQueueReport][checkVariables]',_0x42b281,util['inspect'](_0x49c4b1,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x5607('0xa')][_0x5607('0x26')]=function(){logger['error'](_0x5607('0x3f'));clearChannels(this[_0x5607('0x10')]);this['clearQueueReport'](this[_0x5607('0xe')]);clearAgentBooked(this[_0x5607('0xf')]);clearVoiceQueues(this[_0x5607('0x12')]);clearCampaigns(this[_0x5607('0x14')]);};VoiceQueueReport[_0x5607('0xa')][_0x5607('0x40')]=function(_0x4c5ebe){var _0x30bc5c=this;if(!_[_0x5607('0x2e')](_0x4c5ebe)){for(var _0x12eee5 in _0x4c5ebe){if(_0x4c5ebe[_0x5607('0x30')](_0x12eee5)){_0x30bc5c['emitVoiceQueueChannelRemove'](_0x4c5ebe[_0x12eee5],_0x5607('0x41'));delete _0x4c5ebe[_0x12eee5];}}}};VoiceQueueReport['prototype'][_0x5607('0x42')]=function(_0x88980b,_0x4be5b9,_0x346f60){io['to'](_0x88980b)[_0x5607('0x42')](_0x4be5b9,_0x346f60);};VoiceQueueReport[_0x5607('0xa')][_0x5607('0x43')]=function(_0x16283b,_0x578b71){logger[_0x5607('0x44')](_0x5607('0x45')+_0x578b71+_0x5607('0x46'),_0x16283b['uniqueid'],util[_0x5607('0x3e')](_0x16283b,{'showHidden':![],'depth':null}));this['emit'](util[_0x5607('0x47')](_0x5607('0x48'),_0x16283b['name']),_0x5607('0x49'),_0x16283b);io['emit']('voice_queue_presence:save',_0x16283b);};VoiceQueueReport[_0x5607('0xa')][_0x5607('0x4a')]=function(_0x197a6f,_0x289060){logger[_0x5607('0x44')](_0x5607('0x45')+_0x289060+_0x5607('0x4b'),_0x197a6f[_0x5607('0x4c')],util['inspect'](_0x197a6f,{'showHidden':![],'depth':null}));this[_0x5607('0x42')](util['format']('voice:queue:%s',_0x197a6f[_0x5607('0x4d')]),_0x5607('0x4e'),_0x197a6f);io['emit'](_0x5607('0x4f'),_0x197a6f);};VoiceQueueReport[_0x5607('0xa')][_0x5607('0x50')]=function(_0x2815e9,_0x12ac63){if(_0x2815e9[_0x5607('0x51')]===_0x5607('0x52')){var _0x402077={'id':_0x2815e9['id'],'name':_0x2815e9['name'],'strategy':_0x2815e9[_0x5607('0x53')],'answered':_0x2815e9[_0x5607('0x54')],'available':_0x2815e9[_0x5607('0x55')],'loggedIn':_0x2815e9[_0x5607('0x56')],'pTalking':_0x2815e9['pTalking'],'sumBillable':_0x2815e9['sumBillable'],'sumDuration':_0x2815e9['sumDuration'],'sumHoldTime':_0x2815e9['sumHoldTime']||0x0,'talking':_0x2815e9[_0x5607('0x31')],'total':_0x2815e9[_0x5607('0x57')],'type':_0x2815e9[_0x5607('0x51')],'unmanaged':_0x2815e9[_0x5607('0x58')],'abandoned':_0x2815e9[_0x5607('0x59')],'waiting':_0x2815e9[_0x5607('0x32')]};if(_0x2815e9['Trunk']){_0x402077['Trunk']={'id':_0x2815e9['Trunk']['id'],'name':_0x2815e9[_0x5607('0x5a')][_0x5607('0x4d')],'active':_0x2815e9[_0x5607('0x5a')][_0x5607('0x5b')],'callerid':_0x2815e9[_0x5607('0x5a')]['callerid']};}if(_0x2815e9['Interval']){_0x402077[_0x5607('0x5c')]={'id':_0x2815e9[_0x5607('0x5c')]['id'],'name':_0x2815e9[_0x5607('0x5c')]['name']};}var _0x19b0f9=md5(JSON[_0x5607('0x5d')](_0x402077));if(_0x2815e9[_0x5607('0x2')]!==_0x19b0f9){_0x2815e9['md5']=_0x19b0f9;logger[_0x5607('0x44')](_0x5607('0x5e')+_0x12ac63+_0x5607('0x5f'),util[_0x5607('0x3e')](_0x402077,{'showHidden':![],'depth':null}));this[_0x5607('0x42')](util[_0x5607('0x47')]('voice:queue:%s',_0x402077[_0x5607('0x4d')]),_0x5607('0x60'),_0x402077);}}};VoiceQueueReport[_0x5607('0xa')][_0x5607('0x61')]=function(_0x42de2){return _0x42de2!==null&&!_[_0x5607('0x62')](_0x42de2);};VoiceQueueReport[_0x5607('0xa')]['loopQueueShow']=function(){var _0x1a11c8=this;setInterval(function(){_0x1a11c8[_0x5607('0x35')]();ami[_0x5607('0x39')]({'action':_0x5607('0x63')})[_0x5607('0x3a')](function(_0x160439){logger[_0x5607('0x3c')](_0x5607('0x64'),util[_0x5607('0x3e')](_0x160439,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype']['loopQueueSummary']=function(){var _0x3ba601=this;setInterval(function(){if(_0x3ba601[_0x5607('0x13')]){return ami['Action']({'action':_0x5607('0x65')})['then'](function(_0x3732dc){_0x3ba601['flagQueueSummary']=![];})[_0x5607('0x3a')](function(_0xb3287f){logger[_0x5607('0x3c')](_0x5607('0x66'),util[_0x5607('0x3e')](_0xb3287f,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x5607('0xa')][_0x5607('0x67')]=function(_0x356801){try{if(this[_0x5607('0x61')](_0x356801)&&this['isNotNull'](_0x356801[_0x5607('0x68')])){logger[_0x5607('0x44')](_0x5607('0x69'),util[_0x5607('0x3e')](_0x356801,{'showHidden':![],'depth':null}));if(this[_0x5607('0x12')][_0x356801[_0x5607('0x68')]]){logger[_0x5607('0x6a')](_0x5607('0x6b'),_0x356801[_0x5607('0x68')]);var _0x15f662=_[_0x5607('0x6c')](this['channels'],_0x5607('0x68'))[_0x356801['queue']]||0x0;var _0xee7881=_0x15f662-_0x356801[_0x5607('0x6d')];if(this['voiceQueues'][_0x356801[_0x5607('0x68')]][_0x5607('0x32')]!==_['toNumber'](_0x356801['callers'])||this[_0x5607('0x12')][_0x356801[_0x5607('0x68')]][_0x5607('0x56')]!==_[_0x5607('0x6e')](_0x356801[_0x5607('0x6f')])||this[_0x5607('0x12')][_0x356801[_0x5607('0x68')]][_0x5607('0x55')]!==_[_0x5607('0x6e')](_0x356801[_0x5607('0x55')])||this['voiceQueues'][_0x356801[_0x5607('0x68')]][_0x5607('0x31')]!==_0xee7881){this['voiceQueues'][_0x356801['queue']][_0x5607('0x32')]=_[_0x5607('0x6e')](_0x356801[_0x5607('0x6d')]);this['voiceQueues'][_0x356801[_0x5607('0x68')]][_0x5607('0x56')]=_[_0x5607('0x6e')](_0x356801[_0x5607('0x6f')]);this[_0x5607('0x12')][_0x356801['queue']]['available']=_[_0x5607('0x6e')](_0x356801['available']);this['voiceQueues'][_0x356801['queue']][_0x5607('0x31')]=_0xee7881>0x0?_0xee7881:0x0;this['voiceQueues'][_0x356801[_0x5607('0x68')]][_0x5607('0x31')]=this['voiceQueues'][_0x356801[_0x5607('0x68')]][_0x5607('0x31')]>_[_0x5607('0x6e')](_0x356801['loggedin'])?_[_0x5607('0x6e')](_0x356801[_0x5607('0x6f')]):this['voiceQueues'][_0x356801[_0x5607('0x68')]][_0x5607('0x31')];this[_0x5607('0x50')](this['voiceQueues'][_0x356801[_0x5607('0x68')]],_0x5607('0x65'));}logger[_0x5607('0x44')](_0x5607('0x70'),util[_0x5607('0x3e')](this[_0x5607('0x12')][_0x356801['queue']],{'showHidden':![],'depth':null}));ami['emit'](_0x5607('0x71'),this[_0x5607('0x12')][_0x356801[_0x5607('0x68')]]);}}}catch(_0x1bc19b){logger[_0x5607('0x3c')](_0x5607('0x66'),util[_0x5607('0x3e')](_0x1bc19b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0x4021a4){logger[_0x5607('0x44')](_0x5607('0x72'),util[_0x5607('0x3e')](_0x4021a4,{'showHidden':![],'depth':null}));this[_0x5607('0x13')]=!![];};VoiceQueueReport[_0x5607('0xa')][_0x5607('0x1a')]=function(_0x954d04){try{if(this[_0x5607('0x61')](_0x954d04)){logger[_0x5607('0x44')](_0x5607('0x73'),_0x954d04['uniqueid'],util['inspect'](_0x954d04,{'showHidden':![],'depth':null}));if(_[_0x5607('0x62')](this[_0x5607('0xe')][_0x954d04[_0x5607('0x4c')]]))this[_0x5607('0xe')][_0x954d04[_0x5607('0x4c')]]=[];if(_[_0x5607('0x62')](this[_0x5607('0x10')][_0x954d04[_0x5607('0x4c')]]))this[_0x5607('0x10')][_0x954d04[_0x5607('0x4c')]]={};var _0x15907d=new QueueReport();_0x15907d[_0x5607('0x4d')]=_0x954d04[_0x5607('0x68')];_0x15907d['type']=this[_0x5607('0x12')][_0x15907d['name']]&&this['voiceQueues'][_0x15907d[_0x5607('0x4d')]][_0x5607('0x51')]?this[_0x5607('0x12')][_0x15907d[_0x5607('0x4d')]][_0x5607('0x51')]||_0x5607('0x52'):_0x5607('0x52');_0x15907d[_0x5607('0x68')]=_0x954d04['queue'];_0x15907d[_0x5607('0x74')]=moment()[_0x5607('0x47')](_0x5607('0x75'));_0x15907d['position']=_0x954d04[_0x5607('0x76')];_0x15907d[_0x5607('0x77')]=_0x954d04[_0x5607('0x77')];_0x15907d['uniqueid']=_0x954d04[_0x5607('0x4c')];_0x15907d[_0x5607('0x78')]=this[_0x5607('0x10')][_0x954d04['uniqueid']][_0x5607('0x78')];logger['info'](_0x5607('0x79'),_0x15907d[_0x5607('0x4d')],_0x15907d[_0x5607('0x51')]);_[_0x5607('0x7a')](_0x15907d,_[_0x5607('0x7b')](_0x954d04,_['keys'](_0x15907d)));this[_0x5607('0xe')][_0x954d04[_0x5607('0x4c')]]['push'](_0x15907d);this[_0x5607('0x10')][_0x954d04[_0x5607('0x4c')]]=_0x15907d;this[_0x5607('0x43')](_0x15907d,_0x5607('0x19'));}}catch(_0x88185b){logger['error'](_0x5607('0x73'),_0x954d04[_0x5607('0x4c')],util['inspect'](_0x88185b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5607('0xa')][_0x5607('0x1c')]=function(_0xaed76a){try{if(this[_0x5607('0x61')](_0xaed76a)){logger['debug'](_0x5607('0x7c'),_0xaed76a[_0x5607('0x4c')],util[_0x5607('0x3e')](_0xaed76a,{'showHidden':![],'depth':null}));if(this[_0x5607('0xe')][_0xaed76a[_0x5607('0x4c')]]){var _0x41dfab=_[_0x5607('0x7d')](this[_0x5607('0xe')][_0xaed76a['uniqueid']]);_0x41dfab['queuecallercomplete']=![];_0x41dfab[_0x5607('0x7e')]=null;_0x41dfab[_0x5607('0x7f')]=_0xaed76a[_0x5607('0x7f')];_0x41dfab[_0x5607('0x80')]=_0xaed76a['originalposition'];_0x41dfab['queuecallerabandon']=!![];_0x41dfab[_0x5607('0x81')]=moment()[_0x5607('0x47')](_0x5607('0x75'));_0x41dfab['queuecallerexitreason']=_0x5607('0x82');_0x41dfab['lastAssignedTo']=null;logger[_0x5607('0x6a')]('[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s',_0x41dfab[_0x5607('0x4d')],_0x41dfab[_0x5607('0x51')]);this[_0x5607('0x10')][_0xaed76a[_0x5607('0x4c')]]=_0x41dfab;this[_0x5607('0x4a')](_0x41dfab,_0x5607('0x1b'));}}}catch(_0x4a252c){logger[_0x5607('0x3c')](_0x5607('0x7c'),_0xaed76a['uniqueid'],util['inspect'](_0x4a252c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5607('0xa')]['syncQueueCallerLeave']=function(_0x500b4e){try{if(this[_0x5607('0x61')](_0x500b4e)){logger[_0x5607('0x44')](_0x5607('0x83'),_0x500b4e[_0x5607('0x4c')],util[_0x5607('0x3e')](_0x500b4e,{'showHidden':![],'depth':null}));if(this[_0x5607('0xe')][_0x500b4e[_0x5607('0x4c')]]){var _0x10ef52=_['last'](this['queueReports'][_0x500b4e[_0x5607('0x4c')]]);_0x10ef52[_0x5607('0x84')]=moment()['format'](_0x5607('0x75'));_0x10ef52[_0x5607('0x85')]=_0x500b4e[_0x5607('0x85')];_0x10ef52[_0x5607('0x86')]=_0x500b4e['connectedlinename'];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x10ef52[_0x5607('0x4d')],_0x10ef52['type'],_0x500b4e[_0x5607('0x85')],_0x500b4e['connectedlinename']);this[_0x5607('0x10')][_0x500b4e[_0x5607('0x4c')]]=_0x10ef52;this[_0x5607('0x43')](_0x10ef52,_0x5607('0x1d'));}}}catch(_0x49d6b2){logger['error'](_0x5607('0x83'),_0x500b4e[_0x5607('0x4c')],util[_0x5607('0x3e')](_0x49d6b2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5607('0xa')]['syncAgentConnect']=function(_0x38eb11){try{if(this[_0x5607('0x61')](_0x38eb11)){logger['debug'](_0x5607('0x87'),_0x38eb11[_0x5607('0x4c')],util['inspect'](_0x38eb11,{'showHidden':![],'depth':null}));if(this[_0x5607('0xe')][_0x38eb11[_0x5607('0x4c')]]){var _0x4c436b=_[_0x5607('0x7d')](this[_0x5607('0xe')][_0x38eb11[_0x5607('0x4c')]]);_0x4c436b[_0x5607('0x88')]=!![];_0x4c436b['queuecallerexitreason']=_0x5607('0x89');logger['info'](_0x5607('0x8a'),_0x4c436b['name'],_0x4c436b['type']);}}}catch(_0x59f47f){logger[_0x5607('0x3c')](_0x5607('0x87'),_0x38eb11[_0x5607('0x4c')],util[_0x5607('0x3e')](_0x59f47f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x5607('0x1f')]=function(_0x2dc1db){try{if(this[_0x5607('0x61')](_0x2dc1db)){logger['debug'](_0x5607('0x8b'),_0x2dc1db[_0x5607('0x4c')],util[_0x5607('0x3e')](_0x2dc1db,{'showHidden':![],'depth':null}));if(this[_0x5607('0xe')][_0x2dc1db[_0x5607('0x4c')]]){var _0x3c5f0b=_[_0x5607('0x7d')](this[_0x5607('0xe')][_0x2dc1db[_0x5607('0x4c')]]);_0x3c5f0b[_0x5607('0x1b')]=![];_0x3c5f0b[_0x5607('0x81')]=null;_0x3c5f0b[_0x5607('0x8c')]=!![];_0x3c5f0b[_0x5607('0x8d')]=_0x2dc1db[_0x5607('0x8e')];_0x3c5f0b[_0x5607('0x7f')]=_0x2dc1db[_0x5607('0x7f')];_0x3c5f0b[_0x5607('0x88')]=!![];_0x3c5f0b['queuecallerexit']=![];_0x3c5f0b[_0x5607('0x8f')]=null;if(!_0x3c5f0b[_0x5607('0x90')]){if(_0x2dc1db['reason']==_0x5607('0x90')){_0x3c5f0b[_0x5607('0x91')]=_0x5607('0x92');logger[_0x5607('0x6a')](_0x5607('0x93'),_0x3c5f0b['name'],_0x3c5f0b[_0x5607('0x51')]);}else{if(_[_0x5607('0x94')](_0x2dc1db[_0x5607('0x95')][_0x5607('0x96')](),_0x5607('0x97'))){if(this[_0x5607('0xe')][_0x2dc1db['linkedid']]){var _0x18ac61=_['last'](this[_0x5607('0xe')][_0x2dc1db[_0x5607('0x98')]]);_0x18ac61[_0x5607('0x88')]=![];_0x18ac61[_0x5607('0x99')]=!![];_0x18ac61[_0x5607('0x8f')]=moment(_0x3c5f0b[_0x5607('0x74')])['add'](_0x2dc1db[_0x5607('0x7f')],'seconds')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x18ac61[_0x5607('0x91')]=_0x5607('0x9a');_0x18ac61[_0x5607('0x90')]=!![];_0x18ac61[_0x5607('0x9b')]=_0x5607('0x9c');_0x18ac61['transferexten']=_0x2dc1db[_0x5607('0x9d')];_0x18ac61[_0x5607('0x9e')]=_0x2dc1db[_0x5607('0x4c')];logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x18ac61[_0x5607('0x4d')],_0x18ac61[_0x5607('0x51')]);var _0x5ea30c=this[_0x5607('0xe')][_0x2dc1db['linkedid']];this[_0x5607('0xe')][_0x2dc1db[_0x5607('0x98')]]=this[_0x5607('0xe')][_0x2dc1db[_0x5607('0x4c')]];this[_0x5607('0xe')][_0x2dc1db[_0x5607('0x4c')]]=_0x5ea30c;}}else{_0x3c5f0b[_0x5607('0x91')]=_0x5607('0x9f')+_0x2dc1db[_0x5607('0xa0')][_0x5607('0xa1')]();logger[_0x5607('0x6a')](_0x5607('0xa2'),_0x3c5f0b['name'],_0x3c5f0b[_0x5607('0x51')],_0x3c5f0b[_0x5607('0x91')]);}}}this[_0x5607('0x10')][_0x2dc1db[_0x5607('0x4c')]]=_0x3c5f0b;this[_0x5607('0x4a')](_0x3c5f0b,_0x5607('0x1e'));}}}catch(_0x7f2ffd){logger[_0x5607('0x3c')](_0x5607('0x8b'),_0x2dc1db[_0x5607('0x4c')],util[_0x5607('0x3e')](_0x7f2ffd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5607('0xa')][_0x5607('0xa3')]=function(_0x1c7c5c){try{if(this[_0x5607('0x61')](_0x1c7c5c)){logger[_0x5607('0x44')]('[%s][voiceQueueReport][varset]',_0x1c7c5c[_0x5607('0x4c')],util['inspect'](_0x1c7c5c,{'showHidden':![],'depth':null}));this['addVariable'](_0x1c7c5c[_0x5607('0x4c')],_['keys'](_0x1c7c5c[_0x5607('0xa4')])[0x0],_0x1c7c5c['value']);if(this['queueReports'][_0x1c7c5c[_0x5607('0x4c')]]){var _0x3932ef=_[_0x5607('0x7d')](this[_0x5607('0xe')][_0x1c7c5c['uniqueid']]);if(_0x3932ef){if(this[_0x5607('0x61')](_0x1c7c5c[_0x5607('0xa4')])&&this[_0x5607('0x61')](_0x1c7c5c[_0x5607('0xa4')]['queuestatus'])){switch(_0x1c7c5c[_0x5607('0xa5')]){case _0x5607('0xa6'):_0x3932ef[_0x5607('0x99')]=![];_0x3932ef['queuecallerexitAt']=null;break;case _0x5607('0xa7'):_0x3932ef[_0x5607('0xa8')]='timeout';_0x3932ef[_0x5607('0x99')]=!![];_0x3932ef[_0x5607('0x8f')]=moment()[_0x5607('0x47')](_0x5607('0x75'));_0x3932ef[_0x5607('0x84')]=moment()[_0x5607('0x47')](_0x5607('0x75'));logger[_0x5607('0x44')]('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x1c7c5c['uniqueid'],util[_0x5607('0x3e')](_0x3932ef,{'showHidden':![],'depth':null}));ami[_0x5607('0x42')](_0x5607('0xa9'),_0x3932ef);break;default:_0x3932ef[_0x5607('0x99')]=!![];_0x3932ef['queuecallerexitAt']=moment()['format'](_0x5607('0x75'));_0x3932ef['queuecallerleaveAt']=moment()[_0x5607('0x47')]('YYYY-MM-DD\x20HH:mm:ss');}_0x3932ef[_0x5607('0x1b')]=![];_0x3932ef[_0x5607('0x81')]=null;_0x3932ef[_0x5607('0x91')]=_0x1c7c5c[_0x5607('0xa5')];this[_0x5607('0x10')][_0x1c7c5c['uniqueid']]=_0x3932ef;this[_0x5607('0x4a')](_0x3932ef,_0x5607('0x22'));}else if(this[_0x5607('0x61')](_0x1c7c5c['variable'])&&this[_0x5607('0x61')](_0x1c7c5c['variable'][_0x5607('0xaa')])){if(!_0x3932ef[_0x5607('0x1b')]){_0x3932ef[_0x5607('0x99')]=!![];_0x3932ef[_0x5607('0x8f')]=moment()[_0x5607('0x47')](_0x5607('0x75'));_0x3932ef[_0x5607('0x91')]=_0x5607('0xab');_0x3932ef[_0x5607('0x84')]=moment()[_0x5607('0x47')](_0x5607('0x75'));this[_0x5607('0x10')][_0x1c7c5c[_0x5607('0x4c')]]=_0x3932ef;}}logger[_0x5607('0x6a')](_0x5607('0xac'),_0x1c7c5c[_0x5607('0x4c')],_0x3932ef[_0x5607('0x4d')],_0x3932ef['type'],_[_0x5607('0xad')](_0x1c7c5c[_0x5607('0xa4')])[0x0],_0x1c7c5c['value']);_0x3932ef['variables']=this['variables'][_0x1c7c5c[_0x5607('0x4c')]];}}}}catch(_0x3daec6){logger['error'](_0x5607('0xae'),_0x1c7c5c[_0x5607('0x4c')],util[_0x5607('0x3e')](_0x3daec6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5607('0xa')][_0x5607('0xaf')]=function(_0x5ac356,_0x35075c,_0x14f6ad){var _0x408ee0=[_0x5607('0xb0'),_0x5607('0xb1'),_0x5607('0xb2'),_0x5607('0xb3'),_0x5607('0xb4'),_0x5607('0xb5'),_0x5607('0xb6'),_0x5607('0xb7'),_0x5607('0xb8'),_0x5607('0xb9'),_0x5607('0xba'),_0x5607('0xbb'),_0x5607('0xbc'),_0x5607('0xbd'),_0x5607('0xbe'),'memberlastcall',_0x5607('0x8e'),'memberpenalty','memberrealtime'];if(!_[_0x5607('0x38')](_0x35075c)&&!_['includes'](_0x408ee0,_0x35075c)){if(_[_0x5607('0x62')](this[_0x5607('0x15')][_0x5ac356])){this[_0x5607('0x15')][_0x5ac356]={};}this[_0x5607('0x15')][_0x5ac356][_0x35075c]=_0x14f6ad;}};VoiceQueueReport[_0x5607('0xa')][_0x5607('0x24')]=function(_0x589010){try{if(this['isNotNull'](_0x589010)){logger[_0x5607('0x44')](_0x5607('0xbf'),_0x589010['uniqueid'],util[_0x5607('0x3e')](_0x589010,{'showHidden':![],'depth':null}));if(this[_0x5607('0xe')][_0x589010['uniqueid']]){for(var _0x478a17=0x0,_0x5baad1={};_0x478a17<this[_0x5607('0xe')][_0x589010[_0x5607('0x4c')]][_0x5607('0xc0')];_0x478a17+=0x1){_0x5baad1=this[_0x5607('0xe')][_0x589010[_0x5607('0x4c')]][_0x478a17];if(this['voiceQueues'][_0x5baad1[_0x5607('0x68')]]){if(_0x5baad1['queuecallerexit']&&_0x5baad1['transfer']!=!![]){this[_0x5607('0x12')][_0x5baad1[_0x5607('0x68')]][_0x5607('0x58')]+=0x1;}if(_0x5baad1['queuecallerabandon']){this[_0x5607('0x12')][_0x5baad1[_0x5607('0x68')]][_0x5607('0x59')]+=0x1;}this['voiceQueues'][_0x5baad1[_0x5607('0x68')]][_0x5607('0xc1')]+=moment(_0x5baad1[_0x5607('0x84')])['diff'](_0x5baad1[_0x5607('0x74')],_0x5607('0xc2'))||0x0;if(_0x478a17===this['queueReports'][_0x589010['uniqueid']]['length']-0x1){this[_0x5607('0x12')][_0x5baad1[_0x5607('0x68')]]['sumDuration']+=moment()[_0x5607('0xc3')](0x0)[_0x5607('0xc4')](_0x5baad1[_0x5607('0x74')],_0x5607('0xc2'));this['voiceQueues'][_0x5baad1[_0x5607('0x68')]]['total']+=0x1;if(_0x5baad1[_0x5607('0x88')]){this[_0x5607('0x12')][_0x5baad1[_0x5607('0x68')]][_0x5607('0x54')]+=0x1;this[_0x5607('0x12')][_0x5baad1[_0x5607('0x68')]][_0x5607('0xc5')]+=moment()[_0x5607('0xc3')](0x0)[_0x5607('0xc4')](_0x5baad1[_0x5607('0x84')],_0x5607('0xc2'));_0x5baad1['queuecallercompleteAt']=moment()[_0x5607('0x47')](_0x5607('0x75'));_0x5baad1[_0x5607('0x99')]=![];_0x5baad1[_0x5607('0x8f')]=null;}if(_0x5baad1[_0x5607('0x99')]&&_0x5baad1[_0x5607('0x90')]!=!![]){_0x5baad1[_0x5607('0xa8')]=_0x5607('0x58');logger['debug'](_0x5607('0xc6'),_0x589010[_0x5607('0x4c')],util[_0x5607('0x3e')](_0x5baad1,{'showHidden':![],'depth':null}));ami[_0x5607('0x42')](_0x5607('0xc7'),_0x5baad1);}if(_0x5baad1[_0x5607('0x1b')]){_0x5baad1[_0x5607('0xa8')]=_0x5607('0x59');logger[_0x5607('0x44')](_0x5607('0xc8'),_0x589010['uniqueid'],util[_0x5607('0x3e')](_0x5baad1,{'showHidden':![],'depth':null}));ami[_0x5607('0x42')](_0x5607('0xc9'),_0x5baad1);}}else{this[_0x5607('0x12')][_0x5baad1['queue']]['sumDuration']+=this[_0x5607('0x12')][_0x5baad1[_0x5607('0x68')]][_0x5607('0xc1')];}logger[_0x5607('0x6a')]('[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s',_0x589010[_0x5607('0x4c')],_0x5baad1['name'],_0x5baad1['type'],_0x589010['cause-txt']);this[_0x5607('0x10')][_0x589010[_0x5607('0x4c')]]=_0x5baad1;this[_0x5607('0x4a')](_0x5baad1,_0x5607('0x23'));this[_0x5607('0x50')](this['voiceQueues'][_0x5baad1[_0x5607('0x68')]],_0x5607('0x23'));}}logger['debug'](_0x5607('0xca'),_0x589010['uniqueid'],util[_0x5607('0x3e')](this[_0x5607('0xe')][_0x589010[_0x5607('0x4c')]],{'showHidden':![],'depth':null}));ami[_0x5607('0x42')](_0x5607('0xcb'),this['queueReports'][_0x589010[_0x5607('0x4c')]]);delete this[_0x5607('0xe')][_0x589010['uniqueid']];delete this['channels'][_0x589010[_0x5607('0x4c')]];}if(this[_0x5607('0x15')][_0x589010[_0x5607('0x4c')]]){delete this[_0x5607('0x15')][_0x589010['uniqueid']];}}}catch(_0xb92e6d){logger[_0x5607('0x3c')](_0x5607('0xbf'),_0x589010[_0x5607('0x4c')],util[_0x5607('0x3e')](_0xb92e6d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5607('0xa')][_0x5607('0x2a')]=function(_0x563e2c){try{if(this[_0x5607('0x61')](_0x563e2c)){logger[_0x5607('0x44')](_0x5607('0xcc'),_0x563e2c[_0x5607('0x4c')],util['inspect'](_0x563e2c,{'showHidden':![],'depth':null}));var _0x11d794;if(this[_0x5607('0xe')][_0x563e2c[_0x5607('0xcd')]]){_0x11d794=_[_0x5607('0x7d')](this[_0x5607('0xe')][_0x563e2c[_0x5607('0xcd')]]);_0x11d794[_0x5607('0xce')]=_0x563e2c[_0x5607('0xcf')];_0x11d794[_0x5607('0x9e')]=_0x563e2c['secondtransfereruniqueid'];_0x11d794[_0x5607('0x91')]=_0x5607('0xd0');_0x11d794[_0x5607('0x90')]=!![];_0x11d794['transfertype']='ATTENDED';if(this[_0x5607('0xe')][_0x563e2c[_0x5607('0xd1')]]){var _0x2b3ea1=this[_0x5607('0xe')][_0x563e2c['secondtransfereruniqueid']];this['queueReports'][_0x563e2c[_0x5607('0xd1')]]=this[_0x5607('0xe')][_0x563e2c[_0x5607('0xcd')]];this[_0x5607('0xe')][_0x563e2c[_0x5607('0xcd')]]=_0x2b3ea1;var _0x4e226e=_[_0x5607('0x7d')](this[_0x5607('0xe')][_0x563e2c['transfereeuniqueid']]);_0x4e226e['switch']=!![];}logger[_0x5607('0x6a')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x563e2c[_0x5607('0x4c')],_0x11d794[_0x5607('0x4d')],_0x11d794[_0x5607('0x51')],_0x11d794[_0x5607('0xce')],_0x11d794[_0x5607('0x9e')]);}else if(this[_0x5607('0xe')][_0x563e2c[_0x5607('0xd2')]]){_0x11d794=_['last'](this[_0x5607('0xe')][_0x563e2c[_0x5607('0xd2')]]);_0x11d794[_0x5607('0xce')]=_0x563e2c[_0x5607('0xd3')];_0x11d794[_0x5607('0x9e')]=_0x563e2c['origtransfereruniqueid'];_0x11d794[_0x5607('0x91')]=_0x5607('0xd0');_0x11d794['transfer']=!![];_0x11d794[_0x5607('0x9b')]='ATTENDED';if(this['queueReports'][_0x563e2c[_0x5607('0xd4')]]){var _0x2b3ea1=this['queueReports'][_0x563e2c['origtransfereruniqueid']];this[_0x5607('0xe')][_0x563e2c[_0x5607('0xd4')]]=this[_0x5607('0xe')][_0x563e2c['transfertargetuniqueid']];this[_0x5607('0xe')][_0x563e2c[_0x5607('0xd2')]]=_0x2b3ea1;var _0x4e226e=_['last'](this[_0x5607('0xe')][_0x563e2c['transfertargetuniqueid']]);_0x4e226e['switch']=!![];}logger[_0x5607('0x6a')](_0x5607('0xd5'),_0x563e2c[_0x5607('0x4c')],_0x11d794[_0x5607('0x4d')],_0x11d794[_0x5607('0x51')],_0x11d794[_0x5607('0xce')],_0x11d794[_0x5607('0x9e')]);}}}catch(_0x136c6d){logger[_0x5607('0x3c')]('[%s][voiceQueueReport][attendedtransfer]',_0x563e2c['uniqueid'],util[_0x5607('0x3e')](_0x136c6d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5607('0xa')][_0x5607('0x2b')]=function(_0x3fabcd){try{if(this[_0x5607('0x61')](_0x3fabcd)){logger[_0x5607('0x44')](_0x5607('0xd6'),_0x3fabcd[_0x5607('0x4c')],util[_0x5607('0x3e')](_0x3fabcd,{'showHidden':![],'depth':null}));if(this[_0x5607('0xe')][_0x3fabcd[_0x5607('0xcd')]]){var _0x198448=_[_0x5607('0x7d')](this[_0x5607('0xe')][_0x3fabcd[_0x5607('0xcd')]]);_0x198448[_0x5607('0x91')]='BLINDTRANSFER';_0x198448['transfer']=!![];_0x198448[_0x5607('0x9b')]=_0x5607('0xd7');_0x198448[_0x5607('0xce')]=_0x3fabcd[_0x5607('0xd8')];_0x198448[_0x5607('0x9e')]=_0x3fabcd[_0x5607('0xcd')];logger['info'](_0x5607('0xd9'),_0x3fabcd['uniqueid'],_0x198448[_0x5607('0x4d')],_0x198448['type'],_0x198448[_0x5607('0xce')],_0x198448[_0x5607('0x9e')]);this[_0x5607('0x24')]({'event':_0x5607('0xda'),'uniqueid':_0x3fabcd['transfereeuniqueid'],'context':_0x3fabcd[_0x5607('0xdb')],'channel':_0x3fabcd[_0x5607('0xdc')]});}}}catch(_0x765fdc){logger['error']('[%s][voiceQueueReport][blindtransfer]',_0x3fabcd[_0x5607('0x4c')],util[_0x5607('0x3e')](_0x765fdc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5607('0xa')]['syncMusicOnHoldStart']=function(_0x507a45){try{if(this[_0x5607('0x61')](_0x507a45)){logger[_0x5607('0x44')](_0x5607('0xdd'),_0x507a45[_0x5607('0x4c')],util['inspect'](_0x507a45,{'showHidden':![],'depth':null}));if(this[_0x5607('0xe')][_0x507a45[_0x5607('0x4c')]]){var _0x2ec017=_['last'](this[_0x5607('0xe')][_0x507a45['uniqueid']]);if(!_[_0x5607('0x38')](_0x2ec017[_0x5607('0x84')])){_0x2ec017[_0x5607('0xde')]=moment()[_0x5607('0x47')](_0x5607('0x75'));logger[_0x5607('0x6a')](_0x5607('0xdf'),_0x507a45[_0x5607('0x4c')],_0x2ec017[_0x5607('0xde')]);}}}}catch(_0x4a425c){logger[_0x5607('0x3c')](_0x5607('0xdd'),_0x507a45[_0x5607('0x4c')],util[_0x5607('0x3e')](_0x4a425c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5607('0xa')][_0x5607('0xe0')]=function(_0x5a10fd){try{if(this['isNotNull'](_0x5a10fd)){logger[_0x5607('0x44')](_0x5607('0xe1'),_0x5a10fd[_0x5607('0x4c')],util[_0x5607('0x3e')](_0x5a10fd,{'showHidden':![],'depth':null}));if(this[_0x5607('0xe')][_0x5a10fd[_0x5607('0x4c')]]){var _0x11afee=_[_0x5607('0x7d')](this['queueReports'][_0x5a10fd['uniqueid']]);if(!_[_0x5607('0x38')](_0x11afee[_0x5607('0xde')])){_0x11afee[_0x5607('0xe2')]+=moment()[_0x5607('0xc3')](0x0)['diff'](_0x11afee[_0x5607('0xde')],'seconds');logger[_0x5607('0x6a')](_0x5607('0xe3'),_0x5a10fd[_0x5607('0x4c')],_0x11afee[_0x5607('0xe2')]);delete _0x11afee['mohstarttime'];}}}}catch(_0x598fa6){logger['error'](_0x5607('0xe1'),_0x5a10fd[_0x5607('0x4c')],util['inspect'](_0x598fa6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5607('0xa')][_0x5607('0xe4')]=function(_0x4230ab){try{if(this[_0x5607('0x61')](_0x4230ab)){logger['debug']('[%s][voiceQueueReport][newexten]\x20event:',_0x4230ab[_0x5607('0x4c')],util[_0x5607('0x3e')](_0x4230ab,{'showHidden':![],'depth':null}));if(_0x4230ab[_0x5607('0xe5')][_0x5607('0x96')]()==='set'){_0x4230ab[_0x5607('0xe6')]=_0x4230ab['appdata']&&_0x4230ab[_0x5607('0xe7')]['startsWith'](_0x5607('0xe8'))?_0x4230ab[_0x5607('0xe7')]:(_0x4230ab[_0x5607('0xe7')]||_0x4230ab[_0x5607('0xe6')])[_0x5607('0x96')]();if(_[_0x5607('0x94')](_0x4230ab[_0x5607('0xe6')]['toLowerCase'](),_0x5607('0xe9'))){logger[_0x5607('0x6a')](_0x5607('0xea'),_0x4230ab['uniqueid'],_0x4230ab[_0x5607('0xe5')],_0x4230ab['applicationdata']);if(_[_0x5607('0x62')](this['channels'][_0x4230ab[_0x5607('0x4c')]]))this[_0x5607('0x10')][_0x4230ab[_0x5607('0x4c')]]={};var _0x1abf69=_0x4230ab[_0x5607('0xe6')][_0x5607('0xeb')]('=');var _0x4628fe=_0x1abf69[0x0][_0x5607('0x96')]()[_0x5607('0xec')](/cdr\((.*)\)/);if(_0x4628fe)this[_0x5607('0x10')][_0x4230ab[_0x5607('0x4c')]][_0x4628fe[0x1]]=_0x1abf69[0x1];}}}}catch(_0x2fbc10){logger[_0x5607('0x3c')](_0x5607('0xed'),_0x4230ab[_0x5607('0x4c')],util[_0x5607('0x3e')](_0x2fbc10,{'showHidden':![],'depth':null}));}};module[_0x5607('0xee')]=VoiceQueueReport;