Built motion from commit f0b1811d.|2.6.6
[motion2.git] / server / services / ami / acw / index.js
index 1818002..22ee84e 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xb13d=['acw','destlinkedid','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','then','agents','getAgent','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','savePause','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','finally','error','[ACW][START]\x20%s','uniqueid','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xb13d,0x71));var _0xdb13=function(_0x565cc2,_0x4be445){_0x565cc2=_0x565cc2-0x0;var _0x1738c1=_0xb13d[_0x565cc2];return _0x1738c1;};'use strict';var util=require(_0xdb13('0x0'));var _=require(_0xdb13('0x1'));var moment=require(_0xdb13('0x2'));var ami=require(_0xdb13('0x3'));var logger=require(_0xdb13('0x4'))('acw');var RpcUser=require(_0xdb13('0x5'));var RpcVoiceAgentReport=require(_0xdb13('0x6'));function Acw(_0x334026){this[_0xdb13('0x7')]=_0x334026[_0xdb13('0x7')];this['agents']=_0x334026['agents'];this[_0xdb13('0x8')]=_0x334026[_0xdb13('0x8')];this[_0xdb13('0x9')]={};ami['on'](_0xdb13('0xa'),this[_0xdb13('0xb')][_0xdb13('0xc')](this));ami['on'](_0xdb13('0xd'),this[_0xdb13('0xe')][_0xdb13('0xc')](this));ami['on'](_0xdb13('0xf'),this['syncHangup'][_0xdb13('0xc')](this));ami['on'](_0xdb13('0x10'),this[_0xdb13('0x11')][_0xdb13('0xc')](this));ami['on'](_0xdb13('0x12'),this[_0xdb13('0x13')][_0xdb13('0xc')](this));ami['on'](_0xdb13('0x14'),this[_0xdb13('0x15')][_0xdb13('0xc')](this));ami['on'](_0xdb13('0x16'),this[_0xdb13('0x17')][_0xdb13('0xc')](this));}function getDiff(_0x518766){var _0x56a14b=moment()[_0xdb13('0x18')](0x0);var _0x3243f3=moment(_0x518766)[_0xdb13('0x18')](0x0);return _0x56a14b[_0xdb13('0x19')](_0x3243f3,_0xdb13('0x1a'));}Acw[_0xdb13('0x1b')][_0xdb13('0x1c')]=function(_0x358a2f){try{var _0x3ca72b=this;var _0x59fef5=this[_0xdb13('0x9')][_0x358a2f][_0xdb13('0x1d')];var _0x1389ce=this[_0xdb13('0x9')][_0x358a2f][_0xdb13('0x1e')];var _0x3a86c1=this[_0xdb13('0x7')][_0x1389ce];var _0x4c697e=![];var _0x15b020=_0xdb13('0x1f');if(_0x3a86c1[_0xdb13('0x20')]){if(_0x3a86c1[_0xdb13('0x21')][_0xdb13('0x22')]){_0x4c697e=!![];_0x15b020=_0x3a86c1[_0xdb13('0x21')]['name'];}}ami['Action']({'action':'QueuePause','interface':_0x59fef5,'paused':!![],'reason':_0x15b020})[_0xdb13('0x23')](function(_0x1a3ceb){if(_0x3ca72b[_0xdb13('0x24')][_0x59fef5]){return RpcUser[_0xdb13('0x25')](_0x3ca72b[_0xdb13('0x24')][_0x59fef5]['id'])['then'](function(_0x40aaab){if(_0x40aaab&&!_0x40aaab['voicePause']){logger[_0xdb13('0x26')](_0xdb13('0x27'),_0x358a2f,_0x59fef5,_0x1389ce);var _0x44a6f0=_0x3ca72b[_0xdb13('0x9')][_0x358a2f][_0xdb13('0x28')]&&_0x3ca72b[_0xdb13('0x9')][_0x358a2f]['destlinkedid']?_0x3ca72b[_0xdb13('0x9')][_0x358a2f]['destlinkedid']:_0x358a2f;return RpcUser[_0xdb13('0x29')](_0x3ca72b[_0xdb13('0x24')][_0x59fef5],_0x15b020,_0x44a6f0)[_0xdb13('0x23')](function(_0x5b53ea){if(!_0x4c697e){_0x3ca72b['timers'][_0x59fef5]={};logger[_0xdb13('0x26')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x358a2f,_0x3ca72b[_0xdb13('0x7')][_0x1389ce][_0xdb13('0x2a')],_0x59fef5,_0x1389ce);_0x3ca72b[_0xdb13('0x8')][_0x59fef5][_0xdb13('0x2b')]=setTimeout(_0x3ca72b[_0xdb13('0x2c')][_0xdb13('0xc')](_0x3ca72b,_0x59fef5),_0x3ca72b[_0xdb13('0x7')][_0x1389ce][_0xdb13('0x2a')]*0x3e8);_0x3ca72b[_0xdb13('0x8')][_0x59fef5][_0xdb13('0x2d')]=moment()['format'](_0xdb13('0x2e'));_0x3ca72b[_0xdb13('0x8')][_0x59fef5]['uniqueid']=_0x358a2f;_0x3ca72b[_0xdb13('0x8')][_0x59fef5]['queue']=_0x1389ce;_0x3ca72b['timers'][_0x59fef5][_0xdb13('0x2f')]=function(){var _0x296656=getDiff(_0x3ca72b[_0xdb13('0x8')][_0x59fef5]['lastPauseAt']);clearTimeout(_0x3ca72b[_0xdb13('0x8')][_0x59fef5][_0xdb13('0x2b')]);_0x3ca72b[_0xdb13('0x8')][_0x59fef5][_0xdb13('0x2b')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x296656},_0x3ca72b[_0xdb13('0x8')][_0x59fef5]['uniqueid'],_0x59fef5)[_0xdb13('0x23')](function(_0x3e7fa5){logger[_0xdb13('0x26')](_0xdb13('0x30'),_0x358a2f,_0x296656,_0x3e7fa5);})[_0xdb13('0x31')](function(_0xecacd1){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x358a2f,_0xecacd1);});delete _0x3ca72b['timers'][_0x59fef5];};}});}else{logger['info'](_0xdb13('0x32'),_0x358a2f,_0x59fef5,_0x1389ce);}});}})[_0xdb13('0x31')](function(_0x4f1ae2){logger['error'](_0xdb13('0x33'),_0x358a2f,_0x3ca72b[_0xdb13('0x7')][_0x1389ce][_0xdb13('0x2a')],_0x59fef5,_0x1389ce);})[_0xdb13('0x34')](function(){delete _0x3ca72b[_0xdb13('0x9')][_0x358a2f];});}catch(_0xcc622a){logger[_0xdb13('0x35')](_0xdb13('0x36'),_0xcc622a['message']);}};Acw['prototype']['stopAcw']=function(_0x242ad9){try{var _0x2f444f=this;if(_0x2f444f[_0xdb13('0x8')][_0x242ad9]){_0x2f444f[_0xdb13('0x8')][_0x242ad9][_0xdb13('0x2b')]=![];var _0x2ca43b=_0x2f444f[_0xdb13('0x8')][_0x242ad9][_0xdb13('0x37')];var _0x110720=_0x2f444f['timers'][_0x242ad9][_0xdb13('0x1e')];var _0x39c964=_0x2f444f[_0xdb13('0x7')][_0x110720][_0xdb13('0x2a')];logger[_0xdb13('0x26')]('[%s][TIMER][STOP][AGENT:%s]',_0x2ca43b,_0x242ad9);RpcUser[_0xdb13('0x38')](this[_0xdb13('0x24')][_0x242ad9]);RpcVoiceAgentReport['update']({'acwtime':_0x39c964,'agentacw':!![]},_0x2ca43b,_0x242ad9)[_0xdb13('0x23')](function(_0xc6e9d8){logger['info'](_0xdb13('0x30'),_0x2ca43b,_0x39c964,_0xc6e9d8);})[_0xdb13('0x31')](function(_0x3c9562){logger[_0xdb13('0x35')](_0xdb13('0x39'),_0x2ca43b,_0x3c9562);});}else{logger[_0xdb13('0x35')](_0xdb13('0x3a'),_0x242ad9);if(_0x2f444f[_0xdb13('0x8')]){logger[_0xdb13('0x26')](_0xdb13('0x3b'),JSON[_0xdb13('0x3c')](_0x2f444f[_0xdb13('0x8')]));}}}catch(_0x29610e){logger['error'](_0xdb13('0x3d'),_0x29610e[_0xdb13('0x3e')]);}};Acw[_0xdb13('0x1b')][_0xdb13('0xb')]=function(_0x1742af){try{if(this[_0xdb13('0x7')][_0x1742af['queue']]&&(this[_0xdb13('0x7')][_0x1742af[_0xdb13('0x1e')]][_0xdb13('0x3f')]||this[_0xdb13('0x7')][_0x1742af['queue']][_0xdb13('0x20')])){if(this[_0xdb13('0x24')][_0x1742af['interface']]){this[_0xdb13('0x9')][_0x1742af[_0xdb13('0x37')]]={'queue':_0x1742af[_0xdb13('0x1e')],'interface':_0x1742af[_0xdb13('0x1d')],'destlinkedid':_0x1742af[_0xdb13('0x40')]};}}}catch(_0x2c2750){logger[_0xdb13('0x35')](_0xdb13('0x41'),_0x2c2750[_0xdb13('0x3e')]);}};Acw['prototype'][_0xdb13('0x17')]=function(_0x27b7ac){try{if(this[_0xdb13('0x7')][_0x27b7ac[_0xdb13('0x1e')]]&&(this[_0xdb13('0x7')][_0x27b7ac['queue']][_0xdb13('0x3f')]||this[_0xdb13('0x7')][_0x27b7ac[_0xdb13('0x1e')]][_0xdb13('0x20')])){if(this[_0xdb13('0x24')][_0x27b7ac[_0xdb13('0x1d')]]){this[_0xdb13('0x9')][_0x27b7ac['uniqueid']]={'queue':_0x27b7ac['queue'],'interface':_0x27b7ac['interface']};}}}catch(_0x23ace5){logger[_0xdb13('0x35')](_0xdb13('0x42'),_0x23ace5[_0xdb13('0x3e')]);}};Acw[_0xdb13('0x1b')]['syncHangupRequest']=function(_0x31709d){try{if(this[_0xdb13('0x9')][_0x31709d[_0xdb13('0x37')]]&&_['isUndefined'](this[_0xdb13('0x9')][_0x31709d[_0xdb13('0x37')]]['attended'])){logger[_0xdb13('0x26')]('[%s][HANGUP:UNIQUEID]',_0x31709d[_0xdb13('0x37')]);this['startAcw'](_0x31709d[_0xdb13('0x37')]);}else if(this['channels'][_0x31709d[_0xdb13('0x43')]]&&_[_0xdb13('0x44')](this[_0xdb13('0x9')][_0x31709d[_0xdb13('0x43')]][_0xdb13('0x28')])){logger[_0xdb13('0x26')](_0xdb13('0x45'),_0x31709d[_0xdb13('0x43')]);this[_0xdb13('0x1c')](_0x31709d[_0xdb13('0x43')]);}}catch(_0x54658c){logger[_0xdb13('0x35')](_0xdb13('0x46'),_0x54658c[_0xdb13('0x3e')]);}};Acw[_0xdb13('0x1b')][_0xdb13('0x47')]=function(_0x1961ef){try{if(this[_0xdb13('0x9')][_0x1961ef[_0xdb13('0x37')]]&&this[_0xdb13('0x9')][_0x1961ef[_0xdb13('0x37')]][_0xdb13('0x28')]){logger[_0xdb13('0x26')](_0xdb13('0x48'),_0x1961ef[_0xdb13('0x37')]);this[_0xdb13('0x1c')](_0x1961ef[_0xdb13('0x37')]);}else if(this[_0xdb13('0x9')][_0x1961ef['linkedid']]&&this[_0xdb13('0x9')][_0x1961ef['linkedid']][_0xdb13('0x28')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x1961ef[_0xdb13('0x43')]);this[_0xdb13('0x1c')](_0x1961ef[_0xdb13('0x43')]);}}catch(_0xd080e3){logger[_0xdb13('0x35')]('[ACW][syncHangup]\x20%s',_0xd080e3['message']);}};Acw[_0xdb13('0x1b')][_0xdb13('0x13')]=function(_0x5b8f9a){try{if(!_[_0xdb13('0x49')](this[_0xdb13('0x9')][_0x5b8f9a[_0xdb13('0x4a')]])){this[_0xdb13('0x1c')](_0x5b8f9a[_0xdb13('0x4a')]);if(this[_0xdb13('0x9')][_0x5b8f9a[_0xdb13('0x4b')]]){this[_0xdb13('0x9')][_0x5b8f9a['secondtransfereruniqueid']]['attended']=!![];this['channels'][_0x5b8f9a[_0xdb13('0x4c')]]=this[_0xdb13('0x9')][_0x5b8f9a[_0xdb13('0x4b')]];delete this[_0xdb13('0x9')][_0x5b8f9a['secondtransfereruniqueid']];}}else if(!_[_0xdb13('0x49')](this[_0xdb13('0x9')][_0x5b8f9a[_0xdb13('0x4c')]])){this['startAcw'](_0x5b8f9a[_0xdb13('0x4c')]);if(this[_0xdb13('0x9')][_0x5b8f9a['origtransfereruniqueid']]){this[_0xdb13('0x9')][_0x5b8f9a['origtransfereruniqueid']][_0xdb13('0x28')]=!![];this['channels'][_0x5b8f9a[_0xdb13('0x4a')]]=this[_0xdb13('0x9')][_0x5b8f9a['origtransfereruniqueid']];delete this['channels'][_0x5b8f9a[_0xdb13('0x4d')]];}}}catch(_0xb2a578){logger['error'](_0xdb13('0x4e'),_0xb2a578[_0xdb13('0x3e')]);}};Acw[_0xdb13('0x1b')][_0xdb13('0x15')]=function(_0x1b18cb){try{if(this[_0xdb13('0x9')][_0x1b18cb[_0xdb13('0x4f')]]){logger[_0xdb13('0x26')](_0xdb13('0x50'),JSON[_0xdb13('0x3c')](_0x1b18cb[_0xdb13('0x4f')]));this['startAcw'](_0x1b18cb['transfereruniqueid']);}else if(this['channels'][_0x1b18cb[_0xdb13('0x51')]]){logger[_0xdb13('0x26')](_0xdb13('0x52'),JSON[_0xdb13('0x3c')](_0x1b18cb[_0xdb13('0x51')]));this['startAcw'](_0x1b18cb[_0xdb13('0x51')]);}}catch(_0x314f59){logger['error']('[ACW][syncBlindTransfer]\x20%s',_0x314f59[_0xdb13('0x3e')]);}};Acw[_0xdb13('0x1b')][_0xdb13('0x11')]=function(_0x289c34){try{if(this['voiceQueues'][_0x289c34[_0xdb13('0x1e')]]&&this[_0xdb13('0x7')][_0x289c34['queue']][_0xdb13('0x53')]===_0xdb13('0x54')){if(this[_0xdb13('0x24')][_0x289c34[_0xdb13('0x1d')]]){logger['info'](_0xdb13('0x55'),_0x289c34['uniqueid'],_0x289c34[_0xdb13('0x1d')],_0x289c34['queue']);return RpcUser[_0xdb13('0x29')](this[_0xdb13('0x24')][_0x289c34[_0xdb13('0x1d')]],'Auto-Pause',_0x289c34[_0xdb13('0x37')]);}}}catch(_0x53d6b2){logger[_0xdb13('0x35')](_0xdb13('0x56'),_0x53d6b2[_0xdb13('0x3e')]);}};module[_0xdb13('0x57')]=Acw;
\ No newline at end of file
+var _0x58f0=['secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','milliseconds','diff','seconds','prototype','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','timer','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','message','syncAgentConnect','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','attended','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','transfereeuniqueid'];(function(_0x2fd0d3,_0x50bd4f){var _0x764c4c=function(_0x261ccc){while(--_0x261ccc){_0x2fd0d3['push'](_0x2fd0d3['shift']());}};_0x764c4c(++_0x50bd4f);}(_0x58f0,0xb8));var _0x058f=function(_0x48f0e1,_0x6f048){_0x48f0e1=_0x48f0e1-0x0;var _0x3628aa=_0x58f0[_0x48f0e1];return _0x3628aa;};'use strict';var util=require(_0x058f('0x0'));var _=require(_0x058f('0x1'));var moment=require(_0x058f('0x2'));var ami=require(_0x058f('0x3'));var logger=require(_0x058f('0x4'))(_0x058f('0x5'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x058f('0x6'));function Acw(_0x3a6750){this[_0x058f('0x7')]=_0x3a6750[_0x058f('0x7')];this['agents']=_0x3a6750[_0x058f('0x8')];this[_0x058f('0x9')]=_0x3a6750[_0x058f('0x9')];this[_0x058f('0xa')]={};ami['on'](_0x058f('0xb'),this['syncAgentConnect'][_0x058f('0xc')](this));ami['on'](_0x058f('0xd'),this[_0x058f('0xe')][_0x058f('0xc')](this));ami['on'](_0x058f('0xf'),this[_0x058f('0x10')][_0x058f('0xc')](this));ami['on'](_0x058f('0x11'),this[_0x058f('0x12')][_0x058f('0xc')](this));ami['on']('attendedtransfer',this[_0x058f('0x13')][_0x058f('0xc')](this));ami['on'](_0x058f('0x14'),this[_0x058f('0x15')][_0x058f('0xc')](this));ami['on']('custom:agentConnectPreview',this['syncAgentConnectPreview'][_0x058f('0xc')](this));}function getDiff(_0x2af75a){var _0x12ae64=moment()[_0x058f('0x16')](0x0);var _0x3099eb=moment(_0x2af75a)[_0x058f('0x16')](0x0);return _0x12ae64[_0x058f('0x17')](_0x3099eb,_0x058f('0x18'));}Acw[_0x058f('0x19')][_0x058f('0x1a')]=function(_0x524cfc){try{var _0x1be795=this;var _0x21aaf3=this['channels'][_0x524cfc][_0x058f('0x1b')];var _0x531f63=this[_0x058f('0xa')][_0x524cfc][_0x058f('0x1c')];var _0x1a0d42=this[_0x058f('0x7')][_0x531f63];var _0x439bf2=![];var _0x1d5d26=_0x058f('0x1d');if(_0x1a0d42[_0x058f('0x1e')]){if(_0x1a0d42[_0x058f('0x1f')][_0x058f('0x20')]){_0x439bf2=!![];_0x1d5d26=_0x1a0d42[_0x058f('0x1f')][_0x058f('0x20')];}}ami['Action']({'action':_0x058f('0x21'),'interface':_0x21aaf3,'paused':!![],'reason':_0x1d5d26})[_0x058f('0x22')](function(_0x2ea04f){if(_0x1be795[_0x058f('0x8')][_0x21aaf3]){return RpcUser[_0x058f('0x23')](_0x1be795[_0x058f('0x8')][_0x21aaf3]['id'])[_0x058f('0x22')](function(_0x49ce4c){if(_0x49ce4c&&!_0x49ce4c[_0x058f('0x24')]){logger[_0x058f('0x25')](_0x058f('0x26'),_0x524cfc,_0x21aaf3,_0x531f63);var _0x2d3a65=_0x1be795[_0x058f('0xa')][_0x524cfc]['attended']&&_0x1be795['channels'][_0x524cfc]['destlinkedid']?_0x1be795[_0x058f('0xa')][_0x524cfc][_0x058f('0x27')]:_0x524cfc;return RpcUser['savePause'](_0x1be795[_0x058f('0x8')][_0x21aaf3],_0x1d5d26,_0x2d3a65)[_0x058f('0x22')](function(_0x138eee){if(!_0x439bf2){_0x1be795[_0x058f('0x9')][_0x21aaf3]={};logger[_0x058f('0x25')](_0x058f('0x28'),_0x524cfc,_0x1be795[_0x058f('0x7')][_0x531f63][_0x058f('0x29')],_0x21aaf3,_0x531f63);_0x1be795[_0x058f('0x9')][_0x21aaf3]['timer']=setTimeout(_0x1be795[_0x058f('0x2a')][_0x058f('0xc')](_0x1be795,_0x21aaf3),_0x1be795[_0x058f('0x7')][_0x531f63]['acwTimeout']*0x3e8);_0x1be795[_0x058f('0x9')][_0x21aaf3][_0x058f('0x2b')]=moment()['format'](_0x058f('0x2c'));_0x1be795[_0x058f('0x9')][_0x21aaf3][_0x058f('0x2d')]=_0x524cfc;_0x1be795[_0x058f('0x9')][_0x21aaf3][_0x058f('0x1c')]=_0x531f63;_0x1be795[_0x058f('0x9')][_0x21aaf3]['updateAcw']=function(){var _0x3af987=getDiff(_0x1be795[_0x058f('0x9')][_0x21aaf3][_0x058f('0x2b')]);clearTimeout(_0x1be795[_0x058f('0x9')][_0x21aaf3][_0x058f('0x2e')]);_0x1be795['timers'][_0x21aaf3][_0x058f('0x2e')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x3af987},_0x1be795[_0x058f('0x9')][_0x21aaf3]['uniqueid'],_0x21aaf3)[_0x058f('0x22')](function(_0x540208){logger[_0x058f('0x25')](_0x058f('0x2f'),_0x524cfc,_0x3af987,_0x540208);})[_0x058f('0x30')](function(_0x5a823a){logger[_0x058f('0x31')](_0x058f('0x32'),_0x524cfc,_0x5a823a);});delete _0x1be795['timers'][_0x21aaf3];};}});}else{logger[_0x058f('0x25')]('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x524cfc,_0x21aaf3,_0x531f63);}});}})['catch'](function(_0x2ce9ee){logger['error']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x524cfc,_0x1be795[_0x058f('0x7')][_0x531f63][_0x058f('0x29')],_0x21aaf3,_0x531f63);})['finally'](function(){delete _0x1be795[_0x058f('0xa')][_0x524cfc];});}catch(_0x535cfe){logger[_0x058f('0x31')](_0x058f('0x33'),_0x535cfe['message']);}};Acw[_0x058f('0x19')]['stopAcw']=function(_0x177045){try{var _0x5b525e=this;if(_0x5b525e[_0x058f('0x9')][_0x177045]){_0x5b525e[_0x058f('0x9')][_0x177045][_0x058f('0x2e')]=![];var _0x1bdd9a=_0x5b525e[_0x058f('0x9')][_0x177045][_0x058f('0x2d')];var _0x3f8f0d=_0x5b525e['timers'][_0x177045][_0x058f('0x1c')];var _0x4990ff=_0x5b525e[_0x058f('0x7')][_0x3f8f0d][_0x058f('0x29')];logger[_0x058f('0x25')](_0x058f('0x34'),_0x1bdd9a,_0x177045);RpcUser['saveUnpause'](this[_0x058f('0x8')][_0x177045]);RpcVoiceAgentReport['update']({'acwtime':_0x4990ff,'agentacw':!![]},_0x1bdd9a,_0x177045)[_0x058f('0x22')](function(_0x292dcf){logger[_0x058f('0x25')](_0x058f('0x2f'),_0x1bdd9a,_0x4990ff,_0x292dcf);})['catch'](function(_0xbeb6c5){logger[_0x058f('0x31')]('[%s][UPDATE][ERRORS:%s]',_0x1bdd9a,_0xbeb6c5);});}else{logger[_0x058f('0x31')](_0x058f('0x35'),_0x177045);if(_0x5b525e[_0x058f('0x9')]){logger[_0x058f('0x25')](_0x058f('0x36'),JSON['stringify'](_0x5b525e['timers']));}}}catch(_0x203994){logger[_0x058f('0x31')](_0x058f('0x37'),_0x203994[_0x058f('0x38')]);}};Acw[_0x058f('0x19')][_0x058f('0x39')]=function(_0x43e5bd){try{if(this[_0x058f('0x7')][_0x43e5bd[_0x058f('0x1c')]]&&(this[_0x058f('0x7')][_0x43e5bd[_0x058f('0x1c')]][_0x058f('0x5')]||this[_0x058f('0x7')][_0x43e5bd[_0x058f('0x1c')]][_0x058f('0x1e')])){if(this[_0x058f('0x8')][_0x43e5bd[_0x058f('0x1b')]]){this[_0x058f('0xa')][_0x43e5bd[_0x058f('0x2d')]]={'queue':_0x43e5bd[_0x058f('0x1c')],'interface':_0x43e5bd['interface'],'destlinkedid':_0x43e5bd[_0x058f('0x27')]};}}}catch(_0x5239f9){logger['error']('[ACW][syncAgentConnect]\x20%s',_0x5239f9[_0x058f('0x38')]);}};Acw[_0x058f('0x19')][_0x058f('0x3a')]=function(_0x19a790){try{if(this[_0x058f('0x7')][_0x19a790['queue']]&&(this[_0x058f('0x7')][_0x19a790[_0x058f('0x1c')]][_0x058f('0x5')]||this[_0x058f('0x7')][_0x19a790[_0x058f('0x1c')]]['mandatoryDisposition'])){if(this[_0x058f('0x8')][_0x19a790[_0x058f('0x1b')]]){this[_0x058f('0xa')][_0x19a790['uniqueid']]={'queue':_0x19a790[_0x058f('0x1c')],'interface':_0x19a790['interface']};}}}catch(_0x43419a){logger[_0x058f('0x31')](_0x058f('0x3b'),_0x43419a['message']);}};Acw[_0x058f('0x19')][_0x058f('0xe')]=function(_0x3d1551){try{if(this['channels'][_0x3d1551['uniqueid']]&&_[_0x058f('0x3c')](this[_0x058f('0xa')][_0x3d1551[_0x058f('0x2d')]][_0x058f('0x3d')])){logger[_0x058f('0x25')]('[%s][HANGUP:UNIQUEID]',_0x3d1551['uniqueid']);this[_0x058f('0x1a')](_0x3d1551['uniqueid']);}else if(this[_0x058f('0xa')][_0x3d1551[_0x058f('0x3e')]]&&_[_0x058f('0x3c')](this[_0x058f('0xa')][_0x3d1551[_0x058f('0x3e')]][_0x058f('0x3d')])){logger[_0x058f('0x25')](_0x058f('0x3f'),_0x3d1551[_0x058f('0x3e')]);this['startAcw'](_0x3d1551[_0x058f('0x3e')]);}}catch(_0x266e2a){logger[_0x058f('0x31')](_0x058f('0x40'),_0x266e2a[_0x058f('0x38')]);}};Acw[_0x058f('0x19')][_0x058f('0x10')]=function(_0x29f4d0){try{if(this[_0x058f('0xa')][_0x29f4d0[_0x058f('0x2d')]]&&this['channels'][_0x29f4d0[_0x058f('0x2d')]]['attended']){logger[_0x058f('0x25')](_0x058f('0x41'),_0x29f4d0['uniqueid']);this[_0x058f('0x1a')](_0x29f4d0[_0x058f('0x2d')]);}else if(this[_0x058f('0xa')][_0x29f4d0[_0x058f('0x3e')]]&&this['channels'][_0x29f4d0[_0x058f('0x3e')]][_0x058f('0x3d')]){logger['info'](_0x058f('0x42'),_0x29f4d0[_0x058f('0x3e')]);this['startAcw'](_0x29f4d0[_0x058f('0x3e')]);}}catch(_0x33b3ef){logger[_0x058f('0x31')]('[ACW][syncHangup]\x20%s',_0x33b3ef['message']);}};Acw[_0x058f('0x19')][_0x058f('0x13')]=function(_0x2a6207){try{if(!_['isNil'](this['channels'][_0x2a6207[_0x058f('0x43')]])){this[_0x058f('0x1a')](_0x2a6207[_0x058f('0x43')]);if(this[_0x058f('0xa')][_0x2a6207[_0x058f('0x44')]]){this[_0x058f('0xa')][_0x2a6207[_0x058f('0x44')]][_0x058f('0x3d')]=!![];this['channels'][_0x2a6207[_0x058f('0x45')]]=this[_0x058f('0xa')][_0x2a6207[_0x058f('0x44')]];delete this[_0x058f('0xa')][_0x2a6207[_0x058f('0x44')]];}}else if(!_[_0x058f('0x46')](this['channels'][_0x2a6207[_0x058f('0x45')]])){this['startAcw'](_0x2a6207[_0x058f('0x45')]);if(this['channels'][_0x2a6207[_0x058f('0x47')]]){this[_0x058f('0xa')][_0x2a6207['origtransfereruniqueid']][_0x058f('0x3d')]=!![];this[_0x058f('0xa')][_0x2a6207[_0x058f('0x43')]]=this['channels'][_0x2a6207[_0x058f('0x47')]];delete this['channels'][_0x2a6207[_0x058f('0x47')]];}}}catch(_0x1879ab){logger[_0x058f('0x31')](_0x058f('0x48'),_0x1879ab[_0x058f('0x38')]);}};Acw[_0x058f('0x19')][_0x058f('0x15')]=function(_0x593265){try{if(this[_0x058f('0xa')][_0x593265[_0x058f('0x49')]]){logger[_0x058f('0x25')](_0x058f('0x4a'),JSON[_0x058f('0x4b')](_0x593265['transfereruniqueid']));this['startAcw'](_0x593265[_0x058f('0x49')]);}else if(this[_0x058f('0xa')][_0x593265[_0x058f('0x4c')]]){logger['info']('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x058f('0x4b')](_0x593265[_0x058f('0x4c')]));this[_0x058f('0x1a')](_0x593265[_0x058f('0x4c')]);}}catch(_0x431659){logger[_0x058f('0x31')](_0x058f('0x4d'),_0x431659[_0x058f('0x38')]);}};Acw[_0x058f('0x19')][_0x058f('0x12')]=function(_0x59ce7a){try{if(this['voiceQueues'][_0x59ce7a[_0x058f('0x1c')]]&&this['voiceQueues'][_0x59ce7a[_0x058f('0x1c')]][_0x058f('0x4e')]===_0x058f('0x4f')){if(this[_0x058f('0x8')][_0x59ce7a['interface']]){logger[_0x058f('0x25')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x59ce7a[_0x058f('0x2d')],_0x59ce7a[_0x058f('0x1b')],_0x59ce7a[_0x058f('0x1c')]);return RpcUser[_0x058f('0x50')](this[_0x058f('0x8')][_0x59ce7a[_0x058f('0x1b')]],_0x058f('0x51'),_0x59ce7a['uniqueid']);}}}catch(_0x2f283b){logger[_0x058f('0x31')](_0x058f('0x52'),_0x2f283b[_0x058f('0x38')]);}};module[_0x058f('0x53')]=Acw;
\ No newline at end of file