collect
collect
collect(params): Promise<CallCollect>
Collect user input. For methods that include a prompt to the user, please see promptAudio, promptRingtone, or promptTTS.
Parameters
Object containing the parameters for collecting user input.
Configuration for collecting digits. You must either set this, or speech. See CollectDigitsConfig.
Configuration for collecting speech. You must either set this, or digits. See CollectSpeechConfig.
Detect utterances and digits until stopped.
Number of seconds to wait for initial input before giving up. Will be used only when startInputTimers is true or when the timer is started manually via the startInputTimers method.
If true, partial result events are fired.
If true, the startOfInput event is fired when input is detected.
If true, the initialTimeout timer is started.
Returns
Promise<CallCollect>
A promise that resolves to a CallCollect object that you can use to
view the current state and results of the collect session.
Examples
Digits Example
In this example, we collect digits from the user and log the result.
Speech Example
In this example, we collect speech from the user and log the result.
CallCollect Events Example
In this example we are collecting digits and listening for results using the CallCollect Events: