My local livekit server doesnt create dispatch rul...
# ask-ai
m
My local livekit server doesnt create dispatch rule with agent configuration
rule = api.SIPDispatchRule(
dispatch_rule_individual=api.SIPDispatchRuleIndividual(
room_prefix='call-',
pin=''
)
)
request = api.CreateSIPDispatchRuleRequest(
rule=rule,
name=f"{name}-Dispatch-Rule",
trunk_ids=[inbound_trunk_id],
hide_phone_number=False,
room_config=api.RoomConfiguration(
agents=[api.RoomAgentDispatch(
agent_name="test-agent",
metadata=name,
)]
),
)
t
Thanks for reaching out, Rajadurai. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm here to help you get your local LiveKit server working smoothly with the SIP dispatch rule and agent configuration. Let's walk through a few things together: 1. First, please double-check that your
roomConfig
includes a properly set up
agents
array, and that the
agentName
exactly matches the registered agent. This little detail is really important! 2. Next, make sure your SIP trunk and Redis configurations are spot on. The Redis server needs to be up and reachable, and your SIP service should have matching Redis settings to avoid any hiccups. 3. Also, try to use only one dispatch rule type per rule, like
dispatchRuleIndividual
. Mixing different types can cause errors, so keeping it consistent will help. 4. Take a moment to verify that your
api_key
,
api_secret
, and
ws_url
in the SIP service configuration are all valid and aligned with your LiveKit server’s settings. 5. Lastly, please confirm that your agent framework is running smoothly, with the specified agent properly registered and active to receive dispatch signals. If you’re still facing issues after these checks, don’t worry! Just share with me: • The exact configuration you’re using for the dispatch rule and SIP trunk. • Confirmation that the agent is correctly registered. • Any error logs from LiveKit or your SIP service. We’ll work through this together and get everything up and running in no time! Sources: SIP dispatch rule | LiveKit Docs | test/integration/sip_test.go | cmd/lk/sip.go
m
It returns dispatch rule sip_dispatch_rule_id: "SDR_VjMK9PfuCqSm" rule { dispatch_rule_individual { room_prefix: "call-" } } trunk_ids: "test3" name: "test3-Dispatch-Rule" It shows no room_config is applied and when calling my trunk it goes to default agent
t
It looks like the issue is happening because the
room_config
field isn’t being applied in the dispatch rule. When this field is missing, LiveKit defaults to dispatching the default agent instead of the one you’ve specified. To help fix this, please double-check the following: 1. Make sure the
room_config
field is clearly defined in the dispatch rule, including the
agents
array with the correct
agentName
. 2. Confirm that the dispatch rule includes specific
trunk_ids
so it doesn’t get treated as a default or wildcard rule. 3. Check that there aren’t any higher-priority rules (like those with specific
inbound_numbers
) that might be overriding the rule you want to use. If you’re still seeing the issue after these steps, feel free to share the exact dispatch rule configuration and any related logs. I’m here to help you get this sorted out! Sources: SIP dispatch rule | LiveKit Docs | rpc/io.pb.go
m
I also verified this dispatch with another cloud SIP server it retus dispatch rule with room config
t
Thank you for your question! The
room_config
field in SIP dispatch rules is a feature that’s currently available only on LiveKit Cloud. It’s not supported on local LiveKit server deployments because this field is specifically designed as a cloud-only feature in the LiveKit SIP protocol definitions. If you’re working with a local server and want similar functionality, you’d need to manage room configuration and agent dispatch logic externally, since the local server doesn’t support this field natively. I hope this helps clarify things, and please feel free to reach out if you have any more questions or need further assistance! Sources: livekit/livekit_sip.pb.go | SIP APIs | LiveKit Docs
m
Can you share the reference link where livekit mentioned this
t
Thank you for reaching out! I want to share some helpful information about the
room_config
field. It’s noted as cloud-only in the LiveKit SIP protocol definitions and the LiveKit documentation for
SIPDispatchRuleInfo
. To give you a bit more detail: • The
room_config
parameter is marked as cloud-only in the SIP protocol definitions, with comments highlighting that it’s intended for LiveKit Cloud use. • The LiveKit documentation for
SIPDispatchRuleInfo
also clearly mentions that
room_config
is connected to LiveKit Cloud. I understand it can be tricky not having direct links to these references, and I’m here to help if you’d like me to guide you further or clarify anything else. Just let me know!