[Asterisk-Users] oddness in AGI - a bug in AGI or my own insanity ?

James Golovich james at wwnet.net
Wed Feb 26 09:14:06 MST 2003



On Wed, 26 Feb 2003, Florian Overkamp wrote:

> Alright, I'm debugging now. I've confirmed this problem occurs _only_ if a 
> previous command (like a WAIT FOR DIGIT) did _not_ get any digits.
> 
> Okay - spotted. The problem lays in a combination of my own AGI code and 
> the way Asterisk appears to handle commands.

You should print your error messages to STDERR or use the AGI Verbose
facility to send your errors to the asterisk console.


> It seems a bit weird that AGI allows commands to overlap, i.e. STREAM FILE 
> can be followed by other commands. Current behaviour is that these commands 
> are honoured, even though there was no result for the STREAM FILE yet. The 
> STREAM FILE continues to play, even though my script now expects it to be 
> finished and starts throwing other commands at Asterisk.

This is not normal behavior.  Your program must be doing buffered i/o.
You need to switch to unbuffered i/o and this problem should go away.
What language are you writing your AGI in?

James




More information about the asterisk-users mailing list