Thomas Kowalski
Thomas Kowalski

Reputation: 2184

Asterisk-Java can't find fastagi-mapping.properties

I'm using Asterisk and I'd like to emit a call from my Java app and then use an AGI script to control what happens. So I've got a first class that contacts the Asterisk server and uses an OriginateAction to start the call (this works well) and an AGI server that runs and should serve AGI requests. Though, it doesn't work because it can't find the fastagi-mapping.properties file.

Here is my fastagi-mapping.properties:

alertcall.agi = AlertCallScript

(It only has one case.)

In the same folder, I have AlertCallScript.java (and asterisk-java.jar) that I compile like this:

javac -cp asterisk-java.jar:. AlertCallScript.java ExamplesAsteriskSettings.java

And then I start my AGI server using this (found in the doc):

java -cp asterisk-java.jar:. -jar asterisk-java.jar

When I emit my call, I get the following error in the AGI server output:

Jun 13, 2018 6:28:12 AM org.asteriskjava.fastagi.ResourceBundleMappingStrategy loadResourceBundle
INFO: Resource bundle 'fastagi-mapping' not found.
Jun 13, 2018 6:28:12 AM org.asteriskjava.fastagi.internal.AgiConnectionHandler run
SEVERE: No script configured for URL 'agi://localhost/alertcall.agi' (script 'alertcall.agi')

And I don't know why... I've been looking into this for more than an hour and I probably made a stupid mistake, though I can't find it.

Notes :

Please suggest.

Upvotes: 2

Views: 1063

Answers (1)

Brandon Haugen
Brandon Haugen

Reputation: 959

Part of the problem is probably trying to use -cp and -jar in the same java command, this is not supported and there are a number of questions on Stackoverflow about that (here is one).

You can use something like

java -cp asterisk-java.jar:. DefaultAgiServer

to start asterisk-java's DefaultAgiServer specifically (which is what specifying -jar asterisk-java.jar is going to do anyways, if I remember the entry in the manifest correctly).

Upvotes: 3

Related Questions