Skip to content

Commit 37390a8

Browse files
committed
Allow passing ClientParams to SIP RPC client.
1 parent 0a3efbf commit 37390a8

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

.changeset/sip-client-params.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"github.com/livekit/protocol": patch
3+
---
4+
5+
Allow passing ClientParams to SIP RPC client.

rpc/sip_client.go

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@
1414

1515
package rpc
1616

17-
import (
18-
"github.com/livekit/psrpc"
19-
)
17+
import "github.com/livekit/psrpc"
2018

2119
type SIPClient interface {
2220
SIPInternalClient
@@ -27,11 +25,16 @@ type sipClient struct {
2725
}
2826

2927
func NewSIPClient(bus psrpc.MessageBus) (SIPClient, error) {
30-
if bus == nil {
28+
return NewSIPClientWithParams(ClientParams{Bus: bus})
29+
}
30+
31+
func NewSIPClientWithParams(params ClientParams) (SIPClient, error) {
32+
if params.Bus == nil {
3133
return nil, nil
3234
}
35+
opts := params.Options()
3336

34-
internalClient, err := NewSIPInternalClient(bus)
37+
internalClient, err := NewSIPInternalClient(params.Bus, opts...)
3538
if err != nil {
3639
return nil, err
3740
}

0 commit comments

Comments
 (0)