Bind Asterisk to my Java program via AGI

2.4k Views Asked by At

I am trying to bind Asterisk to my java program. I followed this article (http://www.jcgonzalez.com/asterisk-handle-calls-with-java-example) to the letter. But I have an error once I call the 888 extention. It gives me the following error :

Dec 12, 2014 7:32:00 PM org.asteriskjava.fastagi.DefaultAgiServer startup
INFO: Thread pool started.
Dec 12, 2014 7:32:00 PM org.asteriskjava.fastagi.DefaultAgiServer startup
INFO: Listening on *:4573.
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.DefaultAgiServer startup
INFO: Received connection from /127.0.0.1
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.ResourceBundleMappingStrategy loadResourceBundle
INFO: Resource bundle 'fastagi-mapping' not found.
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.AbstractMappingStrategy createAgiScriptInstance
SEVERE: Unable to create AgiScript instance of type hello.agi: Class not found, make sure the class exists and is available on the CLASSPATH
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.internal.AgiConnectionHandler run
SEVERE: No script configured for URL 'agi://localhost/hello.agi' (script 'hello.agi')

I have just switched to UBUNTU, and I have no idea what this sentence means : make sure the fastagi-mapping.properties is in the class path or put it in the same folder as your compiled classes.

Please help.

2

There are 2 best solutions below

4
On BEST ANSWER

Actually you have to put hello.agi mapping with actual java class file in fastagi-mapping.properties file , so that it can find the corresponding AGI file that u call from asterisk..

2
On

Your error have no any relation to AGI.

Your error say you have no class in path(or mistype)

SEVERE: Unable to create AgiScript instance of type hello.agi: Class not found, make sure the class exists and is available on the CLASSPATH
Dec 12, 2014 7:32:05 PM org.asteriskjava.fastagi.internal.AgiConnectionHandler run
SEVERE: No script configured for URL 'agi://localhost/hello.agi' (script 'hello.agi')

Note, class used WILL depend of url used when calling agi in dialplan.