[OpenSIPS-Users] json module issues

Kurtis Heimerl kheimerl at cs.berkeley.edu
Tue Jul 8 18:48:07 CEST 2014


Huh. I tried the default json code too (
http://lists.opensips.org/pipermail/devel/2009-September/004177.html)

   $json(obj1) := "{}";       # initialize an empty JSON object
   $json(obj1/key) = "value"; #replace or insert the (key,value)
                              #pair into the json object;
   xlog("$json(obj1)");       # print the serialized version of the object


Which still doesn't work (printing null), so something deeply screwed up.

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.

Anyone have any idea why the json module would be failing like this? It
doesn't seem like an issue with my config.


On Mon, Jul 7, 2014 at 11:28 PM, Răzvan Crainea <razvan at opensips.org> wrote:

> Hi, Kurtis!
>
> I've just run your test and the output seems ok:
> Kurtis [ 1, 2 ]
> 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?
>
> Best regards,
>
> Razvan Crainea
> OpenSIPS Core Developer
> http://www.opensips-solutions.com
>
>
> On 07/08/2014 03:01 AM, Kurtis Heimerl wrote:
>
>> Hey All,
>>
>> I seem to be having some very simple issues with the json module. The
>> following code in my config:
>>
>> $json(k) := "[1,2]";
>> xlog("L_ERR","Kurtis $json(k)");
>>
>> Is producing the following output:
>>
>> Jul  7 23:59:00 NAME /usr/sbin/opensips[6379]: Kurtis2 <null>
>>
>> This looks to be as simple as I can get a json command, but I can't
>> figure out why it's null. Changing the  ":=" to a "=" and the "[1,2]" to
>> a "4" works, but that's just a normal variable. Anyone know what's up?
>>
>> Thanks!
>>
>>
>> _______________________________________________
>> Users mailing list
>> Users at lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20140708/a501c21d/attachment.htm>


More information about the Users mailing list