[Asterisk-Dev] PATCH - Adds a set'able text string for each channel

Adam Goryachev mailinglists at websitemanagers.com.au
Thu Jun 3 18:45:16 MST 2004


Personally, I don't see why this should be accessible after the
call/from the CDR. I presume there is a method for accessing channel
variables from AGI either during the call, and/or after the call is
hungup.

I have implemented (as I already said) the setting of channel variables
from the manager interface, I just need to solve the other half of the
problem on how to read the values back...

If anyone knows the correct/easiest method of retrieving the value of a
variable given a channel, and variable name, it would be appreciated.

So far I have found:
char *ast_var_value(struct ast_var_t *var)
{
        return (var != NULL ? var->value : NULL);
}
but it requires I already have the struct ast_var_t, and I'm not sure
how to get that part...

Once this is done, I will post the patch to the bug tracker... It only
works with current CVS, I had to run around and make a bunch of changes
when CVS head changed the way it locked channels or something...

Regards,
Adam

On Thu, 2004-05-20 at 23:00, asterisk at billheckel.com wrote:
> It might be nice if this information was retreivable after hangup somehow at least from AGI.
> 
> Bill
> 
> Adam Goryachev wrote:
> 
> >>It sounds like what I want to do is simply use the same manager
> >>interface like this:
> >>Action: Setvar
> >>Channel: Zap/1-1
> >>Variable: mytext
> >>Value: blahblah
> >>
> >>This would be the same as:
> >>Setvar(mytext=blahblah)
> >>when channel zap/1-1 was still running through the dialplan.
> >>
> > 
> > 
> > Well, actually, that was really easy to implement.
> > 
> > The question now is, how to implement/allow the manager interface to
> > retrieve channel variables?
> > 
> > In the dialplan they are accessed as ${foo} but in the manager API I
> > suppose we need something more like:
> > Action: Getvar
> > Channel: Zap/1-1
> > Variable: blahblah
> > 
> > or should it be Action: Readvar ?
> > 
> > What about setting/reading global vars?
> > Perhaps:
> > Action: Getvar
> > Channel: Global
> > Variable: blahblah





More information about the asterisk-dev mailing list