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 file transfer offer, where the transport method is &xep0065;.
+Naturally, more complex scenarios are possible; 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 offer, where the transport method is &xep0176;.
The initiator and responder would then exchange media using any of the acceptable codecs.
-Eventually, one of the parties (here the responder) can terminate the sessio.
+Eventually, one of the parties (here the responder) will terminate the session.
This document defines the signalling protocol only. Additional documents specify the following:
Various application formats (audio, video, etc.) and, where possible, mapping of those types to the Session Description Protocol (SDP; see &rfc4566;); examples include Jingle RTP Sessions and Jingle Video via RTP.
Various transport methods; examples include &xep0176; and Raw UDP Transport.
Procedures for mapping the Jingle signalling protocol to existing signalling standards such as the IETF's Session Initiation Protocol (SIP) and the ITU's H.323 protocol (see &h323;); these documents are forthcoming.
Various application formats (audio, video, etc.) and, where possible, mapping of those types to the Session Description Protocol (SDP; see &rfc4566;); examples include Jingle RTP Sessions and &xep0234;.
Various transport methods; examples include Jingle ICE-UDP Transport and &xep0177;.
Procedures for mapping the Jingle signalling protocol to existing signalling standards such as the IETF's Session Initiation Protocol (SIP) and the ITU's H.323 protocol (see &h323;); see for example &xmppsipmedia;.
In diagrams, the following conventions are used:
This document defines the semantics and syntax for overall session management. It also provides pluggable "slots" for application formats and transport methods, which are specified in separate documents.
At the most basic level, the process for initial negotiation of a Jingle session is as follows (i.e., the actions that can be generated during the PENDING state):
After the initial session negotiation has been completed and the session is in the ACTIVE state, the parties can adjust the session definition. This can involve sending the content-modify, content-remove, content-add, and transport-replace actions. In addition, certain transport methods allow continued sending of transport-info actions while in the ACTIVE state. And naturally the parties may send session-info actions at any time.
+After the initial session negotiation has been completed and the session is in the ACTIVE state, the parties can adjust the session definition by sending the content-modify, content-remove, content-add, and transport-replace actions. In addition, certain transport methods allow continued sending of transport-info actions while in the ACTIVE state. And naturally the parties can send session-info actions at any time.
The state machine for overall session management (i.e., the state per Session ID) is as follows:
@@ -484,11 +498,12 @@ Romeo Juliet
|/ |
PENDING o----------------------+ |
| | content-accept, | |
+ | | content-add, | |
| | content-modify, | |
| | content-remove, | |
| | session-info, | |
- | | transport-accept | |
- | | transport-info | |
+ | | transport-accept, | |
+ | | transport-info, | |
| | transport-replace | |
| +-------------------+ |
| |
@@ -500,8 +515,8 @@ PENDING o----------------------+ |
| | content-modify, | |
| | content-remove, | |
| | session-info, | |
- | | transport-accept | |
- | | transport-info | |
+ | | transport-accept, | |
+ | | transport-info, | |
| | transport-replace | |
| +-------------------+ |
| |
@@ -511,83 +526,46 @@ PENDING o----------------------+ |
|
o ENDED
- There are three overall session states:
+As shown, there are three overall session states:
The actions related to management of the overall Jingle session are described in the following table.
-Action | -Description | -
---|---|
content-accept | -Accept a content-add action received from another party. | -
content-add | -Add one or more new content definitions to the session. The sender MUST specify only the added content definition(s), not the added content definition(s) plus the existing content definition(s). Therefore it is the responsibility of the recipient to maintain a local copy of the current content definition(s). This action MUST NOT be sent while the session is in the PENDING state. If the recipient wishes to include the new content definition in the session, it MUST send a content-accept action to the other party. |
-
content-modify | -Change the direction of an existing content definition thorugh modification of the 'senders' attribute. If the recipient deems the directionality of a content-modify action to be unacceptable, it MAY reply with a contrary content-modify action, terminate the session, or simply refuse to send or accept application data in the new direction. In any case, the recipient MUST NOT send a content-accept action in response to the content-modify. |
-
content-remove | -Remove one or more content definitions from the session. The sender MUST specify only the removed content definition(s), not the removed content definition(s) plus the remaining content definition(s). Therefore it is the responsibility of the recipient to maintain a local copy of the current content definition(s). Upon receiving a content-remove from the other party, the recipient MUST NOT send a content-accept and MUST NOT continue to negotiate the transport method related to that content definition or send application data related to that content definition. The recipient MUST NOT send a content-accept in response to a content-remove. |
-
session-accept | -Definitively accept a session negotiation (implicitly this action also serves as a content-accept). | -
session-info | -Send session-level information, such as (for Jingle RTP sessions) a ringing message. | -
session-initiate | -Request negotiation of a new Jingle session. | -
session-terminate | -End an existing session. | -
transport-accept | -Accept a transport-replace action received from another party. | -
transport-info | -Exchange transport candidates; it is mainly used in XEP-0176 but may be used in other transport specifications. | -
transport-replace | -Redefine a transport method. | -
The actions related to management of the overall Jingle session are as follows (detailed definitions are provided in under Action Attribute).
+This section defines the high-level flow of a Jingle session. More detailed descriptions are provided in the specifications for Jingle application formats and transport methods.
In order to initiate a Jingle session, the initiator must determine which of the responder's XMPP resources is best for the desired application format. Methods for doing so are out of scope for this specification. However, see the Determining Support section of this document (and associated specifications) for relevant information.
+In order to initiate a Jingle session, the initiator needs to determine which of the responder's XMPP resources is best for the desired application format. Methods for doing so are out of scope for this specification. However, see the Determining Support section of this document (and associated specifications) for relevant information.
Once the initiator has discovered which of the responder's XMPP resources is ideal for the desired application format, it sends a session initiation request to the responder. This request is an IQ-set containing a &JINGLE; element qualified by the 'urn:xmpp:tmp:jingle' namespace &NSNOTE;, where the value of the 'action' attribute is "session-initiate" and where the &JINGLE; element contains one or more &CONTENT; elements. Each &CONTENT; element defines a content type to be transferred during the session, and each &CONTENT; element in turn contains one &DESCRIPTION; child element that specifies a desired application format and one &TRANSPORT; child element that specifies a potential transport method. If either party wishes to propose the use of multiple transport methods for the same application format, it must send multiple &CONTENT; elements.
+Once the initiator has discovered which of the responder's XMPP resources is ideal for the desired application format, it sends a session initiation request to the responder. This request is an IQ-set containing a &JINGLE; element qualified by the 'urn:xmpp:jingle:0' namespace &VNOTE;, where the value of the 'action' attribute is "session-initiate" and where the &JINGLE; element contains one or more &CONTENT; elements. Each &CONTENT; element defines a content type to be transferred during the session, and each &CONTENT; element in turn contains one &DESCRIPTION; child element that specifies a desired application format and one &TRANSPORT; child element that specifies a potential transport method. If either party wishes to propose the use of multiple transport methods for the same application format, it MUST include multiple &CONTENT; elements.
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 action 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 actions after receiving the session-initiate action (if not, it is appropriate for the responder to return <unknown-session/> errors since according to its state machine the session does not exist).
+Note: The syntax and semantics of the &DESCRIPTION; and &TRANSPORT; elements are out of scope for this document, 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 action 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 in accordance with &xmppcore;, the responder will receive such transport-info actions after receiving the session-initiate action (if not, it is appropriate for the responder to return <unknown-session/> errors since according to its state machine the session does not exist).
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.
+However, after acknowledging the session initiation request, the responder might 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.
There are several reasons why the responder might immediately return an error instead of acknowledging receipt of the initiation request:
@@ -635,7 +612,7 @@ PENDING o----------------------+ |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 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 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 wishes to redirect the request to another address, it MUST 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 responder does not have sufficient resources to participate in a session, it MUST return a &constraint; error.
If (after negotiation of transport methods and application formats as well as checking of transport candidates) the responder determines that it will be able to establish a connection, it sends a definitive acceptance to the initiator.
-Note: In the session-accept stanza, the &JINGLE; element MUST contain one or more <content/> elements, each of which MUST contain one <description/> element and one <transport/> element. The &JINGLE; element SHOULD possess a 'responder' attribute that explicitly specifies the full JID of the responding entity; after sending acknowledgement of the session-accept, the initiator SHOULD send all future commmunications about this Jingle session to the JID provided in the 'responder' attribute and note the new JID in the user interface.
-The initiator then acknowledges the responder's definitive acceptance, after which the parties can exchange media over the negotiated connection.
-If one of the parties cannot find a suitable transport method or candidate, it SHOULD terminate the session as described below.
-Once a session is in the ACTIVE state, it may be modified via a content-add, content-modify, content-remove, or transport-info action. Examples of such modifications are shown in the specifications for various application formats and transport methods.
-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 session-terminate action to the other party.
-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".
-And the initiator acknowledges session acceptance:
-The initiator then acknowledges the responder's definitive acceptance, after which the parties can exchange media over the negotiated connection.
+The initiator and responder would then exchange media using any of the acceptable codecs.
-Eventually, one of the parties (here the responder) can terminate the sessio.
-If one of the parties cannot find a suitable transport method or candidate, it SHOULD terminate the session as described below.
+Once a session is in the ACTIVE state, it might be modified via a content-add, content-modify, content-remove, or transport-info action. Examples of such modifications are shown in the specifications for various application formats and transport methods.
+In order to gracefully end the session (which can 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 session-terminate action to the other party.
+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 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 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 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 condition is "unsupported-transports".
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.
@@ -852,28 +826,44 @@ PENDING o----------------------+ | id='ringing1' to='romeo@montague.net/orchard' type='set'> -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/>.
+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 SHOULD further contain a payload child element (specific to the application format or 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/>.
If either party receives an empty session-info action for an active session, it MUST send an empty IQ result; this way, an empty session-info action may be used as a "ping" to determine session vitality.
-Informational messages are specific to a particular application type or transport method and therefore are described in specifications other than this one.
+However, the &JINGLE; element associated with a session-info action MAY be empty. If either party receives an empty session-info action for an active session, it MUST send an empty IQ result; this usage functions as a "ping" to determine session vitality.
+The value of the 'action' attribute SHOULD be one of the following. If an entity receives a value not defined here, it SHOULD ignore attribute and SHOULD return a &badrequest; error to the sender.
+The content-accept action is used to accept a content-add action received from another party.
+The content-add action is used to add one or more new content definitions to the session. The sender MUST specify only the added content definition(s), not the added content definition(s) plus the existing content definition(s). Therefore it is the responsibility of the recipient to maintain a local copy of the current content definition(s). If the recipient wishes to include the new content definition in the session, it MUST send a content-accept action to the other party.
+The content-modify action is used to change the direction of an existing content definition thorugh modification of the 'senders' attribute. If the recipient deems the directionality of a content-modify action to be unacceptable, it MAY reply with a contrary content-modify action, terminate the session, or simply refuse to send or accept application data in the new direction. In any case, the recipient MUST NOT send a content-accept action in response to the content-modify.
+The content-remove action is used to remove one or more content definitions from the session. The sender MUST specify only the removed content definition(s), not the removed content definition(s) plus the remaining content definition(s). Therefore it is the responsibility of the recipient to maintain a local copy of the current content definition(s). Upon receiving a content-remove from the other party, the recipient MUST NOT send a content-accept and MUST NOT continue to negotiate the transport method related to that content definition or send application data related to that content definition.
The session-accept action is used to definitively accept a session negotiation (implicitly this action also serves as a content-accept). A session-accept action indicates acceptance only of the content definition(s) included in the session-initiate, not any content definition(s) subsequently added during the PENDING state. In the session-accept stanza, the &JINGLE; element MUST contain one or more <content/> elements, each of which MUST contain one <description/> element and one <transport/> element. The &JINGLE; element SHOULD possess a 'responder' attribute that explicitly specifies the full JID of the responding entity; after sending acknowledgement of the session-accept, the initiator SHOULD send all future commmunications about this Jingle session to the JID provided in the 'responder' attribute and note the new JID in the user interface.
+The session-info action is used to send session-level information, such as (for Jingle RTP sessions) a ringing message.
+The session-initiate action is used to request negotiation of a new Jingle session.
+The session-terminate action is used to end an existing session.
+The transport-accept action is used to accept a transport-replace action received from another party.
+The transport-info action is used to exchange transport candidates; it is mainly used in XEP-0176 but might be used in other transport specifications.
+The transport-replace action is used to redefine a transport method.
+It is possible that two instances of certain actions can be sent at the same time in the context of an existing session, one by each party; for example, both parties might simulaneously attempt to send a content-add, content-modify, or content-remove action. In all such cases, the action sent by the initiator MUST overrule the action sent by the responder; i.e., both parties MUST accept the action sent by the initiator and the initiator MUST return an &unexpected; error to the responder for the duplicate action.
+The attributes of the &CONTENT; element are as follows.
creator | -Which party originally generated the content type (used to prevent race conditions regarding modifications). | +Which party originally generated the content type (used to prevent race conditions regarding modifications); the defined values are "initiator" and "responder" (where the default is "initiator"). | REQUIRED |
name | -A unique name or identifier for the content type according to the creator, which MAY have semantic meaning in order to differentiate this content type from other content types (e.g., two content types containing video media could differentiate between "room-pan" and "slides"). | +A unique name or identifier for the content type according to the creator, which MAY have meaning to a human user in order to differentiate this content type from other content types (e.g., two content types containing video media could differentiate between "room-pan" and "slides"). | REQUIRED |
senders | -Which parties in the session will be generating content; the allowable values are "initiator", "responder", or "both" (where "both" is the default). | +Which parties in the session will be generating content; the allowable values are "initiator", "responder", or "both" (where the default is "both"). | RECOMMENDED |
The defined conditions are described in the folloiwing table.
+The defined conditions are described in the following table.
Element | @@ -953,7 +982,7 @@ PENDING o----------------------+ |||
---|---|---|
<busy/> | -The party is busy and cannot accept communications. | +The party is busy and cannot accept a session. |
<connectivity-error/> | @@ -989,10 +1018,13 @@ PENDING o----------------------+ |
The syntax and semantics of the <thread/> element exactly matches that of the <thread/> element as defined for the &MESSAGE; stanza (qualified by the 'jabber:client' namespace) as defined in &xmppim;. It is used to associate a Jingle session or sessions with an ongoing conversation, so that user interfaces with the ability to present multiple interactions in the same window can show an association between the conversation and the Jingle session(s).
+The Jingle-specific error conditions are as follows. These condition elements are qualified by the 'urn:xmpp:tmp:jingle:errors' namespace &NSNOTE;.
+The Jingle-specific error conditions are as follows. These condition elements are qualified by the 'urn:xmpp:jingle:errors:0' namespace &VNOTE;.
Jingle Condition | @@ -1018,7 +1050,7 @@ PENDING o----------------------+ |
---|