Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions livekit/livekit_models.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 19 additions & 8 deletions observability/roomobs/room.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,32 @@ const (
SimulationRoomFeature
)

func RoomFeatureFromParticipantKind(k livekit.ParticipantInfo_Kind) RoomFeature {
// RoomFeatureFromParticipantKind derives the room-session features implied by a
// participant's kind and any kind details. Features are additive: a single
// participant can contribute multiple bits (e.g. an AGENT participant flagged
// with the SIMULATION kind detail yields both AgentRoomFeature and
// SimulationRoomFeature).
func RoomFeatureFromParticipantKind(k livekit.ParticipantInfo_Kind, details ...livekit.ParticipantInfo_KindDetail) RoomFeature {
var f RoomFeature
switch k {
case livekit.ParticipantInfo_INGRESS:
return IngressRoomFeature
f = IngressRoomFeature
case livekit.ParticipantInfo_EGRESS:
return EgressRoomFeature
f = EgressRoomFeature
case livekit.ParticipantInfo_SIP:
return SIPRoomFeature
f = SIPRoomFeature
case livekit.ParticipantInfo_AGENT:
return AgentRoomFeature
f = AgentRoomFeature
case livekit.ParticipantInfo_CONNECTOR:
return ConnectorRoomFeature
default:
return 0
f = ConnectorRoomFeature
}
for _, d := range details {
switch d {
case livekit.ParticipantInfo_SIMULATION:
f |= SimulationRoomFeature
}
}
return f
}

func ParticipantKindCode(k livekit.ParticipantInfo_Kind) int32 {
Expand Down
3 changes: 2 additions & 1 deletion protobufs/livekit_models.proto
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ message ParticipantInfo {
CONNECTOR_WHATSAPP = 2;
CONNECTOR_TWILIO = 3;
BRIDGE_RTSP = 4;
// NEXT_ID: 5
SIMULATION = 5;
// NEXT_ID: 6
}
string sid = 1;
string identity = 2;
Expand Down
Loading