mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 00:58:34 +00:00
fixed gather cannot timeout if listenDuringPrompt is true (#1276)
* fixed gather cannot timeout if listenDuringPrompt is true * wip * wip * wip
This commit is contained in:
@@ -3009,6 +3009,11 @@ Duration=${duration} `
|
|||||||
const task = this.currentTask;
|
const task = this.currentTask;
|
||||||
if (task && TaskName.Say === task.name) {
|
if (task && TaskName.Say === task.name) {
|
||||||
task.notifyTtsStreamIsEmpty();
|
task.notifyTtsStreamIsEmpty();
|
||||||
|
} else if (
|
||||||
|
// If Gather nested say task is streaming
|
||||||
|
TaskName.Gather === task.name && task.sayTask && task.sayTask.isStreamingTts) {
|
||||||
|
const sayTask = task.sayTask;
|
||||||
|
sayTask.notifyTtsStreamIsEmpty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -267,12 +267,17 @@ class TaskGather extends SttTask {
|
|||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
process();
|
process();
|
||||||
});
|
});
|
||||||
|
if (this.sayTask.isStreamingTts && !this.sayTask.closeOnStreamEmpty) {
|
||||||
|
// if streaming tts, we do not wait for it to complete if it is not closing the stream automatically
|
||||||
|
process();
|
||||||
|
} else {
|
||||||
this.sayTask.on('playDone', (err) => {
|
this.sayTask.on('playDone', (err) => {
|
||||||
span.end();
|
span.end();
|
||||||
if (err) this.logger.error({err}, 'Gather:exec Error playing tts');
|
if (err) this.logger.error({err}, 'Gather:exec Error playing tts');
|
||||||
process();
|
process();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if (this.playTask) {
|
else if (this.playTask) {
|
||||||
const {span, ctx} = this.startChildSpan(`nested:${this.playTask.summary}`);
|
const {span, ctx} = this.startChildSpan(`nested:${this.playTask.summary}`);
|
||||||
const process = () => {
|
const process = () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user