This looks very well:
exten => s,1,Set(GlobalVar=$[${GlobalVar} + 1])
exten => s,2,Set(Chan_Var=${GlobalVar})
s,1 gives You incrementing in one line
setting ChanVar (local variable i presume) don't bother GlobalVar.
-FD
Użytkownik Koen Van Impe napisał:
Sounds like a reasonable explanation.
But this means that I should limit the incrementing stuff to one
line in the dialplan.
This would be bad:
exten => s,1,Set(Chan_Var=${GlobalVar})
exten => s,2,Set(Chan_Var=$[${Chan_Var} + 1])
exten => s,3,Set(GlobalVar=Chan_Var,g)
Better:
exten => s,1,Set(GlobalVar=$[${GlobalVar} + 1])
exten => s,2,Set(Chan_Var=${GlobalVar})
Please confirm...
K
On 5/31/06, Filip Drągowski <[EMAIL PROTECTED]> wrote:
Each variable is specyfied by
name and callid
Call number 1. Executing Set("SIP/X-2749", "DL=0") in new stack
Call number 2. Executing Set("SIP/X-9100", "DL=0") in new stack
X - sip provider login and there is -number (i think that this number
is in HEX)
so every "local" variable have diffrent identity
As You can see Asterisk uses stack so there should be:
1. Executing Set(global_VAR....) in new stack
2. Executing Set(global_VAR....) in new stack
No.1 resolves then next ... ther is no simultaneous operation
it's my opinion.
Try it and see what is shown in * console.
-FD
If I edit the value of a global variable in my dialplan, could
there be a risk of collision between calls?
More in details: could a global var be used to build a counter
that will be incremented by every call that passes.
I think when 2 calls come in almost sumiltaneously, they could
both be incrementing and saving the same value... which is bad!
Anybody knows how asterisk handles this?
K
|
_______________________________________________
--Bandwidth and Colocation provided by Easynews.com --
Asterisk-Users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users