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

Henning Westerholt hw at gilawa.com
Tue Aug 9 21:59:28 CEST 2022


Hello,

the Via header is a bit of a special one, as its obviously also added from the Kamailio server during relay or other operations. This might interfere with the textops remove_hf operation.

What is your goal that you want to achieve? There might be another way to doing it.

Cheers,

Henning

-- 
Henning Westerholt - https://skalatan.de/blog/
Kamailio services - https://gilawa.com

-----Original Message-----
From: sr-users <sr-users-bounces at lists.kamailio.org> On Behalf Of Bernd Krueger-Knauber
Sent: Tuesday, August 9, 2022 2:39 PM
To: sr-users at lists.kamailio.org
Subject: [SR-Users] remove_hf() does not remove the complete line

Hi,

I tried to remove a Via header line with:

remove_hf("Via");

Original I have this 2 lines:

Via: SIP/2.0/TCP
xxx.xxx.xxx.xxx;branch=z9hG4bK370b.21720bb33c4f8264fde4e7994d288a57.0;i
Via: SIP/2.0/TCP
yyy.yyy.yyy.yyy:53967;received=yyy.yyy.yyy.yyy;rport=53967;branch=z9hG4bKPjxb0bdb2c9624076815f12937cc9e51d;alias

If I insert remove_hf("Via"); in the cfg, I get:

Via: SIP/2.0/TCP
xxx.xxx.xxx.xxx;branch=z9hG4bK370b.21720bb33c4f8264fde4e7994d288a57.0;i
;received=yyy.yyy.yyy.yyy;rport=53967;branch=z9hG4bKPjxb0bdb2c9624076815f12937cc9e51d;alias

Doesn't mattter if the command make sense or not, the result, in my opinion, is wrong.
The INVITE packet has now an invalid header line.

Any ideas?

version: kamailio 5.6.1 (x86_64/linux)

Best regards,

Bernd



__________________________________________________________
Kamailio - Users Mailing List - Non Commercial Discussions
  * 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



More information about the sr-users mailing list