has published an interesting article on how to build an AGI server with Asterisk-Java to run AGI scripts written in BeanShell.

They provide a dispatcher AgiScript that delegates to a BeanShell script and provides some additional convenience functions to make the custom scripts easy to implement.

The advantages of using scripting languages on the JVM along with Asterisk-Java are compelling:

The approach is quite flexible, our script engine doesn't need to be on the same computer the pbx is on, and we can add/modify our scripts on the fly without need for compilation or engine restart.

You might also be interested in our recent posting on writing AGI scripts in Groovy that describes a similar approach with a focus on Groovy.