2

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.

ATJ
  • 136
  • 3
  • 11

2 Answers2

4

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..

n j
  • 444
  • 1
  • 6
  • 15
  • Hello, thanks for your answer, I have already put the fastagi-mapping.properties into the java class directory with the .class files. Still it doesn't work. – ATJ Dec 15 '14 at 11:12
  • can you show contents of the fastagi-mapping.properties – n j Dec 15 '14 at 11:54
  • 2
    Hi again, the previous content was : hello.agi = HelloAgiScript, the actuel content is : hello.agi = my.package.HelloAgiScript and it works. – ATJ Dec 15 '14 at 12:06
  • 1
    Thanks a lot good sir, may what ever you believe in open you the ways to where ever you want to go – ATJ Dec 15 '14 at 12:07
0

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.

arheops
  • 15,544
  • 1
  • 21
  • 27