mirror of
https://github.com/jambonz/sbc-inbound.git
synced 2026-10-04 02:04:22 +00:00
Feature/minimal media anchoring (#11)
* add support for sitting behind a sip proxy that adds X-Forwarded-For header * feature: release media from freeswitch * handle mute/unmute * fix for relaying INFO * support for relaying dtmf via SIP INFO to FS * deps
This commit is contained in:
@@ -73,6 +73,17 @@ module.exports = function(srf, logger) {
|
||||
|
||||
const initLocals = (req, res, next) => {
|
||||
req.locals = req.locals || {};
|
||||
|
||||
/* check if forwarded by a proxy that applied an X-Forwarded-For Header */
|
||||
if (req.has('X-Subspace-Forwarded-For')) {
|
||||
const original_source_address = req.get('X-Subspace-Forwarded-For');
|
||||
logger.info({
|
||||
callId: req.get('Call-ID'),
|
||||
original_source_address,
|
||||
proxy_source_address: req.source_address,
|
||||
}, 'overwriting source address for proxied SIP INVITE');
|
||||
req.source_address = original_source_address;
|
||||
}
|
||||
req.locals.cdr = initCdr(req);
|
||||
const callId = req.get('Call-ID');
|
||||
req.on('cancel', () => {
|
||||
|
||||
Reference in New Issue
Block a user