diff --git a/xep-0301.xml b/xep-0301.xml index 28384144..0f386943 100644 --- a/xep-0301.xml +++ b/xep-0301.xml @@ -29,6 +29,12 @@ RealJabber.org and Rejhon Technologies Inc. http://www.realjabber.com + + 0.2 + 2012-03-19 + MDR +

Lots of edits. Simplifications, improvements and corrections. Forward and backward compatible with version 0.1.

+
0.1 2011-06-29 @@ -37,9 +43,9 @@ 0.0.3 - 2011-06-24 + 2011-06-25 MDR -

Third draft, minor edits.

+

Third draft, recommended edits.

0.0.2 @@ -56,69 +62,69 @@ - + -

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 +

Real-time text is text transmitted live while it is being typed or created. The recipient can immediately read the sender's typing, without waiting before reading. This is similar to a telephone conversation where one listens "as words are spoken". This allows text to be used conversationally, provides a sense of contact, eliminates waiting times found in messaging, and is favored by deaf individuals 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:

+ + + +

Real-time text is suitable for smooth and rapid mainstream communication in text, as an all-inclusive technology to complement instant messaging. At the same time, real-time text has special usefulness to many audiences including the deaf and other people who cannot use speech on the telephone. This document defines a specification for real-time text transmitted in-band over an XMPP network.

  1. Allow transmission of real-time text with a low latency.
  2. -
  3. Support real-time message editing, including text insertions, deletions and cursor movements.
  4. -
  5. Support transmission of the original intervals between key presses, to preserve look-and-feel of typing independently of transmission intervals.
  6. -
-
- -
  1. Balance low latencies versus system, network and server limitations.
  2. -
  3. Be backwards compatible with XMPP clients that do not support real-time text.
  4. -
  5. Be interoperable with other real-time text protocols via gateways, including RFC 4103 and other standards.
  6. +
  7. Support message editing in real-time, including text insertions and deletions.
  8. +
  9. Support transmission of the original intervals between key presses, to preserve look-and-feel of typing independently of transmission intervals.
  1. Reliable real-time text delivery.
  2. -
  3. Provide a high level XML mechanism of transmitting real-time text.
  4. +
  5. Be backwards compatible with XMPP clients that do not support real-time text.
  6. Minimize reliance on knowledge of network transversal protocols and/or out-of-band transmission protocols.
  7. +
  8. Compatible with multi-user chat (MUC) and simultaneous logins.
- +
    -
  1. Allow use within existing instant-messaging user interfaces, with minimal modifications.
  2. -
  3. Allow alternate presentations of real-time text, including split screen and/or other layouts.
  4. -
  5. Protocol design extensible for new features.
  6. -
  7. Protocol recovery from lost/missing messages.
  8. +
  9. Allow use within existing instant-messaging user interfaces, with minimal UI modifications.
  10. +
  11. Allow alternate optional presentations of real-time text, including split screen and/or other layouts.
  12. +
  13. Protocol design allows error recovery, and allows extensions for new features.
  14. +
  15. Be interoperable with other real-time text protocols via gateways, including RFC 4103 and other standards.
  16. +
+
+ +
    +
  1. Allow XMPP to follow the ITU-T Rec. F.703 ITU-T Rec. F.703: Multimedia conversational services. <http://www.itu.int/rec/T-REC-F.703>. Total Conversation accessibility standard for simultaneous voice, video, and real-time text.
  2. +
  3. Be a candidate technology for use with Next Generation 9-1-1 / 1-1-2 emergency services.
  4. +
  5. 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.
  6. +
  7. Be an accessible enhancement for mobile phone text messaging and mainstream instant messaging.
-

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 – Text transmitted live while it is being typed or created.

+

real-time message – Recipient's real-time live view of the sender's message still being typed or created.

+

real-time message edit – An edit operation done by the remote sender, that is transmitted in real-time to the recipient.

+

action element – An XML element that represents a single real-time message edit, such as text insertion or deletion.

+

RTT – Acronym for real-time text.

-

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:

+

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 in a <body/> element.

+

This is a basic example of a real-time message "Hello, my Juliet!", transmitted live while it is being typed, before a final message delivery:

Example 1: Introductory Example

@@ -141,63 +147,52 @@ 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.

-

If the recipient client does not support this real-time text standard, the sender SHOULD NOT transmit the <rtt> element. For more information, see Determining Support.

+ +

The <rtt/> element contains a series of one or more child elements called action elements that represent real-time message edits such as text being appended, inserted, or deleted. Example 1 illustrates only the <t/> action element, which appends text to the end of a message. For more information, see Real-Time Message Editing.

+

Transmission of <rtt/> occurs at regular intervals whenever the sender is actively composing a message. If there are no changes to the message since the last transmission, no transmission occurs. For more information, see Transmission Interval.

+

The namespace of the <rtt/> element is “urn:xmp:rtt:0”.

- -

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

-
- -

This REQUIRED attribute indicates the sequence number, and MUST 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 REQUIRED attribute is a counter to maintain the integrity of a real-time message. Senders MUST increment the seq attribute by 1 for each subsequent <rtt/> transmitted. Recipients MUST monitor the seq value to verify that it is incrementing. For more info, see Automatic Recovery of Real-Time Text.

+

The bounds of seq is 31-bits, the range of positive values of a signed integer. The exception to the incrementing rule is <rtt/> elements with an 'event' attribute. In this case, senders MAY use any seq value as the new starting value. For best integrity, seq SHOULD be randomized. The new starting value SHOULD be less than 1 million to allow plenty of incrementing room, and to keep <rtt/> compact.

-

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.

+

This attribute signals 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, except in the following situations:

  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. + Senders MUST use this value on the first <rtt/> element of a new message, which also delivers the first character(s) being typed in a message. Recipients MUST initialize a new real-time message for display, and then process action elements within this <rtt/>. A new seq value MAY be used.

  3. 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.

  4. -
  5. event='start'
    - The sender MAY use this value to indicate the start of a real-time session. The <rtt> payload MUST be empty, with no real-time actions.

  6. + Identical to event='new', except it replaces the existing real-time message. Senders MAY use this attribute during Automatic Recovery of Real-Time Text. Recipients MUST support this attribute, and process action elements within this <rtt/> to replace the existing real-time message.

  7. event='cancel'
    - 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.

  8. + Senders MAY use this value to signal recipient to stop transmitting real-time text. Recipients SHOULD clear the real-time message, and discontinue sending back <rtt/> for the remainder of the current chat session until the sender sends another <rtt/> to resume real-time text. No action elements should be included within <rtt/>.

-

Only one <rtt> element is allowed per <message>. Therefore, to transmit multiple events, use multiple consecutive <message>'s.

+

The first <rtt/> element in a chat session, signals the start of real-time text. The <rtt event='cancel'/> signals the end of real-time text in a chat session. There MUST NOT be more than one <rtt/> element per <message/>. 

-

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.

+

Upon receipt of <body/>, the message becomes permanent and can not be edited any further. The delivered message is displayed instead of the real-time message. In the ideal case, the message from <body/> is redundant since this delivered message is identical to the final contents of the real-time message. When the sender begins composing a new message after a <body/> is sent, the next <rtt/> transmitted by the sender MUST contain the event='new' attribute.

-

The <body> element continues to follow the &xmppcore; standard. This keeps backwards compatibility 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 the real-time message with the final delivered message from <body>. The message is thus becomes 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. In the event that there are lost <messages>, the delivery of the <body> permits Error Recovery of Real-Time Text.

-

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

+

The real-time text standard simply provides early delivery of text before the <body/> element. The <body/> element continues to follow the &xmppcore; standard. Clients that do not support real-time text, will continue to behave normally, displaying complete lines of messages as they are delivered.

-

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 much shorter interval may more frequently trigger the flooding protection algorithms in XMPP servers, leading to dropped <message> elements and/or Congestion Considerations. 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.

-

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.

-
- -

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:

+

For the best balance between interoperability and usability, the transmission interval of <rtt/> for a continuously-changing message SHOULD be approximately 0.7 second. This interval meets ITU-T Rec. F.700 ITU-T Rec. F.700: Framework Recommendation for multimedia services <http://www.itu.int/rec/T-REC-F.700>. for good real-time text. If a different transmission interval needs to be used, the interval SHOULD be between 0.3 second and 1 second.

+

A longer interval will lead to a less optimal user experience. Conversely, a much shorter interval may more frequently trigger throttling or flooding protection algorithms in public XMPP servers, leading to dropped <message/> elements and/or Congestion Considerations.

+

To provide fluid real-time text, one or more of the following methods can be used:

    -
  • 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.
  • +
  • Preserving Key Press Intervals for natural typing display, independently of the transmission interval.
  • +
  • Use of Time Critical And Low Latency Methods, for real-time captioning/transcription.
  • +
  • For other options or reduced-precision options, see Reduced Precision Text Smoothing Methods.
-

Each real-time action is represented by an action element. Examples can be found in Use Cases.

+
+ +

The <rtt/> element MAY contain one or more action elements representing real-time message editing operations, including text being appended, inserted, or deleted.

+

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 chat session with real-time text, the recipient can watch the sender compose and edit their message before it is delivered.

-

The following is a short summary. For more detailed information, see Action Elements.

- +

This is a short summary of action elements that operate on a real-time message. For detailed information, see Action Elements.

@@ -212,147 +207,126 @@ - + - - -
Action
Backspace <e p='#' n='#'/>REQUIRED. Remove n characters to the left of position p in message.REQUIRED. Remove n characters before position p in message.
Forward Delete <d p='#' n='#'/>REQUIRED. Remove n characters starting at position p in message.
-
- - - - - - + - - - - - - - - - -
ActionElementDescriptionREQUIRED. Remove n characters starting at position p in message.
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.
  • -
  • n and p values are counts of individual Unicode code points.
  • +
  • The n attribute represents a length value. If the n attribute is omitted, the default value for n MUST be 1.

  • +
  • The p attribute represents an absolute position value. This is a 0-based index, where 0 represents the first character of the real-time message. If p is omitted, p MUST be treated as the length of the message (points to end of the real-time message).

  • +
  • For text modifications, both n and p attributes are based on Unicode Character Counting. Also see Ensuring Accuracy Of Attribute Values.

-

For interoperability of p and n values, processing MUST be done on the original Unicode real-time message. For both senders and receivers, this is the version of the Unicode message text without Unicode normalization, emoticon graphics images, display text formatting, processing of Unicode combining marks, etc. For recipients obtaining text from the <t> element, this is the Unicode text immediately after XML processing, and before any further processing. From the perspective of p and n values, a real-time message is treated as an editable array of Unicode code points.

-

Regardless of the original format of line breaks during XMPP transmission, line breaks are treated as a single code unit (LINE FEED U+000A) for the purposes of real-time message processing. Conversion of line breaks into a single U+000A character is REQUIRED for XML processors, according to section 2.11 of XML XML: Extensible Markup Language 1.0 (Fifth Edition). <http://www.w3.org/TR/xml/>., so a compliant XML processor already do this automatically, and already provide the correct original Unicode text for interoperability.

-

NOTE WELL: Extreme care MUST be taken to correctly calculate n and p values based on Unicode code points, to avoid corruption of the real-time message during real-time editing. For more information, see Internationalization Considerations.

- -
+ - -

(Tier 1) REQUIRED. Supports the transmission of key presses, text block inserts, and text being pasted.
- Note: Any text permitted in the <body> element of a <message> may be used, subject to the rules in XMPP Core. More examples can be found in Use Cases.

+

Recipients are REQUIRED to support <t/>, <e/> and <d/> action elements for incoming <rtt/> transmissions, even if not all elements are used for outgoing <rtt/> transmissions. Support for <w/> is RECOMMENDED for both senders and recipients in order to accommodate Preserving Key Press Intervals. Recipients MUST ignore unexpected or unsupported elements within <rtt/>, while continuing to process subsequent action elements. Action elements are immediate child elements of the <rtt/> element, and are never nested. Examples can be found in Use Cases.

+ +

REQUIRED. Supports the transmission of key presses, text block inserts, and text being pasted.
+ Note: Any text normally used in the <body/> element of a <message/> may be used. If the <t/> element is empty, no text modification takes place.

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.
- Note: Direction 'left' represents the numeric direction. Thus, for right-to-left text (i.e. Arabic), numeric 'left' represents visible 'right'.

+ +

REQUIRED. Supports the behavior of Backspace key presses.
+ Note: Excess backspaces, at the start of the message, MUST be ignored.

]]>

-

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

+

Remove n characters before position p in message.

]]>

-

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

+

Remove 1 character before 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.
- Note: Direction 'right' represents the numeric direction. Thus, for right-to-left text (i.e. Arabic), numeric 'right' represents visible 'left'.

+ +

REQUIRED. Supports the behavior of Delete key presses, text block deletes, and text being cut.
+ Note: Excess deletes, beyond end of message, MUST be ignored.

]]>

-

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

+

Remove n characters beginning at position p in message.

]]>

-

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

+

Remove 1 character beginning at 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.

+ +

RECOMMENDED. Allows the transmission of intervals between real-time message edits, such as the pauses between key presses. For more information, see Preserving Key Press Intervals.

]]>

-

Executes a pause of n thousandths of a second. The n value SHOULD NOT exceed the Transmission Interval. Also, if a Body Element arrives, pauses SHOULD be interrupted to prevent message delivery delay.

-
- -

(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 feature is the real-time version of &xep0224;, and MAY execute the same alerting method.
- Note: 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 consoles.

-

]]>

-

Executes a brief flash, sound, vibration, etc.

+

Executes a pause of n thousandths of a second. This pause may be approximate, and not necessarily be of millisecond precision. The n value SHOULD NOT exceed the Transmission Interval. Also, if a Body Element arrives, pauses SHOULD be interrupted to prevent a delay in message delivery.

- + +

Real-time message edits work only within the boundaries of the current real-time message, and do not affect previous messages. Senders MUST NOT use negative values for any attribute, nor use p values beyond the current message length. However, recipients receiving such values MUST clip negative values to 0, and clip excessively high p values to the current message length.

+

For senders, p and n values are calculated relative to the plain text version of the message. This is the message otherwise normally transmitted in a <body/> element after all processing is complete, including emoticon graphics as plain text. For recipients, p and n are calculated relative to the message text immediately after XML processing, and before any further processing.

+

Regardless of the original format of line breaks during XMPP transmission, line breaks are treated as a single code point (LINE FEED U+000A). Conversion of line breaks into a single line feed is REQUIRED for XML processors, according to section 2.11 of XML XML: Extensible Markup Language 1.0 (Fifth Edition). <http://www.w3.org/TR/xml/>., so a compliant XML processor already do this automatically, and already provide the correct original Unicode text for interoperability.

+
+ +

For platform-independent interoperability, calculations of p and n values MUST be based on Unicode code points. Different platforms use different internal Unicode encodings, which may be different from the transmission encoding (UTF-8) for XMPP. Consider these factors:

    -
  • There MUST not be more than one <rtt> child element per <message>.
  • -
  • The <rtt> element MAY be an empty element, or contain one or more action elements.
  • -
  • Action elements MUST be immediate children of <rtt>. Nesting is not allowed.
  • -
  • Support of all Tier 1 edit actions is REQUIRED.
  • -
  • Tier 2 presentation actions MUST NOT affect the contents of the real-time message string.
  • -
  • Excess Backspaces and Forward Deletes beyond start/end of the message, MUST be ignored.
  • -
  • 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 work only within the boundaries of the current real-time message, and MUST NOT affect previous messages.
  • -
  • Values for p and n attributes MUST be calculated according to Rules for Attribute Values.
  • +
  • Multiple Unicode code points may represent one displayable Unicode glyph (i.e. combining marks).
    + Action elements operate on Unicode code points, not on displayable character glyphs.

  • +
  • Characters U+10000 through U+1FFFF, which are single code points, but are represented as multiple surrogate code units in certain Unicode encodings (i.e. UTF-16).
    + Action elements operate on Unicode code points, not on individual surrogate code units.

  • +
  • Some Unicode encodings use a variable number of bytes per Unicode character (i.e. UTF-8).
    Action elements operate on Unicode code points, not on individual bytes.

+

Incorrectly calculated p and n values may cause scrambled text during real-time message editing for many languages. This scrambled text persists until full message delivery, or Message Retransmission. From the perspective of p and n values, a real-time message is treated equivalent to an editable array of Unicode code points, even if not necessarily stored as such.

- -

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 recipient 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).

+ +

In a chat session with real-time text, 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. Recovery of in-progress real-time message is useful in several situations:

+
    +
  • Disconnect and reconnection (i.e. intentional, unintentional, wireless reception, servers, etc.)
  • +
  • XMPP servers may drop <message/> elements automatically (i.e. flooding protection).
  • +
  • Multiple Simultaneous Logins. (i.e. additional clients logging in, recipient switching computers)
  • +
-

To stay synchronized:

+

To stay synchronized, for <rtt/> elements that do not contain an 'event' attribute:

    -
  1. The sender MUST increment the seq attribute for each consecutive <rtt> element sent.
  2. -
  3. The recipients MUST monitor the seq attribute value of received <rtt> elements, to verify that it is incrementing.
  4. -
  5. The seq values for the sender, and for the recipient, are independent and kept track of separately.
  6. +
  7. The sender MUST increment the seq attribute for consecutive <rtt/> element.
  8. +
  9. The recipient MUST monitor the seq attribute value of received <rtt/> elements, to verify that it is incrementing.
  10. +
  11. The seq values for incoming messages, versus outgoing messages, are independent and kept track of separately.
-

The sync is considered lost if the seq attribute of the <rtt> element does not increment as expected. Trying to process certain real-time edit actions after loss of sync, will result in scrambled text. Therefore, to avoid this situation:

+

The sync is considered lost if the seq attribute of the <rtt/> element does not increment as expected. Trying to process certain action elements, after loss of sync, can result in scrambled text. Therefore, to avoid this situation:

    -
  1. The recipient MUST stop processing all subsequent real-time action elements, and freeze the current real-time message.
  2. -
  3. An indicator (i.e. reception bars, color code, missing text indicator) or a chat state message (i.e. “Typing Frozen...”) MAY be used by the recipient to indicate the loss of sync.
  4. +
  5. The recipient MUST stop processing all subsequent action elements, and pause the current real-time message.
  6. +
  7. An indicator MAY be used by the recipient to indicate the loss of sync. (i.e. reception bars, color code, missing text indicator, chat state message)

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. -
  3. 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.
  4. +
  5. A message <body/> is delivered. The Body Element replaces the real-time message.
  6. +
  7. The event attribute of <rtt/> has a value of new or reset. Processing of real-time MUST restart, with the new starting 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.

-

+ +

In order to prevent recipients from waiting for Recovery From Loss of Sync, senders SHOULD retransmit the contents of a partially-composed message, in the following situations:

+
    +
  • When the recipient's presence changes. (i.e. offline to online)
  • +
  • When the recipient sends a <message/> from a different full JID than before. (i.e. Simultaneous Logins)
  • +
  • At regular intervals, to allow recovery from unexpected situations such as lost <message/> stanzas.
  • +
+

A message retransmit is done using the <rtt/> attribute event='reset' (see RTT Attributes).

+

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

+

Retransmission SHOULD be done at a regular interval of 10 seconds, unless there are no message changes. This interval is frequent enough to minimize user waiting time, while being infrequent enough to reduce bandwidth overhead. This interval MAY vary in order to reduce average bandwidth requirements for minor message changes and/or for long messages.

-

If a client supports the Real Time Text protocol, it MUST advertise that fact in its responses via &xep0030; information ("disco#info") requests by returning a feature of urn:xmpp:rtt:0

+

If a client supports this real-time text protocol, it MUST advertise that fact in its responses via &xep0030; information ("disco#info") requests by returning a feature of urn:xmpp:rtt:0

Example 1. A disco#info query

]]>

-

If this successful response of <feature var='urn:xmpp:rtt:0'/> is not received, the client SHOULD NOT transmit any outgoing <rtt> elements in <message> transmissions. This avoids unnecessary consumption of bandwidth to clients that do not support this protocol.

+

If this successful response of <feature var='urn:xmpp:rtt:0'/> is not received, the client SHOULD NOT transmit any outgoing <rtt/> elements in <message/> transmissions. This avoids unnecessary consumption of bandwidth to clients that do not support this protocol.

- + -

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

+

If a long Transmission Interval is used without Preserving Key Press Intervals, then text will appear in intermittent bursts if the display of text is not smoothed. This hurts user experience of real-time text.

-

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 an example transmission of key intervals, see Real World Message With Key Press Intervals.

+

For the highest quality display of text being typed, using Element <w/> – Interval allows the original look-and-feel of typing to be preserved, independently of the transmission interval. Using the <w/> element, the sender can record multiple key presses including key press intervals, and transmit them over the XMPP network in a single <message/>. The recipient can then play back the sender's typing in real-time at original typing speed including the intervals between key presses.

+

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

+

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

+
+ +

There are specialized situations such as live transcriptions and captioning (i.e. transcription service, closed captioning provider, captioned telephone, relay services, Remote CART) that demands low latency transmission. Such systems typically use voice recognition and/or stenotype machines, which output text in word bursts rather than a character at a time. Senders with bursty output MAY immediately transmit word bursts of text without buffering. This eliminates any lag caused by the Transmission Interval. It is NOT REQUIRED to monitor or transmit Element <w/> – Interval for transcription. If additional accuracy is required, it is also possible to timecode the <rtt/> elements.

+
+ +

Some software platforms (i.e. JavaScript, BOSH, mobile devices, etc.) may have low-precision timers that impact Transmission Interval and/or Preserving Key Press Intervals. Clients MAY optimize for bandwidth, performance and/or screen repaints by eliminating, merging, or ignoring Element <w/> – Interval selectively, especially those containing shorter intervals. The transmission interval of <rtt/> MAY also vary, either intentionally for optimizations, or due to precision limitation.

+

Clients MAY 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.

- + -

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:

+

For sending clients, there are several potential methods of capturing typing and message edits, in order to generate action elements for an <rtt/> transmission. However, instead of monitoring key presses directly, the most reliable and practical method is to monitor the text changes to the local message text field:

  • it captures all typing, including edits and deletes.
  • it captures cut & paste operations, as well as edits made via a pointing device.
  • @@ -398,57 +378,58 @@
  • 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. For more information, see Rules for Attribute Values. 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.

+

In a text change event, the current message string can be compared to the previous message string in order to calculate what text changes took place. The appropriate action elements are then generated, to represent text insertions and deletions. If Preserving Key Press Intervals are supported, then the interval is implemented as the time elapsed between text change events. For additional information, see Action Elements and Rules for Attribute Values. The following guidelines are for clients that use keyboard input.

  • 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 small sequence of typing.

  • -
  • During every Transmission Interval, all buffered action elements are transmitted in <rtt> element of a <message>. This is equivalent to transmitting a small sequence of typing at a time.

  • -
  • If there are no changes to the real-time message, and no cursor movements, no unnecessary <rtt> transmission takes place.

  • +
  • During every Transmission Interval, all buffered action elements are transmitted in <rtt/> element of a <message/>. This is equivalent to transmitting a small sequence of typing at a time.

  • +
  • If there are no changes to the real-time message, then no unnecessary <rtt/> transmission takes place.

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

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

  • -
  • Processing of intervals (<w> elements) SHOULD be done via non-blocking programming techniques.

  • -
  • Upon receiving a <message> containing <body> indicating a completed message, the full message SHOULD be displayed immediately in place of the real-time message, and unprocessed action elements cleared from the playback queue. This ensures final message delivery is not delayed by late processing of action elements.

  • -
  • 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.

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

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

  • +
  • Processing of intervals (<w/> elements) SHOULD be done via non-blocking programming techniques.

  • +
  • Upon receiving a <message/> containing <body/> indicating a completed message, the full message SHOULD be displayed immediately in place of the real-time message, and unprocessed action elements cleared from the playback queue. This ensures final message delivery is not delayed by late processing of action elements.

  • +
  • If support for the <w/> element is not possible, receiving software SHOULD use an alternate text-smoothing method. See Reduced Precision Text Smoothing Methods for more info.

  • +
  • If the playback queue contains too much delay in <w/> elements (i.e. <w/> elements from two <rtt/> transmissions ago), the recipient client MAY ignore or shorten the intervals of <w/> elements, to allow lagged real-time text to "catch up" more quickly.

- -

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.

+ +

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. Recipient clients that do not support a remote cursor, can simply ignore calculating a cursor position, and skip this section.

-

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:

+

All action elements always have absolute cursor positioning. When <t/>, <e/>, or <d/> action elements are processed in incoming real-time text, the beginning value for the cursor position calculation is the absolute position value of the p attribute, according to Rules for Attribute Values. The cursor position immediately after an action element, is calculated 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.
  • +
  • After Element <t/> – Insert Text, the cursor position is the p attribute plus the length of the text being inserted. The cursor position is put at the end of inserted text.
    + This mimics normal forward cursor movement during text insertion.

  • +
  • After Element <e/> – Backspace, the cursor position is the p attribute minus the n attribute. If the n value is greater than p, then cursor position becomes 0.
    + This mimics normal cursor response to a Backspace key.

  • +
  • After Element <d/> – Forward Delete, the cursor position is the p attribute, unaffected by the n attribute.
    + This mimics normal cursor response to a Delete key.

  • +
  • After an empty Element <t/> – Insert Text (in the format of <t p='#'/> with no text to insert), the cursor position is the p attribute, and no text modification is done.
    This allows cursor response to arrow keys and/or mouse repositioning the cursor.

+

The remote cursor SHOULD be clearly distinguishable from the sender's real local cursor. One example is to use a non-blinking cursor, easily emulated with a Unicode character or the vertical bar character '|'.

-

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.

+

Whenever the cursor is moving without any text modifications (via arrow keys or mouse), the sender MAY transmit extra Element <t/> – Insert Text with an empty string to update the remote cursor position via attribute p. This maintains accurate positioning for the remote cursor in recipients that support a remote cursor. These extra elements are ignored by recipients that do not support a remote cursor.

+

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 text marking/selection operations, and doubles as the event for monitoring the 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 an <rtt> element, resulting in the <message> exceeding the XMPP server's maximum allowed length of a <message> stanza. This may result in dropped messages. It is acceptable to simply retransmit the whole real-time message using <rtt event='reset'> if the length of the <rtt> element would otherwise exceed the application's maximum chat message length. The process of retransmitting the whole real-time message, has the disadvantage of discarding Key Press Intervals for one <rtt> element.

-

For long messages, the final <rtt> transmission may be made in a separate <message> than the <message> containing the <body>. For example:

+

A large sequence of rapid message changes may generate a large series of action elements in an <rtt/> element, resulting in the <message/> exceeding the XMPP server's maximum allowed length of a <message/> stanza. This may result in dropped messages. It is acceptable to simply retransmit the whole real-time message using <rtt event='reset'/> if the length of the <rtt/> element would otherwise exceed the application's maximum chat message length.

+

For long messages, the final <rtt/> transmission may be made in a separate <message/> than the <message/> 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:

@@ -459,31 +440,49 @@ - 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.

+ +

Real-time text MAY be accompanied with XEP-0085 &xep0085;. These are simple guidelines for <message/> stanzas that include an <rtt/> element:

+
    +
  • For <rtt/> transmitted without an accompanying <body/>, include <composing/> chat state.
  • +
  • For <rtt/> transmitted with an accompanying <body/>, include the <active/> chat state.
  • +
  • Other chat states are handled as specified by XEP-0085 Chat States.
  • +
- -

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. Also see &xep0286;.

+ +

The in-band nature of this real-time text standard allows one-to-many situations. Thus, real-time text is compatible with &xep0045; (MUC), as well as concurrent simultaneous logins. Support for real-time text in MUC is OPTIONAL, and is fully Backwards Compatible with group chat participants that do not support real-time text.

+ +

For MUC, the RTT Element event attribute value of 'cancel' SHOULD NOT be used. This prevents one participant from suppressing real-time text for all participants in a group chat. Participants that turn off real-time text for themselves, can simply ignore incoming <rtt/> and not transmitting outgoing <rtt/>. Participant clients without real-time text (whether unsupported or turned off) will simply see group chat function normally on a line-by-line basis. Participants that enable real-time text during group chat, need to keep track of separate real-time messages on a per-participant basis, via full JID. As a result, participants with real-time text, will see real-time text coming from each participant that have real-time text enabled. Software MAY hide idle real-time messages to minimize on-screen clutter when more than one person is typing. Congestion control MAY also be used, via automatic adjustment of Transmission Interval, see Congestion Considerations.

+
+ +

In simultaneous login situations, transmitting of <rtt/> works in one-to-many situations without any special software support. For many-to-one situations where there is incoming <rtt/> from more than one simultaneous login, the existing Automatic Recovery of Real-Time Text already catches this situation until there is only one typist. A good implementation of Message Retransmission will improve user experience, regardless of whether or not XEP-0296 is used (&xep0296;). Alternatively, clients MAY choose to improve on this behavior, by keeping track of multiple separate real-time messages per full JID, similar to Multi-User Chat.

+
+
+ +

With real-time text, frequent screen updates may occur. Screen updates are a potential performance bottleneck, because fast typists type many key presses per second. Optimizing screen updates becomes especially important for slower platforms. Real-time messages should be updated efficiently in a flicker-free manner. Alternatively, to improve performance, the display of real-time messages may be implemented as a separate window or separate display element.

+

Battery life considerations are closely related to performance, as the addition of real-time text may impact battery life. If Preserving Key Press Intervals are supported, then the implementation of Element <w/> – Interval should be implemented in a battery-efficient manner. The Transmission Interval may vary dynamically to optimize for battery life and wireless reception. For devices where screen updates are an unavoidable inefficient bottleneck, see Reduced Precision Text Smoothing Methods to reduce the number of screen updates per second. Also see &xep0286;.

+
+ +

According to ITU-T Rec. F.703, the “Total Conversation” accessibility standard defines the simultaneous use of audio, video, and real-time text. For convenience, chat applications may be designed to have automatic negotiation of as many as possible of the three media preferred by the users.

+

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 MAY be used together simultaneously.

-

The first examples are deliberately kept simple instead of real-world, and are designed to educate in a progressively more difficult manner. For simplicity, most examples do not include the RECOMMENDED Key Press Intervals except for the last Use Case example. For real-world communications in software implementations supporting key press intervals, most transmissions will tend to resemble the last Use Case example, Real World Message With Key Press Intervals.

+

Most of these examples are deliberately kept simple. In software implementations supporting key press intervals, transmissions will most resemble the last example, Full Message Including Key Press Intervals.

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".

+ +

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

@@ -491,11 +490,11 @@ 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/>.

+ +

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/>.

@@ -521,10 +520,10 @@ ack ]]>

- -

Resulting real-time message: "Hello back"
+ +

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

@@ -533,12 +532,12 @@ 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).

+ +

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).

@@ -546,11 +545,11 @@ 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.

+ +

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.

@@ -560,14 +559,14 @@ 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.

+ +

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.

+

This is an example message containing multiple consecutive real-time message edits.

Helo @@ -577,13 +576,12 @@ World there, - ]]>

- -

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

+ +

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

@@ -605,7 +603,7 @@ - + @@ -617,7 +615,7 @@ - + @@ -633,14 +631,8 @@ - - - - - -
Element
<t>lo...planet</t>Output "lo...planet"Output "lo...planet" at end of line. Hello...planet 14
<t> World</t>Output " World"Output " World" at end of line. Hello... World 14
Hello there, World 12
<c p='18'/>Move cursor to endHello there, World18
-

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

+

Normally, the action elements are split into multiple separate transmissions. This example also does not illustrate Preserving Key Press Intervals. The Cursor Pos column is only relevant if the Optional Remote Cursor is implemented.

Representing a short chat session of three separate messages:
@@ -691,7 +683,7 @@ How are you? ]]>

- +

This example also illustrates the following:

@@ -700,23 +692,23 @@
  • The seq attribute always increments.
  • - -

    This is the most important example. It is a transmission of “Hello there!” with Key Press Intervals. It illustrates a four-second typing sequence:

    + +

    This example is a transmission of “Hello there!” while Preserving Key Press Intervals. It illustrates a four-second typing sequence:

    • The misspelled phrase “Hello tehre!” is typed;
    • -
    • Three cursor-left movements back to the mis-typed letters;
    • -
    • Two backspaces to delete the two mis-typed letters;
    • +
    • Three cursor-left movements back to the typing mistake;
    • +
    • Two backspaces to delete the typing mistake;
    • Two correct key presses to correctly spell the word “there”.
    -

    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.

    +

    In between each key press, is Element <w/> – Interval to allow the receiving client execute a small pause between action elements, which allows the playback of the typing at its original look-and-feel.

    H - e + e l - l + l o - + @@ -724,94 +716,79 @@ t - e + e h - r - + r + e - ! - - + ! + + - - - - h - e - + + + + h + e + - + Hello there! ]]>

    - -

    This real-world example also illustrate the following:

    + +

    This example also illustrate the following:

      -
    • Typing is done via Element <t> – Insert Text.
    • -
    • Cursor movements are done via Element <c> – Cursor Position.
    • -
    • Backspaces are done via Element <e> – Backspace.
    • -
    • Intervals between key presses are done via Element <w> – Interval.
    • -
    • Each <message> is delivered every one second, the default Transmission Interval.
    • -
    • To achieve the smoothest playback of typing, the total sum of all values in <w> elements in one <message> equal the Transmission Interval 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.
    • +
    • Typing is done via the REQUIRED Element <t/> – Insert Text.
    • +
    • Backspaces are done via the REQUIRED Element <e/> – Backspace.
    • +
    • There is a final transmission with a Body Element, when the message is finished.
    • +
    • Intervals between key presses are done via the RECOMMENDED Element <w/> – Interval.
    • +
    • Each <message/> is delivered every 0.7 seconds, the default RECOMMENDED Transmission Interval.
    • +
    • These action elements are generated automatically via Monitoring Message Edits RECOMMENDED method.
    • +
    • Cursor movements are done via empty <t/> elements, for an Optional Remote Cursor.
    • +
    • In order to maximize precision, and achieve the smoothest playback of typing, the total sum of all values in Element <w/> – Interval in one <message/> equal the Transmission Interval during periods of continuous typing. This also results in some <w/> interval elements being split between consecutive messages.

    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.

    -

    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 transmission of XHTML-IM formatting, in order to support transcoding of ISO 6429 formatting codes.

    + +

    It is noted there is also another real-time text standard (RFC 4103, 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 sessions with 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 specification of the specific session control standard in use for that particular session. This varies from implementation to implementation. For example, Google Talk network uses XMPP messaging for instant messages sent during audio/video conversations. Therefore, in this situation, it is recommended to use this XEP-0301 specification 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.

    +
    + +

    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. This protocol combination is specified by IETF, and by regional emergency service organizations, to be one of the protocols supported for IP based real-time emergency calls that support real-time text. Another reason is that SIP is 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.

    +

    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 covered in this version of 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.

    +

    Also, see Total Conversation – Combination With Audio And Video.

    - -

    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 sessions with 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 specification of the specific session control standard in use for that particular session. This varies from implementation to implementation. For example, Google Talk network uses XMPP messaging for instant messages sent during audio/video conversations. Therefore, in this situation, it 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. Different programming platforms use different internal Unicode encodings, which may be different from the transmission encoding (UTF-8) for XMPP. To achieve universally correct calculations for p and n attributes, consider these factors:

    -
      -
    • Multiple Unicode code points may represent one displayable Unicode character (i.e. combining marks).
      - Action elements operate on Unicode code points, not on displayable characters.

    • -
    • Characters U+10000 through U+1FFFF, which are single code points, but are represented as multiple surrogate code units in certain Unicode encodings (i.e. UTF-16).
      - Action elements operate on Unicode code points, not on individual surrogate code units.

    • -
    • Some Unicode encodings use a variable number of bytes per Unicode code point (i.e. UTF-8).
      Action elements operate on Unicode code points, not on individual bytes.

    • -
    -

    Failure to correctly calculate p and n values by counting individual Unicode code points, will result in interoperability problems in the form of scrambled text during real-time editing. In some cases, this problem do not become visible until a chat session occurs in a different international language for the first time. It is critical to follow Rules for Attribute Values in order to maintain world-wide interoperability of international text.

    +

    The main internationalization consideration involve real-time message editing of international and mixed-language text. Correct calculations for Action Elements based on Unicode Character Counting is necessary to avoid scrambled text for many languages.

    -

    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 send the message. With real-time editing, recipients can watch all text changes that occur in the sender's text, before the sender sends the final message.

    +

    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 send the message. With real-time message editing, recipients can watch all text changes that occur in the sender's text, before the sender sends the final message.

    -

    The nature of real-time text result in more frequent transmission of <message> elements than may otherwise happen in a non-real-time text conversation. This may lead to increased network and server loading of XMPP networks. Care SHOULD to be taken to use a reasonable Transmission Interval, and avoid transmitting messages at an excessive rate, to avoid creating unnecessary congestion on public XMPP networks. Also, see &xep0205;.

    -

    Network monitoring mechanisms (i.e. &xep0184; and/or &xep0199;, etc.) MAY be used to monitor reliability and latency, in order to temporarily adjust the interval to prevent failure of real-time text transmissions during extreme network conditions.

    -

    That said, the load between participants using this specification in the recommended way, will cause a load that is only marginally higher than a user communicating without this specification. This is very low compared to many other activities possible on XMPP networks including VoIP and file transfers.

    +

    The nature of real-time text result in more frequent transmission of <message/> elements than may otherwise happen in a non-real-time text conversation. This may lead to increased network and server loading of XMPP networks. Care SHOULD to be taken to use a reasonable Transmission Interval, and avoid transmitting messages at an excessive rate, to avoid creating unnecessary congestion on public XMPP networks. Also, see &xep0205;.

    +

    Network monitoring mechanisms (i.e. &xep0184; and/or &xep0199;, etc.) MAY be used to monitor reliability and latency, in order to temporarily adjust the interval to prevent failure of real-time text transmissions during extreme network conditions. This is also useful for mission-critical applications such as Next Generation 9-1-1 emergency services.

    +

    The load between participants using this specification in the recommended way, will cause a load that is only marginally higher than a user communicating without this specification. Bandwidth overhead of real-time text is very low compared to many other activities possible on XMPP networks including VoIP and file transfers.

    @@ -837,7 +814,7 @@ The protocol documented by this schema is defined in - XEP-0xxx: http://www.xmpp.org/extensions/xep-0xxx.html + XEP-0301: http://www.xmpp.org/extensions/xep-0301.html @@ -849,9 +826,7 @@ - - @@ -876,19 +851,11 @@ - - - - - - - - @@ -898,10 +865,10 @@ ]]>

    -

    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.

    +

    Acknowledgments

    +

    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, Arnoud 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.

    - +