Skip to content

Commit 409558f

Browse files
authored
Add media encryption options. (#892)
1 parent 64b40bd commit 409558f

File tree

12 files changed

+1181
-978
lines changed

12 files changed

+1181
-978
lines changed

.changeset/healthy-poets-tan.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@livekit/protocol": minor
3+
"github.com/livekit/protocol": minor
4+
---
5+
6+
Add media encryption options for SIP.

livekit/livekit_sip.pb.go

Lines changed: 575 additions & 454 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

livekit/livekit_sip.twirp.go

Lines changed: 168 additions & 162 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

protobufs/livekit_sip.proto

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,12 @@ enum SIPHeaderOptions {
118118
SIP_ALL_HEADERS = 2; // map all headers to sip.h.* attributes
119119
}
120120

121+
enum SIPMediaEncryption {
122+
SIP_MEDIA_ENCRYPT_DISABLE = 0; // do not enable encryption
123+
SIP_MEDIA_ENCRYPT_ALLOW = 1; // use encryption if available
124+
SIP_MEDIA_ENCRYPT_REQUIRE = 2; // require encryption
125+
}
126+
121127
message SIPTrunkInfo {
122128
option deprecated = true;
123129

@@ -215,8 +221,9 @@ message SIPInboundTrunkInfo {
215221
google.protobuf.Duration max_call_duration = 12;
216222

217223
bool krisp_enabled = 13;
224+
SIPMediaEncryption media_encryption = 16;
218225

219-
// NEXT ID: 16
226+
// NEXT ID: 17
220227
}
221228

222229
message CreateSIPOutboundTrunkRequest {
@@ -263,7 +270,9 @@ message SIPOutboundTrunkInfo {
263270
// lowercase header names should be used, for example: sip.h.x-custom-header.
264271
SIPHeaderOptions include_headers = 12;
265272

266-
// NEXT ID: 13
273+
SIPMediaEncryption media_encryption = 13;
274+
275+
// NEXT ID: 14
267276
}
268277

269278
message GetSIPInboundTrunkRequest {
@@ -417,7 +426,10 @@ message SIPDispatchRuleInfo {
417426

418427
// RoomConfiguration to use if the participant initiates the room
419428
RoomConfiguration room_config = 10;
420-
// NEXT ID: 11
429+
430+
bool krisp_enabled = 11;
431+
SIPMediaEncryption media_encryption = 12;
432+
// NEXT ID: 13
421433
}
422434

423435
// ListSIPDispatchRuleRequest lists dispatch rules for given filters. If no filters are set, all rules are listed.
@@ -491,8 +503,10 @@ message CreateSIPParticipantRequest {
491503
google.protobuf.Duration max_call_duration = 12;
492504

493505
// Enable voice isolation for the callee.
494-
bool enable_krisp = 14;
495-
// NEXT ID: 18
506+
bool krisp_enabled = 14;
507+
508+
SIPMediaEncryption media_encryption = 18;
509+
// NEXT ID: 19
496510
}
497511

498512
message SIPParticipantInfo {

protobufs/rpc/io.proto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,9 @@ message EvaluateSIPDispatchRulesResponse {
193193
string room_preset = 20;
194194
livekit.RoomConfiguration room_config = 21;
195195

196-
// NEXT ID: 22
196+
livekit.SIPMediaEncryption media_encryption = 22;
197+
198+
// NEXT ID: 23
197199
}
198200

199201
message UpdateSIPCallStateRequest {

protobufs/rpc/sip.proto

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ message InternalCreateSIPParticipantRequest {
9999
// Max call duration.
100100
google.protobuf.Duration max_call_duration = 24;
101101

102-
// NEXT ID: 28
102+
livekit.SIPMediaEncryption media_encryption = 28;
103+
104+
// NEXT ID: 29
103105
}
104106

105107
message InternalCreateSIPParticipantResponse {

rpc/io.pb.go

Lines changed: 130 additions & 116 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rpc/io.psrpc.go

Lines changed: 98 additions & 95 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rpc/sip.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,13 @@ func NewCreateSIPParticipantRequest(
5050
}
5151

5252
var features []livekit.SIPFeature
53-
if req.EnableKrisp {
53+
if req.KrispEnabled {
5454
features = append(features, livekit.SIPFeature_KRISP_ENABLED)
5555
}
56+
enc := trunk.MediaEncryption
57+
if req.MediaEncryption != 0 {
58+
enc = req.MediaEncryption
59+
}
5660

5761
headers := trunk.Headers
5862
if len(req.Headers) != 0 {
@@ -96,6 +100,7 @@ func NewCreateSIPParticipantRequest(
96100
EnabledFeatures: features,
97101
RingingTimeout: req.RingingTimeout,
98102
MaxCallDuration: req.MaxCallDuration,
103+
MediaEncryption: enc,
99104
}, nil
100105
}
101106

rpc/sip.pb.go

Lines changed: 97 additions & 82 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)