// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe472=['acw','../rpc/user','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','lastPauseAt','timer','update','info','[%s][UPDATE][ACWTIME:%s]','catch','error','finally','ACW','mandatoryDispositionPause','name','resolve','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','then','available','acwTimeout','stopAcw','format','queue','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','getAgent','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','mandatoryDisposition','interface','[ACW][syncAgentConnect]\x20%s','uniqueid','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','isUndefined','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','syncAttendedTransfer','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','exports','lodash','moment','../ami'];(function(_0x997738,_0x4b8298){var _0x227380=function(_0x11ee71){while(--_0x11ee71){_0x997738['push'](_0x997738['shift']());}};_0x227380(++_0x4b8298);}(_0xe472,0x1a1));var _0x2e47=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe472[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x2e47('0x0'));var moment=require(_0x2e47('0x1'));var ami=require(_0x2e47('0x2'));var logger=require('../../../config/logger')(_0x2e47('0x3'));var RpcUser=require(_0x2e47('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x40abc8){this[_0x2e47('0x5')]=_0x40abc8[_0x2e47('0x5')];this[_0x2e47('0x6')]=_0x40abc8[_0x2e47('0x6')];this['timers']=_0x40abc8[_0x2e47('0x7')];this[_0x2e47('0x8')]={};ami['on']('agentconnect',this[_0x2e47('0x9')][_0x2e47('0xa')](this));ami['on'](_0x2e47('0xb'),this[_0x2e47('0xc')][_0x2e47('0xa')](this));ami['on']('hangup',this[_0x2e47('0xd')][_0x2e47('0xa')](this));ami['on']('agentringnoanswer',this[_0x2e47('0xe')][_0x2e47('0xa')](this));ami['on'](_0x2e47('0xf'),this['syncAttendedTransfer'][_0x2e47('0xa')](this));ami['on'](_0x2e47('0x10'),this[_0x2e47('0x11')]['bind'](this));ami['on'](_0x2e47('0x12'),this[_0x2e47('0x13')]['bind'](this));}function getDiff(_0x8b6c51){var _0x3cc25c=moment()[_0x2e47('0x14')](0x0);var _0xe9124=moment(_0x8b6c51)[_0x2e47('0x14')](0x0);return _0x3cc25c[_0x2e47('0x15')](_0xe9124,_0x2e47('0x16'));}Acw[_0x2e47('0x17')][_0x2e47('0x18')]=function(_0x4356a8,_0x2eca18){var _0x3d6e7c=this;var _0x5cbcf4=getDiff(_0x3d6e7c[_0x2e47('0x7')][_0x4356a8][_0x2e47('0x19')]);clearTimeout(_0x3d6e7c[_0x2e47('0x7')][_0x4356a8][_0x2e47('0x1a')]);_0x3d6e7c[_0x2e47('0x7')][_0x4356a8]['timer']=![];return RpcVoiceAgentReport[_0x2e47('0x1b')]({'acwtime':_0x5cbcf4},_0x3d6e7c[_0x2e47('0x7')][_0x4356a8]['uniqueid'],_0x4356a8)['then'](function(_0xc339bc){logger[_0x2e47('0x1c')](_0x2e47('0x1d'),_0x2eca18,_0x5cbcf4,_0xc339bc);})[_0x2e47('0x1e')](function(_0x376741){logger[_0x2e47('0x1f')]('[%s][UPDATE][ERRORS:%s]',_0x2eca18,_0x376741);})[_0x2e47('0x20')](function(){delete _0x3d6e7c[_0x2e47('0x7')][_0x4356a8];});};Acw[_0x2e47('0x17')]['startAcw']=function(_0x20ea5d){try{var _0x3550bc=this;var _0x200ee7=this[_0x2e47('0x8')][_0x20ea5d]['interface'];var _0x58af6f=this[_0x2e47('0x8')][_0x20ea5d]['queue'];var _0xb1e166=this[_0x2e47('0x5')][_0x58af6f];var _0x59a532=![];var _0x175f02=_0x2e47('0x21');if(_0xb1e166['mandatoryDisposition']&&_0xb1e166[_0x2e47('0x22')][_0x2e47('0x23')]){_0x59a532=!![];_0x175f02=_0xb1e166['mandatoryDispositionPause'][_0x2e47('0x23')];}if(!_0x3550bc[_0x2e47('0x6')][_0x200ee7]){return Promise[_0x2e47('0x24')]();}return RpcUser['getAgent'](_0x3550bc[_0x2e47('0x6')][_0x200ee7]['id'])['then'](function(_0x385f42){if(!_0x385f42||_0x385f42[_0x2e47('0x25')]){logger[_0x2e47('0x1c')](_0x2e47('0x26'),_0x20ea5d,_0x200ee7,_0x58af6f);return;}logger[_0x2e47('0x1c')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x20ea5d,_0x200ee7,_0x58af6f);var _0x3fa0da=_0x3550bc[_0x2e47('0x8')][_0x20ea5d][_0x2e47('0x27')]&&_0x3550bc[_0x2e47('0x8')][_0x20ea5d][_0x2e47('0x28')]?_0x3550bc[_0x2e47('0x8')][_0x20ea5d][_0x2e47('0x28')]:_0x20ea5d;return RpcUser[_0x2e47('0x29')](_0x3550bc['agents'][_0x200ee7],_0x175f02,_0x3fa0da)[_0x2e47('0x2a')](function(_0x116c9f){_0x3550bc[_0x2e47('0x5')][_0x58af6f][_0x2e47('0x2b')]-=0x1;_0x3550bc[_0x2e47('0x5')][_0x58af6f]['paused']+=0x1;return _0x116c9f;});})[_0x2e47('0x2a')](function(_0x4ccd07){if(_0x59a532||!_0x4ccd07){return;}_0x3550bc[_0x2e47('0x7')][_0x200ee7]={};logger[_0x2e47('0x1c')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x20ea5d,_0x3550bc[_0x2e47('0x5')][_0x58af6f][_0x2e47('0x2c')],_0x200ee7,_0x58af6f);_0x3550bc[_0x2e47('0x7')][_0x200ee7][_0x2e47('0x1a')]=setTimeout(_0x3550bc[_0x2e47('0x2d')][_0x2e47('0xa')](_0x3550bc,_0x200ee7),_0x3550bc[_0x2e47('0x5')][_0x58af6f]['acwTimeout']*0x3e8);_0x3550bc[_0x2e47('0x7')][_0x200ee7][_0x2e47('0x19')]=moment()[_0x2e47('0x2e')]('YYYY-MM-DD\x20HH:mm:ss');_0x3550bc['timers'][_0x200ee7]['uniqueid']=_0x20ea5d;_0x3550bc[_0x2e47('0x7')][_0x200ee7][_0x2e47('0x2f')]=_0x58af6f;_0x3550bc[_0x2e47('0x7')][_0x200ee7][_0x2e47('0x18')]=_0x3550bc['updateAcw'][_0x2e47('0xa')](_0x3550bc,_0x200ee7,_0x20ea5d);})[_0x2e47('0x1e')](function(){logger['error'](_0x2e47('0x30'),_0x20ea5d,_0x3550bc['voiceQueues'][_0x58af6f][_0x2e47('0x2c')],_0x200ee7,_0x58af6f);})[_0x2e47('0x20')](function(){delete _0x3550bc[_0x2e47('0x8')][_0x20ea5d];});}catch(_0x17ab07){logger[_0x2e47('0x1f')](_0x2e47('0x31'),_0x17ab07[_0x2e47('0x32')]);}};Acw[_0x2e47('0x17')]['stopAcw']=function(_0x3b34da){try{var _0x147046=this;if(_0x147046[_0x2e47('0x7')][_0x3b34da]){_0x147046[_0x2e47('0x7')][_0x3b34da][_0x2e47('0x1a')]=![];var _0x75707c=_0x147046[_0x2e47('0x7')][_0x3b34da]['uniqueid'];var _0x38e8a0=_0x147046['timers'][_0x3b34da][_0x2e47('0x2f')];var _0x70b6a9=_0x147046[_0x2e47('0x5')][_0x38e8a0]['acwTimeout'];logger[_0x2e47('0x1c')]('[%s][TIMER][STOP][AGENT:%s]',_0x75707c,_0x3b34da);RpcUser[_0x2e47('0x33')](this[_0x2e47('0x6')][_0x3b34da]['id'])[_0x2e47('0x2a')](function(_0x4ebc2f){if(_0x4ebc2f['pauseType']===_0x2e47('0x21')){return RpcUser[_0x2e47('0x34')](_0x147046[_0x2e47('0x6')][_0x3b34da]);}});RpcVoiceAgentReport[_0x2e47('0x1b')]({'acwtime':_0x70b6a9,'agentacw':!![]},_0x75707c,_0x3b34da)[_0x2e47('0x2a')](function(_0x2def9a){logger[_0x2e47('0x1c')](_0x2e47('0x1d'),_0x75707c,_0x70b6a9,_0x2def9a);})[_0x2e47('0x1e')](function(_0x41114d){logger['error'](_0x2e47('0x35'),_0x75707c,_0x41114d);});}else{logger['error'](_0x2e47('0x36'),_0x3b34da);if(_0x147046[_0x2e47('0x7')]){logger[_0x2e47('0x1c')](_0x2e47('0x37'),JSON['stringify'](_0x147046['timers']));}}}catch(_0x15521e){logger['error'](_0x2e47('0x38'),_0x15521e[_0x2e47('0x32')]);}};Acw['prototype'][_0x2e47('0x9')]=function(_0xb6181b){try{if(this[_0x2e47('0x5')][_0xb6181b[_0x2e47('0x2f')]]&&(this[_0x2e47('0x5')][_0xb6181b[_0x2e47('0x2f')]][_0x2e47('0x3')]||this[_0x2e47('0x5')][_0xb6181b[_0x2e47('0x2f')]][_0x2e47('0x39')])){if(this[_0x2e47('0x6')][_0xb6181b['interface']]){this[_0x2e47('0x8')][_0xb6181b['uniqueid']]={'queue':_0xb6181b[_0x2e47('0x2f')],'interface':_0xb6181b[_0x2e47('0x3a')],'destlinkedid':_0xb6181b[_0x2e47('0x28')]};}}}catch(_0x5b2823){logger[_0x2e47('0x1f')](_0x2e47('0x3b'),_0x5b2823[_0x2e47('0x32')]);}};Acw[_0x2e47('0x17')][_0x2e47('0x13')]=function(_0x2a4154){try{if(this[_0x2e47('0x5')][_0x2a4154[_0x2e47('0x2f')]]&&(this[_0x2e47('0x5')][_0x2a4154[_0x2e47('0x2f')]][_0x2e47('0x3')]||this[_0x2e47('0x5')][_0x2a4154[_0x2e47('0x2f')]][_0x2e47('0x39')])){if(this['agents'][_0x2a4154[_0x2e47('0x3a')]]){this[_0x2e47('0x8')][_0x2a4154[_0x2e47('0x3c')]]={'queue':_0x2a4154[_0x2e47('0x2f')],'interface':_0x2a4154['interface']};}}}catch(_0x27be2b){logger['error'](_0x2e47('0x3d'),_0x27be2b['message']);}};Acw['prototype'][_0x2e47('0xc')]=function(_0x484184){try{if(this[_0x2e47('0x8')][_0x484184[_0x2e47('0x3c')]]&&_['isUndefined'](this[_0x2e47('0x8')][_0x484184[_0x2e47('0x3c')]][_0x2e47('0x27')])){logger['info'](_0x2e47('0x3e'),_0x484184[_0x2e47('0x3c')]);this[_0x2e47('0x3f')](_0x484184[_0x2e47('0x3c')]);}else if(this[_0x2e47('0x8')][_0x484184[_0x2e47('0x40')]]&&_[_0x2e47('0x41')](this['channels'][_0x484184[_0x2e47('0x40')]][_0x2e47('0x27')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x484184[_0x2e47('0x40')]);this['startAcw'](_0x484184[_0x2e47('0x40')]);}}catch(_0x1f2b68){logger['error'](_0x2e47('0x42'),_0x1f2b68[_0x2e47('0x32')]);}};Acw[_0x2e47('0x17')][_0x2e47('0xd')]=function(_0x5d9f24){try{if(this['channels'][_0x5d9f24['uniqueid']]&&this[_0x2e47('0x8')][_0x5d9f24[_0x2e47('0x3c')]][_0x2e47('0x27')]){logger[_0x2e47('0x1c')](_0x2e47('0x43'),_0x5d9f24[_0x2e47('0x3c')]);this[_0x2e47('0x3f')](_0x5d9f24['uniqueid']);}else if(this[_0x2e47('0x8')][_0x5d9f24[_0x2e47('0x40')]]&&this['channels'][_0x5d9f24[_0x2e47('0x40')]]['attended']){logger[_0x2e47('0x1c')](_0x2e47('0x44'),_0x5d9f24[_0x2e47('0x40')]);this[_0x2e47('0x3f')](_0x5d9f24[_0x2e47('0x40')]);}}catch(_0x387b96){logger[_0x2e47('0x1f')]('[ACW][syncHangup]\x20%s',_0x387b96[_0x2e47('0x32')]);}};Acw[_0x2e47('0x17')][_0x2e47('0x45')]=function(_0x2b0347){try{if(!_[_0x2e47('0x46')](this[_0x2e47('0x8')][_0x2b0347[_0x2e47('0x47')]])){this['startAcw'](_0x2b0347[_0x2e47('0x47')]);if(this[_0x2e47('0x8')][_0x2b0347[_0x2e47('0x48')]]){this[_0x2e47('0x8')][_0x2b0347['secondtransfereruniqueid']][_0x2e47('0x27')]=!![];this[_0x2e47('0x8')][_0x2b0347[_0x2e47('0x49')]]=this[_0x2e47('0x8')][_0x2b0347[_0x2e47('0x48')]];delete this['channels'][_0x2b0347[_0x2e47('0x48')]];}}else if(!_[_0x2e47('0x46')](this[_0x2e47('0x8')][_0x2b0347[_0x2e47('0x49')]])){this[_0x2e47('0x3f')](_0x2b0347[_0x2e47('0x49')]);if(this['channels'][_0x2b0347[_0x2e47('0x4a')]]){this[_0x2e47('0x8')][_0x2b0347[_0x2e47('0x4a')]][_0x2e47('0x27')]=!![];this['channels'][_0x2b0347[_0x2e47('0x47')]]=this[_0x2e47('0x8')][_0x2b0347['origtransfereruniqueid']];delete this[_0x2e47('0x8')][_0x2b0347[_0x2e47('0x4a')]];}}}catch(_0xadc0bf){logger[_0x2e47('0x1f')](_0x2e47('0x4b'),_0xadc0bf['message']);}};Acw['prototype'][_0x2e47('0x11')]=function(_0x2a2e29){try{if(this[_0x2e47('0x8')][_0x2a2e29[_0x2e47('0x4c')]]){logger[_0x2e47('0x1c')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON['stringify'](_0x2a2e29[_0x2e47('0x4c')]));this[_0x2e47('0x3f')](_0x2a2e29[_0x2e47('0x4c')]);}else if(this[_0x2e47('0x8')][_0x2a2e29['transfererlinkedid']]){logger[_0x2e47('0x1c')](_0x2e47('0x4d'),JSON[_0x2e47('0x4e')](_0x2a2e29[_0x2e47('0x4f')]));this[_0x2e47('0x3f')](_0x2a2e29[_0x2e47('0x4f')]);}}catch(_0x4f6ade){logger[_0x2e47('0x1f')](_0x2e47('0x50'),_0x4f6ade[_0x2e47('0x32')]);}};Acw[_0x2e47('0x17')][_0x2e47('0xe')]=function(_0x5ca316){try{if(this['voiceQueues'][_0x5ca316[_0x2e47('0x2f')]]&&this[_0x2e47('0x5')][_0x5ca316[_0x2e47('0x2f')]]['autopause']==='all'){if(this[_0x2e47('0x6')][_0x5ca316[_0x2e47('0x3a')]]){logger[_0x2e47('0x1c')](_0x2e47('0x51'),_0x5ca316['uniqueid'],_0x5ca316[_0x2e47('0x3a')],_0x5ca316[_0x2e47('0x2f')]);return RpcUser[_0x2e47('0x29')](this[_0x2e47('0x6')][_0x5ca316[_0x2e47('0x3a')]],_0x2e47('0x52'),_0x5ca316['uniqueid']);}}}catch(_0x65c9eb){logger[_0x2e47('0x1f')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x65c9eb[_0x2e47('0x32')]);}};module[_0x2e47('0x53')]=Acw;
\ No newline at end of file
+var _0xd488=['agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','timer','update','uniqueid','then','info','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','mandatoryDisposition','mandatoryDispositionPause','name','resolve','getAgent','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','available','paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','queue','updateAcw','catch','message','[%s][TIMER][STOP][AGENT:%s]','ACW','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','acw','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','isNil','transfereeuniqueid','transfertargetuniqueid','secondtransfereruniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues'];(function(_0x44ae0b,_0x3e9865){var _0x69232a=function(_0x5ae588){while(--_0x5ae588){_0x44ae0b['push'](_0x44ae0b['shift']());}};_0x69232a(++_0x3e9865);}(_0xd488,0x10b));var _0x8d48=function(_0x5e0e90,_0x1c8363){_0x5e0e90=_0x5e0e90-0x0;var _0x33cfe3=_0xd488[_0x5e0e90];return _0x33cfe3;};'use strict';var _=require(_0x8d48('0x0'));var moment=require(_0x8d48('0x1'));var ami=require(_0x8d48('0x2'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0x8d48('0x3'));var RpcVoiceAgentReport=require(_0x8d48('0x4'));function Acw(_0x31eea9){this[_0x8d48('0x5')]=_0x31eea9[_0x8d48('0x5')];this[_0x8d48('0x6')]=_0x31eea9['agents'];this[_0x8d48('0x7')]=_0x31eea9['timers'];this[_0x8d48('0x8')]={};ami['on'](_0x8d48('0x9'),this[_0x8d48('0xa')][_0x8d48('0xb')](this));ami['on'](_0x8d48('0xc'),this[_0x8d48('0xd')][_0x8d48('0xb')](this));ami['on'](_0x8d48('0xe'),this[_0x8d48('0xf')][_0x8d48('0xb')](this));ami['on']('agentringnoanswer',this[_0x8d48('0x10')][_0x8d48('0xb')](this));ami['on'](_0x8d48('0x11'),this[_0x8d48('0x12')]['bind'](this));ami['on']('blindtransfer',this[_0x8d48('0x13')][_0x8d48('0xb')](this));ami['on'](_0x8d48('0x14'),this[_0x8d48('0x15')][_0x8d48('0xb')](this));}function getDiff(_0x2f5766){var _0x434b2f=moment()['milliseconds'](0x0);var _0x450768=moment(_0x2f5766)[_0x8d48('0x16')](0x0);return _0x434b2f[_0x8d48('0x17')](_0x450768,_0x8d48('0x18'));}Acw[_0x8d48('0x19')]['updateAcw']=function(_0x4f443f,_0x5f5c0b){var _0x277e38=this;var _0x5b0c52=getDiff(_0x277e38[_0x8d48('0x7')][_0x4f443f]['lastPauseAt']);clearTimeout(_0x277e38['timers'][_0x4f443f][_0x8d48('0x1a')]);_0x277e38[_0x8d48('0x7')][_0x4f443f]['timer']=![];return RpcVoiceAgentReport[_0x8d48('0x1b')]({'acwtime':_0x5b0c52},_0x277e38[_0x8d48('0x7')][_0x4f443f][_0x8d48('0x1c')],_0x4f443f)[_0x8d48('0x1d')](function(_0x4fdc83){logger[_0x8d48('0x1e')]('[%s][UPDATE][ACWTIME:%s]',_0x5f5c0b,_0x5b0c52,_0x4fdc83);})['catch'](function(_0x13483e){logger[_0x8d48('0x1f')](_0x8d48('0x20'),_0x5f5c0b,_0x13483e);})[_0x8d48('0x21')](function(){delete _0x277e38[_0x8d48('0x7')][_0x4f443f];});};Acw[_0x8d48('0x19')][_0x8d48('0x22')]=function(_0x209205){try{var _0x38154f=this;var _0x212202=this[_0x8d48('0x8')][_0x209205]['interface'];var _0x5df9b1=this[_0x8d48('0x8')][_0x209205]['queue'];var _0x26f3b7=this[_0x8d48('0x5')][_0x5df9b1];var _0x486342=![];var _0x499bcb='ACW';if(_0x26f3b7[_0x8d48('0x23')]&&_0x26f3b7[_0x8d48('0x24')]['name']){_0x486342=!![];_0x499bcb=_0x26f3b7[_0x8d48('0x24')][_0x8d48('0x25')];}if(!_0x38154f[_0x8d48('0x6')][_0x212202]){return Promise[_0x8d48('0x26')]();}return RpcUser[_0x8d48('0x27')](_0x38154f[_0x8d48('0x6')][_0x212202]['id'])['then'](function(_0x18950a){if(!_0x18950a||_0x18950a['voicePause']){logger[_0x8d48('0x1e')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x209205,_0x212202,_0x5df9b1);return;}logger['info'](_0x8d48('0x28'),_0x209205,_0x212202,_0x5df9b1);var _0x52e65e=_0x38154f[_0x8d48('0x8')][_0x209205][_0x8d48('0x29')]&&_0x38154f[_0x8d48('0x8')][_0x209205][_0x8d48('0x2a')]?_0x38154f['channels'][_0x209205][_0x8d48('0x2a')]:_0x209205;return RpcUser[_0x8d48('0x2b')](_0x38154f[_0x8d48('0x6')][_0x212202],_0x499bcb,_0x52e65e)[_0x8d48('0x1d')](function(_0x2bac95){_0x38154f[_0x8d48('0x5')][_0x5df9b1][_0x8d48('0x2c')]-=0x1;_0x38154f['voiceQueues'][_0x5df9b1][_0x8d48('0x2d')]+=0x1;return _0x2bac95;});})[_0x8d48('0x1d')](function(_0x172d0f){if(_0x486342||!_0x172d0f){return;}_0x38154f['timers'][_0x212202]={};logger[_0x8d48('0x1e')](_0x8d48('0x2e'),_0x209205,_0x38154f[_0x8d48('0x5')][_0x5df9b1][_0x8d48('0x2f')],_0x212202,_0x5df9b1);_0x38154f[_0x8d48('0x7')][_0x212202]['timer']=setTimeout(_0x38154f[_0x8d48('0x30')]['bind'](_0x38154f,_0x212202),_0x38154f[_0x8d48('0x5')][_0x5df9b1][_0x8d48('0x2f')]*0x3e8);_0x38154f['timers'][_0x212202][_0x8d48('0x31')]=moment()[_0x8d48('0x32')](_0x8d48('0x33'));_0x38154f[_0x8d48('0x7')][_0x212202][_0x8d48('0x1c')]=_0x209205;_0x38154f[_0x8d48('0x7')][_0x212202][_0x8d48('0x34')]=_0x5df9b1;_0x38154f['timers'][_0x212202]['updateAcw']=_0x38154f[_0x8d48('0x35')][_0x8d48('0xb')](_0x38154f,_0x212202,_0x209205);})[_0x8d48('0x36')](function(){logger['error'](_0x8d48('0x2e'),_0x209205,_0x38154f[_0x8d48('0x5')][_0x5df9b1][_0x8d48('0x2f')],_0x212202,_0x5df9b1);})[_0x8d48('0x21')](function(){delete _0x38154f[_0x8d48('0x8')][_0x209205];});}catch(_0x48141f){logger['error']('[ACW][START]\x20%s',_0x48141f[_0x8d48('0x37')]);}};Acw[_0x8d48('0x19')][_0x8d48('0x30')]=function(_0x1188c9){try{var _0x2d1f5c=this;if(_0x2d1f5c[_0x8d48('0x7')][_0x1188c9]){_0x2d1f5c[_0x8d48('0x7')][_0x1188c9][_0x8d48('0x1a')]=![];var _0x27f539=_0x2d1f5c[_0x8d48('0x7')][_0x1188c9][_0x8d48('0x1c')];var _0x79d001=_0x2d1f5c[_0x8d48('0x7')][_0x1188c9][_0x8d48('0x34')];var _0x99419d=_0x2d1f5c[_0x8d48('0x5')][_0x79d001][_0x8d48('0x2f')];logger['info'](_0x8d48('0x38'),_0x27f539,_0x1188c9);RpcUser['getAgent'](this['agents'][_0x1188c9]['id'])[_0x8d48('0x1d')](function(_0xa79c3f){if(_0xa79c3f['pauseType']===_0x8d48('0x39')){return RpcUser[_0x8d48('0x3a')](_0x2d1f5c[_0x8d48('0x6')][_0x1188c9]);}});RpcVoiceAgentReport['update']({'acwtime':_0x99419d,'agentacw':!![]},_0x27f539,_0x1188c9)[_0x8d48('0x1d')](function(_0x57ae89){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x27f539,_0x99419d,_0x57ae89);})['catch'](function(_0x5f1fdc){logger[_0x8d48('0x1f')](_0x8d48('0x20'),_0x27f539,_0x5f1fdc);});}else{logger[_0x8d48('0x1f')](_0x8d48('0x3b'),_0x1188c9);if(_0x2d1f5c[_0x8d48('0x7')]){logger[_0x8d48('0x1e')](_0x8d48('0x3c'),JSON[_0x8d48('0x3d')](_0x2d1f5c['timers']));}}}catch(_0x309d20){logger[_0x8d48('0x1f')](_0x8d48('0x3e'),_0x309d20[_0x8d48('0x37')]);}};Acw[_0x8d48('0x19')]['syncAgentConnect']=function(_0x56fc01){try{if(this[_0x8d48('0x5')][_0x56fc01[_0x8d48('0x34')]]&&(this[_0x8d48('0x5')][_0x56fc01[_0x8d48('0x34')]][_0x8d48('0x3f')]||this[_0x8d48('0x5')][_0x56fc01[_0x8d48('0x34')]]['mandatoryDisposition'])){if(this['agents'][_0x56fc01[_0x8d48('0x40')]]){this[_0x8d48('0x8')][_0x56fc01[_0x8d48('0x1c')]]={'queue':_0x56fc01[_0x8d48('0x34')],'interface':_0x56fc01[_0x8d48('0x40')],'destlinkedid':_0x56fc01['destlinkedid']};}}}catch(_0x45d410){logger['error'](_0x8d48('0x41'),_0x45d410[_0x8d48('0x37')]);}};Acw[_0x8d48('0x19')][_0x8d48('0x15')]=function(_0x5e2e51){try{if(this['voiceQueues'][_0x5e2e51[_0x8d48('0x34')]]&&(this[_0x8d48('0x5')][_0x5e2e51[_0x8d48('0x34')]][_0x8d48('0x3f')]||this[_0x8d48('0x5')][_0x5e2e51[_0x8d48('0x34')]][_0x8d48('0x23')])){if(this[_0x8d48('0x6')][_0x5e2e51[_0x8d48('0x40')]]){this[_0x8d48('0x8')][_0x5e2e51['uniqueid']]={'queue':_0x5e2e51[_0x8d48('0x34')],'interface':_0x5e2e51['interface']};}}}catch(_0x265170){logger[_0x8d48('0x1f')](_0x8d48('0x42'),_0x265170[_0x8d48('0x37')]);}};Acw[_0x8d48('0x19')][_0x8d48('0xd')]=function(_0x1ee8ec){try{if(this[_0x8d48('0x8')][_0x1ee8ec['uniqueid']]&&_[_0x8d48('0x43')](this[_0x8d48('0x8')][_0x1ee8ec[_0x8d48('0x1c')]][_0x8d48('0x29')])){logger[_0x8d48('0x1e')](_0x8d48('0x44'),_0x1ee8ec['uniqueid']);this[_0x8d48('0x22')](_0x1ee8ec[_0x8d48('0x1c')]);}else if(this[_0x8d48('0x8')][_0x1ee8ec[_0x8d48('0x45')]]&&_['isUndefined'](this['channels'][_0x1ee8ec[_0x8d48('0x45')]][_0x8d48('0x29')])){logger[_0x8d48('0x1e')](_0x8d48('0x46'),_0x1ee8ec[_0x8d48('0x45')]);this['startAcw'](_0x1ee8ec['linkedid']);}}catch(_0x1ef9aa){logger[_0x8d48('0x1f')](_0x8d48('0x47'),_0x1ef9aa['message']);}};Acw['prototype'][_0x8d48('0xf')]=function(_0x125400){try{if(this[_0x8d48('0x8')][_0x125400[_0x8d48('0x1c')]]&&this[_0x8d48('0x8')][_0x125400[_0x8d48('0x1c')]][_0x8d48('0x29')]){logger[_0x8d48('0x1e')](_0x8d48('0x48'),_0x125400[_0x8d48('0x1c')]);this[_0x8d48('0x22')](_0x125400[_0x8d48('0x1c')]);}else if(this[_0x8d48('0x8')][_0x125400['linkedid']]&&this[_0x8d48('0x8')][_0x125400[_0x8d48('0x45')]][_0x8d48('0x29')]){logger[_0x8d48('0x1e')](_0x8d48('0x49'),_0x125400[_0x8d48('0x45')]);this[_0x8d48('0x22')](_0x125400[_0x8d48('0x45')]);}}catch(_0x18ff0c){logger['error']('[ACW][syncHangup]\x20%s',_0x18ff0c[_0x8d48('0x37')]);}};Acw['prototype'][_0x8d48('0x12')]=function(_0x3f5b2d){try{if(!_[_0x8d48('0x4a')](this['channels'][_0x3f5b2d[_0x8d48('0x4b')]])){this[_0x8d48('0x22')](_0x3f5b2d[_0x8d48('0x4b')]);if(this[_0x8d48('0x8')][_0x3f5b2d['secondtransfereruniqueid']]){this[_0x8d48('0x8')][_0x3f5b2d['secondtransfereruniqueid']][_0x8d48('0x29')]=!![];this[_0x8d48('0x8')][_0x3f5b2d[_0x8d48('0x4c')]]=this[_0x8d48('0x8')][_0x3f5b2d[_0x8d48('0x4d')]];delete this[_0x8d48('0x8')][_0x3f5b2d[_0x8d48('0x4d')]];}}else if(!_[_0x8d48('0x4a')](this[_0x8d48('0x8')][_0x3f5b2d['transfertargetuniqueid']])){this[_0x8d48('0x22')](_0x3f5b2d[_0x8d48('0x4c')]);if(this[_0x8d48('0x8')][_0x3f5b2d[_0x8d48('0x4e')]]){this['channels'][_0x3f5b2d[_0x8d48('0x4e')]][_0x8d48('0x29')]=!![];this[_0x8d48('0x8')][_0x3f5b2d['transfereeuniqueid']]=this[_0x8d48('0x8')][_0x3f5b2d[_0x8d48('0x4e')]];delete this[_0x8d48('0x8')][_0x3f5b2d[_0x8d48('0x4e')]];}}}catch(_0x44a6b7){logger[_0x8d48('0x1f')](_0x8d48('0x4f'),_0x44a6b7['message']);}};Acw[_0x8d48('0x19')][_0x8d48('0x13')]=function(_0x15d513){try{if(this[_0x8d48('0x8')][_0x15d513[_0x8d48('0x50')]]){logger['info'](_0x8d48('0x51'),JSON['stringify'](_0x15d513[_0x8d48('0x50')]));this[_0x8d48('0x22')](_0x15d513[_0x8d48('0x50')]);}else if(this[_0x8d48('0x8')][_0x15d513[_0x8d48('0x52')]]){logger[_0x8d48('0x1e')](_0x8d48('0x53'),JSON['stringify'](_0x15d513[_0x8d48('0x52')]));this['startAcw'](_0x15d513['transfererlinkedid']);}}catch(_0x520b80){logger[_0x8d48('0x1f')](_0x8d48('0x54'),_0x520b80[_0x8d48('0x37')]);}};Acw['prototype'][_0x8d48('0x10')]=function(_0x16395c){try{if(this['voiceQueues'][_0x16395c[_0x8d48('0x34')]]&&this[_0x8d48('0x5')][_0x16395c['queue']][_0x8d48('0x55')]===_0x8d48('0x56')){if(this['agents'][_0x16395c[_0x8d48('0x40')]]){logger[_0x8d48('0x1e')](_0x8d48('0x57'),_0x16395c['uniqueid'],_0x16395c[_0x8d48('0x40')],_0x16395c[_0x8d48('0x34')]);return RpcUser[_0x8d48('0x2b')](this[_0x8d48('0x6')][_0x16395c[_0x8d48('0x40')]],_0x8d48('0x58'),_0x16395c['uniqueid']);}}}catch(_0x556d66){logger[_0x8d48('0x1f')](_0x8d48('0x59'),_0x556d66[_0x8d48('0x37')]);}};module[_0x8d48('0x5a')]=Acw;
\ No newline at end of file