Hey, using the LiveKit JS Client SDK, I am receivi...
# ask-ai
b
Hey, using the LiveKit JS Client SDK, I am receiving ParticipantActive events for regular users, however I am not getting this event for when a sip participant joins the room and becomes active. See https://livekit-users.slack.com/archives/C088ZNU7QQ5/p1764097914893119 for context We need to remove the particpant programatically but only when the sip.callStatus is active. Have any suggestion how to do it properly ?
t
Thanks for reaching out, Mike. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding to your question about why you see ParticipantActive for regular users but not for SIP and how to remove a SIP participant when
sip.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:
Copy code
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):
Copy code
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