Built motion from commit 47436d59.|2.6.7
[motion2.git] / server / services / ami / acw / index.js
index 05f5d4a..7435aa3 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2262=['attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','YYYY-MM-DD\x20HH:mm:ss','lastPauseAt','update','uniqueid','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','finally','message','[%s][TIMER][STOP][AGENT:%s]','[%s][UPDATE][ACWTIME:%s]','catch','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','voiceQueues','agents','timers','channels','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','syncAgentConnectPreview','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]'];(function(_0x22bbdf,_0x572a63){var _0x235359=function(_0x18c90e){while(--_0x18c90e){_0x22bbdf['push'](_0x22bbdf['shift']());}};_0x235359(++_0x572a63);}(_0x2262,0x80));var _0x2226=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2262[_0x20a584];return _0x4b41a8;};'use strict';var util=require(_0x2226('0x0'));var _=require(_0x2226('0x1'));var moment=require(_0x2226('0x2'));var ami=require(_0x2226('0x3'));var logger=require(_0x2226('0x4'))(_0x2226('0x5'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x11d020){this[_0x2226('0x6')]=_0x11d020['voiceQueues'];this['agents']=_0x11d020[_0x2226('0x7')];this[_0x2226('0x8')]=_0x11d020[_0x2226('0x8')];this[_0x2226('0x9')]={};ami['on']('agentconnect',this[_0x2226('0xa')][_0x2226('0xb')](this));ami['on'](_0x2226('0xc'),this[_0x2226('0xd')][_0x2226('0xb')](this));ami['on'](_0x2226('0xe'),this[_0x2226('0xf')][_0x2226('0xb')](this));ami['on'](_0x2226('0x10'),this[_0x2226('0x11')][_0x2226('0xb')](this));ami['on'](_0x2226('0x12'),this[_0x2226('0x13')][_0x2226('0xb')](this));ami['on'](_0x2226('0x14'),this[_0x2226('0x15')][_0x2226('0xb')](this));ami['on']('custom:agentConnectPreview',this[_0x2226('0x16')][_0x2226('0xb')](this));}function getDiff(_0x27a1bc){var _0x31c64c=moment()['milliseconds'](0x0);var _0x390211=moment(_0x27a1bc)['milliseconds'](0x0);return _0x31c64c['diff'](_0x390211,_0x2226('0x17'));}Acw[_0x2226('0x18')][_0x2226('0x19')]=function(_0x283c93){try{var _0x116db3=this;var _0x3a695b=this['channels'][_0x283c93][_0x2226('0x1a')];var _0x59637b=this[_0x2226('0x9')][_0x283c93][_0x2226('0x1b')];var _0x456d28=this[_0x2226('0x6')][_0x59637b];var _0x444dc1=![];var _0x20cc6e=_0x2226('0x1c');if(_0x456d28[_0x2226('0x1d')]){if(_0x456d28[_0x2226('0x1e')][_0x2226('0x1f')]){_0x444dc1=!![];_0x20cc6e=_0x456d28['mandatoryDispositionPause'][_0x2226('0x1f')];}}ami['Action']({'action':_0x2226('0x20'),'interface':_0x3a695b,'paused':!![],'reason':_0x20cc6e})[_0x2226('0x21')](function(_0x39b335){if(_0x116db3[_0x2226('0x7')][_0x3a695b]){return RpcUser[_0x2226('0x22')](_0x116db3[_0x2226('0x7')][_0x3a695b]['id'])[_0x2226('0x21')](function(_0x2a599b){if(_0x2a599b&&!_0x2a599b[_0x2226('0x23')]){logger[_0x2226('0x24')](_0x2226('0x25'),_0x283c93,_0x3a695b,_0x59637b);var _0x424ed4=_0x116db3[_0x2226('0x9')][_0x283c93][_0x2226('0x26')]&&_0x116db3['channels'][_0x283c93][_0x2226('0x27')]?_0x116db3[_0x2226('0x9')][_0x283c93]['destlinkedid']:_0x283c93;return RpcUser[_0x2226('0x28')](_0x116db3[_0x2226('0x7')][_0x3a695b],_0x20cc6e,_0x424ed4)['then'](function(_0x3478ae){if(!_0x444dc1){_0x116db3[_0x2226('0x8')][_0x3a695b]={};logger[_0x2226('0x24')](_0x2226('0x29'),_0x283c93,_0x116db3[_0x2226('0x6')][_0x59637b][_0x2226('0x2a')],_0x3a695b,_0x59637b);_0x116db3[_0x2226('0x8')][_0x3a695b][_0x2226('0x2b')]=setTimeout(_0x116db3[_0x2226('0x2c')][_0x2226('0xb')](_0x116db3,_0x3a695b),_0x116db3[_0x2226('0x6')][_0x59637b][_0x2226('0x2a')]*0x3e8);_0x116db3[_0x2226('0x8')][_0x3a695b]['lastPauseAt']=moment()['format'](_0x2226('0x2d'));_0x116db3['timers'][_0x3a695b]['uniqueid']=_0x283c93;_0x116db3[_0x2226('0x8')][_0x3a695b]['queue']=_0x59637b;_0x116db3[_0x2226('0x8')][_0x3a695b]['updateAcw']=function(){var _0x2970ef=getDiff(_0x116db3[_0x2226('0x8')][_0x3a695b][_0x2226('0x2e')]);clearTimeout(_0x116db3[_0x2226('0x8')][_0x3a695b][_0x2226('0x2b')]);_0x116db3[_0x2226('0x8')][_0x3a695b][_0x2226('0x2b')]=![];RpcVoiceAgentReport[_0x2226('0x2f')]({'acwtime':_0x2970ef},_0x116db3[_0x2226('0x8')][_0x3a695b][_0x2226('0x30')],_0x3a695b)['then'](function(_0x2188ea){logger[_0x2226('0x24')]('[%s][UPDATE][ACWTIME:%s]',_0x283c93,_0x2970ef,_0x2188ea);})['catch'](function(_0x1968c6){logger[_0x2226('0x31')](_0x2226('0x32'),_0x283c93,_0x1968c6);});delete _0x116db3[_0x2226('0x8')][_0x3a695b];};}});}else{logger['info'](_0x2226('0x33'),_0x283c93,_0x3a695b,_0x59637b);}});}})['catch'](function(_0x4f2b65){logger[_0x2226('0x31')](_0x2226('0x29'),_0x283c93,_0x116db3[_0x2226('0x6')][_0x59637b][_0x2226('0x2a')],_0x3a695b,_0x59637b);})[_0x2226('0x34')](function(){delete _0x116db3[_0x2226('0x9')][_0x283c93];});}catch(_0x18e3a7){logger['error']('[ACW][START]\x20%s',_0x18e3a7[_0x2226('0x35')]);}};Acw[_0x2226('0x18')][_0x2226('0x2c')]=function(_0x5e14ad){try{var _0x383031=this;if(_0x383031[_0x2226('0x8')][_0x5e14ad]){_0x383031[_0x2226('0x8')][_0x5e14ad][_0x2226('0x2b')]=![];var _0x53ccb4=_0x383031[_0x2226('0x8')][_0x5e14ad]['uniqueid'];var _0x3789ae=_0x383031[_0x2226('0x8')][_0x5e14ad]['queue'];var _0x502926=_0x383031[_0x2226('0x6')][_0x3789ae][_0x2226('0x2a')];logger[_0x2226('0x24')](_0x2226('0x36'),_0x53ccb4,_0x5e14ad);RpcUser['saveUnpause'](this[_0x2226('0x7')][_0x5e14ad]);RpcVoiceAgentReport[_0x2226('0x2f')]({'acwtime':_0x502926,'agentacw':!![]},_0x53ccb4,_0x5e14ad)[_0x2226('0x21')](function(_0x2945df){logger[_0x2226('0x24')](_0x2226('0x37'),_0x53ccb4,_0x502926,_0x2945df);})[_0x2226('0x38')](function(_0x21650f){logger['error'](_0x2226('0x32'),_0x53ccb4,_0x21650f);});}else{logger[_0x2226('0x31')](_0x2226('0x39'),_0x5e14ad);if(_0x383031[_0x2226('0x8')]){logger[_0x2226('0x24')](_0x2226('0x3a'),JSON[_0x2226('0x3b')](_0x383031[_0x2226('0x8')]));}}}catch(_0x6a770d){logger[_0x2226('0x31')]('[ACW][STOP]\x20%s',_0x6a770d['message']);}};Acw[_0x2226('0x18')]['syncAgentConnect']=function(_0x5b71c5){try{if(this[_0x2226('0x6')][_0x5b71c5[_0x2226('0x1b')]]&&(this[_0x2226('0x6')][_0x5b71c5[_0x2226('0x1b')]][_0x2226('0x5')]||this[_0x2226('0x6')][_0x5b71c5[_0x2226('0x1b')]][_0x2226('0x1d')])){if(this[_0x2226('0x7')][_0x5b71c5[_0x2226('0x1a')]]){this[_0x2226('0x9')][_0x5b71c5[_0x2226('0x30')]]={'queue':_0x5b71c5[_0x2226('0x1b')],'interface':_0x5b71c5[_0x2226('0x1a')],'destlinkedid':_0x5b71c5[_0x2226('0x27')]};}}}catch(_0x56e1d3){logger[_0x2226('0x31')](_0x2226('0x3c'),_0x56e1d3[_0x2226('0x35')]);}};Acw[_0x2226('0x18')][_0x2226('0x16')]=function(_0x407e21){try{if(this[_0x2226('0x6')][_0x407e21[_0x2226('0x1b')]]&&(this[_0x2226('0x6')][_0x407e21[_0x2226('0x1b')]][_0x2226('0x5')]||this[_0x2226('0x6')][_0x407e21['queue']][_0x2226('0x1d')])){if(this[_0x2226('0x7')][_0x407e21[_0x2226('0x1a')]]){this[_0x2226('0x9')][_0x407e21['uniqueid']]={'queue':_0x407e21[_0x2226('0x1b')],'interface':_0x407e21['interface']};}}}catch(_0x83e98d){logger[_0x2226('0x31')](_0x2226('0x3d'),_0x83e98d[_0x2226('0x35')]);}};Acw[_0x2226('0x18')]['syncHangupRequest']=function(_0x2049ff){try{if(this['channels'][_0x2049ff['uniqueid']]&&_[_0x2226('0x3e')](this['channels'][_0x2049ff[_0x2226('0x30')]]['attended'])){logger[_0x2226('0x24')](_0x2226('0x3f'),_0x2049ff[_0x2226('0x30')]);this[_0x2226('0x19')](_0x2049ff[_0x2226('0x30')]);}else if(this['channels'][_0x2049ff[_0x2226('0x40')]]&&_[_0x2226('0x3e')](this[_0x2226('0x9')][_0x2049ff[_0x2226('0x40')]][_0x2226('0x26')])){logger[_0x2226('0x24')](_0x2226('0x41'),_0x2049ff['linkedid']);this[_0x2226('0x19')](_0x2049ff['linkedid']);}}catch(_0xbcdff8){logger[_0x2226('0x31')]('[ACW][syncHangupRequest]\x20%s',_0xbcdff8[_0x2226('0x35')]);}};Acw[_0x2226('0x18')][_0x2226('0xf')]=function(_0x3b4fdb){try{if(this['channels'][_0x3b4fdb['uniqueid']]&&this['channels'][_0x3b4fdb['uniqueid']][_0x2226('0x26')]){logger[_0x2226('0x24')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x3b4fdb[_0x2226('0x30')]);this['startAcw'](_0x3b4fdb['uniqueid']);}else if(this[_0x2226('0x9')][_0x3b4fdb[_0x2226('0x40')]]&&this['channels'][_0x3b4fdb[_0x2226('0x40')]]['attended']){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x3b4fdb[_0x2226('0x40')]);this[_0x2226('0x19')](_0x3b4fdb[_0x2226('0x40')]);}}catch(_0xe40a3d){logger['error'](_0x2226('0x42'),_0xe40a3d[_0x2226('0x35')]);}};Acw[_0x2226('0x18')][_0x2226('0x13')]=function(_0x8415ed){try{if(!_[_0x2226('0x43')](this['channels'][_0x8415ed['transfereeuniqueid']])){this[_0x2226('0x19')](_0x8415ed[_0x2226('0x44')]);if(this[_0x2226('0x9')][_0x8415ed['secondtransfereruniqueid']]){this[_0x2226('0x9')][_0x8415ed[_0x2226('0x45')]][_0x2226('0x26')]=!![];this[_0x2226('0x9')][_0x8415ed[_0x2226('0x46')]]=this['channels'][_0x8415ed[_0x2226('0x45')]];delete this[_0x2226('0x9')][_0x8415ed[_0x2226('0x45')]];}}else if(!_[_0x2226('0x43')](this[_0x2226('0x9')][_0x8415ed[_0x2226('0x46')]])){this[_0x2226('0x19')](_0x8415ed['transfertargetuniqueid']);if(this[_0x2226('0x9')][_0x8415ed['origtransfereruniqueid']]){this[_0x2226('0x9')][_0x8415ed['origtransfereruniqueid']]['attended']=!![];this['channels'][_0x8415ed[_0x2226('0x44')]]=this[_0x2226('0x9')][_0x8415ed['origtransfereruniqueid']];delete this['channels'][_0x8415ed[_0x2226('0x47')]];}}}catch(_0x3ad49d){logger[_0x2226('0x31')](_0x2226('0x48'),_0x3ad49d[_0x2226('0x35')]);}};Acw[_0x2226('0x18')][_0x2226('0x15')]=function(_0x5650a4){try{if(this[_0x2226('0x9')][_0x5650a4['transfereruniqueid']]){logger[_0x2226('0x24')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0x2226('0x3b')](_0x5650a4[_0x2226('0x49')]));this[_0x2226('0x19')](_0x5650a4[_0x2226('0x49')]);}else if(this['channels'][_0x5650a4[_0x2226('0x4a')]]){logger[_0x2226('0x24')](_0x2226('0x4b'),JSON['stringify'](_0x5650a4['transfererlinkedid']));this[_0x2226('0x19')](_0x5650a4['transfererlinkedid']);}}catch(_0x45e5ab){logger[_0x2226('0x31')](_0x2226('0x4c'),_0x45e5ab['message']);}};Acw[_0x2226('0x18')][_0x2226('0x11')]=function(_0x153351){try{if(this['voiceQueues'][_0x153351[_0x2226('0x1b')]]&&this[_0x2226('0x6')][_0x153351[_0x2226('0x1b')]][_0x2226('0x4d')]===_0x2226('0x4e')){if(this[_0x2226('0x7')][_0x153351[_0x2226('0x1a')]]){logger['info'](_0x2226('0x4f'),_0x153351[_0x2226('0x30')],_0x153351[_0x2226('0x1a')],_0x153351['queue']);return RpcUser[_0x2226('0x28')](this['agents'][_0x153351[_0x2226('0x1a')]],_0x2226('0x50'),_0x153351[_0x2226('0x30')]);}}}catch(_0x493349){logger['error'](_0x2226('0x51'),_0x493349[_0x2226('0x35')]);}};module[_0x2226('0x52')]=Acw;
\ No newline at end of file
+var _0x9842=['transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','../ami','../../../config/logger','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','attendedtransfer','blindtransfer','milliseconds','diff','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','voicePause','info','destlinkedid','timer','stopAcw','acwTimeout','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid'];(function(_0x3cc765,_0x59490a){var _0x12da47=function(_0x17cefe){while(--_0x17cefe){_0x3cc765['push'](_0x3cc765['shift']());}};_0x12da47(++_0x59490a);}(_0x9842,0x1a5));var _0x2984=function(_0x1f1cd4,_0x4a52c9){_0x1f1cd4=_0x1f1cd4-0x0;var _0x2c4bac=_0x9842[_0x1f1cd4];return _0x2c4bac;};'use strict';var util=require(_0x2984('0x0'));var _=require(_0x2984('0x1'));var moment=require('moment');var ami=require(_0x2984('0x2'));var logger=require(_0x2984('0x3'))('acw');var RpcUser=require(_0x2984('0x4'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x24db76){this[_0x2984('0x5')]=_0x24db76['voiceQueues'];this[_0x2984('0x6')]=_0x24db76[_0x2984('0x6')];this['timers']=_0x24db76[_0x2984('0x7')];this[_0x2984('0x8')]={};ami['on'](_0x2984('0x9'),this[_0x2984('0xa')][_0x2984('0xb')](this));ami['on'](_0x2984('0xc'),this[_0x2984('0xd')][_0x2984('0xb')](this));ami['on'](_0x2984('0xe'),this['syncHangup']['bind'](this));ami['on'](_0x2984('0xf'),this['syncAgentRingNoAnswer'][_0x2984('0xb')](this));ami['on'](_0x2984('0x10'),this['syncAttendedTransfer'][_0x2984('0xb')](this));ami['on'](_0x2984('0x11'),this['syncBlindTransfer']['bind'](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x2984('0xb')](this));}function getDiff(_0x305090){var _0x173c60=moment()[_0x2984('0x12')](0x0);var _0x25b554=moment(_0x305090)[_0x2984('0x12')](0x0);return _0x173c60[_0x2984('0x13')](_0x25b554,'seconds');}Acw[_0x2984('0x14')][_0x2984('0x15')]=function(_0x419718){try{var _0xaf7aa=this;var _0x17a0b7=this[_0x2984('0x8')][_0x419718][_0x2984('0x16')];var _0x140caa=this[_0x2984('0x8')][_0x419718][_0x2984('0x17')];var _0x1d78dc=this[_0x2984('0x5')][_0x140caa];var _0x65bef9=![];var _0x571ad1=_0x2984('0x18');if(_0x1d78dc[_0x2984('0x19')]){if(_0x1d78dc[_0x2984('0x1a')]['name']){_0x65bef9=!![];_0x571ad1=_0x1d78dc['mandatoryDispositionPause'][_0x2984('0x1b')];}}ami['Action']({'action':_0x2984('0x1c'),'interface':_0x17a0b7,'paused':!![],'reason':_0x571ad1})[_0x2984('0x1d')](function(_0x4721a5){if(_0xaf7aa[_0x2984('0x6')][_0x17a0b7]){return RpcUser['getAgent'](_0xaf7aa[_0x2984('0x6')][_0x17a0b7]['id'])[_0x2984('0x1d')](function(_0x55b1f6){if(_0x55b1f6&&!_0x55b1f6[_0x2984('0x1e')]){logger[_0x2984('0x1f')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x419718,_0x17a0b7,_0x140caa);var _0xe6944e=_0xaf7aa[_0x2984('0x8')][_0x419718]['attended']&&_0xaf7aa['channels'][_0x419718][_0x2984('0x20')]?_0xaf7aa[_0x2984('0x8')][_0x419718][_0x2984('0x20')]:_0x419718;return RpcUser['savePause'](_0xaf7aa[_0x2984('0x6')][_0x17a0b7],_0x571ad1,_0xe6944e)['then'](function(_0x7e5bb7){if(!_0x65bef9){_0xaf7aa[_0x2984('0x7')][_0x17a0b7]={};logger[_0x2984('0x1f')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x419718,_0xaf7aa[_0x2984('0x5')][_0x140caa]['acwTimeout'],_0x17a0b7,_0x140caa);_0xaf7aa[_0x2984('0x7')][_0x17a0b7][_0x2984('0x21')]=setTimeout(_0xaf7aa[_0x2984('0x22')][_0x2984('0xb')](_0xaf7aa,_0x17a0b7),_0xaf7aa[_0x2984('0x5')][_0x140caa][_0x2984('0x23')]*0x3e8);_0xaf7aa['timers'][_0x17a0b7][_0x2984('0x24')]=moment()['format'](_0x2984('0x25'));_0xaf7aa[_0x2984('0x7')][_0x17a0b7][_0x2984('0x26')]=_0x419718;_0xaf7aa['timers'][_0x17a0b7][_0x2984('0x17')]=_0x140caa;_0xaf7aa[_0x2984('0x7')][_0x17a0b7][_0x2984('0x27')]=function(){var _0x4cd0bb=getDiff(_0xaf7aa['timers'][_0x17a0b7]['lastPauseAt']);clearTimeout(_0xaf7aa[_0x2984('0x7')][_0x17a0b7][_0x2984('0x21')]);_0xaf7aa['timers'][_0x17a0b7][_0x2984('0x21')]=![];RpcVoiceAgentReport[_0x2984('0x28')]({'acwtime':_0x4cd0bb},_0xaf7aa[_0x2984('0x7')][_0x17a0b7][_0x2984('0x26')],_0x17a0b7)[_0x2984('0x1d')](function(_0x372329){logger[_0x2984('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x419718,_0x4cd0bb,_0x372329);})[_0x2984('0x29')](function(_0x1808c4){logger[_0x2984('0x2a')](_0x2984('0x2b'),_0x419718,_0x1808c4);});delete _0xaf7aa[_0x2984('0x7')][_0x17a0b7];};}});}else{logger[_0x2984('0x1f')](_0x2984('0x2c'),_0x419718,_0x17a0b7,_0x140caa);}});}})[_0x2984('0x29')](function(_0x32ef89){logger[_0x2984('0x2a')](_0x2984('0x2d'),_0x419718,_0xaf7aa[_0x2984('0x5')][_0x140caa][_0x2984('0x23')],_0x17a0b7,_0x140caa);})[_0x2984('0x2e')](function(){delete _0xaf7aa['channels'][_0x419718];});}catch(_0x233142){logger[_0x2984('0x2a')]('[ACW][START]\x20%s',_0x233142[_0x2984('0x2f')]);}};Acw[_0x2984('0x14')]['stopAcw']=function(_0x10e345){try{var _0x1bc1a9=this;if(_0x1bc1a9['timers'][_0x10e345]){_0x1bc1a9[_0x2984('0x7')][_0x10e345][_0x2984('0x21')]=![];var _0x474496=_0x1bc1a9['timers'][_0x10e345][_0x2984('0x26')];var _0x257c92=_0x1bc1a9[_0x2984('0x7')][_0x10e345][_0x2984('0x17')];var _0x377aef=_0x1bc1a9[_0x2984('0x5')][_0x257c92][_0x2984('0x23')];logger['info'](_0x2984('0x30'),_0x474496,_0x10e345);RpcUser[_0x2984('0x31')](this[_0x2984('0x6')][_0x10e345]);RpcVoiceAgentReport[_0x2984('0x28')]({'acwtime':_0x377aef,'agentacw':!![]},_0x474496,_0x10e345)[_0x2984('0x1d')](function(_0x303e6d){logger[_0x2984('0x1f')]('[%s][UPDATE][ACWTIME:%s]',_0x474496,_0x377aef,_0x303e6d);})['catch'](function(_0x1a243b){logger[_0x2984('0x2a')](_0x2984('0x2b'),_0x474496,_0x1a243b);});}else{logger[_0x2984('0x2a')](_0x2984('0x32'),_0x10e345);if(_0x1bc1a9['timers']){logger['info'](_0x2984('0x33'),JSON['stringify'](_0x1bc1a9['timers']));}}}catch(_0x2e87d3){logger['error'](_0x2984('0x34'),_0x2e87d3[_0x2984('0x2f')]);}};Acw[_0x2984('0x14')][_0x2984('0xa')]=function(_0x10b8c1){try{if(this[_0x2984('0x5')][_0x10b8c1['queue']]&&(this[_0x2984('0x5')][_0x10b8c1[_0x2984('0x17')]][_0x2984('0x35')]||this[_0x2984('0x5')][_0x10b8c1[_0x2984('0x17')]]['mandatoryDisposition'])){if(this['agents'][_0x10b8c1[_0x2984('0x16')]]){this[_0x2984('0x8')][_0x10b8c1['uniqueid']]={'queue':_0x10b8c1['queue'],'interface':_0x10b8c1[_0x2984('0x16')],'destlinkedid':_0x10b8c1['destlinkedid']};}}}catch(_0x1a3c83){logger[_0x2984('0x2a')]('[ACW][syncAgentConnect]\x20%s',_0x1a3c83['message']);}};Acw['prototype']['syncAgentConnectPreview']=function(_0x4e0b76){try{if(this[_0x2984('0x5')][_0x4e0b76[_0x2984('0x17')]]&&(this['voiceQueues'][_0x4e0b76[_0x2984('0x17')]]['acw']||this['voiceQueues'][_0x4e0b76[_0x2984('0x17')]][_0x2984('0x19')])){if(this['agents'][_0x4e0b76['interface']]){this[_0x2984('0x8')][_0x4e0b76[_0x2984('0x26')]]={'queue':_0x4e0b76['queue'],'interface':_0x4e0b76[_0x2984('0x16')]};}}}catch(_0x2a7313){logger[_0x2984('0x2a')](_0x2984('0x36'),_0x2a7313[_0x2984('0x2f')]);}};Acw[_0x2984('0x14')]['syncHangupRequest']=function(_0x4e1cf0){try{if(this[_0x2984('0x8')][_0x4e1cf0[_0x2984('0x26')]]&&_[_0x2984('0x37')](this[_0x2984('0x8')][_0x4e1cf0[_0x2984('0x26')]][_0x2984('0x38')])){logger[_0x2984('0x1f')](_0x2984('0x39'),_0x4e1cf0[_0x2984('0x26')]);this['startAcw'](_0x4e1cf0['uniqueid']);}else if(this[_0x2984('0x8')][_0x4e1cf0['linkedid']]&&_[_0x2984('0x37')](this[_0x2984('0x8')][_0x4e1cf0[_0x2984('0x3a')]][_0x2984('0x38')])){logger[_0x2984('0x1f')]('[%s][HANGUP:LINKEDID]',_0x4e1cf0[_0x2984('0x3a')]);this[_0x2984('0x15')](_0x4e1cf0[_0x2984('0x3a')]);}}catch(_0x3de74a){logger[_0x2984('0x2a')](_0x2984('0x3b'),_0x3de74a[_0x2984('0x2f')]);}};Acw['prototype']['syncHangup']=function(_0x322206){try{if(this['channels'][_0x322206[_0x2984('0x26')]]&&this[_0x2984('0x8')][_0x322206['uniqueid']][_0x2984('0x38')]){logger[_0x2984('0x1f')](_0x2984('0x3c'),_0x322206[_0x2984('0x26')]);this[_0x2984('0x15')](_0x322206[_0x2984('0x26')]);}else if(this[_0x2984('0x8')][_0x322206[_0x2984('0x3a')]]&&this[_0x2984('0x8')][_0x322206[_0x2984('0x3a')]][_0x2984('0x38')]){logger[_0x2984('0x1f')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x322206['linkedid']);this['startAcw'](_0x322206[_0x2984('0x3a')]);}}catch(_0x21d34d){logger[_0x2984('0x2a')](_0x2984('0x3d'),_0x21d34d[_0x2984('0x2f')]);}};Acw['prototype']['syncAttendedTransfer']=function(_0x1eadaa){try{if(!_[_0x2984('0x3e')](this['channels'][_0x1eadaa[_0x2984('0x3f')]])){this['startAcw'](_0x1eadaa['transfereeuniqueid']);if(this['channels'][_0x1eadaa[_0x2984('0x40')]]){this['channels'][_0x1eadaa[_0x2984('0x40')]][_0x2984('0x38')]=!![];this[_0x2984('0x8')][_0x1eadaa[_0x2984('0x41')]]=this['channels'][_0x1eadaa['secondtransfereruniqueid']];delete this[_0x2984('0x8')][_0x1eadaa[_0x2984('0x40')]];}}else if(!_[_0x2984('0x3e')](this[_0x2984('0x8')][_0x1eadaa[_0x2984('0x41')]])){this[_0x2984('0x15')](_0x1eadaa['transfertargetuniqueid']);if(this[_0x2984('0x8')][_0x1eadaa[_0x2984('0x42')]]){this[_0x2984('0x8')][_0x1eadaa[_0x2984('0x42')]][_0x2984('0x38')]=!![];this[_0x2984('0x8')][_0x1eadaa[_0x2984('0x3f')]]=this[_0x2984('0x8')][_0x1eadaa[_0x2984('0x42')]];delete this[_0x2984('0x8')][_0x1eadaa[_0x2984('0x42')]];}}}catch(_0x32d6c6){logger[_0x2984('0x2a')](_0x2984('0x43'),_0x32d6c6[_0x2984('0x2f')]);}};Acw[_0x2984('0x14')][_0x2984('0x44')]=function(_0x39c7f0){try{if(this[_0x2984('0x8')][_0x39c7f0[_0x2984('0x45')]]){logger[_0x2984('0x1f')](_0x2984('0x46'),JSON[_0x2984('0x47')](_0x39c7f0[_0x2984('0x45')]));this[_0x2984('0x15')](_0x39c7f0[_0x2984('0x45')]);}else if(this[_0x2984('0x8')][_0x39c7f0[_0x2984('0x48')]]){logger['info'](_0x2984('0x49'),JSON[_0x2984('0x47')](_0x39c7f0[_0x2984('0x48')]));this[_0x2984('0x15')](_0x39c7f0['transfererlinkedid']);}}catch(_0x1ee7d1){logger[_0x2984('0x2a')](_0x2984('0x4a'),_0x1ee7d1[_0x2984('0x2f')]);}};Acw[_0x2984('0x14')][_0x2984('0x4b')]=function(_0x35af0b){try{if(this['voiceQueues'][_0x35af0b[_0x2984('0x17')]]&&this[_0x2984('0x5')][_0x35af0b['queue']][_0x2984('0x4c')]===_0x2984('0x4d')){if(this[_0x2984('0x6')][_0x35af0b['interface']]){logger['info'](_0x2984('0x4e'),_0x35af0b[_0x2984('0x26')],_0x35af0b[_0x2984('0x16')],_0x35af0b[_0x2984('0x17')]);return RpcUser[_0x2984('0x4f')](this[_0x2984('0x6')][_0x35af0b['interface']],'Auto-Pause',_0x35af0b[_0x2984('0x26')]);}}}catch(_0x4761a2){logger[_0x2984('0x2a')](_0x2984('0x50'),_0x4761a2[_0x2984('0x2f')]);}};module['exports']=Acw;
\ No newline at end of file