lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Wed, 23 Feb 2011 14:02:25 +0100, Michal Kolodziejczyk <miko@wp.pl>
wrote:
>io.read() by default reads whole line ('*l'). So you need to send it a
>line (ending with CR/LF, or CTRL+D for empty line), or close the input.
>Otherwise it waits in blocking read. You seem to expect it is
>non-blocking. Try io.read(0) and read the manual:
>http://www.lua.org/manual/5.1/manual.html#pdf-file:read

Thanks Michal, but according to those pages...

"When Asterisk starts an AGI script, it feeds the channel variables to
the script on standard input. "
www.voip-info.org/wiki/view/Asterisk+AGI

"All communication with the AGI occurs over STDIN and STDOUT; [...]
When your program starts, Asterisk will stream a number of variables
to it, which it's in your interest to capture. "
www.voip-info.org/wiki/view/Asterisk+AGI+php

... the server does end each line with a CRL/LF, ending with an empty
CR/LF line when done, so I can't figure out why the while loop never
ends.