[SR-Users] via header not removed wit hremove_hf()

Henning Westerholt hw at skalatan.de
Tue Sep 7 15:05:08 CEST 2021


Hello,

please have a look here http://www.kamailio.org/wiki/tutorials/faq/main#why_changes_made_to_headers_or

Cheers,

Henning

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

From: sr-users <sr-users-bounces at lists.kamailio.org> On Behalf Of Richard Robson
Sent: Tuesday, September 7, 2021 2:10 PM
To: Kamailio (SER) - Users Mailing List <sr-users at lists.kamailio.org>
Subject: [SR-Users] via header not removed wit hremove_hf()


during testing I need to remove a Via header

This is the code snippet

route[REPLACE_VIA] {
    xlog ("L_INFO", "[REPLACE_VIA] Start of block\n");
    xlog ("L_INFO", "[REPLACE_VIA] $hdrc(Via) Via headers\n");
        if(remove_hf("Via")) {
                xlog ("L_INFO", "[REPLACE_VIA] removed Via\n");
        }
        else {
                xlog ("L_INFO", "[REPLACE_VIA] did not remove Via\n");
        }
    xlog ("L_INFO", "[REPLACE_VIA] $hdrc(Via) Via headers\n");


and this is the logs output

Sep  7 08:00:00 INFO: _LOG: 3a547f956d65fe985ba189916047fc320ae150ad: [REPLACE_RURI] Start of block
Sep  7 08:00:00 INFO: _LOG: 3a547f956d65fe985ba189916047fc320ae150ad: [REPLACE_VIA] Start of block
Sep  7 08:00:00 INFO: _LOG: 3a547f956d65fe985ba189916047fc320ae150ad: [REPLACE_VIA] 1 Via headers
Sep  7 08:00:00 INFO: _LOG: 3a547f956d65fe985ba189916047fc320ae150ad: [REPLACE_VIA] removed Via
Sep  7 08:00:00 INFO: _LOG: 3a547f956d65fe985ba189916047fc320ae150ad: [REPLACE_VIA] 1 Via headers

From the logs it looks like the remove_hf returns true and we have the header removed, but its still counting the Via header and the Via Header is still present when the INVIE is releyed on
 Regards,

Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20210907/74f301ae/attachment.htm>


More information about the sr-users mailing list