I would argue that this is the documented behavior. The topmost via: is added during
message assembly, and remove_hf() acts against the *received* message. The behavior of
this is along the lines of:
append_hf("X-Fake-Header: Foo");
remove_hf("X-Fake-Header");
I don't think that the reason it can't be removed in the manner requested has to
do directly with RFC compliance, but rather the way Kamailio's architecture processes
messages. Could we have more clarification and better documentation around this fact?
Sure. Is it a bug? Since Kamailio's reason for being is to function as a SIP proxy,
and proper insertion of the Via: header is usually critical to that function it
wouldn't seem so.
Kaufman
From: sr-users <sr-users-bounces(a)lists.kamailio.org> On Behalf Of Federico Cabiddu
Sent: Thursday, August 11, 2022 6:31 AM
To: Kamailio (SER) - Users Mailing List <sr-users(a)lists.kamailio.org>
Subject: Re: [SR-Users] remove_hf() does not remove the complete line
Hi Bernd,
as I said I am using it to remove Via headers inserted by previous hops since years with
no issue.
Cheers,
Federico
On Thu, Aug 11, 2022 at 1:10 PM Bernd Krueger-Knauber
<bkk@ednt.de<mailto:bkk@ednt.de>> wrote:
Hi,
if I remove only 1 of 2 it is not against the standard, because one Via
header line is still inside.
But if I modify the documentation I would write:
"Attention: it is not working with a Via header field"
Then everyone thinks: ok, that is the only point where it will not work.
But how can I, as not a kamailio programmer, can know if this is really
the only case?
So I would also write something which is not 100% correct.
This has to be done by a guy who knows this, and not by me as a kamailio
learner.
Best regards,
Bernd
Am 11.08.2022 um 12:56 schrieb Henning Westerholt:
Hi Bernd,
The Via header is mandatory according to RFC 3261, section 20, in Requests:
Header field where proxy ACK BYE CAN INV OPT REG
___________________________________________________________________
[..]
Via R amr m m m m m m
You are asking Kamailio to do something that is against the standard. So, some people
might expect that it's not working in this case, and I personally would not call it a
Bug.
Documentation would be never fully complete for a complex software like Kamailio, sure.
You could open a feature request or (even better) a pull request to improve the
documentation for the textops module in the Kamailio github.
Cheers,
Henning
--
EDNT GmbH
Werner-von-Siemens-Strasse 7
64625 Bensheim
www.ednt.de<https://nam11.safelinks.protection.outlook.com/?url=http%3A%…
Registergericht: Darmstadt
Registernummer: 24972
Geschäftsführerin: Kerstin Knapp
__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
* sr-users@lists.kamailio.org<mailto:sr-users@lists.kamailio.org>
Important: keep the mailing list in the recipients, do not reply only to the sender!
Edit mailing list options or unsubscribe:
*
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users<https://nam…