preconditions require thatthe participant reserve network resources before continuing withthe session. We do not define new quality ofservice reservation mechanisms; these preconditions simply requirea participant to use existing resource reservation mechanismsbefore beginning the session. ...... A precondition is a set ofconstraints about the session which are introduced in theoffer.
Preconditions就是让参与则在会话建立之前,保留网络资源
Precondition包括3种状态当前状态、请求的状态以及确认的状态。
current-status = "a=curr:" precondition-type
SPstatus-type SP direction-tag
desired-status = "a=des:" precondition-type
SPstrength-tag SP status-type
SPdirection-tag
confirm-status = "a=conf:" precondition-type
SPstatus-type SP direction-tag
precondition-type = "qos" |token
strength-tag = ("mandatory" | "optional" |"none"
= | "failure" | "unknown")
status-type = ("e2e" | "local" | "remote")
direction-tag = ("none" | "send" | "recv" |"sendrecv")
//curren-staus 当前媒体流所有的网络资源状态
//desired-status就是需要preconditions预前需要提供的网络资源状态
//confirm-status 一个阈值。当网络资源状态达到这个阈值时,对端的UA就要发送update消息说明当前流媒体的状态。
When the status of network resources reach theseconditions, the peer user agent will
send an update of the session descriptioncontaining an updated current status attributefor
this particularmedia stream.
//strength-tag当precondition没有达到要求时,主叫是否需要alerting.
//status-type表明 e2e就是end to end端到端的意思
//direction-TAG表明该precondition是用于发送还是用于接收
Preconditons常见的场景如下
【VOLTE】VOLTE中的Precondition
A给B拨打电话
1.A不希望在A和B的网络资源未准备好之前B振铃,B也同意。
2.当A呼叫B,B接到INVITE消息后,并不马上振铃,而是回复183(session progress)给A,让A保留所需要的网络资源
3.A收到B的183(session progress)后,开始准备预留网络资源,当准备完成后,发送update消息给B
4.当B接收到A的update消息,表明A的网络资源已预留好了之后,然后开始振铃。
(1) INVITE
INVITEsip:0123456789;phone-context=test.net@test.net;user=phoneSIP/2.0
Allow:INVITE,ACK,OPTIONS,CANCEL,BYE,UPDATE,INFO,REFER,NOTIFY,MESSAGE,PRACK
P-Preferred-Identity:
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:
a:*;+g.3gpp.icsi-ref="urn:urn-7:3gpp-service.ims.icsi.mmtel"
c: application/sdp
f: ;tag=2763466811
i: 2270680280
k: 100rel,timer,precondition //需要对方的precondition
l: 733
m:;+g.3gpp.icsi-ref="urn:urn-7:3gpp-service.ims.icsi.mmtel"
t:
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
(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: ;tag=2763466811
To: ;tag=1111111111
Call-ID: 2270680280
CSeq: 1 INVITE
Contact:
Record-Route:
Content-Type: application/sdp
Require: precondition
Require: 100rel
RSeq: 1
Content-Length: 763
Privacy: none
P-Asserted-Identity:;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 communicationsince 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
(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: ;tag=2763466811
To: ;tag=1111111111
Call-ID: 2270680280
CSeq: 3 UPDATE
Allow: INVITE, ACK, CANCEL, BYE, PRACK, MESSAGE
Contact:
Record-Route:
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=TCPSIP/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:
c: application/sdp
f: ;tag=2763466811
i: 2270680280
l: 738
m:
t: ;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 sinceit meets 'des'condition
a=curr:qos remote none //Indicate 'remote' is not ready for communication since itdoes 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: ;tag=2763466811
To: ;tag=1111111111
Call-ID: 2270680280
CSeq: 3 UPDATE
Allow: INVITE, ACK, CANCEL, BYE, PRACK, MESSAGE
Contact:
Record-Route:
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
参考文档:
http://www.sharetechnote.com/
————————————————
版权声明:本文为CSDN博主「时九19」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/shij19/article/details/52946502
来源:CSDN
作者:一叶知秋dong
链接:https://blog.csdn.net/dxpqxb/article/details/103706039