mirror of
https://github.com/jambonz/sbc-outbound.git
synced 2026-01-25 02:07:59 +00:00
Redirect outbound user calls to private IP of other SBC (#197)
* redirect client calls to private address of other SBC * remove unused util * use address not port
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
const debug = require('debug')('jambonz:sbc-outbound');
|
||||
const parseUri = require('drachtio-srf').parseUri;
|
||||
const Registrar = require('@jambonz/mw-registrar');
|
||||
const {selectHostPort, nudgeCallCounts} = require('./utils');
|
||||
const { nudgeCallCounts} = require('./utils');
|
||||
const FS_UUID_SET_NAME = 'fsUUIDs';
|
||||
|
||||
module.exports = (srf, logger, redisClient) => {
|
||||
@@ -234,8 +234,8 @@ module.exports = (srf, logger, redisClient) => {
|
||||
logger.info({details: reg}, `sending call to registered user ${aor}`);
|
||||
if (req.server.hostport !== reg.sbcAddress) {
|
||||
/* redirect to the correct SBC where this user is connected */
|
||||
const proxyAddress = selectHostPort(reg.sbcAddress, 'tcp');
|
||||
const redirectUri = `<sip:${proxyAddress[1]}>`;
|
||||
const proxyAddress = reg.privateSbcAddress.split(':');
|
||||
const redirectUri = `<sip:${proxyAddress[0]}>`;
|
||||
logger.info({
|
||||
myHostPort: req.server.hostport,
|
||||
registeredHostPort: reg.sbcAddress,
|
||||
|
||||
Reference in New Issue
Block a user