preconditions require thatthe participant reserve network resources before continuing withthe session.
Preconditions就是让参与则在会话建立之前,保留网络资源
Precondition包括3种状态当前状态、请求的状态以及确认的状态。
current-status
desired-status
confirm-status
precondition-type
strength-tag
status-type
direction-tag
//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常见的场景如下
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