[asterisk-users] Can't read environment variable

Philip Prindeville philipp_subx at redfish-solutions.com
Thu Jan 31 12:48:32 CST 2008


Uhhh...  just

export HOSTNAME

should be enough once it's been set.


Joost Kuif | Mobillion wrote:
> This pointed me into the right direction, thanks Tzafrir!
>
> i added a export HOSTNAME=$HOSTNAME into my .bash_profile 
>
> Grtz,
> Joost
>
> -----Oorspronkelijk bericht-----
> Van: asterisk-users-bounces at lists.digium.com
> [mailto:asterisk-users-bounces at lists.digium.com] Namens Tzafrir Cohen
> Verzonden: Wednesday, January 30, 2008 1:58 PM
> Aan: asterisk-users at lists.digium.com
> Onderwerp: Re: [asterisk-users] Can't read environment variable
>
> On Wed, Jan 30, 2008 at 01:38:48PM +0100, Joost Kuif | Mobillion wrote:
>   
>> Hi,
>>  
>> I can't read a environment variable in a asterisk dialplan. 
>> When logged in as user root on the system an 'echo $HOSTNAME' gives 
>> the hostame of the machine.
>> Asterisk (1.4) is started from the same console.
>>  
>> I try to read it like this:
>> exten => s,n,NoOp(host=${ENV(HOSTNAME)})
>>  
>> Does anyone know what i am missing?
>>     
>
> Is that variable set?
>
>   cat /proc/PID_OF_ASTERISK/environ | tr '\0' '\n' | grep ^HOSTNAME=
>
>   




More information about the asterisk-users mailing list