Abstract: | This specification defines an XMPP protocol extension for message receipts, whereby the sender of a message can request notification that it has been received by the intended recipient. |
Authors: | Peter Saint-Andre, Joe Hildebrand |
Copyright: | © 1999 - 2010 XMPP Standards Foundation. SEE LEGAL NOTICES. |
Status: | Draft |
Type: | Standards Track |
Version: | 1.0 |
Last Updated: | 2007-09-26 |
NOTICE: The protocol defined herein is a Draft Standard of the XMPP Standards Foundation. Implementations are encouraged and the protocol is appropriate for deployment in production systems, but some changes to the protocol are possible before it becomes a Final Standard.
1. Introduction
2. Requirements
3. Protocol Format
4. Business Rules
5. Determining Support
6. Negotiation
7. Implementation Notes
8. Security Considerations
9. IANA Considerations
10. XMPP Registrar Considerations
10.1. Protocol Namespaces
10.2. Field Standardization
11. XML Schema
12. Acknowledgements
Appendices
A: Document Information
B: Author Information
C: Legal Notices
D: Relation to XMPP
E: Discussion Venue
F: Requirements Conformance
G: Notes
H: Revision History
While Advanced Message Processing [1] provides message acknowledgements at the server level, it does not extend that model all the way to the client. However, sometimes client-level acknowledgements are needed, for example to provide "receipts". This document defines a mechanism for XMPP message receipts, which are functionally equivalent to the "delivered" or "displayed" event in Message Events [2], which this specification in part obsoletes. [3]
Note: This extension is functionally equivalent to an Advanced Message Processing rule of "receipt" but uses a dedicated namespace to simplify processing by end user clients and intermediate routers.
This document addresses the following requirements:
Note: This document explicitly does not define a protocol for "guaranteed delivery", since that term (like "security") means different things to different people. Instead, we define a more focused protocol that addresses the need for message receipts, thus solving one problem that falls under the heading of "guaranteed delivery".
In order to make it possible for senders to request and for recipients to generate message receipts, we define a dedicated protocol extension qualified by the 'urn:xmpp:receipts' namespace.
There are two allowable elements in this namespace:
Specifically, the receiving entity shall return a <received/> notice if it has received and processed the message. The term "processed" is understood to include presentation to a human user if appropriate or any other application-specific client-side processing, including generation of an error response if the application determines that the message contents cannot be handled.
The following is an example of a message that includes a request for return receipt.
<message from='northumberland@shakespeare.lit/westminster' id='richard2-4.1.247' to='kingrichard@royalty.england.lit/throne'> <body>My lord, dispatch; read o'er these articles.</body> <request xmlns='urn:xmpp:receipts'/> </message>
The recipient shall generate a receipt if and only if it supports the protocol defined herein and it is configured to return receipts, either globally or for this recipient (otherwise it MUST NOT return a receipt and SHOULD NOT return an error).
<message from='kingrichard@royalty.england.lit/throne' id='richard2-4.1.247' to='northumberland@shakespeare.lit/westminster'> <received xmlns='urn:xmpp:receipts'/> </message>
The <received/> element SHOULD be the only child of the <message/> stanza and MUST mirror the 'id' of the sent message.
The following business rules apply:
A sender SHOULD NOT include a request for message receipts when sending a message to the bare JID <localpart@domain.tld> of the recipient, only when sending to a full JID <localpart@domain.tld/resource>.
A sender SHOULD NOT include a request for message receipts unless it knows (via Service Discovery [4] or Entity Capabilities [5]) that the intended recipient supports the protocol described herein or unless the use of message receipts is negotiated via Stanza Session Negotiation [6].
A sender SHOULD include an 'id' attribute on the message so that the sender can properly track the receipt.
Naturally, message receipts can be combined with the rules specified in Advanced Message Processing (e.g., the deliver rule) for more complete reporting.
If a sender wishes to request message receipts, it SHOULD first determine whether the intended recipient supports message receipts. This can be done directly via Service Discovery or indirectly via Entity Capabilities.
If an entity supports message receipts, it MUST report that by including a service discovery feature of "urn:xmpp:receipts" in response to disco#info requests:
<iq from='northumberland@shakespeare.lit/westminster' id='disco1' to='kingrichard@royalty.england.lit/throne' type='get'> <query xmlns='http://jabber.org/protocol/disco#info'/> </iq>
<iq from='kingrichard@royalty.england.lit/throne' id='disco1' to='northumberland@shakespeare.lit/westminster' type='result'> <query xmlns='http://jabber.org/protocol/disco#info'> ... <feature var='urn:xmpp:receipts'/> ... </query> </iq>
Two entities MAY negotiate the use of message receipts for a given session using Stanza Session Negotiation. The parameter to be negotiated is named "urn:xmpp:receipts". Its use is illustrated in the following examples.
<message type='normal' from='northumberland@shakespeare.lit/westminster' to='kingrichard@royalty.england.lit/throne' id='init1'> <thread>ffd7076498744578d10edabfe7f4a866</thread> <feature xmlns='http://jabber.org/protocol/feature-neg'> <x xmlns='jabber:x:data' type='form'> <field var='FORM_TYPE' type='hidden'> <value>urn:xmpp:ssn</value> </field> <field label='Accept this chat?' type='boolean' var='accept'> <value>true</value> <required/> </field> <field label='Enable Message Receipts?' type='boolean' var='urn:xmpp:receipts'> <value>0</value> </field> </x> </feature> </message>
<message type='normal' from='kingrichard@royalty.england.lit/throne' to='northumberland@shakespeare.lit/westminster' id='init1'> <thread>ffd7076498744578d10edabfe7f4a866</thread> <feature xmlns='http://jabber.org/protocol/feature-neg'> <x xmlns='jabber:x:data' type='submit'> <field var='FORM_TYPE' type='hidden'> <value>urn:xmpp:ssn</value> </field> <field var='accept'> <value>true</value> </field> <field var='urn:xmpp:receipts'> <value>1</value> </field> </x> </feature> </message>
Although a sender MAY attempt to resend a message if it knows that the recipient supports message receipts and it does not receive a reply within some configurable timeout period, resend logic is out of scope for this specification.
It is possible for a recipient to leak its presence when returning message receipts; therefore, a recipient SHOULD NOT return message receipts to senders who are not otherwise authorized to view its presence.
No interaction with the Internet Assigned Numbers Authority (IANA) [7] is necessary as a result of this document.
The XMPP Registrar [8] includes "urn:xmpp:receipts" in its registry of protocol namespaces (see <http://xmpp.org/registrar/namespaces.html>).
Field Standardization for Data Forms [9] defines a process for standardizing the fields used within Data Forms qualified by a particular namespace, and the XMPP Registrar maintains a registry of such fields (see <http://xmpp.org/registrar/formtypes.html>). The Registrar shall add the following field for use in Stanza Session Negotiation forms:
<form_type> <name>urn:xmpp:ssn</name> <field var='urn:xmpp:receipts' type='boolean' label='Whether to enable Message Receipts per XEP-0184'/> </form_type>
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='urn:xmpp:receipts' xmlns='urn:xmpp:receipts' elementFormDefault='qualified'> <xs:annotation> <xs:documentation> The protocol documented by this schema is defined in XEP-0184: http://www.xmpp.org/extensions/xep-0184.html </xs:documentation> </xs:annotation> <xs:element name='received' type='empty'/> <xs:element name='request' type='empty'/> <xs:simpleType name='empty'> <xs:restriction base='xs:string'> <xs:enumeration value=''/> </xs:restriction> </xs:simpleType> </xs:schema>
Thanks to Joe Kemp and Kevin Smith for their input.
Series: XEP
Number: 0184
Publisher: XMPP Standards Foundation
Status:
Draft
Type:
Standards Track
Version: 1.0
Last Updated: 2007-09-26
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: XEP-0022 (in part)
Superseded By: None
Short Name: receipts
Schema: <http://www.xmpp.org/schemas/receipts.xsd>
Source Control:
HTML
RSS
Email:
stpeter@jabber.org
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
Email:
jhildebr@cisco.com
JabberID:
hildjj@jabber.org
The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 3920) and XMPP IM (RFC 3921) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.
The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.
Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.
Errata can be sent to <editor@xmpp.org>.
The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".
1. XEP-0079: Advanced Message Processing <http://xmpp.org/extensions/xep-0079.html>.
2. XEP-0022: Message Events <http://xmpp.org/extensions/xep-0022.html>.
3. This specification does not distinguish between delivery and presentation, as was done in the message events protocol, in part because no existing clients make the distinction.
4. XEP-0030: Service Discovery <http://xmpp.org/extensions/xep-0030.html>.
5. XEP-0115: Entity Capabilities <http://xmpp.org/extensions/xep-0115.html>.
6. XEP-0155: Stanza Session Negotiation <http://xmpp.org/extensions/xep-0155.html>.
7. The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see <http://www.iana.org/>.
8. The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see <http://xmpp.org/registrar/>.
9. XEP-0068: Field Data Standardization for Data Forms <http://xmpp.org/extensions/xep-0068.html>.
Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/
Per a vote of the XMPP Council, advanced to Draft.
(psa)Per Council feedback, modified to use dedicated namespace (not AMP).
(psa)Removed reliability features, which belong at a different level.
(psa)Added two more scenarios; defined business rule about not sending to bare JIDs; specified security consideration regarding presence leaks.
(psa)Initial version.
(psa)Added text and examples for service discovery; added text and examples for chat session negotiation; added recommendations regarding message processing, retries, etc.
(psa)First draft.
(psa)END