[Asterisk-Users] oddness in AGI - a bug in AGI or my
own insanity ?
Florian Overkamp
florian at obsimref.com
Wed Feb 26 09:28:43 MST 2003
At 07:58 26-2-2003 -0600, you wrote:
>Warnings should be thrown to STDERR. This ges the data out, but doesn't
>send it to AGI.
Correct - the warning should not have been there in the first place, but
alas :-)
> > 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.
> >
> > I think it would be better if commands in AGI were not honoured at all
> > untill the current command loop has finished in a normal fashion
> (either by
> > timeout or user input).
>
>Since you are using STDIN and STDOUT which are buffered by the OS, AGI
>doesn't accept any new commands while the current command is running,
>you just have queued it up for when AGI is ready. Kind of like typing
>ahead in a shell while it is busy on a command. The command completes
>and the shell goes to reading from STDIN till it finds a return and
>starts processing again.
Ehm well, thats the point. Asterisk accepted the input even though it
really shouldn't have (yet) (I think). And if it should, then the running
command should probably abort ?
>So far, there has been few to no problems getting scripts to work when
>you control your STDOUT output. If you are using perl, and you have
>errors being generated outside of your control, your may want to
>consider using select to try and reroute the warnings out to STDERR, and
>then specify STDOUT for your commands.
True - I'm seeing where to do this properly. BTW, I'm scripting with PHP
for this one ;->>
Grtz,
Florian
More information about the asterisk-users
mailing list