Feature Request: Add room_config support to create...
# telephony
n
Feature Request: Add room_config support to createSipDispatchRule SDK method Hi LiveKit team! 👋 I'm currently using the LiveKit Java SDK and noticed that the
sipServiceClient.createSipDispatchRule()
method doesn't support adding
room_config
parameters, which is essential for configuring agents in SIP dispatch rules. Current Limitation: The SDK method signature doesn't allow passing
room_config
with agent configuration, forcing us to use direct HTTP API calls instead of the cleaner SDK approach. API Documentation vs SDK Mismatch: According to the SIP Service API documentation, the
CreateSIPDispatchRule
API supports additional parameters including
room_config
, but the Java SDK's
sipServiceClient.createSipDispatchRule()
method doesn't expose these parameters. This creates a gap between what's available in the HTTP API and what's accessible through the SDK. What I need: java
Copy code
// Current workaround - using HTTP client directly
Map<String, Object> requestBody = new HashMap<>();
requestBody.put("room_config", Map.of(
    "agents", List.of(Map.of(
        "agentName", agentName,
        "metadata", roomMetadata
    ))
));
Requested Enhancement: Could you please update the
createSipDispatchRule
method (and potentially other SIP service methods) to: • Accept all parameters documented in the API spec, especially
room_config
• Maintain feature parity between HTTP API and SDK methods • Allow us to configure agent assignments directly through the SDK • Set room metadata and agent-specific configurations Use Case: We're building automated SIP call routing with agent dispatch, and
room_config
is crucial for specifying which agents should handle incoming calls and their associated metadata. It would be great if the SDK could expose the full functionality available in the HTTP API rather than requiring manual HTTP calls for missing parameters. Would love to see this enhancement in a future SDK release! Let me know if you need any additional details about the use case.
e
In case it helps, this is what we're doing — it sounds similar to your use case: 1. We set up Twilio to call a webhook on our API server 2. The webhook creates a new room with the right room metadata, and an explicit agent dispatch request with the right job metadata 3. We then respond to Twilio with a TwiML payload that dials our LiveKit SIP endpoint with the room name, e.g.
sip:<room_name>@123.sip.livekit.cloud
(see instructions here) 4. Twilio forwards the call to LiveKit 5. Our "callee" dispatch rule without prefix in LiveKit makes it so the SIP participant lands in the pre-configured room
n
Thanks for sharing your approach! That's a great workflow for handling calls through Twilio webhooks. My use case is slightly different - I'm working with inbound trunks and dispatch rules rather than the Twilio webhook approach: 1. First, I create a SIP inbound trunk using
sipServiceClient.createSipInboundTrunk()
2. Then, I need to create a dispatch rule with
dispatchRuleIndividual
(not "callee" dispatch) that's specifically tied to that trunk 3. The dispatch rule needs
room_config
to specify which agents should handle calls coming through that particular trunk The key difference is I'm using trunk-specific dispatch rules with
dispatchRuleIndividual
rather than a global "callee" rule. This allows for more granular control - different trunks can route to different agents with different configurations. The main issue: While the HTTP API documentation shows that
CreateSIPDispatchRule
supports
room_config
, the Kotlin SDK's
sipServiceClient.createSipDispatchRule()
method doesn't expose this parameter, forcing me to use direct HTTP calls. Broader point: Ideally, both the SDK methods and the HTTP endpoints should have feature parity. When the API documentation shows certain parameters are available, developers should be able to access them through the SDK without having to drop down to manual HTTP requests. Would love to see the SDK updated to match the full API specification! 🚀
👌 1
io/livekit/server/SipServiceClient.kt
File Path Function
createSipDispatchRule
Hey! @early-fall-57331 Just wanted to follow up on this. Is this something that could be considered for a future SDK update? Or is there a technical reason why
room_config
and other documented API parameters aren't exposed in the SDK methods? I'm happy to provide more details about the use case if that would help move this forward. Right now, we're maintaining HTTP client code alongside the SDK which isn't ideal. Also curious - is there a preferred way to track feature requests like this?
+ @refined-appointment-81829
e
@narrow-chef-71655 I'm just a fellow LiveKit user trying to be helpful.
n
Oh, my bad! I thought you were from the LiveKit team. Thanks for trying to help anyway! 😅
Hey @refined-appointment-81829! Just checking if you saw my question above about the SDK/API parity gap with
createSipDispatchRule()
. The SDK method is missing
room_config
and other parameters that are documented in the HTTP API spec, which is forcing us to use direct HTTP calls instead of the SDK. Is this something that can be addressed? Would really help to have the SDK expose all the parameters available in the API. Thanks!
r
I've not looked at the Java SDK but if you want to make a PR for what you need I can pass it on to the team
n
Thank you for reply! Unfortunately, I'm not able to raise a PR because the SDK is written in Kotlin and I only work with Java. I don't have experience with Kotlin, so I wouldn't be confident about making changes. What I need: Support for the
room_config
parameter in
CreateSipDispatchRule
, specifically: •
room_config.agents[]
with fields:
agent_name
and
metadata
Also humble request for maintaining same parity between http documentation and Kotlin SDK🙏
r
I will share with client team
n
Thank You!
b
@early-fall-57331 at step 3 (We then respond to Twilio with a TwiML payload that dials our LiveKit SIP endpoint with the room name, e.g.
sip:
), does the callee hear the ringing sound when Twilio connects to the LiveKit room?
e
@best-toddler-3221 yes, the callee will then hear a ringing sound from Twilio until the SIP participant has joined the room.
b
as we are using your similar setup for outbound call (the flow is below), the ring experience is bad for the callee. 1. Twilio call a callee A with answered machine detected enabled 2. Twilio detect the callee A is answering, then do a sip (sip:phone_number@livekit_sip_uri.) to the Livekit 3. The callee A hears the ring sound. Do you know whether there is anyway to remove the ring for the sip? I asked ChatGPT, which mentioned I can setup a middle layer in my service to be websocket endpoint, which connects to LiveKit. But after I did some research, it seems that LiveKit doesn't support websocket to the room. One sidenote is that I tried sip:room_number@livekit_sip_uri. I found Twilio always can't connect to Livekit and observed 503. Do you see similar issue?
e
Our use case is just inbound, so for us the ringing sound is fine. Not sure if there's a way around it. Haven't seen 503 from LiveKit... sounds like maybe a billing plan or capacity or concurrency issue.
b
Our use case is just inbound, so for us the ringing sound is fine => make sense maybe a billing plan or capacity or concurrency issue => It shouldn't. I mean, sip:phone_number@livekit_sip_uri can work. If that is the issue, then sip:phone_number can't work Is it possible to help share an example on the TwiML? I want to see whether you add some transport=tcp after the sip:room as this setup (create the room using dispatch and then sip to the room) makes much more sense
I am also curious on inbound setup 1. option 1: use webhook to return TwiML, then sip to the room 2. option 2: associate the created Twilio inbound trunk directly with the phone number. Then Twilio inbound trunk will connect to the LiveKit inbound trunk What is your consideration to use option 1? Like what is issue for option 2 or benefit for option 1
e
We have a multitenant application so we need to support many phone numbers, so we have a wildcard inbound trunk. We also need to pass data to the agent, so it makes sense to create the room first and do explicit agent dispatch.
Copy code
<Sip username="sip_trunk_username" password="sip_trunk_password">
      sip:some_unique_room_name@4wxwgg2qj6t.sip.livekit.cloud
    /Sip
We do essentially this, from the LiveKit docs.
b
I see. Huge thanks. I don't put username and password. Not sure whether that it is the issue. I will give a try
👍 1
support many phone numbers => Can I understand your setup is 1. Twilo many phone numbers 2. Create a Twilio inbound trunk and associate with all phone numbers in step 1. The trunk with origination SIP URI pointing to your LiveKit SIP 3. Then create a LiveKit inbound trunk with numbers being *
e
For #2 we have each phone number configured to call a webhook on our API. That webhook dynamically creates the room and agent dispatch request first. Only then do we respond with the TwiML to dial the LiveKit SIP.
b
Oh. Yes
e
And you need the Callee dispatch rule for this to work.
👍 1
b
My bad to miss that part from your previous thread
👍 1
why callee. I mean this is the inbound call,
the caller has different phone numbers
Screenshot 2025-10-09 at 12.03.56 PM.png
or maybe dispatch_rule_direct as you have already created a room firstly
e
"Callee" is referring to whatever you put in the SIP URL in this case i.e.
sip:<callee>@bla.livekit.cloud
b
I see
e
Yea took me a while to figure that out
🙌 1
b
I am guessing this can be the key part for my setup fail
e
Since you can set up a dispatch rule to map the callee directly to a room name, it effectively let's you do
sip:room_name@bla.livekit.cloud
using a single static dispatch rule.
👍 1
b
I really appreciate your time
👍 1
this can save me a lot of Cursor back and forth experiment
😆 1