Hi Benoît
The is_direction function works by checking the From tag in the From header and comparing it to the From tag in the Route header field. Mid-dialog requests that are in the opposite direction (from that of the original INVITE) have the To and From values swapped, so it's possible to tell from the Route header fields whether the mid-dialog request is from A to B or from B to A.
Anyway, getting the parameter, removing it, and then rebuilding the Route header fields may work for you. I don't think I'd use that, but it might work for you. You also need to be careful to not affect Route values that other proxy servers might have added. I didn't consider that in my first reply.
James
On Fri, 13 Dec 2024 at 15:32, Benoît Panizzon benoit.panizzon@imp.ch wrote:
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
I m p r o W a r e A G - Leiter Commerce Kunden ______________________________________________________
Zurlindenstrasse 29 Tel +41 61 826 93 00 CH-4133 Pratteln Fax +41 61 826 93 01 Schweiz Web http://www.imp.ch ______________________________________________________