<div dir="ltr"><div><div>Hi Thomas,<br><br></div>I faced the same issue. looks like some bug with json module.<br><br></div>jansson_get_field(<em>"$var(result)", "status", "$var(status)");</em><br><br> worked for me. It resulted as expected <br><i>INFO: <script>: SUCCESS</i><br><br><div><div class="gmail_extra"><br clear="all"><div><div class="gmail-m_3976165580045489715gmail_signature"><div><font size="2"><span style="font-family:verdana,sans-serif"><span style="color:rgb(39,78,19)">--<br>regards,</span></span></font></div><font size="2"><span style="font-family:verdana,sans-serif"><span style="color:rgb(39,78,19)"><br>abdul basit | p: +92 32 1416 4196 | o: +92 30 0841 1445</span></span></font></div></div>
<br><div class="gmail_quote">On 21 February 2018 at 20:41, Thomas Carvello <span dir="ltr"><<a href="mailto:notifications@github.com" target="_blank">notifications@github.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<h3>Description</h3>
<h3>Troubleshooting</h3>
<h4>Reproduction</h4>
<p>Hello,<br>
i have an issue with the JSON module .</p>
<p>i have JSON response from a HTTP request to process in my script:</p>
<p>{"status":"SUCCESS"}</p>
<p>i use the command HTTP_query:</p>
<p><i>http_query("<a href="http://xxxxx" rel="nofollow" target="_blank">http://xxxxx</a>", "$var(result)");</i></p>
<p>then i try to parse my result:</p>
<p><i>json_get_field("$var(result)", "status", "$var(status)");</i></p>
<p>But when i log my result:<br>
<i>xlog("L_INFO", "$var(status)");</i></p>
<p>i have a wrong output:</p>
<p><i>INFO: <script>: "SUCCESS"</i></p>
<p>double quote is embedded in the string variable which is wrong because this not part of my json value.</p>
<p>Is there any way to fix this behaviour or having a new function in order to retrieve the right value of my json field?</p>
<p>Thank you for your help.</p>
<p style="font-size:small;color:rgb(102,102,102)">—<br>You are receiving this because you are subscribed to this thread.<br>Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1452" target="_blank">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZTQBSiU8c6rfeldJdX5ER-bV8dZOks5tXDkmgaJpZM4SN2bQ" target="_blank">mute the thread</a>.<img alt="" src="https://github.com/notifications/beacon/AF36ZXuOz6R2BTEXIcnPw_nraQ-qORbvks5tXDkmgaJpZM4SN2bQ.gif" style="display: none !important;" width="1" height="1"></p>
<div>
<div>
</div>
</div>
<br>______________________________<wbr>_________________<br>
Kamailio (SER) - Development Mailing List<br>
<a href="mailto:sr-dev@lists.kamailio.org" target="_blank">sr-dev@lists.kamailio.org</a><br>
<a href="https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-dev" rel="noreferrer" target="_blank">https://lists.kamailio.org/cgi<wbr>-bin/mailman/listinfo/sr-dev</a><br>
<br></blockquote></div><br></div></div></div>