mirror of
https://github.com/jambonz/sbc-sip-sidecar.git
synced 2025-12-19 04:27:46 +00:00
fix: update register status with sid
This commit is contained in:
@@ -19,6 +19,7 @@ class Regbot {
|
||||
['ipv4', 'port', 'username', 'password', 'sip_realm'].forEach((prop) => this[prop] = opts[prop]);
|
||||
|
||||
logger.debug({ opts }, 'Regbot');
|
||||
this.voip_carrier_sid = opts.voip_carrier_sid;
|
||||
this.username = opts.username;
|
||||
this.password = opts.password;
|
||||
this.sip_realm = opts.sip_realm || opts.ipv4;
|
||||
@@ -96,7 +97,7 @@ class Regbot {
|
||||
reason: `${res.status} ${res.reason}`,
|
||||
cseq: req.get('Cseq'),
|
||||
callId: req.get('Call-Id')
|
||||
});
|
||||
}, this.voip_carrier_sid);
|
||||
});
|
||||
} catch (err) {
|
||||
this.logger.error({ err }, `Regbot Error registering to ${this.ipv4}:${this.port}`);
|
||||
@@ -104,7 +105,7 @@ class Regbot {
|
||||
updateVoipCarriersRegisterStatus({
|
||||
status: 'fail',
|
||||
reason: err
|
||||
});
|
||||
}, this.voip_carrier_sid);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -250,6 +251,7 @@ const updateCarrierRegbots = async(logger, srf) => {
|
||||
// start new regbots
|
||||
for (const gw of gateways) {
|
||||
const rb = new Regbot(logger, {
|
||||
voip_carrier_sid: gw.carrier.voip_carrier_sid,
|
||||
ipv4: gw.ipv4,
|
||||
port: gw.port,
|
||||
username: gw.carrier.register_username,
|
||||
|
||||
Reference in New Issue
Block a user