bumpy-kilobyte-69034
11/26/2025, 10:02 AMtall-airline-16756
11/26/2025, 10:02 AMtall-airline-16756
11/26/2025, 10:03 AMsip.callStatus is active.
Short answer and recommended approach
• SIP participants are regular participants (they have kind === ParticipantKind.SIP) and the join/connect event does fire for them.
• Detect the SIP call becoming active by watching participant attributes (the sip.callStatus attribute). Use ParticipantAttributesChanged to catch the transition to "active", and also check participant.attributes['sip.callStatus'] when they first connect in case it’s already active.
• Removing a participant must be done server-side (server SDK / RoomService.RemoveParticipant). From the client, call your backend when you detect sip.callStatus === 'active' and let the backend call the remove API (requires room admin permissions).
Suggested code sketches 1) Listen for connect + attribute changes:
room.on(RoomEvent.ParticipantConnected, (p) => {
if (p.kind === ParticipantKind.SIP && p.attributes['sip.callStatus'] === 'active') {
notifyBackendRemove(p.identity);
}
});
room.on(RoomEvent.ParticipantAttributesChanged, (p, changed) => {
if (p.kind === ParticipantKind.SIP && changed['sip.callStatus'] === 'active') {
notifyBackendRemove(p.identity);
}
});
2) Example client → backend call (POST body: room, identity):
await fetch('/api/remove-participant', { method: 'POST', body: JSON.stringify({ room: room.name, identity: p.identity }) });
Backend must call the server SDK removeParticipant(roomName, participantIdentity) (or RoomService.RemoveParticipant).
If you’d like, share:
• a short snippet of how you currently listen for participant events, and
• whether you already receive ParticipantAttributesChanged events for SIP participants
I can review that and suggest a minimal change.
Sources: livekit/livekit_composite | DeepWiki | Handling events | LiveKit docs | SIP participant | LiveKit docs | Managing participants | LiveKit docs | Make outbound calls | LiveKit docs