Built motion from commit (unavailable).|2.3.91
[motion2.git] / server / services / routing / server / applications / strategy / rrmemory.js
index f5ba301..a8fc23b 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xaaa0=['handleRun','bind','handleTimeout','module','drained','handleDrained','prototype','agentId','info','[%s][QUEUE]\x20available\x20again\x20%s','intervals','queue','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','isAgentAvailable','agents','channel','busy','name','showNotification','RINGING','handleCheckReject','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','done','[%s][QUEUE]\x20timeout\x20with\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','TIMEOUT','busyQueue','uuid','notificationId','squeue','realtime','routing','push'];(function(_0x385c76,_0xb97335){var _0x5c8367=function(_0xdfcd3){while(--_0xdfcd3){_0x385c76['push'](_0x385c76['shift']());}};_0x5c8367(++_0xb97335);}(_0xaaa0,0x1c1));var _0x0aaa=function(_0x251b80,_0x489f84){_0x251b80=_0x251b80-0x0;var _0x1eea35=_0xaaa0[_0x251b80];return _0x1eea35;};'use strict';var rr=require('rr');var _=require('lodash');var uuid=require(_0x0aaa('0x0'));var util=require('./util');var logger=require('../../../../../config/logger')('routing');var RRMemory=function(_0x16c3ed,_0x436ac5,_0x1468a3,_0x1ba0ec){this[_0x0aaa('0x1')]=uuid['v4']();this[_0x0aaa('0x2')]=_0x16c3ed;this['queue']=_0x436ac5;this[_0x0aaa('0x3')]=_0x1468a3;this[_0x0aaa('0x4')]=_0x1ba0ec;this['intervals']={};this[_0x0aaa('0x2')][_0x0aaa('0x5')](this[_0x0aaa('0x6')][_0x0aaa('0x7')](this),this[_0x0aaa('0x8')]['bind'](this),this[_0x0aaa('0x9')]);this[_0x0aaa('0x2')]['on']('timeout',this[_0x0aaa('0x8')]['bind'](this));this['squeue']['on'](_0x0aaa('0xa'),this[_0x0aaa('0xb')][_0x0aaa('0x7')](this));};RRMemory[_0x0aaa('0xc')]['push']=function(){this[_0x0aaa('0x2')][_0x0aaa('0x5')](this[_0x0aaa('0x6')][_0x0aaa('0x7')](this),this['handleTimeout']['bind'](this));};RRMemory[_0x0aaa('0xc')]['handleDrained']=function(_0x180857){this[_0x0aaa('0x8')](!![]);};RRMemory[_0x0aaa('0xc')]['handleCheckReject']=function(_0x3a2b9a){if(util['isAgentAvailable'](this[_0x0aaa('0x2')]['id'],this[_0x0aaa('0x3')]['agents'][this[_0x0aaa('0xd')]],this['squeue']['channel'],!![])){logger[_0x0aaa('0xe')](_0x0aaa('0xf'),this[_0x0aaa('0x2')]['id'],this[_0x0aaa('0xd')]);clearInterval(this[_0x0aaa('0x10')][this[_0x0aaa('0xd')]]);_0x3a2b9a['done']();setTimeout(this[_0x0aaa('0x5')][_0x0aaa('0x7')](this),0x3e8);}};RRMemory[_0x0aaa('0xc')][_0x0aaa('0x6')]=function(_0x2cd62c){this[_0x0aaa('0xd')]=rr(this[_0x0aaa('0x11')][_0x0aaa('0x12')]);logger['info'](_0x0aaa('0x13'),this[_0x0aaa('0x2')]['id'],this[_0x0aaa('0xd')]);if(_[_0x0aaa('0x14')](this['realtime']['agents'][this[_0x0aaa('0xd')]])){logger[_0x0aaa('0xe')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x0aaa('0x2')]['id'],this[_0x0aaa('0xd')]);_0x2cd62c['done']();setTimeout(this['push'][_0x0aaa('0x7')](this),0x3e8);}else{if(util[_0x0aaa('0x15')](this[_0x0aaa('0x2')]['id'],this[_0x0aaa('0x3')][_0x0aaa('0x16')][this[_0x0aaa('0xd')]],this[_0x0aaa('0x2')][_0x0aaa('0x17')],!![])){this[_0x0aaa('0x3')][_0x0aaa('0x16')][this[_0x0aaa('0xd')]][_0x0aaa('0x18')]=!![];this[_0x0aaa('0x3')][_0x0aaa('0x16')][this['agentId']]['busyQueue']=this[_0x0aaa('0x11')][_0x0aaa('0x19')];util[_0x0aaa('0x1a')](this[_0x0aaa('0x1')],this[_0x0aaa('0x2')]['id'],this['realtime']['agents'][this['agentId']],this[_0x0aaa('0x11')],this[_0x0aaa('0x4')]);util['writeLog'](this[_0x0aaa('0x2')]['id'],this['realtime'][_0x0aaa('0x16')][this[_0x0aaa('0xd')]],_0x0aaa('0x1b'));this[_0x0aaa('0x10')][this[_0x0aaa('0xd')]]=setInterval(this[_0x0aaa('0x1c')][_0x0aaa('0x7')](this,_0x2cd62c),0x3e8);}else{logger[_0x0aaa('0xe')](_0x0aaa('0x1d'),this['squeue']['id'],this[_0x0aaa('0xd')]);_0x2cd62c[_0x0aaa('0x1e')]();setTimeout(this[_0x0aaa('0x5')][_0x0aaa('0x7')](this),0x3e8);}}};RRMemory['prototype']['handleTimeout']=function(_0x3856e9){logger[_0x0aaa('0xe')](_0x0aaa('0x1f'),this[_0x0aaa('0x2')]['id'],this['agentId']);if(_['isNil'](this[_0x0aaa('0x3')][_0x0aaa('0x16')][this[_0x0aaa('0xd')]])){logger[_0x0aaa('0xe')](_0x0aaa('0x20'),this[_0x0aaa('0x2')]['id'],this[_0x0aaa('0xd')]);}else{clearInterval(this[_0x0aaa('0x10')][this['agentId']]);util['hideNotification'](this[_0x0aaa('0x1')],this[_0x0aaa('0x2')]['id'],this[_0x0aaa('0x3')][_0x0aaa('0x16')][this[_0x0aaa('0xd')]],this[_0x0aaa('0x11')],this[_0x0aaa('0x4')]);util['writeLog'](this[_0x0aaa('0x2')]['id'],this[_0x0aaa('0x3')][_0x0aaa('0x16')][this['agentId']],_0x0aaa('0x21'));this['realtime'][_0x0aaa('0x16')][this[_0x0aaa('0xd')]][_0x0aaa('0x18')]=![];this[_0x0aaa('0x3')]['agents'][this[_0x0aaa('0xd')]][_0x0aaa('0x22')]=undefined;}if(!_0x3856e9){setTimeout(this[_0x0aaa('0x5')][_0x0aaa('0x7')](this),0x3e8);}};function rrmemory(_0x398df2,_0x377cc5,_0x35d98a,_0x93c6f9){return new RRMemory(_0x398df2,_0x377cc5,_0x35d98a,_0x93c6f9);}module['exports']=rrmemory;
\ No newline at end of file
+var _0xaee3=['push','agents','agentId','channel','info','[%s][QUEUE]\x20available\x20again\x20%s','done','mapAgentsId','[%s][QUEUE]\x20try\x20with\x20%s','isNil','isAgentAvailable','busyQueue','name','showNotification','notificationId','writeLog','RINGING','handleCheckReject','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','hideNotification','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','queue','realtime','intervals','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype'];(function(_0x40b07f,_0x2146f2){var _0x3c8a9f=function(_0x1f3388){while(--_0x1f3388){_0x40b07f['push'](_0x40b07f['shift']());}};_0x3c8a9f(++_0x2146f2);}(_0xaee3,0x65));var _0x3aee=function(_0x1c2f29,_0x5a2668){_0x1c2f29=_0x1c2f29-0x0;var _0x258465=_0xaee3[_0x1c2f29];return _0x258465;};'use strict';var rr=require('rr');var _=require(_0x3aee('0x0'));var uuid=require(_0x3aee('0x1'));var util=require(_0x3aee('0x2'));var logger=require(_0x3aee('0x3'))(_0x3aee('0x4'));var RRMemory=function(_0x5df6fc,_0x5da7d6,_0x403ddc,_0x35f612){this['notificationId']=uuid['v4']();this[_0x3aee('0x5')]=_0x5df6fc;this[_0x3aee('0x6')]=_0x5da7d6;this[_0x3aee('0x7')]=_0x403ddc;this[_0x3aee('0x4')]=_0x35f612;this[_0x3aee('0x8')]={};this[_0x3aee('0x5')]['push'](this[_0x3aee('0x9')][_0x3aee('0xa')](this),this[_0x3aee('0xb')][_0x3aee('0xa')](this),this['module']);this['squeue']['on'](_0x3aee('0xc'),this[_0x3aee('0xb')][_0x3aee('0xa')](this));this[_0x3aee('0x5')]['on'](_0x3aee('0xd'),this[_0x3aee('0xe')][_0x3aee('0xa')](this));};RRMemory[_0x3aee('0xf')][_0x3aee('0x10')]=function(){this['squeue']['push'](this[_0x3aee('0x9')]['bind'](this),this[_0x3aee('0xb')]['bind'](this));};RRMemory[_0x3aee('0xf')][_0x3aee('0xe')]=function(_0xacbe1e){this[_0x3aee('0xb')](!![]);};RRMemory['prototype']['handleCheckReject']=function(_0x15fded){if(util['isAgentAvailable'](this[_0x3aee('0x5')]['id'],this[_0x3aee('0x7')][_0x3aee('0x11')][this[_0x3aee('0x12')]],this[_0x3aee('0x5')][_0x3aee('0x13')],!![])){logger[_0x3aee('0x14')](_0x3aee('0x15'),this['squeue']['id'],this[_0x3aee('0x12')]);clearInterval(this[_0x3aee('0x8')][this[_0x3aee('0x12')]]);_0x15fded[_0x3aee('0x16')]();setTimeout(this[_0x3aee('0x10')][_0x3aee('0xa')](this),0x3e8);}};RRMemory[_0x3aee('0xf')][_0x3aee('0x9')]=function(_0x23fca8){this[_0x3aee('0x12')]=rr(this[_0x3aee('0x6')][_0x3aee('0x17')]);logger['info'](_0x3aee('0x18'),this[_0x3aee('0x5')]['id'],this[_0x3aee('0x12')]);if(_[_0x3aee('0x19')](this[_0x3aee('0x7')][_0x3aee('0x11')][this[_0x3aee('0x12')]])){logger[_0x3aee('0x14')]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x3aee('0x12')]);_0x23fca8[_0x3aee('0x16')]();setTimeout(this['push']['bind'](this),0x3e8);}else{if(util[_0x3aee('0x1a')](this[_0x3aee('0x5')]['id'],this[_0x3aee('0x7')][_0x3aee('0x11')][this[_0x3aee('0x12')]],this[_0x3aee('0x5')][_0x3aee('0x13')],!![])){this[_0x3aee('0x7')][_0x3aee('0x11')][this['agentId']]['busy']=!![];this[_0x3aee('0x7')][_0x3aee('0x11')][this[_0x3aee('0x12')]][_0x3aee('0x1b')]=this[_0x3aee('0x6')][_0x3aee('0x1c')];util[_0x3aee('0x1d')](this[_0x3aee('0x1e')],this['squeue']['id'],this[_0x3aee('0x7')][_0x3aee('0x11')][this['agentId']],this[_0x3aee('0x6')],this['routing']);util[_0x3aee('0x1f')](this[_0x3aee('0x5')]['id'],this[_0x3aee('0x7')][_0x3aee('0x11')][this[_0x3aee('0x12')]],_0x3aee('0x20'));this[_0x3aee('0x8')][this[_0x3aee('0x12')]]=setInterval(this[_0x3aee('0x21')][_0x3aee('0xa')](this,_0x23fca8),0x3e8);}else{logger[_0x3aee('0x14')](_0x3aee('0x22'),this['squeue']['id'],this[_0x3aee('0x12')]);_0x23fca8['done']();setTimeout(this[_0x3aee('0x10')][_0x3aee('0xa')](this),0x3e8);}}};RRMemory[_0x3aee('0xf')][_0x3aee('0xb')]=function(_0x5132a3){logger[_0x3aee('0x14')]('[%s][QUEUE]\x20timeout\x20with\x20%s',this['squeue']['id'],this[_0x3aee('0x12')]);if(_[_0x3aee('0x19')](this[_0x3aee('0x7')][_0x3aee('0x11')][this['agentId']])){logger[_0x3aee('0x14')](_0x3aee('0x23'),this[_0x3aee('0x5')]['id'],this[_0x3aee('0x12')]);}else{clearInterval(this[_0x3aee('0x8')][this[_0x3aee('0x12')]]);util[_0x3aee('0x24')](this[_0x3aee('0x1e')],this['squeue']['id'],this['realtime'][_0x3aee('0x11')][this[_0x3aee('0x12')]],this[_0x3aee('0x6')],this[_0x3aee('0x4')]);util[_0x3aee('0x1f')](this[_0x3aee('0x5')]['id'],this[_0x3aee('0x7')][_0x3aee('0x11')][this[_0x3aee('0x12')]],_0x3aee('0x25'));this[_0x3aee('0x7')][_0x3aee('0x11')][this[_0x3aee('0x12')]]['busy']=![];this[_0x3aee('0x7')]['agents'][this[_0x3aee('0x12')]]['busyQueue']=undefined;}if(!_0x5132a3){setTimeout(this['push']['bind'](this),0x3e8);}};function rrmemory(_0x2ca226,_0x1d0deb,_0x2c8303,_0x264f53){return new RRMemory(_0x2ca226,_0x1d0deb,_0x2c8303,_0x264f53);}module[_0x3aee('0x26')]=rrmemory;
\ No newline at end of file