Hello,

do you add the route header content manually? Because there is a r2=on but there is a single Route header. The r2=on means that the kamailio added two Record-Route (and thus there have to be 2 Route headers) and it will consume 2 of them. So, just remove r2=on if that is the case.

Cheers,
Daniel

On 05.03.21 16:36, Ilie Soltanici wrote:
Hello,

I have a strange issue here with the Route header not been respected by the Kamailio server.

I'm getting the INVITE from the SBC-1, adding my own RR header (SBC-2), and send it to the SBC-3

This is the Invite I'm sending outside to the SBC-3 Proxy.

```
INVITE sip:+123456789@192.168.1.1:5060 SIP/2.0
Record-Route: <sip:SBC-2:5067;transport=tls;r2=on;ftag=as2b53df6f;lr>
Record-Route: <sip:SBC-1;ftag=as2b53df6f;lr>
```

I'm getting back 200OK with mirrored RR, the call is established successfully.

But, the problem is with the BYE message coming from the SBC-3:

```
BYE sip:+123456789@192.168.1.2:5060 SIP/2.0
ROUTE: <sip:SBC-2:5067;transport=tls;r2=on;ftag=as2b53df6f;lr>,<sip:SBC-1;ftag=as2b53df6f;lr>
```

There are 2 routes within a single header. Afaik, loose_function should remove his own Route header (SBC-2) and forward the message to the next Route (SBC-1), or to the URI if there are not other Routes. But, in my case, for some reason Kamailio on SBC-2 is sending the request directly to the URI, bypassing the SBC-1. 

In the logs I'm getting the following errors:

rr_do_force_send_socket(): no socket found to match second RR (sip:SBC-1)
rr_do_force_send_socket(): second RR uri is not myself (sip:SBC-1)

To enforce the socket I was trying to use 'sn=interface', then I'm not getting anymore this error - but still, Kamailio sends the message directly to the URI, instead of SBC-1. 
Is there anything wrong with my config, or I am missing something with the Route headers?

Kamailio Version: version: kamailio 5.4.4 (x86_64/linux) bdf4e0

Thank you.

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
-- 
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla