feat: Outbound register use sbc public IP address

This commit is contained in:
Quan Luu
2022-09-14 21:03:07 +07:00
parent b6af3f12b1
commit 95f863295b
3 changed files with 34 additions and 1 deletions

1
app.js
View File

@@ -90,6 +90,7 @@ srf.on('connect', (err, hp) => {
const arr = /^(.*)\/(.*):(\d+)$/.exec(hp);
if (arr && 'udp' === arr[1]) {
logger.info(`adding sbc public address to database: ${arr[2]}`);
srf.locals.sbcPublicIpAddress = `${arr[2]}:${arr[3]}`;
addSbcAddress(arr[2]);
}
}