Skip to content

Commit

Permalink
Add ringing timeout and max call duration setting for SIP. (#844)
Browse files Browse the repository at this point in the history
* Add ringing timeout and max call duration setting for SIP.

* generated protobuf

---------

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
dennwc and github-actions[bot] authored Oct 10, 2024
1 parent 9081e96 commit 19b686d
Show file tree
Hide file tree
Showing 12 changed files with 973 additions and 799 deletions.
6 changes: 6 additions & 0 deletions .changeset/perfect-bats-share.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@livekit/protocol": minor
"github.com/livekit/protocol": minor
---

Add ringing timeout and max call duration setting for SIP.
829 changes: 445 additions & 384 deletions livekit/livekit_sip.pb.go

Large diffs are not rendered by default.

235 changes: 120 additions & 115 deletions livekit/livekit_sip.twirp.go

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion protobufs/livekit_sip.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ option csharp_namespace = "LiveKit.Proto";
option ruby_package = "LiveKit::Proto";

import "google/protobuf/empty.proto";
import "google/protobuf/duration.proto";

/*
LiveKit's SIP API is built with 3 high level primitives
Expand Down Expand Up @@ -188,6 +189,11 @@ message SIPInboundTrunkInfo {
map<string, string> headers = 9;
// Map SIP X-* headers from INVITE to SIP participant attributes.
map<string, string> headers_to_attributes = 10;

// Max time for the caller to wait for track subscription.
google.protobuf.Duration ringing_timeout = 11;
// Max call duration.
google.protobuf.Duration max_call_duration = 12;
}

message CreateSIPOutboundTrunkRequest {
Expand Down Expand Up @@ -401,7 +407,12 @@ message CreateSIPParticipantRequest {
// If true, a random value for identity will be used and numbers will be omitted from attributes.
bool hide_phone_number = 10;

// NEXT ID: 11
// Max time for the callee to answer the call.
google.protobuf.Duration ringing_timeout = 11;
// Max call duration.
google.protobuf.Duration max_call_duration = 12;

// NEXT ID: 13
}

message SIPParticipantInfo {
Expand Down
9 changes: 8 additions & 1 deletion protobufs/rpc/io.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ option go_package = "github.com/livekit/protocol/rpc";
import "livekit_egress.proto";
import "livekit_ingress.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/duration.proto";

service IOInfo {
// egress
Expand Down Expand Up @@ -167,7 +168,13 @@ message EvaluateSIPDispatchRulesResponse {
map<string, string> headers_to_attributes = 14;

repeated SIPFeature enabled_features = 15;
// NEXT ID: 16

// Max time for the caller to wait for track subscription.
google.protobuf.Duration ringing_timeout = 16;
// Max call duration.
google.protobuf.Duration max_call_duration = 17;

// NEXT ID: 18
}

enum SIPFeature {
Expand Down
8 changes: 7 additions & 1 deletion protobufs/rpc/sip.proto
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package rpc;
option go_package = "github.com/livekit/protocol/rpc";

import "google/protobuf/empty.proto";
import "google/protobuf/duration.proto";
import "options.proto";
import "livekit_sip.proto";

Expand Down Expand Up @@ -81,7 +82,12 @@ message InternalCreateSIPParticipantRequest {
map<string, string> headers = 21;
map<string, string> headers_to_attributes = 22;

// NEXT ID: 23
// Max time for the callee to answer the call.
google.protobuf.Duration ringing_timeout = 23;
// Max call duration.
google.protobuf.Duration max_call_duration = 24;

// NEXT ID: 25
}

message InternalCreateSIPParticipantResponse {
Expand Down
237 changes: 135 additions & 102 deletions rpc/io.pb.go

Large diffs are not rendered by default.

172 changes: 88 additions & 84 deletions rpc/io.psrpc.go

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions rpc/sip.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@ func NewCreateSIPParticipantRequest(
PlayRingtone: req.PlayRingtone,
Headers: trunk.Headers,
HeadersToAttributes: trunk.HeadersToAttributes,
RingingTimeout: req.RingingTimeout,
MaxCallDuration: req.MaxCallDuration,
}, nil
}
159 changes: 96 additions & 63 deletions rpc/sip.pb.go

Large diffs are not rendered by default.

100 changes: 52 additions & 48 deletions rpc/sip.psrpc.go

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

2 changes: 2 additions & 0 deletions sip/sip.go
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,8 @@ func EvaluateDispatchRule(projectID string, trunk *livekit.SIPInboundTrunkInfo,
if trunk != nil {
resp.Headers = trunk.Headers
resp.HeadersToAttributes = trunk.HeadersToAttributes
resp.RingingTimeout = trunk.RingingTimeout
resp.MaxCallDuration = trunk.MaxCallDuration
}
return resp, nil
}

0 comments on commit 19b686d

Please sign in to comment.