%ents; ]>
Feature Negotiation This document defines an XMPP protocol extension that enables two entities to mutually negotiate feature options. &LEGALNOTICE; 0020 Draft Standards Track Standards JIG XMPP Core XEP-0004 feature-neg http://www.xmpp.org/schemas/feature-neg.xsd &pgmillard; &stpeter; 1.5 2006-10-20 ip Various updates and corrections avoiding material changes. 1.4 2004-05-21 psa Moved remaining feature negotiation text from XEP-0030 to this document. 1.3 2004-04-23 psa Per Council discussion, changed root element from <query/> to <feature/> for the sake of consistency with using protocols; moved some text from XEP-0030 to this document. 1.2 2004-03-08 psa Added XMPP error handling; clarified the text; corrected the examples; fixed an error in the schema; added numerous references. 1.1 2003-02-16 psa Made corrections to the text; added security and IANA considerations; added schema. 1.0 2002-12-06 psa Per a vote of the Jabber Council, revision 0.4 was advanced to Draft on 2002-12-06. 0.4 2002-11-17 pgm Changed protocol to use jabber:x:data. 0.3 2002-10-01 pgm Added some extra text to help clarify protocol & purpose. 0.2 2002-05-22 pgm Changed examples. 0.1 2002-02-26 pgm Initial version.

A discovery protocol such as &xep0030; enables Jabber entities to query other entities regarding the features they support, but does not provide a means for the two entities to negotiate specific options related to the advertised features.

The protocol defined herein enables Jabber entities to negotiate options for specific features. These features could be negotiated between any two endpoints on the Jabber network, such as two clients, a client and a component, two components, a client and a server, or two servers. The protocol is generic enough that it can be used whenever options need to be negotiated between two Jabber entities. For examples, &xep0095;, &xep0096; or &xep0155;.

Features are negotiated though the exchange of &IQ; or &MESSAGE; stanzas containing <feature/> child elements qualified by the 'http://jabber.org/protocol/feature-neg' namespace. However, this <feature/> element is simply a wrapper for structured data encapsulated in the &xep0004; protocol. Earlier versions of this document defined a structured data format to handle the feature negotiation workflow; versions later than 0.4 use Data Forms, i.e., the 'jabber:x:data' namespace.

In order to begin a negotation, the initiator sends an &IQ; stanza of type "get" (or a &MESSAGE; stanza type "normal") to the recipient with a single <feature/> element containing a data form of type "form" which defines the available options for one or more features. Each feature is represented as an x-data "field".

The recipient SHOULD examine each feature and the values of the options provided. In order to indicate preferred values, the recipient then SHOULD specify one value for each feature and return a data form of type "submit" to the initiator in an &IQ; stanza of type "result" (or a &MESSAGE; stanza type "normal").

The following examples show some likely scenarios for feature negotiation between entities. Further examples can be found in using protocols, such as File Transfer.

A typical negotiation flow is shown in the following example of two entities negotiating the time and place for a meeting.

]]> Secret Grotto 22:30 ]]>

If the responding entity does not support one or more of the features, it MUST return a &feature; error, and SHOULD specify the feature(s) not implemented in the XMPP <text/> element.

times-to-meet ]]>

If the responding entity supports none of the options offered for one or more of the features, it MUST return a ¬acceptable; error, and SHOULD specify the relevant feature(s) in the XMPP <text/> element.

places-to-meet ]]>

If at least one feature offered by an entity is subject to Feature Negotiation, the entity's response to a service discovery information request MUST include <feature var='http://jabber.org/protocol/feature-neg'/> as one of the features.

]]> ... ... ]]>

The using protocol (in these examples, &xep0045;) SHOULD specify which features might be negotiable, either in the relevant documentation or in the entry for that feature in the service discovery features registry maintained by the ®ISTRAR;. However, the requesting entity MAY also query the responding entity in order to determine which features are negotiable, as shown below.

]]>

If that feature is not negotiable, the responding entity MUST return a "Feature Not Implemented" error:

]]>

If that feature is negotiable, the responding entity MUST return an appropriate negotiation form:

]]>

The requesting entity MAY then submit a data form containing the required information.

Security considerations are the responsibility of the using protocol.

This document requires no interaction with &IANA;.

In order for Jabber entities to adequately leverage Data Forms (e.g., by using machine-readable fields), it is RECOMMENDED to register standard x-data fields with the XMPP Registrar via the mechanisms defined in &xep0068;. Whether to do so for any given features and options shall be determined by the using protocol.

The protocol documented by this schema is defined in XEP-0020: http://www.xmpp.org/extensions/xep-0020.html ]]>

Peter Millard, the primary author of this specification from version 0.1 through version 1.4, died on April 26, 2006. The remaining author is thankful for Peter's work on this specification.