[prev in list] [next in list] [prev in thread] [next in thread]
List: openser-users
Subject: Re: [SR-Users] remove_hf_re error on startup
From: Grant Bagdasarian <gb () cm ! nl>
Date: 2017-06-27 9:30:27
Message-ID: d60f101246d94b02a7cbbef60a13340b () cm ! nl
[Download RAW message or body]
Too bad!
Your workaround works.
I'll use that instead.
Thanks!
-----Original Message-----
From: sr-users [mailto:sr-users-bounces@lists.kamailio.org] On Behalf Of Daniel Tryba
Sent: dinsdag 27 juni 2017 11:09
To: Kamailio (SER) - Users Mailing List <sr-users@lists.kamailio.org>
Subject: Re: [SR-Users] remove_hf_re error on startup
On Tue, Jun 27, 2017 at 08:48:07AM +0000, Grant Bagdasarian wrote:
> I'm trying to remove all custom headers starting with X-, except a
> certain header, but Kamailio won't start due to an error. ERROR:
> <core> [route.c:1154]: fix_actions(): fixing failed (code=-1) at
> cfg:/etc/kamailio/kamailio.cfg:455
>
> remove_hf_re("^(?!X-ThisHeaderShouldNotBeRemoved)X-.*") or
> remove_hf_re("^(?!X- ThisHeaderShouldNotBeRemoved)X-")
>
> This is valid regex according to https://regex101.com/
>
> Any idea's why this won't compile?
Maybe because kamailio uses a regular expression lib that doesn't support this syntax \
(since there is a seperate regex module that supports PCRE it implies the "standard" \
regexes don't).
Easy work around is to remove all X- headers and add them again, something like:
remove_hf_re("^X-");
if(is_present_hf("X-ThisHeaderShouldNotBeRemoved"))
{
append_hf("X-ThisHeaderShouldNotBeRemoved: \
$(hdr(X-ThisHeaderShouldNotBeRemoved))\r\n"); }
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic