[asterisk-users] [asterisk-user] Can't get hostname on asterisk dialplan by ENV()

Mark Deneen mdeneen at gmail.com
Thu Apr 21 13:21:05 CDT 2011


Rajnikant,

This surely depends on how you start asterisk.  How are you starting
the asterisk process?

-M

On Thu, Apr 21, 2011 at 7:20 AM, RAJNIKANT VANZA <rajnivanza at gmail.com> wrote:
> Hi Friend,
>
> Can't get hostname environment variable on asterisk dialplan.
> Help me about how to get hostname environment variable on asterisk dialplan.
> I have written "export HOSTNAME" in /root/.bash_profile and when i execute
> "echo $HOSTNAME" then get right hostname but not success through asterisk
> dialplan.
> Get environment variable path right value through below statement.
> exten => XXX,n,NoOp(----------- ${ENV(PATH)})
> I have tried like this:
> exten => XXX,n,Set(CDR(hostname)=${System(echo $HOSTNAME)})
> exten => XXX,n,Set(CDR(hostname)=${ENV(HOSTNAME)})
>
> Thanks in advance.
> --
> Best Regards,
>
> Rajnikant Vanza
> Call : +91-9737456583
> Software Engineer
> -------------------------------------------------------
> Working On Linux,C/C++,Asterisk Technology
> Gandhinagar - Gujarat
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>               http://www.asterisk.org/hello
>
> 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