Sip サーブレットの set 属性に関する問題に直面しています。別のソースから別の 200 OK を受信したときに、 200 OK を送信しようとしています。だから私はこのようにすることを考えました:
protected void doInvite(SipServletRequest req) throws ServletException, IOException {
//...
SipSession session = req.getSession();
SipServletResponse response = req.createResponse(200);
session.setAttribute("reqResponse", response);
/...
}
そのため、反対側から 200 ok を受信すると、次のようになります。
protected void doSuccessResponse(SipServletResponse resp)
//...
throws ServletException, IOException {
SipServletResponse response = (SipServletResponse) session.getAttribute("reqResponse");
response.send();
//....
}
しかし、response.send() を実行しようとすると、エラーが発生します。
[0m[31m09:25:15,956 ERROR [org.mobicents.servlet.sip.core.dispatchers.DispatchTask] (Mobicents-SIP-Servlets-UDPMessageChannelThread-10) Unexpected exception while processing message SIP/2.0 200 Ok
Via: SIP/2.0/UDP localhost:5080;received=127.0.0.1;branch=z9hG4bKa76ae813-561c-40ec-90b3-0cb29839c16f_d9d5d8b1_b843c7c0-2c76-4a9a-87e2-3fd9959601ea
From: "x-lite" <sip:user2@127.0.0.1>;tag=15858376_d7e7552a_d9d5d8b1_a76ae813-561c-40ec-90b3-0cb29839c16f
To: <sip:user1@127.0.0.1:5061>;tag=qGnECUk
Call-ID: 31ad484919b40e2a20d2ef2d28468f8d@127.0.0.1
CSeq: 1 INVITE
User-Agent: Linphone/3.8.5 (belle-sip/1.4.1)
Supported: outbound
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,NOTIFY,MESSAGE,SUBSCRIBE,INFO,UPDATE
Contact: <sip:user1@127.0.0.1:5061>;+sip.instance="<urn:uuid:2fc1acc8-38e5-420e-981e-70d1c82d961f>"
Content-Type: application/sdp
Content-Length: 398
v=0
o=user1 3189 2578 IN IP4 10.1.2.214
s=Talk
c=IN IP4 10.1.2.214
t=0 0
m=audio 7078 RTP/AVPF 96 0
a=rtpmap:96 opus/48000/2
a=fmtp:96 useinbandfec=1; stereo=0; sprop-stereo=0
a=rtcp-fb:* trr-int 5000
m=video 9078 RTP/AVPF 102 103
a=rtpmap:102 VP8/90000
a=rtpmap:103 H264/90000
a=fmtp:103 profile-level-id=42801F
a=rtcp-fb:* trr-int 5000
a=rtcp-fb:102 ccm fir
a=rtcp-fb:103 ccm fir
: org.mobicents.servlet.sip.core.DispatcherException: Unexpected exception while processing response : SIP/2.0 200 Ok
Via: SIP/2.0/UDP localhost:5080;received=127.0.0.1;branch=z9hG4bKa76ae813-561c-40ec-90b3-0cb29839c16f_d9d5d8b1_b843c7c0-2c76-4a9a-87e2-3fd9959601ea
From: "x-lite" <sip:user2@127.0.0.1>;tag=15858376_d7e7552a_d9d5d8b1_a76ae813-561c-40ec-90b3-0cb29839c16f
To: <sip:user1@127.0.0.1:5061>;tag=qGnECUk
Call-ID: 31ad484919b40e2a20d2ef2d28468f8d@127.0.0.1
CSeq: 1 INVITE
User-Agent: Linphone/3.8.5 (belle-sip/1.4.1)
Supported: outbound
Allow: INVITE,ACK,CANCEL,OPTIONS,BYE,REFER,NOTIFY,MESSAGE,SUBSCRIBE,INFO,UPDATE
Contact: <sip:user1@127.0.0.1:5061>;+sip.instance="<urn:uuid:2fc1acc8-38e5-420e-981e-70d1c82d961f>"
Content-Type: application/sdp
Content-Length: 398
v=0
o=user1 3189 2578 IN IP4 10.1.2.214
s=Talk
c=IN IP4 10.1.2.214
t=0 0
m=audio 7078 RTP/AVPF 96 0
a=rtpmap:96 opus/48000/2
a=fmtp:96 useinbandfec=1; stereo=0; sprop-stereo=0
a=rtcp-fb:* trr-int 5000
m=video 9078 RTP/AVPF 102 103
a=rtpmap:102 VP8/90000
a=rtpmap:103 H264/90000
a=fmtp:103 profile-level-id=42801F
a=rtcp-fb:* trr-int 5000
a=rtcp-fb:102 ccm fir
a=rtcp-fb:103 ccm fir
at org.mobicents.servlet.sip.core.dispatchers.ResponseDispatcher$1.dispatch(ResponseDispatcher.java:491) [sip-servlets-impl-3.0.564.jar:3.0.564]
at org.mobicents.servlet.sip.core.dispatchers.DispatchTask.dispatchAndHandleExceptions(DispatchTask.java:61) [sip-servlets-impl-3.0.564.jar:3.0.564]
at org.mobicents.servlet.sip.core.dispatchers.ResponseDispatcher.dispatchMessage(ResponseDispatcher.java:512) [sip-servlets-impl-3.0.564.jar:3.0.564]
at org.mobicents.servlet.sip.core.SipApplicationDispatcherImpl.processResponse(SipApplicationDispatcherImpl.java:1005) [sip-servlets-impl-3.0.564.jar:3.0.564]
at gov.nist.javax.sip.EventScanner.deliverEvent(EventScanner.java:296) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.SipProviderImpl.handleEvent(SipProviderImpl.java:185) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.DialogFilter.processResponse(DialogFilter.java:1501) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.stack.SIPClientTransactionImpl.inviteClientTransaction(SIPClientTransactionImpl.java:896) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.stack.SIPClientTransactionImpl.processResponse(SIPClientTransactionImpl.java:532) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.stack.SIPClientTransactionImpl.processResponse(SIPClientTransactionImpl.java:1604) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.stack.UDPMessageChannel.processMessage(UDPMessageChannel.java:603) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.stack.UDPMessageChannel.processIncomingDataPacket(UDPMessageChannel.java:512) [jain-sip-ri-1.2.228.jar:1.2.228]
at gov.nist.javax.sip.stack.UDPMessageChannel.run(UDPMessageChannel.java:317) [jain-sip-ri-1.2.228.jar:1.2.228]
at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_79]
Caused by: java.lang.NullPointerException
at org.mobicents.servlet.sip.example.SimpleSipServlet.doSuccessResponse(SimpleSipServlet.java:151)
at javax.servlet.sip.SipServlet.doResponse(SipServlet.java:274) [sip-servlets-spec-3.0.564.jar:3.0.564]
at org.mobicents.servlet.sip.example.SimpleSipServlet.doResponse(SimpleSipServlet.java:195)
at javax.servlet.sip.SipServlet.service(SipServlet.java:334) [sip-servlets-spec-3.0.564.jar:3.0.564]
at org.mobicents.servlet.sip.core.dispatchers.MessageDispatcher.callServlet(MessageDispatcher.java:458) [sip-servlets-impl-3.0.564.jar:3.0.564]
at org.mobicents.servlet.sip.core.dispatchers.ResponseDispatcher$1.dispatch(ResponseDispatcher.java:479) [sip-servlets-impl-3.0.564.jar:3.0.564]
... 13 more
誰かがエラーの場所を理解するのを手伝ってくれますか? 注: 200 ok メッセージをログに出力しようとしましたが、エラーはないようです。正しく取得できました! ご協力ありがとうございました!