[Asterisk-Users] AGI questions..

Steven Critchfield critch at basesys.com
Fri Oct 24 11:37:55 MST 2003


On Fri, 2003-10-24 at 10:36, WipeOut wrote:
> Steven Critchfield wrote:
> 
> >You can use php, but php is just perl lite. if you do anything more than
> >a trivial app, you will want to be in something more than php. Take for
> >instance all the modules you have in CPAN that can deal with audio,
> >databases and any number of odd things you need to have.
> >  
> >
> I agree that perl is very powerful but our inhouse skills are in PHP.. 
> So if possible I would prefer to do it in PHP..

If you know php, then you are 7/10ths of the way to knowing perl fairly
well.

> >Echo or print, just make sure you understand that you need to flush the
> >input/output after each command.  
> >  
> >
> can you explain what you mean by "flush the input/output"??

Familiarize yourself with buffered output. Basically, buffered output is
there so the kernel can get a large enough block of data to work with to
be efficient when it does the context switch to the app receiving the
data. The problem is these buffers are usually around a half k or more
in size and not line oriented. You need to flush the buffer through to
the other application(AGI) to make sure it gets the whole line to
process with the line terminator so AGI knows to start working on the
command. the flush command takes care of that for the buffers you are
writing to. I'm not too sure about the buffers you will be reading from.

> >All of them are passed via the stdin at the beginning, some will vary
> >depending on what is available on your channel. Write your script and
> >check it out. 
> >  
> >
> Will do.. :)
> 
> >If you are running agi commands instead of asterisk commands, you will
> >receive a result code back from AGI that will indicate a hangup. At this
> >point AGI will no longer accept commands, but your app is still running
> >and can do post processing. In the apps my company has running, we use
> >this time to clean up our session and send off files to be processed.
> >  
> >
> Are there corresponding AGI commands for the Asterisk commands?? eg a 
> command to dial instead or using the Asterisk "Dial" command..

Yes and no. You can set the priority, extension, and context of the
dialplan to resume at when you exit. You can even dial out, but at the
moment you dial, the AGI app will no longer be in control.

> Thanks for any help.. I am coming under pressure to get this system up 
> and running.. :(
> 
> Later..
> 
> 
> _______________________________________________
> Asterisk-Users mailing list
> Asterisk-Users at lists.digium.com
> http://lists.digium.com/mailman/listinfo/asterisk-users
-- 
Steven Critchfield  <critch at basesys.com>




More information about the asterisk-users mailing list