Skip to content

Commit 22d54e9

Browse files
committed
wip
1 parent 0f6869b commit 22d54e9

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

lib/regbot.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,8 @@ class Regbot {
5050
this.register(srf);
5151
}
5252

53-
stop() {
53+
stop(srf) {
5454
const { deleteEphemeralGateway } = srf.locals.realtimeDbHelpers;
55-
this.logger.info(`stopping regbot ${this.fromUser}@${this.sip_realm}`);
5655
clearTimeout(this.timer);
5756
this.timer = null;
5857
// remove any ephemeral gateways created for this regbot
@@ -147,7 +146,7 @@ class Regbot {
147146
if (REGISTER_RESPONSE_REMOVE.includes(res.status)) {
148147
const { updateCarrierBySid, lookupCarrierBySid } = srf.locals.dbHelpers;
149148
await updateCarrierBySid(this.voip_carrier_sid, {requires_register: false});
150-
this.stop(); //Remove the retry timer
149+
this.stop(srf); //Remove the retry timer
151150
const carrier = await lookupCarrierBySid(this.voip_carrier_sid);
152151
if (carrier) {
153152
// eslint-disable-next-line max-len

lib/sip-trunk-register.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,12 +154,12 @@ const checkStatus = async(logger, srf) => {
154154
}
155155
else if (token && token !== myToken) {
156156
logger.info('Someone else grabbed the role! I need to stand down');
157-
regbots.forEach((rb) => rb.stop());
157+
regbots.forEach((rb) => rb.stop(srf));
158158
regbots.length = 0;
159159
}
160160
else {
161161
grabForTheWheel = true;
162-
regbots.forEach((rb) => rb.stop());
162+
regbots.forEach((rb) => rb.stop(srf));
163163
regbots.length = 0;
164164
}
165165
}
@@ -230,7 +230,7 @@ const updateCarrierRegbots = async(logger, srf) => {
230230
Array.prototype.push.apply(gateways, gws);
231231

232232
// stop / kill existing regbots
233-
regbots.forEach((rb) => rb.stop());
233+
regbots.forEach((rb) => rb.stop(srf));
234234
regbots.length = 0;
235235

236236
// start new regbots

0 commit comments

Comments
 (0)