The GetInput element
You can use the GetInput XML element to collect user input through automatic speech recognition or DTMF “digit press” inputs.
When collecting speech as input, Plivo transcribes and relays a user’s speech to the specified action URL in real time.
When collecting input through digit press, Plivo relays the digits entered to the specified action URL.
The GetInput XML element supports simultaneous detection of both speech and digit press inputs.
Nesting elements
You can nest Speak XML (text-to-speech) and Play XML elements inside GetInput XML to prompt users for inputs. This is useful for building interactive voice response (IVR) experiences.
Attributes
action requiredStringCallback-retry configurable | The input is sent to a specific URL. See the “parameters sent to the action URL” table below for more information. Allowed values: a fully qualified URL |
method String | The HTTP method to use when invoking the Allowed values: GET, POST |
inputType String | The type of input(s) you expect to receive. Allowed values: When set to |
executionTimeout integer | Maximum execution time, in seconds, for which input detection is carried out. If the user fails to provide input within the timeout period, the next element in the response will be processed. This duration is counted after nested Play/Speak elements have ended. Allowed values: 5 to 60 |
digitEndTimeout String | Time, in seconds, allowed between consecutive digit inputs. If no new digit input is provided within the
Allowed values: 2 to 10, or This attribute is applicable to input types |
speechEndTimeout String | Time, in seconds, that Plivo waits for more speech once silence is detected before it stops speech recognition. At that point, a transcription of the collected speech is relayed to the action URL. Allowed values: 2 to 10, or This attribute is applicable to input types |
finishOnKey String | A digit that the user can press to submit digits. Allowed values: One and only one of 0–9, *, #, <empty string>,
If set to <empty string> or This attribute is applicable to input types |
The maximum number of digits to be processed in the current operation. Plivo relays the digits to the action URL as soon as the maximum number of digits specified is collected. Allowed values: 1 to 32 This attribute is applicable to input types | |
The automatic speech recognition (ASR) model to use for transcribing the speech. Allowed values: This attribute is applicable to input types
| |
hints String | A list of phrases to act as “hints” to the speech recognition model; these phrases can boost the probability that such words or phrases will be recognized. Phrases may be provided both as small groups of words or as single words. Allowed values: a non-empty string of comma-separated phrases Limits: This attribute is applicable to input types |
language String | Specifies the language Plivo should recognize from the user. Allowed values: See list of supported languages This attribute is applicable to input types |
interimSpeechResultsCallback StringCallback-retry configurable | If See the “parameters sent to the interimSpeechResultsCallback URL” table below for more information. Allowed values: a fully qualified URL This attribute is applicable to input types |
interimSpeechResultsCallbackMethod String | The HTTP method to use when invoking the Allowed values: GET, POST This attribute is applicable to input types |
log boolean | If Allowed values: |
redirect boolean | If Allowed values: |
profanityFilter boolean | If Allowed values: This attribute is applicable to input types |
Parameters sent to the action URL
In addition to the standard action
URL request parameters, these parameters are sent to the action
URL specified.
InputType | The type of input detected. Allowed values: |
Digits | The digits entered by the caller, excluding the finishOnKey input, if used. This parameter will
be empty if inputType is speech . |
Speech | The transcribed result of the caller’s speech. This parameter will be empty if inputType is
dtmf . |
SpeechConfidenceScore | A confidence score between 0.0 and 1.0. The higher the confidence score, the more likely that the transcription is accurate. |
BilledAmount | The total amount billed for speech input transcription. |
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.
StableSpeech | The stable transcribed result of the user’s speech. |
UnstableSpeech | The newer unstable transcribed result of the user’s speech. This is an interim result and may change as more speech is gathered from the caller. |
Stability | An estimate of the likelihood that the recognizer will not change its guess about the interim result. Values range from 0.0 (completely unstable) to 1.0 (completely stable). This field only applies to unstable speech. |
SequenceNumber | Contains a sequence number of the interim speech callback, to help with ordering incoming callback requests. |