-
Notifications
You must be signed in to change notification settings - Fork 180
TEL-459: route outbound sip traffic through a proxy #643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
4e820ed
ea4572f
5e7a3fa
e079e44
6075ebc
0bf61a2
8467365
88f14a9
8e082a7
ec6b764
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,6 @@ | ||
| package sip | ||
|
|
||
| const signalLoggingFeatureFlag = "sip.signal_logging" | ||
| const ( | ||
| signalLoggingFeatureFlag = "sip.signal_logging" | ||
| outboundRouteHeadersFeatureFlag = "sip.outbound_route_headers" | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -135,6 +135,9 @@ func (c *Client) newCall(ctx context.Context, tid traceid.ID, conf *config.Confi | |
| } | ||
| return AttrsToHeaders(r.LocalParticipant.Attributes(), c.sipConf.attrsToHeaders, headers) | ||
| }) | ||
| if sipConf.featureFlags[outboundRouteHeadersFeatureFlag] == "true" { | ||
| call.cc.routeHeaders = conf.OutboundRouteHeaders | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we should consider putting these URIs to the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, and I think it'll be helpful to do percentage traffic migration there. That being said, feature flag is still useful here if we only want to enable it for UHG, which is our plan. We may need both.. |
||
| } | ||
|
|
||
| call.mon = c.mon.NewCall(stats.Outbound, sipConf.host, sipConf.address) | ||
| var err error | ||
|
|
@@ -769,11 +772,12 @@ func (c *Client) newOutbound(log logger.Logger, id LocalTag, from, contact URI, | |
| } | ||
|
|
||
| type sipOutbound struct { | ||
| log logger.Logger | ||
| c *Client | ||
| id LocalTag | ||
| from *sip.FromHeader | ||
| contact *sip.ContactHeader | ||
| log logger.Logger | ||
| c *Client | ||
| id LocalTag | ||
| from *sip.FromHeader | ||
| contact *sip.ContactHeader | ||
| routeHeaders []string | ||
|
|
||
| mu sync.RWMutex | ||
| tag RemoteTag | ||
|
|
@@ -1038,6 +1042,10 @@ func (c *sipOutbound) attemptInvite(ctx context.Context, callID sip.CallIDHeader | |
| req.AppendHeader(h) | ||
| } | ||
|
|
||
| for _, route := range c.routeHeaders { | ||
| req.PrependHeader(sip.NewHeader("Route", route)) | ||
hechen-eng marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| tx, err := c.c.sipCli.TransactionRequest(req) | ||
| if err != nil { | ||
| return nil, nil, err | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.