Internet Engineering Task Force
Internet Draft                                     Wu/Schulzrinne/Lennox
wu-cpl-schema-01.txt                                 Columbia University
November 4, 2002
Expires: May 2003


An Extensible Markup Language Schema for Call Processing Language (CPL)

STATUS OF THIS MEMO

   This document is an Internet-Draft and is in full conformance with
   all provisions of Section 10 of RFC2026.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF), its areas, and its working groups.  Note that
   other groups may also distribute working documents as Internet-
   Drafts.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress".

   The list of current Internet-Drafts can be accessed at
   http://www.ietf.org/ietf/1id-abstracts.txt

   To view the list Internet-Draft Shadow Directories, see
   http://www.ietf.org/shadow.html.


Abstract

   This document provides an Extensible Markup Language (XML) Schema for
   the Call Processing Language (CPL). The original CPL specification
   only provides a Document Type Declaration (DTD) to describe the
   structure of the language. Compared with XML DTDs, XML schemas have
   many advantages such as performing stricter type checking, providing
   pre-defined data types and being able to derive new data types from
   existing ones.


1 Introduction

   The Call Processing Language (CPL) [1] is a language that can be used
   to describe and control Internet telephony services. It is based on
   the Extensible Markup Language (XML) [2], a common hierarchical
   format for describing structured data.



Wu/Schulzrinne/Lennox                                         [Page 1]


Internet Draft                 CPL-Schema               November 4, 2002


   There are two primary formats used to describe the structure of an
   XML document. The older one, the Document Type Declaration (DTD) is
   part of the original XML specification; the newer one, the XML schema
   [3] was defined later. At the time the CPL specification was written,
   the XML schema specification had not yet been finalized, so the CPL
   specification only provides a DTD for the CPL.

   Compared with XML DTDs, XML schemas have many advantages.  XML
   schemas perform stricter type checking and provide many pre-defined
   data types. Also, XML schemas allow the derivation of new data types
   from existing ones, making it easier to use XML schemas for CPL
   extensions.

   This document therefore defines an XML schema for the CPL.  And we
   recommend that all future extensions of CPL should use schema
   definitions only.

2 Overview of the schema

   Most of the data types defined in the CPL DTD can be easily
   translated to an XML schema. However, two limitations on XML schema
   make several data types of CPL difficult to define. The first
   limitation is that several CPL data types are defined as having
   case-insensitive values, whereas XML schemas cannot easily define
   case-insensitive strings, so in the CPL schema, we have to use string
   patterns to define some tokens. For example, we have to use
   <xs:pattern value="[y|Y][e|E][a|A][r|R][l|L][y|Y]"/> to define the
   token 'YEAR' in a case-insensitive manner. The second limitation of
   XML schema is that it only allows white space as a list delimiter.
   However, the time-switch of CPL follows Internet Calendaring and
   Scheduling Core Object Specification (iCalendar COS), RFC 2445 [4],
   which uses comma (,) as its list delimiter. So we cannot use
   <xs:list> to define some data types, such as the ByDayType, which
   contains a list of days of the week. We have to use string pattern to
   define the list.  In addition, the time format in iCalendar is
   different from that provided in XML schema, so we have to use
   <xs:string> to define the time, instead of using <xs:datetime> type.

3 The XML schema of the CPL

   The following is the XML schema of the CPL. We have checked the
   schema with the examples in the original CPL specification. The
   namespace URI for elements defined by this specification is a URN
   [5], using the namespace identifier 'ietf' defined by [6] and
   extended by [7]. This URN is:

   urn:ietf:params:xml:ns:cpl




Wu/Schulzrinne/Lennox                                         [Page 2]


Internet Draft                 CPL-Schema               November 4, 2002


   <?xml version="1.0" encoding="UTF-8"?>
      <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
                targetNamespace="urn:ietf:params:xml:ns:cpl"
                xmlns="urn:ietf:params:xml:ns:cpl" >
     <xs:group name="Switch">
       <xs:choice>
         <xs:element name="address-switch" type="AddressSwitchType"/>
         <xs:element name="string-switch" type="StringSwitchType"/>
         <xs:element name="language-switch" type="LanguageSwitchType"/>
         <xs:element name="time-switch" type="TimeSwitchType"/>
         <xs:element name="priority-switch" type="PrioritySwitchType"/>
       </xs:choice>
     </xs:group>
     <xs:group name="Location">
       <xs:choice>
         <xs:element name="location" type="LocationType"/>
         <xs:element name="lookup" type="LookupType"/>
         <xs:element name="remove-location" type="RemoveLocationType"/>
       </xs:choice>
     </xs:group>
     <xs:group name="SignallingAction">
       <xs:choice>
         <xs:element name="proxy" type="ProxyAction"/>
         <xs:element name="redirect" type="RedirectAction"/>
         <xs:element name="reject" type="RejectAction"/>
       </xs:choice>
     </xs:group>
     <xs:group name="OtherAction">
       <xs:choice>
         <xs:element name="mail" type="MailAction"/>
         <xs:element name="log" type="LogAction"/>
         <xs:any/>
       </xs:choice>
     </xs:group>
     <xs:group name="Sub">
       <xs:all>
         <xs:element name="sub" type="SubAction"/>
       </xs:all>
     </xs:group>
     <xs:group name="Node">
       <xs:choice minOccurs="0">
         <xs:group ref="Switch"/>
         <xs:group ref="Location"/>
         <xs:group ref="SignallingAction"/>
         <xs:group ref="OtherAction"/>
         <xs:group ref="Sub"/>
       </xs:choice>
     </xs:group>



Wu/Schulzrinne/Lennox                                         [Page 3]


Internet Draft                 CPL-Schema               November 4, 2002


     <xs:complexType name="OtherwiseAction">
       <xs:group ref="Node"/>
     </xs:complexType>
     <xs:complexType name="NotPresentAction">
       <xs:group ref="Node"/>
     </xs:complexType>
     <xs:simpleType name="YesNoType">
       <xs:restriction base="xs:NMTOKEN">
         <xs:enumeration value="yes"/>
         <xs:enumeration value="no"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="CommaDelimiterType">
       <xs:restriction base="xs:string">
         <xs:enumeration value=","/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="AddressFieldType">
       <xs:restriction base="xs:NMTOKEN">
         <xs:enumeration value="origin"/>
         <xs:enumeration value="destination"/>
         <xs:enumeration value="original-destination"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="AddressSubfieldType">
       <xs:restriction base="xs:NMTOKEN">
         <xs:enumeration value="address-type"/>
         <xs:enumeration value="user"/>
         <xs:enumeration value="host"/>
         <xs:enumeration value="port"/>
         <xs:enumeration value="tel"/>
         <xs:enumeration value="display"/>
         <xs:enumeration value="password"/>
         <xs:enumeration value="alias-type"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:complexType name="AddressType">
       <xs:group ref="Node"/>
       <xs:attribute name="is" type="xs:string"/>
       <xs:attribute name="contains" type="xs:string"/>
       <xs:attribute name="subdomain-of" type="xs:string"/>
     </xs:complexType>
     <xs:complexType name="AddressSwitchType">
       <xs:sequence>
         <xs:element name="address" type="AddressType" minOccurs="0" maxOccurs="unbounded"/>
         <xs:sequence minOccurs="0">
           <xs:element name="not-present" type="NotPresentAction"/>
           <xs:element name="address" type="AddressType" minOccurs="0" maxOccurs="unbounded"/>



Wu/Schulzrinne/Lennox                                         [Page 4]


Internet Draft                 CPL-Schema               November 4, 2002


         </xs:sequence>
         <xs:element name="otherwise" type="OtherwiseAction" minOccurs="0"/>
       </xs:sequence>
       <xs:attribute name="field" type="AddressFieldType" use="required"/>
       <xs:attribute name="subfield" type="AddressSubfieldType" use="optional"/>
     </xs:complexType>
     <xs:simpleType name="StringFieldType">
       <xs:restriction base="xs:NMTOKEN">
         <xs:enumeration value="subject"/>
         <xs:enumeration value="organization"/>
         <xs:enumeration value="user-agent"/>
         <xs:enumeration value="display"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:complexType name="StringType">
       <xs:group ref="Node"/>
       <xs:attribute name="is" type="xs:string" use="optional"/>
       <xs:attribute name="contains" type="xs:string" use="optional"/>
     </xs:complexType>
     <xs:complexType name="StringSwitchType">
       <xs:sequence>
         <xs:element name="string" type="StringType" minOccurs="0" maxOccurs="unbounded"/>
         <xs:sequence minOccurs="0">
           <xs:element name="not-present" type="NotPresentAction"/>
           <xs:element name="string" type="StringType" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
         <xs:element name="otherwise" type="OtherwiseAction" minOccurs="0"/>
       </xs:sequence>
       <xs:attribute name="field" type="StringFieldType" use="required"/>
     </xs:complexType>
     <xs:simpleType name="LanguageTagType">
       <xs:restriction base="xs:string"/>
     </xs:simpleType>
     <xs:complexType name="LanguageType">
       <xs:group ref="Node"/>
       <xs:attribute name="matches" type="LanguageTagType" use="required"/>
     </xs:complexType>
     <xs:complexType name="LanguageSwitchType">
       <xs:sequence>
         <xs:element name="language" type="LanguageType" minOccurs="0" maxOccurs="unbounded"/>
         <xs:sequence minOccurs="0">
           <xs:element name="not-present" type="NotPresentAction"/>
           <xs:element name="language" type="LanguageType" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
         <xs:element name="otherwise" type="OtherwiseAction" minOccurs="0"/>
       </xs:sequence>
     </xs:complexType>
     <xs:simpleType name="FreqType">



Wu/Schulzrinne/Lennox                                         [Page 5]


Internet Draft                 CPL-Schema               November 4, 2002


       <xs:restriction base="xs:NMTOKEN">
         <xs:pattern value="[s|S][e|E][c|C][o|O][n|N][d|D][l|L][y|Y]"/>
         <xs:pattern value="[m|M][i|I][n|N][u|U][t|T][e|E][l|L][y|Y]"/>
         <xs:pattern value="[h|H][o|O][u|U][r|R][l|L][y|Y]"/>
         <xs:pattern value="[d|D][a|A][i|I][l|L][y|Y]"/>
         <xs:pattern value="[w|W][e|E][e|E][k|K][l|L][y|Y]"/>
         <xs:pattern value="[m|M][o|N][n|N][t|T][h|H][l|L][y|Y]"/>
         <xs:pattern value="[y|Y][e|E][a|A][r|R][l|L][y|Y]"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="DayType">
       <xs:restriction base="xs:NMTOKEN">
         <xs:pattern value="[m|M][o|O]"/>
         <xs:pattern value="[t|T][u|U]"/>
         <xs:pattern value="[w|W][e|E]"/>
         <xs:pattern value="[t|T][h|H]"/>
         <xs:pattern value="[f|F][r|R]"/>
         <xs:pattern value="[s|S][a|A]"/>
         <xs:pattern value="[s|S][u|U]"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="PositiveYearDayType">
       <xs:restriction base="xs:integer">
         <xs:minInclusive value="1"/>
         <xs:maxInclusive value="366"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="NegativeYearDayType">
       <xs:restriction base="xs:integer">
         <xs:minInclusive value="-366"/>
         <xs:maxInclusive value="-1"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="YearDayType">
       <xs:union memberTypes="PositiveYearDayType NegativeYearDayType"/>
     </xs:simpleType>
     <xs:simpleType name="ByYearDayType">
       <xs:annotation>Should be list of YearDayType</xs:annotation>
       <xs:restriction base="xs:string">
         <xs:pattern value="([+|-]?([1-9]|[1-9][0-9]|[1-2][0-9][0-9]|[3][0-5][0-9]|[3][6][0-6]))(,([+|-]?([1-9]|[1-9][0-9]|[1-2][0-9][0-9]|[3][0-5][0-9]|[3][6][0-6])))*"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="PositiveMonthDayType">
       <xs:restriction base="xs:integer">
         <xs:minInclusive value="1"/>
         <xs:maxInclusive value="31"/>
       </xs:restriction>
     </xs:simpleType>



Wu/Schulzrinne/Lennox                                         [Page 6]


Internet Draft                 CPL-Schema               November 4, 2002


     <xs:simpleType name="NegativeMonthDayType">
       <xs:restriction base="xs:integer">
         <xs:minInclusive value="-31"/>
         <xs:maxInclusive value="-1"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="MonthDayType">
       <xs:union memberTypes="PositiveMonthDayType NegativeMonthDayType"/>
     </xs:simpleType>
     <xs:simpleType name="ByMonthDayType">
       <xs:annotation>Should be list of MonthDayType</xs:annotation>
       <xs:restriction base="xs:string">
         <xs:pattern value="([+|-]?([1-9]|[1-2][0-9]|[3][0-1]))(,([+|-]?([1-9]|[1-2][0-9]|[3][0-1])))*"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="ExtendedDayType">
       <xs:restriction base="xs:string">
         <xs:pattern value="([+|-]?([1-9]|[1-9][0-9]|[1-2][0-9][0-9]|[3][0-5][0-9]|[3][6][0-6]))?([M|m][O|o]|[T|t][U|u]|[W|w][E|e]|[T|t][H|h]|[F|f][R|r]|[S|s][A|a]|[S|s][U|u])"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="ByDayType">
       <xs:annotation>Should be list of ExtendedDayType</xs:annotation>
       <xs:restriction base="xs:string">
         <xs:pattern value="([+|-]?([1-9]|[1-9][0-9]|[1-2][0-9][0-9]|[3][0-5][0-9]|[3][6][0-6]))?([M|m][O|o]|[T|t][U|u]|[W|w][E|e]|[T|t][H|h]|[F|f][R|r]|[S|s][A|a]|[S|s][U|u])(,([+|-]?([1-9]|[1-9][0-9]|[1-2][0-9][0-9]|[3][0-5][0-9]|[3][6][0-6]))?([M|m][O|o]|[T|t][U|u]|[W|w][E|e]|[T|t][H|h]|[F|f][R|r]|[S|s][A|a]|[S|s][U|u]))*"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="SecondMinuteType">
       <xs:restriction base="xs:integer">
         <xs:minInclusive value="0"/>
         <xs:maxInclusive value="59"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="BySecondMinuteType">
       <xs:annotation>Should be list of SecondMinuteType</xs:annotation>
       <xs:restriction base="xs:string">
         <xs:pattern value="([0-9]|[1-5][0-9])(,([0-9]|[1-5][0-9]))*"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="HourType">
       <xs:restriction base="xs:integer">
         <xs:minInclusive value="0"/>
         <xs:maxInclusive value="23"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="ByHourType">
       <xs:annotation>Should be list of HourType</xs:annotation>
       <xs:restriction base="xs:string">
         <xs:pattern value="([0-9]|[1][0-9]|[2][0-3])(,([0-9]|[1][0-9]|[2][0-3]))*"/>



Wu/Schulzrinne/Lennox                                         [Page 7]


Internet Draft                 CPL-Schema               November 4, 2002


       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="PositiveWeekType">
       <xs:restriction base="xs:integer">
         <xs:minInclusive value="1"/>
         <xs:maxInclusive value="53"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="NegativeWeekType">
       <xs:restriction base="xs:integer">
         <xs:minInclusive value="-53"/>
         <xs:maxInclusive value="-1"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="WeekType">
       <xs:union memberTypes="PositiveWeekType NegativeWeekType"/>
     </xs:simpleType>
     <xs:simpleType name="ByWeekType">
       <xs:restriction base="xs:string">
         <xs:pattern value="([+|-]?([1-9]|[1-4][0-9]|[5][0-3]))(,([+|-]?([1-9]|[1-4][0-9]|[5][0-3])))*"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="MonthType">
       <xs:restriction base="xs:integer">
         <xs:maxInclusive value="12"/>
         <xs:minInclusive value="1"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:simpleType name="ByMonthType">
       <xs:restriction base="xs:string">
         <xs:pattern value="([1-9]|[1][1-2])(,([1-9]|[1][1-2]))*"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:complexType name="TimeType">
       <xs:group ref="Node"/>
       <xs:attribute name="dtstart" type="xs:string" use="required">
         <xs:annotation>Should be xs:datetime</xs:annotation>
       </xs:attribute>
       <xs:attribute name="dtend" type="xs:string">
         <xs:annotation>Should be xs:datetime</xs:annotation>
       </xs:attribute>
       <xs:attribute name="duration" type="xs:string">
         <xs:annotation>Should be xs:duration</xs:annotation>
       </xs:attribute>
       <xs:attribute name="freq" type="FreqType"/>
       <xs:attribute name="until" type="xs:string">
         <xs:annotation>Should be xs:datetime</xs:annotation>
       </xs:attribute>



Wu/Schulzrinne/Lennox                                         [Page 8]


Internet Draft                 CPL-Schema               November 4, 2002


       <xs:attribute name="count" type="xs:integer"/>
       <xs:attribute name="interval" type="xs:integer" default="1"/>
       <xs:attribute name="bysecond" type="BySecondMinuteType"/>
       <xs:attribute name="byminute" type="BySecondMinuteType"/>
       <xs:attribute name="byhour" type="ByHourType"/>
       <xs:attribute name="byday" type="ByDayType"/>
       <xs:attribute name="bymonthday" type="ByMonthDayType"/>
       <xs:attribute name="byyearday" type="ByYearDayType"/>
       <xs:attribute name="byweekno" type="ByWeekType"/>
       <xs:attribute name="bymonth" type="ByMonthType"/>
       <xs:attribute name="wkst" type="DayType" default="MO"/>
       <xs:attribute name="bysetpos" type="YearDayType"/>
     </xs:complexType>
     <xs:simpleType name="TZIDType">
       <xs:restriction base="xs:string"/>
     </xs:simpleType>
     <xs:simpleType name="TZURLType">
       <xs:restriction base="xs:anyURI"/>
     </xs:simpleType>
     <xs:complexType name="TimeSwitchType">
       <xs:sequence>
         <xs:element name="time" type="TimeType"/>
         <xs:sequence minOccurs="0">
           <xs:element name="not-present" type="NotPresentAction"/>
           <xs:element name="time" type="TimeType" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
         <xs:element name="otherwise" type="OtherwiseAction" minOccurs="0"/>
       </xs:sequence>
       <xs:attribute name="tzid" type="TZIDType"/>
       <xs:attribute name="tzurl" type="TZURLType"/>
     </xs:complexType>
     <xs:simpleType name="PriorityValues">
       <xs:restriction base="xs:NMTOKEN">
         <xs:pattern value="[e|E][m|M][e|E][r|R][g|G][e|E][n|N][c|C][y|Y]"/>
         <xs:pattern value="[u|U][r|R][g|G][e|E][n|N][t|T]"/>
         <xs:pattern value="[n|N][o|O][r|R][m|M][a|A][l|L]"/>
         <xs:pattern value="[n|N][o|O][n|N]-[u|U][r|R][g|G][e|E][n|N][t|T]"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:complexType name="PriorityType">
       <xs:group ref="Node"/>
       <xs:attribute name="less" type="PriorityValues"/>
       <xs:attribute name="greater" type="PriorityValues"/>
       <xs:attribute name="equal" type="PriorityValues"/>
     </xs:complexType>
     <xs:complexType name="PrioritySwitchType">
       <xs:sequence>
         <xs:element name="priority" type="PriorityType"/>



Wu/Schulzrinne/Lennox                                         [Page 9]


Internet Draft                 CPL-Schema               November 4, 2002


         <xs:sequence minOccurs="0">
           <xs:element name="not-present" type="NotPresentAction"/>
           <xs:element name="priority" type="PriorityType" minOccurs="0" maxOccurs="unbounded"/>
         </xs:sequence>
         <xs:element name="otherwise" type="OtherwiseAction" minOccurs="0"/>
       </xs:sequence>
     </xs:complexType>
     <xs:simpleType name="LocationPriorityType">
       <xs:restriction base="xs:float">
         <xs:minInclusive value="0.0"/>
         <xs:maxInclusive value="1.0"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:complexType name="LocationType">
       <xs:group ref="Node"/>
       <xs:attribute name="url" type="xs:anyURI"/>
       <xs:attribute name="priority" type="LocationPriorityType"/>
       <xs:attribute name="clear" type="YesNoType" default="no"/>
     </xs:complexType>
     <xs:complexType name="LookupType">
       <xs:sequence>
         <xs:element name="success" minOccurs="0">
           <xs:complexType>
             <xs:group ref="Node"/>
           </xs:complexType>
         </xs:element>
         <xs:element name="notfound" minOccurs="0">
           <xs:complexType>
             <xs:group ref="Node"/>
           </xs:complexType>
         </xs:element>
         <xs:element name="failure" minOccurs="0">
           <xs:complexType>
             <xs:group ref="Node"/>
           </xs:complexType>
         </xs:element>
       </xs:sequence>
       <xs:attribute name="source" type="xs:string" use="required"/>
       <xs:attribute name="timeout" type="xs:integer" default="30"/>
       <xs:attribute name="use" type="xs:string"/>
       <xs:attribute name="ignore" type="xs:string"/>
       <xs:attribute name="clear" type="YesNoType" default="no"/>
     </xs:complexType>
     <xs:complexType name="RemoveLocationType">
       <xs:group ref="Node"/>
       <xs:attribute name="location" type="xs:string"/>
       <xs:attribute name="param" type="xs:string"/>
       <xs:attribute name="value" type="xs:string"/>



Wu/Schulzrinne/Lennox                                        [Page 10]


Internet Draft                 CPL-Schema               November 4, 2002


     </xs:complexType>
     <xs:simpleType name="OrderingType">
       <xs:restriction base="xs:NMTOKEN">
         <xs:enumeration value="parallel"/>
         <xs:enumeration value="sequential"/>
         <xs:enumeration value="first-only"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:complexType name="ProxyAction">
       <xs:sequence>
         <xs:element name="busy" minOccurs="0">
           <xs:complexType>
             <xs:group ref="Node"/>
           </xs:complexType>
         </xs:element>
         <xs:element name="noanswer" minOccurs="0">
           <xs:complexType>
             <xs:group ref="Node"/>
           </xs:complexType>
         </xs:element>
         <xs:element name="failure" minOccurs="0">
           <xs:complexType>
             <xs:group ref="Node"/>
           </xs:complexType>
         </xs:element>
         <xs:element name="redirection" minOccurs="0">
           <xs:complexType>
             <xs:group ref="Node"/>
           </xs:complexType>
         </xs:element>
         <xs:element name="default" minOccurs="0">
           <xs:complexType>
             <xs:group ref="Node"/>
           </xs:complexType>
         </xs:element>
       </xs:sequence>
       <xs:attribute name="timeout" type="xs:integer" use="optional"/>
       <xs:attribute name="recursive" type="YesNoType" use="optional" default="yes"/>
       <xs:attribute name="ordering" type="OrderingType" use="optional" default="parallel"/>
     </xs:complexType>
     <xs:complexType name="RedirectAction">
       <xs:attribute name="permanent" type="YesNoType" default="no"/>
     </xs:complexType>
     <xs:simpleType name="StatusType">
       <xs:restriction base="xs:NMTOKEN">
         <xs:enumeration value="busy"/>
         <xs:enumeration value="notfound"/>
         <xs:enumeration value="reject"/>



Wu/Schulzrinne/Lennox                                        [Page 11]


Internet Draft                 CPL-Schema               November 4, 2002


         <xs:enumeration value="error"/>
       </xs:restriction>
     </xs:simpleType>
     <xs:complexType name="RejectAction">
       <xs:attribute name="status" type="StatusType"/>
       <xs:attribute name="reason" type="xs:string"/>
     </xs:complexType>
     <xs:complexType name="MailAction">
       <xs:group ref="Node"/>
       <xs:attribute name="url" type="xs:anyURI" use="required"/>
     </xs:complexType>
     <xs:complexType name="LogAction">
       <xs:group ref="Node"/>
       <xs:attribute name="name" type="xs:string"/>
       <xs:attribute name="comment" type="xs:string"/>
     </xs:complexType>
     <xs:complexType name="SubAction">
       <xs:attribute name="ref" type="xs:string"/>
     </xs:complexType>
     <xs:complexType name="AncillaryType"/>
     <xs:complexType name="SubactionType">
       <xs:group ref="Node"/>
       <xs:attribute name="id" use="required"/>
     </xs:complexType>
     <xs:complexType name="IncomingType">
       <xs:group ref="Node"/>
     </xs:complexType>
     <xs:complexType name="OutgoingType">
       <xs:group ref="Node"/>
     </xs:complexType>
     <xs:element name="cpl">
       <xs:complexType>
         <xs:sequence>
           <xs:element name="ancillary" type="AncillaryType" minOccurs="0"/>
           <xs:element name="subaction" type="SubactionType" minOccurs="0"/>
           <xs:choice minOccurs="0">
             <xs:element name="incoming" type="IncomingType"/>
             <xs:element name="outgoing" type="OutgoingType"/>
           </xs:choice>
         </xs:sequence>
       </xs:complexType>
     </xs:element>
   </xs:schema>




4 Examples



Wu/Schulzrinne/Lennox                                        [Page 12]


Internet Draft                 CPL-Schema               November 4, 2002


   The following scripts are from the original CPL specification, but
   using the schema in this specification. As indicated from the
   examples, the complete schema can also be found at
   http://www.cs.columbia.edu/sip/cpl.xsd.


   <?xml version="1.0" encoding="UTF-8"?>
   <cplns:cpl xmlns:cplns="urn:ietf:params:xml:ns:cpl"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="urn:ietf:params:xml:ns:cpl
   http://www.cs.columbia.edu/sip/cpl.xsd">
     <incoming>
       <string-switch field="user-agent">
         <string is="Inadequate Software SIP User Agent/0.9beta2">
           <lookup source="registration" ignore="feature">
             <success>
               <remove-location location="sip:me@mobile.provider.net"/>
             </success>
           </lookup>
         </string>
       </string-switch>
     </incoming>
   </cplns:cpl>

   <?xml version="1.0" encoding="UTF-8"?>
   <cplns:cpl xmlns:cplns="urn:ietf:params:xml:ns:cpl"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="urn:ietf:params:xml:ns:cpl
   http://www.cs.columbia.edu/~xiaotaow/research/cpl_schema/cpl.xsd">
        <subaction id="voicemail">
          <location url="sip:jones@voicemail.example.com" >
            <proxy />
          </location>
        </subaction>

        <incoming>
          <location url="sip:jones@jonespc.example.com">
             <proxy timeout="8">
               <busy>
                 <sub ref="voicemail" />
               </busy>
               <noanswer>
                 <sub ref="voicemail" />
               </noanswer>
             </proxy>
          </location>
        </incoming>
   </cplns:cpl>



Wu/Schulzrinne/Lennox                                        [Page 13]


Internet Draft                 CPL-Schema               November 4, 2002


A Changes from Earlier Version

A.1 Changes from Draft -00

   * Bug fix, in xs:schema tag, change 'xmlns:tns' to 'xmlns'
   * Add example CPL scripts with using the schema in this specification

B Authors' Addresses

   Xiaotao Wu
   Dept. of Computer Science
   Columbia University
   1214 Amsterdam Avenue, MC 0401
   New York, NY 10027
   USA
   electronic mail: xiaotaow@cs.columbia.edu

   Henning Schulzrinne
   Dept. of Computer Science
   Columbia University
   1214 Amsterdam Avenue, MC 0401
   New York, NY 10027
   USA
   electronic mail: schulzrinne@cs.columbia.edu

   Jonathan Lennox
   Dept. of Computer Science
   Columbia University
   1214 Amsterdam Avenue, MC 0401
   New York, NY 10027
   USA
   electronic mail: lennox@cs.columbia.edu

C Bibliography

   [1] J. Lennox and H. Schulzrinne, "CPL: A language for user control
   of internet telephony services," Internet Draft, Internet Engineering
   Task Force, Nov.  2001.  Work in progress.

   [2] C. M. S.-M. E. M. Tim Bray, Jean Paoli, "Extensible markup
   language (xml) 1.0 (second edition)," W3C Recommendation, World Wide
   Web Consortium (W3C), 2000.  http://www.w3.org/TR/2000/REC-xml-
   20001006.

   [3] D. C. Fallside, "XML schema part 0: Primer," W3C Recommendation,
   World Wide Web Consortium (W3C), May 2001.
   http://www.w3.org/TR/xmlschema-0/.




Wu/Schulzrinne/Lennox                                        [Page 14]


Internet Draft                 CPL-Schema               November 4, 2002


   [4] F. Dawson and D. Stenerson, "Internet calendaring and scheduling
   core object specification (icalendar)," RFC 2445, Internet
   Engineering Task Force, Nov.  1998.

   [5] R. Moats, "URN syntax," RFC 2141, Internet Engineering Task
   Force, May 1997.

   [6] R. Moats, "A URN namespace for IETF documents," RFC 2648,
   Internet Engineering Task Force, Aug. 1999.

   [7] M. Mealling, "The IETF XML registry," Internet Draft, Internet
   Engineering Task Force, July 2002.  Work in progress.


   Full Copyright Statement

   Copyright (c) The Internet Society (2002). All Rights Reserved.

   This document and translations of it may be copied and furnished to
   others, and derivative works that comment on or otherwise explain it
   or assist in its implementation may be prepared, copied, published
   and distributed, in whole or in part, without restriction of any
   kind, provided that the above copyright notice and this paragraph are
   included on all such copies and derivative works. However, this
   document itself may not be modified in any way, such as by removing
   the copyright notice or references to the Internet Society or other
   Internet organizations, except as needed for the purpose of
   developing Internet standards in which case the procedures for
   copyrights defined in the Internet Standards process must be
   followed, or as required to translate it into languages other than
   English.

   The limited permissions granted above are perpetual and will not be
   revoked by the Internet Society or its successors or assigns.

   This document and the information contained herein is provided on an
   "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
   TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
   BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
   HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
   MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.




                           Table of Contents





Wu/Schulzrinne/Lennox                                        [Page 15]


Internet Draft                 CPL-Schema               November 4, 2002


   1          Introduction ........................................    1
   2          Overview of the schema ..............................    2
   3          The XML schema of the CPL ...........................    2
   4          Examples ............................................   12
   A          Changes from Earlier Version ........................   14
   A.1        Changes from Draft -00 ..............................   14
   B          Authors' Addresses ..................................   14
   C          Bibliography ........................................   14











































Wu/Schulzrinne/Lennox                                        [Page 16]