Hi Thomas,

I faced the same issue. looks like some bug with json module.

jansson_get_field("$var(result)", "status", "$var(status)");

 worked for me. It resulted as expected
INFO: <script>: SUCCESS


--
regards,

abdul basit | p: +92 32 1416 4196 | o: +92 30 0841 1445

On 21 February 2018 at 20:41, Thomas Carvello <notifications@github.com> wrote:

Description

Troubleshooting

Reproduction

Hello,
i have an issue with the JSON module .

i have JSON response from a HTTP request to process in my script:

{"status":"SUCCESS"}

i use the command HTTP_query:

http_query("http://xxxxx", "$var(result)");

then i try to parse my result:

json_get_field("$var(result)", "status", "$var(status)");

But when i log my result:
xlog("L_INFO", "$var(status)");

i have a wrong output:

INFO: <script>: "SUCCESS"

double quote is embedded in the string variable which is wrong because this not part of my json value.

Is there any way to fix this behaviour or having a new function in order to retrieve the right value of my json field?

Thank you for your help.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.


_______________________________________________
Kamailio (SER) - Development Mailing List
sr-dev@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev