Built motion from commit f0b1811d.|2.6.6
[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 _0x9e79=['originated','talking','pTalking','waiting','unlockRR','prototype','clearZombieChannels','channels','switch','isNil','Action','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave','[%s][voiceQueueReport][','uniqueid','format','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','strategy','answered','available','loggedIn','sumBillable','unmanaged','abandoned','Trunk','active','Interval','stringify','voice_queue:save','isNotNull','loopQueueShow','queues','[voiceQueueReport][queues]','flagQueueSummary','queuesummary','then','[voiceQueueReport][queuesummary]','queue','debug','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','callers','toNumber','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummarycomplete','[%s][voiceQueueReport][queuecallerjoin]','isUndefined','queuecallerjoinAt','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinenum','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinename','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','queuecallerexitreason','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','assigned','lastAssignedTo','membername','queuecallerexit','transfer','toLowerCase','local/','linkedid','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','reason','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][agentcomplete]','[%s][voiceQueueReport][varset]','addVariable','value','variable','queuestatus','CONTINUE','queuecallerexitAt','TIMEOUT','lastevent','timeout','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','queueposition','EXITWITHKEY','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','includes','handleHangup','length','sumHoldTime','diff','total','milliseconds','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','sumDuration','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','ATTENDEDTRANSFER','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][hangup]','cause-txt','cause','transferid','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','ATTENDED','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','secondtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLINDTRANSFER','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]','mohstarttime','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','startsWith','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','split','match','[%s][voiceQueueReport][newexten]','exports','lodash','moment','util','md5','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','localhost','socket.io-emitter','enqueue','finally','sequence','queueReports','agents','queueChannels','voiceQueues','campaigns','variables','bind','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','varset','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','loopQueueSummary','isEmpty','hasOwnProperty'];(function(_0x3ce937,_0x568d7d){var _0x41d2fa=function(_0x19a409){while(--_0x19a409){_0x3ce937['push'](_0x3ce937['shift']());}};_0x41d2fa(++_0x568d7d);}(_0x9e79,0xc6));var _0x99e7=function(_0x22c108,_0x5d1ff1){_0x22c108=_0x22c108-0x0;var _0x5b4bfc=_0x9e79[_0x22c108];return _0x5b4bfc;};'use strict';var _=require(_0x99e7('0x0'));var moment=require(_0x99e7('0x1'));var util=require(_0x99e7('0x2'));var md5=require(_0x99e7('0x3'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x99e7('0x4'))(_0x99e7('0x5'));var ami=require(_0x99e7('0x6'));var QueueReport=require(_0x99e7('0x7'));config[_0x99e7('0x8')]=_[_0x99e7('0x9')](config['redis'],{'host':_0x99e7('0xa'),'port':0x18eb});var io=require(_0x99e7('0xb'))(new Redis(config[_0x99e7('0x8')]));var Sequence=function(){};Sequence['prototype'][_0x99e7('0xc')]=function(_0x5385e6){this['tail']=this['tail']?this['tail'][_0x99e7('0xd')](_0x5385e6):_0x5385e6();};function VoiceQueueReport(_0x579b37){this[_0x99e7('0xe')]=new Sequence();this[_0x99e7('0xf')]={};this[_0x99e7('0x10')]=_0x579b37[_0x99e7('0x10')];this['channels']=_0x579b37[_0x99e7('0x11')];this[_0x99e7('0x12')]=_0x579b37['voiceQueues'];this['flagQueueSummary']=!![];this[_0x99e7('0x13')]=_0x579b37[_0x99e7('0x13')];this[_0x99e7('0x14')]={};ami['on']('queuesummary',this['syncQueueSummary'][_0x99e7('0x15')](this));ami['on']('queuesummarycomplete',this[_0x99e7('0x16')][_0x99e7('0x15')](this));ami['on'](_0x99e7('0x17'),this[_0x99e7('0x18')][_0x99e7('0x15')](this));ami['on'](_0x99e7('0x19'),this['syncQueueCallerAbandon'][_0x99e7('0x15')](this));ami['on'](_0x99e7('0x1a'),this[_0x99e7('0x1b')][_0x99e7('0x15')](this));ami['on'](_0x99e7('0x1c'),this[_0x99e7('0x1d')]['bind'](this));ami['on'](_0x99e7('0x1e'),this['syncAgentConnect']['bind'](this));ami['on'](_0x99e7('0x1f'),this['syncVarSet'][_0x99e7('0x15')](this));ami['on'](_0x99e7('0x20'),this[_0x99e7('0x21')][_0x99e7('0x15')](this));ami['on'](_0x99e7('0x22'),this[_0x99e7('0x23')][_0x99e7('0x15')](this));ami['on'](_0x99e7('0x24'),this[_0x99e7('0x25')][_0x99e7('0x15')](this));ami['on'](_0x99e7('0x26'),this[_0x99e7('0x27')]['bind'](this));ami['on'](_0x99e7('0x28'),this[_0x99e7('0x29')][_0x99e7('0x15')](this));ami['on'](_0x99e7('0x2a'),this['syncBlindTransfer'][_0x99e7('0x15')](this));this[_0x99e7('0x2b')]();this['loopQueueShow']();}function clearChannels(_0x42878a){if(!_[_0x99e7('0x2c')](_0x42878a)){for(var _0x1b9647 in _0x42878a){if(_0x42878a[_0x99e7('0x2d')](_0x1b9647)){delete _0x42878a[_0x1b9647];}}}}function clearCampaigns(_0x284f89){if(!_[_0x99e7('0x2c')](_0x284f89)){for(var _0x3f230b in _0x284f89){if(_0x284f89[_0x99e7('0x2d')](_0x3f230b)){_0x284f89[_0x3f230b][_0x99e7('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x2174cc){if(!_[_0x99e7('0x2c')](_0x2174cc)){for(var _0xf9dbc9 in _0x2174cc){if(_0x2174cc[_0x99e7('0x2d')](_0xf9dbc9)){_0x2174cc[_0xf9dbc9][_0x99e7('0x2e')]=0x0;_0x2174cc[_0xf9dbc9][_0x99e7('0x2f')]=0x0;_0x2174cc[_0xf9dbc9][_0x99e7('0x30')]=0x0;_0x2174cc[_0xf9dbc9][_0x99e7('0x31')]=0x0;_0x2174cc[_0xf9dbc9]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x2befd1){if(!_[_0x99e7('0x2c')](_0x2befd1)){for(var _0x341ca2 in _0x2befd1){if(_0x2befd1[_0x99e7('0x2d')](_0x341ca2)){_0x2befd1[_0x341ca2][_0x99e7('0x32')]=!![];}}}}VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x34')]=function(){var _0x4360f8=this;for(var _0x13b7df in this[_0x99e7('0x35')]){if(this['channels'][_0x99e7('0x2d')](_0x13b7df)&&!this[_0x99e7('0x35')][_0x13b7df][_0x99e7('0x36')]){this[_0x99e7('0xe')][_0x99e7('0xc')](function(){if(!_[_0x99e7('0x37')](_0x4360f8['channels'][_0x13b7df])){return ami[_0x99e7('0x38')]({'action':_0x99e7('0x39'),'channel':_0x4360f8[_0x99e7('0x35')][_0x13b7df][_0x99e7('0x3a')]})[_0x99e7('0x3b')](function(_0x708074){if(_0x708074[_0x99e7('0x3c')]===_0x99e7('0x3d')){setTimeout(function(){if(_0x4360f8['channels'][_0x13b7df]){delete _0x4360f8[_0x99e7('0x35')][_0x13b7df];logger[_0x99e7('0x3e')](_0x99e7('0x3f'),_0x13b7df,util[_0x99e7('0x40')](_0x708074,{'showHidden':![],'depth':null}));}if(_0x4360f8[_0x99e7('0xf')][_0x13b7df]){delete _0x4360f8[_0x99e7('0xf')][_0x13b7df];logger['error'](_0x99e7('0x41'),_0x13b7df,util['inspect'](_0x708074,{'showHidden':![],'depth':null}));}if(_0x4360f8[_0x99e7('0x14')][_0x13b7df]){delete _0x4360f8[_0x99e7('0x14')][_0x13b7df];logger[_0x99e7('0x3e')]('[%s][voiceQueueReport][checkVariables]',_0x13b7df,util[_0x99e7('0x40')](_0x708074,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport['prototype'][_0x99e7('0x23')]=function(){logger[_0x99e7('0x3e')]('[FullyBooted]\x20clear\x20realtime');clearChannels(this[_0x99e7('0x35')]);this[_0x99e7('0x42')](this['queueReports']);clearAgentBooked(this[_0x99e7('0x10')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x99e7('0x13')]);};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x42')]=function(_0xfc7974){var _0x34a08f=this;if(!_['isEmpty'](_0xfc7974)){for(var _0x1020ea in _0xfc7974){if(_0xfc7974['hasOwnProperty'](_0x1020ea)){_0x34a08f[_0x99e7('0x43')](_0xfc7974[_0x1020ea],_0x99e7('0x44'));delete _0xfc7974[_0x1020ea];}}}};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x45')]=function(_0x73366b,_0x307114,_0x516dac){io['to'](_0x73366b)[_0x99e7('0x45')](_0x307114,_0x516dac);};VoiceQueueReport['prototype'][_0x99e7('0x46')]=function(_0x1e7a5d,_0x38fa83){logger['debug'](_0x99e7('0x47')+_0x38fa83+']\x20sending\x20voice_queue_channel:save\x20event:',_0x1e7a5d[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x1e7a5d,{'showHidden':![],'depth':null}));this[_0x99e7('0x45')](util[_0x99e7('0x49')](_0x99e7('0x4a'),_0x1e7a5d[_0x99e7('0x4b')]),_0x99e7('0x4c'),_0x1e7a5d);io[_0x99e7('0x45')](_0x99e7('0x4d'),_0x1e7a5d);};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x43')]=function(_0x39dca2,_0x2037d9){logger['debug'](_0x99e7('0x47')+_0x2037d9+_0x99e7('0x4e'),_0x39dca2['uniqueid'],util[_0x99e7('0x40')](_0x39dca2,{'showHidden':![],'depth':null}));if(_0x39dca2['queuecallerexitreason']==='ATTENDEDTRANSFER')return;this[_0x99e7('0x45')](util[_0x99e7('0x49')](_0x99e7('0x4a'),_0x39dca2[_0x99e7('0x4b')]),_0x99e7('0x4f'),_0x39dca2);io[_0x99e7('0x45')]('voice_queue_presence:remove',_0x39dca2);};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x50')]=function(_0x2c6877,_0xc9e5f7){if(_0x2c6877[_0x99e7('0x51')]===_0x99e7('0x52')){var _0x13bfc3={'id':_0x2c6877['id'],'name':_0x2c6877['name'],'strategy':_0x2c6877[_0x99e7('0x53')],'answered':_0x2c6877[_0x99e7('0x54')],'available':_0x2c6877[_0x99e7('0x55')],'loggedIn':_0x2c6877[_0x99e7('0x56')],'pTalking':_0x2c6877[_0x99e7('0x30')],'sumBillable':_0x2c6877[_0x99e7('0x57')],'sumDuration':_0x2c6877['sumDuration'],'sumHoldTime':_0x2c6877['sumHoldTime']||0x0,'talking':_0x2c6877['talking'],'total':_0x2c6877['total'],'type':_0x2c6877[_0x99e7('0x51')],'unmanaged':_0x2c6877[_0x99e7('0x58')],'abandoned':_0x2c6877[_0x99e7('0x59')],'waiting':_0x2c6877['waiting']};if(_0x2c6877['Trunk']){_0x13bfc3[_0x99e7('0x5a')]={'id':_0x2c6877['Trunk']['id'],'name':_0x2c6877[_0x99e7('0x5a')]['name'],'active':_0x2c6877[_0x99e7('0x5a')][_0x99e7('0x5b')],'callerid':_0x2c6877[_0x99e7('0x5a')]['callerid']};}if(_0x2c6877['Interval']){_0x13bfc3['Interval']={'id':_0x2c6877[_0x99e7('0x5c')]['id'],'name':_0x2c6877[_0x99e7('0x5c')][_0x99e7('0x4b')]};}var _0x2ff34c=md5(JSON[_0x99e7('0x5d')](_0x13bfc3));if(_0x2c6877[_0x99e7('0x3')]!==_0x2ff34c){_0x2c6877[_0x99e7('0x3')]=_0x2ff34c;logger['debug']('[voiceQueueReport]['+_0xc9e5f7+']\x20sending\x20voice_queue:save\x20event:',util[_0x99e7('0x40')](_0x13bfc3,{'showHidden':![],'depth':null}));this[_0x99e7('0x45')](util[_0x99e7('0x49')](_0x99e7('0x4a'),_0x13bfc3[_0x99e7('0x4b')]),_0x99e7('0x5e'),_0x13bfc3);}}};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x5f')]=function(_0x58db70){return _0x58db70!==null&&!_['isUndefined'](_0x58db70);};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x60')]=function(){var _0x318c37=this;setInterval(function(){_0x318c37[_0x99e7('0x34')]();ami[_0x99e7('0x38')]({'action':_0x99e7('0x61')})[_0x99e7('0x3b')](function(_0x52b809){logger[_0x99e7('0x3e')](_0x99e7('0x62'),util[_0x99e7('0x40')](_0x52b809,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport['prototype']['loopQueueSummary']=function(){var _0x4bb19b=this;setInterval(function(){if(_0x4bb19b[_0x99e7('0x63')]){return ami[_0x99e7('0x38')]({'action':_0x99e7('0x64')})[_0x99e7('0x65')](function(){_0x4bb19b[_0x99e7('0x63')]=![];})[_0x99e7('0x3b')](function(_0x3185c0){logger['error'](_0x99e7('0x66'),util[_0x99e7('0x40')](_0x3185c0,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype']['syncQueueSummary']=function(_0x2badea){try{if(this[_0x99e7('0x5f')](_0x2badea)&&this['isNotNull'](_0x2badea[_0x99e7('0x67')])){logger[_0x99e7('0x68')](_0x99e7('0x69'),util[_0x99e7('0x40')](_0x2badea,{'showHidden':![],'depth':null}));if(this['voiceQueues'][_0x2badea[_0x99e7('0x67')]]){logger[_0x99e7('0x6a')](_0x99e7('0x6b'),_0x2badea[_0x99e7('0x67')]);var _0xa5bfe7=_[_0x99e7('0x6c')](this['channels'],_0x99e7('0x67'))[_0x2badea[_0x99e7('0x67')]]||0x0;var _0x263a3d=_0xa5bfe7-_0x2badea[_0x99e7('0x6d')];if(this[_0x99e7('0x12')][_0x2badea[_0x99e7('0x67')]]['waiting']!==_[_0x99e7('0x6e')](_0x2badea[_0x99e7('0x6d')])||this['voiceQueues'][_0x2badea['queue']][_0x99e7('0x56')]!==_[_0x99e7('0x6e')](_0x2badea[_0x99e7('0x6f')])||this['voiceQueues'][_0x2badea[_0x99e7('0x67')]][_0x99e7('0x55')]!==_[_0x99e7('0x6e')](_0x2badea[_0x99e7('0x55')])||this[_0x99e7('0x12')][_0x2badea[_0x99e7('0x67')]][_0x99e7('0x2f')]!==_0x263a3d){this['voiceQueues'][_0x2badea['queue']][_0x99e7('0x31')]=_['toNumber'](_0x2badea[_0x99e7('0x6d')]);this[_0x99e7('0x12')][_0x2badea[_0x99e7('0x67')]][_0x99e7('0x56')]=_[_0x99e7('0x6e')](_0x2badea['loggedin']);this[_0x99e7('0x12')][_0x2badea[_0x99e7('0x67')]][_0x99e7('0x55')]=_[_0x99e7('0x6e')](_0x2badea['available']);this[_0x99e7('0x12')][_0x2badea[_0x99e7('0x67')]][_0x99e7('0x2f')]=_0x263a3d>0x0?_0x263a3d:0x0;this['voiceQueues'][_0x2badea[_0x99e7('0x67')]][_0x99e7('0x2f')]=this['voiceQueues'][_0x2badea[_0x99e7('0x67')]]['talking']>_[_0x99e7('0x6e')](_0x2badea[_0x99e7('0x6f')])?_['toNumber'](_0x2badea[_0x99e7('0x6f')]):this[_0x99e7('0x12')][_0x2badea[_0x99e7('0x67')]][_0x99e7('0x2f')];this['emitVoiceQueueSummary'](this[_0x99e7('0x12')][_0x2badea[_0x99e7('0x67')]],'queuesummary');}logger[_0x99e7('0x68')](_0x99e7('0x70'),util[_0x99e7('0x40')](this[_0x99e7('0x12')][_0x2badea[_0x99e7('0x67')]],{'showHidden':![],'depth':null}));ami[_0x99e7('0x45')]('custom:queuesummary',this[_0x99e7('0x12')][_0x2badea[_0x99e7('0x67')]]);}}}catch(_0x27e030){logger[_0x99e7('0x3e')](_0x99e7('0x66'),util[_0x99e7('0x40')](_0x27e030,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x16')]=function(_0x2a2383){logger['debug']('[voiceQueueReport][queuesummarycomplete]\x20event:',util[_0x99e7('0x40')](_0x2a2383,{'showHidden':![],'depth':null}));ami[_0x99e7('0x45')](_0x99e7('0x71'),{});this['flagQueueSummary']=!![];};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x18')]=function(_0x444149){try{if(this['isNotNull'](_0x444149)){logger[_0x99e7('0x68')](_0x99e7('0x72'),_0x444149['uniqueid'],util[_0x99e7('0x40')](_0x444149,{'showHidden':![],'depth':null}));if(_[_0x99e7('0x73')](this[_0x99e7('0xf')][_0x444149[_0x99e7('0x48')]]))this[_0x99e7('0xf')][_0x444149[_0x99e7('0x48')]]=[];if(_[_0x99e7('0x73')](this['channels'][_0x444149[_0x99e7('0x48')]]))this[_0x99e7('0x35')][_0x444149[_0x99e7('0x48')]]={};var _0x2a337b=new QueueReport();_0x2a337b[_0x99e7('0x4b')]=_0x444149[_0x99e7('0x67')];_0x2a337b[_0x99e7('0x51')]=this[_0x99e7('0x12')][_0x2a337b[_0x99e7('0x4b')]]&&this[_0x99e7('0x12')][_0x2a337b[_0x99e7('0x4b')]][_0x99e7('0x51')]?this[_0x99e7('0x12')][_0x2a337b[_0x99e7('0x4b')]]['type']||_0x99e7('0x52'):_0x99e7('0x52');_0x2a337b[_0x99e7('0x67')]=_0x444149[_0x99e7('0x67')];_0x2a337b[_0x99e7('0x74')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2a337b[_0x99e7('0x75')]=_0x444149[_0x99e7('0x75')];_0x2a337b[_0x99e7('0x76')]=_0x444149[_0x99e7('0x76')];_0x2a337b[_0x99e7('0x48')]=_0x444149['uniqueid'];_0x2a337b[_0x99e7('0x77')]=this['channels'][_0x444149['uniqueid']][_0x99e7('0x77')];logger[_0x99e7('0x6a')](_0x99e7('0x78'),_0x2a337b[_0x99e7('0x4b')],_0x2a337b[_0x99e7('0x51')]);_[_0x99e7('0x79')](_0x2a337b,_[_0x99e7('0x7a')](_0x444149,_[_0x99e7('0x7b')](_0x2a337b)));this[_0x99e7('0xf')][_0x444149[_0x99e7('0x48')]][_0x99e7('0x7c')](_0x2a337b);this[_0x99e7('0x35')][_0x444149[_0x99e7('0x48')]]=_0x2a337b;this[_0x99e7('0x46')](_0x2a337b,_0x99e7('0x17'));}}catch(_0x3b8921){logger[_0x99e7('0x3e')](_0x99e7('0x72'),_0x444149['uniqueid'],util[_0x99e7('0x40')](_0x3b8921,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x4f7e47){try{if(this[_0x99e7('0x5f')](_0x4f7e47)){logger[_0x99e7('0x68')](_0x99e7('0x7d'),_0x4f7e47[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x4f7e47,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4f7e47['uniqueid']]){var _0x1a640d=_['last'](this[_0x99e7('0xf')][_0x4f7e47[_0x99e7('0x48')]]);_0x1a640d[_0x99e7('0x7e')]=![];_0x1a640d[_0x99e7('0x7f')]=null;_0x1a640d[_0x99e7('0x80')]=_0x4f7e47[_0x99e7('0x80')];_0x1a640d[_0x99e7('0x81')]=_0x4f7e47[_0x99e7('0x81')];_0x1a640d['queuecallerabandon']=!![];_0x1a640d[_0x99e7('0x82')]=moment()[_0x99e7('0x49')](_0x99e7('0x83'));_0x1a640d['queuecallerexitreason']=_0x99e7('0x84');_0x1a640d['lastAssignedTo']=null;logger[_0x99e7('0x6a')](_0x99e7('0x85'),_0x1a640d['name'],_0x1a640d[_0x99e7('0x51')]);this[_0x99e7('0x35')][_0x4f7e47['uniqueid']]=_0x1a640d;this[_0x99e7('0x43')](_0x1a640d,_0x99e7('0x19'));}}}catch(_0x3a8da6){logger[_0x99e7('0x3e')](_0x99e7('0x7d'),_0x4f7e47[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x3a8da6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x1b')]=function(_0x4cf848){try{if(this[_0x99e7('0x5f')](_0x4cf848)){logger[_0x99e7('0x68')](_0x99e7('0x86'),_0x4cf848[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x4cf848,{'showHidden':![],'depth':null}));if(this[_0x99e7('0xf')][_0x4cf848['uniqueid']]){var _0x1b266b=_[_0x99e7('0x87')](this[_0x99e7('0xf')][_0x4cf848[_0x99e7('0x48')]]);_0x1b266b[_0x99e7('0x88')]=moment()[_0x99e7('0x49')](_0x99e7('0x83'));_0x1b266b[_0x99e7('0x89')]=_0x4cf848[_0x99e7('0x89')];_0x1b266b['connectedlinename']=_0x4cf848['connectedlinename'];logger[_0x99e7('0x6a')](_0x99e7('0x8a'),_0x1b266b[_0x99e7('0x4b')],_0x1b266b['type'],_0x4cf848['connectedlinenum'],_0x4cf848[_0x99e7('0x8b')]);this[_0x99e7('0x35')][_0x4cf848[_0x99e7('0x48')]]=_0x1b266b;this[_0x99e7('0x46')](_0x1b266b,'queuecallerleave');}}}catch(_0x1d0355){logger['error'](_0x99e7('0x86'),_0x4cf848[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x1d0355,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x99e7('0x8c')]=function(_0x3e30c2){try{if(this[_0x99e7('0x5f')](_0x3e30c2)){logger[_0x99e7('0x68')](_0x99e7('0x8d'),_0x3e30c2[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x3e30c2,{'showHidden':![],'depth':null}));if(this[_0x99e7('0xf')][_0x3e30c2[_0x99e7('0x48')]]){var _0x2bbf94=_[_0x99e7('0x87')](this[_0x99e7('0xf')][_0x3e30c2[_0x99e7('0x48')]]);_0x2bbf94[_0x99e7('0x7e')]=!![];_0x2bbf94[_0x99e7('0x8e')]='COMPLETEDBYAGENT';logger[_0x99e7('0x6a')](_0x99e7('0x8f'),_0x2bbf94[_0x99e7('0x4b')],_0x2bbf94[_0x99e7('0x51')]);}}}catch(_0x342c72){logger['error'](_0x99e7('0x8d'),_0x3e30c2[_0x99e7('0x48')],util['inspect'](_0x342c72,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x1d')]=function(_0x3ab3a3){try{if(this[_0x99e7('0x5f')](_0x3ab3a3)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x3ab3a3['uniqueid'],util[_0x99e7('0x40')](_0x3ab3a3,{'showHidden':![],'depth':null}));if(this[_0x99e7('0xf')][_0x3ab3a3['uniqueid']]){var _0x43bdf1=_['last'](this['queueReports'][_0x3ab3a3['uniqueid']]);_0x43bdf1[_0x99e7('0x19')]=![];_0x43bdf1[_0x99e7('0x82')]=null;_0x43bdf1[_0x99e7('0x90')]=!![];_0x43bdf1[_0x99e7('0x91')]=_0x3ab3a3[_0x99e7('0x92')];_0x43bdf1[_0x99e7('0x80')]=_0x3ab3a3[_0x99e7('0x80')];_0x43bdf1[_0x99e7('0x7e')]=!![];_0x43bdf1[_0x99e7('0x93')]=![];_0x43bdf1['queuecallerexitAt']=null;if(!_0x43bdf1[_0x99e7('0x94')]){if(_0x3ab3a3['reason']==_0x99e7('0x94')){_0x43bdf1[_0x99e7('0x8e')]='COMPLETED';logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x43bdf1[_0x99e7('0x4b')],_0x43bdf1['type']);}else{if(_['startsWith'](_0x3ab3a3[_0x99e7('0x3a')][_0x99e7('0x95')](),_0x99e7('0x96'))){if(this['queueReports'][_0x3ab3a3['linkedid']]){var _0x43452c=_[_0x99e7('0x87')](this[_0x99e7('0xf')][_0x3ab3a3[_0x99e7('0x97')]]);_0x43452c[_0x99e7('0x7e')]=![];_0x43452c[_0x99e7('0x93')]=!![];_0x43452c['queuecallerexitAt']=moment(_0x43bdf1['queuecallerjoinAt'])['add'](_0x3ab3a3['holdtime'],_0x99e7('0x98'))['format'](_0x99e7('0x83'));_0x43452c[_0x99e7('0x8e')]=_0x99e7('0x99');_0x43452c[_0x99e7('0x94')]=!![];_0x43452c[_0x99e7('0x9a')]=_0x99e7('0x9b');_0x43452c[_0x99e7('0x9c')]=_0x3ab3a3[_0x99e7('0x9d')];_0x43452c[_0x99e7('0x9e')]=_0x3ab3a3[_0x99e7('0x48')];logger[_0x99e7('0x6a')](_0x99e7('0x9f'),_0x43452c['name'],_0x43452c[_0x99e7('0x51')]);var _0x213e38=this[_0x99e7('0xf')][_0x3ab3a3[_0x99e7('0x97')]];this['queueReports'][_0x3ab3a3[_0x99e7('0x97')]]=this['queueReports'][_0x3ab3a3['uniqueid']];this[_0x99e7('0xf')][_0x3ab3a3[_0x99e7('0x48')]]=_0x213e38;}}else{_0x43bdf1[_0x99e7('0x8e')]=_0x99e7('0xa0')+_0x3ab3a3[_0x99e7('0xa1')][_0x99e7('0xa2')]();logger[_0x99e7('0x6a')](_0x99e7('0xa3'),_0x43bdf1[_0x99e7('0x4b')],_0x43bdf1[_0x99e7('0x51')],_0x43bdf1['queuecallerexitreason']);}}}this['channels'][_0x3ab3a3['uniqueid']]=_0x43bdf1;this['emitVoiceQueueChannelRemove'](_0x43bdf1,'agentcomplete');}}}catch(_0x2953a6){logger['error'](_0x99e7('0xa4'),_0x3ab3a3[_0x99e7('0x48')],util['inspect'](_0x2953a6,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')]['syncVarSet']=function(_0x1e0fbc){try{if(this['isNotNull'](_0x1e0fbc)){logger[_0x99e7('0x68')](_0x99e7('0xa5'),_0x1e0fbc[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x1e0fbc,{'showHidden':![],'depth':null}));this[_0x99e7('0xa6')](_0x1e0fbc['uniqueid'],_['keys'](_0x1e0fbc['variable'])[0x0],_0x1e0fbc[_0x99e7('0xa7')]);if(this[_0x99e7('0xf')][_0x1e0fbc[_0x99e7('0x48')]]){var _0x1653a1=_['last'](this[_0x99e7('0xf')][_0x1e0fbc[_0x99e7('0x48')]]);if(_0x1653a1){if(this[_0x99e7('0x5f')](_0x1e0fbc['variable'])&&this[_0x99e7('0x5f')](_0x1e0fbc[_0x99e7('0xa8')][_0x99e7('0xa9')])){switch(_0x1e0fbc[_0x99e7('0xa7')]){case _0x99e7('0xaa'):_0x1653a1[_0x99e7('0x93')]=![];_0x1653a1[_0x99e7('0xab')]=null;break;case _0x99e7('0xac'):_0x1653a1[_0x99e7('0xad')]=_0x99e7('0xae');_0x1653a1[_0x99e7('0x93')]=!![];_0x1653a1[_0x99e7('0xab')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1653a1['queuecallerleaveAt']=moment()['format'](_0x99e7('0x83'));logger[_0x99e7('0x68')](_0x99e7('0xaf'),_0x1e0fbc[_0x99e7('0x48')],util['inspect'](_0x1653a1,{'showHidden':![],'depth':null}));ami[_0x99e7('0x45')]('custom:timeout',_0x1653a1);break;default:_0x1653a1[_0x99e7('0x93')]=!![];_0x1653a1[_0x99e7('0xab')]=moment()['format'](_0x99e7('0x83'));_0x1653a1[_0x99e7('0x88')]=moment()['format'](_0x99e7('0x83'));}_0x1653a1[_0x99e7('0x19')]=![];_0x1653a1[_0x99e7('0x82')]=null;_0x1653a1['queuecallerexitreason']=_0x1e0fbc['value'];this['channels'][_0x1e0fbc['uniqueid']]=_0x1653a1;this[_0x99e7('0x43')](_0x1653a1,'varset');}else if(this['isNotNull'](_0x1e0fbc[_0x99e7('0xa8')])&&this[_0x99e7('0x5f')](_0x1e0fbc[_0x99e7('0xa8')][_0x99e7('0xb0')])){if(!_0x1653a1[_0x99e7('0x19')]){_0x1653a1[_0x99e7('0x93')]=!![];_0x1653a1[_0x99e7('0xab')]=moment()[_0x99e7('0x49')](_0x99e7('0x83'));_0x1653a1['queuecallerexitreason']=_0x99e7('0xb1');_0x1653a1['queuecallerleaveAt']=moment()[_0x99e7('0x49')](_0x99e7('0x83'));this[_0x99e7('0x35')][_0x1e0fbc['uniqueid']]=_0x1653a1;}}logger['info'](_0x99e7('0xb2'),_0x1e0fbc['uniqueid'],_0x1653a1['name'],_0x1653a1[_0x99e7('0x51')],_[_0x99e7('0x7b')](_0x1e0fbc[_0x99e7('0xa8')])[0x0],_0x1e0fbc[_0x99e7('0xa7')]);_0x1653a1[_0x99e7('0x14')]=this[_0x99e7('0x14')][_0x1e0fbc[_0x99e7('0x48')]];}}}}catch(_0x1a2112){logger[_0x99e7('0x3e')](_0x99e7('0xa5'),_0x1e0fbc[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x1a2112,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')]['addVariable']=function(_0x181ef3,_0x174330,_0x5919df){var _0xba0500=[_0x99e7('0xb3'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x99e7('0xb4'),_0x99e7('0xb5'),_0x99e7('0xb6'),_0x99e7('0xb7'),'rtpaudioqosrttbridged',_0x99e7('0xb8'),_0x99e7('0xb9'),_0x99e7('0xba'),'bridgepvtcallid',_0x99e7('0xbb'),_0x99e7('0xbc'),_0x99e7('0xbd'),_0x99e7('0xbe'),'membername','memberpenalty',_0x99e7('0xbf')];if(!_[_0x99e7('0x37')](_0x174330)&&!_[_0x99e7('0xc0')](_0xba0500,_0x174330)){if(_[_0x99e7('0x73')](this[_0x99e7('0x14')][_0x181ef3])){this['variables'][_0x181ef3]={};}this[_0x99e7('0x14')][_0x181ef3][_0x174330]=_0x5919df;}};VoiceQueueReport['prototype'][_0x99e7('0xc1')]=function(_0x1df6e3,_0x299ee6,_0x2135ca){var _0x3acf21={};for(var _0x96ec12=0x0;_0x96ec12<this[_0x99e7('0xf')][_0x1df6e3][_0x99e7('0xc2')];_0x96ec12+=0x1){_0x3acf21=this['queueReports'][_0x1df6e3][_0x96ec12];if(this[_0x99e7('0x12')][_0x3acf21[_0x99e7('0x67')]]){if(_0x3acf21[_0x99e7('0x93')]&&_0x3acf21['transfer']!=!![]){this[_0x99e7('0x12')][_0x3acf21[_0x99e7('0x67')]][_0x99e7('0x58')]+=0x1;}if(_0x3acf21[_0x99e7('0x19')]){this['voiceQueues'][_0x3acf21[_0x99e7('0x67')]][_0x99e7('0x59')]+=0x1;}this[_0x99e7('0x12')][_0x3acf21[_0x99e7('0x67')]][_0x99e7('0xc3')]+=moment(_0x3acf21[_0x99e7('0x88')])['diff'](_0x3acf21[_0x99e7('0x74')],'seconds')||0x0;if(_0x96ec12===this['queueReports'][_0x1df6e3][_0x99e7('0xc2')]-0x1){this[_0x99e7('0x12')][_0x3acf21[_0x99e7('0x67')]]['sumDuration']+=moment()['milliseconds'](0x0)[_0x99e7('0xc4')](_0x3acf21[_0x99e7('0x74')],_0x99e7('0x98'));this[_0x99e7('0x12')][_0x3acf21[_0x99e7('0x67')]][_0x99e7('0xc5')]+=0x1;if(_0x3acf21['queuecallercomplete']){this[_0x99e7('0x12')][_0x3acf21[_0x99e7('0x67')]][_0x99e7('0x54')]+=0x1;this[_0x99e7('0x12')][_0x3acf21[_0x99e7('0x67')]][_0x99e7('0x57')]+=moment()[_0x99e7('0xc6')](0x0)[_0x99e7('0xc4')](_0x3acf21['queuecallerleaveAt'],_0x99e7('0x98'));_0x3acf21['queuecallercompleteAt']=moment()[_0x99e7('0x49')](_0x99e7('0x83'));_0x3acf21[_0x99e7('0x93')]=![];_0x3acf21[_0x99e7('0xab')]=null;}if(_0x3acf21[_0x99e7('0x93')]&&_0x3acf21['transfer']!=!![]){_0x3acf21[_0x99e7('0xad')]=_0x99e7('0x58');logger['debug']('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x1df6e3,util[_0x99e7('0x40')](_0x3acf21,{'showHidden':![],'depth':null}));ami[_0x99e7('0x45')](_0x99e7('0xc7'),_0x3acf21);}if(_0x3acf21[_0x99e7('0x19')]){_0x3acf21['lastevent']='abandoned';logger[_0x99e7('0x68')](_0x99e7('0xc8'),_0x1df6e3,util[_0x99e7('0x40')](_0x3acf21,{'showHidden':![],'depth':null}));ami[_0x99e7('0x45')](_0x99e7('0xc9'),_0x3acf21);}}else{this[_0x99e7('0x12')][_0x3acf21[_0x99e7('0x67')]][_0x99e7('0xca')]+=this[_0x99e7('0x12')][_0x3acf21[_0x99e7('0x67')]][_0x99e7('0xc3')];}logger['info'](_0x99e7('0xcb'),_0x1df6e3,_0x3acf21[_0x99e7('0x4b')],_0x3acf21[_0x99e7('0x51')],_0x299ee6);if(_0x2135ca&&_0x3acf21[_0x99e7('0x8e')]===_0x99e7('0xcc')){_0x3acf21['queuecallerexitreason']='COMPLETEDBYAGENT';}this['channels'][_0x1df6e3]=_0x3acf21;this[_0x99e7('0x43')](_0x3acf21,'hangup');this[_0x99e7('0x50')](this[_0x99e7('0x12')][_0x3acf21['queue']],_0x99e7('0x20'));}}logger[_0x99e7('0x68')](_0x99e7('0xcd'),_0x1df6e3,util['inspect'](this[_0x99e7('0xf')][_0x1df6e3],{'showHidden':![],'depth':null}));ami['emit'](_0x99e7('0xce'),this['queueReports'][_0x1df6e3]);if(_0x3acf21[_0x99e7('0x8e')]==='ATTENDEDTRANSFER')return;delete this[_0x99e7('0xf')][_0x1df6e3];delete this[_0x99e7('0x35')][_0x1df6e3];if(this[_0x99e7('0x14')][_0x1df6e3]){delete this[_0x99e7('0x14')][_0x1df6e3];}};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x21')]=function(_0x3cc12d){try{if(this[_0x99e7('0x5f')](_0x3cc12d)){logger[_0x99e7('0x68')](_0x99e7('0xcf'),_0x3cc12d[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x3cc12d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3cc12d[_0x99e7('0x48')]]){return this[_0x99e7('0xc1')](_0x3cc12d[_0x99e7('0x48')],_0x3cc12d[_0x99e7('0xd0')]);}if(this['queueReports'][_0x3cc12d[_0x99e7('0x97')]]){if(_0x3cc12d[_0x99e7('0xd1')]==='21'){return;}return this[_0x99e7('0xc1')](_0x3cc12d[_0x99e7('0x97')],_0x3cc12d[_0x99e7('0xd0')],!![]);}var _0x3f492f=Object[_0x99e7('0x7b')](this[_0x99e7('0xf')]);for(var _0x38ae8a=0x0;_0x38ae8a<_0x3f492f[_0x99e7('0xc2')];_0x38ae8a++){var _0x18e451=_[_0x99e7('0x87')](this[_0x99e7('0xf')][_0x3f492f[_0x38ae8a]]);if(_0x18e451&&_0x18e451[_0x99e7('0xd2')]===_0x3cc12d[_0x99e7('0x48')]){return this['handleHangup'](_0x18e451[_0x99e7('0x48')],_0x3cc12d['cause-txt'],!![]);}}}}catch(_0x1c82cf){logger[_0x99e7('0x3e')](_0x99e7('0xcf'),_0x3cc12d[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x1c82cf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x29')]=function(_0x46eb5a){try{if(this[_0x99e7('0x5f')](_0x46eb5a)){logger['debug'](_0x99e7('0xd3'),_0x46eb5a[_0x99e7('0x48')],util['inspect'](_0x46eb5a,{'showHidden':![],'depth':null}));var _0x1dab42;var _0x39ab86;var _0xa0d0d5;if(this[_0x99e7('0xf')][_0x46eb5a[_0x99e7('0xd4')]]){_0x1dab42=_[_0x99e7('0x87')](this[_0x99e7('0xf')][_0x46eb5a[_0x99e7('0xd4')]]);_0x1dab42[_0x99e7('0x9c')]=_0x46eb5a[_0x99e7('0xd5')];_0x1dab42['transferuniqueid']=_0x46eb5a['secondtransfereruniqueid'];_0x1dab42[_0x99e7('0x8e')]=_0x99e7('0xcc');_0x1dab42[_0x99e7('0x94')]=!![];_0x1dab42[_0x99e7('0x9a')]=_0x99e7('0xd6');if(this[_0x99e7('0xf')][_0x46eb5a['secondtransfereruniqueid']]){_0xa0d0d5=this[_0x99e7('0xf')][_0x46eb5a['secondtransfereruniqueid']];this[_0x99e7('0xf')][_0x46eb5a['secondtransfereruniqueid']]=this[_0x99e7('0xf')][_0x46eb5a[_0x99e7('0xd4')]];this[_0x99e7('0xf')][_0x46eb5a[_0x99e7('0xd4')]]=_0xa0d0d5;_0x39ab86=_[_0x99e7('0x87')](this['queueReports'][_0x46eb5a[_0x99e7('0xd4')]]);_0x39ab86['switch']=!![];}logger[_0x99e7('0x6a')](_0x99e7('0xd7'),_0x46eb5a['uniqueid'],_0x1dab42[_0x99e7('0x4b')],_0x1dab42[_0x99e7('0x51')],_0x1dab42[_0x99e7('0x9c')],_0x1dab42[_0x99e7('0x9e')]);}else if(this['queueReports'][_0x46eb5a['transfertargetuniqueid']]){_0x1dab42=_[_0x99e7('0x87')](this[_0x99e7('0xf')][_0x46eb5a[_0x99e7('0xd8')]]);_0x1dab42[_0x99e7('0x9c')]=_0x46eb5a[_0x99e7('0xd9')];_0x1dab42[_0x99e7('0x9e')]=_0x46eb5a[_0x99e7('0xda')];_0x1dab42['queuecallerexitreason']=_0x99e7('0xcc');_0x1dab42[_0x99e7('0x94')]=!![];_0x1dab42[_0x99e7('0x9a')]='ATTENDED';if(this[_0x99e7('0xf')][_0x46eb5a[_0x99e7('0xda')]]){_0xa0d0d5=this['queueReports'][_0x46eb5a[_0x99e7('0xda')]];this[_0x99e7('0xf')][_0x46eb5a['origtransfereruniqueid']]=this['queueReports'][_0x46eb5a[_0x99e7('0xd8')]];this['queueReports'][_0x46eb5a[_0x99e7('0xd8')]]=_0xa0d0d5;_0x39ab86=_[_0x99e7('0x87')](this['queueReports'][_0x46eb5a[_0x99e7('0xd8')]]);_0x39ab86[_0x99e7('0x36')]=!![];}logger[_0x99e7('0x6a')]('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x46eb5a[_0x99e7('0x48')],_0x1dab42[_0x99e7('0x4b')],_0x1dab42['type'],_0x1dab42[_0x99e7('0x9c')],_0x1dab42[_0x99e7('0x9e')]);}else if(this[_0x99e7('0xf')][_0x46eb5a[_0x99e7('0xda')]]){_0x1dab42=_['last'](this[_0x99e7('0xf')][_0x46eb5a['origtransfereruniqueid']]);_0x1dab42[_0x99e7('0x9c')]=_0x46eb5a[_0x99e7('0xd9')];_0x1dab42[_0x99e7('0x9e')]=_0x46eb5a[_0x99e7('0xda')];_0x1dab42['queuecallerexitreason']='ATTENDEDTRANSFER';_0x1dab42[_0x99e7('0x94')]=!![];_0x1dab42[_0x99e7('0x9a')]='ATTENDED';_0x1dab42[_0x99e7('0x36')]=!![];_0x1dab42[_0x99e7('0xd2')]=_0x46eb5a[_0x99e7('0xd4')];}else if(this[_0x99e7('0xf')][_0x46eb5a[_0x99e7('0xdb')]]){_0x1dab42=_[_0x99e7('0x87')](this[_0x99e7('0xf')][_0x46eb5a[_0x99e7('0xdb')]]);_0x1dab42[_0x99e7('0x9c')]=_0x46eb5a[_0x99e7('0xd5')];_0x1dab42[_0x99e7('0x9e')]=_0x46eb5a[_0x99e7('0xdb')];_0x1dab42[_0x99e7('0x8e')]=_0x99e7('0xcc');_0x1dab42[_0x99e7('0x94')]=!![];_0x1dab42['transfertype']='ATTENDED';_0x1dab42[_0x99e7('0x36')]=!![];_0x1dab42[_0x99e7('0xd2')]=_0x46eb5a[_0x99e7('0xd8')];}}}catch(_0x2c0075){logger[_0x99e7('0x3e')]('[%s][voiceQueueReport][attendedtransfer]',_0x46eb5a[_0x99e7('0x48')],util['inspect'](_0x2c0075,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')]['syncBlindTransfer']=function(_0x1de104){try{if(this['isNotNull'](_0x1de104)){logger[_0x99e7('0x68')](_0x99e7('0xdc'),_0x1de104[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x1de104,{'showHidden':![],'depth':null}));if(this[_0x99e7('0xf')][_0x1de104['transfereeuniqueid']]){var _0x3a11cf=_[_0x99e7('0x87')](this[_0x99e7('0xf')][_0x1de104[_0x99e7('0xd4')]]);_0x3a11cf[_0x99e7('0x8e')]=_0x99e7('0xdd');_0x3a11cf[_0x99e7('0x94')]=!![];_0x3a11cf[_0x99e7('0x9a')]='BLIND';_0x3a11cf['transferexten']=_0x1de104[_0x99e7('0xde')];_0x3a11cf[_0x99e7('0x9e')]=_0x1de104[_0x99e7('0xd4')];logger[_0x99e7('0x6a')](_0x99e7('0xdf'),_0x1de104['uniqueid'],_0x3a11cf[_0x99e7('0x4b')],_0x3a11cf[_0x99e7('0x51')],_0x3a11cf[_0x99e7('0x9c')],_0x3a11cf[_0x99e7('0x9e')]);this[_0x99e7('0x21')]({'event':'BlindTransfer','uniqueid':_0x1de104[_0x99e7('0xd4')],'context':_0x1de104[_0x99e7('0xe0')],'channel':_0x1de104['transfererchannel']});}}}catch(_0x51250f){logger['error'](_0x99e7('0xdc'),_0x1de104[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x51250f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')]['syncMusicOnHoldStart']=function(_0x1dd789){try{if(this['isNotNull'](_0x1dd789)){logger[_0x99e7('0x68')](_0x99e7('0xe1'),_0x1dd789[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x1dd789,{'showHidden':![],'depth':null}));if(this[_0x99e7('0xf')][_0x1dd789[_0x99e7('0x48')]]){var _0x52148e=_[_0x99e7('0x87')](this['queueReports'][_0x1dd789[_0x99e7('0x48')]]);if(!_['isNil'](_0x52148e[_0x99e7('0x88')])){_0x52148e['mohstarttime']=moment()[_0x99e7('0x49')](_0x99e7('0x83'));logger[_0x99e7('0x6a')](_0x99e7('0xe2'),_0x1dd789[_0x99e7('0x48')],_0x52148e['mohstarttime']);}}}}catch(_0x324d48){logger['error'](_0x99e7('0xe1'),_0x1dd789['uniqueid'],util[_0x99e7('0x40')](_0x324d48,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')][_0x99e7('0x27')]=function(_0x34bdc6){try{if(this['isNotNull'](_0x34bdc6)){logger[_0x99e7('0x68')](_0x99e7('0xe3'),_0x34bdc6[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x34bdc6,{'showHidden':![],'depth':null}));if(this[_0x99e7('0xf')][_0x34bdc6['uniqueid']]){var _0x19e53e=_[_0x99e7('0x87')](this['queueReports'][_0x34bdc6[_0x99e7('0x48')]]);if(!_['isNil'](_0x19e53e[_0x99e7('0xe4')])){_0x19e53e[_0x99e7('0xe5')]+=moment()[_0x99e7('0xc6')](0x0)['diff'](_0x19e53e[_0x99e7('0xe4')],_0x99e7('0x98'));logger['info'](_0x99e7('0xe6'),_0x34bdc6[_0x99e7('0x48')],_0x19e53e[_0x99e7('0xe5')]);delete _0x19e53e[_0x99e7('0xe4')];}}}}catch(_0x12906e){logger[_0x99e7('0x3e')](_0x99e7('0xe3'),_0x34bdc6[_0x99e7('0x48')],util['inspect'](_0x12906e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x99e7('0x33')]['syncNewExten']=function(_0x3895e0){try{if(this[_0x99e7('0x5f')](_0x3895e0)){logger[_0x99e7('0x68')](_0x99e7('0xe7'),_0x3895e0[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x3895e0,{'showHidden':![],'depth':null}));if(_0x3895e0[_0x99e7('0xe8')][_0x99e7('0x95')]()===_0x99e7('0xe9')){_0x3895e0[_0x99e7('0xea')]=_0x3895e0[_0x99e7('0xeb')]&&_0x3895e0['appdata'][_0x99e7('0xec')](_0x99e7('0xed'))?_0x3895e0[_0x99e7('0xeb')]:(_0x3895e0[_0x99e7('0xeb')]||_0x3895e0[_0x99e7('0xea')])[_0x99e7('0x95')]();if(_[_0x99e7('0xec')](_0x3895e0[_0x99e7('0xea')][_0x99e7('0x95')](),_0x99e7('0xee'))){logger[_0x99e7('0x6a')](_0x99e7('0xef'),_0x3895e0[_0x99e7('0x48')],_0x3895e0['application'],_0x3895e0[_0x99e7('0xea')]);if(_['isUndefined'](this[_0x99e7('0x35')][_0x3895e0[_0x99e7('0x48')]]))this[_0x99e7('0x35')][_0x3895e0[_0x99e7('0x48')]]={};var _0x46786f=_0x3895e0[_0x99e7('0xea')][_0x99e7('0xf0')]('=');var _0x13a53c=_0x46786f[0x0][_0x99e7('0x95')]()[_0x99e7('0xf1')](/cdr\((.*)\)/);if(_0x13a53c)this[_0x99e7('0x35')][_0x3895e0[_0x99e7('0x48')]][_0x13a53c[0x1]]=_0x46786f[0x1];}}}}catch(_0x32c8a2){logger[_0x99e7('0x3e')](_0x99e7('0xf2'),_0x3895e0[_0x99e7('0x48')],util[_0x99e7('0x40')](_0x32c8a2,{'showHidden':![],'depth':null}));}};module[_0x99e7('0xf3')]=VoiceQueueReport;