Play audio content as a prompt and simultaneously collect user input via DTMF
digits or speech recognition. Returns a
CollectAction that resolves when
input is collected, the operation times out, or an error occurs.
The CollectAction resolves only on collect events, not on play events. This
means await action.wait() blocks until the user provides input (or the
operation terminates), not when the audio finishes playing.
This method emits calling.call.collect events. See Call Events for payload details.
Array of media items to play as the prompt. Same format as
play() media items.
Input collection configuration.
DTMF digit collection settings.
Maximum number of digits to collect.
Seconds to wait between digits before completing.
Characters that terminate digit collection (e.g., "#").
Speech recognition settings.
Seconds of silence to wait before finalizing speech input.
Maximum seconds to listen for speech.
Speech recognition language code (e.g., "en-US").
Words or phrases to boost recognition accuracy.
Volume adjustment in dB for the prompt audio.
Custom control ID. Auto-generated if not provided.
Callback invoked when collection completes.
Promise<CollectAction> — An action handle with
stop(), volume(), startInputTimers(), and wait() methods.