mirror of
https://github.com/jambonz/sbc-sip-sidecar.git
synced 2025-12-19 04:27:46 +00:00
use sip gateway host for DNS lookup of ephemeral gw and only if not an IP address
This commit is contained in:
@@ -204,14 +204,14 @@ class Regbot {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
// for reg trunks, create ephemeral set of IP addresses for inbound gateways
|
// for reg trunks, create ephemeral set of IP addresses for inbound gateways
|
||||||
if (this.trunk_type === 'reg') {
|
if (this.trunk_type === 'reg' && !isValidIPv4(this.ipv4)) {
|
||||||
this.addresses = [];
|
this.addresses = [];
|
||||||
if (this.port) {
|
if (this.port) {
|
||||||
const addrs = await dnsResolverA(this.logger, this.sip_realm);
|
const addrs = await dnsResolverA(this.logger, this.ipv4);
|
||||||
this.addresses.push(...addrs);
|
this.addresses.push(...addrs);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const addrs = await dnsResolverSrv(this.logger, this.sip_realm, this.transport);
|
const addrs = await dnsResolverSrv(this.logger, this.ipv4, this.transport);
|
||||||
this.addresses.push(...addrs);
|
this.addresses.push(...addrs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user