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
params
Object containing the parameters for collecting user input.
digits
Configuration for collecting digits. You must either set this, or speech. See CollectDigitsConfig.
speech
Configuration for collecting speech. You must either set this, or digits. See CollectSpeechConfig.
continuous
Detect utterances and digits until stopped.
initialTimeout
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.
partialResults
If true, partial result events are fired.
sendStartOfInput
If true, the startOfInput event is fired when input is detected.
startInputTimers
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: