启动 SIP 会话时出现问题/ getClientTransaction(request) 抛出 NullPointerException

发布于 2024-09-07 08:38:01 字数 1151 浏览 11 评论 0原文

我有一个小问题,我的 SIP 客户端正在工作,并且我更改了代码的结构。我保留了 SIP 对象的创建过程,就像以前一样,但现在它不起作用。

我不断收到:

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

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

这是 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);

请问有什么帮助吗?

亚当.

I have a small issue, I had my SIP client working, and I changed the structure of the code. I kept the creation process of the SIP objects as it was before, but now it does not work.

I keep getting:

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

and there is no reference to such error in the documentation... what does it mean?

here is the instantiation code for the 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);

Any Help please??

Adam.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梨涡少年 2024-09-14 08:38:01

WWWWWWWWWWWOOOOOOOOOOOWWWWWWWWWWWWW

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

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

大问题,据我所知,在 1.2 中,request.getMethod() 返回 < strong>CSeq 标头,以防我不使用 request.setMethod(method)

而在1.2.1中,如果不设置request.setMethod(method),则request.getMethod()方法将返回null。

那是我的错误...

现在,如果你读到这篇文章,请赞扬或其他什么...我很沮丧,我已经在这个虫子上坐了 4 个小时了。该死。

亚当.

WWWWWWWWWWWOOOOOOOOOOOWWWWWWWWWWWWW

If anyone would had ever guessed this, I'll eat my LapTop....

in the first project I was using the Jain-Sip 1.2
and in the new one I use the 1.2.1

BIG issue that in the 1.2, as far as I can tell, request.getMethod() returns the method of the CSeq header in case I don't use the request.setMethod(method).

While in the 1.2.1, if not setting the request.setMethod(method), the request.getMethod() method returns null.

that was my error...

now if you read this please commend or something... I'm so frustrated, I was sitting on this bugger for 4 hours now. Damn.

Adam.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文