Hc_alias_list

Команда возвращает список алиасов, определенных в домене и определенных в домене для определенного адреса или диапазона адресов.

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

domain/<DOMAIN>/alias/list

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

POST

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

http://host:port/commands/alias_list

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation="aliases_list.xsd"/>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="aliases" minOccurs="1">
                    <xs:complexType>
                        <xs:attribute name="domain" type="xs:string" use="required"/>
                        <xs:attribute name="addr" type="xs:string" use="optional"/>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="aliases" minOccurs="1">
                    <xs:complexType>
                        <xs:sequence minOccurs="0" maxOccurs="unbounded">
                            <xs:element name="alias" type="aliasType" 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>
CODE

aliases_list.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- aliasType-->
    <xs:complexType name="aliasType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="interface" type="xs:string" use="required"/>
        <xs:attribute name="interface_type" type="xs:string" use="optional"/>
        <xs:attribute name="interface_group" type="xs:string" use="optional"/>
        <xs:attribute name="address" type="xs:string" use="required"/>
        <xs:attribute name="iface_name" type="xs:string" use="optional"/>
        <xs:attribute name="active" type="xs:boolean" use="required"/>
        <xs:attribute name="binded" type="xs:boolean" use="optional"/>
        <xs:attribute name="displayName" type="xs:string" use="optional"/>
    </xs:complexType>
    <!-- errorType-->
    <xs:complexType name="errorType">
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="interface" type="xs:string"/>
                <xs:attribute name="address" type="xs:string"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
</xs:schema>
CODE

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alias_list.xsd">
   <aliases domain="biysk.local" addr="24046{2-4}" />
</in>
CODE

Ответ:

200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alias_list.xsd">
    <aliases>
        <alias domain="biysk.local" interface="0616e1cdf6d17ece" interface_type="sip" interface_group="loc.gr" address="240462" active="true"/>
        <alias domain="biysk.local" interface="0616e1cdf89ba684" interface_type="sip" interface_group="loc.gr" address="240464" active="true"/>
    </aliases>
</out>
CODE

Hc_alias_list2

Команда возвращает список алиасов, определенных в домене с фильтрацией по свойствам алиаса.

Аналога команды в CoCon нет, является сочетанием двух команд:

domain/<DOMAIN>/alias/list

domain/<DOMAIN>/alias/info


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


POST


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


http://host:port/commands/alias_list2

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

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

XSD-схема XML-файла с ответом alias_list2.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!-- opType-->
	<xs:simpleType name="opType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="=="/>
			<xs:enumeration value="~"/>
			<xs:enumeration value="/="/>
			<xs:enumeration value=">"/>
			<xs:enumeration value="<"/>
			<xs:enumeration value="=<"/>
			<xs:enumeration value=">="/>
			<xs:enumeration value="in"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- filterType -->
	<xs:complexType name="filterType">
		<xs:attribute name="name" type="xs:string" use="required"/>
		<xs:attribute name="op" type="opType" use="required"/>
		<xs:attribute name="value" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- andFiltersType -->
	<xs:complexType name="andFiltersType">
		<xs:sequence>
			<xs:element name="filter" type="filterType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<!-- filtersType -->
	<xs:complexType name="filtersType">
		<xs:sequence>
			<xs:element name="and" type="andFiltersType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<!-- aliasType -->
	<xs:complexType name="aliasType">
		<xs:attribute name="domain" type="xs:string" use="required"/>
		<xs:attribute name="iface" type="xs:string" use="required"/>
		<xs:attribute name="address" type="xs:string" use="required"/>
		<xs:attribute name="active" type="xs:boolean" use="required"/>
		<xs:attribute name="binded" type="xs:boolean" use="required"/>
		<xs:attribute name="display_name" type="xs:string" use="required"/>
		<xs:attribute name="regime" type="xs:string" use="required"/>
		<xs:attribute name="interface_name" type="xs:string" use="required"/>
		<xs:attribute name="interface_type" type="xs:string" use="required"/>
		<xs:attribute name="interface_owner" type="xs:string" use="required"/>
		<xs:attribute name="interface_group" type="xs:string" use="required"/>
	</xs:complexType>	
	<!-- in-->
	<xs:element name="in">
		<xs:complexType>
			<xs:all>
				<xs:element name="request">
					<xs:complexType>
						<xs:all>
							<xs:element name="filters" type="filtersType"/>
						</xs:all>
						<xs:attribute name="domain" type="xs:string" use="required"/>
						<xs:attribute name="limit" type="xs:string" use="required"/>
						<xs:attribute name="address_range" type="xs:string" use="optional"/>
						<xs:attribute name="cursor" type="xs:string" use="optional"/>
					</xs:complexType>
				</xs:element>
			</xs:all>
		</xs:complexType>
	</xs:element>
	<!-- out -->
	<xs:element name="out">
		<xs:complexType>
			<xs:all>
				<xs:element name="result">
					<xs:complexType>
						<xs:sequence minOccurs="0" maxOccurs="unbounded">
							<xs:element name="alias" type="aliasType" minOccurs="0" maxOccurs="unbounded"/>
						</xs:sequence>
						<xs:attribute name="cursor" type="xs:string" use="optional"/>
					</xs:complexType>
				</xs:element>
			</xs:all>
		</xs:complexType>
	</xs:element>
</xs:schema>

CODE

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alias_list2.xsd">
    <request address_range="240{500-510}" domain="biysk.local" limit="5">
        <filters>
            <and>
                <filter name="regime" op="==" value="accsusp"/>
            </and>
            <and>
                <filter name="active" op="==" value="true"/>
            </and>
        </filters>
    </request>
</in>

CODE

Ответ: 200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alias_list2.xsd">
    <result>
        <alias domain="biysk.local" iface="061d4d840b68f853" address="240500" active="true" binded="true" display_name="" regime="accsusp" interface_name="240500@biysk.local" interface_type="sip" interface_owner="sip1" interface_group="loc.gr"/>
    </result>
</out>
CODE

Hc_ alias_where

Команда возвращает список задекларированных алиасов с определенным адресом (во всех доменах, со всеми интерфейсами).

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

domain/<DOMAIN>/alias/where

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

POST

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

http://host:port/commands/alias_where

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

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

XSD-схема XML-файла с ответом alias_where.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:include schemaLocation="aliases_list.xsd"/>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="aliases" minOccurs="1">
                    <xs:complexType>
                        <xs:attribute name="domain" type="xs:string" use="required"/>
                        <xs:attribute name="addr" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="aliases" minOccurs="1">
                    <xs:complexType>
                        <xs:sequence minOccurs="0" maxOccurs="unbounded">
                            <xs:element name="alias" type="aliasType" 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>
CODE

aliases_list.xsd: 

Схема файла определена в разделе hc_aliases_list.

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alias_where.xsd">
    <aliases addr="240{4,5,6}0{0,1,3}" domain="biysk.local" />
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alias_where.xsd">
    <aliases>
        <error address="240400">{not_exists,"240400"}</error>
        <error address="240401">{not_exists,"240401"}</error>
        <error address="240403">{not_exists,"240403"}</error>
        <alias domain="biysk.local" interface="0616e1ce0437ed8d" address="240500" iface_name="240500@biysk.local" active="true" binded="true" displayName=""/>
        <alias domain="biysk.local" interface="0616e1ce0437f792" address="240501" iface_name="240501@biysk.local" active="true" binded="true" displayName=""/>
        <alias domain="biysk.local" interface="0616e1ce04381f14" address="240503" iface_name="240503@biysk.local" active="true" binded="true" displayName=""/>
        <alias domain="biysk.local" interface="0616e1ce13af0be9" address="240600" iface_name="240600@biysk.local" active="true" binded="true" displayName=""/>
        <alias domain="biysk.local" interface="0616e1ce13af16da" address="240601" iface_name="240601@biysk.local" active="true" binded="true" displayName=""/>
        <alias domain="biysk.local" interface="0616e1ce13af2200" address="240603" iface_name="240603@biysk.local" active="true" binded="true" displayName=""/>
    </aliases>
</out>
CODE

Hc_alias_who

Команда возвращает список задекларированных алиасов с определенным интерфейсом (во всех доменах, со всеми адресами).

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

domain/<DOMAIN>/alias/who

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

POST

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

http://host:port/commands/alias_who

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
    <xs:include schemaLocation="aliases_list.xsd"/>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="aliases" minOccurs="1">
                    <xs:complexType>
                        <xs:attribute name="domain" type="xs:string" use="required"/>
                        <xs:attribute name="iface" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="aliases" minOccurs="1">
                    <xs:complexType>
                        <xs:sequence minOccurs="0" maxOccurs="unbounded">
                            <xs:element name="alias" type="aliasType" 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>
CODE

Схема файла определена в разделе hc_aliases_list.

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alias_who.xsd">
    <aliases iface="e389d19152a30983" domain="biysk.local" />
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alias_who.xsd">
    <aliases>
        <alias domain="biysk.local" interface="0616e1ce13af2200" address="240603" active="true" binded="true" displayName=""/>
    </aliases>
</out>
CODE

Hc_ alias_info

Команда возвращает информацию о свойствах алиасов.  Кроме того,  предусмотрена фильтрация по доменам, адресам, интерфейсам и свойствам алиаса посредством POST-запроса.

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

domain/<DOMAIN>/alias/info

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

POST

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

http://host:port/commands/alias_info

  • Для возврата свойства на уровне домена: указать domain
  • Для возврата свойства на уровне адреса: указать addr
  • Для возврата свойства на уровне домен+адрес: указать domain, addr
  • Для возврата свойства на уровне домен+интерфейс: указать domain, iface
  • Для возврата свойства на уровне домен+интерфейс+адрес: указать domain, iface, addr
  • Для возврата свойства с именем propertyName уровня домен+интерфейс+адрес: указать domain, iface, addr, prop

Каждый из параметров «iface», «addr», «prop» может как присутствовать, так и отсутствовать. «propertyName» представляет собой имя свойства, значения которого необходимо получить. «iface_pattern» и «addr_pattern» представляют собой шаблон имени интерфейса и шаблон адреса соответственно. В шаблоне для отображения диапазона адресов/интерфейсов можно воспользоваться шаблоном “{from-to}”, где from и to – нижняя и верхняя граница перечисления адресов/интерфейсов. Например: шаблон для адреса ”550{02-10}01” выведет следующие адреса:
5500201, 5500301, 5500401, 5500501, 5500601, 5500701, 5500801, 5500901, 5501001 .
Для имен интерфейсов можно также воспользоваться данным шаблоном. Когда одновременно присутствуют параметры «iface» и «addr», каждый из них может принимать значение прочерк (_). Прочерк означает, что значение данного параметра вычисляется на основе второго.
В зависимости от того, какие параметры присутствуют в POST-запросе, возвращаются свойства, расположенные на разных уровнях.

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
    <!-- propertyTypeType-->
    <xs:simpleType name="propertyTypeType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="global"/>
            <xs:enumeration value="domain"/>
            <xs:enumeration value="domain_interface"/>
            <xs:enumeration value="domain_address"/>
            <xs:enumeration value="address"/>
            <xs:enumeration value="profile"/>
            <xs:enumeration value="alias"/>
        </xs:restriction>
    </xs:simpleType>
    <!-- propertyType-->
    <xs:complexType name="propertyType">
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="type" type="propertyTypeType" use="required"/>
        <xs:attribute name="value" type="xs:string" use="required">
            <xs:annotation>
                <xs:documentation xml:lang="en">
                    For other type of properties value will be formatted specifically.
                    Key:    timetables\TIMETABLE_NAME
                    Value:  {"name":"TIMETABLE_NAME", "filters":[{"date":"DAYS_LIST_OR_DAY_TYPE_NAME","from":"FROM_HH:FROM_MM","to":"TO_HH:TO_MM"}],"properties":{"description | KEY":"VALUE"}}
                    Sample: {"name":"tt2","filters":[{"date":"1 2 3 4 5","from":"9:0","to":"12:59"},{"date":"HOLIDAY","from":"13:0","to":"17:59"}],"properties":{"description":"Мой 2","key3":"{hello,world}"}}
                </xs:documentation>
            </xs:annotation>
        </xs:attribute>
    </xs:complexType>
    <!-- aliasType-->
    <xs:complexType name="aliasType">
        <xs:sequence>
            <xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="iface" type="xs:string" use="required"/>
        <xs:attribute name="address" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- addressType-->
    <xs:complexType name="addressType">
        <xs:sequence>
            <xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- ifaceType-->
    <xs:complexType name="ifaceType">
        <xs:sequence>
            <xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- errorType-->
    <xs:complexType name="errorType">
        <xs:attribute name="iface" type="xs:string" use="required"/>
        <xs:attribute name="address" type="xs:string" use="required"/>
        <xs:attribute name="value" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- Properties elements-->
    <xs:complexType name="ifacesType">
        <xs:sequence>
            <xs:element name="iface" type="ifaceType" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="domain" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="addressesType">
        <xs:sequence>
            <xs:element name="address" type="addressType" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="domain" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="aliasesType">
        <xs:sequence>
            <xs:element name="alias" type="aliasType" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="domain" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="domainType">
        <xs:sequence>
            <xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="aliases" minOccurs="1" maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:attribute name="domain" type="xs:string" use="required"/>
                        <xs:attribute name="addr" type="xs:string" use="optional"/>
                        <xs:attribute name="iface" type="xs:string" use="optional"/> 
          <!-- iface задавать только как iface_id! -->
           
          
                        <xs:attribute name="prop" type="xs:string" use="optional"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- out-->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="domain" type="domainType"/>
                <xs:element name="ifaces" type="ifacesType"/>
                <xs:element name="addresses" type="addressesType"/>
                <xs:element name="aliases" type="aliasesType"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>
CODE

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="aliases.xsd">
    <aliases addr="24046{2-5}" domain="biysk.local" iface="_" />
</in>
CODE

Ответ:

200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="aliases.xsd">
    <aliases domain="biysk.local">
        <alias iface="0616e1cdf6d17ece" address="240462">
            <property name="user_agent" type="alias" value="Brcm-Callctrl/v1.10.3 M5T SIP Stack/4.1.2.2"/>
            <property name="uid" type="alias" value="<<"0616e1cdf6fd6a2a">>"/>
            <property name="timezone" type="global" value="UTC+07:00"/>
            <property name="terminal_type" type="alias" value="smart"/>
            <property name="subscriber_portal\password" type="alias" value="9nMz5rjL"/>
            <property name="subscriber_portal\login" type="alias" value="240462"/>
            <property name="ss\mgm\telephone" type="global" value="enabled"/>
            <property name="screening" type="profile" value="networkProvided"/>
            <property name="profile" type="alias" value="user_default"/>
            <property name="pin" type="global" value="1111"/>
            <property name="npi" type="profile" value="isdnTelephony"/>
            <property name="ni" type="profile" value="private"/>
            <property name="nai" type="profile" value="subscriberNumber"/>
            <property name="media-profile" type="domain" value="default"/>
            <property name="isIfaceActive" type="alias" value="true"/>
            <property name="isActive" type="alias" value="true"/>
            <property name="dtmf_source" type="alias" value="rfc+info"/>
            <property name="cdr_group" type="domain" value="bsk3"/>
            <property name="category" type="profile" value="10"/>
            <property name="access_type" type="domain" value="access_type0"/>
            <property name="access_group" type="profile" value="all"/>
        </alias>
        <alias iface="0616e1cdf89ba684" address="240464">
            <property name="user_agent" type="alias" value="TAU-2M.IP/2.0.0.229 SN/VI39005419 sofia-sip/1.12.10"/>
            <property name="uid" type="alias" value="<<"0616e1cdf8cda96a">>"/>
            <property name="timezone" type="global" value="UTC+07:00"/>
            <property name="terminal_type" type="alias" value="smart"/>
            <property name="subscriber_portal\password" type="alias" value="8I4GzvCi"/>
            <property name="subscriber_portal\login" type="alias" value="240464"/>
            <property name="ss\mgm\telephone" type="global" value="enabled"/>
            <property name="screening" type="profile" value="networkProvided"/>
            <property name="profile" type="alias" value="user_default"/>
            <property name="pin" type="global" value="1111"/>
            <property name="npi" type="profile" value="isdnTelephony"/>
            <property name="ni" type="profile" value="private"/>
            <property name="nai" type="profile" value="subscriberNumber"/>
            <property name="media-profile" type="domain" value="default"/>
            <property name="last_incoming_call_info" type="alias" value="{rtop_last_incoming_call_info,1,"240462",3559082181779416120, {1559,30929,916928}}"/>
            <property name="isIfaceActive" type="alias" value="true"/>
            <property name="isActive" type="alias" value="true"/>
            <property name="dtmf_source" type="alias" value="rfc+info"/>
            <property name="cdr_group" type="domain" value="bsk3"/>
            <property name="category" type="profile" value="10"/>
            <property name="access_type" type="domain" value="access_type0"/>
            <property name="access_group" type="profile" value="all"/>
        </alias>
        <alias iface="0616e1cdfa62ad0e" address="240465">
            <property name="user_agent" type="alias" value="TAU-2M.IP/2.0.0.229 SN/VI39005419 sofia-sip/1.12.10"/>
            <property name="uid" type="alias" value="<<"0616e1cdfaa175a8">>"/>
            <property name="timezone" type="global" value="UTC+07:00"/>
            <property name="terminal_type" type="alias" value="smart"/>
            <property name="subscriber_portal\password" type="alias" value="9vFyIB2a"/>
            <property name="subscriber_portal\login" type="alias" value="240465"/>
            <property name="ss\mgm\telephone" type="global" value="enabled"/>
            <property name="screening" type="profile" value="networkProvided"/>
            <property name="profile" type="alias" value="user_default"/>
            <property name="pin" type="global" value="1111"/>
            <property name="npi" type="profile" value="isdnTelephony"/>
            <property name="ni" type="profile" value="private"/>
            <property name="nai" type="profile" value="subscriberNumber"/>
            <property name="media-profile" type="domain" value="default"/>
            <property name="last_incoming_call_info" type="alias" value="{rtop_last_incoming_call_info,1,"240474",4063428173976658745, {1558,932168,864198}}"/>
            <property name="isIfaceActive" type="alias" value="true"/>
            <property name="isActive" type="alias" value="true"/>
            <property name="dtmf_source" type="alias" value="rfc+info"/>
            <property name="cdr_group" type="domain" value="bsk3"/>
            <property name="category" type="profile" value="10"/>
            <property name="access_type" type="domain" value="access_type0"/>
            <property name="access_group" type="profile" value="all"/>
        </alias>
    </aliases>
</out>
CODE

Hc_alias_set

Команда предназначена для задания свойств алиаса на различных уровнях. Свойства могут быть определены на уровнях: глобальный, домен, адрес, домен + адрес, домен + интерфейс, домен + адрес + интерфейс.

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

domain/<DOMAIN>/alias/set

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

POST

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

http://host:port/commands/alias_set

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

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

XSD-схема XML-файла с запросом set_alias_properties.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<!-- propertyType-->
	<xs:complexType name="propertyType">
		<xs:attribute name="name" type="xs:string" use="required"/>
		<xs:attribute name="value" type="xs:string" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">
					For other type of properties value will be formatted specifically.
					Key:    timetables\TIMETABLE_NAME
					Value:  {"name":"TIMETABLE_NAME", "filters":[{"date":"DAYS_LIST_OR_DAY_TYPE_NAME","from":"FROM_HH:FROM_MM","to":"TO_HH:TO_MM"}],"properties":{"description | KEY":"VALUE"}}
					Sample: {"name":"tt2","filters":[{"date":"1 2 3 4 5","from":"9:0","to":"12:59"},{"date":"HOLIDAY","from":"13:0","to":"17:59"}],"properties":{"description":"Мой 2","key3":"{hello,world}"}}
				</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<!-- in-->
	<xs:element name="in">
		<xs:complexType>
			<xs:all>
				<xs:element name="aliases">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
						</xs:sequence>
						<xs:attribute name="addr" type="xs:string" use="optional"/>
						<xs:attribute name="iface" type="xs:string" use="optional">
							<xs:annotation>
								<xs:documentation xml:lang="en">
									iface :: IfacePattern1;IfacePattern2;...IfacePatternN
									IfacePatternN :: {From-To}@domain
								</xs:documentation>
							</xs:annotation>
						</xs:attribute>
						<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:sequence>
				<xs:element name="error">
					<xs:complexType>
						<xs:attribute name="domain" type="xs:string" use="optional" />
						<xs:attribute name="iface" type="xs:string" use="optional" />
						<xs:attribute name="addr" type="xs:string" use="optional" />
						<xs:attribute name="reason" type="xs:string" use="required" />
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
CODE

Установить режим для диапазона алиасов и всех принадлежащих им интерфейсов
Запрос: http://192.168.1.21:9999/commands/alias_set
Параметры:

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="set_alias_properties.xsd">
    <aliases addr="24046{2,6}" iface="_" domain="biysk.local">
        <property name="regime" value="accsusp"/>
    </aliases>
</in>
CODE

Ответ: 201

Hc_ alias_declare

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

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

domain/<DOMAIN>/alias/declare

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

POST

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

http://host:port/commands/alias_declare

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

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

XSD-схема XML-файла с ответом hc_alias_declare.xsd:

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

    <!-- causeType-->
    <xs:simpleType name="causeType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="already_exists"/>
            <xs:enumeration value="licence_limit"/>
            <xs:enumeration value="domain_limit"/>
            <xs:enumeration value="no_such_iface"/>
            <xs:enumeration value="bad_owner"/>
            <xs:enumeration value="bad_group"/>
            <xs:enumeration value="cannot_get_iface"/>
            <xs:enumeration value="invalid_address_format"/>
        </xs:restriction>
    </xs:simpleType>

    <!-- warningType-->
    <xs:complexType name="warningType">
        <xs:attribute name="cause" type="causeType"/>
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="interface" type="xs:string" use="required"/>
        <xs:attribute name="address" type="xs:string" use="required"/>
    </xs:complexType>

    <!-- aliasType-->
    <xs:complexType name="aliasType">
        <xs:attribute name="domain" type="xs:string" use="required"/>
        <xs:attribute name="interface" type="xs:string" use="required"/>
        <xs:attribute name="address" type="xs:string" use="required"/>
        <xs:attribute name="active" type="xs:boolean" use="required"/>
    </xs:complexType>

    <!-- successType-->
    <xs:complexType name="successType">
        <xs:sequence>
            <xs:element name="alias" type="aliasType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <!-- warningsType-->
    <xs:complexType name="warningsType">
        <xs:sequence>
            <xs:element name="warning" type="warningType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <!-- resultType-->
    <xs:complexType name="resultType">
        <xs:sequence>
            <xs:element name="success" type="successType"/>
            <xs:element name="warnings" type="warningsType"/>
        </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:attribute name="address" type="xs:string" use="required"/>
						<xs:attribute name="iface" type="xs:string" use="required"/>
						<xs:attribute name="active" type="xs:boolean" use="required"/>
						<xs:attribute name="owner" type="xs:string" use="optional"/>
						<xs:attribute name="group" type="xs:string" use="optional"/>
					</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/alias_declare

<?xml version="1.0"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alias_declare.xsd">
    <request domain="biysk.local" address="600" iface="0616e1ce554bc90e" active="true" owner="sip1" group="loc.gr"/>
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_alias_declare.xsd">
    <result>
        <success>
            <alias domain="biysk.local" interface="0616e1ce554bc90e" address="600" active="true"/>
        </success>
        <warnings/>
    </result>
</out>
CODE

Hc_alias_remove

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

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

domain/<DOMAIN>/alias/remove

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

POST

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

http://host:port/commands/alias_remove

XSD-схема XML-файла с ответом hc_alias_remove.xsd:

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

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

    <!-- aliasesType-->
    <xs:complexType name="aliasesType">
        <xs:sequence>
            <xs:element name="alias" type="aliasType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="aliases" type="aliasesType"/>
                        </xs:sequence>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>


CODE

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

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

XSD-схема XML-файла с ответом:

Пустой XML

Пример:

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

<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_alias_remove.xsd">
    <request>
        <aliases>
            <alias domain="biysk.local" address="600" iface="0616e1ce554bc90e"/>
        </aliases>
    </request>
</in>
CODE

Ответ: 204.

Hc_alias_clean

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

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

domain/<DOMAIN>/alias/clean

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

POST

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

http://host:port/commands/alias_clean

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

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

XSD-схема XML-файла с запросом aliases.xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<!-- propertyTypeType-->
	<xs:simpleType name="propertyTypeType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="global"/>
			<xs:enumeration value="domain"/>
			<xs:enumeration value="domain_interface"/>
			<xs:enumeration value="domain_address"/>
			<xs:enumeration value="address"/>
			<xs:enumeration value="profile"/>
			<xs:enumeration value="alias"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- propertyType-->
	<xs:complexType name="propertyType">
		<xs:attribute name="name" type="xs:string" use="required"/>
		<xs:attribute name="type" type="propertyTypeType" use="required"/>
		<xs:attribute name="value" type="xs:string" use="required">
			<xs:annotation>
				<xs:documentation xml:lang="en">
					For other type of properties value will be formatted specifically.
					Key:    timetables\TIMETABLE_NAME
					Value:  {"name":"TIMETABLE_NAME", "filters":[{"date":"DAYS_LIST_OR_DAY_TYPE_NAME","from":"FROM_HH:FROM_MM","to":"TO_HH:TO_MM"}],"properties":{"description | KEY":"VALUE"}}
					Sample: {"name":"tt2","filters":[{"date":"1 2 3 4 5","from":"9:0","to":"12:59"},{"date":"HOLIDAY","from":"13:0","to":"17:59"}],"properties":{"description":"Мой 2","key3":"{hello,world}"}}
				</xs:documentation>
			</xs:annotation>
		</xs:attribute>
	</xs:complexType>
	<!-- aliasType-->
	<xs:complexType name="aliasType">
		<xs:sequence>
			<xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="iface" type="xs:string" use="required"/>
		<xs:attribute name="address" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- addressType-->
	<xs:complexType name="addressType">
		<xs:sequence>
			<xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="name" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- ifaceType-->
	<xs:complexType name="ifaceType">
		<xs:sequence>
			<xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="name" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- errorType-->
	<xs:complexType name="errorType">
		<xs:attribute name="iface" type="xs:string" use="required"/>
		<xs:attribute name="address" type="xs:string" use="required"/>
		<xs:attribute name="value" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- Properties elements-->
	<xs:complexType name="ifacesType">
		<xs:sequence>
			<xs:element name="iface" type="ifaceType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="domain" type="xs:string" use="required"/>
	</xs:complexType>
	<xs:complexType name="addressesType">
		<xs:sequence>
			<xs:element name="address" type="addressType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="domain" type="xs:string" use="required"/>
	</xs:complexType>
	<xs:complexType name="aliasesType">
		<xs:sequence>
			<xs:element name="alias" type="aliasType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="domain" type="xs:string" use="required"/>
	</xs:complexType>
	<xs:complexType name="domainType">
		<xs:sequence>
			<xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="name" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- in-->
	<xs:element name="in">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="aliases" minOccurs="1" maxOccurs="unbounded">
					<xs:complexType>
						<xs:attribute name="domain" type="xs:string" use="required"/>
						<xs:attribute name="addr" type="xs:string" use="optional"/>
						<xs:attribute name="iface" type="xs:string" use="optional"/> <!-- iface задавать только как iface_id! -->
						<xs:attribute name="prop" type="xs:string" use="optional"/>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<!-- out-->
	<xs:element name="out">
		<xs:complexType>
			<xs:choice>
				<xs:element name="domain" type="domainType"/>
				<xs:element name="ifaces" type="ifacesType"/>
				<xs:element name="addresses" type="addressesType"/>
				<xs:element name="aliases" type="aliasesType"/>
			</xs:choice>
		</xs:complexType>
	</xs:element>
</xs:schema>

CODE

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="aliases.xsd">
    <aliases addr="24052{0-1}" iface="_" domain="biysk.local" prop="regime" />
</in>
CODE

Ответ:

204