rapid-honey-43838
02/16/2026, 2:02 PMtall-airline-16756
02/16/2026, 2:02 PMtall-airline-16756
02/16/2026, 2:02 PMroom_prefix creates unique room names).
◦ Direct routing to a specific room_name (optionally protected by a pin).
• Agent dispatch automation:
◦ Automatically dispatch named agents into the room when the call connects (via room_config.agents).
• Room configuration applied at connect:
◦ Set limits such as max_participants.
◦ Attach metadata and other room-level settings.
• Automatic egress / recording:
◦ Enable automatic egress to record the session without manual steps (room_config.egress / AutoEgress).
• Call routing logic and segmentation:
◦ Match rules by trunk_ids and other criteria so different trunks (sales, support, etc.) route to different rooms/workflows.
How these work together (typical flows)
• A call arrives on a configured inbound trunk → trunk settings (numbers, Krisp) apply → dispatch rule matched for that trunk → dispatch rule creates or selects a room and applies room_config (agents, egress, limits) → agents join and the session behaves per the rule’s configuration.
If you’d like, I can:
• Show an example dispatch rule for individual-per-call rooms vs direct-room routing.
• Explain how to configure automatic agent dispatch or AutoEgress in more detail.
• Help map your use case (sales vs support flows, recordings, agent automation) to specific trunk + dispatch rule settings.
Which of those would be most helpful right now?
Sources: sip | livekit/livekit_composite | DeepWiki | Agents telephony integration | LiveKit Documentation | server-sdk-kotlin | livekit/livekit_composite | DeepWiki | Python SDKs | livekit/livekit_composite | DeepWikirapid-honey-43838
02/16/2026, 2:18 PMtall-airline-16756
02/16/2026, 2:19 PMroom_prefix (e.g., call-123).
◦ SIPDispatchRuleDirect: routes the call directly into a named room_name (can require a pin).
• trunk matching
◦ trunk_ids ties the rule to specific inbound trunks so different numbers/trunks use different routing.
• room_config
◦ `agents`: list of agents to automatically dispatch into the room when the call connects.
◦ max_participants, metadata, and other room-level settings applied at room creation.
• behavior flow
◦ Incoming call hits an inbound trunk → matching dispatch rule runs → rule creates or selects a room and applies room_config → agents and egress behave as configured.
Egress (AutoEgress) — what it does and where to configure it
• Purpose: Automatically export audio/video from the room for recording or streaming without manual start/stop.
• Where to set it: inside the dispatch rule’s room_config.egress so every call routed by that rule uses the egress settings automatically.
• Common outputs:
◦ File recording to cloud storage (S3/GCS) or local path.
◦ RTMP streaming (stream to a live destination).
◦ Callback/webhook notifications when egress jobs start/finish.
Example patterns
1) Individual room per call + automatic file recording
# illustrative example (adapt to your SDK)
CreateSIPDispatchRuleRequest(
trunk_ids=[inbound_trunk_id],
rule=SIPDispatchRule(
dispatch_rule_individual=SIPDispatchRuleIndividual(
room_prefix="call-"
)
),
room_config=RoomConfiguration(
max_participants=5,
agents=[ {"agentName":"inbound-agent","metadata":"sales"} ],
egress=AutoEgressConfiguration(
file_output="<s3://your-bucket/recordings/{room_name}.mp4>"
)
)
)
2) Direct routing to a named room + RTMP stream
CreateSIPDispatchRuleRequest(
trunk_ids=[support_trunk_id],
rule=SIPDispatchRule(
dispatch_rule_direct=SIPDispatchRuleDirect(
room_name="support-room-1",
pin="1234" # optional
)
),
room_config=RoomConfiguration(
agents=[ {"agentName":"support-agent"} ],
egress=AutoEgressConfiguration(
rtmp_url="<rtmp://live.example.com/live/streamkey>"
)
)
)
Notes and best practices
• Prefer explicit room_config.agents for predictable agent dispatch instead of relying on implicit behaviors.
• Use trunk-specific dispatch rules to separate flows (sales, support, IVR).
• Ensure your egress destinations (S3 bucket, RTMP endpoint) are reachable and credentials are configured where required.
• Keep max_participants aligned with expected call scenarios to prevent unexpected join failures.
Would you like:
• a full copy-paste example in the language/SDK you use (Node, Python, or REST JSON)?
• help mapping your specific numbers/trunks to rule examples for sales vs support? Sources: Why do jobs stop after agent rejection? | LiveKit | Agents telephony integration | LiveKit Documentation | sip | livekit/livekit_composite | DeepWiki | examples/bank-ivr | livekit/livekit_composite | DeepWiki | Python SDKs | livekit/livekit_composite | DeepWiki