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:
Dave Horton
2021-10-21 12:00:02 -04:00
committed by GitHub
parent ca4599da22
commit 981788dc58
7 changed files with 295 additions and 343 deletions
+11
View File
@@ -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', () => {