CallPrompt
Represents a current or past prompting session in a call.
Obtain instances of this class by starting a Prompt with one of the following methods:
Example
Prompting for a PIN to be entered using the keypad, then waiting for the user to finish entering the PIN before proceeding with the next instructions.
Properties
Confidence level for the speech recognition result (if type is "speech"), from 0 to 100. For example, 83.2.
The digits that have been collected (if type is "digit"). For example, "12345".
The unique id for this prompt.
Alias for type, in case of errors. Use this field to check the reason of the error.
The terminator used to complete the prompt (if type is "digit"). For example, "#".
The text that has been collected (if type is "speech"). For example, "hello who's there".
The type of this prompt.
The raw result object from the prompt operation.
Whether the prompt has ended. Returns true if the result type is one of: "no_input", "error", "no_match", "digit", or "speech".
Methods
ended
- ended():
Promise<CallPrompt>
Returns a promise that is resolved only after this prompt finishes (or is stopped).
Returns
Promise<CallPrompt>
A promise that is resolves to CallPrompt when the prompt has been ended.
Example
setVolume
- setVolume(
volume):Promise<CallPrompt>
Changes the volume of the audio.
Parameters
Volume value between -40dB and +40dB.
Returns
Promise<CallPrompt>
A promise that is resolves to CallPrompt when the volume is changed.
Example
stop
- stop():
Promise<CallPrompt>
Stops the prompt.
Returns
Promise<CallPrompt>
A promise that is resolves to CallPrompt when the prompt stops.
Example
Events
onStarted
- CallPrompt.listen(
{ onStarted: Callback }})
Emitted when the prompt starts. Your event handler will receive an instance of CallPrompt.
Parameters
The prompt that started. See CallPrompt.
onUpdated
- CallPrompt.listen(
{ onUpdated: Callback }})
Emitted when the prompt is updated. Your event handler will receive an instance of CallPrompt.
Parameters
The prompt that updated. See CallPrompt.
onFailed
- CallPrompt.listen(
{ onFailed: Callback }})
Emitted when the prompt fails. Your event handler will receive an instance of CallPrompt.
Parameters
The prompt that failed. See CallPrompt.
onEnded
- CallPrompt.listen(
{ onEnded: Callback }})
Emitted when the prompt ends. Your event handler will receive an instance of CallPrompt.
Parameters
The prompt that ended. See CallPrompt.