i made an asterisk game where ppl call a number and get some kind of a trivia game, they answer questions and so on …
my problem is that when i call from 3 or 4 phones at the same time to test it, some phones start to override other phones answers, now why will something like this happen ?
it`s like all the ppl who call this number, the asterisk opens only one session for all users shared variables 0.o
Im guessing you must be storing the answers in the DB, or as a global variables. all normal variables are channel specific. So from you description i will put money on Global variables
yes most of my variables are global, they are used for purposes like counters and ETC. could that be the problem? if yes then how could i NOT use a global variable, what`s the point of having them then
How are you defining the varibles ? basicly if you just specify a varible it isnt global, you have to secify it as global for it to be a global. But we dont know how you have specified them. post the cost that sets the varible in question and we can see what you have done.
Yes that is the problem. you are detinging them under globals and when you are setting them you are also setting them as globals, thats what the g is doing
ian first of all thx but you got me wrong, i need the variables to be global so the dialplan for the game can access these variables from all contexts, my problem is that the global variables are becoming some sort of shared between all CALLERS
if i set a variable ( not global ) in some context will the other contexts be able to access it? if not then i need a global variable, therefore i`m stuck with that problem
another Q, if i use the AstDB instead of global variables will it solve the problem?
A global variable is as the name suggests global.
The same variable and its value is used by all callers.
If you mean you want a variable to be used by a caller as they progress through the dialplan then you have to prefix the variable with either _ or __ see the wiki for more details.
You could use the astdb and store and call them using the calls unique ID as the family then delete the family when the call ends.