feat: add fs service url to sbc ping option (#383)

* feat multi srs

* add fs service URL to SBC ping option
This commit is contained in:
Hoan Luu Huu
2023-06-23 17:13:08 +07:00
committed by GitHub
parent 91fe3ceb06
commit 62bc6b4bac
4 changed files with 15 additions and 9 deletions

5
app.js
View File

@@ -120,10 +120,15 @@ function handle(signal) {
srf.locals.disabled = true;
logger.info(`got signal ${signal}`);
const setName = `${(JAMBONES_CLUSTER_ID || 'default')}:active-fs`;
const fsServiceUrlSetName = `${(JAMBONES_CLUSTER_ID || 'default')}:fs-service-url`;
if (setName && srf.locals.localSipAddress) {
logger.info(`got signal ${signal}, removing ${srf.locals.localSipAddress} from set ${setName}`);
removeFromSet(setName, srf.locals.localSipAddress);
}
if (fsServiceUrlSetName && srf.locals.serviceUrl) {
logger.info(`got signal ${signal}, removing ${srf.locals.serviceUrl} from set ${fsServiceUrlSetName}`);
removeFromSet(fsServiceUrlSetName, srf.locals.serviceUrl);
}
removeFromSet(FS_UUID_SET_NAME, srf.locals.fsUUID);
if (K8S) {
srf.locals.lifecycleEmitter.operationalState = LifeCycleEvents.ScaleIn;

View File

@@ -101,7 +101,8 @@ module.exports = (logger) => {
method: 'OPTIONS',
headers: {
'X-FS-Status': ms && !dryUpCalls ? 'open' : 'closed',
'X-FS-Calls': srf.locals.sessionTracker.count
'X-FS-Calls': srf.locals.sessionTracker.count,
'X-FS-ServiceUrl': srf.locals.serviceUrl
}
});
req.on('response', (res) => {

14
package-lock.json generated
View File

@@ -15,7 +15,7 @@
"@jambonz/speech-utils": "^0.0.15",
"@jambonz/stats-collector": "^0.1.8",
"@jambonz/time-series": "^0.2.7",
"@jambonz/verb-specifications": "^0.0.24",
"@jambonz/verb-specifications": "^0.0.25",
"@opentelemetry/api": "^1.4.0",
"@opentelemetry/exporter-jaeger": "^1.9.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.35.0",
@@ -1699,9 +1699,9 @@
}
},
"node_modules/@jambonz/verb-specifications": {
"version": "0.0.24",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.24.tgz",
"integrity": "sha512-Bm8NKaCa2Xor82I1c873BtBaXbtFHXS3rPrnSM1+cYQqz5eXkl4QE4qDKqv2z9ihYYuuTZzTwwp8jQSXJGIb0g==",
"version": "0.0.25",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.25.tgz",
"integrity": "sha512-Dq8bS9hNCWGm7CbSaAwMv3YzG6PI1tk3lOj0bFIF74FiLq/cIHtm4KsUwUMQPgJhED8Lbi0v3q63L98737ndbg==",
"dependencies": {
"debug": "^4.3.4",
"pino": "^8.8.0"
@@ -10219,9 +10219,9 @@
}
},
"@jambonz/verb-specifications": {
"version": "0.0.24",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.24.tgz",
"integrity": "sha512-Bm8NKaCa2Xor82I1c873BtBaXbtFHXS3rPrnSM1+cYQqz5eXkl4QE4qDKqv2z9ihYYuuTZzTwwp8jQSXJGIb0g==",
"version": "0.0.25",
"resolved": "https://registry.npmjs.org/@jambonz/verb-specifications/-/verb-specifications-0.0.25.tgz",
"integrity": "sha512-Dq8bS9hNCWGm7CbSaAwMv3YzG6PI1tk3lOj0bFIF74FiLq/cIHtm4KsUwUMQPgJhED8Lbi0v3q63L98737ndbg==",
"requires": {
"debug": "^4.3.4",
"pino": "^8.8.0"

View File

@@ -31,7 +31,7 @@
"@jambonz/speech-utils": "^0.0.15",
"@jambonz/stats-collector": "^0.1.8",
"@jambonz/time-series": "^0.2.7",
"@jambonz/verb-specifications": "^0.0.24",
"@jambonz/verb-specifications": "^0.0.25",
"@opentelemetry/api": "^1.4.0",
"@opentelemetry/exporter-jaeger": "^1.9.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.35.0",