broad-painter-9222
12/04/2025, 1:34 PMtall-airline-16756
12/04/2025, 1:34 PMtall-airline-16756
12/04/2025, 1:34 PMparticipant = await ctx.wait_for_participant(kind=participant_kinds) is used — this waits until a participant of a specified kind (or kinds) joins the room, then returns that participant.
Quick details and examples:
• Purpose: block the agent until a matching participant appears so the agent interacts only with intended participant types (e.g., human callers, SIP callers).
• Parameter: kind can be a single kind or a list. Example kinds: rtc.ParticipantKind.PARTICIPANT_KIND_STANDARD, rtc.ParticipantKind.PARTICIPANT_KIND_SIP, rtc.ParticipantKind.PARTICIPANT_KIND_AGENT, etc.
• Default: calling await ctx.wait_for_participant() with no kind waits for any participant.
Examples:
1) Wait for a SIP caller only
participant = await ctx.wait_for_participant(kind=rtc.ParticipantKind.PARTICIPANT_KIND_SIP)
2) Wait for either a standard user or SIP caller
participant_kinds = [
rtc.ParticipantKind.PARTICIPANT_KIND_STANDARD,
rtc.ParticipantKind.PARTICIPANT_KIND_SIP
]
participant = await ctx.wait_for_participant(kind=participant_kinds)
3) Wait for any participant
participant = await ctx.wait_for_participant()
If you want, tell me which participant kinds you expect (web user, SIP caller, agent) and I’ll suggest the exact filter and next steps for handling that participant.
Sources: livekit/livekit_composite | DeepWiki | Job lifecycle | LiveKit docs | Rooms, participants, and tracks | LiveKit docsbroad-painter-9222
12/04/2025, 1:53 PMtall-airline-16756
12/04/2025, 1:53 PMawait ctx.connect()
for rp in ctx.room.remote_participants.values():
# rp is a RemoteParticipant
print(rp.identity)
• Listen for participant-connected events
@ctx.room.on("participant_connected")
def on_participant_connected(participant: rtc.RemoteParticipant):
print(participant.identity)
• Use track subscription events (gives participant when a track is subscribed)
@ctx.room.on("track_subscribed")
def on_track_subscribed(track, publication, participant: rtc.RemoteParticipant):
print(participant.identity)
Which SDK/language are you using (Python or Node)? I can provide a tailored example or show how to filter by participant kind.
Sources: Job lifecycle | LiveKit docs | Building an Automated IVR Menu Caller | LiveKit docs | SIP participant | LiveKit docs