prompt
prompt
- prompt(
params):Promise<CallPrompt>
Generic method to prompt the user for input.
Take a look at promptAudio, promptRingtone, or promptTTS for the more specific input methods.
Parameters
Object containing the parameters for prompting the user for input.
A media playlist to play. See VoicePlaylist.
Configuration for collecting digits. You must either set this, or speech. See CollectDigitsConfig.
Configuration for collecting speech. You must either set this, or digits. Pass an empty object to use the default configuration. See CollectSpeechConfig.
Initial timeout in seconds.
Returns
Promise<CallPrompt>
A promise that resolves to a CallPrompt object that you can use to
view the current state and results of the prompt session.
Examples
Digits Example
In this example, we dial a phone number and prompt for digits. After the digits are entered or a timeout occurs, the prompt session will end and return the digits results, and the call will hangup. We also listen for prompt events.
Speech Example
In this example, we dial a phone number and prompt for speech. After the speech is entered or a timeout occurs, the call will hangup. We also listen for prompt events.