microscopic-dress-75199
12/09/2025, 9:25 PMtall-airline-16756
12/09/2025, 9:25 PMtall-airline-16756
12/09/2025, 9:25 PMmicroscopic-dress-75199
12/09/2025, 10:44 PMtall-airline-16756
12/09/2025, 10:45 PMroom_config.egress to record the call.
1. Save files locally on the egress machine
• Specify a local absolute path for the egress output and do NOT include any cloud storage fields (no s3, gcp, azure, etc.). The file will be written to the filesystem of the machine/container running the egress service.
• Ensure the directory exists and is writable by the egress process:
mkdir -p /path/to/recordings && chmod 755 /path/to/recordings
1. Example outputs
• Record as a single MP4 file (room egress):
{
"room": {
"file": {
"filepath": "/path/to/recordings/call-output.mp4"
}
}
}
• Use segmented HLS:
{
"room": {
"segments": {
"filename_prefix": "/path/to/recordings/call-segment"
}
}
}
• For raw audio track egress (no transcoding), use Track Egress with file output (e.g., .ogg for Opus):
{
"room_name": "call-room-123",
"track_id": "TR_AUDIO_TRACK_ID",
"file": {
"filepath": "/path/to/recordings/raw-audio.ogg"
}
}
1. Verify egress deployment
• Confirm the egress service is running where you expect (the filesystem you point to is the egress host/container).
• Confirm permissions so egress can write to the chosen path.
If you want, tell me:
• Do you prefer a single MP4, raw audio (.ogg), or HLS segments?
• Are you using Auto Egress or starting egress manually?
I can then give the exact JSON for your SIP dispatch rule or a StartEgress/StartTrackEgress request.
Sources: Auto egress | LiveKit docs | Universal Egress | Recording and export | LiveKit docs | Egress output types | LiveKit docsmicroscopic-dress-75199
12/09/2025, 10:45 PMtall-airline-16756
12/09/2025, 10:46 PMfilepath or filename_prefix will land on that host.
• Make sure the egress service is deployed on the machine where you want files stored and that the target directory exists and is writable by the egress process:
mkdir -p /path/to/recordings && chmod 755 /path/to/recordings
• Omit any cloud storage fields (s3, gcp, azure, etc.) in the egress output config to keep files local.
If you’d like, tell me which output type you want (single MP4, raw audio .ogg, or HLS segments) and whether you use Auto Egress for SIP or will start egress manually — I’ll provide the exact JSON/config for your self-hosted setup.microscopic-dress-75199
12/09/2025, 10:47 PMtall-airline-16756
12/09/2025, 10:48 PMmkdir -p /var/lib/livekit/recordings
chmod 755 /var/lib/livekit/recordings
chown <egress-user>:<egress-user> /var/lib/livekit/recordings
Replace <egress-user> with the user the egress process runs as (or skip chown if running as root/container user).
3) Configure your SIP dispatch rule to enable Auto Egress (automatic recording)
• In your SIP dispatch rule, set room_config.egress to produce a room egress with a file output pointing to an absolute local path. Example JSON snippet for MP4 output:
{
"room_config": {
"egress": {
"room": {
"file": {
"filepath": "/var/lib/livekit/recordings/call-{{CALL_ID}}.mp4"
}
}
}
}
}
• Use a template or unique filename per call (e.g., include timestamp or call id) so files don’t overwrite.
4) (Alternative) Start egress manually after SIP bridge creates the room
• If you prefer starting egress programmatically, call StartRoomEgress or StartTrackEgress against the egress API after the SIP call creates the room.
• Example StartRoomEgress payload to create an MP4 file:
{
"room_name": "call-room-123",
"file": {
"filepath": "/var/lib/livekit/recordings/call-room-123.mp4"
}
}
5) File format and track considerations
• Room file egress will produce an MP4 (audio + any video if present). For SIP audio-only calls, the MP4 will contain the audio track.
• If you want raw audio instead, use Track Egress with `.ogg`; but you requested MP4 so use room/file or combine tracks into MP4.
6) Verify and test
• Place a test SIP call through your configured dispatch rule.
• On the egress host, watch for the MP4 file in /var/lib/livekit/recordings/.
• Check file ownership and size; confirm audio plays.
7) Troubleshooting tips
• If no file appears:
◦ Confirm the egress service logs show StartEgress succeeded.
◦ Confirm the path in the egress config is absolute and writable by egress.
• If permission errors appear, adjust directory ownership/permissions or run egress under a user with write access.
If you’d like, tell me:
• the exact path you want to use for recordings, and
• whether you want Auto Egress (SIP dispatch rule) or to start egress manually.
I’ll return the precise JSON for your SIP dispatch rule or StartRoomEgress request with that filename pattern.microscopic-dress-75199
12/09/2025, 10:57 PMtall-airline-16756
12/09/2025, 10:58 PMlk CLI example.
1) Export your current dispatch rule to a file (so you can edit safely)
lk sip dispatch get --id <DISPATCH_RULE_ID> > dispatch-rule.json
2) Edit dispatch-rule.json and add a room_config.egress block. Example (MP4 written to local path):
{
"room_config": {
"egress": {
"room": {
"file": {
"filepath": "/var/lib/livekit/recordings/call-{{call_id}}-{{time}}.mp4"
}
}
}
}
}
• Use an absolute filepath on the egress host.
• Keep out any s3, gcp, or azure sections to store locally.
3) Update the dispatch rule with the edited file
lk sip dispatch update --id <DISPATCH_RULE_ID> dispatch-rule.json
4) Confirm
• Place a test SIP call routed by that dispatch rule.
• Check /var/lib/livekit/recordings/ on the egress host for the MP4.
If you want, tell me your dispatch rule ID and the exact local path you prefer and I’ll generate a ready-to-use dispatch-rule.json snippet with that filename pattern.
Sources: Egress examples | LiveKit docs | SIP dispatch rule | LiveKit docs | SIP overview | LiveKit docsmicroscopic-dress-75199
12/09/2025, 10:59 PMtall-airline-16756
12/09/2025, 10:59 PMlk sip dispatch update will only add the room_config or overwrite other fields. It will only update the fields you include — it will not clear or remove existing fields.
What to do:
1. Export current rule (safe backup):
lk sip dispatch get --id <DISPATCH_RULE_ID> > dispatch-rule.json
1. Add a room_config.egress block to that file (example MP4):
{
"room_config": {
"egress": {
"room": {
"file": {
"filepath": "/var/lib/livekit/recordings/call-{{call_id}}-{{time}}.mp4"
}
}
}
}
}
1. Update the rule:
lk sip dispatch update --id <DISPATCH_RULE_ID> dispatch-rule.json
Notes:
• Fields not present in dispatch-rule.json are preserved.
• Backing up with get ensures you can restore or edit the full rule if you prefer.
• Tell me your dispatch rule ID and preferred filepath if you want a ready-to-use JSON. Sources: SIP APIs | LiveKit docs