%ents; ]>
In-Band Real Time Text This is a specification for real-time text transmitted in-band over an XMPP session. This XMPP Extension Protocol is copyright (c) 1999 - 2011 by the XMPP Standards Foundation (XSF). Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation. ## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. In no event shall the XMPP Standards Foundation or the authors of this Specification be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification. ## In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising out of the use or inability to use the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages. This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which may be found at <http://www.xmpp.org/extensions/ipr-policy.shtml> or obtained by writing to XSF, P.O. Box 1641, Denver, CO 80201 USA). xxxx ProtoXEP Standards Track Standards Council XMPP Core XEP-0020 NOT_YET_ASSIGNED Mark Rejhon markybox@gmail.com markybox@gmail.com RealJabber.org and Rejhon Technologies Inc. http://www.realjabber.com 0.0.2 2011-06-15 MDR

Second draft.

0.0.1 2011-02-21 MDR

First draft.

This document defines a specification for real-time text transmitted in-band over an XMPP session.

Real-time text is text that is sent as it is created. The recipient can watch the sender type "as written words are typed" – similar to a telephone conversation where one listens to a conversation "as words are spoken". It provides a sense of contact in conversation, eliminates waiting times found in messaging, and is also favored by the deaf who prefer text conversation. For a visual animation of real-time text, see RealJabber.org RealJabber.org is the author's web site containing work related to this specification, including animation examples of what real time text looks like. <http://www.realjabber.org>..

Real-time text has been around for decades in various implementations:

  1. Allow transmission of real-time text with a low latency.
  2. Support real-time message editing, including text insertions, deletions and cursor movements.
  3. Support transmission of the original intervals between key presses, to preserve look-and-feel of typing independently of transmission intervals.
  1. Balance low latencies versus system, network and server limitations.
  2. Be backwards compatible with XMPP clients that do not support real-time text.
  3. Be interoperable with other real-time text protocols via gateways, including RFC 4103 and other standards.
  1. Reliable message delivery.
  2. Provide a high level XML mechanism of transmitting real-time text.
  3. Minimize reliance on knowledge of network transversal protocols and/or out-of-band transmission protocols.
  1. Allow use within existing instant-messaging user interfaces, with minimal modifications.
  2. Allow alternate presentations of real-time text, including split screen and/or other layouts.
  3. Protocol design extensible for new features.
  4. Protocol recovery from lost/missing messages.

real-time text – Text transmitted and displayed in real-time as it is typed or entered.

real-time message – A chat message that changes in real-time, via real-time text, and as it is edited by the remote sender.

real-time action – An action done to a real-time message, such as an edit action or a presentation action.

real-time chat session – A chat session that supports real-time messages.

RTT – Acronym for real-time text. This is also the name of the main XML element used by this standard.

action element – An XML element that indicates a single edit action, or presentation action.

edit action – A text modification of any kind, including text insertion or deletion. This may be as small as a single key press.

presentation action – A presentation behavior such as the movement of a visible cursor, a pause, or a flash.

Real-time text is transmitted via an <rtt> child element of a <message> stanza. The <rtt> element is transmitted at regular intervals by the sender while a chat message is being composed, to allow the recipient to watch the sender type (and edit) the message before the full message is sent.

This is a basic example of a real-time message "Hello, my Juliet!", transmitted in three real-time text fragments, followed by a final message delivery:

Example 1: Introductory Example

Hello, my Juliet! Hello, my Juliet! ]]>

The <rtt> element contains a series of one or more child elements representing real-time actions including edit actions and/or presentation actions. Example 1 illustrates only a single edit action, the <t> action element, which simply adds text to the end of a message. For more information about action elements, see Real-Time Actions.

This REQUIRED attribute MUST be urn:xmpp:rtt:0

This REQUIRED attribute indicates the sequence number, and SHOULD begin at 0 in the first <rtt> element sent at the start of a real-time chat session. This attribute MUST increment by 1 for every <rtt> element sent until the end of the session. This value may be used by the receiver to detect lost <message> elements, which affects the integrity of real-time text. For more information, see Error Recovery of Real-Time Text.

This attribute signals session events for real-time messages, such as the start of a new real-time message. The event attribute is omitted from the <rtt> element, when it is not needed.

  1. event='new'
    The sender MUST use this value on the first <rtt> element of a new real-time message. The recipient MUST initialize a blank real-time message for display, before processing the <rtt> payload, if any is provided.

  2. event='reset'
    The sender MAY use this value to retransmit a real-time message. The recipient MUST clear the existing real-time message, before processing the <rtt> payload. One use case is for error recovery. Another use case is where the recipient logs off and on, all while the sender is still composing a message. This allows the recipient re-display the real-time message.

  3. event='start'
    The sender MAY use this value to indicate the start of a real-time session. This also signals the recipient that the sender supports real-time text. The <rtt> payload MUST be empty, with no real-time actions.

  4. event='stop'
    The sender MAY use this value to indicate the end of a real-time session. The recipient SHOULD clear or close the current real-time message, if any is still displayed. An example case is closing a chat window before a message is delivered. The <rtt> payload MUST be empty, with no real-time actions.

One event is allowed per <rtt> element. To transmit multiple events at once, use multiple consecutive <message>'s.

Note: In subsequent versions of this spec, this attribute may be extended to cover real-time chat session negotiation (event='accept' / event='reject'), to provide a real-time text session initiation mechanism that is similar and familiar to users of other real-time instant messaging implementations, including AOL AIM's Real-Time IM.

To turn a real-time message into a permanent delivered message, the sender MUST transmit the whole message as a standard <body> child element within the <message> stanza.

The <body> element complies with the &xmppcore; standard. This is backwards compatible with XMPP clients that do not support this specification. Such clients will continue to behave normally, displaying complete lines of messages as they are delivered.

Upon receipt of <body>, the recipient MUST replace any currently-displayed real-time message with the message text in <body>. This signals the recipient that the real-time message is finished, and is considered delivered. The message is made permanent and can not be edited any further.

In the ideal case, the message in a <body> is redundant since it simply repeats the entire contents of the real-time message. This provides error recovery, in the event that there are lost <message> elements that affect the integrity of the real-time message.

After delivering a completed message as a <body>, the sender may create a new real-time message, using the event='new' attribute.

For the best balance between interoperability and usability, the interval of transmission of <rtt> for a continuously-changing real-time message SHOULD be once every 1 second. If there has been no changes to the real-time message, no transmission should take place.

A shorter interval may more frequently trigger the flooding protection algorithms in XMPP servers, leading to dropped <message> elements. A longer interval will lead to a less optimal user experience. One second is a balance that meets the requirements of real-time text. This interval is mentioned in other real-time text standards, including section 5.4 of IETF RFC 4103 and section 5.2.2 of IETF RFC 5194 IETF RFC 5194: Framework for Real-Time Text over IP Using the Session Initiation Protocol (SIP). <http://tools.ietf.org/html/rfc5194>., used for SIP.

For mission-critical applications, it is acceptable to use network monitoring mechanisms (i.e. &xep0184; and/or &xep0199;, etc.) to monitor reliability and latency, in order to temporarily adjust the interval to prevent failure of real-time text transmissions during extreme network conditions.

To smooth the output of text, this specification supports transmission of the sender's original Key Press Intervals. This allows the recipient software to display the sender's typing at the original speed, regardless of the transmission interval. For more information, see the next section Real-Time Actions.

The <rtt> element is used to transmit a series of one or more real-time actions, including edit actions and presentation actions.

Most chat clients allow a sender to edit their message before sending (i.e. via a Send button, or hitting Enter). The inclusion of real-time functionality to existing chat client software must not degrade the sender's existing expectation of being able to edit their messages before sending. Thus, in a real-time chat session, the recipient can watch the sender compose and edit their message before it is delivered.

Edit actions include typing of text, backspacing, and blocks of text being inserted or deleted. In addition, a real-time chat session may also include presentation actions, including:

  • Key press intervals, to smooth the flow of real-time text independently of the transmission interval;
  • Cursor movements, to make it easier for the recipient to watch edits being made by the sender;
  • Visual flash (beep) to allow the sender to catch the attention of the recipient.

Each real-time action is represented by an action element.

Action Element Description
Insert Text <t ='#'>text</t> REQUIRED. Insert specified text at position p in message.
Backspace <e p='#' n='#'/> REQUIRED. Remove n characters to the left of position p in message.
Forward Delete <d p='#' n='#'/> REQUIRED. Remove n characters starting at position p in message.
Action Element Description
Interval <w n='#'/> RECOMMENDED. Execute a pause of n thousandths of a second.
Cursor Position <c p='#'/> OPTIONAL. Move cursor to position p in message.
Flash <g/> OPTIONAL. Execute a visual flash, beep, or buzz.
  • The n and p attributes are unsigned 32-bit integers, represented as a string.
  • If the n attribute is omitted, the default value for n is 1.
  • If the p attribute is omitted, the default value for p is the length of the current real-time message.
  • A p value of 0 represents the start of the message.

Note: n and p values assume lengths and indexes within the real-time message string before presentation processing. This is the original Unicode string before processing text replacements, emoticon graphics, text decorations, combining marks, Unicode normalization, multiple Unicode characters representing one displayable character, etc. In addition, n and p values are optimized for 16-bit Unicode. As a result, Characters U+10000 through U+10FFFF are counted as 2 each, because they return a string length of 2 in programming platforms that use 16-bit Unicode strings. For more information, see Internationalization Considerations.

(Tier 1) REQUIRED. Supports the transmission of key presses, text block inserts, and text being pasted. Any text permitted in the <body> element of a <message> may be used, subject to the rules in XMPP Core, which implies section 2.2 of XML XML: Extensible Markup Language 1.0 (Fifth Edition). <http://www.w3.org/TR/xml/>.. Line breaks are treated as a single new line character (U+000A) that can be backspaced or deleted.

text]]>

Inserts specified text at position p in the message text.

text]]>

Appends specified text at the end of message. (p defaults to message length)

(Tier 1) REQUIRED. Supports the behavior of Backspace key presses.

]]>

Remove n characters to the left of position p in message.

]]>

Remove 1 character to the left of position p in message. (n defaults to 1)

]]>

Remove n characters from end of message. (p defaults to message length)

]]>

Remove 1 character from end of message. (Both n and p at default values)

(Tier 1) REQUIRED. Supports the behavior of Delete key presses, text block deletes, and text being cut.

]]>

Remove n characters to the right of position p in message.

]]>

Remove 1 character to the right of position p in message. (n defaults to 1)

(Tier 2) RECOMMENDED. Allows the transmission of the original intervals between real-time actions, including the pauses between key presses. For more information, see Key Press Intervals.

]]>

Executes a pause of n thousandths of a second.

(Tier 2) OPTIONAL. Allows the transmission of cursor positions. This allows the recipient to see the sender's cursor in their real-time message, and makes it easier to track the sender's message edits. For more information, see Remote Cursor.

]]>

Moves cursor (caret) to the character position p in message.

(Tier 2) OPTIONAL. Allows a flash/beep/buzz feature. This supports real-time text interoperability with similar features in text telephones for the deaf (TTY / TDD), ITU-T T.140 implementations, and Control-G beep at terminals. In addition, this permits a feature similar to BlackBerry 'Ping', Windows Live 'Nudge', Yahoo 'Buzz', etc.

]]>

Executes a brief visual flash, beep or buzz.

  • There MUST not be more than one <rtt> child element per <message>.
  • The <rtt> element MAY be empty, or contain one or more action elements.
  • Action elements MUST be immediate children of <rtt>. Nesting is not allowed.
  • Support of Tier 1 edit actions is REQUIRED.
  • Support of Tier 2 presentation actions is RECOMMENDED.
  • Tier 2 presentation actions MUST NOT affect the contents of the real-time message string.
  • Recipients MUST process supported action elements in the same order as received within the <rtt> element. Unrecognized action elements MUST be ignored.
  • Real-time actions only work within the boundaries of the current real-time message, and MUST NOT affect previous messages.
  • Real-time actions MUST be processed on the original unmodified real-time message string, before it is formatted for display (i.e. word wrap line breaks, emotion graphics, text decorations, etc).

In a real-time chat session, it is critical that the real-time message is identical on both the sender and recipient ends. The loss of a single <rtt> transmission can represent missing text, or a missing edit. This leads to the real-time message getting out of sync, the message becoming different on the sender versus the recipient ends.

Transmissions of <message> elements may be lost for several reasons. One reason is that a recipients may disconnect and reconnect while a sender is still typing a message. Another reason is some XMPP servers may drop <message> elements automatically (i.e. flooding protection).

To stay synchronized:

  1. The sender MUST increment the seq attribute for each consecutive <rtt> element sent.
  2. The recipients MUST monitor the seq attribute value of received <rtt> elements, to verify that it is incrementing.
  3. The seq values for the sender, and for the recipient, are independent and kept track of separately.

The sync is considered lost if the seq attribute of <rtt> element does not increment as expected. When this happens:

  1. The recipient MUST stop processing all subsequent real-time action elements.
  2. The recipient MUST freeze the current real-time message in its present state.
  3. An indicator (reception bars, color code, missing text indicator) or a message (“Typing Frozen...”) MAY be used by the recipient to indicate the loss of sync.

Recovery occurs when any of the following happens:

  1. A message <body> is delivered. The frozen real-time message MUST be replaced with this delivered message.
  2. The event attribute of <rtt> has a value of new or reset. Processing of real-time text MUST resume, with the new correct seq value obtained from this <rtt> element.

The sender MAY help the recipient stay in sync by automatically retransmitting the real-time message whenever the recipient status changes from offline to online. The entire contents of the real-time message, may be retransmitted using the <rtt> attribute event='reset' with a single Insert Text action.

This is a retransmission of the entire real-time message. ]]>

To prevent flooding the public XMPP network, transmissions of messages containing real-time text is rate-limited to the recommended <rtt> message transmission interval, normally 1 second in Transmission Interval. If the display of text is not smoothed, text will appear in intermittent bursts. This hurts usability of real-time text, and is NOT RECOMMENDED.

Through the use of the RECOMMENDED Element <w> – Interval, the original look-and-feel of typing can be preserved, despite the long transmission interval. Using the <w> element, the sender can record multiple key presses including key press intervals, and transmit them over the XMPP network in a single <message>. The recipient can then play back the sender's typing in real-time at original typing speed including the intervals between key presses. The text is displayed exactly as it was typed.

Much like VoIP is a packetization of sound, this spec enables packetization of typing including the original key press intervals. This enables the real-time feel of typing over virtually any Internet connection, and without requiring shorter transmission intervals. Look and feel of typing is also preserved over polled XMPP including &xep0206;, as well as over satellite and long international connections with heavy packet-bursting tendencies and variable latencies.

The recipient can watch the sender fluidly compose/edit their message in real-time without any “bursting” effects. This is “Natural Typing”, and appears indistinguishable from local typing. Since all key press intervals are preserved at a high precision, all subtleties of typing are preserved, including the 'mood' (calm typing versus panicked or emphatic typing, etc).

For sending clients, there are several methods of capturing typing and message edits, in order to generate action elements for an <rtt> transmission. The most reliable and practical method is to monitor the text change event of a text box field (rather than monitoring key press events) since:

  • it captures all typing, including edits and deletes.

  • it captures cut & paste operations, as well as edits made via a pointing device.

  • it captures automatic text changes, such as done by spell checker, macros, assistive devices, etc.

  • it captures accented characters, Chinese, Arabic and other characters that require multiple key presses to compose. For more information, see Internationalization Considerations.

  • it makes no assumptions about different keyboards or input entry methods.

  • text change events are more cross-platform portable, including on mobile phones.

In the text change event, the current message string can be compared to the previous message string in order to calculate what text changes took place. The appropriate action elements are then generated, to represent text insertions and deletions. The key press interval can be measured as the time elapsed in milliseconds between text change events.

  • Monitor typing via the technique in Monitoring Message Edits to generate action elements, and add these action elements to a buffer. This is equivalent to recording a sequence of typing.

  • During every transmission interval (1 second), all buffered action elements are transmitted in <rtt> element of a <message>. This is equivalent to transmitting a 1 second sequence of typing at a time.

  • If there are no changes to the real-time message, no unnecessary <rtt> transmission should take place.

  • Upon receipt of a <message> containing an <rtt> element, the action elements in <rtt> should be added to a playback queue, in the order that they are received. This provides immunity to variable network conditions, since the buffering action smooths out the latency fluctuations of <message> delivery.

  • The recipient software should interpret the action elements in the playback queue in sequential order, including <w> elements (intervals). This is equivalent to playing back the sender's original typing, including key press intervals.

  • Processing of intervals (<w> elements) should be accomplished using non-blocking programming techniques such as timers or multi-threaded programming, to ensure full responsiveness of the client user interface.

  • Upon receiving a <message> containing <body> indicating a completed message, processing of action elements should discontinue immediately & the full message displayed immediately. This ensures final message delivery is not delayed by late processing of action elements. In some cases, this may cause typing to "suddenly catch up".

  • If support for the <w> element is not possible, receiving software SHOULD use an alternate text-smoothing method, such as time-smoothed progressive output of received text.

Senders MAY choose to transmit changes to cursor positions. Recipient clients MAY choose to display a cursor (or caret) within incoming real-time messages. This enhances usability of real-time text further, since it becomes easier for a recipient to observe the sender's real-time message edits.

The <c> element (Cursor Position) MAY be used to specify an exact cursor position, as a zero-based index into the real-time message string. While between <c> elements, the current cursor position MAY be calculated from the last edit action element as follows:

  • For <t> element (Insert Text), the cursor position is moved to the end of the inserted text.
  • For <e> element (Backspace), the cursor position is moved left as text is deleted.
  • For <d> element (Forward Delete) and all other action elements, the cursor position is unaffected.
  • The current cursor position does not affect the behavior of subsequent edit elements.

The sender MAY choose to transmit cursor positions via <c> elements, only whenever the actual cursor position is different from the calculated position according to Calculating Cursor Position above.

Monitoring the actual cursor position may need to be done via a “selection changed” event of a text box field in many programming platforms. This event typically monitors the start/end indexes of a text marking operation, and usually doubles as the event for monitoring the cursor position. In this case, the start index should be used, since the transmission of the visual appearance of text marking operations is not supported in this current specification.

Recipient software MAY choose to display a remote cursor within received real-time messages. The remote cursor SHOULD be clearly distinguishable from the sender's local cursor. One example is to use a non-blinking cursor, easily emulated with the vertical bar character '|'.

While waiting for the next <c> element (if any), the cursor position MAY be calculated from the last edit action element according to Calculating Cursor Position.

There are other special basic considerations for real-time message transmissions that need to be considered by implementors.

A large sequence of rapid message changes may generate a large series of action elements in a <rtt> element that exceed the maximum allowed length of a <message> stanza, usually 8 kilobytes. It is acceptable to instead retransmit the whole real-time message using <rtt event='reset'> if the length of the <rtt> element exceeds half this limit. For long messages, the final <rtt> transmission may be made in a separate <message> stanza as the <message> stanza containing the <body>. For example:

Hello World...In a Super Long Message! [etc] Hello World...In a Super Long Message! [etc] ]]>

The message MAY be split into two separate message transmissions:

Hello World...In a Super Long Message! [etc] Hello World...In a Super Long Message! [etc] ]]>

The user interface display of the real-time text output, is usually the main performance bottleneck. Care should be taken not to do inefficient entire-screen repainting during every single key press, since fast typists may type over 10 key presses per second. This is especially important for slower platforms. To improve performance, the display of real-time messages may need to be implemented as a separate display element, rather than as a string concatenated to the current message history, so that the display can efficiently be refreshed every key press.

Battery life considerations are closely related to Performance. The addition of real-time text to a mobile device, will typically significantly impact battery life due mostly to more frequent screen refreshes. The specific implementation of interval action elements (play back of key press intervals) may play a factor, and this should be programmed efficiently. Also, in cases where screen updates are the primary inefficient bottleneck on a specific mobile device, and the code cannot be sufficiently optimized, the number of repaints per second may need to be throttled in order to prolong battery life, at the slight expense of the look-and-feel of typing transmissions.

For simplicity, all use cases exclude the RECOMMENDED Key Press Intervals except for the last Use Case.

Hello bcakack ]]>

Resulting real-time message: "Hello back"
This code sends the misspelled "Hello bcak", then <e/><e/><e/> backspaces 3 times, then sends "ack".

Hello bcakack ]]>

Resulting real-time message: "Hello back"
This code is the same as the previous example, demonstrating that <e n='3'/> does the same thing as <e/><e/><e/>.

Hello bcak ack ]]>

Resulting real-time message: "Hello back"
This code results in the same final text as the previous two examples, segmented into four separate messages.

Hello Bob, this is Alice! ]]>

Resulting real-time message: "Hello, this is Alice!"
This code outputs "Hello Bob, this is Alice!" then <d n='4' p='5'/> deletes 4 characters from position 5.
(This erases the text " Bob" including the preceding space character).

Hello, this is Alice! Bob ]]>

Resulting real-time message: "Hello Bob, this is Alice!"
This is because the code outputs "Hello, this is Alice!" then the <t p='5'> inserts the specified text " Bob" at position 5.

Hello Bob, tihsd is Alice! this ]]>

Resulting real-time message: "Hello Bob, this is Alice!"
This code outputs "Hello Bob, tihsd is Alice!", then <d p='11' n='5'/> deletes 5 characters at position 11 in the string of text. (erases the mistyped word "tihsd"). Finally, <t p='11'>this</t> inserts the text "this" place of the original misspelled word.

This is an example message containing multiple consecutive edit actions.

Helo lo...planet World there, ]]>

Resulting real-time message: "Hello there, World", completed in the following series of steps:

Element Action Real -Time Message Cursor Pos
<t>Helo</t> Output "Helo" Helo 4
<e/> Backspace 1 character from end of line. Hel 3
<t>lo...planet</t> Output "lo...planet" Hello...planet 14
<e n='6'/> Backspace 6 characters from end of line Hello... 8
<t> World</t> Output " World" Hello... World 14
<d n='3' p='5'/> Delete 3 characters at position 5 Hello World 5
<t p='5'> there,</t> Output " there," at position 5 Hello there, World 12
<c p='0'/> Move cursor to beginning Hello there, World 0

Normally, the action elements are split into multiple separate transmissions, with Key Press Intervals added.

Representing a short chat session of three separate messages:
Bob says: "Hello Alice"
Bob says: "This is Bob"
Bob says: "How are you?"

Hello Alice Hello Alice This i s Bob This is Bob How a re yo u? How are you? ]]>

This example also illustrates the following:

  • The type attribute equals 'new' for the start of every new message.
  • The seq attribute always increments.

This is an example transmission of “Hello there!” with Key Press Intervals. The message writing sequence is as follows: The misspelled phrase “Hello tehre!” is typed, then cursor movements back to the typo, then two backspaces to delete the typo, and then two key presses to fix the typo. In between each key press, is Element <w> – Interval to allow the receiving client execute a small pause between action elements, which allows the play back of the typing at its original look-and-feel.

H e l l o t e h r e ! h e Hello there! ]]>

This example also illustrates the following:

  • The sum of all the n attributes of <w> elements in one <message> equal a total of 1000 milliseconds. This represent the default Transmission Interval of one <message> element transmitted every 1 second during periods of continuous typing.
  • Some <w> interval elements are split between consecutive messages, since key presses are not timed with transmission intervals.
  • The <w> interval elements also apply to cursor movements of the Remote Cursor.
  • There is a final transmission with a <body> element, transmitted immediately when the message is finished.
  • These action elements are generated automatically via Monitoring Message Edits.

There are other real-time text formats with interoperability considerations relating to the session setup level, the media transport level, and presentation level. For each environment where interoperability is supported, an interoperability specification should be documented that covers addressing, session control, media negotiation and media transcoding.

One environment for such interoperability considerations is SIP with real-time text (also called Text over IP, or ToIP) as specified in ITU-T T.140 and IETF RFC 4103. One reason for its importance is that this protocol combination is specified by IETF and by regional emergency service organizations to be the protocols supported for IP based real-time emergency calls that support real-time text. Another reason is that SIP is the currently dominating peering protocol between services, and many implementations of real-time text in SIP exist.

Interoperability implies addressing translation, media negotiation and translation, and media transcoding. For media transcoding between this specification and T.140/RFC 4103, the real-time text transcoding is straight forward, except the editing feature of this specification. Backwards positioning and insertion or deletion far back in the message can cause a large number of erase operations in T.140, that takes time and bandwidth to convey. Therefore, it is proposed that the scope of editing can be limited by negotiation to only allow backspacing when connecting to a system that only T.140 real-time message editing capabilities.

It should be noted that T.140 specifies use of ISO 6429 control codes for presentation characteristics such as text color etc, that are not possible to represent in plain text according to this specification. All control codes from both sides that cannot be presented on the other side of the conversion, must be filtered off in order to not disturb the presentation of text.

Note that a future version of this specification may support real-time text with XHTML-IM. It is possible to transcode many of these ISO 6429 formatting codes to &xep0071;.

In some cases, it may be beneficial in a real-time conversation situation to have simultaneous availability of multiple real-time media.

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. For clients that already support audio and/or video, it is RECOMMENDED to continue providing real-time text according to this specification, regardless of whether audio and/or video is negotiated.

It is noted there is also another real-time text standard (RFC 4103, RFC 5194), used for SIP messaging and real-time text. In the situation where an implementor needs to decide which real-time text standard to use, it is generally recommended to use the real-time text extension of the specific instant messaging standard in use for that particular conversation. This varies from implementation to implementation. For example, Google Talk network uses XMPP messaging for instant messages sent during audio/video conversations. Therefore, in this situation, it is recommended to use this XMPP extension document to add real-time text functionality. However, there are other situations where it is necessary to support multiple real-time-text standards, and to interoperate between the multiple real-time text standards. For more information, see the next section.

According to ITU-T F.703 ITU-T F.703: Multimedia conversational services. <http://www.itu.int/rec/T-REC-F.703>., "Total Conversation" defines the simultaneous use of audio, video, and real-time text. For convenience, some chat applications may be designed to have automatic negotiation of as many as possible of the three media preferred by the users.

There are special internationalization considerations involving real-time editing of international text, due to the character positioning and length values used by Action Elements, in the form of p and n attributes. There are multiple different ways to calculate lengths and indexes into a Unicode string, because multiple Unicode encoding formats exist. This is also further complicated by the use of combining characters and surrogate pairs, with the use of multiple Unicode code points to represent one displayable Unicode character.

The indexing standard for positions and lengths is defined based on 16-bit Unicode string variables. For simplicity and performance, most programming languages treat Unicode strings as an array of 16-bit elements. If real-time messages are processed in an a Unicode encoding other than 16-bit, extra care must be taken to calculate p and n attributes correctly:

The supported Unicode character range is limited to characters allowable in XMPP Core, which implies section 2.2 of the XML standard.

The security considerations are mainly user interface related, which varies in implementation from client to client:

It is important for implementors of real-time text to educate users about real-time text. Users of real-time text should be aware that their typing in the local input buffer is now visible to everyone in the current chat conversation. This may have security implications if users copy & paste private information into their chat entry buffer (i.e. a shopping invoice) before editing out the private parts of the pasted text (i.e. a credit card number) before they hit Enter or click Send. With real-time editing, recipients can watch all text changes that occur in the sender's text.

Concern shall be taken so that the network and server load of XMPP based real-time text is not excessive to the degree that it causes congestion, and a potential denial-of-service situation.

This document requires no interaction with the Internet Assigned Numbers Authority (IANA).

The XMPP Registrar should include "urn:xmpp:rtt:0" in its registry of protocol namespaces (see <http://xmpp.org/registrar/namespaces.html>).

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.

The protocol documented by this schema is not yet defined on XMPP.org until submitted. XEP-0xxx: http://www.xmpp.org/extensions/xep-0xxx.html ]]>

Acknowledgements

The author would like to thank Real-Time Text Taskforce (R3TF) at www.realtimetext.org for their contribution to the technology documented in this specification. Members of R3TF who have contributed to this document, including corrections and edits, include Gunnar Helstrom, Barry Dingle, Paul E. Jones, Anoud van Wijk, and Gregg Vanderheiden.

“Natural Typing”, the technique of preserving key press intervals, is acknowledged as an invention by Mark Rejhon, who is deaf. This technology is provided to XMPP.org as part of this specification in compliance of the XSF's Intellectual Property Rights Policy at http://xmpp.org/extensions/ipr-policy.shtml. For more information, see Appendix C: Legal Notices.