<?xml version="1.0" encoding="UTF-8"?>
<!--
   XML data type definitions for the RESTful Network API for WebRTC Signaling  
   Version: 1.0 (1.0)
   Date: 31 Jan 2017
   
   FILE INFORMATION 
   
      OMA Permanent Document 
         File: OMA-SUP-XSD_rest_netapi_webrtcsignaling-V1_0-20170131-A
         Type: Text - Schema Description 
   
   Public Reachable Information 
      Path: http://www.openmobilealliance.org/tech/profiles 
      Name: rest_netapi_webrtcsignaling-v1_0.xsd 
   
   NORMATIVE INFORMATION
   
   Information about this file can be found in the latest revision of the specification
 
       OMA-TS-REST_NetAPI_WebRTCSignaling-V1_0 
       
       This is available at http://www.openmobilealliance.org/
   
      Send comments to technical-comments@mail.openmobilealliance.org
   
   CHANGE HISTORY 
   31012017 Status changed to Approved by TP, TP Ref # OMA-TP-2017-0004-INP_REST_NetAPI_WebRTCSignaling-V1_0_ERP_for_Final_Approval
      
   LEGAL DISCLAIMER

  Copyright 2017 Open Mobile Alliance  All rights reserved.

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions
  are met:

  1. Redistributions of source code must retain the above copyright
  notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright
  notice, this list of conditions and the following disclaimer in the
  documentation and/or other materials provided with the distribution.
  3. Neither the name of the copyright holder nor the names of its
  contributors may be used to endorse or promote products derived
  from this software without specific prior written permission.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  POSSIBILITY OF SUCH DAMAGE.

  The above license is used as a license under copyright only.  Please
  reference the OMA IPR Policy for patent licensing terms:
  http://www.openmobilealliance.org/ipr.html   
-->


<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   targetNamespace="urn:oma:xml:rest:netapi:webrtcsignaling:1" 
   xmlns:common="urn:oma:xml:rest:netapi:common:1"
   xmlns="urn:oma:xml:rest:netapi:webrtcsignaling:1" version="1.0">
   
   <xsd:annotation>
      <xsd:documentation>This schema defines the XML data types for the RESTful Network API for WebRTC Signaling.</xsd:documentation>
   </xsd:annotation>
   
   <xsd:import namespace="urn:oma:xml:rest:netapi:common:1"
      schemaLocation="http://www.openmobilealliance.org/tech/profiles/rest_netapi_common-v1_0.xsd"/>

   <!-- Importing xml default declarations (like xml:lang and xml:space) -->
   <xsd:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/xml.xsd"/>
   
   <!-- ==================================== -->
   <!-- Subscriptions -->
   <!-- ==================================== -->
   
   <xsd:element name="wrtcsSubscriptionList" type="WrtcsSubscriptionList"/>
   
   <xsd:complexType name="WrtcsSubscriptionList">
      <xsd:sequence>
         <xsd:element name="wrtcsNotificationSubscription" type="WrtcsNotificationSubscription" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="resourceURL" type="xsd:anyURI " minOccurs="1" maxOccurs="1"/>         
      </xsd:sequence>
   </xsd:complexType>
   
   <xsd:element name="wrtcsNotificationSubscription" type="WrtcsNotificationSubscription"/>
   
   <xsd:complexType name="WrtcsNotificationSubscription">
      <xsd:sequence>
         <xsd:element name="callbackReference" type="common:CallbackReference" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="duration" type="xsd:int" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="clientCorrelator" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="resourceURL" type="xsd:anyURI " minOccurs="0" maxOccurs="1"/>         
      </xsd:sequence>
   </xsd:complexType>
   
   <!-- ==================================== -->
   <!-- Call Session -->
   <!-- ==================================== -->

   <xsd:element name="wrtcsSession" type="WrtcsSession"/>
   
   <xsd:complexType name="WrtcsSession">
      <xsd:sequence>
         <xsd:element name="originatorAddress" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="originatorName" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="tParticipantAddress" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="tParticipantName" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="status" type="SessionStatus" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="offer" type="WrtcsOffer" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="answer" type="WrtcsAnswer" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="update" type="WrtcsOffer" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="clientCorrelator" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="resourceURL" type="xsd:anyURI " minOccurs="0" maxOccurs="1"/>         
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:element name="wrtcsSessionStatus" type="WrtcsSessionStatus"/>
   
   <xsd:complexType name="WrtcsSessionStatus">
      <xsd:sequence>
         <xsd:element name="status" type="SessionStatus" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <!-- ==================================== -->
   <!-- Offer and Answer -->
   <!-- ==================================== -->
   
   <xsd:element name="wrtcsAnswer" type="WrtcsAnswer"/>
   
   <xsd:complexType name="WrtcsAnswer">
      <xsd:sequence>
         <xsd:element name="type" type="OfferAnswerType" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="isProvisional" type="xsd:boolean" minOccurs="1" maxOccurs="1"/>
         <xsd:choice minOccurs="1" maxOccurs="1">
            <xsd:element name="sdp" type="xsd:string" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="sdpBase64" type="xsd:base64Binary" minOccurs="1" maxOccurs="1"/>
         </xsd:choice>
         <xsd:element name="mediaIndicator" type="MediaIndicator" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="allowVideoUpgrade" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
	 </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:element name="wrtcsOffer" type="WrtcsOffer"/>
   
   <xsd:complexType name="WrtcsOffer">
      <xsd:sequence>
         <xsd:element name="type" type="OfferAnswerType" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="holdAlerting" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
         <xsd:choice minOccurs="1" maxOccurs="1">
            <xsd:element name="sdp" type="xsd:string" minOccurs="1" maxOccurs="1"/>
            <xsd:element name="sdpBase64" type="xsd:base64Binary" minOccurs="1" maxOccurs="1"/>
         </xsd:choice>
         <xsd:element name="mediaIndicator" type="MediaIndicator" minOccurs="0" maxOccurs="unbounded"/>         
         <xsd:element name="serviceType" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="allowVideoUpgrade" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>


   <xsd:complexType name="MediaIndicator">
      <xsd:sequence>
         <xsd:element name="type" type="MediaType" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="entryIdx" type="xsd:unsignedInt" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="entryId" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="streamId" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="trackId" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="payload" type="PayloadIndicator" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="direction" type="MediaDirection" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   <xsd:complexType name="PayloadIndicator">
      <xsd:sequence>
         <xsd:element name="payloadType" type="xsd:unsignedInt" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="encoding" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="formatParams" type="xsd:string" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <!-- ==================================== -->
   <!-- Notifications -->
   <!-- ==================================== -->
   
   <xsd:element name="wrtcsEventNotification" type="WrtcsEventNotification"/>
   
   <xsd:complexType name="WrtcsEventNotification">
      <xsd:sequence>
         <xsd:element name="callbackData" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="link" type="common:Link" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="eventType" type="EventType" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="eventDescription" type="xsd:string" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   

   <xsd:element name="wrtcsSessionInvitationNotification" type="WrtcsSessionInvitationNotification"/>
   
   <xsd:complexType name="WrtcsSessionInvitationNotification">
      <xsd:sequence>
         <xsd:element name="callbackData" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="link" type="common:Link" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="originatorAddress" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="originatorName" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="tParticipantAddress" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="tParticipantName" type="xsd:string" minOccurs="0" maxOccurs="1"/>
          <xsd:element name=" forceConnectingWithoutMedia" type="xsd:boolean" minOccurs="0" maxOccurs="1"/>
          <xsd:element name="offer" type="WrtcsOffer" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>

   
   <xsd:element name="wrtcsAcceptanceNotification" type="WrtcsAcceptanceNotification"/>
   
   <xsd:complexType name="WrtcsAcceptanceNotification">
      <xsd:sequence>
         <xsd:element name="callbackData" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="link" type="common:Link" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="answer" type="WrtcsAnswer" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:element name="wrtcsOfferNotification" type="WrtcsOfferNotification"/>
   
   <xsd:complexType name="WrtcsOfferNotification">
      <xsd:sequence>
         <xsd:element name="callbackData" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="link" type="common:Link" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="offer" type="WrtcsOffer" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:element name="wrtcsAnswerNotification" type="WrtcsAnswerNotification"/>
   
   <xsd:complexType name="WrtcsAnswerNotification">
      <xsd:sequence>
         <xsd:element name="callbackData" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="link" type="common:Link" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="answer" type="WrtcsAnswer" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:element name="wrtcsSubscriptionCancellationNotification" type="WrtcsSubscriptionCancellationNotification"/>
   
   <xsd:complexType name="WrtcsSubscriptionCancellationNotification">
      <xsd:sequence>
         <xsd:element name="callbackData" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="link" type="common:Link" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="reason" type="common:ServiceError" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:element name="wrtcsIceStatus" type="WrtcsIceStatus"/>
   
   <xsd:complexType name="WrtcsIceStatus">
      <xsd:sequence>
         <xsd:element name="status" type="IceStatus" minOccurs="1" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
  
   <xsd:element name="wrtcsConflictNotification" type="WrtcsConflictNotification"/>
   
   <xsd:complexType name="WrtcsConflictNotification">
      <xsd:sequence>
         <xsd:element name="callbackData" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="link" type="common:Link" minOccurs="1" maxOccurs="unbounded"/>
         <xsd:element name="reason" type="common:ServiceError" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <!-- ==================================== -->
   <!-- Enumerations -->
   <!-- ==================================== -->
   
   <xsd:simpleType name="EventType">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="Cancelled"/>
         <xsd:enumeration value="SessionEnded"/>
         <xsd:enumeration value="Declined"/>
         <xsd:enumeration value="NoAnswer"/>
         <xsd:enumeration value="NotReachable"/>
         <xsd:enumeration value="Ringing"/>
         <xsd:enumeration value="Busy"/>
      </xsd:restriction>
   </xsd:simpleType>
   

   <xsd:simpleType name="SessionStatus">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="Initiated"/>
         <xsd:enumeration value="Ringing"/>
         <xsd:enumeration value="Connected"/>
         <xsd:enumeration value="Closed"/>
      </xsd:restriction>
   </xsd:simpleType>
   

   <xsd:simpleType name="IceStatus">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="New"/>
         <xsd:enumeration value="Checking"/>
         <xsd:enumeration value="Connected"/>
         <xsd:enumeration value="Completed"/>
         <xsd:enumeration value="Failed"/>
         <xsd:enumeration value="Disconnected"/>
         <xsd:enumeration value="Closed"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   
   <xsd:simpleType name="MediaType">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="Audio"/>
         <xsd:enumeration value="Video"/>
         <xsd:enumeration value="Data"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   
   <xsd:simpleType name="MediaDirection">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="SendRecv"/>
         <xsd:enumeration value="SendOnly"/>
         <xsd:enumeration value="RecvOnly"/>
         <xsd:enumeration value="Inactive"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   
   <xsd:simpleType name="OfferAnswerType">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="Local"/>
         <xsd:enumeration value="Remote"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   
</xsd:schema>