Built motion from commit da24aabd.|2.6.20
[motion2.git] / server / services / ami / report / voiceQueueReport.js
index a05ec3a..ff15702 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2f38=['Action','status','catch','message','No\x20such\x20channel','error','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','clearqueuereport','emit','emitVoiceQueueChannelSave','debug','uniqueid','voice:queue:%s','name','voice_queue_channel:save','voice_queue_presence:save','emitVoiceQueueChannelRemove','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:remove\x20event:','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','Trunk','Interval','stringify','[voiceQueueReport][','format','voice_queue:save','isUndefined','queues','[voiceQueueReport][queues]','then','isNotNull','[voiceQueueReport][queuesummary]\x20event:','queue','[voiceQueueReport][queuesummary]\x20name:%s','toNumber','callers','loggedin','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','pick','keys','push','[%s][voiceQueueReport][queuecallerabandon]','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerabandon','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','last','queuecallerleaveAt','connectedlinenum','connectedlinename','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','assigned','membername','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','channel','toLowerCase','local/','add','seconds','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','linkedid','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','addVariable','variable','value','queuestatus','CONTINUE','queuecallerexit','TIMEOUT','lastevent','custom:timeout','queueposition','EXITWITHKEY','variables','[%s][voiceQueueReport][varset]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberpenalty','memberrealtime','includes','syncHangup','[%s][voiceQueueReport][hangup]','length','diff','milliseconds','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','hangup','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertype','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','extension','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','context','transfererchannel','[%s][voiceQueueReport][blindtransfer]','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstop]','mohtime','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','[%s][voiceQueueReport][newexten]\x20event:','applicationdata','appdata','cdr(','application','split','exports','moment','md5','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','queuesummarycomplete','syncQueueSummaryComplete','bind','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','agentconnect','syncAgentConnect','varset','syncVarSet','fullybooted','newexten','syncNewExten','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','hasOwnProperty','isEmpty','originated','talking','pTalking','waiting','queueStatusComplete','unlockRR','clearZombieChannels','isNil'];(function(_0xbbc5a8,_0x503c3a){var _0x2957d6=function(_0x3de5ce){while(--_0x3de5ce){_0xbbc5a8['push'](_0xbbc5a8['shift']());}};_0x2957d6(++_0x503c3a);}(_0x2f38,0x1a7));var _0x82f3=function(_0x413d95,_0x532d51){_0x413d95=_0x413d95-0x0;var _0x3246fb=_0x2f38[_0x413d95];return _0x3246fb;};'use strict';var _=require('lodash');var moment=require(_0x82f3('0x0'));var util=require('util');var md5=require(_0x82f3('0x1'));var Redis=require(_0x82f3('0x2'));var config=require(_0x82f3('0x3'));var logger=require(_0x82f3('0x4'))(_0x82f3('0x5'));var ami=require(_0x82f3('0x6'));var QueueReport=require('../model/queueReport');config[_0x82f3('0x7')]=_['defaults'](config['redis'],{'host':_0x82f3('0x8'),'port':0x18eb});var io=require(_0x82f3('0x9'))(new Redis(config[_0x82f3('0x7')]));var Sequence=function(){};Sequence[_0x82f3('0xa')][_0x82f3('0xb')]=function(_0x427ef6){this[_0x82f3('0xc')]=this[_0x82f3('0xc')]?this[_0x82f3('0xc')][_0x82f3('0xd')](_0x427ef6):_0x427ef6();};function VoiceQueueReport(_0x2d92aa){this[_0x82f3('0xe')]=new Sequence();this[_0x82f3('0xf')]={};this['agents']=_0x2d92aa[_0x82f3('0x10')];this[_0x82f3('0x11')]=_0x2d92aa[_0x82f3('0x12')];this[_0x82f3('0x13')]=_0x2d92aa[_0x82f3('0x13')];this[_0x82f3('0x14')]=!![];this[_0x82f3('0x15')]=_0x2d92aa['campaigns'];this['variables']={};ami['on'](_0x82f3('0x16'),this[_0x82f3('0x17')]['bind'](this));ami['on'](_0x82f3('0x18'),this[_0x82f3('0x19')][_0x82f3('0x1a')](this));ami['on'](_0x82f3('0x1b'),this[_0x82f3('0x1c')][_0x82f3('0x1a')](this));ami['on']('queuecallerabandon',this[_0x82f3('0x1d')][_0x82f3('0x1a')](this));ami['on'](_0x82f3('0x1e'),this[_0x82f3('0x1f')][_0x82f3('0x1a')](this));ami['on'](_0x82f3('0x20'),this['syncAgentComplete']['bind'](this));ami['on'](_0x82f3('0x21'),this[_0x82f3('0x22')][_0x82f3('0x1a')](this));ami['on'](_0x82f3('0x23'),this[_0x82f3('0x24')][_0x82f3('0x1a')](this));ami['on']('hangup',this['syncHangup'][_0x82f3('0x1a')](this));ami['on'](_0x82f3('0x25'),this['syncFullyBooted']['bind'](this));ami['on'](_0x82f3('0x26'),this[_0x82f3('0x27')][_0x82f3('0x1a')](this));ami['on'](_0x82f3('0x28'),this[_0x82f3('0x29')][_0x82f3('0x1a')](this));ami['on'](_0x82f3('0x2a'),this[_0x82f3('0x2b')]['bind'](this));ami['on'](_0x82f3('0x2c'),this[_0x82f3('0x2d')]['bind'](this));ami['on']('blindtransfer',this[_0x82f3('0x2e')]['bind'](this));this[_0x82f3('0x2f')]();this[_0x82f3('0x30')]();}function clearChannels(_0x26aa47){if(!_['isEmpty'](_0x26aa47)){for(var _0x402bff in _0x26aa47){if(_0x26aa47[_0x82f3('0x31')](_0x402bff)){delete _0x26aa47[_0x402bff];}}}}function clearCampaigns(_0xe66683){if(!_[_0x82f3('0x32')](_0xe66683)){for(var _0x3021d7 in _0xe66683){if(_0xe66683['hasOwnProperty'](_0x3021d7)){_0xe66683[_0x3021d7][_0x82f3('0x33')]=0x0;}}}}function clearVoiceQueues(_0x3c8980){if(!_[_0x82f3('0x32')](_0x3c8980)){for(var _0x4fe4ca in _0x3c8980){if(_0x3c8980[_0x82f3('0x31')](_0x4fe4ca)){_0x3c8980[_0x4fe4ca][_0x82f3('0x33')]=0x0;_0x3c8980[_0x4fe4ca][_0x82f3('0x34')]=0x0;_0x3c8980[_0x4fe4ca][_0x82f3('0x35')]=0x0;_0x3c8980[_0x4fe4ca][_0x82f3('0x36')]=0x0;_0x3c8980[_0x4fe4ca][_0x82f3('0x37')]=!![];}}}}function clearAgentBooked(_0x35d7c3){if(!_[_0x82f3('0x32')](_0x35d7c3)){for(var _0x1aa0e4 in _0x35d7c3){if(_0x35d7c3[_0x82f3('0x31')](_0x1aa0e4)){_0x35d7c3[_0x1aa0e4][_0x82f3('0x38')]=!![];}}}}VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x39')]=function(){var _0x1b0f43=this;for(var _0x398b36 in this[_0x82f3('0x11')]){if(this[_0x82f3('0x11')][_0x82f3('0x31')](_0x398b36)&&!this[_0x82f3('0x11')][_0x398b36]['switch']){this[_0x82f3('0xe')]['enqueue'](function(){if(!_[_0x82f3('0x3a')](_0x1b0f43[_0x82f3('0x11')][_0x398b36])){return ami[_0x82f3('0x3b')]({'action':_0x82f3('0x3c'),'channel':_0x1b0f43[_0x82f3('0x11')][_0x398b36]['channel']})[_0x82f3('0x3d')](function(_0x3e082a){if(_0x3e082a[_0x82f3('0x3e')]===_0x82f3('0x3f')){setTimeout(function(){if(_0x1b0f43[_0x82f3('0x11')][_0x398b36]){delete _0x1b0f43['channels'][_0x398b36];logger[_0x82f3('0x40')]('[%s][voiceQueueReport][checkChannel]',_0x398b36,util[_0x82f3('0x41')](_0x3e082a,{'showHidden':![],'depth':null}));}if(_0x1b0f43['queueReports'][_0x398b36]){delete _0x1b0f43[_0x82f3('0xf')][_0x398b36];logger[_0x82f3('0x40')](_0x82f3('0x42'),_0x398b36,util['inspect'](_0x3e082a,{'showHidden':![],'depth':null}));}if(_0x1b0f43['variables'][_0x398b36]){delete _0x1b0f43['variables'][_0x398b36];logger[_0x82f3('0x40')](_0x82f3('0x43'),_0x398b36,util[_0x82f3('0x41')](_0x3e082a,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x44')]=function(){logger[_0x82f3('0x40')](_0x82f3('0x45'));clearChannels(this[_0x82f3('0x11')]);this['clearQueueReport'](this[_0x82f3('0xf')]);clearAgentBooked(this[_0x82f3('0x10')]);clearVoiceQueues(this[_0x82f3('0x13')]);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x46')]=function(_0x2309f3){var _0x21afd2=this;if(!_['isEmpty'](_0x2309f3)){for(var _0x187653 in _0x2309f3){if(_0x2309f3[_0x82f3('0x31')](_0x187653)){_0x21afd2['emitVoiceQueueChannelRemove'](_0x2309f3[_0x187653],_0x82f3('0x47'));delete _0x2309f3[_0x187653];}}}};VoiceQueueReport['prototype'][_0x82f3('0x48')]=function(_0x31c373,_0x4491a5,_0x122dc2){io['to'](_0x31c373)[_0x82f3('0x48')](_0x4491a5,_0x122dc2);};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x49')]=function(_0x3e6cb5,_0x5f5cfe){logger[_0x82f3('0x4a')]('[%s][voiceQueueReport]['+_0x5f5cfe+']\x20sending\x20voice_queue_channel:save\x20event:',_0x3e6cb5[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x3e6cb5,{'showHidden':![],'depth':null}));this[_0x82f3('0x48')](util['format'](_0x82f3('0x4c'),_0x3e6cb5[_0x82f3('0x4d')]),_0x82f3('0x4e'),_0x3e6cb5);io[_0x82f3('0x48')](_0x82f3('0x4f'),_0x3e6cb5);};VoiceQueueReport['prototype'][_0x82f3('0x50')]=function(_0x3ecd87,_0x23e765){logger[_0x82f3('0x4a')](_0x82f3('0x51')+_0x23e765+_0x82f3('0x52'),_0x3ecd87[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x3ecd87,{'showHidden':![],'depth':null}));this[_0x82f3('0x48')](util['format'](_0x82f3('0x4c'),_0x3ecd87[_0x82f3('0x4d')]),_0x82f3('0x53'),_0x3ecd87);io['emit'](_0x82f3('0x54'),_0x3ecd87);};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x55')]=function(_0x26e280,_0x4c9a79){if(_0x26e280[_0x82f3('0x56')]===_0x82f3('0x57')){var _0x496bf3={'id':_0x26e280['id'],'name':_0x26e280[_0x82f3('0x4d')],'strategy':_0x26e280['strategy'],'answered':_0x26e280[_0x82f3('0x58')],'available':_0x26e280[_0x82f3('0x59')],'loggedIn':_0x26e280[_0x82f3('0x5a')],'pTalking':_0x26e280[_0x82f3('0x35')],'sumBillable':_0x26e280[_0x82f3('0x5b')],'sumDuration':_0x26e280[_0x82f3('0x5c')],'sumHoldTime':_0x26e280[_0x82f3('0x5d')]||0x0,'talking':_0x26e280[_0x82f3('0x34')],'total':_0x26e280[_0x82f3('0x5e')],'type':_0x26e280[_0x82f3('0x56')],'unmanaged':_0x26e280[_0x82f3('0x5f')],'abandoned':_0x26e280[_0x82f3('0x60')],'waiting':_0x26e280[_0x82f3('0x36')]};if(_0x26e280[_0x82f3('0x61')]){_0x496bf3[_0x82f3('0x61')]={'id':_0x26e280[_0x82f3('0x61')]['id'],'name':_0x26e280['Trunk']['name'],'active':_0x26e280['Trunk']['active'],'callerid':_0x26e280['Trunk']['callerid']};}if(_0x26e280['Interval']){_0x496bf3[_0x82f3('0x62')]={'id':_0x26e280[_0x82f3('0x62')]['id'],'name':_0x26e280[_0x82f3('0x62')]['name']};}var _0x3d904b=md5(JSON[_0x82f3('0x63')](_0x496bf3));if(_0x26e280[_0x82f3('0x1')]!==_0x3d904b){_0x26e280[_0x82f3('0x1')]=_0x3d904b;logger[_0x82f3('0x4a')](_0x82f3('0x64')+_0x4c9a79+']\x20sending\x20voice_queue:save\x20event:',util[_0x82f3('0x41')](_0x496bf3,{'showHidden':![],'depth':null}));this[_0x82f3('0x48')](util[_0x82f3('0x65')]('voice:queue:%s',_0x496bf3[_0x82f3('0x4d')]),_0x82f3('0x66'),_0x496bf3);}}};VoiceQueueReport[_0x82f3('0xa')]['isNotNull']=function(_0x29e25d){return _0x29e25d!==null&&!_[_0x82f3('0x67')](_0x29e25d);};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x30')]=function(){var _0x16b5c8=this;setInterval(function(){_0x16b5c8['clearZombieChannels']();ami[_0x82f3('0x3b')]({'action':_0x82f3('0x68')})[_0x82f3('0x3d')](function(_0xf2231b){logger[_0x82f3('0x40')](_0x82f3('0x69'),util[_0x82f3('0x41')](_0xf2231b,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x2f')]=function(){var _0x5df2e1=this;setInterval(function(){if(_0x5df2e1[_0x82f3('0x14')]){return ami[_0x82f3('0x3b')]({'action':_0x82f3('0x16')})[_0x82f3('0x6a')](function(_0x51212c){_0x5df2e1['flagQueueSummary']=![];})[_0x82f3('0x3d')](function(_0x6e5f44){logger[_0x82f3('0x40')]('[voiceQueueReport][queuesummary]',util[_0x82f3('0x41')](_0x6e5f44,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x17')]=function(_0x55085d){try{if(this[_0x82f3('0x6b')](_0x55085d)&&this[_0x82f3('0x6b')](_0x55085d['queue'])){logger[_0x82f3('0x4a')](_0x82f3('0x6c'),util[_0x82f3('0x41')](_0x55085d,{'showHidden':![],'depth':null}));if(this[_0x82f3('0x13')][_0x55085d[_0x82f3('0x6d')]]){logger['info'](_0x82f3('0x6e'),_0x55085d[_0x82f3('0x6d')]);var _0x3a48c2=_['countBy'](this[_0x82f3('0x11')],'queue')[_0x55085d[_0x82f3('0x6d')]]||0x0;var _0x7e8e23=_0x3a48c2-_0x55085d['callers'];if(this['voiceQueues'][_0x55085d[_0x82f3('0x6d')]][_0x82f3('0x36')]!==_[_0x82f3('0x6f')](_0x55085d[_0x82f3('0x70')])||this[_0x82f3('0x13')][_0x55085d[_0x82f3('0x6d')]][_0x82f3('0x5a')]!==_[_0x82f3('0x6f')](_0x55085d[_0x82f3('0x71')])||this[_0x82f3('0x13')][_0x55085d[_0x82f3('0x6d')]]['available']!==_[_0x82f3('0x6f')](_0x55085d[_0x82f3('0x59')])||this[_0x82f3('0x13')][_0x55085d['queue']]['talking']!==_0x7e8e23){this[_0x82f3('0x13')][_0x55085d[_0x82f3('0x6d')]][_0x82f3('0x36')]=_[_0x82f3('0x6f')](_0x55085d['callers']);this[_0x82f3('0x13')][_0x55085d[_0x82f3('0x6d')]]['loggedIn']=_[_0x82f3('0x6f')](_0x55085d['loggedin']);this['voiceQueues'][_0x55085d[_0x82f3('0x6d')]][_0x82f3('0x59')]=_['toNumber'](_0x55085d['available']);this['voiceQueues'][_0x55085d[_0x82f3('0x6d')]][_0x82f3('0x34')]=_0x7e8e23>0x0?_0x7e8e23:0x0;this[_0x82f3('0x13')][_0x55085d[_0x82f3('0x6d')]]['talking']=this[_0x82f3('0x13')][_0x55085d[_0x82f3('0x6d')]][_0x82f3('0x34')]>_['toNumber'](_0x55085d[_0x82f3('0x71')])?_[_0x82f3('0x6f')](_0x55085d[_0x82f3('0x71')]):this[_0x82f3('0x13')][_0x55085d[_0x82f3('0x6d')]][_0x82f3('0x34')];this[_0x82f3('0x55')](this[_0x82f3('0x13')][_0x55085d['queue']],_0x82f3('0x16'));}logger[_0x82f3('0x4a')](_0x82f3('0x72'),util[_0x82f3('0x41')](this[_0x82f3('0x13')][_0x55085d[_0x82f3('0x6d')]],{'showHidden':![],'depth':null}));ami[_0x82f3('0x48')]('custom:queuesummary',this[_0x82f3('0x13')][_0x55085d[_0x82f3('0x6d')]]);}}}catch(_0x215e5c){logger['error'](_0x82f3('0x73'),util[_0x82f3('0x41')](_0x215e5c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x19')]=function(_0x24dc27){logger[_0x82f3('0x4a')](_0x82f3('0x74'),util[_0x82f3('0x41')](_0x24dc27,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x1c')]=function(_0x33bbfe){try{if(this['isNotNull'](_0x33bbfe)){logger[_0x82f3('0x4a')](_0x82f3('0x75'),_0x33bbfe[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x33bbfe,{'showHidden':![],'depth':null}));if(_[_0x82f3('0x67')](this[_0x82f3('0xf')][_0x33bbfe[_0x82f3('0x4b')]]))this[_0x82f3('0xf')][_0x33bbfe[_0x82f3('0x4b')]]=[];if(_[_0x82f3('0x67')](this[_0x82f3('0x11')][_0x33bbfe[_0x82f3('0x4b')]]))this[_0x82f3('0x11')][_0x33bbfe[_0x82f3('0x4b')]]={};var _0x5e384f=new QueueReport();_0x5e384f['name']=_0x33bbfe[_0x82f3('0x6d')];_0x5e384f['type']=this[_0x82f3('0x13')][_0x5e384f[_0x82f3('0x4d')]]&&this[_0x82f3('0x13')][_0x5e384f['name']][_0x82f3('0x56')]?this[_0x82f3('0x13')][_0x5e384f[_0x82f3('0x4d')]][_0x82f3('0x56')]||_0x82f3('0x57'):_0x82f3('0x57');_0x5e384f[_0x82f3('0x6d')]=_0x33bbfe[_0x82f3('0x6d')];_0x5e384f[_0x82f3('0x76')]=moment()[_0x82f3('0x65')](_0x82f3('0x77'));_0x5e384f[_0x82f3('0x78')]=_0x33bbfe[_0x82f3('0x78')];_0x5e384f[_0x82f3('0x79')]=_0x33bbfe[_0x82f3('0x79')];_0x5e384f['uniqueid']=_0x33bbfe[_0x82f3('0x4b')];_0x5e384f[_0x82f3('0x7a')]=this[_0x82f3('0x11')][_0x33bbfe[_0x82f3('0x4b')]][_0x82f3('0x7a')];logger[_0x82f3('0x7b')](_0x82f3('0x7c'),_0x5e384f[_0x82f3('0x4d')],_0x5e384f[_0x82f3('0x56')]);_[_0x82f3('0x7d')](_0x5e384f,_[_0x82f3('0x7e')](_0x33bbfe,_[_0x82f3('0x7f')](_0x5e384f)));this[_0x82f3('0xf')][_0x33bbfe['uniqueid']][_0x82f3('0x80')](_0x5e384f);this['channels'][_0x33bbfe[_0x82f3('0x4b')]]=_0x5e384f;this[_0x82f3('0x49')](_0x5e384f,_0x82f3('0x1b'));}}catch(_0x5afd64){logger[_0x82f3('0x40')](_0x82f3('0x75'),_0x33bbfe['uniqueid'],util['inspect'](_0x5afd64,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x1d')]=function(_0x388378){try{if(this['isNotNull'](_0x388378)){logger[_0x82f3('0x4a')](_0x82f3('0x81'),_0x388378[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x388378,{'showHidden':![],'depth':null}));if(this[_0x82f3('0xf')][_0x388378['uniqueid']]){var _0x5822e1=_['last'](this[_0x82f3('0xf')][_0x388378[_0x82f3('0x4b')]]);_0x5822e1[_0x82f3('0x82')]=![];_0x5822e1[_0x82f3('0x83')]=null;_0x5822e1[_0x82f3('0x84')]=_0x388378['holdtime'];_0x5822e1[_0x82f3('0x85')]=_0x388378[_0x82f3('0x85')];_0x5822e1[_0x82f3('0x86')]=!![];_0x5822e1[_0x82f3('0x87')]=moment()['format'](_0x82f3('0x77'));_0x5822e1[_0x82f3('0x88')]=_0x82f3('0x89');_0x5822e1[_0x82f3('0x8a')]=null;logger[_0x82f3('0x7b')](_0x82f3('0x8b'),_0x5822e1['name'],_0x5822e1['type']);this[_0x82f3('0x11')][_0x388378['uniqueid']]=_0x5822e1;this['emitVoiceQueueChannelRemove'](_0x5822e1,_0x82f3('0x86'));}}}catch(_0x14f3b2){logger[_0x82f3('0x40')](_0x82f3('0x81'),_0x388378[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x14f3b2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x82f3('0xa')]['syncQueueCallerLeave']=function(_0x3de060){try{if(this[_0x82f3('0x6b')](_0x3de060)){logger[_0x82f3('0x4a')](_0x82f3('0x8c'),_0x3de060[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x3de060,{'showHidden':![],'depth':null}));if(this[_0x82f3('0xf')][_0x3de060[_0x82f3('0x4b')]]){var _0x4873b5=_[_0x82f3('0x8d')](this[_0x82f3('0xf')][_0x3de060[_0x82f3('0x4b')]]);_0x4873b5[_0x82f3('0x8e')]=moment()[_0x82f3('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x4873b5[_0x82f3('0x8f')]=_0x3de060[_0x82f3('0x8f')];_0x4873b5[_0x82f3('0x90')]=_0x3de060[_0x82f3('0x90')];logger[_0x82f3('0x7b')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x4873b5[_0x82f3('0x4d')],_0x4873b5['type'],_0x3de060['connectedlinenum'],_0x3de060['connectedlinename']);this[_0x82f3('0x11')][_0x3de060[_0x82f3('0x4b')]]=_0x4873b5;this[_0x82f3('0x49')](_0x4873b5,'queuecallerleave');}}}catch(_0x350f8d){logger[_0x82f3('0x40')]('[%s][voiceQueueReport][queuecallerleave]',_0x3de060['uniqueid'],util[_0x82f3('0x41')](_0x350f8d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x82f3('0x22')]=function(_0x30d582){try{if(this[_0x82f3('0x6b')](_0x30d582)){logger[_0x82f3('0x4a')](_0x82f3('0x91'),_0x30d582['uniqueid'],util[_0x82f3('0x41')](_0x30d582,{'showHidden':![],'depth':null}));if(this[_0x82f3('0xf')][_0x30d582[_0x82f3('0x4b')]]){var _0x56915c=_[_0x82f3('0x8d')](this[_0x82f3('0xf')][_0x30d582[_0x82f3('0x4b')]]);_0x56915c['queuecallercomplete']=!![];_0x56915c[_0x82f3('0x88')]=_0x82f3('0x92');logger['info'](_0x82f3('0x93'),_0x56915c[_0x82f3('0x4d')],_0x56915c['type']);}}}catch(_0x55473a){logger['error'](_0x82f3('0x91'),_0x30d582[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x55473a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x94')]=function(_0x301b0b){try{if(this[_0x82f3('0x6b')](_0x301b0b)){logger['debug'](_0x82f3('0x95'),_0x301b0b[_0x82f3('0x4b')],util['inspect'](_0x301b0b,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x301b0b[_0x82f3('0x4b')]]){var _0x2fd3bd=_['last'](this[_0x82f3('0xf')][_0x301b0b[_0x82f3('0x4b')]]);_0x2fd3bd[_0x82f3('0x86')]=![];_0x2fd3bd[_0x82f3('0x87')]=null;_0x2fd3bd[_0x82f3('0x96')]=!![];_0x2fd3bd[_0x82f3('0x8a')]=_0x301b0b[_0x82f3('0x97')];_0x2fd3bd[_0x82f3('0x84')]=_0x301b0b[_0x82f3('0x84')];_0x2fd3bd[_0x82f3('0x82')]=!![];_0x2fd3bd['queuecallerexit']=![];_0x2fd3bd[_0x82f3('0x98')]=null;if(!_0x2fd3bd[_0x82f3('0x99')]){if(_0x301b0b[_0x82f3('0x9a')]==_0x82f3('0x99')){_0x2fd3bd[_0x82f3('0x88')]=_0x82f3('0x9b');logger[_0x82f3('0x7b')](_0x82f3('0x9c'),_0x2fd3bd[_0x82f3('0x4d')],_0x2fd3bd[_0x82f3('0x56')]);}else{if(_[_0x82f3('0x9d')](_0x301b0b[_0x82f3('0x9e')][_0x82f3('0x9f')](),_0x82f3('0xa0'))){if(this[_0x82f3('0xf')][_0x301b0b['linkedid']]){var _0x31f865=_[_0x82f3('0x8d')](this[_0x82f3('0xf')][_0x301b0b['linkedid']]);_0x31f865['queuecallercomplete']=![];_0x31f865['queuecallerexit']=!![];_0x31f865[_0x82f3('0x98')]=moment(_0x2fd3bd[_0x82f3('0x76')])[_0x82f3('0xa1')](_0x301b0b[_0x82f3('0x84')],_0x82f3('0xa2'))[_0x82f3('0x65')](_0x82f3('0x77'));_0x31f865[_0x82f3('0x88')]='FORWARDTRANSFER';_0x31f865[_0x82f3('0x99')]=!![];_0x31f865['transfertype']='FORWARD';_0x31f865[_0x82f3('0xa3')]=_0x301b0b[_0x82f3('0xa4')];_0x31f865[_0x82f3('0xa5')]=_0x301b0b[_0x82f3('0x4b')];logger['info'](_0x82f3('0xa6'),_0x31f865[_0x82f3('0x4d')],_0x31f865[_0x82f3('0x56')]);var _0x4f591e=this[_0x82f3('0xf')][_0x301b0b[_0x82f3('0xa7')]];this['queueReports'][_0x301b0b[_0x82f3('0xa7')]]=this[_0x82f3('0xf')][_0x301b0b[_0x82f3('0x4b')]];this['queueReports'][_0x301b0b[_0x82f3('0x4b')]]=_0x4f591e;}}else{_0x2fd3bd[_0x82f3('0x88')]=_0x82f3('0xa8')+_0x301b0b[_0x82f3('0x9a')][_0x82f3('0xa9')]();logger[_0x82f3('0x7b')](_0x82f3('0xaa'),_0x2fd3bd[_0x82f3('0x4d')],_0x2fd3bd[_0x82f3('0x56')],_0x2fd3bd[_0x82f3('0x88')]);}}}this[_0x82f3('0x11')][_0x301b0b[_0x82f3('0x4b')]]=_0x2fd3bd;this[_0x82f3('0x50')](_0x2fd3bd,_0x82f3('0x20'));}}}catch(_0x7ba0dd){logger[_0x82f3('0x40')](_0x82f3('0x95'),_0x301b0b[_0x82f3('0x4b')],util['inspect'](_0x7ba0dd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x82f3('0xa')]['syncVarSet']=function(_0x319eef){try{if(this['isNotNull'](_0x319eef)){logger['debug']('[%s][voiceQueueReport][varset]',_0x319eef[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x319eef,{'showHidden':![],'depth':null}));this[_0x82f3('0xab')](_0x319eef[_0x82f3('0x4b')],_['keys'](_0x319eef[_0x82f3('0xac')])[0x0],_0x319eef[_0x82f3('0xad')]);if(this[_0x82f3('0xf')][_0x319eef[_0x82f3('0x4b')]]){var _0x35e302=_[_0x82f3('0x8d')](this[_0x82f3('0xf')][_0x319eef[_0x82f3('0x4b')]]);if(_0x35e302){if(this[_0x82f3('0x6b')](_0x319eef[_0x82f3('0xac')])&&this['isNotNull'](_0x319eef['variable'][_0x82f3('0xae')])){switch(_0x319eef[_0x82f3('0xad')]){case _0x82f3('0xaf'):_0x35e302[_0x82f3('0xb0')]=![];_0x35e302[_0x82f3('0x98')]=null;break;case _0x82f3('0xb1'):_0x35e302[_0x82f3('0xb2')]='timeout';_0x35e302['queuecallerexit']=!![];_0x35e302[_0x82f3('0x98')]=moment()['format'](_0x82f3('0x77'));_0x35e302[_0x82f3('0x8e')]=moment()[_0x82f3('0x65')]('YYYY-MM-DD\x20HH:mm:ss');logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x319eef[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x35e302,{'showHidden':![],'depth':null}));ami[_0x82f3('0x48')](_0x82f3('0xb3'),_0x35e302);break;default:_0x35e302['queuecallerexit']=!![];_0x35e302['queuecallerexitAt']=moment()[_0x82f3('0x65')](_0x82f3('0x77'));_0x35e302[_0x82f3('0x8e')]=moment()[_0x82f3('0x65')](_0x82f3('0x77'));}_0x35e302[_0x82f3('0x86')]=![];_0x35e302['queuecallerabandonAt']=null;_0x35e302[_0x82f3('0x88')]=_0x319eef['value'];this[_0x82f3('0x11')][_0x319eef[_0x82f3('0x4b')]]=_0x35e302;this[_0x82f3('0x50')](_0x35e302,_0x82f3('0x23'));}else if(this['isNotNull'](_0x319eef[_0x82f3('0xac')])&&this[_0x82f3('0x6b')](_0x319eef[_0x82f3('0xac')][_0x82f3('0xb4')])){if(!_0x35e302[_0x82f3('0x86')]){_0x35e302[_0x82f3('0xb0')]=!![];_0x35e302[_0x82f3('0x98')]=moment()['format'](_0x82f3('0x77'));_0x35e302[_0x82f3('0x88')]=_0x82f3('0xb5');_0x35e302[_0x82f3('0x8e')]=moment()[_0x82f3('0x65')](_0x82f3('0x77'));this[_0x82f3('0x11')][_0x319eef[_0x82f3('0x4b')]]=_0x35e302;}}logger[_0x82f3('0x7b')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x319eef[_0x82f3('0x4b')],_0x35e302[_0x82f3('0x4d')],_0x35e302[_0x82f3('0x56')],_[_0x82f3('0x7f')](_0x319eef[_0x82f3('0xac')])[0x0],_0x319eef['value']);_0x35e302[_0x82f3('0xb6')]=this[_0x82f3('0xb6')][_0x319eef['uniqueid']];}}}}catch(_0x1389dd){logger[_0x82f3('0x40')](_0x82f3('0xb7'),_0x319eef[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x1389dd,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x82f3('0xab')]=function(_0x441c50,_0x3c3352,_0x1bc7d1){var _0x4385e6=['rtpaudioqos',_0x82f3('0xb8'),_0x82f3('0xb9'),_0x82f3('0xba'),_0x82f3('0xbb'),'rtpaudioqoslossbridged',_0x82f3('0xbc'),'rtpaudioqosrttbridged',_0x82f3('0xbd'),_0x82f3('0xbe'),_0x82f3('0xbf'),'bridgepvtcallid',_0x82f3('0xc0'),_0x82f3('0xc1'),_0x82f3('0xc2'),'memberlastcall',_0x82f3('0x97'),_0x82f3('0xc3'),_0x82f3('0xc4')];if(!_[_0x82f3('0x3a')](_0x3c3352)&&!_[_0x82f3('0xc5')](_0x4385e6,_0x3c3352)){if(_[_0x82f3('0x67')](this[_0x82f3('0xb6')][_0x441c50])){this[_0x82f3('0xb6')][_0x441c50]={};}this[_0x82f3('0xb6')][_0x441c50][_0x3c3352]=_0x1bc7d1;}};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0xc6')]=function(_0x5e0989){try{if(this[_0x82f3('0x6b')](_0x5e0989)){logger[_0x82f3('0x4a')](_0x82f3('0xc7'),_0x5e0989['uniqueid'],util['inspect'](_0x5e0989,{'showHidden':![],'depth':null}));if(this[_0x82f3('0xf')][_0x5e0989[_0x82f3('0x4b')]]){for(var _0x7ac62a=0x0,_0x338e67={};_0x7ac62a<this['queueReports'][_0x5e0989[_0x82f3('0x4b')]][_0x82f3('0xc8')];_0x7ac62a+=0x1){_0x338e67=this[_0x82f3('0xf')][_0x5e0989['uniqueid']][_0x7ac62a];if(this[_0x82f3('0x13')][_0x338e67['queue']]){if(_0x338e67['queuecallerexit']&&_0x338e67[_0x82f3('0x99')]!=!![]){this[_0x82f3('0x13')][_0x338e67['queue']]['unmanaged']+=0x1;}if(_0x338e67[_0x82f3('0x86')]){this[_0x82f3('0x13')][_0x338e67[_0x82f3('0x6d')]]['abandoned']+=0x1;}this[_0x82f3('0x13')][_0x338e67['queue']][_0x82f3('0x5d')]+=moment(_0x338e67[_0x82f3('0x8e')])[_0x82f3('0xc9')](_0x338e67[_0x82f3('0x76')],_0x82f3('0xa2'))||0x0;if(_0x7ac62a===this[_0x82f3('0xf')][_0x5e0989[_0x82f3('0x4b')]][_0x82f3('0xc8')]-0x1){this[_0x82f3('0x13')][_0x338e67[_0x82f3('0x6d')]][_0x82f3('0x5c')]+=moment()['milliseconds'](0x0)[_0x82f3('0xc9')](_0x338e67[_0x82f3('0x76')],_0x82f3('0xa2'));this[_0x82f3('0x13')][_0x338e67['queue']]['total']+=0x1;if(_0x338e67[_0x82f3('0x82')]){this[_0x82f3('0x13')][_0x338e67[_0x82f3('0x6d')]][_0x82f3('0x58')]+=0x1;this[_0x82f3('0x13')][_0x338e67[_0x82f3('0x6d')]][_0x82f3('0x5b')]+=moment()[_0x82f3('0xca')](0x0)[_0x82f3('0xc9')](_0x338e67[_0x82f3('0x8e')],_0x82f3('0xa2'));_0x338e67[_0x82f3('0x83')]=moment()[_0x82f3('0x65')](_0x82f3('0x77'));_0x338e67[_0x82f3('0xb0')]=![];_0x338e67[_0x82f3('0x98')]=null;}if(_0x338e67[_0x82f3('0xb0')]&&_0x338e67['transfer']!=!![]){_0x338e67[_0x82f3('0xb2')]=_0x82f3('0x5f');logger[_0x82f3('0x4a')](_0x82f3('0xcb'),_0x5e0989[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x338e67,{'showHidden':![],'depth':null}));ami[_0x82f3('0x48')](_0x82f3('0xcc'),_0x338e67);}if(_0x338e67['queuecallerabandon']){_0x338e67[_0x82f3('0xb2')]=_0x82f3('0x60');logger[_0x82f3('0x4a')](_0x82f3('0xcd'),_0x5e0989['uniqueid'],util[_0x82f3('0x41')](_0x338e67,{'showHidden':![],'depth':null}));ami['emit'](_0x82f3('0xce'),_0x338e67);}}else{this['voiceQueues'][_0x338e67[_0x82f3('0x6d')]]['sumDuration']+=this[_0x82f3('0x13')][_0x338e67[_0x82f3('0x6d')]]['sumHoldTime'];}logger['info'](_0x82f3('0xcf'),_0x5e0989['uniqueid'],_0x338e67[_0x82f3('0x4d')],_0x338e67[_0x82f3('0x56')],_0x5e0989[_0x82f3('0xd0')]);this['channels'][_0x5e0989[_0x82f3('0x4b')]]=_0x338e67;this[_0x82f3('0x50')](_0x338e67,_0x82f3('0xd1'));this['emitVoiceQueueSummary'](this['voiceQueues'][_0x338e67[_0x82f3('0x6d')]],'hangup');}}logger[_0x82f3('0x4a')](_0x82f3('0xd2'),_0x5e0989[_0x82f3('0x4b')],util['inspect'](this['queueReports'][_0x5e0989[_0x82f3('0x4b')]],{'showHidden':![],'depth':null}));ami[_0x82f3('0x48')](_0x82f3('0xd3'),this[_0x82f3('0xf')][_0x5e0989[_0x82f3('0x4b')]]);delete this[_0x82f3('0xf')][_0x5e0989['uniqueid']];delete this['channels'][_0x5e0989[_0x82f3('0x4b')]];}if(this[_0x82f3('0xb6')][_0x5e0989[_0x82f3('0x4b')]]){delete this[_0x82f3('0xb6')][_0x5e0989[_0x82f3('0x4b')]];}}}catch(_0x449db8){logger[_0x82f3('0x40')](_0x82f3('0xc7'),_0x5e0989['uniqueid'],util[_0x82f3('0x41')](_0x449db8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x82f3('0x2d')]=function(_0x2260e0){try{if(this[_0x82f3('0x6b')](_0x2260e0)){logger['debug'](_0x82f3('0xd4'),_0x2260e0['uniqueid'],util['inspect'](_0x2260e0,{'showHidden':![],'depth':null}));var _0x2a3db6;if(this[_0x82f3('0xf')][_0x2260e0['transfereeuniqueid']]){_0x2a3db6=_['last'](this['queueReports'][_0x2260e0[_0x82f3('0xd5')]]);_0x2a3db6['transferexten']=_0x2260e0[_0x82f3('0xd6')];_0x2a3db6[_0x82f3('0xa5')]=_0x2260e0[_0x82f3('0xd7')];_0x2a3db6['queuecallerexitreason']=_0x82f3('0xd8');_0x2a3db6['transfer']=!![];_0x2a3db6[_0x82f3('0xd9')]=_0x82f3('0xda');if(this[_0x82f3('0xf')][_0x2260e0['secondtransfereruniqueid']]){var _0x541400=this[_0x82f3('0xf')][_0x2260e0[_0x82f3('0xd7')]];this[_0x82f3('0xf')][_0x2260e0[_0x82f3('0xd7')]]=this['queueReports'][_0x2260e0[_0x82f3('0xd5')]];this[_0x82f3('0xf')][_0x2260e0[_0x82f3('0xd5')]]=_0x541400;var _0xf6f71e=_[_0x82f3('0x8d')](this[_0x82f3('0xf')][_0x2260e0['transfereeuniqueid']]);_0xf6f71e[_0x82f3('0xdb')]=!![];}logger[_0x82f3('0x7b')](_0x82f3('0xdc'),_0x2260e0['uniqueid'],_0x2a3db6[_0x82f3('0x4d')],_0x2a3db6['type'],_0x2a3db6[_0x82f3('0xa3')],_0x2a3db6['transferuniqueid']);}else if(this[_0x82f3('0xf')][_0x2260e0[_0x82f3('0xdd')]]){_0x2a3db6=_[_0x82f3('0x8d')](this[_0x82f3('0xf')][_0x2260e0['transfertargetuniqueid']]);_0x2a3db6[_0x82f3('0xa3')]=_0x2260e0[_0x82f3('0xde')];_0x2a3db6[_0x82f3('0xa5')]=_0x2260e0[_0x82f3('0xdf')];_0x2a3db6[_0x82f3('0x88')]=_0x82f3('0xd8');_0x2a3db6[_0x82f3('0x99')]=!![];_0x2a3db6[_0x82f3('0xd9')]=_0x82f3('0xda');if(this[_0x82f3('0xf')][_0x2260e0[_0x82f3('0xdf')]]){var _0x541400=this[_0x82f3('0xf')][_0x2260e0[_0x82f3('0xdf')]];this[_0x82f3('0xf')][_0x2260e0[_0x82f3('0xdf')]]=this[_0x82f3('0xf')][_0x2260e0[_0x82f3('0xdd')]];this[_0x82f3('0xf')][_0x2260e0[_0x82f3('0xdd')]]=_0x541400;var _0xf6f71e=_[_0x82f3('0x8d')](this[_0x82f3('0xf')][_0x2260e0[_0x82f3('0xdd')]]);_0xf6f71e[_0x82f3('0xdb')]=!![];}logger['info']('[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s',_0x2260e0['uniqueid'],_0x2a3db6['name'],_0x2a3db6[_0x82f3('0x56')],_0x2a3db6['transferexten'],_0x2a3db6[_0x82f3('0xa5')]);}}}catch(_0x3eee6a){logger[_0x82f3('0x40')](_0x82f3('0xd4'),_0x2260e0[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x3eee6a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x2e')]=function(_0x2e0781){try{if(this[_0x82f3('0x6b')](_0x2e0781)){logger['debug']('[%s][voiceQueueReport][blindtransfer]',_0x2e0781[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x2e0781,{'showHidden':![],'depth':null}));if(this[_0x82f3('0xf')][_0x2e0781[_0x82f3('0xd5')]]){var _0x2950f4=_['last'](this['queueReports'][_0x2e0781[_0x82f3('0xd5')]]);_0x2950f4['queuecallerexitreason']='BLINDTRANSFER';_0x2950f4['transfer']=!![];_0x2950f4['transfertype']='BLIND';_0x2950f4[_0x82f3('0xa3')]=_0x2e0781[_0x82f3('0xe0')];_0x2950f4[_0x82f3('0xa5')]=_0x2e0781[_0x82f3('0xd5')];logger[_0x82f3('0x7b')](_0x82f3('0xe1'),_0x2e0781[_0x82f3('0x4b')],_0x2950f4[_0x82f3('0x4d')],_0x2950f4[_0x82f3('0x56')],_0x2950f4['transferexten'],_0x2950f4['transferuniqueid']);this[_0x82f3('0xc6')]({'event':'BlindTransfer','uniqueid':_0x2e0781[_0x82f3('0xd5')],'context':_0x2e0781[_0x82f3('0xe2')],'channel':_0x2e0781[_0x82f3('0xe3')]});}}}catch(_0xc8e5ac){logger[_0x82f3('0x40')](_0x82f3('0xe4'),_0x2e0781[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0xc8e5ac,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncMusicOnHoldStart']=function(_0x30726c){try{if(this[_0x82f3('0x6b')](_0x30726c)){logger[_0x82f3('0x4a')](_0x82f3('0xe5'),_0x30726c[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x30726c,{'showHidden':![],'depth':null}));if(this[_0x82f3('0xf')][_0x30726c[_0x82f3('0x4b')]]){var _0x125e96=_[_0x82f3('0x8d')](this[_0x82f3('0xf')][_0x30726c[_0x82f3('0x4b')]]);if(!_[_0x82f3('0x3a')](_0x125e96['queuecallerleaveAt'])){_0x125e96['mohstarttime']=moment()[_0x82f3('0x65')](_0x82f3('0x77'));logger[_0x82f3('0x7b')]('[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s',_0x30726c[_0x82f3('0x4b')],_0x125e96[_0x82f3('0xe6')]);}}}}catch(_0x1cba53){logger[_0x82f3('0x40')]('[%s][voiceQueueReport][musiconholdstart]',_0x30726c[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x1cba53,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x2b')]=function(_0x1d152e){try{if(this[_0x82f3('0x6b')](_0x1d152e)){logger[_0x82f3('0x4a')](_0x82f3('0xe7'),_0x1d152e[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x1d152e,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1d152e[_0x82f3('0x4b')]]){var _0x451ffc=_['last'](this['queueReports'][_0x1d152e['uniqueid']]);if(!_[_0x82f3('0x3a')](_0x451ffc[_0x82f3('0xe6')])){_0x451ffc[_0x82f3('0xe8')]+=moment()[_0x82f3('0xca')](0x0)[_0x82f3('0xc9')](_0x451ffc['mohstarttime'],'seconds');logger['info'](_0x82f3('0xe9'),_0x1d152e[_0x82f3('0x4b')],_0x451ffc[_0x82f3('0xe8')]);delete _0x451ffc[_0x82f3('0xe6')];}}}}catch(_0x271cc8){logger[_0x82f3('0x40')](_0x82f3('0xe7'),_0x1d152e[_0x82f3('0x4b')],util[_0x82f3('0x41')](_0x271cc8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x82f3('0xa')][_0x82f3('0x27')]=function(_0x272cd2){try{if(this[_0x82f3('0x6b')](_0x272cd2)){logger[_0x82f3('0x4a')](_0x82f3('0xea'),_0x272cd2['uniqueid'],util['inspect'](_0x272cd2,{'showHidden':![],'depth':null}));if(_0x272cd2['application'][_0x82f3('0x9f')]()==='set'){_0x272cd2[_0x82f3('0xeb')]=_0x272cd2[_0x82f3('0xec')]&&_0x272cd2[_0x82f3('0xec')][_0x82f3('0x9d')]('CDR(routeAlias)')?_0x272cd2[_0x82f3('0xec')]:(_0x272cd2[_0x82f3('0xec')]||_0x272cd2[_0x82f3('0xeb')])[_0x82f3('0x9f')]();if(_[_0x82f3('0x9d')](_0x272cd2[_0x82f3('0xeb')][_0x82f3('0x9f')](),_0x82f3('0xed'))){logger[_0x82f3('0x7b')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x272cd2[_0x82f3('0x4b')],_0x272cd2[_0x82f3('0xee')],_0x272cd2[_0x82f3('0xeb')]);if(_[_0x82f3('0x67')](this[_0x82f3('0x11')][_0x272cd2[_0x82f3('0x4b')]]))this[_0x82f3('0x11')][_0x272cd2['uniqueid']]={};var _0x58967b=_0x272cd2[_0x82f3('0xeb')][_0x82f3('0xef')]('=');var _0x4d7d19=_0x58967b[0x0][_0x82f3('0x9f')]()['match'](/cdr\((.*)\)/);if(_0x4d7d19)this[_0x82f3('0x11')][_0x272cd2['uniqueid']][_0x4d7d19[0x1]]=_0x58967b[0x1];}}}}catch(_0x87c5ca){logger[_0x82f3('0x40')]('[%s][voiceQueueReport][newexten]',_0x272cd2[_0x82f3('0x4b')],util['inspect'](_0x87c5ca,{'showHidden':![],'depth':null}));}};module[_0x82f3('0xf0')]=VoiceQueueReport;
\ No newline at end of file
+var _0xb2b0=['assign','syncQueueStatusComplete','type','inbound','outbound','custom:queuesummary','statusRequests','completeEvent','syncQueueMember','push','[voiceQueueReport][queuesummary]\x20event:','[voiceQueueReport][queuesummary]\x20name:%s','[voiceQueueReport][queuesummarycomplete]\x20event:','custom:queuesummarycomplete','syncQueueCallerJoin','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','position','count','info','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','pick','emitVoiceQueueChannelSave','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','queuecallerleaveAt','connectedlinenum','connectedlinename','syncAgentConnect','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','queuecallerexitAt','transfer','reason','COMPLETED','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','FORWARDTRANSFER','transfertype','FORWARD','transferexten','destexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','addVariable','keys','value','variable','CONTINUE','TIMEOUT','lastevent','[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:','custom:timeout','[%s][voiceQueueReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberlastcall','membername','memberpenalty','isNil','includes','length','sumHoldTime','diff','sumDuration','seconds','total','answered','sumBillable','unmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','abandoned','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]','handleHangup','cause-txt','cause','transferid','[%s][voiceQueueReport][syncHangup]\x20No\x20available\x20data\x20in\x20queueReports\x20structure:\x20clear\x20action\x20in\x20variablea\x20and\x20channels\x20structures\x20needed','[%s][voiceQueueReport][attendedtransfer]','transfereeuniqueid','secondtransfereruniqueid','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','ATTENDED','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','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','[%s][voiceQueueReport][musiconholdstop]','mohtime','milliseconds','syncNewExten','[%s][voiceQueueReport][newexten]\x20event:','application','set','applicationdata','appdata','CDR(routeAlias)','cdr(','split','match','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../model/voiceQueueSummary','defaults','redis','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','realtime','agents','queueChannels','voiceQueues','campaigns','summary','variables','queuesummary','bind','syncQueueSummaryComplete','queuestatuscomplete','queuecallerjoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','agentconnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','waiting','queuecallerexit','queuecallercomplete','clearZombieChannels','channels','Action','status','channel','message','No\x20such\x20channel','[%s][voiceQueueReport][checkChannel]','inspect','error','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','syncFullyBooted','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','clearqueuereport','emit','[%s][voiceQueueReport][','format','voice:queue:%s','queue','voice_queue_channel:save','debug',']\x20sending\x20voice_queue_channel:remove\x20event:','uniqueid','queuecallerexitreason','ATTENDEDTRANSFER','voice_queue_channel:remove','voice_queue_presence:remove','emitInboundVoiceQueueSummary','[voiceQueueReport][queuesummary]\x20sending\x20voice_queue:save\x20event:','name','isNotNull','isUndefined','queues','catch','[voiceQueueReport][queues]','loopQueueSummary','isRunning','actionid','queuestatus','[voiceQueueReport][queuesummary]','createQueueSummaryReport','summaryEvent','createReport','handleInboundQueueSummaryReport','compareToInboundQueue'];(function(_0x1278aa,_0x53cc06){var _0x11cbc8=function(_0x1e7d63){while(--_0x1e7d63){_0x1278aa['push'](_0x1278aa['shift']());}};_0x11cbc8(++_0x53cc06);}(_0xb2b0,0x8f));var _0x0b2b=function(_0x5e69f1,_0x2d1835){_0x5e69f1=_0x5e69f1-0x0;var _0x3ff8d0=_0xb2b0[_0x5e69f1];return _0x3ff8d0;};'use strict';var _=require(_0x0b2b('0x0'));var moment=require(_0x0b2b('0x1'));var util=require(_0x0b2b('0x2'));var Redis=require('ioredis');var config=require(_0x0b2b('0x3'));var logger=require(_0x0b2b('0x4'))(_0x0b2b('0x5'));var ami=require('../ami');var QueueReport=require('../model/queueReport');var VoiceQueueSummary=require(_0x0b2b('0x6'));config['redis']=_[_0x0b2b('0x7')](config[_0x0b2b('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x0b2b('0x9'))(new Redis(config[_0x0b2b('0x8')]));var Sequence=function(){};Sequence[_0x0b2b('0xa')][_0x0b2b('0xb')]=function(_0x114178){this['tail']=this[_0x0b2b('0xc')]?this[_0x0b2b('0xc')][_0x0b2b('0xd')](_0x114178):_0x114178();};function VoiceQueueReport(_0x1c06c6){this[_0x0b2b('0xe')]=new Sequence();this[_0x0b2b('0xf')]={};this[_0x0b2b('0x10')]=_0x1c06c6;this['agents']=_0x1c06c6[_0x0b2b('0x11')];this['channels']=_0x1c06c6[_0x0b2b('0x12')];this[_0x0b2b('0x13')]=_0x1c06c6[_0x0b2b('0x13')];this[_0x0b2b('0x14')]=_0x1c06c6[_0x0b2b('0x14')];this[_0x0b2b('0x15')]=initializeSummary();this[_0x0b2b('0x16')]={};ami['on'](_0x0b2b('0x17'),this['syncQueueSummary'][_0x0b2b('0x18')](this));ami['on']('queuesummarycomplete',this[_0x0b2b('0x19')][_0x0b2b('0x18')](this));ami['on']('queuemember',this['syncQueueMember']['bind'](this));ami['on'](_0x0b2b('0x1a'),this['syncQueueStatusComplete'][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x1b'),this['syncQueueCallerJoin'][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x1c'),this[_0x0b2b('0x1d')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x1e'),this[_0x0b2b('0x1f')]['bind'](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x20'),this['syncAgentConnect']['bind'](this));ami['on'](_0x0b2b('0x21'),this[_0x0b2b('0x22')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x23'),this[_0x0b2b('0x24')]['bind'](this));ami['on'](_0x0b2b('0x25'),this['syncFullyBooted']['bind'](this));ami['on']('musiconholdstart',this[_0x0b2b('0x26')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x27'),this[_0x0b2b('0x28')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x29'),this[_0x0b2b('0x2a')][_0x0b2b('0x18')](this));ami['on'](_0x0b2b('0x2b'),this[_0x0b2b('0x2c')][_0x0b2b('0x18')](this));this['loopQueueSummary']();this[_0x0b2b('0x2d')]();}function clearChannels(_0x455eed){if(!_[_0x0b2b('0x2e')](_0x455eed)){for(var _0x4cacf2 in _0x455eed){if(_0x455eed[_0x0b2b('0x2f')](_0x4cacf2)){delete _0x455eed[_0x4cacf2];}}}}function clearCampaigns(_0x539b95){if(!_[_0x0b2b('0x2e')](_0x539b95)){for(var _0x3229c2 in _0x539b95){if(_0x539b95[_0x0b2b('0x2f')](_0x3229c2)){_0x539b95[_0x3229c2][_0x0b2b('0x30')]=0x0;}}}}function clearVoiceQueues(_0x5ec306){if(!_[_0x0b2b('0x2e')](_0x5ec306)){for(var _0x151bf7 in _0x5ec306){if(_0x5ec306['hasOwnProperty'](_0x151bf7)){_0x5ec306[_0x151bf7][_0x0b2b('0x30')]=0x0;_0x5ec306[_0x151bf7]['talking']=0x0;_0x5ec306[_0x151bf7]['pTalking']=0x0;_0x5ec306[_0x151bf7][_0x0b2b('0x31')]=0x0;_0x5ec306[_0x151bf7]['queueStatusComplete']=!![];}}}}function clearAgentBooked(_0x3396c1){if(!_['isEmpty'](_0x3396c1)){for(var _0x2ded99 in _0x3396c1){if(_0x3396c1[_0x0b2b('0x2f')](_0x2ded99)){_0x3396c1[_0x2ded99]['unlockRR']=!![];}}}}function initializeSummary(){return{'id':null,'completeEvent':null,'isRunning':![],'queues':{},'queuestatus':{},'statusRequests':0x0};}function hasCallerLeftTheQueue(_0x528111){return _0x528111[_0x0b2b('0x32')]||_0x528111[_0x0b2b('0x1c')]||_0x528111[_0x0b2b('0x33')];}VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x34')]=function(){var _0x5d06d8=this;for(var _0x4d7a88 in this['channels']){if(this[_0x0b2b('0x35')][_0x0b2b('0x2f')](_0x4d7a88)&&!this[_0x0b2b('0x35')][_0x4d7a88]['switch']){this[_0x0b2b('0xe')]['enqueue'](function(){if(!_['isNil'](_0x5d06d8[_0x0b2b('0x35')][_0x4d7a88])){return ami[_0x0b2b('0x36')]({'action':_0x0b2b('0x37'),'channel':_0x5d06d8['channels'][_0x4d7a88][_0x0b2b('0x38')]})['catch'](function(_0x5bd9aa){if(_0x5bd9aa[_0x0b2b('0x39')]===_0x0b2b('0x3a')){setTimeout(function(){if(_0x5d06d8[_0x0b2b('0x35')][_0x4d7a88]){delete _0x5d06d8[_0x0b2b('0x35')][_0x4d7a88];logger['error'](_0x0b2b('0x3b'),_0x4d7a88,util[_0x0b2b('0x3c')](_0x5bd9aa,{'showHidden':![],'depth':null}));}if(_0x5d06d8[_0x0b2b('0xf')][_0x4d7a88]){delete _0x5d06d8[_0x0b2b('0xf')][_0x4d7a88];logger[_0x0b2b('0x3d')](_0x0b2b('0x3e'),_0x4d7a88,util['inspect'](_0x5bd9aa,{'showHidden':![],'depth':null}));}if(_0x5d06d8[_0x0b2b('0x16')][_0x4d7a88]){delete _0x5d06d8[_0x0b2b('0x16')][_0x4d7a88];logger['error'](_0x0b2b('0x3f'),_0x4d7a88,util[_0x0b2b('0x3c')](_0x5bd9aa,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x40')]=function(){logger[_0x0b2b('0x3d')](_0x0b2b('0x41'));clearChannels(this['channels']);this[_0x0b2b('0x42')](this[_0x0b2b('0xf')]);clearAgentBooked(this[_0x0b2b('0x11')]);clearVoiceQueues(this[_0x0b2b('0x13')]);clearCampaigns(this[_0x0b2b('0x14')]);this['summary']=initializeSummary();};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x42')]=function(_0x4da1b7){var _0x406fe4=this;if(!_['isEmpty'](_0x4da1b7)){for(var _0x26be49 in _0x4da1b7){if(_0x4da1b7[_0x0b2b('0x2f')](_0x26be49)){_0x406fe4[_0x0b2b('0x43')](_0x4da1b7[_0x26be49],_0x0b2b('0x44'));delete _0x4da1b7[_0x26be49];}}}};VoiceQueueReport['prototype'][_0x0b2b('0x45')]=function(_0x48bebc,_0x5c2559,_0x38a233){io['to'](_0x48bebc)[_0x0b2b('0x45')](_0x5c2559,_0x38a233);};VoiceQueueReport[_0x0b2b('0xa')]['emitVoiceQueueChannelSave']=function(_0x1359bc,_0x5e3bf9){logger['debug'](_0x0b2b('0x46')+_0x5e3bf9+']\x20sending\x20voice_queue_channel:save\x20event:',_0x1359bc['uniqueid'],util['inspect'](_0x1359bc,{'showHidden':![],'depth':null}));this[_0x0b2b('0x45')](util[_0x0b2b('0x47')](_0x0b2b('0x48'),_0x1359bc[_0x0b2b('0x49')]),_0x0b2b('0x4a'),_0x1359bc);io[_0x0b2b('0x45')]('voice_queue_presence:save',_0x1359bc);};VoiceQueueReport[_0x0b2b('0xa')]['emitVoiceQueueChannelRemove']=function(_0x238506,_0x4be6f2){logger[_0x0b2b('0x4b')](_0x0b2b('0x46')+_0x4be6f2+_0x0b2b('0x4c'),_0x238506[_0x0b2b('0x4d')],util['inspect'](_0x238506,{'showHidden':![],'depth':null}));if(_0x238506[_0x0b2b('0x4e')]===_0x0b2b('0x4f')){return;}this[_0x0b2b('0x45')](util['format']('voice:queue:%s',_0x238506[_0x0b2b('0x49')]),_0x0b2b('0x50'),_0x238506);io[_0x0b2b('0x45')](_0x0b2b('0x51'),_0x238506);};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x52')]=function(_0x1085c7){if(_0x1085c7['type']==='inbound'){logger[_0x0b2b('0x4b')](_0x0b2b('0x53'),util[_0x0b2b('0x3c')](_0x1085c7,{'showHidden':![],'depth':null}));this[_0x0b2b('0x45')](util[_0x0b2b('0x47')](_0x0b2b('0x48'),_0x1085c7[_0x0b2b('0x54')]),'voice_queue:save',_0x1085c7);}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x55')]=function(_0x113cac){return _0x113cac!==null&&!_[_0x0b2b('0x56')](_0x113cac);};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x2d')]=function(){var _0x58dd8c=this;setInterval(function(){_0x58dd8c[_0x0b2b('0x34')]();ami[_0x0b2b('0x36')]({'action':_0x0b2b('0x57')})[_0x0b2b('0x58')](function(_0x22025e){logger[_0x0b2b('0x3d')](_0x0b2b('0x59'),util[_0x0b2b('0x3c')](_0x22025e,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x5a')]=function(){var _0x8831a=this;setInterval(function(){if(!_0x8831a[_0x0b2b('0x15')][_0x0b2b('0x5b')]){return ami[_0x0b2b('0x36')]({'action':_0x0b2b('0x17')})['then'](function(_0x43b12a){_0x8831a[_0x0b2b('0x15')]['id']=_0x43b12a[_0x0b2b('0x5c')];_0x8831a[_0x0b2b('0x15')][_0x0b2b('0x5b')]=!![];_0x8831a[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x43b12a[_0x0b2b('0x5c')]]={};})[_0x0b2b('0x58')](function(_0x577300){logger['error'](_0x0b2b('0x5e'),util['inspect'](_0x577300,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x5f')]=function(_0x5373d3,_0x5df03d){var _0x29add9;if(this[_0x0b2b('0x15')]&&this['summary'][_0x0b2b('0x57')]&&this[_0x0b2b('0x15')][_0x0b2b('0x57')][_0x5373d3[_0x0b2b('0x54')]]){_0x29add9=this[_0x0b2b('0x15')]['queues'][_0x5373d3[_0x0b2b('0x54')]][_0x0b2b('0x60')];}var _0x80ad92=new VoiceQueueSummary(_0x5373d3);return _0x80ad92[_0x0b2b('0x61')](_0x5df03d[_0x0b2b('0x11')],this[_0x0b2b('0x11')],_0x29add9,this[_0x0b2b('0x10')][_0x0b2b('0x35')]);};VoiceQueueReport['prototype'][_0x0b2b('0x62')]=function(_0x78eecb,_0x2857f6){var _0x44077c=this[_0x0b2b('0x5f')](_0x78eecb,_0x2857f6);var _0x38702d=![];_0x38702d=_0x44077c[_0x0b2b('0x63')](_0x78eecb);if(_0x38702d){Object[_0x0b2b('0x64')](_0x78eecb,_0x44077c);this[_0x0b2b('0x10')][_0x0b2b('0x13')][_0x78eecb['name']]=_0x78eecb;this['emitInboundVoiceQueueSummary'](_0x44077c);}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x65')]=function(_0x1989b3){var _0x2dba6e=null;var _0x1b14e8=this['summary']['id'];if(this[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x1b14e8]){_0x2dba6e=this[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x1b14e8][_0x1989b3['actionid']];}if(!_0x2dba6e){this['summary']=initializeSummary();return;}var _0xed5871=this[_0x0b2b('0x13')][_0x2dba6e[_0x0b2b('0x49')]];if(_0xed5871[_0x0b2b('0x66')]===_0x0b2b('0x67')){this['handleInboundQueueSummaryReport'](_0xed5871,_0x2dba6e);}else if(_0xed5871[_0x0b2b('0x66')]===_0x0b2b('0x68')){var _0x22981d=this[_0x0b2b('0x5f')](_0xed5871,_0x2dba6e);ami[_0x0b2b('0x45')](_0x0b2b('0x69'),_0x22981d);}this[_0x0b2b('0x15')][_0x0b2b('0x6a')]-=0x1;var _0x3bcbb9=this['summary'][_0x0b2b('0x6a')]>0x0?!![]:![];if(!_0x3bcbb9){return this[_0x0b2b('0x19')](this[_0x0b2b('0x15')][_0x0b2b('0x6b')]);}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x6c')]=function(_0x582c62){var _0x8d3c5f=this['summary']['id'];if(this[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x8d3c5f]&&this[_0x0b2b('0x15')][_0x0b2b('0x5d')][_0x8d3c5f][_0x582c62['actionid']]){this['summary'][_0x0b2b('0x5d')][_0x8d3c5f][_0x582c62['actionid']][_0x0b2b('0x11')][_0x0b2b('0x6d')](_0x582c62);}};VoiceQueueReport[_0x0b2b('0xa')]['syncQueueSummary']=function(_0x1adb4f){var _0x197d80=this;try{if(this['isNotNull'](_0x1adb4f)&&this[_0x0b2b('0x55')](_0x1adb4f[_0x0b2b('0x49')])){logger[_0x0b2b('0x4b')](_0x0b2b('0x6e'),util[_0x0b2b('0x3c')](_0x1adb4f,{'showHidden':![],'depth':null}));var _0x17a3f4=this[_0x0b2b('0x13')][_0x1adb4f['queue']];if(_0x17a3f4){logger[_0x0b2b('0x4b')](_0x0b2b('0x6f'),_0x17a3f4[_0x0b2b('0x54')]);this[_0x0b2b('0x15')][_0x0b2b('0x57')][_0x17a3f4[_0x0b2b('0x54')]]={'summaryEvent':_0x1adb4f};this[_0x0b2b('0x15')][_0x0b2b('0x6a')]+=0x1;return ami[_0x0b2b('0x36')]({'action':_0x0b2b('0x5d'),'queue':_0x17a3f4[_0x0b2b('0x54')]})['then'](function(_0x55fbb3){if(!_0x197d80['summary'][_0x0b2b('0x5d')][_0x1adb4f[_0x0b2b('0x5c')]]){_0x197d80[_0x0b2b('0x15')]['queuestatus'][_0x1adb4f['actionid']]={};}_0x197d80['summary'][_0x0b2b('0x5d')][_0x1adb4f[_0x0b2b('0x5c')]][_0x55fbb3[_0x0b2b('0x5c')]]={'queue':_0x17a3f4['name'],'agents':[]};})['catch'](function(_0xb02d15){throw _0xb02d15;});}}}catch(_0x40ce9f){logger[_0x0b2b('0x3d')](_0x0b2b('0x5e'),util['inspect'](_0x40ce9f,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0b2b('0x19')]=function(_0x955376){if(this[_0x0b2b('0x15')]['statusRequests']>0x0){this[_0x0b2b('0x15')][_0x0b2b('0x6b')]=_0x955376;return;}logger['debug'](_0x0b2b('0x70'),util['inspect'](_0x955376,{'showHidden':![],'depth':null}));this[_0x0b2b('0x15')]=initializeSummary();ami[_0x0b2b('0x45')](_0x0b2b('0x71'),{});};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x72')]=function(_0x3ae799){try{if(this['isNotNull'](_0x3ae799)){logger[_0x0b2b('0x4b')](_0x0b2b('0x73'),_0x3ae799['uniqueid'],util[_0x0b2b('0x3c')](_0x3ae799,{'showHidden':![],'depth':null}));if(_['isUndefined'](this[_0x0b2b('0xf')][_0x3ae799[_0x0b2b('0x4d')]])){this[_0x0b2b('0xf')][_0x3ae799[_0x0b2b('0x4d')]]=[];}if(_[_0x0b2b('0x56')](this[_0x0b2b('0x35')][_0x3ae799[_0x0b2b('0x4d')]])){this['channels'][_0x3ae799['uniqueid']]={};}var _0x1e9ae5=new QueueReport();_0x1e9ae5['queue']=_0x3ae799[_0x0b2b('0x49')];_0x1e9ae5[_0x0b2b('0x66')]=this[_0x0b2b('0x13')][_0x1e9ae5[_0x0b2b('0x49')]]&&this['voiceQueues'][_0x1e9ae5[_0x0b2b('0x49')]][_0x0b2b('0x66')]?this[_0x0b2b('0x13')][_0x1e9ae5[_0x0b2b('0x49')]]['type']||_0x0b2b('0x67'):'inbound';_0x1e9ae5[_0x0b2b('0x74')]=moment()[_0x0b2b('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x1e9ae5[_0x0b2b('0x75')]=_0x3ae799['position'];_0x1e9ae5[_0x0b2b('0x76')]=_0x3ae799[_0x0b2b('0x76')];_0x1e9ae5[_0x0b2b('0x4d')]=_0x3ae799['uniqueid'];_0x1e9ae5['routealias']=this[_0x0b2b('0x35')][_0x3ae799['uniqueid']]['routealias'];logger[_0x0b2b('0x77')](_0x0b2b('0x78'),_0x1e9ae5[_0x0b2b('0x49')],_0x1e9ae5[_0x0b2b('0x66')]);Object['assign'](_0x1e9ae5,_[_0x0b2b('0x79')](_0x3ae799,_['keys'](_0x1e9ae5)));this[_0x0b2b('0xf')][_0x3ae799[_0x0b2b('0x4d')]][_0x0b2b('0x6d')](_0x1e9ae5);this[_0x0b2b('0x35')][_0x3ae799[_0x0b2b('0x4d')]]=_0x1e9ae5;this[_0x0b2b('0x7a')](_0x1e9ae5,_0x0b2b('0x1b'));}}catch(_0x17a139){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x3ae799[_0x0b2b('0x4d')],util['inspect'](_0x17a139,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')]['syncQueueCallerAbandon']=function(_0x185588){try{if(this[_0x0b2b('0x55')](_0x185588)){logger[_0x0b2b('0x4b')]('[%s][voiceQueueReport][queuecallerabandon]',_0x185588['uniqueid'],util[_0x0b2b('0x3c')](_0x185588,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x185588[_0x0b2b('0x4d')]]){var _0x11a56f=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x185588['uniqueid']]);_0x11a56f[_0x0b2b('0x33')]=![];_0x11a56f[_0x0b2b('0x7c')]=null;_0x11a56f[_0x0b2b('0x7d')]=_0x185588[_0x0b2b('0x7d')];_0x11a56f[_0x0b2b('0x7e')]=_0x185588[_0x0b2b('0x7e')];_0x11a56f[_0x0b2b('0x1c')]=!![];_0x11a56f[_0x0b2b('0x7f')]=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x11a56f[_0x0b2b('0x4e')]=_0x0b2b('0x81');_0x11a56f[_0x0b2b('0x82')]=null;logger[_0x0b2b('0x77')](_0x0b2b('0x83'),_0x11a56f['queue'],_0x11a56f[_0x0b2b('0x66')]);this['channels'][_0x185588[_0x0b2b('0x4d')]]=_0x11a56f;this[_0x0b2b('0x43')](_0x11a56f,_0x0b2b('0x1c'));}}}catch(_0x2279a0){logger['error']('[%s][voiceQueueReport][queuecallerabandon]',_0x185588[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x2279a0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')]['syncQueueCallerLeave']=function(_0x417323){try{if(this['isNotNull'](_0x417323)){logger['debug'](_0x0b2b('0x84'),_0x417323[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x417323,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x417323['uniqueid']]){var _0x362819=_[_0x0b2b('0x7b')](this['queueReports'][_0x417323[_0x0b2b('0x4d')]]);_0x362819[_0x0b2b('0x85')]=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x362819[_0x0b2b('0x86')]=_0x417323[_0x0b2b('0x86')];_0x362819[_0x0b2b('0x87')]=_0x417323[_0x0b2b('0x87')];logger[_0x0b2b('0x77')]('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x362819['queue'],_0x362819['type'],_0x417323[_0x0b2b('0x86')],_0x417323[_0x0b2b('0x87')]);this[_0x0b2b('0x35')][_0x417323[_0x0b2b('0x4d')]]=_0x362819;this[_0x0b2b('0x7a')](_0x362819,_0x0b2b('0x1e'));}}}catch(_0x2f5b16){logger[_0x0b2b('0x3d')](_0x0b2b('0x84'),_0x417323['uniqueid'],util['inspect'](_0x2f5b16,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0b2b('0x88')]=function(_0x3e7384){try{if(this['isNotNull'](_0x3e7384)){logger[_0x0b2b('0x4b')](_0x0b2b('0x89'),_0x3e7384[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x3e7384,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x3e7384[_0x0b2b('0x4d')]]){var _0x534dc0=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x3e7384[_0x0b2b('0x4d')]]);_0x534dc0[_0x0b2b('0x33')]=!![];_0x534dc0[_0x0b2b('0x4e')]=_0x0b2b('0x8a');logger[_0x0b2b('0x77')](_0x0b2b('0x8b'),_0x534dc0[_0x0b2b('0x49')],_0x534dc0[_0x0b2b('0x66')]);}}}catch(_0xbfba8e){logger[_0x0b2b('0x3d')](_0x0b2b('0x89'),_0x3e7384[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0xbfba8e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x8c')]=function(_0x4ba56f){try{if(this[_0x0b2b('0x55')](_0x4ba56f)){logger[_0x0b2b('0x4b')](_0x0b2b('0x8d'),_0x4ba56f['uniqueid'],util[_0x0b2b('0x3c')](_0x4ba56f,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x4ba56f[_0x0b2b('0x4d')]]){var _0x5f3caf=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x4ba56f[_0x0b2b('0x4d')]]);_0x5f3caf[_0x0b2b('0x1c')]=![];_0x5f3caf['queuecallerabandonAt']=null;_0x5f3caf['assigned']=!![];_0x5f3caf[_0x0b2b('0x82')]=_0x4ba56f['membername'];_0x5f3caf[_0x0b2b('0x7d')]=_0x4ba56f[_0x0b2b('0x7d')];_0x5f3caf[_0x0b2b('0x33')]=!![];_0x5f3caf[_0x0b2b('0x32')]=![];_0x5f3caf[_0x0b2b('0x8e')]=null;if(!_0x5f3caf[_0x0b2b('0x8f')]){if(_0x4ba56f[_0x0b2b('0x90')]==_0x0b2b('0x8f')){_0x5f3caf[_0x0b2b('0x4e')]=_0x0b2b('0x91');logger[_0x0b2b('0x77')](_0x0b2b('0x92'),_0x5f3caf['queue'],_0x5f3caf['type']);}else{if(_[_0x0b2b('0x93')](_0x4ba56f[_0x0b2b('0x38')][_0x0b2b('0x94')](),_0x0b2b('0x95'))){if(this[_0x0b2b('0xf')][_0x4ba56f[_0x0b2b('0x96')]]){var _0x1b3bad=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x4ba56f['linkedid']]);_0x1b3bad[_0x0b2b('0x33')]=![];_0x1b3bad[_0x0b2b('0x32')]=!![];_0x1b3bad['queuecallerexitAt']=moment(_0x5f3caf[_0x0b2b('0x74')])['add'](_0x4ba56f[_0x0b2b('0x7d')],'seconds')[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x1b3bad[_0x0b2b('0x4e')]=_0x0b2b('0x97');_0x1b3bad['transfer']=!![];_0x1b3bad[_0x0b2b('0x98')]=_0x0b2b('0x99');_0x1b3bad[_0x0b2b('0x9a')]=_0x4ba56f[_0x0b2b('0x9b')];_0x1b3bad[_0x0b2b('0x9c')]=_0x4ba56f['uniqueid'];logger[_0x0b2b('0x77')](_0x0b2b('0x9d'),_0x1b3bad[_0x0b2b('0x49')],_0x1b3bad[_0x0b2b('0x66')]);var _0x7693c8=this['queueReports'][_0x4ba56f['linkedid']];this['queueReports'][_0x4ba56f[_0x0b2b('0x96')]]=this[_0x0b2b('0xf')][_0x4ba56f[_0x0b2b('0x4d')]];this['queueReports'][_0x4ba56f[_0x0b2b('0x4d')]]=_0x7693c8;}}else{_0x5f3caf['queuecallerexitreason']=_0x0b2b('0x9e')+_0x4ba56f[_0x0b2b('0x90')][_0x0b2b('0x9f')]();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x5f3caf['queue'],_0x5f3caf[_0x0b2b('0x66')],_0x5f3caf[_0x0b2b('0x4e')]);}}}this[_0x0b2b('0x35')][_0x4ba56f['uniqueid']]=_0x5f3caf;}}}catch(_0x3db38e){logger[_0x0b2b('0x3d')]('[%s][voiceQueueReport][agentcomplete]',_0x4ba56f[_0x0b2b('0x4d')],util['inspect'](_0x3db38e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x22')]=function(_0x121717){try{if(this[_0x0b2b('0x55')](_0x121717)){logger['debug']('[%s][voiceQueueReport][varset]',_0x121717[_0x0b2b('0x4d')],util['inspect'](_0x121717,{'showHidden':![],'depth':null}));this[_0x0b2b('0xa0')](_0x121717[_0x0b2b('0x4d')],_[_0x0b2b('0xa1')](_0x121717['variable'])[0x0],_0x121717[_0x0b2b('0xa2')]);if(this[_0x0b2b('0xf')][_0x121717[_0x0b2b('0x4d')]]){var _0x5a6a2e=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x121717['uniqueid']]);if(_0x5a6a2e){if(this[_0x0b2b('0x55')](_0x121717['variable'])&&this[_0x0b2b('0x55')](_0x121717[_0x0b2b('0xa3')]['queuestatus'])){switch(_0x121717[_0x0b2b('0xa2')]){case _0x0b2b('0xa4'):_0x5a6a2e[_0x0b2b('0x32')]=![];_0x5a6a2e[_0x0b2b('0x8e')]=null;break;case _0x0b2b('0xa5'):_0x5a6a2e[_0x0b2b('0xa6')]='timeout';_0x5a6a2e[_0x0b2b('0x32')]=!![];_0x5a6a2e[_0x0b2b('0x8e')]=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x5a6a2e[_0x0b2b('0x85')]=moment()[_0x0b2b('0x47')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0x0b2b('0x4b')](_0x0b2b('0xa7'),_0x121717[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x5a6a2e,{'showHidden':![],'depth':null}));ami[_0x0b2b('0x45')](_0x0b2b('0xa8'),_0x5a6a2e);break;default:_0x5a6a2e['queuecallerexit']=!![];_0x5a6a2e['queuecallerexitAt']=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0x5a6a2e[_0x0b2b('0x85')]=moment()['format'](_0x0b2b('0x80'));}_0x5a6a2e['queuecallerabandon']=![];_0x5a6a2e[_0x0b2b('0x7f')]=null;_0x5a6a2e[_0x0b2b('0x4e')]=_0x121717[_0x0b2b('0xa2')];this['channels'][_0x121717['uniqueid']]=_0x5a6a2e;this['emitVoiceQueueChannelRemove'](_0x5a6a2e,_0x0b2b('0x21'));}else if(this[_0x0b2b('0x55')](_0x121717[_0x0b2b('0xa3')])&&this[_0x0b2b('0x55')](_0x121717[_0x0b2b('0xa3')]['queueposition'])){if(!_0x5a6a2e[_0x0b2b('0x1c')]){_0x5a6a2e[_0x0b2b('0x32')]=!![];_0x5a6a2e[_0x0b2b('0x8e')]=moment()['format'](_0x0b2b('0x80'));_0x5a6a2e[_0x0b2b('0x4e')]='EXITWITHKEY';_0x5a6a2e[_0x0b2b('0x85')]=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));this[_0x0b2b('0x35')][_0x121717[_0x0b2b('0x4d')]]=_0x5a6a2e;}}logger[_0x0b2b('0x77')]('[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s',_0x121717['uniqueid'],_0x5a6a2e[_0x0b2b('0x49')],_0x5a6a2e[_0x0b2b('0x66')],_[_0x0b2b('0xa1')](_0x121717['variable'])[0x0],_0x121717[_0x0b2b('0xa2')]);_0x5a6a2e[_0x0b2b('0x16')]=this[_0x0b2b('0x16')][_0x121717[_0x0b2b('0x4d')]];}}}}catch(_0x3547f0){logger[_0x0b2b('0x3d')](_0x0b2b('0xa9'),_0x121717[_0x0b2b('0x4d')],util['inspect'](_0x3547f0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0xa0')]=function(_0x362ce2,_0x573112,_0x3d4e76){var _0x2d6f52=[_0x0b2b('0xaa'),_0x0b2b('0xab'),_0x0b2b('0xac'),'rtpaudioqosjitterbridged',_0x0b2b('0xad'),_0x0b2b('0xae'),_0x0b2b('0xaf'),'rtpaudioqosrttbridged',_0x0b2b('0xb0'),_0x0b2b('0xb1'),_0x0b2b('0xb2'),_0x0b2b('0xb3'),'membercalls','memberdynamic',_0x0b2b('0xb4'),_0x0b2b('0xb5'),_0x0b2b('0xb6'),_0x0b2b('0xb7'),'memberrealtime'];if(!_[_0x0b2b('0xb8')](_0x573112)&&!_[_0x0b2b('0xb9')](_0x2d6f52,_0x573112)){if(_[_0x0b2b('0x56')](this[_0x0b2b('0x16')][_0x362ce2])){this[_0x0b2b('0x16')][_0x362ce2]={};}this[_0x0b2b('0x16')][_0x362ce2][_0x573112]=_0x3d4e76;}};VoiceQueueReport['prototype']['handleHangup']=function(_0x2e8149,_0x4ce2a5,_0x3e299f){try{var _0xe9ddb={};if(this[_0x0b2b('0xf')][_0x2e8149]){for(var _0x2aab18=0x0;_0x2aab18<this[_0x0b2b('0xf')][_0x2e8149][_0x0b2b('0xba')];_0x2aab18+=0x1){_0xe9ddb=this['queueReports'][_0x2e8149][_0x2aab18];var _0x2674dd=this[_0x0b2b('0x13')][_0xe9ddb['queue']];if(_0x2674dd){_0x2674dd[_0x0b2b('0xbb')]+=moment(_0xe9ddb['queuecallerleaveAt'])[_0x0b2b('0xbc')](_0xe9ddb[_0x0b2b('0x74')],'seconds')||0x0;if(_0x3e299f&&_0xe9ddb['queuecallerexitreason']===_0x0b2b('0x4f')){_0xe9ddb['queuecallerexitreason']='COMPLETEDBYAGENT';}if(_0x2aab18===this[_0x0b2b('0xf')][_0x2e8149][_0x0b2b('0xba')]-0x1){_0x2674dd[_0x0b2b('0xbd')]+=moment()['milliseconds'](0x0)[_0x0b2b('0xbc')](_0xe9ddb[_0x0b2b('0x74')],_0x0b2b('0xbe'));if(hasCallerLeftTheQueue(_0xe9ddb)&&_0xe9ddb[_0x0b2b('0x4e')]!==_0x0b2b('0x4f')){_0x2674dd[_0x0b2b('0xbf')]+=0x1;}if(_0xe9ddb[_0x0b2b('0x33')]){_0x2674dd[_0x0b2b('0xc0')]+=0x1;_0x2674dd[_0x0b2b('0xc1')]+=moment()['milliseconds'](0x0)['diff'](_0xe9ddb[_0x0b2b('0x85')],'seconds');_0xe9ddb['queuecallercompleteAt']=moment()[_0x0b2b('0x47')](_0x0b2b('0x80'));_0xe9ddb[_0x0b2b('0x32')]=![];_0xe9ddb[_0x0b2b('0x8e')]=null;}if(_0xe9ddb['queuecallerexit']&&_0xe9ddb['transfer']!=!![]){_0x2674dd[_0x0b2b('0xc2')]+=0x1;_0xe9ddb[_0x0b2b('0xa6')]=_0x0b2b('0xc2');logger[_0x0b2b('0x4b')](_0x0b2b('0xc3'),_0x2e8149,util[_0x0b2b('0x3c')](_0xe9ddb,{'showHidden':![],'depth':null}));ami['emit'](_0x0b2b('0xc4'),_0xe9ddb);}if(_0xe9ddb['queuecallerabandon']){_0x2674dd[_0x0b2b('0xc5')]+=0x1;_0xe9ddb[_0x0b2b('0xa6')]=_0x0b2b('0xc5');logger[_0x0b2b('0x4b')]('[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:',_0x2e8149,util[_0x0b2b('0x3c')](_0xe9ddb,{'showHidden':![],'depth':null}));ami['emit'](_0x0b2b('0xc6'),_0xe9ddb);}}else{_0x2674dd[_0x0b2b('0xbd')]+=_0x2674dd[_0x0b2b('0xbb')];}logger[_0x0b2b('0x77')](_0x0b2b('0xc7'),_0x2e8149,_0xe9ddb[_0x0b2b('0x49')],_0xe9ddb[_0x0b2b('0x66')],_0x4ce2a5);this['channels'][_0x2e8149]=_0xe9ddb;Object[_0x0b2b('0x64')](this['voiceQueues'][_0xe9ddb[_0x0b2b('0x49')]],_0x2674dd);if(_0xe9ddb['queuecallerleaveAt']){this[_0x0b2b('0x43')](_0xe9ddb,_0x0b2b('0x23'));}}}logger[_0x0b2b('0x4b')](_0x0b2b('0xc8'),_0x2e8149,util['inspect'](this[_0x0b2b('0xf')][_0x2e8149],{'showHidden':![],'depth':null}));if(hasCallerLeftTheQueue(_0xe9ddb)&&_0xe9ddb[_0x0b2b('0x4e')]!==_0x0b2b('0x4f')){ami[_0x0b2b('0x45')](_0x0b2b('0xc9'),this[_0x0b2b('0xf')][_0x2e8149]);if(this[_0x0b2b('0xf')][_0x2e8149]){delete this['queueReports'][_0x2e8149];}if(this[_0x0b2b('0x35')][_0x2e8149]){delete this[_0x0b2b('0x35')][_0x2e8149];}if(this[_0x0b2b('0x16')][_0x2e8149]){delete this[_0x0b2b('0x16')][_0x2e8149];}}}}catch(_0x5d5eb2){logger[_0x0b2b('0x3d')](_0x0b2b('0xca'),_0x2e8149,util[_0x0b2b('0x3c')](_0x5d5eb2,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x24')]=function(_0x5873af){try{if(this[_0x0b2b('0x55')](_0x5873af)){logger[_0x0b2b('0x4b')](_0x0b2b('0xcb'),_0x5873af[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x5873af,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x5873af[_0x0b2b('0x4d')]]){return this[_0x0b2b('0xcc')](_0x5873af['uniqueid'],_0x5873af[_0x0b2b('0xcd')],![]);}if(this[_0x0b2b('0xf')][_0x5873af[_0x0b2b('0x96')]]){if(_0x5873af[_0x0b2b('0xce')]==='21'){return;}return this[_0x0b2b('0xcc')](_0x5873af[_0x0b2b('0x96')],_0x5873af[_0x0b2b('0xcd')],!![]);}var _0xdfdebc=Object[_0x0b2b('0xa1')](this[_0x0b2b('0xf')]);for(var _0x10e86a=0x0;_0x10e86a<_0xdfdebc[_0x0b2b('0xba')];_0x10e86a++){var _0x2150ae=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0xdfdebc[_0x10e86a]]);if(_0x2150ae&&_0x2150ae[_0x0b2b('0xcf')]===_0x5873af['uniqueid']){return this['handleHangup'](_0x2150ae[_0x0b2b('0x4d')],_0x5873af['cause-txt'],!![]);}}if(!this[_0x0b2b('0xf')][_0x5873af[_0x0b2b('0x4d')]]){logger[_0x0b2b('0x4b')](_0x0b2b('0xd0'),_0x5873af[_0x0b2b('0x4d')]);if(this[_0x0b2b('0x35')][_0x5873af[_0x0b2b('0x4d')]]){delete this[_0x0b2b('0x35')][_0x5873af['uniqueid']];}if(this[_0x0b2b('0x16')][_0x5873af[_0x0b2b('0x4d')]]){delete this['variables'][_0x5873af[_0x0b2b('0x4d')]];}}}}catch(_0x313638){logger['error']('[%s][voiceQueueReport][hangup]',_0x5873af['uniqueid'],util[_0x0b2b('0x3c')](_0x313638,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')]['syncAttendedTransfer']=function(_0x3c22cb){try{if(this[_0x0b2b('0x55')](_0x3c22cb)){logger['debug'](_0x0b2b('0xd1'),_0x3c22cb['uniqueid'],util[_0x0b2b('0x3c')](_0x3c22cb,{'showHidden':![],'depth':null}));var _0x164a13;var _0x558ecc;var _0x43499f;if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd2')]]){_0x164a13=_['last'](this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd2')]]);_0x164a13[_0x0b2b('0x9a')]=_0x3c22cb['secondtransfererexten'];_0x164a13[_0x0b2b('0x9c')]=_0x3c22cb[_0x0b2b('0xd3')];_0x164a13[_0x0b2b('0x4e')]=_0x0b2b('0x4f');_0x164a13[_0x0b2b('0x8f')]=!![];_0x164a13[_0x0b2b('0x98')]='ATTENDED';if(this['queueReports'][_0x3c22cb[_0x0b2b('0xd3')]]){_0x43499f=this[_0x0b2b('0xf')][_0x3c22cb['secondtransfereruniqueid']];this['queueReports'][_0x3c22cb[_0x0b2b('0xd3')]]=this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd2')]];this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd2')]]=_0x43499f;_0x558ecc=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x3c22cb['transfereeuniqueid']]);_0x558ecc[_0x0b2b('0xd4')]=!![];}logger[_0x0b2b('0x77')](_0x0b2b('0xd5'),_0x3c22cb['uniqueid'],_0x164a13[_0x0b2b('0x49')],_0x164a13['type'],_0x164a13[_0x0b2b('0x9a')],_0x164a13[_0x0b2b('0x9c')]);}else if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd6')]]){_0x164a13=_['last'](this[_0x0b2b('0xf')][_0x3c22cb['transfertargetuniqueid']]);_0x164a13[_0x0b2b('0x9a')]=_0x3c22cb[_0x0b2b('0xd7')];_0x164a13[_0x0b2b('0x9c')]=_0x3c22cb['origtransfereruniqueid'];_0x164a13[_0x0b2b('0x4e')]=_0x0b2b('0x4f');_0x164a13['transfer']=!![];_0x164a13[_0x0b2b('0x98')]=_0x0b2b('0xd8');if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd9')]]){_0x43499f=this['queueReports'][_0x3c22cb['origtransfereruniqueid']];this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd9')]]=this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd6')]];this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd6')]]=_0x43499f;_0x558ecc=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd6')]]);_0x558ecc[_0x0b2b('0xd4')]=!![];}logger['info'](_0x0b2b('0xd5'),_0x3c22cb[_0x0b2b('0x4d')],_0x164a13[_0x0b2b('0x49')],_0x164a13[_0x0b2b('0x66')],_0x164a13[_0x0b2b('0x9a')],_0x164a13[_0x0b2b('0x9c')]);}else if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd9')]]){_0x164a13=_[_0x0b2b('0x7b')](this['queueReports'][_0x3c22cb['origtransfereruniqueid']]);_0x164a13[_0x0b2b('0x9a')]=_0x3c22cb['origtransfererexten'];_0x164a13[_0x0b2b('0x9c')]=_0x3c22cb[_0x0b2b('0xd9')];_0x164a13[_0x0b2b('0x4e')]='ATTENDEDTRANSFER';_0x164a13['transfer']=!![];_0x164a13[_0x0b2b('0x98')]='ATTENDED';_0x164a13[_0x0b2b('0xd4')]=!![];_0x164a13[_0x0b2b('0xcf')]=_0x3c22cb[_0x0b2b('0xd2')];}else if(this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd3')]]){_0x164a13=_['last'](this[_0x0b2b('0xf')][_0x3c22cb[_0x0b2b('0xd3')]]);_0x164a13[_0x0b2b('0x9a')]=_0x3c22cb['secondtransfererexten'];_0x164a13[_0x0b2b('0x9c')]=_0x3c22cb[_0x0b2b('0xd3')];_0x164a13[_0x0b2b('0x4e')]=_0x0b2b('0x4f');_0x164a13[_0x0b2b('0x8f')]=!![];_0x164a13[_0x0b2b('0x98')]=_0x0b2b('0xd8');_0x164a13['switch']=!![];_0x164a13[_0x0b2b('0xcf')]=_0x3c22cb[_0x0b2b('0xd6')];}}}catch(_0x4153d3){logger[_0x0b2b('0x3d')](_0x0b2b('0xd1'),_0x3c22cb[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x4153d3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x2c')]=function(_0x6d8e7b){try{if(this['isNotNull'](_0x6d8e7b)){logger[_0x0b2b('0x4b')](_0x0b2b('0xda'),_0x6d8e7b['uniqueid'],util[_0x0b2b('0x3c')](_0x6d8e7b,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x6d8e7b[_0x0b2b('0xd2')]]){var _0x2c7bf4=_['last'](this[_0x0b2b('0xf')][_0x6d8e7b[_0x0b2b('0xd2')]]);_0x2c7bf4[_0x0b2b('0x4e')]=_0x0b2b('0xdb');_0x2c7bf4[_0x0b2b('0x8f')]=!![];_0x2c7bf4[_0x0b2b('0x98')]=_0x0b2b('0xdc');_0x2c7bf4['transferexten']=_0x6d8e7b[_0x0b2b('0xdd')];_0x2c7bf4[_0x0b2b('0x9c')]=_0x6d8e7b['transfereeuniqueid'];logger['info'](_0x0b2b('0xde'),_0x6d8e7b[_0x0b2b('0x4d')],_0x2c7bf4[_0x0b2b('0x49')],_0x2c7bf4[_0x0b2b('0x66')],_0x2c7bf4[_0x0b2b('0x9a')],_0x2c7bf4[_0x0b2b('0x9c')]);this[_0x0b2b('0x24')]({'event':_0x0b2b('0xdf'),'uniqueid':_0x6d8e7b[_0x0b2b('0xd2')],'context':_0x6d8e7b[_0x0b2b('0xe0')],'channel':_0x6d8e7b[_0x0b2b('0xe1')]});}}}catch(_0x3a1b1d){logger[_0x0b2b('0x3d')](_0x0b2b('0xda'),_0x6d8e7b['uniqueid'],util['inspect'](_0x3a1b1d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncMusicOnHoldStart']=function(_0x5a1ab9){try{if(this[_0x0b2b('0x55')](_0x5a1ab9)){logger[_0x0b2b('0x4b')](_0x0b2b('0xe2'),_0x5a1ab9[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x5a1ab9,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x5a1ab9[_0x0b2b('0x4d')]]){var _0x50f3d1=_[_0x0b2b('0x7b')](this[_0x0b2b('0xf')][_0x5a1ab9[_0x0b2b('0x4d')]]);if(!_[_0x0b2b('0xb8')](_0x50f3d1[_0x0b2b('0x85')])){_0x50f3d1[_0x0b2b('0xe3')]=moment()['format'](_0x0b2b('0x80'));logger['info'](_0x0b2b('0xe4'),_0x5a1ab9[_0x0b2b('0x4d')],_0x50f3d1[_0x0b2b('0xe3')]);}}}}catch(_0x570436){logger['error'](_0x0b2b('0xe2'),_0x5a1ab9[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x570436,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x0b2b('0xa')][_0x0b2b('0x28')]=function(_0x309d39){try{if(this[_0x0b2b('0x55')](_0x309d39)){logger['debug'](_0x0b2b('0xe5'),_0x309d39[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x309d39,{'showHidden':![],'depth':null}));if(this[_0x0b2b('0xf')][_0x309d39[_0x0b2b('0x4d')]]){var _0x42250d=_['last'](this[_0x0b2b('0xf')][_0x309d39['uniqueid']]);if(!_[_0x0b2b('0xb8')](_0x42250d[_0x0b2b('0xe3')])){_0x42250d[_0x0b2b('0xe6')]+=moment()[_0x0b2b('0xe7')](0x0)[_0x0b2b('0xbc')](_0x42250d[_0x0b2b('0xe3')],_0x0b2b('0xbe'));logger[_0x0b2b('0x77')]('[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s',_0x309d39[_0x0b2b('0x4d')],_0x42250d[_0x0b2b('0xe6')]);delete _0x42250d['mohstarttime'];}}}}catch(_0x174ddf){logger[_0x0b2b('0x3d')]('[%s][voiceQueueReport][musiconholdstop]',_0x309d39[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x174ddf,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x0b2b('0xe8')]=function(_0x56af54){try{if(this['isNotNull'](_0x56af54)){logger[_0x0b2b('0x4b')](_0x0b2b('0xe9'),_0x56af54[_0x0b2b('0x4d')],util[_0x0b2b('0x3c')](_0x56af54,{'showHidden':![],'depth':null}));if(_0x56af54[_0x0b2b('0xea')]['toLowerCase']()===_0x0b2b('0xeb')){_0x56af54[_0x0b2b('0xec')]=_0x56af54[_0x0b2b('0xed')]&&_0x56af54[_0x0b2b('0xed')][_0x0b2b('0x93')](_0x0b2b('0xee'))?_0x56af54[_0x0b2b('0xed')]:(_0x56af54[_0x0b2b('0xed')]||_0x56af54[_0x0b2b('0xec')])[_0x0b2b('0x94')]();if(_[_0x0b2b('0x93')](_0x56af54['applicationdata'][_0x0b2b('0x94')](),_0x0b2b('0xef'))){logger[_0x0b2b('0x77')]('[%s][voiceQueueReport][newexten]\x20application:%s\x20appdata:%s',_0x56af54['uniqueid'],_0x56af54[_0x0b2b('0xea')],_0x56af54[_0x0b2b('0xec')]);if(_[_0x0b2b('0x56')](this['channels'][_0x56af54[_0x0b2b('0x4d')]]))this[_0x0b2b('0x35')][_0x56af54[_0x0b2b('0x4d')]]={};var _0x1c134d=_0x56af54[_0x0b2b('0xec')][_0x0b2b('0xf0')]('=');var _0xc6ed53=_0x1c134d[0x0][_0x0b2b('0x94')]()[_0x0b2b('0xf1')](/cdr\((.*)\)/);if(_0xc6ed53)this[_0x0b2b('0x35')][_0x56af54[_0x0b2b('0x4d')]][_0xc6ed53[0x1]]=_0x1c134d[0x1];}}}}catch(_0xf62ade){logger['error']('[%s][voiceQueueReport][newexten]',_0x56af54['uniqueid'],util['inspect'](_0xf62ade,{'showHidden':![],'depth':null}));}};module[_0x0b2b('0xf2')]=VoiceQueueReport;
\ No newline at end of file