[asterisk-users] Binary AGI Scripts

Lee Jenkins lee at datatrakpos.com
Fri Dec 29 09:02:18 MST 2006


Hi Everyone,

I'm wondering if anyone here write AGI's in compiled binaries.  I'm 
writing a small Cepstral AGI in Freepascal/Lazarus.  I know there are 
some other AGI's out there, but I wanted to add some more functionality 
than what is available such as having the AGI determine if the "data" 
argument is plain text or a path to a text file and act accordingly.

The problem that I'm having is that Asterisk is not sending back any 
responses to commands.  I'm using stdin/stdout through the ReadLn and 
WriteLn commands in freepascal.

Reading in the initial env variables is no problem, but once I issue a 
command like so:

// >>> Create wav file from swift here <<<

WriteLn('EXEC PLAYBACK /tmp/NewlyCreatedFile');

ReadLn(StringVar); // <=========  Never returns

// >>> Clean up code to delete file, etc <<<


(The command STREAM FILES always comes back and complains the file is 
not found when it really is there so I have settled for using the 
Playback application.)

Am I mistaken in thinking that Asterisk is supposed to send back a 
response over stdin?

Of course, if I do not attempt to read the response, I run into bigger 
problem as the sound file will not be found because the next portion of 
code deletes the file created for playback, but before asterisk has a 
chance to play it!

I worked on this thing all day yesterday and tried everything that I can 
think of, but this morning I figured I will ask for some help.
-- 

Warm Regards,

Lee



More information about the asterisk-users mailing list