mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 16:50:39 +00:00
bugfix #192: config with dtmf only followed later by gather with speech not working
This commit is contained in:
@@ -607,13 +607,19 @@ class CallSession extends Emitter {
|
|||||||
this.logger.info(`CallSession:exec starting task #${stackNum}:${taskNum}: ${task.name}`);
|
this.logger.info(`CallSession:exec starting task #${stackNum}:${taskNum}: ${task.name}`);
|
||||||
try {
|
try {
|
||||||
const resources = await this._evaluatePreconditions(task);
|
const resources = await this._evaluatePreconditions(task);
|
||||||
|
let skip = false;
|
||||||
this.currentTask = task;
|
this.currentTask = task;
|
||||||
if (TaskName.Gather === task.name && this.isBotModeEnabled) {
|
if (TaskName.Gather === task.name && this.isBotModeEnabled) {
|
||||||
const timeout = task.timeout;
|
if (this.backgroundGatherTask.updateTaskInProgress(task)) {
|
||||||
this.logger.info(`CallSession:exec skipping #${stackNum}:${taskNum}: ${task.name}`);
|
this.logger.info(`CallSession:exec skipping #${stackNum}:${taskNum}: ${task.name}`);
|
||||||
this.backgroundGatherTask.updateTimeout(timeout);
|
skip = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.logger.info('CallSession:exec disabling bot mode to start gather with new options');
|
||||||
|
this.disableBotMode();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
if (!skip) {
|
||||||
const {span, ctx} = this.rootSpan.startChildSpan(`verb:${task.summary}`);
|
const {span, ctx} = this.rootSpan.startChildSpan(`verb:${task.summary}`);
|
||||||
task.span = span;
|
task.span = span;
|
||||||
task.ctx = ctx;
|
task.ctx = ctx;
|
||||||
|
|||||||
@@ -262,8 +262,12 @@ class TaskGather extends Task {
|
|||||||
this._resolve('killed');
|
this._resolve('killed');
|
||||||
}
|
}
|
||||||
|
|
||||||
updateTimeout(timeout) {
|
updateTaskInProgress(opts) {
|
||||||
this.logger.info(`TaskGather:updateTimeout - updating timeout to ${timeout}`);
|
if (!this.needsStt && opts.input.includes('speech')) {
|
||||||
|
this.logger.info('TaskGather:updateTaskInProgress - adding speech to a background gather');
|
||||||
|
return false; // this needs be handled by killing the background gather and starting a new one
|
||||||
|
}
|
||||||
|
const {timeout} = opts;
|
||||||
this.timeout = timeout;
|
this.timeout = timeout;
|
||||||
this._startTimer();
|
this._startTimer();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user