Skip to content

Commit 8d9a571

Browse files
Add IngressID and ResourceID attributes for the ingress participants (#344)
1 parent 7487e76 commit 8d9a571

4 files changed

Lines changed: 9 additions & 4 deletions

File tree

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ require (
1616
github.com/livekit/go-rtmp v0.0.0-20230829211117-1c4f5a5c81ed
1717
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1
1818
github.com/livekit/mediatransportutil v0.0.0-20241220010243-a2bdee945564
19-
github.com/livekit/protocol v1.35.0
19+
github.com/livekit/protocol v1.36.2-0.20250411001049-b735b3b9aec7
2020
github.com/livekit/psrpc v0.6.1-0.20250205181828-a0beed2e4126
2121
github.com/livekit/server-sdk-go/v2 v2.4.2
2222
github.com/pion/dtls/v3 v3.0.4

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 h1:jm09419p0lqTkD
120120
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
121121
github.com/livekit/mediatransportutil v0.0.0-20241220010243-a2bdee945564 h1:GX7KF/V9ExmcfT/2Bdia8aROjkxrgx7WpyH7w9MB4J4=
122122
github.com/livekit/mediatransportutil v0.0.0-20241220010243-a2bdee945564/go.mod h1:36s+wwmU3O40IAhE+MjBWP3W71QRiEE9SfooSBvtBqY=
123-
github.com/livekit/protocol v1.35.0 h1:qUWXJZQoOpEerQCoq7C6x+aS4UO2uwY3It5sKjorStY=
124-
github.com/livekit/protocol v1.35.0/go.mod h1:WrT/CYRxtMNOVUjnIPm5OjWtEkmreffTeE1PRZwlRg4=
123+
github.com/livekit/protocol v1.36.2-0.20250411001049-b735b3b9aec7 h1:ir8E7VVk6oV6yKaeoJJL4zE+jSGWM8tA9/o3v9XvHBQ=
124+
github.com/livekit/protocol v1.36.2-0.20250411001049-b735b3b9aec7/go.mod h1:WrT/CYRxtMNOVUjnIPm5OjWtEkmreffTeE1PRZwlRg4=
125125
github.com/livekit/psrpc v0.6.1-0.20250205181828-a0beed2e4126 h1:fzuYpAQbCid7ySPpQWWePfQOWUrs8x6dJ0T3Wl07n+Y=
126126
github.com/livekit/psrpc v0.6.1-0.20250205181828-a0beed2e4126/go.mod h1:X5WtEZ7OnEs72Fi5/J+i0on3964F1aynQpCalcgMqRo=
127127
github.com/livekit/server-sdk-go/v2 v2.4.2 h1:q6ioBWpwLaLNj41f96eLQHi11kRyiY9MfEb5D3zi5AI=

pkg/lksdk_output/lksdk_output.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ func NewLKSDKOutput(ctx context.Context, onDisconnected func(), p *params.Params
217217
return nil, err
218218
}
219219

220+
// The resourceID may not be available when the token is created
221+
room.LocalParticipant.SetAttributes(map[string]string{
222+
livekit.AttrIngressResourceID: p.State.ResourceId,
223+
})
224+
220225
s.room = room
221226
s.logger = p.GetLogger().WithValues("roomID", room.SID())
222227

pkg/params/params.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func GetParams(ctx context.Context, psrpcClient rpc.IOInfoClient, conf *config.C
140140
UpdateTranscodingEnabled(infoCopy)
141141

142142
if token == "" {
143-
token, err = ingress.BuildIngressToken(conf.ApiKey, conf.ApiSecret, info.RoomName, info.ParticipantIdentity, info.ParticipantName, info.ParticipantMetadata)
143+
token, err = ingress.BuildIngressToken(conf.ApiKey, conf.ApiSecret, info.RoomName, info.ParticipantIdentity, info.ParticipantName, info.ParticipantMetadata, info.IngressId)
144144
if err != nil {
145145
return nil, err
146146
}

0 commit comments

Comments
 (0)