Hello,

On 27.11.23 14:04, Benoit Panizzon via sr-users wrote:
Hi List

Two Kamailio Nodes situation.

Node A: Routing Instance.
Node B: Registrar Instance.

An invite is sent from Node A to B.

Customer registered on B is 'busy' as example.

B initiates Call Forwarding by adding a Diversion Header and sending
the Invite back to A with a new R-URI towards the CFB destination.

The Invite sent from B to A still has Node B in it's Record-Route. So
all subsequent SIP messages pass via B, which is not needed and cause
issue with rtpengine running on B.

I attempted to remove_record_route(); when sending the call back to A,
but this causes:

parse_headers(): bad header field [;lr;ftag=3910078620-883101371>

It looks like only the beginning of the RR header is removed leaving
back a competely broken line.

What is the propper was to remove a node from RR and Via routing?

the B should not do record_route() when forwards back INVITE to A.

Via is for routing back replies, if you remove it, node B does retransmissions because it does not receives any response and will also send a failure code at some point.

Alternative is to send 302 or something else back to A, which does the redirect using script operations to fetch the contact address or uac_redirect module.

Cheers, Daniel

-- 
Daniel-Constantin Mierla (@ asipto.com)
twitter.com/miconda -- linkedin.com/in/miconda
Kamailio Consultancy and Development Services
Kamailio Advanced Training -- asipto.com