[variables] Value of global variable empty?


I’m working with Asterisk 1.4, and noticed that the value of a global variable is empty when jumping to another context through a local channel:

I re-read the relevant chapters of the third edition of “Asterisk: The Definitive Guide”, but didn’t find an explanation.

Does someone know why the global variable above is empty in the [callback] context, and if there’s a solution?

Thank you.

You have shadowed the global variable with a local variable of the same name. You need to set the global variable.

Thanks David. I thought including the variable in [globals] was enough: What is the right way to set the value of a global variable so that it carries to another context?

core show function GLOBAL

Thanks for the info. This is the first time I use a variable across two contexts, so didn’t know I had to use a specific function:

wiki.asterisk.org/wiki/display/ … les+Basics