Summary:ASTERISK-02297: no EOF after AGI answer to command: "channel status"
Reporter:silke (silke)Labels:
Date Opened:2004-08-30 17:26:35Date Closed:2011-06-07 14:10:15
Versions:Frequency of

I am currently writing a PHP-script
for AGI.

There I found out that there must be a problem
with the command "channel status". The command
itself is okay, but the answer of asterisk to this command
does not deliver a further "\n" (if probably not displayed correctly:
in the quotes is a backslash followed by an n). But this is just
a small problem.

I don't know if it is standard to send a further BACKSLASH-N
but some answers of AGI-commands do and some not.

More problematic is this:

Having sent the command "channel status", asterisks also does not
deliver a proper EOF when all information is already delivered to AGI
which (the EOF) is -on the other hand- delivered correctly by other
commands such as "hangup" or "stream file".

I get: "200 result=6" followed by one BACKSLASH-N but then there comes no
EOF as with other answers to commands.

I use CVS-24082004.

Best regards,

Comments:By: Mark Spencer (markster) 2004-08-30 20:01:30

Are you perhaps confusing the behavior of AGI with that of the manager interface?  Asterisk does not send EOF on an AGI, or even additional \n's...

By: silke (silke) 2004-08-31 03:21:40

Dear Mark,

I call an AGI-Script on an incoming call in

This AGI-Script is currently only for developing
PHP-Core-Functions like hangup(), channel_status()
and stream_file().

For comunication with asterisk AGI I use STDIN / STDOUT.
Controlling of incoming data is done by doing "selects" /
feof() on the STDIN.

The "read from STDIN" function is the same for all of the
following commands.

Doing a "STREAM FILE $name \"\"\n" returns me from STDIN:

200 result=X endpos=y\n

Doing a "HANGUP\n" returns me from STDIN:

200 result=X

Doing a "CHANNEL STATUS\n" returns me from STDIN:

200 result=x\n

So there's maybe somewhere an inconsistency.

I use CVS-24082004 and PHP 4.3.7 in CLI mode.

Best regards,


By: Mark Spencer (markster) 2004-09-04 11:16:50

There are no EOF's in the stream.  As far as I can tell everything is the same in terms of how many \n's are being produced in each case, just looking at the code.

By: Mark Spencer (markster) 2004-09-29 10:58:45

To the best of my knowledge this is not a bug, and I cannot duplicate the problem being described.