Wednesday, December 8, 2010

SIP Dialog

  1. peer to peer SIP relationship between two user agents
  2. facilitate sequencing messages between UA and proper routing of requests between them
  3. provides a context in which to interpret SIP messages
  4. dialogs can be created by
    1. INVITE method (rfc 3261)
    2. SUBSCRIBE and NOTIFY method (rfc 3265)
  5. a dialog is identified with a Dialog-ID
    1. the dialog-ID at each UA involved in the dialog is not the same, the local tag at one UA are identical to the remote tag at the peer UA
    2. dialog-ID is also associated with all the responses and with any request that contain a tag in To filed
    3. the rules for computing the dialog-ID of a message depends on whether SIP element is a UAS or UAC. 
    4. for a UAC the dialog-ID is composed of 
      1. call-ID
      2. remote tag (tag in the To field)
      3. local tag (tag in the From field), as this is added by the UAC on sending the request
    5. for a UAS the dialog-ID is composed of
      1. call-ID
      2. remote tag (tag in the From field)
      3. local tag (tag in the To field), added by UAS in the response
  6. dialogs are created through the generation of non failure responses (2xx and 101-199 with a To tag) to request with specific methods (INVITE)
  7. A dialog established by a non final response to a request is in the "early" state and is called an early dialog
  8. UAS behavior on creation of a dialog
    1. UAS Must copy all the Record Route header fields from the request to the response and Must maintain the order of the values
    2. UAS Must add a contact header field to the response, the URI in the contact header field Must be a SIP or SIPS URI
    3. if the request that initiated the dialog contains a SIPS URI in the Request URI, or in the top Record Route header, or the Contact header field, the Contact header filed added by the UAS Must be a SIPS URI
    4. the URI SHOULD have global scope, that is  can be used outside this dialog
    5. the UAS then construct the state of the dialog, which Must be maintained for the duration of the dialog
    6. if the request arrived over TLS, and the Request-URI contained a SIPS URI then the "secure" flag is set to TRUE
    7. the route set Must be set to the list of URI in the Record-Route header filed from the request
    8. the remote target Must be set to the URI from the Contact header field of the request
    9. the remote sequence number Must be set to the value of sequence number in the CSeq header of the request, the local sequence number Must be empty
    10. the call identifier component of the dialog-ID Must be set to the value of the Call-ID in the request
    11. the local tag component of the dialog-ID Must be set to the tag in the To field, and the remote tag of dialog-ID Must be set to the tag from the From field in the request
    12. UAS must be prepared to receive a request without a tag in the From filed, in which case the tag is considered to have a null value (to maintain backward compatibility with RFC 2543)
  9.  

  10. UAC behavior on creation of a dialog
    1. the SIP or SIPS URI in the Contact header field in the request (INVITE) Must have global scope (can be used outside the dialog)
    2. if the request has a Request-URI or a topmost Route header field value with a SIPS URI, the Contact header field Must contain a SIPS URI
    3. when a UAC receives a response that establishes a dialog, it construct the state of the dialog, which Must be maintained for the duration of the dialog
    4. if the request was send over TLS and the Request-URI contained a SIPS URI the "secure" flag is set to TRUE
    5. the route set Must be set to the list of URIs int the Record-Route header from the response, taken in the reverse order and preserving all URI parameters
    6. the remote target Must be set to the URI from the Contact header field of the response
    7. the local sequence number Must be set to the value of the sequence number in the CSeq header field of the request, the remote sequence number MUST be empty
    8. local tag in the dialog ID Must be set to the tag in the From field in the request, and the remote tag in the  dialog ID Must be set to the To field in the response
    9. UAC must be prepared to receive a request without a tag in the From filed, in which case the tag is considered to have a null value (to maintain backward compatibility with RFC 2543)

No comments: