[OpenSIPS-Users] json module issues
Vlad Paiu
vladpaiu at opensips.org
Tue Jul 8 19:40:56 CEST 2014
Hello,
There have been some recent changes to the JSON module in terms of
parsing the error codes ( some old code got deprecated on versions < 0.9
) and we had to do some compile-time detection of the version of libjson
used ( since the JSON library only exports a version macro starting with
0.10 ), so this might be the source of your issues.
What is the version of the libjson do you currently have installed on
your system ? So far tested with 0.9, 0.10 and 0.12 and does not seem to
replicate.
Best Regards,
Vlad Paiu
OpenSIPS Developer
http://www.opensips-solutions.com
On 08.07.2014 19:57, Kurtis Heimerl wrote:
> I bumped up the debug, seeing this in the logs:
>
> Jul 8 16:51:47 SERVERNAME /usr/sbin/opensips[30188]:
> ERROR:json:pv_set_json: Error parsing json: success
> Jul 8 16:51:47 SERVERNAME /usr/sbin/opensips[30188]:
> ERROR:core:do_assign: setting PV failed
> Jul 8 16:51:47 SERVERNAME /usr/sbin/opensips[30188]:
> ERROR:core:do_assign: error at line: 151
>
> Looks like it thinks the json isn't parsing right, but the config is
> still dead simple...
>
> $json(k) := "[1,2]";
> xlog("L_ERR","Kurtis2 $json(k)");
>
>
>
> On Tue, Jul 8, 2014 at 9:48 AM, Kurtis Heimerl
> <kheimerl at cs.berkeley.edu <mailto:kheimerl at cs.berkeley.edu>> wrote:
>
> 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, Ra(zvan Crainea
> <razvan at opensips.org <mailto: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 <mailto:Users at lists.opensips.org>
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org <mailto: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/97bf7fb0/attachment-0001.htm>
More information about the Users
mailing list