AGI, how to connect and related problems

Hi,

I am a asterisk newbie and I want to learn how to use AGI.

I need to write AGI scripts on JAVA, till here, it’s OK.

But how can I recall these scripts?

1- to which folder I need to save these scripts?, If it is any folder, how can I define its global path.

2- If I want to use agi like exten(1100, (agi://*********/myscript)) again how asterisk find myscript on server. I think I need to define (agi://) protocol and define its base folder. But how can I do that?

Simply, how can I use agi? especially I want to do that with java, I check on fastagi or agi tutorial but non of them explaining the points above.

My Asterisk is 1.8 and running on Ubuntu 10.14.

Hi,

Process based AGI…

The default directory for the AGI scripts is… /var/lib/asterisk/agi-bin.

You can also look in /etc/asterisk/asterisk.conf in a [directories] section for a line like on one below. That specified the path Asterisk will look in if a simple script name is passed to AGI.(see below)

astagidir => /var/lib/asterisk/agi-bin

There may be sample scripts in that directory that you can use to help you understand AGI usage. If not there, you can look in the agi directory in the source code tree.

To call an AGI script, use the AGI application like this…

If ‘script’ is a simple filename, Asterisk will look in the default directory(above). If ‘script’ is an absolute pathname (/usr/local/agi/scriptname), Asterisk will attempt to run the script using the path specified.

Remember that the script must executable by the user running the Asterisk process.

FastAGI(Network based AGI)…

‘Fast AGI’ is AGI using TCP. In this case, Asterisk doesn’t know or care where the script is because it connects via a network socket (port 4573 by default). Calling the AGI() app with a uri of (agi://hostname) is all you need in the dialplan.

AGI can be any language as long as it can talk the AGI protocol. I would assume that there is a Java library for it, though I do not program in Java so I do not know.