mirror of
https://github.com/moparisthebest/xeps
synced 2024-11-24 02:02:16 -05:00
1022 lines
91 KiB
XML
1022 lines
91 KiB
XML
<?xml version='1.0' encoding='UTF-8'?>
|
||
<!DOCTYPE xep SYSTEM 'xep.dtd' [
|
||
<!ENTITY % ents SYSTEM 'xep.ent'>
|
||
%ents;
|
||
]>
|
||
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
|
||
<xep>
|
||
<header>
|
||
<title>In-Band Real Time Text</title>
|
||
<abstract>This is a specification for real-time text transmitted in-band over an XMPP session.</abstract>
|
||
&LEGALNOTICE;
|
||
<number>0301</number>
|
||
<status>Experimental</status>
|
||
<type>Standards Track</type>
|
||
<sig>Standards</sig>
|
||
<approver>Council</approver>
|
||
<dependencies>
|
||
<spec>XMPP Core</spec>
|
||
<spec>XEP-0020</spec>
|
||
</dependencies>
|
||
<supersedes/>
|
||
<supersededby/>
|
||
<shortname>NOT_YET_ASSIGNED</shortname>
|
||
<author>
|
||
<firstname>Mark</firstname>
|
||
<surname>Rejhon</surname>
|
||
<email>mark@realjabber.org</email>
|
||
<jid>markybox@gmail.com</jid>
|
||
<org>RealJabber.org and Rejhon Technologies Inc.</org>
|
||
<uri>http://www.realjabber.com</uri>
|
||
</author>
|
||
<revision>
|
||
<version>0.3</version>
|
||
<date>2012-07-07</date>
|
||
<initials>MDR</initials>
|
||
<remark><p>Edits recommended from public discussion.</p></remark>
|
||
</revision>
|
||
<revision>
|
||
<version>0.2</version>
|
||
<date>2012-03-18</date>
|
||
<initials>MDR</initials>
|
||
<remark><p>Lots of edits. Simplifications, improvements and corrections. Forward and backward compatible with version 0.1.</p></remark>
|
||
</revision>
|
||
<revision>
|
||
<version>0.1</version>
|
||
<date>2011-06-29</date>
|
||
<initials>psa</initials>
|
||
<remark><p>Initial published version.</p></remark>
|
||
</revision>
|
||
<revision>
|
||
<version>0.0.3</version>
|
||
<date>2011-06-25</date>
|
||
<initials>MDR</initials>
|
||
<remark><p>Third draft, recommended edits.</p></remark>
|
||
</revision>
|
||
<revision>
|
||
<version>0.0.2</version>
|
||
<date>2011-06-15</date>
|
||
<initials>MDR</initials>
|
||
<remark><p>Second draft.</p></remark>
|
||
</revision>
|
||
<revision>
|
||
<version>0.0.1</version>
|
||
<date>2011-02-21</date>
|
||
<initials>MDR</initials>
|
||
<remark><p>First draft.</p></remark>
|
||
</revision>
|
||
</header>
|
||
|
||
|
||
|
||
<section1 topic="Introduction" anchor="introduction">
|
||
<p><strong>Real-time text is text transmitted instantly while it is being typed or created.</strong> The recipient can immediately read the sender's text as it is written, without waiting. Text can be used conversationally, similar to a telephone conversation, where one listens while the other is speaking. It eliminates waiting times found in messaging, and is favored by deaf and hard of hearing individuals who prefer text conversation. For a visual animation of real-time text, see <span class="ref"><strong><link url="http://www.realjabber.org">RealJabber.org</link></strong></span>
|
||
<note>RealJabber.org is the author's web site containing work related to this specification, including animation examples of what real time text looks like. <<link url="http://www.realjabber.org">http://www.realjabber.org</link>>.</note>.</p>
|
||
<p>Real-time text has been around for decades in various implementations:</p>
|
||
<ul>
|
||
<li>The 'talk' command on UNIX systems since the 1970's.</li>
|
||
<li>ICQ had a peer-to-peer split screen mode from 1996-1999.</li>
|
||
<li>TTY and text telephones for the deaf and hard of hearing.</li>
|
||
<li>For SIP, real-time text is sent using <span class="ref"><strong><link url="http://tools.ietf.org/html/rfc4103">IETF RFC 4103</link></strong></span> <note>IETF RFC 4103: RTP Payload for Text Conversation. <<link url="http://tools.ietf.org/html/rfc4103">http://tools.ietf.org/html/rfc4103</link>>.</note> with <span class="ref"><strong><link url="http://www.itu.int/rec/T-REC-T.140">ITU-T T.140</link></strong></span> <note>ITU-T T.140: Protocol for multimedia application text conversation. <<link url="http://www.itu.int/rec/T-REC-T.140">http://www.itu.int/rec/T-REC-T.140</link>>.</note> presentation coding.</li>
|
||
<li>In 2008, AOL AIM 6.8 gained the <span class="ref"><strong><link url="http://help.aol.com/help/microsites/microsite.do?cmd=displayKC&externalId=223568">AOL Real-Time IM</link></strong></span> <note>AOL AIM Real Time Text: <<link url="http://help.aol.com/help/microsites/microsite.do?cmd=displayKC&externalId=223568">http://help.aol.com/help/microsites/microsite.do?cmd=displayKC&externalId=223568</link>>.</note> feature.</li>
|
||
<li>Deployment of <span class="ref"><strong><link url="http://www.reach112.eu">Reach112</link></strong></span> <note>Reach112: European emergency service with real-time text. <<link url="http://www.reach112.eu">http://www.reach112.eu</link>>.</note> in Europe, an accessible emergency service with real-time text.</li>
|
||
</ul>
|
||
|
||
|
||
|
||
<p>Real-time text is suitable for smooth and rapid mainstream communication in text, as an all-inclusive technology to complement instant messaging. At the same time, real-time text has special usefulness to many audiences including the deaf, hard of hearing, and other people who cannot use speech on the telephone. Real-time text is also beneficial in emergency situations, due to its immediacy. This document defines a specification for real-time text transmitted in-band over an XMPP network.</p>
|
||
</section1>
|
||
<section1 topic="Requirements" anchor="requirements">
|
||
<section2 topic="Fluid Real-Time Text" anchor="fluid_realtime_text">
|
||
<ol>
|
||
<li>Allow transmission of real-time text with a low latency.</li>
|
||
<li>Balance low latencies versus system, network and server limitations.</li>
|
||
<li>Support message editing in real-time, including text insertions and deletions.</li>
|
||
<li>Support transmission of the original intervals between key presses, to preserve look-and-feel of typing independently of transmission intervals.</li>
|
||
</ol>
|
||
</section2>
|
||
<section2 topic="In-Band Transmission" anchor="inband_transmission">
|
||
<ol>
|
||
<li>Reliable real-time text delivery.</li>
|
||
<li>Be backwards compatible with XMPP clients that do not support real-time text.</li>
|
||
<li>Minimize reliance on network traversal protocols and/or out-of-band transmission protocols.</li>
|
||
<li>Compatible with multi-user chat (MUC) and simultaneous logins.</li>
|
||
</ol>
|
||
</section2>
|
||
<section2 topic="Flexible and Interoperable" anchor="flexible_and_interoperable">
|
||
<ol>
|
||
<li>Allow use within existing instant-messaging user interfaces, with minimal UI modifications.</li>
|
||
<li>Allow alternate optional presentations of real-time text, including split screen and/or other layouts.</li>
|
||
<li>Protocol design ensures integrity of real-time text, and allows extensions for new features.</li>
|
||
<li>Be interoperable with other real-time text protocols via gateways, including RFC 4103 and ITU-T T.140.</li>
|
||
</ol>
|
||
</section2>
|
||
<section2 topic="Accessible" anchor="accessible">
|
||
<ol>
|
||
<li>Allow XMPP to follow the <span class="ref"><strong><link url="http://www.itu.int/rec/T-REC-F.703">ITU-T Rec. F.703</link></strong></span> <note>ITU-T Rec. F.703: Multimedia conversational services. <<link url="http://www.itu.int/rec/T-REC-F.703">http://www.itu.int/rec/T-REC-F.703</link>>.</note> Total Conversation accessibility standard for simultaneous voice, video, and real-time text.</li>
|
||
<li>Be a candidate technology for use with Next Generation 9-1-1 / 1-1-2 emergency services.</li>
|
||
<li>Be suitable for transcription services and (when coupled with voice at user's choice) for TTY/text telephone alternatives, relay services, and captioned telephone systems.</li>
|
||
<li>Be an accessible enhancement for mobile phone text messaging and mainstream instant messaging.</li>
|
||
</ol>
|
||
</section2>
|
||
</section1>
|
||
<section1 topic="Glossary" anchor="glossary">
|
||
<p><strong>real-time</strong> – A conversational latency of less than 1 second, as defined by <span class="ref"><strong><link url="http://www.itu.int/rec/T-REC-F.700">ITU-T Rec. F.700</link></strong></span> <note>ITU-T Rec. F.700: Framework Recommendation for multimedia services <<link url="http://www.itu.int/rec/T-REC-F.700">http://www.itu.int/rec/T-REC-F.700</link>>.</note>, section 2.1.2.1.</p>
|
||
<p><strong>real-time text</strong> – Text transmitted in real-time while it is being typed or created.</p>
|
||
<p><strong>real-time message</strong> – Recipient's real-time view of the sender's message still being typed or created.</p>
|
||
<p><strong>real-time message edit</strong> – An edit operation done by the remote sender, that is transmitted in real-time to the recipient.</p>
|
||
<p><strong>action element</strong> – An XML element that represents a single real-time message edit, such as text insertion or deletion.</p>
|
||
<p><strong>RTT</strong> – Acronym for real-time text.</p>
|
||
</section1>
|
||
<section1 topic="Protocol" anchor="protocol">
|
||
<section2 topic="RTT Element" anchor="rtt_element">
|
||
<p>Real-time text is transmitted via an <rtt/> child element of a <message/> stanza. The <rtt/> element is transmitted at regular intervals by the sender while a message is being composed, to allow the recipient to see the sender type (and edit) the message before the full message is sent in a <body/> element.</p>
|
||
<p>This is a basic example of a <em><strong>real-time message</strong></em> "Hello, my Juliet!", transmitted live while it is being typed, before a final message delivery:</p>
|
||
<p><strong>Example 1: Introductory Example</strong></p>
|
||
<p><code><![CDATA[<message to='juliet@capulet.lit' from='romeo@montague.lit/orchard' type='chat' id='a01'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='0' event='new'>
|
||
<t>Hello, </t>
|
||
</rtt>
|
||
</message>
|
||
|
||
<message to='juliet@capulet.lit' from='romeo@montague.lit/orchard' type='chat' id='a02'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='1'>
|
||
<t>my </t>
|
||
</rtt>
|
||
</message>
|
||
|
||
<message to='juliet@capulet.lit' from='romeo@montague.lit/orchard' type='chat' id='a03'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='2'>
|
||
<t>Juliet!</t>
|
||
</rtt>
|
||
</message>
|
||
|
||
<message to='juliet@capulet.lit' from='romeo@montague.lit/orchard' type='chat' id='a04'>
|
||
<body>Hello, my Juliet!</body>
|
||
</message>]]></code></p>
|
||
|
||
|
||
|
||
<p>The <rtt/> element contains a series of one or more child elements called <em><strong>action elements</strong></em> that represent <em><strong>real-time message edits</strong></em> such as text being appended, inserted, or deleted. Example 1 illustrates only the <t/> action element, which appends text to the end of a message. See <link url="#realtime_text_operations">Real-Time Text Operations</link>.</p>
|
||
<p>Transmission of the <rtt/> element occurs at regular intervals whenever the sender is actively composing a message. If there are no changes to the message since the last transmission, no transmission occurs. See <link url="#transmission_interval">Transmission Interval</link>.</p>
|
||
<p>The namespace of the <rtt/> element is “urn:xmpp:rtt:0”. There MUST NOT be more than one <rtt/> element per <message/> stanza.</p>
|
||
</section2>
|
||
<section2 topic="RTT Attributes" anchor="rtt_attributes">
|
||
<section3 topic="seq" anchor="seq">
|
||
<p>This REQUIRED attribute is a counter to maintain the integrity of real-time text. (The bounds of <strong>seq</strong> is 31-bits, the range of positive values of a signed integer.)</p>
|
||
<p>Senders MUST increment the <strong>seq</strong> attribute by 1 in each subsequent <rtt/> transmitted without an <strong>event</strong> attribute. When an <rtt/> element has an <strong>event</strong> attribute, senders MAY instead use any value as the new starting value for <strong>seq</strong>. A random starting <strong>seq</strong> value is RECOMMENDED for best integrity during <link url="#usage_with_multiuser_chat_and_simultaneous_logins">Usage With Multi-User Chat and Simultaneous Logins</link>. Senders MAY limit the size of the new starting <strong>seq</strong> value, to keep <rtt/> compact, and allow plenty of incrementing room without overflow.</p>
|
||
<p>Recipients MUST monitor the <strong>seq</strong> value to verify the integrity of real-time text. See <link url="#keeping_realtime_text_synchronized">Keeping Real-Time Text Synchronized</link>.</p>
|
||
</section3>
|
||
<section3 topic="event" anchor="event">
|
||
<p>This attribute signals events for real-time text, such as the start of a new real-time message. The <strong>event</strong> attribute MAY be omitted from the <rtt/> element during regular real-time text transmission. Recipients MUST ignore <rtt/> containing unsupported <strong>event</strong> values.</p>
|
||
<table>
|
||
<tr>
|
||
<th>event</th>
|
||
<th>Description</th>
|
||
<th>Sender Support</th>
|
||
<th>Recipient Support</th>
|
||
</tr>
|
||
<tr>
|
||
<td>new</td>
|
||
<td>Begin a new real-time message.</td>
|
||
<td><strong>REQUIRED</strong></td>
|
||
<td><strong>REQUIRED</strong></td>
|
||
</tr>
|
||
<tr>
|
||
<td>reset</td>
|
||
<td>Reset the current real-time message.</td>
|
||
<td><strong>RECOMMENDED</strong></td>
|
||
<td><strong>REQUIRED</strong></td>
|
||
</tr>
|
||
<tr>
|
||
<td>init</td>
|
||
<td>Initiate a real-time text session.</td>
|
||
<td>OPTIONAL</td>
|
||
<td>OPTIONAL</td>
|
||
</tr>
|
||
<tr>
|
||
<td>cancel</td>
|
||
<td>End a real-time text session.</td>
|
||
<td>OPTIONAL</td>
|
||
<td>OPTIONAL</td>
|
||
</tr>
|
||
</table>
|
||
<p><strong>event='new'</strong><br />
|
||
Senders MUST use this value when transmitting the first <rtt/> element containing <link url="#action_elements">Action Elements</link> (i.e. the first character(s) of a new message). Recipient clients MUST initialize a new real-time message for display, and then process action elements within the <rtt/> element. If a real-time message already exists in the same chat session, its content MUST be replaced (i.e. cleared prior to processing action elements). Senders MAY send subsequent <rtt/> elements that do not contain an <strong>event</strong> attribute.</p>
|
||
<p><strong>event='reset'</strong><br />
|
||
Recipients MUST treat <strong>'reset'</strong> the same as <strong>'new'</strong>. Senders MUST use <strong>'new'</strong> only when the sender has started composing a new message, and use '<strong>reset'</strong> when re-transmitting a real-time message. See <link url="#message_reset">Message Reset</link>, used for <link url="#keeping_realtime_text_synchronized">Keeping Real-Time Text Synchronized</link> and <link url="#basic_realtime_text">Basic Real-Time Text</link>.</p>
|
||
<p><strong>event='init'</strong><br />
|
||
Clients MAY use this value to signal the other end that real-time text is being activated. If used, this <rtt/> element MUST be empty with no action elements. See <link url="#activating_and_deactivating_realtime_text">Activating and Deactivating Real-Time Text</link>.</p>
|
||
<p><strong>event='cancel'</strong><br />
|
||
Clients MAY use this value to signal the other end to stop transmitting real-time text. If used, this <rtt/> element MUST be empty with no action elements. Recipients SHOULD discontinue sending back <rtt/> elements for the remainder of the same chat session (or unless <strong>'init'</strong> is used again). See <link url="#activating_and_deactivating_realtime_text">Activating and Deactivating Real-Time Text</link>.</p>
|
||
</section3>
|
||
</section2>
|
||
<section2 topic="Body Element" anchor="body_element">
|
||
<p>The real-time message is considered complete upon receipt of a <body/> element in a message stanza. The delivered message is displayed instead of the real-time message. In the ideal case, the message from <body/> is redundant since this delivered message is identical to the final contents of the real-time message.</p>
|
||
<p>Senders MUST include an <link url="#event">event</link> attribute in the next <rtt/> element that is transmitted after a message stanza containing a <body/> element.</p>
|
||
<section3 topic="Backwards Compatible" anchor="backwards_compatible">
|
||
<p>The real-time text standard simply provides early delivery of text before the <body/> element. The <body/> element continues to follow the &xmppcore; specification. In particular, XMPP implementations need to ignore XML elements they do not understand. Clients that do not support real-time text, will continue to behave normally, displaying complete lines of messages as they are delivered.</p>
|
||
</section3>
|
||
</section2>
|
||
<section2 topic="Transmission Interval" anchor="transmission_interval">
|
||
<p>For the best balance between interoperability and usability, the transmission interval of <rtt/> elements for a continuously-changing message SHOULD be approximately <strong>0.7 second</strong>. This interval meets ITU-T Rec. F.700 for real-time conversation. If a different transmission interval needs to be used, the interval SHOULD be <strong>between 0.3 second and 1 second</strong>.</p>
|
||
<p>A longer interval will lead to a less optimal user experience. Conversely, a much shorter interval may more frequently trigger throttling or flooding protection algorithms in public XMPP servers, leading to dropped <message/> elements and/or <link url="#congestion_considerations">Congestion Considerations</link>.</p>
|
||
<p>To provide fluid real-time text, one or more of the following methods can be used:</p>
|
||
<ul>
|
||
<li><link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link> for natural typing display, independently of the transmission interval.</li>
|
||
<li>Use of <link url="#time_critical_and_low_latency_methods">Time Critical And Low Latency Methods</link>, for real-time captioning/transcription.</li>
|
||
<li>For other options or reduced-precision options, see <link url="#lowbandwidth_and_lowprecision_text_smoothing">Low-Bandwidth And Low-Precision Text Smoothing</link>.</li>
|
||
</ul>
|
||
</section2>
|
||
<section2 topic="Real-Time Text Operations" anchor="realtime_text_operations">
|
||
<p>The <rtt/> element MAY contain one or more <em><strong>action elements</strong></em> representing real-time text operations, including text being appended, inserted, or deleted.</p>
|
||
<p>Many chat clients allow a sender to edit their message before sending (via a Send button, or pressing Enter). The inclusion of real-time text functionality to existing client software, needs to preserve the sender's existing expectation of being able to edit their messages before sending. In a chat session with real-time text, the recipient can watch the sender compose and edit their message before it is delivered.</p>
|
||
<section3 topic="Action Elements" anchor="action_elements">
|
||
<p>This is a short summary of action elements that operate on a real-time message. For detailed information, see <link url="#list_of_action_elements">List of Action Elements</link>.</p>
|
||
<table>
|
||
<tr>
|
||
<th>Action</th>
|
||
<th>Element</th>
|
||
<th>Description</th>
|
||
<th>Sender Support</th>
|
||
<th>Recipient Support</th>
|
||
</tr>
|
||
<tr>
|
||
<td>Insert Text</td>
|
||
<td><t p='#'>text</t></td>
|
||
<td>Insert specified <em><strong>text</strong></em> at position <em><strong>p</strong></em> in message.</td>
|
||
<td><strong>REQUIRED</strong></td>
|
||
<td><strong>REQUIRED</strong></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Backspace</td>
|
||
<td><e p='#' n='#'/></td>
|
||
<td>Remove <em><strong>n</strong></em> characters before position <em><strong>p</strong></em> in message<em>.</em></td>
|
||
<td>RECOMMENDED</td>
|
||
<td><strong>REQUIRED</strong></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Forward Delete</td>
|
||
<td><d p='#' n='#'/></td>
|
||
<td>Remove <em><strong>n</strong></em> characters starting at position <em><strong>p</strong></em> in message.</td>
|
||
<td>RECOMMENDED</td>
|
||
<td><strong>REQUIRED</strong></td>
|
||
</tr>
|
||
<tr>
|
||
<td>Interval</td>
|
||
<td><w n='#'/></td>
|
||
<td>Wait <em><strong>n</strong></em> thousandths of a second.</td>
|
||
<td>RECOMMENDED</td>
|
||
<td>RECOMMENDED</td>
|
||
</tr>
|
||
</table>
|
||
</section3>
|
||
<section3 topic="Summary of Attribute Values" anchor="summary_of_attribute_values">
|
||
<ul>
|
||
<li><p>The <em><strong>n</strong></em> attribute is a length value.<br />
|
||
If <em><strong>n</strong></em> is omitted, the default value of <em><strong>n</strong></em> MUST be 1.</p></li>
|
||
<li><p>The <em><strong>p</strong></em> attribute is an absolute position value, as a 0-based index (0 represents beginning of message).<br />
|
||
If <em><strong>p</strong></em> is omitted, the default value of <em><strong>p</strong></em> MUST be the current message length (<em><strong>p</strong></em> defaults to end of message).</p></li>
|
||
<li><p>For text modifications, length and position (<em><strong>n</strong></em> and <em><strong>p</strong></em>) is based on <link url="#unicode_character_counting">Unicode Character Counting</link>.<br />
|
||
Also see <link url="#accurate_processing_of_action_elements">Accurate Processing of Action Elements</link>.</p></li>
|
||
<li><p>Senders MUST NOT use negative values for any attribute, nor use <em><strong>p</strong></em> values beyond the current message length. However, recipients receiving such values MUST clip negative values to 0, and clip excessively high <em><strong>p</strong></em> values to the current length of the real-time message. Modifications only occur within the boundaries of the current real-time message, and not other delivered messages.</p></li>
|
||
</ul>
|
||
</section3>
|
||
<section3 topic="List of Action Elements" anchor="list_of_action_elements">
|
||
<p>Recipients MUST be able to process all <t/>, <e/> and <d/> action elements for incoming <rtt/> transmissions, even if senders do not use these for outgoing <rtt/> transmissions (e.g. <link url="#basic_realtime_text">Basic Real-Time Text</link>). Support for <w/> is RECOMMENDED for both senders and recipients in order to accommodate <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>. Recipients MUST ignore unexpected or unsupported elements within <rtt/>, while continuing to process subsequent action elements (Compatibility is ensured via <link url="#namespace_versioning">Namespace Versioning</link>). Action elements are immediate child elements of the <rtt/> element, and are never nested. See examples in <link url="#use_cases">Use Cases</link>.</p>
|
||
<section4 topic="Element <t/> – Insert Text" anchor="element_t_insert_text">
|
||
<p>Supports transmission of text, including key presses, and text block inserts.<br />
|
||
<em>Note: Text can be any</em> <em>subset of text allowed in the <body/> element of a <message/>. If <t/> is empty, no text modification takes place.</em></p>
|
||
<p><code><![CDATA[<t>text</t>]]></code></p>
|
||
<p>Appends specified <em><strong>text</strong></em> at the end of message. (<em><strong>p</strong></em> defaults to message length).<br />
|
||
<em>Note: This action element is the minimum sender support REQUIRED for <link url="#basic_realtime_text">Basic Real-Time Text</link>.</em></p>
|
||
<p><code><![CDATA[<t p='#'>text</t>]]></code></p>
|
||
<p>Inserts specified <em><strong>text</strong></em> at position <em><strong>p</strong></em> in the message text.</p>
|
||
|
||
|
||
|
||
</section4>
|
||
<section4 topic="Element <e/> – Backspace" anchor="element_e_backspace">
|
||
<p>Supports the behavior of Backspace key presses. Text is removed towards beginning of the message.<br />
|
||
<em>Note: Excess backspaces MUST be ignored, with text being backspaced only to the beginning of the message in this case.</em></p>
|
||
<p><code><![CDATA[<e/>]]></code></p>
|
||
<p>Remove 1 character from end of message. (Both <em><strong>n</strong></em> and <em><strong>p</strong></em> at default values)</p>
|
||
<p><code><![CDATA[<e p='#'/>]]></code></p>
|
||
<p>Remove 1 character before position <em><strong>p</strong></em> in message. (<em><strong>n</strong></em> defaults to 1)</p>
|
||
<p><code><![CDATA[<e n='#'/>]]></code></p>
|
||
<p>Remove <em><strong>n</strong></em> characters from end of message. (<em><strong>p</strong></em> defaults to message length)</p>
|
||
<p><code><![CDATA[<e n='#' p='#'/>]]></code></p>
|
||
<p>Remove <em><strong>n</strong></em> characters before position <em><strong>p</strong></em> in message.</p>
|
||
|
||
|
||
|
||
</section4>
|
||
<section4 topic="Element <d/> – Forward Delete" anchor="element_d_forward_delete">
|
||
<p>Supports the behavior of Delete key presses, and text block deletes. Text is removed towards end of the message.<br />
|
||
<em>Note:Excess deletes MUST be ignored, with text being deleted only to the end of the message in this case.</em></p>
|
||
<p><code><![CDATA[<d p='#'/>]]></code></p>
|
||
<p>Remove 1 character beginning at position <em><strong>p</strong></em> in message. (<em><strong>n</strong></em> defaults to 1)</p>
|
||
<p><code><![CDATA[<d p='#' n='#'/>]]></code></p>
|
||
<p>Remove <em><strong>n</strong></em> characters beginning at position <em><strong>p</strong></em> in message.</p>
|
||
</section4>
|
||
<section4 topic="Element <w/> – Interval" anchor="element_w_interval">
|
||
<p>Allows the transmission of intervals between real-time message edits, such as the pauses between key presses. See <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>.</p>
|
||
<p><code><![CDATA[<w n='#'/>]]></code></p>
|
||
<p>Wait <em><strong>n</strong></em> thousandths of a second before processing the next action element. This pause MAY be approximate, and not necessarily be of millisecond precision. The <em><strong>n</strong></em> value SHOULD NOT exceed the <link url="#transmission_interval">Transmission Interval</link>. Also, if a <link url="#body_element">Body Element</link> arrives, pauses SHOULD be interrupted to prevent a delay in message delivery.</p>
|
||
</section4>
|
||
</section3>
|
||
<section3 topic="Accurate Processing of Action Elements" anchor="accurate_processing_of_action_elements">
|
||
<p>Real-time text is generated based on text normally allowed to be transmitted within the <body/> element.</p>
|
||
<p>Incorrectly generated action elements may lead to inconsistencies between the sender and recipient during real-time editing. The Unicode characters of the real-time text needs to make it transparently from the sender to the recipient, without further Unicode character modifications. This is the chain between the sender's creation of real-time text, to the recipient's processing of real-time text. Transparent transmission of Unicode characters is possible with sender pre-processing, as long as the transmission from the sender to the recipient remains standards-compliant, including compliant XML processors and compliant XMPP servers.</p>
|
||
<p>Any inconsistencies that occur during real-time message editing (i.e. non-compliant XMPP server that modifies messages) will recover during the next <link url="#message_reset">Message Reset</link>, and also via <link url="#basic_realtime_text">Basic Real-Time Text</link>.</p>
|
||
<section4 topic="Guidelines For Senders" anchor="guidelines_for_senders">
|
||
<p>Senders MUST generate real-time text based on the plain text version of the sender's message with all processing completed. Processing include Unicode normalization, conversion of emoticons graphics to text, removal of illegal characters, line-break conversion, and all other Unicode character modifications. This MAY be done in parallel to the sender client's displayed version of the message (i.e. graphics, formatting, &xep0071;).</p>
|
||
<p>For the purpose of calculating <em><strong>n</strong></em> and <em><strong>p</strong></em> values, line breaks MUST be treated as a single character, if line breaks are used within real-time text. It is noted conversion of line breaks into a single LINE FEED U+000A is REQUIRED for XML processors, according to section 2.11 of <span class="ref"><strong><link url="http://www.w3.org/TR/xml/">XML</link></strong></span> <note>XML: Extensible Markup Language 1.0 (Fifth Edition). <<link url="http://www.w3.org/TR/xml/">http://www.w3.org/TR/xml/</link>>.</note>.</p>
|
||
</section4>
|
||
<section4 topic="Guidelines For Recipients" anchor="guidelines_for_recipients">
|
||
<p>For recipients, <em><strong>p</strong></em> and <em><strong>n</strong></em> are calculated relative to real-time text obtained from a compliant XML processor, before any further Unicode character modifications. (This includes recipient-side Unicode normalization. In an ideal and compliant scenario, normalizing an already normalized Unicode string, will result in no character modifications, and will not cause any issues.) Recipients MUST NOT do Unicode normalization (or any other code point modifications) on their internal copy of the real-time message, for accurate processing of subsequent action elements. (The recipient client can process the same text separately for display).</p>
|
||
<p>Note that <link url="#element_t_insert_text">Element <t/> – Insert Text</link> is allowed to contain any subset sequence of Unicode characters from the real-time message. This may result in certain situations where the text transmitted in <t/> elements is allowed to be temporarily an incorrectly-formed Unicode string. (i.e. non spacing characters, orphaned diacritic, orphaned control character including direction-change character for bidirectional Unicode, incompletely formed glyphs, etc.) but becomes correct when inserted into the middle of the recipient's real-time message, and passes recipient validation/normalization with no character modifications. Note that a compliant XML processor does not modify or fix Unicode errors caused by taking only a subset of characters from correctly-formed Unicode text. One alternative way for implementers to visualize this, is to visualize the Unicode text as an array of individual code points, and treat the <em><strong>p</strong></em> and <em><strong>n</strong></em> values accordingly.</p>
|
||
</section4>
|
||
<section4 topic="Unicode Character Counting" anchor="unicode_character_counting">
|
||
<p>For platform-independent interoperability, calculations of length and position values (<em><strong>p</strong></em> and <em><strong>n</strong></em>) MUST be based on Unicode code points. A single UTF-8 encoded character equals one code point. However, many platforms use different internal encodings (i.e. string formats) that is different from the transmission encoding (UTF-8). Consider these factors:</p>
|
||
<ul>
|
||
<li><p>Multiple Unicode code points (e.g. combining marks) may combine into one displayable character.<br />
|
||
<em>Action elements operate on individual Unicode code points, not on displayable characters.</em></p></li>
|
||
<li><p>Unicode code points for characters U+10000 through U+10FFFF are represented as a surrogate pair in some Unicode encodings (e.g. UTF-16).<br />
|
||
<em>Action elements operate on individual Unicode code points, not on the separate components of a surrogate pair.</em></p></li>
|
||
<li><p>Some Unicode encodings use a variable number of bytes per Unicode code point (e.g. UTF-8).<br /><em>Action elements operate on individual Unicode code points, not on individual bytes.</em></p></li>
|
||
</ul>
|
||
<p>Incorrectly calculated length and position values (<em><strong>p</strong></em> and <em><strong>n</strong></em>) can result in inconsistencies in the real-time message, such as scrambled text. If this happens, this situation can recover during the <link url="#message_reset">Message Reset</link>.</p>
|
||
<p>Length and position values (<em><strong>p</strong></em> and <em><strong>n</strong></em>) are relative to the internal Unicode text of the real-time message, independently of the directionality of actual displayed text. Any existing Unicode text direction can be used (right-to-left, left-to-right, and bidirectional). From the perspective of length and position values (<em><strong>p</strong></em> and <em><strong>n</strong></em>), a real-time message is treated equivalent to an editable array of Unicode code points, even if not necessarily stored as such.</p>
|
||
</section4>
|
||
</section3>
|
||
</section2>
|
||
<section2 topic="Keeping Real-Time Text Synchronized" anchor="keeping_realtime_text_synchronized">
|
||
<p>In a chat session, it is important that real-time text stays identical on both the sender and recipient ends. The loss of a single <rtt/> transmission could represent missing text or missing edits. Also, recipients can connect after the sender has already started composing a message. Recovery of in-progress real-time message via <link url="#message_reset">Message Reset</link> is useful in several situations:</p>
|
||
<ul>
|
||
<li>Resuming after connecting (e.g. wireless reception, recipient restarted software, participants joining).</li>
|
||
<li>Resuming after recipient discarded <link url="#stale_messages">Stale Messages</link> (e.g. sender resumes composing hours later).</li>
|
||
<li>XMPP servers may drop <message/> elements (e.g. flooding protection).</li>
|
||
<li>Multiple <link url="#simultaneous_logins">Simultaneous Logins</link> (e.g. switching systems, switching windows, simultaneous typing).</li>
|
||
</ul>
|
||
<section3 topic="Staying In Sync" anchor="staying_in_sync">
|
||
<p>For <rtt/> elements that does not contain an <link url="#event">event</link> attribute:</p>
|
||
<ol>
|
||
<li>Senders MUST increment the <link url="#seq">seq</link> attribute for consecutively transmitted <rtt/> elements.</li>
|
||
<li>Recipients MUST monitor the <link url="#seq">seq</link> attribute value of received <rtt/> elements, to verify that it is incrementing.</li>
|
||
</ol>
|
||
<p>Recipients MUST keep track of separate real-time messages per sender, including maintaining independent <link url="#seq">seq</link> values. Recipients MAY also use additional methods to distinguish <link url="#simultaneous_logins">Simultaneous Logins</link>, including using the full JID and/or <thread/>. </p>
|
||
</section3>
|
||
<section3 topic="Recovery From Loss of Sync" anchor="recovery_from_loss_of_sync">
|
||
<p>Loss of sync occurs if the <link url="#seq">seq</link> attribute does not increment as expected when <link url="#staying_in_sync">Staying In Sync</link>. In this case:</p>
|
||
<ul>
|
||
<li>Recipients MUST freeze the current real-time message; and</li>
|
||
<li>Recipients MUST ignore action elements within the current and subsequent <rtt/> elements; and</li>
|
||
<li>An indication can be used to show the loss of sync (e.g. color coding, modified chat state message).</li>
|
||
</ul>
|
||
<p>Recovery occurs when the recipient receives the following:</p>
|
||
<ul>
|
||
<li>A <body/> element. The <link url="#body_element">Body Element</link> supersedes the real-time message.</li>
|
||
<li>An <rtt/> element containing an <link url="#event">event</link> attribute (e.g. new message, or <link url="#message_reset">Message Reset</link>).</li>
|
||
</ul>
|
||
</section3>
|
||
<section3 topic="Message Reset" anchor="message_reset">
|
||
<p>A message reset is a retransmission of the sender's partially composed text. The recipient refreshes the real-time message as a result. It allows real-time text conversation to resume quickly, without waiting for senders to start a new message.</p>
|
||
<p>Retransmission SHOULD be done at an average interval of 10 seconds during active typing or composing. This interval is frequent enough to minimize user waiting time, while being infrequent enough to reduce bandwidth overhead. This interval MAY vary in order to reduce average bandwidth requirements for minor message changes and/or for long messages. For quicker recovery, senders MAY adjust the timing of the message retransmissions to occur right after any of the following additional events: </p>
|
||
<ul>
|
||
<li>When a recipient starts sending messages from a different full JID (e.g. switched systems);</li>
|
||
<li>When a recipient sends a presence update (e.g. from offline to online);</li>
|
||
<li>When a recipient sends a chat state notification. See <link url="#usage_with_chat_states">Usage With Chat States</link>.</li>
|
||
<li>When a conversation is unlocked via &xep0296;;</li>
|
||
</ul>
|
||
<p>A message reset is done using the <rtt/> attribute <link url="#event">event</link> value of <strong>'reset'</strong> (see <link url="#rtt_attributes">RTT Attributes</link>).</p>
|
||
<p><code><![CDATA[<rtt event='reset' seq='#' xmlns='urn:xmpp:rtt:0'>
|
||
<t>This is a retransmission of the entire real-time message.</t>
|
||
</rtt>]]></code></p>
|
||
<p>Note: That there are no restrictions on using multiple <link url="#action_elements">Action Elements</link> during a message reset. (e.g. typing or backspacing occurring at the end of a retransmitted message.)</p>
|
||
</section3>
|
||
</section2>
|
||
</section1>
|
||
<section1 topic="Determining Support" anchor="determining_support">
|
||
<p>If a client supports this real-time text protocol, it is strongly RECOMMENDED to advertise that fact in its responses via &xep0030; information ("disco#info") requests by returning a feature of <strong>urn:xmpp:rtt:0</strong></p>
|
||
<p><strong>Example 1. A disco#info query</strong></p>
|
||
<p><code><![CDATA[<iq from='romeo@montague.lit/orchard'
|
||
id='disco1'
|
||
to='juliet@capulet.lit/balcony'
|
||
type='get'>
|
||
<query xmlns='http://jabber.org/protocol/disco#info'/>
|
||
</iq>
|
||
|
||
]]></code></p>
|
||
<p><strong>Example 2. A disco#info response</strong></p>
|
||
<p><code><![CDATA[<iq from='juliet@capulet.lit/balcony'
|
||
id='disco1'
|
||
to='romeo@montague.lit/orchard'
|
||
type='result'>
|
||
<query xmlns='http://jabber.org/protocol/disco#info'>
|
||
<feature var='urn:xmpp:rtt:0'/>
|
||
</query>
|
||
</iq>
|
||
|
||
]]></code></p>
|
||
<p>If this successful response of <strong><feature var='urn:xmpp:rtt:0'/></strong> is not received, the client SHOULD NOT transmit any outgoing <rtt/> elements in <message/> transmissions. This avoids unnecessary consumption of bandwidth to clients that do not support this protocol.</p>
|
||
<p>Enabling/disabling of discovery is SHOULD NOT be the default method of activating/deactivating real-time text. See <link url="#activating_and_deactivating_realtime_text">Activating and Deactivating Real-Time Text</link>.</p>
|
||
<p>In the absence of feature discovery, sender clients MAY send a single blank <rtt/> element at the beginning of the session (or upon sender attempting to initiate real-time text), as a method of indicating to the recipient that real-time text is permitted until the end of the chat session. Senders SHOULD NOT send any further <rtt/> until incoming <rtt/> is received during the same chat session, or when support is confirmed via discovery.</p>
|
||
</section1>
|
||
<section1 topic="Implementation Notes" anchor="implementation_notes">
|
||
<section2 topic="Text Presentation" anchor="text_presentation">
|
||
<section3 topic="Avoid Bursty Text Presentation" anchor="avoid_bursty_text_presentation">
|
||
<p>If a long <link url="#transmission_interval">Transmission Interval</link> is used without <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>, then text will appear in intermittent bursts if the display of text is not smoothed. This hurts user experience of real-time text.</p>
|
||
</section3>
|
||
<section3 topic="Preserving Key Press Intervals" anchor="preserving_key_press_intervals">
|
||
<p>For the highest quality display of text being typed, using <link url="#element_w_interval">Element <w/> – Interval</link> allows the original look-and-feel of typing to be preserved, independently of the transmission interval. Using the <w/> element, the sender can record multiple key presses including key press intervals, and transmit them over the XMPP network in a single <message/>. The recipient can then play back the sender's typing in real-time at original typing speed including the intervals between key presses.</p>
|
||
<p>Much like VoIP is a packetization of sound, this spec enables packetization of typing including the original key press intervals. This enables the real-time feel of typing over virtually any network connection, without requiring frequent transmission intervals. Look and feel of typing is also preserved over variable latency connections including &xep0206;, mobile phone, satellite and long international connections with heavy packet-bursting tendencies.</p>
|
||
<p>The recipient can watch the sender fluidly compose/edit their message in real-time without any “bursting” effects. This is “Natural Typing”, and appears indistinguishable from local typing. When key press intervals are preserved at high precision, all subtleties of typing are preserved, including the 'mood' (calm typing versus panicked or emphatic typing, etc). For an example transmission of key intervals, see <link url="#full_message_including_key_press_intervals">Full Message Including Key Press Intervals</link>.</p>
|
||
</section3>
|
||
<section3 topic="Time Critical And Low Latency Methods" anchor="time_critical_and_low_latency_methods">
|
||
<p>There are specialized situations such as live transcriptions and captioning (e.g. transcription service, closed captioning provider, captioned telephone, Communication Access Realtime Translation (CART), relay services) that demands low latency transmission. Such systems typically use voice recognition and/or stenotype machines, which output text in word bursts rather than a character at a time. It is acceptable for senders with bursty output to immediately transmit word bursts of text without buffering. This eliminates any lag caused by the <link url="#transmission_interval">Transmission Interval</link>. It is not necessary to transmit <link url="#element_w_interval">Element <w/> – Interval</link> for real-time transcription.</p>
|
||
</section3>
|
||
<section3 topic="Low-Bandwidth And Low-Precision Text Smoothing" anchor="lowbandwidth_and_lowprecision_text_smoothing">
|
||
<p>Some software platforms (e.g. JavaScript, BOSH, mobile devices) may have low-precision timers that impact <link url="#transmission_interval">Transmission Interval</link> and/or <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>. Clients can optimize for bandwidth, performance and/or screen repaints by eliminating, merging, or ignoring <link url="#element_w_interval">Element <w/> – Interval</link> selectively, especially those containing shorter intervals. It is acceptable for the transmission interval of <rtt/> to vary, either intentionally for optimizations, or due to precision limitation.</p>
|
||
<p>Clients can choose to implement alternate text-smoothing methods, such as adaptive-rate character-at-a-time output, and/or word buffering for incoming real-time text. Word buffering prevents most typing mistakes from being displayed, which can be a useful mode of operation for certain recipients who may dislike watching the sender's typing mistakes.</p>
|
||
</section3>
|
||
</section2>
|
||
<section2 topic="Activating and Deactivating Real-Time Text" anchor="activating_and_deactivating_realtime_text">
|
||
<p>Implementors can choose a preferred activation method for real-time text. For example, clients in the assistive market can choose to do immediate activation of real-time text. Popular mainstream clients might do user-initiated activation/confirmation of real-time text. The confirmation process could be similar to common activation methods used for audio/video. It is also beneficial for senders and recipients to easily synchronize the enabling/disabling of real-time text.</p>
|
||
<section3 topic="Activation Methods" anchor="activation_methods">
|
||
<p>Activation of real-time text in a chat session (immediate or user-initiated) can be done by:</p>
|
||
<ul>
|
||
<li>Immediately transmitting real-time text (if allowed after <link url="#determining_support">Determining Support</link>); or</li>
|
||
<li>Signaling first (by transmitting a single <rtt event='init'/> and waiting for response).</li>
|
||
</ul>
|
||
<p>Recipients can respond to incoming real-time text with an appropriate response, such as:</p>
|
||
<ul>
|
||
<li>Accepting immediately (by also activating as well, during the next message); or</li>
|
||
<li>Accepting after recipient confirmation (by also activating after a user confirmation prompt); or</li>
|
||
<li>Deny (by transmitting <rtt event='cancel'/> which is used in <link url="#deactivation_methods">Deactivation Methods</link>); or</li>
|
||
<li>Ignoring (by discarding incoming <rtt/> as a last resort, without using <link url="#deactivation_methods">Deactivation Methods</link>).</li>
|
||
</ul>
|
||
<p>It is not necessary for senders or recipients to transmit <rtt event='init'/> first, as any incoming <link url="#rtt_element">RTT Element</link> (other than <rtt event='cancel'/>) signals the start of incoming real time text. However, it permits signaling before the sender begins typing. It also permits sender signaling of a desire to begin real-time text, regardless of discovery in <link url="#determining_support">Determining Support</link>.</p>
|
||
<p>It is acceptable for recipients to display incoming real-time text without activating outgoing real-time text (such as while waiting for user confirmation). Care needs to be taken to prevent this situation from becoming confusing to the user. Implementors can add other additional behaviors that are appropriate, such as an introductory message upon first activation, for <link url="#privacy">Privacy</link> considerations.</p>
|
||
</section3>
|
||
<section3 topic="Deactivation Methods" anchor="deactivation_methods">
|
||
<p>Real-time text can be deactivated by any of:</p>
|
||
<ul>
|
||
<li>Sending a signal (using <rtt event='cancel'/> upon deactivation, deny, or end of chat session); or</li>
|
||
<li>Simply ending the chat session (without transmitting any further <rtt/> elements).</li>
|
||
</ul>
|
||
<p>Recipients can respond to deactivation by any one or more of the following:</p>
|
||
<ul>
|
||
<li>Deactivating in response (stop transmitting <rtt/> elements); and/or</li>
|
||
<li>Handling unfinished incoming real-time message (clearing and/or saving it); and/or</li>
|
||
<li>Inform the recipient that real-time text has ended (or denied/cancelled, if no real-time text was received).</li>
|
||
</ul>
|
||
<p>Sending an <rtt event='cancel'/> is useful in situations where the user closes a chat window, and ends the chat session. It is useful when the user wants to deactivate real-time text, while still continuing the chat session. After deactivation, either party may reactivate real-time text again in accordance to <link url="#activation_methods">Activation Methods</link>.</p>
|
||
</section3>
|
||
</section2>
|
||
<section2 topic="Optional Remote Cursor" anchor="optional_remote_cursor">
|
||
<p>Recipient clients might choose to display a cursor (or caret) within incoming real-time messages. This enhances usability of real-time text further, since it becomes easier for a recipient to observe the sender's real-time message edits.</p>
|
||
<p>Recipient clients that do not support a remote cursor, can simply ignore calculating a cursor position, and skip this section. All action elements only have absolute positioning, and positioning does not depend on previous action elements, so clients do not need to remember the previous cursor position.</p>
|
||
<section3 topic="Calculating Cursor Position" anchor="calculating_cursor_position">
|
||
<p>When <t/>, <e/>, or <d/> action elements are processed in incoming real-time text, the beginning value for the cursor position calculation is the absolute position value of the <em><strong>p</strong></em> attribute, according to <link url="#summary_of_attribute_values">Summary of Attribute Values</link>. The recipient can calculate the cursor position as follows:</p>
|
||
<ul>
|
||
<li><p>After <link url="#element_t_insert_text">Element <t/> – Insert Text</link>, the cursor position is the <em><strong>p</strong></em> attribute plus the length of the text being inserted. The cursor position is put at the end of inserted text.<br />
|
||
<em>This is the normal forward cursor movement during text insertion.</em></p></li>
|
||
<li><p>After <link url="#element_e_backspace">Element <e/> – Backspace</link>, the cursor position is the <em><strong>p</strong></em> attribute minus the <em><strong>n</strong></em> attribute.<br />
|
||
<em>This is the normal backwards cursor movement to a Backspace key.</em></p></li>
|
||
<li><p>After <link url="#element_d_forward_delete">Element <d/> – Forward Delete</link>, the cursor position is the <em><strong>p</strong></em> attribute, unaffected by the <em><strong>n</strong></em> attribute.<br />
|
||
<em>This is the normal stationary cursor response to a Delete key.</em></p></li>
|
||
<li><p>After an empty <link url="#element_t_insert_text">Element <t/> – Insert Text</link> (in the format of <strong><t p='#'/></strong> with no text to insert), the cursor position is the <strong>p</strong> attribute, and no text modification is done.<br /><em>This allows cursor response to arrow keys and/or mouse repositioning the cursor.</em></p></li>
|
||
</ul>
|
||
<p>The remote cursor needs to be clearly distinguishable from the sender's real local cursor. One example is to use a non-blinking cursor, easily emulated with a Unicode character or the vertical bar character '|'.</p>
|
||
<p>It is acceptable for the sender to transmit <link url="#element_t_insert_text">Element <t/> – Insert Text</link> as empty elements (with the cursor position in the <em><strong>p</strong></em> attribute) whenever the cursor position is changing without any text modifications (i.e. via arrow keys or mouse). This allows recipients supporting a remote cursor, to show the cursor movements. These extra elements are ignored by recipients that do not support a remote cursor.</p>
|
||
</section3>
|
||
</section2>
|
||
<section2 topic="Real-Time Text Transmission Methodologies" anchor="realtime_text_transmission_methodologies">
|
||
<section3 topic="Basic Real-Time Text" anchor="basic_realtime_text">
|
||
<p>Senders may choose to implement <link url="#message_reset">Message Reset</link> as the only method of transmitting changes to real-time message. The entire message is simply retransmitted every <link url="#transmission_interval">Transmission Interval</link> whenever there are any text changes. The below is a transmission of the real-time message “HELLO THERE BOB!” at regular intervals while the sender is typing.</p>
|
||
<p><code><![CDATA[<message to='bob@example.com' from='alice@example.com/home' type='chat' id='a01'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
|
||
<t>HELLO</t>
|
||
</rtt>
|
||
</message>
|
||
|
||
<message to='bob@example.com' from='alice@example.com/home' type='chat' id='b02'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='456002' event='reset'>
|
||
<t>HELLO THERE</t>
|
||
</rtt>
|
||
</message>
|
||
|
||
<message to='bob@example.com' from='alice@example.com/home' type='chat' id='c03'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='789003' event='reset'>
|
||
<t>HELLO THERE BOB!</t>
|
||
</rtt>
|
||
</message>]]></code></p>
|
||
<p>The advantage is very simple sender implementation. However, disadvantages include the lack of <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>, and extra bandwidth consumption that can occur with longer messages.</p>
|
||
</section3>
|
||
<section3 topic="Append-Only Real-Time Text" anchor="appendonly_realtime_text">
|
||
<p>The use of <link url="#element_t_insert_text">Element <t/> – Insert Text</link> without any attributes, simply appends text to the end of a message, while the use of <link url="#element_e_backspace">Element <e/> – Backspace</link> without any attributes, simply deletes text from the end of the message. This is useful if mid-message editing capabilities are not used (e.g. news tickers, relay services, captioned telephone).</p>
|
||
<p>If mid-message editing is needed without adding sender support for other <link url="#action_elements">Action Elements</link>, the use of <link url="#message_reset">Message Reset</link> can be a simple solution to support this situation. In this situation, disadvantages include the lack of <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>, and extra bandwidth consumption that can occur with longer messages.</p>
|
||
</section3>
|
||
<section3 topic="Monitoring Key Presses Directly" anchor="monitoring_key_presses_directly">
|
||
<p>Real-time text can be generated via a key press event. However, this does not have the advantages of <link url="#monitoring_message_changes_instead_of_key_presses">Monitoring Message Changes Instead Of Key Presses</link>. Care needs be taken with automatic changes to the message, generated by means other than key presses. This includes spell check auto-correct, copy and pastes, transcription, input method editors, and multiple key presses required to compose a character (i.e. accents). As a result, experience has found that key press events are not the best way to do real-time text over messaging.</p>
|
||
</section3>
|
||
<section3 topic="Monitoring Message Changes Instead Of Key Presses" anchor="monitoring_message_changes_instead_of_key_presses">
|
||
<p>Experience has found that the most reliable and practical method is to monitor the <strong>text changes</strong> to the local message text field, since:</p>
|
||
<ul>
|
||
<li>it captures all typing, including edits and deletes.</li>
|
||
<li>it captures copy & paste operations, as well as edits made via a pointing device.</li>
|
||
<li>it captures all automatic text changes (e.g. spell check auto-correct, macros, transcription, assistive devices).</li>
|
||
<li>it captures characters requiring multiple key presses to compose (e.g. accents, combining marks).</li>
|
||
<li>it makes no assumptions about different keyboards or input method editors (e.g. Chinese).</li>
|
||
<li>text change events are more portable across platforms, including on mobile phones.</li>
|
||
</ul>
|
||
<p>During a text change event, the current message string can be compared to the previous message string, in order to calculate what text changes took place. The first changed character and last changed character is determined. From this, it is then possible to generate action elements for text insertion and deletions. In addition, if <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link> are supported, then the interval is implemented as the time elapsed between text change events. For additional information, see <link url="#action_elements">Action Elements</link> and <link url="#summary_of_attribute_values">Summary of Attribute Values</link>.</p>
|
||
<section4 topic="Suggested Guidelines for Senders" anchor="suggested_guidelines_for_senders">
|
||
<ul>
|
||
<li><p>Monitor the message change event. Whenever message change occur, compute action elements and add these action elements to a buffer. This is equivalent to recording a small sequence of typing.</p></li>
|
||
<li><p>During every <link url="#transmission_interval">Transmission Interval</link>, all buffered action elements are transmitted in <rtt/> element of a <message/>. This is equivalent to transmitting a small sequence of typing at a time.</p></li>
|
||
<li><p>If there are no changes to the real-time message, then no unnecessary <rtt/> transmission takes place.</p></li>
|
||
</ul>
|
||
</section4>
|
||
<section4 topic="Suggested Guidelines for Receivers" anchor="suggested_guidelines_for_receivers">
|
||
<ul>
|
||
<li><p>Upon receving <rtt/> elements, the action elements are added to a queue, in the order that they are received. This provides immunity to variable network conditions, since the buffering action smooths out the latency fluctuations of message transmission.</p></li>
|
||
<li><p>The recipient software interprets the action elements in the queue in sequential order, including pauses from <link url="#element_w_interval">Element <w/> – Interval</link>. This is equivalent to playing back the sender's original typing, including key press intervals.</p></li>
|
||
<li><p>Upon receiving a <body/> element indicating a completed message, the full message can be displayed immediately in place of the real-time message, and unprocessed action elements cleared from the playback queue. This ensures final message delivery is not delayed by late processing of action elements.</p></li>
|
||
<li><p>If the playback queue contains too much delay in <w/> elements (i.e. <w/> elements from two <rtt/> transmissions ago), the recipient client can ignore or shorten the intervals of <w/> elements, to allow lagged real-time text to "catch up" more quickly.</p></li>
|
||
<li><p>It is best to process <link url="#element_w_interval">Element <w/> – Interval</link> via non-blocking programming techniques.</p></li>
|
||
</ul>
|
||
</section4>
|
||
</section3>
|
||
</section2>
|
||
<section2 topic="Other Guidelines" anchor="other_guidelines">
|
||
<p><link name="_Hlk168620696"></link>There are other special basic considerations for real-time message transmissions that need to be considered by implementors.</p>
|
||
<section3 topic="Message Length" anchor="message_length">
|
||
<p>A large sequence of action elements can result in an <rtt/> larger than the size of a message <body/>. This can occur normally during fast typing when <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link> during small messages. However, if the <rtt/> element becomes unusually huge (e.g. macros, multiple copy and pastes, leading to an <rtt/> exceeding one kilobyte) a <link url="#message_reset">Message Reset</link> can instead be used, in order to save bandwidth. (Stream compression is another approach.)</p>
|
||
<p>Clients can limit the length of the text input for the sender's message, in order to keep the size of <message/> stanzas reasonable, including during <link url="#message_reset">Message Reset</link>. Also, large <rtt/> elements may occur in situations such as large copy and pastes. To keep message stanza sizes reasonable, <rtt/> can be transmitted in a separate <message/> than the one containing <body/>.</p>
|
||
<p>For specialized clients that sends continuous real-time text (e.g. news ticker, captioning, transcription, TTY gateway), an automatic-send feature can be implemented when messages reaches a certain length. This allows continuous real-time text without real-time messages becoming excessively large.</p>
|
||
</section3>
|
||
<section3 topic="Usage With Chat States" anchor="usage_with_chat_states">
|
||
<p>Real-time text can be used in conjunction with XEP-0085 &xep0085;. These are simple guidelines for <message/> stanzas that include an <rtt/> element:</p>
|
||
<ul>
|
||
<li>For <rtt/> transmitted without an accompanying <body/>, include <composing/> chat state.</li>
|
||
<li>For <rtt/> transmitted with an accompanying <body/>, include the <active/> chat state.</li>
|
||
<li>Other chat states are handled as specified by XEP-0085 Chat States.</li>
|
||
</ul>
|
||
</section3>
|
||
<section3 topic="Usage With Multi-User Chat and Simultaneous Logins" anchor="usage_with_multiuser_chat_and_simultaneous_logins">
|
||
<p>The in-band nature of this real-time text standard allows one-to-many situations. Thus, real-time text is appropriate for use with &xep0045; (MUC), as well as concurrent simultaneous logins.</p>
|
||
<section4 topic="Multi-User Chat" anchor="multiuser_chat">
|
||
<p>Clients can implement this specification only for one-on-one chat. However, it is appropriate to support <rtt/> elements in MUC, even if not all participants support real-time text. Participants that enable real-time text during group chat, need to keep track of multiple concurrent real-time messages on a per-participant basis. As a result, participants with real-time text, will see real-time text coming from each participant that have real-time text enabled. Participants that turn off real-time text for themselves, can simply ignore incoming <rtt/> and not transmit outgoing <rtt/>. Participant clients without real-time text (whether unsupported or turned off) will simply see group chat function normally on a line-by-line basis, since it is <link url="#backwards_compatible">Backwards Compatible</link>. For the same participant logged in multiple times in the same room, see <link url="#simultaneous_logins">Simultaneous Logins</link>. For <rtt/> elements, the <link url="#event">event</link> attribute of 'init' or 'cancel' is not appropriate for MUC since they are intended for one-on-one use. To minimize on-screen clutter of multiple idle real-time messages, clients can hide idle messages, clear old <link url="#stale_messages">Stale Messages</link>, and/or prioritize the display of the most useful real-time messages. Prioritization can be recent typists and/or moderators (e.g. classroom teacher, convention speaker). In situations of simultaneous typing by a large number of participants, see <link url="#congestion_considerations">Congestion Considerations</link>.</p>
|
||
</section4>
|
||
<section4 topic="Simultaneous Logins" anchor="simultaneous_logins">
|
||
<p>In simultaneous login situations, transmitting of <rtt/> works in one-to-many situations without any special software support. For many-to-one situations where there is incoming <rtt/> from more than one simultaneous login, <link url="#keeping_realtime_text_synchronized">Keeping Real-Time Text Synchronized</link> will pause the real-time message upon conflicting <rtt/>, and resume during the next <link url="#message_reset">Message Reset</link>, presumably from the active login. This provides a seamless system-switching experience. A good implementation of <link url="#message_reset">Message Reset</link> will improve user experience, regardless of whether or not the client follows Best Practices For Resource Locking (XEP-0296). Clients can choose to distinguish the <rtt/> streams (via full JID and/or via <thread/>) and keep multiple concurrent real-time messages similar in manner to <link url="#multiuser_chat">Multi-User Chat</link>, with the <link url="#stale_messages">Stale Messages</link> being timed-out.</p>
|
||
</section4>
|
||
</section3>
|
||
<section3 topic="Stale Messages" anchor="stale_messages">
|
||
<p>There are situations where senders pause typing indefinitely. This can result in recipients displaying a real-time message for an extended time period. It may also be a screen clutter concern during <link url="#multiuser_chat">Multi-User Chat</link>. In addition, it may be a resource-consumption concern, as part of <link url="#congestion_considerations">Congestion Considerations</link>.</p>
|
||
<p>It is acceptable for recipients to clear (and/or save) incoming real-time messages that have been idle for an extended time period. There is no specific time-out period defined by this specification. For <link url="#multiuser_chat">Multi-User Chat</link>, the time-out period might be shorter because of the need to reduce screen clutter. For normal chat sessions, the time-out period might need to be longer to allow reasonable interruptions (i.e. sender pausing during a long phone call).</p>
|
||
<p>Senders that resumes composing a message (i.e. continues a partially-composed message hours later) can transmit a <link url="#message_reset">Message Reset</link>, which allows recipients to redisplay the real-time message.</p>
|
||
</section3>
|
||
<section3 topic="Performance & Efficiency" anchor="performance_efficiency">
|
||
<p>With real-time text, frequent screen updates may occur. Screen updates are a potential performance bottleneck, because fast typists type many key presses per second. Optimizing screen updates becomes especially important for slower platforms. Real-time messages needs to be updated efficiently in a flicker-free manner. Alternatively, to improve performance, the display of real-time messages may be implemented as a separate window or separate display element.</p>
|
||
<p>Battery life considerations are closely related to performance, as the addition of real-time text may impact battery life. If <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link> are supported, then the implementation of <link url="#element_w_interval">Element <w/> – Interval</link> needs to be implemented in a battery-efficient manner. The <link url="#transmission_interval">Transmission Interval</link> may vary dynamically to optimize for battery life and wireless reception. For devices where screen updates are an unavoidable inefficient bottleneck, see <link url="#lowbandwidth_and_lowprecision_text_smoothing">Low-Bandwidth And Low-Precision Text Smoothing</link> to reduce the number of screen updates per second. Also see &xep0286;.</p>
|
||
</section3>
|
||
<section3 topic="Total Conversation – Combination With Audio And Video" anchor="total_conversation_combination_with_audio_and_video">
|
||
<p>According to ITU-T Rec. F.703, the “Total Conversation” accessibility standard defines the simultaneous use of audio, video, and real-time text. For convenience, messaging applications may be designed to have automatic negotiation of as many as possible of the three media preferred by the users.</p>
|
||
<p>In the XMPP session environment, the Jingle protocol (&xep0166;) is available for negotiation and transport of the more time-critical, real-time audio and video media. Any combination of audio, video, and real-time text can be used together simultaneously.</p>
|
||
</section3>
|
||
</section2>
|
||
</section1>
|
||
<section1 topic="Use Cases" anchor="use_cases">
|
||
<p>Most of these examples are deliberately kept simple. In complete software implementations supporting key press intervals, transmissions will most resemble the last example, <link url="#full_message_including_key_press_intervals">Full Message Including Key Press Intervals</link>.</p>
|
||
<section2 topic="Example of Simple Real Time Text" anchor="example_of_simple_real_time_text">
|
||
<p>All three examples shown below result in the same real-time message "<strong>HELLO</strong>" created by writing "<strong>HLL</strong>", backspacing two times, and then "<strong>ELLO</strong>".</p>
|
||
<p><code><![CDATA[<message to='bob@example.com' from='alice@example.com/home' type='chat' id='a01'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
|
||
<t>HLL</t>
|
||
<e/><e/>
|
||
<t>ELLO</t>
|
||
</rtt>
|
||
</message>]]></code></p>
|
||
|
||
|
||
|
||
<p>The above code sends the misspelled "<strong>HLL</strong>", then <strong><e/><e/></strong> backspaces 2 times, then sends "<strong>HELLO</strong>".</p>
|
||
<p><code><![CDATA[<message to='bob@example.com' from='alice@example.com/home' type='chat' id='a01'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
|
||
<t>HLL</t>
|
||
<e n='2'/>
|
||
<t>ELLO</t>
|
||
</rtt>
|
||
</message>]]></code></p>
|
||
|
||
|
||
|
||
<p>The above code shows that <strong><e n='2'/></strong> does the same thing as <strong><e/><e/></strong>.</p>
|
||
<p><code><![CDATA[<message to='bob@example.com' from='alice@example.com/home' type='chat' id='a01'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
|
||
<t>HLL</t>
|
||
</rtt>
|
||
</message>
|
||
|
||
<message to='bob@example.com' from='alice@example.com/home' type='chat' id='b02'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123002'>
|
||
<e n='2'/>
|
||
</rtt>
|
||
</message>
|
||
|
||
<message to='bob@example.com' from='alice@example.com/home' type='chat' id='c03'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123003'>
|
||
<t>ELLO</t>
|
||
</rtt>
|
||
</message>]]></code></p>
|
||
|
||
|
||
|
||
<p>The above code splits the same real-time text over multiple stanzas, which would occur if the typing was occurring more slowly, over several <link url="#transmission_interval">Transmission Interval</link> cycles.</p>
|
||
</section2>
|
||
<section2 topic="Example of Multiple Messages" anchor="example_of_multiple_messages">
|
||
<p>The below example represents a short chat session of three separate messages:<br />
|
||
Bob says: "Hello Alice"<br />
|
||
Bob says: "This is Bob"<br />
|
||
Bob says: "How are you?"</p>
|
||
<p><code><![CDATA[<message to='alice@example.com' from='bob@example.com/home' type='chat' id='a01'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
|
||
<t>Hello</t>
|
||
</rtt>
|
||
<composing/>
|
||
</message>
|
||
|
||
<message to='alice@example.com' from='bob@example.com/home' type='chat' id='b02'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123002'>
|
||
<t> Alice</t>
|
||
</rtt>
|
||
<body>Hello Alice</body>
|
||
<active/>
|
||
</message>
|
||
|
||
<message to='alice@example.com' from='bob@example.com/home' type='chat' id='c03'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='456001' event='new'>
|
||
<t>This i</t>
|
||
</rtt>
|
||
<composing/>
|
||
</message>
|
||
|
||
<message to='alice@example.com' from='bob@example.com/home' type='chat' id='d04'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='456002'>
|
||
<t>s Bob</t>
|
||
</rtt>
|
||
<body>This is Bob</body>
|
||
<active/>
|
||
</message>
|
||
|
||
<message to='alice@example.com' from='bob@example.com/home' type='chat' id='e05'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='789001' event='new'>
|
||
<t>How a</t>
|
||
</rtt>
|
||
<composing/>
|
||
</message>
|
||
|
||
<message to='alice@example.com' from='bob@example.com/home' type='chat' id='f06'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='789002'>
|
||
<t>re yo</t>
|
||
</rtt>
|
||
<composing/>
|
||
</message>
|
||
|
||
<message to='alice@example.com' from='bob@example.com/home' type='chat' id='g07'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='789003'>
|
||
<t>u?</t>
|
||
</rtt>
|
||
<body>How are you?</body>
|
||
<active/>
|
||
</message>]]></code></p>
|
||
|
||
|
||
|
||
<p>This is based on a moderate typing speed transmitted at a normal <link url="#transmission_interval">Transmission Interval</link>. This example also illustrates the following:</p>
|
||
<ul>
|
||
<li>The <strong>type</strong> attribute equals 'new' for the start of every new message.</li>
|
||
<li>The <strong>seq</strong> attribute increments during the same message.</li>
|
||
<li>The <strong>event</strong> attribute indicating the start of a new message, while <strong>seq</strong> is randomized to a new starting value.</li>
|
||
<li>This shows <link url="#usage_with_chat_states">Usage With Chat States</link>.</li>
|
||
</ul>
|
||
</section2>
|
||
<section2 topic="Examples of Message Edits" anchor="examples_of_message_edits">
|
||
<section3 topic="Deleting Text From Message" anchor="deleting_text_from_message">
|
||
<p><code><![CDATA[<message to='bob@example.com' from='alice@example.com/home' type='chat' id='a01'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
|
||
<t>Hello Bob, this is Alice!</t>
|
||
<d n='4' p='5'/>
|
||
</rtt>
|
||
</message>]]></code></p>
|
||
|
||
|
||
|
||
<p>Final result of real-time message: "<strong>Hello, this is Alice!</strong>"<br />
|
||
This code outputs "<strong>Hello Bob, this is Alice!</strong>" then <strong><d n='4' p='5'/></strong> deletes 4 characters from position 5.<br />
|
||
(This erases the text " <strong>Bob</strong>" including the preceding space character).</p>
|
||
</section3>
|
||
<section3 topic="Inserting Text Into Message" anchor="inserting_text_into_message">
|
||
<p><code><![CDATA[<message to='bob@example.com' from='alice@example.com/home' type='chat' id='a01'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
|
||
<t>Hello, this is Alice!</t>
|
||
<t p='5'> Bob</t>
|
||
</rtt>
|
||
</message>]]></code></p>
|
||
|
||
|
||
|
||
<p>Final result of real-time message: "<strong>Hello Bob, this is Alice!</strong>"<br />
|
||
This is because the code outputs "<strong>Hello, this is Alice!</strong>" then the <strong><t p='5'></strong> inserts the specified text " <strong>Bob</strong>" at position 5.</p>
|
||
</section3>
|
||
<section3 topic="Deleting And Replacing Text In Message" anchor="deleting_and_replacing_text_in_message">
|
||
<p><code><![CDATA[<message to='bob@example.com' from='alice@example.com/home' type='chat' id='a01'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
|
||
<t>Hello Bob, tihsd is Alice!</t>
|
||
<d p='11' n='5'/>
|
||
<t p='11'>this</t>
|
||
</rtt>
|
||
</message>]]></code></p>
|
||
|
||
|
||
|
||
<p>Final result of real-time message: "<strong>Hello Bob, this is Alice!</strong>"<br />
|
||
This code outputs "<strong>Hello Bob, tihsd is Alice!</strong>", then <strong><d p='11' n='5'/></strong> deletes 5 characters at position 11 in the string of text. (erases the mistyped word "<strong>tihsd</strong>"). Finally, <strong><t p='11'>this</t></strong> inserts the text "<strong>this</strong>" place of the original misspelled word.</p>
|
||
</section3>
|
||
</section2>
|
||
<section2 topic="Examples of Full Spec Support" anchor="examples_of_full_spec_support">
|
||
<section3 topic="Multiple Message Edits" anchor="multiple_message_edits">
|
||
<p>This is an example message containing multiple consecutive real-time message edits.</p>
|
||
<p><code><![CDATA[<message to='bob@example.com' from='alice@example.com/home' type='chat' id='a01'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
|
||
<t>Helo</t>
|
||
<e/>
|
||
<t>lo...planet</t>
|
||
<e n='6'/>
|
||
<t> World</t>
|
||
<d n='3' p='5'/>
|
||
<t p='5'> there,</t>
|
||
</rtt>
|
||
</message>]]></code></p>
|
||
|
||
|
||
|
||
<p>Resulting real-time message: "<strong>Hello there, World</strong>", completed in the following series of steps:</p>
|
||
<table>
|
||
<tr>
|
||
<th>Element</th>
|
||
<th>Action</th>
|
||
<th>Real -Time Message</th>
|
||
<th>Cursor Position*</th>
|
||
</tr>
|
||
<tr>
|
||
<td><t>Helo</t></td>
|
||
<td>Output "Helo"</td>
|
||
<td>Helo</td>
|
||
<td>4</td>
|
||
</tr>
|
||
<tr>
|
||
<td><e/></td>
|
||
<td>Backspace 1 character from end of line.</td>
|
||
<td>Hel</td>
|
||
<td>3</td>
|
||
</tr>
|
||
<tr>
|
||
<td><t>lo...planet</t></td>
|
||
<td>Output "lo...planet" at end of line.</td>
|
||
<td>Hello...planet</td>
|
||
<td>14</td>
|
||
</tr>
|
||
<tr>
|
||
<td><e n='6'/></td>
|
||
<td>Backspace 6 characters from end of line</td>
|
||
<td>Hello...</td>
|
||
<td>8</td>
|
||
</tr>
|
||
<tr>
|
||
<td><t> World</t></td>
|
||
<td>Output " World" at end of line.</td>
|
||
<td>Hello... World</td>
|
||
<td>14</td>
|
||
</tr>
|
||
<tr>
|
||
<td><d n='3' p='5'/></td>
|
||
<td>Delete 3 characters at position 5</td>
|
||
<td>Hello World</td>
|
||
<td>5</td>
|
||
</tr>
|
||
<tr>
|
||
<td><t p='5'> there,</t></td>
|
||
<td>Output " there," at position 5</td>
|
||
<td>Hello there, World</td>
|
||
<td>12</td>
|
||
</tr>
|
||
</table>
|
||
<p>Normally, the action elements are split into multiple separate transmissions. This example also does not illustrate <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>. *The Cursor Position column is only relevant if the <link url="#optional_remote_cursor">Optional Remote Cursor</link> is implemented.</p>
|
||
</section3>
|
||
<section3 topic="Full Message Including Key Press Intervals" anchor="full_message_including_key_press_intervals">
|
||
<p>This example is a transmission of “Hello there!” while <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>. It illustrates a four-second typing sequence:</p>
|
||
<ul>
|
||
<li>The misspelled phrase “Hello tehre!” is typed;</li>
|
||
<li>Three cursor-left movements back to the typing mistake;</li>
|
||
<li>Two backspaces to delete the typing mistake;</li>
|
||
<li>Two correct key presses to correctly spell the word “there”.</li>
|
||
</ul>
|
||
<p>In between each key press, is <link url="#element_w_interval">Element <w/> – Interval</link> to allow the receiving client execute a small pause between action elements, which allows the playback of the typing at its original look-and-feel.</p>
|
||
<p><code><![CDATA[<message to='bob@example.com' from='alice@example.com/home' type='chat' id='a01'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
|
||
<t>H</t>
|
||
<w n='115'/><t>e</t>
|
||
<w n='154'/><t>l</t>
|
||
<w n='151'/><t>l</t>
|
||
<w n='115'/><t>o</t>
|
||
<w n='165'/>
|
||
</rtt>
|
||
</message>
|
||
|
||
<message to='bob@example.com' from='alice@example.com/home' type='chat' id='b02'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123002'>
|
||
<w n='40'/><t> </t>
|
||
<w n='161'/><t>t</t>
|
||
<w n='137'/><t>e</t>
|
||
<w n='135'/><t>h</t>
|
||
<w n='134'/><t>r</t>
|
||
<w n='93'/>
|
||
</rtt>
|
||
</message>
|
||
|
||
<message to='bob@example.com' from='alice@example.com/home' type='chat' id='c03'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123003'>
|
||
<w n='109'/><t>e</t>
|
||
<w n='115'/><t>!</t>
|
||
<w n='330'/><t p='11'/>
|
||
<w n='108'/><t p='10'/>
|
||
<w n='38'/>
|
||
</rtt>
|
||
</message>
|
||
|
||
<message to='bob@example.com' from='alice@example.com/home' type='chat' id='d04'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123004'>
|
||
<w n='109'/><t p='9'/>
|
||
<w n='111'/><e p='9'/>
|
||
<w n='106'/><e p='8'/>
|
||
<w n='138'/><t p='7'>h</t>
|
||
<w n='209'/><t p='8'>e</t>
|
||
<w n='27'/>
|
||
</rtt>
|
||
</message>
|
||
|
||
<message to='bob@example.com' from='alice@example.com/home' type='chat' id='d04'>
|
||
<rtt xmlns='urn:xmpp:rtt:0' seq='123005'>
|
||
<w n='445'/><t p='12'/>
|
||
</rtt>
|
||
<body>Hello there!</body>
|
||
</message>]]></code></p>
|
||
|
||
|
||
|
||
<p>This example also illustrate the following:</p>
|
||
<ul>
|
||
<li>Typing is done via <link url="#element_t_insert_text">Element <t/> – Insert Text</link>.</li>
|
||
<li>Backspaces are done via <link url="#element_e_backspace">Element <e/> – Backspace</link>.</li>
|
||
<li>There is a final transmission with a <link url="#body_element">Body Element</link>, when the message is finished.</li>
|
||
<li>Intervals between key presses are done via <link url="#element_w_interval">Element <w/> – Interval</link>.</li>
|
||
<li>Each <message/> is delivered every 0.7 seconds, the default <link url="#transmission_interval">Transmission Interval</link>.</li>
|
||
<li>Cursor movements are done via empty <t/> elements, for an <link url="#optional_remote_cursor">Optional Remote Cursor</link>.</li>
|
||
<li>Recipient that do not support <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>, will still display this message normally.</li>
|
||
<li>The total sum of all values in <link url="#element_w_interval">Element <w/> – Interval</link> in one <message/> equal the <link url="#transmission_interval">Transmission Interval</link> during periods of continuous typing. This also results in some <w/> interval elements being split between consecutive messages. Although not critical, it can improve the fluidity of typing playback</li>
|
||
<li>See <link url="#monitoring_message_changes_instead_of_key_presses">Monitoring Message Changes Instead Of Key Presses</link> for more info.</li>
|
||
</ul>
|
||
</section3>
|
||
</section2>
|
||
</section1>
|
||
<section1 topic="Interoperability Considerations" anchor="interoperability_considerations">
|
||
<p>There are other real-time text formats with interoperability considerations relating to the session setup level, the media transport level, and presentation level. For each environment where interoperability is supported, an interoperability specification needs to be documented that covers addressing, session control, media negotiation and media transcoding.</p>
|
||
<section2 topic="Other Real-Time Text Standards" anchor="other_realtime_text_standards">
|
||
<p>It is noted there is also another real-time text standard (RFC 4103, <span class="ref"><strong><link url="http://tools.ietf.org/html/rfc5194">IETF RFC 5194</link></strong></span> <note>IETF RFC 5194: Framework for Real-Time Text over IP Using the Session Initiation Protocol (SIP). <<link url="http://tools.ietf.org/html/rfc5194">http://tools.ietf.org/html/rfc5194</link>>.</note>), used for SIP sessions with real-time text. In the situation where an implementor needs to decide which real-time text standard to use, it makes sense to use the real-time text specification of the specific session control standard in use for that particular session. This varies from implementation to implementation. For example, Google Talk network uses XMPP messaging for instant messages sent during audio/video conversations. Therefore, in this situation, it makes sense to use this XEP-0301 specification to add real-time text functionality. However, there can be situations where it is necessary to support multiple real-time-text standards, and to interoperate between the multiple real-time text standards.</p>
|
||
</section2>
|
||
<section2 topic="RFC 4103 and T.140" anchor="rfc_4103_and_t140">
|
||
<p>One environment for interoperability considerations is SIP with real-time text (also called Text over IP, or ToIP) as specified in ITU-T T.140 and IETF RFC 4103. This protocol combination is specified by IETF, and by some emergency service organizations, to be one of the protocols supported for IP based real-time emergency calls that support real-time text. Another reason is that SIP is a popular real-time session control protocol. Also, there are many implementations of real-time text that is being controlled by SIP.</p>
|
||
<p>Interoperability implies addressing translation, media negotiation and translation, and media transcoding. For media transcoding between this specification and T.140/RFC 4103, the real-time text transcoding is straight forward, except the editing feature of this specification. Backwards positioning and insertion or deletion far back in the message can cause a large number of erase operations in T.140, that takes time and bandwidth to convey.</p>
|
||
<p>It is noted that T.140 specifies the use of ISO 6429 control codes for presentation characteristics, such as text color, that are not covered in this version of this specification. All control codes from both sides that cannot be presented on the other side of the conversion, needs to be filtered off in order to not disturb the presentation of text.</p>
|
||
<p>Also, see <link url="#total_conversation_combination_with_audio_and_video">Total Conversation – Combination With Audio And Video</link>.</p>
|
||
</section2>
|
||
</section1>
|
||
<section1 topic="Internationalization Considerations" anchor="internationalization_considerations">
|
||
<p>The primary internationalization consideration involve real-time message editing via <link url="#action_elements">Action Elements</link>, where text is inserted and deleted using index and position values. In particular, correct <link url="#unicode_character_counting">Unicode Character Counting</link> needs to be followed, due to the existence of variable-length encodings and right-to-left text. Also, <link url="#accurate_processing_of_action_elements">Accurate Processing of Action Elements</link> will ensure that all possible valid Unicode text can be used via this protocol. This can include text containing multiple scripts/languages, ideographic symbols (e.g. Chinese), right-to-left text (e.g. Arabic), and bidirectional text.</p>
|
||
<p>For accessibility considerations, there is an <span class="ref"><strong><link url="http://www.fasttext.org">International Symbol of Real-Time Text</link></strong></span>
|
||
<note>The International Symbol of Real-Time Text <<link url="http://www.fasttext.org">http://www.fasttext.org</link>>.</note> to alert users to the existence of this feature.</p>
|
||
</section1>
|
||
<section1 topic="Security Considerations" anchor="security_considerations">
|
||
<section2 topic="Privacy" anchor="privacy">
|
||
<p>It is important for implementors of real-time text to educate users about real-time text. Users of real-time text needs to be aware that their typing is now visible in real-time to everyone in the current chat conversation. This may have security implications if users copy & paste private information into their chat entry buffer (e.g. a shopping invoice) before editing out the private parts of the pasted text (e.g. a credit card number) before they send the message. With real-time message editing, recipients can watch all text changes that occur in the sender's text, before the sender sends the final message. Implementation behaviors and improved education can be added to reduce privacy issues. Examples include introduction upon first activation of feature, special handling for copy and pastes (i.e. preventing them, or prompting for confirmation), recipient confirmation of real-time text via <link url="#activating_and_deactivating_realtime_text">Activating and Deactivating Real-Time Text</link>, etc.</p>
|
||
</section2>
|
||
<section2 topic="Encryption" anchor="encryption">
|
||
<p>Real-time text (<rtt/> elements) transmit the content contained within messages. Therefore, a client that encrypts <body/>, also needs to also encrypt <rtt/> as well:</p>
|
||
<ul>
|
||
<li><p>Encryption at the stream level (e.g. TLS) can be used normally with this specification. Stream-level encryption is the most common form of encryption.</p></li>
|
||
<li><p>Encryption at the stanza level (e.g. &xep0200;) can be used for all stanzas containing either <rtt/> or <body/>. It is worth noting that stanza-level encryption produces significantly more overhead, due to the increased number of stanzas that real-time text causes, leading to <link url="#congestion_considerations">Congestion Considerations</link>.</p></li>
|
||
<li><p>Encryption at the <body/> level (e.g. deprecated XEP-0027) do not encrypt <rtt/>. In this case, <rtt/> needs to be encrypted separately. It is preferable to use a broader level of encryption, where possible.</p></li>
|
||
</ul>
|
||
</section2>
|
||
<section2 topic="Congestion Considerations" anchor="congestion_considerations">
|
||
<p>The nature of real-time text result in more frequent transmission of <message/> stanzas than may otherwise happen in a non-real-time text conversation. This may lead to increased network and server loading of XMPP networks.</p>
|
||
<p>Transmission of real-time text can be throttled temporarily during poor network conditions. It is appropriate to use latency monitoring mechanisms (e.g. &xep0184; or &xep0198;) in order to temporarily adjust the <link url="#transmission_interval">Transmission Interval</link> of real-time text beyond the recommended range. This results in lagged text (less real-time) but is better than failure during poor network conditions. The use of <link url="#message_reset">Message Reset</link> can also retransmit real-time text lost by poor network conditions, including stanzas dropped by the server. This is also useful for mission-critical applications such as Next Generation 9-1-1 emergency services.</p>
|
||
<p>Excess numbers of real-time messages (e.g. during DoS scenario in <link url="#multiuser_chat">Multi-User Chat</link>) might cause local resource-consumption issues, which can be mitigated by accelerated time-out of <link url="#stale_messages">Stale Messages</link>.</p>
|
||
<p>Use of this specification in the recommended way will cause a load that is only marginally higher than a user communicating without this specification. Bandwidth overhead of real-time text is very low compared to many other activities possible on XMPP networks including in-band file transfers and audio.</p>
|
||
</section2>
|
||
</section1>
|
||
<section1 topic="IANA Considerations" anchor="iana_considerations">
|
||
<p>This document requires no interaction with the Internet Assigned Numbers Authority (IANA).</p>
|
||
</section1>
|
||
<section1 topic="XMPP Registrar Considerations" anchor="xmpp_registrar_considerations">
|
||
<section2 topic="Protocol Namespaces" anchor="protocol_namespaces">
|
||
<p>The XMPP Registrar should include "urn:xmpp:rtt:0" in its registry of protocol namespaces (see <<link url="http://xmpp.org/registrar/namespaces.html">http://xmpp.org/registrar/namespaces.html</link>>).</p>
|
||
</section2>
|
||
<section2 topic="Namespace Versioning" anchor="namespace_versioning">
|
||
<p>If the protocol defined in this specification undergoes a revision that is not fully backwards-compatible with an older version, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of XEP-0053.</p>
|
||
</section2>
|
||
</section1>
|
||
<section1 topic="XML Schema" anchor="xml_schema">
|
||
<p><code><![CDATA[<?xml version='1.0' encoding='UTF-8'?>
|
||
|
||
<xs:schema
|
||
xmlns:xs='http://www.w3.org/2001/XMLSchema'
|
||
targetNamespace='urn:xmpp:rtt:0'
|
||
xmlns='urn:xmpp:rtt:0'
|
||
elementFormDefault='qualified'>
|
||
|
||
<xs:annotation>
|
||
<xs:documentation>
|
||
The protocol documented by this schema is defined in
|
||
XEP-0301: http://www.xmpp.org/extensions/xep-0301.html
|
||
</xs:documentation>
|
||
</xs:annotation>
|
||
|
||
<xs:element name='rtt'>
|
||
<xs:complexType>
|
||
<xs:attribute name='seq' type='xs:unsignedInt' use='required'/>
|
||
<xs:attribute name='event' use='optional'>
|
||
<xs:simpleType>
|
||
<xs:restriction base="xs:string">
|
||
<xs:enumeration value="new"/>
|
||
<xs:enumeration value="reset"/>
|
||
<xs:enumeration value="cancel"/>
|
||
</xs:restriction>
|
||
</xs:simpleType>
|
||
</xs:attribute>
|
||
<xs:sequence>
|
||
<xs:element ref='t' minOccurs='0' maxOccurs='unbounded'/>
|
||
<xs:element ref='e' minOccurs='0' maxOccurs='unbounded'/>
|
||
<xs:element ref='d' minOccurs='0' maxOccurs='unbounded'/>
|
||
<xs:element ref='w' minOccurs='0' maxOccurs='unbounded'/>
|
||
</xs:sequence>
|
||
</xs:complexType>
|
||
</xs:element>
|
||
|
||
<xs:element name='t' type='xs:string'>
|
||
<xs:complexType>
|
||
<xs:attribute name='p' type='xs:nonNegativeInteger' use='optional'/>
|
||
</xs:complexType>
|
||
</xs:element>
|
||
|
||
<xs:element name='e' type='empty'>
|
||
<xs:complexType>
|
||
<xs:attribute name='p' type='xs:nonNegativeInteger' use='optional'/>
|
||
<xs:attribute name='n' type='xs:nonNegativeInteger' use='optional' default='1'/>
|
||
</xs:complexType>
|
||
</xs:element>
|
||
|
||
<xs:element name='d' type='empty'>
|
||
<xs:complexType>
|
||
<xs:attribute name='p' type='xs:nonNegativeInteger' use='required'/>
|
||
<xs:attribute name='n' type='xs:nonNegativeInteger' use='optional' default='1'/>
|
||
</xs:complexType>
|
||
</xs:element>
|
||
|
||
<xs:element name='w' type='empty'>
|
||
<xs:complexType>
|
||
<xs:attribute name='n' type='xs:nonNegativeInteger' use='required'/>
|
||
</xs:complexType>
|
||
</xs:element>
|
||
|
||
<xs:simpleType name='empty'>
|
||
<xs:restriction base='xs:string'>
|
||
<xs:enumeration value=''/>
|
||
</xs:restriction>
|
||
</xs:simpleType>
|
||
|
||
</xs:schema>]]></code></p>
|
||
</section1>
|
||
<section1 topic="Acknowledgments" anchor="acknowledgments">
|
||
<p>The author would like to thank Real-Time Text Taskforce (R3TF) at <link class="western" href="http://www.realtimetext.org/">www.realtimetext.org</link> for their contribution to the technology documented in this specification. Mark Rejhon leads the Jabber/XMPP Taskgroup at R3TF. Members of R3TF who have contributed to this document, include Gunnar Helstrom (Omnitor), Paul E. Jones (Cisco), Gregg Vanderheiden (Trace R&D Center, University of Wisconsin), Barry Dingle (Interopability Leader, R3TF), and Arnoud van Wijk (Founder, R3TF). Others contributors include Bernard Aboba (Microsoft), Austin McKinley (Facebook), Christian Vogler (Gallaudet University), Norm Williams (Gallaudet University).</p>
|
||
<p>“Natural Typing”, the technique of preserving key press intervals, is acknowledged as an invention by Mark Rejhon, who is deaf. This technology is provided to XMPP.org as part of this specification in compliance of the XSF's Intellectual Property Rights Policy at <link class="western" href="http://xmpp.org/extensions/ipr-policy.shtml">http://xmpp.org/extensions/ipr-policy.shtml</link>.</p>
|
||
|
||
|
||
</section1>
|
||
|
||
</xep>
|