How global variables are accessed?

hi guys, i need to know something.

if i define a global variable in extensions.conf will that variable be replicated for each active channel or every channel has access to single global variable. i mean if a channel sets that variable to a value, it will be changed for all channels or for only that channel which changed its value: for example


in dialplan


wouldn’t it be bad practice to want to change a global variable for a channel. shouldn’t you be only refering to that variable value ?

to change a global var, you use the SetGlobalVar() application, or preferably the Set() command with the ‘g’ option.

yes it is a bad practice if the variable is not replicated for each channel to use.