Hc_media_profile_list

Команда для просмотра списка медиа-профилей сконфигурированных в домене.

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

domain/DOMAIN_NAME/media-profile/list

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

POST

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

http://host:port/commands/media_profile_list

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

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:include schemaLocation="media_profile.xsd"/>

    <!-- requestType -->
    <xs:complexType name="requestType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- responseType -->
    <xs:complexType name="responseType">
        <xs:choice>
			<xs:element name="ok" type="okType"/>
            <xs:element name="error" type="errorType"/>
        </xs:choice>
    </xs:complexType>

    <!-- okType -->
    <xs:complexType name="okType">
        <xs:sequence minOccurs="0" maxOccurs="unbounded">
            <xs:element name="media_profile" type="mediaProfileType"/>
        </xs:sequence>
    </xs:complexType>

    <!-- errorType -->
    <xs:complexType name="errorType">
        <xs:attribute name="description" 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
CODE

Примеры:

http://192.168.1.21:9999/commands/media_profile_list

Запрос:

<?xml version="1.0"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
    <request domain="biysk.local"/>
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
	xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_media_profile_list.xsd">
	<response>
		<ok>
			<media_profile domain="biysk.local" name="default" description="Default media profile for current domain." codecs_priority="user">
				<codecs_info type="<other>">
					<codecs name="<other>" payload_type="*" enabled="true"/>
					<properties key="offroad" value="false"/>
					<properties key="rtcp-enabled" value="true"/>
				</codecs_info>
				<codecs_info type="audio">
					<codecs name="G722" payload_type="*" enabled="true"/>
					<codecs name="PCMA" payload_type="*" enabled="true"/>
					<codecs name="PCMU" payload_type="*" enabled="true"/>
					<codecs name="G729" payload_type="*" enabled="true"/>
					<codecs name="telephone-event" payload_type="*" enabled="true"/>
					<properties key="offroad" value="false"/>
					<properties key="rtcp-enabled" value="true"/>
				</codecs_info>
			</media_profile>
			<media_profile domain="biysk.local" name="mp1" description="add_video" codecs_priority="system">
				<codecs_info type="video">
					<codecs name="H264" payload_type="*" enabled="true">
						<attributes key="key3" value="val3"/>
					</codecs>
					<properties key="offroad" value="true"/>
				</codecs_info>
				<properties key="key1" value="val1"/>
			</media_profile>
		</ok>
	</response>
</out>
CODE

Hc_media_profile_declare

Команда для создания медиа-профилей в домене.

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

domain/DOMAIN_NAME/media-profile/declare <name> <description> <priority>

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

POST

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

http://host:port/commands/media_profile_declare

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

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XML-схема:
media_profile.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

    <!-- MediaProfile -->
    <xs:complexType name="mediaProfileType">
        <xs:sequence>
            <xs:element name="codecs_info" type="mediaProfileCodecsType" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="properties" type="proplistType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="description" type="xs:string" use="optional"/>
        <xs:attribute name="codecs_priority" type="codecsPriorityType" use="required"/>
    </xs:complexType>

    <xs:simpleType name="codecsPriorityType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="user"/>
            <xs:enumeration value="system"/>
        </xs:restriction>
    </xs:simpleType>

    <xs:complexType name="proplistType">
        <xs:attribute name="key" type="xs:string" use="required"/>
        <xs:attribute name="value" type="xs:string" use="required"/>
    </xs:complexType>


    <!-- MediaProfilecodecs -->
    <xs:complexType name="mediaProfileCodecsType">
        <xs:sequence>
            <xs:element name="codecs" type="mediaProfileCodecType" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="properties" type="proplistType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="type" type="codecsType" use="required"/>
    </xs:complexType>

    <xs:simpleType name="codecsType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="audio"/>
            <xs:enumeration value="video"/>
            <xs:enumeration value="image"/>
            <xs:enumeration value="<other>"/>
        </xs:restriction>
    </xs:simpleType>


    <!-- MediaProfilecodec -->
    <xs:complexType name="mediaProfileCodecType">
        <xs:sequence>
            <xs:element name="attributes" type="proplistType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/> <!-- or special codec wildcard <other> -->
        <xs:attribute name="payload_type" type="xs:string" use="required"/> <!-- or special PT wildcard * -->
        <xs:attribute name="enabled" type="xs:boolean" use="required"/>
    </xs:complexType>


    <xs:element name="media_profile" type="mediaProfileType"/>

</xs:schema
CODE

XML-схема: 

media_profile_declare.xsd

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:include schemaLocation="media_profile.xsd"/>

    <!-- requestType -->
    <xs:complexType name="requestType">
        <xs:sequence>
            <xs:element name="media_profile" type="mediaProfileType" minOccurs="1" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <!-- responseType -->
    <xs:complexType name="responseType">
        <xs:choice>
			<xs:element name="ok" type="okType"/>
            <xs:element name="error" type="errorType"/>
        </xs:choice>
    </xs:complexType>

    <xs:complexType name="okType"/>

    <xs:complexType name="errorType">
        <xs:attribute name="description" 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>
CODE

Примеры:

http://192.168.1.21:9999/commands/media_profile_declare

Запрос:

<?xml version="1.0"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
    <request>
        <media_profile domain="biysk.local" name="mp1" description="add_video" codecs_priority="system">
            <codecs_info type="video">
                <codecs name="H264" payload_type="*" enabled="true">
                    <attributes key="key3" value="val3"/>
                </codecs>
                <properties key="offroad" value="true"/>
            </codecs_info>
            <properties key="key1" value="val1"/>
        </media_profile>
    </request>
</in>
CODE

Ответ:

<?xml version="1.0"?>                                                                   
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_media_profile_declare.xsd">
    <response>                                                                          
        <ok/>                                                    
    </response>                                                                         
</out> 
CODE

Hc_media_profile_info

Команда для просмотра параметров медиа-профиля.

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

domain/DOMAIN_NAME/media-profile/info <name>

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

POST

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

http://host:port/commands/media_profile_info

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

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:include schemaLocation="media_profile.xsd"/>

    <!-- requestType -->
    <xs:complexType name="requestType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="profile_name" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- responseType -->
    <xs:complexType name="responseType">
        <xs:choice>
			<xs:element name="media_profile" type="mediaProfileType"/>
            <xs:element name="error" type="errorType"/>
        </xs:choice>
    </xs:complexType>

    <!-- errorType -->
    <xs:complexType name="errorType">
        <xs:attribute name="description" 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>
CODE

Примеры:

http://192.168.1.21:9999/commands/media_profile_info

Запрос:

<?xml version="1.0"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
    <request domain="biysk.local" profile_name="mp_video"/>
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_media_profile_info.xsd">
    <response>
        <media_profile domain="biysk.local" name="mp_video" description="video" codecs_priority="system">
            <codecs_info type="<other>">
                <codecs name="<other>" payload_type="*" enabled="true"/>
                <properties key="offroad" value="true"/>
            </codecs_info>
            <codecs_info type="audio">
                <codecs name="G722" payload_type="9" enabled="true"/>
                <codecs name="PCMA" payload_type="8" enabled="true"/>
                <codecs name="PCMU" payload_type="0" enabled="true"/>
                <properties key="offroad" value="true"/>
            </codecs_info>
            <codecs_info type="video">
                <codecs name="H263-1998" payload_type="*" enabled="true"/>
                <codecs name="H264" payload_type="*" enabled="true"/>
                <properties key="offroad" value="true"/>
            </codecs_info>
        </media_profile>
    </response>
</out>
CODE

Hc_media_profile_set

Команда для изменения общих параметров медиа-профиля.

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

domain/DOMAIN_NAME/media-profile/set <name> <param> <value>

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

POST

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

http://host:port/commands/media_profile_set

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

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<xs:include schemaLocation="media_profile.xsd"/>

    <!-- requestType -->
    <xs:complexType name="requestType">
        <xs:sequence>
            <xs:element name="media_profile" type="mediaProfileType" minOccurs="1" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <!-- responseType -->
    <xs:complexType name="responseType">
        <xs:choice>
			<xs:element name="ok" type="okType"/>
            <xs:element name="error" type="errorType"/>
        </xs:choice>
    </xs:complexType>

    <!-- okType -->
	<xs:complexType name="okType"/>

    <!-- errorType -->
    <xs:complexType name="errorType">
        <xs:attribute name="description" 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
CODE

Примеры:

http://192.168.1.21:9999/commands/media_profile_set

Запрос:

<?xml version="1.0"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
    <request>
        <media_profile domain="biysk.local" name="mp_video" description="for office" codecs_priority="user">
            <codecs_info type="audio">
                <codecs name="G729" payload_type="18" enabled="true">
                    <attributes key="offroad" value="true"/>
                </codecs>
                <properties key="key2" value="val2"/>
            </codecs_info>
            <properties key="key1" value="val1"/>
        </media_profile>
    </request>
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_media_profile_set.xsd">
    <response>
        <ok/>
    </response>
</out>
CODE

Hc_media_profile_remove

Команда для удаления медиа-профиля.

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

domain/DOMAIN_NAME/media-profile/remove <name>

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

POST

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

http://host:port/commands/media_profile_remove

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

При выполнении команды HTTP-терминал может ответить следующими сообщениями:

  • 200 – в случае успеха;
  • 404 – в случае ошибки.

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

    <!-- requestType -->
    <xs:complexType name="requestType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="profile_name" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- responseType -->
    <xs:complexType name="responseType">
        <xs:choice>
			<xs:element name="ok" type="okType"/>
            <xs:element name="error" type="errorType"/>
        </xs:choice>
    </xs:complexType>

    <!-- okType -->
	<xs:complexType name="okType"/>

    <!-- errorType -->
    <xs:complexType name="errorType">
        <xs:attribute name="description" 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>
CODE

Примеры:

http://192.168.1.21:9999/commands/media_profile_remove

Запрос:

<?xml version="1.0"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
    <request domain="biysk.local" profile_name="mp1"/>
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_media_profile_remove.xsd">
    <response>
        <ok/>
    </response>
</out>
CODE

Запрос:

<?xml version="1.0"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
    <request domain="biysk.local" profile_name="test"/>
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_media_profile_remove.xsd">
    <response>
        <error description="not_exists"/>
    </response>
</out>
CODE