I need to obtain one variable in the dialplan containing the IP address that Asterisk is using, I mean, the originating IP for any calls coming out of Asterisk via SIP. Is this possible? F.Alves
Call AGI script (Bash, Perl, whatever) that parses the value out of 'ifconfig' (or somewhere in /proc, routing table, whatever) and sets it as a channel variable before returning.> I need to obtain one variable in the dialplan containing the IP address > that > Asterisk is using, I mean, the originating IP for any calls coming out of > Asterisk via SIP. Is this possible? > F.Alves > > > _______________________________________________ > -- 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 >-- Alex Balashov Evariste Systems Web : http://www.evaristesys.com/ Tel : (+1) (678) 954-0670 Direct : (+1) (678) 954-0671 Mobile : (+1) (678) 237-1775
Subject : Re: [asterisk-users] Question -------------------------------^^^^^^^^ You may have better luck with a better Subject. On Tue, 19 May 2009, Venefax wrote:> I need to obtain one variable in the dialplan containing the IP address > that Asterisk is using, I mean, the originating IP for any calls coming > out of Asterisk via SIP. Is this possible?Your question is a bit vague. If you only have a single IP address, you could pass it in as an environment variable when you start Asterisk. Like: ADDRESS=$(ifconfig eth0\ | tr ":" " "\ | awk '/inet addr/ {print $3}') nice --adjustment=-20\ env --ignore-environment\ ADDRESS=${ADDRESS}\ $ASTERISK $START_OPTIONS (I just hacked this out as an example.) If you have multiple IP addresses on the box, good luck :) Thanks in advance, ------------------------------------------------------------------------ Steve Edwards sedwards at sedwards.com Voice: +1-760-468-3867 PST Newline Fax: +1-760-731-3000