通过AGI将Asterisk绑定到我的Java程序

时间:2014-12-12 19:48:36

标签: java asterisk agi

我正在尝试将Asterisk绑定到我的java程序。 我按照这篇文章(http://www.jcgonzalez.com/asterisk-handle-calls-with-java-example)来写信。但是,一旦我拨打888延期,我就会出错。它给了我以下错误:

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')

我刚刚切换到UBUNTU,我不知道这句话是什么意思:确保fastagi-mapping.properties在类路径中或者将它放在与编译类相同的文件夹中。

请帮忙。

2 个答案:

答案 0 :(得分:4)

实际上你必须将hello.agi映射与fastagi-mapping.properties文件中的实际java类文件放在一起,以便它可以找到你从星号调用的相应AGI文件。

答案 1 :(得分:0)

您的错误与AGI无关。

您的错误表示您没有路径类(或错误类型)

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')

注意,使用的类将取决于在拨号方案中调用agi时使用的URL。