Include region in ParticipantInfo (#585)

This commit is contained in:
Raja Subramanian
2022-03-31 14:57:55 +05:30
committed by GitHub
parent ffb45f7fe2
commit 4696503790
8 changed files with 81 additions and 3 deletions
+3
View File
@@ -108,7 +108,9 @@ func (s *RTCService) validate(r *http.Request) (livekit.RoomName, routing.Partic
claims.Identity += "#" + publishParam
}
region := ""
if router, ok := s.router.(routing.Router); ok {
region = router.GetRegion()
if foundNode, err := router.GetNodeForRoom(r.Context(), roomName); err == nil {
if selector.LimitsReached(s.limits, foundNode.Stats) {
return "", routing.ParticipantInit{}, http.StatusServiceUnavailable, rtc.ErrLimitExceeded
@@ -123,6 +125,7 @@ func (s *RTCService) validate(r *http.Request) (livekit.RoomName, routing.Partic
AutoSubscribe: true,
Client: s.ParseClientInfo(r),
Grants: claims,
Region: region,
}
if autoSubParam != "" {