Gather
Collect dtmf or speech input
When collecting speech input, the default recognizer for the application will be used unless you overridde it by specifying a recognizer property.
Parameters
Webhook or websocket URL to send the collected digits or speech to; may be either an absolute or relative URL (see note below).
In the case of webhooks, this will be sent in a POST request.
See below for payload details.
An object describing behaviors to apply if the webhook or websocket application delays in responding to the actionHook
.
Boolean indicating whether to allow barge-in when collecting speech (i.e., kill audio playback if the caller begins speaking).
Boolean indicating whether to allow barge-in using DTMF keys.
An object describing audio to play to the caller if the webhook or websocket application delays in responding to the actionHook
.
(Deprecated in favor of actionHookDelay
).
Whether to enable or disable filler noise.
Integer value specifying the number of seconds to wait for a response from the remote application.
HTTP(S) URL to audio to play as filler noise.
A DTMF key that, if received, indicates the end of DTMF input.
Array specifying allowed types of input: ['digits']
, ['speech']
, or ['digits', 'speech']
.
Amount of time in seconds to wait between digits after minDigits
have been entered.
If false
, do not listen for user speech until the nested say
or play
command has completed.
Maximum number of DTMF digits expected to gather.
If bargein
is true
, only kill speech when this many words are spoken OR a final transcription is returned.
Minimum number of DTMF digits expected to gather.
Exact number of DTMF digits expected to gather.
Webhook to send interim transcription results to.
Partial transcriptions are only generated if this property is set.
Nested play
verb that can be used to prompt the user with an audio file.
Speech recognition options to override default settings if desired.
See recognizer
.
Nested say
command that can be used to prompt the user with text-to-speech.
The actionHook
property may be either an absolute URL or a relative URL.
If it is a relative URL, it will be resolved relative to the base URL of the jambonz application.
Generally speaking, you will typically use a relative URL for the actionHook
property, and when using websockets you
are strongly encouragedto use a relative URL.
actionHook properties
The payload sent to the actionHook
URL will always include a reason
property with one of the following values:
speechDetected
- user speech was collecteddtmfDetected
- user dtmf entries were collectedstt-low-confidence
- user speech was collected but the confidence level was below the thresholdtimeout
- neither speech nor dtmf was collected before the timeout expirederror
- an error occurred during the gather operation, possibly with the speech recognizer
Depending on the reason, additional properties may be included in the payload.
speechDetected
A speech
object will be included in the payload. The speech
object will include the following properties:
language_code
- the detected language that was spokenis_final
- a boolean indicating whether this was a final or interim transcriptionchannel_tag
- a value of 1 if the transcription is from the caller, or 2 if from the calleealternatives
- an array of alternative transcriptions, each with atranscript
andconfidence
valuevendor
- the raw payload returned from the speech vendor
Example:
dtmfDetected
A digits
property will be included in the payload containing the digits that were collected.
stt-low-confidence
A speech
object will be included, see speechDetected
for an example. The reason stt-low-confidence
indicates to the application that this transcript should be treated with caution as it is likely to
be an inaccurate reporting of what the user actually said.
timeout
No additional properties will be included in the payload.
error
A details
property will be included in the payload with a description of the error.