%ents; ]>
Resource Application Priority This document defines an XMPP protocol extension to indicate the presence priority of XMPP resources for applications other than standard XMPP messaging. &LEGALNOTICE; 0168 Experimental Standards Track Standards Council XMPP Core XMPP IM XEP-0030 TO BE ASSIGNED &stpeter; &hildjj; 0.6 2007-11-19 psa

Documented optional pubsub transport for RAP data.

0.5 2007-11-15 psa

Editorial review and consistency check.

0.4 2007-06-06 psa

Added section on RAP-based routing of messages sent to bare JIDs; removed RAP request protocol; changed app attribute to ns attribute; removed the application types registry since it is unnecessary if the ns attribute specifies the XML namespace of the data most closely associated with the application type; updated namespaces to conform to XMPP Registrar processes.

0.3 2006-09-17 psa

Changed im application type to messaging; added jingle-video.

0.2 2005-12-19 psa

Clarified structure of, and added schema for, RAP request namespace.

0.1 2005-12-15 psa

Initial published version.

0.0.6 2005-11-29 psa

Document cleanup.

0.0.5 2005-11-17 psa

Added support for RAP requests via IQ.

0.0.4 2005-10-27 psa/jjh

Defined registry of application types; clarified business rules; corrected schema.

0.0.3 2005-10-24 psa/jjh

Broadened previous resource flagging proposal to include priority for applications other than messaging.

0.0.2 2005-09-26 psa/jjh

Added more business rules and examples; defined service discovery guidelines.

0.0.1 2005-09-23 psa/jjh

First draft.

Within the Extensible Messaging and Presence Protocol (XMPP; see &rfc3920;), presence indicates availability for communication. Specifically, in systems that bundle presence and instant messaging (see &rfc3921;), the <priority/> child of the XMPP &PRESENCE; stanza indicates availability for communications qualified by the "jabber:client" namespace, especially instant messaging. However, a wide variety of entities might provide XMPP presence, including entities that are not primarily focused on IM (e.g., phones) or even entities that do not support XMPP messaging at all.

Consider a scenario in which a contact wants to initiate a voice chat (see &xep0167;) with a user who has the following three XMPP resources:

Resource Messaging Priority Voice Chat Priority
desktop 10 5
pda 5 -1
mobile -1 10

If the contact chooses the resource with which it initiates a voice chat based on the standard XMPP <priority/> element, the resulting behavior could be misleading (i.e., initiating the voice chat with the "desktop" resource rather than the "mobile" resource).

What is needed is a way for the user's clients to indicate that the application priority for the three resources is different from the standard XMPP priority. This document defines such a mechanism via an optional XMPP presence extension.

As extensions to that core use case, this document also defines:

Application priority is encapsulated by a <rap/> element qualified by the 'http://www.xmpp.org/extensions/xep-0168.html#ns' namespace &NSNOTE;. The attributes of the <rap/> element are as follows.

Attribute Definition Inclusion
ns The primary namespace of the application type. REQUIRED
num The resource's priority for this application type. This protocol uses a 'num' attribute rather than a 'priority' attribute to reduce confusion with standard XMPP presence.) REQUIRED

An example follows.

]]>

The following business rules apply to the generation of resource application priority by the client:

  1. A client SHOULD include a <rap/> element for each application type for which it wishes to advertise a priority, but SHOULD NOT do so if the priority for that application is the same as the resource's standard XMPP priority.

  2. A client MUST NOT generate a <rap/> element that has a 'ns' attribute whose value is "jabber:client" or that has no 'ns' attribute (since the default 'ns' is "jabber:client").

  3. The <rap/> element SHOULD be empty.

As explained in the following sections, there are two possible transports for RAP data: standard XMPP presence and the XMPP publish-subscribe extension.

RAP data MAY be included as extended content within a standard XMPP presence stanza. This is consistent with the rule that presence stanzas must be related to the network availability or communication preferences of the entity that provides presence information.

For the three resources ("desktop", "pda", and "mobile") mentioned above, the presence stanzas received by a contact would be as follows.

10 5 -1 ]]>

Alternatively, RAP data MAY be provided via the XMPP &xep0060; publish-subscribe extension, specifically the &xep0163; profile thereof.

For the three resources ("desktop", "pda", and "mobile") mentioned above, the pubsub notifications received by a contact would be as follows.

]]>

The user's XMPP server may have special information that enables it to flag a resource as primary for a given application type. For instance, the server may include a communication policy service that enables the user to define (outside the context of any presence priorities) that she would prefer to be called at her desktop computer only between the hours of 9:00 AM and 5:00 PM local time, prefer to be called on her mobile phone at all other times, and so on.

To flag the primary resource related to a specific application type, the server shall add a <primary/> child to the relevant RAP element. Here is an example:

-1 ]]>

The following business rules apply to primary resource flagging by the server:

  1. A server MAY add the <primary/> element to RAP data generated by the resource it determines is "most available" for a given application type.

  2. Because the default 'ns' is "jabber:client", to flag the primary resource for standard XMPP communications the server SHOULD NOT include a 'ns' attribute, SHOULD NOT include a 'num' attribute, and MUST include a <primary/> child.

  3. An available resource that has specified a negative priority for an application type MUST NOT be flagged as the primary resource for that application type.

  4. A client SHOULD NOT include the <primary/> element in RAP data that it generates; however, if a client includes <primary/> element, the server SHOULD remove or overwrite the element.

  5. In response to a presence probe, a server SHOULD send presence from the primary resource first (this enables the receiving client to skip any local "most-available-resource" algorithms it might implement) if the client includes RAP data in presence.

  6. If the primary resource changes for a given application type and the client includes RAP data in presence, a server MUST broadcast updated presence information (including the <primary/> element) for the new primary resource. If the change in primary resource occurs because of a presence broadcast from the current primary resource, the server MUST push presence from the current primary resource (without the <primary/> element) before pushing presence from the new primary resource (including the <primary/> element).

A server MAY use the RAP data provided by a client in determing how to route incoming &MESSAGE; stanzas directed to the bare JID &LOCALBARE; of a registered account. In order to enable such routing, the sender MUST include an empty <route/> element qualified by the 'http://www.xmpp.org/extensions/xep-0168.html#ns-raproute' namespace &NSNOTE; including an 'ns' attribute corresponding to the desired application type.

For example, consider a &xep0155; request sent from one user (Romeo) to another (Juliet), where the users do not share presence. Romeo wants the request to be delivered to the highest-priority resource for the "http://www.xmpp.org/extensions/xep-0167.html#ns" application type.

ffd7076498744578d10edabfe7f4a866 Open chat with Romeo? urn:xmpp:ssn true ... ]]>

If Juliet's server supports RAP routing, it would then deliver the message to whichever of Juliet's resources has the highest priority for the "http://www.xmpp.org/extensions/xep-0167.html#ns" application type.

In order to discover whether a server or other entity supports this protocol, an entity MUST use &xep0030; or the dynamic profile of service discovery defined in &xep0115;.

]]>

If the queried entity supports the functionality specified herein, it MUST return the following features &NSNOTE;:

  • For RAP, "http://www.xmpp.org/extensions/xep-0168.html#ns"
  • For RAP routing, "http://www.xmpp.org/extensions/xep-0168.html#ns-route"
... ... ]]>

When the pubsub transport is used, client publishing of resource application priority may result in a presence leak if the node access model is "open". Care should be taken in properly configuring the pubsub node so that unauthorized entities are not able to retrieve information about the user's available resources.

Server flagging of the primary resource is not know to introduce any vulnerabilities or compromises of user privacy.

This document requires no interaction with &IANA;.

Until this specification advances to a status of Draft, its associated namespaces shall be:

  • http://www.xmpp.org/extensions/xep-0168.html#ns
  • http://www.xmpp.org/extensions/xep-0168.html#ns-route

Upon advancement of this specification, the ®ISTRAR; shall issue permanent namespaces in accordance with the process defined in Section 4 of &xep0053;.

The following namespaces are requested, and are thought to be unique per the XMPP Registrar's requirements:

  • urn:xmpp:rap
  • urn:xmpp:rap:route
]]> ]]>