在SIP INVITE方法中连续获得200响应

时间:2016-04-28 16:08:00

标签: sip

在INVITE请求中,被叫方正在向我发送200(OK)响应,我正在发送ACK,但现在我不知道被叫方是否未收到确认,因为我仍然收到200响应连续下面是请求和响应。

这是整个SIP对话框:

INVITE sip:3000@192.168.1.101 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.9:5070;branch=z9hG4bKe446822249352251a5bd13b6e66ef303;rport
Max-Forwards: 70
From: Sahitya<sip:3001@internalmail.com>;tag=m1RbnnhW7m
To: Prithvi<sip:3000@192.168.1.101>
Call-ID: b6c72c48-402d-40d3-aabf-0538eb1bb630@internalmail.com
CSeq: 1 INVITE
Contact: <sip:3001@192.168.1.9:5070>
Allow: INVITE,ACK,BYE,CANCEL
User-Agent: MySIP V2.0
Content-Type: application/sdp
Content-Length: 179
<------------->


<--- Reliably Transmitting (no NAT) to 192.168.1.9:5070 --->
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP  192.168.1.9:5070;branch=z9hG4bKe446822249352251a5bd13b6e66ef303;received=192.168.1.9;rport=5070
From: Sahitya<sip:3001@internalmail.com>;tag=m1RbnnhW7m
To: Prithvi<sip:3000@192.168.1.101>;tag=as69cbf848
Call-ID: b6c72c48-402d-40d3-aabf-0538eb1bb630@internalmail.com
CSeq: 1 INVITE
Server: Asterisk PBX 11.7.0~dfsg-1ubuntu1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
WWW-Authenticate: Digest algorithm=MD5, realm="asterisk", nonce="50310a1a"
Content-Length: 0



 <--- SIP read from UDP:192.168.1.9:5070 --->
ACK sip:3000@192.168.1.101 SIP/2.0
Via: SIP/2.0/UDP   192.168.1.9:5070;branch=z9hG4bKe446822249352251a5bd13b6e66ef303;rport
Max-Forwards: 70
From: Sahitya<sip:3001@internalmail.com>;tag=m1RbnnhW7m
To: Prithvi<sip:3000@192.168.1.101>;tag=as69cbf848
Call-ID: b6c72c48-402d-40d3-aabf-0538eb1bb630@internalmail.com
CSeq: 1 ACK
User-Agent: MySIP V2.0
Content-Length: 0

<------------->


<--- SIP read from UDP:192.168.1.9:5070 --->
INVITE sip:3000@192.168.1.101 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.9:5070;branch=z9hG4bK4fc5c00de7440b65f8b5355cfacb82d2;rport
Max-Forwards: 70
From: Sahitya<sip:3001@internalmail.com>;tag=m1RbnnhW7m
To: Prithvi<sip:3000@192.168.1.101>;tag=as69cbf848
Call-ID: b6c72c48-402d-40d3-aabf-0538eb1bb630@internalmail.com
CSeq: 2 INVITE
Contact: <sip:3001@192.168.1.9:5070>
Allow: INVITE,ACK,BYE,CANCEL
User-Agent: MySIP V2.0
Content-Type: application/sdp
Content-Length: 179
Authorization: Digest username="3001", realm="asterisk", nonce="50310a1a",  opaque="", uri="sip:3001@192.168.1.101:5060", response="b1e38ea10061a0224e2189e9177fff1c", algorithm=MD5
<------------->


<--- Transmitting (no NAT) to 192.168.1.9:5070 --->
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.1.9:5070;branch=z9hG4bK4fc5c00de7440b65f8b5355cfacb82d2;received=192.168.1.9;rport=5070
From: Sahitya<sip:3001@internalmail.com>;tag=m1RbnnhW7m
To: Prithvi<sip:3000@192.168.1.101>;tag=as69cbf848
Call-ID: b6c72c48-402d-40d3-aabf-0538eb1bb630@internalmail.com
CSeq: 2 INVITE
Server: Asterisk PBX 11.7.0~dfsg-1ubuntu1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:3000@192.168.1.101:5060>
Content-Length: 0
<------------>


<--- Transmitting (no NAT) to 192.168.1.9:5070 --->
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.1.9:5070;branch=z9hG4bK4fc5c00de7440b65f8b5355cfacb82d2;received=192.168.1.9;rport=5070
From: Sahitya<sip:3001@internalmail.com>;tag=m1RbnnhW7m
To: Prithvi<sip:3000@192.168.1.101>;tag=as69cbf848
Call-ID: b6c72c48-402d-40d3-aabf-0538eb1bb630@internalmail.com
CSeq: 2 INVITE
Server: Asterisk PBX 11.7.0~dfsg-1ubuntu1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:3000@192.168.1.101:5060>
Content-Length: 0
<------------>

<--- Reliably Transmitting (no NAT) to 192.168.1.9:5070 --->
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.9:5070;branch=z9hG4bK4fc5c00de7440b65f8b5355cfacb82d2;received=192.168.1.9;rport=5070
From: Sahitya<sip:3001@internalmail.com>;tag=m1RbnnhW7m
To: Prithvi<sip:3000@192.168.1.101>;tag=as69cbf848
Call-ID: b6c72c48-402d-40d3-aabf-0538eb1bb630@internalmail.com
CSeq: 2 INVITE
Server: Asterisk PBX 11.7.0~dfsg-1ubuntu1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:3000@192.168.1.101:5060>
Content-Type: application/sdp
Content-Length: 195
<------------>


<--- SIP read from UDP:192.168.1.9:5070 --->
ACK sip:3000@192.168.1.101:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.9:5070;branch=z9hG4bKd8c26ff688480593ce616e913ac8e609;rport
Max-Forwards: 70
From: Sahitya<sip:3001@internalmail.com>;tag=m1RbnnhW7m
To: Prithvi<sip:3000@192.168.1.101>;tag=as69cbf848
Call-ID: b6c72c48-402d-40d3-aabf-0538eb1bb630@internalmail.com
CSeq: 2 ACK
Authorization: Digest username="3001", realm="asterisk", nonce="50310a1a", opaque="", uri="sip:3001@192.168.1.101:5060", response="b1e38ea10061a0224e2189e9177fff1c", algorithm=MD5
User-Agent: MySIP V2.0
Content-Length: 0
<------------->


Retransmitting #1 (no NAT) to 192.168.1.9:5070:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.9:5070;branch=z9hG4bK4fc5c00de7440b65f8b5355cfacb82d2;received=192.168.1.9;rport=5070
From: Sahitya<sip:3001@internalmail.com>;tag=m1RbnnhW7m
To: Prithvi<sip:3000@192.168.1.101>;tag=as69cbf848
Call-ID: b6c72c48-402d-40d3-aabf-0538eb1bb630@internalmail.com
CSeq: 2 INVITE
Server: Asterisk PBX 11.7.0~dfsg-1ubuntu1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Contact: <sip:3000@192.168.1.101:5060>
Content-Type: application/sdp
Content-Length: 195
---

<--- SIP read from UDP:192.168.1.9:5070 --->
ACK sip:3000@192.168.1.101:5060 SIP/2.0
Via: SIP/2.0/UDP   192.168.1.9:5070;branch=z9hG4bK542e162569381a2bd29c111fa3ea6e03;rport
Max-Forwards: 70
From: Sahitya<sip:3001@internalmail.com>;tag=m1RbnnhW7m
To: Prithvi<sip:3000@192.168.1.101>;tag=as69cbf848
Call-ID: b6c72c48-402d-40d3-aabf-0538eb1bb630@internalmail.com
CSeq: 2 ACK
Authorization: Digest username="3001", realm="asterisk", nonce="50310a1a", opaque="", uri="sip:3001@192.168.1.101:5060", response="b1e38ea10061a0224e2189e9177fff1c", algorithm=MD5
User-Agent: MySIP V2.0
Content-Length: 0

2 个答案:

答案 0 :(得分:0)

我怀疑问题是因为在您的第二个INVITE请求中,您重新使用与原始INVITE相同的Call-ID,From Tag和To Tag。它们应该是第二个INVITE请求的不同值,因为它是一个新事务。

答案 1 :(得分:0)

在第二个邀请中:

  • From标签应该不同
  • Via分支应该是不同的
  • 缺少To标签

同样在200 OK的确认中:

  • From,To,Via和Call-ID应该与200 OK
  • 中的相同

否则在被叫方方面也存在明显的错误(例如接受带有标签的INVITE)。