Gather
Introduction
The gather command is used to collect dtmf or/and speech input.
The gather command can accept the following attributes:
Options
Option |
Description |
Required |
---|---|---|
actionHook |
Specify a webhook that will be triggered when the user input is detected. |
yes |
bargein |
Allow to stop audio playback if caller begins speaking. |
no |
dtmfBargein |
Allow to stop audio playback if caller enters digit. |
no |
finishOnKey |
A key that indicates the completion of DTMF input. |
no |
input |
Array, you can choose from the following options: [‘digits’], [‘speech’], or [‘digits’, ‘speech’]. |
no |
interDigitTimeout |
The duration of time to pause between digits after the minimum number of digits has been entered during a gather verb. |
no |
listenDuringPrompt |
If true, listen to user speech while say or play is executing. Defaults to true. |
no |
minBargeinWordCount |
If bargein is true, stop speech when a amount of words are match. Defaults to 1. |
no |
minDigits |
Minimum number of digits that gather expects to collect. |
no |
maxDigits |
Maxinum number of digits that gather expects to collect. |
no |
numDigits |
Specify the precise number of digits that gather expects to collect. |
no |
partialResultHook |
Specify a webhook that will be triggered that sends interim transcription results to a designated location. Note: partial transcriptions are solely generated if the property is enabled. |
no |
play |
Nested “play” command that can be utilized to prompt the user. |
no |
recognizer |
Use “recognizer” options |
no |
Example
{
"verb": "gather",
"actionHook": "http://example.com/collect",
"input": ["digits", "speech"],
"bargein": true,
"dtmfBargein": true,
"finishOnKey": "#",
"numDigits": 5,
"timeout": 8,
"recognizer": {
"vendor": "Google",
"language": "en-US",
"hints": ["sales", "support"],
"hintsBoost": 10
},
"say": {
"text": "To speak to Sales press 1 or say Sales. To speak to customer support press 2 or say Support",
"synthesizer": {
"vendor": "Google",
"language": "en-US"
}
}
Note
An HTTP POST method will serve as the action and the partialResultCallback, since the body may require nested JSON objects for speech details. Additionally, it is worth noting that the partialResultCallback web callback must not provide any content, as any returned content will be disregarded.
Please contact us for timely support via:
Phone: 1900-1563
Email: support@epacific.com.vn