Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / services / routing / server / applications / strategy / rrmemory.js
index 45d1ee6..dafe599 100644 (file)
@@ -1 +1 @@
-'use strict';const a1398_0x3526=['4973lRlJUk','144777ROoFoW','channel','busy','realtime','intervals','isNil','256163ntHkEn','TIMEOUT','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','87740kTQCpS','agentId','timeout','mapAgentsId','[%s][QUEUE]\x20timeout\x20with\x20%s','writeLog','module','info','name','handleTimeout','prototype','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','handleDrained','[%s][QUEUE]\x20available\x20again\x20%s','bind','squeue','push','done','showNotification','routing','queue','handleCheckReject','[%s][QUEUE]\x20try\x20with\x20%s','305246STXnnY','RINGING','./util','uuid','77PIHvcs','agents','1kmHjVS','553766OimMeR','drained','isAgentAvailable','notificationId','busyQueue','hideNotification','handleRun','@config/logger','499704SXkWPz'];const a1398_0x476d=function(_0x1c0298,_0x1b0b3e){_0x1c0298=_0x1c0298-0x136;let _0x35265c=a1398_0x3526[_0x1c0298];return _0x35265c;};const a1398_0x454776=a1398_0x476d;(function(_0x622da5,_0x53167f){const _0x11d713=a1398_0x476d;while(!![]){try{const _0x2b00fd=-parseInt(_0x11d713(0x13a))+parseInt(_0x11d713(0x144))+parseInt(_0x11d713(0x164))+-parseInt(_0x11d713(0x137))*parseInt(_0x11d713(0x143))+parseInt(_0x11d713(0x14d))+-parseInt(_0x11d713(0x139))*-parseInt(_0x11d713(0x14a))+parseInt(_0x11d713(0x142));if(_0x2b00fd===_0x53167f)break;else _0x622da5['push'](_0x622da5['shift']());}catch(_0x1e2271){_0x622da5['push'](_0x622da5['shift']());}}}(a1398_0x3526,0x5724f));const rr=require('rr'),_=require('lodash'),uuid=require(a1398_0x454776(0x136)),util=require(a1398_0x454776(0x166)),logger=require(a1398_0x454776(0x141))(a1398_0x454776(0x160)),RRMemory=function(_0xd16083,_0x4204c8,_0x4bc0a5,_0x53c18d){const _0x4cb2dd=a1398_0x454776;this[_0x4cb2dd(0x13d)]=uuid['v4'](),this[_0x4cb2dd(0x15c)]=_0xd16083,this['queue']=_0x4204c8,this[_0x4cb2dd(0x147)]=_0x4bc0a5,this['routing']=_0x53c18d,this['intervals']={},this[_0x4cb2dd(0x15c)]['push'](this[_0x4cb2dd(0x140)][_0x4cb2dd(0x15b)](this),this[_0x4cb2dd(0x156)]['bind'](this),this[_0x4cb2dd(0x153)]),this[_0x4cb2dd(0x15c)]['on'](_0x4cb2dd(0x14f),this[_0x4cb2dd(0x156)]['bind'](this)),this[_0x4cb2dd(0x15c)]['on'](_0x4cb2dd(0x13b),this[_0x4cb2dd(0x159)][_0x4cb2dd(0x15b)](this));};RRMemory[a1398_0x454776(0x157)][a1398_0x454776(0x15d)]=function(){const _0x5551cb=a1398_0x454776;this['squeue'][_0x5551cb(0x15d)](this[_0x5551cb(0x140)]['bind'](this),this[_0x5551cb(0x156)]['bind'](this));},RRMemory['prototype'][a1398_0x454776(0x159)]=function(){this['handleTimeout'](!![]);},RRMemory[a1398_0x454776(0x157)]['handleCheckReject']=function(_0x42b7de){const _0x41685d=a1398_0x454776;util[_0x41685d(0x13c)](this[_0x41685d(0x15c)]['id'],this[_0x41685d(0x147)][_0x41685d(0x138)][this[_0x41685d(0x14e)]],this[_0x41685d(0x15c)][_0x41685d(0x145)],!![])&&(logger[_0x41685d(0x154)](_0x41685d(0x15a),this[_0x41685d(0x15c)]['id'],this[_0x41685d(0x14e)]),clearInterval(this[_0x41685d(0x148)][this[_0x41685d(0x14e)]]),_0x42b7de[_0x41685d(0x15e)](),setTimeout(this[_0x41685d(0x15d)][_0x41685d(0x15b)](this),0x3e8));},RRMemory['prototype']['handleRun']=function(_0xbace9d){const _0x4676eb=a1398_0x454776;this['agentId']=rr(this[_0x4676eb(0x161)][_0x4676eb(0x150)]),logger[_0x4676eb(0x154)](_0x4676eb(0x163),this['squeue']['id'],this[_0x4676eb(0x14e)]),_[_0x4676eb(0x149)](this[_0x4676eb(0x147)][_0x4676eb(0x138)][this[_0x4676eb(0x14e)]])?(logger['info'](_0x4676eb(0x158),this['squeue']['id'],this['agentId']),_0xbace9d[_0x4676eb(0x15e)](),setTimeout(this[_0x4676eb(0x15d)][_0x4676eb(0x15b)](this),0x3e8)):util[_0x4676eb(0x13c)](this[_0x4676eb(0x15c)]['id'],this[_0x4676eb(0x147)]['agents'][this['agentId']],this['squeue'][_0x4676eb(0x145)],!![])?(this[_0x4676eb(0x147)][_0x4676eb(0x138)][this[_0x4676eb(0x14e)]][_0x4676eb(0x146)]=!![],this['realtime']['agents'][this[_0x4676eb(0x14e)]][_0x4676eb(0x13e)]=this['queue'][_0x4676eb(0x155)],util[_0x4676eb(0x15f)](this[_0x4676eb(0x13d)],this[_0x4676eb(0x15c)]['id'],this[_0x4676eb(0x147)][_0x4676eb(0x138)][this[_0x4676eb(0x14e)]],this[_0x4676eb(0x161)],this[_0x4676eb(0x160)]),util[_0x4676eb(0x152)](this[_0x4676eb(0x15c)]['id'],this['realtime'][_0x4676eb(0x138)][this[_0x4676eb(0x14e)]],_0x4676eb(0x165)),this[_0x4676eb(0x148)][this['agentId']]=setInterval(this[_0x4676eb(0x162)][_0x4676eb(0x15b)](this,_0xbace9d),0x3e8)):(logger[_0x4676eb(0x154)](_0x4676eb(0x14c),this['squeue']['id'],this['agentId']),_0xbace9d['done'](),setTimeout(this[_0x4676eb(0x15d)][_0x4676eb(0x15b)](this),0x3e8));},RRMemory[a1398_0x454776(0x157)][a1398_0x454776(0x156)]=function(_0x49fc60){const _0x1f4887=a1398_0x454776;logger[_0x1f4887(0x154)](_0x1f4887(0x151),this[_0x1f4887(0x15c)]['id'],this[_0x1f4887(0x14e)]),_[_0x1f4887(0x149)](this[_0x1f4887(0x147)][_0x1f4887(0x138)][this['agentId']])?logger[_0x1f4887(0x154)](_0x1f4887(0x158),this[_0x1f4887(0x15c)]['id'],this[_0x1f4887(0x14e)]):(clearInterval(this[_0x1f4887(0x148)][this['agentId']]),util[_0x1f4887(0x13f)](this[_0x1f4887(0x13d)],this[_0x1f4887(0x15c)]['id'],this[_0x1f4887(0x147)][_0x1f4887(0x138)][this[_0x1f4887(0x14e)]],this[_0x1f4887(0x161)],this[_0x1f4887(0x160)]),util[_0x1f4887(0x152)](this[_0x1f4887(0x15c)]['id'],this[_0x1f4887(0x147)][_0x1f4887(0x138)][this['agentId']],_0x1f4887(0x14b)),this['realtime']['agents'][this['agentId']][_0x1f4887(0x146)]=![],this[_0x1f4887(0x147)][_0x1f4887(0x138)][this[_0x1f4887(0x14e)]][_0x1f4887(0x13e)]=undefined),!_0x49fc60&&setTimeout(this['push'][_0x1f4887(0x15b)](this),0x3e8);};function rrmemory(_0xce089c,_0x3ce8a5,_0xd35b23,_0x5af166){return new RRMemory(_0xce089c,_0x3ce8a5,_0xd35b23,_0x5af166);}module['exports']=rrmemory;
\ No newline at end of file
+'use strict';const a1406_0x29b2=['queue','exports','@config/logger','intervals','[%s][QUEUE]\x20agent\x20skipped,\x20not\x20available\x20id\x20%s','lodash','module','71GPlbiJ','agentId','65485SDjszX','bind','33539iTEbaC','drained','1335784WNfiPq','mapAgentsId','handleDrained','push','realtime','4957TmzYVH','handleTimeout','38wuxDfv','agents','552apUfSP','TIMEOUT','routing','busyQueue','1106563LzZUNI','handleCheckReject','channel','name','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][QUEUE]\x20timeout\x20with\x20%s','[%s][QUEUE]\x20available\x20again\x20%s','info','handleRun','showNotification','squeue','writeLog','busy','prototype','isNil','done','notificationId','450665XuTrhs','hideNotification','isAgentAvailable','1996OEhMmB'];const a1406_0x4122=function(_0x3d602d,_0x9ae8e9){_0x3d602d=_0x3d602d-0x16e;let _0x29b2fd=a1406_0x29b2[_0x3d602d];return _0x29b2fd;};const a1406_0x4c93be=a1406_0x4122;(function(_0xc80a6d,_0x328e75){const _0x1445dd=a1406_0x4122;while(!![]){try{const _0x1296fa=-parseInt(_0x1445dd(0x170))*-parseInt(_0x1445dd(0x179))+parseInt(_0x1445dd(0x19b))*parseInt(_0x1445dd(0x177))+-parseInt(_0x1445dd(0x172))+parseInt(_0x1445dd(0x17f))+-parseInt(_0x1445dd(0x16e))+parseInt(_0x1445dd(0x190))+-parseInt(_0x1445dd(0x193))*parseInt(_0x1445dd(0x17b));if(_0x1296fa===_0x328e75)break;else _0xc80a6d['push'](_0xc80a6d['shift']());}catch(_0x311314){_0xc80a6d['push'](_0xc80a6d['shift']());}}}(a1406_0x29b2,0xa6294));const rr=require('rr'),_=require(a1406_0x4c93be(0x199)),uuid=require('uuid'),util=require('./util'),logger=require(a1406_0x4c93be(0x196))(a1406_0x4c93be(0x17d)),RRMemory=function(_0x3afc62,_0x1ce501,_0x4b5d63,_0x3ef0c3){const _0x5a9f86=a1406_0x4c93be;this['notificationId']=uuid['v4'](),this[_0x5a9f86(0x189)]=_0x3afc62,this['queue']=_0x1ce501,this['realtime']=_0x4b5d63,this['routing']=_0x3ef0c3,this['intervals']={},this[_0x5a9f86(0x189)][_0x5a9f86(0x175)](this[_0x5a9f86(0x187)]['bind'](this),this[_0x5a9f86(0x178)][_0x5a9f86(0x16f)](this),this[_0x5a9f86(0x19a)]),this[_0x5a9f86(0x189)]['on']('timeout',this[_0x5a9f86(0x178)][_0x5a9f86(0x16f)](this)),this[_0x5a9f86(0x189)]['on'](_0x5a9f86(0x171),this[_0x5a9f86(0x174)]['bind'](this));};RRMemory['prototype']['push']=function(){const _0x571e26=a1406_0x4c93be;this['squeue'][_0x571e26(0x175)](this[_0x571e26(0x187)][_0x571e26(0x16f)](this),this['handleTimeout'][_0x571e26(0x16f)](this));},RRMemory['prototype'][a1406_0x4c93be(0x174)]=function(){const _0x1baa80=a1406_0x4c93be;this[_0x1baa80(0x178)](!![]);},RRMemory[a1406_0x4c93be(0x18c)]['handleCheckReject']=function(_0x44b25e){const _0x26de09=a1406_0x4c93be;util[_0x26de09(0x192)](this[_0x26de09(0x189)]['id'],this[_0x26de09(0x176)][_0x26de09(0x17a)][this[_0x26de09(0x19c)]],this[_0x26de09(0x189)][_0x26de09(0x181)],!![])&&(logger['info'](_0x26de09(0x185),this[_0x26de09(0x189)]['id'],this[_0x26de09(0x19c)]),clearInterval(this[_0x26de09(0x197)][this['agentId']]),_0x44b25e['done'](),setTimeout(this[_0x26de09(0x175)]['bind'](this),0x3e8));},RRMemory[a1406_0x4c93be(0x18c)][a1406_0x4c93be(0x187)]=function(_0x28d001){const _0x351d36=a1406_0x4c93be;this[_0x351d36(0x19c)]=rr(this[_0x351d36(0x194)][_0x351d36(0x173)]),logger[_0x351d36(0x186)]('[%s][QUEUE]\x20try\x20with\x20%s',this[_0x351d36(0x189)]['id'],this[_0x351d36(0x19c)]),_[_0x351d36(0x18d)](this['realtime'][_0x351d36(0x17a)][this[_0x351d36(0x19c)]])?(logger['info'](_0x351d36(0x183),this['squeue']['id'],this[_0x351d36(0x19c)]),_0x28d001[_0x351d36(0x18e)](),setTimeout(this[_0x351d36(0x175)]['bind'](this),0x3e8)):util['isAgentAvailable'](this[_0x351d36(0x189)]['id'],this['realtime'][_0x351d36(0x17a)][this['agentId']],this[_0x351d36(0x189)]['channel'],!![])?(this[_0x351d36(0x176)][_0x351d36(0x17a)][this[_0x351d36(0x19c)]][_0x351d36(0x18b)]=!![],this[_0x351d36(0x176)][_0x351d36(0x17a)][this[_0x351d36(0x19c)]][_0x351d36(0x17e)]=this['queue'][_0x351d36(0x182)],util[_0x351d36(0x188)](this[_0x351d36(0x18f)],this[_0x351d36(0x189)]['id'],this[_0x351d36(0x176)][_0x351d36(0x17a)][this['agentId']],this[_0x351d36(0x194)],this[_0x351d36(0x17d)]),util['writeLog'](this[_0x351d36(0x189)]['id'],this[_0x351d36(0x176)]['agents'][this[_0x351d36(0x19c)]],'RINGING'),this[_0x351d36(0x197)][this[_0x351d36(0x19c)]]=setInterval(this[_0x351d36(0x180)]['bind'](this,_0x28d001),0x3e8)):(logger[_0x351d36(0x186)](_0x351d36(0x198),this['squeue']['id'],this['agentId']),_0x28d001['done'](),setTimeout(this[_0x351d36(0x175)][_0x351d36(0x16f)](this),0x3e8));},RRMemory[a1406_0x4c93be(0x18c)][a1406_0x4c93be(0x178)]=function(_0x48fa18){const _0x575347=a1406_0x4c93be;logger['info'](_0x575347(0x184),this[_0x575347(0x189)]['id'],this['agentId']),_[_0x575347(0x18d)](this[_0x575347(0x176)][_0x575347(0x17a)][this[_0x575347(0x19c)]])?logger[_0x575347(0x186)]('[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this['agentId']):(clearInterval(this[_0x575347(0x197)][this['agentId']]),util[_0x575347(0x191)](this['notificationId'],this['squeue']['id'],this['realtime'][_0x575347(0x17a)][this[_0x575347(0x19c)]],this['queue'],this[_0x575347(0x17d)]),util[_0x575347(0x18a)](this[_0x575347(0x189)]['id'],this[_0x575347(0x176)][_0x575347(0x17a)][this['agentId']],_0x575347(0x17c)),this[_0x575347(0x176)][_0x575347(0x17a)][this[_0x575347(0x19c)]][_0x575347(0x18b)]=![],this[_0x575347(0x176)][_0x575347(0x17a)][this[_0x575347(0x19c)]]['busyQueue']=undefined),!_0x48fa18&&setTimeout(this[_0x575347(0x175)][_0x575347(0x16f)](this),0x3e8);};function rrmemory(_0x1b0b76,_0x83ab6a,_0x41cb6a,_0xe9c203){return new RRMemory(_0x1b0b76,_0x83ab6a,_0x41cb6a,_0xe9c203);}module[a1406_0x4c93be(0x195)]=rrmemory;
\ No newline at end of file