Skip to content
Merged
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/ringing-timeout-status.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"github.com/livekit/protocol": patch
"@livekit/protocol": patch
---

Add ringing_timeout_status to SIPInboundTrunkInfo & EvaluateSIPDispatchRulesResponse
280 changes: 145 additions & 135 deletions livekit/livekit_sip.pb.go

Large diffs are not rendered by default.

749 changes: 375 additions & 374 deletions livekit/livekit_sip.twirp.go

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions livekit/sip.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,9 @@ func (p *SIPInboundTrunkInfo) ValidateResult() ValidationResult {
if err := p.Media.Validate(); err != nil {
return ValidationFailure(err)
}
if c := p.RingingTimeoutStatus; c != SIPStatusCode_SIP_STATUS_UNKNOWN && (c < 400 || c > 699) {
return ValidationFailure(psrpc.NewErrorf(psrpc.InvalidArgument, "ringing timeout status must be 4xx-6xx, got %d", c))
}

result := validateHeaders(p.Headers)
if !result.OK() {
Expand Down
24 changes: 24 additions & 0 deletions livekit/sip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,30 @@ func TestSIPValidate(t *testing.T) {
exp: true,
wantSoftErrs: true,
},
{
name: "inbound ringing timeout status",
req: &SIPInboundTrunkInfo{
Numbers: []string{"+1111"},
RingingTimeoutStatus: SIPStatusCode_SIP_STATUS_TEMPORARILY_UNAVAILABLE,
},
exp: true,
},
{
name: "inbound ringing timeout status 2xx",
req: &SIPInboundTrunkInfo{
Numbers: []string{"+1111"},
RingingTimeoutStatus: SIPStatusCode_SIP_STATUS_OK,
},
exp: false,
},
{
name: "inbound ringing timeout status out of range",
req: &SIPInboundTrunkInfo{
Numbers: []string{"+1111"},
RingingTimeoutStatus: SIPStatusCode(700),
},
exp: false,
},
},
"SIPOutboundTrunkInfo": {
{
Expand Down
4 changes: 3 additions & 1 deletion protobufs/livekit_sip.proto
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,8 @@ message SIPInboundTrunkInfo {

// Max time for the caller to wait for track subscription.
google.protobuf.Duration ringing_timeout = 11;
// SIP status code if ringing_timeout elapses. Unset means using system default.
SIPStatusCode ringing_timeout_status = 21;
// Max call duration.
google.protobuf.Duration max_call_duration = 12;

Expand All @@ -372,7 +374,7 @@ message SIPInboundTrunkInfo {
google.protobuf.Timestamp created_at = 17;
google.protobuf.Timestamp updated_at = 18;

// NEXT ID: 21
// NEXT ID: 22
}

message SIPInboundTrunkUpdate {
Expand Down
4 changes: 3 additions & 1 deletion protobufs/rpc/io.proto
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,8 @@ message EvaluateSIPDispatchRulesResponse {

// Max time for the caller to wait for track subscription.
google.protobuf.Duration ringing_timeout = 16;
// SIP status code if ringing_timeout elapses. Unset means using system default.
livekit.SIPStatusCode ringing_timeout_status = 25;
// Max call duration.
google.protobuf.Duration max_call_duration = 17;

Expand All @@ -262,7 +264,7 @@ message EvaluateSIPDispatchRulesResponse {

map<string, string> feature_flags = 23;

// NEXT ID: 25
// NEXT ID: 26
}

message SIPCallObservability {
Expand Down
138 changes: 75 additions & 63 deletions rpc/io.pb.go

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

Loading
Loading