Compare commits

...
8 Commits
4 changed files with 36 additions and 22 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';
}
+15 -15
View File
@@ -1,18 +1,18 @@
{
"name": "sbc-outbound",
"version": "0.9.3",
"version": "0.9.4",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sbc-outbound",
"version": "0.9.3",
"version": "0.9.4",
"license": "MIT",
"dependencies": {
"@jambonz/db-helpers": "^0.9.9",
"@jambonz/db-helpers": "^0.9.12",
"@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.2",
"drachtio-srf": "^5.0.5",
"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.12",
"resolved": "https://registry.npmjs.org/@jambonz/db-helpers/-/db-helpers-0.9.12.tgz",
"integrity": "sha512-cmUuh6G2yqsPZxx0v0iKq0puCaWPz6RGaHvMxBZlolEfLHxTcHshgm+Y/L7J3/4bEKaovzP4z7TXh/pab7mZig==",
"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,9 @@
"integrity": "sha512-bMtje8GWVTze+UG6WSGnlUfBaYCuFiApNXl/XxWc+X9uATZiZkV2jIqhf+Y4SY3nS8dZclJIVKd9qwoCa+i+Vw=="
},
"node_modules/drachtio-srf": {
"version": "5.0.2",
"resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-5.0.2.tgz",
"integrity": "sha512-tM4TVNoC3IpdmpNn2gnuIp5AzNF6Ik6rvRTFjmQ25/W4gb4eVzK8cCYntc00rtbENI4HHmrX4Ep+/T+ZVnoTDw==",
"version": "5.0.5",
"resolved": "https://registry.npmjs.org/drachtio-srf/-/drachtio-srf-5.0.5.tgz",
"integrity": "sha512-dKdOf+zonTvk1eVu0IVc4a/Hdah2KspXngAeLQ3NZHdAkjQCJjYQZubVP6ho2QT1pzu8wA3U4M/atL1O99Ujzw==",
"dependencies": {
"debug": "^3.2.7",
"delegates": "^0.1.0",
@@ -1605,7 +1605,7 @@
"uuid-random": "^1.3.2"
},
"engines": {
"node": ">= 10.x"
"node": ">= 18.x"
}
},
"node_modules/drachtio-srf/node_modules/debug": {
+4 -4
View File
@@ -1,6 +1,6 @@
{
"name": "sbc-outbound",
"version": "0.9.3",
"version": "0.9.4",
"main": "app.js",
"engines": {
"node": ">= 18.0.0"
@@ -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.12",
"@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.2",
"drachtio-srf": "^5.0.5",
"express": "^4.19.2",
"pino": "^8.20.0",
"sdp-transform": "^2.15.0"