Built motion from commit f861bcb808219e66da88ba48b61bddb35224a65e. Version 3.0.0...
[motion-next.git] / server / services / routing / server / applications / strategy / agent.js
index 2fc1260..d3be269 100644 (file)
@@ -1 +1 @@
-'use strict';const a1395_0x1aee=['497758bbCqEA','agent','TIMEOUT','RINGING','37oGIVda','[%s][AGENT]\x20try\x20with\x20%s','3DabOek','handleDrained','438095TURcic','uuid','202167tXdchM','./util','hideNotification','50227VXKLtz','realtime','forcedOwnership','writeLog','239PxqBuu','19033QKqhvb','busy','isNil','squeue','bind','[%s][AGENT]\x20timeout\x20with\x20%s','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',':FORCED','timeout','push','agents','handleRun','isAgentAvailable','showNotification','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','routing','info','channel','busyQueue','614671IdRAcT','prototype','lodash','notificationId','1843MtHhll','handleTimeout'];const a1395_0x1e2a=function(_0x4ce94d,_0x335367){_0x4ce94d=_0x4ce94d-0xa5;let _0x1aee3f=a1395_0x1aee[_0x4ce94d];return _0x1aee3f;};const a1395_0x228084=a1395_0x1e2a;(function(_0x1036f4,_0x1a4594){const _0x7678f5=a1395_0x1e2a;while(!![]){try{const _0x3dd435=parseInt(_0x7678f5(0xb4))*-parseInt(_0x7678f5(0xbb))+parseInt(_0x7678f5(0xac))*parseInt(_0x7678f5(0xbf))+-parseInt(_0x7678f5(0xc0))*-parseInt(_0x7678f5(0xb2))+parseInt(_0x7678f5(0xb8))+-parseInt(_0x7678f5(0xa8))+parseInt(_0x7678f5(0xae))+-parseInt(_0x7678f5(0xb6));if(_0x3dd435===_0x1a4594)break;else _0x1036f4['push'](_0x1036f4['shift']());}catch(_0x2dfe25){_0x1036f4['push'](_0x1036f4['shift']());}}}(a1395_0x1aee,0x9c898));const _=require(a1395_0x228084(0xaa)),uuid=require(a1395_0x228084(0xb7)),util=require(a1395_0x228084(0xb9)),logger=require('@config/logger')('routing'),Agent=function(_0x51a4b1,_0x3ff9b0,_0x38b340,_0x3d7feb){const _0x54cb22=a1395_0x228084;this[_0x54cb22(0xab)]=uuid['v4'](),this[_0x54cb22(0xc3)]=_0x51a4b1,this[_0x54cb22(0xaf)]=_0x3ff9b0,this['realtime']=_0x38b340,this[_0x54cb22(0xcf)]=_0x3d7feb,this[_0x54cb22(0xc3)]['push'](this[_0x54cb22(0xcb)]['bind'](this),this[_0x54cb22(0xad)]['bind'](this)),this[_0x54cb22(0xc3)]['on'](_0x54cb22(0xc8),this['handleTimeout'][_0x54cb22(0xc4)](this)),this[_0x54cb22(0xc3)]['on']('drained',this[_0x54cb22(0xb5)][_0x54cb22(0xc4)](this));};Agent[a1395_0x228084(0xa9)]['push']=function(){const _0x5eddb6=a1395_0x228084;this['squeue'][_0x5eddb6(0xc9)](this[_0x5eddb6(0xcb)][_0x5eddb6(0xc4)](this),this[_0x5eddb6(0xad)][_0x5eddb6(0xc4)](this));},Agent[a1395_0x228084(0xa9)][a1395_0x228084(0xb5)]=function(){const _0x181533=a1395_0x228084;this[_0x181533(0xad)](!![]);},Agent[a1395_0x228084(0xa9)]['handleRun']=function(){const _0xbcf176=a1395_0x228084;logger[_0xbcf176(0xa5)](_0xbcf176(0xb3),this[_0xbcf176(0xc3)]['id'],this[_0xbcf176(0xaf)]['id']),_['isNil'](this[_0xbcf176(0xbc)][_0xbcf176(0xca)][this[_0xbcf176(0xaf)]['id']])?(logger[_0xbcf176(0xa5)](_0xbcf176(0xc6),this[_0xbcf176(0xc3)]['id'],this[_0xbcf176(0xaf)]['id']),setTimeout(this[_0xbcf176(0xc9)][_0xbcf176(0xc4)](this),0x3e8)):this['routing'][_0xbcf176(0xbd)]||util[_0xbcf176(0xcc)](this['squeue']['id'],this['realtime'][_0xbcf176(0xca)][this[_0xbcf176(0xaf)]['id']],this[_0xbcf176(0xc3)][_0xbcf176(0xa6)],![])?(this['realtime'][_0xbcf176(0xca)][this[_0xbcf176(0xaf)]['id']][_0xbcf176(0xc1)]=!![],this[_0xbcf176(0xbc)][_0xbcf176(0xca)][this['agent']['id']]['busyQueue']=undefined,util[_0xbcf176(0xcd)](this['notificationId'],this['squeue']['id'],this[_0xbcf176(0xbc)][_0xbcf176(0xca)][this[_0xbcf176(0xaf)]['id']],null,this[_0xbcf176(0xcf)]),util[_0xbcf176(0xbe)](this[_0xbcf176(0xc3)]['id'],this[_0xbcf176(0xbc)][_0xbcf176(0xca)][this[_0xbcf176(0xaf)]['id']],_0xbcf176(0xb1)+(this['routing']['forcedOwnership']?_0xbcf176(0xc7):''))):(logger[_0xbcf176(0xa5)](_0xbcf176(0xce),this[_0xbcf176(0xc3)]['id'],this[_0xbcf176(0xaf)]['id']),setTimeout(this[_0xbcf176(0xc9)][_0xbcf176(0xc4)](this),0x3e8));},Agent[a1395_0x228084(0xa9)]['handleTimeout']=function(_0x12fec7){const _0x511f44=a1395_0x228084;if(_[_0x511f44(0xc2)](this['realtime'][_0x511f44(0xca)][this[_0x511f44(0xaf)]['id']]))return logger[_0x511f44(0xa5)]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x511f44(0xc3)]['id'],this[_0x511f44(0xaf)]['id']);else logger[_0x511f44(0xa5)](_0x511f44(0xc5),this[_0x511f44(0xc3)]['id'],this[_0x511f44(0xaf)]['id']),util[_0x511f44(0xba)](this[_0x511f44(0xab)],this[_0x511f44(0xc3)]['id'],this['realtime']['agents'][this[_0x511f44(0xaf)]['id']],null,this[_0x511f44(0xcf)]),this[_0x511f44(0xbc)][_0x511f44(0xca)][this[_0x511f44(0xaf)]['id']]['busy']=![],this['realtime']['agents'][this['agent']['id']][_0x511f44(0xa7)]=undefined,util[_0x511f44(0xbe)](this[_0x511f44(0xc3)]['id'],this[_0x511f44(0xbc)][_0x511f44(0xca)][this[_0x511f44(0xaf)]['id']],_0x12fec7?'STOP':_0x511f44(0xb0));!_0x12fec7&&setTimeout(this[_0x511f44(0xc9)][_0x511f44(0xc4)](this),0x3e8);};function agent(_0x269d47,_0x2a97e5,_0x479b17,_0x25b89a){return new Agent(_0x269d47,_0x2a97e5,_0x479b17,_0x25b89a);}module['exports']=agent;
\ No newline at end of file
+'use strict';const a1403_0x3676=['channel','routing','info','69257aMyrxz','drained','uuid','RINGING','busyQueue','handleTimeout','writeLog','busy','bind','push','prototype','exports','agent','107867ofkgnh','1dGNdBy','122869KTcpOP','agents','timeout','handleRun','550752sCuEDA','isNil','3oeTaSQ','@config/logger','showNotification','squeue','526443DkiPZG','handleDrained',':FORCED','46437dXomNC','notificationId','forcedOwnership','[%s][AGENT]\x20timeout\x20with\x20%s','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','342102liaKoI','17EpwExH','realtime'];const a1403_0x1c01=function(_0x3eddef,_0x2c1084){_0x3eddef=_0x3eddef-0x198;let _0x3676e5=a1403_0x3676[_0x3eddef];return _0x3676e5;};const a1403_0x4e3a12=a1403_0x1c01;(function(_0x2ed962,_0x113762){const _0x277bcc=a1403_0x1c01;while(!![]){try{const _0x51fe3e=parseInt(_0x277bcc(0x1a6))+-parseInt(_0x277bcc(0x199))*parseInt(_0x277bcc(0x1bb))+-parseInt(_0x277bcc(0x1bf))*parseInt(_0x277bcc(0x1ba))+-parseInt(_0x277bcc(0x1ac))+-parseInt(_0x277bcc(0x1a0))+-parseInt(_0x277bcc(0x19d))+parseInt(_0x277bcc(0x1b9))*parseInt(_0x277bcc(0x1a7));if(_0x51fe3e===_0x113762)break;else _0x2ed962['push'](_0x2ed962['shift']());}catch(_0x34a266){_0x2ed962['push'](_0x2ed962['shift']());}}}(a1403_0x3676,0x95fc9));const _=require('lodash'),uuid=require(a1403_0x4e3a12(0x1ae)),util=require('./util'),logger=require(a1403_0x4e3a12(0x19a))(a1403_0x4e3a12(0x1aa)),Agent=function(_0x4de1bd,_0x2a182d,_0x342d58,_0x4edbb6){const _0x5bf1b2=a1403_0x4e3a12;this['notificationId']=uuid['v4'](),this[_0x5bf1b2(0x19c)]=_0x4de1bd,this['agent']=_0x2a182d,this['realtime']=_0x342d58,this[_0x5bf1b2(0x1aa)]=_0x4edbb6,this['squeue']['push'](this[_0x5bf1b2(0x1be)][_0x5bf1b2(0x1b4)](this),this['handleTimeout'][_0x5bf1b2(0x1b4)](this)),this['squeue']['on'](_0x5bf1b2(0x1bd),this[_0x5bf1b2(0x1b1)][_0x5bf1b2(0x1b4)](this)),this[_0x5bf1b2(0x19c)]['on'](_0x5bf1b2(0x1ad),this[_0x5bf1b2(0x19e)][_0x5bf1b2(0x1b4)](this));};Agent[a1403_0x4e3a12(0x1b6)]['push']=function(){const _0x2f299d=a1403_0x4e3a12;this['squeue'][_0x2f299d(0x1b5)](this[_0x2f299d(0x1be)][_0x2f299d(0x1b4)](this),this[_0x2f299d(0x1b1)][_0x2f299d(0x1b4)](this));},Agent[a1403_0x4e3a12(0x1b6)][a1403_0x4e3a12(0x19e)]=function(){this['handleTimeout'](!![]);},Agent['prototype'][a1403_0x4e3a12(0x1be)]=function(){const _0x291245=a1403_0x4e3a12;logger[_0x291245(0x1ab)]('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this[_0x291245(0x1b8)]['id']),_['isNil'](this[_0x291245(0x1a8)]['agents'][this[_0x291245(0x1b8)]['id']])?(logger[_0x291245(0x1ab)](_0x291245(0x1a5),this[_0x291245(0x19c)]['id'],this[_0x291245(0x1b8)]['id']),setTimeout(this[_0x291245(0x1b5)][_0x291245(0x1b4)](this),0x3e8)):this[_0x291245(0x1aa)][_0x291245(0x1a2)]||util['isAgentAvailable'](this[_0x291245(0x19c)]['id'],this[_0x291245(0x1a8)][_0x291245(0x1bc)][this[_0x291245(0x1b8)]['id']],this[_0x291245(0x19c)][_0x291245(0x1a9)],![])?(this[_0x291245(0x1a8)][_0x291245(0x1bc)][this[_0x291245(0x1b8)]['id']][_0x291245(0x1b3)]=!![],this[_0x291245(0x1a8)][_0x291245(0x1bc)][this[_0x291245(0x1b8)]['id']][_0x291245(0x1b0)]=undefined,util[_0x291245(0x19b)](this[_0x291245(0x1a1)],this[_0x291245(0x19c)]['id'],this[_0x291245(0x1a8)]['agents'][this[_0x291245(0x1b8)]['id']],null,this[_0x291245(0x1aa)]),util[_0x291245(0x1b2)](this[_0x291245(0x19c)]['id'],this['realtime'][_0x291245(0x1bc)][this[_0x291245(0x1b8)]['id']],_0x291245(0x1af)+(this[_0x291245(0x1aa)][_0x291245(0x1a2)]?_0x291245(0x19f):''))):(logger[_0x291245(0x1ab)](_0x291245(0x1a4),this['squeue']['id'],this[_0x291245(0x1b8)]['id']),setTimeout(this[_0x291245(0x1b5)][_0x291245(0x1b4)](this),0x3e8));},Agent[a1403_0x4e3a12(0x1b6)][a1403_0x4e3a12(0x1b1)]=function(_0x53f160){const _0x4c8ca4=a1403_0x4e3a12;if(_[_0x4c8ca4(0x198)](this[_0x4c8ca4(0x1a8)][_0x4c8ca4(0x1bc)][this[_0x4c8ca4(0x1b8)]['id']]))return logger[_0x4c8ca4(0x1ab)](_0x4c8ca4(0x1a5),this[_0x4c8ca4(0x19c)]['id'],this[_0x4c8ca4(0x1b8)]['id']);else logger['info'](_0x4c8ca4(0x1a3),this['squeue']['id'],this[_0x4c8ca4(0x1b8)]['id']),util['hideNotification'](this[_0x4c8ca4(0x1a1)],this[_0x4c8ca4(0x19c)]['id'],this[_0x4c8ca4(0x1a8)]['agents'][this['agent']['id']],null,this[_0x4c8ca4(0x1aa)]),this['realtime'][_0x4c8ca4(0x1bc)][this[_0x4c8ca4(0x1b8)]['id']]['busy']=![],this['realtime'][_0x4c8ca4(0x1bc)][this[_0x4c8ca4(0x1b8)]['id']]['busyQueue']=undefined,util['writeLog'](this['squeue']['id'],this[_0x4c8ca4(0x1a8)][_0x4c8ca4(0x1bc)][this[_0x4c8ca4(0x1b8)]['id']],_0x53f160?'STOP':'TIMEOUT');!_0x53f160&&setTimeout(this[_0x4c8ca4(0x1b5)]['bind'](this),0x3e8);};function agent(_0x2c92d7,_0x3c6304,_0xa5c73a,_0x3f4391){return new Agent(_0x2c92d7,_0x3c6304,_0xa5c73a,_0x3f4391);}module[a1403_0x4e3a12(0x1b7)]=agent;
\ No newline at end of file