Hс_queue_add_agent

Команда предназначена для добавления агентов в выбранную очередь call-центра.

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

domain/<DOMAIN>/cc/queue/<QUEUE>/add-agent

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

POST

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

http://host:port/commands/queue_add_agent

Код 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:include schemaLocation="hc_queue_common.xsd"/>
  <xs:include schemaLocation="error.xsd"/>
  <!--errorReasonType-->
  <xs:simpleType name="warningReasonType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="already_added"/>
      <xs:enumeration value="not_exists"/>
    </xs:restriction>
  </xs:simpleType>
  <!--errorsType-->
  <xs:complexType name="warningsType">
    <xs:sequence>
      <xs:element name="warning" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
          <xs:attribute name="agent" type="xs:string"/>
          <xs:attribute name="reason" type="warningReasonType"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <!--in-->
  <xs:element name ="in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="agents" type="agentsType"/>
            </xs:sequence>
            <xs:attribute name="domain" use="required"/>
            <xs:attribute name="queue" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!--out-->
  <xs:element name="out">
    <xs:complexType>
      <xs:choice>
        <xs:element name="response">
          <xs:complexType>
            <xs:choice>
              <!--all agents was added-->
              <xs:element name="ok">
                <xs:complexType/>
              </xs:element>
              <!--not very bad. command works fine but some agents not added:-->
              <xs:element name="warnings" type="warningsType"/>
            </xs:choice>
          </xs:complexType>
        </xs:element>
        <!--bad. command failed:-->
        <xs:element name="error" type="errorType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>

CODE

Пример

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_queue_add_agent.xsd">
    <request domain="biysk.local" queue="qltp3">
        <agents>
            <agent name = "521"/>
            <agent name = "522"/>
            <agent name = "523"/>
            <agent name = "524"/>
            <agent name = "525"/>
        </agents>
    </request>
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
	xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_queue_add_agent.xsd">
	<response>
		<warnings>
			<warning agent="525" reason="already_added"/>
		</warnings>
	</response>
</out>
CODE

Ответ на тот же самый запрос, если агент с именем "529" не существует в контакт-центре:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_queue_add_agent.xsd">
    <response>
        <warnings>
            <warning agent="529" reason="not_exists"/>
        </warnings>
    </response>
</out>
CODE

Hс_queue_clean

Очистить указанные свойства очереди виртуального call-центра.

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

domain/<DOMAIN>/cc/queue/<QUEUE>/clean

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

POST

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

http://host:port/commands/queue_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:include schemaLocation="hc_queue_common.xsd"/>
  <xs:include schemaLocation="error.xsd"/>

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

  <xs:element name = "in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request">
          <xs:complexType>
            <xs:sequence>
              <!--request body-->
              <xs:element name="queue">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="property" type="propertyNameType" maxOccurs="unbounded"/>
                  </xs:sequence>
                  <!--queue name-->
                  <xs:attribute name="name" use="required"/>
                </xs:complexType>
              </xs:element>
              <!--end-->
            </xs:sequence>
            <!--request attributes-->
            <xs:attribute name="domain" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name = "out">
    <xs:complexType>
      <xs:choice>
        <!--Positive case-->
        <xs:element name="response">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ok"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <!--Or error-->
        <xs:element name="error" type="errorType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
CODE

Пример 1

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

<?xml version="1.0" encoding="UTF-8"?>
<in>
  <request domain="biysk.local">
    <queue name="qltp3">
      <property name="description"/>
      <property name="max_wait_time"/>
      <property name="some\custom\property"/>
    </queue>
  </request>
</in>
CODE

Ответ:

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

Пример 2

Ответ (434) на предыдущий запрос если нет такой очереди:

<?xml version="1.0" encoding="UTF-8"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_queue_clean.xsd">
    <error cmd="queue_clean" reason="nocommand" body="Command not found by path /domain/biysk.local/cc/queue/qltp4/clean."/>
</out>
CODE

Hс_queue_configuration

Команда позволяет выбрать свойства очереди указанного сall-центра из БД.

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

domain/<DOMAIN>/cc/queue/configuration <QUEUE>

domain/<DOMAIN>/cc/queue/<QUEUE>/configuration

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

POST

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

http://host:port/commands/queue_configuration

Код 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:include schemaLocation="hc_queue_common.xsd"/>

  <!--configurationsType-->
  <xs:complexType name="configurationsType">
    <xs:sequence>
      <xs:element name="queue" type="queueType" 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>
              <!--request body-->
              <xs:element name="queue" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="name" type="xs:string" use="required"/>
                </xs:complexType>
              </xs:element>
              <!--end-->
            </xs:sequence>
            <xs:attribute name="domain" type="xs:string" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!--out-->
  <xs:element name = "out">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="response">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="queues" type="configurationsType"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
CODE

Пример
Запрос:

http://192.168.1.21:9999/commands/queue_configuration

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_queue_configuration.xsd">
    <request domain="biysk.local">
        <queue name="line1"/>
        <queue name="line2"/>
        <queue name="qltp3"/>
    </request>
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
	xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_queue_configuration.xsd">
	<response>
		<queues>
			<queue name="line1" ringback_mode="once" distribution_mode="random" max_wait_time="3600" description="" skill_based_distribution="false" max_distribution_attempts="3" max_distribution_duration="10" window_duration="10" remember_choice="none">
				<groups>
					<group name="ltp1"/>
				</groups>
				<agents>
					<agent name="509"/>
					<agent name="508"/>
					<agent name="507"/>
					<agent name="506"/>
					<agent name="505"/>
					<agent name="504"/>
					<agent name="503"/>
					<agent name="502"/>
					<agent name="501"/>
					<agent name="500"/>
				</agents>
				<properties>
					<property name="time_prediction\statistics\lower_threshold" value="10"/>
					<property name="time_prediction\statistics\upper_threshold" value="1800"/>
					<property name="time_prediction\statistics\max_count" value="100"/>
					<property name="time_prediction\based_on" value="defined_value"/>
					<property name="time_prediction\defined_value" value="60"/>
					<property name="time_prediction\min_values_in_statistics" value="10"/>
				</properties>
			</queue>
			<queue name="line2" ringback_mode="once" distribution_mode="random" max_wait_time="3600" description="" skill_based_distribution="false" max_distribution_attempts="3" max_distribution_duration="10" window_duration="10" remember_choice="none">
				<groups>
					<group name="ltp2"/>
				</groups>
				<agents>
					<agent name="518"/>
					<agent name="517"/>
					<agent name="516"/>
					<agent name="515"/>
					<agent name="514"/>
					<agent name="513"/>
					<agent name="512"/>
					<agent name="511"/>
					<agent name="510"/>
				</agents>
				<properties>
					<property name="time_prediction\statistics\lower_threshold" value="10"/>
					<property name="time_prediction\statistics\upper_threshold" value="1800"/>
					<property name="time_prediction\statistics\max_count" value="100"/>
					<property name="time_prediction\based_on" value="defined_value"/>
					<property name="time_prediction\defined_value" value="60"/>
					<property name="time_prediction\min_values_in_statistics" value="10"/>
				</properties>
			</queue>
			<queue name="qltp3" queue_length="6" ringback_mode="once" distribution_mode="random" max_wait_time="1800" description="my queue" skill_based_distribution="false" max_distribution_attempts="2" max_distribution_duration="20" window_duration="5" remember_choice="none">
				<groups>
					<group name="group1"/>
					<group name="group2"/>
				</groups>
				<agents>
					<agent name="526"/>
					<agent name="525"/>
					<agent name="524"/>
					<agent name="523"/>
					<agent name="522"/>
					<agent name="521"/>
				</agents>
				<properties>
					<property name="time_prediction\statistics\lower_threshold" value="10"/>
					<property name="time_prediction\statistics\upper_threshold" value="1800"/>
					<property name="time_prediction\statistics\max_count" value="100"/>
					<property name="time_prediction\based_on" value="defined_value"/>
					<property name="time_prediction\defined_value" value="60"/>
					<property name="time_prediction\min_values_in_statistics" value="10"/>
					<property name="another\custom\property" value="[another,term]"/>
					<property name="some\custom\property" value="{erlang,term}"/>
				</properties>
			</queue>
		</queues>
	</response>
</out>
CODE

Hс_queue_declare

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

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

domain/<DOMAIN>/cc/queue/declare

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

POST

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

http://host:port/commands/queue_declare

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

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

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

hc_queue_common.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="common_types.xsd"/>
<!--distributionModeType-->
<xs:simpleType name = "distributionModeType">
  <xs:restriction base="xs:string">
    <xs:enumeration value="random"/>
    <xs:enumeration value="loa"/>
    <xs:enumeration value="mia"/>
    <xs:enumeration value="multicall"/>
    <xs:enumeration value="serial"/>
    <xs:enumeration value="cycled"/>
    <xs:enumeration value="progressive"/>
    <xs:enumeration value="manual"/>
  </xs:restriction>
</xs:simpleType>
<!--rememberChoiceType-->
<xs:simpleType name = "rememberChoiceType">
  <xs:restriction base="xs:string">
    <xs:enumeration value="none"/>
    <xs:enumeration value="strict"/>
    <xs:enumeration value="non_strict"/>
  </xs:restriction>
</xs:simpleType>
    <!--ringbackModeType-->
<xs:simpleType name = "ringbackMode">
    <xs:restriction base="xs:string">
        <xs:enumeration value="once"/>
        <xs:enumeration value="none"/>
    </xs:restriction>
</xs:simpleType>
<!--aliasAgentType-->
<xs:complexType name="aliasAgentType">
  <xs:attribute name="number" type="xs:string" use="required"/>
</xs:complexType>
<!--aliasAgentType-->
<xs:complexType name="ccAgentType">
  <xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
<!--groupType-->
<xs:complexType name="groupType">
  <xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
<!--agentsType-->
<xs:complexType name="agentsType">
    <xs:sequence>
      <xs:element name="alias" type="aliasAgentType" minOccurs="0" maxOccurs="unbounded"/>
      <xs:element name="agent" type="ccAgentType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
</xs:complexType>
<!--groupsType-->
<xs:complexType name="groupsType">
    <xs:sequence>
      <xs:element name="group" type="groupType" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
</xs:complexType>
<!--customPropertiesType-->
<xs:complexType name="customPropertiesType">
  <xs:sequence>
    <xs:element name="property" type="propertyType" minOccurs="0" maxOccurs="unbounded">
      <xs:annotation>
        <xs:documentation xml:lang="en">
          Available custom properties:
            time_prediction\statistics\lower_threshold :: Lower threshold of conversation duration in seconds. Values less then lower threshold ignored during prediction. Default is 10 seconds.
            time_prediction\statistics\upper_threshold :: Upper threshold of conversation duration in seconds. Values greater then upper threshold ignored during prediction. Default is 30 minutes.
            time_prediction\statistics\max_count       :: Max values stored in the statistics count. Default is 100.
            time_prediction\based_on                   :: average | most_freq | defined_value. What value to consider during prediction. Default is average.
            average - processed conversation duration average.
            most_freq - most frequently appeared interval of conversation processing duration.
            defined_value - manually specified value of conversation processing duration.
            time_prediction\defined_value              :: Manually defined single conversation processing time in seconds. It used in prediction if it explicitly specified by time_prediction\based_on or if statistic values count less then time_prediction\min_values_in_statistics. Default is 60 seconds.
            time_prediction\min_values_in_statistics   :: Min values count in the statistics to make prediction. If values count less then time_prediction\min_values_in_statistics then queue will use time_prediction\defined_value as estimate value of the single conversation handling duration. Default is 10.
        </xs:documentation>
      </xs:annotation>
    </xs:element>
  </xs:sequence>
</xs:complexType>
<!--queueType-->
<xs:complexType name="queueType">
  <xs:all>
    <xs:element name="agents" type="agentsType" minOccurs="0"/>
    <xs:element name="groups" type="groupsType" minOccurs="0"/>
    <xs:element name="properties" type="customPropertiesType" minOccurs="0"/>
  </xs:all>
  <xs:attribute name="name" type="xs:string" use="required"/>
  <xs:attribute name="distribution_mode" type="distributionModeType" use="optional"/>
  <xs:attribute name="max_wait_time" type="xs:nonNegativeInteger" use="optional"/>
  <xs:attribute name="max_distribution_attempts" type="xs:nonNegativeInteger" use="optional"/>
  <xs:attribute name="max_distribution_duration" type="xs:nonNegativeInteger" use="optional"/>
  <xs:attribute name="ringback_mode" type="ringbackMode" use="optional"/>
  <xs:attribute name="max_predicted_time" type="xs:nonNegativeInteger" use="optional"/>
  <xs:attribute name="window_duration" type="xs:nonNegativeInteger" use="optional"/>
  <xs:attribute name="queue_length" type="xs:nonNegativeInteger" use="optional"/>
  <xs:attribute name="max_active_waiting_callbacks" type="xs:nonNegativeInteger" use="optional"/>
  <xs:attribute name="description" type="xs:string" use="optional"/>
  <xs:attribute name="remember_choice" type="rememberChoiceType" use="optional"/>
  <xs:attribute name="skill_based_distribution" type="xs:boolean" use="optional"/>
  <xs:attribute name="decline_if_no_operators" type="xs:boolean" use="optional"/>
  <xs:attribute name="email" type="xs:string" use="optional"/>
</xs:complexType>

</xs:schema>
CODE

hc_queue_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="hc_queue_common.xsd"/>
  <xs:include schemaLocation="error.xsd"/>

  <xs:element name = "in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request">
          <xs:complexType>
            <xs:all>
              <xs:element name="queue" type="queueType" minOccurs="1" maxOccurs="1"/>
            </xs:all>
            <xs:attribute name="domain" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name="out">
    <xs:complexType>
      <xs:sequence minOccurs="0" maxOccurs="1">
        <xs:element name="error" type="errorType"/>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

CODE

Пример 1

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_queue_declare.xsd">
    <request domain="biysk.local">
        <queue name="qltp3" distribution_mode="random" max_wait_time="1800" max_distribution_attempts="2" max_distribution_duration="20" window_duration="5" queue_length="6" description="my queue" remember_choice="none" skill_based_distribution="false">
            <agents>
                <agent name="525"/>
                <agent name="526"/>
            </agents>
            <groups>
                <group name="group1"/>
                <group name="group2"/>
            </groups>
            <properties>
                <property name="some\\custom\\property" value="{erlang, term}"/>
                <property name="another\\custom\\property" value="[another, term]"/>
            </properties>
        </queue>
    </request>
</in>
CODE

Ответ:

201

Пример 2

Ответ(200) на предыдущий запрос, если такая очередь уже есть в указанном виртуальном call-центре:

<?xml version="1.0" encoding="UTF-8"?>
<out
	xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_queue_declare.xsd">
	<error cmd="hc_queue_declare" reason="already_declared" body="{error,already_declared}" entity="qltp3"/>
</out>
CODE

Hс_queue_list

Команда предназначена для отображения списка очередей выбранного call-центра.

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

domain/<DOMAIN>/cc/queue/list

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

POST

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

http://host:port/commands/queue_list

Код 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:include schemaLocation="hc_queue_common.xsd"/>

  <xs:complexType name = "queuesType">
    <xs:sequence>
      <xs:element name = "queue" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
          <xs:attribute name = "name" type="xs:string" use="required"/>
          <xs:attribute name = "groups" type="xs:string" use="optional"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>

  <xs:element name = "in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request">
          <xs:complexType>
             <xs:attribute name="domain" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name = "out">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="response">
          <xs:complexType>
            <xs:sequence>
              <xs:element name = "queues" type="queuesType"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
CODE

Пример

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

<?xml version="1.0" encoding="UTF-8"?>
<in>
  <request domain="biysk.local"/>
</in>
CODE

Ответ:

<?xml version="1.0"?>
<out
	xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_queue_list.xsd">
	<response>
		<queues>
			<queue name="line1" groups="ltp1"/>
			<queue name="line2" groups="ltp2"/>
			<queue name="line3" groups="ltp3"/>
			<queue name="qltp3" groups="group1,group2"/>
		</queues>
	</response>
</out>
CODE

Hс_queue_remove

Команда предназначена для удаления очереди из выбранного виртуального call-центра.

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

domain/<DOMAIN>/cc/queue/remove

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

POST

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

http://host:port/commands/queue_remove

Код 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:include schemaLocation="hc_queue_common.xsd"/>

  <xs:element name = "in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request">
          <xs:complexType>
            <xs:sequence>
              <!--request body-->
              <xs:element name="queue">
                <xs:complexType>
                  <!--queue name-->
                  <xs:attribute name="name" use="required"/>
                </xs:complexType>
              </xs:element>
              <!--end-->
            </xs:sequence>
            <xs:attribute name="domain" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name = "out">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="response">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ok"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
CODE

Пример

Запрос: http://192.168.1.12:9999/commands/queue_remove

<?xml version="1.0" encoding="UTF-8"?>
<in>
  <request domain="biysk.local">
    <queue name="line3"/>
  </request>
</in>
CODE

Ответ:

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

Hс_queue_remove_agent

Удалить агентов из указанной очереди call-центра.

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

domain/<DOMAIN>/cc/queue/<QUEUE>/remove-agent

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

POST

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

http://host:port/commands/queue_remove_agent

Код 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:include schemaLocation="hc_queue_common.xsd"/>
  <xs:include schemaLocation="error.xsd"/>
  <!--errorReasonType-->
  <xs:simpleType name="warningReasonType">
    <xs:restriction base="xs:string">
      <xs:enumeration value="not_in_queue"/>
    </xs:restriction>
  </xs:simpleType>
  <!--errorsType-->
  <xs:complexType name="warningsType">
    <xs:sequence>
      <xs:element name="warning" minOccurs="0" maxOccurs="unbounded">
        <xs:complexType>
          <xs:attribute name="agent" type="xs:string"/>
          <xs:attribute name="reason" type="warningReasonType"/>
        </xs:complexType>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <!--in-->
  <xs:element name ="in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="agents" type="agentsType"/>
            </xs:sequence>
            <xs:attribute name="domain" use="required"/>
            <xs:attribute name="queue" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <!--out-->
  <xs:element name="out">
    <xs:complexType>
      <xs:choice>
        <xs:element name="response">
          <xs:complexType>
            <xs:choice>
              <!--all agents was removed-->
              <xs:element name="ok">
                <xs:complexType/>
              </xs:element>
              <!--not very bad. command works fine but some agents was not removed:-->
              <xs:element name="warnings" type="warningsType"/>
            </xs:choice>
          </xs:complexType>
        </xs:element>
        <!--bad. command failed:-->
        <xs:element name="error" type="errorType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
CODE

Пример

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

<?xml version="1.0" encoding="UTF-8"?>
<in>
    <request domain="biysk.local" queue="qltp3">
        <agents>
            <agent name = "524"/>
            <agent name = "525"/>
        </agents>
    </request>
</in>
CODE

Ответ:

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

Ответ на предыдущий запрос, если таких агентов нет в очереди:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_queue_remove_agent.xsd">
    <response>
        <warnings>
            <warning agent="525" reason="not_in_queue"/>
            <warning agent="524" reason="not_in_queue"/>
        </warnings>
    </response>
</out>
CODE

Hс_queue_set

Установить свойства очереди виртуального call-центра.

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

domain/<DOMAIN>/cc/queue/<QUEUE>/set

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

POST

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

http://host:port/commands/queue_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:include schemaLocation="hc_queue_common.xsd"/>
  <xs:include schemaLocation="error.xsd"/>

 <xs:element name = "in">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="request">
          <xs:complexType>
            <xs:sequence>
              <!--request body-->
              <xs:element name="queue" type="queueType"/>
              <!--end-->
            </xs:sequence>
            <xs:attribute name="domain" use="required"/>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
  <xs:element name = "out">
    <xs:complexType>
      <xs:choice>
        <!--Positive case-->
        <xs:element name="response">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="ok"/>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <!--Or error-->
        <xs:element name="error" type="errorType"/>
      </xs:choice>
    </xs:complexType>
  </xs:element>
</xs:schema>
CODE

Пример 1

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

<?xml version="1.0" encoding="UTF-8"?>
<in>
    <request domain="biysk.local">
        <queue name="qltp3" distribution_mode="mia" max_wait_time="1801" max_distribution_attempts="3" max_distribution_duration="21" window_duration="15" queue_length="16" description="my queue new" remember_choice="strict" skill_based_distribution="true">
            <agents>
                <alias number="522"/>
                <agent name="524"/>
                <agent name="525"/>
            </agents>
            <groups>
                <group name="group2"/>
                <group name="group3"/>
            </groups>
            <properties>
                <property name="some\\custom\\property" value="{erlang, term1}"/>
                <property name="another\\custom\\property2" value="[another, new, term]"/>
            </properties>
        </queue>
    </request>
</in>
CODE

Ответ:

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

Пример 2

Ответ на предыдущий запрос если нет такой очереди:

<?xml version="1.0" encoding="UTF-8"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_queue_set.xsd">
    <error cmd="queue_set" reason="nocommand" body="Command not found by path /domain/biysk.local/cc/queue/ltp4/set."/>
</out>
CODE