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

Hc_bridge_declare

Команда предназначена для декларации бриджа между двумя виртуальными АТС в рамках одного ECSS-10.

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

/bridge/declare

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

POST

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

http://host:port/commands/bridge_declare

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

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="bridge.xsd"/>
    <!-- okType -->
    <xs:complexType name="okType">
        <xs:attribute name="bridge" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- warnType -->
    <xs:complexType name="warnType">
        <xs:attribute name="bridge" type="xs:string" use="required"/>
        <xs:attribute name="reason" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- errorType -->
    <xs:complexType name="errorType">
        <xs:attribute name="bridge" type="xs:string" use="required"/>
        <xs:attribute name="reason" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="bridge" type="bridgeType" minOccurs="0" maxOccurs="unbounded"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- out-->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="response">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="ok" type="okType" minOccurs="0" maxOccurs="unbounded"/>
                            <xs:element name="warn" type="warnType" minOccurs="0" maxOccurs="unbounded"/>
                            <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

bridge.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <!-- directionType-->
    <xs:complexType name="directionType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="interface" type="xs:string" use="required"/>
        <xs:attribute name="trunkgroupid" type="xs:string" use="required"/>
        <xs:attribute name="context" type="xs:string" use="required"/>
        <xs:attribute name="np" type="xs:string" use="optional"/>
    </xs:complexType>
    <!-- bridgeType -->
    <xs:complexType name="bridgeType">
        <xs:sequence>
            <xs:element name="a" type="directionType" />
            <xs:element name="b" type="directionType" />
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="strict" type="xs:boolean" use="optional"/>
        <xs:attribute name="bandwidth_in" type="xs:string"/> <!-- non-negative integer or 'unbounded' string -->
        <xs:attribute name="bandwidth_out" type="xs:string"/> <!-- non-negative integer or 'unbounded' string -->
        <xs:attribute name="bandwidth_total" type="xs:string"/> <!-- non-negative integer or 'unbounded' string -->
    </xs:complexType>
</xs:schema>

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="bridge_declare.xsd">
    <request>
        <bridge name="biysk.local_to_ct.office" strict="false">
            <a domain="biysk.local" interface="bridge:p_to_a" trunkgroupid="tg:p_to_a" context="ctx_from_local"/>
            <b domain="ct.office" interface="bridge:a_to_p" trunkgroupid="tg:a_to_p" context="ctx_from_local"/>
        </bridge>
    </request>
</in>

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="bridge_declare.xsd">
    <response>
        <ok bridge="biysk.local_to_ct.office"/>
    </response>
</out>

Hc_bridge_info

Команда предназначена для просмотра информации о всех (или определенном) бриджах, декларированных в системе.

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

/bridge/info

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

POST

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

http://host:port/commands/bridge_info

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

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

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

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

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

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

      <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="bridge" type="bridgeInType" minOccurs="0" maxOccurs="1"/>
            </xs:all>
          </xs:complexType>
      </xs:element>

      <xs:element name="out">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="bridge" type="bridgeType" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
          </xs:complexType>
      </xs:element>
</xs:schema>

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="bridge_info.xsd">
    <bridge name="biysk.local_to_ct.office" />
</in>

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="bridge_info.xsd">
    <bridge name="biysk.local_to_ct.office" duplex="false" strict="false">
        <a domain="biysk.local" np="default" interface="bridge:p_to_a" trunkgroupid="tg:p_to_a" context="ctx_from_local"/>
        <b domain="ct.office" np="default" interface="bridge:a_to_p" trunkgroupid="tg:a_to_p" context="ctx_from_local"/>
    </bridge>
</out>

Чтобы получить список всех бриджей нужно выполните запрос:

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="bridge_info.xsd" />

Hc_bridge_remove

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

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

/bridge/remove

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

POST

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

http://host:port/commands/bridge_remove

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

При выполнении команды 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="bridgeType">
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="bridge" type="bridgeType" minOccurs="0" maxOccurs="unbounded"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="bridge_remove.xsd">
  <request>
    <bridge name="bridge1"/>
    <bridge name="bridge2"/>
  </request>
</in>

Hc_bridge_cleanup

Команда предназначена для удаления всех, декларированных в системе бриджей.

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

/bridge/cleanup

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

POST

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

http://host:port/commands/bridge_cleanup

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

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

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

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

<?xml version="1.0" encoding="UTF-8" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="cleanup" minOccurs="1" maxOccurs="1"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="bridge_cleanup.xsd">
    <cleanup />
</in>

Ответ: 204

Hc_bridge_change

Команда предназначена для изменения свойств декларированных в системе бриджей.

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

/bridge/change

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

POST

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

http://host:port/commands/bridge_change

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

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <xs:include schemaLocation="bridge.xsd"/>
    <!-- okType -->
    <xs:complexType name="okType">
        <xs:attribute name="bridge" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- warnType -->
    <xs:complexType name="warnType">
        <xs:attribute name="bridge" type="xs:string" use="required"/>
        <xs:attribute name="reason" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- errorType -->
    <xs:complexType name="errorType">
        <xs:attribute name="bridge" type="xs:string" use="required"/>
        <xs:attribute name="reason" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="bridge" type="bridgeType" minOccurs="0" maxOccurs="unbounded"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- out-->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="response">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="ok" type="okType" minOccurs="0" maxOccurs="unbounded"/>
                            <xs:element name="warn" type="warnType" minOccurs="0" maxOccurs="unbounded"/>
                            <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

Пример:

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

<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="bridge_change.xsd">
    <request>
        <bridge name="bsk2office">
            <a domain="biysk.local" interface="bridge:bsk" np="np240" trunkgroupid="tg:bsk" context="ctx_from_local"/>
            <b domain="ct.office" interface="bridge:office" np="np_office" trunkgroupid="tg:office" context="ctx_from_local"/>
        </bridge>
    </request>
</in>

Ответ: 200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="bridge_change.xsd">
    <response>
        <ok bridge="bsk2office"/>
    </response>
</out>
  • Нет меток