sip (session initiation protocol) - sip messages
DESCRIPTION
SIP (Session Initiation Protocol) - SIP Messages. Contents. A Simple SIP Example SIP Message - Request Message RFC2543 (INVITE, REGISTER, BYE, ACK, CANCEL,OPTION) INTERNET-DRAFTS (INFO, PRACK) - Response Message. A Simple SIP Example(1). Tesla. Marconi. INVITE. 180 Ringing. 200 OK. - PowerPoint PPT PresentationTRANSCRIPT
SIPSIP(Session Initiation Protocol)(Session Initiation Protocol)- SIP Messages- SIP Messages
ContentsContents A Simple SIP Example SIP Message
- Request Message RFC2543 (INVITE, REGISTER, BYE, ACK, CANCEL,OPTION)
INTERNET-DRAFTS (INFO, PRACK)
- Response Message
A Simple SIP Example(1)A Simple SIP Example(1)Marconi
INVITE
180 Ringing
200 OK
ACK
Media Session
BYE
200 OK
Tesla
A Simple SIP Example(2)A Simple SIP Example(2)
Via: SIP/2.0/UDP lab.high-voltage.org:5060To: G. Marconi <sip:[email protected]>From: Nikola Tesla <sip:[email protected]>Call-ID: [email protected]: 1 INVITESubject: About That Power Outage…Contact: sip:[email protected]: application/sdpContent-Length: 158
Via: SIP/2.0/UDP lab.high-voltage.org:5060To: G. Marconi <sip:[email protected]>From: Nikola Tesla <sip:[email protected]>Call-ID: [email protected]: 1 INVITESubject: About That Power Outage…Contact: sip:[email protected]: application/sdpContent-Length: 158
INVITE sip:[email protected] SIP/2.0INVITE sip:[email protected] SIP/2.0
v=0o=Tesla 2890844526 2890844526 IN IP4 lab.high-voltage.orgs=Phone Callc=IN IP4 100.101.102.103t=0 0m=audio 49170 RTP/AVP 0a=rtpmap:0 PCMU/8000
v=0o=Tesla 2890844526 2890844526 IN IP4 lab.high-voltage.orgs=Phone Callc=IN IP4 100.101.102.103t=0 0m=audio 49170 RTP/AVP 0a=rtpmap:0 PCMU/8000
Start line
Message Header
Message Body
CRLF
minimum requiredheader set
A Simple SIP Example(3)A Simple SIP Example(3)SIP/2.0 180 RingingSIP/2.0 180 Ringing
Via: SIP/2.0/UDP lab.high-voltage.org:5060To: G. Marconi <sip:[email protected]>From: Nikola Tesla <sip:[email protected]>Call-ID: [email protected]: 1 INVITEContent-Length: 0
Via: SIP/2.0/UDP lab.high-voltage.org:5060To: G. Marconi <sip:[email protected]>From: Nikola Tesla <sip:[email protected]>Call-ID: [email protected]: 1 INVITEContent-Length: 0
- Copying many of the Headers from the INVITE message,
including the Via, To, From, Call-ID, and CSeq
- To and From headers are not reversed(To and From headers
are Defined to indicate the direction of the request)
A Simple SIP Example(4)A Simple SIP Example(4)
..Contact: sip:[email protected]: application/sdpContent-Length: 155
..Contact: sip:[email protected]: application/sdpContent-Length: 155
SIP/2.0 200 OKSIP/2.0 200 OK
v=0o=heisenberg 2890844526 2890844526 IN IP4 200.201.202.203s=Phone Callc=IN IP4 200.201.202.203t=0 0m=audio 49172 RTP/AVP 0a=rtpmap:0 PCMU/8000
v=0o=heisenberg 2890844526 2890844526 IN IP4 200.201.202.203s=Phone Callc=IN IP4 200.201.202.203t=0 0m=audio 49172 RTP/AVP 0a=rtpmap:0 PCMU/8000
UAS Media Capability
- When the called party decides to accept the call, a 200 OK response is sent
A Simple SIP Example(5)A Simple SIP Example(5)
ACK sip:[email protected] SIP/2.0ACK sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP lab.high-voltage.org:5060To: G. Marconi <sip:[email protected]>From: Nikola Tesla <sip:[email protected]>Call-ID: [email protected]: 1 ACKContent-Length: 0
Via: SIP/2.0/UDP lab.high-voltage.org:5060To: G. Marconi <sip:[email protected]>From: Nikola Tesla <sip:[email protected]>Call-ID: [email protected]: 1 ACKContent-Length: 0
- ACK Method means that UAC can support the media session proposed by UAS- At this point , the media session begins using the media information carried in the SIP messages.- In TCP , connection is safely closed after sending ACK Method
A Simple SIP Example(6)A Simple SIP Example(6)BYE sip:[email protected] SIP/2.0BYE sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP tower.radio.org:5060To: Nikola Tesla <sip:[email protected]>
From: Marconi <sip:[email protected]>Call-ID: [email protected]: 1 BYEContent-Length: 0
Via: SIP/2.0/UDP tower.radio.org:5060To: Nikola Tesla <sip:[email protected]>
From: Marconi <sip:[email protected]>Call-ID: [email protected]: 1 BYEContent-Length: 0
SIP/2.0 200 OKSIP/2.0 200 OK
.. ..
.. ..
- SIP-enabled device must contain both SIP server and SIP client software
- To and From headers are reversed but Tesla is able to identify the call leg and tear down the correct media session
SIP MessagesSIP Messages Method(RFC2543)
- INVITE, REGISTER, BYE, ACK, CANCEL, OPTIONS
Internet-Drafts Method - INFO, PRACK
Response Messages
INVITE methodINVITE method Establish media sessions between user agents It usually has a message body containing the media info
rmation- If it dose not have, the ACK contains the media information
re-INVITE- An INVITE sent for an existing call leg references the same Call-ID as the original INVITE- Changing the session characteristics.- CSeq is incremented
Request-URI is able to contain a phone number ex) INVITE <sip:[email protected]>;user=phone SIP/2.0
REGISTER methodREGISTER method
The REGISTER method is used by a user agent to notify a SIP network of its current IP address and the URLs for which it would like to receive calls
Request-URI contains only the domain of the registrar Server with no user portion Example(Contact, Expires header & expires parameter)
REGISTER sip:registrar.munich.de SIP/2.0..Contact: sip:[email protected]
200 OK
Contact: *Expires: 0
Contact: sip:[email protected];expires=30
Contact: sip:[email protected];Expires: 30
BYE methodBYE method It is used to terminate an established media session A BYE is send only by user agents participating in the sess
ion, never by proxies or other third parties A BYE can be sent by either the caller or the called party i
n a session. BYE always increments the CSeq
ACK methodACK method The ACK method is used to acknowledge final responses t
o INVITE requests ACK is never incremented for an ACK - A UAS can match the CSeq number of the ACK with the n
umber of the corresponding INVITE An ACK may contain an message body, but can not be use
d to modify a media description
CANCEL method(1)CANCEL method(1) The CANCEL method is used to terminate pending
searches or call attempts A forking proxy can use the CANCEL method.
Calling user agent
Forking proxy server
The CANCEL method dose not increment the CSeq
- UA can match the CSeq of the CANCEL with the CSeq of the pending INVITE
CANCEL method(2)CANCEL method(2) CANCEL method is a hop-by-hop request If a final response has already been received, a user agent should not
generate a CANCEL
INVITECSeq: 1 INVITE INVITE
CSeq: 1 INVITE 100 TryingCSeq: 1 INVITE
100 TryingCSeq: 1 INVITE
CANCELCSeq: 1 CANCEL
200 OKCSeq: 1 INVITE
200 OKCSeq: 1 CANCEL
CANCELCSeq: 1 CANCEL
200 OKCSeq: 1 INVITE
200 OKCSeq: 1 CANCEL
ACKCSeq: 1 ACK
BYECSeq: 2 BYE
200 OKCSeq: 2BYE
UAC Stateful Proxy UAS
OPTIONS methodOPTIONS method The OPTION method is used to query a user agent or
server about its capabilities and discover its current availability
OPTIONS sip:proxy.carrier.com SIP/2.0Via: SIP/2.0/UDP cavendish.kings.cambridge.edu.ukTo: sip:proxy.carrier.comFrom: J.C. Maxwell <sip:[email protected]>CSeq: 1 OPTIONSContent-Length: 0
SIP/2.0 200 OKVia: SIP/2.0/UDP cavendish.kings.cambridge.edu.uk;tag=512A6To: sip:proxy.carrier.comFrom: J.C. Maxwell <sip:[email protected]>Call-ID: [email protected]: 1 OPTIONSAllow: INVITE, OPTION, ACK, BYE, CANCEL, REGISTERAccept-Language: en, de, frContent-Length: 0
INFO & PRACK method(1)INFO & PRACK method(1) INFO method
- It is used by UA to send call signaling information to another user agent with which it has an established media session.
PRACK
- It is used to acknowlegde receipt of reliably transported provisional responses(1XX)
INFO & PRACK method(2)INFO & PRACK method(2)
UAC UASINVITESupported:100relCSeq: 1 INVITE
100 TryingCSeq: 1 INVITE
180 RingingCSeq: 1 INVITERSeq: 314 T1
180 RingingCSeq: 1 INVITERSeq: 314 PRACK
CSeq: 2 PRACKRAck: 314 1 INVITE
200 OKCSeq: 2 PRACK 200 OK
CSeq: 1 INVITEACKCSeq: 1 ACK
Media Session
Response Messages(1)Response Messages(1) A SIP response is a message generated by a UAS or a SIP
server to reply to a request generated by a UAC The reason phrase is for human consumption only - 200 Call Failed = 200 OK
Informational class response(1XX)
- It is used to indicate call progress - The first informational response received by the UAC confirms receipt
of the INVITE, and stops retransmission of the INVITE ( ex)180 Ringing)
Response Messages(2)Response Messages(2) Success 200 OK
- When used to accept a session invitation( ex) INVITE )- Successful completion of the request( ex) PRACK )
Redirection class response(3XX) - It is generally sent by a SIP server acting as a redirect server in response to an INVITE - There is no requirement that a UAC receiving a
redirection response must retry the request to the specified address. - UAC could be configured to automatically generate a new INVITE upon receipt of a redirection class response without requiring user intervention
Response Messages(3)Response Messages(3) Client Error(4XX) - It is used by a server or UAS to indicate that the request cannot be
fulfilled as it was submitted
- 400 Bad Request , 401 Unauthorized, 404 Not Found ..
Server Error(5XX) - The request cannot be processed because of an error with the server
- The response may contain a Retry-After header if the server anticipates
being available within a specific time period
- 501 Not Implemented, 505 Version Not Supported
Response Messages(4)Response Messages(4) Global Error(6XX) - The Server knows that the request will fail wherever it is tried. As a
result the request should not be sent to other locations
- 604 Dose Not Exist Anywhere
It is similar to the 404 Not found but indicates that the user in the Request-URI cannot be found anywhere.