mirror of
https://github.com/jambonz/jambonz-feature-server.git
synced 2025-12-20 08:40:38 +00:00
dialogflow: allow app to specify event to send in case on no input
This commit is contained in:
@@ -17,7 +17,8 @@ class Dialogflow extends Task {
|
|||||||
if (this.welcomeEvent.length && this.data.welcomeEventParams && typeof this.data.welcomeEventParams === 'object') {
|
if (this.welcomeEvent.length && this.data.welcomeEventParams && typeof this.data.welcomeEventParams === 'object') {
|
||||||
this.welcomeEventParams = this.data.welcomeEventParams;
|
this.welcomeEventParams = this.data.welcomeEventParams;
|
||||||
}
|
}
|
||||||
this.noInputTimeout = this.data.noInputTimeout ;
|
this.noInputTimeout = this.data.noInputTimeout || 20000;
|
||||||
|
this.noInputEvent = this.data.noInputTimeout || 'actions_intent_NO_INPUT';
|
||||||
this.passDtmfAsInputText = this.passDtmfAsInputText === true;
|
this.passDtmfAsInputText = this.passDtmfAsInputText === true;
|
||||||
if (this.data.eventHook) this.eventHook = this.data.eventHook;
|
if (this.data.eventHook) this.eventHook = this.data.eventHook;
|
||||||
if (this.eventHook && Array.isArray(this.data.events)) {
|
if (this.eventHook && Array.isArray(this.data.events)) {
|
||||||
@@ -124,7 +125,7 @@ class Dialogflow extends Task {
|
|||||||
if (this.noinput && this.greetingPlayed) {
|
if (this.noinput && this.greetingPlayed) {
|
||||||
this.logger.info('no input timer fired, reprompting..');
|
this.logger.info('no input timer fired, reprompting..');
|
||||||
this.noinput = false;
|
this.noinput = false;
|
||||||
ep.api('dialogflow_start', `${ep.uuid} ${this.project} ${this.lang} actions_intent_NO_INPUT`);
|
ep.api('dialogflow_start', `${ep.uuid} ${this.project} ${this.lang} ${this.noInputEvent}`);
|
||||||
}
|
}
|
||||||
else if (this.dtmfEntry && this.greetingPlayed) {
|
else if (this.dtmfEntry && this.greetingPlayed) {
|
||||||
this.logger.info('dtmf detected, reprompting..');
|
this.logger.info('dtmf detected, reprompting..');
|
||||||
|
|||||||
@@ -129,6 +129,7 @@
|
|||||||
"welcomeEvent": "string",
|
"welcomeEvent": "string",
|
||||||
"welcomeEventParams": "object",
|
"welcomeEventParams": "object",
|
||||||
"noInputTimeout": "number",
|
"noInputTimeout": "number",
|
||||||
|
"noInputEvent": "string",
|
||||||
"passDtmfAsTextInput": "boolean",
|
"passDtmfAsTextInput": "boolean",
|
||||||
"thinkingMusic": "string"
|
"thinkingMusic": "string"
|
||||||
},
|
},
|
||||||
|
|||||||
2
package-lock.json
generated
2
package-lock.json
generated
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jambonz-feature-server",
|
"name": "jambonz-feature-server",
|
||||||
"version": "0.2.1",
|
"version": "0.2.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "jambonz-feature-server",
|
"name": "jambonz-feature-server",
|
||||||
"version": "0.2.1",
|
"version": "0.2.2",
|
||||||
"main": "app.js",
|
"main": "app.js",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 10.16.0"
|
"node": ">= 10.16.0"
|
||||||
|
|||||||
Reference in New Issue
Block a user