Hc_media_registrar_clean

Команда для сброса в значение по умолчанию настроек подключения медиа-ресурсов.

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

/system/media/registrar/clean

Шаблон URL запроса:

POST
http://host:port/commands/media_registrar_clean

Код ответа:

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

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

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
  <xs:annotation>
    <xs:documentation xml:lang="en">
      Show properties of media registrar.
      Usage: http://server:9999/commands/media_registrar_clean.
      Implementation: hc_media_registrar_clean.erl.
      Git: git@git.eltex.loc:httpTerminal.git.
      Copyright (c) 2016, Eltex. All rights reserved.
    </xs:documentation>
  </xs:annotation>

  <xs:include schemaLocation="error.xsd"/>

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

  <xs:complexType name="nodeOptionType">
    <xs:attribute name="node" type="xs:string" use="required"/>
    <xs:attribute name="name" type="xs:string" use="required"/>
  </xs:complexType>

<!-- in-->
  <xs:element name="in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="option"  type="optionType" minOccurs="0" maxOccurs="1"/>
              <xs:element name="node_option" type="nodeOptionType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
<!-- out -->
  <xs:element name="out">
    <xs:complexType>
      <xs:choice>
        <xs:element name="success" type="xs:string"/>
        <xs:element name="error" type="errorType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
CODE

Пример

http://192.168.1.21/commands/media_registrar_clean

Запрос:

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_media_registrar_clean.xsd">
    <request>
        <option name="registration_timeout"/>
        <node_option node="core1@ecss1" name="is_active"/>
        <node_option node="core1@ecss1" name="listen_ip"/>
        <node_option node="core1@ecss1" name="listen_port"/>
    </request>
</in>
CODE

Ответ:

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

Hc_media_registrar_info

Команда предназначена для просмотра настроек подключения медиа-ресурсов.

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

/system/media/registrar/info

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

POST
http://host:port/commands/media_registrar_info

Код ответа:

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

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

XML-схема:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Show properties of media registrar.
            Usage: http://server:9999/commands/media_registrar_info.
            Implementation: hc_media_registrar_info.erl.
            Git: git@git.eltex.loc:httpTerminal.git.
            Copyright (c) 2016, Eltex. All rights reserved.
        </xs:documentation>
    </xs:annotation>

    <xs:include schemaLocation="error.xsd"/>

 <!-- commonOptionsType-->
    <xs:complexType name="commonOptionsType">
        <xs:attribute name="registration_timeout" type="xs:integer" use="required"/>
    </xs:complexType>

<!-- nodeOptionsType -->
    <xs:complexType name="nodeOptionsType">
        <xs:attribute name="node" type="xs:string" use="required"/>
        <xs:attribute name="status" type="xs:string" use="required"/>
        <xs:attribute name="is_active" type="xs:boolean" use="required"/>
        <xs:attribute name="listen_ip" type="xs:string" use="required"/>
        <xs:attribute name="listen_port" type="xs:integer" use="required"/>
    </xs:complexType>

    <!-- resultType-->
    <xs:complexType name="resultType">
        <xs:sequence>
            <xs:element name="commonParameters" type="commonOptionsType" minOccurs="1"/>
            <xs:element name="privateParameters" type="nodeOptionsType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType/>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="result" type="resultType"/>
                <xs:element name="error" type="errorType"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema
CODE

Пример

http://192.168.1.21:9999/commands/media_registrar_info

Запрос:

<?xml version="1.0"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_media_registrar_info.xsd">
    <request/>
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_media_registrar_info.xsd">
    <result>
        <commonParameters registration_timeout="90"/>
        <privateParameters node="core1@ecss1" status="active" is_active="true" listen_ip="192.168.2.21" listen_port="5000"/>
        <privateParameters node="core1@ecss2" status="active" is_active="true" listen_ip="192.168.2.22" listen_port="5000"/>
    </result>
</out>
CODE

Hc_media_registrar_set

Команда предназначена для редактирования настроек подключения медиа-ресурсов.

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

/system/media/registrar/set

Шаблон URL запроса:

POST
http://host:port/commands/media_registrar_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" attributeFormDefault="unqualified">
  <xs:annotation>
    <xs:documentation xml:lang="en">
      Show properties of media registrar.
      Usage: http://server:9999/commands/media_registrar_clean.
      Implementation: hc_media_registrar_clean.erl.
      Git: git@git.eltex.loc:httpTerminal.git.
      Copyright (c) 2016, Eltex. All rights reserved.
    </xs:documentation>
  </xs:annotation>

  <xs:include schemaLocation="error.xsd"/>

<!-- resultType-->
  <xs:complexType name="resultType">
    <xs:choice>
      <xs:element name="success" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="error" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
    </xs:choice>
  </xs:complexType>

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

  <xs:complexType name="nodeOptionType">
    <xs:attribute name="node" type="xs:string" use="required"/>
    <xs:attribute name="name" type="xs:string" use="required"/>
    <xs:attribute name="value" type="xs:string" use="required"/>
  </xs:complexType>

<!-- in-->
  <xs:element name="in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="option"  type="optionType" minOccurs="0" maxOccurs="1"/>
              <xs:element name="node_option" type="nodeOptionType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
<!-- out -->
  <xs:element name="out">
    <xs:complexType>
      <xs:choice>
        <xs:element name="result" type="resultType"/>
        <xs:element name="error" type="errorType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
CODE

Пример

http://192.168.1.21:9999/commands/media_registrar_set

Запрос:

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_media_registrar_set.xsd">
    <request>
        <option name="registration_timeout" value="60"/>
        <node_option node="core1@ecss1" name="is_active" value="true"/>
        <node_option node="core1@ecss1" name="listen_port" value="5001"/>
        <node_option node="core1@ecss1" name="listen_ip" value="0.0.0.0"/>
    </request>
</in>
CODE

Ответ:

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

Ошибка:

<?xml version="1.0" encoding="UTF-8"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_media_registrar_set.xsd">
    <error cmd="media_registrar_set" reason="error" body="{error,bad_node,core1@ecss3}"/>
</out>
CODE