SetGlobalVar and Threads

Hi all,

I want to have a global count when the users select record (i.e: each user will leave a message in the form: question-ID.wav), I use the following:
exten => 1,1,SetGlobalVar(questionID=$[${questionID} + 1])
exten => 1,2,record(/var/lib/asterisk/questions/quest-${questionID}:wav)

It seems to works with 1 user. But I wonder whether it is thread safe. What happen when 2 users calling at the same time? They would get the same questionID and it is bad.

Thanks in advance for any suggestion,

Phil

Please do not double post.

forums.digium.com/viewtopic.php?t=2273