mirror of
https://github.com/jambonz/sbc-sip-sidecar.git
synced 2026-01-24 22:27:52 +00:00
restore only use port if proxy is IPv4 address
broke in this commit 543f52d3dd
This commit is contained in:
@@ -6,7 +6,7 @@ const {
|
||||
REGISTER_RESPONSE_REMOVE,
|
||||
JAMBONES_REGBOT_USER_AGENT
|
||||
} = require('./config');
|
||||
const {isValidDomainOrIP} = require('./utils');
|
||||
const {isValidDomainOrIP, isValidIPv4} = require('./utils');
|
||||
const DEFAULT_EXPIRES = (parseInt(JAMBONES_REGBOT_DEFAULT_EXPIRES_INTERVAL) || 3600);
|
||||
const MIN_EXPIRES = (parseInt(JAMBONES_REGBOT_MIN_EXPIRES_INTERVAL) || 30);
|
||||
const assert = require('assert');
|
||||
@@ -119,7 +119,8 @@ class Regbot {
|
||||
proxy = `sip:${this.outbound_sip_proxy};transport=${transport}`;
|
||||
this.logger.debug(`sending via proxy ${proxy}`);
|
||||
} else {
|
||||
proxy = `sip:${this.ipv4}:${this.port};transport=${transport}`;
|
||||
const isIPv4 = isValidIPv4(this.ipv4);
|
||||
proxy = `sip:${this.ipv4}${isIPv4 ? `:${this.port}` : ''};transport=${transport}`;
|
||||
this.logger.debug(`sending to registrar ${proxy}`);
|
||||
}
|
||||
const req = await srf.request(`${scheme}:${this.sip_realm}`, {
|
||||
|
||||
Reference in New Issue
Block a user