Skip to content

Commit

Permalink
Merge branch 'emiago:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
InnovativeUS authored Jun 20, 2024
2 parents 4b89c68 + cbd22c0 commit d3dee7e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion dialog_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,13 @@ func (s *DialogClientSession) TransactionRequest(ctx context.Context, req *sip.R
}

if rr := s.InviteResponse.RecordRoute(); rr != nil {
req.SetDestination(rr.Address.HostPort())
if rr.Address.UriParams.Has("lr") {
req.AppendHeader(&sip.RouteHeader{
Address: rr.Address,
})
} else {
req.SetDestination(rr.Address.HostPort())
}
}
}

Expand Down
4 changes: 2 additions & 2 deletions sip/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,8 @@ func NewAckRequest(inviteRequest *Request, inviteResponse *Response, body []byte
// https://datatracker.ietf.org/doc/html/rfc2543#section-6.29
hdrs := inviteResponse.GetHeaders("Record-Route")
for i := len(hdrs) - 1; i >= 0; i-- {
h := hdrs[i].headerClone()
ackRequest.AppendHeader(h)
recordRoute := hdrs[i]
ackRequest.AppendHeader(NewHeader("Route", recordRoute.Value()))
}
}

Expand Down

0 comments on commit d3dee7e

Please sign in to comment.