asterisk-java 错误Exception in thread "Asterisk-Java DaemonPool-1-thread-1" java.lang.NullPointerException

申缘 发布于 2016/12/09 16:43
阅读 1K+
收藏 0

【Gopher China万字分享】华为云的Go语言云原生实战经验!>>>

各位网友大家好,最近在学习Asterisk-java接口,按照Asterisk-java官网资料照做。

asterisk-java官网教程地址:http://asterisk-java.org/tutorial/

HelloAgiScript .java内容如下:
-----------------------------------------------------------------
import org.asteriskjava.fastagi.AgiChannel;
import org.asteriskjava.fastagi.AgiException;
import org.asteriskjava.fastagi.AgiRequest;
import org.asteriskjava.fastagi.BaseAgiScript;

public class HelloAgiScript extends BaseAgiScript{

    public void service(AgiRequest request, AgiChannel channel)
            throws AgiException{
                   answer();
                   streamFile("welcome");
                   hangup();
            }
}
------------------------------------------------------------------
编译没有错误。
在fastagi-mapping.properties文件映射脚本名称如下:
hello.agi = HelloAgiScript

拨号计划配置文件中配置:

[defalut]
exten =>1300,1,Agi(agi://localhost/hello.agi)

启动Agiserver。

------------------------------------------------------------------

[root@localhost asterisk-java]# java -jar asterisk-java-1.0.0.jar 
十二月 09, 2016 4:30:16 下午 org.asteriskjava.fastagi.DefaultAgiServer startup
信息: Listening on *:4573.
------------------------------------------------------------------
xlite拨号1300.出现如下错误:
------------------------------------------------------------------
十二月 09, 2016 4:30:26 下午 org.asteriskjava.fastagi.DefaultAgiServer startup
信息: Received connection from /0:0:0:0:0:0:0:1
十二月 09, 2016 4:30:26 下午 org.asteriskjava.fastagi.AbstractAgiServer getPool
信息: Thread pool started.
十二月 09, 2016 4:30:26 下午 org.asteriskjava.fastagi.ResourceBundleMappingStrategy loadResourceBundle
信息: Added mapping for 'hello.agi' to class HelloAgiScript
十二月 09, 2016 4:30:26 下午 org.asteriskjava.fastagi.internal.AgiConnectionHandler runScript
信息: Begin AgiScript HelloAgiScript on Asterisk-Java DaemonPool-1-thread-1
十二月 09, 2016 4:30:26 下午 org.asteriskjava.fastagi.internal.AgiConnectionHandler runScript
信息: End AgiScript HelloAgiScript on Asterisk-Java DaemonPool-1-thread-1
Exception in thread "Asterisk-Java DaemonPool-1-thread-1" java.lang.NullPointerException
at org.asteriskjava.util.internal.SocketConnectionFacadeImpl.close(SocketConnectionFacadeImpl.java:183)
at org.asteriskjava.fastagi.internal.FastAgiConnectionHandler.release(FastAgiConnectionHandler.java:70)
at org.asteriskjava.fastagi.internal.AgiConnectionHandler.run(AgiConnectionHandler.java:147)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
------------------------------------------------------------------

请教各位,这是怎么回事?

加载中
返回顶部
顶部