<?xml version="1.0" encoding="utf-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:nx="http://schemas.nixxis.com/ApplicationServer" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:element name="resources">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="resource" minOccurs="1" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence minOccurs="0">
              <xs:element name="role" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="id" use="required">
                    <xs:annotation>
                      <xs:documentation>
                        Specify the meaning of the role .
                      </xs:documentation>
                    </xs:annotation>
                    <xs:simpleType>
                      <xs:restriction base="xs:string">
                        <xs:enumeration value="Agent">
                          <xs:annotation>
                            <xs:documentation>
                              Defines agent role.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="HoldMusicPlayer">
                          <xs:annotation>
                            <xs:documentation>
                              Defines a role specifying that the resource is able to provide hold music.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="ConferenceBridge">
                          <xs:annotation>
                            <xs:documentation>
                              Defines a role specifying that the resource is able to provide conferencing.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="Ringer">
                          <xs:annotation>
                            <xs:documentation>
                              Defines a role specifying that the resource is able to provide ringback.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="QueueLoopPlayer">
                          <xs:annotation>
                            <xs:documentation>
                              Defines a role specifying that the resource is able to provide queue waiting.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="IVRPlayer">
                          <xs:annotation>
                            <xs:documentation>
                              Defines a role specifying that the resource is able to provide IVR functionality.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="OutboundGateway">
                          <xs:annotation>
                            <xs:documentation>
                              Defines an outbound gateway role.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="AnsweringMachineDetector">
                          <xs:annotation>
                            <xs:documentation>
                              Defines an anwsering machine detector role.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="Monitoring">
                          <xs:annotation>
                            <xs:documentation>
                              Defines a coaching (listen, whisper) role.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="RecordingPlayer">
                          <xs:annotation>
                            <xs:documentation>
                              Defines a recording play back role.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                        <xs:enumeration value="Recording">
                          <xs:annotation>
                            <xs:documentation>
                              Defines a recording server role.
                            </xs:documentation>
                          </xs:annotation>
                        </xs:enumeration>
                      </xs:restriction>                        
                    </xs:simpleType>
                  </xs:attribute>
                  <xs:attribute name="uri" use="optional" type="xs:string">
                    <xs:annotation>
                      <xs:documentation>
                        The uri to use when requesting a particular resource's role. The uri of the resource is taken when no value is specified
                      </xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                  <xs:attribute name="cost" use="optional" type="xs:integer">
                    <xs:annotation>
                      <xs:documentation>
                        The cost to use the resource's role. Default value is 0. This value will be added to location costs.
                      </xs:documentation>
                    </xs:annotation>
                  </xs:attribute>
                </xs:complexType>
              </xs:element> 
            </xs:sequence>
            <xs:attribute name="key" use="required" type="xs:string">
              <xs:annotation>
                <xs:documentation>
                  The unique key identifying the resource.
                </xs:documentation>
              </xs:annotation>              
            </xs:attribute>
            <xs:attribute name="uri" use="required" type="xs:string">
              <xs:annotation>
                <xs:documentation>
                  The uri linked with the resource.
                </xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="associationId" use="optional" type="xs:string" >
              <xs:annotation>
                <xs:documentation>
                  Indicates the agent statically linked with the phone. Default to no static link...
                </xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="register" use="optional" type="xs:boolean">
              <xs:annotation>
                <xs:documentation>
                  Indicates if the resource will register to the application server. Default value is false, meaning that the resource will not register. When true, the resource is considered available only after registration.
                </xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="keepConnectionOpened" use="optional" type="xs:boolean">
              <xs:annotation>
                <xs:documentation>
                  Indicates if the connection must be kept.
                </xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="useragent" use="optional" type="xs:string" >
              <xs:annotation>
                <xs:documentation>
                  Indicates the user agent value to use. This is useful with resourec that do not register. Default to empty string.
                </xs:documentation>
              </xs:annotation>
            </xs:attribute>
            <xs:attribute name="location" use="optional" type="xs:string">
              <xs:annotation>
                <xs:documentation>
                  Specify the location of the resource. Defaults to empty location. This will be used to compute location costs.
                </xs:documentation>
              </xs:annotation>
            </xs:attribute>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
