From 050297825bd33139b8cef2eda55a36676534ca7c Mon Sep 17 00:00:00 2001 From: Dave Horton Date: Tue, 3 Jan 2023 10:04:51 -0500 Subject: [PATCH] fix #206: prevent 2 simultaneous background gathers --- lib/session/call-session.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/session/call-session.js b/lib/session/call-session.js index 1ea105be..44d6cc63 100644 --- a/lib/session/call-session.js +++ b/lib/session/call-session.js @@ -449,6 +449,10 @@ class CallSession extends Emitter { async enableBotMode(gather, autoEnable) { try { + if (this.backgroundGatherTask) { + this.logger.info('CallSession:enableBotMode - bot mode currently enabled, stop it'); + this.disableBotMode(); + } const t = normalizeJambones(this.logger, [gather]); this.backgroundGatherTask = makeTask(this.logger, t[0]); this._bargeInEnabled = true;