mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
fix issue where multiple gathers running simultaneously (#321)
This commit is contained in:
@@ -529,7 +529,7 @@ class CallSession extends Emitter {
|
|||||||
this.logger.info({currInput, newInput},
|
this.logger.info({currInput, newInput},
|
||||||
'CallSession:enableBotMode - restarting background gather to apply new input type');
|
'CallSession:enableBotMode - restarting background gather to apply new input type');
|
||||||
this.backgroundGatherTask.sticky = false;
|
this.backgroundGatherTask.sticky = false;
|
||||||
this.disableBotMode();
|
await this.disableBotMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.backgroundGatherTask = task;
|
this.backgroundGatherTask = task;
|
||||||
@@ -568,12 +568,12 @@ class CallSession extends Emitter {
|
|||||||
this.logger.info({err, gather}, 'CallSession:enableBotMode - Error creating gather task');
|
this.logger.info({err, gather}, 'CallSession:enableBotMode - Error creating gather task');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
disableBotMode() {
|
async disableBotMode() {
|
||||||
this._bargeInEnabled = false;
|
this._bargeInEnabled = false;
|
||||||
if (this.backgroundGatherTask) {
|
if (this.backgroundGatherTask) {
|
||||||
try {
|
try {
|
||||||
this.backgroundGatherTask.removeAllListeners();
|
this.backgroundGatherTask.removeAllListeners();
|
||||||
this.backgroundGatherTask.kill().catch((err) => {});
|
await this.backgroundGatherTask.kill();
|
||||||
} catch (err) {}
|
} catch (err) {}
|
||||||
this.backgroundGatherTask = null;
|
this.backgroundGatherTask = null;
|
||||||
}
|
}
|
||||||
@@ -724,7 +724,7 @@ class CallSession extends Emitter {
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.logger.info('CallSession:exec disabling bot mode to start gather with new options');
|
this.logger.info('CallSession:exec disabling bot mode to start gather with new options');
|
||||||
this.disableBotMode();
|
await this.disableBotMode();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!skip) {
|
if (!skip) {
|
||||||
|
|||||||
Reference in New Issue
Block a user