diff --git a/lib/regbot.js b/lib/regbot.js index 08b76b3..4d5b7c1 100644 --- a/lib/regbot.js +++ b/lib/regbot.js @@ -204,14 +204,14 @@ class Regbot { })); // 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 = []; if (this.port) { - const addrs = await dnsResolverA(this.logger, this.sip_realm); + const addrs = await dnsResolverA(this.logger, this.ipv4); this.addresses.push(...addrs); } 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); }