<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>Hello,</p>
    <p>preparing the release of v4.4.5 and digesting the sr-dev mailing
      list activity, I noticed that this was not answered.</p>
    <p>The $var(x) type of variables is not reset, they persist over
      execution of the routing blocks. Their values are stored in
      private memory, so they are like global variables per each
      kamailio process/worker. You have to reset them explicitly.</p>
    <p>Cheers,<br>
      Daniel<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 26/11/2016 00:19, Armen Babikyan
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAGDtNKD7L_cZWMqbYafg3FZxROMasj0O_0vMMu_sS0-8msjj9w@mail.gmail.com"
      type="cite">
      <div dir="ltr">Hello,
        <div><br>
        </div>
        <div>I recall reading somewhere that all private variables (i.e.
          $var(foo)-style pvs) are reset/destroyed between request_route
          executions, but I have a suspicion this is not happening -
          either in some limited cases or perhaps in all cases.</div>
        <div><br>
        </div>
        <div>I suppose the most telling symptom is that I see no
          references to either destroy_vars() or reset_vars() functions
          that are defined in $kamailio/modules/pv/pv_svar.{c,h}.</div>
        <div><br>
        </div>
        <div>Is this behavior intentional?  If so, I'll see what I can
          do about implementing a mechanism that manually resets (or
          destroys?) variables with a  "$var(all) = $null;"-type of
          statement (similar to "$uac_req(all) = $null;"), or making a
          modparam setting that automatically does this.</div>
        <div><br>
        </div>
        <div>Thoughts welcome.  Thanks!</div>
        <div><br>
        </div>
        <div>Armen</div>
        <div><br>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
sr-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</a>
</pre>
    </blockquote>
    <br>
    <pre class="moz-signature" cols="72">-- 
Daniel-Constantin Mierla
<a class="moz-txt-link-abbreviated" href="http://www.twitter.com/miconda">www.twitter.com/miconda</a> -- <a class="moz-txt-link-abbreviated" href="http://www.linkedin.com/in/miconda">www.linkedin.com/in/miconda</a>
Kamailio World Conference - May 8-10, 2017 - <a class="moz-txt-link-abbreviated" href="http://www.kamailioworld.com">www.kamailioworld.com</a></pre>
  </body>
</html>