<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body 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="moz-signature" cols="72">Liviu Chircu
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
<div class="moz-cite-prefix">On 23.11.2017 14:13, Denys Pozniak
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CADcrYG+rH=Bfe70y9DUa4U-5sDBqybMootkta2gpK6m6yPydYA@mail.gmail.com">
<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="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>