<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep xmlns="">
<header>
  <title>Source-Specific Media Attributes in Jingle</title>
  <abstract>This specification provides an XML mapping for translating the RFC 5766 Source-Specific Media Attributes from SDP to Jingle</abstract>
  
<legal>
<copyright>This XMPP Extension Protocol is copyright © 1999 – 2024 by the <link url="https://xmpp.org/">XMPP Standards Foundation</link> (XSF).</copyright>
<permissions>Permission is hereby granted, free of charge, to any person obtaining a copy of this specification (the "Specification"), to make use of the Specification without restriction, including without limitation the rights to implement the Specification in a software program, deploy the Specification in a network service, and copy, modify, merge, publish, translate, distribute, sublicense, or sell copies of the Specification, and to permit persons to whom the Specification is furnished to do so, subject to the condition that the foregoing copyright notice and this permission notice shall be included in all copies or substantial portions of the Specification. Unless separate permission is granted, modified works that are redistributed shall not contain misleading information regarding the authors, title, number, or publisher of the Specification, and shall not claim endorsement of the modified works by the authors, any organization or project to which the authors belong, or the XMPP Standards Foundation.</permissions>
<warranty>## NOTE WELL: This Specification is provided on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. ##</warranty>
<liability>In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall the XMPP Standards Foundation or any author of this Specification be liable for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising from, out of, or in connection with the Specification or the implementation, deployment, or other use of the Specification (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if the XMPP Standards Foundation or such author has been advised of the possibility of such damages.</liability>
<conformance>This XMPP Extension Protocol has been contributed in full conformance with the XSF's Intellectual Property Rights Policy (a copy of which can be found at &lt;<link url="https://xmpp.org/about/xsf/ipr-policy">https://xmpp.org/about/xsf/ipr-policy</link>&gt; or obtained by writing to XMPP Standards Foundation, P.O. Box 787, Parker, CO 80134 USA).</conformance>
</legal>
  <number>0339</number>
  <status>Draft</status>
  <lastcall>2020-05-19</lastcall>
  <type>Standards Track</type>
  <sig>Standards</sig>
  <approver>Council</approver>
  <dependencies>
    <spec>XEP-0166</spec>
  </dependencies>
  <supersedes/>
  <supersededby/>
  <shortname>NOT_YET_ASSIGNED</shortname>
  
  <author>
    <firstname>Philipp</firstname>
    <surname>Hancke</surname>
    <email>fippo@andyet.com</email>
    <jid>fippo@goodadvice.pages.de</jid>
  </author>

  <revision>
    <version>1.0.1</version>
    <date>2021-10-23</date>
    <initials>egp</initials>
    <remark><p>Add a XML Schema, and fix an example lacking a namespace.</p></remark>
  </revision>
  <revision>
    <version>1.0.0</version>
    <date>2020-05-26</date>
    <initials>XEP Editor (jsc)</initials>
    <remark><p>Move to Draft as per Council vote from 2020-05-20.</p></remark>
  </revision>
  <revision>
    <version>0.3</version>
    <date>2017-09-11</date>
    <initials>XEP Editor (jwi)</initials>
    <remark>Defer due to lack of activity.</remark>
  </revision>
  <revision>
    <version>0.2</version>
    <date>2015-11-09</date>
    <initials>ph</initials>
    <remark><p>remove obsolete mslabel and label lines.</p></remark>
  </revision>
  <revision>
    <version>0.1</version>
    <date>2014-01-08</date>
    <initials>psa</initials>
    <remark><p>Initial published version approved by the XMPP Council.</p></remark>
  </revision>
  <revision>
    <version>0.0.1</version>
    <date>2013-11-25</date>
    <initials>ph</initials>
    <remark><p>First draft.</p></remark>
  </revision>
</header>
<section1 topic="Introduction" anchor="intro">
  <p><span class="ref"><link url="http://tools.ietf.org/html/rfc5576">RFC 5576</link></span> <note>RFC 5576: Source-Specific Media Attributes in the Session Description Protocol (SDP) &lt;<link url="http://tools.ietf.org/html/rfc5576">http://tools.ietf.org/html/rfc5576</link>&gt;.</note> provides a mechanism to describe attributes of individual media sources (identified by their synchronization source) within a media stream. A mapping to Jingle as an extension to <span class="ref"><link url="https://xmpp.org/extensions/xep-0167.html">Jingle RTP Sessions (XEP-0167)</link></span> <note>XEP-0167: Jingle RTP Sessions &lt;<link url="https://xmpp.org/extensions/xep-0167.html">https://xmpp.org/extensions/xep-0167.html</link>&gt;.</note> is defined in this document.</p>
</section1>
<section1 topic="Mapping to Session Description Protocol" anchor="sdp">
  <section2 topic="The ssrc attribute" anchor="sdp-ssrc">
    <p>The SDP format defined in <span class="ref"><link url="http://tools.ietf.org/html/rfc5576">RFC 5576</link></span> <note>RFC 5576: Source-Specific Media Attributes in the Session Description Protocol (SDP) &lt;<link url="http://tools.ietf.org/html/rfc5576">http://tools.ietf.org/html/rfc5576</link>&gt;.</note> is shown below.</p>
    <code>
a=ssrc:&lt;ssrc-id&gt; &lt;attribute&gt;
a=ssrc:&lt;ssrc-id&gt; &lt;attribute&gt;:&lt;value&gt;
    </code>
    <p>This maps to Jingle as a &lt;source/&gt; element qualified by the 'urn:xmpp:jingle:apps:rtp:ssma:0' namespace. Since 'ssrc' is a media attribute in SDP, the &lt;source/&gt; element is included as child of the Jingle &lt;description/&gt; element.</p>
    <code><![CDATA[
<source ssrc='ssrc-id' xmlns='urn:xmpp:jingle:apps:rtp:ssma:0'>
    <parameter name='attribute'/>
    <parameter name='attribute' value='value'/>
</source>
]]></code>
    <p>Each ssrc-id maps to a &lt;source/&gt; element whose 'ssrc' attribute is set to the ssrc-id. The associated attributes map to &lt;parameter/&gt; children with 'name' and 'value' attributes. If there is no value in the SDP, the value parameter shall be omitted.</p>
    <p>An example follows:</p>
    <code>
a=ssrc:1656081975 cname:Yv/wvbCdsDW2Prgd
a=ssrc:1656081975 msid:MLTJKIHilGn71fNQoszkQ4jlPTuS5vJyKVIv MLTJKIHilGn71fNQoszkQ4jlPTuS5vJyKVIva0</code>
    <code><![CDATA[
<source ssrc='1656081975' xmlns='urn:xmpp:jingle:apps:rtp:ssma:0'>
    <parameter name='cname' value='Yv/wvbCdsDW2Prgd'/>
    <parameter name='msid' value='MLTJKIHilGn71fNQoszkQ4jlPTuS5vJyKVIv MLTJKIHilGn71fNQoszkQ4jlPTuS5vJyKVIva0'/>
</source>]]></code>
  </section2>
  <section2 topic="The ssrc-group attribute" anchor="sdp-ssrc-group">
    <p>The SDP format defined in <span class="ref"><link url="http://tools.ietf.org/html/rfc5576">RFC 5576</link></span> <note>RFC 5576: Source-Specific Media Attributes in the Session Description Protocol (SDP) &lt;<link url="http://tools.ietf.org/html/rfc5576">http://tools.ietf.org/html/rfc5576</link>&gt;.</note> is shown below.</p>
    <code>
a=ssrc-group:&lt;semantics&gt; &lt;ssrc-id&gt; ...</code>
    <p>This maps to Jingle as a &lt;ssrc-group/&gt; element qualified by the 'urn:xmpp:jingle:apps:rtp:ssma:0' namespace. Like the &lt;source/&gt; element, this is included as child of the Jingle &lt;description/&gt; element. The SDP 'semantics' parameter is mapped to the semantics attribute (for consistency with <span class="ref"><link url="https://xmpp.org/extensions/xep-0338.html">Jingle Grouping Framework (XEP-0338)</link></span> <note>XEP-0338: Jingle Grouping Framework &lt;<link url="https://xmpp.org/extensions/xep-0338.html">https://xmpp.org/extensions/xep-0338.html</link>&gt;.</note>) and the list of ssrc-ids is mapped to &lt;source/&gt; elements whole 'ssrc' attribute is set to the ssrc-id.</p>
    <code><![CDATA[
<ssrc-group xmlns='urn:xmpp:jingle:apps:rtp:ssma:0' semantics='semantics'>
   <source ssrc='ssrc-id'/>
   [...]
</ssrc-group>]]></code>
  </section2>
</section1>
<section1 topic="Example" anchor="example">
  <p>A minimal example follows:</p>
    <code>
m=video 1 RTP/SAVPF 100 116 117
a=rtpmap:100 VP8/90000
a=ssrc-group:FID 2301230316 386328120
a=ssrc:2301230316 cname:T5qvrIZj42v//eYQ
a=ssrc:386328120 cname:uEYgNtStZyTF74sM
a=ssrc-group:FID 3139499595 2613715171
a=ssrc:3139499595 cname:re8jhxkly9bxzuxr
a=ssrc:2613715171 cname:f83avsiw6n1m7vi
    </code>
    <p>This is mapped to Jingle as follows:</p>
    <code><![CDATA[
<content xmlns='http://jabber.org/protocols/jingle' creator='initiator' name='webcam'>
  <description xmlns='urn:xmpp:jingle:apps:rtp:1' media='video'>
    <payload-type id='100' name='VP8' clockrate='90000'/>
    <ssrc-group xmlns='urn:xmpp:jingle:apps:rtp:ssma:0' semantics='FID'>
      <source ssrc='2301230316'/>
      <source ssrc='386328120'/>
    </ssrc-group>
    <ssrc-group xmlns='urn:xmpp:jingle:apps:rtp:ssma:0' semantics='FID'>
      <source ssrc='3139499595'/>
      <source ssrc='2613715171'/>
    </ssrc-group>
    <source ssrc='2301230316' xmlns='urn:xmpp:jingle:apps:rtp:ssma:0'>
      <parameter name='cname' value='T5qvrIZj42v//eYQ'/>
    </source>
    <source ssrc='386328120' xmlns='urn:xmpp:jingle:apps:rtp:ssma:0'>
      <parameter name='cname' value='uEYgNtStZyTF74sM'/>
    </source>
    <source ssrc='3139499595' xmlns='urn:xmpp:jingle:apps:rtp:ssma:0'>
      <parameter name='cname' value='re8jhxkly9bxzuxr'/>
    </source>
    <source ssrc='2613715171' xmlns='urn:xmpp:jingle:apps:rtp:ssma:0'>
      <parameter name='cname' value='f83avsiw6n1m7vi'/>
    </source>
  </description>
</content>
]]></code>
</section1>
<section1 topic="Determining Support" anchor="disco">
  <p>If an entity supports source specific media attributes as described in <span class="ref"><link url="http://tools.ietf.org/html/rfc5576">RFC 5576</link></span> <note>RFC 5576: Source-Specific Media Attributes in the Session Description Protocol (SDP) &lt;<link url="http://tools.ietf.org/html/rfc5576">http://tools.ietf.org/html/rfc5576</link>&gt;.</note>, it MUST advertise that fact in its responses to <span class="ref"><link url="https://xmpp.org/extensions/xep-0030.html">Service Discovery (XEP-0030)</link></span> <note>XEP-0030: Service Discovery &lt;<link url="https://xmpp.org/extensions/xep-0030.html">https://xmpp.org/extensions/xep-0030.html</link>&gt;.</note> information ("disco#info") requests by returning a feature of 'urn:ietf:rfc:5576':</p>
  <example caption="A disco#info query"><![CDATA[
<iq type='get'
    from='calvin@usrobots.lit/lab'
    to='herbie@usrobots.lit/home'
    id='disco1'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
  <example caption="A disco#info response"><![CDATA[
<iq type='result'
    from='herbie@usrobots.lit/home'
    to='calvin@usrobots.lit/lab'
    id='disco1'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <feature var='urn:xmpp:jingle:1'/>
    <feature var='urn:ietf:rfc:5576'/>
  </query>
</iq>
]]></example>
  <p>In order for an application to determine whether an entity supports this protocol, where possible it SHOULD use the dynamic, presence-based profile of service discovery defined in <span class="ref"><link url="https://xmpp.org/extensions/xep-0115.html">Entity Capabilities (XEP-0115)</link></span> <note>XEP-0115: Entity Capabilities &lt;<link url="https://xmpp.org/extensions/xep-0115.html">https://xmpp.org/extensions/xep-0115.html</link>&gt;.</note>. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.</p>
</section1>
<!--
<section1 topic='Acknowledgements' anchor='acks'>
</section1>
-->
<section1 topic="Security Considerations" anchor="security">
  <p>This document introduces no additional security considerations above and beyond those defined in the documents on which it depends.</p>
</section1>

<section1 topic="IANA Considerations" anchor="iana">
  <p>This document requires no interaction with the <span class="ref"><link url="http://www.iana.org/">Internet Assigned Numbers Authority (IANA)</link></span> <note>The Internet Assigned Numbers Authority (IANA) is the central coordinator for the assignment of unique parameter values for Internet protocols, such as port numbers and URI schemes. For further information, see &lt;<link url="http://www.iana.org/">http://www.iana.org/</link>&gt;.</note>.</p>
</section1>

<section1 topic="XMPP Registrar Considerations" anchor="registrar">
  <section2 topic="Protocol Namespaces" anchor="registrar-ns">
    <p>This specification defines the following XML namespace:</p>
    <ul>
      <li>urn:xmpp:jingle:apps:rtp:ssma:0</li>
    </ul>
    <p>The <span class="ref"><link url="https://xmpp.org/registrar/">XMPP Registrar</link></span> <note>The XMPP Registrar maintains a list of reserved protocol namespaces as well as registries of parameters used in the context of XMPP extension protocols approved by the XMPP Standards Foundation. For further information, see &lt;<link url="https://xmpp.org/registrar/">https://xmpp.org/registrar/</link>&gt;.</note> includes the foregoing namespace to the registry located at &lt;<link url="https://xmpp.org/registrar/namespaces.html">https://xmpp.org/registrar/namespaces.html</link>&gt;, as described in Section 4 of <span class="ref"><link url="https://xmpp.org/extensions/xep-0053.html">XMPP Registrar Function (XEP-0053)</link></span> <note>XEP-0053: XMPP Registrar Function &lt;<link url="https://xmpp.org/extensions/xep-0053.html">https://xmpp.org/extensions/xep-0053.html</link>&gt;.</note>.</p>
  </section2>
  <section2 topic="Protocol Versioning" anchor="registrar-versioning">
    <p>If the protocol defined in this specification undergoes a revision that is not fully backwards-compatible with an older version, the XMPP Registrar shall increment the protocol version number found at the end of the XML namespaces defined herein, as described in Section 4 of <cite>XEP-0053</cite>.</p>
  </section2>
</section1>
<section1 topic="XML Schema" anchor="schema">
  <code><![CDATA[
<?xml version='1.0' encoding='UTF-8'?>

<xs:schema
    xmlns:xs='http://www.w3.org/2001/XMLSchema'
    targetNamespace='urn:xmpp:jingle:apps:rtp:ssma:0'
    xmlns='urn:xmpp:jingle:apps:rtp:ssma:0'
    elementFormDefault='qualified'>

  <xs:annotation>
    <xs:documentation>
      The protocol documented by this schema is defined in
      XEP-0339: http://www.xmpp.org/extensions/xep-0339.html
    </xs:documentation>
  </xs:annotation>

  <xs:element name='ssrc-group'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='source'
                    minOccurs='0'
                    maxOccurs='unbounded'/>
      </xs:sequence>
      <xs:attribute name='semantics' use='required'>
        <xs:simpleType>
          <xs:restriction base='xs:NCName'>
            <xs:enumeration value='LS'/>
            <xs:enumeration value='FID'/>
            <xs:enumeration value='SRF'/>
            <xs:enumeration value='ANAT'/>
            <xs:enumeration value='FEC'/>
            <xs:enumeration value='DDP'/>
          </xs:restriction>
        </xs:simpleType>
      </xs:attribute>
    </xs:complexType>
  </xs:element>

  <xs:element name='source'>
    <xs:complexType>
      <xs:sequence>
        <xs:element ref='parameter'
                    minOccurs='0'
                    maxOccurs='unbounded'/>
      </xs:sequence>
      <xs:attribute name='ssrc' type='xs:unsignedInt' use='required'/>
    </xs:complexType>
  </xs:element>

  <xs:element name='parameter'>
    <xs:complexType>
      <xs:attribute name='name' type='xs:string' use='required'/>
      <xs:attribute name='value' type='xs:string' use='optional'/>
    </xs:complexType>
  </xs:element>

</xs:schema>
]]></code>
</section1>
</xep>
