fix #206: prevent 2 simultaneous background gathers

This commit is contained in:
Dave Horton
2023-01-03 10:04:51 -05:00
parent 1fcfe08f9b
commit 050297825b

View File

@@ -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;