Skip to content
Open
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
6 changes: 6 additions & 0 deletions .changeset/room-rpc-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"github.com/livekit/protocol": minor
"@livekit/protocol": minor
---

Introduce a participant RPC protobuf registry for well-known LiveKit RPCs.
202 changes: 202 additions & 0 deletions livekit/roomrpc/siprpc/roomrpc_sip_v1.pb.go

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

33 changes: 32 additions & 1 deletion magefile.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,16 @@ func Proto() error {
"rpc/sip.proto",
}

// mapped proto directory:
// ./protobufs/livekit/roomrpc/<name>rpc
// and generated Go package:
// ./livekit/roomrpc/<name>rpc
roomrpcTypeNames := []string{
"sip",
}

fmt.Println("generating protobuf")
target := "livekit"
const target = "./livekit"
if err := os.MkdirAll(target, 0755); err != nil {
return err
}
Expand Down Expand Up @@ -162,6 +170,29 @@ func Proto() error {
}
}

fmt.Println("generating protobuf (livekit/roomrpc)")
for _, protoName := range roomrpcTypeNames {
pkgName := "roomrpc/" + protoName + "rpc"
protoFiles, err := os.ReadDir(filepath.Join("./protobufs", pkgName))
if err != nil {
return err
}
args := []string{
"--go_out", target,
"--go_opt=paths=source_relative",
"--plugin=go=" + protocGoPath,
"-I=./protobufs",
}
for _, protoFile := range protoFiles {
args = append(args, filepath.Join(pkgName, protoFile.Name()))
}
cmd := exec.Command(protoc, args...)
connectStd(cmd)
if err := cmd.Run(); err != nil {
return err
}
}

fmt.Println("generating grpc protobuf")
args = append([]string{
"--go_out", ".",
Expand Down
25 changes: 25 additions & 0 deletions protobufs/roomrpc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# LiveKit participant RPCs registry (roomrpc)

These protos describe a list of well-known [LiveKit participant RPCs](https://docs.livekit.io/transport/data/rpc/)
and corresponding request/response messages.

## Directory structure

Each participant type or API should have its own directory under `roomrpc` with the name `<type>rpc`
to avoid Go package name collisions and isolate types for each API.

## Versioning

Proto files should follow the name convention: `roomrpc_<type>_v<vers>.proto`. Version is a single sequential number, not a semver.
For example: `roomrpc_sip_v1.proto`.

Corresponding `V<vers>` should be added as a suffix to the service definition and the request/response types
(method name should omit the version, as the versioned service name is part of the method path).

```protobuf
service MyServiceV1 {
rpc DoSomething(DoSomethingV1Request) returns (DoSomethingV1Response);
}
message DoSomethingV1Request {}
message DoSomethingV1Response {}
```
38 changes: 38 additions & 0 deletions protobufs/roomrpc/siprpc/roomrpc_sip_v1.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// Copyright 2026 LiveKit, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

syntax = "proto3";

package livekit;
option go_package = "github.com/livekit/protocol/livekit/roomrpc/siprpc";
option csharp_namespace = "LiveKit.Proto.RoomRPC.SIP";
option ruby_package = "LiveKit::Proto::RoomRPC:SIP";

import "logger/options.proto";

service SIPParticipantV1 {
// RPC: lk.sip.GetRemoteHeaders
rpc GetRemoteHeaders(GetRemoteHeadersV1Request) returns (GetRemoteHeadersV1Response);
}

message GetRemoteHeadersV1Request {
repeated string include = 1; // list of headers to include
repeated string exclude = 2; // list of headers to exclude
}
message GetRemoteHeadersV1Response {
map<string,string> headers = 1 [
(logger.sensitivity) = SENSITIVITY_PII,
(logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
];
}
Loading