[Asterisk-Dev] Retrieving variable set bySetVar() in extensions.conf

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Fri Apr 1 09:49:48 MST 2005


On Friday 01 April 2005 04:29, Alf Thomas Nilsen wrote:
> > #include <asterisk/pbx.h>
> > value = pbx_builtin_getvar_helper(chan, "name");
>
> I tested this today but the "chan" variable gave me problems during
> compile. I guess this is because rtp.c doesn't have a struct called
> chan.
>
> I tried creating "chan":
>
> struct ast_channel *chan;
>
> However, this obviously didn't work, since "chan" in this case, isn't
> "linked" to anything... Right now I'm trying to get this to work
> using SIP, but later I will also try to implement this for IAX2.

Well, you're going to have to find the associated channel somehow,
because variables set with SetVar are all associated with a specific
channel.

-- 
Tilghman



More information about the asterisk-dev mailing list