fast-hairdresser-13908
11/30/2025, 7:42 PMtall-airline-16756
11/30/2025, 7:42 PMtall-airline-16756
11/30/2025, 7:42 PMagent_name parameter on the @rtc_session decorator (or equivalent agent registration) when you define the agent entrypoint. This ties the running agent to a specific dispatch name.
Example (Python):
@server.rtc_session(agent_name="my-telephony-agent")
async def entrypoint(ctx: JobContext):
session = AgentSession(...)
await session.start(ctx.room, agent=Agent(instructions="You are a helpful assistant."))
1. Create a dispatch rule that references the same agent name
• The dispatch rule’s room_config must list the same agentName used above so incoming SIP calls dispatch that named agent into the room.
Example dispatch JSON:
{
"dispatch_rule": {
"roomConfig": {
"agents": [
{
"agentName": "my-telephony-agent"
}
]
}
}
}
• Apply the rule (CLI/API) so LiveKit will create the room and dispatch that named agent on inbound calls.
1. Ensure your SIP trunk / inbound number is configured
• Confirm your inbound trunk or phone number is linked in LiveKit so incoming calls evaluate dispatch rules and create rooms accordingly.
Call flow summary:
• Inbound SIP call → LiveKit identifies the dispatch rule for that trunk/number → room is created → dispatch rule requests agent named "my-telephony-agent" → agent registered with @rtc_session(agent_name="my-telephony-agent") joins the room and runs its AgentSession.
Key notes:
• agent_name is set at the agent registration (rtc_session), not on AgentSession itself.
• The names must match exactly between the agent registration and the dispatch rule.
• If you leave agent_name unset, agents may be auto-dispatched to all rooms (not recommended for telephony).
If you want, tell me:
• which language/runtime you’re using (Python, Node, etc.), and
• a snippet of your current agent registration or dispatch rule
—I can provide a tailored code example or check for mismatches.
Sources: Agents telephony integration | LiveKit docs | Agent session | LiveKit docs | SIP dispatch rule | LiveKit docs | SIP trunk setup | LiveKit docsfast-hairdresser-13908
11/30/2025, 7:43 PMtall-airline-16756
11/30/2025, 7:43 PMagent_name can be passed via cli.run_app(WorkerOptions(..., agent_name='botverse_test_new')). That will not set the dispatchable agent name.
Set the agent name on the agent registration entrypoint (the @rtc_session decorator or equivalent) so dispatch rules can match it. Example (Python):
@server.rtc_session(agent_name="botverse_test_new")
async def entrypoint(ctx: JobContext):
session = AgentSession(...)
await session.start(ctx.room, agent=Agent(instructions="You are a helpful assistant."))
Keep WorkerOptions(entrypoint_fnc=entrypoint) for launching the worker; do not rely on passing agent_name there. If you share which runtime or current entrypoint code you have, I can show the exact change.fast-hairdresser-13908
11/30/2025, 7:49 PMagent_name with your dispatch rule. The agent name is independent of SIP dispatch rulestall-airline-16756
11/30/2025, 7:49 PMagent_name must match the dispatch rule for inbound SIP calls. To be clear: if you want deterministic routing to a specific agent, the dispatch rule must reference the same agent_name that the agent registers with (via @rtc_session(agent_name=...) or equivalent).
Quick points:
• Set agent_name on the agent registration entrypoint (not via WorkerOptions).
• Make the dispatch rule’s roomConfig.agents[].agentName exactly match that name.
• If you don’t set an agent_name, agents may be auto-dispatched to rooms (default behavior), but that is non-deterministic and not recommended for telephony.
If you want, share your entrypoint code and dispatch JSON (or tell me your runtime) and I’ll point out exactly what to change.fast-hairdresser-13908
11/30/2025, 7:49 PMtall-airline-16756
11/30/2025, 7:50 PMAgentServer isn't exported from livekit.agents. Import it from the correct submodule and confirm your package version.
1) Use this import:
from livekit.agents.server import AgentServer
2) Verify package and extras:
• Install/upgrade LiveKit Agents 1.x and required extras:
pip install --upgrade "livekit-agents[silero,turn-detector]"
3) Check for version mismatch
• If you still get import errors, confirm which livekit-agents version is installed (pip show livekit-agents) and share it if you want help interpreting it.
4) Reminder about agent_name (since you're configuring telephony)
• Set agent_name on the agent registration entrypoint (@server.rtc_session(agent_name="...")), not via WorkerOptions.
• Ensure your dispatch rule's roomConfig.agents[].agentName exactly matches that name.
If you share your current imports, installed package version, and entrypoint snippet, I’ll point out the exact change.
Sources: Agents telephony integration | LiveKit docs | SIP dispatch rule | LiveKit docs | Voice AI quickstart | LiveKit docsfast-hairdresser-13908
11/30/2025, 7:55 PMtall-airline-16756
11/30/2025, 7:56 PMfrom livekit.agents.server import AgentServer
1. Example minimal agent entrypoint (Python):
from livekit.agents.server import AgentServer
from livekit.agents import AgentSession, Agent
server = AgentServer()
@server.rtc_session(agent_name="botverse_test_new")
async def entrypoint(ctx: JobContext):
session = AgentSession(...)
await session.start(ctx.room, agent=Agent(instructions="You are a helpful assistant."))
1. Run worker with your entrypoint (don’t rely on WorkerOptions.agent_name for dispatch):
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
1. Ensure your dispatch rule references the same name:
"roomConfig": { "agents": [{ "agentName": "botverse_test_new" }] }
If you still see the ImportError after changing the import, please share:
• the exact traceback, and
• the output of pip show livekit-agents (you already provided version which is helpful).