gather verb is used to collect DTMF or speech input.
Configuration
The full set of configuration parameters:| Parameter | Description | Required |
|---|---|---|
| actionHook | A webhook POST to send the collected digits or speech. The payload includes a speech or dtmf property along with the standard attributes. | Yes |
| bargein | Enable speech barge-in, which pauses audio playback if the caller starts speaking. | No |
| dtmfBargein | Enable DTMF barge-in, which pauses audio playback if the caller enters DTMF tones. | No |
| finishOnKey | The DTMF key that signals the end of input. | No |
| input | An array specifying the allowed types of input: ['digits'], ['speech'], or ['digits', 'speech']. The default value is ['digits']. | No |
| interDigitTimeout | The amount of time to wait between digits after minDigits have been entered. | No |
| listenDuringPrompt | If this parameter is false, the system will not listen for user speech until the say or play verbs has completed. The default value is true. | No |
| minBargeinWordCount | If bargein is true, only halt speech when this many words are spoken. The default value is 1. | No |
| minDigits | The minimum number of DTMF digits expected to gather. The default value is 1. | No |
| maxDigits | The maximum number of DTMF digits expected to gather. | No |
| numDigits | The exact number of DTMF digits expected to gather. | No |
| partialResultHook | A webhook POST to send interim transcription results to. Partial transcriptions are only generated if this property is set. | No |
| play | A nested play verb that can be used to prompt the user. | No |
| recognizer | Speech recognition options. | No |
Example
When speech input is used, theactionHook payload will contain a speech object with the response from the speech provider, such as Google Speech.
digits property indicating the DTMF keys pressed: