<div dir="ltr">Thank you for the explanation!<div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 23 November 2017 at 14:34, Liviu Chircu <span dir="ltr"><<a href="mailto:liviu@opensips.org" target="_blank">liviu@opensips.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<p><tt>Hi Denys,</tt></p>
<p><tt>The book is doing the correct thing - educating the script
writer that he must not rely on any $var() holders once an
instance of script execution ends for a given message.</tt></p>
<p><tt>You, on the other hand, have the additional knowledge of an
underlying optimization: the $var() values are not reset
(actually, they are rarely touched at all beyond the script
manipulations). The fact that you occasionally find the value that
you left in the previous message is just a coincidence, and you
cannot reliably use their initial values. Since this is just a
"nice to know" developer quirk, I think it would cause confusion
if the authors were to include it in the book.<br>
</tt></p>
<p><tt>If you talk C, you can think of $vars as "uninitialized stack
variables".</tt></p>
<p><tt>Regards,</tt><br>
</p>
<pre class="m_1043789625166092729moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="m_1043789625166092729moz-txt-link-freetext" href="http://www.opensips-solutions.com" target="_blank">http://www.opensips-solutions.<wbr>com</a></pre><div><div class="h5">
<div class="m_1043789625166092729moz-cite-prefix">On 23.11.2017 14:13, Denys Pozniak
wrote:<br>
</div>
</div></div><blockquote type="cite"><div><div class="h5">
<div dir="ltr">
<div>Hello!</div>
<div><br>
</div>
<div>I am newbie in OpenSIPS and probably my question is stupid,
but I could not sleep without correct answer :) </div>
<div>In the book <b>Building Telephony Systems with OpenSIPS
Second Edition</b> I found next part (p. 97):</div>
<div><br>
</div>
<div>
<div><i>The script variables</i></div>
<div><i>As the name indicates, these variables are strictly
bound to the scripting routes. The</i></div>
<div><i>variables are visible only in the routing blocks and
they have no persistency—when</i></div>
<div><i>the route (with all its subroutes) ends, the variables
are discarded.</i></div>
</div>
<div><br>
</div>
<div>Is it correct explanation?According to this, variable lives
on SIP message level when script are executing, but I think
something is not correct as variable lives on proccess level.</div>
<div><br>
</div>
<div>Please help me to sort out this!</div>
<div><br>
</div>
<div>BR</div>
<div>Denys</div>
<div> </div>
</div>
<br>
<fieldset class="m_1043789625166092729mimeAttachmentHeader"></fieldset>
<br>
</div></div><pre>______________________________<wbr>_________________
Users mailing list
<a class="m_1043789625166092729moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a class="m_1043789625166092729moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
</div>
<br>______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><br><div>BR</div><div>Denys Pozniak</div></div></div>
</div>