Ejemplos SIP RFC 3261

6,114 views
5,930 views

Published on

Presentación de Tech Invite del los ejemplos SIP del capítulo 4 (overview of operation), detalladas en el capítulo 24 de RFC 3261 –
SIP: Session Initiation Protocol.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
6,114
On SlideShare
0
From Embeds
0
Number of Embeds
17
Actions
Shares
0
Downloads
181
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Ejemplos SIP RFC 3261

  1. 1. http://www.tech-invite.com RFC 3261's SIP Examples V2.4 – January 2, 2008 biloxi.com Bob's Registrar SIP phone .REGISTER. This is a representation, as a slide show, of the SIP examples outlined in .200 OK. chapter 4 (overview of operation) and detailed in chapter 24 of RFC 3261 – Alice's atlanta.com biloxi.com SIP: Session Initiation Protocol. softphone Proxy Proxy SIP messages are reported in strict .INVITE. conformance with this RFC. Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. .100 Trying. .INVITE. .100 Trying. .INVITE. .180 Ringing. .180 Ringing. .180 Ringing. .200 OK. .200 OK. .200 OK. .ACK. ..Media Session.. .BYE. .200 OK. 17 pages
  2. 2. RFC 3261's Example – Registration (a) Location Server The Request-URI atlanta.com biloxi.com names the domain of the location proxy proxy service for which the registration is meant biloxi.com registrar The To header field contains the address of record whose registration is to be created Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. F1 The From header field contains the address-of-record REGISTER sip:registrar.biloxi.com SIP/2.0 of the person responsible for the registration. The Via: SIP/2.0/UDP bobspc.biloxi.com:5060 value is the same as the To header field unless the ;branch=z9hG4bKnashds7 request is a third-party registration. Max-Forwards: 70 To: Bob <sip:bob@biloxi.com> From: Bob <sip:bob@biloxi.com> All registrations from a UA should use the ;tag=456248 same Call-ID header field value for Call-ID: 843817637684230@998sdasdh09 registrations sent to a particular registrar. CSeq: 1826 REGISTER Contact: <sip:bob@192.0.2.4> Expires: 7200 The CSeq value guarantees proper ordering Content-Length: 0 of REGISTER requests. A UA must increment the CSeq value by one for each REGISTER request with the same Call-ID. The Expires header field indicates how long the UA would like the The Contact header field with zero or more binding to be valid. The value is a values containing address bindings. number indicating seconds. Bob's Alice's SIP softphone phone
  3. 3. RFC 3261's Example – Registration (b) Location Server Store atlanta.com biloxi.com proxy proxy biloxi.com registrar Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. F2 SIP/2.0 200 OK Via: SIP/2.0/UDP bobspc.biloxi.com:5060 ;branch=z9hG4bKnashds7 ;received=192.0.2.4 To: Bob <sip:bob@biloxi.com> ;tag=2493k59kd From: Bob <sip:bob@biloxi.com> ;tag=456248 Call-ID: 843817637684230@998sdasdh09 CSeq: 1826 REGISTER Contact: <sip:bob@192.0.2.4> Expires: 7200 Content-Length: 0 Bob's Alice's SIP softphone phone
  4. 4. RFC 3261's Example – Session Setup (1) The Via header field indicates the transport (UDP) used for the transaction and identifies the location -- sent-by (pc33.atlanta.com) -- where the The initial Request-URI response is to be sent. The quot;branchquot; parameter is of the message is set used to identify the transaction created by that to the value of the URI request. It is mandatory and must always begin in the To field. with the characters quot;z9hG4bKquot;. atlanta.com The Max-Forwards header field serves to limit biloxi.com proxy the number of hops a request can transit on the proxy way to its destination. It is decremented by one at each hop. The To header field specifies the desired quot;logicalquot; recipient of the request, or the address-of-record (AOR) of the user or resource that is the target of this F1 request. There is no quot;tagquot; parameter since the dialog is not established yet. INVITE sip:bob@biloxi.com SIP/2.0 Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. Via: SIP/2.0/UDP pc33.atlanta.com ;branch=z9hG4bKnashds8 The From header field indicates the logical identity of the initiator of the Max-Forwards: 70 request, possibly the user's address-of-record. quot;Alicequot; is the (optional) To: Bob <sip:bob@biloxi.com> display name. The quot;tagquot; parameter identifies this UA as a peer of the dialog. From: Alice <sip:alice@atlanta.com> ;tag=1928301774 Call-ID: a84b4c76e66710 The Call-ID header field acts as a unique identifier and must be the same CSeq: 314159 INVITE for all requests and responses sent by either UA in a dialog. Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp The CSeq header field serves as a way to identify and order transactions. It Content-Length: 142 consists of a sequence number and a method, matching that of the request. (Alice's SDP not shown) The Contact header field provides a SIP or SIPS URI that can be used by Bob's UA to contact Alice's UA for subsequent requests. The Content-Type header field indicates the media type of the message-body sent to the recipient. SDP (session description protocol ) is defined in RFC 4566. Alice's user agent (UA) does not know the location of Bob's UA or his Bob's Alice's server in the biloxi.com domain. Therefore, the INVITE request is sent to SIP softphone the SIP server that serves Alice's domain (atlanta.com). The address of phone the atlanta.com SIP server could have been configured in Alice's softphone, or it could have been discovered by DHCP, for example.
  5. 5. RFC 3261's Example – Session Setup (2) The quot;atlanta.comquot; proxy server finds the SIP proxy server that serves the quot;biloxi.comquot; domain by performing a particular type of DNS lookup. This procedure (selecting a transport protocol, determining port and IP address) is described in RFC 3263 (SIP: Locating SIP Servers). Before forwarding the INVITE request, the quot;atlanta.comquot; server adds an additional Via header field value that contains its own address -- sent-by (bigbox3.site3.atlanta.com) -- and the quot;branchquot; transaction value F3 INVITE sip:bob@biloxi.com SIP/2.0 atlanta.com Via: SIP/2.0/UDP bigbox3.site3.atlanta.com biloxi.com proxy ;branch=z9hG4bK77ef4c2312983.1 proxy Via: SIP/2.0/UDP pc33.atlanta.com ;branch=z9hG4bKnashds8 ;received=192.0.2.1 Max-Forwards: 69 F2 To: Bob <sip:bob@biloxi.com> The quot;receivedquot; parameter is added to From: Alice <sip:alice@atlanta.com> SIP/2.0 100 Trying the Via header field built by Alice's ;tag=1928301774 Via: SIP/2.0/UDP pc33.atlanta.com UA (as for quot;100 Tryingquot; message). Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. Call-ID: a84b4c76e66710 ;branch=z9hG4bKnashds8 CSeq: 314159 INVITE ;received=192.0.2.1 Contact: <sip:alice@pc33.atlanta.com> To: Bob <sip:bob@biloxi.com> Content-Type: application/sdp Max-Forwards is decremented by one From: Alice <sip:alice@atlanta.com> Content-Length: 142 ;tag=1928301774 Call-ID: a84b4c76e66710 (Alice's SDP not shown) CSeq: 314159 INVITE The remainder of the INVITE request Content-Length: 0 received from Alice's UA is unchanged. The 100 (Trying) response contains the same To, From, Call-ID, CSeq header field values as the INVITE request. The quot;receivedquot; parameter is added to the Via header field by the quot;server transportquot; of atlanta.com proxy, after examining the value of the sent-by parameter (pc33.atlanta.com). This sent-by parameter was inserted by the UA's quot;client transportquot; in the Via header field value, just before sending the INVITE request. The sent-by field contained an IP address or host name, and port. The quot;receivedquot; parameter contains the IP source address from which the packet was received. Bob's Alice's SIP softphone phone
  6. 6. RFC 3261's Example – Session Setup (3) The proxy server consults the location server database, Location Response that contains the current IP Server Query address of Bob. F4 SIP/2.0 100 Trying atlanta.com Via: SIP/2.0/UDP bigbox3.site3.atlanta.com biloxi.com proxy ;branch=z9hG4bK77ef4c2312983.1 proxy ;received=192.0.2.2 Via: SIP/2.0/UDP pc33.atlanta.com ;branch=z9hG4bKnashds8 ;received=192.0.2.1 F5 To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com> INVITE sip:bob@192.0.2.4 SIP/2.0 ;tag=1928301774 Via: SIP/2.0/UDP server10.biloxi.com Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. Call-ID: a84b4c76e66710 ;branch=z9hG4bK4b43c2ff8.1 CSeq: 314159 INVITE Via: SIP/2.0/UDP bigbox3.site3.atlanta.com Content-Length: 0 ;branch=z9hG4bK77ef4c2312983.1 ;received=192.0.2.2 Via: SIP/2.0/UDP pc33.atlanta.com ;branch=z9hG4bKnashds8 Before forwarding the INVITE request, the ;received=192.0.2.1 quot;biloxi.comquot; server adds an additional Via Max-Forwards: 68 header field value that contains its own address To: Bob <sip:bob@biloxi.com> From: Alice <sip:alice@atlanta.com> ;tag=1928301774 Call-ID: a84b4c76e66710 The quot;receivedquot; parameter is added to the Via header CSeq: 314159 INVITE field built by quot;atlanta.comquot; proxy server Contact: <sip:alice@pc33.atlanta.com> Content-Type: application/sdp Content-Length: 142 (Alice's SDP not shown) Max-Forwards is decremented by one Bob's Alice's The remainder of the INVITE request SIP softphone received from quot;atlanta.comquot; proxy phone server is unchanged.
  7. 7. RFC 3261's Example – Session Setup (4) atlanta.com biloxi.com proxy proxy The quot;receivedquot; parameter is added to the Via F6 header field built by quot;biloxi.comquot; proxy server SIP/2.0 180 Ringing Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. Via: SIP/2.0/UDP server10.biloxi.com ;branch=z9hG4bK4b43c2ff8.1 The quot;tagquot; parameter, identifying this UA as a ;received=192.0.2.3 peer of the dialog, is added to the To header Via: SIP/2.0/UDP bigbox3.site3.atlanta.com field. Although the dialog is not established yet, ;branch=z9hG4bK77ef4c2312983.1 the 3 values that identify a dialog (Call-ID, local ;received=192.0.2.2 Tag, remote Tag) are already defined. Via: SIP/2.0/UDP pc33.atlanta.com ;branch=z9hG4bKnashds8 ;received=192.0.2.1 The Contact header field provides a SIP or SIPS To: Bob <sip:bob@biloxi.com> URI that can be used by Alice's UA to contact ;tag=a6c85cf Bob's UA for subsequent requests. From: Alice <sip:alice@atlanta.com> ;tag=1928301774 Call-ID: a84b4c76e66710 Contact: <sip:bob@192.0.2.4> CSeq: 314159 INVITE The other header field values (From, Call-ID, Content-Length: 0 CSeq, and bottom Via's) are copied from the INVITE request. Bob's SIP phone rings and indicates this in a 180 Bob's Alice's (Ringing) response, which is routed back in the SIP softphone reverse direction to biloxi.com proxy (IP address and transport found in the top Via header field) phone
  8. 8. RFC 3261's Example – Session Setup (5) F7 SIP/2.0 180 Ringing Via: SIP/2.0/UDP bigbox3.site3.atlanta.com atlanta.com biloxi.com ;branch=z9hG4bK77ef4c2312983.1 proxy ;received=192.0.2.2 proxy Via: SIP/2.0/UDP pc33.atlanta.com ;branch=z9hG4bKnashds8 ;received=192.0.2.1 To: Bob <sip:bob@biloxi.com> ;tag=a6c85cf From: Alice <sip:alice@atlanta.com> The top Via header field in the 180 ;tag=1928301774 (Ringing) message received from Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. Call-ID: a84b4c76e66710 Bob's UA, is used by biloxi.com Contact: <sip:bob@192.0.2.4> proxy server for retrieving the CSeq: 314159 INVITE relevant transaction, using the quot;branchquot; parameter. It is then Content-Length: 0 removed and the information in the new top Via header field is used for forwarding the message towards the next hop in the reverse path: atlanta.com proxy. Bob's Alice's SIP softphone phone
  9. 9. RFC 3261's Example – Session Setup (6) atlanta.com biloxi.com proxy proxy F8 Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. SIP/2.0 180 Ringing Via: SIP/2.0/UDP pc33.atlanta.com ;branch=z9hG4bKnashds8 ;received=192.0.2.1 To: Bob <sip:bob@biloxi.com> ;tag=a6c85cf The top Via header field in the 180 From: Alice <sip:alice@atlanta.com> (Ringing) message received from ;tag=1928301774 biloxi.com proxy, is used by atlanta.com Call-ID: a84b4c76e66710 proxy server for retrieving the relevant Contact: <sip:bob@192.0.2.4> transaction, using the quot;branchquot; CSeq: 314159 INVITE parameter. It is then removed and the Content-Length: 0 information in the new top Via header field is used for forwarding the message towards the next hop in the reverse path: Alice's UA. Alice's softphone passes the Ringing information to Bob's Alice's Alice, using an audio ringback tone or by displaying SIP softphone a message on Alice's screen. phone
  10. 10. RFC 3261's Example – Session Setup (7) quot;CSeq: 314159 INVITEquot; / quot;branch=z9hG4bK4b43c2ff8.1quot; transaction, between biloxi.com proxy and Bob's UA, terminates with this 200 (OK) response atlanta.com biloxi.com proxy proxy F9 SIP/2.0 200 OK Via: SIP/2.0/UDP server10.biloxi.com Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. ;branch=z9hG4bK4b43c2ff8.1 ;received=192.0.2.3 Via: SIP/2.0/UDP bigbox3.site3.atlanta.com ;branch=z9hG4bK77ef4c2312983.1 ;received=192.0.2.2 Via: SIP/2.0/UDP pc33.atlanta.com ;branch=z9hG4bKnashds8 ;received=192.0.2.1 To: Bob <sip:bob@biloxi.com> ;tag=a6c85cf From: Alice <sip:alice@atlanta.com> ;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:bob@192.0.2.4> Content-Type: application/sdp Content-Length: 131 (Bob's SDP not shown) When Bob answers the call, his SIP phone sends a Bob's Alice's 200 (OK) response to indicate that the call has been SIP softphone answered. The 200 (OK) contains a message body phone with the SDP media description of the type of session that Bob is willing to establish with Alice.
  11. 11. RFC 3261's Example – Session Setup (8) quot;CSeq: 314159 INVITEquot; / quot;branch=z9hG4bK77ef4c2312983.1quot; transaction, between biloxi.com proxy and atlanta.com proxy, terminates with this 200 (OK) response F10 SIP/2.0 200 OK atlanta.com Via: SIP/2.0/UDP bigbox3.site3.atlanta.com biloxi.com proxy ;branch=z9hG4bK77ef4c2312983.1 proxy ;received=192.0.2.2 Via: SIP/2.0/UDP pc33.atlanta.com ;branch=z9hG4bKnashds8 ;received=192.0.2.1 To: Bob <sip:bob@biloxi.com> ;tag=a6c85cf From: Alice <sip:alice@atlanta.com> Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. ;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:bob@192.0.2.4> Content-Type: application/sdp Content-Length: 131 (Bob's SDP not shown) Bob's Alice's SIP softphone phone
  12. 12. RFC 3261's Example – Session Setup (9) atlanta.com biloxi.com proxy proxy F11 Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. SIP/2.0 200 OK Via: SIP/2.0/UDP pc33.atlanta.com ;branch=z9hG4bKnashds8 ;received=192.0.2.1 To: Bob <sip:bob@biloxi.com> ;tag=a6c85cf From: Alice <sip:alice@atlanta.com> ;tag=1928301774 Call-ID: a84b4c76e66710 CSeq: 314159 INVITE Contact: <sip:bob@192.0.2.4> Content-Type: application/sdp Content-Length: 131 (Bob's SDP not shown) quot;CSeq: 314159 INVITEquot; / quot;branch=z9hG4bKnashds8quot; transaction, between atlanta.com proxy and Alice's UA, terminates with this 200 (OK) response Bob's Alice's Alice's softphone stops the ringback tone and SIP softphone indicates that the call has been answered phone
  13. 13. RFC 3261's Example – Session Setup (10) atlanta.com biloxi.com proxy proxy Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. Alice's softphone sends an ACK (message request) to Bob's SIP phone to confirm the reception of the final response (200 (OK)). In this example, the ACK is sent directly from Alice's softphone to Bob's SIP phone, bypassing the two proxies. This occurs because the endpoints have learned each other's address from the Contact header F12 fields through the INVITE/200 (OK) ACK sip:bob@192.0.2.4 SIP/2.0 exchange, which was not known when the Via: SIP/2.0/UDP pc33.atlanta.com initial INVITE was sent. ;branch=z9hG4bKnashds9 Max-Forwards: 70 To: Bob <sip:bob@biloxi.com> ;tag=a6c85cf From: Alice <sip:alice@atlanta.com> ;tag=1928301774 Bob's Alice's Call-ID: a84b4c76e66710 SIP softphone CSeq: 314159 ACK phone Content-Length: 0
  14. 14. RFC 3261's Example – Session Setup (11) atlanta.com biloxi.com proxy proxy Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. Alice and Bob's media session has now begun, and they send media packets using the format to which they agreed in the exchange of SDP. In general, the end-to-end media packets take a different path from the SIP signaling messages. One or a combination of the following media types can be used with SDP: quot;audioquot;, quot;videoquot;, quot;applicationquot;, quot;dataquot;, quot;controlquot;... Bob's Alice's softphone Media Session SIP phone
  15. 15. RFC 3261's Example – Session Setup (12) atlanta.com biloxi.com proxy proxy Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. At the end of the call, Bob disconnects F13 (hangs up) first and his SIP phone BYE sip:alice@pc33.atlanta.com SIP/2.0 generates a BYE (request) message. Via: SIP/2.0/UDP 192.0.2.4 This BYE is routed directly to Alice's ;branch=z9hG4bKnashds10 softphone, again bypassing the proxies. Max-Forwards: 70 From: Bob <sip:bob@biloxi.com> ;tag=a6c85cf To: Alice <sip:alice@atlanta.com> ;tag=1928301774 Bob's Alice's Call-ID: a84b4c76e66710 SIP softphone CSeq: 231 BYE phone Content-Length: 0
  16. 16. RFC 3261's Example – Session Setup (13) atlanta.com biloxi.com proxy proxy Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. F14 Alice confirms receipt of the BYE with a SIP/2.0 200 OK 200 (OK) response, which terminates Via: SIP/2.0/UDP 192.0.2.4 the session and the BYE transaction. ;branch=z9hG4bKnashds10 From: Bob <sip:bob@biloxi.com> ;tag=a6c85cf To: Alice <sip:alice@atlanta.com> ;tag=1928301774 Call-ID: a84b4c76e66710 Bob's Alice's CSeq: 231 BYE SIP softphone Content-Length: 0 phone
  17. 17. RFC 3261's Example – Session Setup (end) atlanta.com biloxi.com proxy proxy Copyright © 2005-2008 Tech-invite.com Joël Repiquet. All Rights Reserved. Bob's Alice's SIP softphone phone

×