GetDigits
The<GetDigits> element collects DTMF (touch-tone) digits entered by the caller. Use it for IVR menus, PIN entry, and numeric input.
Recommendation: Use GetInput instead of GetDigits for new applications. GetInput supports both speech and digit input.
Basic Usage
GetDigits Attributes
| Attribute | Type | Default | Description |
|---|---|---|---|
action | URL | - | URL to receive the digits |
method | string | POST | HTTP method (GET, POST) |
numDigits | integer | 99 | Maximum digits to collect |
timeout | integer | 5 | Seconds to wait for first digit |
digitTimeout | integer | 2 | Seconds between consecutive digits |
finishOnKey | string | # | Key to submit input (digit, #, *, none) |
retries | integer | 1 | Retry attempts if no input |
redirect | boolean | true | Redirect to action URL |
playBeep | boolean | false | Play beep after nested elements |
validDigits | string | 1234567890*# | Allowed digits |
invalidDigitsSound | URL | - | Audio for invalid digit |
log | boolean | true | Log digits (disable for sensitive input) |
Nested Elements
<GetDigits> can contain:
<Speak>- Text-to-speech prompt<Play>- Audio file prompt
Phone Tree (IVR)
PIN Entry
Collect a specific number of digits:log="false" for sensitive input like PINs.
Variable Length Input
UsefinishOnKey for variable-length input:
Restrict Valid Digits
Only accept specific digits:No Redirect
Collect digits without redirecting (fire and forget):GetDigits Action URL Parameters
When digits are collected, these parameters are sent:| Parameter | Description |
|---|---|
Digits | The digits entered (excluding finishOnKey) |
GetDigits Flow Behavior
- Nested
<Speak>or<Play>elements execute - If
playBeep="true", a beep plays - Digit collection starts
- Collection ends when:
numDigitsreachedfinishOnKeypressedtimeoutordigitTimeoutexpires
- Digits sent to
actionURL - Response XML from
actionURL executes
retries attempts, execution continues to the next element.
GetInput
The<GetInput> element collects user input through automatic speech recognition (ASR) or DTMF digit presses. It’s the recommended replacement for <GetDigits>, supporting both speech and digit input.
Basic Usage
GetInput Attributes
Core Settings
| Attribute | Type | Default | Description |
|---|---|---|---|
action | URL | required | URL to receive the input |
method | string | POST | HTTP method (GET, POST) |
inputType | string | - | Input type: dtmf, speech, dtmf speech |
redirect | boolean | true | Redirect to action URL after input |
log | boolean | true | Log input (disable for sensitive data) |
Timing
| Attribute | Type | Default | Description |
|---|---|---|---|
executionTimeout | integer | 15 | Max seconds to wait for input (5-60) |
digitEndTimeout | string | auto | Seconds between digits (2-10, or auto) |
speechEndTimeout | string | auto | Seconds of silence to end speech (2-10, or auto) |
DTMF Settings
| Attribute | Type | Default | Description |
|---|---|---|---|
numDigits | integer | 32 | Maximum digits to collect (1-32) |
finishOnKey | string | # | Key to submit input (digit, #, *, none) |
Speech Settings
| Attribute | Type | Default | Description |
|---|---|---|---|
language | string | en-US | Speech recognition language |
speechModel | string | default | ASR model: default, command_and_search, phone_call |
hints | string | - | Comma-separated phrases to boost recognition |
profanityFilter | boolean | false | Filter profane words |
Callbacks
| Attribute | Type | Default | Description |
|---|---|---|---|
interimSpeechResultsCallback | URL | - | URL for real-time speech results |
interimSpeechResultsCallbackMethod | string | POST | HTTP method for interim callback |
Input Types
DTMF Only
Collect only digit presses:Speech Only
Collect only speech input:Both Speech and DTMF
Accept either input type (first detected wins):Speech Recognition Models
| Model | Best For |
|---|---|
default | General long-form audio |
command_and_search | Short commands and voice search |
phone_call | Phone call audio (varied quality) |
Improve Speech Recognition
Usehints to boost recognition of specific words:
- Max 500 phrases per request
- Max 10,000 characters total
- Max 100 characters per phrase
Real-Time Speech Results
Get interim transcription results as the user speaks:Interim Callback Parameters
| Parameter | Description |
|---|---|
StableSpeech | Confident transcription so far |
UnstableSpeech | Current guess (may change) |
Stability | Confidence score (0.0-1.0) |
SequenceNumber | Order of callbacks |
Supported Languages
Common languages include:| Language | Code |
|---|---|
| English (US) | en-US |
| English (UK) | en-GB |
| English (Australia) | en-AU |
| Spanish (US) | es-US |
| Spanish (Spain) | es-ES |
| French | fr-FR |
| German | de-DE |
| Italian | it-IT |
| Portuguese (Brazil) | pt-BR |
| Japanese | ja-JP |
| Chinese (Mandarin) | zh-CN |
GetInput Action URL Parameters
When input is collected:| Parameter | Description |
|---|---|
InputType | dtmf or speech |
Digits | Digits entered (empty if speech) |
Speech | Transcribed text (empty if DTMF) |
SpeechConfidenceScore | Confidence (0.0-1.0) |
BilledAmount | Transcription cost |
Handling Input on Your Server
GetInput Nested Elements
<GetInput> can contain:
<Speak>- Voice prompt<Play>- Audio prompt
Speech Recognition Pricing
Speech recognition is billed per 15-second increment.Related
- Audio Output - Speak, Play, DTMF
- Call Routing - Dial, Redirect, Hangup, Wait