mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-21 17:17:58 +00:00
create gather without prompt
This commit is contained in:
@@ -233,11 +233,15 @@ class Cognigy extends Task {
|
||||
|
||||
async _onBotFinalPing(cs, ep) {
|
||||
this.logger.info({prompts: this.prompts}, 'Cognigy:_onBotFinalPing');
|
||||
try {
|
||||
await this.taskQueue.lastPromise;
|
||||
this.gatherTask = this._makeGatherTask({textPrompt: 'this should be changed'});
|
||||
this.gatherTask = this._makeGatherTask();
|
||||
this.gatherTask.exec(cs, ep, this)
|
||||
.catch((err) => this.logger.info({err}, 'Cognigy gather task returned error'));
|
||||
this.prompts = [];
|
||||
} catch (err) {
|
||||
this.logger.error({err}, 'Could not execute bot final ping!');
|
||||
}
|
||||
}
|
||||
|
||||
async _onBotUtterance(cs, ep, evt) {
|
||||
@@ -285,14 +289,14 @@ class Cognigy extends Task {
|
||||
|
||||
return;
|
||||
case 'refer':
|
||||
this._enqueueTask(async() => {
|
||||
this._enqueueTask((async() => {
|
||||
const referTask = this._makeReferTask(evt.data.number);
|
||||
await referTask.exect(cs, ep, this);
|
||||
this.performAction({cognigyResult: 'refer succeeded'});
|
||||
this.reportedFinalAction = true;
|
||||
this.notifyTaskDone();
|
||||
this.kill(cs);
|
||||
});
|
||||
}).bind(this));
|
||||
return;
|
||||
default:
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user