Skip to main content
The gather verb is used to collect DTMF or speech input.
{
  "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",
      "voice": "en-US-Wavenet-F"
    }
  }
}

Configuration

The full set of configuration parameters:
ParameterDescriptionRequired
actionHookA webhook POST to send the collected digits or speech. The payload includes a speech or dtmf property along with the standard attributes.Yes
bargeinEnable speech barge-in, which pauses audio playback if the caller starts speaking.No
dtmfBargeinEnable DTMF barge-in, which pauses audio playback if the caller enters DTMF tones.No
finishOnKeyThe DTMF key that signals the end of input.No
inputAn array specifying the allowed types of input: ['digits'], ['speech'], or ['digits', 'speech']. The default value is ['digits'].No
interDigitTimeoutThe amount of time to wait between digits after minDigits have been entered.No
listenDuringPromptIf 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
minBargeinWordCountIf bargein is true, only halt speech when this many words are spoken. The default value is 1.No
minDigitsThe minimum number of DTMF digits expected to gather. The default value is 1.No
maxDigitsThe maximum number of DTMF digits expected to gather.No
numDigitsThe exact number of DTMF digits expected to gather.No
partialResultHookA webhook POST to send interim transcription results to. Partial transcriptions are only generated if this property is set.No
playA nested play verb that can be used to prompt the user.No
recognizerSpeech recognition options.No

Example

When speech input is used, the actionHook payload will contain a speech object with the response from the speech provider, such as Google Speech.
"speech": {
			"stability": 0,
			"is_final": true,
			"alternatives": [{
				"confidence": 0.858155,
				"transcript": "sales please"
			}]
		}
In the case of digits input, the payload includes a digits property indicating the DTMF keys pressed:
"digits": "0276"

More Information

I