Skip to content

Support specifying To/From SIP headers for outbound.#702

Open
dennwc wants to merge 1 commit into
mainfrom
outbound-headers
Open

Support specifying To/From SIP headers for outbound.#702
dennwc wants to merge 1 commit into
mainfrom
outbound-headers

Conversation

@dennwc

@dennwc dennwc commented May 26, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@dennwc dennwc force-pushed the outbound-headers branch from 95ed281 to 1707c9b Compare June 9, 2026 11:55
@dennwc dennwc enabled auto-merge (squash) June 9, 2026 12:11

@hechen-eng hechen-eng left a comment

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.

it'll be great if we can add some tests..

Comment thread pkg/sip/outbound.go
Addr: contact.Addr,
Transport: tr,
}

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.

Suggested change

Comment thread pkg/sip/client.go
p := &sip.Uri{Scheme: "sip"}
setUriTransport(p, tr)
if err := esip.ParseUri(raw, p); err != nil {
return nil, psrpc.NewErrorf(psrpc.InvalidArgument, "invalid request URI")

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.

shall we return a plain fmt.Errorf? it'll be wrapped as psrpc error in the caller

Comment thread pkg/sip/client.go
"github.com/frostbyte73/core"
"golang.org/x/exp/maps"

esip "github.com/emiago/sipgo/sip"

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.

we are using both emiago sipgo and livekit sipgo. Do we plan to only rely on one of them?

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.

LK fork just aliases all types/functions we use to upstream ones. The only reason I import upstream here is that we don't have alias for that function/type.

Comment thread pkg/sip/client.go
func buildRawURI(raw string, tr livekit.SIPTransport) (*sip.Uri, error) {
p := &sip.Uri{Scheme: "sip"}
setUriTransport(p, tr)
if err := esip.ParseUri(raw, p); err != nil {

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.

this seems to be a bug since it'll drop what's set in setUriTransport?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants