- •Contents
- •Foreword to the First Edition
- •Preface to the Third Edition
- •Preface to the Second Edition
- •Preface to the First Edition
- •1 SIP and the Internet
- •1.1 Signaling Protocols
- •1.2.2 Data/Link Layer
- •1.2.3 Network Layer
- •1.2.4 Transport Layer
- •1.2 Internet Multimedia Protocol Stack
- •1.2.1 Physical Layer
- •1.2.5 Application Layer
- •1.2.6 Utility Applications
- •1.2.7 Multicast
- •1.3 Internet Names
- •1.4 URLs, URIs, and URNs
- •1.5 Domain Name Service
- •1.5.1 DNS Resource Records
- •1.5.2 Address Resource Records (A or AAAA)
- •1.5.3 Service Resource Records (SRV)
- •1.5.4 Naming Authority Pointer Resource Records (NAPTR)
- •1.5.5 DNS Resolvers
- •1.6 Global Open Standards
- •1.7 Internet Standards Process
- •1.8 A Brief History of SIP
- •1.9 Conclusion
- •References
- •2 Introduction to SIP
- •2.1 A Simple Session Establishment Example
- •2.2 SIP Call with a Proxy Server
- •2.3 SIP Registration Example
- •2.4 SIP Presence and Instant Message Example
- •2.5 Message Transport
- •2.5.1 UDP Transport
- •2.5.2 TCP Transport
- •2.5.3 TLS Transport
- •2.5.4 SCTP Transport
- •2.6 Transport Protocol Selection
- •2.7 Conclusion
- •2.8 Questions
- •References
- •3 SIP Clients and Servers
- •3.1 SIP User Agents
- •3.2 Presence Agents
- •3.3 Back-to-Back User Agents
- •3.4 SIP Gateways
- •3.5 SIP Servers
- •3.5.1 Proxy Servers
- •3.5.2 Redirect Servers
- •3.5.3 Registrar Servers
- •3.6 Uniform Resource Indicators
- •3.7 Acknowledgment of Messages
- •3.8 Reliability
- •3.9 Multicast Support
- •3.10 Conclusion
- •3.11 Questions
- •References
- •4 SIP Request Messages
- •4.1 Methods
- •4.1.1 INVITE
- •4.1.2 REGISTER
- •4.1.5 CANCEL
- •4.1.6 OPTIONS
- •4.1.7 SUBSCRIBE
- •4.1.8 NOTIFY
- •4.1.9 PUBLISH
- •4.1.10 REFER
- •4.1.11 MESSAGE
- •4.1.12 INFO
- •4.1.13 PRACK
- •4.1.14 UPDATE
- •4.2 URI and URL Schemes Used by SIP
- •4.2.1 SIP and SIPS URIs
- •4.2.2 Telephone URLs
- •4.2.3 Presence and Instant Messaging URLs
- •4.3 Tags
- •4.4 Message Bodies
- •4.5 Conclusion
- •4.6 Questions
- •References
- •5 SIP Response Messages
- •5.1 Informational
- •5.1.1 100 Trying
- •5.1.2 180 Ringing
- •5.1.3 181 Call is Being Forwarded
- •5.1.4 182 Call Queued
- •5.1.5 183 Session Progress
- •5.2 Success
- •5.2.2 202 Accepted
- •5.3 Redirection
- •5.3.1 300 Multiple Choices
- •5.3.2 301 Moved Permanently
- •5.3.3 302 Moved Temporarily
- •5.3.4 305 Use Proxy
- •5.3.5 380 Alternative Service
- •5.4.3 402 Payment Required
- •5.4.4 403 Forbidden
- •5.4.5 404 Not Found
- •5.4.6 405 Method Not Allowed
- •5.4.7 406 Not Acceptable
- •5.4.8 407 Proxy Authentication Required
- •5.4.9 408 Request Timeout
- •5.4.11 410 Gone
- •5.4.12 411 Length Required
- •5.4.13 412 Conditional Request Failed
- •5.4 Client Error
- •5.4.1 400 Bad Request
- •5.4.2 401 Unauthorized
- •5.4.14 413 Request Entity Too Large
- •5.4.15 414 Request-URI Too Long
- •5.4.16 415 Unsupported Media Type
- •5.4.17 416 Unsupported URI Scheme
- •5.4.18 417 Unknown Resource Priority
- •5.4.19 420 Bad Extension
- •5.4.20 421 Extension Required
- •5.4.21 422 Session Timer Interval Too Small
- •5.4.22 423 Interval Too Brief
- •5.4.23 428 Use Identity Header
- •5.4.24 429 Provide Referror Identity
- •5.4.25 430 Flow Failed
- •5.4.26 433 Anonymity Disallowed
- •5.4.27 436 Bad Identity-Info Header
- •5.4.29 438 Invalid Identity Header
- •5.4.30 439 First Hop Lacks Outbound Support
- •5.4.31 440 Max-Breadth Exceeded
- •5.4.32 470 Consent Needed
- •5.4.33 480 Temporarily Unavailable
- •5.4.34 481 Dialog/Transaction Does Not Exist
- •5.4.35 482 Loop Detected
- •5.4.36 483 Too Many Hops
- •5.4.37 484 Address Incomplete
- •5.4.38 485 Ambiguous
- •5.4.39 486 Busy Here
- •5.4.40 487 Request Terminated
- •5.4.41 488 Not Acceptable Here
- •5.4.42 489 Bad Event
- •5.4.43 491 Request Pending
- •5.4.44 493 Request Undecipherable
- •5.4.45 494 Security Agreement Required
- •5.5 Server Error
- •5.5.1 500 Server Internal Error
- •5.5.2 501 Not Implemented
- •5.5.3 502 Bad Gateway
- •5.5.4 503 Service Unavailable
- •5.5.5 504 Gateway Timeout
- •5.5.6 505 Version Not Supported
- •5.5.7 513 Message Too Large
- •5.5.8 580 Preconditions Failure
- •5.6 Global Error
- •5.6.1 600 Busy Everywhere
- •5.6.2 603 Decline
- •5.6.3 604 Does Not Exist Anywhere
- •5.6.4 606 Not Acceptable
- •5.7 Questions
- •References
- •6 SIP Header Fields
- •6.1 Request and Response Header Fields
- •6.1.1 Accept
- •6.1.2 Accept-Encoding
- •6.1.3 Accept-Language
- •6.1.4 Alert-Info
- •6.1.5 Allow
- •6.1.6 Allow-Events
- •6.1.7 Answer-Mode
- •6.1.8 Call-ID
- •6.1.9 Contact
- •6.1.10 CSeq
- •6.1.11 Date
- •6.1.12 Encryption
- •6.1.13 Expires
- •6.1.14 From
- •6.1.15 History Info
- •6.1.16 Organization
- •6.1.17 Path
- •6.1.19 Record-Route
- •6.1.20 Recv-Info
- •6.1.21 Refer-Sub
- •6.1.22 Retry-After
- •6.1.23 Subject
- •6.1.24 Supported
- •6.1.25 Timestamp
- •6.1.27 User-Agent
- •6.2 Request Header Fields
- •6.2.1 Accept-Contact
- •6.2.2 Authorization
- •6.2.3 Call-Info
- •6.2.4 Event
- •6.2.5 Hide
- •6.2.6 Identity
- •6.2.7 Identity-Info
- •6.2.8 In-Reply-To
- •6.2.9 Info-Package
- •6.2.10 Join
- •6.2.11 Priority
- •6.2.12 Privacy
- •6.2.13 Proxy-Authorization
- •6.2.14 Proxy-Require
- •6.2.15 P-OSP-Auth-Token
- •6.2.16 P-Asserted-Identity
- •6.2.17 P-Preferred-Identity
- •6.2.18 Max-Breadth
- •6.2.19 Max-Forwards
- •6.2.20 Reason
- •6.2.21 Refer-To
- •6.2.22 Referred-By
- •6.2.23 Reply-To
- •6.2.24 Replaces
- •6.2.25 Reject-Contact
- •6.2.26 Request-Disposition
- •6.2.27 Require
- •6.2.28 Resource-Priority
- •6.2.29 Response-Key
- •6.2.30 Route
- •6.2.31 RAck
- •6.2.32 Security-Client
- •6.2.33 Security-Verify
- •6.2.34 Session-Expires
- •6.2.35 SIP-If-Match
- •6.2.36 Subscription-State
- •6.2.37 Suppress-If-Match
- •6.2.38 Target-Dialog
- •6.2.39 Trigger-Consent
- •6.3 Response Header Fields
- •6.3.1 Accept-Resource-Priority
- •6.3.2 Authentication-Info
- •6.3.3 Error-Info
- •6.3.4 Flow-Timer
- •6.3.5 Min-Expires
- •6.3.7 Permission-Missing
- •6.3.8 Proxy-Authenticate
- •6.3.9 Security-Server
- •6.3.10 Server
- •6.3.11 Service-Route
- •6.3.12 SIP-ETag
- •6.3.13 Unsupported
- •6.3.14 Warning
- •6.3.15 WWW-Authenticate
- •6.3.16 RSeq
- •6.4 Message Body Header Fields
- •6.4.1 Content-Encoding
- •6.4.2 Content-Disposition
- •6.4.3 Content-Language
- •6.4.4 Content-Length
- •6.4.5 Content-Type
- •6.4.6 MIME-Version
- •6.5 Questions
- •References
- •7 Wireless, Mobility, and IMS
- •7.1 IP Mobility
- •7.2 SIP Mobility
- •7.4 IMS Header Fields
- •7.5 Conclusion
- •7.6 Questions
- •References
- •8 Presence and Instant Messaging
- •8.1 Introduction
- •8.2 History of IM and Presence
- •8.3 SIMPLE
- •8.4 Presence with SIMPLE
- •8.4.1 SIP Events Framework
- •8.4.2 Presence Bodies
- •8.4.3 Resource Lists
- •8.4.4 Filtering
- •8.4.6 Partial Publication
- •8.4.7 Presence Documents Summary
- •8.5 Instant Messaging with SIMPLE
- •8.5.1 Page Mode Instant Messaging
- •8.5.4 Message Composition Indication
- •8.5.5 Multiple Recipient Messages
- •8.5.6 Session Mode Instant Messaging
- •8.6 Jabber
- •8.6.1 Standardization as Extensible Messaging and Presence Protocol
- •8.6.2 Interworking with SIMPLE
- •8.6.3 Jingle
- •8.6.4 Future Standardization of XMPP
- •8.7 Conclusion
- •8.8 Questions
- •References
- •9 Services in SIP
- •9.1 Gateway Services
- •9.2 SIP Trunking
- •9.3 SIP Service Examples
- •9.4 Voicemail
- •9.5 SIP Video
- •9.6 Facsimile
- •9.7 Conferencing
- •9.7.1 Focus
- •9.7.2 Mixer
- •9.8 Application Sequencing
- •9.9 Other SIP Service Architectures
- •9.9.1 Service Oriented Architecture
- •9.9.2 Servlets
- •9.9.3 Service Delivery Platform
- •9.10 Conclusion
- •9.11 Questions
- •References
- •10 Network Address Translation
- •10.1 Introduction to NAT
- •10.2 Advantages of NAT
- •10.3 Disadvantages of NAT
- •10.4 How NAT Works
- •10.5 Types of NAT
- •10.5.1 Endpoint Independent Mapping NAT
- •10.5.2 Address Dependent Mapping NAT
- •10.5.3 Address and Port Dependent Mapping NAT
- •10.5.4 Hairpinning Support
- •10.5.5 IP Address Pooling Options
- •10.5.6 Port Assignment Options
- •10.5.7 Mapping Refresh
- •10.5.8 Filtering Modes
- •10.6 NAT Mapping Examples
- •10.7 NATs and SIP
- •10.8 Properties of a Friendly NAT or How a NAT Should BEHAVE
- •10.9 STUN Protocol
- •10.10 UNSAF Requirements
- •10.11 SIP Problems with NAT
- •10.11.1 Symmetric SIP
- •10.11.2 Connection Reuse
- •10.11.3 SIP Outbound
- •10.12 Media NAT Traversal Solutions
- •10.12.1 Symmetric RTP
- •10.12.2 RTCP Attribute
- •10.12.3 Self-Fixing Approach
- •10.13 Hole Punching
- •10.14 TURN: Traversal Using Relays Around NAT
- •10.15 ICE: Interactive Connectivity Establishment
- •10.16 Conclusion
- •10.17 Questions
- •References
- •11 Related Protocols
- •11.1 PSTN Protocols
- •11.1.1 Circuit Associated Signaling
- •11.1.2 ISDN Signaling
- •11.1.3 ISUP Signaling
- •11.2 SIP for Telephones
- •11.3 Media Gateway Control Protocols
- •11.4.1 Introduction to H.323
- •11.4.2 Example of H.323
- •11.4.3 Versions
- •References
- •12 Media Transport
- •12.1 Real-Time Transport Protocol (RTP)
- •12.2 RTP Control Protocol (RTCP)
- •12.2.1 RTCP Reports
- •12.2.2 RTCP Extended Reports
- •12.3 Compression
- •12.4.1 Audio Codecs
- •12.4.2 Video Codecs
- •12.5 Conferencing
- •12.6 ToIP—Conversational Text
- •12.7 DTMF Transport
- •12.8 Questions
- •References
- •13 Negotiating Media Sessions
- •13.1 Session Description Protocol (SDP)
- •13.1.1 Protocol Version
- •13.1.2 Origin
- •13.1.3 Session Name and Information
- •13.1.5 E-Mail Address and Phone Number
- •13.1.6 Connection Data
- •13.1.7 Bandwidth
- •13.1.8 Time, Repeat Times, and Time Zones
- •13.1.9 Encryption Keys
- •13.1.10 Media Announcements
- •13.1.11 Attributes
- •13.2 SDP Extensions
- •13.3 The Offer Answer Model
- •13.3.1 Rules for Generating an Offer
- •13.3.2 Rules for Generating an Answer
- •13.3.3 Rules for Modifying a Session
- •13.3.4 Special Case—Call Hold
- •13.4 Static and Dynamic Payloads
- •13.5 SIP Offer Answer Exchanges
- •13.6 Conclusion
- •13.7 Questions
- •References
- •14 SIP Security
- •14.1 Basic Security Concepts
- •14.1.1 Encryption
- •14.1.2 Public Key Cryptography
- •14.1.4 Message Authentication
- •14.2 Threats
- •14.3 Security Protocols
- •14.3.1 IPSec
- •14.3.3 DNSSec
- •14.3.4 Secure MIME
- •14.4 SIP Security Model
- •14.4.1 SIP Digest Authentication
- •14.4.2 SIP Authentication Using TLS
- •14.4.3 Secure SIP
- •14.4.4 Identity
- •14.4.5 Enhanced SIP Identity
- •14.6 Media Security
- •14.6.1 Non-RTP Media
- •14.6.2 Secure RTP
- •14.6.3 Keying SRTP
- •14.6.4 Best Effort Encryption
- •14.6.5 ZRTP
- •14.7 Questions
- •References
- •15 Peer-to-Peer SIP
- •15.1 P2P Properties
- •15.2 P2P Properties of SIP
- •15.3 P2P Overlays
- •15.4 RELOAD
- •15.5 Host Identity Protocol
- •15.6 Conclusion
- •15.7 Questions
- •References
- •16 Call Flow Examples
- •16.1 SIP Call with Authentication, Proxies, and Record-Route
- •16.2 SIP Call with Stateless and Stateful Proxies with Called Party Busy
- •16.3 SIP to PSTN Call Through Gateways
- •16.4 PSTN to SIP Call Through a Gateway
- •16.5 Parallel Search
- •16.6 Call Setup with Two Proxies
- •16.7 SIP Presence and Instant Message Example
- •References
- •17 Future Directions
- •17.2 More Extensions
- •17.3 Better Identity
- •17.4 Interdomain SIP
- •17.5 Making Features Work Better
- •17.6 Emergency Calling
- •17.7 More SIP Trunking
- •17.9 Improved NAT Traversal
- •17.10 Security Deployment
- •17.11 Better Interoperability
- •References
- •A.1 ABNF Rules
- •A.2 Introduction to XML
- •References
- •About the Author
Presence and Instant Messaging |
191 |
Figure 8.2 Presence architecture.
|
Table 8.2 |
|
Presence Elements |
Presence service |
Protocol used to transport presence information |
Presentity |
Publishes presence information to presence service. |
Presence user agent |
User interface for gathering presence information about user. |
Watcher |
Requests and receives presence information from presence service. |
Watcher user agent |
Renders presence information received to the user. |
8.3 SIMPLE
In 2001, the IETF chartered a new working group to develop SIP standards and extensions for instant messaging and presence. Over the years, a set of specifications and protocols have been developed, with a few still under development. The standards for presence are summarized in Table 8.3. An overview specification is known as “SIMPLE made simple” [3], which describes how all these protocols work together.
8.4 Presence with SIMPLE
This section will cover presence with SIMPLE. The specifications are summarized in Tables 8.3 and 8.4.
8.4.1SIP Events Framework
The SIP events framework was defined in RFC 3265 which defined the SUBSCRIBE and NOTIFY methods, as described in Sections 4.1.7 and 4.1.8. SUBSCRIBE is used to establish a dialog and ongoing association between two UAs. In the presence architecture of Figure 8.2, the watcher sends the SUBSCRIBE request to the presentity. If the subscription is authorized, the presentity will send NOTIFYs whenever the state of the presentity changes, and at regular intervals. The basic call flow was shown in Figure 4.5.
|
192 |
SIP: Understanding the Session Initiation Protocol |
|
|
|
|
Table 8.3 |
|
|
|
|
SIMPLE Presence Specifications |
|
|
|
Document |
Title |
Use |
|
|
|
|
|
|
|
RFC 3265 |
SIP events [4] |
Defines SUBSCRIBE and NOTIFY usage with |
|
|
SIP. |
|
||
|
|
|
|
|
|
RFC 3903 |
SIP publication [5] |
Defines PUBLISH method. |
|
|
RFC 3863 |
PIDF [6] |
Presence Information Data Format. |
|
|
RFC 3856 |
Presence event package [7] |
SIP event package used in NOTIFY and |
|
|
PUBLSH methods. |
|
||
|
|
|
|
|
|
RFC 3857 |
Watcher info package [8] |
SIP event package used to find out who is |
|
|
watching or subscribing to your state. |
|
||
|
|
|
|
|
|
RFC 3858 |
Watcher info XML [9] |
Body used for watcher info NOTIFYs and |
|
|
PUBLISHes. |
|
||
|
|
|
|
|
|
RFC 4480 |
RPID [10] |
Rich Presence Information Data format PIDF |
|
|
extensions. |
|
||
|
|
|
|
|
|
RFC 4482 |
CIPID [11] |
Contact information in presence information |
|
|
data. |
|
||
|
|
|
|
|
|
RFC 4479 |
Data model [12] |
A data model for presence. |
|
|
RFC 4662 |
Resource list extension [13] |
Combining subscriptions into a resource list. |
|
|
RFC 4661 |
Filtering [14] |
XML format for event notification filtering. |
|
|
RFC 4825 |
XCAP [15] |
XML configuration access protocol. |
|
|
RFC 4826 |
Resource list format [16] |
XML format for resource lists. |
|
|
RFC 4827 |
XCAP usage for presence [17] |
Used for manipulating presence document. |
|
|
RFC 5025 |
Presence authorization [18] |
Presence authorization rules. |
|
|
RFC 5196 |
UA capabilities extension [19] |
Extensions to PIDF for UA capabilities. |
|
|
RFC 5261 |
XML patch framework [20] |
|
|
|
RFC 5262 |
Partial presence PIDF [21] |
|
|
|
RFC 5263 |
Partial presence [22] |
|
|
|
RFC 5264 |
Partial presence publication [23] |
|
|
|
RFC 3861 |
Pres URI scheme [24] |
Use of SRV records for the pres URI scheme. |
|
[25]Conditional notification
[26]XCAP diff
RFC 5364 SIMPLE made simple
SIP events allow any number of event packages to be defined. Table 4.8 lists common SIP event packages. For presence, the presence package is used, which also uses the application/xml+presence MIME type. This XML format is used to convey the presence state in NOTIFYs.
8.4.2Presence Bodies
Presence information is conveyed using SIP message bodies in XML (Extensible Markup Language) format. The basic presence document is known as Presence Information Data Format or PIDF [12] and is shown here:
|
|
Presence and Instant Messaging |
193 |
|
|
|
Table 8.4 |
|
|
|
|
SIMPLE Instant Messaging Specifications |
|
|
|
Document |
Title |
Use |
|
|
RFC 3428 |
SIP extensions for IM [27] |
Defines MESSAGE method for page mode IM. |
|
|
RFC 3994 |
Message composition [28] |
Used for “istyping” indications for IM. |
|
|
RFC 5365 |
Multiple recipient IMs [29] |
Used to send an IM to a group. |
|
|
RFC 4975 |
MSRP [30] |
Message Sessions Relay Protocol. |
|
|
RFC 4976 |
Relay extensions for MSRP [31] |
Relays for MSRP for logging and NAT traversal. |
|
|
RFC 3861 |
IM URI scheme [24] |
Use of SRV records for the IM URI scheme. |
|
|
RFC 3862 |
CPIM [32] |
Common profile for IM format. |
|
|
RFC 5438 |
IMDN [33] |
IM disposition notification. |
|
|
Draft |
MSRP multiparty chat [34] |
|
|
|
Draft |
Alt connection with MSRP [35] |
|
|
<?xml version=”1.0” encoding=”UTF-8”?> <presence xmlns=”urn:ietf:params:xml:ns:pidf”
entity=”pres:Sophie.Germain@mathematica.org”> <tuple id=”34g45sfde”>
<status>
<basic>open</basic>
</status>
<contact>sip:sophie@78.34.32.1:51234</contact>
</tuple>
</presence>
The XML document begins with the XML declaration, then the presentity information is contained in the <presence> element. The presence information is that of the entity listed in the entity attribute. Presence documents consist of <tuple> elements, which contain the <status> of the presentity and can be either open (available) or closed (unavailable). In addition, this example shows <contact> information. Presence information is conveyed in a SIP message us-
ing the Content-Type: application/pidf+xml. Note that this Content-Type is
also sometimes incorrectly written as application/cpim-pidf+xml.
The next example shows the inclusion of both contact information (Contact Information Presence Information Data or CIPID) [11], UA capabilities [19] , and the presence data model [12]:
<?xml version=”1.0” encoding=”UTF-8”?> <presence xmlns=”urn:ietf:params:xml:ns:pidf”
xmlns:dm=”urn:ietf:params:xml:ns:pidf:data-model” xmlns:cipid=”urn:ietf:params:xml:ns:pidf:cipid” xmlns:caps=”urn:ietf:params:xml:ns:pidf:caps” entity=”pres:m.c.thomas@brynmawr.edu”>
<tuple id=”54234g45sfde”> <status> <basic>open</basic> </status>
<contact>sip:mc@dean.brynmawr.edu</contact>
194 |
SIP: Understanding the Session Initiation Protocol |
<caps:servcaps>
<caps:audio>true</caps:audio>
<caps:video>true</caps:video>
</caps:servcaps>
</tuple>
<dm:person id=”1”> <cipid:card>http://brynmawr.edu/~m.c.thomas/card.vcd</c:card> <cipid:display-name>M. C. Thomas</c:card>
</dm:person>
</presence>
This document defines a default namespace plus three other extension namespaces, dm, cipid, and caps. This example shows that the capabilities of the UA identified by the <contact> element include both audio and video, as indicated by the <audio> and <video> subelements of <servcaps>. The data model element <person> is used to provide personal information about the contact entity, and includes the contact information including a vcard, display name, homepage, icon, and map. The next example shows Rich Presence Information Data (RIPD) [10]:
<?xml version=”1.0” encoding=”UTF-8”?> <presence xmlns=”urn:ietf:params:xml:ns:pidf”
xmlns:rpid=”urn:ietf:params:xml:ns:pidf:rpid”
entity=”sip:skovalevsky@su.se”> <tuple id=”4sdf432sd”>
<status>
<basic>closed</basic>
</status>
<rpid:class>IM</rpid:class>
<contact>im:skovalesky@su.se</contact>
</tuple>
<tuple id=”832thr76jk”> <status>
<basic>open</basic>
</status>
<rpid:class>voice</rpid:class>
<contact>tel:+465551212</contact>
</tuple>
</presence>
8.4.3Resource Lists
Resource lists allow a UA to combine multiple individual subscriptions into a single subscription and receive notifications about multiple individual subscriptions in a single notification message. Resource lists are defined in RFC 4662 [13] and are an extension to the SIP events framework [4]. As such, resource lists can be used with any event package. However, the most common use is for subscriptions to a “buddy list” in presence applications. In this application, a contact list or “buddy list” is represented by a SIP URI and stored in a server
Presence and Instant Messaging |
195 |
known as a resource list server or RLS. For example, if a user’s contact list contained 10 SIP URIs, this would normally require 10 separate subscriptions to be maintained, one for each URI in the list. Each of these subscriptions would need to be created, managed, and refreshed, resulting in a lot of overhead traffic messages. With the resource list extension, the list is stored in the RLS, and the presence client creates a single subscription to the RLS over which notifications of the presence of all 10 URIs would be sent. The RLS may need to initiate 10 separate subscriptions, but not the presence UA. An example event list subscription is shown here:
SUBSCRIBE sip:beatrix-321223@lakesdistrict.co.uk SIP/2.0 Via: SIP/2.0/TCP cottage43.lakesdistrict.co.uk:5060 ;branch=z9hG4bKwYb6QREiCL
Max-Forwards: 70
To: <sip:beatrix-321223@lakesdistrict.co.uk>
From: Beatrix Potter <sip:beatrix@lakesdistrict.co.uk> ;tag=6733
Call-ID: dkfj39890wssdfj2938d7 CSeq: 23822 SUBSCRIBE
Contact: <sip:beatrix@cottage.lakesdistrict.co.uk; transport=tcp>
Ev ent: presence Expires: 7200 Supported: eventlist
Accept: application/pidf+xml Accept: application/rlmi+xml Accept: multipart/related Content-Length: 0
In this subscription, the presence of the Supported: eventlist header field indicates that the presence UA supports the extension. The Accept: application/ rlmi+xml also indicates that it is willing to accept notifications that use the resource list format described in the next section. The Event: presence and Accept: application/pidf+xml are to indicate that the subscription is for presence information. A NOTIFY sent during this subscription might look like:
NOTIFY sip:beatrix@cottage43.lakesdistrict.co.uk SIP/2.0 Via: SIP/2.0/TCP pres.vancouver.example.com
;branch=z9hG4bKMgRenTETmm Max-Forwards: 70
From: <sip:beatrix-321223@lakesdistrict.co.uk>;tag=dkisksk3 To: Beatrix Potter <sip:beatrix@lakesdistrict.co.uk>
;tag=673
Call-ID: dkfj39890wssdfj2938d7 CSeq: 997935768 NOTIFY
Contact: <sip:rls34.lakesdistrict.co.uk> Event: presence
Subscription-State: active;expires=7200 Require: eventlist
Content-Type: multipart/related;type=”application/rlmi+xml” ;start=”<38dk2nXYxAE@lakesdistrict.co.uk>” ;boundary=”0909e3ksdf893”
Content-Length: 1560
196 |
SIP: Understanding the Session Initiation Protocol |
--0909e3ksdf893 Content-Transfer-Encoding: binary
Content-ID: <38dk2nXYxAE@lakesdistrict.co.uk> Content-Type: application/rlmi+xml;charset=”UTF-8”
<?xml version=”1.0” encoding=”UTF-8”?> <list xmlns=”urn:ietf:params:xml:ns:rlmi”
uri=”sip:beatrix-friends@lakesdistrict.co.uk” version=”1” fullState=”true”>
<resource uri=”sip:hildegard@abbey.org”> <name>Hildegard von Bingen</name> <instance id=“juwigmtboe“ state=“active“
cid=“K3qrtD83kj2@lakesdistrict.co.uk“/>
</resource>
<resource uri=”sip:juana_ines@cuidaddemexico.mx”> <name>Sor Juana Ines de la Crux</name> <instance id=”hqzsuxtfyq” state=”active”
cid=”XdY7yhjxAEw@lakesdistrict.co.uk”/>
</resource>
<resource uri=”sip:mmead@amnh.org”> <name>Margaret Mead</name>
</resource>
</list>
--0909e3ksdf893 Content-Transfer-Encoding: binary
Content-ID: <K3qrtD83kj2@lakesdistrict.co.uk> Content-Type: application/pidf+xml;charset=”UTF-8”
<?xml version=”1.0” encoding=”UTF-8”?> <presence xmlns=”urn:ietf:params:xml:ns:pidf”
entity=”sip:hildegard@abbey.org”> <tuple id=”93sg89ae”>
<status>
<basic>open</basic>
</status>
<contact
priority=”1.0”>sip:hildegard@music.abbey.org</contact>
</tuple>
</presence>
--0909e3ksdf893 Content-Transfer-Encoding: binary
Content-ID: <XdY7yhjxAEw@lakesdistrict.co.uk> Content-Type: application/pidf+xml;charset=”UTF-8”
<?xml version=”1.0” encoding=”UTF-8”?> <presence xmlns=”urn:ietf:params:xml:ns:pidf”
entity=”sip:juana_ines@cuidaddemexico.mx”> <tuple id=”4rslie74”>
<status>
<basic>closed</basic>
</status>
</tuple>
</presence>
--0909e3ksdf893--
Presence and Instant Messaging |
197 |
The notification contains Require: eventlist, which indicates that this is an eventlist notification. The
related;type=”application/rlmi+xml” indicates that the message body is mul-
tipart MIME and contains application/rlmi+xml parts, which is the XML format for event lists defined in RFC 4662 [13]. Each part of the multipart MIME is separated by a CRLF and a boundary string, defined to be 0909e3ksdf893 in
this example. The Content-Type: application/pidf+xml;charset=”UTF-8” in
each part indicates that each part is a PIDF.
A resource list stored on an RLS is not a static list—the presence user may add or delete users from this list at any time. One way to do this is to use XCAP to manipulate the resource list. The format for this resource list is defined in RFC 4826 [16]. An example document is shown here:
<?xml version=”1.0” encoding=”UTF-8”?>
<rls-services xmlns=”urn:ietf:params:xml:ns:rls-services” xmlns:rl=”urn:ietf:params:xml:ns:resource-lists” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”> <service uri=”sip:astronomers@lists.org”>
<list name=”astronomers”>
<rl:entry uri=”sip:janet.taylor@observatory.com”/> <rl:entry uri=”sip:Maria.Kirch.Winkelmann@comets.r.us”/>
</list>
<packages>
<package>presence</package>
</packages>
</service> </rls-services>
The list is enclosed in a <rls-services> element where each <service> element defines a resource list. In this example, the event list URI is sip:marketing@ example.com as defined by the URI attribute to the <service> element. The list is included inside the <list> element.
Instead of using XCAP to create the list, the resource list subscribe extension [36] allows a SUBSCRIBE to create an event list. An example SUBSCRIBE is shown here:
SUBSCRIBE sip:beatrix-321223@lakesdistrict.co.uk SIP/2.0 Via: SIP/2.0/TCP cottage43.lakesdistrict.co.uk ;branch=z9hG4bKwYb6QREiCL
Max-Forwards: 70
To: <sip:beatrix-321223@lakesdistrict.co.uk>
From: Beatrix Potter <sip:beatrix@lakesdistrict.co.uk> ;tag=26
Call-ID: dkfj39890wssdfj2938d7 CSeq: 23822 SUBSCRIBE
Contact: <sip:beatrix@cottage43.lakesdistrict.co.uk;transport=tcp> Event: presence
Expires: 7200
Require: recipient-list-subscribe Supported: eventlist
Accept: application/pidf+xml
198 |
SIP: Understanding the Session Initiation Protocol |
Accept: application/rlmi+xml
Accept: multipart/related
Accept: multipart/signed
Accept: multipart/encrypted
Content-Type: application/resource-lists+xml
Content-Disposition: recipient-list
Content-Length: 337
<?xml version=”1.0” encoding=”UTF-8”?>
<resource-lists xmlns=”urn:ietf:params:xml:ns:resource-lists” xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”>
<list>
<entry uri=”sip:hildegard@abbey.org” />
<entry uri=”sip:juana_ines@cuidaddemexico.mx” /> <entry uri=”sip:mmead@amnh.org” />
</list> </resource-lists>
The presence of the Require: recipient-list-subscribe indicates
that this SUBCRIBE contains a list for the creation of an event list. Note that
the Content-Type: application/resource-lists+xml is the same format as the
list in [16]. However, this extension only allows list creation with the initial SUBSCRIBE. Refresh SUBSCRIBEs cannot modify the list.
An alternative is defined in [37] which allows a SUBSCRIBE request to create or update an event list. Note that this specification is not yet an RFC but is implemented in industry. An example call flow is shown in Figure 8.3.
An example SUBSCRIBE is shown here:
SUBSCRIBE sips:manya-friends@warszawa.pl SIP/2.0 Via: SIP/2.0/TLS rs.warszawa.pl ;branch=z9hG4bKwYb6QREiCL
Figure 8.3 Ad hoc list creation and manipulation.
Presence and Instant Messaging |
199 |
To: <sips:manya-friends@warszawa.pl>
From: Manya Sklodowska <sips:manya@warszawa.pl>;tag=22222 Call-ID: 7jh5dD3Fkifr2
CSeq: 3 SUBSCRIBE
Max-Forwards: 70 Event: presence Require: adhoclist
Accept: application/pidf+xml Accept: application/rlmi+xml Contact: <sips:manya@rs.warszawa.pl> Content-Type: application/adrl+xml Content-Length: ...
<?xml version=”1.0”?>
<adhoclist uri=”sip:manya-friends@warszawa” name=”Manya’s Friends”>
<add>
<resource
uri=”sips:hypatia@greatlibrary.alexandria.eg”> <resource uri=”sips:m.g.mayer@katowice.pl”> <resource uri=”sips:pan.chao@imperial.org”>
</add>
</adhoclist>
This subscribe adds three URIs in the <resource> element contained
in the <adhoclist> element. The Require: adhoclist and Content-Type:
application/adrl+xml indicate that this SUBSCRIBE is for an RLS that supports adhoc lists. A later refresh SUBSCRIBE could be used to add more URIs and delete others. For example:
SUBSCRIBE sips:manya-friends@warszawa.pl SIP/2.0 Via: SIP/2.0/TLS rs.warszawa.pl
;branch=z9hG4bKwYb6QREiCL
To: <sips:manya-friends@warszawa.pl>;tag=32111df
From: Manya Sklodowska <sips:manya@warszawa.pl>;tag=xz2d Call-ID: 7jh5dD3Fkifr2
CSeq: 34 SUBSCRIBE
Max-Forwards: 70 Event: presence Require: adhoclist
Accept: application/pidf+xml Accept: application/rlmi+xml Contact: <sips:manya@rs.warszawa.pl> Content-Type: application/adrl+xml Content-Length: ...
<?xml version=”1.0”?>
<adhoclist uri=”sip:manya-friends@warszawa” name=”Manya’s Friends”>
<add>
<resource uri=”sips:margaret_cavendish@dutchess.newcastle.gb”>
</add>
<delete>
<resource uri=”sips:m.g.mayer@katowice.pl”> </delete>
</adhoclist>
