[SR-Users] JANSSON Delete from JSON

Daniel-Constantin Mierla miconda at gmail.com
Mon Mar 22 10:38:32 CET 2021


Hello,

I haven't looked and jansson module, maybe it needs an extension for it,
if nobody needed the operation so far, but I just want to point that
whenever I needed a bit more complex JSON operations, I just used an
embedded scripting language like javascript (app_jsdt) or lua (app_lua).
You can pass the entire json as a string parameter, transform it, then
serialized it back to a Kamailio variable.

Cheers,
Daniel

On 20.03.21 23:09, Jeremy McNamara wrote:
> Hi Folks - I am using JANSSON to store JSON data in an htable.  How
> does one remove an entire element from a JSON?
>
> I do not see a specific function mentioning clear or remove exposed in
> the Kamailio module, but do see various clear/remove methods in the
> underlying C library. 
>
> Below does set the value of key foo to null.  I would like to remove
> both the key and value of foo. 
>
> jansson_set("null", "$var(foo)", "$var(json)", "$var(result)");
>
>
> Running Kamailio v5.4
> Debian 10
>
>
> -Jeremy 
>
>
> _______________________________________________
> 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/20210322/b8fa45b2/attachment.htm>


More information about the sr-users mailing list