fix: update register status with sid

This commit is contained in:
Quan HL
2023-04-02 22:36:44 +07:00
parent adddf8b868
commit b817e1b95e

View File

@@ -92,20 +92,20 @@ class Regbot {
debug(`setting timer for next register to ${expires} seconds`);
this.timer = setTimeout(this.register.bind(this, srf), (expires - 5) * 1000);
}
updateVoipCarriersRegisterStatus({
updateVoipCarriersRegisterStatus(this.voip_carrier_sid, {
status: res.status === 200 ? 'ok' : 'fail',
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}`);
this.timer = setTimeout(this.register.bind(this, srf), 60 * 1000);
updateVoipCarriersRegisterStatus({
updateVoipCarriersRegisterStatus(this.voip_carrier_sid, {
status: 'fail',
reason: err
}, this.voip_carrier_sid);
});
}
}