Wed Oct 28 11:53:24 2009

Asterisk developer's documentation

Asterisk Dialplan Variables

Asterisk Dialplan variables are divided into three groups:

Global variables are reachable in all channels, all of the time. Channel variables are only reachable within the channel.

For more information on the predefined variables, see Globally predefined channel variables

Global and Channel variables:

exten => 1234,1,set(GLOBAL(myvariable)=tomteluva)

exten => 1234,1,set(xmasattribute=tomtegröt)

Global Variables

Global variables can also be set in the [globals] section of extensions.conf. The setting clearglobalvars in extensions.conf [general] section affects whether or not the global variables defined in globals are reset at dialplan reload.

There are CLI commands to change and read global variables. This can be handy to reset counters at midnight from an external script.

Developer notes

Variable handling is managed within pbx.c You need to include pbx.h to reach these functions.

The variables is a linked list stored in the channel data structure with the list starting at varshead in struct ast_channel

Generated on Wed Oct 28 11:53:24 2009 for Asterisk - the Open Source PBX by  doxygen 1.5.6