[Asterisk-Dev] Bridged channel during 'h' extension

Steven Poelmans steven at besite.be
Fri Sep 12 05:29:53 MST 2003


On Fri, 2003-09-12 at 12:18, Alastair Maw wrote:
> Steven Poelmans wrote:
> 
> > I would like to know the name of the channel that was bridged, after
> > the call has been hung up. I want to set it somehow in a variable
> > that can be read in an AGI script, started from the 'h' extension.
> > 
> > I tried to read it from setup_env in app_agi.c, from
> > chan->bridge->name. But I assume its empty before the AGI script
> > starts... Now im digging further into the dial app, but im kinda
> > stuck atm.. Any suggestions?
> > 
> > Thanks in advance, Steven
> 
> :(

> The h extension has a whole load of stuff unset such that getting 
> variables from AGI scripts doesn't work. A bug report should probably be 
> filed about this.

Hmm..

I know that it must be somehow kept, because it can be logged with CDR
(e.g. in MySQL).. 
But i cant access it from the cdr log, because the cdr record is
inserted at the end.

> In the meantime, you can get variables into your AGI script by putting 
> them into argv thusly: AGI(foo.pl,${MYVAR})
> 
> Here you discover another bug, which is that AGI(foo.pl,${VAR1},${VAR2}) 
> doesn't work - only VAR1 gets passed in.

Yes, I know about that.. I solve this by AGI(foo.pl,${VAR1}!${VAR2})

in the script:
my ($var1, $var2) = split(/!/, $ARGV[0])

Thanks :)




More information about the asterisk-dev mailing list