mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
try a different approach
This commit is contained in:
@@ -305,8 +305,8 @@ class Cognigy extends Task {
|
|||||||
this.logger.info({text}, 'received text');
|
this.logger.info({text}, 'received text');
|
||||||
this._enqueueTask(async() => {
|
this._enqueueTask(async() => {
|
||||||
// todo inject the session config into the say task
|
// todo inject the session config into the say task
|
||||||
const sayTask = this._createPromtTask({ text, dontListenAfterSpeech: true });
|
const promtTask = this._createPromtTask({ text, dontListenAfterSpeech: true });
|
||||||
await sayTask.exec(cs, ep, this);
|
await promtTask.exec(cs, ep, this);
|
||||||
this.logger.debug({text}, 'executed say task');
|
this.logger.debug({text}, 'executed say task');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -369,11 +369,10 @@ class Cognigy extends Task {
|
|||||||
//then stop execution of currently queues bot output before sending the
|
//then stop execution of currently queues bot output before sending the
|
||||||
//response to waiting bot since otherwise we could stop upcoming bot output
|
//response to waiting bot since otherwise we could stop upcoming bot output
|
||||||
|
|
||||||
if (this.config.skipUntilBotInput) {
|
if (this.config.bargeInEnabled && this.config.skipUntilBotInput) {
|
||||||
// clear task queue, resolve the last promise and cleanup;
|
// clear task queue, resolve the last promise and cleanup;
|
||||||
this.taskQueue.lastPromise.resolve();
|
this.taskQueue.lastPromise.resolve();
|
||||||
this.taskQueue.end();
|
this.taskQueue.end();
|
||||||
//this._killSayTasks();
|
|
||||||
this.taskQueue.autostart = true;
|
this.taskQueue.autostart = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,6 +107,8 @@ class TaskGather extends Task {
|
|||||||
if (!this.killed) {
|
if (!this.killed) {
|
||||||
if (this.listenAfterSpeech) {
|
if (this.listenAfterSpeech) {
|
||||||
startListening(cs, ep);
|
startListening(cs, ep);
|
||||||
|
} else {
|
||||||
|
this.notifyTaskDone();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user