fix #206: prevent 2 simultaneous background gathers

This commit is contained in:
Dave Horton
2023-01-03 10:04:51 -05:00
parent 83d767116b
commit aad2d52efd

View File

@@ -453,6 +453,10 @@ class CallSession extends Emitter {
async enableBotMode(gather, autoEnable) { async enableBotMode(gather, autoEnable) {
try { try {
if (this.backgroundGatherTask) {
this.logger.info('CallSession:enableBotMode - bot mode currently enabled, stop it');
this.disableBotMode();
}
const t = normalizeJambones(this.logger, [gather]); const t = normalizeJambones(this.logger, [gather]);
this.backgroundGatherTask = makeTask(this.logger, t[0]); this.backgroundGatherTask = makeTask(this.logger, t[0]);
this._bargeInEnabled = true; this._bargeInEnabled = true;