[英]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. 我正在使用Asterisk,我想从Java应用程序发出呼叫,然后使用AGI脚本控制发生的情况。 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. 因此,我有一个与Asterisk服务器联系并使用
OriginateAction
来启动调用的类(运行良好),还有一个运行并应为AGI请求提供服务的AGI服务器。 Though, it doesn't work because it can't find the fastagi-mapping.properties
file. 但是,由于找不到
fastagi-mapping.properties
文件,因此无法正常工作。
Here is my fastagi-mapping.properties
: 这是我的
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: 在同一文件夹中,我具有
AlertCallScript.java
编译的AlertCallScript.java
(和asterisk-java.jar
):
javac -cp asterisk-java.jar:. AlertCallScript.java ExamplesAsteriskSettings.java
And then I start my AGI server using this (found in the doc): 然后,我使用此文件(在文档中找到)启动AGI服务器:
java -cp asterisk-java.jar:. -jar asterisk-java.jar
When I emit my call, I get the following error in the AGI server output: 发出呼叫时,在AGI服务器输出中出现以下错误:
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 : 注意事项:
java-asterisk.jar:.
java-asterisk.jar:.
to be able to have asterisk-java
and the current folder, which contains the fastagi-mapping.properties
file, so the file should be found without any problem within the class path. asterisk-java
和当前文件夹,该文件夹包含fastagi-mapping.properties
文件,因此应该可以在类路径内找到该文件而没有任何问题。 Please suggest. 请提出建议。
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). 问题的一部分可能是试图在同一
java
命令中使用-cp
和-jar
,这不受支持,并且关于Stackoverflow的问题很多( 这里是一个)。
You can use something like 您可以使用类似
java -cp asterisk-java.jar:.
java -cp asterisk-java.jar:。 DefaultAgiServer
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). 专门启动asterisk-java的
DefaultAgiServer
(如果我正确记住清单中的条目,则指定-jar asterisk-java.jar
还是要这样做的)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.