No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

xep-0301.xml 106KB

  1. <?xml version='1.0' encoding='UTF-8'?>
  2. <!DOCTYPE xep SYSTEM 'xep.dtd' [
  3. <!ENTITY % ents SYSTEM 'xep.ent'>
  4. <!ENTITY R3TF "<span class='ref'><link url=''>Real-Time Text Taskforce</link></span> <note>Real-Time Text Taskforce (R3TF) &lt;<link url=''></link>&gt;.</note>" >
  5. %ents;
  6. ]>
  7. <?xml-stylesheet type='text/xsl' href='xep.xsl'?>
  8. <xep>
  9. <header>
  10. <title>In-Band Real Time Text</title>
  11. <abstract>This is a specification for real-time text transmitted in-band over an XMPP session.
  12. Real-time text is text transmitted instantly while it is being typed or
  13. created.</abstract>
  15. <number>0301</number>
  16. <status>Draft</status>
  17. <type>Standards Track</type>
  18. <sig>Standards</sig>
  19. <approver>Council</approver>
  20. <dependencies>
  21. <spec>XMPP Core</spec>
  22. <spec>XMPP IM</spec>
  23. <spec>XEP-0030</spec>
  24. </dependencies>
  25. <supersedes/>
  26. <supersededby/>
  27. <shortname>rtt</shortname>
  28. <author>
  29. <firstname>Mark</firstname>
  30. <surname>Rejhon</surname>
  31. <email></email>
  32. <jid></jid>
  33. <uri></uri>
  34. </author>
  35. <author>
  36. <firstname>Gunnar</firstname>
  37. <surname>Hellstrom</surname>
  38. <email></email>
  39. <uri></uri>
  40. </author>
  41. <revision>
  42. <version>1.0</version>
  43. <date>2013-10-08</date>
  44. <initials>psa</initials>
  45. <remark><p>Per a vote of the XMPP Council, advanced status to Draft.</p></remark>
  46. </revision>
  47. <revision>
  48. <version>0.12</version>
  49. <date>2013-09-25</date>
  50. <initials>MDR</initials>
  51. <remark><p>Add discovery for support during Multi-User Chat (XEP-0045), plus minor editorial changes.</p></remark>
  52. </revision>
  53. <revision>
  54. <version>0.11</version>
  55. <date>2013-07-31</date>
  56. <initials>MDR</initials>
  57. <remark><p>Changes recommended by Kevin Smith during Last Call. One section moved (activation/deactivation guidelines).</p></remark>
  58. </revision>
  59. <revision>
  60. <version>0.10</version>
  61. <date>2013-06-24</date>
  62. <initials>MDR</initials>
  63. <remark><p>Changes from Last Call feedback.</p></remark>
  64. </revision>
  65. <revision>
  66. <version>0.9</version>
  67. <date>2013-05-18</date>
  68. <initials>MDR</initials>
  69. <remark><p>Minor corrections and clarifications.</p></remark>
  70. </revision>
  71. <revision>
  72. <version>0.8</version>
  73. <date>2013-04-08</date>
  74. <initials>MDR</initials>
  75. <remark><p>Several clarifications made to several sections.
  76. Removed references to proprietary products. New "Processing Rules" section added.
  77. Set a default &lt;rtt/&gt; event attribute value of 'edit', if no event
  78. attribute is specified.</p></remark>
  79. </revision>
  80. <revision>
  81. <version>0.7</version>
  82. <date>2012-08-08</date>
  83. <initials>MDR</initials>
  84. <remark><p>Simplifications and grammatical corrections. Some sections (1, 6.2, 6.4) shortened with simpler language.</p></remark>
  85. </revision>
  86. <revision>
  87. <version>0.6</version>
  88. <date>2012-07-28</date>
  89. <initials>MDR</initials>
  90. <remark><p>Changes and improvements in preparation for advance to Draft. Unified
  91. &lt;e/&gt; element (Erase Text) to handle all possible text deletions.
  92. Clarify the Unicode terminology used in this specification, and move
  93. section 4.5.4 downwards to section 4.7 to improve reading
  94. order.</p></remark>
  95. </revision>
  96. <revision>
  97. <version>0.5</version>
  98. <date>2012-07-22</date>
  99. <initials>MDR</initials>
  100. <remark><p>Minor corrections and clarifications.</p></remark>
  101. </revision>
  102. <revision>
  103. <version>0.4</version>
  104. <date>2012-07-20</date>
  105. <initials>MDR</initials>
  106. <remark><p>Spelling, grammar, and clarification edits, including section clarifications recommended from public discussion. Interop with XEP-0308 message correction.</p></remark>
  107. </revision>
  108. <revision>
  109. <version>0.3</version>
  110. <date>2012-06-07</date>
  111. <initials>MDR</initials>
  112. <remark><p>Edits recommended from public discussion.</p></remark>
  113. </revision>
  114. <revision>
  115. <version>0.2</version>
  116. <date>2012-03-18</date>
  117. <initials>MDR</initials>
  118. <remark><p>Lots of edits. Simplifications, improvements and corrections. Forward and backward compatible with version 0.1.</p></remark>
  119. </revision>
  120. <revision>
  121. <version>0.1</version>
  122. <date>2011-06-29</date>
  123. <initials>psa</initials>
  124. <remark><p>Initial published version.</p></remark>
  125. </revision>
  126. <revision>
  127. <version>0.0.3</version>
  128. <date>2011-06-25</date>
  129. <initials>MDR</initials>
  130. <remark><p>Third draft, recommended edits.</p></remark>
  131. </revision>
  132. <revision>
  133. <version>0.0.2</version>
  134. <date>2011-06-15</date>
  135. <initials>MDR</initials>
  136. <remark><p>Second draft.</p></remark>
  137. </revision>
  138. <revision>
  139. <version>0.0.1</version>
  140. <date>2011-02-21</date>
  141. <initials>MDR</initials>
  142. <remark><p>First draft.</p></remark>
  143. </revision>
  144. </header>
  145. <section1 topic="Introduction" anchor="introduction">
  146. <p>This document defines a specification for real-time text transmitted in-band over an XMPP network.</p>
  147. <p>Real-time text is text transmitted instantly while it is being typed or created. The recipient can immediately read the sender's text as it is written, without waiting. It allows text to be used as conversationally as a telephone conversation, including in situations where speech is not practical (e.g., environments that must be quiet, environments too noisy to hear, restrictions on phone use, situations where speaking is a privacy or security concern, and/or when participant(s) are deaf or hard of hearing). It is also used for transmission of live speech transcription.</p>
  148. <p>Real-time text is found in various implementations:</p>
  149. <ul>
  150. <li>The 'talk' command on UNIX systems since the 1970's.</li>
  151. <li>Session Initiation Protocol (SIP), utilizing &rfc4103; real-time text.</li>
  152. <li>Instant messaging enhancements, including a <span class="ref"><strong><link url="">Gallaudet University</link></strong></span>
  153. <note>Gallaudet University Technology Access Program collaboration project: Real-Time Text &lt;<link url=""></link>&gt;.</note> collaboration.</li>
  154. <li>Next generation emergency services (&rfc6443;).</li>
  155. </ul>
  156. <p>For a visual animation of real-time text, see <span class="ref"><strong><link url="">Real-Time Text Taskforce</link></strong></span>
  157. <note>Real-Time Text Taskforce, a foundation for real-time text standardization &lt;<link url=""></link>&gt;.</note>.</p>
  158. </section1>
  159. <section1 topic="Requirements" anchor="requirements">
  160. <section2 topic="Fluid Real-Time Text" anchor="fluid_realtime_text">
  161. <ol>
  162. <li>Allow reliable transmission of real-time text with a low latency.</li>
  163. <li>Support message editing in real-time, including text insertions and deletions.</li>
  164. <li>Support transmission and reproduction of the original intervals between key presses, to preserve look-and-feel of typing independently of transmission intervals.</li>
  165. </ol>
  166. </section2>
  167. <section2 topic="In-Band Transmission" anchor="inband_transmission">
  168. <ol>
  169. <li>Be backwards compatible with XMPP clients that do not support real-time text.</li>
  170. <li>Be compatible with &xep0045; and simultaneous logins.</li>
  171. <li>Minimize reliance on out-of-band transmission protocols, for simpler network traversal.</li>
  172. </ol>
  173. </section2>
  174. <section2 topic="Flexible and Interoperable" anchor="flexible_and_interoperable">
  175. <ol>
  176. <li>Allow seamless integration of real-time text into instant messaging clients, with minimal user interface modifications.</li>
  177. <li>Be able to function securely over intermittent and unreliable connections, including mobile phones.</li>
  178. <li>Allow use within gateways to interoperate with other real-time text protocols, including <strong>RFC 4103</strong> and <span class="ref"><strong><link url="">ITU-T T.140</link></strong></span>
  179. <note>ITU-T T.140: Protocol for multimedia application text conversation &lt;<link url=""></link>&gt;.</note>.</li>
  180. <li>Be usable in an international setting.</li>
  181. </ol>
  182. </section2>
  183. <section2 topic="Accessible" anchor="accessible">
  184. <ol>
  185. <li>Allow XMPP applications to be able to implement <span class="ref"><strong><link url="">ITU-T Rec. F.703</link></strong></span>
  186. <note>ITU-T Rec. F.703: Multimedia conversational services &lt;<link url=""></link>&gt;.</note> Total Conversation standard for simultaneous voice, video, and real-time text.</li>
  187. <li>Be a candidate technology for use with next generation emergency services (e.g., 9-1-1 and 1-1-2).</li>
  188. <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>
  189. </ol>
  190. </section2>
  191. </section1>
  192. <section1 topic="Glossary" anchor="glossary">
  193. <dl><di><dt>action element</dt><dd>An XML element that represents a single real-time message edit, such as text insertion or deletion.</dd></di>
  194. <di><dt>character</dt><dd>A single Unicode code point. See <link url="#unicode_character_counting">Unicode Character Counting</link>.</dd></di>
  195. <di><dt>real-time</dt><dd>A conversational latency of less than 1 second, as defined by <span class="ref"><strong><link url="">ITU-T Rec. F.700</link></strong></span>
  196. <note>ITU-T Rec. F.700: Framework Recommendation for multimedia services &lt;<link url=""></link>&gt;.</note>, section</dd></di>
  197. <di><dt>real-time text</dt><dd>Text transmitted instantly while it is being typed or created, to allow recipient(s) to immediately read the sender's text as it is written, without waiting.</dd></di>
  198. <di><dt>real-time message</dt><dd>Recipient's real-time view of the sender's message still being typed or created.</dd></di>
  199. <di><dt>RTT</dt><dd>Acronym for real-time text.</dd></di>
  200. <di><dt>simultaneous login</dt><dd>Multiple simultaneous sessions, on multiple clients, using the same login (Jabber Identifier).</dd></di></dl>
  201. </section1>
  202. <section1 topic="Protocol" anchor="protocol">
  203. <section2 topic="RTT Element" anchor="rtt_element">
  204. <p>Real-time text is transmitted via an &lt;rtt/&gt; child element of a &lt;message/&gt; stanza. The &lt;rtt/&gt; element is transmitted at regular intervals by the sender client while a message is being composed. This allows the recipient to see the latest message text from the sender, without waiting for the full message to be sent in a &lt;body/&gt; element.</p>
  205. <p>This is a basic example of a <strong>real-time message</strong> "Hello, my Juliet!” transmitted in real-time while it is being typed, before a final message delivery in a &lt;body/&gt; element (to remain <link url="#backwards_compatible">Backwards Compatible</link>):</p>
  206. <p><strong>Example 1: Introductory Example</strong></p>
  207. <code><![CDATA[<message to='juliet@capulet.lit' from='romeo@montague.lit/orchard' type='chat' id='a01'>
  208. <rtt xmlns='urn:xmpp:rtt:0' seq='0' event='new'>
  209. <t>Hello, </t>
  210. </rtt>
  211. </message>
  212. <message to='juliet@capulet.lit' from='romeo@montague.lit/orchard' type='chat' id='a02'>
  213. <rtt xmlns='urn:xmpp:rtt:0' seq='1'>
  214. <t>my J</t>
  215. </rtt>
  216. </message>
  217. <message to='juliet@capulet.lit' from='romeo@montague.lit/orchard' type='chat' id='a03'>
  218. <rtt xmlns='urn:xmpp:rtt:0' seq='2'>
  219. <t>uliet!</t>
  220. </rtt>
  221. </message>
  222. <message to='juliet@capulet.lit' from='romeo@montague.lit/orchard' type='chat' id='a04'>
  223. <body>Hello, my Juliet!</body>
  224. </message>]]></code>
  225. <p>The &lt;rtt/&gt; element contains one or more child elements that represent <link url="#realtime_text_actions">Real-Time Text Actions</link> such as text being appended, inserted, or deleted. Example 1 illustrates only the &lt;t/&gt; <strong>action element</strong>, which appends text to the end of a message.</p>
  226. <p>Transmission of the &lt;rtt/&gt; element occurs at a regular <link url="#transmission_interval">Transmission Interval</link> whenever the sender is actively composing a message. If there are no changes to the message since the last transmission, no transmission occurs.</p>
  227. <p>There MUST NOT be more than one &lt;rtt/&gt; element per &lt;message/&gt; stanza.</p>
  228. <p>The namespace of the &lt;rtt/&gt; element is “urn:xmpp:rtt:0”.</p>
  229. </section2>
  230. <section2 topic="RTT Attributes" anchor="rtt_attributes">
  231. <section3 topic="seq" anchor="seq">
  232. <p>This REQUIRED attribute is a counter to maintain synchronization of real-time text. Senders MUST increment this value by 1 for each subsequent edit to the same real-time message, including when appending new text. Receiving clients MUST monitor this 'seq' value as a lightweight verification on the synchronization of real-time text messages. The bounds of 'seq' is 31-bits, the range of positive values for a signed 32-bit integer. See <link url="#keeping_realtime_text_synchronized">Keeping Real-Time Text Synchronized</link>.</p>
  233. </section3>
  234. <section3 topic="event" anchor="event">
  235. <p>This attribute signals events for real-time text.</p>
  236. <table>
  237. <tr>
  238. <th>event</th>
  239. <th>Description</th>
  240. <th>Action&#160;Elements</th>
  241. <th>Sender&#160;Support</th>
  242. <th>Recipient&#160;Support</th>
  243. </tr>
  244. <tr>
  245. <td>new</td>
  246. <td>Begin a new real-time message.</td>
  247. <td>Yes</td>
  248. <td><strong>REQUIRED</strong></td>
  249. <td><strong>REQUIRED</strong></td>
  250. </tr>
  251. <tr>
  252. <td>reset</td>
  253. <td>Re-initialize the real-time message.</td>
  254. <td>Yes</td>
  255. <td>RECOMMENDED</td>
  256. <td><strong>REQUIRED</strong></td>
  257. </tr>
  258. <tr>
  259. <td>edit</td>
  260. <td>Modify existing real-time message.</td>
  261. <td>Yes</td>
  262. <td>OPTIONAL</td>
  263. <td><strong>REQUIRED</strong></td>
  264. </tr>
  265. <tr>
  266. <td>init</td>
  267. <td>Signals activation of real-time text.</td>
  268. <td>No</td>
  269. <td>OPTIONAL</td>
  270. <td>RECOMMENDED</td>
  271. </tr>
  272. <tr>
  273. <td>cancel</td>
  274. <td>Signals deactivation of real-time text.</td>
  275. <td>No</td>
  276. <td>OPTIONAL</td>
  277. <td>RECOMMENDED</td>
  278. </tr>
  279. </table>
  280. <p>If the 'event' attribute is omitted, event="edit" is assumed as the default. When <link url="#action_elements">Action Elements</link> are used (e.g., text appends, insertions and deletions), the &lt;rtt/&gt; element MAY contain one or more of any action elements, in any order. When action elements are not allowed, the &lt;rtt/&gt; element MUST be empty. Recipient clients MUST ignore &lt;rtt/&gt; elements containing unrecognized 'event' values.</p>
  281. </section3>
  282. <section3 topic="id" anchor="id">
  283. <p>This attribute is used only if &xep0308; is implemented along with this specification. See <link url="#usage_with_last_message_correction">Usage with Last Message Correction</link> to enable real-time text during editing of the previous message.</p>
  284. </section3>
  285. </section2>
  286. <section2 topic="Processing Rules" anchor="processing_rules">
  287. <ul>
  288. <li><p><strong>Initialize a new real-time message: &lt;rtt event="new"/&gt; and &lt;rtt event="reset"/&gt;</strong></p>
  289. <p>Sender clients MUST use an &lt;rtt/&gt; element containing either event="new" or event="reset" in the first transmission of a new real-time message. Recipient clients MUST initialize a new blank real-time message for display, and then process all <link url="#action_elements">Action Elements</link> (e.g., text insertions and deletions) included within the &lt;rtt/&gt; element. If a real-time message already exists from the same sender in the same chat session, its content MUST be seamlessly replaced (i.e., cleared prior to immediately processing action elements).</p></li>
  290. <li><p><strong>Both &lt;rtt event="new"/&gt; and &lt;rtt event="reset"/&gt; are logically identical to recipients, except for presentation:</strong></p>
  291. <p>For recipients, these differ only for optional presentation purposes (e.g., highlighting newly started incoming messages). Senders SHOULD use event="new" when sending the first text of a new message (e.g., the first key presses), and only use event="reset" when doing <link url="#message_refresh">Message Refresh</link> or <link url="#simple_realtime_text">Simple Real-Time Text</link>. See <link url="#keeping_realtime_text_synchronized">Keeping Real-Time Text Synchronized</link>.</p></li>
  292. <li><p><strong>Sending modifications of a real-time message: Outgoing &lt;rtt event="edit"/&gt; or &lt;rtt/&gt;</strong></p>
  293. <p>Sender clients SHOULD transmit this element at a regular <link url="#transmission_interval">Transmission Interval</link> while the message is being modified. The 'seq' attribute MUST increment by 1 for every consecutive modification transmitted. See <link url="#sending_realtime_text">Sending Real-Time Text</link>.</p></li>
  294. <li><p><strong>Receiving modifications of a real-time message: Incoming &lt;rtt event="edit"/&gt; or &lt;rtt/&gt;</strong></p>
  295. <p>Recipient clients must verify that the 'seq' attribute increments by 1 in consecutively received &lt;rtt/&gt; elements from the same sender. If 'seq' increments as expected, the <link url="#action_elements">Action Elements</link> (e.g., text insertions and deletions) included with this element MUST be processed to modify the existing real-time message. Otherwise, if 'seq' does not increment as expected, or if no real-time message already exists, the real-time message is considered out of sync and all subsequent modifications MUST be ignored until a new real-time message is initialized via event="new" or event="reset". See <link url="#keeping_realtime_text_synchronized">Keeping Real-Time Text Synchronized</link>.</p></li>
  296. <li><p><strong>Committing a real-time message: Delivery of a &lt;body/&gt; element</strong></p>
  297. <p>A real-time message is considered complete upon receiving &lt;body/&gt;. See <link url="#body_element">Body Element</link>.</p></li>
  298. <li><p><strong>Starting real-time text: &lt;rtt event="init"/&gt;</strong></p>
  299. <p>Clients MAY use this value to signal activation of real-time text without first starting a real-time message, since the sender may not start composing immediately. The 'seq' attribute is ignored by recipient clients. See <link url="#guidelines_for_initiating_realtime_text">Guidelines for Initiating Real-Time Text</link>.</p></li>
  300. <li><p><strong>Ending real-time text: &lt;rtt event="cancel"/&gt;</strong></p>
  301. <p>Clients MAY use this value to signal deactivation of real-time text. Clients receiving this element SHOULD also discontinue sending &lt;rtt/&gt; elements for the remainder of the same one-to-one chat session (until event="init" is used again), and handle any unfinished real-time messages appropriately (e.g., clearing or saving the message). The 'seq' attribute is ignored by recipient clients. See <link url="#guidelines_for_initiating_realtime_text">Guidelines for Initiating Real-Time Text</link>.</p></li>
  302. <li><p><strong>Starting value for seq attribute:</strong></p>
  303. <p>Sender clients MAY use any new starting value for 'seq' when initializing a real-time message using event="new" or event="reset". Recipient clients receiving such elements MUST use this 'seq' value as the new starting value. A random starting value is RECOMMENDED to improve reliability of <link url="#keeping_realtime_text_synchronized">Keeping Real-Time Text Synchronized</link> during <link url="#usage_with_multiuser_chat">Usage with Multi-User Chat</link> and <link url="#simultaneous_logins">Simultaneous Logins</link>.</p></li>
  304. </ul>
  305. </section2>
  306. <section2 topic="Body Element" anchor="body_element">
  307. <p>The real-time message is considered complete upon receipt of a standard &lt;body/&gt; element (as qualified by the 'jabber:client' namespace in &xmppim;). The delivered text within &lt;body/&gt; is considered the final message text, and supersedes the real-time message. In the ideal case, the text within &lt;body/&gt; is redundant since it is identical to the final contents of the real-time message.</p>
  308. <p>Sender clients MAY transmit the &lt;body/&gt; element in the same or separate &lt;message/&gt; stanza as the one containing the final &lt;rtt/&gt; element for the real-time message. To continue sending real-time text in subsequent &lt;message/&gt; stanzas, the sender client MUST first initialize a new real-time message according to <link url="#processing_rules">Processing Rules</link>.</p>
  309. <section3 topic="Backwards Compatible" anchor="backwards_compatible">
  310. <p>This real-time text standard simply provides early delivery of text before the &lt;body/&gt; element. The &lt;body/&gt; element continues to follow the XMPP IM 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>
  311. </section3>
  312. </section2>
  313. <section2 topic="Transmission Interval" anchor="transmission_interval">
  314. <p>For the best balance between interoperability and usability, the default transmission interval of &lt;rtt/&gt; elements for a continuously-changing message SHOULD be approximately <strong>700 milliseconds</strong>. This interval makes it possible for clients to meet <strong>ITU-T Rec. F.700</strong> Section A.3.2.1 for good quality real-time text conversation in many network environments. If a different transmission interval needs to be used, the interval SHOULD be <strong>between 300 and 1000 milliseconds</strong>.</p>
  315. <p>A longer interval will lead to a less optimal user experience. Conversely, a much shorter interval can lead to <link url="#congestion_considerations">Congestion Considerations</link>. To provide fluid real-time text, one or more of the following methods can be used:</p>
  316. <ul>
  317. <li><link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link> for natural typing display, independently of the transmission interval.</li>
  318. <li>Use of <link url="#time_critical_and_low_latency_methods">Time Critical and Low Latency Methods</link>, for real-time captioning/speech transcription.</li>
  319. <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>
  320. </ul>
  321. </section2>
  322. <section2 topic="Real-Time Text Actions" anchor="realtime_text_actions">
  323. <p>The &lt;rtt/&gt; element MAY contain one or more <strong>action elements</strong> representing real-time text operations, including text being appended, inserted, or deleted.</p>
  324. <p>Many chat clients allow a sender to edit their message before sending (via a Send button, or pressing Enter). The seamless inclusion of real-time text functionality, in existing client software, needs to preserve the sender's existing expectation of being able to edit their messages. In a chat session with real-time text, the recipient can see the sender compose and edit their message before it is completed.</p>
  325. <section3 topic="Action Elements" anchor="action_elements">
  326. <p>This is a short summary of action elements that operate on a real-time message.</p>
  327. <table>
  328. <tr>
  329. <th>Action</th>
  330. <th>Element</th>
  331. <th>Description</th>
  332. <th>Sender&#160;Support</th>
  333. <th>Recipient&#160;Support</th>
  334. </tr>
  335. <tr>
  336. <td>Insert&#160;Text</td>
  337. <td>&lt;t&#160;p='#'&gt;text&lt;/t&gt;</td>
  338. <td>Insert specified <strong>text</strong> at position 'p' in message.</td>
  339. <td><strong>REQUIRED</strong></td>
  340. <td><strong>REQUIRED</strong></td>
  341. </tr>
  342. <tr>
  343. <td>Erase&#160;Text</td>
  344. <td>&lt;e&#160;p='#'&#160;n='#'/&gt;</td>
  345. <td>Remove 'n' characters before position 'p' in message<em>.</em></td>
  346. <td>RECOMMENDED</td>
  347. <td><strong>REQUIRED</strong></td>
  348. </tr>
  349. <tr>
  350. <td>Wait&#160;Interval</td>
  351. <td>&lt;w&#160;n='#'/&gt;</td>
  352. <td>Wait 'n' milliseconds.</td>
  353. <td>RECOMMENDED</td>
  354. <td>RECOMMENDED</td>
  355. </tr>
  356. </table>
  357. <p>These elements are kept compact in order to save bandwidth, since a single &lt;rtt/&gt; element can contain a large number of action elements (e.g., during <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>). See <link url="#list_of_action_elements">List of Action Elements</link> for details.</p>
  358. </section3>
  359. <section3 topic="Attribute Values" anchor="attribute_values">
  360. <ul>
  361. <li><p>For <link url="#element_e_erase_text">Element &lt;e/&gt; – Erase Text</link>:<br />
  362. The 'n' attribute is a length value, in number of characters. If 'n' is omitted, the default value of 'n' MUST be “1”.</p></li>
  363. <li><p>For <link url="#element_t_insert_text">Element &lt;t/&gt; – Insert Text</link> and <link url="#element_e_erase_text">Element &lt;e/&gt; – Erase Text</link>:<br />
  364. The 'p' attribute is an absolute position value, as a character position index into the real-time message, where “0” represents the beginning of the message. If 'p' is omitted, the default value of 'p' MUST point to the end of the message (i.e., 'p' is set to the current length of the real-time message).</p></li>
  365. <li><p>For the purpose of this specification, the word "character" represents a single Unicode code point. See <link url="#unicode_character_counting">Unicode Character Counting</link>.</p></li>
  366. <li><p>Senders MUST NOT use negative values for any attribute, nor use 'p' values bigger than the current message length. However, recipients receiving such values MUST clip negative values to “0”, and clip excessively high 'p' values to the current length of the real-time message. Modifications only occur within the boundaries of the current real-time message.</p></li>
  367. </ul>
  368. </section3>
  369. <section3 topic="List of Action Elements" anchor="list_of_action_elements">
  370. <p>Recipients MUST be able to process all &lt;t/&gt; and &lt;e/&gt; action elements for incoming &lt;rtt/&gt; transmissions, even if senders do not use all of these for outgoing &lt;rtt/&gt; transmissions (e.g., <link url="#simple_realtime_text">Simple Real-Time Text</link>). Support for &lt;w/&gt; 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 &lt;rtt/&gt;, 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 &lt;rtt/&gt; element, and are never nested. See examples in <link url="#use_cases">Use Cases</link>.</p>
  371. <section4 topic="Element &lt;t/&gt; – Insert Text" anchor="element_t_insert_text">
  372. <p>Supports the transmission of text, including key presses, and text block inserts.<br />
  373. <em>Note: Text can be any</em> <em>subset of text allowed in the &lt;body/&gt; element of a &lt;message/&gt;. If &lt;t/&gt; is empty or blank, no text modification takes place.</em></p>
  374. <code><![CDATA[<t>text</t>]]></code>
  375. <p>Append specified <strong>text</strong> at the end of message. ('p' defaults to message length).<br />
  376. <em>Note: This action element is the minimum support REQUIRED for sender clients (i.e., speech transcription, chat bots, and <link url="#simple_realtime_text">Simple Real-Time Text</link> are still possible without supporting additional action elements).</em></p>
  377. <code><![CDATA[<t p='#'>text</t>]]></code>
  378. <p>Inserts specified <strong>text</strong> at position 'p' in the message text.</p>
  379. </section4>
  380. <section4 topic="Element &lt;e/&gt; – Erase Text" anchor="element_e_erase_text">
  381. <p>Supports the behavior of backspace key presses. Text is removed towards beginning of the message. This element is also used for all delete operations, including the backspace key, the delete key, and text block deletes.<br />
  382. <em>Note: Excess backspaces MUST be ignored by the receiving client. Thus, text is backspaced only to the beginning of the message, in situations where n is larger than p.</em></p>
  383. <code><![CDATA[<e/>]]></code>
  384. <p>Remove 1 character from end of message. ('n' defaults to “1”, and 'p' defaults to message length)</p>
  385. <code><![CDATA[<e p='#'/>]]></code>
  386. <p>Remove 1 character before character position 'p' in message. ('n' defaults to “1”)</p>
  387. <code><![CDATA[<e n='#'/>]]></code>
  388. <p>Remove 'n' characters from end of message. ('p' defaults to message length)</p>
  389. <code><![CDATA[<e n='#' p='#'/>]]></code>
  390. <p>Remove 'n' characters before character position 'p' in message.</p>
  391. </section4>
  392. <section4 topic="Element &lt;w/&gt; – Wait Interval" anchor="element_w_wait_interval">
  393. <p>Allow for the transmission of intervals, between real-time text actions, to recreate the pauses between key presses. See <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>.</p>
  394. <code><![CDATA[<w n='#'/>]]></code>
  395. <p>Wait 'n' milliseconds before processing the next action element. This pause MAY be approximate, and not necessarily be of millisecond precision. Sender clients SHOULD NOT send large 'n' values that exceed the average <link url="#transmission_interval">Transmission Interval</link>. Recipient clients MAY selectively shorten or ignore the pauses ('n') in &lt;w/&gt; action elements to avoid lag in a chat session. Situations such as network congestion can result in a surge of &lt;w/&gt; elements where the total of pauses exceeds a transmission interval cycle. See <link url="#receiving_realtime_text">Receiving Real-Time Text</link>.</p>
  396. </section4>
  397. </section3>
  398. </section2>
  399. <section2 topic="Keeping Real-Time Text Synchronized" anchor="keeping_realtime_text_synchronized">
  400. <p>During a chat session, real-time text needs to be identical on both the sender and recipient ends. A missing &lt;rtt/&gt; transmission can represent missing text or missing edits. Also, recipients can connect after the sender has already started composing a message. To address this, a <link url="#message_refresh">Message Refresh</link> mechanism allows recipient clients to recover the sender's real-time message that is actively in-progress. This synchronizes real-time text in many situations, including:</p>
  401. <ul>
  402. <li>After recipient client reconnections (e.g., due to wireless reception, due to user restarting client).</li>
  403. <li>After recipient client discarded <link url="#stale_messages">Stale Messages</link> (e.g., sender resumes composing hours later).</li>
  404. <li><link url="#simultaneous_logins">Simultaneous Logins</link> (e.g., user switching between devices/clients or between windows/tabs in a client).</li>
  405. <li>During <link url="#usage_with_multiuser_chat">Usage with Multi-User Chat</link> (e.g., participants joining/leaving while other participants are composing).</li>
  406. <li>After message stanzas are lost in transit (e.g., <link url="#congestion_considerations">Congestion Considerations</link>).</li>
  407. </ul>
  408. <p>Recipient clients MUST keep track of separate real-time messages on a per-contact basis, including tracking independent '<link url="#seq">seq</link>' attribute values. Recipient clients MAY track incoming &lt;rtt/&gt; elements per bare JID &LOCALBARE; to keep only one real-time message per contact. The remainder of this section automatically handles conflicting &lt;rtt/&gt; elements (e.g., typing coming concurrently from separate <link url="#simultaneous_logins">Simultaneous Logins</link>, contrary to the common case of one typist per contact). Alternatively, recipient clients MAY track incoming &lt;rtt/&gt; elements per full JID &LOCALFULL; and/or per &lt;thread/&gt;, to keep multiple separate real-time messages for the same contact. For more information about &lt;thread/&gt;, see &xep0201;.</p>
  409. <section3 topic="Staying In Sync" anchor="staying_in_sync">
  410. <p>By following <link url="#processing_rules">Processing Rules</link>, the recipient client creates a new real-time message when receiving &lt;rtt event="new"/&gt; or &lt;rtt event="reset"/&gt;. Thereafter, when receiving text modifications (i.e., &lt;rtt event="edit"/&gt; or &lt;rtt/&gt; without an 'event' attribute):</p>
  411. <ol>
  412. <li>There MUST be an existing real-time message (created via &lt;rtt event="new"/&gt; or &lt;rtt event="reset"/&gt;);</li>
  413. <li>Senders MUST increment the 'seq' attribute in steps of 1, for consecutively transmitted text modifications.</li>
  414. <li>Recipients MUST verify that the 'seq' attribute is incrementing by 1, for consecutively received text modifications.</li>
  415. </ol>
  416. </section3>
  417. <section3 topic="Recovery From Loss of Sync" anchor="recovery_from_loss_of_sync">
  418. <p>Loss of sync occurs during receiving text modifications if the 'seq' attribute does not increment by 1 as expected, or if no real-time message exists. In this case:</p>
  419. <ul>
  420. <li>Recipients MUST keep the real-time message unchanged (if any exists); and</li>
  421. <li>Recipients MUST ignore subsequent text modifications (i.e., &lt;rtt event="edit"/&gt; or &lt;rtt/&gt; without an 'event' attribute); and</li>
  422. <li>An indication can be used to show the loss of sync (e.g., color coding, modified chat state message).</li>
  423. </ul>
  424. <p>Recovery occurs when the recipient receives the following:</p>
  425. <ul>
  426. <li>A &lt;body/&gt; element. The <link url="#body_element">Body Element</link> supersedes the real-time message.</li>
  427. <li>An &lt;rtt/&gt; element with an 'event' attribute of 'new' or 'reset' (e.g., new message, or <link url="#message_refresh">Message Refresh</link>).</li>
  428. </ul>
  429. </section3>
  430. <section3 topic="Message Refresh" anchor="message_refresh">
  431. <p>A message refresh is the sender's partially composed text being (re)transmitted via &lt;rtt event="reset"/&gt;. The recipient client(s) can seamlessly redisplay the real-time message as a result. This allows real-time text to resume quickly, without waiting for senders to start a new message:</p>
  432. <code><![CDATA[<rtt event='reset' seq='#' xmlns='urn:xmpp:rtt:0'>
  433. <t>This is a retransmission of the entire real-time message.</t>
  434. </rtt>]]></code>
  435. <p>The message refresh SHOULD be transmitted at intervals during active typing or composing. The RECOMMENDED interval is 10 seconds. This interval is frequent enough to minimize user waiting time, while being infrequent enough to not cause a significant bandwidth overhead. This interval can be varied, or be set to a longer time period, in order to reduce average bandwidth (e.g., long messages, infrequent or minor message changes). To save bandwidth, message refreshes SHOULD NOT occur continuously while the sender is idle. To allow quicker resumption of real-time text, sender clients MAY adjust the timing of the message refresh to occur right after any of the following additional events:</p>
  436. <ul>
  437. <li>When the recipient starts sending messages from a different full JID (e.g., switched clients);</li>
  438. <li>When the recipient presence changes to a more available state (e.g., &lt;show/&gt; value of “chat”);</li>
  439. <li>When the sender resumes composing after an extended pause (e.g., recipient may have cleared <link url="#stale_messages">Stale Messages</link>);</li>
  440. <li>When the conversation is unlocked (e.g., section 5.1 of XMPP IM);</li>
  441. </ul>
  442. <p>If the recipient already has an existing real-time message from the sender, <link url="#processing_rules">Processing Rules</link> require that the real-time message MUST be seamlessly replaced. Thus, if the recipient is successfully <link url="#staying_in_sync">Staying In Sync</link>, the recipient user sees no visible effect since the text contained within &lt;rtt event="reset"/&gt; is a duplicate of the existing real-time message. If the recipient client was out of sync (<link url="#recovery_from_loss_of_sync">Recovery From Loss of Sync</link>) or it has no real-time message, the recipient user sees the real-time message immediately “catch up”.</p>
  443. <p>Note: The use of &lt;rtt event="reset"/&gt; is not limited to message refresh, as it can contain any number of <link url="#action_elements">Action Elements</link> in any order. Sender clients MAY combine a message refresh with additional action elements (e.g., re-transmitting a whole message in one <link url="#element_t_insert_text">Element &lt;t/&gt; – Insert Text</link>, followed by some additional action elements, such as additional typing or backspacing, to seamlessly allow <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>).</p>
  444. </section3>
  445. </section2>
  446. <section2 topic="Accurate Processing of Action Elements" anchor="accurate_processing_of_action_elements">
  447. <p>Real-time text is generated based on text normally allowed to be transmitted within the &lt;body/&gt; element.</p>
  448. <p>Incorrectly generated <link url="#action_elements">Action Elements</link> and <link url="#attribute_values">Attribute Values</link> can lead to inconsistencies between the sender and recipient during real-time editing. The Unicode characters of the real-time text need to be transmitted unaltered from the sender to the recipient, without unexpected modifications after sender pre-processing. This is the chain between the sender's creation of real-time text, to the recipient's processing of real-time text. Unaltered 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>
  449. <p>If unexpected Unicode inconsistencies occur during real-time message editing, the recipient client will normally recover the message upon receiving a <link url="#body_element">Body Element</link> or a <link url="#message_refresh">Message Refresh</link>.</p>
  450. <section3 topic="Unicode Character Counting" anchor="unicode_character_counting">
  451. <p>For this specification, a "character" represents a single Unicode code point. This is the same definition used in section 1.1 of <span class="ref"><strong><link url="">RFC 5198</link></strong></span>
  452. <note>RFC 5198: Unicode Format for Network Interchange &lt;<link url=""></link>&gt;.</note>. For platform-independent interoperability of <link url="#action_elements">Action Elements</link>, calculations on <link url="#attribute_values">Attribute Values</link> (<em><strong>p</strong></em> and <em><strong>n</strong></em>) MUST be based on counts of Unicode code points.</p>
  453. <p>Many platforms use different internal encodings (i.e., string formats) that are different from the transmission encoding (UTF-8). These factors need to be considered:</p>
  454. <ul>
  455. <li><p>Multiple Unicode code points (e.g., combining marks, accents) can form a combining character sequence. This can occur in situations where there isn't a visually equivalent composite character of a single code point (e.g., when doing Unicode normalization).<br />
  456. <em>Action elements operate on Unicode code points individually.</em></p></li>
  457. <li><p>Unicode code points U+10000 through U+10FFFF are represented as a surrogate pair in some Unicode encodings (e.g., UTF-16).<br />
  458. <em>Action elements operate on Unicode code points as a whole, not on separate components of a surrogate pair.</em></p></li>
  459. <li><p>XMPP transmission uses UTF-8, which uses a variable number of bytes per Unicode code point.<br /><em>Action elements operate on Unicode code points as a whole, not on separate bytes.</em></p></li>
  460. </ul>
  461. <p>Lengths and positions in <link url="#attribute_values">Attribute Values</link> are relative to the internal Unicode text of the real-time message, independently of the directionality of actual displayed text. As a result, any valid Unicode text direction can be used with real-time text (right-to-left, left-to-right, and bidirectional). One way for implementers to visualize this, is to simply visualize Unicode text as an array of individual code points, and treat <link url="#attribute_values">Attribute Values</link> as array indexes.</p>
  462. </section3>
  463. <section3 topic="Guidelines for Senders" anchor="guidelines_for_senders">
  464. <p>Sender clients MUST generate real-time text (<link url="#action_elements">Action Elements</link> and <link url="#attribute_values">Attribute Values</link>) based on the plain text version of the sender's message with pre-processing completed. This is separate from and concurrent to any displayed presentation of the same message (e.g., formatting, emoticon graphics, &xep0071;).</p>
  465. <p>Pre-processing before generating real-time text includes Unicode normalization, conversion of emoticons graphics to text, removal of illegal characters, line-break conversion, and any other necessary text modifications. For Unicode normalization, sender clients SHOULD ensure the message is in <span class="ref"><strong><link url="">Unicode Normalization Form C</link></strong></span>
  466. <note>Unicode Standard Annex #15: Unicode Normalization Forms &lt;<link url=""></link>&gt;.</note> ("NFC"), as recommended within section 3 of <strong>RFC 5198</strong>, and within many other standards such as Canonical XML 1.0.</p>
  467. <p>If Unicode combining character sequences (e.g., letter with multiple accents) are used for <link url="#element_t_insert_text">Element &lt;t/&gt; – Insert Text</link>, then complete combining character sequences SHOULD be sent. In situations where modifications are required to an existing combining character sequence (e.g., adding an additional accent), an <link url="#element_e_erase_text">Element &lt;e/&gt; – Erase Text</link> SHOULD be used to delete the existing combining character sequence, before transmitting a complete replacement sequence via the &lt;t/&gt; element. (However, recipients SHOULD NOT assume this behavior from sending clients. See <link url="#guidelines_for_recipients">Guidelines for Recipients</link>.)</p>
  468. <p>For the purpose of calculating <link url="#attribute_values">Attribute Values</link>, any line breaks MUST be treated as a single character. 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="">XML</link></strong></span>
  469. <note>XML: Extensible Markup Language 1.0 (Fifth Edition) &lt;<link url=""></link>&gt;.</note>.</p>
  470. </section3>
  471. <section3 topic="Guidelines for Recipients" anchor="guidelines_for_recipients">
  472. <p>For <link url="#element_t_insert_text">Element &lt;t/&gt; – Insert Text</link>, text MUST be obtained using compliant XML processing (including entities converted to characters). Recipient clients SHOULD ensure that the received text is in Unicode Normalization Form C ("NFC"). After this, recipient clients MUST NOT do any other modifications to resulting real-time messages. This is to allow accurate processing of subsequent <link url="#action_elements">Action Elements</link> and <link url="#attribute_values">Attribute Values</link> (the recipient client can separately process/modify a copy of the same real-time message text, if necessary for the purpose of display presentation).</p>
  473. <p>It is possible for sender clients to send <link url="#element_t_insert_text">Element &lt;t/&gt; – Insert Text</link> with an incomplete combining character sequence (e.g., combining mark(s) without a Unicode base character). This is valid when extending an existing combining character sequence into a longer valid complete combining character sequence (e.g., adding an additional accent mark). It is also possible for senders to send <link url="#element_e_erase_text">Element &lt;e/&gt; – Erase Text</link> to remove code points from an existing combining character sequence, into a shorter valid complete combining character sequence (e.g., removing an accent mark). In all cases, recipient clients MUST process these elements in accordance to <link url="#action_elements">Action Elements</link>.</p>
  474. </section3>
  475. </section2>
  476. </section1>
  477. <section1 topic="Determining Support" anchor="determining_support">
  478. <p>If a client supports this real-time text protocol, it MUST advertise that fact in its responses to &xep0030; information requests ("disco#info") by returning a feature of ‘<strong>urn:xmpp:rtt:0</strong>’.</p>
  479. <p><strong>Example 1. A disco#info query</strong></p>
  480. <code><![CDATA[<iq from='romeo@montague.lit/orchard'
  481. id='disco1'
  482. to='juliet@capulet.lit/balcony'
  483. type='get'>
  484. <query xmlns=''/>
  485. </iq>
  486. ]]></code>
  487. <p><strong>Example 2. A disco#info response</strong></p>
  488. <code><![CDATA[<iq from='juliet@capulet.lit/balcony'
  489. id='disco1'
  490. to='romeo@montague.lit/orchard'
  491. type='result'>
  492. <query xmlns=''>
  493. <feature var='urn:xmpp:rtt:0'/>
  494. </query>
  495. </iq>
  496. ]]></code>
  497. <p>In order for an application to determine whether an entity supports this protocol, where possible it SHOULD use the dynamic, presence-based profile of service discovery defined in &xep0115;. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.</p>
  498. <p>See <link url="#guidelines_for_initiating_realtime_text">Guidelines for Initiating Real-Time Text</link> for more information, including implicit discovery.</p>
  499. <section2 topic="Support for Groupchat" anchor="support_for_groupchat">
  500. <p>Real-time text MAY also be used with <strong>Multi-User Chat</strong>. Before transmitting &lt;rtt/&gt; elements to a groupchat room, clients MUST follow section 17.1.1 of <strong>XEP-0045</strong> to verify that the service allows any extension or that ‘urn:xmpp:rtt:0’ is listed as an allowable namespace.</p>
  501. <p>Services explicitly allowing this extension MUST follow section 17.1.1 of <strong>XEP-0045</strong> to include ‘urn:xmpp:rtt:0’ as an allowable namespace.</p>
  502. <p>See <link url="#usage_with_multiuser_chat">Usage with Multi-User Chat</link>.</p>
  503. </section2>
  504. </section1>
  505. <section1 topic="Guidelines for Initiating Real-Time Text" anchor="guidelines_for_initiating_realtime_text">
  506. <p>Some clients can choose to send outgoing real-time text at all times by default. Other clients might choose to do user-initiated activation (e.g., via a button). These guidelines provide interoperability between clients that use different methods of initiating real-time text.</p>
  507. <section2 topic="Activating Real-Time Text" anchor="activating_realtime_text">
  508. <p>In the simplest case, sender clients MAY simply begin transmitting real-time text (i.e., send &lt;rtt/&gt; elements) upon determining support.</p>
  509. <p>For one-to-one chats, it can be beneficial for clients to easily synchronize the enabling/disabling of real-time text. Upon receiving incoming real-time text, recipient clients MAY automatically do an appropriate response, such as:</p>
  510. <ul>
  511. <li>Activate immediately (begin transmitting &lt;rtt/&gt; elements too); or</li>
  512. <li>Activate after user confirmation prompt (for <link url="#privacy">Privacy</link> considerations); or</li>
  513. <li>Deny (transmit &lt;rtt event="cancel"/&gt;); or</li>
  514. <li>Ignore (discard incoming &lt;rtt/&gt; elements); or</li>
  515. <li>Display only incoming real-time text (e.g., <link url="#usage_with_multiuser_chat">Usage with Multi-User Chat</link> participants control their own outgoing real-time text).</li>
  516. </ul>
  517. <p>To prevent transmission loops, senders SHOULD NOT transmit &lt;rtt event="init"/&gt; automatically in response to incoming &lt;rtt event="init"/&gt;. Upon sending any &lt;rtt/&gt; elements (except &lt;rtt event="cancel"/&gt;), real-time text is considered activated on the sender side and it is not necessary to transmit &lt;rtt event="init"/&gt; again for the chat session while real-time text is active.</p>
  518. <p>For any client, the preferred first &lt;rtt/&gt; element to send is &lt;rtt <link url="#event">event</link>="init"/&gt; as it can quickly signal activation of real-time text, without waiting for the sender to begin composing a new message, and since it is usable regardless of discovery. Also, if the sender was already composing a message when activating real-time text, <link url="#message_refresh">Message Refresh</link> handles this situation.</p>
  519. <p>While explicit discovery is REQUIRED where possible (see <link url="#determining_support">Determining Support</link>), it is not possible to use explicit discovery when the sender does not share a presence subscription with the the contact and knows only their bare JID (e.g., they have yet to receive stanzas from the contact). In this case, the sender client MAY implicitly request and discover the use of real-time text, by sending &lt;rtt event="init"/&gt; upon activation. Senders SHOULD NOT send any further &lt;rtt/&gt; elements, until support is confirmed either by incoming &lt;rtt/&gt; elements or via discovery. Implicit discovery makes it possible to use real-time text as an enhancement to &xep0085; (Section 5.1), during all situations where it can be used (e.g., when an actively-composing sender appears invisible/offline to the recipient). See <link url="#usage_with_chat_states">Usage with Chat States</link>.</p>
  520. </section2>
  521. <section2 topic="Deactivating Real-Time Text" anchor="deactivating_realtime_text">
  522. <p>Real-time text MAY be deactivated by transmitting &lt;rtt <link url="#event">event</link>="cancel"/&gt;, or simply by ending the chat session. Recipient clients SHOULD respond to deactivation with appropriate response(s), including:</p>
  523. <ul>
  524. <li>Stop transmitting &lt;rtt/&gt; elements as well (not applicable to <link url="#usage_with_multiuser_chat">Usage with Multi-User Chat</link>); and</li>
  525. <li>Handle the sender's unfinished incoming real-time message; and</li>
  526. <li>Inform the recipient user that sender ended real-time text (or denied/cancelled, if no real-time text was received).</li>
  527. </ul>
  528. <p>Any client MAY also send an &lt;rtt event="cancel"/&gt; when ending the chat session (e.g., user closes a chat window) or when deactivating real-time text while continuing the chat session. Clients receiving &lt;rtt event="cancel"/&gt; do not need to also transmit &lt;rtt event="cancel"/&gt; back.</p>
  529. <p>Senders deactivating real-time text while in the middle of composing a message can continue composing their message without real-time text being sent. Completed messages continue to be transmitted normally via the <link url="#body_element">Body Element</link>. Recipients that no longer receive further real-time updates, MAY handle the incomplete sender's real-time message appropriately (e.g., clearing/greying-out/saving the message, or using <link url="#stale_messages">Stale Messages</link> handling).</p>
  530. <p>After deactivation, any client MAY reactivate real-time text again using &lt;rtt event="init"/&gt;.</p>
  531. </section2>
  532. </section1>
  533. <section1 topic="Implementation Notes" anchor="implementation_notes">
  534. <section2 topic="Text Presentation" anchor="text_presentation">
  535. <section3 topic="Avoid Bursty Text Presentation" anchor="avoid_bursty_text_presentation">
  536. <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 incoming text will appear in intermittent bursts if the display of text is not smoothed. This hurts user experience of real-time text.</p>
  537. </section3>
  538. <section3 topic="Preserving Key Press Intervals" anchor="preserving_key_press_intervals">
  539. <p>For high quality presentation of real-time text, the original look-and-feel of typing can be preserved independently of the transmission interval. This is achieved using <link url="#element_w_wait_interval">Element &lt;w/&gt; – Wait Interval</link> between other <link url="#action_elements">Action Elements</link>. Sender clients can transmit the length of pauses between key presses, and send multiple key presses in a single &lt;message/&gt; stanza. Recipient clients that process &lt;w/&gt; elements are able to display the sender's typing smoothly without sudden bursts of text. See <link url="#examples_of_key_press_intervals">Examples of Key Press Intervals</link>.</p>
  540. <p>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.). Much as Voice over IP (VoIP) allows accurate packet transmission of sound, this spec allows accurate packet transmission of original typing look-and-feel. 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>
  541. </section3>
  542. <section3 topic="Time Critical and Low Latency Methods" anchor="time_critical_and_low_latency_methods">
  543. <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 demand low latency transmission. Such systems typically use voice recognition and/or stenotype machines, which output text in word or phrase bursts rather than a character at a time. It can be acceptable for senders with bursty output to immediately transmit word or phrase bursts of text without buffering, as long as the average stanza rate is not excessive. This eliminates any lag caused by the <link url="#transmission_interval">Transmission Interval</link>. It is not necessary to transmit <link url="#element_w_wait_interval">Element &lt;w/&gt; – Wait Interval</link> for real-time transcription.</p>
  544. </section3>
  545. <section3 topic="Low-Bandwidth and Low-Precision Text Smoothing" anchor="lowbandwidth_and_lowprecision_text_smoothing">
  546. <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_wait_interval">Element &lt;w/&gt; – Wait Interval</link> selectively, especially those containing shorter intervals. In addition, it is acceptable for the transmission interval of &lt;rtt/&gt; to vary, either intentionally for optimizations, or due to precision limitation, preferably within the range recommended by <link url="#transmission_interval">Transmission Interval</link>. Compression can also be used to reduce bandwidth (e.g., TLS compression or &xep0138;).</p>
  547. <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>
  548. </section3>
  549. </section2>
  550. <section2 topic="Optional Remote Cursor" anchor="optional_remote_cursor">
  551. <p>Recipient clients can choose to display a remote cursor within incoming real-time messages. A remote cursor is a separate cursor/caret indicator within incoming real-time messages, separate of the user's local cursor for outgoing messages. This can improve usability of real-time text, since it becomes easier for a recipient to observe the sender's real-time message edits. For clients that do not implement a remote cursor, skip this section.</p>
  552. <p><link url="#action_elements">Action Elements</link> use only absolute positioning (relative positions are not used by this specification), so clients do not need to remember the position value from previous action elements. Recipient software can calculate the remote cursor position as follows:</p>
  553. <ul>
  554. <li><p>Upon receiving <link url="#element_t_insert_text">Element &lt;t/&gt; – Insert Text</link>, the cursor position is the 'p' attribute plus the length of the text being inserted. The cursor position is put at the end of the inserted text.<br />
  555. <em>This allows normal forward cursor movement during text insertion.</em></p></li>
  556. <li><p>Upon receiving <link url="#element_e_erase_text">Element &lt;e/&gt; – Erase Text</link>, the cursor position is the 'p' attribute minus the 'n' attribute.<br />
  557. <em>This allows normal backwards cursor movement to a backspace key.</em></p></li>
  558. <li><p>Upon receiving an empty <link url="#element_t_insert_text">Element &lt;t/&gt; – Insert Text</link> (e.g., &lt;t p='#'/&gt; or &lt;t p='#'&gt;&lt;/t&gt;), the cursor position is the 'p' attribute and no text modification is done. Senders can send these elements when only the cursor position has changed (e.g., arrow keys, mouse repositioning). These are non-operative elements on recipients that do not implement a remote cursor.</p></li>
  559. </ul>
  560. </section2>
  561. <section2 topic="Sending Real-Time Text" anchor="sending_realtime_text">
  562. <p>This section lists several possible methods of generating real-time text for transmission. For most situations, the preferred methodology is <link url="#monitoring_message_changes_instead_of_key_presses">Monitoring Message Changes Instead Of Key Presses</link>.</p>
  563. <section3 topic="Monitoring Message Changes Instead Of Key Presses" anchor="monitoring_message_changes_instead_of_key_presses">
  564. <p>Experience has found that the most reliable method for generating real-time text, is to monitor for <strong>text changes</strong> to the sender’s message entry field, instead of key press events. Text change events have the following advantages:</p>
  565. <ul>
  566. <li>It captures all typing, including edits and deletes.</li>
  567. <li>It captures copy &amp; paste operations, as well as edits made via a pointing device.</li>
  568. <li>It captures all automatic text changes (e.g., spell checker, auto-correct, macros, transcription, assistive devices).</li>
  569. <li>It captures characters requiring multiple key presses to compose (e.g., accents, combining marks).</li>
  570. <li>It makes no assumptions about different keyboards or input method editors (e.g., Chinese).</li>
  571. <li>Text change events are more portable across platforms, including on mobile phones.</li>
  572. </ul>
  573. <p>During a text change event, the sender’s current message text can be compared to the old message text from the previous text change event. The difference in text, between consecutive text change events, is typically a one character difference (e.g., key press) or one text block difference (e.g., auto-correct, cut, paste). In order to calculate what text changes took place, the first changed character and the last changed character are determined. From this, it is simple to generate <link url="#action_elements">Action Elements</link> for a single text block deletion and/or insertion. In addition, if <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link> is supported, then <link url="#element_w_wait_interval">Element &lt;w/&gt; – Wait Interval</link> records the time elapsed between text change events.</p>
  574. <p>Sender software can do the following:</p>
  575. <ol>
  576. <li><p>Monitor for text changes in the sender’s message. Whenever a text change event occurs, compute action element(s) and append these action element(s) to a buffer. Repeating this step during every text change event, is equivalent to recording a small sequence of typing.</p></li>
  577. <li><p>During every <link url="#transmission_interval">Transmission Interval</link>, all buffered action elements are transmitted in &lt;rtt/&gt; element in a &lt;message/&gt; stanza. This is equivalent to transmitting a small sequence of typing at a time.</p></li>
  578. <li><p>If there are no message changes occurring, no unnecessary transmission takes place.</p></li>
  579. </ol>
  580. </section3>
  581. <section3 topic="Monitoring Key Presses Directly" anchor="monitoring_key_presses_directly">
  582. <p>Real-time text can be generated via monitoring key presses. 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). Key press events can miss these text changes, and this can potentially cause incorrect real-time text to be transmitted.</p>
  583. </section3>
  584. <section3 topic="Append-Only Real-Time Text" anchor="appendonly_realtime_text">
  585. <p>The use of <link url="#element_t_insert_text">Element &lt;t/&gt; – Insert Text</link> without any attributes, simply appends text to the end of a message, while the use of <link url="#element_e_erase_text">Element &lt;e/&gt; – Erase Text</link> without any attributes, simply erases text from the end of the message. This sending method can also be useful for special-purpose clients where mid-message editing capabilities are not used (e.g., simple transcription, news tickers, relay services, captioned telephone).</p>
  586. </section3>
  587. <section3 topic="Simple Real-Time Text" anchor="simple_realtime_text">
  588. <p>It is possible for sender clients to use <link url="#message_refresh">Message Refresh</link> to simply re-transmit the whole real-time message, as a method of transmitting text changes. The advantage is very simple implementation. Disadvantages can 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, unless stream compression is used. The below illustrates transmission of the real-time message “<strong>Hello there!</strong>” at a regular <link url="#transmission_interval">Transmission Interval</link> while the sender is typing.</p>
  589. <code><![CDATA[<message to='' from='' type='chat' id='a01'>
  590. <rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
  591. <t>Hel</t>
  592. </rtt>
  593. </message>
  594. <message to='' from='' type='chat' id='b02'>
  595. <rtt xmlns='urn:xmpp:rtt:0' seq='456002' event='reset'>
  596. <t>Hello th</t>
  597. </rtt>
  598. </message>
  599. <message to='' from='' type='chat' id='c03'>
  600. <rtt xmlns='urn:xmpp:rtt:0' seq='789003' event='reset'>
  601. <t>Hello there!</t>
  602. </rtt>
  603. </message>]]></code>
  604. <p>Note: The 'seq' attribute can be restarted at any value with &lt;rtt event="reset"/&gt; and &lt;rtt event="new"/&gt;. See <link url="#processing_rules">Processing Rules</link>.</p>
  605. </section3>
  606. </section2>
  607. <section2 topic="Receiving Real-Time Text" anchor="receiving_realtime_text">
  608. <p>In order to allow <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link> in incoming real-time text, recipient clients can do the following:</p>
  609. <ol>
  610. <li><p>Upon receiving <link url="#action_elements">Action Elements</link> in incoming &lt;rtt/&gt; elements, they are added to a queue in the order they are received. This provides immunity to variable network conditions, since the queueing action will smooth out incoming transmission (e.g., receiving new &lt;rtt/&gt; while still processing action elements from a delayed &lt;rtt/&gt;).</p></li>
  611. <li><p>The recipient client processes action elements in the queue in sequential order, including pauses from <link url="#element_w_wait_interval">Element &lt;w/&gt; – Wait Interval</link>, if supported. This is equivalent to playing back the sender's original typing.</p></li>
  612. </ol>
  613. <p>If <link url="#element_w_wait_interval">Element &lt;w/&gt; – Wait Interval</link> is supported, excess lag in incoming real-time text can occur when delayed &lt;rtt/&gt; elements get delivered (e.g., congestion, intermittent wireless reception). To avoid delayed presentation of real-time text, the recipient client needs to speed up processing of action elements. This can be accomplished through a variety of techniques, such as shortening the pauses ('n' value) in &lt;w/&gt; elements, ignoring excess &lt;w/&gt; elements, immediately outputting action elements that are still queued, and/or keeping action elements from a limited number of &lt;rtt/&gt; elements queued (immediately outputting any prior action elements). This allows lagged real-time text to catch up more quickly.</p>
  614. <p>Upon receiving a <link url="#body_element">Body Element</link> indicating a completed message, it is acceptable for the full message text from &lt;body/&gt; to be displayed immediately in place of the real-time message, and discard any unprocessed action elements. This prevents any delay in displaying the final message delivery, however, this may cause a sudden surge of text in some situations.</p>
  615. <p>If the &lt;w/&gt; element is not supported, receiving clients can use an alternate text-smoothing method in order to <link url="#avoid_bursty_text_presentation">Avoid Bursty Text Presentation</link> (e.g., time-smoothed progressive output of received real-time text).</p>
  616. </section2>
  617. <section2 topic="Other Guidelines" anchor="other_guidelines">
  618. <section3 topic="Message Length" anchor="message_length">
  619. <p>A large sequence of action elements can result in an &lt;rtt/&gt; larger than the size of a message &lt;body/&gt;. 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 &lt;rtt/&gt; element becomes unusually large (e.g., macros, multiple copy and pastes, leading to an &lt;rtt/&gt; exceeding one kilobyte) a <link url="#message_refresh">Message Refresh</link> can instead be used, in order to save bandwidth. (Stream compression is another approach.)</p>
  620. <p>Clients can limit the length of the text input for the sender's message, in order to keep the size of &lt;message/&gt; stanzas reasonable, including during <link url="#message_refresh">Message Refresh</link>. Also, large &lt;rtt/&gt; elements might occur in situations such as large copy and pastes. To keep message stanza sizes reasonable, &lt;rtt/&gt; can be transmitted in a separate &lt;message/&gt; than the one containing &lt;body/&gt;.</p>
  621. <p>For clients that send continuous real-time text (e.g., news ticker, captioning, speech transcription, TTY/text telephone gateway), a <link url="#body_element">Body Element</link> can be sent and then a new real-time message started immediately after, every time a message reaches a specific size. This allows continuous real-time text without real-time messages becoming excessively large.</p>
  622. </section3>
  623. <section3 topic="Usage with Chat States" anchor="usage_with_chat_states">
  624. <p>Real-time text can be used in conjunction with <strong>Chat State Notifications</strong>. It is best to handle <strong>XEP-0301</strong> and <strong>XEP-0085</strong> transmissions in separate &lt;message/&gt; stanzas. Chat states such as &lt;composing/&gt; or &lt;active/&gt; are sent separately from &lt;rtt/&gt; elements.</p>
  625. <p>Chat states are handled as specified by <strong>XEP-0085</strong>. The continuous transmission of real-time text corresponds to a &lt;composing/&gt; chat state. Therefore, the timing of the &lt;composing/&gt; chat state coincides with the beginning of continuous &lt;rtt/&gt; transmission.</p>
  626. </section3>
  627. <section3 topic="Usage with Last Message Correction" anchor="usage_with_last_message_correction">
  628. <p>It is possible to use <strong>Last Message Correction</strong> with real-time text. If <strong>XEP-0308</strong> is implemented in concert with this specification, the following rules apply:</p>
  629. <ul>
  630. <li><p>For all &lt;rtt/&gt; elements transmitted during composing a new message, the '<link url="#id">id</link>' attribute of &lt;rtt/&gt; is not used.</p></li>
  631. <li><p>For all &lt;rtt/&gt; elements transmitted during editing of the previous message, the 'id' attribute of &lt;rtt/&gt; matches the 'id' attribute of the old &lt;message/&gt; stanza containing the &lt;body/&gt; text being edited (see 'Business Rules' in <strong>XEP-0308</strong>). This enables recipient clients to display real-time text while the sender is editing the previously-delivered message.</p></li>
  632. <li><p>Senders clients need to transmit a <link url="#message_refresh">Message Refresh</link> when transmitting &lt;rtt/&gt; for a different message than the previously transmitted &lt;rtt/&gt; (i.e., the value of the 'id' attribute changes, 'id' becomes included, or 'id' becomes not included). This keeps real-time text synchronized when beginning to edit a previously delivered message versus continuing to compose a new message.</p></li>
  633. <li><p>The <strong>XEP-0301</strong> and <strong>XEP-0308</strong> protocols operate concurrently via separate message stanzas. Thus, a message stanza never simultaneously includes both &lt;rtt/&gt; and &lt;replace/&gt;.</p></li>
  634. <li><p>The <link url="#body_element">Body Element</link> delivers a finished new message or a finished message correction (&lt;replace/&gt; is used with &lt;body/&gt; in accordance to <strong>XEP-0308</strong>).</p></li>
  635. </ul>
  636. </section3>
  637. <section3 topic="Usage with Multi-User Chat" anchor="usage_with_multiuser_chat">
  638. <p>For simplicity, clients can implement real-time text only for one-to-one chat, and not for <strong>Multi-User Chat</strong>. However, it can be appropriate to support &lt;rtt/&gt; elements in groupchat rooms, even if not all participants support real-time text, as long as the service allows it (See <link url="#support_for_groupchat">Support for Groupchat</link>).</p>
  639. <p>Participants that enable real-time text during group chat need to keep track of multiple concurrent real-time messages on a per-participant basis. Participants, with real-time text, will see real-time text coming from each participant that has real-time text enabled. 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>.</p>
  640. <p>Participants that turn off real-time text for themselves, can simply ignore incoming &lt;rtt/&gt; and not transmit outgoing &lt;rtt/&gt;. Participant clients in groupchat receiving an incoming &lt;rtt <link url="#event">event</link>=’cancel’/&gt; needs to keep outgoing transmission unaffected during <link url="#deactivating_realtime_text">Deactivating Real-Time Text</link> (otherwise, one participant could deny real-time text between other willing participants).</p>
  641. <p>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. Prominent visibility of real-time text can be assigned to recent typists and/or moderators (e.g., classroom teacher, convention speaker). For the same participant logged in multiple times in the same room, see <link url="#simultaneous_logins">Simultaneous Logins</link> for handling this situation. In situations of simultaneous typing by a large number of participants, see <link url="#congestion_considerations">Congestion Considerations</link>.</p>
  642. </section3>
  643. <section3 topic="Simultaneous Logins" anchor="simultaneous_logins">
  644. <p>In situations where there are multiple sessions from the same JID (i.e., simultaneous logins on multiple clients/devices), transmitting of &lt;rtt/&gt; works in one-to-many situations without any special software support. For many-to-one situations where there is incoming &lt;rtt/&gt; from multiple sessions under the same JID, <link url="#keeping_realtime_text_synchronized">Keeping Real-Time Text Synchronized</link> will pause the real-time message upon conflicting &lt;rtt/&gt;, and resume during the next <link url="#message_refresh">Message Refresh</link>, presumably from the active session. This provides a seamless system-switching experience. A good implementation of <link url="#message_refresh">Message Refresh</link> will improve user experience, regardless of whether or not the client follows &xep0296;. Clients can choose to distinguish the &lt;rtt/&gt; streams (via full JID and/or via &lt;thread/&gt;) and keep multiple concurrent real-time messages similar in manner to <link url="#usage_with_multiuser_chat">Usage with Multi-User Chat</link>, with the <link url="#stale_messages">Stale Messages</link> being timed-out.</p>
  645. </section3>
  646. <section3 topic="Stale Messages" anchor="stale_messages">
  647. <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="#usage_with_multiuser_chat">Usage with Multi-User Chat</link>. In addition, it may be a resource-consumption concern, as part of <link url="#congestion_considerations">Congestion Considerations</link>.</p>
  648. <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="#usage_with_multiuser_chat">Usage with Multi-User Chat</link>, the time-out period might be shorter because of the need to reduce screen clutter. For one-to-one chat sessions, the time-out period might need to be longer to allow reasonable interruptions (i.e., sender pausing during a long phone call or other interruption).</p>
  649. <p>Senders that resume composing a message (i.e., continues a partially-composed message hours later) can do a <link url="#message_refresh">Message Refresh</link>, which allows recipients to redisplay the real-time message.</p>
  650. </section3>
  651. <section3 topic="Performance &amp; Efficiency" anchor="performance_efficiency">
  652. <p>With real-time text, frequent screen updates can occur. Screen updates are a potential performance bottleneck, since fast typists type many key presses per second. Optimizing screen updates is more important on slower platforms. The real-time message might be implemented as a separate window or separate display element.</p>
  653. <p>Battery life considerations are closely related to performance, as the addition of real-time text can have an impact on battery life. If <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link> is supported, then support for <link url="#element_w_wait_interval">Element &lt;w/&gt; – Wait Interval</link> needs to be implemented in a battery-efficient manner. The <link url="#transmission_interval">Transmission Interval</link> can 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.</p>
  654. </section3>
  655. </section2>
  656. </section1>
  657. <section1 topic="Use Cases" anchor="use_cases">
  658. <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>. For simplicity, these examples use a bare JID, even in situations where a full JID might be more appropriate.</p>
  659. <section2 topic="Introductory Examples of Real-Time Text" anchor="introductory_examples_of_realtime_text">
  660. <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>". The action elements are <link url="#element_t_insert_text">Element &lt;t/&gt; – Insert Text</link> and <link url="#element_e_erase_text">Element &lt;e/&gt; – Erase Text</link>.</p>
  661. <code><![CDATA[<message to='' from='' type='chat' id='a01'>
  662. <rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
  663. <t>HLL</t>
  664. <e/><e/>
  665. <t>ELLO</t>
  666. </rtt>
  667. </message>]]></code>
  668. <p>The example above sends the misspelled "<strong>HLL</strong>", then <strong>&lt;e/&gt;&lt;e/&gt;</strong> backspaces 2 times, then sends "<strong>HELLO</strong>".</p>
  669. <code><![CDATA[<message to='' from='' type='chat' id='a01'>
  670. <rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
  671. <t>HLL</t>
  672. <e n='2'/>
  673. <t>ELLO</t>
  674. </rtt>
  675. </message>]]></code>
  676. <p>The example above shows that <strong>&lt;e n='2'/&gt;</strong> does the same thing as <strong>&lt;e/&gt;&lt;e/&gt;</strong>.</p>
  677. <code><![CDATA[<message to='' from='' type='chat' id='a01'>
  678. <rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
  679. <t>HLL</t>
  680. </rtt>
  681. </message>
  682. <message to='' from='' type='chat' id='b02'>
  683. <rtt xmlns='urn:xmpp:rtt:0' seq='123002'>
  684. <e n='2'/>
  685. </rtt>
  686. </message>
  687. <message to='' from='' type='chat' id='c03'>
  688. <rtt xmlns='urn:xmpp:rtt:0' seq='123003'>
  689. <t>ELLO</t>
  690. </rtt>
  691. </message>]]></code>
  692. <p>The example above splits the same real-time text over multiple &lt;message/&gt; stanzas, which would occur if the typing was occurring more slowly, over several <link url="#transmission_interval">Transmission Interval</link> cycles.</p>
  693. </section2>
  694. <section2 topic="Example of Multiple Messages" anchor="example_of_multiple_messages">
  695. <p>The example below represents a short chat session of three separate messages:<br />
  696. Bob says: "Hello Alice"<br />
  697. Bob says: "This is Bob"<br />
  698. Bob says: "How are you?"</p>
  699. <code><![CDATA[<message to='' from='' type='chat' id='a01'>
  700. <rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
  701. <t>Hello</t>
  702. </rtt>
  703. </message>
  704. <message to='' from='' type='chat' id='b02'>
  705. <rtt xmlns='urn:xmpp:rtt:0' seq='123002'>
  706. <t> Alice</t>
  707. </rtt>
  708. <body>Hello Alice</body>
  709. </message>
  710. <message to='' from='' type='chat' id='c03'>
  711. <rtt xmlns='urn:xmpp:rtt:0' seq='456001' event='new'>
  712. <t>This i</t>
  713. </rtt>
  714. </message>
  715. <message to='' from='' type='chat' id='d04'>
  716. <rtt xmlns='urn:xmpp:rtt:0' seq='456002'>
  717. <t>s Bob</t>
  718. </rtt>
  719. <body>This is Bob</body>
  720. </message>
  721. <message to='' from='' type='chat' id='e05'>
  722. <rtt xmlns='urn:xmpp:rtt:0' seq='789001' event='new'>
  723. <t>How a</t>
  724. </rtt>
  725. </message>
  726. <message to='' from='' type='chat' id='f06'>
  727. <rtt xmlns='urn:xmpp:rtt:0' seq='789002'>
  728. <t>re yo</t>
  729. </rtt>
  730. </message>
  731. <message to='' from='' type='chat' id='g07'>
  732. <rtt xmlns='urn:xmpp:rtt:0' seq='789003'>
  733. <t>u?</t>
  734. </rtt>
  735. <body>How are you?</body>
  736. </message>]]></code>
  737. <p>The example above represents moderate typing speed during a normal <link url="#transmission_interval">Transmission Interval</link>, such as 700 milliseconds between &lt;message/&gt; stanzas for continuous typing. It illustrates the following <link url="#rtt_attributes">RTT Attributes</link>:</p>
  738. <ul>
  739. <li>The 'event' attribute equals “new” for the start of every new message.</li>
  740. <li>The 'seq' attribute increments within the same message.</li>
  741. <li>The 'seq' attribute randomizes when beginning a new message.</li>
  742. </ul>
  743. </section2>
  744. <section2 topic="Examples of Message Edits" anchor="examples_of_message_edits">
  745. <p>These examples illustrate real-time message editing via <link url="#action_elements">Action Elements</link>.<br />
  746. Note: In most situations, during normal human typing speeds at a normal <link url="#transmission_interval">Transmission Interval</link>, smaller fragments of text will be spread over multiple &lt;rtt/&gt; elements, than these demonstration examples below. See <link url="#sending_realtime_text">Sending Real-Time Text</link>.</p>
  747. <section3 topic="Deleting Text From Message" anchor="deleting_text_from_message">
  748. <code><![CDATA[<message to='' from='' type='chat' id='a01'>
  749. <rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
  750. <t>Hello Bob, this is Alice!</t>
  751. <e n='4' p='9'/>
  752. </rtt>
  753. </message>]]></code>
  754. <p>Final result of real-time message: "<strong>Hello, this is Alice!</strong>"<br />
  755. This example outputs "<strong>Hello Bob, this is Alice!</strong>" then <strong>&lt;e n='4' p='9'/&gt;</strong> erases 4 characters before character position index 9. The <link url="#element_e_erase_text">Element &lt;e/&gt; – Erase Text</link> removes the text " <strong>Bob</strong>" including the preceding space character.</p>
  756. </section3>
  757. <section3 topic="Inserting Text Into Message" anchor="inserting_text_into_message">
  758. <code><![CDATA[<message to='' from='' type='chat' id='a01'>
  759. <rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
  760. <t>Hello, this is Alice!</t>
  761. <t p='5'> Bob</t>
  762. </rtt>
  763. </message>]]></code>
  764. <p>Final result of real-time message: "<strong>Hello Bob, this is Alice!</strong>"<br />
  765. This is because this example outputs "<strong>Hello, this is Alice!</strong>" then the <strong>&lt;t p='5'&gt;</strong> inserts the specified text " <strong>Bob</strong>" at position 5, using <link url="#element_t_insert_text">Element &lt;t/&gt; – Insert Text</link>.</p>
  766. </section3>
  767. <section3 topic="Deleting and Replacing Text In Message" anchor="deleting_and_replacing_text_in_message">
  768. <code><![CDATA[<message to='' from='' type='chat' id='a01'>
  769. <rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
  770. <t>Hello Bob, tihsd is Alice!</t>
  771. <e p='16' n='5'/>
  772. <t p='11'>this</t>
  773. </rtt>
  774. </message>]]></code>
  775. <p>Final result of real-time message: "<strong>Hello Bob, this is Alice!</strong>"<br />
  776. This example outputs "<strong>Hello Bob, tihsd is Alice!</strong>", then <strong>&lt;e p='16' n='5'/&gt;</strong> erases 5 characters at position 16 in the string of text (which erases the mistyped word "<strong>tihsd</strong>"). Finally, <strong>&lt;t p='11'&gt;this&lt;/t&gt;</strong> inserts the text "<strong>this</strong>" place of the original misspelled word.</p>
  777. </section3>
  778. <section3 topic="Multiple Message Edits" anchor="multiple_message_edits">
  779. <p>This is an example message containing multiple consecutive real-time message edits. This illustrates valid use of the &lt;rtt/&gt; element.</p>
  780. <code><![CDATA[<message to='' from='' type='chat' id='a01'>
  781. <rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
  782. <t>Helo</t>
  783. <e/>
  784. <t>lo...planet</t>
  785. <e n='6'/>
  786. <t> World</t>
  787. <e n='3' p='8'/>
  788. <t p='5'> there,</t>
  789. </rtt>
  790. </message>]]></code>
  791. <p>Resulting real-time message: "<strong>Hello there, World</strong>", completed in the following series of action elements:</p>
  792. <table>
  793. <tr>
  794. <th>Element</th>
  795. <th>Action</th>
  796. <th>Real -Time&#160;Message</th>
  797. <th>Cursor&#160;Position*</th>
  798. </tr>
  799. <tr>
  800. <td>&lt;t&gt;Helo&lt;/t&gt;</td>
  801. <td>Output&#160;"Helo"</td>
  802. <td>Helo</td>
  803. <td>4</td>
  804. </tr>
  805. <tr>
  806. <td>&lt;e/&gt;</td>
  807. <td>Erase&#160;1&#160;character&#160;from&#160;end&#160;of&#160;line.</td>
  808. <td>Hel</td>
  809. <td>3</td>
  810. </tr>
  811. <tr>
  812. <td>&lt;t&gt;lo...planet&lt;/t&gt;</td>
  813. <td>Output&#160;"lo...planet"&#160;at&#160;end&#160;of&#160;line.</td>
  814. <td>Hello...planet</td>
  815. <td>14</td>
  816. </tr>
  817. <tr>
  818. <td>&lt;e&#160;n='6'/&gt;</td>
  819. <td>Erase&#160;6&#160;characters&#160;from&#160;end&#160;of&#160;line</td>
  820. <td>Hello...</td>
  821. <td>8</td>
  822. </tr>
  823. <tr>
  824. <td>&lt;t&gt;&#160;World&lt;/t&gt;</td>
  825. <td>Output&#160;"&#160;World"&#160;at&#160;end&#160;of&#160;line.</td>
  826. <td>Hello...&#160;World</td>
  827. <td>14</td>
  828. </tr>
  829. <tr>
  830. <td>&lt;e&#160;n='3'&#160;p='8'/&gt;</td>
  831. <td>Erase&#160;3&#160;characters&#160;before&#160;position&#160;8</td>
  832. <td>Hello&#160;World</td>
  833. <td>5</td>
  834. </tr>
  835. <tr>
  836. <td>&lt;t&#160;p='5'&gt;&#160;there,&lt;/t&gt;</td>
  837. <td>Output&#160;"&#160;there,"&#160;at&#160;position&#160;5</td>
  838. <td>Hello&#160;there,&#160;World</td>
  839. <td>12</td>
  840. </tr>
  841. </table>
  842. <p>*The Cursor Position column is only relevant if the <link url="#optional_remote_cursor">Optional Remote Cursor</link> is implemented.</p>
  843. <p>This example does not illustrate <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>. Also, it is noted that most situations, during normal typing speeds at a normal <link url="#transmission_interval">Transmission Interval</link>, the above series of <link url="#action_elements">Action Elements</link> will normally be spread over multiple separate &lt;rtt/&gt; elements.</p>
  844. </section3>
  845. </section2>
  846. <section2 topic="Examples of Key Press Intervals" anchor="examples_of_key_press_intervals">
  847. <section3 topic="Comparison With and Without Intervals" anchor="comparison_with_and_without_intervals">
  848. <p>All examples shown below, result in the same real-time message “<strong>HELLO</strong>”. Only the last example follows <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>.</p>
  849. <code><![CDATA[<message to='' from='' type='chat' id='a01'>
  850. <rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
  851. <t>HELLO</t>
  852. </rtt>
  853. </message>]]></code>
  854. <p>The above example outputs “<strong>HELLO</strong>” in a single action element (<link url="#element_t_insert_text">Element &lt;t/&gt; – Insert Text</link>).</p>
  855. <code><![CDATA[<message to='' from='' type='chat' id='a01'>
  856. <rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
  857. <t>H</t>
  858. <t>E</t>
  859. <t>L</t>
  860. <t>L</t>
  861. <t>O</t>
  862. </rtt>
  863. </message>]]></code>
  864. <p>The above example outputs “<strong>HELLO</strong>” in separate action elements for each key press.</p>
  865. <code><![CDATA[<message to='' from='' type='chat' id='a01'>
  866. <rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
  867. <t>H</t><w n='101'/>
  868. <t>E</t><w n='110'/>
  869. <t>L</t><w n='125'/>
  870. <t>L</t><w n='103'/>
  871. <t>O</t><w n='110'/>
  872. </rtt>
  873. </message>]]></code>
  874. <p>The above example outputs “<strong>HELLO</strong>” in separate action elements for each key press, while also <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>. The <link url="#element_w_wait_interval">Element &lt;w/&gt; – Wait Interval</link> specifies the number of milliseconds between key presses, to allow smooth presentation in recipient clients that support &lt;w/&gt; action elements.</p>
  875. </section3>
  876. <section3 topic="Full Message Including Key Press Intervals" anchor="full_message_including_key_press_intervals">
  877. <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>
  878. <ul>
  879. <li>The misspelled phrase “Hello tehre!” is typed;</li>
  880. <li>Optional transmission of cursor movements towards the typing mistake;</li>
  881. <li>Two backspaces to delete the typing mistake;</li>
  882. <li>Two correct key presses to correctly spell the word “there”.</li>
  883. </ul>
  884. <p>The use <link url="#element_w_wait_interval">Element &lt;w/&gt; – Wait Interval</link>, between key presses, allows the receiving client to execute a small pause between action elements. This allows recipient clients to play back the sender's typing fluidly.</p>
  885. <code><![CDATA[<message to='' from='' type='chat' id='a01'>
  886. <rtt xmlns='urn:xmpp:rtt:0' seq='123001' event='new'>
  887. <t>H</t>
  888. <w n='115'/><t>e</t>
  889. <w n='154'/><t>l</t>
  890. <w n='151'/><t>l</t>
  891. <w n='115'/><t>o</t>
  892. <w n='165'/>
  893. </rtt>
  894. </message>
  895. <message to='' from='' type='chat' id='b02'>
  896. <rtt xmlns='urn:xmpp:rtt:0' seq='123002'>
  897. <w n='40'/><t> </t>
  898. <w n='161'/><t>t</t>
  899. <w n='137'/><t>e</t>
  900. <w n='135'/><t>h</t>
  901. <w n='134'/><t>r</t>
  902. <w n='93'/>
  903. </rtt>
  904. </message>
  905. <message to='' from='' type='chat' id='c03'>
  906. <rtt xmlns='urn:xmpp:rtt:0' seq='123003'>
  907. <w n='109'/><t>e</t>
  908. <w n='115'/><t>!</t>
  909. <w n='330'/><t p='11'/>
  910. <w n='108'/><t p='10'/>
  911. <w n='38'/>
  912. </rtt>
  913. </message>
  914. <message to='' from='' type='chat' id='d04'>
  915. <rtt xmlns='urn:xmpp:rtt:0' seq='123004'>
  916. <w n='109'/><t p='9'/>
  917. <w n='111'/><e p='9'/>
  918. <w n='106'/><e p='8'/>
  919. <w n='138'/><t p='7'>h</t>
  920. <w n='209'/><t p='8'>e</t>
  921. <w n='27'/>
  922. </rtt>
  923. </message>
  924. <message to='' from='' type='chat' id='d04'>
  925. <rtt xmlns='urn:xmpp:rtt:0' seq='123005'>
  926. <w n='445'/><t p='12'/>
  927. </rtt>
  928. <body>Hello there!</body>
  929. </message>]]></code>
  930. <p>This example also illustrates the following:</p>
  931. <ul>
  932. <li>Typing is done via <link url="#element_t_insert_text">Element &lt;t/&gt; – Insert Text</link>.</li>
  933. <li>Backspaces are done via <link url="#element_e_erase_text">Element &lt;e/&gt; – Erase Text</link>.</li>
  934. <li>There is a final transmission with a <link url="#body_element">Body Element</link>, when the message is finished.</li>
  935. <li>Intervals between key presses are done via <link url="#element_w_wait_interval">Element &lt;w/&gt; – Wait Interval</link>.</li>
  936. <li>Each &lt;message/&gt; is delivered at a regular <link url="#transmission_interval">Transmission Interval</link>, typically 700 milliseconds.</li>
  937. <li>Cursor movements via empty &lt;t/&gt; elements. Sender transmission is not essential, but can be desirable for recipient clients supporting an <link url="#optional_remote_cursor">Optional Remote Cursor</link>.</li>
  938. <li>Recipient clients that do not support <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link> and/or <link url="#optional_remote_cursor">Optional Remote Cursor</link>, will still display this message normally.</li>
  939. <li>The total sum of all values in <link url="#element_w_wait_interval">Element &lt;w/&gt; – Wait Interval</link> in one &lt;message/&gt; equal the <link url="#transmission_interval">Transmission Interval</link> during periods of continuous typing. This also results in some &lt;w/&gt; interval elements being split between consecutive messages. Although not critical, it can further improve the fluidity of <link url="#receiving_realtime_text">Receiving Real-Time Text</link>.</li>
  940. <li>See <link url="#monitoring_message_changes_instead_of_key_presses">Monitoring Message Changes Instead Of Key Presses</link> for the best method of implementation.</li>
  941. </ul>
  942. </section3>
  943. </section2>
  944. </section1>
  945. <section1 topic="Interoperability Considerations" anchor="interoperability_considerations">
  946. <p>There are other real-time text formats with interoperability considerations relating to the session setup level, the media transport level, and presentation level. Interoperability specifications between multiple real-time text formats can be found at Real-Time Text Taskforce (R3TF).</p>
  947. <p>Implementers ought to choose the most appropriate real-time text approach for the session control technology in use during a particular session. For example, clients that use XMPP can utilize this <strong>XEP-0301</strong> specification, and clients that use SIP might utilize <strong>RFC 4103</strong>, <span class="ref"><strong><link url="">RFC 5194</link></strong></span>
  948. <note>RFC 5194: Framework for Real-Time Text over IP Using the Session Initiation Protocol (SIP) &lt;<link url=""></link>&gt;.</note> and <strong>ITU-T T.140</strong>. Clients that run on multiple networks, might need to utilize multiple real-time text technologies. To interoperate between incompatible real-time text technologies, gateway servers can transcode between different real-time text technologies, along with other media such as audio and video. This can include TTY and textphones.</p>
  949. <section2 topic="RFC 4103 and T.140" anchor="rfc_4103_and_t140">
  950. <p>In the SIP environment, real-time text is specified in <strong>RFC 4103</strong> and <strong>ITU-T T.140</strong>. SIP is a popular real-time session control protocol, and there are many implementations of real-time text controlled by SIP. This includes emergency services in some regions.</p>
  951. <p>Interoperability considerations include addressing translation, media negotiation and translation, and media transcoding. Transcoding is straightforward between this specification and <strong>T.140</strong> / <strong>RFC 4103</strong>, except for editing in the middle of messages. Text insertions or deletions, occurring far back in the message, can cause a large number of erase operations in <strong>T.140</strong> that consume time and bandwidth. <strong>T.140</strong> specifies the use of ISO 6429 control codes for presentation characteristics, such as text color, that are not supported by this specification. During transcoding, these control codes needs to be filtered off in order to not disturb the presentation of text. Guidance on address translation and conveyance between XMPP and SIP can be found in &stoxcore;.</p>
  952. </section2>
  953. <section2 topic="Total Conversation – Combination with Audio and Video" anchor="total_conversation_combination_with_audio_and_video">
  954. <p>According to <strong>ITU-T Rec. F.703</strong>, the “Total Conversation” standard defines the simultaneous use of audio, video, and real-time text. For convenience, real-time communication applications can be designed to have automatic negotiation of as many as possible of the three media preferred by the users.</p>
  955. <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>
  956. </section2>
  957. </section1>
  958. <section1 topic="Internationalization Considerations" anchor="internationalization_considerations">
  959. <p>The primary internationalization consideration involves real-time message editing using <link url="#action_elements">Action Elements</link>, where text is inserted and deleted using position and length values. For this, <link url="#accurate_processing_of_action_elements">Accurate Processing of Action Elements</link> including correct <link url="#unicode_character_counting">Unicode Character Counting</link> will ensure that all possible valid Unicode text can be used via this protocol. This includes text containing multiple scripts/languages, ideographic symbols (e.g., Chinese), right-to-left text (e.g., Arabic), and bidirectional text.</p>
  960. <p>For accessibility considerations, there is an <span class="ref"><strong><link url="">International Symbol of Real-Time Text</link></strong></span>
  961. <note>The International Symbol of Real-Time Text &lt;<link url=""></link>&gt;.</note> to alert users to the existence of this feature.</p>
  962. </section1>
  963. <section1 topic="Security Considerations" anchor="security_considerations">
  964. <section2 topic="Privacy" anchor="privacy">
  965. <p>It is important for users to be made aware of real-time text (e.g., user consent, software notice, introductory explanation). Users of real-time text need to be aware that their typing is now visible in real-time to everyone in the current chat conversation. There can be potential security implications if users copy &amp; 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) and then sending the message. There can also be implications for chat clients that suddenly pop up a chat window upon incoming messages and takes keyboard focus unexpectedly, resulting in the sender typing sensitive information into the wrong window. These accidental privacy risks are also apparent for traditional chat (e.g., accidentally sending a message) but are more immediate for real-time text. With real-time message editing, recipients can watch all text changes that occur in the sender's text, before the sender finishes the message.</p>
  966. <p>Such risks can be avoided by good user interface design. In addition, implementation behaviors and improved education can be added to reduce privacy issues. Examples include showing an 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="#guidelines_for_initiating_realtime_text">Guidelines for Initiating Real-Time Text</link>, etc.</p>
  967. </section2>
  968. <section2 topic="Encryption" anchor="encryption">
  969. <p>Real-time text (&lt;rtt/&gt; elements) transmits the content contained within messages. Therefore, a client that encrypts &lt;body/&gt; also needs to encrypt &lt;rtt/&gt; as well:</p>
  970. <ul>
  971. <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>
  972. <li><p>Encryption at the &lt;message/&gt; stanza level (e.g., XEP-0200) can be used for all stanzas containing either &lt;rtt/&gt; or &lt;body/&gt;. It is noted that real-time text can have a higher rate of message stanzas, contributing to additional overhead. See <link url="#congestion_considerations">Congestion Considerations</link>.</p></li>
  973. <li><p>Encryption at the &lt;body/&gt; level (e.g., deprecated XEP-0027) does not encrypt &lt;rtt/&gt;. In this case, &lt;rtt/&gt; needs to be encrypted separately. It is preferable to use a broader level of encryption, where possible.</p></li>
  974. </ul>
  975. <p>It is possible for the timing of individual key presses to be used as a timing attack on encryption. Protection against this is provided by buffering of key presses into a regular <link url="#transmission_interval">Transmission Interval</link>. As an additional measure of security, the risk of timing attacks can be further mitigated by padding &lt;rtt/&gt; elements to lengths not clearly related to the number of characters in the message. Alternatively, general XMPP protection mechanisms hiding length information can be applied on the complete message exchange instead of (or in concert with) &lt;rtt/&gt; specific protection mechanisms.</p>
  976. </section2>
  977. <section2 topic="Congestion Considerations" anchor="congestion_considerations">
  978. <p>The nature of real-time text can result in more frequent transmission of &lt;message/&gt; stanzas than would otherwise happen in a non-real-time text conversation. This can lead to increased network and server loading of XMPP networks.</p>
  979. <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_refresh">Message Refresh</link> can also retransmit real-time text lost by poor network conditions, including stanzas dropped during a network issue or server error. These techniques are useful for mission-critical applications such as next generation emergency services (e.g., text to 9-1-1).</p>
  980. <p>Excess numbers of real-time messages (e.g., during a Denial of Service (DoS) scenario in <link url="#usage_with_multiuser_chat">Usage with 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>. Also see &xep0205;.</p>
  981. <p>According to multiple university studies worldwide (including <span class="ref"><strong><link url="">Carnegie Mellon University Study</link></strong></span>
  982. <note>Communication Characteristics of Instant Messaging: Effects and Predictions of Interpersonal Relationships &lt;<link url=""></link>&gt;.</note>), the average length of instant messages is under 40 characters. The additional incremental bandwidth overhead of real-time text can be very low for an existing XMPP client, especially one already using many extensions. Bandwidth can also be further mitigated using stream compression, to benefit bandwidth-constrained networks (e.g., GPRS, 3G, satellite).</p>
  983. </section2>
  984. </section1>
  985. <section1 topic="IANA Considerations" anchor="iana_considerations">
  986. <p>This document requires no interaction with the Internet Assigned Numbers Authority (IANA).</p>
  987. </section1>
  988. <section1 topic="XMPP Registrar Considerations" anchor="xmpp_registrar_considerations">
  989. <section2 topic="Protocol Namespaces" anchor="protocol_namespaces">
  990. <p>The &REGISTRAR; includes "urn:xmpp:rtt:0" in its registry of protocol namespaces (see &lt;<link url=""></link>&gt;).</p>
  991. </section2>
  992. <section2 topic="Namespace Versioning" anchor="namespace_versioning">
  993. <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>
  994. </section2>
  995. </section1>
  996. <section1 topic="XML Schema" anchor="xml_schema">
  997. <code><![CDATA[<?xml version='1.0' encoding='UTF-8'?>
  998. <xs:schema
  999. xmlns:xs=''
  1000. targetNamespace='urn:xmpp:rtt:0'
  1001. xmlns='urn:xmpp:rtt:0'
  1002. elementFormDefault='qualified'>
  1003. <xs:annotation>
  1004. <xs:documentation>
  1005. The protocol documented by this schema is defined in
  1006. XEP-0301:
  1007. </xs:documentation>
  1008. </xs:annotation>
  1009. <xs:element name='rtt'>
  1010. <xs:complexType>
  1011. <xs:attribute name='seq' type='xs:unsignedInt' use='required'/>
  1012. <xs:attribute name='event' use='optional' default='edit'>
  1013. <xs:simpleType>
  1014. <xs:restriction base='xs:string'>
  1015. <xs:enumeration value='new'/>
  1016. <xs:enumeration value='reset'/>
  1017. <xs:enumeration value='edit'/>
  1018. <xs:enumeration value='init'/>
  1019. <xs:enumeration value='cancel'/>
  1020. </xs:restriction>
  1021. </xs:simpleType>
  1022. </xs:attribute>
  1023. <xs:attribute name='id' type='xs:string' use='optional'>
  1024. <xs:sequence>
  1025. <xs:element ref='t' minOccurs='0' maxOccurs='unbounded'/>
  1026. <xs:element ref='e' minOccurs='0' maxOccurs='unbounded'/>
  1027. <xs:element ref='w' minOccurs='0' maxOccurs='unbounded'/>
  1028. </xs:sequence>
  1029. </xs:complexType>
  1030. </xs:element>
  1031. <xs:element name='t' type='xs:string'>
  1032. <xs:complexType>
  1033. <xs:attribute name='p' type='xs:unsignedInt' use='optional'/>
  1034. </xs:complexType>
  1035. </xs:element>
  1036. <xs:element name='e' type='empty'>
  1037. <xs:complexType>
  1038. <xs:attribute name='p' type='xs:unsignedInt' use='optional'/>
  1039. <xs:attribute name='n' type='xs:unsignedInt' use='optional' default='1'/>
  1040. </xs:complexType>
  1041. </xs:element>
  1042. <xs:element name='w' type='empty'>
  1043. <xs:complexType>
  1044. <xs:attribute name='n' type='xs:unsignedInt' use='required'/>
  1045. </xs:complexType>
  1046. </xs:element>
  1047. <xs:simpleType name='empty'>
  1048. <xs:restriction base='xs:string'>
  1049. <xs:enumeration value=''/>
  1050. </xs:restriction>
  1051. </xs:simpleType>
  1052. </xs:schema>]]></code>
  1053. </section1>
  1054. <section1 topic="Acknowledgments" anchor="acknowledgments">
  1055. <p>The members of the &R3TF; made significant contributions to this specification. Mark Rejhon leads the Jabber/XMPP Taskgroup at R3TF. Members of R3TF who have contributed to this specification include Gunnar Hellstrom, Paul E. Jones, Gregg Vanderheiden, Barry Dingle, and Arnoud van Wijk. Others contributors include Bernard Aboba, Mark Grady, Darren Sturman, Christian Vogler, Norm Williams, and several members from the XMPP Standards Mailing List, including Kevin Smith, Peter Saint-Andre and many others.</p>
  1056. <p>The technique of <link url="#preserving_key_press_intervals">Preserving Key Press Intervals</link>, otherwise called "natural typing", was created by Mark Rejhon, who is deaf. It is incorporated into this specification in compliance with the &XSFIPR;.</p>
  1057. </section1>
  1058. </xep>