recordCall

View as MarkdownOpen in Claude

Start recording the call in the background. The conversation continues while recording is active.

For continuous call recording, omit initial_timeout and end_silence_timeout. Those parameters are for voicemail-style recordings that automatically stop on silence. Use stopRecordCall() to end continuous recordings.

Parameters

opts
object

Optional recording configuration.

opts.controlId
string

Identifier for this recording. Pass the same ID to stopRecordCall() to stop this specific recording.

opts.stereo
booleanDefaults to false

Record in stereo (true) or mono (false).

opts.format
stringDefaults to wav

Recording file format.

  • "wav" — uncompressed WAV audio
  • "mp3" — compressed MP3 audio
opts.direction
stringDefaults to both

Audio direction to record.

  • "speak" — what the agent says
  • "listen" — what the caller says
  • "both" — both sides of the conversation
opts.terminators
string

DTMF digits that stop recording when pressed (e.g., "#").

opts.beep
booleanDefaults to false

Play a beep tone before recording starts.

opts.inputSensitivity
numberDefaults to 44.0

Input sensitivity level for the recording.

opts.initialTimeout
number

Seconds to wait for speech to begin before auto-stopping. Used for voicemail-style recordings.

opts.endSilenceTimeout
number

Seconds of silence after speech to wait before auto-stopping. Used for voicemail-style recordings.

opts.maxLength
number

Maximum recording duration in seconds.

opts.statusUrl
string

URL to receive recording status webhook events.

Returns

FunctionResultthis, for chaining.

Examples

Continuous Recording

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult('Recording started.')
4 .recordCall({ format: 'mp3', direction: 'both' });

Voicemail Recording

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult('Please leave your message after the beep.')
4 .recordCall({
5 controlId: 'voicemail',
6 beep: true,
7 maxLength: 120,
8 endSilenceTimeout: 3,
9 });