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) {
|
async _onBotFinalPing(cs, ep) {
|
||||||
this.logger.info({prompts: this.prompts}, 'Cognigy:_onBotFinalPing');
|
this.logger.info({prompts: this.prompts}, 'Cognigy:_onBotFinalPing');
|
||||||
await this.taskQueue.lastPromise;
|
try {
|
||||||
this.gatherTask = this._makeGatherTask({textPrompt: 'this should be changed'});
|
await this.taskQueue.lastPromise;
|
||||||
this.gatherTask.exec(cs, ep, this)
|
this.gatherTask = this._makeGatherTask();
|
||||||
.catch((err) => this.logger.info({err}, 'Cognigy gather task returned error'));
|
this.gatherTask.exec(cs, ep, this)
|
||||||
this.prompts = [];
|
.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) {
|
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;
|
||||||
|
|||||||
Reference in New Issue
Block a user