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
845 changes: 504 additions & 341 deletions livekit/livekit_sip.pb.go

Large diffs are not rendered by default.

692 changes: 350 additions & 342 deletions livekit/livekit_sip.twirp.go

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion livekit/sip.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"strconv"
"strings"

"golang.org/x/text/language"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

"github.com/livekit/protocol/utils/xtwirp"
"golang.org/x/text/language"
)

var (
Expand Down Expand Up @@ -1024,3 +1024,13 @@ var (
")", "",
)
)

// MergeEncryption optionally applies SIPMediaEncryption if it's not set on the SIPMediaConfig.
func (m *SIPMediaConfig) MergeEncryption(v SIPMediaEncryption) {
if m == nil {
return
}
if m.Encryption == 0 {
m.Encryption = v
}
}
26 changes: 21 additions & 5 deletions protobufs/livekit_sip.proto
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,19 @@ enum SIPMediaEncryption {
SIP_MEDIA_ENCRYPT_REQUIRE = 2; // require encryption
}

message SIPCodec {
string name = 1;
uint32 rate = 2;
}

message SIPMediaConfig {
// if set, ignore the default codecs and use the list below.
bool only_listed_codecs = 1;
// List of allowed codecs. If only_listed_codecs is not set, this list is added to default codecs.
repeated SIPCodec codecs = 2;
SIPMediaEncryption encryption = 3;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What else might we potentially add here in the future ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Krisp is an obvious one we should move here, although I'm not sure how it should look like. Krisp shouldn't be a flag as it is right now, it's better if we allow user to pick from multiple noise cancellation (or other) models. But that would be a bigger change.

}

message ProviderInfo {
string id = 1;
string name = 2;
Expand Down Expand Up @@ -649,13 +662,14 @@ message SIPDispatchRuleInfo {
// RoomConfiguration to use if the participant initiates the room
RoomConfiguration room_config = 10;

SIPMediaConfig media = 16;
bool krisp_enabled = 11;
SIPMediaEncryption media_encryption = 12;
SIPMediaEncryption media_encryption = 12 [deprecated=true];

google.protobuf.Timestamp created_at = 14;
google.protobuf.Timestamp updated_at = 15;

// NEXT ID: 16
// NEXT ID: 17
}

message SIPDispatchRuleUpdate {
Expand All @@ -670,7 +684,8 @@ message SIPDispatchRuleUpdate {
(logger.redact) = true,
(logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
];
optional SIPMediaEncryption media_encryption = 6;
optional SIPMediaEncryption media_encryption = 6 [deprecated=true];
SIPMediaConfig media = 7;
}

// ListSIPDispatchRuleRequest lists dispatch rules for given filters. If no filters are set, all rules are listed.
Expand Down Expand Up @@ -788,7 +803,8 @@ message CreateSIPParticipantRequest {
// Enable voice isolation for the callee.
bool krisp_enabled = 14;

SIPMediaEncryption media_encryption = 18;
SIPMediaEncryption media_encryption = 18 [deprecated = true];
SIPMediaConfig media = 23;

// Wait for the answer for the call before returning.
bool wait_until_answered = 19;
Expand All @@ -804,7 +820,7 @@ message CreateSIPParticipantRequest {
(logger.redact_format) = "<redacted ({{ .Size }} bytes)>"
];
optional Destination destination = 22;
// NEXT ID: 23
// NEXT ID: 24
}

message SIPParticipantInfo {
Expand Down
5 changes: 3 additions & 2 deletions protobufs/rpc/io.proto
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,12 @@ message EvaluateSIPDispatchRulesResponse {
string room_preset = 20;
livekit.RoomConfiguration room_config = 21;

livekit.SIPMediaEncryption media_encryption = 22;
livekit.SIPMediaEncryption media_encryption = 22 [deprecated = true];
livekit.SIPMediaConfig media = 24;

map<string, string> feature_flags = 23;

// NEXT ID: 24
// NEXT ID: 25
}

message UpdateSIPCallStateRequest {
Expand Down
5 changes: 3 additions & 2 deletions protobufs/rpc/sip.proto
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ message InternalCreateSIPParticipantRequest {
// Max call duration.
google.protobuf.Duration max_call_duration = 24;

livekit.SIPMediaEncryption media_encryption = 28;
livekit.SIPMediaEncryption media_encryption = 28 [deprecated = true];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How widely used is this right now ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just marking it as deprecated so it's easier to update in our codebase. The old parameter will still continue to work as this PR applies it for both forward and backward compatibility.

livekit.SIPMediaConfig media = 34;

// Wait for the answer for the call before returning.
bool wait_until_answered = 29;
Expand All @@ -143,7 +144,7 @@ message InternalCreateSIPParticipantRequest {
// Project-level feature flags from ProjectSettings.FeatureFlags
map<string, string> feature_flags = 33;

// NEXT ID: 34
// NEXT ID: 35
}

message InternalCreateSIPParticipantResponse {
Expand Down
109 changes: 61 additions & 48 deletions rpc/io.pb.go

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

Loading
Loading