gpt4 book ai didi

java - Sip Servlet 不发送邀请请求

转载 作者:行者123 更新时间:2023-11-30 02:06:42 28 4
gpt4 key购买 nike

我使用 android JAIN-SIP 应用程序创建了一个客户端,并且我有一个在 mobiecent jboass as7 上运行的 sip servlet。我已成功将 REGISTER 发送到服务器并将客户端注册到位置服务。现在我发送邀请请求,Sip-Servlet 响应我 100 TRYING 但在要连接的设备上没有请求。

1) Android device1 Sip Stack 创建于 10.0.2.15:5060

2) Android device2 Sip Stack 创建于 10.0.2.15:5061

3) 我在本地主机 JBOSS AS 7 中运行服务器

00:46:38,709 INFO  [gov.nist.javax.sip.stack.SIPTransactionStack] (Mobicents-SIP-Servlets-UDPMessageChannelThread-1) <message
from="127.0.0.1:5060"
to="127.0.0.1:5080"
time="1433101598708"
isSender="false"
transactionId="z9hg4bk-353139-23dd952026f58e7b7fa437a9a829521a"
callId="ea66e330013864d677f61835b193ce05@10.0.2.15"
firstLine="INVITE sip:imran@10.0.2.15 SIP/2.0"
>
<![CDATA[INVITE sip:imran@10.0.2.15 SIP/2.0
Call-ID: ea66e330013864d677f61835b193ce05@10.0.2.15
CSeq: 1 INVITE
From: <sip:mubeen@10.0.2.15:5060>;tag=Tzt0ZEP92
To: <sip:imran@10.0.2.15>
Via: SIP/2.0/UDP 10.0.2.15:5060;rport=61459;branch=z9hG4bK-353139-23dd952026f58e7b7fa437a9a829521a;received=127.0.0.1
Max-Forwards: 70
Supported: replaces,outbound
Route: <sip:10.0.2.2:5080;transport=udp;lr>
Contact: <sip:mubeen@10.0.2.15:5060>
My-Header: my header value
Content-Type: application/sdp
My-Other-Header: my new header value
Call-Info: <http://www.antd.nist.gov>
Content-Length: 241

v=0
o=4855 13760799956958020 13760799956958020 IN IP4 10.0.2.15
s=mysession session
p=+46 8 52018010
c=IN IP4 10.0.2.15
t=0 0
m=audio 5061 RTP/AVP 0 4 18
a=rtpmap:0 PCMU/8000
a=rtpmap:4 G723/8000
a=rtpmap:18 G729A/8000
a=ptime:20
]]>
</message>

00:46:38,728 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Mobicents-SIP-Servlets-UDPMessageChannelThread-1) <message
from="127.0.0.1:5080"
to="10.0.2.15:5061"
time="1433101598727"
isSender="true"
transactionId="z9hg4bkce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8"
callId="f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1"
firstLine="INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0"
>
<![CDATA[INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0
Call-ID: f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1
CSeq: 1 INVITE
From: <sip:mubeen@10.0.2.15:5060>;tag=19882621_5c8e9ada_9b2c9cf3_ce7f0022-7c26-40b3-b53d-bd976010b3b4
To: <sip:imran@10.0.2.15>
Max-Forwards: 70
User-Agent: Mobicents Restcomm 7.2.1.601
Contact: <sip:mubeen@127.0.0.1:5080>
Via: SIP/2.0/UDP activate.adobe.com:5080;branch=z9hG4bKce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8
Content-Length: 0

]]>
</message>

00:46:38,732 INFO [org.mobicents.servlet.sip.core.dispatchers.InitialRequestDispatcher] (Mobicents-SIP-Servlets-UDPMessageChannelThread-1) Request event dispatched to org.illuxplain.sip.server
00:46:38,916 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Timer-1) <message
from="127.0.0.1:5080"
to="127.0.0.1:61459"
time="1433101598915"
isSender="true"
transactionId="z9hg4bk-353139-23dd952026f58e7b7fa437a9a829521a"
callId="ea66e330013864d677f61835b193ce05@10.0.2.15"
firstLine="SIP/2.0 100 Trying"
>
<![CDATA[SIP/2.0 100 Trying
To: <sip:imran@10.0.2.15>
Via: SIP/2.0/UDP 10.0.2.15:5060;rport=61459;branch=z9hG4bK-353139-23dd952026f58e7b7fa437a9a829521a;received=127.0.0.1
CSeq: 1 INVITE
Call-ID: ea66e330013864d677f61835b193ce05@10.0.2.15
From: <sip:mubeen@10.0.2.15:5060>;tag=Tzt0ZEP92
Server: Mobicents Restcomm 7.2.1.601
Content-Length: 0

]]>
</message>

00:46:39,235 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Timer-1) <message
from="127.0.0.1:5080"
to="10.0.2.15:5061"
time="1433101599233"
isSender="true"
transactionId="z9hg4bkce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8"
callId="f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1"
firstLine="INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0"
>
<![CDATA[INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0
Call-ID: f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1
CSeq: 1 INVITE
From: <sip:mubeen@10.0.2.15:5060>;tag=19882621_5c8e9ada_9b2c9cf3_ce7f0022-7c26-40b3-b53d-bd976010b3b4
To: <sip:imran@10.0.2.15>
Max-Forwards: 70
User-Agent: Mobicents Restcomm 7.2.1.601
Contact: <sip:mubeen@127.0.0.1:5080>
Via: SIP/2.0/UDP activate.adobe.com:5080;branch=z9hG4bKce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8
Content-Length: 0

]]>
</message>

00:46:40,233 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Timer-1) <message
from="127.0.0.1:5080"
to="10.0.2.15:5061"
time="1433101600233"
isSender="true"
transactionId="z9hg4bkce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8"
callId="f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1"
firstLine="INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0"
>
<![CDATA[INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0
Call-ID: f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1
CSeq: 1 INVITE
From: <sip:mubeen@10.0.2.15:5060>;tag=19882621_5c8e9ada_9b2c9cf3_ce7f0022-7c26-40b3-b53d-bd976010b3b4
To: <sip:imran@10.0.2.15>
Max-Forwards: 70
User-Agent: Mobicents Restcomm 7.2.1.601
Contact: <sip:mubeen@127.0.0.1:5080>
Via: SIP/2.0/UDP activate.adobe.com:5080;branch=z9hG4bKce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8
Content-Length: 0

]]>
</message>

00:46:42,233 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Timer-1) <message
from="127.0.0.1:5080"
to="10.0.2.15:5061"
time="1433101602233"
isSender="true"
transactionId="z9hg4bkce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8"
callId="f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1"
firstLine="INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0"
>
<![CDATA[INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0
Call-ID: f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1
CSeq: 1 INVITE
From: <sip:mubeen@10.0.2.15:5060>;tag=19882621_5c8e9ada_9b2c9cf3_ce7f0022-7c26-40b3-b53d-bd976010b3b4
To: <sip:imran@10.0.2.15>
Max-Forwards: 70
User-Agent: Mobicents Restcomm 7.2.1.601
Contact: <sip:mubeen@127.0.0.1:5080>
Via: SIP/2.0/UDP activate.adobe.com:5080;branch=z9hG4bKce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8
Content-Length: 0

]]>
</message>

00:46:46,233 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Timer-1) <message
from="127.0.0.1:5080"
to="10.0.2.15:5061"
time="1433101606233"
isSender="true"
transactionId="z9hg4bkce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8"
callId="f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1"
firstLine="INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0"
>
<![CDATA[INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0
Call-ID: f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1
CSeq: 1 INVITE
From: <sip:mubeen@10.0.2.15:5060>;tag=19882621_5c8e9ada_9b2c9cf3_ce7f0022-7c26-40b3-b53d-bd976010b3b4
To: <sip:imran@10.0.2.15>
Max-Forwards: 70
User-Agent: Mobicents Restcomm 7.2.1.601
Contact: <sip:mubeen@127.0.0.1:5080>
Via: SIP/2.0/UDP activate.adobe.com:5080;branch=z9hG4bKce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8
Content-Length: 0

]]>
</message>

00:46:54,234 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Timer-1) <message
from="127.0.0.1:5080"
to="10.0.2.15:5061"
time="1433101614234"
isSender="true"
transactionId="z9hg4bkce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8"
callId="f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1"
firstLine="INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0"
>
<![CDATA[INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0
Call-ID: f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1
CSeq: 1 INVITE
From: <sip:mubeen@10.0.2.15:5060>;tag=19882621_5c8e9ada_9b2c9cf3_ce7f0022-7c26-40b3-b53d-bd976010b3b4
To: <sip:imran@10.0.2.15>
Max-Forwards: 70
User-Agent: Mobicents Restcomm 7.2.1.601
Contact: <sip:mubeen@127.0.0.1:5080>
Via: SIP/2.0/UDP activate.adobe.com:5080;branch=z9hG4bKce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8
Content-Length: 0

]]>
</message>

00:47:10,235 INFO [gov.nist.javax.sip.stack.SIPTransactionStack] (Timer-1) <message
from="127.0.0.1:5080"
to="10.0.2.15:5061"
time="1433101630235"
isSender="true"
transactionId="z9hg4bkce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8"
callId="f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1"
firstLine="INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0"
>
<![CDATA[INVITE sip:imran@10.0.2.15:5061;transport=udp;registering_acc=10.0.2.2 SIP/2.0
Call-ID: f35cb07ebe1ddc8a5cedc1c1072eaa10@127.0.0.1
CSeq: 1 INVITE
From: <sip:mubeen@10.0.2.15:5060>;tag=19882621_5c8e9ada_9b2c9cf3_ce7f0022-7c26-40b3-b53d-bd976010b3b4
To: <sip:imran@10.0.2.15>
Max-Forwards: 70
User-Agent: Mobicents Restcomm 7.2.1.601
Contact: <sip:mubeen@127.0.0.1:5080>
Via: SIP/2.0/UDP activate.adobe.com:5080;branch=z9hG4bKce7f0022-7c26-40b3-b53d-bd976010b3b4_9b2c9cf3_351e96b0-efbf-4055-ad41-0d2449a959e8
Content-Length: 0

]]>
</message>

这是 Sip-Servlet doInvite() 方法

Address contactURI = sipFactory.createAddress(stringURI);

SipServletRequest outRequest = sipFactory.createRequest(req.getApplicationSession(), INVITE, req.getFrom().getURI(), req.getTo().getURI());
if(contactURI == null){
req.createResponse(SipServletResponse.SC_NOT_FOUND).send();
return;
}
outRequest.setRequestURI(contactURI.getURI());
if(req.getContent() == null){
outRequest.setContent(req.getContent(), req.getContentType());
}
outRequest.send();

//Create a Session there will be multiple request, Called DIALOG..
sessions.put(req.getSession(), outRequest.getSession());
sessions.put(outRequest.getSession(),req.getSession());

我的 DAR 文件

REGISTER: ("org.illuxplain.sip.server", "DAR:From", "ORIGINATING", "", "NO_ROUTE", "0")
OPTIONS: ("org.illuxplain.sip.server", "DAR:From", "TERMINATING", "", "NO_ROUTE", "0")
INVITE: ("org.illuxplain.sip.server", "DAR:From", "ORIGINATING", "", "NO_ROUTE", "0")

您可以暗示可能是什么问题。我没有提示和想法。

最佳答案

您的 Via header 是 activate.adobe.com,这很奇怪。可能会去外部网络。您应该使用本地 IP 或名称。

关于java - Sip Servlet 不发送邀请请求,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30572287/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com