最近5G商业测试中有一项是5G打4G的时延,牵涉到VoLTE的知识点,花点时间对VoLTE进行回炉。
关于VoLTE,主要是分为两个方面,一个是接入层,另一个是应用层(也就是SIP层)。
下面这个例子是关闭了鉴权和预先条件(Precondition)

上图是一个总体的流程,每个消息里面都包含了很复杂、很细的一些细节消息。
一个完整的VOLTE呼叫流程如下:

(1) INVITE
UE发送INVITE来为特定服务发起会话。在这一步,UE发送SDP offer,并且通常这个SDP携带媒体信息
注:在某些应用中,特别是在LTE中,被叫方在邀请后发送100 trying。但根据RFC,这不是强制性的。
(2) 183 Session Progress
被叫发送183个会话进程。基本意思是“我收到了你的邀请信息,正在做一些事情来让这项工作成功”。
看个例子,此消息带有以下hearder。这意味着“此会话需要先决条件”和“此消息需要100 rel”。100 rel需要什么?它的意思是“因为这条信息将携带非常重要的内容,我想从另一方得到确认(PRACK)”。通常,像183这样的预备消息不需要另一方的任何响应,但是如果它带有头“require:100rel”,则另一方应该发送名为PRACK的特定确认消息。
Require: precondition
Require: 100rel
由于此消息设置为“Precondition=Required”,它开始交换所需的qos参数,如下所示'des (desired):qos'定义此会话的最终qos条件,'curr(current):qos'表示我们当前达到的qos条件。在这种情况下当前:curr:qos local和'curr:qos remote'设置为'none',因为我们正处于本地或远程端都没有分配资源的阶段。
a=curr:qos local none
a=curr:qos remote none
a=des:qos mandatory local sendrecv
a=des:qos mandatory remote sendrecv
(3) PRACK
此消息是183会话进程的一种确认消息。这意味着“我收到了你发送的183 Session Progress消息”。在某些情况下,PRACK可以携带SDP。根据PRACH是否携带SDP,或者SDP中详细的qos设置,更新过程可能会有一些变化。
(4) 200 OK
这是针对PRACK的一个确认响应,它可以携带SDP的复杂消息。
(5) UPDATE
UPDATE消息从主叫发送到被叫。这个消息的主要目的是“好的,现在我已经准备好了。这种media和qos我这边已确认可设置”。
LTE情况下所需条件的一个例子是完成专用EPS承载设置。这意味着“更新将在专用EPS承载设置后发送”。
更新消息中SDP中qos设置的一个示例如下。在本例中,你将看到“本地qos满足要求”,因为curr:qos local sendrecv >= des:qos mandatory local sendrecv
a=curr:qos local sendrecv
a=curr:qos remote none
a=des:qos mandatory local sendrecv
a=des:qos mandatory remote sendrecv
(6) 200 OK
这是对更新的响应(确认)。另外,该消息的另一个重要功能是携带有qos参数的SDP。下面是这个SDP中qos参数的一个示例。你会看到“qos for both local and remote satisfies the requirement,现在因为” curr:qos local sendrecv >= des:qos mandatory local sendrecv and curr:qos remote sendrecv >= des:qos mandatory remote sendrecv”
a=curr:qos local sendrecv
a=curr:qos remote sendrecv
a=des:qos mandatory local sendrecv
a=des:qos mandatory remote sendrecv
一旦你看到这个qos设置状态,这意味着本地和远程均准备建立连接了。
(7) 180 Ringing
在这一步,被叫和主叫都会听到振铃的声音。因为这是一个重要的步骤,它将携带以下header。
Require: 100rel
这意味着下一步需要PRACK。
(8) PRACK
响应180 ringing的回复。
(9) 200 OK
PRACK的确认消息
(10) 200 OK
INVITE的确认消息
(11) ACK
200 OK的确认消息
下面看几个例子
< Example >
INVITE sip:user1@192.168.1.11:37607 SIP/2.0
Via: SIP/2.0/UDP 192.168.1.12:64700;branch=z9hG4bK635101086023655710;rport;transport=UDP
Max-Forwards: 69
Call-ID: 635101086023565705@192.168.1.2
CSeq: 6 INVITE
Via: SIP/2.0/UDP 192.168.1.2:64627;branch=z9hG4bK635101086023565705;transport=UDP
To: <sip:user1@anritsu-cscf.com>
From: <sip:0123456789@anritsu-cscf.com>;tag=1111111111
Contact: <sip:0123456789@anritsu-cscf.com:64627;transport=udp>
Allow: INVITE, UPDATE, ACK, CANCEL, BYE, PRACK, MESSAGE
Supported: 100rel // 指示支持 "PRACK"
Supported: precondition // 指示支持 "Precondition"
Accept-Contact: *;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-application.ims.iari.gsma-vs";require;explicit
Privacy: id
Content-Type: application/sdp
Content-Length: 565
Record-Route: <sip:192.168.1.2;lr>
< Example >
INVITE sip:0123456789;phone-context=one.att.net@one.att.net;user=phone SIP/2.0
Allow: INVITE,ACK,OPTIONS,CANCEL,BYE,UPDATE,INFO,REFER,NOTIFY,MESSAGE,PRACK
P-Preferred-Identity: <sip:310410123456789@one.att.net>
User-Agent: SAMSUNG IMS CLIENT 4.0
P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.mmtel
CSeq: 1 INVITE
Max-Forwards: 70
P-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=31041000010000000
Route: <sip:[2001:0:0:2::2]:5060;lr>
a: *;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
c: application/sdp
f: <sip:310410123456789@one.att.net>;tag=2763466811
i: 2270680280
k: 100rel,timer,precondition
l: 733
m: <sip:310410123456789@[2001:0:0:2::1]:5060;transport=UDP>;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
t: <sip:0123456789;phone-context=one.att.net@one.att.net;user=phone>
v: SIP/2.0/TCP [2001:0:0:2::1]:5060;branch=z9hG4bK932432170smg;transport=TCP
< Example >
SIP/2.0 183 Session Progress
Max-Forwards: 70
Via: SIP/2.0/TCP [2001:0:0:2::1]:5060;branch=z9hG4bK932432170smg;transport=TCP
From: <sip:310410123456789@one.att.net>;tag=2763466811
To: <sip:0123456789;phone-context=one.att.net@one.att.net;user=phone>;tag=1111111111
Call-ID: 2270680280
CSeq: 1 INVITE
Contact: <sip:0123456789@[2001:0:0:2::2]:65094;transport=tcp>
Record-Route: <sip:[2001:0:0:2::2];lr>
Content-Type: application/sdp
Require: precondition // 指示 "precondition"是要求的
Require: 100rel // 要求有 "PRACK" 消息
RSeq: 1
Content-Length: 763
Privacy: none
P-Asserted-Identity: <sip:0123456789>;phone-context=one.att.net@one.att.net;user=phone
Precondition 类型

如何知道前提条件是否满足,是否允许继续进行?
这个问题的答案很简单。具体如下:
Current condition (Resource Readiness) >= Desired Condition (Resource Requirement)
以下当前和所需状态的值不允许继续建立会话:
current status = resources reserved in the send direction
desired status = resources reserved in both (sendrecv) directions
另一方面,下面示例的值将使会话建立恢复:
current status = resources reserved in both (sendrecv) directions
desired status = resources reserved in the send direction
现在看几个真实的SIP消息例子


SDP协商
Full Sequence Example 1 : MO VoLTE with PreCondition

(1) INVITE
INVITE sip:0123456789;phone-context=test.net@test.net;user=phone SIP/2.0
Allow: INVITE,ACK,OPTIONS,CANCEL,BYE,UPDATE,INFO,REFER,NOTIFY,MESSAGE,PRACK
P-Preferred-Identity: <sip:310410123456789@test.net>
User-Agent: TEST IMS CLIENT 4.0
P-Preferred-Service: urn:urn-7:3gpp-service.ims.icsi.mmtel
CSeq: 1 INVITE
Max-Forwards: 70
P-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=31041000010000000
Route: <sip:[2001:0:0:2::2]:5060;lr>
a: *;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
c: application/sdp
f: <sip:310410123456789@test.net>;tag=2763466811
i: 2270680280
k: 100rel,timer,precondition
l: 733
m: <sip:310410123456789@[2001:0:0:2::1]:5060;transport=UDP>;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
t: <sip:0123456789;phone-context=test.net@test.net;user=phone>
v: SIP/2.0/TCP [2001:0:0:2::1]:5060;branch=z9hG4bK932432170smg;transport=TCP
v=0
o=TEST-IMS-UE 1234562 0 IN IP6 2001:0:0:2::1
s=SS VOIP
c=IN IP6 2001:0:0:2::1
t=0 0
m=audio 50000 RTP/AVP 116 107 97 115 111 110
b=AS:49
a=rtpmap:116 AMR-WB/16000
a=fmtp:116 mode-change-capability=2; max-red=0
a=rtpmap:107 AMR-WB/16000
a=fmtp:107 octet-align=1;mode-change-capability=2; max-red=0
a=rtpmap:97 AMR/8000
a=fmtp:97 mode-change-capability=2; max-red=0
a=rtpmap:115 AMR/8000
a=fmtp
(2) 100 Trying
SIP/2.0 100 Trying
Via: SIP/2.0/TCP [2001:0:0:2::1]:5060;branch=z9hG4bK932432170smg;transport=TCP
Max-Forwards: 70
From: <sip:310410123456789@test.net>;tag=2763466811
To: <sip:0123456789;phone-context=test.net@test.net;user=phone>
Call-ID: 2270680280
CSeq: 1 INVITE
Content-Length: 0
(3) 183 Session Progress
SIP/2.0 183 Session Progress
Max-Forwards: 70
Via: SIP/2.0/TCP [2001:0:0:2::1]:5060;branch=z9hG4bK932432170smg;transport=TCP
From: <sip:310410123456789@test.net>;tag=2763466811
To: <sip:0123456789;phone-context=test.net@test.net;user=phone>;tag=1111111111
Call-ID: 2270680280
CSeq: 1 INVITE
Contact: <sip:0123456789@[2001:0:0:2::2]:65094;transport=tcp>
Record-Route: <sip:[2001:0:0:2::2];lr>
Content-Type: application/sdp
Require: precondition
Require: 100rel
RSeq: 1
Content-Length: 763
Privacy: none
P-Asserted-Identity: <sip:0123456789>;phone-context=test.net@test.net;user=phone
v=0
o=anritsu 1 1 IN IP6 2001:0:0:2::2
s=SS VOIP
c=IN IP6 2001:0:0:2::2
t=0 0
m=audio 60000 RTP/AVP 116 107 97 115 111 110
b=AS:49
a=rtpmap:116 AMR-WB/16000
a=fmtp:116 mode-change-capability=2; max-red=0
a=rtpmap:107 AMR-WB/16000
a=fmtp:107 octet-align=1;mode-change-capability=2; max-red=0
a=rtpmap:97 AMR/8000
a=fmtp:97 mode-change-capability=2; max-red=0
a=rtpmap:115 AMR/8000
a=fmtp:115 octet-align=1;mode-change-capability=2; max-red=0
a=rtpmap:111 telephone-event/16000
a=fmtp:111 0-15
a=rtpmap:110 telephone-event/8000
a=fmtp:110 0-15
a=curr:qos local none // Indicate 'local' is not ready for communication since it does not meet 'des' condition
a=curr:qos remote none // Indicate 'remote' is not ready for communication since it does not meet 'des' condition
a=des:qos mandatory local sendrecv
a=des:qos mandatory remote sendrecv
a=sendrecv
a=ptime:20
a=maxptime:240
a=conf:qos remote sendrecv
a=rtcp:60001
(4) PRACK
PRACK sip:0123456789@[2001:0:0:2::2]:65094;transport=UDP SIP/2.0
RAck: 1 1 INVITE
CSeq: 2 PRACK
Max-Forwards: 70
P-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=31041000010000000
Route: <sip:[2001:0:0:2::2];lr>
f: <sip:310410123456789@test.net>;tag=2763466811
i: 2270680280
k: precondition
l: 0
t: <sip:0123456789;phone-context=test.net@test.net;user=phone>;tag=1111111111
v: SIP/2.0/UDP [2001:0:0:2::1]:5060;branch=z9hG4bK367193557smg;transport=UDP
(5) 200 OK
SIP/2.0 200 OK
Max-Forwards: 70
Via: SIP/2.0/TCP [2001:0:0:2::1]:5060;branch=z9hG4bK1835967788smg;transport=TCP
From: <sip:310410123456789@test.net>;tag=2763466811
To: <sip:0123456789;phone-context=test.net@test.net;user=phone>;tag=1111111111
Call-ID: 2270680280
CSeq: 3 UPDATE
Allow: INVITE, ACK, CANCEL, BYE, PRACK, MESSAGE
Contact: <sip:0123456789@[2001:0:0:2::2]:65094;transport=tcp>
Record-Route: <sip:[2001:0:0:2::2];lr>
Content-Type: application/sdp
Content-Length: 743
Privacy: none
v=0
o=anritsu 1 2 IN IP6 2001:0:0:2::2
s=SS VOIP
c=IN IP6 2001:0:0:2::2
t=0 0
m=audio 60000 RTP/AVP 116 107 97 115 111 110
b=AS:49
a=rtpmap:116 AMR-WB/16000
a=fmtp:116 mode-change-capability=2; max-red=0
a=rtpmap:107 AMR-WB/16000
a=fmtp:107 octet-align=1;mode-change-capability=2; max-red=0
a=rtpmap:97 AMR/8000
a=fmtp:97 mode-change-capability=2; max-red=0
a=rtpmap:115 AMR/8000
a=fmtp:115 octet-align=1;mode-change-capability=2; max-red=0
a=rtpmap:111 telephone-event/16000
a=fmtp:111 0-15
a=rtpmap:110 telephone-event/8000
a=fmtp:110 0-15
a=curr:qos local sendrecv // Indicate 'local' is ready for communication since it meets 'des' condition
a=curr:qos remote sendrecv // Indicate 'remote' is ready for communication since it meets 'des' condition
a=des:qos mandatory local sendrecv
a=des:qos mandatory remote sendrecv
a=sendrecv
a=ptime:20
a=maxptime:240
a=rtcp:60001
(6) UPDATE
SIUPDATE sip:0123456789@[2001:0:0:2::2]:65094;transport=TCP SIP/2.0
Proxy-Require: sec-agree
Security-Verify:
CSeq: 3 UPDATE
Max-Forwards: 70
P-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=31041000010000000
Route: <sip:[2001:0:0:2::2];lr>
c: application/sdp
f: <sip:310410123456789@test.net>;tag=2763466811
i: 2270680280
l: 738
m: <sip:310410123456789@[2001:0:0:2::1]:5060;transport=UDP>
t: <sip:0123456789;phone-context=test.net@test.net;user=phone>;tag=1111111111
v: SIP/2.0/TCP [2001:0:0:2::1]:5060;branch=z9hG4bK1835967788smg;transport=TCP
v=0
o=TEST-IMS-UE 1234562 1 IN IP6 2001:0:0:2::1
s=SS VOIP
c=IN IP6 2001:0:0:2::1
t=0 0
m=audio 50000 RTP/AVP 116 107 97 115 111 110
b=AS:49
a=rtpmap:116 AMR-WB/16000
a=fmtp:116 mode-change-capability=2; max-red=0
a=rtpmap:107 AMR-WB/16000
a=fmtp:107 octet-align=1;mode-change-capability=2; max-red=0
a=rtpmap:97 AMR/8000
a=fmtp:97 mode-change-capability=2; max-red=0
a=rtpmap:115 AMR/8000
a=fmtp:115 octet-align=1;mode-change-capability=2; max-red=0
a=rtpmap:111 telephone-event/16000
a=fmtp:111 0-15
a=rtpmap:110 telephone-event/8000
a=fmtp:110 0-15
a=curr:qos local sendrecv // Indicate 'local' is ready for communication since it meets 'des' condition
a=curr:qos remote none //Indicate 'remote' is not ready for communication since it does not meet 'des' condition
a=des:qos mandatory local sendrecv
a=des:qos mandatory remote sendrecv
a=sendrecv
a=ptime:20
a=maxptime:240
(7) 200 OK
SIP/2.0 200 OK
Max-Forwards: 70
Via: SIP/2.0/TCP [2001:0:0:2::1]:5060;branch=z9hG4bK1835967788smg;transport=TCP
From: <sip:310410123456789@test.net>;tag=2763466811
To: <sip:0123456789;phone-context=test.net@test.net;user=phone>;tag=1111111111
Call-ID: 2270680280
CSeq: 3 UPDATE
Allow: INVITE, ACK, CANCEL, BYE, PRACK, MESSAGE
Contact: <sip:0123456789@[2001:0:0:2::2]:65094;transport=tcp>
Record-Route: <sip:[2001:0:0:2::2];lr>
Content-Type: application/sdp
Content-Length: 743
Privacy: none
v=0
o=anritsu 1 2 IN IP6 2001:0:0:2::2
s=SS VOIP
c=IN IP6 2001:0:0:2::2
t=0 0
m=audio 60000 RTP/AVP 116 107 97 115 111 110
b=AS:49
a=rtpmap:116 AMR-WB/16000
a=fmtp:116 mode-change-capability=2; max-red=0
a=rtpmap:107 AMR-WB/16000
a=fmtp:107 octet-align=1;mode-change-capability=2; max-red=0
a=rtpmap:97 AMR/8000
a=fmtp:97 mode-change-capability=2; max-red=0
a=rtpmap:115 AMR/8000
a=fmtp:115 octet-align=1;mode-change-capability=2; max-red=0
a=rtpmap:111 telephone-event/16000
a=fmtp:111 0-15
a=rtpmap:110 telephone-event/8000
a=fmtp:110 0-15
a=curr:qos local sendrecv // Indicate 'local' is ready for communication since it meets 'des' condition
a=curr:qos remote sendrecv // Indicate 'remote' is ready for communication since it meets 'des' condition
a=des:qos mandatory local sendrecv
a=des:qos mandatory remote sendrecv
a=sendrecv
a=ptime:20
a=maxptime:240
a=rtcp:60001
(8) 180 Ringing
SIP/2.0 180 Ringing
Max-Forwards: 70
Via: SIP/2.0/TCP [2001:0:0:2::1]:5060;branch=z9hG4bK932432170smg;transport=TCP
From: <sip:310410123456789@test.net>;tag=2763466811
To: <sip:0123456789;phone-context=test.net@test.net;user=phone>;tag=1111111111
Call-ID: 2270680280
CSeq: 1 INVITE
Contact: <sip:0123456789@[2001:0:0:2::2]:65094;transport=tcp>
Record-Route: <sip:[2001:0:0:2::2];lr>
Require: 100rel
RSeq: 2
Content-Length: 0
Privacy: none
P-Asserted-Identity: <sip:0123456789>;phone-context=test.net@test.net;user=phone
(9) PRACK
PRACK sip:0123456789@[2001:0:0:2::2]:65094;transport=UDP SIP/2.0
RAck: 2 1 INVITE
CSeq: 4 PRACK
Max-Forwards: 70
P-Access-Network-Info: 3GPP-E-UTRAN-FDD;utran-cell-id-3gpp=31041000010000000
Route: <sip:[2001:0:0:2::2];lr>
f: <sip:310410123456789@test.net>;tag=2763466811
i: 2270680280
l: 0
t: <sip:0123456789;phone-context=test.net@test.net;user=phone>;tag=1111111111
v: SIP/2.0/UDP [2001:0:0:2::1]:5060;branch=z9hG4bK589904351smg;transport=UDP
(10) 200 OK
SIP/2.0 200 OK
Max-Forwards: 70
Via: SIP/2.0/UDP [2001:0:0:2::1]:5060;branch=z9hG4bK589904351smg;transport=UDP
From: <sip:310410123456789@test.net>;tag=2763466811
To: <sip:0123456789;phone-context=test.net@test.net;user=phone>;tag=1111111111
Call-ID: 2270680280
CSeq: 4 PRACK
Allow: INVITE, ACK, CANCEL, BYE, PRACK, MESSAGE
Contact: <sip:0123456789@[2001:0:0:2::2]:65487;transport=udp>
Record-Route: <sip:[2001:0:0:2::2];lr>
Supported: 100rel
Content-Length: 0
Privacy: none
(11) 200 OK
SIP/2.0 200 OK
Max-Forwards: 70
Via: SIP/2.0/TCP [2001:0:0:2::1]:5060;branch=z9hG4bK932432170smg;transport=TCP
From: <sip:310410123456789@test.net>;tag=2763466811
To: <sip:0123456789;phone-context=test.net@test.net;user=phone>;tag=1111111111
Call-ID: 2270680280
CSeq: 1 INVITE
Allow: INVITE, ACK, CANCEL, BYE, PRACK, MESSAGE
Contact: <sip:0123456789@[2001:0:0:2::2]:65487;transport=udp>
Record-Route: <sip:[2001:0:0:2::2];lr>
Content-Length: 0
Privacy: none
P-Asserted-Identity: <sip:0123456789>;phone-context=test.net@test.net;user=phone
(12) ACK
ACK sip:0123456789@[2001:0:0:2::2]:65487;transport=UDP SIP/2.0
CSeq: 1 ACK
Max-Forwards: 70
Route: <sip:[2001:0:0:2::2];lr>
f: <sip:310410123456789@test.net>;tag=2763466811
i: 2270680280
l: 0
m: <sip:310410123456789@[2001:0:0:2::1]:5060;transport=UDP>;+g.3gpp.icsi-ref="urn%3Aurn-7%3A3gpp-service.ims.icsi.mmtel"
t: <sip:0123456789;phone-context=test.net@test.net;user=phone>;tag=1111111111
v: SIP/2.0/UDP [2001:0:0:2::1]:5060;branch=z9hG4bK2949521758smg;transport=UDP