Skip to content

Commit 66ffa01

Browse files
authored
Use protocol helper for getting SIP status. (#627)
1 parent 7c461bb commit 66ffa01

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/gorilla/websocket v1.5.3
1313
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1
1414
github.com/livekit/mediatransportutil v0.0.0-20241220010243-a2bdee945564
15-
github.com/livekit/protocol v1.36.1
15+
github.com/livekit/protocol v1.36.2-0.20250408143132-c193b8d080da
1616
github.com/magefile/mage v1.15.0
1717
github.com/pion/dtls/v3 v3.0.6
1818
github.com/pion/interceptor v0.1.37
@@ -25,7 +25,6 @@ require (
2525
go.uber.org/atomic v1.11.0
2626
golang.org/x/crypto v0.36.0
2727
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394
28-
google.golang.org/grpc v1.71.1
2928
google.golang.org/protobuf v1.36.6
3029
)
3130

@@ -78,5 +77,6 @@ require (
7877
golang.org/x/text v0.23.0 // indirect
7978
google.golang.org/genproto/googleapis/api v0.0.0-20250324211829-b45e905df463 // indirect
8079
google.golang.org/genproto/googleapis/rpc v0.0.0-20250324211829-b45e905df463 // indirect
80+
google.golang.org/grpc v1.71.1 // indirect
8181
gopkg.in/yaml.v3 v3.0.1 // indirect
8282
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,8 @@ github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1 h1:jm09419p0lqTkD
9191
github.com/livekit/mageutil v0.0.0-20230125210925-54e8a70427c1/go.mod h1:Rs3MhFwutWhGwmY1VQsygw28z5bWcnEYmS1OG9OxjOQ=
9292
github.com/livekit/mediatransportutil v0.0.0-20241220010243-a2bdee945564 h1:GX7KF/V9ExmcfT/2Bdia8aROjkxrgx7WpyH7w9MB4J4=
9393
github.com/livekit/mediatransportutil v0.0.0-20241220010243-a2bdee945564/go.mod h1:36s+wwmU3O40IAhE+MjBWP3W71QRiEE9SfooSBvtBqY=
94-
github.com/livekit/protocol v1.36.1 h1:0cShRQxZQBQ/VquXrQRVD0qFwD84/7pffAN5dQM55Iw=
95-
github.com/livekit/protocol v1.36.1/go.mod h1:WrT/CYRxtMNOVUjnIPm5OjWtEkmreffTeE1PRZwlRg4=
94+
github.com/livekit/protocol v1.36.2-0.20250408143132-c193b8d080da h1:KZ2almsG7lNk0/4FhpLEuX5JOq5QVh8eCVhfsf4821M=
95+
github.com/livekit/protocol v1.36.2-0.20250408143132-c193b8d080da/go.mod h1:WrT/CYRxtMNOVUjnIPm5OjWtEkmreffTeE1PRZwlRg4=
9696
github.com/livekit/psrpc v0.6.1-0.20250205181828-a0beed2e4126 h1:fzuYpAQbCid7ySPpQWWePfQOWUrs8x6dJ0T3Wl07n+Y=
9797
github.com/livekit/psrpc v0.6.1-0.20250205181828-a0beed2e4126/go.mod h1:X5WtEZ7OnEs72Fi5/J+i0on3964F1aynQpCalcgMqRo=
9898
github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg=

sipclient.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"github.com/livekit/protocol/livekit"
2323
"github.com/livekit/protocol/utils/xtwirp"
2424
"github.com/twitchtv/twirp"
25-
"google.golang.org/grpc/status"
2625
"google.golang.org/protobuf/types/known/emptypb"
2726
)
2827

@@ -315,14 +314,5 @@ func (s *SIPClient) TransferSIPParticipant(ctx context.Context, in *livekit.Tran
315314

316315
// SIPStatusFrom unwraps an error and returns associated SIP call status, if any.
317316
func SIPStatusFrom(err error) *livekit.SIPStatus {
318-
st, ok := status.FromError(err)
319-
if !ok {
320-
return nil
321-
}
322-
for _, d := range st.Details() {
323-
if e, ok := d.(*livekit.SIPStatus); ok {
324-
return e
325-
}
326-
}
327-
return nil
317+
return livekit.SIPStatusFrom(err)
328318
}

0 commit comments

Comments
 (0)