[asterisk-users] Can't read environment variable

Joris Cras joris at bitnetwerk.nl
Wed Jan 30 06:54:12 CST 2008


You're using the variables wrong.

This is what you could do is either:
        exten => s,1,NoOp(${ENV(HOSTNAME)})
or
    In globals section
        ;; Defing hostname
        host=${ENV(HOSTNAME)})
    In you dailplan section
        exten => s,1,NoOp(${host})

You will manage,

Greets
Joris


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?
>  
>  
> Ipv een saaie e-mail een leuk videobericht? Ga naar/ 
> //www.KletsKoppies.nl <http://www.kletskoppies.nl/>/
>  
> ------------------------------------------------------------------------
>
> _______________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users



More information about the asterisk-users mailing list