<?xml version="1.0" encoding="UTF-8"?>
<!--
   FILE INFORMATION 
   Description 
   This schema describes RESTful bindings for Parlay X Web Services, Call Notification 
   
   Version: 1.0 (1.0)
   Date: 11 Jan 2011 
   
   OMA Permanent Document 
   File: OMA-SUP-XSD_rest_callnotification-V1_0-20110111-C
   Type: Text 
   
   Public Reachable Information 
   Path: http://www.openmobilealliance.org/tech/profiles 
   Name: rest_callnotification-v1_0.xsd 
   
   NORMATIVE INFORMATION
   
   Information about this file can be found in the latest revision of the specification
   OMA-TS-ParlayREST_CallNotification-V1_0 available at
   http://www.openmobilealliance.org/
   
   Send comments to technical-comments@mail.openmobilealliance.org
   
   LEGAL DISCLAIMER
   
   Use of this document is subject to all of the terms and conditions
   of the Use Agreement located at
   http://www.openmobilealliance.org/UseAgreement.html,
   provided, however, that section (d) under "Documents - Terms 
   of Use" which states, "no modifications are made to such 
   Documents" does not apply to your use.
   
   The Open Mobile Alliance authorizes you to copy this document, 
   provided that you retain all copyright and other proprietary  
   notices contained in the original materials on any copies of the 
   materials and  that you comply strictly with these terms. This 
   copyright permission does not constitute an endorsement of the 
   products or services. The Open Mobile Alliance assumes no 
   responsibility for errors or omissions in this document.
   
   Each Open Mobile Alliance member has agreed to use reasonable
   endeavors to inform the Open Mobile Alliance in a timely manner of
   Essential IPR as it becomes aware that the Essential IPR is related
   to the prepared or published specification.  However, the members
   do not have an obligation to conduct IPR searches.  The declared
   Essential IPR is publicly available to members and non-members of
   the Open Mobile Alliance and may be found on the "OMA IPR
   Declarations" list at http://www.openmobilealliance.org/ipr.html.
   The Open Mobile Alliance has not conducted an independent IPR review
   of this document and the information contained herein, and makes no
   representations or warranties regarding third party IPR, including
   without limitation patents, copyrights or trade secret rights.  This
   document may contain inventions for which you must obtain licenses
   from third parties before making, using or selling the inventions.
   Defined terms above are set forth in the schedule to the Open Mobile
   Alliance Application Form.
   
   NO REPRESENTATIONS OR WARRANTIES (WHETHER EXPRESS OR IMPLIED) ARE
   MADE BY THE OPEN MOBILE ALLIANCE OR ANY OPEN MOBILE ALLIANCE MEMBER
   OR ITS AFFILIATES REGARDING ANY OF THE IPR'S REPRESENTED ON THE "OMA
   IPR DECLARATIONS" LIST, INCLUDING, BUT NOT LIMITED TO THE ACCURACY,
   COMPLETENESS, VALIDITY OR RELEVANCE OF THE INFORMATION OR WHETHER OR
   NOT SUCH RIGHTS ARE ESSENTIAL OR NON-ESSENTIAL.
   
   THE OPEN MOBILE ALLIANCE IS NOT LIABLE FOR AND HEREBY DISCLAIMS ANY
   DIRECT, INDIRECT, PUNITIVE, SPECIAL, INCIDENTAL, CONSEQUENTIAL, OR
   EXEMPLARY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF
   DOCUMENTS AND THE INFORMATION CONTAINED IN THE DOCUMENTS.
   
   Copyright 2011 Open Mobile Alliance Ltd.  All Rights Reserved.
   Used with the permission of the Open Mobile Alliance Ltd. under the
   terms set forth above.   
-->

<!--
   CHANGE HISTORY 
   20100429 File created by Uwe Rauschenbach, NSN, based on OMA-ARC-REST-2010-0176-INP_CR_CallNotification_TS_resources_datastructures_flows
   20100506 Aligned with OMA-TS-ParlayREST_CallNotification-V1_0-20100506-D.doc
   20100526 Aligned with OMA-TS-ParlayREST_CallNotification-V1_0-20100526-D.doc
   20100616 CR OMA-ARC-REST-2010-0285-CR_CallNotification_XSD_fixes applied
   20100624 CR OMA-ARC-REST-2010-0285R01-CR_CallNotification_XSD_fixes applied
   20100802 CR OMA-ARC-REST-2010-0367-CR_Redundancy_fix_CallNotification_XSD applied
   20100826 CR OMA-ARC-REST-2010-0367R01-CR_Redundancy_fix_CallNotification_XSD applied
   20100830 Updated with the latest OMA legal disclaimer
   20100920 Implemented OMA-ARC-REST-2010-0535-INP_Default_Namespaces_Fix_in_Some_XSDs 
   20101201 Aligned with changes in CR OMA-ARC-REST-2010-0672R01-CR_CONRR_resolution_D009_CallNotif 
   20101217 Import declaration fixed 
   20110111 Candidate approval
-->

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   targetNamespace="urn:oma:xml:rest:callnotification:1" 
   xmlns:common="urn:oma:xml:rest:common:1"
   xmlns="urn:oma:xml:rest:callnotification:1" version="1.0">
   
   <xsd:annotation>
      <xsd:documentation>This schema defines the XML for validating data used in the CallNotification REST enabler.</xsd:documentation>
   </xsd:annotation>
   
   <xsd:import namespace="urn:oma:xml:rest:common:1"
      schemaLocation="http://www.openmobilealliance.org/tech/profiles/rest_common-v1_1.xsd"/>
   
   <xsd:complexType name="EventDescription">
      <xsd:sequence>
         <xsd:element name="callEvent" type="CallEvents" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="description" type="xsd:string" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:element name="action" type="Action"/>
   
   <xsd:complexType name="Action">
      <xsd:sequence>
         <xsd:element name="actionToPerform" type="ActionValues" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="routingAddress" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="charging" type="common:ChargingInformation" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="mediaInfo" type="common:MediaInfo" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="decisionId" type="xsd:string" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>   
   </xsd:complexType>
   
   
   <xsd:element name="callNotificationSubscriptionList" type="CallNotificationSubscriptionList"/>
   
   <xsd:complexType name="CallNotificationSubscriptionList">
      <xsd:sequence>
         <xsd:element name="callEventSubscription" type="CallEventSubscription" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="callDirectionSubscription" type="CallDirectionSubscription" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="playAndCollectInteractionSubscription" type="PlayAndCollectInteractionSubscription" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="playAndRecordInteractionSubscription" type="PlayAndRecordInteractionSubscription" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="resourceURL" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:complexType name="CallEventFilter">
      <xsd:sequence>
         <xsd:element name="address" type="xsd:anyURI" minOccurs="1" maxOccurs="unbounded"/>
         <xsd:element name="criteria" type="CallEvents" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="addressDirection" type="AddressDirection" minOccurs="0" maxOccurs="1"/> 
      </xsd:sequence>
   </xsd:complexType>
   

   <xsd:complexType name="CallNotificationSubscription">
      <xsd:sequence>
         <xsd:element name="callbackReference" type="common:CallbackReference" minOccurs="1"  maxOccurs="1"/>
         <xsd:element name="filter" type="CallEventFilter" minOccurs="1"  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="callEventSubscription" type="CallEventSubscription"/>
   
   <xsd:complexType name="CallEventSubscription">
      <xsd:complexContent>
         <xsd:extension base="CallNotificationSubscription"/>
      </xsd:complexContent>
   </xsd:complexType>
   
   
   <xsd:element name="callDirectionSubscription" type="CallDirectionSubscription"/>
   
   <xsd:complexType name="CallDirectionSubscription">
      <xsd:complexContent>
         <xsd:extension base="CallNotificationSubscription"/>
      </xsd:complexContent>
   </xsd:complexType>
   
   
   <xsd:complexType name="MediaInteractionSubscription">
      <xsd:sequence>
         <xsd:element name="callbackReference" type="common:CallbackReference" minOccurs="1"  maxOccurs="1"/> 
         <xsd:choice>
            <xsd:element name="callSessionIdentifier" type="xsd:string" minOccurs="1"  maxOccurs="1"/>
            <xsd:element name="link" type="common:Link" minOccurs="1" maxOccurs="1"/>
         </xsd:choice>
         <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="playAndCollectInteractionSubscription" type="PlayAndCollectInteractionSubscription"/>
     
   <xsd:complexType name="PlayAndCollectInteractionSubscription">
      <xsd:complexContent>
         <xsd:extension base="MediaInteractionSubscription"/>
      </xsd:complexContent>
   </xsd:complexType>
   
   <xsd:element name="playAndRecordInteractionSubscription" type="PlayAndRecordInteractionSubscription"/>
   
   <xsd:complexType name="PlayAndRecordInteractionSubscription">
      <xsd:complexContent>
         <xsd:extension base="MediaInteractionSubscription"/>
      </xsd:complexContent>
   </xsd:complexType>
   
   
   <xsd:element name="callEventNotification" type="CallEventNotification"/>
   
   <xsd:complexType name="CallEventNotification">
      <xsd:sequence>
         <xsd:element name="callbackData" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="notificationType" type="CallEventNotificationTypes" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="eventDescription" type="EventDescription" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="callingParticipant" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="callingParticipantName" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="calledParticipant" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="callSessionIdentifier" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="link" type="common:Link" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:element name="mediaInteractionNotification" type="MediaInteractionNotification"/>
   
   <xsd:complexType name="MediaInteractionNotification">
      <xsd:sequence>
         <xsd:element name="callbackData" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="notificationType" type="MediaInteractionNotificationTypes" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="callParticipant" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="mediaInteractionResult" type="xsd:string" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="link" type="common:Link" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
   </xsd:complexType>
   

   <xsd:element name="callEventMonitorList" type="CallEventMonitorList"/>
   
   <xsd:complexType name="CallEventMonitorList">
      <xsd:sequence>
         <xsd:element name="callEventMonitor" type="CallEventMonitor" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="resourceURL" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:element name="callEventMonitor" type="CallEventMonitor"/>
   
   <xsd:complexType name="CallEventMonitor">
      <xsd:sequence>
         <xsd:element name="filter" type="CallEventFilter	" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="callEventRecordList" type="CallEventRecordList" 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="callEventRecordList" type="CallEventRecordList"/>
   
   <xsd:complexType name="CallEventRecordList">
      <xsd:sequence>
         <xsd:element name="callEventRecord" type="CallEventRecord" minOccurs="0" maxOccurs="unbounded"/>
         <xsd:element name="resourceURL" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:element name="callEventRecord" type="CallEventRecord"/>
   
   <xsd:complexType name="CallEventRecord">
      <xsd:sequence>
         <xsd:element name="eventDescription" type="EventDescription" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="callingParticipant" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="callingParticipantName" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="calledParticipant" type="xsd:anyURI" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="callSessionIdentifier" type="xsd:string" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="timestamp" type="xsd:dateTime" minOccurs="1" maxOccurs="1"/>
         <xsd:element name="resourceURL" type="xsd:anyURI" minOccurs="0" maxOccurs="1"/>
         <xsd:element name="link" type="common:Link" minOccurs="0" maxOccurs="unbounded"/>
      </xsd:sequence>
   </xsd:complexType>
   
   
   <xsd:simpleType name="CallEvents">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="Busy"/>
         <xsd:enumeration value="NotReachable"/>
         <xsd:enumeration value="NoAnswer"/>
         <xsd:enumeration value="CalledNumber"/>
         <xsd:enumeration value="Answer"/>
         <xsd:enumeration value="Disconnected"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   
   <xsd:simpleType name="ActionValues">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="Route"/>
         <xsd:enumeration value="Continue"/>
         <xsd:enumeration value="EndCall"/>
         <xsd:enumeration value="Deferred"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   <xsd:simpleType name="CallEventNotificationTypes">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="CallEvent"/>
         <xsd:enumeration value="CallDirection"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   <xsd:simpleType name="MediaInteractionNotificationTypes">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="PlayAndCollect"/>
         <xsd:enumeration value="PlayAndRecord"/>
      </xsd:restriction>
   </xsd:simpleType>
   
   <xsd:simpleType name="AddressDirection">
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="Calling"/>
         <xsd:enumeration value="Called"/>
      </xsd:restriction>
   </xsd:simpleType>
   
</xsd:schema>