Ok, maybe I'm having a brain fart, or maybe I've never gotten quite this far, but, if you call a fast AGI script, how do you RETURN data from the fast AGI back to the dialplan??? Doug.
On Thursday 17 August 2006 17:12, Douglas Garstang wrote:> Ok, maybe I'm having a brain fart, or maybe I've never gotten quite this > far, but, if you call a fast AGI script, how do you RETURN data from the > fast AGI back to the dialplan???You could set some channel variables.
> -----Original Message----- > From: Justin Tunney [mailto:jtunney@gmail.com] > Sent: Thursday, August 17, 2006 3:36 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] Return data from Fast AGI > > > On Thursday 17 August 2006 17:12, Douglas Garstang wrote: > > Ok, maybe I'm having a brain fart, or maybe I've never > gotten quite this > > far, but, if you call a fast AGI script, how do you RETURN > data from the > > fast AGI back to the dialplan??? > > You could set some channel variables.See, that's what I can't work out. Let's say you have this in your dialplan. exten => _X.,1,AGI(agi://server.gumby.com) Control at this point is passed to the server. That server has no relationship with the Asterisk process. It doesn't even have access to the STDOUT and STDERR streams tied to Asterisk. If you send anything to STDOUT from the server (ie set a channel variable), it's just going to go to STDOUT of the server process, which is probably the terminal it's running on. And what happens if the server process is on a different host? It seems like you can't return variable from Fast AGI or interact with the dial plan in any way, by setting or getting dial plan variables. I must be missing something here. Doug.
> -----Original Message----- > From: Anders Nygren [mailto:anders.nygren@gmail.com] > Sent: Thursday, August 17, 2006 4:32 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] Return data from Fast AGI > > > On 8/17/06, Douglas Garstang <dgarstang@oneeighty.com> wrote: > > > -----Original Message----- > > > From: Justin Tunney [mailto:jtunney@gmail.com] > > > Sent: Thursday, August 17, 2006 3:36 PM > > > To: Asterisk Users Mailing List - Non-Commercial Discussion > > > Subject: Re: [asterisk-users] Return data from Fast AGI > > > > > > > > > On Thursday 17 August 2006 17:12, Douglas Garstang wrote: > > > > Ok, maybe I'm having a brain fart, or maybe I've never > > > gotten quite this > > > > far, but, if you call a fast AGI script, how do you RETURN > > > data from the > > > > fast AGI back to the dialplan??? > > > > > > You could set some channel variables. > > > > See, that's what I can't work out. Let's say you have this > in your dialplan. > > > > exten => _X.,1,AGI(agi://server.gumby.com) > > > > Control at this point is passed to the server. That server > has no relationship with the Asterisk process. It doesn't > even have access to the STDOUT and STDERR streams tied to > Asterisk. If you send anything to STDOUT from the server (ie > set a channel variable), it's just going to go to STDOUT of > the server process, which is probably the terminal it's > running on. And what happens if the server process is on a > different host? > > > > It seems like you can't return variable from Fast AGI or > interact with the dial plan in any way, by setting or getting > dial plan variables. I must be missing something here. > > > Doug > With fastAGI You have a TCP connection between the Asterisk > box and the > fastAGI server so You have to send Your commands on that connection. > > There are "get variable" and "set variable" commands among > many others.Anders, yes I know. That's why I can't understand how stdout is of any use. The stdout of the server process is _not_ the same as the stdout of the Asterisk process. If you set a variable in the server process by writing to stdout, the Asterisk process won't know anything about it. Given that all you have on the client side is: exten => _X.,1,AGI(agi://server.gumby.com) ... how do you send commands? Doug.
> -----Original Message----- > From: Roger Schreiter [mailto:roger@planinternet.de] > Sent: Thursday, August 17, 2006 4:58 PM > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] Return data from Fast AGI > > > Douglas Garstang schrieb: > > ... > > It doesn't even have access to the STDOUT and STDERR streams > > tied to Asterisk. If you send anything to STDOUT from the server > > > Hi, > > STDIN/-OUT in AGI corresponds to the TCP socket in Fast AGI. > > Thus, read data from asterisk via the socket and write date > to asterisk via the socket!Oh yeah. That worked.... d'uh! Thanks Roger.
In article <645FEC31A18FE54A8721500CDD55A7B6035D0A6F@mail.oneeighty.com>, Douglas Garstang <dgarstang@oneeighty.com> wrote:> > Given that all you have on the client side is: > > exten => _X.,1,AGI(agi://server.gumby.com) > > ... how do you send commands?The other thing you can do, if you want the same FastAGI server to do different things from different points in the dialplan is to add another part to the URL. e.g. exten => _X.,1,AGI(agi://server.gumby.com/begin) ... exten => h,1,DeadAGI(agi:://server.gumby.com/end) In the above cases, agi_network_script will be set to "begin" or "end" respectively, and the server can decide what to do based on that. Cheers Tony -- Tony Mountifield Work: tony@softins.co.uk - http://www.softins.co.uk Play: tony@mountifield.org - http://tony.mountifield.org