From 828ca33f2d10de49af5a0b886f0f243926b9bfc1 Mon Sep 17 00:00:00 2001
From: Peter Saint-Andre Added content-replace action; modified reasoncode and reasontext to use elements instead of attributes; added sid element to handle alternative-session condition; modified examples to use file transfer instead of voice chat; moved profile element to XEP-0167 and XEP-0180. Naturally, more complex scenarios are probable; such scenarios are described in other specifications, such as XEP-0167 for voice chat. The simplest flow might happen as follows. The example is that of a voice chat (see XEP-0167) initiated by Romeo, where the transport is &xep0177;. The simplest flow might happen as follows. The example is that of a file transfer offer, where the transport method is &xep0065;.
If the proposed session is acceptable, the responder definitively accepts it.
-The initiator then acknowledges the session-accept action.
-The parties then begin to exchange media. In this case they would exchange audio using the Speex codec at a clockrate of 8000 since that is the highest-priority codec for the responder (as determined by the XML order of the &PAYLOADTYPE; children).
-The parties may continue the session as long as desired.
-Eventually, one of the parties terminates the session.
+The parties would then attempt to negotiate use of the SOCKS5 Bytestreams transport method, as described in XEP-0065.
+Once the file transfer succeeds, one of the parties terminates the session.
The other party MUST then acknowledge termination of the session.
+The other party then acknowledges termination of the session.
Note: The syntax and semantics of the &DESCRIPTION; and &TRANSPORT; elements are out of scope for this specification, since they are defined in related specifications. The syntax and semantics of the &JINGLE; and &CONTENT; elements are specified in this document under Formal Definition.
Note: In order to expedite session establishment, the initiator MAY send transport candidates (e.g., for negotiation of the ICE transport) immediately after sending the "session-initiate" message and before receiving acknowledgement from the responder (i.e., the initiator MUST consider the session to be PENDING even before receiving acknowledgement). Given in-order delivery, the responder should receive such "transport-info" messages after receiving the "session-initiate" message (if not, it is appropriate for the responder to return <unknown-session/> errors since according to its state machine the session does not exist).
Unless one of the following errors occurs, the responder SHOULD acknowledge receipt of the initiation request.
However, after acknowledging the session initiation request, the responder may subsequently determine that it cannot proceed with negotiation of the session (e.g., because it does not support any of the offered application formats or transport methods, because a human user is busy or unable to accept the session, because a human user wishes to formally decline the session, etc.). In these cases, the responder SHOULD immediately acknowledge the session initiation request but then terminate the session with an appropriate reasoncode as described in the Termination section of this document.
+However, after acknowledging the session initiation request, the responder may subsequently determine that it cannot proceed with negotiation of the session (e.g., because it does not support any of the offered application formats or transport methods, because a human user is busy or unable to accept the session, because a human user wishes to formally decline the session, etc.). In these cases, the responder SHOULD immediately acknowledge the session initiation request but then terminate the session with an appropriate reason as described in the Termination section of this document.
If the responder acknowledges receipt of the initation request, both parties must consider the session to be in the PENDING state.
If the initiator is unknown to the responder (e.g., via presence subscription as defined in &rfc3921; or stanza session negotiation as defined in &xep0155;) and the responder has a policy of not communicating via Jingle with unknown entities, it SHOULD return a &unavailable; error.
If the responder does not support Jingle, it MUST return a &unavailable; error.
If the responder wishes to redirect the request to another address, it SHOULD return a &redirect; error.
If the responder does not have sufficient resources to participate in a session, it SHOULD return a &constraint; error.
If the initiation request was malformed, the responder MUST return a &badrequest; error.
In order to gracefully end the session (which MAY be done at any point after acknowledging receipt of the initiation request, including immediately thereafter in order to decline the request), either the responder or the initiator MUST send a "terminate" action to the other party.
-The party that terminates the session SHOULD include a 'reasoncode' attribute that specifies why the session is being terminated. Examples follow.
-One reason for terminating the session is that the terminating party is busy; in this case, the recommended reasoncode is "busy".
+The party that terminates the session SHOULD include a <reason/> element that specifies why the session is being terminated. Examples follow.
+One reason for terminating the session is that the terminating party is busy; in this case, the recommended condition is "busy".
Another reason for terminating the session is that the terminating party wishes to formally decline the session; in this case, the recommended reasoncode is "decline".
+Another reason for terminating the session is that the terminating party wishes to formally decline the session; in this case, the recommended condition is "decline".
Another reason for terminating the session is that the terminating party already has an existing session with the other party and wishes to use that session rather than initiate a new session; in this case, the recommended reasoncode is "alternative-session" and the terminating party should include the session ID of the atlernative session in the 'reasontext' attribute.
+Another reason for terminating the session is that the terminating party already has an existing session with the other party and wishes to use that session rather than initiate a new session; in this case, the recommended condition is "alternative-session" and the terminating party SHOULD include the session ID of the atlernative session in the <sid/> element.
Another reason for terminating the session is that the terminating party does not support any of the offered application formats; in this case, the recommended reasoncode is "unsupported-applications".
+Another reason for terminating the session is that the terminating party does not support any of the offered application formats; in this case, the recommended condition is "unsupported-applications".
Another reason for terminating the session is that the terminating party does not support any of the offered transport methods; in this case, the recommended reasoncode is "unsupported-transports".
+Another reason for terminating the session is that the terminating party does not support any of the offered transport methods; in this case, the recommended condition is "unsupported-transports".
Upon receiving an action of "session-terminate", the other party MUST then acknowledge termination of the session:
Note: As soon as an entity sends a "session-terminate" action, it MUST consider the session to be in the ENDED state (even before receiving acknowledgement from the other party). If the terminating entity receives additional Jingle-related IQ-sets from the other party after sending the "session-terminate" action, it MUST reply with an <unknown-session/> error.
Unfortunately, not all sessions end gracefully. In applications of Jingle that also involve the exchange of presence information, receipt of &UNAVAILABLE; from the other party MAY be considered a session-ending event. However, in this case there is nothing for the party to acknowledge.
At any point after initiation of a Jingle session, either entity MAY send an informational message to the other party, for example to change a transport method, inform the other party that a device is ringing or that a scheduled event has occurred or will occur, etc.
+At any point after initiation of a Jingle session, either entity MAY send an informational message to the other party, for example to inform the other party that a device is ringing.
+An informational message MUST be an IQ-set containing a &JINGLE; element whose 'action' attribute is set to a value of "session-info" or "transport-info"; the &JINGLE; element MUST further contain a payload child element (specific to the session or to a transport method) that specifies the information being communicated. If the party that receives an informational message does not understand the payload, it MUST return a &feature; error with a Jingle-specific error condition of <unsupported-info/>.
The structure of the <reason/> element is as follows.
+The defined conditions are described in the folloiwing table.
+Element | +Description | +
---|---|
<alternative-session/> | +The party prefers to use an existing session with the peer rather than initiate a new session; the session ID of the alternative session should be provided in the reasontext attribute. | +
<busy/> | +The party is busy and cannot accept communications. | +
<connectivity-error/> | +The action is related to connectivity problems. | +
<decline/> | +The party wishes to formally decline the session. | +
<general-error/> | +The action is related to a non-specific application error. | +
<media-error/> | +The action is related to media processing problems. | +
<no-error/> | +The action is generated during the normal course of state management. | +
<success/> | +The session has been successfully completed. | +
<unsupported-applications/> | +The party supports none of the offered application types. | +
<unsupported-transports/> | +The party supports none of the offered transport methods. | +
If an entity supports Jingle, it MUST advertise that fact by returning a feature of "urn:xmpp:tmp:jingle" &NSNOTE; in response to a &xep0030; information request. The response MUST also include features for the application formats and transport methods supported by the responding entity, as described in the relevant specifications.
The XMPP Registrar shall maintain a registry of reason codes related to Jingle actions.
- ®PROCESS; -
- the value of the 'reasoncode' attribute
- a natural-language summary of the reason code
- the document in which this reason code is specified
-
- ]]>
-
The following submission registers reasoncodes currently in use. Refer to the registry itself for a complete and current list of reasoncodes.
-
- alternative-session
-
- the party prefers to use an existing session with the peer
- rather than initiate a new session; the session ID of the
- alternative session should be provided in the reasontext
- attribute
-
- XEP-0166
-
-
-
- busy
- the party is busy
- XEP-0166
-
-
-
- decline
- the party wishes to formally decline the session
- XEP-0166
-
-
-
- connectivity-error
- the action is related to connectivity problems
- XEP-0166
-
-
-
- general-error
- the action is related to a non-specific application error
- XEP-0166
-
-
-
- media-error
- the action is related to media processing problems
- XEP-0166
-
-
-
- no-error
- the action is generated during the normal course of state management
- XEP-0166
-
-
-
- unsupported-applications
- the party supports none of the offered application formats
- XEP-0166
-
-
-
- unsupported-transports
- the party supports none of the offered transport methods
- XEP-0166
-
- ]]>
-