Skip to content

Commit ad100dd

Browse files
committed
Add Record-Route header for inbound.
1 parent cf8aac7 commit ad100dd

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pkg/sip/inbound.go

+10
Original file line numberDiff line numberDiff line change
@@ -1189,6 +1189,16 @@ func (c *sipInbound) Accept(ctx context.Context, sdpData []byte, headers map[str
11891189
// This will effectively redirect future SIP requests to this server instance (if host address is not LB).
11901190
r.AppendHeader(c.contact)
11911191

1192+
// Other in-dialog requests should be sent to this instance as well.
1193+
recordRoute := c.contact.Address.Clone()
1194+
if recordRoute.UriParams == nil {
1195+
recordRoute.UriParams = sip.HeaderParams{}
1196+
}
1197+
recordRoute.UriParams.Add("lr", "")
1198+
r.PrependHeader(&sip.RecordRouteHeader{
1199+
Address: *recordRoute,
1200+
})
1201+
11921202
c.setDestFromVia(r)
11931203

11941204
r.AppendHeader(&contentTypeHeaderSDP)

0 commit comments

Comments
 (0)