Indeed, as I looked at the code, jansson_get() treats the first parameter as
json-path and `.` is a delimiter there.
With the stable kamailio versions at this moment, up to 5.7.x, you can use json
module which should work with field name, no json-path.
Alternatively, you can use the an embedded scripting language to parse the
json, for example app_jsdt module is offering embedded javascript without any
external dependency and inside it you can use JS function JSON.parse(), then
walk through the structure and set the value of the desired field to a
kamailio.cfg variable.
For the future major stable releases (or if you want to use git master branch
now), I pushed some commits to jansson module to change the function
jansson_get_field() to work only with the field name, leaving jansson_get() to
work with json-path.
I am closing this issue as there are options for stable releases and the
development branch got new code for it in the jansson module.
--
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/3658#issuecomment-1829437174
You are receiving this because you are subscribed to this thread.
Message ID: <kamailio/kamailio/issues/3658/1829437...@github.com>
_______________________________________________
Kamailio (SER) - Development Mailing List
To unsubscribe send an email to sr-dev-le...@lists.kamailio.org