mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2025-12-19 04:37:43 +00:00
include source port in X-Forwarded-For
This commit is contained in:
@@ -17,7 +17,7 @@
|
||||
"database": "jambones"
|
||||
},
|
||||
"trunks": {
|
||||
"appserver": ["sip:172.38.0.11"]
|
||||
"appserver": ["172.38.0.11"]
|
||||
},
|
||||
"transcoding": {
|
||||
"rtpCharacteristics" : {
|
||||
|
||||
@@ -49,7 +49,7 @@ class CallSession extends Emitter {
|
||||
}
|
||||
|
||||
// now send the INVITE in towards the feature servers
|
||||
const headers = {'X-Forwarded-For': this.req.source_address};
|
||||
const headers = {'X-Forwarded-For': `${this.req.source_address}:${this.req.source_port}`};
|
||||
if (this.req.locals.carrier) Object.assign(headers, {'X-Originating-Carrier': this.req.locals.carrier});
|
||||
|
||||
debug(`sending INVITE to ${proxy} with ${uri}`);
|
||||
|
||||
@@ -9,6 +9,7 @@ module.exports = function(srf, logger) {
|
||||
try {
|
||||
const gateway = await lookupSipGatewayBySignalingAddress(req.source_address, req.source_port);
|
||||
if (!gateway) {
|
||||
// TODO: if uri.host is not a domain, just reject
|
||||
req.locals.originator = 'device';
|
||||
return authenticator(req, res, next);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "sbc-inbound",
|
||||
"version": "0.1.0",
|
||||
"version": "0.1.1",
|
||||
"main": "app.js",
|
||||
"engines": {
|
||||
"node": ">= 10.16.0"
|
||||
|
||||
Reference in New Issue
Block a user