Built motion from commit 44377920.|2.6.11
[motion2.git] / server / services / ami / acw / index.js
index 5f52648..b570140 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf324=['[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','interface','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','syncBlindTransfer','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','moment','../ami','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','acwTimeout','finally','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause'];(function(_0x4eaa4c,_0x2f7422){var _0x15aec6=function(_0x23efc9){while(--_0x23efc9){_0x4eaa4c['push'](_0x4eaa4c['shift']());}};_0x15aec6(++_0x2f7422);}(_0xf324,0xcb));var _0x4f32=function(_0x401c79,_0x1ebeed){_0x401c79=_0x401c79-0x0;var _0x24c591=_0xf324[_0x401c79];return _0x24c591;};'use strict';var _=require('lodash');var moment=require(_0x4f32('0x0'));var ami=require(_0x4f32('0x1'));var logger=require(_0x4f32('0x2'))(_0x4f32('0x3'));var RpcUser=require(_0x4f32('0x4'));var RpcVoiceAgentReport=require(_0x4f32('0x5'));function Acw(_0x4ee943){this[_0x4f32('0x6')]=_0x4ee943[_0x4f32('0x6')];this[_0x4f32('0x7')]=_0x4ee943[_0x4f32('0x7')];this['timers']=_0x4ee943[_0x4f32('0x8')];this[_0x4f32('0x9')]={};ami['on'](_0x4f32('0xa'),this['syncAgentConnect'][_0x4f32('0xb')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0x4f32('0xb')](this));ami['on'](_0x4f32('0xc'),this[_0x4f32('0xd')][_0x4f32('0xb')](this));ami['on'](_0x4f32('0xe'),this[_0x4f32('0xf')]['bind'](this));ami['on'](_0x4f32('0x10'),this[_0x4f32('0x11')][_0x4f32('0xb')](this));ami['on']('blindtransfer',this['syncBlindTransfer']['bind'](this));ami['on']('custom:agentConnectPreview',this[_0x4f32('0x12')][_0x4f32('0xb')](this));}function getDiff(_0x3b3ab0){var _0xb458ec=moment()[_0x4f32('0x13')](0x0);var _0x421db4=moment(_0x3b3ab0)[_0x4f32('0x13')](0x0);return _0xb458ec['diff'](_0x421db4,_0x4f32('0x14'));}Acw[_0x4f32('0x15')][_0x4f32('0x16')]=function(_0x324ff1){try{var _0x13fc83=this;var _0x4009b1=this[_0x4f32('0x9')][_0x324ff1]['interface'];var _0x4b3ad6=this[_0x4f32('0x9')][_0x324ff1][_0x4f32('0x17')];var _0x116556=this[_0x4f32('0x6')][_0x4b3ad6];var _0x4a199b=![];var _0xc8b12e=_0x4f32('0x18');if(_0x116556[_0x4f32('0x19')]){if(_0x116556[_0x4f32('0x1a')][_0x4f32('0x1b')]){_0x4a199b=!![];_0xc8b12e=_0x116556['mandatoryDispositionPause'][_0x4f32('0x1b')];}}return ami['Action']({'action':_0x4f32('0x1c'),'interface':_0x4009b1,'paused':!![],'reason':_0xc8b12e})[_0x4f32('0x1d')](function(){if(_0x13fc83[_0x4f32('0x7')][_0x4009b1]){return RpcUser[_0x4f32('0x1e')](_0x13fc83['agents'][_0x4009b1]['id'])[_0x4f32('0x1d')](function(_0x3c8177){if(_0x3c8177&&!_0x3c8177[_0x4f32('0x1f')]){logger[_0x4f32('0x20')](_0x4f32('0x21'),_0x324ff1,_0x4009b1,_0x4b3ad6);var _0x4f0e7e=_0x13fc83[_0x4f32('0x9')][_0x324ff1][_0x4f32('0x22')]&&_0x13fc83[_0x4f32('0x9')][_0x324ff1]['destlinkedid']?_0x13fc83[_0x4f32('0x9')][_0x324ff1]['destlinkedid']:_0x324ff1;return RpcUser[_0x4f32('0x23')](_0x13fc83['agents'][_0x4009b1],_0xc8b12e,_0x4f0e7e)[_0x4f32('0x1d')](function(){if(!_0x4a199b){_0x13fc83[_0x4f32('0x8')][_0x4009b1]={};logger[_0x4f32('0x20')](_0x4f32('0x24'),_0x324ff1,_0x13fc83[_0x4f32('0x6')][_0x4b3ad6]['acwTimeout'],_0x4009b1,_0x4b3ad6);_0x13fc83[_0x4f32('0x8')][_0x4009b1][_0x4f32('0x25')]=setTimeout(_0x13fc83[_0x4f32('0x26')][_0x4f32('0xb')](_0x13fc83,_0x4009b1),_0x13fc83['voiceQueues'][_0x4b3ad6]['acwTimeout']*0x3e8);_0x13fc83[_0x4f32('0x8')][_0x4009b1][_0x4f32('0x27')]=moment()[_0x4f32('0x28')](_0x4f32('0x29'));_0x13fc83[_0x4f32('0x8')][_0x4009b1][_0x4f32('0x2a')]=_0x324ff1;_0x13fc83[_0x4f32('0x8')][_0x4009b1][_0x4f32('0x17')]=_0x4b3ad6;_0x13fc83[_0x4f32('0x8')][_0x4009b1][_0x4f32('0x2b')]=function(){var _0x1705de=getDiff(_0x13fc83[_0x4f32('0x8')][_0x4009b1][_0x4f32('0x27')]);clearTimeout(_0x13fc83[_0x4f32('0x8')][_0x4009b1][_0x4f32('0x25')]);_0x13fc83[_0x4f32('0x8')][_0x4009b1][_0x4f32('0x25')]=![];RpcVoiceAgentReport[_0x4f32('0x2c')]({'acwtime':_0x1705de},_0x13fc83['timers'][_0x4009b1]['uniqueid'],_0x4009b1)[_0x4f32('0x1d')](function(_0x5458b8){logger['info'](_0x4f32('0x2d'),_0x324ff1,_0x1705de,_0x5458b8);})[_0x4f32('0x2e')](function(_0x152520){logger[_0x4f32('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x324ff1,_0x152520);});delete _0x13fc83[_0x4f32('0x8')][_0x4009b1];};}});}else{logger[_0x4f32('0x20')](_0x4f32('0x30'),_0x324ff1,_0x4009b1,_0x4b3ad6);}});}})[_0x4f32('0x2e')](function(){logger[_0x4f32('0x2f')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x324ff1,_0x13fc83['voiceQueues'][_0x4b3ad6][_0x4f32('0x31')],_0x4009b1,_0x4b3ad6);})[_0x4f32('0x32')](function(){delete _0x13fc83['channels'][_0x324ff1];});}catch(_0x3e2a5e){logger['error'](_0x4f32('0x33'),_0x3e2a5e[_0x4f32('0x34')]);}};Acw[_0x4f32('0x15')][_0x4f32('0x26')]=function(_0x16baef){try{var _0x2c089b=this;if(_0x2c089b[_0x4f32('0x8')][_0x16baef]){_0x2c089b[_0x4f32('0x8')][_0x16baef][_0x4f32('0x25')]=![];var _0x3fddb7=_0x2c089b[_0x4f32('0x8')][_0x16baef][_0x4f32('0x2a')];var _0x24e24d=_0x2c089b[_0x4f32('0x8')][_0x16baef][_0x4f32('0x17')];var _0x3565eb=_0x2c089b[_0x4f32('0x6')][_0x24e24d]['acwTimeout'];logger[_0x4f32('0x20')](_0x4f32('0x35'),_0x3fddb7,_0x16baef);RpcUser[_0x4f32('0x36')](this[_0x4f32('0x7')][_0x16baef]);RpcVoiceAgentReport[_0x4f32('0x2c')]({'acwtime':_0x3565eb,'agentacw':!![]},_0x3fddb7,_0x16baef)[_0x4f32('0x1d')](function(_0x2c3b52){logger[_0x4f32('0x20')]('[%s][UPDATE][ACWTIME:%s]',_0x3fddb7,_0x3565eb,_0x2c3b52);})['catch'](function(_0x45ca8a){logger[_0x4f32('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x3fddb7,_0x45ca8a);});}else{logger[_0x4f32('0x2f')](_0x4f32('0x37'),_0x16baef);if(_0x2c089b[_0x4f32('0x8')]){logger[_0x4f32('0x20')](_0x4f32('0x38'),JSON[_0x4f32('0x39')](_0x2c089b[_0x4f32('0x8')]));}}}catch(_0x2a99ad){logger[_0x4f32('0x2f')](_0x4f32('0x3a'),_0x2a99ad[_0x4f32('0x34')]);}};Acw[_0x4f32('0x15')][_0x4f32('0x3b')]=function(_0x234fce){try{if(this[_0x4f32('0x6')][_0x234fce[_0x4f32('0x17')]]&&(this[_0x4f32('0x6')][_0x234fce[_0x4f32('0x17')]][_0x4f32('0x3')]||this[_0x4f32('0x6')][_0x234fce[_0x4f32('0x17')]]['mandatoryDisposition'])){if(this[_0x4f32('0x7')][_0x234fce[_0x4f32('0x3c')]]){this['channels'][_0x234fce[_0x4f32('0x2a')]]={'queue':_0x234fce[_0x4f32('0x17')],'interface':_0x234fce['interface'],'destlinkedid':_0x234fce['destlinkedid']};}}}catch(_0x340605){logger[_0x4f32('0x2f')]('[ACW][syncAgentConnect]\x20%s',_0x340605[_0x4f32('0x34')]);}};Acw['prototype'][_0x4f32('0x12')]=function(_0x291aca){try{if(this[_0x4f32('0x6')][_0x291aca['queue']]&&(this['voiceQueues'][_0x291aca[_0x4f32('0x17')]][_0x4f32('0x3')]||this['voiceQueues'][_0x291aca['queue']]['mandatoryDisposition'])){if(this[_0x4f32('0x7')][_0x291aca['interface']]){this['channels'][_0x291aca[_0x4f32('0x2a')]]={'queue':_0x291aca[_0x4f32('0x17')],'interface':_0x291aca['interface']};}}}catch(_0x1b4437){logger['error'](_0x4f32('0x3d'),_0x1b4437['message']);}};Acw[_0x4f32('0x15')][_0x4f32('0x3e')]=function(_0x546938){try{if(this[_0x4f32('0x9')][_0x546938['uniqueid']]&&_[_0x4f32('0x3f')](this['channels'][_0x546938[_0x4f32('0x2a')]]['attended'])){logger[_0x4f32('0x20')](_0x4f32('0x40'),_0x546938[_0x4f32('0x2a')]);this[_0x4f32('0x16')](_0x546938[_0x4f32('0x2a')]);}else if(this[_0x4f32('0x9')][_0x546938[_0x4f32('0x41')]]&&_[_0x4f32('0x3f')](this[_0x4f32('0x9')][_0x546938[_0x4f32('0x41')]][_0x4f32('0x22')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x546938[_0x4f32('0x41')]);this['startAcw'](_0x546938[_0x4f32('0x41')]);}}catch(_0xe58d81){logger[_0x4f32('0x2f')](_0x4f32('0x42'),_0xe58d81[_0x4f32('0x34')]);}};Acw[_0x4f32('0x15')][_0x4f32('0xd')]=function(_0xe10007){try{if(this[_0x4f32('0x9')][_0xe10007[_0x4f32('0x2a')]]&&this[_0x4f32('0x9')][_0xe10007[_0x4f32('0x2a')]][_0x4f32('0x22')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0xe10007[_0x4f32('0x2a')]);this['startAcw'](_0xe10007[_0x4f32('0x2a')]);}else if(this['channels'][_0xe10007[_0x4f32('0x41')]]&&this[_0x4f32('0x9')][_0xe10007[_0x4f32('0x41')]][_0x4f32('0x22')]){logger[_0x4f32('0x20')](_0x4f32('0x43'),_0xe10007[_0x4f32('0x41')]);this['startAcw'](_0xe10007[_0x4f32('0x41')]);}}catch(_0x1814d7){logger[_0x4f32('0x2f')](_0x4f32('0x44'),_0x1814d7[_0x4f32('0x34')]);}};Acw[_0x4f32('0x15')][_0x4f32('0x11')]=function(_0x48b366){try{if(!_[_0x4f32('0x45')](this[_0x4f32('0x9')][_0x48b366[_0x4f32('0x46')]])){this[_0x4f32('0x16')](_0x48b366[_0x4f32('0x46')]);if(this[_0x4f32('0x9')][_0x48b366[_0x4f32('0x47')]]){this['channels'][_0x48b366[_0x4f32('0x47')]]['attended']=!![];this[_0x4f32('0x9')][_0x48b366[_0x4f32('0x48')]]=this[_0x4f32('0x9')][_0x48b366[_0x4f32('0x47')]];delete this[_0x4f32('0x9')][_0x48b366[_0x4f32('0x47')]];}}else if(!_['isNil'](this['channels'][_0x48b366['transfertargetuniqueid']])){this[_0x4f32('0x16')](_0x48b366[_0x4f32('0x48')]);if(this[_0x4f32('0x9')][_0x48b366[_0x4f32('0x49')]]){this['channels'][_0x48b366[_0x4f32('0x49')]][_0x4f32('0x22')]=!![];this[_0x4f32('0x9')][_0x48b366['transfereeuniqueid']]=this[_0x4f32('0x9')][_0x48b366['origtransfereruniqueid']];delete this[_0x4f32('0x9')][_0x48b366[_0x4f32('0x49')]];}}}catch(_0x130e51){logger['error'](_0x4f32('0x4a'),_0x130e51[_0x4f32('0x34')]);}};Acw[_0x4f32('0x15')][_0x4f32('0x4b')]=function(_0x21c800){try{if(this[_0x4f32('0x9')][_0x21c800[_0x4f32('0x4c')]]){logger['info'](_0x4f32('0x4d'),JSON[_0x4f32('0x39')](_0x21c800[_0x4f32('0x4c')]));this[_0x4f32('0x16')](_0x21c800[_0x4f32('0x4c')]);}else if(this[_0x4f32('0x9')][_0x21c800[_0x4f32('0x4e')]]){logger['info'](_0x4f32('0x4f'),JSON['stringify'](_0x21c800['transfererlinkedid']));this[_0x4f32('0x16')](_0x21c800['transfererlinkedid']);}}catch(_0x5be7e1){logger['error'](_0x4f32('0x50'),_0x5be7e1['message']);}};Acw[_0x4f32('0x15')][_0x4f32('0xf')]=function(_0x291f05){try{if(this[_0x4f32('0x6')][_0x291f05[_0x4f32('0x17')]]&&this[_0x4f32('0x6')][_0x291f05[_0x4f32('0x17')]][_0x4f32('0x51')]===_0x4f32('0x52')){if(this['agents'][_0x291f05[_0x4f32('0x3c')]]){logger[_0x4f32('0x20')](_0x4f32('0x53'),_0x291f05[_0x4f32('0x2a')],_0x291f05[_0x4f32('0x3c')],_0x291f05['queue']);return RpcUser['savePause'](this['agents'][_0x291f05['interface']],_0x4f32('0x54'),_0x291f05[_0x4f32('0x2a')]);}}}catch(_0x1a477e){logger[_0x4f32('0x2f')](_0x4f32('0x55'),_0x1a477e[_0x4f32('0x34')]);}};module['exports']=Acw;
\ No newline at end of file
+var _0x9b0c=['../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','syncAgentConnect','bind','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','update','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','message','saveUnpause','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','interface','destlinkedid','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','[%s][HANGUP:UNIQUEID]','linkedid','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfereruniqueid','[%s][BLINDTRANSFER:LINKEDID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','lodash','moment','../ami'];(function(_0x560534,_0x1a2815){var _0x3dec01=function(_0x2222dd){while(--_0x2222dd){_0x560534['push'](_0x560534['shift']());}};_0x3dec01(++_0x1a2815);}(_0x9b0c,0x15d));var _0xc9b0=function(_0x48e6fe,_0x580772){_0x48e6fe=_0x48e6fe-0x0;var _0x4ac0ec=_0x9b0c[_0x48e6fe];return _0x4ac0ec;};'use strict';var _=require(_0xc9b0('0x0'));var moment=require(_0xc9b0('0x1'));var ami=require(_0xc9b0('0x2'));var logger=require(_0xc9b0('0x3'))(_0xc9b0('0x4'));var RpcUser=require(_0xc9b0('0x5'));var RpcVoiceAgentReport=require(_0xc9b0('0x6'));function Acw(_0x1a01d2){this[_0xc9b0('0x7')]=_0x1a01d2[_0xc9b0('0x7')];this['agents']=_0x1a01d2[_0xc9b0('0x8')];this[_0xc9b0('0x9')]=_0x1a01d2[_0xc9b0('0x9')];this[_0xc9b0('0xa')]={};ami['on']('agentconnect',this[_0xc9b0('0xb')][_0xc9b0('0xc')](this));ami['on']('hanguprequest',this[_0xc9b0('0xd')][_0xc9b0('0xc')](this));ami['on'](_0xc9b0('0xe'),this[_0xc9b0('0xf')][_0xc9b0('0xc')](this));ami['on'](_0xc9b0('0x10'),this[_0xc9b0('0x11')][_0xc9b0('0xc')](this));ami['on'](_0xc9b0('0x12'),this[_0xc9b0('0x13')][_0xc9b0('0xc')](this));ami['on'](_0xc9b0('0x14'),this[_0xc9b0('0x15')][_0xc9b0('0xc')](this));ami['on'](_0xc9b0('0x16'),this['syncAgentConnectPreview'][_0xc9b0('0xc')](this));}function getDiff(_0xa5306d){var _0x3de1d1=moment()[_0xc9b0('0x17')](0x0);var _0xc5df2a=moment(_0xa5306d)['milliseconds'](0x0);return _0x3de1d1[_0xc9b0('0x18')](_0xc5df2a,_0xc9b0('0x19'));}Acw[_0xc9b0('0x1a')][_0xc9b0('0x1b')]=function(_0x47ac47){try{var _0x5e7ba0=this;var _0x73ae3d=this[_0xc9b0('0xa')][_0x47ac47]['interface'];var _0x1f0d3c=this[_0xc9b0('0xa')][_0x47ac47][_0xc9b0('0x1c')];var _0x490d7b=this[_0xc9b0('0x7')][_0x1f0d3c];var _0x4f76b9=![];var _0x29c654=_0xc9b0('0x1d');if(_0x490d7b[_0xc9b0('0x1e')]){if(_0x490d7b[_0xc9b0('0x1f')][_0xc9b0('0x20')]){_0x4f76b9=!![];_0x29c654=_0x490d7b[_0xc9b0('0x1f')][_0xc9b0('0x20')];}}return ami['Action']({'action':_0xc9b0('0x21'),'interface':_0x73ae3d,'paused':!![],'reason':_0x29c654})[_0xc9b0('0x22')](function(){if(_0x5e7ba0['agents'][_0x73ae3d]){return RpcUser[_0xc9b0('0x23')](_0x5e7ba0[_0xc9b0('0x8')][_0x73ae3d]['id'])[_0xc9b0('0x22')](function(_0x5591b5){if(_0x5591b5&&!_0x5591b5[_0xc9b0('0x24')]){logger[_0xc9b0('0x25')](_0xc9b0('0x26'),_0x47ac47,_0x73ae3d,_0x1f0d3c);var _0x55682a=_0x5e7ba0[_0xc9b0('0xa')][_0x47ac47][_0xc9b0('0x27')]&&_0x5e7ba0[_0xc9b0('0xa')][_0x47ac47]['destlinkedid']?_0x5e7ba0[_0xc9b0('0xa')][_0x47ac47]['destlinkedid']:_0x47ac47;return RpcUser[_0xc9b0('0x28')](_0x5e7ba0[_0xc9b0('0x8')][_0x73ae3d],_0x29c654,_0x55682a)[_0xc9b0('0x22')](function(){if(!_0x4f76b9){_0x5e7ba0[_0xc9b0('0x9')][_0x73ae3d]={};logger[_0xc9b0('0x25')](_0xc9b0('0x29'),_0x47ac47,_0x5e7ba0[_0xc9b0('0x7')][_0x1f0d3c][_0xc9b0('0x2a')],_0x73ae3d,_0x1f0d3c);_0x5e7ba0[_0xc9b0('0x9')][_0x73ae3d][_0xc9b0('0x2b')]=setTimeout(_0x5e7ba0[_0xc9b0('0x2c')]['bind'](_0x5e7ba0,_0x73ae3d),_0x5e7ba0[_0xc9b0('0x7')][_0x1f0d3c]['acwTimeout']*0x3e8);_0x5e7ba0['timers'][_0x73ae3d][_0xc9b0('0x2d')]=moment()[_0xc9b0('0x2e')](_0xc9b0('0x2f'));_0x5e7ba0[_0xc9b0('0x9')][_0x73ae3d][_0xc9b0('0x30')]=_0x47ac47;_0x5e7ba0['timers'][_0x73ae3d][_0xc9b0('0x1c')]=_0x1f0d3c;_0x5e7ba0[_0xc9b0('0x9')][_0x73ae3d]['updateAcw']=function(){var _0x71105=getDiff(_0x5e7ba0[_0xc9b0('0x9')][_0x73ae3d]['lastPauseAt']);clearTimeout(_0x5e7ba0[_0xc9b0('0x9')][_0x73ae3d][_0xc9b0('0x2b')]);_0x5e7ba0['timers'][_0x73ae3d]['timer']=![];RpcVoiceAgentReport[_0xc9b0('0x31')]({'acwtime':_0x71105},_0x5e7ba0[_0xc9b0('0x9')][_0x73ae3d][_0xc9b0('0x30')],_0x73ae3d)[_0xc9b0('0x22')](function(_0x166085){logger['info']('[%s][UPDATE][ACWTIME:%s]',_0x47ac47,_0x71105,_0x166085);})[_0xc9b0('0x32')](function(_0xfdf94e){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x47ac47,_0xfdf94e);});delete _0x5e7ba0[_0xc9b0('0x9')][_0x73ae3d];};}});}else{logger[_0xc9b0('0x25')](_0xc9b0('0x33'),_0x47ac47,_0x73ae3d,_0x1f0d3c);}});}})['catch'](function(){logger[_0xc9b0('0x34')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x47ac47,_0x5e7ba0[_0xc9b0('0x7')][_0x1f0d3c][_0xc9b0('0x2a')],_0x73ae3d,_0x1f0d3c);})[_0xc9b0('0x35')](function(){delete _0x5e7ba0[_0xc9b0('0xa')][_0x47ac47];});}catch(_0x59adf2){logger[_0xc9b0('0x34')](_0xc9b0('0x36'),_0x59adf2[_0xc9b0('0x37')]);}};Acw['prototype']['stopAcw']=function(_0x3e3d97){try{var _0x4844d0=this;if(_0x4844d0[_0xc9b0('0x9')][_0x3e3d97]){_0x4844d0[_0xc9b0('0x9')][_0x3e3d97][_0xc9b0('0x2b')]=![];var _0x51c424=_0x4844d0['timers'][_0x3e3d97][_0xc9b0('0x30')];var _0x54aafd=_0x4844d0[_0xc9b0('0x9')][_0x3e3d97][_0xc9b0('0x1c')];var _0x3c4add=_0x4844d0['voiceQueues'][_0x54aafd][_0xc9b0('0x2a')];logger['info']('[%s][TIMER][STOP][AGENT:%s]',_0x51c424,_0x3e3d97);RpcUser[_0xc9b0('0x38')](this['agents'][_0x3e3d97]);RpcVoiceAgentReport['update']({'acwtime':_0x3c4add,'agentacw':!![]},_0x51c424,_0x3e3d97)[_0xc9b0('0x22')](function(_0x37d955){logger[_0xc9b0('0x25')](_0xc9b0('0x39'),_0x51c424,_0x3c4add,_0x37d955);})[_0xc9b0('0x32')](function(_0x4ff383){logger[_0xc9b0('0x34')]('[%s][UPDATE][ERRORS:%s]',_0x51c424,_0x4ff383);});}else{logger[_0xc9b0('0x34')](_0xc9b0('0x3a'),_0x3e3d97);if(_0x4844d0[_0xc9b0('0x9')]){logger['info'](_0xc9b0('0x3b'),JSON[_0xc9b0('0x3c')](_0x4844d0['timers']));}}}catch(_0x2b922b){logger['error'](_0xc9b0('0x3d'),_0x2b922b[_0xc9b0('0x37')]);}};Acw['prototype']['syncAgentConnect']=function(_0x37e248){try{if(this[_0xc9b0('0x7')][_0x37e248['queue']]&&(this[_0xc9b0('0x7')][_0x37e248[_0xc9b0('0x1c')]][_0xc9b0('0x4')]||this[_0xc9b0('0x7')][_0x37e248['queue']]['mandatoryDisposition'])){if(this[_0xc9b0('0x8')][_0x37e248[_0xc9b0('0x3e')]]){this[_0xc9b0('0xa')][_0x37e248[_0xc9b0('0x30')]]={'queue':_0x37e248[_0xc9b0('0x1c')],'interface':_0x37e248[_0xc9b0('0x3e')],'destlinkedid':_0x37e248[_0xc9b0('0x3f')]};}}}catch(_0x2b30b6){logger[_0xc9b0('0x34')](_0xc9b0('0x40'),_0x2b30b6['message']);}};Acw[_0xc9b0('0x1a')]['syncAgentConnectPreview']=function(_0x49fc4f){try{if(this[_0xc9b0('0x7')][_0x49fc4f[_0xc9b0('0x1c')]]&&(this[_0xc9b0('0x7')][_0x49fc4f['queue']][_0xc9b0('0x4')]||this[_0xc9b0('0x7')][_0x49fc4f[_0xc9b0('0x1c')]]['mandatoryDisposition'])){if(this[_0xc9b0('0x8')][_0x49fc4f[_0xc9b0('0x3e')]]){this[_0xc9b0('0xa')][_0x49fc4f[_0xc9b0('0x30')]]={'queue':_0x49fc4f[_0xc9b0('0x1c')],'interface':_0x49fc4f[_0xc9b0('0x3e')]};}}}catch(_0x576dca){logger[_0xc9b0('0x34')](_0xc9b0('0x41'),_0x576dca[_0xc9b0('0x37')]);}};Acw[_0xc9b0('0x1a')][_0xc9b0('0xd')]=function(_0x58c7e9){try{if(this[_0xc9b0('0xa')][_0x58c7e9[_0xc9b0('0x30')]]&&_[_0xc9b0('0x42')](this['channels'][_0x58c7e9[_0xc9b0('0x30')]][_0xc9b0('0x27')])){logger[_0xc9b0('0x25')](_0xc9b0('0x43'),_0x58c7e9[_0xc9b0('0x30')]);this[_0xc9b0('0x1b')](_0x58c7e9[_0xc9b0('0x30')]);}else if(this[_0xc9b0('0xa')][_0x58c7e9[_0xc9b0('0x44')]]&&_[_0xc9b0('0x42')](this[_0xc9b0('0xa')][_0x58c7e9[_0xc9b0('0x44')]]['attended'])){logger['info']('[%s][HANGUP:LINKEDID]',_0x58c7e9['linkedid']);this[_0xc9b0('0x1b')](_0x58c7e9[_0xc9b0('0x44')]);}}catch(_0x1feb41){logger['error'](_0xc9b0('0x45'),_0x1feb41[_0xc9b0('0x37')]);}};Acw[_0xc9b0('0x1a')][_0xc9b0('0xf')]=function(_0xe29f30){try{if(this['channels'][_0xe29f30[_0xc9b0('0x30')]]&&this[_0xc9b0('0xa')][_0xe29f30[_0xc9b0('0x30')]][_0xc9b0('0x27')]){logger[_0xc9b0('0x25')](_0xc9b0('0x46'),_0xe29f30['uniqueid']);this[_0xc9b0('0x1b')](_0xe29f30[_0xc9b0('0x30')]);}else if(this[_0xc9b0('0xa')][_0xe29f30[_0xc9b0('0x44')]]&&this[_0xc9b0('0xa')][_0xe29f30[_0xc9b0('0x44')]]['attended']){logger[_0xc9b0('0x25')](_0xc9b0('0x47'),_0xe29f30[_0xc9b0('0x44')]);this[_0xc9b0('0x1b')](_0xe29f30[_0xc9b0('0x44')]);}}catch(_0x49ab5f){logger[_0xc9b0('0x34')](_0xc9b0('0x48'),_0x49ab5f[_0xc9b0('0x37')]);}};Acw[_0xc9b0('0x1a')][_0xc9b0('0x13')]=function(_0xb779c2){try{if(!_[_0xc9b0('0x49')](this[_0xc9b0('0xa')][_0xb779c2[_0xc9b0('0x4a')]])){this['startAcw'](_0xb779c2[_0xc9b0('0x4a')]);if(this[_0xc9b0('0xa')][_0xb779c2[_0xc9b0('0x4b')]]){this[_0xc9b0('0xa')][_0xb779c2[_0xc9b0('0x4b')]]['attended']=!![];this[_0xc9b0('0xa')][_0xb779c2[_0xc9b0('0x4c')]]=this[_0xc9b0('0xa')][_0xb779c2[_0xc9b0('0x4b')]];delete this[_0xc9b0('0xa')][_0xb779c2['secondtransfereruniqueid']];}}else if(!_[_0xc9b0('0x49')](this['channels'][_0xb779c2[_0xc9b0('0x4c')]])){this[_0xc9b0('0x1b')](_0xb779c2[_0xc9b0('0x4c')]);if(this[_0xc9b0('0xa')][_0xb779c2['origtransfereruniqueid']]){this[_0xc9b0('0xa')][_0xb779c2[_0xc9b0('0x4d')]][_0xc9b0('0x27')]=!![];this[_0xc9b0('0xa')][_0xb779c2[_0xc9b0('0x4a')]]=this['channels'][_0xb779c2['origtransfereruniqueid']];delete this['channels'][_0xb779c2[_0xc9b0('0x4d')]];}}}catch(_0x48ba0a){logger[_0xc9b0('0x34')]('[ACW][syncAttendedTransfer]\x20%s',_0x48ba0a[_0xc9b0('0x37')]);}};Acw[_0xc9b0('0x1a')][_0xc9b0('0x15')]=function(_0x50548e){try{if(this[_0xc9b0('0xa')][_0x50548e['transfereruniqueid']]){logger[_0xc9b0('0x25')](_0xc9b0('0x4e'),JSON[_0xc9b0('0x3c')](_0x50548e[_0xc9b0('0x4f')]));this[_0xc9b0('0x1b')](_0x50548e['transfereruniqueid']);}else if(this[_0xc9b0('0xa')][_0x50548e['transfererlinkedid']]){logger[_0xc9b0('0x25')](_0xc9b0('0x50'),JSON['stringify'](_0x50548e[_0xc9b0('0x51')]));this[_0xc9b0('0x1b')](_0x50548e[_0xc9b0('0x51')]);}}catch(_0x49d8f3){logger[_0xc9b0('0x34')](_0xc9b0('0x52'),_0x49d8f3[_0xc9b0('0x37')]);}};Acw[_0xc9b0('0x1a')]['syncAgentRingNoAnswer']=function(_0x5db477){try{if(this[_0xc9b0('0x7')][_0x5db477[_0xc9b0('0x1c')]]&&this[_0xc9b0('0x7')][_0x5db477['queue']][_0xc9b0('0x53')]===_0xc9b0('0x54')){if(this[_0xc9b0('0x8')][_0x5db477[_0xc9b0('0x3e')]]){logger[_0xc9b0('0x25')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x5db477[_0xc9b0('0x30')],_0x5db477[_0xc9b0('0x3e')],_0x5db477['queue']);return RpcUser['savePause'](this['agents'][_0x5db477[_0xc9b0('0x3e')]],_0xc9b0('0x55'),_0x5db477[_0xc9b0('0x30')]);}}}catch(_0x53274e){logger[_0xc9b0('0x34')](_0xc9b0('0x56'),_0x53274e[_0xc9b0('0x37')]);}};module[_0xc9b0('0x57')]=Acw;
\ No newline at end of file