<div dir="ltr">Use $var when you want to manipulate values inside a route block, for example, when you want to store a value that will live only in the scope of that route block. When the route block exits, it will be automatically deallocated.<br>
<div><br></div><div style>Use $avp when you want to store a value that you want to read anywhere. It will live as long as the SIP transaction lives.</div><div style><br></div><div style>- $var is stored in private memory, it is per process. This means that only the process that created it can read it.</div>
<div style>- $avp is stored in shared memory. It can be accessed from any process in kamailio&#39;s process list (childs)</div><div style><br></div><div style>- $var has local route block scope.</div><div style>- $avp has SIP transaction scope.</div>
<div style><br></div><div style>- Both $avp and $var are automatically freed.</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Apr 19, 2013 at 10:50 AM, Victor V. Kustov <span dir="ltr">&lt;<a href="mailto:coyote@bks.tv" target="_blank">coyote@bks.tv</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">В Fri, 19 Apr 2013 10:56:26 +0200<br>
<div class="im">&quot;Olle E. Johansson&quot; &lt;<a href="mailto:oej@edvina.net">oej@edvina.net</a>&gt; пишет:<br>
<br>
</div><div class="im">&gt; - $avp is stored in transactions (in shared memory), so if you set<br>
&gt; them while processing a request you have them when processing<br>
&gt; responses and failures.<br>
<br>
</div>is memory freeing automatically or i need to do it myself?<br>
<div class="im HOEnZb"><br>
--<br>
 SY,<br>
        Victor<br>
  JID: <a href="mailto:coyote@bks.tv">coyote@bks.tv</a><br>
  JID: <a href="mailto:coyote@bryansktel.ru">coyote@bryansktel.ru</a><br>
  I use FREE operation system: 3.8.4-calculate GNU/Linux<br>
<br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list<br>
<a href="mailto:sr-users@lists.sip-router.org">sr-users@lists.sip-router.org</a><br>
<a href="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users" target="_blank">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Carlos<div><a href="http://caruizdiaz.com" target="_blank">http://caruizdiaz.com</a></div><div>+595981146623</div>
</div>