【问题标题】:Problem initiating SIP session/ getClientTransaction(request) throws NullPointerException发起 SIP 会话/getClientTransaction(request) 时出现问题抛出 NullPointerException
【发布时间】:2010-06-27 09:21:32
【问题描述】:

我有一个小问题,我的 SIP 客户端正常工作,我更改了代码的结构。 SIP对象的创建过程我保持之前的样子,但是现在不行了。

我不断得到:

gov.nist.javax.sip.SipProviderImpl.getNewClientTransaction(SipProviderImpl.java:285) 处的 java.lang.NullPointerException

并且文档中没有提到此类错误...这是什么意思?

这里是 sip 的实例化代码:

        sipFactory.setPathName(host);
        sipFactory.resetFactory();
        sipStack = sipFactory.createSipStack(getProperties());
        String address = Inet4Address.getLocalHost().getHostAddress();
        sipFactory.createHeaderFactory();
        sipFactory.createAddressFactory();
        sipFactory.createMessageFactory();

        udpPoint = sipStack.createListeningPoint(address, SIPPort, SIPConstants.UDP);
        udpSipProvider = sipStack.createSipProvider(udpPoint);
        udpSipProvider.addSipListener(this);

        tcpPoint = sipStack.createListeningPoint(address, SIPPort, SIPConstants.TCP);
        tcpSipProvider = sipStack.createSipProvider(tcpPoint);
        tcpSipProvider.addSipListener(this);

        sipStack.start();
        setSessionState(SipSessionState.Connected);

有什么帮助吗??

亚当。

【问题讨论】:

    标签: java voip sip jain-sip


    【解决方案1】:

    WWWWWWWWWWWOOOOOOOOOOOWWWWWWWWWWWWWWWWWW

    如果有人能猜到这一点,我会吃掉我的笔记本电脑......

    在第一个项目中,我使用的是 Jain-Sip 1.2 在新版本中,我使用 1.2.1

    据我所知,1.2 中的大问题,request.getMethod() 返回 CSeq 标头 的方法如果我不使用 request.setMethod(method)

    1.2.1中,如果没有设置request.setMethod(method)request.getMethod()方法返回空。

    那是我的错误...

    现在,如果您阅读了这篇文章,请点赞或其他什么...我很沮丧,我已经在这个臭虫上坐了 4 个小时了。该死的。

    亚当。

    【讨论】:

    • 我仍然不敢相信这是错误...非常深入的调试真的!
    猜你喜欢
    • 2013-06-27
    • 2022-11-02
    • 1970-01-01
    • 1970-01-01
    • 2013-01-12
    • 1970-01-01
    • 1970-01-01
    • 2021-03-12
    相关资源
    最近更新 更多