<?xml version="1.0" encoding="US-ASCII"?>
<!-- This template is for creating an Internet Draft using xml2rfc,
     which is available here: http://xml.resource.org. -->
<!DOCTYPE rfc SYSTEM "rfc2629.dtd" [

<!ENTITY RFC2119    PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.2119.xml'>
<!ENTITY RFC3264    PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.3264.xml'>
<!ENTITY RFC6120    PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml/reference.RFC.6120.xml'>
<!ENTITY JSEP       PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.ietf-rtcweb-jsep.xml'>
<!ENTITY ROAP       PUBLIC '' 'http://xml.resource.org/public/rfc/bibxml3/reference.I-D.jennings-rtcweb-signaling.xml'>
]>

<?rfc toc="yes" ?>
<?rfc tocompact="no" ?>
<?rfc tocindent="no" ?>
<?rfc comments="yes" ?>
<?rfc inline="yes" ?>
<?rfc symrefs="yes" ?>
<?rfc sortrefs="yes"?>
<?rfc iprnotified="no" ?>
<?rfc strict="yes" ?>
<?rfc compact="yes"?>
<?rfc subcompact="yes"?>

<rfc
  category="std"
  ipr="trust200902"
  docName="draft-li-rtcweb-jsep-xmpp-mapping-00">

  <front>
    <title abbrev="RTCWeb-JSEP-XMPP-Mapping">
    RTCWeb JSEP XMPP/Jingle Mapping
    </title>

    <author initials="K." surname="Li" fullname="Kepeng Li">
      <organization abbrev="Huawei Technologies">Huawei Technologies</organization>
      <address>
        <postal>
          <street>Huawei Base, Bantian, Longgang District</street>
          <city>Shenzhen</city>
          <region>Guangdong</region>
          <code>518129</code>
          <country>P. R. China</country>
        </postal>
        <phone>+86-755-28971807</phone>
        <email>likepeng@huawei.com</email>
      </address>
    </author>   
    
    <date year="2012" />

    <area>RAI</area>
    <workgroup>rtcweb</workgroup>

    <abstract>
      <t>
   This document proposes mapping message representations between RTCWeb
    Javascript Session Establishment Protocol(JSEP) scheme and 
    XMPP/Jingle [XEP-0166] messaging scheme. Such a signaling
   mapping is intended to enable Javascript to use XMPP/Jingle to establish
   a session between two RTCWeb enabled browsers.
      </t>
    </abstract>

  </front>

  <middle>
    <section anchor="intro" title="Introduction">
    
      <t>
   In draft <xref target="I-D.ietf-rtcweb-jsep" />, it is mentioned that 
   there are several options for the signalling mechanisms: ROAP, SIP 
   or XMPP/Jingle. 
      </t>
      
      <t>
   This document focuses on XMPP/Jingle and tries to explain how to use
   JSEP and XMPP/Jingle to exchange session descriptions.
      </t>    

      <section anchor="terms" title="Terminology">
        <t>
          The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
          "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in
          this document are to be interpreted as described in 
          <xref target='RFC2119' />.
        </t>
      </section>   
         
    </section>

    <section anchor="overview" title="Media Setup Overview">
      <t>
   The example here shows a typical call setup using the JSEP model. We
   assume the following architecture in this example, where UA is
   synonymous with "browser", and JS is synonymous with "web
   application".
      </t> 
      
      <t>
     In <xref target="mapping_arch" />, it shows the overall mapping architecture.
      </t>   
         
      <t>
        <figure align="center" anchor="mapping_arch" title="JSEP-XMPP/Jingle Mapping Architecture">
         <artwork>           
                        +----------------------+                      
                        |         Web          |         
                        |                      |
                        |       Server         |              
                        +----------------------+         
                          /                 \
                        /                     \      
            Jingle    /                         \   Jingle
                    /                             \
                  /                                 \
                /                                     \
        +-------------+                        +--------------+
        |     Web     |                        |      Web     |
        | Application |                        |  Application |
        + ----------- +                        + ------------ +
               ^                                       ^
               |  SDP                                  |  SDP
               |                                       |
               V (JSEP)                                V (JSEP)
        +-------------+                        +--------------+
        |   Caller    |                        |    Callee    |
        |             | &lt;====== Media =======> |              |
        |   Browser   |                        |    Browser   |
        +-------------+                        +--------------+
            </artwork>
         </figure>   
       </t>   
      
      <section anchor="Initiating_Session" title="Initiating the Session">  
            <t>
      To initiate a session, the Caller can send the offer to the Callee 
      by using Jingle "session-initiate" action.
           </t>        
           <t>
        CallerJS->CalleeJS: 
        <![CDATA[
 <jingle action="session-initiate"/> ]]>.
           </t>
      </section>
         
      <section anchor="Exchange_ICE" title="Exchange the ICE"> 
        <section anchor="Transport_Info" title="Transport Information">    
            <t>
      To perform the ICE process, the Caller can exchange the ICE candidates  
      with the Callee by using Jingle "transport-info" action.
           </t>        
           <t>
        CallerJS->CalleeJS: <![CDATA[
         <jingle action="transport-info"/>]]>.
           </t>
           <t>
        CalleeJS->CallerJS: <![CDATA[
         <jingle action="transport-info"/>]]>.
           </t>
         </section>   
         
      </section>  
      
      <section anchor="Receiving_Session" title="Receiving the Session">  
        <section anchor="Accept_Session" title="Accept the Session">    
          <t>
      If the Callee accepts a session, it can send back the answer by 
      using Jingle "session-accept" action.
          </t>        
          <t>
        CalleeJS->CallerJS: <![CDATA[
         <jingle action="session-accept"/>]]>.
          </t>
       </section>
       
       <section anchor="Termincate_Session" title="Terminate the Session">     
            <t>
      To terminate a session, the Caller can send the offer to the Callee
      by using Jingle "session-terminate" action.
           </t>        
           <t>
        CallerJS->CalleeJS: <![CDATA[
         <jingle action="session-terminate"/>]]>.
           </t>
       </section>  
      </section>
      
      <section anchor="Updating" title="Updates to the Session">  
         <section anchor="Add_Media" title="Add Media">   
           <t>
      To add media (e.g.video) to an existing session, the Caller can 
      use Jingle "content-add" action.
           </t>        
           <t>
        CallerJS->CalleeJS:  <![CDATA[
          <jingle action="content-add"/>]]>.
           </t>
         </section>
         
         <section anchor="Modify_Media" title="Modify Media">   
           <t>
      To modify media (e.g.change audio to video) to an existing session, 
      the Caller can use Jingle "content-modify" action.
           </t>        
           <t>
        CallerJS->CalleeJS:  <![CDATA[
          <jingle action="content-modify"/>]]>.
           </t>
         </section>
         
         <section anchor="Remove_Media" title="Remove Media">   
           <t>
      To remove media (e.g.video) to an existing session, the Caller can 
      use Jingle "content-remove" action.
           </t>        
           <t>
        CallerJS->CalleeJS:  <![CDATA[
          <jingle action="content-remove"/>]]>.
           </t>
         </section>
         
         <section anchor="Accept_Media" title="Accept Media">   
           <t>
      If the Callee accepts the "content-add" action to an existing session 
      from the Caller, Callee can send back answer by using
       Jingle "content-accept" action.
           </t>        
           <t>
        CalleeJS->CallerJS: <![CDATA[
         <jingle action="content-accept"/>]]>.
           </t>
         </section>
         
         <section anchor="Reject_Media" title="Reject Media">   
           <t>
      If the Callee rejects the "content-add" action to an existing session 
      from the Caller, Callee can send back answer by using
       Jingle "content-reject" action.
           </t>        
           <t>
        CalleeJS->CallerJS: <![CDATA[
         <jingle action="content-reject"/>]]>.
           </t>
         </section>
         
          <section anchor="Desc_Info" title="Description Information">   
           <t>
      To send informational hints about parameters related to an existing session, 
      for example, add new video sources to a call that already has video, the 
      Caller can indicate that by using Jingle "description-info" action.
           </t>        
           <t>
        CallerJS->CalleeJS: <![CDATA[
         <jingle action="description-info"/>]]>.
           </t>
         </section>
         
         <section anchor="Result" title="Result">   
           <t>
      To acknowledge the description information to an existing session from 
      the Caller, Callee can send back answer by using
       IQ stanza of "result" type. See <xref target='RFC6120' />.
           </t>        
           <t>
        CalleeJS->CallerJS: <![CDATA[
         <iq type="result"/>]]>.
           </t>
         </section> 
         
         <section anchor="Error" title="Error">   
           <t>
      If there are errors occurred during an existing session, 
      the Callee can send back answer by using
       IQ stanza of "error" type. See <xref target='RFC6120' />.
           </t>        
           <t>
        CalleeJS->CallerJS: <![CDATA[
         <iq type="error"/>]]>.
           </t>
         </section>           
         
      </section>
      
      <section anchor="Others" title="Other Actions">
       <t>
       TBD 1: do we have usage for the following actions: "security-info", 
       "session-info"?
       </t>
       <t>
       TBD 2: do we need to redefine a transport method? If yes, we can use
       "transport-replace", "transport-accept", "transport-reject". 
       </t>       
      </section>        

    </section> 
      
      <section anchor="Examples" title="Example Message Flows"> 
       <section anchor="Example_Candidates" title="Exchange Candidates">
         <t>
   In <xref target="msc_exchange_candidates" />, 
   CallerJS uses Jingle "session-initiate" action to
   initiate a session with CalleeJS, and uses Jingle "transport-info" to 
   exchange ICE candidates with CalleeJS. Then CalleeJS accepts the session
   using Jingle "session-accept" action. After the media session, CallerJS 
   uses "session-terminate" action to terminate the session, and CalleeJS
   acknowledges with IQ stanza of "result" type.
         </t>
         <t>
            <figure align="center" anchor="msc_exchange_candidates" title="Exchange Candidates"> 
             <artwork> <![CDATA[
             
    Caller JS                              Callee JS
       |                                       |                       
       |  <jingle action="session-initiate"/>  |                        
       |-------------------------------------->|       
       |                                       |
       |  <jingle action="transport-info"/>    |     
       |-------------------------------------->|
       |                                       |
       |  <jingle action="transport-info"/>    |     
       |<--------------------------------------|
       |                                       |
       |  <jingle action="session-accept"/>    |     
       |<--------------------------------------|               
       |                                       |
       |           Media Session               |     
       |<=====================================>|   
       |                                       |                       
       |  <jingle action="session-terminate"/> |                        
       |-------------------------------------->|           
       |                                       |                       
       |        <iq type="result"/>            |                        
       |<--------------------------------------| 
       |                                       |
           ]]>   </artwork>  
            </figure>               
         </t>
        <t>
        Message details go here...
         </t>
      </section>    
        
      <section anchor="Example_Add_Contents" title="Add Contents">
         <t>
   In <xref target="msc_content_add" />, 
   CallerJS uses Jingle "content-add" action to
   add video media to an existing session. CalleeJS accepts that by using
   Jingle "content-accept" action. For simplicity, candidate exchange
   is not shown.
         </t>
         <t>
            <figure align="center" anchor="msc_content_add" title="Add Contents">
             <artwork> <![CDATA[
             
    Caller JS                              Callee JS
       |                                       |                       
       |  <jingle action="content-add"/>       |                        
       |-------------------------------------->|   
       |                                       |
       |  <jingle action="content-accept"/>    |     
       |<--------------------------------------|
       |                                       |
       |           Media Session               |     
       |<=====================================>|   
       |                                       |
           ]]>   </artwork>  
            </figure>               
         </t>
        <t>
        Message details go here...
         </t>
      </section>   
        
      <section anchor="Example_Video_Stream" title="Exchange Description Information">
         <t>
   In <xref target="msc_exchange_desc" />, CallerJS uses Jingle "description-info" action to
   add new video sources at the same time to a call that already has video. 
   CalleeJS also uses Jingle "description-info" action to indicate the new
   sources to the remote side. After that, they uses IQ stanza of "result"
   type to acknowledge each other.
         </t>
         <t>
            <figure align="center" anchor="msc_exchange_desc" title="Exchange Description Information">
             <artwork> <![CDATA[
             
    Caller JS                              Callee JS
       |                                       |                       
       |  <jingle action="description-info"/>  |                        
       |-------------------------------------->|   
       |                                       |                       
       |  <jingle action="description-info"/>  |                        
       |<--------------------------------------| 
       |                                       |
       |          <iq type="result"/>          |     
       |-------------------------------------->|
       |                                       |
       |          <iq type="result"/>          |     
       |<--------------------------------------|
       |                                       |
       |           Media Session               |     
       |<=====================================>|   
       |                                       |
           ]]>   </artwork>  
            </figure>               
         </t>
        <t>
        Message details go here...
         </t>
      </section>        
      
      </section>
   
      <section anchor="security" title="Security Considerations">
        <t>
           TBD. 
        </t>
      </section>


    <section anchor="iana" title="IANA Considerations">
      <t>
        This document requires no actions from IANA.
      </t>
    </section> 
    
    <section anchor="acknowledgement" title="Acknowledgements">
      <t>
        The author would like to thank Kiran Kumar and Bert
        greevenbosch for the reviews and feedbacks.
      </t>
    </section>

  </middle>

  <back>
    <references title="Normative References">
      &RFC2119;
      &RFC3264;
      &RFC6120;
      &ROAP;
      &JSEP;
      <reference anchor="XEP-0166">
        <front>
          <title>Jingle</title>
          <author>
            <organization>XMPP Standards Foundation</organization>
          </author>
          <date month="Dec" year="2009"/>
        </front>
      </reference>  
    </references>
  </back>
</rfc>
    