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) { async _onBotFinalPing(cs, ep) {
this.logger.info({prompts: this.prompts}, 'Cognigy:_onBotFinalPing'); this.logger.info({prompts: this.prompts}, 'Cognigy:_onBotFinalPing');
try {
await this.taskQueue.lastPromise; await this.taskQueue.lastPromise;
this.gatherTask = this._makeGatherTask({textPrompt: 'this should be changed'}); this.gatherTask = this._makeGatherTask();
this.gatherTask.exec(cs, ep, this) this.gatherTask.exec(cs, ep, this)
.catch((err) => this.logger.info({err}, 'Cognigy gather task returned error')); .catch((err) => this.logger.info({err}, 'Cognigy gather task returned error'));
this.prompts = []; this.prompts = [];
} catch (err) {
this.logger.error({err}, 'Could not execute bot final ping!');
}
} }
async _onBotUtterance(cs, ep, evt) { async _onBotUtterance(cs, ep, evt) {
@@ -285,14 +289,14 @@ class Cognigy extends Task {
return; return;
case 'refer': case 'refer':
this._enqueueTask(async() => { this._enqueueTask((async() => {
const referTask = this._makeReferTask(evt.data.number); const referTask = this._makeReferTask(evt.data.number);
await referTask.exect(cs, ep, this); await referTask.exect(cs, ep, this);
this.performAction({cognigyResult: 'refer succeeded'}); this.performAction({cognigyResult: 'refer succeeded'});
this.reportedFinalAction = true; this.reportedFinalAction = true;
this.notifyTaskDone(); this.notifyTaskDone();
this.kill(cs); this.kill(cs);
}); }).bind(this));
return; return;
default: default:
break; break;