Hc_cn_options_clean

Команда сброса настроек службы CN.

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

/cluster/core/<CORE>/cn/clean

/domain/<DOMAIN>/cn/clean

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

POST

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

http://host:port/commands/cn_options_clean

Код 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">
    <xs:annotation>
        <xs:documentation xml:lang="en">
      Clean properties of call notifier service.
      Usage: http://server:9999/commands/cn_options_clean.
      Implementation: hc_cn_options_clean.erl.
      Git: git@git.eltex.loc:httpTerminal.git.
      Copyright (c) 2015, Eltex. All rights reserved.
    </xs:documentation>
    </xs:annotation>
    <xs:include schemaLocation="error.xsd"/>
    <xs:include schemaLocation="ecm_common.xsd"/>
    <!-- resultType-->
    <xs:complexType name="resultType">
        <xs:all>
            <xs:element name="domain_options" type="domainCleanOutType" minOccurs="1"/>
        </xs:all>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:all>
                            <xs:element name="domain_options" type="domainCleanInType"/>
                        </xs:all>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </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/cn_options_clean

<?xml version="1.0"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_cn_options_clean.xsd">
    <request>
        <domain_options>
            <system />
            <domain name="biysk.local">
                <option name="jabber_release_template"/>
                <option name="email_release_template"/>
                <option name="release_call"/>
            </domain>
        </domain_options>
    </request>
</in>
CODE

Код ответа:

200

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_cn_options_clean.xsd">
    <result>
        <domain_options>
            <system/>
            <domain name="biysk.local">
                <success option="email_release_template"/>
                <success option="jabber_release_template"/>
                <success option="release_call"/>
            </domain>
        </domain_options>
    </result>
</out>
CODE

Hc_cn_options_info

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

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

/cluster/core/<CORE>/cn/info

/domain/<DOMAIN>/cn/info

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

POST

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

http://host:port/commands/cn_options_info

Код 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">
  <xs:annotation>
    <xs:documentation xml:lang="en">
      Show properties of call notifier service.
      Usage: http://server:9999/commands/cn_options_info.
      Implementation: hc_cn_options_info.erl.
      Git: git@git.eltex.loc:httpTerminal.git.
      Copyright (c) 2015, Eltex. All rights reserved.
    </xs:documentation>
  </xs:annotation>

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

          
    <xs:complexType name="cnOptionsType">
        <xs:complexContent>
            <xs:extension base="baseOptionsType">
                <xs:attribute name="jabber_incoming_template" type="xs:string" use="optional"/>
                <xs:attribute name="jabber_release_template" type="xs:string" use="optional"/>
                <xs:attribute name="jabber_incoming_plain_template" type="xs:string" use="optional"/>
                <xs:attribute name="jabber_release_plain_template" type="xs:string" use="optional"/>
                <xs:attribute name="release_call" type="booleanType" use="optional"/>
                <xs:attribute name="email_release_template" type="xs:string" use="optional"/>
                <xs:attribute name="incoming_call" type="booleanType" use="optional"/>
                <xs:attribute name="email_from_name" type="xs:string" use="optional"/>
                <xs:attribute name="email_subject_format" type="xs:string" use="optional"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <!-- resultType-->
    <xs:complexType name="resultType">
      <xs:all>
        <xs:element name="domain_options" type="domainInfoOutType" minOccurs="1"/>
      </xs:all>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
      <xs:complexType>
        <xs:sequence>
          <xs:element name="request">
        <xs:complexType>
          <xs:all>
            <xs:element name="domain_options" type="domainInfoInType" minOccurs="1"/>
          </xs:all>
        </xs:complexType>
          </xs:element>
        </xs:sequence>
      </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/cn_options_info

<?xml version="1.0"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_cn_options_info.xsd">
    <request>
        <domain_options domain="biysk.local"/>
    </request>
</in>
CODE

Код ответа:

200

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_cn_options_info.xsd">
    <result>
        <domain_options>
            <system>
                <options xs:type="cnOptionsType"/>
            </system>
            <domain name="biysk.local">
                <options xs:type="cnOptionsType" release_call="false" jabber_release_template="%DISPLAYNAME% (<a href='%LINK_CALL_TO%=%CALLERID%'>%CALLERID%</a>) called you (%CALLED%) at %TIME% %DATE%" jabber_release_plain_template="%DISPLAYNAME% (%CALLERID% - call back %LINK_CALL_TO%=%CALLERID% ) called you (%CALLED%) at %TIME% %DATE%" jabber_incoming_template="%DISPLAYNAME% (<a href='%LINK_CALL_TO%=%CALLERID%'>%CALLERID%</a>) calling you (%CALLED%) at %TIME% %DATE%" jabber_incoming_plain_template="%DISPLAYNAME% (%CALLERID% - call back %LINK_CALL_TO%=%CALLERID% ) calling you (%CALLED%) at %TIME% %DATE%" incoming_call="true" email_subject_format="%DISPLAYNAME% (%CALLERID%) called you (%CALLED%) at %TIME% %DATE%" email_release_template="%DISPLAYNAME% (%CALLERID% - call back %LINK_CALL_TO%=%CALLERID% ) called you (%CALLED%) at %TIME% %DATE%" email_from_name="ECSS-NO-REPLY"/>
            </domain>
        </domain_options>
    </result>
</out>
CODE

Hc_cn_options_set

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

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

/cluster/core/<CORE>/cn/set

/domain/<DOMAIN>/cn/set

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

POST

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

http://host:port/commands/cn_options_set

Код 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">
    <xs:annotation>
        <xs:documentation xml:lang="en">
            Set call notifier service properties
            Usage: http://server:9999/commands/cn_options_set.
            Implementation: hc_cn_options_set.erl.
            Git: git@git.eltex.loc:httpTerminal.git.
            Copyright (c) 2015, Eltex. All rights reserved.
        </xs:documentation>
    </xs:annotation>
    <xs:include schemaLocation="error.xsd"/>
    <xs:include schemaLocation="ecm_common.xsd"/>

    <xs:complexType name="cnOptionsType">
        <xs:complexContent>
            <xs:extension base="baseOptionsType">
                <xs:attribute name="jabber_incoming_template" type="xs:string" use="optional"/>
                <xs:attribute name="jabber_release_template" type="xs:string" use="optional"/>
                <xs:attribute name="jabber_incoming_plain_template" type="xs:string" use="optional"/>
                <xs:attribute name="jabber_release_plain_template" type="xs:string" use="optional"/>
                <xs:attribute name="release_call" type="booleanType" use="optional"/>
                <xs:attribute name="email_release_template" type="xs:string" use="optional"/>
                <xs:attribute name="incoming_call" type="booleanType" use="optional"/>
                <xs:attribute name="email_from_name" type="xs:string" use="optional"/>
                <xs:attribute name="email_subject_format" type="xs:string" use="optional"/>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    <!-- resultType-->
    <xs:complexType name="resultType">
        <xs:all>
            <xs:element name="domain_options" type="domainSetOutType" minOccurs="1"/>
        </xs:all>
    </xs:complexType>
    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:all>
                            <xs:element name="domain_options" type="domainSetInType"/>
                        </xs:all>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
    <!-- out -->
    <xs:element name="out">
        <xs:complexType>
            <xs:choice>
                <xs:element name="result" type="resultType" minOccurs="1" maxOccurs="1"/>
                <xs:element name="error" type="errorType" minOccurs="1" maxOccurs="1"/>
            </xs:choice>
        </xs:complexType>
    </xs:element>
</xs:schema>

CODE

Пример:

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

<?xml version="1.0"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_cn_options_set.xsd">
    <request>
        <domain_options>
            <system>
                <options xs:type="cnOptionsType"/>
            </system>
            <domain name="biysk.local">
                <options xs:type="cnOptionsType" incoming_call="true" release_call="false"/>
            </domain>
        </domain_options>
    </request>
</in>
CODE

Код ответа:

200

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_cn_options_set.xsd">
    <result>
        <domain_options>
            <system/>
            <domain name="biysk.local">
                <success option="incoming_call"/>
                <success option="release_call"/>
            </domain>
        </domain_options>
    </result>
</out>
CODE