[SR-Users] remove_hf() does not remove the complete line

Kaufman bkaufman at bcmone.com
Thu Aug 11 16:01:36 CEST 2022


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 at lists.kamailio.org> On Behalf Of Federico Cabiddu
Sent: Thursday, August 11, 2022 6:31 AM
To: Kamailio (SER) - Users Mailing List <sr-users at 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 at ednt.de<mailto:bkk at 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%2F%2Fwww.ednt.de%2F&data=05%7C01%7Cbkaufman%40bcmone.com%7C6f4c1458c1e94ec20e3208da7b8d21af%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637958143348606038%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=B8QM%2BsRxyJNn6vRa8UnQEDs2bcfW1u4eaPdCOLGWVZY%3D&reserved=0>

Registergericht: Darmstadt
Registernummer: 24972

Geschäftsführerin: Kerstin Knapp



__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * sr-users at lists.kamailio.org<mailto:sr-users at 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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.kamailio.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fsr-users&data=05%7C01%7Cbkaufman%40bcmone.com%7C6f4c1458c1e94ec20e3208da7b8d21af%7Cafc1818e7b6848568913201b9396c4fc%7C1%7C0%7C637958143348762293%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=vu1h6sAfgkNhcEHeBveSNyI%2BHV3c6OpYGzr7Fo6NgMo%3D&reserved=0>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20220811/0058d443/attachment.htm>


More information about the sr-users mailing list