I think I found the reason why I can't remove headers.
http://lists.sip-router.org/pipermail/users/2007-June/011714.html
This article says you can't remove headers which have been set in request_route. All
my headers are set in custom route. Some of them need to be modified later, for example in
failure_route.
Could someone explain to me what the branch_routes are used for? Does it have to do with
forking?
-----Original Message-----
From: sr-users-bounces(a)lists.sip-router.org [mailto:sr-users-bounces@lists.sip-router.org]
On Behalf Of Grant Bagdasarian
Sent: Thursday, October 3, 2013 9:11 AM
To: Klaus Darilion; Kamailio (SER) - Users Mailing List
Subject: Re: [SR-Users] Replace header value in failure_route
Hello Klaus,
No, removing the header doesn't work either.
Appending it does, but then I get to X-Dispatcher headers. The second one with the correct
value.
The regex, or any other way would be nice to have, because I've tried every function
in textops and textopsx. The remove functions don't work. Same applies to the subst
functions, but I'm assuming I'm doing something wrong there.
Regards,
Grant
-----Original Message-----
From: Klaus Darilion [mailto:klaus.mailinglists@pernau.at]
Sent: Wednesday, October 2, 2013 9:13 PM
To: Kamailio (SER) - Users Mailing List
Cc: Grant Bagdasarian
Subject: Re: [SR-Users] Replace header value in failure_route
Do you need the regex?
Does remove/append_hf work? eg:
remove_hf("X-Dispatcher");
append_hf("X-Dispatcher: $(avp(dsattrs){param.value,dispatcher})");
regards
klaus
On 02.10.2013 15:55, Grant Bagdasarian wrote:
Hello,
I'm trying to replace the value of a custom header in the
failure_route, using the subst function.
subst('/^X-Dispatcher:(.+)$/"X-Dispatcher:
\$(avp(dsattrs){param.value,dispatcher})"/i');
I also tried it with the subst_hf, but that didn't work either.
I'm getting the following message:
5(19536) DEBUG: <core> [re.c:454]: subst_run(): subst_run: running.
r=1
5(19536) DEBUG: textops [textops.c:681]: subst_f(): lst was (nil)
Does anyone have an idea what I'm doing wrong here? I'm not a regex
expert, so I'm guessing there is an error in the pattern.
Regards,
Grant
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing
list sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users(a)lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users