RFC 3994
Indication of Message Composition for Instant Messaging
RFC 3994 π Indication of Message Composition for Instant Messaging
Okay bestie, here's the title block first π
- Network Working Group πΈ
- RFC number: 3994
- Title: Indication of Message Composition for Instant Messaging
- Author: H. Schulzrinne, Columbia U. π¦
- Category: Standards Track β¨
- Date: January 2005 π
The header doesn't have an Obsoletes or Updates line, so there's nothing listed there that it replaces or amends π
Status of This Memo π
This is an Internet standards track protocol for the whole Internet community, and the authors are literally asking for discussion and suggestions π£οΈ For the standardization state and status of this protocol, check the current edition of "Internet Official Protocol Standards" (STD 1). That's the official source π Distribution of this memo is unlimited, so share it around π
Copyright Notice π₯
Copyright (C) The Internet Society (2005).
Abstract β¨
So in instant messaging (IM) systems, it's really useful to know during a conversation whether the other person is composing a message, like typing or recording a voice note ποΈ This document defines a new status message content type and XML namespace that carries info about a message being composed. The status message can cover any type of message, including text, voice, or video π These status messages get delivered to the IM recipient the same way the actual instant messages do π
Table of Contents π§
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 2
2. Terminology and Conventions . . . . . . . . . . . . . . . . . 3
3. Description . . . . . . . . . . . . . . . . . . . . . . . . . 3
3.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . 3
3.2. Message Composer Behavior . . . . . . . . . . . . . . . 4
3.3. Status Message Receiver Behavior . . . . . . . . . . . . 5
3.4. Message Content . . . . . . . . . . . . . . . . . . . . 6
3.5. Additional Status Information . . . . . . . . . . . . . 6
4. Using the Status Message . . . . . . . . . . . . . . . . . . . 7
5. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
6. XML Document Format . . . . . . . . . . . . . . . . . . . . . 8
6.1. XML Schema . . . . . . . . . . . . . . . . . . . . . . . 9
7. Security Considerations . . . . . . . . . . . . . . . . . . . 9
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 10
8.1. Content-Type Registration for
'application/im-iscomposing+xml' . . . . . . . . . . . . 10
8.2. URN Sub-Namespace Registration for
'urn:ietf:params:xml:ns:im-iscomposing' . . . . . . . . 11
8.3. Schema Registration . . . . . . . . . . . . . . . . . . 11
9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 11
10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 12
10.1. Normative References . . . . . . . . . . . . . . . . . . 12
10.2. Informative References . . . . . . . . . . . . . . . . . 12
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 12
Full Copyright Statement . . . . . . . . . . . . . . . . . . . . . 13
1. Introduction π
Instant messaging (IM) is message based by definition π¬ A user composes a message by typing, speaking, or recording a video clip, then it gets sent to one or more recipients. Unlike email, IM is usually conversational, so the other person is sitting there waiting for a reply π₯Ί If no reply shows up, a participant can wrongly assume that the partner has left, or that it's their turn to type again π and then two messages end up "crossing on the wire" π
To fix that uncertainty, a bunch of commercial IM systems have an "is-typing" indicator that gets sent as soon as one person starts typing β¨οΈ This document describes a generalized version of that indicator, called the isComposing status message. As Section 3 explains in more detail, a status message is delivered to the IM recipient the same way the messages themselves are π isComposing status messages can announce the composition of any media type, not just text. For example, somebody recording an audio or video clip π₯ In the future it can also be extended to convey other IM user states β¨ For brevity, these messages get called "status messages" from here on π¦
The status messages are carried as XML, as instances of the XML schema defined in Section 6, and labeled with the content type application/im-iscomposing+xml π§
Honestly these status messages are kind of like the comfort noise packets sent during silence-suppressed interactive voice conversations π§
Events and extensions to presence, such as PIDF [6], were also considered but have a number of disadvantages. They add more overhead, because an explicit and periodic subscription is required. For page-mode delivery, subscribing to the right user agent and set of messages may not be easy. An in-band, message-based mechanism is also easier to translate across heterogeneous instant messaging systems. π
The mechanism described here aims to satisfy the requirements in [7] π―
2. Terminology and Conventions π
This memo uses the vocabulary defined in the IMPP Model document [1]. Terms like CLOSED, INSTANT MESSAGE, OPEN, PRESENCE SERVICE, PRESENTITY, WATCHER, and WATCHER USER AGENT mean the same thing they mean there π The key words MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in BCP 14, RFC 2119 [2] π
This document talks about two kinds of messages. First there's the instant message (IM), which carries the actual content between two or more users in an IM conversation. Second there's the status message, described in this document, which tells the other participants in a conversation what the current composing status is π«Ά We use the terms "content message" and "status message" for these two types.
3. Description π
3.1. Overview
We model the user of an IM system as being in one of several states. In this document that's limited to "idle" and "active" πΈ By default the user is in the "idle" state, both before they start composing a message and after they send it π
3.2. Message Composer Behavior
Only the IM user agent that's actively composing a content message generates status messages showing the current state βοΈ When the user starts composing a content message (the actual instant message), the state becomes "active", and an isComposing status message containing a <state> element indicating "active" is sent to the recipient of the content message being composed. As long as the user keeps producing message content, they stay in the "active" state πββοΈ
There are two sender timers: the active-state refresh interval, and the idle time-out interval β±οΈ
The active-state refresh interval determines how often "active" state messages get sent while the composer is still in "active" state. The composing user chooses this interval and it's indicated in the <refresh> element of the status message, as an integer number of seconds. Each transmission of the isComposing message resets the timer. The interval SHOULD be no shorter than 60 seconds. A message composer MAY decide not to send active-state refresh messages at all π To signal that, you leave out the refresh interval, and that makes the receiver assume the sender has gone idle after 120 seconds. (In most cases, the content message will have been sent by then π¨) No refresh messages get sent in the "idle" state.
The active-state refresh mechanism covers the case where the user logs off or the application crashes before the content message is finished. π
If the user stops composing for longer than a configured time interval, the idle timeout, the state moves to "idle" and an "idle" status message gets sent π΄ If the user starts composing again while in the "idle" state, the state moves to "active" and the matching status message gets sent. Unless the user configures something else, the idle timeout SHOULD have a default value of 15 seconds β³
If a content message gets sent before the idle threshold expires, no "idle" indication is needed. So in most cases you only get one status message per content message π₯° Either way, the message rate is limited to one status message per refresh threshold interval π¦
The state transitions are shown in Figure 1 π¦
+-------------+
|+-----------+|
|| ||
+------>| idle |<--------+
| || || |
| |+-----------+| |
| +------+------+ |
content | | | idle timeout
msg. sent | | composing | w/o activity
----------- | | ------------- | ------------------
-- | | "active" msg. | "idle" status msg.
| | |
| +------V------+ |
| | | |
| | | |
| | | |
+------+ active +--------+
| |
| |------+
+------^------+ | refresh timeout
| | --------------------
| | "active" status msg.
+-------------+
Figure 1. Sender State Diagram π
3.3. Status Message Receiver Behavior
The receiver uses status messages to figure out the state of the content message sender π If the most recent "active" status message had a <refresh> value, the refresh time-out gets set to that value. Otherwise it's 120 seconds. At the receiver, the state moves from "active" back to "idle" under three conditions:
- A status message with status "idle" is received.
- A content message is received.
- The refresh interval expires.
Receivers MUST be able to handle multiple consecutive isComposing messages with "active" state, regardless of the refresh interval πͺ
The state transitions are shown in Figure 2 π¦
+-------------+
|+-----------+|
|| ||
+------>| idle |<------+
| || || |
| |+-----------+| |
| +------+------+ |
| | |
"idle" recd. | |"active" msg.| refresh timeout
or content recd. | | | or 120s
| | |
| +------V------+ |
| | | |
| | | |
| | | |
+------+ active +------+
| |
| |
+-------------+
Figure 2. Receiver State Diagram π
3.4. Message Content β¨
okay so quick recap before we go further π this bit is non-normative, meaning it's just vibes and not actual rules. For the official format, go check Section 6 π
The message is an <isComposing> element with a mandatory <state> element that says whether the composer is idle or active πΈ Then there are three optional extras: <lastactive> (when they last did something), <contenttype> (what kind of message they're making), and <refresh> (how long the receiver can wait before getting an update from the composer) π¦ We'll get into the details next π
3.5. Additional Status Information π§
The status message can carry extra optional bits that give more detail on the composing activity π Any of these can show up in both "active" and "idle" messages.
The optional <lastactive> element is the absolute time when the user last added or edited content β°
The optional <contenttype> element tells you what type of medium the messaging terminal is composing in right now π§ It can be just a MIME media type, like "audio" or "text", or a media type and subtype, like "text/html". Think of it as a hint for the user, not a promise, that the actual message will really only contain what it says π It just helps the human recipient get ready for the likely format π
To further describe message composition, the XML schema or the set of allowable state names can be extended in future documents π Recipients of status messages implementing this specification without extensions MUST treat state tokens other than "idle" and "active" as "idle". Additional elements MUST use their own namespaces and MUST be designed so that receivers can safely ignore such extensions. Adding elements to the namespace defined in this document is not permitted. Bestie, don't touch that namespace π«
The isComposing status message MAY be carried in CPIM messages [3].
Such a wrapper is super useful if messages get relayed by a conference server, since the CPIM message keeps the identity of the original composer π«Ά
4. Using the Status Message β¨
The isComposing status message can be used with either page mode or session mode, although session mode is a more natural fit π¦ In session mode, the status message is sent as part of the messaging stream. Its usage is negotiated just like any other media type in that stream, with details depending on the session mode protocol π₯
Sending the status messages inside the session-mode messaging stream has at least three benefits π First, it guarantees proper ordering and synchronization with the actual content messages being composed. In messaging systems that guarantee in-order delivery, this stops an active indication from showing up at the receiver after the real message has already arrived, which would happen if the two got reordered across two delivery mechanisms π
Secondly, end-to-end security can be applied to the messages π Thirdly, session negotiation mechanisms can be used to turn it on and off at any time, and even to negotiate its use in a single direction at a time πΈ
Usage with page mode is also pretty straightforward: the status message is carried as the body of a page mode message π In SIP-based IM, the composer MUST cease transmitting status messages if the receiver returned a 415 status code (Unsupported Media Type) in response to a MESSAGE request containing the status indication. Respect the 415, bestie π
ββοΈ
The sender can't be assured that the status message gets delivered before the actual content being composed arrives π¬ BUT (not caps-locked, just vibes) SIP page mode is limited to one unacknowledged message, so out-of-order delivery is unlikely, although still possible if proxies are involved π§
5. Examples π
Here are two examples of a status message. First, an active composer working on some plain text:
<?xml version="1.0" encoding="UTF-8"?>
<isComposing xmlns="urn:ietf:params:xml:ns:im-iscomposing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:ietf:params:xml:ns:im-composing
iscomposing.xsd">
<state>active</state>
<contenttype>text/plain</contenttype>
<refresh>90</refresh>
</isComposing>
Next, an idle composer whose last activity was a while back, and who was working on audio:
<?xml version="1.0" encoding="UTF-8"?>
<isComposing xmlns="urn:ietf:params:xml:ns:im-iscomposing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:ietf:params:xml:ns:im-composing
iscomposing.xsd">
<state>idle</state>
<lastactive>2003-01-27T10:43:00Z</lastactive>
<contenttype>audio</contenttype>
</isComposing>
6. XML Document Format π
An isComposing document is an XML document that MUST be well formed and SHOULD be valid π§ isComposing documents MUST be based on XML 1.0 and MUST be encoded by using UTF-8. This spec uses XML namespaces to identify isComposing documents. The namespace URI for elements defined for this purpose is a URN using the namespace identifier 'ietf'. Here's the URN, no cap, copy it exactly π
urn:ietf:params:xml:ns:im-iscomposing
6.1. XML Schema π¦
Here's the schema, and yes, it's giving rigid but it's also the source of truth π
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="urn:ietf:params:xml:ns:im-iscomposing"
elementFormDefault="qualified"
attributeFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:tns="urn:ietf:params:xml:ns:im-iscomposing">
<xs:element name="isComposing">
<xs:complexType>
<xs:sequence>
<xs:element name="state" type="xs:string"/>
<xs:element name="lastactive" type="xs:dateTime"
minOccurs="0"/>
<xs:element name="contenttype" type="xs:string"
minOccurs="0"/>
<xs:element name="refresh" type="xs:positiveInteger"
minOccurs="0"/>
<xs:any namespace="##other" processContents="lax"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
7. Security Considerations π¨
Okay, this section is serious, so I'm putting on my serious face π€ The isComposing indication gives a fine-grained view of the activity of the entity composing, so it deserves particularly careful confidentiality protection. Only the intended recipient of the message should receive the isComposing indication π
Since the status messages are carried by using the IM protocol itself, all security considerations of the underlying IM protocol also apply to the isComposing status messages π«£
There are potential privacy issues in sending isComposing status messages before an actual conversation has been established between the communicating users π A status message may be sent even if the user later abandons the message, so it's not a guarantee of anything. It is RECOMMENDED that isComposing indications in page mode are only sent when a message is being composed as a reply to an earlier message. This document does not prescribe how an implementation detects whether a message is in response to an earlier one in page mode, but elapsed time or user interface behavior might be used as hints π§
8. IANA Considerations π
8.1. Content-Type Registration for 'application/im-iscomposing+xml' π
Here's the registration template, copied exactly because IANA is very picky (and honestly, same) π
To: ietf-types@iana.org
Subject: Registration of MIME media type application/
im-iscomposing+xml
MIME media type name: application
MIME subtype name: im-iscomposing+xml
Required parameters: (none)
Optional parameters: charset; Indicates the character encoding of
enclosed XML. Default is UTF-8.
Encoding considerations: Uses XML, which can employ 8-bit characters,
depending on the character encoding used. See RFC 3023 [4],
section 3.2.
Security considerations: This content type is designed to carry
information about current user activity, which may be considered
private information. Appropriate precautions should be adopted to
limit disclosure of this information.
Interoperability considerations: This content type provides a common
format for exchange of composition activity information.
Published specification: RFC 3994
Applications which use this media type: Instant messaging systems.
Additional information: none
Person & email address to contact for further information: Henning
Schulzrinne, hgs@cs.columbia.edu
Intended usage: LIMITED USE
Author/Change controller: This specification is a work item of the
IETF SIMPLE working group, with the mailing list address
simple@ietf.org.
Other information: This media type is a specialization of
application/xml RFC 3023 [4], and many of the considerations
described there also apply to application/im-iscomposing+xml.
8.2. URN Sub-Namespace Registration for 'urn:ietf:params:xml:ns:im-iscomposing' πΈ
Next up is the namespace registration, with its little XHTML page included π§
URI: urn:ietf:params:xml:ns:im-iscomposing
Description: This is the XML namespace for XML elements defined by
RFC 3994 to describe composition activity by an instant messaging
client using the application/im-iscomposing+xml content type.
Registrant Contact: IETF, SIMPLE working group, simple@ietf.org,
Henning Schulzrinne, hgs@cs.columbia.edu
XML:
BEGIN
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
"http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type"
content="text/html;charset=iso-8859-1"/>
<title>Is-composing Indication for Instant Messaging</title>
</head>
<body>
<h1>Namespace for SIMPLE iscomposing extension</h1>
<h2>urn:ietf:params:xml:ns:im-composing</h2>
<p>See <a href="[URL of published RFC]">RFC3994</a>.</p>
</body>
</html>
END
8.3. Schema Registration π
This section registers a new XML schema per the procedures in [5]. Here are the details π
URI: urn:ietf:params:xml:schema:im-composing
Registrant Contact: IETF, SIMPLE working group, (simple@ietf.org),
Henning Schulzrinne (hgs@cs.columbia.edu).
The XML for this schema can be found as the sole content of Section 6.1 π
9. Acknowledgements π«Ά
Huge thanks to Ben Campbell, Miguel Garcia, Scott Hollenbeck, Christian Jansson, Cullen Jennings, Hisham Khartabil, Allison Mankin, Aki Niemi, Jonathan Rosenberg, and Xiaotao Wu for providing helpful comments π
10. References π
10.1. Normative References π
[1] Day, M., Rosenberg, J., and H. Sugano, "A Model for Presence and Instant Messaging", RFC 2778, February 2000.
[2] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.
[3] Klyne, G. and D. Atkins, "Common Presence and Instant Messaging (CPIM): Message Format", RFC 3862, August 2004.
[4] Murata, M., St. Laurent, S., and D. Kohn, "XML Media Types", RFC 3023, January 2001.
[5] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, January 2004.
10.2. Informative References π¦
[6] Sugano, H., Fujimoto, S., Klyne, G., Bateman, A., Carr, W., and J. Peterson, "Presence Information Data Format (PIDF)", RFC 3863, August 2004.
[7] Rosenberg, J., "Advanced Instant Messaging Requirements for the Session Initiation Protocol (SIP)", Work in Progress, February 2004.
Author's Address π
Henning Schulzrinne
Columbia University
Department of Computer Science
450 Computer Science Building
New York, NY 10027
US
Phone: +1 212 939 7004
EMail: hgs@cs.columbia.edu
URI: http://www.cs.columbia.edu/~hgs
Full Copyright Statement π
Okay bestie, the legal bits, but make it cute π. The Internet Society owns the copyright for this one, dated 2005 π . This document is covered by the rights, licenses, and restrictions in BCP 78, and apart from what BCP 78 says, the authors keep all of their rights π¦.
This document and everything in it is given to you "AS IS" π«Ά, and I need you to read this part carefully. THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, including, but not limited to, any promise that using the information here won't infringe anybody's rights, and any implied warranty of merchantability or fitness for a particular purpose π. Nobody is promising it'll be perfect, periodt π .
Intellectual Property π
The IETF is not picking sides on whether any Intellectual Property Rights (or other rights) that someone might claim over the technology in this document are valid, how far they reach, or whether a license for them is even available π. It also hasn't gone out and hunted down any of those rights itself. If you want the IETF's rules on rights in IETF Documents, look in BCP 78 and BCP 79 π.
Any IPR disclosures sent to the IETF Secretariat are kept, along with any assurances of licenses that get made available, and the results of anyone trying to get a general license or permission to use proprietary rights for this spec. Implementers and users can find all of that in the IETF's online IPR repository at http://www.ietf.org/ipr π§.
The IETF also invites anyone who's interested to flag any copyrights, patents, patent applications, or other proprietary rights that might cover technology needed to implement this standard π₯. Send that info to the IETF at ietf-ipr@ietf.org π.
Acknowledgement π
Shoutout to the funding situation π: the Internet Society is currently paying for the RFC Editor function π.
π¦ where this page comes from
- ietf: rfc3994 2005-02
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms