From b7605a47af3f94ffc2498c11a28beb12e4f224db Mon Sep 17 00:00:00 2001
From: Ian Paterson Renamed to Session Negotiation Renamed to Stanza Session Negotiation Further described contexts in which session negotiation could be useful; added more examples; added reference to SIP RFC and explained basic mapping to SIP INVITE method; added XMPP Registrar considerations. Further described contexts in which stanza session negotiation could be useful; added more examples; added reference to SIP RFC and explained basic mapping to SIP INVITE method; added XMPP Registrar considerations. The traditional model for one-to-one chat "sessions" in Jabber/XMPP is for a user to simply send a message to a contact without any formal negotiation of session parameters (e.g., see &xmppim;). This informal approach to initiation of a session is perfectly acceptable in many contexts, environments, and cultures. However, it may be desirable to formally request a chat session (or any other type of session) and negotiate its parameters before beginning the session in some circumstances, such as: The traditional model for one-to-one chat "sessions" in Jabber/XMPP is for a user to simply send a message to a contact without any formal negotiation of session parameters (e.g., see &xmppim;). This informal approach to initiation of a session is perfectly acceptable in many contexts, environments, and cultures. However, it may be desirable to formally request a chat session (or any other type of XMPP stanza session) and negotiate its parameters before beginning the session in some circumstances, such as: This proposal defines best practices for such a negotiation, re-using the protocol defined in &xep0020;. The specification addresses the following use cases: [1] A session negotiation is initiated when the user sends a message containing a data form of type "form" with an "accept" field. [2] A session negotiation is accepted when the contact sends a message containing a data form of type "submit" with an "accept" field whose value is "1" or "true". [3] A session negotiation is rejected when the contact sends a message containing a data form of type "submit" with an "accept" field whose value is "0" or "false". [4] A session negotiation is confirmed when the user sends a message containing a data form of type "result" with an "accept" field whose value is "1" or "true". [5] A session negotiation is confirmed when the user sends a message containing a data form of type "result" with an "accept" field whose value is "0" or "false". [1] A stanza session negotiation is initiated when the user sends a message containing a data form of type "form" with an "accept" field. [2] A stanza session negotiation is accepted when the contact sends a message containing a data form of type "submit" with an "accept" field whose value is "1" or "true". [3] A stanza session negotiation is rejected when the contact sends a message containing a data form of type "submit" with an "accept" field whose value is "0" or "false". [4] A stanza session negotiation is confirmed when the user sends a message containing a data form of type "result" with an "accept" field whose value is "1" or "true". [5] A stanza session negotiation is confirmed when the user sends a message containing a data form of type "result" with an "accept" field whose value is "0" or "false". [6] An existing session is re-negotiated when either party sends a message containing a data form of type "form" with a "renegotiate" field whose value is "1" or "true". [7] A session re-negotiation is accepted when the other party sends a message containing a data form of type "submit" with a "renegotiate" field whose value is "1" or "true". [8] A session re-negotiation is rejected when the other party sends a message containing a data form of type "submit" with a "renegotiate" field whose value is "0" or "false"; however, the session remains in the active state with the previously-negotiated parameters in force. In order to initiate a negotiated session, the initiating party ("user") sends a &MESSAGE; Note: Sessions may be conducted between entities who are never online at the same time. However, if the user is interested only in an immediate session then the user SHOULD instruct the contact's server not to store the message for later delivery (see &xep0160;) using the &xep0079; protocol. In the following example of a negotiation request, Romeo requests a chat with Juliet and also queries her regarding whether she is able to disallow all message logging (see &xep0136;) In the following example of a negotiation request, Romeo requests a chat with Juliet and also queries her regarding whether she is able to disallow all message logging (see &xep0136;)
-
-
If, upon reception of a user's session request, a contact finds that the request had been stored for later delivery, and if the contact is interested only in an immediate session, then it SHOULD initiate a new session negotiation (including a newly-generated ThreadID) instead of responding to the user's request. Note: Sending any response to the user's original request would leak presence information since it would divulge the fact that the contact had been offline rather than just ignoring the user.
+If, upon reception of a user's session request, a contact finds that the request had been stored for later delivery, and if the contact is interested only in an immediate session, then it SHOULD initiate a new stanza session negotiation (including a newly-generated ThreadID) instead of responding to the user's request. Note: Sending any response to the user's original request would leak presence information since it would divulge the fact that the contact had been offline rather than just ignoring the user.
In any response to the user's request, the contact's client MUST mirror the &THREAD; value so that the user's client can correctly track the response.
If the request is accepted then the contact's client MUST include in its response values for all the fields that the request indicated are required. If the contact's client does not support one of the default values or if the contact has disabled its support (as for Chat State Notifications and XHTML formatting in the example below), and the client can still accept the request, then it MUST set that field to a value that it can support.
In the example below we assume that Juliet accepts the session and specifies that she prefers to speak Italian with Romeo:
@@ -392,7 +392,7 @@ PENDING o---------------+ ]]>If the contact accepted the session (see Accepting a Session) then the user MUST either complete or cancel the session negotiation. If the contact chose an option other than the default (prefered) value for one or more of the fields, then instead of having the client accept the session automatically the user may prefer to review the values that the contact selected before confirming that the session is open.
If the contact accepted the session (see Accepting a Session) then the user MUST either complete or cancel the stanza session negotiation. If the contact chose an option other than the default (prefered) value for one or more of the fields, then instead of having the client accept the session automatically the user may prefer to review the values that the contact selected before confirming that the session is open.