<div dir="ltr">Huh. I tried the default json code too (<a href="http://lists.opensips.org/pipermail/devel/2009-September/004177.html">http://lists.opensips.org/pipermail/devel/2009-September/004177.html</a>) <br><br><div> $json(obj1) := "{}"; # initialize an empty JSON object</div>
<div> $json(obj1/key) = "value"; #replace or insert the (key,value)</div><div> #pair into the json object;</div><div> xlog("$json(obj1)"); # print the serialized version of the object </div>
<div><br></div><div>Which still doesn't work (printing null), so something deeply screwed up. </div><div><br></div><div>As far as versions, I'm running 1.11.2-notls (x86_64/linux), according to opensips. This is out of the default opensips debian repo, as is the json module itself. </div>
<div><br></div><div>Anyone have any idea why the json module would be failing like this? It doesn't seem like an issue with my config. </div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 7, 2014 at 11:28 PM, Răzvan Crainea <span dir="ltr"><<a href="mailto:razvan@opensips.org" target="_blank">razvan@opensips.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi, Kurtis!<br>
<br>
I've just run your test and the output seems ok:<br>
Kurtis [ 1, 2 ]<br>
Are you sure there is no other function between those two lines that could delete the json? Also, what version of OpenSIPS are you using?<br>
<br>
Best regards,<br>
<br>
Razvan Crainea<br>
OpenSIPS Core Developer<br>
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<u></u>com</a><div><div class="h5"><br>
<br>
On 07/08/2014 03:01 AM, Kurtis Heimerl wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">
Hey All,<br>
<br>
I seem to be having some very simple issues with the json module. The<br>
following code in my config:<br>
<br>
$json(k) := "[1,2]";<br>
xlog("L_ERR","Kurtis $json(k)");<br>
<br>
Is producing the following output:<br>
<br>
Jul 7 23:59:00 NAME /usr/sbin/opensips[6379]: Kurtis2 <null><br>
<br>
This looks to be as simple as I can get a json command, but I can't<br>
figure out why it's null. Changing the ":=" to a "=" and the "[1,2]" to<br>
a "4" works, but that's just a normal variable. Anyone know what's up?<br>
<br>
Thanks!<br>
<br>
<br></div></div>
______________________________<u></u>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
<br>
</blockquote>
<br>
______________________________<u></u>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<u></u>bin/mailman/listinfo/users</a><br>
</blockquote></div><br></div>