dazzling-truck-32153
12/12/2025, 6:50 PMtall-airline-16756
12/12/2025, 6:50 PMtall-airline-16756
12/12/2025, 6:50 PMcall-recording.mp3 or an S3 path.
• After the recording finishes you get the file URL:
◦ Listen for the egress_ended webhook event (includes download_url), or
◦ Query the egress status via the egress API/CLI to retrieve the download_url for that egress_id.
• Notes:
◦ You can include Twilio metadata like CallSid in participant attributes (sip.twilio.callSid) for correlation, but you still retrieve audio via LiveKit egress outputs.
◦ If you need cleaner audio, enable krisp_enabled or configure recording settings when creating the SIP participant/room.
Would you like the exact API payload for starting a Room Composite egress to S3 or an example webhook payload for egress_ended?
Sources: Make outbound calls | LiveKit docs | server-sdk-js | livekit/livekit_composite | DeepWiki | examples/bank-ivr | livekit/livekit_composite | DeepWiki | Track egress | LiveKit docs | SIP participant | LiveKit docsdazzling-truck-32153
12/12/2025, 6:52 PMtall-airline-16756
12/12/2025, 6:52 PMdownload_url (webhook or API/CLI) you can use and correlate with sip.twilio.callSid in participant attributes.
Which approach do you prefer—enable Twilio recording or set up LiveKit egress? I can provide the exact Twilio API calls or the LiveKit egress payload/webhook example next.dazzling-truck-32153
12/12/2025, 6:54 PMtall-airline-16756
12/12/2025, 6:54 PMdownload_url (webhook or API/CLI) and correlate it with sip.twilio.callSid in participant attributes.
If you want, I can:
• Show the Twilio API call example to fetch recordings by CallSid, or
• Provide the LiveKit Room Composite egress payload and example egress_ended webhook. Which would you like?dazzling-truck-32153
12/12/2025, 6:56 PMdazzling-truck-32153
12/12/2025, 6:56 PMtall-airline-16756
12/12/2025, 6:56 PMcurl -G https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Recordings.json \
-u '{AccountSid}:{AuthToken}' \
--data-urlencode "CallSid=CAxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
• The response includes recording SIDs and uri fields. To fetch a specific recording media URL:
curl -u '{AccountSid}:{AuthToken}' \
https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Recordings/{RecordingSid}.mp3
• Or use the Recordings list endpoint and look for `media_url`/`uri` in the JSON; Twilio also provides REST links for download.
2) LiveKit — record via egress and get a download_url
• Start a Room Composite egress (or enable AutoEgress) to produce a file output (S3/GCP/Azure or public file).
• Example JSON payload to start a Room Composite egress writing an MP3 to S3:
{
"room_name": "my-sip-call-room",
"output": {
"file": {
"filename": "s3://my-bucket/call-recording-{room_name}.mp3"
}
}
}
• After egress completes you get an egress_id and output info. Retrieve the `download_url`:
◦ Listen for the egress_ended webhook event (payload includes output.download_url), or
◦ Query the egress status via API/CLI: lk egress info EG_xxxxx which returns output.download_url.
3) Correlate Twilio CallSid with LiveKit recording
• When using LiveKit, Twilio metadata is available on the SIP participant attributes (e.g., sip.twilio.callSid). Store that attribute to map LiveKit egress_id / download_url to the Twilio CallSid for cross-reference.
Which example would you like next:
• Full Twilio code sample in your preferred language (Node/Python/cURL)?
• Full LiveKit egress API request and a sample egress_ended webhook payload?
Pick one and I’ll provide the exact snippet.dazzling-truck-32153
12/12/2025, 7:00 PMtall-airline-16756
12/12/2025, 7:00 PMsip.twilio.callSid
• Where to read it: the participant's attributes (the SIP participant object) once they join the room.
Examples:
• Node.js:
const participant = await ctx.wait_for_participant();
const callSid = participant.attributes['sip.twilio.callSid'];
• Python:
participant = await ctx.wait_for_participant()
call_sid = participant.attributes.get('sip.twilio.callSid')
Use that CallSid to correlate with Twilio recordings or logs. Need the exact listener/handler code for your environment?
Sources: SIP participant | LiveKit docsdazzling-truck-32153
12/12/2025, 7:03 PMtall-airline-16756
12/12/2025, 7:03 PM