[asterisk-users] How to access environment variable?

Steve Edwards asterisk.org at sedwards.com
Tue Feb 6 09:25:01 MST 2007


On Tue, 6 Feb 2007, Larry Alkoff wrote:

> There must be a list in Asterisk that only allows cerain environmental 
> variables to be shown.  A very unnecessary bummer.

There is no list.

Try executing a dialplan containing a priority like:

 	exten = *,n,system(set >/tmp/what-asterisk-sees)

to see what is actually in the Asterisk process's environment.

My Asterisk startup script looks something like:

 	env --ignore-environment\
 		HOST=$HOST\
 		PATH=/usr/local/bin/:/bin/\
 		$ASTERISK\
 		$START_OPTIONS

so I control exactly what environment variables are passed.

Thanks in advance,
------------------------------------------------------------------------
Steve Edwards      sedwards at sedwards.com      Voice: +1-760-468-3867 PST
Newline                                             Fax: +1-760-731-3000


More information about the asterisk-users mailing list