Take ClientInfo from request. (#3738)

This will allow WHIP client to pass in client info which can provide
more information about WHIP clients for telemetry.
This commit is contained in:
Raja Subramanian
2025-06-16 21:01:15 -07:00
committed by GitHub
parent 8077426312
commit 9d569e2fef
3 changed files with 82 additions and 79 deletions
+8 -4
View File
@@ -169,14 +169,18 @@ func (s *RTCRestService) validateCreate(r *http.Request) (*createRequest, int, e
return nil, http.StatusBadRequest, fmt.Errorf("malformed SDP offer: %s", err)
}
ci := ParseClientInfo(r)
if ci.Protocol == 0 {
// if no client info available (which will be mostly the case with WHIP clients), at least set protocol
ci.Protocol = types.CurrentProtocol
}
pi := routing.ParticipantInit{
Identity: livekit.ParticipantIdentity(claims.Identity),
Name: livekit.ParticipantName(claims.Name),
AutoSubscribe: true,
Client: &livekit.ClientInfo{
Protocol: types.CurrentProtocol,
},
Grants: claims,
Client: ci,
Grants: claims,
CreateRoom: &livekit.CreateRoomRequest{
Name: string(roomName),
RoomPreset: claims.RoomPreset,