Built motion from commit 56b8093a.|2.6.29
[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 _0x8163=['debug','[%s][voiceQueueReport][','uniqueid','voice:queue:%s','voice_queue_channel:save','voice_queue_presence:save',']\x20sending\x20voice_queue_channel:remove\x20event:','queuecallerexitreason','ATTENDEDTRANSFER','format','voice_queue_channel:remove','emitInboundVoiceQueueSummary','type','inbound','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','isRunning','Action','[voiceQueueReport][queuesummary]','createQueueSummaryReport','summaryEvent','createReport','realtime','compareToInboundQueue','queuestatus','queue','handleInboundQueueSummaryReport','outbound','custom:queuesummary','statusRequests','completeEvent','actionid','syncQueueSummary','[voiceQueueReport][queuesummary]\x20event:','then','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','assign','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','queuecallercompleteAt','originalposition','queuecallerabandonAt','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','connectedlinenum','connectedlinename','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','[%s][voiceQueueReport][agentconnect]','assigned','holdtime','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','linkedid','queuecallerexitAt','add','seconds','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','value','variable','TIMEOUT','lastevent','timeout','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','handleHangup','length','sumHoldTime','diff','queuecallerjoinAt','COMPLETEDBYAGENT','sumDuration','milliseconds','total','answered','sumBillable','unmanaged','custom:queuecallerunmanaged','abandoned','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][handleHangup]','[%s][voiceQueueReport][hangup]','transferid','cause-txt','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','transferuniqueid','secondtransfereruniqueid','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','secondtransfererexten','ATTENDED','[%s][voiceQueueReport][blindtransfer]','BlindTransfer','context','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstart]','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','applicationdata','appdata','CDR(routeAlias)','cdr(','[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s','application','split','match','lodash','moment','ioredis','../../../config/environment','ami','../ami','../model/queueReport','../model/voiceQueueSummary','redis','defaults','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','campaigns','variables','queuesummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','unlockRR','queuecallerexit','queuecallerabandon','clearZombieChannels','switch','isNil','status','channel','catch','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','inspect','[FullyBooted]\x20clear\x20realtime','summary','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','emitVoiceQueueChannelSave'];(function(_0x2c1976,_0x47e99a){var _0x5f15c0=function(_0x55fe36){while(--_0x55fe36){_0x2c1976['push'](_0x2c1976['shift']());}};_0x5f15c0(++_0x47e99a);}(_0x8163,0xa2));var _0x3816=function(_0x527767,_0x169b6b){_0x527767=_0x527767-0x0;var _0xd7c54a=_0x8163[_0x527767];return _0xd7c54a;};'use strict';var _=require(_0x3816('0x0'));var moment=require(_0x3816('0x1'));var util=require('util');var Redis=require(_0x3816('0x2'));var config=require(_0x3816('0x3'));var logger=require('../../../config/logger')(_0x3816('0x4'));var ami=require(_0x3816('0x5'));var QueueReport=require(_0x3816('0x6'));var VoiceQueueSummary=require(_0x3816('0x7'));config[_0x3816('0x8')]=_[_0x3816('0x9')](config[_0x3816('0x8')],{'host':_0x3816('0xa'),'port':0x18eb});var io=require(_0x3816('0xb'))(new Redis(config[_0x3816('0x8')]));var Sequence=function(){};Sequence[_0x3816('0xc')][_0x3816('0xd')]=function(_0x2f0360){this['tail']=this[_0x3816('0xe')]?this['tail'][_0x3816('0xf')](_0x2f0360):_0x2f0360();};function VoiceQueueReport(_0x316e07){this[_0x3816('0x10')]=new Sequence();this[_0x3816('0x11')]={};this['realtime']=_0x316e07;this['agents']=_0x316e07[_0x3816('0x12')];this[_0x3816('0x13')]=_0x316e07[_0x3816('0x14')];this[_0x3816('0x15')]=_0x316e07['voiceQueues'];this[_0x3816('0x16')]=_0x316e07['campaigns'];this['summary']=initializeSummary();this[_0x3816('0x17')]={};ami['on'](_0x3816('0x18'),this['syncQueueSummary'][_0x3816('0x19')](this));ami['on'](_0x3816('0x1a'),this[_0x3816('0x1b')][_0x3816('0x19')](this));ami['on'](_0x3816('0x1c'),this[_0x3816('0x1d')]['bind'](this));ami['on'](_0x3816('0x1e'),this[_0x3816('0x1f')][_0x3816('0x19')](this));ami['on'](_0x3816('0x20'),this[_0x3816('0x21')][_0x3816('0x19')](this));ami['on']('queuecallerabandon',this[_0x3816('0x22')][_0x3816('0x19')](this));ami['on'](_0x3816('0x23'),this[_0x3816('0x24')]['bind'](this));ami['on'](_0x3816('0x25'),this[_0x3816('0x26')][_0x3816('0x19')](this));ami['on'](_0x3816('0x27'),this[_0x3816('0x28')][_0x3816('0x19')](this));ami['on'](_0x3816('0x29'),this[_0x3816('0x2a')][_0x3816('0x19')](this));ami['on'](_0x3816('0x2b'),this[_0x3816('0x2c')][_0x3816('0x19')](this));ami['on'](_0x3816('0x2d'),this[_0x3816('0x2e')][_0x3816('0x19')](this));ami['on'](_0x3816('0x2f'),this[_0x3816('0x30')]['bind'](this));ami['on'](_0x3816('0x31'),this[_0x3816('0x32')]['bind'](this));ami['on'](_0x3816('0x33'),this[_0x3816('0x34')][_0x3816('0x19')](this));ami['on'](_0x3816('0x35'),this[_0x3816('0x36')][_0x3816('0x19')](this));this[_0x3816('0x37')]();this[_0x3816('0x38')]();}function clearChannels(_0x5c9404){if(!_[_0x3816('0x39')](_0x5c9404)){for(var _0x3f35da in _0x5c9404){if(_0x5c9404[_0x3816('0x3a')](_0x3f35da)){delete _0x5c9404[_0x3f35da];}}}}function clearCampaigns(_0x329fdc){if(!_[_0x3816('0x39')](_0x329fdc)){for(var _0x3cb974 in _0x329fdc){if(_0x329fdc['hasOwnProperty'](_0x3cb974)){_0x329fdc[_0x3cb974][_0x3816('0x3b')]=0x0;}}}}function clearVoiceQueues(_0x29e29a){if(!_['isEmpty'](_0x29e29a)){for(var _0x4f00e0 in _0x29e29a){if(_0x29e29a[_0x3816('0x3a')](_0x4f00e0)){_0x29e29a[_0x4f00e0][_0x3816('0x3b')]=0x0;_0x29e29a[_0x4f00e0][_0x3816('0x3c')]=0x0;_0x29e29a[_0x4f00e0][_0x3816('0x3d')]=0x0;_0x29e29a[_0x4f00e0][_0x3816('0x3e')]=0x0;_0x29e29a[_0x4f00e0]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x5755ff){if(!_[_0x3816('0x39')](_0x5755ff)){for(var _0x16b41f in _0x5755ff){if(_0x5755ff[_0x3816('0x3a')](_0x16b41f)){_0x5755ff[_0x16b41f][_0x3816('0x3f')]=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x4d761f){return _0x4d761f[_0x3816('0x40')]||_0x4d761f[_0x3816('0x41')]||_0x4d761f['queuecallercomplete'];}VoiceQueueReport[_0x3816('0xc')][_0x3816('0x42')]=function(){var _0x1bf03c=this;for(var _0x4a6083 in this[_0x3816('0x13')]){if(this[_0x3816('0x13')][_0x3816('0x3a')](_0x4a6083)&&!this[_0x3816('0x13')][_0x4a6083][_0x3816('0x43')]){this['sequence'][_0x3816('0xd')](function(){if(!_[_0x3816('0x44')](_0x1bf03c[_0x3816('0x13')][_0x4a6083])){return ami['Action']({'action':_0x3816('0x45'),'channel':_0x1bf03c[_0x3816('0x13')][_0x4a6083][_0x3816('0x46')]})[_0x3816('0x47')](function(_0xefe5c2){if(_0xefe5c2[_0x3816('0x48')]===_0x3816('0x49')){setTimeout(function(){if(_0x1bf03c[_0x3816('0x13')][_0x4a6083]){delete _0x1bf03c[_0x3816('0x13')][_0x4a6083];logger['error'](_0x3816('0x4a'),_0x4a6083,util['inspect'](_0xefe5c2,{'showHidden':![],'depth':null}));}if(_0x1bf03c[_0x3816('0x11')][_0x4a6083]){delete _0x1bf03c['queueReports'][_0x4a6083];logger[_0x3816('0x4b')](_0x3816('0x4c'),_0x4a6083,util['inspect'](_0xefe5c2,{'showHidden':![],'depth':null}));}if(_0x1bf03c['variables'][_0x4a6083]){delete _0x1bf03c[_0x3816('0x17')][_0x4a6083];logger[_0x3816('0x4b')](_0x3816('0x4d'),_0x4a6083,util[_0x3816('0x4e')](_0xefe5c2,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x3816('0xc')]['syncFullyBooted']=function(){logger[_0x3816('0x4b')](_0x3816('0x4f'));clearChannels(this[_0x3816('0x13')]);this['clearQueueReport'](this[_0x3816('0x11')]);clearAgentBooked(this['agents']);clearVoiceQueues(this[_0x3816('0x15')]);clearCampaigns(this[_0x3816('0x16')]);this[_0x3816('0x50')]=initializeSummary();};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x51')]=function(_0x3b524f){var _0x52cc39=this;if(!_[_0x3816('0x39')](_0x3b524f)){for(var _0x449636 in _0x3b524f){if(_0x3b524f['hasOwnProperty'](_0x449636)){_0x52cc39[_0x3816('0x52')](_0x3b524f[_0x449636],_0x3816('0x53'));delete _0x3b524f[_0x449636];}}}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x54')]=function(_0x1feebe,_0xb58046,_0x8dfc1c){io['to'](_0x1feebe)['emit'](_0xb58046,_0x8dfc1c);};VoiceQueueReport['prototype'][_0x3816('0x55')]=function(_0x29bff1,_0x63f997){logger[_0x3816('0x56')](_0x3816('0x57')+_0x63f997+']\x20sending\x20voice_queue_channel:save\x20event:',_0x29bff1[_0x3816('0x58')],util[_0x3816('0x4e')](_0x29bff1,{'showHidden':![],'depth':null}));this[_0x3816('0x54')](util['format'](_0x3816('0x59'),_0x29bff1['queue']),_0x3816('0x5a'),_0x29bff1);io[_0x3816('0x54')](_0x3816('0x5b'),_0x29bff1);};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x52')]=function(_0x3e238c,_0x541abb){logger['debug'](_0x3816('0x57')+_0x541abb+_0x3816('0x5c'),_0x3e238c[_0x3816('0x58')],util['inspect'](_0x3e238c,{'showHidden':![],'depth':null}));if(_0x3e238c[_0x3816('0x5d')]===_0x3816('0x5e')){return;}this['emit'](util[_0x3816('0x5f')](_0x3816('0x59'),_0x3e238c['queue']),_0x3816('0x60'),_0x3e238c);io[_0x3816('0x54')]('voice_queue_presence:remove',_0x3e238c);};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x61')]=function(_0x4321b4){if(_0x4321b4[_0x3816('0x62')]===_0x3816('0x63')){logger['debug'](_0x3816('0x64'),util[_0x3816('0x4e')](_0x4321b4,{'showHidden':![],'depth':null}));this['emit'](util['format']('voice:queue:%s',_0x4321b4[_0x3816('0x65')]),'voice_queue:save',_0x4321b4);}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x66')]=function(_0x5adb54){return _0x5adb54!==null&&!_[_0x3816('0x67')](_0x5adb54);};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x38')]=function(){var _0x197958=this;setInterval(function(){_0x197958[_0x3816('0x42')]();ami['Action']({'action':_0x3816('0x68')})['catch'](function(_0xfc79e4){logger[_0x3816('0x4b')](_0x3816('0x69'),util['inspect'](_0xfc79e4,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x37')]=function(){var _0x1eb020=this;setInterval(function(){if(!_0x1eb020[_0x3816('0x50')][_0x3816('0x6a')]){return ami[_0x3816('0x6b')]({'action':_0x3816('0x18')})['then'](function(_0x58b409){_0x1eb020[_0x3816('0x50')]['id']=_0x58b409['actionid'];_0x1eb020[_0x3816('0x50')][_0x3816('0x6a')]=!![];_0x1eb020[_0x3816('0x50')]['queuestatus'][_0x58b409['actionid']]={};})[_0x3816('0x47')](function(_0x1c8cf4){logger['error'](_0x3816('0x6c'),util['inspect'](_0x1c8cf4,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport['prototype'][_0x3816('0x6d')]=function(_0x44a530,_0x52b39f){var _0x3b5981;if(this[_0x3816('0x50')]&&this[_0x3816('0x50')][_0x3816('0x68')]&&this[_0x3816('0x50')][_0x3816('0x68')][_0x44a530[_0x3816('0x65')]]){_0x3b5981=this[_0x3816('0x50')][_0x3816('0x68')][_0x44a530['name']][_0x3816('0x6e')];}var _0x46ef4c=new VoiceQueueSummary(_0x44a530);return _0x46ef4c[_0x3816('0x6f')](_0x52b39f[_0x3816('0x12')],this[_0x3816('0x12')],_0x3b5981,this[_0x3816('0x70')][_0x3816('0x13')]);};VoiceQueueReport[_0x3816('0xc')]['handleInboundQueueSummaryReport']=function(_0x27187e,_0x30430a){var _0x3bb777=this['createQueueSummaryReport'](_0x27187e,_0x30430a);var _0x275b74=![];_0x275b74=_0x3bb777[_0x3816('0x71')](_0x27187e);if(_0x275b74){Object['assign'](_0x27187e,_0x3bb777);this[_0x3816('0x70')]['voiceQueues'][_0x27187e['name']]=_0x27187e;this['emitInboundVoiceQueueSummary'](_0x3bb777);}};VoiceQueueReport['prototype']['syncQueueStatusComplete']=function(_0x1221da){var _0x402dcb=null;var _0x1b2959=this[_0x3816('0x50')]['id'];if(this[_0x3816('0x50')]['queuestatus'][_0x1b2959]){_0x402dcb=this[_0x3816('0x50')][_0x3816('0x72')][_0x1b2959][_0x1221da['actionid']];}if(!_0x402dcb){this[_0x3816('0x50')]=initializeSummary();return;}var _0x38f6c6=this['voiceQueues'][_0x402dcb[_0x3816('0x73')]];if(_0x38f6c6['type']==='inbound'){this[_0x3816('0x74')](_0x38f6c6,_0x402dcb);}else if(_0x38f6c6['type']===_0x3816('0x75')){var _0x5be0a8=this[_0x3816('0x6d')](_0x38f6c6,_0x402dcb);ami[_0x3816('0x54')](_0x3816('0x76'),_0x5be0a8);}this[_0x3816('0x50')]['statusRequests']-=0x1;var _0x489dae=this[_0x3816('0x50')][_0x3816('0x77')]>0x0?!![]:![];if(!_0x489dae){return this[_0x3816('0x1b')](this[_0x3816('0x50')][_0x3816('0x78')]);}};VoiceQueueReport['prototype'][_0x3816('0x1d')]=function(_0x2f3744){var _0x396af2=this['summary']['id'];if(this[_0x3816('0x50')][_0x3816('0x72')][_0x396af2]&&this[_0x3816('0x50')][_0x3816('0x72')][_0x396af2][_0x2f3744[_0x3816('0x79')]]){this[_0x3816('0x50')][_0x3816('0x72')][_0x396af2][_0x2f3744[_0x3816('0x79')]][_0x3816('0x12')]['push'](_0x2f3744);}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x7a')]=function(_0x378a31){var _0x347f94=this;try{if(this[_0x3816('0x66')](_0x378a31)&&this[_0x3816('0x66')](_0x378a31[_0x3816('0x73')])){logger[_0x3816('0x56')](_0x3816('0x7b'),util[_0x3816('0x4e')](_0x378a31,{'showHidden':![],'depth':null}));var _0x58e59d=this[_0x3816('0x15')][_0x378a31[_0x3816('0x73')]];if(_0x58e59d){logger['debug']('[voiceQueueReport][queuesummary]\x20name:%s',_0x58e59d[_0x3816('0x65')]);this[_0x3816('0x50')][_0x3816('0x68')][_0x58e59d[_0x3816('0x65')]]={'summaryEvent':_0x378a31};this[_0x3816('0x50')][_0x3816('0x77')]+=0x1;return ami[_0x3816('0x6b')]({'action':_0x3816('0x72'),'queue':_0x58e59d[_0x3816('0x65')]})[_0x3816('0x7c')](function(_0x3ae675){if(!_0x347f94[_0x3816('0x50')]['queuestatus'][_0x378a31[_0x3816('0x79')]]){_0x347f94[_0x3816('0x50')][_0x3816('0x72')][_0x378a31[_0x3816('0x79')]]={};}_0x347f94[_0x3816('0x50')]['queuestatus'][_0x378a31['actionid']][_0x3ae675[_0x3816('0x79')]]={'queue':_0x58e59d['name'],'agents':[]};})[_0x3816('0x47')](function(_0x293ce1){throw _0x293ce1;});}}}catch(_0x1f466e){logger[_0x3816('0x4b')]('[voiceQueueReport][queuesummary]',util[_0x3816('0x4e')](_0x1f466e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x1b')]=function(_0x5496d5){if(this[_0x3816('0x50')][_0x3816('0x77')]>0x0){this[_0x3816('0x50')][_0x3816('0x78')]=_0x5496d5;return;}logger[_0x3816('0x56')](_0x3816('0x7d'),util['inspect'](_0x5496d5,{'showHidden':![],'depth':null}));this[_0x3816('0x50')]=initializeSummary();ami[_0x3816('0x54')]('custom:queuesummarycomplete',{});};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x21')]=function(_0x441e9b){try{if(this[_0x3816('0x66')](_0x441e9b)){logger[_0x3816('0x56')](_0x3816('0x7e'),_0x441e9b[_0x3816('0x58')],util['inspect'](_0x441e9b,{'showHidden':![],'depth':null}));if(_[_0x3816('0x67')](this['queueReports'][_0x441e9b[_0x3816('0x58')]])){this['queueReports'][_0x441e9b[_0x3816('0x58')]]=[];}if(_['isUndefined'](this['channels'][_0x441e9b['uniqueid']])){this[_0x3816('0x13')][_0x441e9b[_0x3816('0x58')]]={};}var _0x2fcf4f=new QueueReport();_0x2fcf4f[_0x3816('0x73')]=_0x441e9b['queue'];_0x2fcf4f['type']=this[_0x3816('0x15')][_0x2fcf4f[_0x3816('0x73')]]&&this['voiceQueues'][_0x2fcf4f[_0x3816('0x73')]][_0x3816('0x62')]?this[_0x3816('0x15')][_0x2fcf4f[_0x3816('0x73')]]['type']||_0x3816('0x63'):'inbound';_0x2fcf4f['queuecallerjoinAt']=moment()['format'](_0x3816('0x7f'));_0x2fcf4f[_0x3816('0x80')]=_0x441e9b[_0x3816('0x80')];_0x2fcf4f[_0x3816('0x81')]=_0x441e9b[_0x3816('0x81')];_0x2fcf4f[_0x3816('0x58')]=_0x441e9b['uniqueid'];_0x2fcf4f[_0x3816('0x82')]=this[_0x3816('0x13')][_0x441e9b['uniqueid']][_0x3816('0x82')];logger[_0x3816('0x83')](_0x3816('0x84'),_0x2fcf4f[_0x3816('0x73')],_0x2fcf4f[_0x3816('0x62')]);Object[_0x3816('0x85')](_0x2fcf4f,_[_0x3816('0x86')](_0x441e9b,_[_0x3816('0x87')](_0x2fcf4f)));this['queueReports'][_0x441e9b[_0x3816('0x58')]][_0x3816('0x88')](_0x2fcf4f);this['channels'][_0x441e9b['uniqueid']]=_0x2fcf4f;this[_0x3816('0x55')](_0x2fcf4f,_0x3816('0x20'));}}catch(_0x5cbeac){logger[_0x3816('0x4b')](_0x3816('0x7e'),_0x441e9b[_0x3816('0x58')],util[_0x3816('0x4e')](_0x5cbeac,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x22')]=function(_0x48c58c){try{if(this[_0x3816('0x66')](_0x48c58c)){logger[_0x3816('0x56')](_0x3816('0x89'),_0x48c58c[_0x3816('0x58')],util[_0x3816('0x4e')](_0x48c58c,{'showHidden':![],'depth':null}));if(this[_0x3816('0x11')][_0x48c58c[_0x3816('0x58')]]){var _0x25f014=_[_0x3816('0x8a')](this[_0x3816('0x11')][_0x48c58c[_0x3816('0x58')]]);_0x25f014[_0x3816('0x8b')]=![];_0x25f014[_0x3816('0x8c')]=null;_0x25f014['holdtime']=_0x48c58c['holdtime'];_0x25f014[_0x3816('0x8d')]=_0x48c58c['originalposition'];_0x25f014[_0x3816('0x41')]=!![];_0x25f014[_0x3816('0x8e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x25f014[_0x3816('0x5d')]=_0x3816('0x8f');_0x25f014[_0x3816('0x90')]=null;logger[_0x3816('0x83')](_0x3816('0x91'),_0x25f014[_0x3816('0x73')],_0x25f014[_0x3816('0x62')]);this[_0x3816('0x13')][_0x48c58c[_0x3816('0x58')]]=_0x25f014;this[_0x3816('0x52')](_0x25f014,_0x3816('0x41'));}}}catch(_0x31eae5){logger[_0x3816('0x4b')](_0x3816('0x89'),_0x48c58c['uniqueid'],util[_0x3816('0x4e')](_0x31eae5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x24')]=function(_0x4917eb){try{if(this[_0x3816('0x66')](_0x4917eb)){logger['debug'](_0x3816('0x92'),_0x4917eb[_0x3816('0x58')],util[_0x3816('0x4e')](_0x4917eb,{'showHidden':![],'depth':null}));if(this[_0x3816('0x11')][_0x4917eb[_0x3816('0x58')]]){var _0x59c684=_['last'](this[_0x3816('0x11')][_0x4917eb['uniqueid']]);_0x59c684['queuecallerleaveAt']=moment()[_0x3816('0x5f')](_0x3816('0x7f'));_0x59c684['connectedlinenum']=_0x4917eb[_0x3816('0x93')];_0x59c684[_0x3816('0x94')]=_0x4917eb[_0x3816('0x94')];logger[_0x3816('0x83')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x59c684[_0x3816('0x73')],_0x59c684['type'],_0x4917eb['connectedlinenum'],_0x4917eb[_0x3816('0x94')]);this['channels'][_0x4917eb[_0x3816('0x58')]]=_0x59c684;this['emitVoiceQueueChannelSave'](_0x59c684,'queuecallerleave');}}}catch(_0x7420fc){logger['error'](_0x3816('0x92'),_0x4917eb[_0x3816('0x58')],util[_0x3816('0x4e')](_0x7420fc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x28')]=function(_0x13b5f8){try{if(this[_0x3816('0x66')](_0x13b5f8)){logger['debug']('[%s][voiceQueueReport][agentconnect]',_0x13b5f8[_0x3816('0x58')],util[_0x3816('0x4e')](_0x13b5f8,{'showHidden':![],'depth':null}));if(this[_0x3816('0x11')][_0x13b5f8[_0x3816('0x58')]]){var _0x27e766=_[_0x3816('0x8a')](this['queueReports'][_0x13b5f8[_0x3816('0x58')]]);_0x27e766[_0x3816('0x8b')]=!![];_0x27e766[_0x3816('0x5d')]='COMPLETEDBYAGENT';logger[_0x3816('0x83')](_0x3816('0x95'),_0x27e766[_0x3816('0x73')],_0x27e766[_0x3816('0x62')]);}}}catch(_0x45a9a8){logger[_0x3816('0x4b')](_0x3816('0x96'),_0x13b5f8[_0x3816('0x58')],util['inspect'](_0x45a9a8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x3816('0x26')]=function(_0x4e341c){try{if(this[_0x3816('0x66')](_0x4e341c)){logger['debug']('[%s][voiceQueueReport][agentcomplete]',_0x4e341c[_0x3816('0x58')],util[_0x3816('0x4e')](_0x4e341c,{'showHidden':![],'depth':null}));if(this[_0x3816('0x11')][_0x4e341c['uniqueid']]){var _0x4ed5e0=_[_0x3816('0x8a')](this['queueReports'][_0x4e341c['uniqueid']]);_0x4ed5e0['queuecallerabandon']=![];_0x4ed5e0[_0x3816('0x8e')]=null;_0x4ed5e0[_0x3816('0x97')]=!![];_0x4ed5e0[_0x3816('0x90')]=_0x4e341c['membername'];_0x4ed5e0[_0x3816('0x98')]=_0x4e341c[_0x3816('0x98')];_0x4ed5e0[_0x3816('0x8b')]=!![];_0x4ed5e0[_0x3816('0x40')]=![];_0x4ed5e0['queuecallerexitAt']=null;if(!_0x4ed5e0[_0x3816('0x99')]){if(_0x4e341c[_0x3816('0x9a')]==_0x3816('0x99')){_0x4ed5e0[_0x3816('0x5d')]=_0x3816('0x9b');logger[_0x3816('0x83')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED',_0x4ed5e0[_0x3816('0x73')],_0x4ed5e0[_0x3816('0x62')]);}else{if(_[_0x3816('0x9c')](_0x4e341c['channel'][_0x3816('0x9d')](),_0x3816('0x9e'))){if(this[_0x3816('0x11')][_0x4e341c[_0x3816('0x9f')]]){var _0x479ddc=_[_0x3816('0x8a')](this['queueReports'][_0x4e341c[_0x3816('0x9f')]]);_0x479ddc[_0x3816('0x8b')]=![];_0x479ddc[_0x3816('0x40')]=!![];_0x479ddc[_0x3816('0xa0')]=moment(_0x4ed5e0['queuecallerjoinAt'])[_0x3816('0xa1')](_0x4e341c[_0x3816('0x98')],_0x3816('0xa2'))['format']('YYYY-MM-DD\x20HH:mm:ss');_0x479ddc[_0x3816('0x5d')]=_0x3816('0xa3');_0x479ddc['transfer']=!![];_0x479ddc[_0x3816('0xa4')]=_0x3816('0xa5');_0x479ddc[_0x3816('0xa6')]=_0x4e341c[_0x3816('0xa7')];_0x479ddc['transferuniqueid']=_0x4e341c[_0x3816('0x58')];logger[_0x3816('0x83')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x479ddc[_0x3816('0x73')],_0x479ddc[_0x3816('0x62')]);var _0x4c8bf4=this['queueReports'][_0x4e341c[_0x3816('0x9f')]];this[_0x3816('0x11')][_0x4e341c[_0x3816('0x9f')]]=this[_0x3816('0x11')][_0x4e341c['uniqueid']];this[_0x3816('0x11')][_0x4e341c['uniqueid']]=_0x4c8bf4;}}else{_0x4ed5e0[_0x3816('0x5d')]=_0x3816('0xa8')+_0x4e341c[_0x3816('0x9a')][_0x3816('0xa9')]();logger['info'](_0x3816('0xaa'),_0x4ed5e0[_0x3816('0x73')],_0x4ed5e0[_0x3816('0x62')],_0x4ed5e0[_0x3816('0x5d')]);}}}this[_0x3816('0x13')][_0x4e341c[_0x3816('0x58')]]=_0x4ed5e0;}}}catch(_0x3e2a98){logger[_0x3816('0x4b')]('[%s][voiceQueueReport][agentcomplete]',_0x4e341c['uniqueid'],util['inspect'](_0x3e2a98,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x2a')]=function(_0x249ce0){try{if(this[_0x3816('0x66')](_0x249ce0)){logger['debug'](_0x3816('0xab'),_0x249ce0[_0x3816('0x58')],util['inspect'](_0x249ce0,{'showHidden':![],'depth':null}));this[_0x3816('0xac')](_0x249ce0[_0x3816('0x58')],_[_0x3816('0x87')](_0x249ce0['variable'])[0x0],_0x249ce0[_0x3816('0xad')]);if(this[_0x3816('0x11')][_0x249ce0[_0x3816('0x58')]]){var _0x4da1f5=_[_0x3816('0x8a')](this[_0x3816('0x11')][_0x249ce0[_0x3816('0x58')]]);if(_0x4da1f5){if(this[_0x3816('0x66')](_0x249ce0[_0x3816('0xae')])&&this[_0x3816('0x66')](_0x249ce0['variable']['queuestatus'])){switch(_0x249ce0[_0x3816('0xad')]){case'CONTINUE':_0x4da1f5['queuecallerexit']=![];_0x4da1f5[_0x3816('0xa0')]=null;break;case _0x3816('0xaf'):_0x4da1f5[_0x3816('0xb0')]=_0x3816('0xb1');_0x4da1f5[_0x3816('0x40')]=!![];_0x4da1f5[_0x3816('0xa0')]=moment()[_0x3816('0x5f')](_0x3816('0x7f'));_0x4da1f5[_0x3816('0xb2')]=moment()['format'](_0x3816('0x7f'));logger[_0x3816('0x56')](_0x3816('0xb3'),_0x249ce0[_0x3816('0x58')],util['inspect'](_0x4da1f5,{'showHidden':![],'depth':null}));ami[_0x3816('0x54')](_0x3816('0xb4'),_0x4da1f5);break;default:_0x4da1f5[_0x3816('0x40')]=!![];_0x4da1f5['queuecallerexitAt']=moment()[_0x3816('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x4da1f5[_0x3816('0xb2')]=moment()['format'](_0x3816('0x7f'));}_0x4da1f5[_0x3816('0x41')]=![];_0x4da1f5['queuecallerabandonAt']=null;_0x4da1f5[_0x3816('0x5d')]=_0x249ce0[_0x3816('0xad')];this[_0x3816('0x13')][_0x249ce0[_0x3816('0x58')]]=_0x4da1f5;this[_0x3816('0x52')](_0x4da1f5,_0x3816('0x29'));}else if(this['isNotNull'](_0x249ce0['variable'])&&this['isNotNull'](_0x249ce0[_0x3816('0xae')]['queueposition'])){if(!_0x4da1f5[_0x3816('0x41')]){_0x4da1f5['queuecallerexit']=!![];_0x4da1f5[_0x3816('0xa0')]=moment()[_0x3816('0x5f')](_0x3816('0x7f'));_0x4da1f5[_0x3816('0x5d')]='EXITWITHKEY';_0x4da1f5['queuecallerleaveAt']=moment()[_0x3816('0x5f')](_0x3816('0x7f'));this[_0x3816('0x13')][_0x249ce0[_0x3816('0x58')]]=_0x4da1f5;}}logger[_0x3816('0x83')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x249ce0[_0x3816('0x58')],_0x4da1f5[_0x3816('0x73')],_0x4da1f5['type'],_[_0x3816('0x87')](_0x249ce0['variable'])[0x0],_0x249ce0[_0x3816('0xad')]);_0x4da1f5[_0x3816('0x17')]=this['variables'][_0x249ce0[_0x3816('0x58')]];}}}}catch(_0x58e868){logger[_0x3816('0x4b')](_0x3816('0xab'),_0x249ce0[_0x3816('0x58')],util[_0x3816('0x4e')](_0x58e868,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0xac')]=function(_0x2d956b,_0x1a4312,_0x4bf205){var _0x42945f=['rtpaudioqos',_0x3816('0xb5'),_0x3816('0xb6'),_0x3816('0xb7'),_0x3816('0xb8'),_0x3816('0xb9'),'rtpaudioqosrtt',_0x3816('0xba'),_0x3816('0xbb'),_0x3816('0xbc'),_0x3816('0xbd'),'bridgepvtcallid','membercalls',_0x3816('0xbe'),_0x3816('0xbf'),_0x3816('0xc0'),_0x3816('0xc1'),_0x3816('0xc2'),_0x3816('0xc3')];if(!_[_0x3816('0x44')](_0x1a4312)&&!_['includes'](_0x42945f,_0x1a4312)){if(_[_0x3816('0x67')](this['variables'][_0x2d956b])){this['variables'][_0x2d956b]={};}this[_0x3816('0x17')][_0x2d956b][_0x1a4312]=_0x4bf205;}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0xc4')]=function(_0x421dae,_0x345c78,_0x5feb4a){try{var _0x36971b={};if(this[_0x3816('0x11')][_0x421dae]){for(var _0x3a5a76=0x0;_0x3a5a76<this['queueReports'][_0x421dae][_0x3816('0xc5')];_0x3a5a76+=0x1){_0x36971b=this[_0x3816('0x11')][_0x421dae][_0x3a5a76];var _0x282029=this['voiceQueues'][_0x36971b[_0x3816('0x73')]];if(_0x282029){_0x282029[_0x3816('0xc6')]+=moment(_0x36971b[_0x3816('0xb2')])[_0x3816('0xc7')](_0x36971b[_0x3816('0xc8')],_0x3816('0xa2'))||0x0;if(_0x5feb4a&&_0x36971b[_0x3816('0x5d')]===_0x3816('0x5e')){_0x36971b[_0x3816('0x5d')]=_0x3816('0xc9');}if(_0x3a5a76===this[_0x3816('0x11')][_0x421dae]['length']-0x1){_0x282029[_0x3816('0xca')]+=moment()[_0x3816('0xcb')](0x0)[_0x3816('0xc7')](_0x36971b[_0x3816('0xc8')],_0x3816('0xa2'));if(hasCallerLeftTheQueue(_0x36971b)&&_0x36971b['queuecallerexitreason']!==_0x3816('0x5e')){_0x282029[_0x3816('0xcc')]+=0x1;}if(_0x36971b[_0x3816('0x8b')]){_0x282029[_0x3816('0xcd')]+=0x1;_0x282029[_0x3816('0xce')]+=moment()['milliseconds'](0x0)[_0x3816('0xc7')](_0x36971b['queuecallerleaveAt'],_0x3816('0xa2'));_0x36971b[_0x3816('0x8c')]=moment()[_0x3816('0x5f')](_0x3816('0x7f'));_0x36971b['queuecallerexit']=![];_0x36971b[_0x3816('0xa0')]=null;}if(_0x36971b[_0x3816('0x40')]&&_0x36971b[_0x3816('0x99')]!=!![]){_0x282029['unmanaged']+=0x1;_0x36971b[_0x3816('0xb0')]=_0x3816('0xcf');logger['debug']('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:',_0x421dae,util[_0x3816('0x4e')](_0x36971b,{'showHidden':![],'depth':null}));ami[_0x3816('0x54')](_0x3816('0xd0'),_0x36971b);}if(_0x36971b[_0x3816('0x41')]){_0x282029[_0x3816('0xd1')]+=0x1;_0x36971b['lastevent']=_0x3816('0xd1');logger['debug'](_0x3816('0xd2'),_0x421dae,util[_0x3816('0x4e')](_0x36971b,{'showHidden':![],'depth':null}));ami[_0x3816('0x54')](_0x3816('0xd3'),_0x36971b);}}else{_0x282029['sumDuration']+=_0x282029[_0x3816('0xc6')];}logger['info'](_0x3816('0xd4'),_0x421dae,_0x36971b['queue'],_0x36971b[_0x3816('0x62')],_0x345c78);this[_0x3816('0x13')][_0x421dae]=_0x36971b;Object['assign'](this[_0x3816('0x15')][_0x36971b[_0x3816('0x73')]],_0x282029);if(_0x36971b[_0x3816('0xb2')]){this[_0x3816('0x52')](_0x36971b,_0x3816('0x2b'));}}}logger[_0x3816('0x56')](_0x3816('0xd5'),_0x421dae,util[_0x3816('0x4e')](this[_0x3816('0x11')][_0x421dae],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0x36971b)&&_0x36971b[_0x3816('0x5d')]!==_0x3816('0x5e')){ami[_0x3816('0x54')](_0x3816('0xd6'),this[_0x3816('0x11')][_0x421dae]);if(this[_0x3816('0x11')][_0x421dae]){delete this['queueReports'][_0x421dae];}if(this[_0x3816('0x13')][_0x421dae]){delete this[_0x3816('0x13')][_0x421dae];}if(this['variables'][_0x421dae]){delete this[_0x3816('0x17')][_0x421dae];}}}}catch(_0x25a036){logger[_0x3816('0x4b')](_0x3816('0xd7'),_0x421dae,util[_0x3816('0x4e')](_0x25a036,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncHangup']=function(_0xdd5d64){try{if(this[_0x3816('0x66')](_0xdd5d64)){logger[_0x3816('0x56')](_0x3816('0xd8'),_0xdd5d64['uniqueid'],util[_0x3816('0x4e')](_0xdd5d64,{'showHidden':![],'depth':null}));if(this[_0x3816('0x11')][_0xdd5d64[_0x3816('0x58')]]){return this[_0x3816('0xc4')](_0xdd5d64[_0x3816('0x58')],_0xdd5d64['cause-txt'],![]);}if(this[_0x3816('0x11')][_0xdd5d64[_0x3816('0x9f')]]){if(_0xdd5d64['cause']==='21'){return;}return this[_0x3816('0xc4')](_0xdd5d64[_0x3816('0x9f')],_0xdd5d64['cause-txt'],!![]);}var _0x48556e=Object[_0x3816('0x87')](this[_0x3816('0x11')]);for(var _0x1524a7=0x0;_0x1524a7<_0x48556e[_0x3816('0xc5')];_0x1524a7++){var _0x27af0f=_['last'](this[_0x3816('0x11')][_0x48556e[_0x1524a7]]);if(_0x27af0f&&_0x27af0f[_0x3816('0xd9')]===_0xdd5d64[_0x3816('0x58')]){return this['handleHangup'](_0x27af0f[_0x3816('0x58')],_0xdd5d64[_0x3816('0xda')],!![]);}}if(!this[_0x3816('0x11')][_0xdd5d64[_0x3816('0x58')]]){logger[_0x3816('0x56')]('[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed',_0xdd5d64[_0x3816('0x58')]);if(this[_0x3816('0x13')][_0xdd5d64[_0x3816('0x58')]]){delete this[_0x3816('0x13')][_0xdd5d64['uniqueid']];}if(this[_0x3816('0x17')][_0xdd5d64['uniqueid']]){delete this[_0x3816('0x17')][_0xdd5d64[_0x3816('0x58')]];}}}}catch(_0x3321de){logger['error'](_0x3816('0xd8'),_0xdd5d64['uniqueid'],util['inspect'](_0x3321de,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x34')]=function(_0x349879){try{if(this['isNotNull'](_0x349879)){logger[_0x3816('0x56')](_0x3816('0xdb'),_0x349879['uniqueid'],util['inspect'](_0x349879,{'showHidden':![],'depth':null}));var _0x4dbb39;var _0xe16eae;var _0x4f5fc5;if(this[_0x3816('0x11')][_0x349879[_0x3816('0xdc')]]){_0x4dbb39=_[_0x3816('0x8a')](this[_0x3816('0x11')][_0x349879[_0x3816('0xdc')]]);_0x4dbb39[_0x3816('0xa6')]=_0x349879['secondtransfererexten'];_0x4dbb39[_0x3816('0xdd')]=_0x349879['secondtransfereruniqueid'];_0x4dbb39[_0x3816('0x5d')]=_0x3816('0x5e');_0x4dbb39[_0x3816('0x99')]=!![];_0x4dbb39[_0x3816('0xa4')]='ATTENDED';if(this[_0x3816('0x11')][_0x349879[_0x3816('0xde')]]){_0x4f5fc5=this[_0x3816('0x11')][_0x349879[_0x3816('0xde')]];this[_0x3816('0x11')][_0x349879[_0x3816('0xde')]]=this[_0x3816('0x11')][_0x349879['transfereeuniqueid']];this[_0x3816('0x11')][_0x349879[_0x3816('0xdc')]]=_0x4f5fc5;_0xe16eae=_[_0x3816('0x8a')](this[_0x3816('0x11')][_0x349879['transfereeuniqueid']]);_0xe16eae[_0x3816('0x43')]=!![];}logger[_0x3816('0x83')](_0x3816('0xdf'),_0x349879[_0x3816('0x58')],_0x4dbb39['queue'],_0x4dbb39[_0x3816('0x62')],_0x4dbb39['transferexten'],_0x4dbb39[_0x3816('0xdd')]);}else if(this['queueReports'][_0x349879[_0x3816('0xe0')]]){_0x4dbb39=_[_0x3816('0x8a')](this[_0x3816('0x11')][_0x349879[_0x3816('0xe0')]]);_0x4dbb39[_0x3816('0xa6')]=_0x349879[_0x3816('0xe1')];_0x4dbb39[_0x3816('0xdd')]=_0x349879[_0x3816('0xe2')];_0x4dbb39['queuecallerexitreason']=_0x3816('0x5e');_0x4dbb39[_0x3816('0x99')]=!![];_0x4dbb39[_0x3816('0xa4')]='ATTENDED';if(this[_0x3816('0x11')][_0x349879[_0x3816('0xe2')]]){_0x4f5fc5=this[_0x3816('0x11')][_0x349879[_0x3816('0xe2')]];this[_0x3816('0x11')][_0x349879[_0x3816('0xe2')]]=this[_0x3816('0x11')][_0x349879[_0x3816('0xe0')]];this[_0x3816('0x11')][_0x349879[_0x3816('0xe0')]]=_0x4f5fc5;_0xe16eae=_[_0x3816('0x8a')](this[_0x3816('0x11')][_0x349879['transfertargetuniqueid']]);_0xe16eae[_0x3816('0x43')]=!![];}logger[_0x3816('0x83')](_0x3816('0xdf'),_0x349879[_0x3816('0x58')],_0x4dbb39[_0x3816('0x73')],_0x4dbb39['type'],_0x4dbb39[_0x3816('0xa6')],_0x4dbb39[_0x3816('0xdd')]);}else if(this['queueReports'][_0x349879[_0x3816('0xe2')]]){_0x4dbb39=_['last'](this[_0x3816('0x11')][_0x349879[_0x3816('0xe2')]]);_0x4dbb39[_0x3816('0xa6')]=_0x349879[_0x3816('0xe1')];_0x4dbb39['transferuniqueid']=_0x349879[_0x3816('0xe2')];_0x4dbb39[_0x3816('0x5d')]=_0x3816('0x5e');_0x4dbb39[_0x3816('0x99')]=!![];_0x4dbb39['transfertype']='ATTENDED';_0x4dbb39[_0x3816('0x43')]=!![];_0x4dbb39['transferid']=_0x349879[_0x3816('0xdc')];}else if(this['queueReports'][_0x349879[_0x3816('0xde')]]){_0x4dbb39=_['last'](this[_0x3816('0x11')][_0x349879[_0x3816('0xde')]]);_0x4dbb39[_0x3816('0xa6')]=_0x349879[_0x3816('0xe3')];_0x4dbb39[_0x3816('0xdd')]=_0x349879[_0x3816('0xde')];_0x4dbb39[_0x3816('0x5d')]=_0x3816('0x5e');_0x4dbb39[_0x3816('0x99')]=!![];_0x4dbb39[_0x3816('0xa4')]=_0x3816('0xe4');_0x4dbb39[_0x3816('0x43')]=!![];_0x4dbb39['transferid']=_0x349879[_0x3816('0xe0')];}}}catch(_0x1fb5c7){logger[_0x3816('0x4b')](_0x3816('0xdb'),_0x349879['uniqueid'],util[_0x3816('0x4e')](_0x1fb5c7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x36')]=function(_0x2e6c09){try{if(this['isNotNull'](_0x2e6c09)){logger['debug'](_0x3816('0xe5'),_0x2e6c09[_0x3816('0x58')],util[_0x3816('0x4e')](_0x2e6c09,{'showHidden':![],'depth':null}));if(this[_0x3816('0x11')][_0x2e6c09[_0x3816('0xdc')]]){var _0x19b254=_['last'](this[_0x3816('0x11')][_0x2e6c09[_0x3816('0xdc')]]);_0x19b254['queuecallerexitreason']='BLINDTRANSFER';_0x19b254['transfer']=!![];_0x19b254[_0x3816('0xa4')]='BLIND';_0x19b254[_0x3816('0xa6')]=_0x2e6c09['extension'];_0x19b254[_0x3816('0xdd')]=_0x2e6c09[_0x3816('0xdc')];logger['info']('[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x2e6c09[_0x3816('0x58')],_0x19b254[_0x3816('0x73')],_0x19b254[_0x3816('0x62')],_0x19b254[_0x3816('0xa6')],_0x19b254[_0x3816('0xdd')]);this[_0x3816('0x2c')]({'event':_0x3816('0xe6'),'uniqueid':_0x2e6c09[_0x3816('0xdc')],'context':_0x2e6c09[_0x3816('0xe7')],'channel':_0x2e6c09['transfererchannel']});}}}catch(_0x49ac17){logger[_0x3816('0x4b')](_0x3816('0xe5'),_0x2e6c09[_0x3816('0x58')],util[_0x3816('0x4e')](_0x49ac17,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0x30')]=function(_0x200730){try{if(this[_0x3816('0x66')](_0x200730)){logger[_0x3816('0x56')]('[%s][voiceQueueReport][musiconholdstart]',_0x200730['uniqueid'],util[_0x3816('0x4e')](_0x200730,{'showHidden':![],'depth':null}));if(this[_0x3816('0x11')][_0x200730[_0x3816('0x58')]]){var _0x2b2faf=_[_0x3816('0x8a')](this[_0x3816('0x11')][_0x200730['uniqueid']]);if(!_[_0x3816('0x44')](_0x2b2faf[_0x3816('0xb2')])){_0x2b2faf[_0x3816('0xe8')]=moment()[_0x3816('0x5f')](_0x3816('0x7f'));logger[_0x3816('0x83')](_0x3816('0xe9'),_0x200730['uniqueid'],_0x2b2faf[_0x3816('0xe8')]);}}}}catch(_0x5a29a1){logger['error'](_0x3816('0xea'),_0x200730['uniqueid'],util[_0x3816('0x4e')](_0x5a29a1,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3816('0xc')]['syncMusicOnHoldStop']=function(_0x32c23d){try{if(this[_0x3816('0x66')](_0x32c23d)){logger[_0x3816('0x56')](_0x3816('0xeb'),_0x32c23d[_0x3816('0x58')],util[_0x3816('0x4e')](_0x32c23d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x32c23d[_0x3816('0x58')]]){var _0x53a297=_['last'](this['queueReports'][_0x32c23d[_0x3816('0x58')]]);if(!_[_0x3816('0x44')](_0x53a297[_0x3816('0xe8')])){_0x53a297[_0x3816('0xec')]+=moment()[_0x3816('0xcb')](0x0)[_0x3816('0xc7')](_0x53a297[_0x3816('0xe8')],'seconds');logger[_0x3816('0x83')](_0x3816('0xed'),_0x32c23d['uniqueid'],_0x53a297['mohtime']);delete _0x53a297[_0x3816('0xe8')];}}}}catch(_0x20dad2){logger[_0x3816('0x4b')]('[%s][voiceQueueReport][musiconholdstop]',_0x32c23d[_0x3816('0x58')],util[_0x3816('0x4e')](_0x20dad2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3816('0xc')][_0x3816('0xee')]=function(_0x12d6f6){try{if(this[_0x3816('0x66')](_0x12d6f6)){logger['debug'](_0x3816('0xef'),_0x12d6f6[_0x3816('0x58')],util[_0x3816('0x4e')](_0x12d6f6,{'showHidden':![],'depth':null}));if(_0x12d6f6['application'][_0x3816('0x9d')]()==='set'){_0x12d6f6[_0x3816('0xf0')]=_0x12d6f6[_0x3816('0xf1')]&&_0x12d6f6[_0x3816('0xf1')][_0x3816('0x9c')](_0x3816('0xf2'))?_0x12d6f6[_0x3816('0xf1')]:(_0x12d6f6[_0x3816('0xf1')]||_0x12d6f6['applicationdata'])['toLowerCase']();if(_['startsWith'](_0x12d6f6[_0x3816('0xf0')][_0x3816('0x9d')](),_0x3816('0xf3'))){logger[_0x3816('0x83')](_0x3816('0xf4'),_0x12d6f6['uniqueid'],_0x12d6f6[_0x3816('0xf5')],_0x12d6f6[_0x3816('0xf0')]);if(_[_0x3816('0x67')](this[_0x3816('0x13')][_0x12d6f6[_0x3816('0x58')]]))this['channels'][_0x12d6f6[_0x3816('0x58')]]={};var _0x467a7a=_0x12d6f6[_0x3816('0xf0')][_0x3816('0xf6')]('=');var _0x45e5d8=_0x467a7a[0x0]['toLowerCase']()[_0x3816('0xf7')](/cdr\((.*)\)/);if(_0x45e5d8)this[_0x3816('0x13')][_0x12d6f6[_0x3816('0x58')]][_0x45e5d8[0x1]]=_0x467a7a[0x1];}}}}catch(_0x2c7b46){logger[_0x3816('0x4b')]('[%s][voiceQueueReport][newexten]',_0x12d6f6[_0x3816('0x58')],util[_0x3816('0x4e')](_0x2c7b46,{'showHidden':![],'depth':null}));}};module['exports']=VoiceQueueReport;