[asterisk-users] How to access environment variable?

Tzafrir Cohen tzafrir.cohen at xorcom.com
Tue Feb 6 13:13:47 MST 2007


On Tue, Feb 06, 2007 at 08:04:23AM -0600, Larry Alkoff wrote:
> Thanks for your reply Ioan.
> 
> Very interesting.  ${ENV(PATH)} works to display the path
> but ${ENV(MYIP)} does not!
> 
> There must be a list in Asterisk that only allows cerain environmental 
> variables to be shown.  A very unnecessary bummer.
> 

Right.

> However, at the CLI prompt:
> ! echo $PATH and  ! echo $MYIP
> both work fine.

However This is incorrect: '!' only works in a remote asterisk terminal: 
a connection from a different process (on the same system) to the running
Asterisk process.

It will run a subshell of thatremote process. So it is not necessarily
related to the environment of the Asterisk process.

Also: when running something in System(), note that you run a
subprocess, and that this subprocess may have its own separate
environment.

-- 
               Tzafrir Cohen       
icq#16849755                    jabber:tzafrir at jabber.org
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com       
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir


More information about the asterisk-users mailing list