XEP-XXXX: SIP/SDP Over XMPP (SoX)

Abstract:This specification defines an XMPP protocol extension for communicating Session Description Protocol (SDP) data, along with relevant Session Initiation Protocol (SIP) headers. The SoX protocol is designed for use by XMPP-only endpoints that need to communicate raw SDP information (e.g., in WebRTC scenarios), not as a general-purpose replacement for the XMPP Jingle extensions.
Authors:Peter Saint-Andre, Joe Hildebrand, Cullen Jennings
Copyright:© 1999 - 2013 XMPP Standards Foundation. SEE LEGAL NOTICES.
Status:ProtoXEP
Type:Standards Track
Version:0.0.2
Last Updated:2013-12-02

WARNING: This document has not yet been accepted for consideration or approved in any official manner by the XMPP Standards Foundation, and this document is not yet an XMPP Extension Protocol (XEP). If this document is accepted as a XEP by the XMPP Council, it will be published at <http://xmpp.org/extensions/> and announced on the <standards@xmpp.org> mailing list.


Table of Contents


1. Introduction
2. Protocol
3. Inclusion of SIP Headers
4. Forwarding Messages to Native SIP Entities
5. Address Mapping
6. Error Handling
7. Determining Support
8. Security Considerations
9. IANA Considerations
10. XMPP Registrar Considerations
    10.1. Protocol Namespaces
    10.2. Protocol Versioning
11. XML Schema
12. Acknowledgements

Appendices
    A: Document Information
    B: Author Information
    C: Legal Notices
    D: Relation to XMPP
    E: Discussion Venue
    F: Requirements Conformance
    G: Notes
    H: Revision History


1. Introduction

The Session Description Protocol (SDP) RFC 4566 [1] is widely used to communicate information about media sessions, typically using the offer/answer model RFC 3264 [2]. For example, when the Session Initiation Protocol (SIP) RFC 3261 [3] is used for establishing media sessions, the payloads of the SIP messages contain SDP payloads. The use of SDP continues to gain force, since SDP has been adopted for use in the WebRTC technologies being defined at the Internet Engineering Task Force (IETF) [4] and World Wide Web Consortium (W3C) [5] for real-time communication among web browsers.

Some user agents that might want to participate in WebRTC interactions use XMPP as their primary or only communication channel. For example, a browser-based XMPP application might use a JavaScript library that connects to an XMPP server using XMPP Over WebSocket [6] or using BOSH (XEP-0124) [7] and XMPP Over BOSH (XEP-0206) [8]. Although such an application could use Jingle (XEP-0166) [9] and Jingle RTP Sessions (XEP-0167) [10] between the client and the server, converting the Jingle XML format into SDP (and associated SIP headers) might require use of a server-side gateway, and such a gateway might introduce unnecessary complexity into the system (e.g., keeping session state in the gateway). Enabling the user agent to natively send SDP (and a minimal set of SIP headers) can make it easier for XMPP client developers to build real-time communication applications using existing SDP and SIP libraries, especially in the context of WebRTC. Even outside of WebRTC, the ability to send SDP/SIP over XMPP can be useful in deployments where XMPP-capable endpoints need to communicate with SIP endpoints such as IP phones.

By specifying a way to send SDP/SIP over XMPP (a.k.a. "SoX"), this document effectively defines a reliable transport method for SIP/SDP messages. However, it is envisioned that this method will be used only by XMPP-only endpoints, not by native SIP or dual-stack SIP/XMPP RFC 7081 [11] endpoints. It is also important to note that SoX is not intended to replace Jingle as a general-purpose method for negotiating media sessions among XMPP entities; instead, it provides a convenient way to reliably transport SIP/SDP traffic for communication from XMPP-only endpoints to native SIP and dual-stack SIP/XMPP endpoints. Finally, because SoX payloads contain only minimal SIP headers (needed for message delivery in certain scenarios) and SDP content, the method is not designed for sending arbitrary SIP message bodies, only SDP.

2. Protocol

The syntax is extremely simple: an XMPP <message/> element contains a <sox/> child element qualified by the 'urn:xmpp:sox:0' namespace, and the <sox/> element contains the SIP/SDP data. An example follows.

Example 1. A Basic SoX Example

<message from='romeo@example.net/orchard' to='juliet@example.com' id='hr0znyj0'
  <sox xmlns='urn:xmpp:sox:0'>
INVITE sip:juliet@im.example.com sip/2.0
Via: SIP/2.0/tcp example.net;branch=z9hG4bK1602341dcb7
From: <sip:romeo@example.net>;tag=0019
To: <sip:juliet@im.example.com>
Contact: <sip:romeo@example.net>;gr=orchard
Call-Info: <xmpp:romeo@example.net>;purpose=impp
Call-ID: 0019aa04-50550007-660c7034-529a811b
Date: Mon, 6 May 2013 21:27:24 GMT
User-Agent: foo
CSeq: 101 INVITE
Max-Forwards: 70
Expires: 180
Allow: ACK,BYE,CANCEL,INVITE
Content-Type: application/sdp
Content-Length: nnnn

v=0
o=<username> <ntp> <ntp> IN IP4 <client_ip>
s=SoX Media Setup
c=IN IP4 <client_ip>
t=0 0
m=audio 9000 RTP/AVP 105 106 121
a=rtpmap:105 opus/48000/2
a=fmtp:105 maxplaybackrate=16000; sprop-maxcapturerate=16000; maxaveragebitrate=24000; stereo=1; useinbandfec=1; usedtx=0
a=rtpmap:106 iLBC/8000
a=ptime:40
a=maxptime:40
a=recv-source 1,2,3
a=rtpmap:121 mix/90000/1
a=fmtp: 121 105/106
a=sendrecv
  </sox>
</message>
  

3. Inclusion of SIP Headers

Including minimal SIP headers makes it possible for XMPP-only endpoints to pass a complete SIP/SDP payload directly to an existing SIP/SDP stack. This is deemed more convenient for implementers than including only the SDP itself, since standalone SDP parsers are less common than complete SIP/SDP stacks.

In addition, the SIP headers are helpful for server-side encapsulation/decapsulation scenarios as described in the next section.

Note that certain SIP headers are required in SIP, or in particular kinds of SIP messages (e.g., the Contact header is required in SIP INVITE messages).

4. Forwarding Messages to Native SIP Entities

Part of the reason for including minimal SIP headers in the SoX format is to enable stateless server-side components that can forward SoX messages to native SIP entities. For example, based on vCard data or a directory lookup, a server-side component might determine that the JID within the XMPP 'to' address of a SoX message is associated with a registered SIP user, and forward the SIP/SDP payload to the registered SIP address.

For example, in the basic SoX example shown above Romeo sends a SoX message to Juliet's JID (juliet@im.example.com), but his server might know that Juliet actually has a SIP address (say, juliet@voice.example.com). If so, a server-side component (say, sox.example.net) could strip off the enclosing XML elements (<message><sox> and </sox></message>) and forward the SIP/SDP on to the correct SIP address. An example of the forwarded payload follows.

Example 2. A SoX Payload, Forwarded

INVITE sip:juliet@voice.example.com sip/2.0
Via: SIP/2.0/tcp sox.example.net;branch=z9hG4bK1602341dcb7
From: <sip:romeo@example.net>;tag=0019
To: <sip:juliet@im.example.com>
Contact: <sip:romeo@example.net>;gr=orchard
Call-Info: <xmpp:romeo@example.net>;purpose=impp
Call-ID: 0019aa04-50550007-660c7034-529a811b
Date: Mon, 6 May 2013 21:27:24 GMT
User-Agent: foo
CSeq: 101 INVITE
Max-Forwards: 70
Expires: 180
Allow: ACK,BYE,CANCEL,INVITE
Content-Type: application/sdp
Content-Length: nnnn

v=0
o=<username> <ntp> <ntp> IN IP4 <client_ip>
s=SoX Media Setup
c=IN IP4 <client_ip>
t=0 0
m=audio 9000 RTP/AVP 105 106 121
a=rtpmap:105 opus/48000/2
a=fmtp:105 maxplaybackrate=16000; sprop-maxcapturerate=16000; maxaveragebitrate=24000; stereo=1; useinbandfec=1; usedtx=0
a=rtpmap:106 iLBC/8000
a=ptime:40
a=maxptime:40
a=recv-source 1,2,3
a=rtpmap:121 mix/90000/1
a=fmtp: 121 105/106
a=sendrecv
  

5. Address Mapping

Address mapping between SIP and XMPP can be a challenge. See draft-ietf-stox-core [12] for details.

The 'to' attribute and 'from' attribute of the XMPP <message/> stanza need not match the "To" header and "From" header of the SoX payload. For example, the sender might know (based on vCard data or a directory lookup) that the SIP address of the intended recipient is different from the XMPP address of the intended recipient. This is possible in so-called CUSAX scenarios; although the CUSAX specification recommends that all SDP signalling be sent over SIP rather than XMPP, the sender might be an XMPP-only endpoint and the intended recipient might be a CUSAX endpoint.

However, in general it is easier for a user agent to simply set the SIP "To" and "From" headers to the same identifiers (JIDs) used for the XMPP 'to' and 'from' attributes.

6. Error Handling

For errors related to the SoX payload (e.g., invalid SIP headers), the proper response by a SoX-aware entity is another SoX message containing the appropriate SIP error (e.g., "406 Not Acceptable").

For errors related to the XMPP "wrapper" (including the fact that the recipient does not understand the SoX payload), the proper response is the appropriate XMPP error.

7. Determining Support

If an entity supports SoX, it MUST advertise that fact in its responses to Service Discovery (XEP-0030) [13] information ("disco#info") requests by returning a feature of "urn:xmpp:sox:0":

Example 3. A disco#info query

<iq type='get' 
    from='romeo@example.net/orchard'
    to='juliet@example.com/chamber'
    id='hx62f49'>
  <query xmlns='http://jabber.org/protocol/disco#info'/>
</iq>
  

Example 4. A disco#info response

<iq type='result' 
    from='juliet@example.com/chamber'
    to='romeo@example.net/orchard'
    id='hx62f49'>
  <query xmlns='http://jabber.org/protocol/disco#info'>
    <feature var='urn:xmpp:sox:0'/>
  </query>
</iq>
  

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 Entity Capabilities (XEP-0115) [14]. However, if an application has not received entity capabilities information from an entity, it SHOULD use explicit service discovery instead.

8. Security Considerations

Crossing protocol boundaries can lead to security mismatches.

9. IANA Considerations

This document requires no interaction with the Internet Assigned Numbers Authority (IANA) [15].

10. XMPP Registrar Considerations

10.1 Protocol Namespaces

This specification defines the following XML namespace:

Upon advancement of this specification from a status of Experimental to a status of Draft, the XMPP Registrar [16] shall add the foregoing namespace to the registry located at <http://xmpp.org/registrar/namespaces.html>, as described in Section 4 of XMPP Registrar Function (XEP-0053) [17].

10.2 Protocol Versioning

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 XEP-0053.

11. XML Schema

<?xml version='1.0' encoding='UTF-8'?>

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

  <xs:element name='sox' type='xs:string'>

</xs:schema>
    

12. Acknowledgements

Thanks to Vikram Khurana, Lance Stout, Field Tian, Duanpei Wu, and Weixin Xia for their feedback.

In 2006, Dirk Griffoen (on behalf of Voipster) proposed a similar approach, called Zoep <http://xmpp.org/extensions/inbox/zoep.html>.


Appendices


Appendix A: Document Information

Series: XEP
Number: XXXX
Publisher: XMPP Standards Foundation
Status: ProtoXEP
Type: Standards Track
Version: 0.0.2
Last Updated: 2013-12-02
Approving Body: XMPP Council
Dependencies: XMPP Core
Supersedes: None
Superseded By: None
Short Name: NOT_YET_ASSIGNED
This document in other formats: XML  PDF


Appendix B: Author Information

Peter Saint-Andre

Email: stpeter@jabber.org
JabberID: stpeter@jabber.org
URI: https://stpeter.im/

Joe Hildebrand

Email: jhildebr@cisco.com
JabberID: hildjj@jabber.org

Cullen Jennings

Email: fluffy@cisco.com
JabberID: fluffy@cisco.com


Appendix C: Legal Notices

Copyright

This XMPP Extension Protocol is copyright © 1999 - 2013 by the XMPP Standards Foundation (XSF).

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.

Disclaimer of 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. ##

Limitation of 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.

IPR 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 <http://xmpp.org/about-xmpp/xsf/xsf-ipr-policy/> or obtained by writing to XMPP Standards Foundation, 1899 Wynkoop Street, Suite 600, Denver, CO 80202 USA).

Appendix D: Relation to XMPP

The Extensible Messaging and Presence Protocol (XMPP) is defined in the XMPP Core (RFC 6120) and XMPP IM (RFC 6121) specifications contributed by the XMPP Standards Foundation to the Internet Standards Process, which is managed by the Internet Engineering Task Force in accordance with RFC 2026. Any protocol defined in this document has been developed outside the Internet Standards Process and is to be understood as an extension to XMPP rather than as an evolution, development, or modification of XMPP itself.


Appendix E: Discussion Venue

The primary venue for discussion of XMPP Extension Protocols is the <standards@xmpp.org> discussion list.

Discussion on other xmpp.org discussion lists might also be appropriate; see <http://xmpp.org/about/discuss.shtml> for a complete list.

Errata can be sent to <editor@xmpp.org>.


Appendix F: Requirements Conformance

The following requirements keywords as used in this document are to be interpreted as described in RFC 2119: "MUST", "SHALL", "REQUIRED"; "MUST NOT", "SHALL NOT"; "SHOULD", "RECOMMENDED"; "SHOULD NOT", "NOT RECOMMENDED"; "MAY", "OPTIONAL".


Appendix G: Notes

1. RFC 4566: SDP: Session Description Protocol <http://tools.ietf.org/html/rfc4566>.

2. RFC 3264: An Offer/Answer Model with the Session Description Protocol (SDP) <http://tools.ietf.org/html/rfc3264>.

3. RFC 3261: Session Initiation Protocol (SIP) <http://tools.ietf.org/html/rfc3261>.

4. The Internet Engineering Task Force is the principal body engaged in the development of new Internet standard specifications, best known for its work on standards such as HTTP and SMTP. For further information, see <http://www.ietf.org/>.

5. The World Wide Web Consortium defines data formats and markup languages (such as HTML and XML) for use over the Internet. For further information, see <http://www.w3.org/>.

6. An XMPP Sub-protocol for WebSocket <https://datatracker.ietf.org/doc/draft-moffitt-xmpp-over-websocket/>. Work in progress.

7. XEP-0124: Bidirectional-streams Over Synchronous HTTP <http://xmpp.org/extensions/xep-0124.html>.

8. XEP-0206: XMPP Over BOSH <http://xmpp.org/extensions/xep-0206.html>.

9. XEP-0166: Jingle <http://xmpp.org/extensions/xep-0166.html>.

10. XEP-0167: Jingle RTP Sessions <http://xmpp.org/extensions/xep-0167.html>.

11. RFC 7081: CUSAX: Combined Use of the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP) <http://tools.ietf.org/html/rfc7081>.

12. Interworking between the Session Initiation Protocol (SIP) and the Extensible Messaging and Presence Protocol (XMPP): Addresses and Error Conditions <http://tools.ietf.org/html/draft-ietf-stox-core>.

13. XEP-0030: Service Discovery <http://xmpp.org/extensions/xep-0030.html>.

14. XEP-0115: Entity Capabilities <http://xmpp.org/extensions/xep-0115.html>.

15. 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 <http://www.iana.org/>.

16. 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 <http://xmpp.org/registrar/>.

17. XEP-0053: XMPP Registrar Function <http://xmpp.org/extensions/xep-0053.html>.


Appendix H: Revision History

Note: Older versions of this specification might be available at http://xmpp.org/extensions/attic/

Version 0.0.2 (2013-12-02)

Clarified scope and intent of the protocol.

(psa)

Version 0.0.1 (2013-06-12)

First draft.

(psa)

END