<remark>Changed <iq/> to <message/> given probability of multiple SIP responses.</remark>
</revision>
<revision>
<version>0.4</version>
<date>2004-03-16</date>
<initials>psa/jjh</initials>
<remark>Specified that the <sdp/> element is in a separate namespace and that the same mechanism could be used for other content schemes in the future.</remark>
</revision>
<revision>
<version>0.3</version>
<date>2004-03-15</date>
<initials>psa/jjh</initials>
<remark>Replaced SDPng with SDP; added sections for Requirements, Protocol, and Discovering Support; added XML schema.</remark>
<p>The Session Description Protocol (SDP; see &rfc2327;) provides a mechanism for describing multimedia sessions that are advertised and negotiated over the Internet. The "Transport for Initiating and Negotiating Sessions" (TINS) specified herein describes how to use SDP to build a framework for media stream/session initiation and negotiation between entities that natively support XMPP (see &xmppcore;).
<note>The approach taken herein is to send pure SDP. While earlier versions of this document used &sdpng; (an XML representation of SDP), SDPng is a more experimental technology; by contrast, SDP is a stable protocol and there is broad support for it by existing gateways and devices. The use of SDP rather than SDPng thus enables the Jabber/XMPP community to implement solutions that are deployable on the Internet today.</note>
In particular, TINS provides an XMPP representation of standard session management semantics such as those provided by the Session Initiation Protocol (SIP; see &rfc3261;). As a result, native XMPP clients that support TINS can negotiate out-of-band multimedia sessions (e.g., use of the Real-Time Transport Protocol or RTP; see &rfc3550;) and XMPP services that support TINS can easily interoperate with SIP services through gateways.</p>
<li>Enable an XMPP entity to negotiate an out-of-band multimedia session with another XMPP entity.</li>
<li>Enable an XMPP entity to negotiate an out-of-band multimedia session with a non-XMPP entity through a gateway.</li>
<li>Maximize interoperability with existing gateways and devices by using standard Internet protocols.</li>
</ol>
</section1>
<section1topic="Protocol"anchor='protocol'>
<p>TINS exchanges are completed by sending &MESSAGE; stanzas containing a child <tins/> element qualified by the 'http://jabber.org/protocol/tins' namespace.
<note>While it may seem that the semantics of &IQ; stanzas are more appropriate, <cite>RFC 3261</cite> allows entities to send multiple results in response to a SIP request, which does not map to the syntax of the &IQ; stanza as defined in <cite>RFC 6120</cite>.</note>
In order to track the structure of the TINS "conversation", the &THREAD; child of &MESSAGE; MAY also be included. The <tins/> element MUST possess a 'method' attribute, whose value SHOULD be either an IANA-registered value for a SIP method or "result", as described below. The following SIP methods will probably be used most frequently in TINS interactions:</p>
<ul>
<li><p>INVITE -- Used to invite the target user to an out-of-band session. The content inside the <tins/> element MAY be SDP descriptions of the connection types offered. If a session is already established for this transaction, the new INVITE serves as a renegotiation of session parameters.</p></li>
<li><p>ACK -- Used by the initiator to tell the invitee that an out-of-band session has been established.</p></li>
<li><p>BYE -- Used by either side of the conversation to terminate the transaction. This message SHOULD cause all resources associated with this transaction to be freed, and any associated network connections to be terminated.</p></li>
</ul>
<p>The SDP data itself is included as the XML character data of an <sdp/> child of the <tins/> element, qualifed by the 'urn:ietf:rfc:2327' namespace (this is consistent with &rfc2648;).
<note>The <sdp/> element is qualified by a separate namespace because it may be desirable for TINS to support other formats (such as SDPng) in the future; these can then be added without changing the XML schema for TINS.</note>
Any restricted XML characters in the SDP data (i.e., &'<>") MUST be properly escaped when contained in the XML character data of the <sdp/> element (for example, the ' character MUST be escaped to &apos;). It is the responsibility of the XMPP recipient or translating gateway to unescape these restricted characters for processing.</p>
<p>The request stanza MAY also include either or both of the following:</p>
<p>In reply to a request, the receiver MUST send zero or more replies, with the value of the 'method' attribute set to a value of "result" and the value of the 'code' attribute set to one of the valid SIP response codes as specified in Section 21 of <cite>RFC 3261</cite>.</p>
<p>Before initiating a TINS negotiation, an XMPP entity SHOULD determine that the target entity supports the 'http://jabber.org/protocol/tins' namespace. Such discovery SHOULD occur by means of &xep0030;, either directly by querying the target entity or indirectly by means of &xep0115;. If the target entity is a non-XMPP entity that is contacted through a gateway, the gateway itself SHOULD reply to service discovery queries on behalf of the non-XMPP entity and SHOULD insert a client capabilities extension into the presence stanzas it generates on behalf of the non-XMPP entity.</p>
<p>If an XMPP entity receives, or a gateway handles, a &MESSAGE; stanza containing a <tins/> element qualified by the 'http://jabber.org/protocol/tins' namespace but it does not understand the TINS protocol, it SHOULD either silently ignore it or return a &unavailable; error (see &xep0086; for error syntax).</p>
<section2topic="Negotiating a Voice Call"anchor='examples-call'>
<p>The following XMPP stanzas could be used to initiate a voice call. The 'from' addresses will usually be added by the XMPP server or relevant gateway, but are shown here for the sake of clarity. Note the inclusion of SHIM headers and extended addresses.</p>
<examplecaption='Step 1: A sends an invite to B'><![CDATA[
<p>TINS is subject to the same security considerations as XMPP, particularly with regard to authentication and channel encryption; for details, refer to <cite>RFC 6120</cite>.</p>