salmon-lighter-12882
12/02/2025, 12:40 PMrequest = CreateSIPParticipantRequest(
sip_trunk_id = "<trunk_id>",
sip_call_to = "<phone_number>",
room_name = "my-sip-room",
participant_identity = "sip-test",
participant_name = "Test Caller",
krisp_enabled = True,
wait_until_answered = True
)tall-airline-16756
12/02/2025, 12:40 PMtall-airline-16756
12/02/2025, 12:41 PMagent_name in your server agent definition so it will only join rooms when explicitly dispatched.
1. Dispatch the agent to the room you’ll use for the call (e.g., "my-sip-room"). Two options:
◦ Agent Dispatch API:
dispatch = await lkapi.agent_dispatch.create_dispatch(
api.CreateAgentDispatchRequest(
agent_name="my-telephony-agent",
room="my-sip-room",
metadata='{"call_reason":"outbound_campaign"}'
)
)
• Or include the target agent in a participant access token / room config so the room is created with that agent assigned:
token = (
AccessToken()
.with_identity("outbound-initiator")
.with_grants(VideoGrants(room_join=True, room="my-sip-room"))
.with_room_config(
RoomConfiguration(
agents=[RoomAgentDispatch(agent_name="my-telephony-agent")]
)
)
.to_jwt()
)
1. Initiate the outbound SIP call (your snippet). When the SIP participant joins room_name="my-sip-room", the dispatched agent will be in that room to handle the call:
request = CreateSIPParticipantRequest(
sip_trunk_id="<trunk_id>",
sip_call_to="<phone_number>",
room_name="my-sip-room",
participant_identity="sip-test",
participant_name="Test Caller",
krisp_enabled=True,
wait_until_answered=True
)
participant = await lk_api.sip.create_sip_participant(request)
1. (Optional) Pass metadata in the dispatch to give the agent context (customer info, phone number). That metadata is available in the agent’s JobContext.
Would you like example code for dispatching then creating the SIP participant in one flow, or do you want help verifying your agent’s explicit-dispatch configuration?
Sources: Agents telephony integration | LiveKit docs | Agent dispatch | LiveKit docs | Make outbound calls | LiveKit docs | livekit/livekit_composite | DeepWiki