From aad2d52efdecf66f7dbae1e4fb3d4e67d34e52ab 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 476dcdbd..095213bb 100644 --- a/lib/session/call-session.js +++ b/lib/session/call-session.js @@ -453,6 +453,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;