Hс_tc_meeting

Команда позволяет создавать/редактировать шаблон совещания на виртуальной АТС.

Аналог команды в CoCon:

domain/<DOMAIN>/tc/meeting/.meeting

Метод HTTP-запроса:

POST

Шаблон HTTP-запроса:

http://server:9999/commands/tc_meeting

Код HTTP-ответа:

  • 201 - успешно;
  • 404 - ошибка.

XSD-схема XML-файла запроса/ответа:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation="common_types.xsd"/>
    <xs:include schemaLocation="error.xsd"/>
    <!-- Types -->
	<xs:complexType name="memberType">
		<xs:sequence>
            <xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="name" type="xs:string" use="required"/>
	</xs:complexType>

	<xs:complexType name="groupType">
		<xs:sequence>
            <xs:element name="member" type="memberType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="id" type="xs:integer" use="required"/>
		<xs:attribute name="name" type="xs:string" use="required"/>
	</xs:complexType>

	<xs:complexType name="masterType">
        <xs:attribute name="option" type="xs:string" use="required"/>
		<xs:attribute name="id" type="xs:string" use="required"/>
	</xs:complexType>

	<xs:complexType name="meetingType">
		<xs:sequence>
            <xs:element name="group" type="groupType" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="master" type="masterType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="id" type="xs:string" use="optional"/>
		<xs:attribute name="name" type="xs:string" use="required"/>
		<xs:attribute name="description" type="xs:string" use="optional"/>
		<xs:attribute name="greeting_url" type="xs:string" use="optional"/>
		<xs:attribute name="is_public" type="xs:boolean"  use="required"/>
		<xs:attribute name="is_open" type="xs:boolean"  use="required"/>
	</xs:complexType>

	<xs:complexType name="requestType">
		<xs:sequence>
            <xs:element name="meeting" type="meetingType"/>
        </xs:sequence>
		<xs:attribute name="domain" type="xs:string" use="required"/>
	</xs:complexType>

	<xs:simpleType name="responseType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="tc meetings declare ok"/>
		</xs:restriction>
	</xs:simpleType>


	<!-- in -->
	<xs:element name="in">
		<xs:complexType>
			<xs:all>
				<xs:element name="request" type="requestType"/>
			</xs:all>
		</xs:complexType>
	</xs:element>

	<!-- out -->
	<xs:element name="out">
		<xs:complexType>
			<xs:choice>
				<!--Positive case-->
				<xs:element name="response">
					<xs:complexType>
						<xs:all>
							<xs:element name="response" type="responseType"/>
						</xs:all>
					</xs:complexType>
				</xs:element>
				<!--Or error-->
				<xs:element name="error" type="errorType"/>
			</xs:choice>
		</xs:complexType>
	</xs:element>
</xs:schema>

XML

Пример

Запрос на создание нового совещания:

http://192.168.1.21:9999/commands/tc_meeting

<?xml version="1.0" encoding="UTF-8"?>
<!-- new meeting -->
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_tc_meeting.xsd">
    <request domain="biysk.local">
        <meeting name="new_meeting2" description="мое новое совещание" greeting_url="system://sounds/ai_participant_of_conference.wav" is_public="true" is_open="true">
            <group id="1" name="Group One">
                <member name="240502">
                    <property name="role" value="passive" />
                </member>
                <member name="240503">
                    <property name="role" value="active" />
                </member>
                <member name="83832744787">
                    <property name="role" value="passive" />
                </member>
            </group>
        </meeting>
    </request>
</in>
XML

Ответ:201

Запрос редактирование совещания 83620F86F67:

http://192.168.1.21:9999/commands/tc_meeting

<?xml version="1.0" encoding="UTF-8"?>
<!-- edit meeting -->
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_tc_meeting.xsd">
    <request domain="biysk.local">
        <meeting id="83620F86F67" name="meeting_2" description="мое отредактированное совещание" greeting_url="system://sounds/ai_participant_of_conference.wav" is_public="true" is_open="false">
            <group id="2" name="Group Two">
                <member name="240505">
                    <property name="role" value="passive" />
                </member>
                <member name="240506">
                    <property name="role" value="active" />
                </member>
                <member name="89913699011">
                    <property name="role" value="passive" />
                </member>
            </group>
        </meeting>
    </request>
</in>
XML

Ответ:

В случае успеха будет 201 ответ, в случае ошибки - 404

Hс_tc_meeting_remove

Команда позволяет удалять шаблон совещания на виртуальной АТС.

Аналог команды в CoCon:

domain/<DOMAIN>/tc/meeting/.remove

Метод HTTP-запроса:

POST

Шаблон HTTP-запроса:

http://server:9999/commands/tc_meeting_remove

Код HTTP-ответа:

  • 201 - успешно;
  • 404 - ошибка.

XSD-схема XML-файла запроса/ответа:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:complexType name="meetingType">
		<xs:attribute name="id" type="xs:string" use="required"/>
	</xs:complexType>

	<xs:complexType name="errorType">
		<xs:attribute name="error" type="xs:string" use="optional"/>
	</xs:complexType>


	<xs:complexType name="requestType">
		<xs:sequence>
            <xs:element name="meeting" type="meetingType"/>
        </xs:sequence>
		<xs:attribute name="domain" type="xs:string" use="required"/>
	</xs:complexType>

	<xs:complexType name="responseType">
		<xs:attribute name="error" type="xs:string" use="required"/>
	</xs:complexType>


	<!-- in -->
	<xs:element name="in">
		<xs:complexType>
			<xs:all>
				<xs:element name="request" type="requestType"/>
			</xs:all>
		</xs:complexType>
	</xs:element>

	<!-- out -->
	<xs:element name="out">
		<xs:complexType>
			<xs:all>
				<xs:element name="response" type="responseType"/>
			</xs:all>
		</xs:complexType>
	</xs:element>
</xs:schema>

XML

Запрос:
http://192.168.1.21:9999/commands/tc_meeting_remove

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="tc_meeting_remove.xsd">
    <request domain="biysk.local">
        <meeting id="83626ECEF82" />
    </request>
</in>
XML

Ответ:

В случае успеха будет 201 ответ, в случае ошибки 404 + xml с описанием ошибки:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_tc_meeting_remove.xsd">
    <response error="not_found"/>
</out>
XML