[asterisk-users] global variables and updates

Julian Lyndon-Smith asterisk at dotr.com
Sat Jul 28 04:18:08 CDT 2007


Sorry if this appears twice - I originally sent it nearly 18 hours ago 
and never saw it ..

I have a need to have a unique integer number that can be used by a
dynamic meetme room (I am wanting to redirect a call into a meeting 
room, and need a unique number to make sure I don't put two people 
together !)

I was going to use a global variable ${NEXTMEETME}, and add one every 
time I redirect.

Is the changing of a global variable atomic ? That is, if I have two or 
more channels being redirected at the same time, and they all execute

exten => _X.,n,Set(NEXTMEETME=${MATH(${NEXTMEETME}+1,i)})
exten => _X.,n,Set(MYMEETME=${NEXTMEETME})

if NEXTMEETME is initially 0, would channel A get MYMEETME as 1, channel 
B get 2 and channel C get 3, even if they execute the dialplan at the 
same time ?

Julian.



More information about the asterisk-users mailing list