Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / services / ami / acw / index.js
index b89a4d8..af46693 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x32f4=['lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','syncAgentConnect','hanguprequest','bind','hangup','syncHangup','agentringnoanswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','updateAcw','timer','update','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','finally','startAcw','interface','channels','ACW','mandatoryDisposition','name','mandatoryDispositionPause','resolve','getAgent','voicePause','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][TIMERS]','stringify','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','[%s][HANGUP:UNIQUEID]','isUndefined','attended','[%s][HANGUP:LINKEDID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','all','Auto-Pause','exports'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x32f4,0x154));var _0x432f=function(_0x12df36,_0x7a942f){_0x12df36=_0x12df36-0x0;var _0x56f524=_0x32f4[_0x12df36];return _0x56f524;};'use strict';var _=require(_0x432f('0x0'));var moment=require(_0x432f('0x1'));var ami=require(_0x432f('0x2'));var logger=require(_0x432f('0x3'))('acw');var RpcUser=require(_0x432f('0x4'));var RpcVoiceAgentReport=require(_0x432f('0x5'));function Acw(_0x51a71a){this[_0x432f('0x6')]=_0x51a71a[_0x432f('0x6')];this[_0x432f('0x7')]=_0x51a71a[_0x432f('0x7')];this[_0x432f('0x8')]=_0x51a71a['timers'];this['channels']={};ami['on'](_0x432f('0x9'),this[_0x432f('0xa')]['bind'](this));ami['on'](_0x432f('0xb'),this['syncHangupRequest'][_0x432f('0xc')](this));ami['on'](_0x432f('0xd'),this[_0x432f('0xe')][_0x432f('0xc')](this));ami['on'](_0x432f('0xf'),this['syncAgentRingNoAnswer'][_0x432f('0xc')](this));ami['on']('attendedtransfer',this[_0x432f('0x10')]['bind'](this));ami['on'](_0x432f('0x11'),this[_0x432f('0x12')]['bind'](this));ami['on'](_0x432f('0x13'),this[_0x432f('0x14')]['bind'](this));}function getDiff(_0x10b6fa){var _0x26aa9a=moment()['milliseconds'](0x0);var _0x48a4db=moment(_0x10b6fa)[_0x432f('0x15')](0x0);return _0x26aa9a[_0x432f('0x16')](_0x48a4db,_0x432f('0x17'));}Acw[_0x432f('0x18')][_0x432f('0x19')]=function(_0x4f91c5,_0x175ba7){var _0x2f0708=this;var _0x1e2c30=getDiff(_0x2f0708[_0x432f('0x8')][_0x4f91c5]['lastPauseAt']);clearTimeout(_0x2f0708[_0x432f('0x8')][_0x4f91c5][_0x432f('0x1a')]);_0x2f0708[_0x432f('0x8')][_0x4f91c5][_0x432f('0x1a')]=![];return RpcVoiceAgentReport[_0x432f('0x1b')]({'acwtime':_0x1e2c30},_0x2f0708[_0x432f('0x8')][_0x4f91c5]['uniqueid'],_0x4f91c5)[_0x432f('0x1c')](function(_0x4ddd21){logger[_0x432f('0x1d')](_0x432f('0x1e'),_0x175ba7,_0x1e2c30,_0x4ddd21);})[_0x432f('0x1f')](function(_0x391fd8){logger[_0x432f('0x20')](_0x432f('0x21'),_0x175ba7,_0x391fd8);})[_0x432f('0x22')](function(){delete _0x2f0708[_0x432f('0x8')][_0x4f91c5];});};Acw[_0x432f('0x18')][_0x432f('0x23')]=function(_0x40176d){try{var _0x3446fd=this;var _0x4dd230=this['channels'][_0x40176d][_0x432f('0x24')];var _0x5c4deb=this[_0x432f('0x25')][_0x40176d]['queue'];var _0x37f136=this[_0x432f('0x6')][_0x5c4deb];var _0x241cb4=![];var _0x89ea50=_0x432f('0x26');if(_0x37f136[_0x432f('0x27')]&&_0x37f136['mandatoryDispositionPause'][_0x432f('0x28')]){_0x241cb4=!![];_0x89ea50=_0x37f136[_0x432f('0x29')]['name'];}if(!_0x3446fd[_0x432f('0x7')][_0x4dd230]){return Promise[_0x432f('0x2a')]();}return RpcUser[_0x432f('0x2b')](_0x3446fd[_0x432f('0x7')][_0x4dd230]['id'])[_0x432f('0x1c')](function(_0x781862){if(!_0x781862||_0x781862[_0x432f('0x2c')]){logger['info'](_0x432f('0x2d'),_0x40176d,_0x4dd230,_0x5c4deb);return;}logger['info'](_0x432f('0x2e'),_0x40176d,_0x4dd230,_0x5c4deb);var _0x573cc5=_0x3446fd[_0x432f('0x25')][_0x40176d]['attended']&&_0x3446fd[_0x432f('0x25')][_0x40176d]['destlinkedid']?_0x3446fd[_0x432f('0x25')][_0x40176d][_0x432f('0x2f')]:_0x40176d;return RpcUser[_0x432f('0x30')](_0x3446fd['agents'][_0x4dd230],_0x89ea50,_0x573cc5);})[_0x432f('0x1c')](function(_0x24406a){if(_0x241cb4||!_0x24406a){return;}_0x3446fd['timers'][_0x4dd230]={};logger['info'](_0x432f('0x31'),_0x40176d,_0x3446fd[_0x432f('0x6')][_0x5c4deb][_0x432f('0x32')],_0x4dd230,_0x5c4deb);_0x3446fd[_0x432f('0x8')][_0x4dd230][_0x432f('0x1a')]=setTimeout(_0x3446fd[_0x432f('0x33')]['bind'](_0x3446fd,_0x4dd230),_0x3446fd['voiceQueues'][_0x5c4deb][_0x432f('0x32')]*0x3e8);_0x3446fd[_0x432f('0x8')][_0x4dd230][_0x432f('0x34')]=moment()['format'](_0x432f('0x35'));_0x3446fd[_0x432f('0x8')][_0x4dd230][_0x432f('0x36')]=_0x40176d;_0x3446fd[_0x432f('0x8')][_0x4dd230][_0x432f('0x37')]=_0x5c4deb;_0x3446fd[_0x432f('0x8')][_0x4dd230][_0x432f('0x19')]=_0x3446fd[_0x432f('0x19')]['bind'](_0x3446fd,_0x4dd230,_0x40176d);})['catch'](function(){logger[_0x432f('0x20')](_0x432f('0x31'),_0x40176d,_0x3446fd['voiceQueues'][_0x5c4deb]['acwTimeout'],_0x4dd230,_0x5c4deb);})['finally'](function(){delete _0x3446fd[_0x432f('0x25')][_0x40176d];});}catch(_0x141141){logger['error'](_0x432f('0x38'),_0x141141[_0x432f('0x39')]);}};Acw[_0x432f('0x18')]['stopAcw']=function(_0x3510d2){try{var _0x440420=this;if(_0x440420['timers'][_0x3510d2]){_0x440420[_0x432f('0x8')][_0x3510d2][_0x432f('0x1a')]=![];var _0x59e111=_0x440420[_0x432f('0x8')][_0x3510d2][_0x432f('0x36')];var _0x148a95=_0x440420[_0x432f('0x8')][_0x3510d2][_0x432f('0x37')];var _0x1c3700=_0x440420[_0x432f('0x6')][_0x148a95][_0x432f('0x32')];logger[_0x432f('0x1d')](_0x432f('0x3a'),_0x59e111,_0x3510d2);RpcUser[_0x432f('0x3b')](this['agents'][_0x3510d2]);RpcVoiceAgentReport[_0x432f('0x1b')]({'acwtime':_0x1c3700,'agentacw':!![]},_0x59e111,_0x3510d2)['then'](function(_0x1550fc){logger[_0x432f('0x1d')]('[%s][UPDATE][ACWTIME:%s]',_0x59e111,_0x1c3700,_0x1550fc);})[_0x432f('0x1f')](function(_0x47d44d){logger[_0x432f('0x20')](_0x432f('0x21'),_0x59e111,_0x47d44d);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x3510d2);if(_0x440420[_0x432f('0x8')]){logger[_0x432f('0x1d')](_0x432f('0x3c'),JSON[_0x432f('0x3d')](_0x440420[_0x432f('0x8')]));}}}catch(_0x513a57){logger['error']('[ACW][STOP]\x20%s',_0x513a57[_0x432f('0x39')]);}};Acw[_0x432f('0x18')]['syncAgentConnect']=function(_0x1f58af){try{if(this[_0x432f('0x6')][_0x1f58af[_0x432f('0x37')]]&&(this[_0x432f('0x6')][_0x1f58af[_0x432f('0x37')]][_0x432f('0x3e')]||this[_0x432f('0x6')][_0x1f58af[_0x432f('0x37')]][_0x432f('0x27')])){if(this['agents'][_0x1f58af[_0x432f('0x24')]]){this[_0x432f('0x25')][_0x1f58af['uniqueid']]={'queue':_0x1f58af[_0x432f('0x37')],'interface':_0x1f58af[_0x432f('0x24')],'destlinkedid':_0x1f58af[_0x432f('0x2f')]};}}}catch(_0x2d623e){logger[_0x432f('0x20')](_0x432f('0x3f'),_0x2d623e[_0x432f('0x39')]);}};Acw[_0x432f('0x18')][_0x432f('0x14')]=function(_0xdaa43a){try{if(this[_0x432f('0x6')][_0xdaa43a[_0x432f('0x37')]]&&(this[_0x432f('0x6')][_0xdaa43a[_0x432f('0x37')]]['acw']||this['voiceQueues'][_0xdaa43a[_0x432f('0x37')]][_0x432f('0x27')])){if(this[_0x432f('0x7')][_0xdaa43a[_0x432f('0x24')]]){this[_0x432f('0x25')][_0xdaa43a['uniqueid']]={'queue':_0xdaa43a[_0x432f('0x37')],'interface':_0xdaa43a[_0x432f('0x24')]};}}}catch(_0x46c5ee){logger[_0x432f('0x20')](_0x432f('0x40'),_0x46c5ee[_0x432f('0x39')]);}};Acw[_0x432f('0x18')]['syncHangupRequest']=function(_0x3abafe){try{if(this[_0x432f('0x25')][_0x3abafe[_0x432f('0x36')]]&&_['isUndefined'](this[_0x432f('0x25')][_0x3abafe[_0x432f('0x36')]]['attended'])){logger['info'](_0x432f('0x41'),_0x3abafe[_0x432f('0x36')]);this['startAcw'](_0x3abafe['uniqueid']);}else if(this[_0x432f('0x25')][_0x3abafe['linkedid']]&&_[_0x432f('0x42')](this[_0x432f('0x25')][_0x3abafe['linkedid']][_0x432f('0x43')])){logger['info'](_0x432f('0x44'),_0x3abafe[_0x432f('0x45')]);this[_0x432f('0x23')](_0x3abafe[_0x432f('0x45')]);}}catch(_0x3051ea){logger[_0x432f('0x20')]('[ACW][syncHangupRequest]\x20%s',_0x3051ea[_0x432f('0x39')]);}};Acw['prototype'][_0x432f('0xe')]=function(_0x109bcd){try{if(this[_0x432f('0x25')][_0x109bcd[_0x432f('0x36')]]&&this['channels'][_0x109bcd[_0x432f('0x36')]][_0x432f('0x43')]){logger[_0x432f('0x1d')](_0x432f('0x46'),_0x109bcd[_0x432f('0x36')]);this[_0x432f('0x23')](_0x109bcd[_0x432f('0x36')]);}else if(this['channels'][_0x109bcd['linkedid']]&&this[_0x432f('0x25')][_0x109bcd[_0x432f('0x45')]][_0x432f('0x43')]){logger[_0x432f('0x1d')](_0x432f('0x47'),_0x109bcd[_0x432f('0x45')]);this['startAcw'](_0x109bcd[_0x432f('0x45')]);}}catch(_0x545035){logger['error'](_0x432f('0x48'),_0x545035[_0x432f('0x39')]);}};Acw[_0x432f('0x18')][_0x432f('0x10')]=function(_0x32decd){try{if(!_[_0x432f('0x49')](this['channels'][_0x32decd[_0x432f('0x4a')]])){this[_0x432f('0x23')](_0x32decd['transfereeuniqueid']);if(this[_0x432f('0x25')][_0x32decd[_0x432f('0x4b')]]){this['channels'][_0x32decd[_0x432f('0x4b')]][_0x432f('0x43')]=!![];this[_0x432f('0x25')][_0x32decd[_0x432f('0x4c')]]=this[_0x432f('0x25')][_0x32decd[_0x432f('0x4b')]];delete this[_0x432f('0x25')][_0x32decd[_0x432f('0x4b')]];}}else if(!_[_0x432f('0x49')](this[_0x432f('0x25')][_0x32decd[_0x432f('0x4c')]])){this[_0x432f('0x23')](_0x32decd[_0x432f('0x4c')]);if(this[_0x432f('0x25')][_0x32decd[_0x432f('0x4d')]]){this[_0x432f('0x25')][_0x32decd['origtransfereruniqueid']]['attended']=!![];this[_0x432f('0x25')][_0x32decd[_0x432f('0x4a')]]=this[_0x432f('0x25')][_0x32decd['origtransfereruniqueid']];delete this[_0x432f('0x25')][_0x32decd[_0x432f('0x4d')]];}}}catch(_0x28a227){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x28a227[_0x432f('0x39')]);}};Acw[_0x432f('0x18')]['syncBlindTransfer']=function(_0x2b83df){try{if(this['channels'][_0x2b83df[_0x432f('0x4e')]]){logger[_0x432f('0x1d')](_0x432f('0x4f'),JSON['stringify'](_0x2b83df[_0x432f('0x4e')]));this[_0x432f('0x23')](_0x2b83df[_0x432f('0x4e')]);}else if(this[_0x432f('0x25')][_0x2b83df['transfererlinkedid']]){logger[_0x432f('0x1d')](_0x432f('0x50'),JSON['stringify'](_0x2b83df[_0x432f('0x51')]));this['startAcw'](_0x2b83df['transfererlinkedid']);}}catch(_0x51abac){logger[_0x432f('0x20')]('[ACW][syncBlindTransfer]\x20%s',_0x51abac[_0x432f('0x39')]);}};Acw[_0x432f('0x18')]['syncAgentRingNoAnswer']=function(_0x51c6c3){try{if(this[_0x432f('0x6')][_0x51c6c3[_0x432f('0x37')]]&&this[_0x432f('0x6')][_0x51c6c3[_0x432f('0x37')]]['autopause']===_0x432f('0x52')){if(this[_0x432f('0x7')][_0x51c6c3['interface']]){logger[_0x432f('0x1d')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x51c6c3[_0x432f('0x36')],_0x51c6c3[_0x432f('0x24')],_0x51c6c3[_0x432f('0x37')]);return RpcUser['savePause'](this[_0x432f('0x7')][_0x51c6c3[_0x432f('0x24')]],_0x432f('0x53'),_0x51c6c3[_0x432f('0x36')]);}}}catch(_0x54fd3c){logger[_0x432f('0x20')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x54fd3c[_0x432f('0x39')]);}};module[_0x432f('0x54')]=Acw;
\ No newline at end of file
+var _0x32df=['paused','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','stopAcw','acwTimeout','YYYY-MM-DD\x20HH:mm:ss','updateAcw','finally','message','pauseType','saveUnpause','[ACW][TIMERS]','stringify','syncAgentConnect','[ACW][syncAgentConnect]\x20%s','acw','interface','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','deleteChannelAfterTimeout','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami','../../../config/logger','../rpc/user','voiceQueues','agents','timers','channels','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','prototype','lastPauseAt','timer','update','uniqueid','then','info','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','getAgent','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','available'];(function(_0x26604b,_0x56d4cc){var _0x16276c=function(_0x34ae98){while(--_0x34ae98){_0x26604b['push'](_0x26604b['shift']());}};_0x16276c(++_0x56d4cc);}(_0x32df,0x7d));var _0xf32d=function(_0x397e8d,_0x532637){_0x397e8d=_0x397e8d-0x0;var _0x173a32=_0x32df[_0x397e8d];return _0x173a32;};'use strict';var _=require(_0xf32d('0x0'));var moment=require(_0xf32d('0x1'));var ami=require(_0xf32d('0x2'));var logger=require(_0xf32d('0x3'))('acw');var RpcUser=require(_0xf32d('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x25997f){this[_0xf32d('0x5')]=_0x25997f[_0xf32d('0x5')];this[_0xf32d('0x6')]=_0x25997f[_0xf32d('0x6')];this[_0xf32d('0x7')]=_0x25997f['timers'];this[_0xf32d('0x8')]={};ami['on']('agentconnect',this['syncAgentConnect'][_0xf32d('0x9')](this));ami['on'](_0xf32d('0xa'),this[_0xf32d('0xb')][_0xf32d('0x9')](this));ami['on'](_0xf32d('0xc'),this[_0xf32d('0xd')][_0xf32d('0x9')](this));ami['on'](_0xf32d('0xe'),this[_0xf32d('0xf')][_0xf32d('0x9')](this));ami['on'](_0xf32d('0x10'),this[_0xf32d('0x11')][_0xf32d('0x9')](this));ami['on'](_0xf32d('0x12'),this[_0xf32d('0x13')][_0xf32d('0x9')](this));ami['on']('custom:agentConnectPreview',this[_0xf32d('0x14')][_0xf32d('0x9')](this));}function getDiff(_0x2a9dac){var _0x5552ec=moment()[_0xf32d('0x15')](0x0);var _0x145380=moment(_0x2a9dac)[_0xf32d('0x15')](0x0);return _0x5552ec[_0xf32d('0x16')](_0x145380,'seconds');}Acw[_0xf32d('0x17')]['updateAcw']=function(_0x5b82f4,_0x1f56b3){var _0x238ceb=this;var _0x290fd3=getDiff(_0x238ceb[_0xf32d('0x7')][_0x5b82f4][_0xf32d('0x18')]);clearTimeout(_0x238ceb[_0xf32d('0x7')][_0x5b82f4][_0xf32d('0x19')]);_0x238ceb[_0xf32d('0x7')][_0x5b82f4][_0xf32d('0x19')]=![];return RpcVoiceAgentReport[_0xf32d('0x1a')]({'acwtime':_0x290fd3},_0x238ceb['timers'][_0x5b82f4][_0xf32d('0x1b')],_0x5b82f4)[_0xf32d('0x1c')](function(_0x440418){logger[_0xf32d('0x1d')](_0xf32d('0x1e'),_0x1f56b3,_0x290fd3,_0x440418);})[_0xf32d('0x1f')](function(_0x2bf764){logger[_0xf32d('0x20')](_0xf32d('0x21'),_0x1f56b3,_0x2bf764);})['finally'](function(){delete _0x238ceb[_0xf32d('0x7')][_0x5b82f4];});};Acw[_0xf32d('0x17')][_0xf32d('0x22')]=function(_0x28d12d){try{var _0x311b5a=this;var _0x2a11b3=this[_0xf32d('0x8')][_0x28d12d]['interface'];var _0x16dee5=this['channels'][_0x28d12d][_0xf32d('0x23')];var _0x3e9aab=this['voiceQueues'][_0x16dee5];var _0x149968=![];var _0x5690ce=_0xf32d('0x24');if(_0x3e9aab[_0xf32d('0x25')]&&_0x3e9aab[_0xf32d('0x26')][_0xf32d('0x27')]){_0x149968=!![];_0x5690ce=_0x3e9aab[_0xf32d('0x26')][_0xf32d('0x27')];}return ami['Action']({'action':_0xf32d('0x28'),'interface':_0x2a11b3,'paused':!![],'reason':_0x5690ce})['then'](function(){if(_0x311b5a[_0xf32d('0x6')][_0x2a11b3]){return RpcUser[_0xf32d('0x29')](_0x311b5a[_0xf32d('0x6')][_0x2a11b3]['id'])[_0xf32d('0x1c')](function(_0x402635){if(!_0x402635||_0x402635[_0xf32d('0x2a')]){logger[_0xf32d('0x1d')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x28d12d,_0x2a11b3,_0x16dee5);return;}logger['info'](_0xf32d('0x2b'),_0x28d12d,_0x2a11b3,_0x16dee5);var _0x26d8e1=_0x311b5a[_0xf32d('0x8')][_0x28d12d][_0xf32d('0x2c')]&&_0x311b5a['channels'][_0x28d12d][_0xf32d('0x2d')]?_0x311b5a[_0xf32d('0x8')][_0x28d12d]['destlinkedid']:_0x28d12d;return RpcUser['savePause'](_0x311b5a[_0xf32d('0x6')][_0x2a11b3],_0x5690ce,_0x26d8e1)[_0xf32d('0x1c')](function(_0xccbfcd){_0x311b5a[_0xf32d('0x5')][_0x16dee5][_0xf32d('0x2e')]-=0x1;_0x311b5a[_0xf32d('0x5')][_0x16dee5][_0xf32d('0x2f')]+=0x1;return _0xccbfcd;});})[_0xf32d('0x1c')](function(_0x298b6c){if(_0x149968||!_0x298b6c){return;}_0x311b5a[_0xf32d('0x7')][_0x2a11b3]={};logger['info'](_0xf32d('0x30'),_0x28d12d,_0x311b5a[_0xf32d('0x5')][_0x16dee5]['acwTimeout'],_0x2a11b3,_0x16dee5);_0x311b5a['timers'][_0x2a11b3][_0xf32d('0x19')]=setTimeout(_0x311b5a[_0xf32d('0x31')][_0xf32d('0x9')](_0x311b5a,_0x2a11b3),_0x311b5a[_0xf32d('0x5')][_0x16dee5][_0xf32d('0x32')]*0x3e8);_0x311b5a[_0xf32d('0x7')][_0x2a11b3][_0xf32d('0x18')]=moment()['format'](_0xf32d('0x33'));_0x311b5a[_0xf32d('0x7')][_0x2a11b3]['uniqueid']=_0x28d12d;_0x311b5a[_0xf32d('0x7')][_0x2a11b3][_0xf32d('0x23')]=_0x16dee5;_0x311b5a[_0xf32d('0x7')][_0x2a11b3][_0xf32d('0x34')]=_0x311b5a[_0xf32d('0x34')][_0xf32d('0x9')](_0x311b5a,_0x2a11b3,_0x28d12d);});}})[_0xf32d('0x1f')](function(){logger[_0xf32d('0x20')](_0xf32d('0x30'),_0x28d12d,_0x311b5a[_0xf32d('0x5')][_0x16dee5]['acwTimeout'],_0x2a11b3,_0x16dee5);})[_0xf32d('0x35')](function(){delete _0x311b5a[_0xf32d('0x8')][_0x28d12d];});}catch(_0xb7528c){logger['error']('[ACW][START]\x20%s',_0xb7528c[_0xf32d('0x36')]);}};Acw[_0xf32d('0x17')][_0xf32d('0x31')]=function(_0x23ce7f){try{var _0x97bc21=this;if(_0x97bc21[_0xf32d('0x7')][_0x23ce7f]){_0x97bc21[_0xf32d('0x7')][_0x23ce7f][_0xf32d('0x19')]=![];var _0x180a81=_0x97bc21[_0xf32d('0x7')][_0x23ce7f]['uniqueid'];var _0x4f3fa9=_0x97bc21[_0xf32d('0x7')][_0x23ce7f]['queue'];var _0x17ebb0=_0x97bc21['voiceQueues'][_0x4f3fa9][_0xf32d('0x32')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x180a81,_0x23ce7f);RpcUser[_0xf32d('0x29')](this[_0xf32d('0x6')][_0x23ce7f]['id'])[_0xf32d('0x1c')](function(_0x49e40a){if(_0x49e40a[_0xf32d('0x37')]==='ACW'){return RpcUser[_0xf32d('0x38')](_0x97bc21['agents'][_0x23ce7f]);}});RpcVoiceAgentReport[_0xf32d('0x1a')]({'acwtime':_0x17ebb0,'agentacw':!![]},_0x180a81,_0x23ce7f)[_0xf32d('0x1c')](function(_0x4d9bfd){logger[_0xf32d('0x1d')](_0xf32d('0x1e'),_0x180a81,_0x17ebb0,_0x4d9bfd);})[_0xf32d('0x1f')](function(_0x1fa995){logger[_0xf32d('0x20')](_0xf32d('0x21'),_0x180a81,_0x1fa995);});}else{logger['error']('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x23ce7f);if(_0x97bc21[_0xf32d('0x7')]){logger[_0xf32d('0x1d')](_0xf32d('0x39'),JSON[_0xf32d('0x3a')](_0x97bc21[_0xf32d('0x7')]));}}}catch(_0x223b7a){logger['error']('[ACW][STOP]\x20%s',_0x223b7a['message']);}};Acw[_0xf32d('0x17')][_0xf32d('0x3b')]=function(_0x6b52fb){try{if(this[_0xf32d('0x5')][_0x6b52fb['queue']]&&(this[_0xf32d('0x5')][_0x6b52fb[_0xf32d('0x23')]]['acw']||this[_0xf32d('0x5')][_0x6b52fb[_0xf32d('0x23')]][_0xf32d('0x25')])){if(this['agents'][_0x6b52fb['interface']]){this['channels'][_0x6b52fb[_0xf32d('0x1b')]]={'queue':_0x6b52fb[_0xf32d('0x23')],'interface':_0x6b52fb['interface'],'destlinkedid':_0x6b52fb[_0xf32d('0x2d')]};}}}catch(_0x2c1bf6){logger[_0xf32d('0x20')](_0xf32d('0x3c'),_0x2c1bf6[_0xf32d('0x36')]);}};Acw[_0xf32d('0x17')][_0xf32d('0x14')]=function(_0x5c9ff){try{if(this['voiceQueues'][_0x5c9ff[_0xf32d('0x23')]]&&(this[_0xf32d('0x5')][_0x5c9ff[_0xf32d('0x23')]][_0xf32d('0x3d')]||this['voiceQueues'][_0x5c9ff[_0xf32d('0x23')]][_0xf32d('0x25')])){if(this[_0xf32d('0x6')][_0x5c9ff['interface']]){this[_0xf32d('0x8')][_0x5c9ff['uniqueid']]={'queue':_0x5c9ff[_0xf32d('0x23')],'interface':_0x5c9ff[_0xf32d('0x3e')]};}}}catch(_0x403b00){logger[_0xf32d('0x20')]('[ACW][syncAgentConnectPreview]\x20%s',_0x403b00[_0xf32d('0x36')]);}};Acw[_0xf32d('0x17')][_0xf32d('0xb')]=function(_0x5aa1c6){try{if(this['channels'][_0x5aa1c6[_0xf32d('0x1b')]]&&_['isUndefined'](this[_0xf32d('0x8')][_0x5aa1c6[_0xf32d('0x1b')]]['attended'])){logger[_0xf32d('0x1d')](_0xf32d('0x3f'),_0x5aa1c6[_0xf32d('0x1b')]);this[_0xf32d('0x22')](_0x5aa1c6[_0xf32d('0x1b')]);}else if(this[_0xf32d('0x8')][_0x5aa1c6[_0xf32d('0x40')]]&&_[_0xf32d('0x41')](this[_0xf32d('0x8')][_0x5aa1c6[_0xf32d('0x40')]][_0xf32d('0x2c')])){logger[_0xf32d('0x1d')](_0xf32d('0x42'),_0x5aa1c6[_0xf32d('0x40')]);this[_0xf32d('0x22')](_0x5aa1c6['linkedid']);}}catch(_0x2c76cb){logger[_0xf32d('0x20')]('[ACW][syncHangupRequest]\x20%s',_0x2c76cb[_0xf32d('0x36')]);}};Acw[_0xf32d('0x17')][_0xf32d('0xd')]=function(_0x26e2d8){try{if(this[_0xf32d('0x8')][_0x26e2d8['uniqueid']]&&this[_0xf32d('0x8')][_0x26e2d8[_0xf32d('0x1b')]][_0xf32d('0x2c')]){logger[_0xf32d('0x1d')](_0xf32d('0x43'),_0x26e2d8['uniqueid']);this[_0xf32d('0x22')](_0x26e2d8[_0xf32d('0x1b')]);}else if(this[_0xf32d('0x8')][_0x26e2d8[_0xf32d('0x40')]]&&this['channels'][_0x26e2d8[_0xf32d('0x40')]]['attended']){logger[_0xf32d('0x1d')](_0xf32d('0x44'),_0x26e2d8['linkedid']);this[_0xf32d('0x22')](_0x26e2d8['linkedid']);}}catch(_0x29f0c3){logger['error'](_0xf32d('0x45'),_0x29f0c3[_0xf32d('0x36')]);}};Acw[_0xf32d('0x17')]['syncAttendedTransfer']=function(_0xbc646a){try{if(!_['isNil'](this[_0xf32d('0x8')][_0xbc646a['transfereeuniqueid']])){this['startAcw'](_0xbc646a[_0xf32d('0x46')]);if(this['channels'][_0xbc646a[_0xf32d('0x47')]]){this[_0xf32d('0x8')][_0xbc646a['secondtransfereruniqueid']][_0xf32d('0x2c')]=!![];this[_0xf32d('0x8')][_0xbc646a[_0xf32d('0x48')]]=this[_0xf32d('0x8')][_0xbc646a['secondtransfereruniqueid']];this[_0xf32d('0x49')](_0xbc646a[_0xf32d('0x47')]);}}else if(!_[_0xf32d('0x4a')](this[_0xf32d('0x8')][_0xbc646a[_0xf32d('0x48')]])){this[_0xf32d('0x22')](_0xbc646a[_0xf32d('0x48')]);if(this[_0xf32d('0x8')][_0xbc646a[_0xf32d('0x4b')]]){this[_0xf32d('0x8')][_0xbc646a[_0xf32d('0x4b')]][_0xf32d('0x2c')]=!![];this[_0xf32d('0x8')][_0xbc646a['transfereeuniqueid']]=this[_0xf32d('0x8')][_0xbc646a[_0xf32d('0x4b')]];this[_0xf32d('0x49')](_0xbc646a[_0xf32d('0x4b')]);}}}catch(_0xc08d0d){logger['error'](_0xf32d('0x4c'),_0xc08d0d[_0xf32d('0x36')]);}};Acw[_0xf32d('0x17')][_0xf32d('0x13')]=function(_0x233f79){try{if(this[_0xf32d('0x8')][_0x233f79['transfereruniqueid']]){logger['info']('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xf32d('0x3a')](_0x233f79['transfereruniqueid']));this[_0xf32d('0x22')](_0x233f79[_0xf32d('0x4d')]);}else if(this[_0xf32d('0x8')][_0x233f79[_0xf32d('0x4e')]]){logger[_0xf32d('0x1d')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xf32d('0x3a')](_0x233f79[_0xf32d('0x4e')]));this[_0xf32d('0x22')](_0x233f79[_0xf32d('0x4e')]);}}catch(_0x5b1bce){logger[_0xf32d('0x20')](_0xf32d('0x4f'),_0x5b1bce[_0xf32d('0x36')]);}};Acw[_0xf32d('0x17')]['syncAgentRingNoAnswer']=function(_0xb64208){try{if(this[_0xf32d('0x5')][_0xb64208[_0xf32d('0x23')]]&&this[_0xf32d('0x5')][_0xb64208[_0xf32d('0x23')]][_0xf32d('0x50')]===_0xf32d('0x51')){if(this[_0xf32d('0x6')][_0xb64208[_0xf32d('0x3e')]]){logger[_0xf32d('0x1d')](_0xf32d('0x52'),_0xb64208[_0xf32d('0x1b')],_0xb64208[_0xf32d('0x3e')],_0xb64208['queue']);return RpcUser[_0xf32d('0x53')](this[_0xf32d('0x6')][_0xb64208[_0xf32d('0x3e')]],'Auto-Pause',_0xb64208['uniqueid']);}}}catch(_0x1b1159){logger[_0xf32d('0x20')](_0xf32d('0x54'),_0x1b1159['message']);}};Acw[_0xf32d('0x17')][_0xf32d('0x49')]=function(_0x3b7ebd,_0x1be09a=0x2710){if(this[_0xf32d('0x8')][_0x3b7ebd]){setTimeout(()=>{delete this[_0xf32d('0x8')][_0x3b7ebd];},_0x1be09a);}};module[_0xf32d('0x55')]=Acw;
\ No newline at end of file