This document specifies an XMPP protocol extension for including media data in XEP-0004 data forms.
WARNING: This Standards-Track document is Experimental. Publication as an XMPP Extension Protocol does not imply approval of this proposal by the XMPP Standards Foundation. Implementation of the protocol described herein is encouraged in exploratory implementations, but production systems should not deploy implementations of this protocol until it advances to a status of Draft.
Series: XEP
Number: 0221
Publisher: XMPP Standards Foundation
Status:
Experimental
Type:
Standards Track
Version: 0.1
Last Updated: 2007-07-11
Approving Body: XMPP Council
Dependencies: XMPP Core, XEP-0004
Supersedes: None
Superseded By: None
Short Name: TO BE ASSIGNED
Wiki Page: <http://wiki.jabber.org/index.php/Data Forms Media Element (XEP-0221)>
Email:
ian.paterson@clientside.co.uk
JabberID:
ian@zoofy.com
JabberID:
stpeter@jabber.org
URI:
https://stpeter.im/
The preferred venue for discussion of this document is the Standards discussion list: <http://mail.jabber.org/mailman/listinfo/standards>.
Errata may be sent to <editor@xmpp.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 following 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. Introduction
2. Media Element
3. XMPP Registrar Considerations
3.1. Protocol Namespaces
4. XML Schema
Notes
Revision History
In certain protocols that make use of Data Forms [1], it can be helpful to include media data such as small images. One example of such a "using protocol" is Robot Challenges [2]. This document defines a method for including media data in a data form.
The root element for media data is <media/>. This element MUST be qualified by the "http://www.xmpp.org/extensions/xep-0221.html#ns' namespace (see Protocol Namespaces regarding issuance of one or more permanent namespaces). The <media/> element MUST be contained within a <field/> element qualified by the 'jabber:x:data' namespace.
If the media is an image or video then the <media/> element SHOULD include 'height' and 'width' attributes specifying the recommended display size of the media in pixels.
The <media/> element SHOULD contain at least one <uri/> element to specify the out-of-band location of the media data. [3] The <uri/> element MUST contain a URI that indicates the location.
The <media/> element MAY also contain one or more <data/> elements for distributing the media in-band. The <data/> element MUST contain the media data encoded according to Base64 as specified in Section 4 of RFC 4648 [4]. The encoded data SHOULD NOT be larger than 8 kilobytes. [5]
Each <uri/> or <data/> element MUST include a 'type' atribute that specifies the MIME type (see RFC 2045 [6]) of the media.
<media xmlns='http://www.xmpp.org/extensions/xep-0221.html#ns'> <uri type='audio/x-wav'>http://victim.example.com/challenges/speech.wav?F3A6292C</uri> <uri type='audio/ogg-speex'>http://victim.example.com/challenges/speech.ogg?F3A6292C</uri> <uri type='audio/mpeg'>http://victim.example.com/challenges/speech.mp3?F3A6292C</uri> <data type='audio/x-wav'> ** Base64 encoded audio ** </data> </media>
Until this specification advances to a status of Draft, its associated namespace shall be "http://www.xmpp.org/extensions/xep-0221.html#ns"; upon advancement of this specification, the XMPP Registrar [7] shall issue a permanent namespace in accordance with the process defined in Section 4 of XMPP Registrar Function [8].
<?xml version='1.0' encoding='UTF-8'?> <xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' targetNamespace='http://www.xmpp.org/extensions/xep-0221.html#ns' xmlns='http://www.xmpp.org/extensions/xep-0221.html#ns' elementFormDefault='qualified'> <xs:element name='media'> <xs:complexType> <xs:sequence> <xs:element ref='uri' minOccurs='1' maxOccurs='unbounded'/> <xs:element ref='data' minOccurs='0' maxOccurs='unbounded'/> </xs:sequence> <xs:attribute name='height' type='xs:unsignedShort' use='optional'/> <xs:attribute name='width' type='xs:unsignedShort' use='optional'/> </xs:complexType> </xs:element> <xs:element name='uri'> <xs:complexType> <xs:simpleContent> <xs:extension base='xs:string'> <xs:attribute name='type' use='required'/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> <xs:element name='data'> <xs:complexType> <xs:simpleContent> <xs:extension base='xs:string'> <xs:attribute name='type' use='required'/> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:schema>
1. XEP-0004: Data Forms <http://www.xmpp.org/extensions/xep-0004.html>.
2. XEP-0158: Robot Challenges <http://www.xmpp.org/extensions/xep-0158.html>.
3. Constrained execution environments prevent some clients from rendering media unless it has been received out-of-band (e.g., Web clients).
4. RFC 4648: The Base16, Base32, and Base64 Data Encodings <http://tools.ietf.org/html/rfc4648>.
5. If a stanza contains more than one <data/> element, the sending entity MUST take care not to trigger server-defined bandwidth limits.
6. RFC 2045: Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies <http://tools.ietf.org/html/rfc2045>.
7. 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://www.xmpp.org/registrar/>.
8. XEP-0053: XMPP Registrar Function <http://www.xmpp.org/extensions/xep-0053.html>.
END