Nesting elements
You can nest Speak XML (text-to-speech) and Play XML elements inside Gather XML to prompt users for inputs. This is useful for building interactive voice response (IVR) experiences.Attributes
Parameters sent to the action URL
In addition to the standard action URL request parameters, these parameters are sent to the action URL specified.Parameters sent to the interimSpeechResultsCallback URL
In addition to the standard callback URL request parameters, these parameters are sent to the interim speech results callback URL.Examples
Collect a single DTMF digit (IVR menu)
Nest aSpeak or Play element to prompt the caller. With numDigits="1", Vobiz posts to the action URL as soon as one digit is pressed.
Collect a multi-digit number with finishOnKey
For variable-length input such as an account number, setfinishOnKey="#" and let the caller signal completion.
Collect speech input
Accept either speech or digits
WithinputType="dtmf speech", whichever input Vobiz detects first is the one relayed to the action URL.
Webhook payload sent to the action URL
After the caller responds (or input ends), Vobiz POSTs the standard call parameters plus the Gather-specific parameters to your action URL.DTMF input
Speech input
Edge cases and tips
- No input / timeout. If the caller provides no input within
executionTimeoutseconds (counted after nestedPlay/Speakfinishes), Vobiz moves on to the next element in the document. Always place fallback XML (a retry, aRedirectback to the menu, or aHangup) after theGather. By default, Vobiz still POSTs to the action URL with emptyDigitsandSpeechon timeout - check for empty values in your handler. - Use
executionTimeout, nevertimeout.Gatherhas notimeoutattribute. UseDial timeoutto limit how long Vobiz waits for a B-leg to answer. The valid range forexecutionTimeoutis 5-60 seconds (default 15). finishOnKeyis excluded fromDigits. The terminating key (default#) is not included in theDigitsparameter. SetfinishOnKey=""orfinishOnKey="none"to rely solely onnumDigitsor the timeout.numDigitsends collection early. Vobiz posts as soon as it collectsnumDigitsdigits, before the timeout orfinishOnKey. For single-key menus, setnumDigits="1"for the snappiest response.- DTMF vs speech. Use
dtmffor menus and structured input (account numbers, PINs) - it is precise and free. Usespeechfor open-ended intent capture; it incurs a per-request charge (see Pricing for speech recognition) and returns aSpeechConfidenceScoreyou should threshold before acting. Combine withdtmf speechwhen you want to accept both. - Improve recognition. Pass domain words via
hints, set the correctlanguage(see supported languages), and pick aspeechModelsuited to the input (command_and_searchfor short commands,phone_call/telephonyfor call audio). - Validate input server-side. Never trust
DigitsorSpeechdirectly in queries or business logic - sanitize and range-check them in your handler.