record on <Dial> to capture the conversation. Use record-from-answer-dual for a dual-channel stereo recording — channel 1 holds the A-leg, channel 2 the B-leg. This lets the transcription pipeline label speakers deterministically.1234567import { VoiceResponse } from "@ruut/voice-sdk"; const xml = new VoiceResponse() .dial({ record: "record-from-answer-dual" }, (dial) => { dial.number("+2348000000009"); }) .toXml();
<Record> verb to capture a caller's message and optionally transcribe it:12345678<Response> <Say>Please leave a message after the tone.</Say> <Record transcribe="true" transcribeCallback="/twiml/transcription" maxLength="120" playBeep="true" /> </Response>
transcribe="true" — transcribe the recording after it completes.transcribeCallback — receive a webhook with the transcript.maxLength, timeout, finishOnKey — control how long to record.agent / customer (the A-leg and B-leg). Mono recordings fall back to ML diarization (SPEAKER_00/01).STT_DEFAULT_PROVIDER=whisperx / WHISPERX_DEFAULT_PROVIDER=whisperx on the platform). Transcription is then diarized automatically.123456const rec = await client.recordings.get("RE123"); console.log(rec.transcription_status); // "completed" console.log(rec.transcription_provider); // "whisperx" console.log(rec.transcription_segments); // [{ speaker: "agent", text: "…", start_time: 0.0, end_time: 3.2, words: [...] }, // { speaker: "customer", text: "…", start_time: 3.2, end_time: 6.1, words: [...] }]
12const wavUrl = client.recordings.mediaUrl("RE123", { format: "wav" }); const mp3Url = client.recordings.mediaUrl("RE123", { format: "mp3" });
1GET /2010-04-01/Accounts/{AccountSid}/Recordings/{RecordingSid}.mp3
recordingStatusCallback fires when the recording is ready (see recording webhooks).transcribeCallback fires with TranscriptionStatus and TranscriptionSegments (see transcription webhooks).