mirror of
https://github.com/jambonz/sbc-sip-sidecar.git
synced 2026-07-04 19:32:03 +00:00
wip
This commit is contained in:
+12
-11
@@ -210,17 +210,8 @@ const updateCarrierRegbots = async(logger, srf) => {
|
||||
}
|
||||
if (JSON.stringify(gws) !== JSON.stringify(gateways)) hasChanged = true;
|
||||
|
||||
// find account_sip_realm for each gateway if it associated with an account
|
||||
for (const gw of gws) {
|
||||
if (gw.carrier.account_sid) {
|
||||
const account = await lookupAccountBySid(gw.carrier.account_sid);
|
||||
if (account && account.sip_realm) {
|
||||
gw.account_sip_realm = account.sip_realm;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (hasChanged) {
|
||||
|
||||
debug('updateCarrierRegbots: got new or changed carriers');
|
||||
logger.info('updateCarrierRegbots: got new or changed carriers');
|
||||
carriers.length = 0;
|
||||
@@ -235,7 +226,17 @@ const updateCarrierRegbots = async(logger, srf) => {
|
||||
|
||||
// start new regbots
|
||||
let batch_count = 0;
|
||||
for (const gw of getUniqueGateways(gateways, logger)) {
|
||||
const uniqueGateways = getUniqueGateways(gateways, logger);
|
||||
// find account_sip_realm for each gateway if it associated with an account
|
||||
for (const gw of uniqueGateways) {
|
||||
if (gw.carrier.account_sid) {
|
||||
const account = await lookupAccountBySid(gw.carrier.account_sid);
|
||||
if (account && account.sip_realm) {
|
||||
gw.account_sip_realm = account.sip_realm;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (const gw of uniqueGateways) {
|
||||
try {
|
||||
const rb = new Regbot(logger, {
|
||||
voip_carrier_sid: gw.carrier.voip_carrier_sid,
|
||||
|
||||
Reference in New Issue
Block a user