В данном разделе описаны команды для управления кампаниями дозвона.

Hc_dialer_campaign_declare

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

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

/domain/<DOMAIN>/ss/dialer/declare

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

POST

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

http://host:port/commands/dialer_campaign_declare

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

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

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

XSD-схема dialer_common.xsd:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

    <xs:complexType name="numbersType">
        <xs:sequence>
            <xs:element name="number" type="numberType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="propertyDesctiptionsType">
        <xs:sequence>
            <xs:element name="property" type="propertyDesctiptionType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="scriptsType">
        <xs:sequence>
            <xs:element name="script" type="scriptType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="operatorNumbersType">
        <xs:sequence>
            <xs:element name="number" type="operatorNumberType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="scriptType">
        <xs:sequence>
            <xs:element name="block" type="blockType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="id" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:complexType name="blockType">
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="output" type="xs:string" use="required"/>
        <xs:attribute name="result" type="xs:string"/>
    </xs:complexType>

    <xs:complexType name="numberType">
        <xs:sequence>
            <xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="digits" type="xs:string"/>
    </xs:complexType>

    <xs:complexType name="operatorNumberType">
        <xs:attribute name="digits" type="xs:string"/>
    </xs:complexType>

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

    <xs:complexType name="propertyDesctiptionType">
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="data_name" type="xs:string"/>
        <xs:attribute name="report_name" type="xs:string"/>
    </xs:complexType>
</xs:schema>
CODE

XSD-схема hc_dialer_campaign_declare.xsd:

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:include schemaLocation="dialer_common.xsd"/>
    <!-- campaignType -->
    <xs:complexType name="campaignType">
        <xs:sequence>
            <xs:element name="numbers" type="numbersType" minOccurs="0"/>
            <xs:element name="operator_numbers" type="operatorNumbersType" minOccurs="0"/>
            <xs:element name="property_descriptions" type="propertyDesctiptionsType" minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="template" type="xs:string" use="required"/>
        <xs:attribute name="call_success_by_variable" type="xs:string"/>
        <xs:attribute name="start_type" type="xs:string" use="required"/>
        <xs:attribute name="lines_limit" type="xs:nonNegativeInteger"/>
        <xs:attribute name="calls_limit" type="xs:nonNegativeInteger"/>
        <xs:attribute name="recall_timeout" type="xs:nonNegativeInteger"/>
        <xs:attribute name="no_answer_timeout" type="xs:nonNegativeInteger"/>
        <xs:attribute name="priority" type="xs:nonNegativeInteger"/>
        <xs:attribute name="save_all_attempts" type="xs:boolean"/>
        <xs:attribute name="time_interval" type="xs:string"/>
        <xs:attribute name="min_duration" type="xs:nonNegativeInteger"/>
        <xs:attribute name="group" type="xs:string"/>
        <xs:attribute name="shuffle" type="xs:boolean"/>
    </xs:complexType>

    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:all>
                            <xs:element name="campaign" type="campaignType"/>
                        </xs:all>
                        <xs:attribute name="domain" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <!-- out-->
    <xs:complexType name="responseType">
        <xs:attribute name="campaign_id" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="response" type="responseType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>

XML

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

<?xml version="1.0"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_dialer_campaign_declare.xsd">
    <request domain="biysk.local">
        <campaign name="info1" template="info4lab" start_type="now" lines_limit="2" calls_limit="2" recall_timeout="60" time_interval="09:00-18:00" min_duration="5" shuffle="true"/>
    </request>
</in>
XML

Ответ: 200

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

Hc_dialer_campaign_info

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

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

/domain/<DOMAIN>/ss/dialer/info

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

POST

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

http://host:port/commands/dialer_campaign_info

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

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

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

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

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:include schemaLocation="dialer_common.xsd"/>
    <!-- campaignType -->
    <xs:complexType name="campaignType">
        <xs:sequence>
            <xs:element name="call" type="callType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="campaign_id" type="xs:string"/>
        <xs:attribute name="name" type="xs:string"/>
        <xs:attribute name="lines_limit" type="xs:nonNegativeInteger"/>
        <xs:attribute name="calls_limit" type="xs:nonNegativeInteger"/>
        <xs:attribute name="recall_timeout" type="xs:nonNegativeInteger"/>
        <xs:attribute name="time_interval" type="xs:string"/>
        <xs:attribute name="min_duration" type="xs:nonNegativeInteger"/>
        <xs:attribute name="start_time" type="xs:string"/>
        <xs:attribute name="update_time" type="xs:string"/>
        <xs:attribute name="status" type="xs:string"/>
        <xs:attribute name="properties" type="xs:string"/>
    </xs:complexType>
    <xs:complexType name="callType">
        <xs:attribute name="number" type="xs:string"/>
        <xs:attribute name="start_time" type="xs:string"/>
        <xs:attribute name="answer_time" type="xs:string"/>
        <xs:attribute name="release_time" type="xs:string"/>
        <xs:attribute name="retry_number" type="xs:string"/>
        <xs:attribute name="status" type="xs:string"/>
        <xs:attribute name="result" type="xs:string"/>
        <xs:attribute name="ivr_variables" type="xs:string" use="optional"/>
    </xs:complexType>
    <!-- campaignsType -->
    <xs:complexType name="campaignsType">
        <xs:sequence>
            <xs:element name="campaign" type="campaignType" 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="campaign_id" type="xs:nonNegativeInteger" use="required"/>
                        <xs:attribute name="active" type="xs:boolean" default="false"/>
                        <xs:attribute name="limit" type="xs:nonNegativeInteger" default="50"/>
                        <xs:attribute name="offset" type="xs:nonNegativeInteger" default="0"/>
                        <xs:attribute name="show_options" type="xs:boolean" default="false"/>
                        <xs:attribute name="show_ivr_variables" type="xs:boolean" default="false"/>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
    <!-- out-->
    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="campaign" type="campaignType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>
XML

Запрос:

http://192.168.1.21:9999/commands/dialer_campaign_info

<?xml version="1.0"?>
<in
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_dialer_campaign_info.xsd">
    <request domain="biysk.local" campaign_id="2" limit="5"/>
</in>
XML

Ответ:

<?xml version="1.0"?>
<out
	xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_dialer_campaign_info.xsd">
	<campaign>
		<call number="240510" start_time="11.09.2019 05:57:54" answer_time="11.09.2019 05:57:56" release_time="11.09.2019 05:58:30" retry_number="1" status="success" result=""/>
		<call number="240511" start_time="11.09.2019 05:57:54" answer_time="11.09.2019 05:57:56" release_time="11.09.2019 05:58:31" retry_number="1" status="success" result=""/>
		<call number="416370" start_time="11.09.2019 05:58:30" answer_time="11.09.2019 05:58:33" release_time="11.09.2019 05:59:04" retry_number="1" status="success" result=""/>
		<call number="416977" start_time="11.09.2019 05:58:31" answer_time="11.09.2019 05:58:42" release_time="11.09.2019 05:58:54" retry_number="1" status="success" result=""/>
	</campaign>
</out>
CODE

Hc_dialer_campaign_action

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

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

/domain/<DOMAIN>/ss/dialer/<remove|stop|pause|unpause>

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

POST

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

http://host:port/commands/dialer_campaign_action

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

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

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

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

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <!-- actionType -->
    <xs:complexType name="actionType">
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="campaign_id" type="xs:nonNegativeInteger"/>
    </xs:complexType>

    <!-- in-->
    <xs:element name="in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request">
                    <xs:complexType>
                        <xs:all>
                            <xs:element name="action" type="actionType"/>
                        </xs:all>
                        <xs:attribute name="domain" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <!-- out-->
    <xs:complexType name="responseType">
        <xs:attribute name="result" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="response" type="responseType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>
XML

Примеры

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

Запрос (pause):

<?xml version="1.0"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_dialer_campaign_action.xsd">
    <request domain="biysk.local">
        <action name="pause" campaign_id="5"/>
    </request>
</in>
XML

Запрос (unpause):

<?xml version="1.0"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_dialer_campaign_action.xsd">
    <request domain="biysk.local">
        <action name="unpause" campaign_id="7"/>
    </request>
</in>
XML

Запрос (stop):

<?xml version="1.0"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_dialer_campaign_action.xsd">
    <request domain="biysk.local">
        <action name="stop" campaign_id="6"/>
    </request>
</in>
XML

Запрос (remove):

<?xml version="1.0"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_dialer_campaign_action.xsd">
    <request domain="biysk.local">
        <action name="remove" campaign_id="5"/>
    </request>
</in>
XML

Ответ (pause):

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

Ответ (unpause):

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

Ответ (stop):

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

Ответ (remove):

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

Hc_dialer_campaign_list

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

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

/domain/<DOMAIN>/ss/dialer/list

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

POST

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

http://host:port/commands/dialer_campaign_list

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

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

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

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

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <xs:include schemaLocation="dialer_common.xsd"/>
    <!-- campaignType -->
    <xs:complexType name="campaignType">
        <xs:attribute name="campaign_id" type="xs:string" use="required"/>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="lines_limit" type="xs:string" use="required"/>
        <xs:attribute name="calls_limit" type="xs:string" use="required"/>
        <xs:attribute name="recall_timeout" type="xs:string" use="required"/>
        <xs:attribute name="time_interval" type="xs:string" use="required"/>
        <xs:attribute name="min_duration" type="xs:string" use="required"/>
        <xs:attribute name="start_time" type="xs:string" use="required"/>
        <xs:attribute name="update_time" type="xs:string" use="required"/>
        <xs:attribute name="status" type="xs:string" use="required"/>
        <xs:attribute name="dialed_numbers" type="xs:string" use="optional"/>
        <xs:attribute name="total_numbers" type="xs:string" use="optional"/>
        <xs:attribute name="percent_complete" type="xs:string" use="optional"/>
    </xs:complexType>
    <!-- campaignsType -->
    <xs:complexType name="campaignsType">
        <xs:sequence>
            <xs:element name="campaign" type="campaignType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="requestType">
        <xs:sequence>
            <xs:element name="filter" type="filterType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="domain" type="xs:string" use="required"/>
    </xs:complexType>
    <xs:complexType name="valueType">
        <xs:attribute name="operator" type="xs:string" use="required"/>
        <xs:attribute name="value" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:complexType name="filterType">
        <xs:sequence>
            <xs:element name="property" type="valueType" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="property" type="xs:string" use="required"/>
        <xs:attribute name="delim" 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:all>
                <xs:element name="result" type="campaignsType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>
XML

Запрос:

http://192.168.1.21:9999/commands/dialer_campaign_list

<?xml version="1.0"?>
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_dialer_campaign_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_dialer_campaign_list.xsd">
	<result>
		<campaign campaign_id="1" name="dialer_test_2019_09_11_12_54_15" lines_limit="2" calls_limit="1" recall_timeout="60" time_interval="09:00-18:00" min_duration="5" start_time="11.09.2019 05:54:29" update_time="11.09.2019 05:54:47" status="finished" dialed_numbers="4" total_numbers="4" percent_complete="100.00"/>
		<campaign campaign_id="2" name="dialer_test_2019_09_11_12_57_49" lines_limit="2" calls_limit="1" recall_timeout="60" time_interval="09:00-18:00" min_duration="5" start_time="11.09.2019 05:57:54" update_time="11.09.2019 05:59:05" status="finished" dialed_numbers="4" total_numbers="4" percent_complete="100.00"/>
	</result>
</out>
XML

Hc_dialer_campaign_start

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

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

/domain/<DOMAIN>/ss/dialer/start

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

POST

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

http://host:port/commands/dialer_campaign_start

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

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

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

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

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
    <!-- actionType -->
    <xs:complexType name="startType">
        <xs:attribute name="campaign_id" type="xs:nonNegativeInteger" use="required"/>
        <xs:attribute name="start_type" 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="start" type="startType"/>
                        </xs:all>
                        <xs:attribute name="domain" type="xs:string" use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>

    <!-- out-->
    <xs:complexType name="responseType">
        <xs:attribute name="campaign_id" type="xs:string" use="required"/>
    </xs:complexType>

    <xs:element name="out">
        <xs:complexType>
            <xs:all>
                <xs:element name="response" type="responseType"/>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>
XML

Примеры

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

Запрос (start_type=now):

<?xml version="1.0"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_dialer_campaign_start.xsd">
    <request domain="biysk.local">
        <start campaign_id="1" start_type="now"/>
    </request>
</in>
XML

Запрос (start_type=manual):

<?xml version="1.0"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_dialer_campaign_start.xsd">
    <request domain="biysk.local">
        <start campaign_id="2" start_type="manual"/>
    </request>
</in>
XML

Запрос (start_type=datetime):

<?xml version="1.0"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_dialer_campaign_start.xsd">
    <request domain="biysk.local">
        <start campaign_id="2" start_type="17.11.2019 21:31:10"/>
    </request>
</in>
XML

Ответ:

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