[Asterisk-Users] Global variables - collision?

Koen Van Impe koenvi at gmail.com
Wed May 31 06:37:39 MST 2006


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 <f.dragowski at ontp.net> 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 <http://easynews.com/> --
>
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
>
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com <http://easynews.com/>--
>
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
>   http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20060531/630ea1c7/attachment.htm


More information about the asterisk-users mailing list