Hello,
I haven't implemented the jansson module, but the docs suggests it supports only path with names:
* https://www.kamailio.org/docs/modules/stable/modules/jansson.html#jansson.f....
I think you can get it with transformations {s.after} and {s.before}. Or use inline execution of a Kemi script that can help with own json parser.
Cheers, Daniel
On 05.04.22 21:12, Barry Flanagan wrote:
Hi
I am trying to use the jannson_get function to pull field "secret" from the below json:
{"3":{"options":{"secret":"mybigsecret"}}}
This works is I use jansson_get("3.options.secret".....
However, I need to know the value of "3" in order to use it. I have tried all the variations on path I can find, but none apart from using the actual root value work for me.
How can I either:
Construct a PATH which will pick this up, or
Obtain this root value ("3" in my example)
I have tried testing using https://jsonpath.com/ and a path of "$..secret" and "$..options.secret" works there, but not in jansson kamailio module.
Any assistance much appreciated.
Thanks
-- -Barry
Kamailio - Users Mailing List - Non Commercial Discussions
- sr-users@lists.kamailio.org
Important: keep the mailing list in the recipients, do not reply only to the sender! Edit mailing list options or unsubscribe: