melodic-vegetable-78787
02/13/2025, 3:44 PMgray-monkey-83525
02/13/2025, 3:44 PMdispatchRuleIndividual
type. This rule creates a new room for each caller, and you can specify a prefix for the room name using the roomPrefix
option. Here's an example configuration:
{
"trunk_ids": [
"<your-trunk-id>"
],
"rule": {
"dispatchRuleIndividual": {
"roomPrefix": "call-"
}
}
}
For outbound calls using agent names, you can use the AgentDispatchClient
to explicitly dispatch an agent to a room. Set the agent_name
in the WorkerOptions
to enable explicit dispatch. Here's a basic example:
from livekit import api
room_name = "my-room"
agent_name = "test-agent"
async def create_explicit_dispatch():
lkapi = api.LiveKitAPI()
dispatch = await lkapi.agent_dispatch.create_dispatch(
api.CreateAgentDispatchRequest(agent_name=agent_name, room=room_name)
)
print("created dispatch", dispatch)
Would you like more details on either setup?
Sources:
- SIP dispatch rule 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.