Bugfix/gather kill race condition (#207)

* further fix for race condition in #206

* #206: ignore request to start bot mode when bot mode is already active
This commit is contained in:
Dave Horton
2023-01-04 09:24:39 -05:00
parent aad2d52efd
commit b16d49d8ea
2 changed files with 13 additions and 3 deletions

View File

@@ -454,8 +454,8 @@ 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();
this.logger.info('CallSession:enableBotMode - bot mode currently enabled, ignoring request to start again');
return;
}
const t = normalizeJambones(this.logger, [gather]);
this.backgroundGatherTask = makeTask(this.logger, t[0]);