cool-iron-91629
06/25/2025, 8:37 PMtall-airline-16756
06/25/2025, 8:37 PMtall-airline-16756
06/25/2025, 8:37 PMsip_participant_identity = phone_number
await ctx.api.sip.create_sip_participant(api.CreateSIPParticipantRequest(
room_name=ctx.room.name,
sip_trunk_id='ST_xxxx',
sip_call_to=phone_number,
participant_identity=sip_participant_identity,
wait_until_answered=True,
))
In this example, the participant_identity
parameter is set to the phone number, but you can use any identifier you prefer. This identity will be used to identify the participant in the LiveKit room once the call is connected.
Sources: Agents telephony integration | LiveKit Docs | Making outbound calls | LiveKit Docscool-iron-91629
06/25/2025, 8:45 PMtall-airline-16756
06/25/2025, 8:45 PMset_participant
method is like your personal communication navigator in a RoomIO instance. Think of it as a friendly way to point out exactly who you want to interact with. Let me break it down in a super simple way: 1. You can tell the method which participant you want to chat with - either by giving it a specific identity or just letting it default to whoever's calling. 2. It's got a handy logging feature that keeps track of who's asking and who they want to talk to (like a helpful friend taking notes). 3. Behind the scenes, it sets up the RoomIO to focus on the participant you've chosen by using room_io.set_participant(target_identity)
. Cool part? This method is set up as an RPC, which means clients can basically reach out and say, "Hey, I want the voice agent to talk to this specific person!" It's like having a communication concierge that makes sure you're connected to the right participant, every single time. Sources: GitHub::livekit::agents | examples/voice_agents/toggle_io.py