create gather without prompt

This commit is contained in:
akirilyuk
2022-02-01 15:18:50 +01:00
parent 3c75d5a489
commit 4e76077dc9

View File

@@ -233,11 +233,15 @@ class Cognigy extends Task {
async _onBotFinalPing(cs, ep) {
this.logger.info({prompts: this.prompts}, 'Cognigy:_onBotFinalPing');
await this.taskQueue.lastPromise;
this.gatherTask = this._makeGatherTask({textPrompt: 'this should be changed'});
this.gatherTask.exec(cs, ep, this)
.catch((err) => this.logger.info({err}, 'Cognigy gather task returned error'));
this.prompts = [];
try {
await this.taskQueue.lastPromise;
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;