<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Hello,<br>
      <br>
      There have been some recent changes to the JSON module in terms of
      parsing the error codes ( some old code got deprecated on versions
      &lt; 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. <br>
      <br>
      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.<br>
      <br>
      Best Regards,<br>
      <pre class="moz-signature" cols="72">Vlad Paiu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a> </pre>
      On 08.07.2014 19:57, Kurtis Heimerl wrote:<br>
    </div>
    <blockquote
cite="mid:CACyT-3=HmXTWJSgVgMW4hOPHuRCaxZBa7v7RWyQCeBSu7f7n2g@mail.gmail.com"
      type="cite">
      <div dir="ltr">I bumped up the debug, seeing this in the logs:
        <div><br>
        </div>
        <div>
          <div>Jul &nbsp;8 16:51:47 SERVERNAME /usr/sbin/opensips[30188]:
            ERROR:json:pv_set_json: Error parsing json: success</div>
          <div>Jul &nbsp;8 16:51:47 SERVERNAME /usr/sbin/opensips[30188]:
            ERROR:core:do_assign: setting PV failed</div>
          <div>Jul &nbsp;8 16:51:47 SERVERNAME /usr/sbin/opensips[30188]:
            ERROR:core:do_assign: error at line: 151</div>
        </div>
        <div><br>
        </div>
        <div>Looks like it thinks the json isn't parsing right, but the
          config is still dead simple...</div>
        <div><br>
        </div>
        <div>
          <div>$json(k) := "[1,2]";</div>
          <div>xlog("L_ERR","Kurtis2 $json(k)");</div>
        </div>
        <div><br>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Tue, Jul 8, 2014 at 9:48 AM, Kurtis
          Heimerl <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:kheimerl@cs.berkeley.edu" target="_blank">kheimerl@cs.berkeley.edu</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Huh. I tried the default json code too (<a
                moz-do-not-send="true"
href="http://lists.opensips.org/pipermail/devel/2009-September/004177.html"
                target="_blank">http://lists.opensips.org/pipermail/devel/2009-September/004177.html</a>)&nbsp;<br>
              <br>
              <div>&nbsp; &nbsp;$json(obj1) := "{}"; &nbsp; &nbsp; &nbsp; # initialize an empty
                JSON object</div>
              <div>&nbsp; &nbsp;$json(obj1/key) = "value"; #replace or insert the
                (key,value)</div>
              <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; #pair into the json
                object;</div>
              <div>&nbsp; &nbsp;xlog("$json(obj1)"); &nbsp; &nbsp; &nbsp; # print the serialized
                version of the object &nbsp;&nbsp;</div>
              <div><br>
              </div>
              <div>Which still doesn't work (printing null), so
                something deeply screwed up.&nbsp;</div>
              <div><br>
              </div>
              <div>As far as versions, I'm running&nbsp;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.&nbsp;</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.&nbsp;</div>
            </div>
            <div class="HOEnZb">
              <div class="h5">
                <div class="gmail_extra"><br>
                  <br>
                  <div class="gmail_quote">On Mon, Jul 7, 2014 at 11:28
                    PM, R&#259;zvan Crainea <span dir="ltr">&lt;<a
                        moz-do-not-send="true"
                        href="mailto:razvan@opensips.org"
                        target="_blank">razvan@opensips.org</a>&gt;</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 moz-do-not-send="true"
                        href="http://www.opensips-solutions.com"
                        target="_blank">http://www.opensips-solutions.com</a>
                      <div>
                        <div><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>
                            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 &nbsp;7 23:59:00 NAME
                            /usr/sbin/opensips[6379]: Kurtis2
                            &lt;null&gt;<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 &nbsp;":="
                            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>
                        _______________________________________________<br>
                        Users mailing list<br>
                        <a moz-do-not-send="true"
                          href="mailto:Users@lists.opensips.org"
                          target="_blank">Users@lists.opensips.org</a><br>
                        <a moz-do-not-send="true"
                          href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                          target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                        <br>
                      </blockquote>
                      <br>
                      _______________________________________________<br>
                      Users mailing list<br>
                      <a moz-do-not-send="true"
                        href="mailto:Users@lists.opensips.org"
                        target="_blank">Users@lists.opensips.org</a><br>
                      <a moz-do-not-send="true"
                        href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                        target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                    </blockquote>
                  </div>
                  <br>
                </div>
              </div>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>