ik wrote:
On 12/30/06, Lee Jenkins <[EMAIL PROTECTED]> wrote:
Hi all,
I'm try to write a console application that interfaces with Asterisk
PBX. The pbx communicates with the console application over stndin and
stdout.
Sorry for the question, but are you on the right library to use AGI ?
Sorry, I'm not sure I understand your question. If you mean, am I
writing to the correct list, then yes. I just want to be sure that I
understand the mechanics of stdin/stdout within a console app. I've
only written GUI apps mostly.
If you mean, am I using the right comiler/tool, then yes. Asterisk
communicates with any program over stdin/stdout from what I understand
and reading the asterisk wiki. I've actually written a couple of AGI
programs in C#/Mono, but didn't like the extra setup required for the
mono runtime.
The problem that I'm having is that when I send a command using WriteLn,
the command doesn't return as it should so I'm wonder if FP/Laz handles
stdin/stdout in some way that I am not familiar with.
As far as I know (I will know more in this week btw :)), you should
also check STDERR.
I will.
Is the data written to WriteLn buffered or sent immediately? Below is a
sample of the code I am trying.
It always buffered. Please take a look at
http://www.freepascal.org/docs-html/rtl/system/settextbuf.html
It also appears that a standard Writeln automatically issues a flush()
command anyway:
http://www.freepascal.org/docs-html/rtl/system/flush.html
Ido
Thanks for responding. It appears the problem may very well be between
the back of my chair and the keyboard. I will start again with a very
basic program and work myself up from there to find out where I am going
wrong.
--
Warm Regards,
Lee
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives