Hc_iface_group_owner_info

Команда позволяет вывести список свойств групп интерфейсов.
Могут быть следующие группы интерфейсов: сгруппированные по владельцу, по имени группы, по владельцу и имени группы, глобальная группа.

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

/cluster/storage/<CLUSTER>/iface/group-info
/domain/<DOMAIN>/iface/group-info

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

POST

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

http://host:port/commands/iface_group_owner_info

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

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!-- propertyTypeType-->
	<xs:simpleType name="propertyTypeType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="global"/>
			<xs:enumeration value="owner"/>
			<xs:enumeration value="group"/>
			<xs:enumeration value="group_owner"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- propertyType-->
	<xs:complexType name="propertyType">
		<xs:attribute name="type" type="propertyTypeType" use="required"/>
		<xs:attribute name="key" type="xs:string" use="required"/>
		<xs:attribute name="value" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- in-->
	<xs:element name="in">
		<xs:complexType>
			<xs:all>
				<xs:element name="request">
					<xs:complexType>
						<xs:attribute name="owner" type="xs:string" use="optional"/>
						<xs:attribute name="group" type="xs:string" use="optional"/>
						<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:all>
				<xs:element name="header">
					<xs:complexType>
						<xs:attribute name="owner" type="xs:string" use="required"/>
						<xs:attribute name="group" type="xs:string" use="required"/>
					</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:complexType>
	</xs:element>
</xs:schema>
XML

Примеры:

Пример запроса информации о глобальной группе:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_group_owner_info.xsd">
    <request domain="biysk.local"/>
</in>
XML

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_group_owner_info.xsd">
    <header group="*" owner="*"/>
    <properties/>
</out>
XML

Пример запроса информации о группе по владельцу:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_group_owner_info.xsd">
    <request owner="sip1" domain="biysk.local"/>
</in>
XML

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_group_owner_info.xsd">
    <header group="*" owner="sip1"/>
    <properties/>
</out>
XML

Пример запроса информации о группе по имени группы:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_group_owner_info.xsd">
    <request group="loc.gr" domain="biysk.local"/>
</in>
XML

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_group_owner_info.xsd">
    <header group="loc.gr" owner="*"/>
    <properties>
        <property type="group" key="gate" value="{gate_amqp,<<"acp.adapter.init.ex">>,<<"acp.sip.sip1.ipset1.init.rk">>}"/>
        <property type="group" key="group" value="{gate_amqp,<<"acp.adapter.init.ex">>,<<"acp.sip.sip1.ipset1.init.rk">>}"/>
        <property type="group" key="owner" value=""sip1""/>
    </properties>
</out>
XML

Пример запроса информации о группе по имени группы и владельцу:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_group_owner_info.xsd">
    <request owner="sip1" group="loc.gr" domain="biysk.local"/>
</in>
XML

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_group_owner_info.xsd">
    <header group="loc.gr" owner="sip1"/>
    <properties>
        <property type="group" key="gate" value="{gate_amqp,&lt;&lt;&quot;acp.adapter.init.ex&quot;>>,&lt;&lt;&quot;acp.ecss10.sip1.init.rk&quot;>>}"/>
        <property type="group" key="owner" value="&quot;sip1&quot;"/>
        <property type="group" key="terminal_type" value="basic"/>
    </properties>
</out>
XML

Hc_iface_group_owner_list

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

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

/cluster/storage/<CLUSTER>/iface/list

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

POST

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

http://host:port/commands/iface_group_owner_list

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

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!-- ownerType-->
	<xs:simpleType name="ownerTypeType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="sip" />
			<xs:enumeration value="megaco" />
			<xs:enumeration value="virtual" />
			<xs:enumeration value="cc" />
			<xs:enumeration value="other" />
		</xs:restriction>
	</xs:simpleType>
	<!-- groupType-->
	<xs:complexType name="groupType">
		<xs:attribute name="name" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- ownerType-->
	<xs:complexType name="ownerType">
		<xs:sequence>
			<xs:element name="groups">
				<xs:complexType>
					<xs:sequence>
						<xs:element name="group" type="groupType" minOccurs="0" maxOccurs="unbounded"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="name" type="xs:string" use="required"/>
		<xs:attribute name="type" type="ownerTypeType" use="required"/>
	</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:sequence>
				<xs:element name="owners">
					<xs:complexType>
						<xs:sequence>
							<xs:element name="owner" type="ownerType" minOccurs="0" maxOccurs="unbounded"/>
						</xs:sequence>
					</xs:complexType>
				</xs:element>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
XML

Пример:

В данном примере запрашиваются все пары {Owner, Group}, относящиеся к домену biysk.local.

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

<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_iface_group_owner_list.xsd">
    <request domain="biysk.local"></request>
</in>
XML

Ответ:

<?xml version="1.0"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_iface_group_owner_list.xsd">
	<owners>
		<owner name="sip1" type="sip">
			<groups>
				<group name="sip.ab"/>
			</groups>
		</owner>
		<owner name="megaco1" type="megaco">
			<groups/>
		</owner>
		<owner name=".virtual" type="other">
			<groups/>
		</owner>
		<owner name=".system_bridge" type="other">
			<groups/>
		</owner>
		<owner name=".system" type="other">
			<groups>
				<group name=".system"/>
			</groups>
		</owner>
	</owners>
</out>
XML

Hc_iface_list

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

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

/domain/<DOMAIN>/iface/list

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

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

POST

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

http://host:port/commands/iface_list

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

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
	<!-- ifaceType -->
	<xs:complexType name="ifaceType">
		<xs:attribute name="id" type="xs:string" use="required"/>
		<xs:attribute name="name" type="xs:string" use="required"/>
		<xs:attribute name="owner" type="xs:string" use="required"/>
		<xs:attribute name="group" type="xs:string" use="required"/>
		<xs:attribute name="type" type="xs:string" use="required"/>
		<xs:attribute name="active" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- ifacesType -->
	<xs:complexType name="ifacesType">
		<xs:sequence>
			<xs:element name="iface" type="ifaceType" minOccurs="0" maxOccurs="unbounded"/>
		</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="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:all>
				<xs:element name="ifaces" type="ifacesType"/>
			</xs:all>
		</xs:complexType>
	</xs:element>
</xs:schema>
XML

Примеры:

Пример запроса всех интерфейсов в определенном домене:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_iface_list.xsd">
    <request domain="biysk.local"/>
</in>
XML

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_iface_list.xsd">
    <ifaces>
        <iface id="06201d997b9cd8f1" name="240616@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d99bedc3c0c" name="240466@biysk.local" owner="sip1" group="loc.gr" type="sip" active="true"/>
        <iface id="06201d997b9db807" name="240628@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d996cc0316f" name="240536@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="smg-4" name="smg-4" owner="sip1" group="smg.gr" type="sip" active="true"/>
        <iface id="06201d99d02a910b" name="240473@biysk.local" owner="sip1" group="loc.gr" type="sip" active="true"/>
        <iface id="06201d997bafec03" name="240772@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d997ba46191" name="240677@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d997baa029e" name="240754@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d996cbf2127" name="240508@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d997bb0095b" name="240777@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d996cc12fa0" name="240562@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d996cc03fff" name="240538@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="to_aster" name="to_aster" owner="sip1" group="sbc.gr" type="sip" active="true"/>
        <iface id="06201d997ba407d9" name="240663@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d996cc21da4" name="240587@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d997bb663d2" name="240792@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d997b9b03b0" name="240605@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d997ba42485" name="240667@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d995549d606" name="240002@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d997bafd9e6" name="240769@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d997ba4a0d2" name="240684@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d996cbefbb1" name="240502@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d996cc00ea0" name="240530@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d996cc09448" name="240542@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="ems1" name="ems1" owner="sip1" group="ssw.gr" type="sip" active="true"/>
        <iface id="06201d996cbf4a88" name="240511@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="system:teleconference" name="system:teleconference" owner=".system" group=".system" type="system" active="true"/>
        <iface id="06201d997ba16772" name="240647@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d996cbf0f2f" name="240505@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
        <iface id="06201d996cc223c5" name="240588@biysk.local" owner="sip1" group="loc.gr" type="sip" active="false"/>
    </ifaces>
</out>
CODE

Пример запроса всех интерфейсов по определенной группе и домену:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_iface_list.xsd">
    <request domain="biysk.local" group="sbc.gr"/>
</in>
XML

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_iface_list.xsd">
    <ifaces>
        <iface id="nsk_sbc" name="nsk_sbc" owner="sip1" group="sbc.gr" type="sip" active="true"/>
        <iface id="to_aster" name="to_aster" owner="sip1" group="sbc.gr" type="sip" active="true"/>
        <iface id="to_sipp" name="to_sipp" owner="sip1" group="sbc.gr" type="sip" active="true"/>
    </ifaces>
</out>
XML

Пример запроса всех интерфейсов определенного владельца в определенной группе и домене:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_iface_list.xsd">
    <request domain="biysk.local" owner="sip1" group="ssw.gr"/>
</in>
XML

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_iface_list.xsd">
    <ifaces>
        <iface id="bsk1" name="bsk1" owner="sip1" group="ssw.gr" type="sip" active="true"/>
        <iface id="bsk2" name="bsk2" owner="sip1" group="ssw.gr" type="sip" active="true"/>
        <iface id="ems1" name="ems1" owner="sip1" group="ssw.gr" type="sip" active="true"/>
        <iface id="ems2" name="ems2" owner="sip1" group="ssw.gr" type="sip" active="true"/>
    </ifaces>
</out>
XML

Hc_iface_info

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

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

/cluster/storage/<CLUSTER>/iface/info

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

POST

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

http://host:port/commands/iface_info

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

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<!-- propertyTypeType-->
	<xs:simpleType name="propertyTypeType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="global"/>
			<xs:enumeration value="owner"/>
			<xs:enumeration value="group"/>
			<xs:enumeration value="group_owner"/>
			<xs:enumeration value="iface"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- propertyType-->
	<xs:complexType name="propertyType">
		<xs:attribute name="type" type="propertyTypeType" use="required"/>
		<xs:attribute name="key" type="xs:string" use="required"/>
		<xs:attribute name="value" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- ifaceRequestType-->
	<xs:complexType name="ifaceRequestType">
		<xs:attribute name="id" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- requestType -->
	<xs:complexType name="requestType">
		<xs:sequence>
			<xs:element name="iface" type="ifaceRequestType" minOccurs="1" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="domain" type="xs:string" use="required"/>
		<xs:attribute name="property" type="xs:string" use="optional"/>
	</xs:complexType>
	<!-- ifaceResponseType-->
	<xs:complexType name="ifaceResponseType">
		<xs:all>
				<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="iface" type="xs:string" use="required"/>
		<xs:attribute name="name" type="xs:string" use="required"/>
		<xs:attribute name="owner" type="xs:string" use="required"/>
		<xs:attribute name="group" type="xs:string" use="required"/>
		<xs:attribute name="active" type="xs:boolean" use="required"/>
	</xs:complexType>
	<!-- noIfaceType-->
	<xs:complexType name="noIfaceType">
		<xs:attribute name="iface" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- in-->
	<xs:element name="in">
		<xs:complexType>
			<xs:all>
				<xs:element name="request" type="requestType"/>
			</xs:all>
		</xs:complexType>
	</xs:element>
	<!-- out-->
	<xs:element name="out">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="iface" type="ifaceResponseType" minOccurs="0" maxOccurs="unbounded"/>
				<xs:element name="noIface" type="noIfaceType" minOccurs="0" maxOccurs="unbounded"/>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>
XML

Пример запроса информации о существующем интерфейсе:

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_iface_info.xsd">
    <request domain="biysk.local">
        <iface id="56089554a52e2f44" />
    </request>
</in>
XML

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_iface_info.xsd">
    <iface iface="smg-4" name="smg-4" owner="sip1" group="smg.gr" active="true">
        <properties>
            <property type="iface" key="media-profile" value="{media_profile,"default",user, [{media_profile_codecs,'<other>', [{media_profile_codec,<<"<other>">>,<<"*">>,true,#{}}], #{offroad => false,'rtcp-enabled' => true}}, {media_profile_codecs,audio, [{media_profile_codec,<<"G722">>,<<"*">>,true,#{}}, {media_profile_codec,<<"PCMA">>,<<"*">>,true,#{}}, {media_profile_codec,<<"PCMU">>,<<"*">>,true,#{}}, {media_profile_codec,<<"G729">>,<<"*">>,true,#{}}, {media_profile_codec,<<"telephone-event">>,<<"*">>,true,#{}}], #{offroad => false,'rtcp-enabled' => true}}], #{}}"/>
            <property type="iface" key="options_control" value="32000"/>
            <property type="iface" key="sipdomain" value="use_address"/>
            <property type="iface" key="stat\rejected\out" value="0"/>
            <property type="iface" key="stat\rejected\in" value="0"/>
            <property type="iface" key="stat\cps_max\total" value="5"/>
            <property type="iface" key="stat\cps_max\out" value="2"/>
            <property type="iface" key="stat\cps_max\in" value="5"/>
            <property type="iface" key="stat\out" value="160"/>
            <property type="iface" key="stat\in" value="5734"/>
            <property type="iface" key="ignore" value="none"/>
            <property type="iface" key="bandwidth\total" value="256"/>
            <property type="iface" key="adapter\version" value=""3.14.0.702""/>
            <property type="iface" key="user_name" value=""smg-4""/>
            <property type="iface" key="trunk" value=""biysk.local.smg.gr.trunk.autoname""/>
            <property type="iface" key="subtype" value="trunk"/>
            <property type="iface" key="routing.context" value="ctx_from_ewsd"/>
            <property type="iface" key="req100rel" value="true"/>
            <property type="iface" key="remote_network_type" value="local"/>
            <property type="iface" key="remote_client" value="default"/>
            <property type="iface" key="port" value="5061"/>
            <property type="iface" key="network_interface" value=""ipset1""/>
            <property type="iface" key="my_from" value=""test.ssw.domain""/>
            <property type="iface" key="mode" value="sipt"/>
            <property type="iface" key="listen_port" value="5061"/>
            <property type="iface" key="ip_set" value=""ipset1""/>
            <property type="iface" key="ip" value=""192.168.2.8""/>
            <property type="iface" key="dynamic" value="false"/>
            <property type="iface" key="declaration" value="{"admin",{1568,121155,720123}}"/>
            <property type="iface" key="cdpn_transformation" value="none"/>
            <property type="iface" key="cause_location" value="default"/>
            <property type="iface" key="profile" value="undefined"/>
            <property type="iface" key="type" value="sip"/>
            <property type="iface" key="id" value="<<"smg-4">>"/>
            <property type="group" key="gate" value="{gate_amqp,<<"acp.adapter.init.ex">>,<<"acp.sip.sip1.ipset1.init.rk">>}"/>
            <property type="group" key="domain" value=""biysk.local""/>
            <property type="global" key="zone" value="<<"default">>"/>
            <property type="global" key="terminal_type" value="smart"/>
            <property type="global" key="site" value="<<"local">>"/>
            <property type="global" key="dtmf_source" value="'rfc+info'"/>
        </properties>
    </iface>
</out>
CODE

Пример запроса информации о несуществующем интерфейсе:

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

<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_iface_info.xsd">
    <request domain="biysk.local">
        <iface id="bla-bla" />
    </request>
</in>
XML

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_iface_info.xsd">
    <noIface iface="bla-bla"/>
</out>
XML

Hc_iface_user_set

Команда по установке свойств интерфейса.

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

domain/<DOMAIN>/iface/user-set

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

POST

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

http://host:port/commands/iface_user_set

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" id="iface_user_set">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Set ECSS iface(s) resources properties.
            Copyright (c) 2015, Eltex. All rights reserved.
        </xs:documentation>
    </xs:annotation>

    <!-- terminalTypeType-->
    <xs:simpleType name="terminalTypeType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="basic"/>
            <xs:enumeration value="smart"/>
        </xs:restriction>
    </xs:simpleType>

    <!-- dtmfSourceType-->
    <xs:simpleType name="dtmfSourceType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="info"/>
            <xs:enumeration value="rfc"/>
            <xs:enumeration value="rfc+info"/>
        </xs:restriction>
    </xs:simpleType>

    <!-- terminalTypeType-->
    <xs:simpleType name="supportEncodingType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="utf8"/>
            <xs:enumeration value="latin1"/>
            <xs:enumeration value="cp1251"/>
        </xs:restriction>
    </xs:simpleType>

    <!-- cfcSupportType-->
    <xs:simpleType name="cfcSupportType">
        <xs:restriction base="xs:string">
            <xs:enumeration value="true"/>
            <xs:enumeration value="false"/>
        </xs:restriction>
    </xs:simpleType>

</xs:schema>
XML

iface_user_set.xsd


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" id="iface_user_set">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Set ECSS iface(s) resources properties.
            Copyright (c) 2015, Eltex. All rights reserved.
        </xs:documentation>
    </xs:annotation>

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

    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:attribute name="domain" type="xs:token" use="required"/>
                        <xs:attribute name="owner" type="xs:token" use="optional"/>
                        <xs:attribute name="group" type="xs:token" use="optional"/>
                        <xs:attribute name="ifaces" type="xs:normalizedString" use="required"/>
                        <xs:attribute name="routing_context" type="xs:string" use="optional"/>
                        <xs:attribute name="modificator" type="xs:string" use="optional"/>
                        <xs:attribute name="site" type="xs:string" use="optional"/>
                        <xs:attribute name="zone" type="xs:string" use="optional"/>
                        <xs:attribute name="terminal_type" type="terminalTypeType" use="optional"/>
                        <xs:attribute name="dtmf_source" type="dtmfSourceType" use="optional"/>
                        <xs:attribute name="support_encoding" type="supportEncodingType" use="optional"/>
                        <xs:attribute name="cfc_support" type="cfcSupportType" use="optional"/>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- in -->

    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="response">
                    <xs:complexType>
                        <xs:attribute name="status" type="xs:token"/>
                    </xs:complexType>
                </xs:element>
                <xs:element name="error" type="errorType" minOccurs="1" maxOccurs="1" />
            </xs:choice>
        </xs:complexType>
    </xs:element>
    <!-- out -->

</xs:schema>
CODE

Пример запроса конкретного свойства:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_iface_info.xsd">
    <request domain="biysk.local" property="cfc_support">
      <iface id="ems1"/>
    </request>
</in>
XML

Ответ: 200

status: 200
content: 
<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_iface_info.xsd">
    <iface iface="ems1" name="ems1" owner="" group="" active="false">
        <properties>
            <property type="global" key="cfc-support" value="true"/>
        </properties>
    </iface>
</out>
XML

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="iface_user_set.xsd">
    <request domain="biysk.local" ifaces="064bc964f1c1f424" routing_context="default_context"/>
</in>
XML

Ответ: 200

 
<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="iface_user_set.xsd">
    <response status="ok"/>
</out>
XML

Hc_iface_safe_user_set

Команда по установке основных свойств интерфейса.

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

domain/<DOMAIN>/iface/user-set

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

POST

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

http://host:port/commands/iface_safe_user_set

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

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

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

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    xmlns:xs="http://www.w3.org/2001/XMLSchema" id="iface_user_set">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Set ECSS iface(s) resources properties.
            Copyright (c) 2015, Eltex. All rights reserved.
        </xs:documentation>
    </xs:annotation>
    <xs:include schemaLocation="error.xsd" />
    <xs:include schemaLocation="iface_user_set_common.xsd" />
    <!-- in -->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:attribute name="domain" type="xs:token" use="required"/>
                        <xs:attribute name="owner" type="xs:token" use="optional"/>
                        <xs:attribute name="group" type="xs:token" use="optional"/>
                        <xs:attribute name="ifaces" type="xs:normalizedString" use="required"/>
                        <xs:attribute name="call_record" type="xs:boolean" use="optional"/>
                        <xs:attribute name="support_encoding" type="supportEncodingType" use="optional"/>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- in -->
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="response">
                    <xs:complexType>
                        <xs:attribute name="status" type="xs:token"/>
                    </xs:complexType>
                </xs:element>
                <xs:element name="error" type="errorType" minOccurs="1" maxOccurs="1" />
            </xs:choice>
        </xs:complexType>
    </xs:element>
    <!-- out -->
</xs:schema>
CODE

Пример:

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="iface_safe_user_set.xsd">
    <request domain="biysk.local" ifaces="06201d997ba16772" call_record="true"/>
</in>
CODE

Ответ: 200

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