[asterisk-users] [AGI 1.4] C sample?

Lee Jenkins lee at datatrakpos.com
Sun Jan 27 14:05:13 CST 2008


Vincent wrote:
> On Sun, 27 Jan 2008 09:09:59 -0500, Lee Jenkins <lee at datatrakpos.com>
> wrote:
>> Sorry, I don't have a sample for you as I write mostly in Freepascal/Lazarus 
>> these days and use my own library for AGI/FastAGI.  That said, did you try 
>> saving the file to a fully qualified path?
> 
> My hero! :-) That did it.
> 
> Both work:
> 
> file = fopen("/tmp/file.txt","w");
> file = fopen("./file.txt","w");
> 
> Also, and contrary to what I've read in some online pages, we don't
> have to put AGI scripts in /var/lib/asterisk/agi-bin:
> 
> exten => 9999,n,AGI(/tmp/check_cid.exe|123)
> 
> BTW, as I'm used to Delphi, I'm also interested in checking out FP. Is
> it easy to install on eg. CentOS? Can I come up with a totally
> self-dependent EXE that I can just drop into a limited host running
> AstLinux?
> 

I've used the Windows version for most development, but have lazarus running 
nicely on a CentOS4 VM. Installing from the setup program on windows and from 
rpm on linux was easy.

Just as with delphi, freepascal creates native stand alone executables as well 
as libraries (.dll or .so) and with speed on par (but not as fast) as C . 
Lazarus is the IDE that I use to work with Freepascal.  Lazarus is now about on 
par with Delphi 6, IMO and one of the best IDE's available for Linux.  Not the 
prettiest, but one of the most useful ;)

I also wrote an objectpascal based AGI/FastAGI wrapper a while back if you're 
interested:

http://www.leebo.dreamhosters.com/asterisk/pasagi.pas

-- 
Warm Regards,

Lee

"Everything I needed to learn in life, I learned selling encyclopedias door to 
door."



More information about the asterisk-users mailing list