mirror of
https://github.com/jambonz/sbc-sip-sidecar.git
synced 2026-01-24 22:27:52 +00:00
minor
This commit is contained in:
@@ -39,8 +39,8 @@ class OptionsBot {
|
||||
writeAlerts({
|
||||
account_sid: carrier.account_sid,
|
||||
service_provider_sid: carrier.service_provider_sid,
|
||||
message: `Options ping ${this.ipv4}${this.port ? `:${this.port}` : ''};transport=${this.protocol}
|
||||
unsuccessfully, received: ${res.status}`
|
||||
// eslint-disable-next-line max-len
|
||||
message: `Options ping ${this.ipv4}${this.port ? `:${this.port}` : ''};transport=${this.protocol} unsuccessfully, received: ${res.status}`
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -53,8 +53,8 @@ class OptionsBot {
|
||||
writeAlerts({
|
||||
account_sid: carrier.account_sid,
|
||||
service_provider_sid: carrier.service_provider_sid,
|
||||
message: `Options ping ${this.ipv4}${this.port ? `:${this.port}` : ''};transport=${this.protocol}
|
||||
unsuccessfully, error: ${err}`
|
||||
// eslint-disable-next-line max-len
|
||||
message: `Options ping ${this.ipv4}${this.port ? `:${this.port}` : ''};transport=${this.protocol} unsuccessfully, error: ${err}`
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -68,15 +68,17 @@ module.exports = async(logger, srf) => {
|
||||
const { lookupSipGatewaysByFilters } = srf.locals.dbHelpers;
|
||||
const gws = await lookupSipGatewaysByFilters({send_options_ping: true, outbound: true, is_active: true});
|
||||
|
||||
logger.info(`updateSipGatewayOptsBot: start sending Options to ${gws.length} destinations`);
|
||||
send_options_gateways.length = 0;
|
||||
send_options_gateways.push(...gws);
|
||||
for (const g of send_options_gateways) {
|
||||
const optsBot = new OptionsBot(logger, g);
|
||||
send_options_bots.push(optsBot);
|
||||
optsBot.options(srf);
|
||||
if (gws.length > 0) {
|
||||
logger.debug(`updateSipGatewayOptsBot: sending OPTIONS ping to ${gws.length} gateways`);
|
||||
send_options_gateways.length = 0;
|
||||
send_options_gateways.push(...gws);
|
||||
for (const g of send_options_gateways) {
|
||||
const optsBot = new OptionsBot(logger, g);
|
||||
send_options_bots.push(optsBot);
|
||||
optsBot.options(srf);
|
||||
}
|
||||
logger.debug(`updateSipGatewayOptsBot: we have started ${send_options_bots.length} optionsBots`);
|
||||
}
|
||||
logger.debug(`updateSipGatewayOptsBot: we have started ${send_options_bots.length} optionsBots`);
|
||||
} catch (err) {
|
||||
logger.error({ err }, 'updateSipGatewayOptsBot Error');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user