detectDigit
detectDigit
- detectDigit(
params?):Promise<CallDetect>
Detects when a digit is pressed in an audio stream. To gather digit input from a caller, please see prompt.
Parameters
params
Object containing the parameters for digit detection.
digits
The digits to detect.
timeout
Number of seconds to run the detector for.
waitForBeep
Whether to wait until the device is ready for voicemail delivery.
Returns
Promise<CallDetect>
A promise that resolves to a CallDetect object that you can use to
view the current state and results of the detect session.
Example
In this example, we dial a phone number and wait for the digit detection to finish. Once the detection is finished, we log the result and then play a TTS message of the digit pressed and then hangup the call.