mirror of
https://github.com/jambonz/sbc-outbound.git
synced 2026-10-28 22:24:17 +00:00
further fix for proxying outbound call to other SBC
This commit is contained in:
1 parent
708441a070
commit
f0cbd6aef5
1 file changed
+2
-4
+2
-4
@@ -1,6 +1,5 @@
|
||||
const debug = require('debug')('jambonz:sbc-outbound');
|
||||
const parseUri = require('drachtio-srf').parseUri;
|
||||
const srf = require('drachtio-srf');
|
||||
const Registrar = require('jambonz-mw-registrar');
|
||||
const {selectHostPort} = require('./utils');
|
||||
|
||||
@@ -61,10 +60,9 @@ function route(opts) {
|
||||
logger.info({details: reg}, `sending call to registered user ${aor}`);
|
||||
if (req.server.hostport !== reg.sbcAddress) {
|
||||
//proxy
|
||||
const proxyAddress = selectHostPort(reg.sbcAddress, 'udp');
|
||||
const proxyAddress = selectHostPort(reg.sbcAddress, 'tcp');
|
||||
logger.info(`proxying call to SBC at ${proxyAddress}`);
|
||||
//req.proxy(`sip:${proxyAddress[1]}`);
|
||||
req.srf.proxyRequest(req, `sip:${proxyAddress[1]}`);
|
||||
req.srf.proxyRequest(req, `sip:${proxyAddress[1]};transport=tcp`);
|
||||
return;
|
||||
}
|
||||
req.locals.registration = reg;
|
||||
|
||||
Reference in new issue
Block a user