mirror of
https://github.com/jambonz/sbc-sip-sidecar.git
synced 2025-12-19 04:27:46 +00:00
If no SRV record found when no port specifiec, look for A record. (#125)
* If no SRV record found when no port specifiec, look for A record. * update log statement to info level
This commit is contained in:
@@ -216,7 +216,18 @@ class Regbot {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const addrs = await dnsResolverSrv(this.logger, this.ipv4, this.transport);
|
const addrs = await dnsResolverSrv(this.logger, this.ipv4, this.transport);
|
||||||
|
if (addrs.length) {
|
||||||
this.addresses.push(...addrs);
|
this.addresses.push(...addrs);
|
||||||
|
} else {
|
||||||
|
this.logger.info({ipv4: this.ipv4, transport: this.transport},
|
||||||
|
'No SRV addresses found for reg-gateway');
|
||||||
|
const addrsARecord = await dnsResolverA(this.logger, this.ipv4);
|
||||||
|
if (addrsARecord.length) {
|
||||||
|
this.addresses.push(...addrsARecord);
|
||||||
|
} else {
|
||||||
|
this.logger.info({ipv4: this.ipv4}, 'No A record found for reg-gateway');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.addresses.length) {
|
if (this.addresses.length) {
|
||||||
|
|||||||
Reference in New Issue
Block a user