启动 SIP 会话时出现问题/ getClientTransaction(request) 抛出 NullPointerException
我有一个小问题,我的 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
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.