busy-spoon-35253
12/15/2025, 5:13 AM{
"dispatchRule": {
"rule": {
"dispatchRuleIndividual": {
"roomPrefix": "call-"
}
},
"trunkIds": [
"ST_fj4X5vtDuCuw",
"ST_7uxDBNReo7fx"
],
"name": "Farm Equipment SIP Dispatch",
"roomConfig": {
"agents": [
{
"agentName": "farming-telephony-agent5"
}
],
"egress": {
"room": {
"audioOnly": true,
"file": {
"fileType": "MP4",
"filepath": "recordings/{room_name}-{time}.mp4",
"s3": {
"accessKey": "your_access_key",
"secret": "your_secret_key",
"bucket": "bucket_name",
"region": "region"
}
}
}
}
}
}
}tall-airline-16756
12/15/2025, 5:13 AMtall-airline-16756
12/15/2025, 5:13 AMroomConfig.egress.room add a webhooks array with your endpoint and signing key:
"webhooks": [
{ "url": "<https://yourserver.com/webhooks/egress>", "signingKey": "your_livekit_signing_key" }
]
1. Redeploy the dispatch rule and run a test call — you should get egress_started and egress_ended events with recording details.
• Or rely on SIP call lifecycle webhooks:
◦ Ensure your project-level webhook is configured to receive sip_call_initiated and sip_call_ended. Those events fire for SIP calls and let you track when recording should start/end.
Quick checks while testing:
• Is your webhook endpoint publicly reachable and returning HTTP 200?
• Does it accept POST with Content-Type application/webhook+json and validate the JWT in the Authorization header?
• Confirm S3 credentials and filepath produce a successful upload after call end.
If you’d like, paste:
• your updated dispatch rule (with the webhooks block),
• or a sample webhook POST (headers + body) you received (or the lack of one),
and I’ll review it and suggest the exact next step.
Sources: Egress API | LiveKit docs | server-sdk-js | livekit/livekit_composite | DeepWiki | Webhooks | LiveKit docsbusy-spoon-35253
12/15/2025, 5:17 AMtall-airline-16756
12/15/2025, 5:17 AMwebhooks array under roomConfig.egress.room in your dispatch rule so the auto-egress will emit egress_started and egress_ended to your endpoint:
"egress": {
"room": {
"audioOnly": true,
"file": { ... },
"webhooks": [
{ "url": "<https://yourserver.com/webhooks/egress>", "signingKey": "your_livekit_signing_key" }
]
}
}
• Or rely on SIP call events: ensure your project webhook is configured to receive sip_call_initiated and sip_call_ended to track call lifecycles tied to recordings.
Validation checklist:
• Your endpoint is public and returns HTTP 200.
• It accepts POST with Content-Type application/webhook+json.
• It validates the JWT from the Authorization header using the signing key.
If you want, paste your dispatch rule with the webhooks block added (or a sample sip_call_ended payload you do receive) and I’ll confirm it looks correct.busy-spoon-35253
12/15/2025, 6:06 AMtall-airline-16756
12/15/2025, 6:07 AMlivekit.yaml? (yes / no)
1. Webhook signing key
◦ Is a Signing Key configured in the same Webhooks settings? (yes / no)
1. Which webhook receives room events
◦ Are your room_started / room_finished events arriving at the same endpoint you expect egress to hit? (yes / no)
1. Dispatch rule (redact secrets)
◦ Paste the dispatch rule JSON you now have (with webhooks and S3 fields redacted). I’ll check placement and format.
1. Evidence egress started
◦ Run lk egress list (or share any egress log/ID you see). Do you see an egress job created for the call? If you don’t have CLI access, list any egress_* entries in your logs.
1. Webhook receiver logs
◦ Any incoming POSTs around call time? If yes, paste the HTTP status your receiver returned and any server log lines for the request. If none, confirm the endpoint is publicly reachable (curl from another host).
Quick checks you can try now:
• Curl your webhook URL to confirm it returns 200 and accepts Content-Type application/webhook+json.
• Confirm your receiver validates the Authorization JWT using the project signing key (if validation fails, events may be dropped).
If you share answers to 1–5 or paste the redacted dispatch rule and any egress ID/logs, I’ll inspect them and tell you the exact next step.
Sources: SIP dispatch rule | LiveKit docs | Webhooks | LiveKit docsbusy-spoon-35253
12/15/2025, 6:31 AM{
"sip_dispatch_rule_id": "SDR_rjcvXxMWXABP",
"rule": {
"dispatch_rule_individual": {
"room_prefix": "call-"
}
},
"trunk_ids": [
"ST_fj4X5vtDuCuw",
"ST_7uxDBNReo7fx"
],
"name": "Farm Equipment SIP Dispatch",
"room_config": {
"agents": [
{
"agent_name": "farming-telephony-agent41"
}
],
"egress": {
"room": {
"audio_only": true,
"file": {
"file_type": "MP4",
"filepath": "recordings/{room_name}-{time}.mp4",
"s3": {
"access_key": "",
"secret": "",
"bucket": "prod-rbg-farm-voice-recordings",
"region": "us-east-1"
}
},
"webhooks": [
{
"url": "<https://z6hg6gv987.execute-api.us-east-1.amazonaws.com/api/v1/webhooks/livekit>",
"signing_key": ""
}
]
}
}
}
}tall-airline-16756
12/15/2025, 6:31 AMagentName, roomPrefix, fileType, accessKey, secret), not snake_case. Try reverting those fields to camelCase.
2) Agent identity & availability
• Confirm the agent name exactly matches the agent service registration (farming-telephony-agent41).
• Verify the agent service/process is running and able to accept assignments.
3) Agent permissions
• Ensure the agent has the necessary permissions (room join / SIP agent role) and that the access token used to create the dispatch rule has sip.admin / roomRecord or appropriate scopes.
4) Dispatch rule applied & matching
• Confirm the dispatch rule ID SDR_rjcvXxMWXABP is active.
• Ensure incoming SIP calls match the `roomPrefix`/trunk IDs so the rule actually triggers.
5) Logs & egress jobs
• Check agent logs and LiveKit logs at call time for assignment errors.
• Run lk egress list or check egress jobs to see if recording was created (if no egress, agent likely never joined).
6) Webhook signing key & S3 creds
• Empty signing_key, access_key, and secret are OK for testing only if you rely on project webhook; otherwise provide valid signing key and S3 creds.
• If you expect per-egress webhooks, remember egress events are sent to the project webhook URL; per-egress webhooks alone may not be sufficient.
If you want, paste a redacted JSON of the rule with camelCase (I can validate), plus:
• Agent service logs around the call time, or
• The LiveKit server logs or lk egress list output.
I’ll review and point out the exact misconfigurations.busy-spoon-35253
12/15/2025, 6:33 AM{
"sipDispatchRuleId": "SDR_rjcvXxMWXABP",
"rule": {
"dispatchRuleIndividual": {
"roomPrefix": "call-"
}
},
"trunkIds": [
"ST_fj4X5vtDuCuw",
"ST_7uxDBNReo7fx"
],
"name": "Farm Equipment SIP Dispatch",
"roomConfig": {
"agents": [
{
"agentName": "farming-telephony-agent41"
}
],
"egress": {
"room": {
"audioOnly": true,
"file": {
"fileType": "MP4",
"filepath": "recordings/{room_name}-{time}.mp4",
"s3": {
"accessKey": "",
"secret": "V+",
"bucket": "prod-rbg-farm-voice-recordings",
"region": "us-east-1"
}
},
"webhooks": [
{
"url": "<https://z6hg6gv987.execute-api.us-east-1.amazonaws.com/api/v1/webhooks/livekit>",
"signingKey": ""
}
]
}
}
}
}tall-airline-16756
12/15/2025, 6:33 AMwebhooks under roomConfig.egress.room is ignored. For auto-egress from a dispatch rule, egress lifecycle events are delivered to the project-level webhook only. Remove the webhooks block from the dispatch rule and ensure your project webhook + signing key are configured in the LiveKit dashboard or server config.
2) Agent not joining
• Your agentName field is correct. Common causes when agents don’t join:
◦ Agent worker is not running or not registered. Run lk agent list and check the agent process for errors.
◦ Agent name mismatch or case difference vs. the registered agent.
◦ Agent is overloaded or failing to accept assignments (check agent logs).
◦ Dispatch rule not active or incoming call didn’t match the rule (verify trunk IDs and roomPrefix).
◦ Token/permissions used to create the rule lack agent/roomJoin rights.
Quick checks for you to run and paste results here:
• Does the project-level webhook exist and include a signing key? (yes/no)
• Output of lk agent list (redact secrets)
• Any agent logs around call time (errors)
• lk egress list or whether an egress job was created for the call
If you prefer a step to try now:
• Remove the webhooks block, confirm project-level webhook/signing key are set, trigger a test call, then share agent list and agent logs — I’ll verify the next step. Sources: SIP APIs | LiveKit docs | Webhooks | LiveKit docs | Egress API | LiveKit docs | sip | livekit/livekit_composite | DeepWiki | SIP dispatch rule | LiveKit docsbusy-spoon-35253
12/15/2025, 6:35 AM{
"sipDispatchRuleId": "SDR_rjcvXxMWXABP",
"rule": {
"dispatchRuleIndividual": {
"roomPrefix": "call-"
}
},
"trunkIds": [
"ST_fj4X5vtDuCuw",
"ST_7uxDBNReo7fx"
],
"name": "Farm Equipment SIP Dispatch",
"roomConfig": {
"agents": [
{
"agentName": "farming-telephony-agent41"
}
],
"egress": {
"room": {
"audioOnly": true,
"file": {
"fileType": "MP4",
"filepath": "recordings/{room_name}-{time}.mp4",
"s3": {
"accessKey": "",
"secret": "V",
"bucket": "prod-rbg-farm-voice-recordings",
"region": "us-east-1"
}
}
}
}
}
}tall-airline-16756
12/15/2025, 6:35 AMagentName and roomPrefix are properly set.
• Auto-egress to S3 is configured correctly.
Two things to confirm so this works end-to-end:
1. Project-level webhook + signing key
• Ensure a project-level webhook URL and signing key are configured in your LiveKit dashboard or server config. Egress lifecycle events from SIP auto-egress are sent to the project webhook, not per-dispatch webhooks.
1. Agent availability & permissions
• Confirm the agent worker farming-telephony-agent41 is running and registered (lk agent list).
• Confirm agent has correct permissions and isn’t failing to accept assignments (check agent logs).
Quick tests to run:
• Trigger a test call and check for participant_joined, sip_call_initiated webhooks at your project webhook.
• Run lk egress list to see created egress jobs.
• If no egress job appears, check agent logs and LiveKit server logs for dispatch/assignment errors.
If you share:
• Project webhook presence (yes/no),
• lk agent list output or agent log errors,
I’ll review and give the exact next step.busy-spoon-35253
12/15/2025, 6:37 AMtall-airline-16756
12/15/2025, 6:37 AMlk egress list and share the output (redact secrets). Do you see an egress job for the room? (paste or say none)
1. Webhook receiver and signature
• Does your receiver log any incoming POSTs around the call time (even 4xx/5xx)? If yes, paste the HTTP status and any error lines. If no, confirm the endpoint is publicly reachable (a simple curl from another host returning 200 is fine).
If the answer to (1) is yes and (2) shows no egress job, the auto-egress did not start (so no egress events will be sent). If an egress job exists but no webhook POST arrived, we’ll inspect your project webhook settings and receiver logs next.
Share the answers or the lk egress list output and I’ll tell you the exact next step.busy-spoon-35253
12/15/2025, 6:45 AMtall-airline-16756
12/15/2025, 6:45 AMagentName), not by numeric/UUID agentId.
What you can do to target a specific agent:
• Use a unique, exact agentName in the dispatch rule (e.g., "agentName": "farming-telephony-agent41"). The dispatcher will attempt to assign that named agent.
• Use agent naming conventions to target a specific worker or a small pool (e.g., team-alpha-*) and register only those agents with matching names.
• Ensure the named agent is running/registered (lk agent list) and able to accept assignments.
If you need deterministic assignment (always the same worker), give that worker a unique agentName and confirm it’s online. If you want load distribution, list multiple agents in the rule.
Tell me which approach you want (single agent vs pool) and I’ll show the exact rule example and checks to ensure the agent will be assigned.