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

Vincent vincent.delporte at bigfoot.com
Sun Jan 27 12:36:07 CST 2008


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?

>Normally ExtractFilePath would return the directory path that the executable is 
>locate in.  My understanding is that that is not necessarily the case on linux 
>which takes into account the directory from which the call to the executable is 
>being made, which might not be the same directory that the executable is located on.

If someone has an idea why it's required to use a full path for the
file to be written, I'm interested.

Thanks again.




More information about the asterisk-users mailing list