incalculable-garage-37123
10/03/2025, 6:55 AMtall-airline-16756
10/03/2025, 6:55 AMtall-airline-16756
10/03/2025, 6:55 AMincalculable-garage-37123
10/03/2025, 6:57 AMtall-airline-16756
10/03/2025, 6:58 AMSIPDispatchRuleIndividual rule type—it lets you automatically create a new room for each inbound call. You can also set a roomPrefix to customize the room names to fit your needs.
• Passing Metadata: There are a few ways you can pass metadata:
◦ Agent Metadata: Use roomConfig.agents.metadata in the dispatch rule to send job-specific metadata to your LiveKit agent.
◦ Room Metadata: You can set or update room metadata dynamically using the CreateRoom or UpdateRoomMetadata APIs.
◦ Participant Metadata: Attach metadata to the SIP participant when creating them, or update it later with the UpdateParticipant API.
◦ Dispatch Rule Metadata: Use the metadata field in your dispatch rule to tag calls with any relevant information.
If you’d like, you can check out the SIP Dispatch Rule and Room Metadata API documentation for more details. And please don’t hesitate to reach out if you want help with specific code examples or configurations—I’m here to support you every step of the way!
Sources: protobufs/livekit_sip.proto | Room metadata | LiveKit Docs | lib/livekit/sip_service_client.rb | Docs::Telephony | Docs::Telephonyincalculable-garage-37123
10/03/2025, 6:59 AMtall-airline-16756
10/03/2025, 7:00 AMSIPDispatchRuleIndividual rule that automatically creates a new room for every inbound call. This way, each call gets its own dedicated space.
2. Assign Metadata: On the server side, you can dynamically assign metadata to each room by:
◦ Listening for inbound call events, perhaps through a webhook or SIP trunk integration.
◦ Using the CreateRoom API to create the room and add metadata right when the room is created.
◦ Or, if you prefer, you can update the metadata afterward with the UpdateRoomMetadata API.
1. Participant Metadata: If you want to attach metadata specific to the caller, you can do so when creating the SIP participant or update it later using the UpdateParticipant API.
This setup will make sure each inbound call has its own room along with the right metadata. If you’d like, I’m here to help you with any specific API calls or configuration details—just let me know!incalculable-garage-37123
10/03/2025, 7:02 AMtall-airline-16756
10/03/2025, 7:03 AMlistRooms API to get a list of active rooms along with their names. This is especially useful if you want to keep an eye on things or manage metadata dynamically after the room has been created.
3. Room Name Format: If you're working with SIPDispatchRuleIndividual, the room name usually follows the pattern roomPrefix + callerNumber + randomSuffix. So, if you’ve set a custom prefix, you can predict the room name format quite easily.
Please feel free to reach out if you’d like some guidance on setting up webhooks, using the listRooms API, or applying this in your specific setup. I’m here to help!
Sources: packages/livekit-server-sdk/src/RoomServiceClient.ts | lib/src/ui/builder/room/room_name.dart | Avoiding Room ID Reuse When Re-Creating Rooms With the Same Name | SIP dispatch rule | LiveKit Docs | Docs::Telephonyincalculable-garage-37123
10/03/2025, 7:04 AMtall-airline-16756
10/03/2025, 7:04 AMlivekit-cli create-room --room my-precreated-room
2. Set Up an Inbound SIP Trunk: Next, configure an inbound SIP trunk in LiveKit so it can authenticate and accept calls from your SIP provider.
3. Create a Dispatch Rule: Use the dispatchRuleDirect type within the SIP dispatch rule to route calls straight to your pre-created room. Here's an example:
{
"rule": {
"dispatchRuleDirect": {
"roomName": "my-precreated-room"
}
},
"trunk_ids": [
"your_sip_trunk_id"
]
}
After setting this up, any inbound calls that match your dispatch rule will be directed to the room you specified. If you’d like, I’m here to help with any specific configurations or API details—just let me know!
Sources: Docs::Telephony | Docs::Telephony | Docs::Telephony | README.md | Using Wavix to accept and make calls | LiveKit Docsincalculable-garage-37123
10/03/2025, 7:06 AMtall-airline-16756
10/03/2025, 7:06 AMincalculable-garage-37123
10/03/2025, 7:16 AMtall-airline-16756
10/03/2025, 7:17 AMSIPDispatchRuleCallee that creates rooms dynamically based on the callee (the called phone number). By setting a roomPrefix and enabling randomize: true, you’ll get unique room names for each call, which is super handy.
2. Create Dispatch Rules Dynamically: If you prefer to have specific room names ready for each callee, you can use the CreateSIPDispatchRule API to programmatically create dispatch rules. This way, you can dynamically add rules as new phone numbers come in.
While dynamically creating dispatch rules is definitely doable, it does involve some backend logic to keep everything running smoothly. If you’d like, I’m here to help you with implementing either method or to chat through your specific needs to find the best fit for your setup.
Sources: Docs::Telephony | SIP dispatch rule | LiveKit Docs | protobufs/livekit_sip.proto | README.md