Compare commits

..
6 Commits
Author SHA1 Message Date
Hoan Luu Huu dd198105e3 update drachtio srf 5.0.4 (#176) 2025-04-18 07:50:21 -04:00
rammohan-y a34491a356 Updated db-helper to 0.9.11 (#175)
https://github.com/jambonz/jambonz-feature-server/issues/1151
2025-04-14 08:22:09 -04:00
Dave Horton 3a467921a6 return 482 loop detected if call to a sip uri would loop back to us (#173)
* return 482 loop detected if call to a sip uri would loop back to us

* this pr fixes #172

* typo

* wip

* wip
2025-03-20 11:25:08 -04:00
rammohan-y 9cb75a0b6b updated realtimedb-helper to 0.8.13 (#169) 2025-03-10 09:53:49 -04:00
Dave Horton 28dae50202 REFER should have sips contact if far end is using sips (#168) 2025-02-24 09:47:47 -05:00
Dave Horton 0b45e766b9 update drachtio-srf 2025-02-20 10:16:59 -05:00
4 changed files with 33 additions and 18 deletions
+2 -1
View File
@@ -1173,7 +1173,7 @@ Duration=${payload.duration} `
// eslint-disable-next-line no-unused-vars
'content-length': _contentlength, 'refer-to': _referto, 'referred-by': referredby,
// eslint-disable-next-line no-unused-vars
'X-Refer-To-Leave-Untouched': _leave,
'X-Refer-To-Leave-Untouched': _leave, contact: _contact,
...customHeaders
} = req.headers;
@@ -1193,6 +1193,7 @@ Duration=${payload.duration} `
headers: {
'Refer-To': `<${stringifyUri(uri)}>`,
'Referred-By': referredby,
'Contact': this.contactHeader,
...customHeaders
}
});
+15 -2
View File
@@ -260,9 +260,22 @@ module.exports = (srf, logger, redisClient) => {
else if ('sip' === desiredRouting) {
// call that needs to be forwarded to a sip endpoint
logger.info(`forwarding call to sip endpoint ${req.uri}`);
// check if the domain is one of ours
if (process.env.JAMBONES_LOCAL_SIP_DOMAINS) {
const allowedDomains = process.env.JAMBONES_LOCAL_SIP_DOMAINS.split(',');
const domain = uri.host;
const isLoop = allowedDomains.some((allowed) =>
domain === allowed.trim() || domain.endsWith(`.${allowed.trim()}`)
);
if (isLoop) {
logger.info({ host: domain }, `returning 482 Loop Detected for attempt to send to: ${req.uri}`);
res.send(482, 'Loop Detected');
return req.srf.endSession(req);
}
}
req.locals.target = 'forward';
}
else if ('phone' === desiredRouting) {
} else if ('phone' === desiredRouting) {
debug('sending call to LCR');
req.locals.target = 'lcr';
}
+13 -12
View File
@@ -9,10 +9,10 @@
"version": "0.9.3",
"license": "MIT",
"dependencies": {
"@jambonz/db-helpers": "^0.9.9",
"@jambonz/db-helpers": "^0.9.11",
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/mw-registrar": "0.2.7",
"@jambonz/realtimedb-helpers": "^0.8.9",
"@jambonz/realtimedb-helpers": "^0.8.13",
"@jambonz/rtpengine-utils": "^0.4.4",
"@jambonz/siprec-client-utils": "^0.2.10",
"@jambonz/stats-collector": "^0.1.10",
@@ -20,7 +20,7 @@
"cidr-matcher": "^2.1.1",
"debug": "^4.3.4",
"drachtio-fn-b2b-sugar": "^0.2.1",
"drachtio-srf": "^5.0.1",
"drachtio-srf": "^5.0.4",
"express": "^4.19.2",
"pino": "^8.20.0",
"sdp-transform": "^2.15.0"
@@ -578,9 +578,9 @@
}
},
"node_modules/@jambonz/db-helpers": {
"version": "0.9.9",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.9.9.tgz",
"integrity": "sha512-aUr7kq78NUiOg7/aqFW+KseHqwujtThaJHu7O1Bp5OznHLMDNFB8jJJDs3LGIqaRHEM/c4oaKtpKA4wahgP99w==",
"version": "0.9.11",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.9.11.tgz",
"integrity": "sha512-L6xw60J0sYEMlR0EkeqolKbk+g08yvN51V8D0+bBfpTxsJUGgHiYhDgeGeTLU5J1FQCGwmj2RI1AVW5aAu6Q1A==",
"dependencies": {
"cidr-matcher": "^2.1.1",
"debug": "^4.3.4",
@@ -609,9 +609,9 @@
}
},
"node_modules/@jambonz/realtimedb-helpers": {
"version": "0.8.9",
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.8.9.tgz",
"integrity": "sha512-+kVH+dgL6ZIaPDxZM9pwHGGZSYRrAZPvIMqNYd4dLrpduKxpYmdEG3ShfmFgXBZOQJq/Ysz5a75vrYCjtyBkyQ==",
"version": "0.8.13",
"resolved": "https://registry.npmjs.org/@jambonz/realtimedb-helpers/-/realtimedb-helpers-0.8.13.tgz",
"integrity": "sha512-/7c8kCu/dMSk8CWTYdEv4xU/7+vmVL30VCjtHPRAXVBRIVejAPDf1xK5n0rXwG8Fda1Oa+0TFsymkiRpew8P6w==",
"dependencies": {
"debug": "^4.3.4",
"ioredis": "^5.3.2"
@@ -1589,9 +1589,10 @@
"integrity": "sha512-bMtje8GWVTze+UG6WSGnlUfBaYCuFiApNXl/XxWc+X9uATZiZkV2jIqhf+Y4SY3nS8dZclJIVKd9qwoCa+i+Vw=="
},
"node_modules/drachtio-srf": {
"version": "5.0.1",
"resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-5.0.1.tgz",
"integrity": "sha512-HMPn+xLm2TCYY6cJoRpTlhCRakyKgPD93lM1gg6nNIlO9gPSKlUjX3mxL4iaFKuh+UFMMTAoB26fj892A6Lr4Q==",
"version": "5.0.4",
"resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-5.0.4.tgz",
"integrity": "sha512-qAUFy67r8UvP8dUdZermJrl165YMcmNU731vlkC8e5JjGkqMNf1TuDzRQiMo266e1qeGIDKBfNGdHHh1EJGxBA==",
"license": "MIT",
"dependencies": {
"debug": "^3.2.7",
"delegates": "^0.1.0",
+3 -3
View File
@@ -27,8 +27,8 @@
"jslint": "eslint app.js lib --fix"
},
"dependencies": {
"@jambonz/db-helpers": "^0.9.9",
"@jambonz/realtimedb-helpers": "^0.8.9",
"@jambonz/db-helpers": "^0.9.11",
"@jambonz/realtimedb-helpers": "^0.8.13",
"@jambonz/http-health-check": "^0.0.1",
"@jambonz/mw-registrar": "0.2.7",
"@jambonz/rtpengine-utils": "^0.4.4",
@@ -38,7 +38,7 @@
"cidr-matcher": "^2.1.1",
"debug": "^4.3.4",
"drachtio-fn-b2b-sugar": "^0.2.1",
"drachtio-srf": "^5.0.1",
"drachtio-srf": "^5.0.4",
"express": "^4.19.2",
"pino": "^8.20.0",
"sdp-transform": "^2.15.0"