Дерево страниц
Перейти к концу метаданных
Переход к началу метаданных

Hc_gateway_declare

Команда создает новый шлюз с указанием типа и профиля.

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

/gateway/declare

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

POST

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

http://host:port/commands/gateway_declare

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:simpleType name="typeType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="megaco"/>
            <xs:enumeration value="sip"/>
            <xs:enumeration value="sigtran_m2ua"/>
            <xs:enumeration value="sigtran_m3ua"/>
            <xs:enumeration value="sigtran_iua"/>
            <xs:enumeration value="sigtran_trunk"/>
        </xs:restriction>
    </xs:simpleType>
    <xs:complexType name="profileType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="type" type="typeType" use="required"/>
        <xs:attribute name="profile" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="gateway" type="profileType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

Запрос: http://192.168.23.34:9999/commands/gateway_declare
Параметры:

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_declare.xsd">
    <gateway domain="p.city" name="fdf" type="sip" profile="profile1" />
</in>

Hc_gateway_info

Команда предназначена для просмотра информации о шлюзе(шлюзах).

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

/gateway/info

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

POST

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

http://host:port/commands/gateway_info

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- gatewayInType -->
    <xs:complexType name="gatewayInType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="name" type="xs:string" use="optional"/>
        <xs:attribute name="type" type="xs:string" use="optional"/>
    </xs:complexType>
    <!-- portType -->
    <xs:complexType name="portType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- sdpTemplateType -->
    <xs:complexType name="sdpTemplateType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- propertyType -->
    <xs:complexType name="propertyType">
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="value" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- gatewayOutType -->
    <xs:complexType name="gatewayOutType">
        <xs:all>
            <xs:element name="ports">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="port" type="portType" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="templates">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="sdp-template" type="sdpTemplateType" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
            <xs:element name="properties">
                <xs:complexType>
                    <xs:sequence>
                        <xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
                    </xs:sequence>
                </xs:complexType>
            </xs:element>
        </xs:all>
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="type" type="xs:string" use="required"/>
        <xs:attribute name="profile" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="gateway" type="gatewayInType" minOccurs="1"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="gateway" type="gatewayOutType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример 1:

Запрос: http://192.168.23.34:9999/commands/gateway_info

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_info.xsd">
    <gateway domain="p.city" name="gw3" />
</in>

Ответ:

<?xml version="1.0"?>
    <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_info.xsd">
        <gateway domain="p.city" name="gw3" profile="profile2" type="sip">
          <ports>
            <port name="p/4"/>
            <port name="p/5"/>
            <port name="p/6"/>
          </ports>
          <properties>
            <property name="k6" value="6"/>
            <property name="k4" value="34"/>
            <property name="k1" value="123"/>
            <property name="k2" value="[1,2,3]"/>
          </properties>
        </gateway>
    </out>

Пример 2:

Запрос:

http://192.168.23.34:9999/commands/gateway_info

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_info.xsd">
    <gateway domain="p.city" type="megaco" />
</in>

Ответ:

<?xml version="1.0"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_info.xsd">
    <gateway domain="p.city" name="gw2" type="megaco" profile="tgw">
        <ports/>
        <templates/>
        <properties>
            <property name="fax_detect" value="caller"/>
            <property name="location" value="local_network"/>
        </properties>
     </gateway>
</out>

Hc_gateway_remove

Команда предназначена для удаления шлюза.

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

/gateway/remove

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

POST

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

http://host:port/commands/gateway_remove

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

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

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

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="gatewayType">
        <xs:attribute  name="domain" type="xs:string" use="required"/>
        <xs:attribute  name="name" type="xs:string" use="required"/>
    </xs:complexType>

          
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="gateway" type="gatewayType" minOccurs="1" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

Запрос: http://192.168.23.34:9999/commands/gateway_remove

<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_remove.xsd">
    <gateway domain="p.city" name="gw2" />
    <gateway domain="p.city" name="gw3" />
</in>

Hc_gateway_set

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

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

/gateway/set

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

POST

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

http://host:port/commands/gateway_set

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

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

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

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="gatewayType">
        <xs:sequence>
            <xs:element name="property" minOccurs="1" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:attribute name="name" type="xs:string" use="required"/>
                    <xs:attribute name="value" type="xs:string" use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

          
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="gateway" type="gatewayType" minOccurs="1" />
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

Запрос: http://192.168.23.34:9999/commands/gateway_set

<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_set.xsd">
    <gateway domain="p.city" name="gw3">
        <property name="k1" value="123" />
        <property name="k2" value="[1, 2, 3]" />
    </gateway>
</in>

Hc_gateway_clean

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

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

/gateway/clean

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

POST

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

http://host:port/commands/gateway_clean

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="gatewayType">
        <xs:sequence>
            <xs:element name="property" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:attribute name="name" type="xs:string" use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="gateway" type="gatewayType"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

Запрос: http://192.168.23.34:9999/commands/gateway_clean

<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_clean.xsd">
    <gateway domain="p.city" name="gw3">
        <property name="key1" />
        <property name="key2" />
    </gateway>
</in>

Hc_gateway_add_port

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

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

/gateway/add-port

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

POST

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

http://host:port/commands/gateway_add_port

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="gatewayType">
        <xs:sequence>
            <xs:element name="property" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:attribute name="name" type="xs:string" use="required"/>
                    <xs:attribute name="value" type="xs:string" use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="port" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="gateway" type="gatewayType"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

Запрос: http://192.168.23.34:9999/commands/gateway_add_port

<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_add_port.xsd">
    <gateway domain="p.city" name="gw3" port="p/3">
        <property name="key1" value="val1" />
         <property name="key2" value="val2" />
    </gateway>
</in>

Hc_gateway_remove_port

Команда предназначена для удаления порта из шлюза.

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

/gateway/remove-port

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

POST

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

http://host:port/commands/gateway_remove_port

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

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

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

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="gatewayType">
        <xs:attribute  name="domain" type="xs:string" use="required"/>
        <xs:attribute  name="name" type="xs:string" use="required"/>
        <xs:attribute  name="port" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="gateway" type="gatewayType" minOccurs="1" maxOccurs="unbounded"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

Запрос: http://192.168.23.34:9999/commands/gateway_remove_port

<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_remove_port.xsd">
    <gateway domain="p.city" name="gw2" port="p/1"/>
    <gateway domain="p.city" name="gw2" port="p/2"/>
</in>

Hc_gateway_add_sdp_template

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

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

/gateway/add-sdp-template

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

POST

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

http://host:port/commands/gateway_add_sdp_template

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="gatewayType">
        <xs:sequence>
            <xs:element name="sdp-template" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:attribute name="name" type="xs:string" use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="domain" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="gateway" type="gatewayType"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

Запрос: http://192.168.23.34:9999/commands/gateway_add_sdp_template

<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="gateway_add_sdp_template.xsd">
    <gateway domain="p.city" name="gw3">
            <sdp-template name="template3" />  
            <sdp-template name="template2" /> 
    </gateway>
</in>

Hc_gateway_remove_sdp_template

Команда предназначена для удаления шаблона SDP из шлюза.

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

/gateway/remove-sdp-template

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

POST

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

http://host:port/commands/gateway_remove_sdp_template

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

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

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

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="gatewayType">
        <xs:sequence>
            <xs:element name="sdp-template" minOccurs="1" maxOccurs="unbounded">
                <xs:complexType>
                    <xs:attribute name="name" type="xs:string" use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>

          
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="gateway" type="gatewayType" minOccurs="1" maxOccurs="1" />
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

Запрос: http://192.168.23.34:9999/commands/gateway_remove_sdp_template

<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="../priv/xsd/gateway_remove_sdp_template.xsd">
    <gateway domain="p.city" name="gw3">
            <sdp-template name="template3" />  
            <sdp-template name="template2" /> 
    </gateway>
</in>

Hc_gateway_change_profile

Команда предназначена для изменения профиля шлюза.

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

/gateway/change-profile

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

POST

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

http://host:port/commands/gateway_change_profile

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:complexType name="gatewayType">
        <xs:sequence>
            <xs:element name="profile">
                <xs:complexType>
                    <xs:attribute name="name" type="xs:string" use="required"/>
                </xs:complexType>
            </xs:element>
        </xs:sequence>
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="gateway" type="gatewayType"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

Запрос: http://192.168.23.34:9999/commands/gateway_сhange_profile

<?xml version="1.0" encoding="UTF-8" ?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="../priv/xsd/gateway_change_profile.xsd">
    <gateway domain="p.city" name="gw3">
            <profile name="profile3" />  
    </gateway>
</in>
  • Нет меток