Asterisk-Java 1.0.0 includes support for implementing AGI scripts in the scripting language of your choice. You still have the benefit of running on the JVM but for the implementation of your script you can now choose your favorite language.
To get started just download the binary distribution of Asterisk-Java. Unpack it and run the asterisk-java.jar file from the unpacked directory.
$ cd asterisk-java-1.0.0-SNAPSHOT $ java -jar asterisk-java.jar May 13, 2009 1:26:16 AM org.asteriskjava.fastagi.DefaultAgiServer startup INFO: Listening on *:4573.
In addition to the functions provided by the scripting language Asterisk-Java adds two variables:
the request data including the dialed extension, the caller id, channel name, parameters and more
for interacting with Asterisk, e.g. to stream files, receive DTMF digits or execute dialplan applications
Modify your dialplan and add extensions for the demo scripts:
exten => 2000,1,Agi(agi://localhost/demo.groovy) exten => 2001,1,Agi(agi://localhost/demo.js) exten => 2002,1,Agi(agi://localhost/demo.php)
If you are not running Asterisk-Java on the same server as Asterisk replace localhost by the hostname of the machine running Asterisk-Java.
Note that you will need at least Java 6 to make use of the new scripting support.