Built motion from commit f651e4b0a7312c0adceb5e57d6684a801a3aaf0d. Version 3.0.0...
[motion-next.git] / server / services / ami / acw / index.js
index 1477264..12ab02f 100644 (file)
@@ -1 +1 @@
-const a1049_0x1a43=['../rpc/voiceAgentReport','catch','hangup','then','[%s][BLINDTRANSFER:LINKEDID]','timers','update','uniqueid','stopAcw','custom:agentConnectPreview','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isUndefined','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','QueuePause','syncAttendedTransfer','voicePause','linkedid','[ACW][syncHangup]\x20%s','timer','queue','prototype','transfereruniqueid','attendedtransfer','[%s][UPDATE][ACWTIME:%s]','transfererlinkedid','[%s][HANGUP:LINKEDID]','syncAgentConnectPreview','isNil','bind','syncBlindTransfer','acwTimeout','syncHangup','attended','lodash','[%s][BLINDTRANSFER:UNIQUEID]','exports','syncAgentConnect','saveUnpause','transfereeuniqueid','[%s][HANGUP:UNIQUEID]','name','lastPauseAt','agents','finally','hanguprequest','agentringnoanswer','blindtransfer','[ACW][syncBlindTransfer]\x20%s','startAcw','transfertargetuniqueid','YYYY-MM-DD\x20HH:mm:ss','Auto-Pause','../ami','[ACW][syncAgentConnectPreview]\x20%s','channels','milliseconds','[%s][START][AGENT:%s][QUEUE:%s]','voiceQueues','[%s][UPDATE][ERRORS:%s]','syncHangupRequest','destlinkedid','info','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','origtransfereruniqueid','message','all','Action','../rpc/user','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','secondtransfereruniqueid','error','stringify','mandatoryDisposition','interface','savePause','updateAcw','seconds','moment','diff','acw'];(function(_0x264077,_0x1a43e6){const _0x5dce97=function(_0x44b3b9){while(--_0x44b3b9){_0x264077['push'](_0x264077['shift']());}};_0x5dce97(++_0x1a43e6);}(a1049_0x1a43,0x191));const a1049_0x5dce=function(_0x264077,_0x1a43e6){_0x264077=_0x264077-0x0;let _0x5dce97=a1049_0x1a43[_0x264077];return _0x5dce97;};const _0x374152=a1049_0x5dce;'use strict';const _=require(_0x374152('0x20')),moment=require(_0x374152('0x4c')),ami=require(_0x374152('0x33')),logger=require('../../../config/logger')(_0x374152('0x4e')),RpcUser=require(_0x374152('0x42')),RpcVoiceAgentReport=require(_0x374152('0x4f'));function Acw(_0x44b3b9){const _0x2acf06=_0x374152;this[_0x2acf06('0x38')]=_0x44b3b9[_0x2acf06('0x38')],this[_0x2acf06('0x29')]=_0x44b3b9[_0x2acf06('0x29')],this[_0x2acf06('0x4')]=_0x44b3b9[_0x2acf06('0x4')],this[_0x2acf06('0x35')]={},ami['on']('agentconnect',this[_0x2acf06('0x23')][_0x2acf06('0x1b')](this)),ami['on'](_0x2acf06('0x2b'),this[_0x2acf06('0x3a')][_0x2acf06('0x1b')](this)),ami['on'](_0x2acf06('0x1'),this[_0x2acf06('0x1e')][_0x2acf06('0x1b')](this)),ami['on'](_0x2acf06('0x2c'),this['syncAgentRingNoAnswer'][_0x2acf06('0x1b')](this)),ami['on'](_0x2acf06('0x15'),this[_0x2acf06('0xd')]['bind'](this)),ami['on'](_0x2acf06('0x2d'),this[_0x2acf06('0x1c')]['bind'](this)),ami['on'](_0x2acf06('0x8'),this[_0x2acf06('0x19')][_0x2acf06('0x1b')](this));}function getDiff(_0x467211){const _0x23b988=_0x374152,_0xa2dfbd=moment()[_0x23b988('0x36')](0x0),_0x21877b=moment(_0x467211)[_0x23b988('0x36')](0x0);return _0xa2dfbd[_0x23b988('0x4d')](_0x21877b,_0x23b988('0x4b'));}Acw[_0x374152('0x13')][_0x374152('0x2f')]=function(_0x3a4ef3){const _0x2cae98=_0x374152;try{const _0x405047=this,_0x2a8933=this[_0x2cae98('0x35')][_0x3a4ef3]['interface'],_0x57a47a=this[_0x2cae98('0x35')][_0x3a4ef3]['queue'],_0x54f653=this[_0x2cae98('0x38')][_0x57a47a];let _0xc50dfc=![],_0x5f45cb='ACW';_0x54f653[_0x2cae98('0x47')]&&(_0x54f653['mandatoryDispositionPause'][_0x2cae98('0x27')]&&(_0xc50dfc=!![],_0x5f45cb=_0x54f653['mandatoryDispositionPause']['name'])),ami[_0x2cae98('0x41')]({'action':_0x2cae98('0xc'),'interface':_0x2a8933,'paused':!![],'reason':_0x5f45cb})[_0x2cae98('0x2')](function(){const _0x17fd53=_0x2cae98;if(_0x405047['agents'][_0x2a8933])return RpcUser['getAgent'](_0x405047[_0x17fd53('0x29')][_0x2a8933]['id'])['then'](function(_0x2f809d){const _0x5aa6d8=_0x17fd53;if(_0x2f809d&&!_0x2f809d[_0x5aa6d8('0xe')]){logger['info'](_0x5aa6d8('0x37'),_0x3a4ef3,_0x2a8933,_0x57a47a);const _0x498176=_0x405047[_0x5aa6d8('0x35')][_0x3a4ef3][_0x5aa6d8('0x1f')]&&_0x405047[_0x5aa6d8('0x35')][_0x3a4ef3][_0x5aa6d8('0x3b')]?_0x405047[_0x5aa6d8('0x35')][_0x3a4ef3][_0x5aa6d8('0x3b')]:_0x3a4ef3;return RpcUser[_0x5aa6d8('0x49')](_0x405047[_0x5aa6d8('0x29')][_0x2a8933],_0x5f45cb,_0x498176)[_0x5aa6d8('0x2')](function(){const _0x24309e=_0x5aa6d8;!_0xc50dfc&&(_0x405047[_0x24309e('0x4')][_0x2a8933]={},logger[_0x24309e('0x3c')](_0x24309e('0x43'),_0x3a4ef3,_0x405047[_0x24309e('0x38')][_0x57a47a]['acwTimeout'],_0x2a8933,_0x57a47a),_0x405047[_0x24309e('0x4')][_0x2a8933]['timer']=setTimeout(_0x405047[_0x24309e('0x7')][_0x24309e('0x1b')](_0x405047,_0x2a8933),_0x405047[_0x24309e('0x38')][_0x57a47a][_0x24309e('0x1d')]*0x3e8),_0x405047[_0x24309e('0x4')][_0x2a8933][_0x24309e('0x28')]=moment()['format'](_0x24309e('0x31')),_0x405047[_0x24309e('0x4')][_0x2a8933][_0x24309e('0x6')]=_0x3a4ef3,_0x405047['timers'][_0x2a8933][_0x24309e('0x12')]=_0x57a47a,_0x405047[_0x24309e('0x4')][_0x2a8933][_0x24309e('0x4a')]=function(){const _0x146903=_0x24309e,_0x3728e5=getDiff(_0x405047[_0x146903('0x4')][_0x2a8933][_0x146903('0x28')]);clearTimeout(_0x405047['timers'][_0x2a8933][_0x146903('0x11')]),_0x405047['timers'][_0x2a8933][_0x146903('0x11')]=![],RpcVoiceAgentReport[_0x146903('0x5')]({'acwtime':_0x3728e5},_0x405047[_0x146903('0x4')][_0x2a8933][_0x146903('0x6')],_0x2a8933)[_0x146903('0x2')](function(_0x3738b7){const _0x41738e=_0x146903;logger[_0x41738e('0x3c')](_0x41738e('0x16'),_0x3a4ef3,_0x3728e5,_0x3738b7);})['catch'](function(_0xecddb8){const _0x286c7e=_0x146903;logger['error'](_0x286c7e('0x39'),_0x3a4ef3,_0xecddb8);}),delete _0x405047['timers'][_0x2a8933];});});}else logger[_0x5aa6d8('0x3c')](_0x5aa6d8('0x3d'),_0x3a4ef3,_0x2a8933,_0x57a47a);});})['catch'](function(){const _0x5b0327=_0x2cae98;logger[_0x5b0327('0x45')](_0x5b0327('0x43'),_0x3a4ef3,_0x405047[_0x5b0327('0x38')][_0x57a47a][_0x5b0327('0x1d')],_0x2a8933,_0x57a47a);})[_0x2cae98('0x2a')](function(){const _0x15cb3a=_0x2cae98;delete _0x405047[_0x15cb3a('0x35')][_0x3a4ef3];});}catch(_0x41cddd){logger[_0x2cae98('0x45')]('[ACW][START]\x20%s',_0x41cddd['message']);}},Acw['prototype']['stopAcw']=function(_0x482fa0){const _0x424858=_0x374152;try{const _0x317e7b=this;if(_0x317e7b[_0x424858('0x4')][_0x482fa0]){_0x317e7b[_0x424858('0x4')][_0x482fa0][_0x424858('0x11')]=![];const _0x31d560=_0x317e7b['timers'][_0x482fa0]['uniqueid'],_0x3377c5=_0x317e7b['timers'][_0x482fa0][_0x424858('0x12')],_0x2cea2a=_0x317e7b[_0x424858('0x38')][_0x3377c5][_0x424858('0x1d')];logger[_0x424858('0x3c')]('[TIMER][STOP][AGENT:%s]',_0x482fa0),RpcUser[_0x424858('0x24')](this['agents'][_0x482fa0]),RpcVoiceAgentReport[_0x424858('0x5')]({'acwtime':_0x2cea2a,'agentacw':!![]},_0x31d560,_0x482fa0)[_0x424858('0x2')](function(_0xe19567){const _0x41c26a=_0x424858;logger[_0x41c26a('0x3c')](_0x41c26a('0x16'),_0x31d560,_0x2cea2a,_0xe19567);})[_0x424858('0x0')](function(_0x1a0a83){const _0x4d534f=_0x424858;logger[_0x4d534f('0x45')](_0x4d534f('0x39'),_0x31d560,_0x1a0a83);});}else logger[_0x424858('0x45')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x482fa0),_0x317e7b['timers']&&logger[_0x424858('0x3c')]('[ACW][TIMERS]',JSON[_0x424858('0x46')](_0x317e7b[_0x424858('0x4')]));}catch(_0x358bd1){logger[_0x424858('0x45')]('[ACW][STOP]\x20%s',_0x358bd1[_0x424858('0x3f')]);}},Acw['prototype'][_0x374152('0x23')]=function(_0x461693){const _0xf6216f=_0x374152;try{this[_0xf6216f('0x38')][_0x461693['queue']]&&(this[_0xf6216f('0x38')][_0x461693[_0xf6216f('0x12')]]['acw']||this[_0xf6216f('0x38')][_0x461693[_0xf6216f('0x12')]][_0xf6216f('0x47')])&&(this[_0xf6216f('0x29')][_0x461693[_0xf6216f('0x48')]]&&(this['channels'][_0x461693['uniqueid']]={'queue':_0x461693[_0xf6216f('0x12')],'interface':_0x461693[_0xf6216f('0x48')],'destlinkedid':_0x461693[_0xf6216f('0x3b')]}));}catch(_0x49c0a9){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x49c0a9[_0xf6216f('0x3f')]);}},Acw['prototype'][_0x374152('0x19')]=function(_0x1d8149){const _0x39f546=_0x374152;try{this[_0x39f546('0x38')][_0x1d8149[_0x39f546('0x12')]]&&(this['voiceQueues'][_0x1d8149[_0x39f546('0x12')]][_0x39f546('0x4e')]||this[_0x39f546('0x38')][_0x1d8149[_0x39f546('0x12')]][_0x39f546('0x47')])&&(this[_0x39f546('0x29')][_0x1d8149['interface']]&&(this[_0x39f546('0x35')][_0x1d8149[_0x39f546('0x6')]]={'queue':_0x1d8149[_0x39f546('0x12')],'interface':_0x1d8149['interface']}));}catch(_0x567e9f){logger[_0x39f546('0x45')](_0x39f546('0x34'),_0x567e9f['message']);}},Acw[_0x374152('0x13')][_0x374152('0x3a')]=function(_0x558446){const _0x29466f=_0x374152;try{if(this['channels'][_0x558446[_0x29466f('0x6')]]&&_['isUndefined'](this[_0x29466f('0x35')][_0x558446['uniqueid']][_0x29466f('0x1f')]))logger[_0x29466f('0x3c')](_0x29466f('0x26'),_0x558446[_0x29466f('0x6')]),this[_0x29466f('0x2f')](_0x558446[_0x29466f('0x6')]);else this[_0x29466f('0x35')][_0x558446[_0x29466f('0xf')]]&&_[_0x29466f('0xa')](this[_0x29466f('0x35')][_0x558446[_0x29466f('0xf')]][_0x29466f('0x1f')])&&(logger[_0x29466f('0x3c')](_0x29466f('0x18'),_0x558446['linkedid']),this['startAcw'](_0x558446[_0x29466f('0xf')]));}catch(_0x8f854a){logger['error']('[ACW][syncHangupRequest]\x20%s',_0x8f854a['message']);}},Acw[_0x374152('0x13')][_0x374152('0x1e')]=function(_0x2e2ea1){const _0x1dcde5=_0x374152;try{if(this[_0x1dcde5('0x35')][_0x2e2ea1[_0x1dcde5('0x6')]]&&this[_0x1dcde5('0x35')][_0x2e2ea1[_0x1dcde5('0x6')]]['attended'])logger['info'](_0x1dcde5('0x9'),_0x2e2ea1['uniqueid']),this[_0x1dcde5('0x2f')](_0x2e2ea1[_0x1dcde5('0x6')]);else this[_0x1dcde5('0x35')][_0x2e2ea1[_0x1dcde5('0xf')]]&&this[_0x1dcde5('0x35')][_0x2e2ea1[_0x1dcde5('0xf')]]['attended']&&(logger[_0x1dcde5('0x3c')](_0x1dcde5('0xb'),_0x2e2ea1[_0x1dcde5('0xf')]),this['startAcw'](_0x2e2ea1['linkedid']));}catch(_0x1eafc0){logger[_0x1dcde5('0x45')](_0x1dcde5('0x10'),_0x1eafc0[_0x1dcde5('0x3f')]);}},Acw['prototype'][_0x374152('0xd')]=function(_0x2ade9a){const _0x2ff998=_0x374152;try{if(!_[_0x2ff998('0x1a')](this[_0x2ff998('0x35')][_0x2ade9a['transfereeuniqueid']]))this[_0x2ff998('0x2f')](_0x2ade9a[_0x2ff998('0x25')]),this[_0x2ff998('0x35')][_0x2ade9a[_0x2ff998('0x44')]]&&(this[_0x2ff998('0x35')][_0x2ade9a['secondtransfereruniqueid']][_0x2ff998('0x1f')]=!![],this[_0x2ff998('0x35')][_0x2ade9a[_0x2ff998('0x30')]]=this[_0x2ff998('0x35')][_0x2ade9a[_0x2ff998('0x44')]],delete this[_0x2ff998('0x35')][_0x2ade9a[_0x2ff998('0x44')]]);else!_[_0x2ff998('0x1a')](this[_0x2ff998('0x35')][_0x2ade9a['transfertargetuniqueid']])&&(this['startAcw'](_0x2ade9a[_0x2ff998('0x30')]),this[_0x2ff998('0x35')][_0x2ade9a['origtransfereruniqueid']]&&(this['channels'][_0x2ade9a[_0x2ff998('0x3e')]][_0x2ff998('0x1f')]=!![],this['channels'][_0x2ade9a[_0x2ff998('0x25')]]=this['channels'][_0x2ade9a[_0x2ff998('0x3e')]],delete this[_0x2ff998('0x35')][_0x2ade9a[_0x2ff998('0x3e')]]));}catch(_0x5a62e0){logger[_0x2ff998('0x45')]('[ACW][syncAttendedTransfer]\x20%s',_0x5a62e0[_0x2ff998('0x3f')]);}},Acw[_0x374152('0x13')][_0x374152('0x1c')]=function(_0x432fb9){const _0xb88c85=_0x374152;try{if(this[_0xb88c85('0x35')][_0x432fb9[_0xb88c85('0x14')]])logger[_0xb88c85('0x3c')](_0xb88c85('0x21'),JSON['stringify'](_0x432fb9['transfereruniqueid'])),this[_0xb88c85('0x2f')](_0x432fb9[_0xb88c85('0x14')]);else this[_0xb88c85('0x35')][_0x432fb9[_0xb88c85('0x17')]]&&(logger[_0xb88c85('0x3c')](_0xb88c85('0x3'),JSON['stringify'](_0x432fb9['transfererlinkedid'])),this[_0xb88c85('0x2f')](_0x432fb9[_0xb88c85('0x17')]));}catch(_0x29c423){logger[_0xb88c85('0x45')](_0xb88c85('0x2e'),_0x29c423[_0xb88c85('0x3f')]);}},Acw[_0x374152('0x13')]['syncAgentRingNoAnswer']=function(_0x207afd){const _0x54b92e=_0x374152;try{if(this['voiceQueues'][_0x207afd['queue']]&&this[_0x54b92e('0x38')][_0x207afd[_0x54b92e('0x12')]]['autopause']===_0x54b92e('0x40')){if(this[_0x54b92e('0x29')][_0x207afd[_0x54b92e('0x48')]])return logger[_0x54b92e('0x3c')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x207afd[_0x54b92e('0x6')],_0x207afd[_0x54b92e('0x48')],_0x207afd[_0x54b92e('0x12')]),RpcUser[_0x54b92e('0x49')](this[_0x54b92e('0x29')][_0x207afd['interface']],_0x54b92e('0x32'),_0x207afd['uniqueid']);}}catch(_0x46266c){logger[_0x54b92e('0x45')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x46266c[_0x54b92e('0x3f')]);}},module[_0x374152('0x22')]=Acw;
\ No newline at end of file
+const a1049_0x4aef=['message','timer','attendedtransfer','timers','syncAgentRingNoAnswer','voiceQueues','bind','uniqueid','autopause','then','blindtransfer','[ACW][START]\x20%s','moment','name','isNil','transfertargetuniqueid','../ami','interface','../rpc/voiceAgentReport','syncAgentConnectPreview','stopAcw','updateAcw','exports','[%s][BLINDTRANSFER:LINKEDID]','[ACW][STOP]\x20%s','lastPauseAt','syncAttendedTransfer','startAcw','[%s][START][AGENT:%s][QUEUE:%s]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','../../../config/logger','saveUnpause','attended','all','update','[ACW][syncBlindTransfer]\x20%s','transfererlinkedid','[ACW][syncHangupRequest]\x20%s','[TIMER][STOP][AGENT:%s]','agentringnoanswer','milliseconds','mandatoryDispositionPause','[ACW][syncAgentConnect]\x20%s','transfereeuniqueid','[ACW][syncAgentRingNoAnswer]\x20%s','[%s][HANGUP:LINKEDID]','getAgent','[ACW][syncAgentConnectPreview]\x20%s','format','[%s][UPDATE][ACWTIME:%s]','syncHangupRequest','acwTimeout','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','queue','acw','ACW','seconds','agents','catch','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','hanguprequest','secondtransfereruniqueid','syncAgentConnect','transfereruniqueid','info','stringify','isUndefined','QueuePause','channels','../rpc/user','syncHangup','prototype','[ACW][TIMERS]','diff','mandatoryDisposition','[ACW][syncAttendedTransfer]\x20%s','lodash','voicePause','destlinkedid','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','Auto-Pause','syncBlindTransfer','[ACW][syncHangup]\x20%s','[%s][HANGUP:UNIQUEID]','origtransfereruniqueid','savePause','Action','YYYY-MM-DD\x20HH:mm:ss','finally','linkedid','error'];(function(_0x1d9776,_0x4aef07){const _0x338dbc=function(_0x68c6d6){while(--_0x68c6d6){_0x1d9776['push'](_0x1d9776['shift']());}};_0x338dbc(++_0x4aef07);}(a1049_0x4aef,0x73));const a1049_0x338d=function(_0x1d9776,_0x4aef07){_0x1d9776=_0x1d9776-0x0;let _0x338dbc=a1049_0x4aef[_0x1d9776];return _0x338dbc;};const _0x3a3feb=a1049_0x338d;'use strict';const _=require(_0x3a3feb('0x35')),moment=require(_0x3a3feb('0x51')),ami=require(_0x3a3feb('0x55')),logger=require(_0x3a3feb('0x7'))(_0x3a3feb('0x1f')),RpcUser=require(_0x3a3feb('0x2e')),RpcVoiceAgentReport=require(_0x3a3feb('0x57'));function Acw(_0x68c6d6){const _0x45f927=_0x3a3feb;this[_0x45f927('0x4a')]=_0x68c6d6[_0x45f927('0x4a')],this[_0x45f927('0x22')]=_0x68c6d6[_0x45f927('0x22')],this[_0x45f927('0x48')]=_0x68c6d6['timers'],this['channels']={},ami['on']('agentconnect',this[_0x45f927('0x27')][_0x45f927('0x4b')](this)),ami['on'](_0x45f927('0x25'),this[_0x45f927('0x1b')][_0x45f927('0x4b')](this)),ami['on']('hangup',this['syncHangup'][_0x45f927('0x4b')](this)),ami['on'](_0x45f927('0x10'),this[_0x45f927('0x49')]['bind'](this)),ami['on'](_0x45f927('0x47'),this[_0x45f927('0x3')][_0x45f927('0x4b')](this)),ami['on'](_0x45f927('0x4f'),this['syncBlindTransfer'][_0x45f927('0x4b')](this)),ami['on']('custom:agentConnectPreview',this[_0x45f927('0x58')]['bind'](this));}function getDiff(_0x406f17){const _0x479328=_0x3a3feb,_0x58734f=moment()[_0x479328('0x11')](0x0),_0x5b6f57=moment(_0x406f17)[_0x479328('0x11')](0x0);return _0x58734f[_0x479328('0x32')](_0x5b6f57,_0x479328('0x21'));}Acw[_0x3a3feb('0x30')][_0x3a3feb('0x4')]=function(_0x4e6d1f){const _0x4dc9f8=_0x3a3feb;try{const _0x2a9bb8=this,_0x5926e1=this[_0x4dc9f8('0x2d')][_0x4e6d1f][_0x4dc9f8('0x56')],_0x2aaa0=this['channels'][_0x4e6d1f][_0x4dc9f8('0x1e')],_0x52aea2=this[_0x4dc9f8('0x4a')][_0x2aaa0];let _0x215c8a=![],_0x542f34=_0x4dc9f8('0x20');_0x52aea2[_0x4dc9f8('0x33')]&&(_0x52aea2[_0x4dc9f8('0x12')][_0x4dc9f8('0x52')]&&(_0x215c8a=!![],_0x542f34=_0x52aea2['mandatoryDispositionPause'][_0x4dc9f8('0x52')])),ami[_0x4dc9f8('0x40')]({'action':_0x4dc9f8('0x2c'),'interface':_0x5926e1,'paused':!![],'reason':_0x542f34})[_0x4dc9f8('0x4e')](function(){const _0x5f12e6=_0x4dc9f8;if(_0x2a9bb8['agents'][_0x5926e1])return RpcUser[_0x5f12e6('0x17')](_0x2a9bb8[_0x5f12e6('0x22')][_0x5926e1]['id'])[_0x5f12e6('0x4e')](function(_0x5ebb29){const _0x54e7f1=_0x5f12e6;if(_0x5ebb29&&!_0x5ebb29[_0x54e7f1('0x36')]){logger['info'](_0x54e7f1('0x5'),_0x4e6d1f,_0x5926e1,_0x2aaa0);const _0x3546da=_0x2a9bb8['channels'][_0x4e6d1f][_0x54e7f1('0x9')]&&_0x2a9bb8['channels'][_0x4e6d1f][_0x54e7f1('0x37')]?_0x2a9bb8[_0x54e7f1('0x2d')][_0x4e6d1f][_0x54e7f1('0x37')]:_0x4e6d1f;return RpcUser[_0x54e7f1('0x3f')](_0x2a9bb8[_0x54e7f1('0x22')][_0x5926e1],_0x542f34,_0x3546da)[_0x54e7f1('0x4e')](function(){const _0x3296b3=_0x54e7f1;!_0x215c8a&&(_0x2a9bb8[_0x3296b3('0x48')][_0x5926e1]={},logger['info'](_0x3296b3('0x24'),_0x4e6d1f,_0x2a9bb8['voiceQueues'][_0x2aaa0]['acwTimeout'],_0x5926e1,_0x2aaa0),_0x2a9bb8[_0x3296b3('0x48')][_0x5926e1][_0x3296b3('0x46')]=setTimeout(_0x2a9bb8['stopAcw'][_0x3296b3('0x4b')](_0x2a9bb8,_0x5926e1),_0x2a9bb8[_0x3296b3('0x4a')][_0x2aaa0][_0x3296b3('0x1c')]*0x3e8),_0x2a9bb8['timers'][_0x5926e1][_0x3296b3('0x2')]=moment()[_0x3296b3('0x19')](_0x3296b3('0x41')),_0x2a9bb8[_0x3296b3('0x48')][_0x5926e1][_0x3296b3('0x4c')]=_0x4e6d1f,_0x2a9bb8['timers'][_0x5926e1]['queue']=_0x2aaa0,_0x2a9bb8[_0x3296b3('0x48')][_0x5926e1][_0x3296b3('0x5a')]=function(){const _0x4a4612=_0x3296b3,_0x5cf8cd=getDiff(_0x2a9bb8[_0x4a4612('0x48')][_0x5926e1][_0x4a4612('0x2')]);clearTimeout(_0x2a9bb8['timers'][_0x5926e1][_0x4a4612('0x46')]),_0x2a9bb8['timers'][_0x5926e1][_0x4a4612('0x46')]=![],RpcVoiceAgentReport['update']({'acwtime':_0x5cf8cd},_0x2a9bb8[_0x4a4612('0x48')][_0x5926e1][_0x4a4612('0x4c')],_0x5926e1)[_0x4a4612('0x4e')](function(_0x57abfd){const _0xda3a14=_0x4a4612;logger[_0xda3a14('0x29')](_0xda3a14('0x1a'),_0x4e6d1f,_0x5cf8cd,_0x57abfd);})[_0x4a4612('0x23')](function(_0x38a8cf){const _0x59590b=_0x4a4612;logger['error'](_0x59590b('0x38'),_0x4e6d1f,_0x38a8cf);}),delete _0x2a9bb8['timers'][_0x5926e1];});});}else logger['info'](_0x54e7f1('0x39'),_0x4e6d1f,_0x5926e1,_0x2aaa0);});})[_0x4dc9f8('0x23')](function(){const _0x168967=_0x4dc9f8;logger['error'](_0x168967('0x24'),_0x4e6d1f,_0x2a9bb8[_0x168967('0x4a')][_0x2aaa0]['acwTimeout'],_0x5926e1,_0x2aaa0);})[_0x4dc9f8('0x42')](function(){delete _0x2a9bb8['channels'][_0x4e6d1f];});}catch(_0x3367f3){logger[_0x4dc9f8('0x44')](_0x4dc9f8('0x50'),_0x3367f3[_0x4dc9f8('0x45')]);}},Acw[_0x3a3feb('0x30')][_0x3a3feb('0x59')]=function(_0x14b06c){const _0x473e00=_0x3a3feb;try{const _0x5f1c4c=this;if(_0x5f1c4c[_0x473e00('0x48')][_0x14b06c]){_0x5f1c4c[_0x473e00('0x48')][_0x14b06c][_0x473e00('0x46')]=![];const _0x3442f3=_0x5f1c4c[_0x473e00('0x48')][_0x14b06c][_0x473e00('0x4c')],_0x5764d3=_0x5f1c4c[_0x473e00('0x48')][_0x14b06c][_0x473e00('0x1e')],_0x31e92d=_0x5f1c4c[_0x473e00('0x4a')][_0x5764d3][_0x473e00('0x1c')];logger[_0x473e00('0x29')](_0x473e00('0xf'),_0x14b06c),RpcUser[_0x473e00('0x8')](this[_0x473e00('0x22')][_0x14b06c]),RpcVoiceAgentReport[_0x473e00('0xb')]({'acwtime':_0x31e92d,'agentacw':!![]},_0x3442f3,_0x14b06c)[_0x473e00('0x4e')](function(_0x14d358){const _0x1e6597=_0x473e00;logger[_0x1e6597('0x29')](_0x1e6597('0x1a'),_0x3442f3,_0x31e92d,_0x14d358);})[_0x473e00('0x23')](function(_0x20c25f){const _0x701295=_0x473e00;logger[_0x701295('0x44')](_0x701295('0x38'),_0x3442f3,_0x20c25f);});}else logger[_0x473e00('0x44')](_0x473e00('0x1d'),_0x14b06c),_0x5f1c4c[_0x473e00('0x48')]&&logger[_0x473e00('0x29')](_0x473e00('0x31'),JSON['stringify'](_0x5f1c4c['timers']));}catch(_0x41ea42){logger['error'](_0x473e00('0x1'),_0x41ea42[_0x473e00('0x45')]);}},Acw[_0x3a3feb('0x30')][_0x3a3feb('0x27')]=function(_0x3173a1){const _0xadf69d=_0x3a3feb;try{this[_0xadf69d('0x4a')][_0x3173a1[_0xadf69d('0x1e')]]&&(this[_0xadf69d('0x4a')][_0x3173a1['queue']][_0xadf69d('0x1f')]||this[_0xadf69d('0x4a')][_0x3173a1[_0xadf69d('0x1e')]]['mandatoryDisposition'])&&(this[_0xadf69d('0x22')][_0x3173a1[_0xadf69d('0x56')]]&&(this[_0xadf69d('0x2d')][_0x3173a1[_0xadf69d('0x4c')]]={'queue':_0x3173a1[_0xadf69d('0x1e')],'interface':_0x3173a1[_0xadf69d('0x56')],'destlinkedid':_0x3173a1[_0xadf69d('0x37')]}));}catch(_0x486178){logger[_0xadf69d('0x44')](_0xadf69d('0x13'),_0x486178[_0xadf69d('0x45')]);}},Acw['prototype'][_0x3a3feb('0x58')]=function(_0x13646f){const _0x39af6c=_0x3a3feb;try{this[_0x39af6c('0x4a')][_0x13646f[_0x39af6c('0x1e')]]&&(this[_0x39af6c('0x4a')][_0x13646f[_0x39af6c('0x1e')]][_0x39af6c('0x1f')]||this[_0x39af6c('0x4a')][_0x13646f['queue']][_0x39af6c('0x33')])&&(this[_0x39af6c('0x22')][_0x13646f[_0x39af6c('0x56')]]&&(this[_0x39af6c('0x2d')][_0x13646f[_0x39af6c('0x4c')]]={'queue':_0x13646f[_0x39af6c('0x1e')],'interface':_0x13646f['interface']}));}catch(_0x550e52){logger['error'](_0x39af6c('0x18'),_0x550e52[_0x39af6c('0x45')]);}},Acw[_0x3a3feb('0x30')]['syncHangupRequest']=function(_0x5f27c6){const _0x33dc50=_0x3a3feb;try{if(this['channels'][_0x5f27c6[_0x33dc50('0x4c')]]&&_[_0x33dc50('0x2b')](this['channels'][_0x5f27c6['uniqueid']]['attended']))logger[_0x33dc50('0x29')](_0x33dc50('0x3d'),_0x5f27c6[_0x33dc50('0x4c')]),this[_0x33dc50('0x4')](_0x5f27c6[_0x33dc50('0x4c')]);else this[_0x33dc50('0x2d')][_0x5f27c6[_0x33dc50('0x43')]]&&_[_0x33dc50('0x2b')](this[_0x33dc50('0x2d')][_0x5f27c6[_0x33dc50('0x43')]][_0x33dc50('0x9')])&&(logger[_0x33dc50('0x29')](_0x33dc50('0x16'),_0x5f27c6[_0x33dc50('0x43')]),this['startAcw'](_0x5f27c6[_0x33dc50('0x43')]));}catch(_0x151a2a){logger['error'](_0x33dc50('0xe'),_0x151a2a['message']);}},Acw[_0x3a3feb('0x30')][_0x3a3feb('0x2f')]=function(_0x3f90e5){const _0xcfd2d=_0x3a3feb;try{if(this['channels'][_0x3f90e5[_0xcfd2d('0x4c')]]&&this['channels'][_0x3f90e5[_0xcfd2d('0x4c')]][_0xcfd2d('0x9')])logger[_0xcfd2d('0x29')](_0xcfd2d('0x6'),_0x3f90e5['uniqueid']),this[_0xcfd2d('0x4')](_0x3f90e5[_0xcfd2d('0x4c')]);else this[_0xcfd2d('0x2d')][_0x3f90e5[_0xcfd2d('0x43')]]&&this[_0xcfd2d('0x2d')][_0x3f90e5[_0xcfd2d('0x43')]][_0xcfd2d('0x9')]&&(logger[_0xcfd2d('0x29')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x3f90e5['linkedid']),this[_0xcfd2d('0x4')](_0x3f90e5[_0xcfd2d('0x43')]));}catch(_0x2f6edd){logger[_0xcfd2d('0x44')](_0xcfd2d('0x3c'),_0x2f6edd[_0xcfd2d('0x45')]);}},Acw[_0x3a3feb('0x30')][_0x3a3feb('0x3')]=function(_0x33de41){const _0x45c7f4=_0x3a3feb;try{if(!_[_0x45c7f4('0x53')](this['channels'][_0x33de41[_0x45c7f4('0x14')]]))this[_0x45c7f4('0x4')](_0x33de41[_0x45c7f4('0x14')]),this[_0x45c7f4('0x2d')][_0x33de41[_0x45c7f4('0x26')]]&&(this[_0x45c7f4('0x2d')][_0x33de41['secondtransfereruniqueid']][_0x45c7f4('0x9')]=!![],this['channels'][_0x33de41[_0x45c7f4('0x54')]]=this['channels'][_0x33de41[_0x45c7f4('0x26')]],delete this[_0x45c7f4('0x2d')][_0x33de41[_0x45c7f4('0x26')]]);else!_['isNil'](this[_0x45c7f4('0x2d')][_0x33de41[_0x45c7f4('0x54')]])&&(this[_0x45c7f4('0x4')](_0x33de41[_0x45c7f4('0x54')]),this[_0x45c7f4('0x2d')][_0x33de41[_0x45c7f4('0x3e')]]&&(this[_0x45c7f4('0x2d')][_0x33de41[_0x45c7f4('0x3e')]][_0x45c7f4('0x9')]=!![],this['channels'][_0x33de41[_0x45c7f4('0x14')]]=this[_0x45c7f4('0x2d')][_0x33de41[_0x45c7f4('0x3e')]],delete this['channels'][_0x33de41[_0x45c7f4('0x3e')]]));}catch(_0x4200d4){logger['error'](_0x45c7f4('0x34'),_0x4200d4[_0x45c7f4('0x45')]);}},Acw[_0x3a3feb('0x30')][_0x3a3feb('0x3b')]=function(_0x5aea50){const _0x546626=_0x3a3feb;try{if(this[_0x546626('0x2d')][_0x5aea50['transfereruniqueid']])logger[_0x546626('0x29')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x546626('0x2a')](_0x5aea50[_0x546626('0x28')])),this[_0x546626('0x4')](_0x5aea50[_0x546626('0x28')]);else this['channels'][_0x5aea50['transfererlinkedid']]&&(logger[_0x546626('0x29')](_0x546626('0x0'),JSON[_0x546626('0x2a')](_0x5aea50[_0x546626('0xd')])),this[_0x546626('0x4')](_0x5aea50[_0x546626('0xd')]));}catch(_0x1e208c){logger[_0x546626('0x44')](_0x546626('0xc'),_0x1e208c[_0x546626('0x45')]);}},Acw['prototype'][_0x3a3feb('0x49')]=function(_0x1fc105){const _0x1d726b=_0x3a3feb;try{if(this['voiceQueues'][_0x1fc105[_0x1d726b('0x1e')]]&&this[_0x1d726b('0x4a')][_0x1fc105[_0x1d726b('0x1e')]][_0x1d726b('0x4d')]===_0x1d726b('0xa')){if(this[_0x1d726b('0x22')][_0x1fc105[_0x1d726b('0x56')]])return logger[_0x1d726b('0x29')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x1fc105[_0x1d726b('0x4c')],_0x1fc105[_0x1d726b('0x56')],_0x1fc105[_0x1d726b('0x1e')]),RpcUser[_0x1d726b('0x3f')](this[_0x1d726b('0x22')][_0x1fc105['interface']],_0x1d726b('0x3a'),_0x1fc105[_0x1d726b('0x4c')]);}}catch(_0xd8b62b){logger[_0x1d726b('0x44')](_0x1d726b('0x15'),_0xd8b62b[_0x1d726b('0x45')]);}},module[_0x3a3feb('0x5b')]=Acw;
\ No newline at end of file