mirror of
https://github.com/jambonz/sbc-sip-sidecar.git
synced 2026-07-04 19:32:03 +00:00
add ephemeral gateways for ip regtrunk (#124)
* add ephemeral gateways for ip regtrunk * linting
This commit is contained in:
+11
-7
@@ -204,17 +204,21 @@ 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' && !isValidIPv4(this.ipv4)) {
|
if (this.trunk_type === 'reg') {
|
||||||
this.addresses = [];
|
this.addresses = [];
|
||||||
if (this.port) {
|
if (isValidIPv4(this.ipv4)) {
|
||||||
const addrs = await dnsResolverA(this.logger, this.ipv4);
|
this.addresses.push(this.ipv4);
|
||||||
this.addresses.push(...addrs);
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const addrs = await dnsResolverSrv(this.logger, this.ipv4, this.transport);
|
if (this.port) {
|
||||||
this.addresses.push(...addrs);
|
const addrs = await dnsResolverA(this.logger, this.ipv4);
|
||||||
|
this.addresses.push(...addrs);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const addrs = await dnsResolverSrv(this.logger, this.ipv4, this.transport);
|
||||||
|
this.addresses.push(...addrs);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.addresses.length) {
|
if (this.addresses.length) {
|
||||||
try {
|
try {
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
|
|||||||
Reference in New Issue
Block a user