Dialogflow
connect a call to a Google Dialogflow bot.
Parameters
The service account key in JSON string form that is used to authenticate to Dialogflow.
Language to use for speech recognition.
The Google Dialogflow project ID.
A webhook invoked when the operation completes.
See below for specified request parameters.
If true, kill playback immediately when the user begins speaking.
A webhook to invoke when a Dialogflow event occurs, such as an intent being detected or a speech transcription being returned.
The response to the event hook may contain a new Jambonz application to execute.
Name of the Dialogflow event to send in query when no input timeout expires.
Number of seconds of no speech detected after which to reprompt.
If true, pass user DTMF entries as text inputs to the Dialogflow bot.
A URL to a .wav or .mp3 file to play as filler music while the Dialogflow back-end is executing.
If provided, audio prompts will be played using text-to-speech rather than the Dialogflow-provided audio clips.
(Google only) MALE, FEMALE, or NEUTRAL.
Language code to use.
Speech vendor to use: Google, AWS (alias: Polly), or default (for application default).
Voice to use. Note that the voice list differs depending on whether you are using AWS or Google. Defaults to application setting, if provided.
An event to send to Dialogflow when first connecting; e.g., to trigger a welcome prompt.
An object containing parameters to send with the welcome event.
actionHook properties
The actionHook webhook will contain the following additional parameters:
dialogflowResult
: the completion reason:redirect
- a new application was returned from an event webhookcompleted
- an intent withend iteraction
set to true was received from dialogflow
eventHook properties
The eventHook webhook will contain two parameters: event
and data
. The event
parameter identifies the specific event and the data
parameter is an object containng event data associated with the event. The following events are supported:
intent
: dialogflow detected an intenttranscription
: a speech transcription was returned from dialogflowdmtf
: a dtmf key was pressed by the callerstart-play
: an audio segment returned from dialogflow started to playstop-play
: an audio segment returned from dialogflow completing playingno-input
: the no input timer elapsed with no input detected from the caller
Please refer to this tutorial for a detailed example.
call transfer in Dialogflow
Call transfer from a dialogflow bot is achieved by responding to an eventHook with event intent
by returning a new jambonz application containing a dial verb. Of course, this should only be done if the intent is signaling a request for a call transfer.
Indicating a desire to transfer the call to a live agent can be done in a couple of different ways in the dialogflow editor:
- By adding a Dialogflow Phone Gateway Response to the intent, with a Transfer Call action.
- By adding a custom payload in a response to the intent, with arbitrary JSON content that you define and which should include the telephone number (or registered user, or sip endpoint) to transfer to.
Note: option 1 only works when transferring to a US number, because the dialogflow editor only accepts US destinations. To transfer to non-US destinations, use option 2.
In either case, your application is responsible for having an eventHook that parses the intent (found in the data
property of the webhook content) in order to check if call transfer is being requested, and if so responding with a new jambonz application.
For instance, when the Dialogflow Phone Gateway Response is used (option 1 above), the code snippet below shows where to find the transfer number in the intent data provided in the eventHook.