[SR-Users] Using variables in remove_hf
Daniel-Constantin Mierla
miconda at gmail.com
Wed May 27 08:30:19 CEST 2020
Hello,
I checked the code and the parameter has to be a static string, not
variables. Probably it works because the pointer of the evaluated
variable maps over the pointer where the static string would be
referenced in the internal function param structure. But it can have
side effects.
We can eventually add a function to support variables in the parameter.
With the current stable release, the solution is using an embedded
interpreter, like app_jsdt:
jsdt_dostring('KSR.hdr.remove("$var(x)")');
Cheers,
Daniel
On 27.05.20 01:04, Cinthia Leung wrote:
> Hi,
>
> I'm trying to use this textops function with a variable, ie
> remove_hf($var(x)). I know the documentation does not explicitly say
> that variables are allowed, but it works.
>
> However, it's throwing the following error:
> textops [textops.c:3431]: hname_fixup(): using hdr type name
> <P-Top-Secret>
> <core> [core/mem/q_malloc.c:487]: qm_free(): WARNING: free(0) called
> from core: core/action.c: do_action(1132)
>
> Is it something you'd highly recommend against doing? Thanks.
>
>
> Cindy
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
--
Daniel-Constantin Mierla -- www.asipto.com
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Funding: https://www.paypal.me/dcmierla
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20200527/1127ee9e/attachment.html>
More information about the sr-users
mailing list