在SIP中实现RSVP功能
在SIP中实现RSVP的步骤如图3-9所示。
图3-9中实线的部分是SIP命令,虚线部分是RSVP消息。首先创建一个RSVP的会话萸 例,如果成功则返回一个非零的数值用于表示建立的会话ID号,创建会话是为了发送RSVP PATH或者是发送RSVP RESVo接下来的流程如下:
(1) 主叫部分发送INVITE命令,命令中包含有主叫的会话描述(这里称为Remote SDP )。
(2) 被叫部分此时处于OpRing的状态中接收到主叫的INVITE消息以后,根据主叫的 INVITE消息和主叫的SDP,得到主叫的地址和主叫的RSVP端口(主叫的RTP端口);被叫 发送包含有数据流标识和数据业务流特征的PATH消息到主叫。
(3) 在完成了一系列SIP命令和状态的交换(RING, OK过程)以后,主叫方开始准备 发送ACK消息了,主叫在下一个过程(收到ACK消息后,打开RTP通道之前)的时候,已 经保证了所有的主叫到被叫之间的路由器都已经收到了 PATH预留消息。
(4) 5和6两个消息是主叫端点向被叫端点发送PATH消息,并且接收对端的RESV消息 的过程。
SIP COMET
只有当所有条件满足时,才会发送COMET。
1.SDP扩展
扩展SDP的BNF描述如下:
qos-attribute="a=qos:" strength-tag SP direction-tag[SP confirmation-tag];服务质量属性 strength-tag= ("mandatory" I "optional" I "success" l"failure")
direction-tag= ("send" I "recv" I "sendrecv") confirmation-tag = "confirm" security-attribute="a=secure:"SP strength-tag SP direction-tag[SP confirmation-tag]
2. SDP实例
2. SDP实例
以下为从A到B的SIP INVITE中的SDP描述。
v=0
o=mhandley 2890844526 2890842807 IN IP4 126.16.64.4
s=SDP Seminar
i=A Seminar on the session description protocol
u=http://www.cs.ucl.ac.uk/staff/M.Handley/sd p.03.ps
e=mjh@isi.edu (Mark Handley)
c=INIP4 224.2.17.12/127
t=2873397496 2873404696
m=audio 49170 RTP/AVP 0;媒体类型 a=qos:mandatory recv confirm
"m=video 51372 RTP/AVP 31;媒体类型 a=secure:mandatory sendrecv m=application 32416 udp wb a=orient:portrait
a=qos:optional sendrecv a=secure:optional sendrecv
1. SIP流程
SIP的工作流程如图3.10所示。
策略服务
1. 模型
策略服务模型如图3-11所示,其中,issll 为 Intergrated Services over Specific Lower Layers , APS为应用策略服务器。
2. OSP (Open Settlements Protocol)OSP流程如图3・12所示。
1) SIP消息
消息如下:
INVITE sip:+1-972-555-5555 @sip.domain2.com;user=phone SIP/2.0
Via: SIP/2.0/UDP phone 1.domain 1.com:5060
From: Henry Sinnreich henry.sinnreich@phone 1 .domain].com; 发端
To: <sip:+1972-555-5555@sip.domain2.com;user=phone>;收端
Callid: 123456 @ domain 1 .com
Cseq: 1 INVITE
Contact: phone 1 .domain 1 .com
SDP
QoS required
2) COPS消息
消息如下:.
REQ OSP =
(Common Header, Client Handle, Context, ClientSI: OSP)
Client Handle = "123456@domainl.com"
Context = "Incoming & Outgoing", "OSP"
ClientSI: OSP = (Called Number, Calling Number)
Called Number = "To: <sip:+1972-555-5555@sip.domain2.com;user=phone>";收端
Calling Number = "From: Henry Sinnreich;发端
henry.sinnreich @phone 1 .domain l.comn
3) OSP消息
消息如下:
<AuthReq>
<?xml version=1.0?>
<Message messageld=" 123454321" random=n12345678">
<AuthorizationRequest componentId="9876567890M>
<Timestamp>
1999-10-24T17:03:00Z
</Timestamp>
<CallId encoding="base64"> YT64VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756t
</CallId>
<SourceInfo type=Hhenry.sinnreich @phone 1 .domain 1 ,com">
</SourceInfb>
<DestinationInfo type="el64">
1-972-555-5555
</DestinationInfb>
<Service/>
<MaximumDestinations>
5
</MaximumDestinations>
</AuthorizationRequest>
</Message> <AuthReq/>
4) OSP消息
消息如下:
<AuthRsp>
<?xml version=1.0?>
<Message messageld=" 123454321" random="l 2345678 ">
<AuthorizationResponse componentId=H9876567890"> <Timestamp>
1999-10-24T17:03:01Z
</Timestamp>
<Status> 、
<Code>
200
</Code>
<Description>
success
</Description>
</Status>
<TransactionId>
67890987
</TransactionId>
<Destination>
<DestinationSignalAddress>
[172.16.1.2]:112
</DestinationSignalAddress>
<Token encoding="base64">
YT64VqpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756t
HGTrfvbnjn8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfH
6ghyHhHUujpfyF47GhIGfHfYT64VQbnj
</Token>
<ValidAfter>
1999-04-24T17:01:01Z
</ValidAfter>
<ValidUntil>
1998-04-24T17:ll:01Z
</ValidUntil>
<CallId encoding="base64">
YT64VqpfyF467GhIGfHfYT6jH 力 n8HHGghyHhHUujhJh756t </CalUd>
<UsageDetail>
<Service/>
<Amount>
24
</Amount>
<Increment>
3600
</Increment>
<Unit>
s
</Unit>
</UsageDetail>
</Destination>
</AuthorizationResponse>
</Message>
<AuthRsp>
5) COPS消息
消息如下:
DEC = (Common Header, Client Handle, Context,
Decision Flag,Decision: ClientSI Data: OSP)
Client Handle = "123456@domainl.com"
Context = "Incoming & Outgoing"
Decision Flag = "Install"
Decision: ClientSI Data: OSP = (Called Number, Authorization Token)
Called Number = "To: <sip:+1972-555-5555@sip.domain2.com;user=phone>" Authorization Token = "<Token encoding=nbase64n>
YT64VQpfyF467GhIGfHfYT6jH77n8HHGghyHhHUujhJh756t HGTrfvbnjn8HHGTrfvhJhjH776tbB9HG4VQbnj7567GhIGfH 6ghyHhHUujpfyF47GhIGfHfYT64VQbnj
</Token>"
Opt. SIP
SIP/2.0 100 Trying
Via: SIP/2.0/UDP phone 1 .domain 1 .com:5060
From: Henry Sinnreich <henry.sinnreich@phone 1 .domain 1 .com>
To: <sip:+l972-555-5555@sip.domain2.com;user=phone>
Callid: 123456 @ domain 1 .com
Cseq: 1 INVITE
6) SIP消息
消息如下:
INVITE sip:+l-972-555-5555 @sip.domain2.com;user=phone SIP/2.0
Via: SIP/2.0/UDP sip.domain 1 .com:5060
Via: SIP/2.0/UDP phone 1 .domainl .com:5060
From: Henry Sinnreich <henry.sinnreich@phone 1 .domain 1 .com>
To: <sip:+1972-555-5555@sip.domain2.com;user=phone>
Callid: 123456@ domain 1 .com
Cseq: 1 INVITE
Contact: phonel.domainl.com
Record-Route: sip.domainl.com
SDP
QOS required
7) SIP消息
消息如下:
INVITE sip:+l-972-555-5555@sip.domain2.com;user=phone SIP/2.0
Via: SIP/2.0/UDP sip.domain2.com:5060
Via: SIP/2.0/UDP sip.domain 1 .com:5060
Via: SIP/2.0/UDP phone 1 .domain 1 .com:5060
From: Henry Sinnreich <henry.sinnreich @ phone 1 .domain 1 .com>
To: <sip:+l972-555-5555@sip.domain2.com;user=phone>
Callid: 123456@domain 1 .com
Cseq: 1 INVITE
Contact: phone 1 .domain 1 .com
Record-Route: sip.domainl.com
SDP
QOS required '
8) SIP消息
消息如下: "
SIP/2.0 183 Session Progress
Wa: SIP/2.0/UDP sip.domain2.com:5060
Via: SIP/2.0/UDP sip.domainl.com:5060
Via: SIP/2.0/UDP phone 1 .domain 1 .com:5060
From: Henry Sinnreich <henry.sinnreich @phone 1 .domain 1 .com>
To: <sip:+1972-555-5555@sip.domain2.com;user=phone>;tag=134159
Callid: 123456@domain 1 .com
Cseq: 1 INVITE
SDP
QoS required
9) COPS消息
消息如下:
REQ AssuredLDP=
(Common Header, Client Handle, Context, ClientSI: ConfigLocalPolicy)
Client Handle = " 123456 @ domain 1 .com"
Context = "Configuration Request" ,nConfigLocalDecisionPolicy"
ClientSI: ConfigLocalDecisionPolicy = ( Caller Media Address, Caller Media
Port, Caller SDP info, Callee Media Address, Callee Media Port, Callee SDP
info)
10) COPS 消息
消息如下:
DEC =
(Common Header, Client Handle) (Decision) I (Error)
Client Handle = nR1001"
Decision = (Context, Decision Flag, Named Decision Data: Config Local DecisionPolicy)
Context = "Configuration Request", "ConfigLocalDecisionPolicy"
Decision Flag = "Install"
Named Decision Data: (Binding Count, PRID, BPD)
Binding Count = 1
PRID = "1.2.3.4"
BPD = (Ace of Caller flow, Caller Token rate, Caller Peak rate, Caller Token Bucket Size, Caller Min Policed Unit, Caller Max Packet Size, Caller Reservation Style, Caller DSCLASS, Caller POLICY)
I (Ace of Callee flow, Callee Token rate, Callee Peak rate, Callee Token Bucket Size, Callee Min Policed Unit, Callee Max Packet Size, Callee Reservation Style, Callee DSCLASS, Callee POLICY ))
11) COPS 消息
消息如下:
RPT =
(Common Header, Client Handle, Report-Type, ClientSI: ConfigRPT) Client Handle = "PEP1001
Report-Type = "Installed"
ClientSI = (PRID)
PRIDu “1.2.34”
12) COPS 消息 *
消息如下:
DEC =
(Common Header, Client Handle, Context, Decision Flags)
Client Handle = " 123456 @ domain 1 .com"
Context = "Incoming&O utgoing","ConfigLocalDecisionPolicy"
Decision Flag = "Install"
13) SIP消息
消息如下:
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP sip.domain2.com:5060
Via: SIP/2.0/UDP sip.domainl;com:5060
Via: SIP/2.0/UDP phone 1 .domain 1 .com:5060
From: Henry Sinnreich <henry.sinnreich@phonel.domainl.com>
To: <sip:+1972-555-5555@sip.domain2.com;user=phone>;tag=134159
Callid: 123456 @ domain 1 .com
Cseq: 1 INVITE
…
SDP
QoS required
14) COPS 消息
消息如下:
REQ
AssuredLDP= (Common Header, Client Handle, Context, ClientSI:
ConfigLocalPolicy)
Client Handle = " 123456 @ domain 1 .com"
Context = "Configuration Request1',"ConfigLocalDecisionPolicy"
ClientSI: ConfigLocalDecisionPolicy = ( Caller Media Address, Caller Media Port, Caller SDP info, Callee Media Address, Callee Media Port, Callee SDP info)
15) COPS 消息
消息如下:
DEC =
(Common Header, Client Handle) (Decision) I (Error)
Client Handle = nR100r'
Decision = (Context, Decision Flag, Named Decision Data: Config Local DecisionPolicy)
Context = "Configuration Request", "ConfigLocalDecisionPolicy"
Decision Flag = "InstalF*
Named Decision Data: (Binding Count, PRID, BPD)
Binding Count = 1
PRID = nl.2.3.4"
BPD = (Ace of Cdler flow, Caller Token rate, Caller Peak rate, Caller Token Bucket Size, Caller Min Policed Unit, Caller Max Packet Size, Caller Reservation Style, Caller DSCLASS, Caller POLICY)
I (Ace of Callee flow, Callee Token rate, Callee Peak rate, Callee Token Bucket Size, Callee Min Policed Unit, Callee Max Packet Size, Callee Reservation Style, Callee DSCLASS, Callee POLICY ))
16) COPS 消息
消息如下:
RPT =
(Common Header, Client Handle, Report-Type, ClientSI: ConfigRPT)
Client Handle 二"PEP1001
Report-Type = "Installed"
ClientSI = (PRID)
PRID = n1.2.3.4n
17) COPS 消息
消息如下:
DEC =
(Common Header, Client Handle, Context, Decision Flags)
Client Handle = " 123456@domainl.com"
Context = "Incoming&Outgoing'V'ConfigLocalDecisionPolicy"
Decision Flag = "Install"
18) SIP消息
消息如下:
SIP/2.0 183 Session Progress
Via: SIP/2.0/UDP sip.domain2.com:5060
Via: SIP/2.0/UDP sip.domainl.com:5060
Via: SIP/2.0/UDP phonel.domain 1 .com:5060
From: Henry Sinnreich <henry.sinnreich@phone 1 .domain 1 .com>
To: <sip:+1972-555-5555@sip.domain2.com;user=phone>;tag=134159 Callid: 123456 @ domain 1 .com
Cseq: 1 INVITE
SDP
QoS required
19) RSVP 消息
消息如下:
PATH 二
(Common Header, [INTEGRITY], SESSION, RSVP.HOP, TIME„VALUES,[
(POLICY_DATA) +], [sender descriptor]
Sender descriptor = (SENDER_TEMPLATE,SENDER_TSPEC, [ADSPEC])
Note: Messages 19 - 31 are for Caller to Callee flow.
20) RSVP 消息
.见消息19)。
21) RSVP 消息 见消息19)0
22) RSVP 消息
RESV = ( Common Header, [INTEGRITY], SESSION, RSVP_HOP, TIME_VALUES,[RESV_ CONFIRM], [SCOPE], [(POLICY_DAIA) + ] STYLE, flow descriptor list)
23) RSVP 消息 见消息22)。
24) RSVP 消息 见消息22)。
25) RSVP 消息
消息如下:
RESV-CONF =(Common Header, [INTEGRITY], SESSION, ERROR_SPEC, RESV_CONHRM,
STYLE,flow descriptor list)
26) RSVP 消息 见消息25)。
27) RSVP 消息 见消息25)。
28) RSVP 消息 见消息19)。
29) RSVP 消息 见消息19)。
30) RSVP 消息 见消息19)。
31) RSVP 消息 见消息22)。
32) RSVP 消息 •见消息22)。
33) RSVP 消息 见消息22)。
34) RSVP 消息 见消息25)。
35) RSVP 消息 见消息25)。
36) RSVP 消息 见消息25)。
37) SIP消息
消息如下:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP sip.domain2.com:5060
Via: SIP/2.0/UDP sip.domain 1 .com:5060
Via: SIP/2.0/UDP phone 1 .domain 1 .com:5060
From: Henry Sinnreich <henry.sinnreich@phonel.domainl.com>
To: <sip:+1972-555-5555@sip.domain2.com;user=phone>;tag=134159 Callid: 123456@ domain 1 .com
Cseq: 1 INVITE
SDP(可选)
38) SIP消息
消息如下:
SIP/2.0 183 Ringing
Via: SIP/2.0/UDP sip.domain2.com:5060
Via: SIP/2.0/UDP sip.domain 1 .com:5060
Via: SIP/2.0/UDP phonel .domain 1 .com:5060
From: Henry Sinnreich <henry.sinnreich@phonel .domainl.com>
To: <sip:+1972-555-5555@sip.domain2.com;user=phone>;tag=134159
Callid:- 123456@domainl.com
Cseq: 1 INVITE
SDP(可选)
39) SIP消息
消息如下:
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP sip.domain2.com:5060
Via: SIP/2.0/UDP sip.domain 1 .com:5060
Via: SIP/2.0/UDP phone 1 .domain 1 .com:5060
From: Henry Sinnreich <henry.sinnreich@phonel.domainl.com>
To: <sip:+1972-555-5555@sip.domain2.com;user=phone>;tag=134159
Callid: 123456 @domain 1 .com
Cseq: 1 INVITE
SDP(可选)
40) SIP消息
消息如下:
SIP/2.0 200 OK
Via: SIP/2.0/UDP sip.domain2.com:5060
Via: SIP/2.0/UDP sip.domain 1 ,com:5060
Via: SIP/2.0/UDPphonel.domainl.com:5060
From: Henry Sinnreich <henry.sinnreich@phonel.domainl.com>
To: <sip:+1972-555-5555@sip.domainl.com;user=phone>;tag=134159
Callid: 123456@domainl.com
Cseq: 1 INVITE
Contact: 972gw.domain2.com
Record-Route: sip.domain 1 .com, sip.domain2.com
SDP (可选)
41) SIP消息
消息如下:
SIP/2.0 200 OK
Via: SIP/2.0/UDP sip.domainl.com:5060
Via: SIP/2.0/UDP phone 1 .domain 1 .com:5060
From: Henry Sinnreich <henry.sinnreich@phonel.domainl.com>
To: <sip:+1972-555-5555@sip.domain2.com;user=phone>;tag=134159
Callid: 123456 @ domain 1. com
Cseq: 1 INVITE
Contact: 972gw.domain2.com
Record-Route: sip.domainl.com, sip.domain2.com
SDP (可选)
42) SIP消息
消息如下:
SIP/2.0 200 OK
Via: SIP/2.0/UDP phonel.domainl.com:5060 ”
From: Henry Sinnreich <henry.sinnreich@phonel.domainl.com>
To: <sip:+1972-555-5555@sip.domain2.com;user=phone>;tag=134159
Callid: 123456@domainl.com
Cseq:l INVITE
Contact: 972gw.domain2.coni
Record-Route: sip.domainLcom, sip.domain2.com
SDP何选)
43) SIP消息
消息如下:
ACK sip.domainl.com SIP/2.0
Via: SIP/2.0/UDP phone 1 .domain 1 .com:5060
From: Henry Sinnreich <henry.sinnreich @phone 1 .domain 1 .com>
To: <sip:+1972-555-5555@sip.domain2.com;user=phone>;tag=134159
Callid: 123456 @ domain 1 .com
Cseq: 1 INVITE
Route: sip.domain2.com, gw972.domain2.com
SDP(可选)
44) SIP消息
消息如下:
ACK sip.domain2.com SIP/2.0
Via: SIP/2.0/UDP sip.domainl .com:5060
Via: SIP/2.0/UDP phone 1 .domain 1 .com:5060
From: Henry Sinnreich <henry.sinnreich@phonel.domainl.com>
To: <sip:+1972-555-5555@sip.domain2.com;user=phone>;tag=134159
Callid: 123456 @ domain 1 .com
Cseq: 1 INVITE
Route: gw972.domain2.com
SDP (可选)
45) SIP消息
消息如下:
ACK gw972.domain2.com SIP/2.0
Via: SIP/2.0/UDP sip.domain2.com:5060
Via: SIP/2.0/UDP sip.domain 1 .com:5060
Via: SIP/2.0/UDP phone 1 .domain 1 ,com:5060
From: Henry Sinnreich <henry.sinnreich @phone 1 .domain 1 .com>
To: <sip:+1972-555-5555@sip.domain2.com;user=phone>;tag=134159
Callid: 123456 @ domain 1 .com
Cseq: 1 INVITE
SDP (可选)
3.0SP相关头部使用范围
OSA相关头部使用范围如表3-10所示。