record
Start recording audio from the call. Returns a
RecordAction that you can use to
pause, resume, stop, or wait for the recording to complete.
This method emits calling.call.record events. See Call Events for payload details.
This method corresponds to the SWML record verb. See the
SWML record reference for the full specification.
Parameters
audio
Audio recording configuration object.
audio.direction
Which audio to record.
"listen"— record audio heard by the caller"speak"— record audio spoken by the caller"both"— record audio in both directions
audio.format
Recording file format.
"mp3"— compressed MP3 format"wav"— uncompressed WAV format
audio.stereo
Record in stereo (each side on a separate channel).
audio.initial_timeout
Seconds to wait for audio before ending with no_input.
audio.end_silence_timeout
Seconds of silence before stopping automatically.
audio.terminators
DTMF digits that stop recording (e.g., "#").
audio.beep
Play a beep before recording starts.
audio.input_sensitivity
Sensitivity threshold for detecting audio input.
control_id
Custom control ID for this operation. Auto-generated if not provided.
on_completed
Callback invoked when recording reaches a terminal state (finished or
no_input). The event contains the recording url, duration, and size.
Returns
RecordAction — An action handle with
stop(), pause(), resume(), and wait() methods.