Change timer for next REGISTER expires / 2 to avoid delayed registrations (#74)

Co-authored-by: Markus Frindt <m.frindt@cognigy.com>
This commit is contained in:
Markus Frindt
2024-09-17 16:04:43 +02:00
committed by GitHub
parent b190d8a312
commit 8d2bba127b

View File

@@ -177,7 +177,7 @@ class Regbot {
expires = MIN_EXPIRES;
}
debug(`setting timer for next register to ${expires} seconds`);
this.timer = setTimeout(this.register.bind(this, srf), (expires - 5) * 1000);
this.timer = setTimeout(this.register.bind(this, srf), (expires / 2) * 1000);
}
updateVoipCarriersRegisterStatus(this.voip_carrier_sid, JSON.stringify({
status: res.status === 200 ? 'ok' : 'fail',