Hc_domain_declare
Команда позволяет создать домен (виртуальную АТС) с возможностью задания первоначальных настроек (максимальное количество абонентов, одновременных вызовов, поддержка резервирования вызовов).
Аналог команды в CoCon:
/domain/declare
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/domain_declare
Код HTTP-ответа:
При выполнении команды HTTP-терминал может ответить следующими сообщениями:
- 201 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла c ответом:
<?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.xsd"/> <xs:include schemaLocation="error.xsd"/> <!-- in--> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="domain"> <xs:complexType> <xs:attribute name="name" type="xs:string" use="required"> <xs:annotation> <xs:documentation xml:lang="en"> The name of the creating domain. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="user" type="xs:string" use="optional"> <xs:annotation> <xs:documentation xml:lang="en"> Obsolete attribute. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="grant_user" type="xs:boolean" default="true" use="optional"> <xs:annotation> <xs:documentation xml:lang="en"> Grant ecss-DOMAIN_NAME-domain-user privileges for current user. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="grant_admin" type="xs:boolean" default="true" use="optional"> <xs:annotation> <xs:documentation xml:lang="en"> Grant ecss-DOMAIN_NAME-domain-admin privileges for current user. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="degraded" type="xs:boolean" default="false" use="optional"> <xs:annotation> <xs:documentation xml:lang="en"> In case of degraded = false - domain support calls failover. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="call_limit" type="xs:nonNegativeInteger" use="optional"> <xs:annotation> <xs:documentation xml:lang="en"> Total number simultaneous calls in the current domain. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="alias_limit" type="xs:nonNegativeInteger" use="optional"> <xs:annotation> <xs:documentation xml:lang="en"> Total number aliases that can be create in the current domain. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="ss_profile" type="xs:string" use="optional"> <xs:annotation> <xs:documentation xml:lang="en"> The name of the system profile to be copied in the creating domain. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="ivr_restrictions_profile" type="xs:string" use="optional"> <xs:annotation> <xs:documentation xml:lang="en"> The name of the IVR scripts' restriction profile to be applied for the creating domain. </xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> <!--out--> <xs:element name = "out"> <xs:complexType> <xs:choice> <!--Positive case--> <xs:element name="response"> <xs:complexType> <xs:sequence> <xs:element name="ok"/> </xs:sequence> </xs:complexType> </xs:element> <!--Or error--> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос: http://192.168.1.21:9999/commands/domain_declare
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_domain_declare.xsd"> <domain name="test.biysk" call_limit="5" alias_limit="30" /> </in>
Ответ: 201.
Hc_list_of_domains
Команда позволяет вывести список доменов (виртуальных АТС), задекларированных в системе.
Аналог команды в CoCon:
/domain/list
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/list_of_domains
Код HTTP-ответа:
При выполнении команды HTTP-терминал может ответить следующими сообщениями:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла c ответом:
domains.xsd
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <!-- domainType--> <xs:complexType name="domainType"> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <!-- in--> <xs:element name="in"> <xs:complexType> <xs:sequence> <xs:element name="request" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:attribute name="storage" type="xs:string" use="optional"> <xs:annotation> <xs:documentation xml:lang="en"> Obsolete attribute. </xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> <!-- out--> <xs:element name="out"> <xs:complexType> <xs:all> <xs:element name="domains" minOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="domain" type="domainType" 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/list_of_domains
<?xml version="1.0" ?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="domains.xsd" > <request storage="ds1"/> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="domains.xsd"> <domains> <domain name="biysk.local"/> <domain name="ct.office"/> <domain name="d.remote"/> </domains> </out>
Hc_domain_remove
Команда позволяет удалить домен (виртуальную АТС) из системы.
Аналог команды в CoCon:
/domain/remove
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/domain_remove
Код HTTP-ответа:
При выполнении команды HTTP-терминал может ответить следующими сообщениями:
- 204 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла c запросом:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <!-- in--> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="domain"> <xs:complexType> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="force" type="xs:boolean" use="optional"/> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос: http://192.168.1.21:9999/commands/domain_remove
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_domain_remove.xsd"> <domain force="true" name="d.remote" /> </in>
Ответ: пустой XML.
Hc_domain_general_info
Команда просмотра значений общих свойств виртуальной АТС.
Аналоги команды в CoCon (сборка):
/domain/<DOMAIN>/alias/subscribers-limit
/domain/<DOMAIN>/sip/user/registered
/domain/<DOMAIN>/megaco/gateways/list
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/domain_general_info
Код 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="error.xsd"/> <xs:complexType name="SubscribersInfo"> <xs:attribute name="count" type="xs:nonNegativeInteger" use="required"/> <xs:attribute name="limit" type="xs:nonNegativeInteger" use="required"/> <xs:attribute name="general_aliases_count" type="xs:nonNegativeInteger" use="required"/> <xs:attribute name="virtual_aliases_count" type="xs:nonNegativeInteger" use="required"/> <xs:attribute name="licence_general_aliases_count" type="xs:nonNegativeInteger" use="required"/> <xs:attribute name="licence_virtual_aliases_count" type="xs:string" use="required"/> <xs:attribute name="free_general_aliases_count" type="xs:nonNegativeInteger" use="required"/> <xs:attribute name="free_virtual_aliases_count" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="RegisteredUsersInfo"> <xs:attribute name="count" type="xs:nonNegativeInteger" use="required"/> </xs:complexType> <xs:complexType name="GatewayInfo"> <xs:attribute name="count" type="xs:nonNegativeInteger" use="required"/> </xs:complexType> <xs:complexType name="DomainGeneralInfo"> <xs:sequence> <xs:element name="subscribersResult"> <xs:complexType> <xs:choice> <xs:element name="subscribersInfo" type="SubscribersInfo"/> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> <xs:element name="registeredUsersResult"> <xs:complexType> <xs:choice> <xs:element name="registeredUsersInfo" type="RegisteredUsersInfo"/> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> <xs:element name="gatewayResult"> <xs:complexType> <xs:choice> <xs:element name="gatewayInfo" type="GatewayInfo"/> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> <!-- in--> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="request"> <xs:complexType> <xs:attribute name="domain" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> <!-- out--> <xs:element name="out"> <xs:complexType> <xs:choice> <!--Positive case--> <xs:element name="response"> <xs:complexType> <xs:sequence> <xs:element name="domainGeneralInfo" type="DomainGeneralInfo"/> </xs:sequence> </xs:complexType> </xs:element> <!--Or error--> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос:
http://192.168.1.21:9999/commands/domain_general_info
<?xml version="1.0" encoding="UTF-8"?> <in> <request domain="biysk.local"/> </in>
Код ответа:
200
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_domain_general_info.xsd"> <response> <domainGeneralInfo> <subscribersResult> <subscribersInfo count="149" limit="2000"/> </subscribersResult> <registeredUsersResult> <registeredUsersInfo count="26"/> </registeredUsersResult> <gatewayResult> <error cmd="domain_general_info" reason="unknown_error" body="{error,{nocommand,"list"}}" entity="gateways"/> </gatewayResult> </domainGeneralInfo> </response> </out>
Hc_domain_copy
Команда предназначена для создания копии домена на основе существующего, с возможность задать digitmap, а так же определить bridge в основной домен.
Аналог команды в CoCon:
/domain/<DOMAIN>/copy
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/domain_copy
Код HTTP-ответа:
При выполнении команды HTTP-терминал может ответить следующими сообщениями:
- 201 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла c ответом:
<?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.xsd"/> <xs:include schemaLocation="error.xsd"/> <!-- in--> <xs:element name="in"> <xs:complexType> <xs:all> <xs:element name="domain"> <xs:complexType> <xs:attribute name="src_name" type="xs:string" use="required"> <xs:annotation> <xs:documentation xml:lang="en"> Source domain name. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="dst_name" type="xs:string" use="required"> <xs:annotation> <xs:documentation xml:lang="en"> New domain name. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="digitmap" type="xs:string" use="optional"> <xs:annotation> <xs:documentation xml:lang="en"> The digitmap for the new domain. </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="src_bridge_name" type="xs:string" use="optional"> <xs:annotation> <xs:documentation xml:lang="en"> Source bridge name (used only with dst_bridge_name). </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="dst_bridge_name" type="xs:string" use="optional"> <xs:annotation> <xs:documentation xml:lang="en"> Destination bridge name (used only with src_bridge_name). </xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> <!--out--> <xs:element name = "out"> <xs:complexType> <xs:choice> <!--Positive case--> <xs:element name="response"> <xs:complexType> <xs:sequence> <xs:element name="ok"/> </xs:sequence> </xs:complexType> </xs:element> <!--Or error--> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> </xs:schema>
Пример
Запрос: http://192.168.23.34:9999/commands/domain_copy
<?xml version="1.0"?> <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_domain_copy.xsd"> <domain src_name="p.city" dst_name="main11" digitmap="xxx+" src_bridge_name="p_city_to_main" dst_bridge_name="p_city_to_main1111"/> </in>
Ответ: пустой xml.