本文共 5421 字,大约阅读时间需要 18 分钟。
· If more than one Contact issent in a REGISTER request, the
registering UA intends toassociate all of the URIs in these Contact
header field values with theaddress-of-record present in the To
field. This list can beprioritized with the "q" parameter in the
Contact header field. The"q" parameter indicates a relative
preference for theparticular Contact header field value compared to
other bindings for thisaddress-of-record. Section 16.6 describes
how a proxy server uses thispreference indication.
---10.2.1.2Preferences among Contact Addresses
Contact的"q"参数如何理解?
· Independent of the method,if a request outside of a dialog generates
a non-2xx final response, any early dialogscreated through
provisional responses to that request areterminated. The mechanism
for terminating confirmed dialogs is methodspecific. In this
specification, the BYE method terminates asession and the dialog
associated with it. See Section 15 for details.
---12.3 Termination of a Dialog
注:参考A UA MUST NOT send a BYE outside of a dialog理解,所以cancel结束早期会话的时候,需要再发送487 Request Terminated结束会话。
· If the INVITE requestcontained an offer, and the UAS had not yet
sent an answer, the 2xx MUSTcontain an answer. If the INVITE did
not contain an offer, the2xx MUST contain an offer if the UAS had
not yet sent an offer.
---13.3.1.4The INVITE is Accepted
注:如何理解?
· Therefore, it is necessary
to periodically pass theresponse directly to the transport until the
ACK arrives. The 2xxresponse is passed to the transport with an
interval that starts at T1seconds and doubles for each
retransmission until itreaches T2 seconds (T1 and T2 are defined in
Section 17). Responseretransmissions cease when an ACK request for
the response is received. Thisis independent of whatever transport
protocols are used to sendthe response.
If the server retransmitsthe 2xx response for 64*T1 seconds without
receiving an ACK, the dialogis confirmed, but the session SHOULD be
terminated. This isaccomplished with a BYE, as described in Section
15.
---13.3.1.4The INVITE is Accepted
看起来200 OK传输是可靠的
· A stateful proxy has aserver
transaction associated withone or more client transactions by a
higher layer proxyprocessing component (see figure 3), known as a
proxy core. An incomingrequest is processed by a server
transaction. Requests fromthe server transaction are passed to a
proxy core. The proxy coredetermines where to route the request,
choosing one or morenext-hop locations. An outgoing request for
each next-hop location isprocessed by its own associated client
transaction. The proxy corecollects the responses from the client
transactions and uses themto send responses to the server
transaction.
A stateful proxy creates anew server transaction for each new
request received. Anyretransmissions of the request will then be
handled by that servertransaction per Section 17
---16.2Stateful Proxy
注:走UDP的重发机制,可以借鉴使用
· when the user hangs up, itindicates a desire to
terminate the attempt toestablish a session, and to terminate any
sessions already created
---15Terminating a Session
session分两种:尚未建立的以及已经建立
· Once the BYE is constructed,the UAC core creates a new non-INVITE
client transaction, andpasses it the BYE request. The UAC MUST
consider the sessionterminated (and therefore stop sending or
listening for media) as soonas the BYE request is passed to the
client transaction. If theresponse for the BYE is a 481
(Call/Transaction Does NotExist) or a 408 (Request Timeout) or no
response at all is receivedfor the BYE (that is, a timeout is
returned by the clienttransaction), the UAC MUST consider the
session and the dialogterminated.
This rule means that a BYEsent without tags by a UAC will be
Rejected(a 481 Call/Transaction Does Not Exist response
). This is a change from RFC2543, which allowed BYE
without tags.
---15.1.1 UACBehavior
· SIP proxies are elementsthat route SIP requests to user agent
servers and SIP responses touser agent clients.
…...
Responses will route throughthe same set of proxies
traversed by the request inthe reverse order.
---16.1Overview
SIP Proxy概念
· When
a connection is opened by the transportlayer, this index is set to
thedestination IP, port and transport. Whenthe connection is
accepted by the transport layer, this indexis set to the source IP
address, port number, and transport.
---18 Transport
注: source IP针对UAC而言,而Destination IP针对UAS而言
· Before a request is sent, the client transportMUST insert a value of
the "sent-by" field into the Viaheader field. This field contains
an IP address or host name, and port.
18.1.1 SendingRequests
注:语气词MUST,然而我抓的包还没看到via 的"sent-by" field
· When a tel URL (RFC 2806[9]) is converted to a SIP or SIPS URI, the
entire telephone-subscriber portion of thetel URL, including any
parameters, is placed into the userinfo partof the SIP or SIPS URI.
Thus, tel:+358-555-1234567;postd=pp22 becomes
sip:+358-555-1234567;postd=pp22@foo.com;user=phone
or
sips:+358-555-1234567;postd=pp22@foo.com;user=phone
not
sip:+358-555-1234567@foo.com;postd=pp22;user=phone
or
sips:+358-555-1234567@foo.com;postd=pp22;user=phone
19.1.6Relating SIP URIs and tel URLs
· The CSeq header field servesto order transactions
within a dialog, to provide a means touniquely identify
transactions, and to differentiate betweennew requests and request
retransmissions. Two CSeq header fields are considered equalif the
sequence number and the request method areidentical
---20.16 CSeq
注意:如果重发的话,CSeq不变
转载地址:http://vzppi.baihongyu.com/