collect
Collect DTMF digit or speech input without playing a prompt. Use this when you
want to listen for input silently or after a prompt has already been played
separately. For collecting input with a prompt, use
play_and_collect().
This method emits calling.call.collect events. See Call Events for payload details.
Parameters
digits
DTMF digit collection settings.
digits.max
Maximum number of digits to collect.
digits.digit_timeout
Seconds to wait between digits before completing.
digits.terminators
Characters that terminate digit collection (e.g., "#").
speech
Speech recognition settings.
speech.end_silence_timeout
Seconds of silence to wait before finalizing speech input.
speech.speech_timeout
Maximum seconds to listen for speech.
speech.language
Speech recognition language code (e.g., "en-US").
speech.hints
Words or phrases to boost recognition accuracy.
initial_timeout
Seconds to wait for the first input before ending with no_input.
partial_results
Enable partial speech recognition results.
continuous
Keep collecting after each result instead of stopping.
send_start_of_input
Send an event when input is first detected.
start_input_timers
Start input timers immediately. If False, call
action.start_input_timers() to start them manually.
control_id
Custom control ID. Auto-generated if not provided.
on_completed
Callback invoked when collection completes.
Returns
StandaloneCollectAction — An action
handle with stop(), start_input_timers(), and wait() methods.