<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<tt>This looks very well:<br>
exten => s,1,Set(GlobalVar=$[${GlobalVar} + 1])<br>
exten => s,2,Set(Chan_Var=${GlobalVar})<br>
<br>
s,1 gives You incrementing in one line<br>
setting ChanVar (local variable i presume) don't bother GlobalVar.<br>
<br>
-FD<br>
</tt><br>
Użytkownik Koen Van Impe napisał:
<blockquote
cite="mid2dce5e710605310637le8e770bp209458df9188973b@mail.gmail.com"
type="cite">
<div>Sounds like a reasonable explanation.</div>
<div>But this means that I should limit the incrementing stuff to one
line in the dialplan.</div>
<div> </div>
<div>This would be bad:</div>
<div>exten => s,1,Set(Chan_Var=${GlobalVar})</div>
<div>exten => s,2,Set(Chan_Var=$[${Chan_Var} + 1])</div>
<div>exten => s,3,Set(GlobalVar=Chan_Var,g)</div>
<div> </div>
<div>Better:</div>
<div>exten => s,1,Set(GlobalVar=$[${GlobalVar} + 1])<br>
exten => s,2,Set(Chan_Var=${GlobalVar})<br>
</div>
<div>Please confirm...</div>
<div> </div>
<div>K</div>
<div> </div>
<div> </div>
<div><span class="gmail_quote">On 5/31/06, <b
class="gmail_sendername">Filip Drągowski</b> <<a
href="mailto:f.dragowski@ontp.net">f.dragowski@ontp.net</a>> wrote:</span>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0px 0px 0px 0.8ex; padding-left: 1ex;">
<div>
<div text="#000000" bgcolor="#ffffff">Each variable is specyfied by
name and callid <br>
Call number 1. Executing Set("SIP/X-2749", "DL=0") in new stack<br>
Call number 2. Executing Set("SIP/X-9100", "DL=0") in new stack
<br>
X - sip provider login and there is -number (i think that this number
is in HEX)<br>
so every "local" variable have diffrent identity<br>
<br>
As You can see Asterisk uses stack so there should be:<br>
1. Executing Set(global_VAR....) in new stack <br>
2. Executing Set(global_VAR....) in new stack<br>
No.1 resolves then next ... ther is no simultaneous operation<br>
it's my opinion. <br>
Try it and see what is shown in * console.<br>
<br>
-FD<br>
</div>
<div><span class="e" id="q_10b8a83d63e7af83_1">
<div>If I edit the value of a global variable in my dialplan, could
there be a risk of collision between calls?</div>
<div> </div>
<div>More in details: could a global var be used to build a counter
that will be incremented by every call that passes.</div>
<div>I think when 2 calls come in almost sumiltaneously, they could
both be incrementing and saving the same value... which is bad!</div>
<div> </div>
<div>Anybody knows how asterisk handles this?</div>
<div> </div>
<div>K</div>
</span></div>
<div>
<pre><hr size="4" width="90%"></pre>
</div>
</div>
</blockquote>
</div>
</blockquote>
<pre class="moz-signature" cols="72">
</pre>
</body>
</html>