From c3a66e2a41c4879933cb72d97f583ecef76f2385 Mon Sep 17 00:00:00 2001 From: InnovativeUS <86477631+InnovativeUS@users.noreply.github.com> Date: Tue, 18 Jun 2024 19:08:01 +0100 Subject: [PATCH] fix: honor lr in record route for dialog clients --- dialog_client.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dialog_client.go b/dialog_client.go index f24ab2a..7ce04a7 100644 --- a/dialog_client.go +++ b/dialog_client.go @@ -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()) + } } }