<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type='text/xsl' href='xep.xsl'?>
<xep xmlns="">
<header>
  <title>Reachability Addresses</title>
  <abstract>This document defines an XMPP protocol extension for communicating information about how an entity can be reached temporarily using methods other than the entity's normal JID.</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>0152</number>
  <status>Draft</status>
  <type>Standards Track</type>
  <sig>Standards</sig>
  <approver>Council</approver>
  <dependencies>
    <spec>XMPP Core</spec>
    <spec>XMPP IM</spec>
  </dependencies>
  <supersedes/>
  <supersededby/>
  <shortname>reach</shortname>
  <schemaloc>
    <ns>reach</ns>
    <url>http://www.xmpp.org/schemas/reach.xsd</url>
  </schemaloc>
  
  <author>
    <firstname>Peter</firstname>
    <surname>Saint-Andre</surname>
    <email>stpeter@stpeter.im</email>
    <jid>stpeter@jabber.org</jid>
    <uri>https://stpeter.im/</uri>
  </author>

  
  <author>
    <firstname>Joe</firstname>
    <surname>Hildebrand</surname>
    <email>jhildebr@cisco.com</email>
    <jid>hildjj@jabber.org</jid>
  </author>

  <revision>
    <version>1.0</version>
    <date>2014-02-25</date>
    <initials>XEP Editor (mm)</initials>
    <remark><p>Per a vote of the XMPP Council, advanced specification from Experimental to Draft.</p></remark>
  </revision>
  <revision>
    <version>0.6</version>
    <date>2013-12-02</date>
    <initials>psa</initials>
    <remark><p>Further clarified the intent of the protocol.</p></remark>
  </revision>
  <revision>
    <version>0.5</version>
    <date>2013-09-25</date>
    <initials>psa</initials>
    <remark><p>Modified the text and examples to better illustrate the primary use case.</p></remark>
  </revision>
  <revision>
    <version>0.4</version>
    <date>2013-02-05</date>
    <initials>psa</initials>
    <remark><p>Updated to reflect new XMPP RFCs; strengthened security considerations.</p></remark>
  </revision>
  <revision>
    <version>0.3</version>
    <date>2008-10-06</date>
    <initials>psa</initials>
    <remark>
      <ul>
        <li>Modified namespaces to incorporate namespace versioning.</li>
        <li>Removed IQ request-response method.</li>
        <li>Corrected PEP examples.</li>
        <li>Corrected XML schema.</li>
      </ul>
    </remark>
  </revision>
  <revision>
    <version>0.2</version>
    <date>2006-09-17</date>
    <initials>psa</initials>
    <remark><p>Defined PEP transport.</p></remark>
  </revision>
  <revision>
    <version>0.1</version>
    <date>2005-06-16</date>
    <initials>psa</initials>
    <remark><p>Initial published version.</p></remark>
  </revision>
  <revision>
    <version>0.0.1</version>
    <date>2005-06-07</date>
    <initials>psa/jjh</initials>
    <remark><p>First draft.</p></remark>
  </revision>
</header>

<section1 topic="Introduction" anchor="intro">
  <p>Sometimes it is desirable to augment instant messaging (IM) with another real-time communications medium, such as a voice conversation conducted over the traditional public switched telephone network (PSTN) or Voice over Internet Protocol (VoIP) applications. In order to facilitate this functionality, a user needs to advertise the address(es) at which they can be reached. There are several possible ways to do this:</p>
  <ul>
    <li><p>Publish the address(es) in the user's vCard (see <span class="ref"><link url="https://xmpp.org/extensions/xep-0054.html">vcard-temp (XEP-0054)</link></span> <note>XEP-0054: vcard-temp &lt;<link url="https://xmpp.org/extensions/xep-0054.html">https://xmpp.org/extensions/xep-0054.html</link>&gt;.</note> and <span class="ref"><link url="https://xmpp.org/extensions/xep-0292.html">vCard4 over XMPP (XEP-0292)</link></span> <note>XEP-0292: vCard4 over XMPP &lt;<link url="https://xmpp.org/extensions/xep-0292.html">https://xmpp.org/extensions/xep-0292.html</link>&gt;.</note>); this is convenient, but is not very dynamic (e.g., reachability addresses might change when the user moves to a new conference room in an office building).</p></li>
    <li><p>Send the address(es) within a &lt;presence/&gt; stanza; this option is described in the <link url="#transport-presence">Presence Transport</link> section of this document and is consistent with <span class="ref"><link url="http://tools.ietf.org/html/rfc6121">RFC 6121</link></span> <note>RFC 6121: Extensible Messaging and Presence Protocol (XMPP): Instant Messaging and Presence &lt;<link url="http://tools.ietf.org/html/rfc6121">http://tools.ietf.org/html/rfc6121</link>&gt;.</note> since reachability is one aspect of a user's availability for communication.</p></li>
    <li><p>Send address(es) to the appropriate <span class="ref"><link url="https://xmpp.org/extensions/xep-0060.html">Publish-Subscribe (XEP-0060)</link></span> <note>XEP-0060: Publish-Subscribe &lt;<link url="https://xmpp.org/extensions/xep-0060.html">https://xmpp.org/extensions/xep-0060.html</link>&gt;.</note> node; this option is described in the <link url="#transport-pep">PEP Transport</link> section of this document but might not be available at all service providers.</p></li>
  </ul>
  <p>This document defines methods for publishing addresses at which a user can be reached temporarily, as opposed to semi-permanent addresses of the kind that are more appropriately communicated in a user's vCard. We illustrate this usage through the scenario of a user sending a reachability address upon entering a physical conference room and then sending an updated notification (without a reachability address) upon leaving the conference room. Similar scenarios might apply when an XMPP implementation is used with technologies such as WebRTC and in deployments of the combined use of SIP and XMPP ("CUSAX"; <span class="ref"><link url="http://tools.ietf.org/html/rfc7081">RFC 7081</link></span> <note>RFC 7081: CUSAX: Combined Use of the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP) &lt;<link url="http://tools.ietf.org/html/rfc7081">http://tools.ietf.org/html/rfc7081</link>&gt;.</note>).</p>
</section1>

<section1 topic="Requirements" anchor="reqs">
  <p>This document addresses the following requirements:</p>
  <ul>
    <li>Enable clients to dynamically publish reachability addresses.</li>
    <li>Minimize network traffic.</li>
  </ul>
</section1>

<section1 topic="Data Format" anchor="format">
  <p>The following is an example of the data format for reachability addresses:</p>
  <example caption="Data Format for Reachability Addresses"><![CDATA[
<reach xmlns='urn:xmpp:reach:0'>
  <addr uri='tel:+1-303-555-1212'/>
  <addr uri='sip:room123@example.com'/>
</reach>
]]></example>
  <p>When publishing reachability addresses, the &lt;reach/&gt; element MUST contain at least one &lt;addr/&gt; element. Each &lt;addr/&gt; element MUST possess a 'uri' attribute, whose value MUST be the Uniform Resource Identifier (<span class="ref"><link url="http://tools.ietf.org/html/rfc3986">RFC 3986</link></span> <note>RFC 3986: Uniform Resource Identifiers (URI): Generic Syntax &lt;<link url="http://tools.ietf.org/html/rfc3986">http://tools.ietf.org/html/rfc3986</link>&gt;.</note>) or Internationalized Resource Identifier (<span class="ref"><link url="http://tools.ietf.org/html/rfc3987">RFC 3987</link></span> <note>RFC 3987: Internationalized Resource Identifiers (IRIs) &lt;<link url="http://tools.ietf.org/html/rfc3987">http://tools.ietf.org/html/rfc3987</link>&gt;.</note>) of an alternate communications method for reaching the user.</p>
  <p>The &lt;addr/&gt; element MAY contain one or more &lt;desc/&gt; children whose XML character data is a natural-language description of the address; this element SHOULD possess an 'xml:lang' attribute whose value is a language tag that conforms to <span class="ref"><link url="http://tools.ietf.org/html/rfc4646">RFC 4646</link></span> <note>RFC 4646: Tags for Identifying Languages &lt;<link url="http://tools.ietf.org/html/rfc4646">http://tools.ietf.org/html/rfc4646</link>&gt;.</note> (although the default language MAY be specified at the stanza level; see <span class="ref"><link url="http://tools.ietf.org/html/rfc6120">RFC 6120</link></span> <note>RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core &lt;<link url="http://tools.ietf.org/html/rfc6120">http://tools.ietf.org/html/rfc6120</link>&gt;.</note>). In order to preserve bandwidth, the &lt;desc/&gt; element SHOULD NOT be included when sending reachability data via presence broadcast, but MAY be included when using directed presence or the personal eventing protocol.</p>
  <example caption="Reachability Addresses With Descriptions"><![CDATA[
<reach xmlns='urn:xmpp:reach:0'>
  <addr uri='tel:+1-303-555-1212'>
    <desc xml:lang='en'>Conference room phone</desc>
  </addr>
  <addr uri='sip:room123@example.com'>
    <desc xml:lang='en'>In-room video system</desc>
  </addr>
</reach>
]]></example>
</section1>

<section1 topic="Data Transport" anchor="transport">
  <p>This document specifies two methods of advertising reachability addresses:</p>
  <ul>
    <li>Presence</li>
    <li><span class="ref"><link url="https://xmpp.org/extensions/xep-0163.html">Personal Eventing Protocol (XEP-0163)</link></span> <note>XEP-0163: Personal Eventing Protocol &lt;<link url="https://xmpp.org/extensions/xep-0163.html">https://xmpp.org/extensions/xep-0163.html</link>&gt;.</note> (PEP)</li>
  </ul>
  <p>This document does not recommend one transport method over the other.</p>
  <p>In addition, a contact MAY request a user's reachability addresses in an XMPP &lt;iq/&gt; stanza of type "get" and a user MAY send reachability addresses in an XMPP &lt;message/&gt; stanza. However, the presence and PEP transport methods are preferred.</p>

  <section2 topic="Presence Transport" anchor="transport-presence">
    <p>To broadcast reachability addresses in presence information, a user's client includes the &lt;reach/&gt; element in the &lt;presence/&gt; stanza it sends to its server.</p>
    <p>For example, consider someone who walks into a conference room at the office. Via nearfield communication, the user's XMPP client might auto-discover a 'tel:' URI for the room audio system and a 'sip:' URI for the room video system.</p>
    <example caption="User's Client Includes Reachability Addresses in Presence"><![CDATA[
<presence from='romeo@example.com/mobile'>
  <reach xmlns='urn:xmpp:reach:0'>
    <addr uri='tel:+1-303-555-1212'/>
    <addr uri='sip:room123@example.com'/>
  </reach>
</presence>
]]></example>
    <p>The user's server then broadcasts that presence stanza to all entities who are subscribed to the user's presence:</p>
    <example caption="User's Server Broadcasts Presence Information"><![CDATA[
<presence from='romeo@montague.net/mobile' to='juliet@capulet.com'>
  <reach xmlns='urn:xmpp:reach:0'>
    <addr uri='tel:+1-303-555-1212'/>
    <addr uri='sip:room123@example.com'/>
  </reach>
</presence>
]]></example>
    <p>(Naturally, a reachability address MAY alternatively be included in directed presence.)</p>
    <p>Upon leaving the conference room, the user's client would send updated presence without the reachability extension.</p>
    <example caption="User's Client Sends Updated Presence Without Reachability Addresses"><![CDATA[
<presence from='romeo@example.com/mobile'/>
]]></example>
  </section2>

  <section2 topic="Personal Eventing Protocol" anchor="transport-pep">
    <p>To publish reachability addresses via the personal eventing protocol (<span class="ref"><link url="https://xmpp.org/extensions/xep-0163.html">Personal Eventing Protocol (XEP-0163)</link></span> <note>XEP-0163: Personal Eventing Protocol &lt;<link url="https://xmpp.org/extensions/xep-0163.html">https://xmpp.org/extensions/xep-0163.html</link>&gt;.</note>), the entity publishes data to the "urn:xmpp:reach:0" node.</p>
    <example caption="Entity Publishes Reachability Addresses via PEP"><![CDATA[
<iq type='set'
    from='romeo@example.com'
    to='pubsub.shakespeare.example'
    id='publish1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='urn:xmpp:reach:0'>
      <item id='a1s2d3f4g5h6bjeh936'>
        <reach xmlns='urn:xmpp:reach:0'>
          <addr uri='tel:+1-303-555-1212'>
            <desc xml:lang='en'>Conference room phone</desc>
          </addr>
          <addr uri='sip:room123@example.com'>
            <desc xml:lang='en'>In-room video system</desc>
          </addr>
        </reach>
      </item>
    </publish>
  </pubsub>
</iq>
]]></example>
    <example caption="Subscriber Receives PEP Event with Payload"><![CDATA[
<message from='pubsub.shakespeare.lit'
         to='juliet@capulet.com'>
  <event xmlns='http://jabber.org/protocol/pubsub#event'>
    <items node='urn:xmpp:reach:0'>
      <item id='a1s2d3f4g5h6bjeh936'>
        <reach xmlns='urn:xmpp:reach:0'>
          <addr uri='tel:+1-303-555-1212'>
            <desc xml:lang='en'>Conference room phone</desc>
          </addr>
          <addr uri='sip:room123@example.com'>
            <desc xml:lang='en'>In-room video system</desc>
          </addr>
        </reach>
      </item>
    </items>
  </event>
</message>
]]></example>
    <p>As above, when leaving the conference room the user's client would publish an updated payload indicating that it no longer has any temporary reachability addresses.</p>
    <example caption="Entity Publishes Payload with Empty Reachability Addresses"><![CDATA[
<iq type='set'
    from='romeo@example.com'
    to='pubsub.shakespeare.example'
    id='publish1'>
  <pubsub xmlns='http://jabber.org/protocol/pubsub'>
    <publish node='urn:xmpp:reach:0'>
      <item id='a1s2d3f4g5h6bjeh936'>
        <reach xmlns='urn:xmpp:reach:0'/>
      </item>
    </publish>
  </pubsub>
</iq>
]]></example>
  </section2>
</section1>

<section1 topic="Determining Support" anchor="support">
  <p>If an entity supports reachability addresses, it MUST advertise that fact by returning a feature of "urn:xmpp:reach:0" (see <link url="#registrar-versioning">Namespace Versioning</link> regarding the possibility of incrementing the version number) in response to a <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 request.</p>
  <example caption="Service Discovery Information Request"><![CDATA[
<iq from='juliet@capulet.com/balcony'
    id='disco1'
    to='romeo@montague.net/orchard'
    type='get'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
]]></example>
  <example caption="Service Discovery Information Response"><![CDATA[
<iq from='romeo@montague.net/orchard'
    id='disco1'
    to='juliet@capulet.com/balcony'
    type='result'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <feature var='urn:xmpp:reach:0'/>
  </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="Implementation Notes" anchor="impl">
  <p>To preserve network bandwidth, the sender ought not include the &lt;desc/&gt; element unless that information is deemed necessary to enable communication.</p>
  <p>A recipient ought to attempt communications with reachability addresses in the order that the &lt;addr/&gt; elements appear within the &lt;reach/&gt; element.</p>
</section1>

<section1 topic="Internationalization Considerations" anchor="i18n">
  <p>If included, the &lt;desc/&gt; element SHOULD possess an 'xml:lang' attribute specifying the language of the human-readable descriptive text for a particular address.</p>
</section1>

<section1 topic="Security Considerations" anchor="security">
  <p>Security considerations for XMPP presence and PEP publication are described in RFC 6120, RFC 6121, XEP-0060, and XEP-0163.</p>
  <p>Advertising a telephone number, SIP URI, or other real-time communication address to multiple contacts in an unencrypted way (e.g., via XMPP presence or PEP in cases where not all hops are TLS-protected) introduces the possibility of information leakage and subsequent attacks such as unsolicited phone calls. Clients are advised to appropriately warn users about the dangers of such attacks. Alternatively, if the address is especially sensitive (say, a hashname <span class="ref"><link url="http://tools.ietf.org/html/rfc6920">RFC 6920</link></span> <note>RFC 6920: Naming Things with Hashes &lt;<link url="http://tools.ietf.org/html/rfc6920">http://tools.ietf.org/html/rfc6920</link>&gt;.</note> for use in a system that enables direct private communication outside of XMPP), then a client could send it in a message that itself is end-to-end encrypted.</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:reach:0</li>
    </ul>
    <p>Upon advancement of this specification from a status of Experimental to a status of Draft, 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> shall add 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="Namespace 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:reach:0'
    xmlns='urn:xmpp:reach:0'
    elementFormDefault='qualified'>

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

  <xs:element name='reach'>
    <xs:complexType>
      <xs:sequence>
        <xs:element name='addr'
                    minOccurs='0'
                    maxOccurs='unbounded'
                    type='addrElementType'/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>

  <xs:complexType name='addrElementType'>
    <xs:sequence>
      <xs:element name='desc'
                  minOccurs='0'
                  maxOccurs='unbounded'
                  type='xs:string'/>
    </xs:sequence>
    <xs:attribute name='uri' use='required' type='xs:anyURI'/>
  </xs:complexType>

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