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@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