javaubuntuagiasterisk-java

Request help | SEVERE: No script configured for URL 'agi://localhost/callin.agi' (script 'callin.agi')


I built and installed Asterisk-Java 3.41.0 from source in /usr/src/asterisk-java/. Inside the target folder I created a directory "buildPackage", inside which I compiled the ExampleCallIn.java file using javac -cp asterisk-java.jar ExampleCallIn.java.

The following files are located in the buildPackage directory: asterisk-java.jar ExampleCallIn.class ExampleCallIn.java fastagi-mapping.properties guava-33.3.1-jre.jar. OS used is Ubuntu 14.04.1 LTS.

When I'm running sudo java -cp asterisk-java.jar:guava-33.3.1-jre.jar org.asteriskjava.fastagi.DefaultAgiServer, and then dialing the configured extension via a softphone I'm getting this output:

Nov 21, 2024 5:20:55 PM org.asteriskjava.fastagi.DefaultAgiServer startup
INFO: Listening on *:4573.
Nov 21, 2024 5:20:59 PM org.asteriskjava.fastagi.AbstractAgiServer getPool
INFO: Thread pool started.
Nov 21, 2024 5:20:59 PM org.asteriskjava.fastagi.ResourceBundleMappingStrategy loadResourceBundle
INFO: Resource bundle 'fastagi-mapping' not found.
Nov 21, 2024 5:20:59 PM org.asteriskjava.fastagi.internal.AgiConnectionHandler run
SEVERE: No script configured for URL 'agi://192.168.2.218/callin.agi' (script 'callin.agi')

When I'm dialing the extensions which is configured to call this script, the request obviously reaches the server but somehow callin.agi is not properly pointing to ExampleCallIn.java.

This is what my fastagi.properties file looks like:

callin.agi=ExampleCallIn

and the extensions.conf:

exten => 1300,1,AGI(agi://192.168.2.218/callin.agi)

I also added the directory containing the fastagi-mapping.properties file to CLASSPATH:

$ echo ${CLASSPATH}
/usr/src/asterisk-java/target/buildPackage

Your help is greatly needed and appreciated !


Solution

  • I was able to solve it myself...

    First I had to include the path to my directory inside the asterisk-java project directory: sudo java -cp asterisk-java.jar:guava-33.3.1-jre.jar:/usr/src/asterisk-java/target/buildPackage org.asteriskjava.fastagi.DefaultAgiServer

    Then, in fastagi-mapping.properties I had to declare the function class in the following way:

    callin.agi=org.asteriskjava.examples.fastagi.java.ExampleCallIn
    

    Be aware that if you're using the -cp flag with java or javac, the path that follows overrides the user classpath that is stored in the $CLASSPATH variable.