Hello Benoit,
the "is_direction" function is indeed the way to go if you just want to get the direction of a request. Its not needed to manually alter Record-Route headers.
The is_direction function only works on requests, not on replies.
Instead of altering the Record-Route header in the replies, what about just ignoring it when you are getting a request from the a-side? Or maybe encode a or b-side in the parameter name etc..
Cheers,
Henning
-----Original Message----- From: Benoît Panizzon via sr-users sr-users@lists.kamailio.org Sent: Friday, December 13, 2024 4:32 PM To: James Browne james@frideo.com Cc: Kamailio (SER) - Users Mailing List sr-users@lists.kamailio.org; Benoît Panizzon benoit.panizzon@imp.ch Subject: [SR-Users] Re: How to remove rr param on a reply?
Hi James
I ended up first using:
$var(rr) = $(hfl(Record-Route){tobody.uri}{uri.param,rr}); to get my rr param I wanted to remove and then the s.rm function from textops.
And as I fear, there is no function to change 'one' header, I ended doing:
remove_hf("Record-Route");
And then re-insert the 'corrected' header in a while loop.
Well thinking about it just now, RR header should be at the beginning of he message, maybe I need to get $hflc and then do a reverse while loop and use insert_hf instead of append_hf
By the way, the rr parameter for adding ftag to the RR header fields can later be used to see which direction (the is_direction() function) the request is going in, so you may not even need to change the Record-Route values if you use that.
I am logging is_direction to find out how it exactly behaves. I also considered using this function but I am not yet sure i fully understand what it does, especially within replies.
-- Mit freundlichen Grüssen
-Benoît Panizzon- @ HomeOffice und normal erreichbar