Bogdan,<div>I&#39;m going to see if I can reproduce it.. I&#39;ll let you know what I find.</div><div> </div><div><br></div><div>Thanks,</div><div>Brett</div><div><br><div><br><div class="gmail_quote">On Fri, Jan 25, 2013 at 6:15 AM, Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@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"><u></u>

  
    
  
  <div bgcolor="#ffffff" text="#000000">
    <tt>Hi Brett,<br>
      <br>
      The missing value warning is fixed on SVN.<br>
      <br>
      I was also trying to fix the concat issue, but not able to
      reproduce it. I tried 2 different cases:<br>
      <br>
          $json(var1) := &#39;{&quot;string1&quot;:&quot;String1data&quot;}&#39;;<br>
          $json(var2) := &#39;{&quot;string2&quot;:&quot;String2data&quot;}&#39;;<br>
      <br>
          $avp(result) = $json(var1/string1) + $json(var2/string2);<br>
      <br>
          xlog(&quot;result is &lt;$avp(result)&gt; \n&quot;);<br>
      <br>
      <br>
      or<br>
      <br>
          $json(var1) :=
      &#39;{&quot;string1&quot;:&quot;String1data&quot;,&quot;string2&quot;:&quot;String2data&quot;}&#39;;<br>
          $json(var2) := &#39;{&quot;string2&quot;:&quot;String2data&quot;}&#39;;<br>
      <br>
          $avp(result) = $json(var1/string1) + $json(var1/string2);<br>
      <br>
          xlog(&quot;result is &lt;$avp(result)&gt; \n&quot;);<br>
      <br>
      <br>
      In both cases I got the a valid output....<br>
      <br>
      Any help with it ?<br>
      <br>
      Regards,<br>
    </tt><div class="im">
    <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
    <br></div><div><div class="h5">
    On 01/22/2013 02:13 PM, Bogdan-Andrei Iancu wrote:
    <blockquote type="cite">
      
      <tt>Hi Brett,<br>
        <br>
        So, some initial data:<br>
        <br>
        The $json variables are (as scope) the same as $var - which
        means they have visibility only per process (as names they do
        exist in all procs, but they have different instances / values
        in each proc), but inside the process they are global - visible
        to all messages, from all routes which are executed in that
        particular process (!so take care that to reset the json before
        usage as you may inherit some value from a previous execution in
        the same proc).<br>
        <br>
        Now, about your cases:<br>
        <br>
        1) using a $json in extra_db - it is visibility issue - you set
        the json var for INVITE (in a process) and you try to read it
        for the BYE (in a different proc). Actually the error you get
        says that you try to read a $json which was never set.<br>
        <br>
        2) using it from failure / onreply routes - same as above.<br>
        <br>
        <br>
        Which leaves us with 2 real bugs:<br>
        <br>
        1) when merging 2 jsons - the bogus len - we will look into it<br>
        <br>
        2) the errors on missing values or tags - I will change them to
        DBG and to actually return NULL value to script.<br>
        <br>
        Thanks and regards,<br>
      </tt>
      <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
      <br>
      On 01/16/2013 05:50 PM, Brett Nemeroff wrote:
      <blockquote type="cite">Bogdan,
        <div>I&#39;m actually getting all sorts of weird errors with the
          JSON module..</div>
        <div>Using it in place, for simple things it works great.</div>
        <div><br>
        </div>
        <div>If I concatonate json variables and place them into an avp,
          I get junk at the end</div>
        <div><br>
        </div>
        <div>$avp(result) = $json(somevar/string1) +
          $json(somevar/string2);</div>
        <div><br>
        </div>
        <div>$avp(result) will be something like
          &quot;String1dataString2dataM\002&quot;</div>
        <div><br>
        </div>
        <div>The M\002 is random.. Almost like a variable that isn&#39;t
          initialized. </div>
        <div><br>
        </div>
        <div>Also. $json variables don&#39;t survive to onreply routes or
          failure routes. And they can&#39;t be used in db_extra. There also
          isn&#39;t a real good way to reliably check for the existence of a
          json element without throwing an error in the log</div>
        <div><br>
        </div>
        <div>Thanks for looking at this. If there is anything I can do
          to help, let me know.</div>
        <div>-Brett</div>
        <div><br>
        </div>
        <div><br>
          <div class="gmail_quote">On Wed, Jan 16, 2013 at 6:58 AM,
            Bogdan-Andrei Iancu <span dir="ltr">&lt;<a href="mailto:bogdan@opensips.org" target="_blank">bogdan@opensips.org</a>&gt;</span>
            wrote:<br>
            <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
              <div bgcolor="#ffffff" text="#000000"> <tt>Hi Brett,<br>
                  <br>
                  Never tried something like that, but let me run some
                  tests....<br>
                  <br>
                  Regards,<br>
                </tt>
                <pre cols="72">Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
<a href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.com</a></pre>
                <div>
                  <div> <br>
                    On 01/15/2013 10:29 PM, Brett Nemeroff wrote: </div>
                </div>
                <blockquote type="cite">
                  <div>
                    <div>Anyone else run into this? Anyone
                      using JSON??
                      <div><br>
                      </div>
                      <div>Thanks,</div>
                      <div>Brett</div>
                      <div><br>
                        <br>
                        <div class="gmail_quote">On Thu, Jan 10, 2013 at
                          12:37 AM, Brett Nemeroff <span dir="ltr">&lt;<a href="mailto:brett@nemeroff.com" target="_blank">brett@nemeroff.com</a>&gt;</span>
                          wrote:<br>
                          <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">To
                            make this more interesting.. I actually
                            don&#39;t get the $json variable in a failure
                            route either. There definitely seems to be
                            something up with this variable type&#39;s
                            scope.
                            <div> <br>
                            </div>
                            <div>For now, I save the json into a
                              dlg_val, and restore as needed. However,
                              it&#39;d be nice to let it persist. Is there a
                              way to do that?</div>
                            <div><br>
                            </div>
                            <div>Thanks,</div>
                            <div>Brett</div>
                            <div>
                              <div>
                                <div><br>
                                </div>
                                <div>
                                  <div><br>
                                    <div class="gmail_quote">On Wed, Jan
                                      9, 2013 at 12:20 PM, Brett
                                      Nemeroff <span dir="ltr">&lt;<a href="mailto:brett@nemeroff.com" target="_blank">brett@nemeroff.com</a>&gt;</span>
                                      wrote:<br>
                                      <blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hey All,
                                        <div>I&#39;m trying to add $json
                                          variables to db_extra. I&#39;m
                                          100% sure the variables are
                                          set as I&#39;m using them all over
                                          my script. However, when acc
                                          wants to write, I get errors
                                          like this:</div>
                                        <div><br>
                                        </div>
                                        <div>
                                          <p style="margin:0px;font-size:12px;font-family:Helvetica;min-height:14px"><br>
                                          </p>
                                          <p style="margin:0px;font-size:12px;font-family:Helvetica">Jan 
                                            9 18:10:52 development
                                            /usr/local/sbin/opensips[10469]:
                                            ERROR:json:pv_get_json:
                                            Variable named:cdata1 not
                                            found</p>
                                          <p style="margin:0px;font-size:12px;font-family:Helvetica">Jan 
                                            9 18:10:52 development
                                            /usr/local/sbin/opensips[10469]:
                                            ERROR:acc:extra2strar:
                                            failed to get &#39;element&#39;</p>
                                        </div>
                                        <div><br>
                                        </div>
                                        <div>Like I said, I&#39;m 100% sure
                                          the variable is
                                          set: $json(cdata1/element)</div>
                                        <div><br>
                                        </div>
                                        <div>It&#39;s almost like it just
                                          doesn&#39;t support $json or that
                                          it&#39;s &quot;out of scope&quot;</div>
                                        <div><br>
                                        </div>
                                        <div>Thanks!</div>
                                        <span><font color="#888888">
                                            <div>-Brett</div>
                                            <div> <br>
                                            </div>
                                          </font></span></blockquote>
                                    </div>
                                    <br>
                                  </div>
                                </div>
                              </div>
                            </div>
                          </blockquote>
                        </div>
                        <br>
                      </div>
                    </div>
                  </div>
                  <pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                </blockquote>
              </div>
            </blockquote>
          </div>
          <br>
        </div>
      </blockquote>
      <pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
  </div></div></div>

</blockquote></div><br></div></div>