One document matched: draft-saintandre-sip-xmpp-presence-03.txt
Differences from draft-saintandre-sip-xmpp-presence-02.txt
Network Working Group P. Saint-Andre
Internet-Draft Cisco Systems, Inc.
Intended status: Informational A. Houri
Expires: April 18, 2013 IBM
J. Hildebrand
Cisco Systems, Inc.
October 15, 2012
Interworking between the Session Initiation Protocol (SIP) and the
Extensible Messaging and Presence Protocol (XMPP): Presence
draft-saintandre-sip-xmpp-presence-03
Abstract
This document defines a bi-directional protocol mapping for the
exchange of presence information between the Session Initiation
Protocol (SIP) and the Extensible Messaging and Presence Protocol
(XMPP).
Status of this Memo
This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress."
This Internet-Draft will expire on April 18, 2013.
Copyright Notice
Copyright (c) 2012 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
Saint-Andre, et al. Expires April 18, 2013 [Page 1]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
This document may contain material from IETF Documents or IETF
Contributions published or made publicly available before November
10, 2008. The person(s) controlling the copyright in some of this
material may not have granted the IETF Trust the right to allow
modifications of such material outside the IETF Standards Process.
Without obtaining an adequate license from the person(s) controlling
the copyright in such materials, this document may not be modified
outside the IETF Standards Process, and derivative works of it may
not be created outside the IETF Standards Process, except to format
it for publication as an RFC or to translate it into languages other
than English.
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Presence Subscriptions . . . . . . . . . . . . . . . . . . . . 3
3.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.2. XMPP to SIP . . . . . . . . . . . . . . . . . . . . . . . 4
3.3. SIP to XMPP . . . . . . . . . . . . . . . . . . . . . . . 8
4. Presence Notifications . . . . . . . . . . . . . . . . . . . . 11
4.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 11
4.2. XMPP to SIP . . . . . . . . . . . . . . . . . . . . . . . 12
4.3. SIP to XMPP . . . . . . . . . . . . . . . . . . . . . . . 14
5. Content Types . . . . . . . . . . . . . . . . . . . . . . . . 16
6. Security Considerations . . . . . . . . . . . . . . . . . . . 17
7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 18
8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 18
8.1. Normative References . . . . . . . . . . . . . . . . . . . 18
8.2. Informative References . . . . . . . . . . . . . . . . . . 19
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 19
Saint-Andre, et al. Expires April 18, 2013 [Page 2]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
1. Introduction
In order to help ensure interworking between presence systems that
conform to the instant message / presence requirements [RFC2779], it
is important to clearly define protocol mappings between such
systems. Within the IETF, work has proceeded on two presence
technologies:
o Various extensions to the Session Initiation Protocol ([RFC3261])
for instant messaging, as developed within the SIP for Instant
Messaging and Presence Leveraging Extensions (SIMPLE) Working
Group; the relevant specification for presence is [RFC3856]
o The Extensible Messaging and Presence Protocol (XMPP), which
consists of a formalization of the core XML streaming protocols
developed originally by the Jabber open-source community; the
relevant specifications are [RFC6120] for the XML streaming layer
and [RFC6121] for basic presence and instant messaging extensions
One approach to helping ensure interworking between these protocols
is to map each protocol to the abstract semantics described in
[RFC3860]; that is the approach taken by
[I-D.ietf-simple-cpim-mapping] and [RFC3922]. The approach taken in
this document is to directly map semantics from one protocol to
another (i.e., from SIP/SIMPLE to XMPP and vice-versa).
The architectural assumptions underlying such direct mappings are
provided in [I-D.saintandre-sip-xmpp-core], including mapping of
addresses and error condisions. The mappings specified in this
document cover basic presence functionality. Mapping of more
advanced functionality is out of scope for this document, but other
documents in this "series" cover such topics.
2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in
[RFC2119].
3. Presence Subscriptions
3.1. Overview
Both XMPP and presence-aware SIP systems enable entities (often but
not necessarily human users) to subscribe to the presence of other
entities. XMPP presence subscriptions are specified in [RFC6121].
Saint-Andre, et al. Expires April 18, 2013 [Page 3]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
Presence subscriptions using a SIP event package for presence are
specified in [RFC3856].
As described in [RFC6121], XMPP presence subscriptions are managed
using XMPP presence stanzas of type "subscribe", "subscribed",
"unsubscribe", and "unsubscribed". The main subscription states are
"none" (neither the user nor the contact is subscribed to the other's
presence information), "from" (the user has a subscription from the
contact), "to" (the user has a subscription to the contact's presence
information), and "both" (both user and contact are subscribed to
each other's presence information).
As described in [RFC3856], SIP presence subscriptions are managed
through the use of SIP SUBSCRIBE events sent from a SIP user agent to
an intended recipient who is most generally referenced by an Instant
Message URI of the form <pres:user@domain> but who may be referenced
by a SIP or SIPS URI of the form <sip:user@domain> or
<sips:user@domain>.
The subscription models underlying XMPP and SIP are quite different.
For instance, XMPP presence subscriptions are long-lived (indeed
permanent if not explicitly cancelled), whereas SIP presence
subscriptions are short-lived (the default time to live of a SIP
presence subscription is 3600 seconds, as specified in Section 6.4 of
[RFC3856]). These differences are addressed below.
3.2. XMPP to SIP
3.2.1. Establishing
An XMPP user initiates a subscription by sending a subscription
request to another entity (conventionally called a "contact"), which
request the contact either accepts or declines. If the contact
accepts the request, the user will have a subscription to the
contact's presence information until (1) the user unsubscribes or (2)
the contact cancels the subscription. The subscription request is
encapsulated in a presence stanza of type "subscribe":
Example: XMPP user subscribes to SIP contact:
| <presence from='juliet@example.com'
| to='romeo@example.net'
| type='subscribe'/>
Upon receiving such a stanza, the XMPP server to which Juliet has
connected needs to determine the identity of the foreign domain,
which it does by performing one or more DNS SRV lookups [RFC2782].
For presence stanzas, the order of lookups recommended by [RFC6121]
Saint-Andre, et al. Expires April 18, 2013 [Page 4]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
is to first try the "_xmpp-server" service as specified in [RFC6120]
and to then try the "_pres" service as specified in [RFC3861]. Here
we assume that the first lookup will fail but that the second lookup
will succeed and return a resolution "_pres._simple.example.net.",
since we have already assumed that the example.net hostname is
running a SIP presence service.
Once the XMPP server has determined that the foreign domain is
serviced by a SIMPLE server, it must determine how to proceed. We
here assume that the XMPP server contains or has available to it an
XMPP-SIMPLE gateway. The XMPP server would then deliver the presence
stanza to the XMPP-SIMPLE gateway.
The XMPP-SIMPLE gateway is then responsible for translating the XMPP
subscription request into a SIP SUBSCRIBE request from the XMPP user
to the SIP user:
Example: XMPP user subscribes to SIP contact (SIP transformation):
| SUBSCRIBE sip:romeo@example.net SIP/2.0
| Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bKna998sk
| From: <sip:juliet@example.com>;tag=ffd2
| To: <sip:romeo@example.net>
| Call-ID: l04th3s1p@example.com
| Event: presence
| Max-Forwards: 70
| CSeq: 123 SUBSCRIBE
| Contact: <sip:sipgate.example.com;transport=tcp>
| Accept: application/pidf+xml
| Expires: 3600
| Content-Length: 0
The SIP user then SHOULD send a response indicating acceptance of the
subscription request:
Example: SIP accepts subscription request:
| SIP/2.0 200 OK
| Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk
| From: <sip:romeo@example.net>;tag=ffd2
| To: <sip:juliet@example.com>;tag=j89d
| Call-ID: l04th3s1p@example.com
| CSeq: 234 SUBSCRIBE
| Contact: <sip:simple.example.net;transport=tcp>
| Expires: 3600
| Content-Length: 0
In accordance with [RFC6665], the XMPP-SIMPLE gateway should consider
Saint-Andre, et al. Expires April 18, 2013 [Page 5]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
the subscription state to be "neutral" until it receives a NOTIFY
message. Therefore the SIP user or SIP-XMPP gateway at the SIP
user's domain SHOULD immediately send a NOTIFY message containing a
"Subscription-State" header whose value contains the string "active"
(see Section 4).
Example: SIP user sends presence notification:
| NOTIFY sip:192.0.2.1 SIP/2.0
| Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk
| From: <sip:romeo@example.net>;tag=yt66
| To: <sip:juliet@example.com>;tag=bi54
| Call-ID: l04th3s1p@example.com
| Event: presence
| Subscription-State: active;expires=499
| Max-Forwards: 70
| CSeq: 8775 NOTIFY
| Contact: <sip:simple.example.net;transport=tcp>
| Content-Type: application/pidf+xml
| Content-Length: 193
|
| <?xml version='1.0' encoding='UTF-8'?>
| <presence xmlns='urn:ietf:params:xml:ns:pidf'
| entity='pres:romeo@example.net'>
| <tuple id='orchard'>
| <status>
| <basic>open</basic>
| </status>
| </tuple>
| </presence>
Upon receiving the first NOTIFY with a subscription state of active,
the XMPP-SIMPLE gateway MUST generate a presence stanza of type
"subscribed":
Example: XMPP user receives acknowledgement from SIP contact:
| <presence from='romeo@example.net'
| to='juliet@example.com'
| type='subscribed'/>
As described under Section 4, the gateway MUST also generate a
presence notification to the XMPP user:
Example: XMPP user receives presence notification from SIP contact:
| <presence from='romeo@example.net/orchard'
| to='juliet@example.com'/>
Saint-Andre, et al. Expires April 18, 2013 [Page 6]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
3.2.2. Refreshing
It is the responsibility of the XMPP-SIMPLE gateway to set the value
of the "Expires" header and to periodically renew the subscription on
the SIMPLE side of the gateway so that the subscription appears to be
permanent to the XMPP user (e.g., the XMPP-SIMPLE gateway SHOULD send
a new SUBSCRIBE request to the SIP user whenever the XMPP user sends
initial presence to its XMPP server, i.e., upon initiating a presence
session with the XMPP server). See the Security Considerations
(Section 6) of this document for important information and
requirements regarding the security implications of this
functionality.
3.2.3. Cancelling
At any time after subscribing, the XMPP user may unsubscribe from the
contact's presence. This is done by sending a presence stanza of
type "unsubscribe":
Example: XMPP user unsubscribes from SIP contact:
| <presence from='juliet@example.com'
| to='romeo@example.net'
| type='unsubscribe'/>
The XMPP-SIMPLE gateway is responsible for translating the
unsubscribe command into a SIP SUBSCRIBE request with the "Expires"
header set to a value of zero:
Example: XMPP user unsubscribes from SIP contact (SIP
transformation):
| SUBSCRIBE sip:romeo@example.net SIP/2.0
| Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk
| From: <sip:juliet@example.com>;tag=j89d
| To: <sip:romeo@example.net>;tag=xfg9
| Call-ID: 1ckm32@example.com
| Event: presence
| Max-Forwards: 70
| CSeq: 789 SUBSCRIBE
| Contact: <sip:x2s.example.com;transport=tcp>
| Accept: application/pidf+xml
| Expires: 0
| Content-Length: 0
Upon sending the transformed unsubscribe, the XMPP-SIMPLE gateway
SHOULD a presence stanza of type "unsubscribed" to the XMPP user:
Saint-Andre, et al. Expires April 18, 2013 [Page 7]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
Example: XMPP user receives unsubscribed notification:
| <presence from='romeo@example.net'
| to='juliet@example.com'
| type='unsubscribed'/>
3.3. SIP to XMPP
3.3.1. Establishing
A SIP user initiates a subscription to a contact's presence
information by sending a SIP SUBSCRIBE request to the contact. The
following is an example of such a request:
Example: SIP user subscribes to XMPP contact:
| SUBSCRIBE sip:juliet@example.com SIP/2.0
| Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk
| From: <sip:romeo@example.net>;tag=xfg9
| To: <sip:juliet@example.com>;tag=ur93
| Call-ID: 4wcm0n@example.net
| Event: presence
| Max-Forwards: 70
| CSeq: 263 SUBSCRIBE
| Contact: <sip:simple.example.net;transport=tcp>
| Accept: application/pidf+xml
| Content-Length: 0
Notice that the "Expires" header was not included in the SUBSCRIBE
request; this means that the default value of 3600 (i.e., 3600
seconds = 1 hour) applies.
Upon receiving such a request, a SIMPLE-XMPP gateway is responsible
for translating it into an XMPP subscription request from the SIP
user to the XMPP user:
Example: SIP user subscribes to XMPP contact (XMPP transformation):
| <presence from='romeo@example.net'
| to='juliet@example.com'
| type='subscribe'/>
In accordance with [RFC6121], the XMPP user's server MUST deliver the
presence subscription request to the XMPP user (or, if a subscription
already exists in the XMPP user's roster, discard the subscribe
request). If the XMPP user approves the subscription request, the
XMPP server then MUST return a presence stanza of type "subscribed"
from the XMPP user to the SIP user; if a subscription already exists,
Saint-Andre, et al. Expires April 18, 2013 [Page 8]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
the XMPP server SHOULD auto-reply with a presence stanza of type
"subscribed". In any case, if the SIMPLE-XMPP gateway receives a
presence stanza of type "subscribed" from the XMPP user, it SHOULD
silently discard the stanza.
3.3.2. Refreshing
It is the responsibility of the SIMPLE-XMPP gateway to properly
handle the difference between short-lived SIP presence subscriptions
and long-lived XMPP presence subscriptions. The gateway has two
options when the SIP user's subscription expires:
o Cancel the subscription (i.e., treat it as temporary) and send an
XMPP presence stanza of type "unsubscribe" to the XMPP contact;
this honors the SIP semantic but will seem rather odd to the XMPP
contact.
o Maintain the subscription (i.e., treat it as long-lived) and (1)
send a SIP NOTIFY request to the SIP user containing a PIDF
document specifying that the XMPP contact now has a basic status
of "closed", including a Subscription-State of "terminated" and
(2) send an XMPP presence stanza of type "unavailable" to the XMPP
contact; this violates the letter of the SIP semantic but will
seem more natural to the XMPP contact.
Which of these options the SIMPLE-XMPP gateway chooses is up to the
implementation.
If the implementation chooses the first option, the protocol
generated would be as follows:
Example: SIP subscription expires (treated as temporary by gateway):
| <presence from='romeo@example.net'
| to='juliet@example.com'
| type='unsubscribe'/>
If the implementation chooses the second option, the protocol
generated would be as follows:
Saint-Andre, et al. Expires April 18, 2013 [Page 9]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
Example: SIP subscription expires (treated as long-lived by gateway):
| NOTIFY sip:192.0.2.2 SIP/2.0
| Via: SIP/2.0/TCP s2x.example.net;branch=z9hG4bKna998sk
| From: <sip:juliet@example.com>;tag=ur93
| To: <sip:romeo@example.net>;tag=pq72
| Call-ID: j4s0h4vny@example.com
| Event: presence
| Subscription-State: terminated;reason=timeout
| Max-Forwards: 70
| CSeq: 232 NOTIFY
| Contact: <sip:sipgate.example.com;transport=tcp>
| Content-Type: application/pidf+xml
| Content-Length: 194
|
| <?xml version='1.0' encoding='UTF-8'?>
| <presence xmlns='urn:ietf:params:xml:ns:pidf'
| entity='pres:juliet@example.com'>
| <tuple id='balcony'>
| <status>
| <basic>closed</basic>
| </status>
| </tuple>
| </presence>
Example: SIP subscription expires (treated as long-lived by gateway):
| <presence from='romeo@example.net'
| to='juliet@example.com'
| type='unavailable'/>
3.3.3. Cancelling
At any time, the SIP user may cancel the subscription by sending a
SUBSCRIBE message whose "Expires" header is set to a value of zero
("0"):
Saint-Andre, et al. Expires April 18, 2013 [Page 10]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
Example: SIP user cancels subscription:
| SUBSCRIBE sip:192.0.2.1 SIP/2.0
| Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk
| From: <sip:romeo@example.net>;tag=yt66
| To: <sip:juliet@example.com>;tag=bi54
| Call-ID: 1tsn1ce@example.net
| Event: presence
| Max-Forwards: 70
| CSeq: 8775 SUBSCRIBE
| Contact: <sip:simple.example.net;transport=tcp>
| Expires: 0
| Content-Length: 0
As above, upon receiving such a request, a SIMPLE-XMPP gateway is
responsible for doing one of the following:
o Cancel the subscription (i.e., treat it as temporary) and send an
XMPP presence stanza of type "unsubscribe" to the XMPP contact.
o Maintain the subscription (i.e., treat it as long-lived) and (1)
send a SIP NOTIFY request to the SIP user containing a PIDF
document specifying that the XMPP contact now has a basic status
of "closed", (2) send a SIP SUBSCRIBE request to the SIP user with
an "Expires" header set to a value of "0" (zero) when it receives
XMPP presence of type "unavailable" from the XMPP contact, and (3)
send an XMPP presence stanza of type "unavailable" to the XMPP
contact.
4. Presence Notifications
4.1. Overview
Both XMPP and presence-aware SIP systems enable entities (often but
not necessarily human users) to send presence notifications to other
entities. At a minimum, the term "presence" refers to information
about an entity's availability for communication on a network (on/
off), often supplemented by information that further specifies the
entity's communications context (e.g., "do not disturb"). Some
systems and protocols extend this notion even further and refer to
any relatively ephemeral information about an entity as a kind of
presence; categories of such "extended presence" include geographical
location (e.g., GPS coordinates), user mood (e.g., grumpy), user
activity (e.g., walking), and ambient environment (e.g., noisy). In
this document, we focus on the "least common denominator" of network
availability only, although future documents may address broader
notions of presence, including extended presence.
Saint-Andre, et al. Expires April 18, 2013 [Page 11]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
[RFC6121] defines how XMPP presence stanzas can indicate availability
(via absence of a 'type' attribute) or lack of availability (via a
'type' attribute with a value of "unavailable"). SIP presence using
a SIP event package for presence is specified in [RFC3856].
As described in [RFC6121], presence information about an entity is
communicated by means of an XML <presence/> stanza sent over an XML
stream. In this document we will assume that such a presence stanza
is sent from an XMPP client to an XMPP server over an XML stream
negotiated between the client and the server, and that the client is
controlled by a human user (again, this is a simplifying assumption
introduced for explanatory purposes only). In general, XMPP presence
is sent by the user to the user's server and then broadcasted to all
entities who are subscribed to the user's presence information.
As described in [RFC3856], presence information about an entity is
communicated by means of a SIP NOTIFY event sent from a SIP user
agent to an intended recipient who is most generally referenced by an
Instant Message URI of the form <pres:user@domain> but who may be
referenced by a SIP or SIPS URI of the form <sip:user@domain> or
<sips:user@domain>. Here again we introduce the simplifying
assumption that the user agent is controlled by a human user.
4.2. XMPP to SIP
When Juliet interacts with her XMPP client to modify her presence
information (or when her client automatically updates her presence
information, e.g. via an "auto-away" feature), her client generates
an XMPP <presence/> stanza. The syntax of the <presence/> stanza,
including required and optional elements and attributes, is defined
in [RFC6121]. The following is an example of such a stanza:
Example: XMPP user sends presence notification:
| <presence from='juliet@example.com/balcony'/>
Upon receiving such a stanza, the XMPP server to which Juliet has
connected broadcasts it to all subscribers who are authorized to
receive presence notifications from Juliet (this is similar to the
SIP NOTIFY method). For each subscriber, broadcasting the presence
notification involves either delivering it to a local recipient (if
the hostname in the subscriber's address matches one of the hostnames
serviced by the XMPP server) or attempting to route it to the foreign
domain that services the hostname in the subscriber's address.
Naturally, in this document we assume that the hostname is a SIP
presence service hosted by a separate server. As specified in
[RFC6121], the XMPP server needs to determine the identity of the
foreign domain, which it does by performing one or more DNS SRV
Saint-Andre, et al. Expires April 18, 2013 [Page 12]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
lookups [RFC2782]. For presence stanzas, the order of lookups
recommended by [RFC6121] is to first try the "_xmpp-server" service
as specified in [RFC6120] and to then try the "_pres" service as
specified in [RFC3861]. Here we assume that the first lookup will
fail but that the second lookup will succeed and return a resolution
"_pres._simple.example.net.", since we have already assumed that the
example.net hostname is running a SIP presence service. (Note: The
XMPP server may have previously determined that the foreign domain is
a SIMPLE server, e.g., when it sent a SIP SUBSCRIBE to the SIP user
when Juliet sent initial presence to the XMPP server, in which case
it would not need to perform the SRV lookups; the caching of such
information is a matter of implementation and local service policy,
and is therefore out of scope for this document.)
Once the XMPP server has determined that the foreign domain is
serviced by a SIMPLE server, it must determine how to proceed. We
here assume that the XMPP server contains or has available to it an
XMPP-SIMPLE gateway. The XMPP server would then deliver the presence
stanza to the XMPP-SIMPLE gateway.
The XMPP-SIMPLE gateway is then responsible for translating the XMPP
presence stanza into a SIP NOTIFY request and included PIDF document
from the XMPP user to the SIP user.
Example: XMPP user sends presence notification (SIP transformation):
| NOTIFY sip:192.0.2.2 SIP/2.0
| Via: SIP/2.0/TCP x2s.example.com;branch=z9hG4bKna998sk
| From: <sip:juliet@example.com>;tag=gh19
| To: <sip:romeo@example.net>;tag=yt66
| Call-ID: j4s0h4vny@example.com
| Event: presence
| Subscription-State: active;expires=599
| Max-Forwards: 70
| CSeq: 157 NOTIFY
| Contact: <sip:sipgate.example.com;transport=tcp>
| Content-Type: application/pidf+xml
| Content-Length: 192
|
| <?xml version='1.0' encoding='UTF-8'?>
| <presence xmlns='urn:ietf:params:xml:ns:pidf'
| entity='pres:juliet@example.com'>
| <tuple id='balcony'>
| <status>
| <basic>open</basic>
| </status>
| </tuple>
| </presence>
Saint-Andre, et al. Expires April 18, 2013 [Page 13]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
The mapping of XMPP syntax elements to SIP syntax elements SHOULD be
as shown in the following table. (Mappings for elements not
mentioned are undefined.)
Table 6: Presence syntax mapping from XMPP to SIP
+-----------------------------+---------------------------+
| XMPP Element or Attribute | SIP Header or PIDF Data |
+-----------------------------+---------------------------+
| <presence/> stanza | "Event: presence" [1] |
| XMPP resource identifer | tuple 'id' attribute |
| from | From |
| id | Call-ID |
| to | To |
| type | basic status [2][3] |
| xml:lang | Content-Language |
| <priority/> | PIDF priority for tuple |
| <show/> | (no mapping) |
| <status/> | note [4] |
+-----------------------------+---------------------------+
Note the following regarding these mappings:
1. Only a presence stanza that lacks a 'type' attribute or whose
'type' attribute has a value of "unavailable" should be mapped by
an XMPP-SIMPLE gateway to a SIP NOTIFY request, since those are
the only presence stanzas that represent notifications.
2. Because the lack of a 'type' attribute indicates that an XMPP
entity is available for communications, the gateway SHOULD map
that information to a PIDF <basic/> status of "open". Because a
'type' attribute with a value of "unavailable" indicates that an
XMPP entity is not available for communications, the gateway
SHOULD map that information to a PIDF <basic/> status of
"closed".
3. When the XMPP-SIMPLE gateway receives XMPP presence of type
"unavailable" from the XMPP contact, it SHOULD (1) send a SIP
NOTIFY request to the SIP user containing a PIDF document
specifying that the XMPP contact now has a basic status of
"closed" and (2) send a SIP SUBSCRIBE request to the SIP user
with an "Expires" header set to a value of "0" (zero).
4. The character data of the XMPP <status/> element MAY be mapped to
the character data of the PIDF <note/> element.
4.3. SIP to XMPP
When Romeo changes his presence, his SIP user agent generates a SIP
NOTIFY request for any active subscriptions. The syntax of the
NOTIFY request is defined in [RFC3856]. The following is an example
Saint-Andre, et al. Expires April 18, 2013 [Page 14]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
of such a request:
Example: SIP user sends presence notification:
| NOTIFY sip:192.0.2.1 SIP/2.0
| Via: SIP/2.0/TCP simple.example.net;branch=z9hG4bKna998sk
| From: <sip:romeo@example.net>;tag=yt66
| To: <sip:juliet@example.com>;tag=bi54
| Call-ID: j0sj4sv1m@example.net
| Event: presence
| Subscription-State: active;expires=499
| Max-Forwards: 70
| CSeq: 8775 NOTIFY
| Contact: <sip:simple.example.net;transport=tcp>
| Content-Type: application/pidf+xml
| Content-Length: 193
|
| <?xml version='1.0' encoding='UTF-8'?>
| <presence xmlns='urn:ietf:params:xml:ns:pidf'
| entity='pres:romeo@example.net'>
| <tuple id='orchard'>
| <status>
| <basic>closed</basic>
| </status>
| </tuple>
| </presence>
Upon receiving such a request, a SIMPLE-XMPP gateway is responsible
for translating it into an XMPP presence stanza from the SIP user to
the XMPP user:
Example: SIP user sends presence notification (XMPP transformation):
| <presence from='romeo@example.net'
| to='juliet@example.com/balcony'
| type='unavailable'/>
The mapping of SIP syntax elements to XMPP syntax elements SHOULD be
as shown in the following table. (Mappings for elements not
mentioned are undefined.)
Saint-Andre, et al. Expires April 18, 2013 [Page 15]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
Table 7: Presence syntax mapping from SIP to XMPP
+---------------------------+-----------------------------+
| SIP Header or PIDF Data | XMPP Element or Attribute |
+---------------------------+-----------------------------+
| basic status | type [1] |
| Content-Language | xml:lang |
| CSeq | id (OPTIONAL) |
| From | from |
| priority for tuple | <priority/> |
| To | to |
| body of MESSAGE | <body/> |
+---------------------------+-----------------------------+
Note the following regarding these mappings:
1. A PIDF basic status of "open" SHOULD be mapped to no 'type'
attribute, and a PIDF basic status of "closed" SHOULD be mapped
to a 'type' attribute whose value is "unavailable".
5. Content Types
SIP requests of type NOTIFY normally contain presence information
encapsulated using the "application/pidf+xml" content type. The
recommended procedures for SIMPLE-to-XMPP gateways to use in handling
these content types are as follows.
The "application/pidf+xml' content type is specified in [RFC3863].
The Presence Information Data Format defines a common data format for
presence protocols that conform to the Common Profile for Presence
([RFC3859]), enabling presence information to be transferred across
CPP-compliant protocol boundaries without modification, with
attendant benefits for end-to-end encryption and performance.
Because the syntax for the "application/pidf+xml" content type is
Extensible Markup Language ([XML]), it is straightforward to send
PIDF data over the Extensible Messaging and Presence Protocol (XMPP)
([RFC6120]), since XMPP is simply an XML streaming protocol.
In addition to following the syntax mappings specified in Section 4,
a SIMPLE-to-XMPP gateway MAY encapsulate PIDF data within an
"extended namespace" contained in an XMPP presence stanza. The
RECOMMENDED method is to include the PIDF <presence/> element as a
child of the XMPP <presence/> stanza. Although it may appear that
this would be potentially confusing, the inclusion of the
'urn:ietf:params:xml:ns:pidf' namespace ensures that PIDF data is
kept separate from XMPP presence data (in accordance with
[XML-NAMES]). The following is a simple example of encapsulating
Saint-Andre, et al. Expires April 18, 2013 [Page 16]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
PIDF data within an "extended namespace" in XMPP:
A basic example of PIDF over XMPP:
<presence from='romeo@example.net/orchard'
to='nurse@example.com'
xml:lang='en'>
<status>Wooing Juliet</status>
<presence xmlns='urn:ietf:params:xml:ns:pidf'
entity='pres:romeo@example.net'>
<tuple id='orchard'>
<status>
<basic>open</basic>
<note>Wooing Juliet</note>
</status>
</tuple>
</presence>
</presence>
6. Security Considerations
Detailed security considerations for presence protocols are given in
[RFC2779], for SIP-based presence in [RFC3856] (see also [RFC3261]),
and for XMPP-based presence in [RFC6121] (see also [RFC6120]).
The mismatch between long-lived XMPP presence subscriptions and
short-lived SIP presence subscriptions introduces the possibility of
an amplification attack launched from the XMPP network against a SIP
presence server. To help prevent such an attack, access to an XMPP-
SIMPLE gateway that is hosted on the XMPP network SHOULD be
restricted to XMPP users associated with a single domain or trust
realm (e.g., a gateway hosted at simple.example.com should allow only
users within the example.com domain to access the gateway, not users
within example.org, example.net, or any other domain); if a SIP
presence server receives communications through an XMPP-SIMPLE
gateway from users who are not associated with a domain that is so
related to the hostname of the gateway, it MAY (based on local
service provisioning) refuse to service such users or refuse to
communicate with the gateway. Furthermore, whenever an XMPP-SIMPLE
gateway seeks to refresh an XMPP user's long-lived subscription to a
SIP user's presence, it MUST first send an XMPP <presence/> stanza of
type "probe" from the address of the gateway to the "bare JID"
(user@domain.tld) of the XMPP user, to which the user's XMPP server
MUST respond in accordance with [RFC6121]; however, the administrator
of an XMPP-SIMPLE gateway MAY (based on local service provisioning)
exempt "known good" XMPP servers from this check (e.g., the XMPP
server associated with the XMPP-SIMPLE gateway as described above).
Saint-Andre, et al. Expires April 18, 2013 [Page 17]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
7. IANA Considerations
This document requests no actions of IANA.
8. References
8.1. Normative References
[I-D.saintandre-sip-xmpp-core]
Saint-Andre, P., Houri, A., and J. Hildebrand,
"Interworking between the Session Initiation Protocol
(SIP) and the Extensible Messaging and Presence Protocol
(XMPP): Core", draft-saintandre-sip-xmpp-core-02 (work in
progress), October 2012.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC2782] Gulbrandsen, A., Vixie, P., and L. Esibov, "A DNS RR for
specifying the location of services (DNS SRV)", RFC 2782,
February 2000.
[RFC3261] Rosenberg, J., Schulzrinne, H., Camarillo, G., Johnston,
A., Peterson, J., Sparks, R., Handley, M., and E.
Schooler, "SIP: Session Initiation Protocol", RFC 3261,
June 2002.
[RFC3856] Rosenberg, J., "A Presence Event Package for the Session
Initiation Protocol (SIP)", RFC 3856, August 2004.
[RFC3861] Peterson, J., "Address Resolution for Instant Messaging
and Presence", RFC 3861, August 2004.
[RFC3863] Sugano, H., Fujimoto, S., Klyne, G., Bateman, A., Carr,
W., and J. Peterson, "Presence Information Data Format
(PIDF)", RFC 3863, August 2004.
[RFC6665] Roach, A., "SIP-Specific Event Notification", RFC 6665,
July 2012.
[XML] Paoli, J., Maler, E., Sperberg-McQueen, C., Yergeau, F.,
and T. Bray, "Extensible Markup Language (XML) 1.0 (Fourth
Edition)", World Wide Web Consortium Recommendation REC-
xml-20060816, August 2006,
<http://www.w3.org/TR/2006/REC-xml-20060816>.
[XML-NAMES]
Saint-Andre, et al. Expires April 18, 2013 [Page 18]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
Bray, T., Hollander, D., and A. Layman, "Namespaces in
XML", W3C REC-xml-names, January 1999,
<http://www.w3.org/TR/REC-xml-names>.
[RFC6120] Saint-Andre, P., "Extensible Messaging and Presence
Protocol (XMPP): Core", RFC 6120, March 2011.
[RFC6121] Saint-Andre, P., "Extensible Messaging and Presence
Protocol (XMPP): Instant Messaging and Presence",
RFC 6121, March 2011.
8.2. Informative References
[I-D.ietf-simple-cpim-mapping]
Rosenberg, J. and B. Campbell, "CPIM Mapping of SIMPLE
Presence and Instant Messaging",
draft-ietf-simple-cpim-mapping-01 (work in progress),
June 2002.
[RFC2779] Day, M., Aggarwal, S., and J. Vincent, "Instant Messaging
/ Presence Protocol Requirements", RFC 2779,
February 2000.
[RFC3859] Peterson, J., "Common Profile for Presence (CPP)",
RFC 3859, August 2004.
[RFC3860] Peterson, J., "Common Profile for Instant Messaging
(CPIM)", RFC 3860, August 2004.
[RFC3922] Saint-Andre, P., "Mapping the Extensible Messaging and
Presence Protocol (XMPP) to Common Presence and Instant
Messaging (CPIM)", RFC 3922, October 2004.
Authors' Addresses
Peter Saint-Andre
Cisco Systems, Inc.
1899 Wynkoop Street, Suite 600
Denver, CO 80202
USA
Phone: +1-303-308-3282
Email: psaintan@cisco.com
Saint-Andre, et al. Expires April 18, 2013 [Page 19]
Internet-Draft SIP-XMPP Interworking: Presence October 2012
Avshalom Houri
IBM
Building 18/D, Kiryat Weizmann Science Park
Rehovot 76123
Israel
Email: avshalom@il.ibm.com
Joe Hildebrand
Cisco Systems, Inc.
1899 Wynkoop Street, Suite 600
Denver, CO 80202
USA
Email: jhildebr@cisco.com
Saint-Andre, et al. Expires April 18, 2013 [Page 20]
| PAFTECH AB 2003-2026 | 2026-04-24 01:32:03 |