Hс_ivr_script_delete

Команда позволяет удалить IVR-скрипт с определенным именем из определенного домена.

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

domain/<DOMAIN>/ivr/script/delete

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

POST

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

http://host:port/commands/ivr_script_delete

Код 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">
	<!-- okReasonType -->
	<xs:simpleType name="okReasonType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="success"/>
			<xs:enumeration value="reset_to_default"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- okType -->
	<xs:complexType name="okType">
		<xs:attribute name="script_id" type="xs:string" use="required"/>
		<xs:attribute name="reason" type="okReasonType" use="optional"/>
	</xs:complexType>
	<!-- errorType -->
	<xs:complexType name="errorType">
		<xs:attribute name="script_id" type="xs:string" use="required"/>
		<xs:attribute name="reason" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- scriptType -->
	<xs:complexType name="scriptType">
		<xs:attribute name="script_id" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- requestType -->
	<xs:complexType name="requestType">
		<xs:sequence>
			<xs:element name="script" type="scriptType" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="domain" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- responseType -->
	<xs:complexType name="responseType">
		<xs:sequence>
			<xs:element name="ok" type="okType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</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="response" type="responseType"/>
			</xs:all>
		</xs:complexType>
	</xs:element>
</xs:schema>
CODE

Пример

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_delete.xsd">
    <request domain="biysk.local">
      <script script_id="edf3acb838c34fde"/>
      <script script_id="edf3a7cd39752236"/>
    </request>
</in>
CODE

Ответ:

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

Hс_ivr_script_import

Команда позволяет импортировать IVR-скрипт в систему.

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

/domain/<DOMAIN>/ivr/script/.import

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

POST

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

http://host:port/commands/ivr_script_import

Код 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="error.xsd"/>
	<!-- okType -->
	<xs:complexType name="okType">
		<xs:attribute name="script_id" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- requestType -->
	<xs:complexType name="requestType">
		<xs:attribute name="domain" type="xs:string" use="required"/>
		<xs:attribute name="script_id" type="xs:string" use="optional"/>
		<xs:attribute name="body" type="xs:base64Binary" use="required"/>
	</xs:complexType>
	<!-- responseType -->
	<xs:complexType name="responseType">
		<xs:choice>
			<xs:element name="ok" type="okType" maxOccurs="unbounded"/>
			<xs:element name="error" type="errorType"/>
		</xs:choice>
	</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="response" type="responseType"/>
			</xs:all>
		</xs:complexType>
	</xs:element>
</xs:schema>
CODE

Пример 1

Создание нового скрипта

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_import.xsd">
  <request domain="biysk.local" body="eyJhY3Rpb25zIjp7ImJlZ2luXzEiOnsibmFtZSI6ImJlZ2luIiwicGFyYW1zIjp7ImRlc2NyaXB0aW9uIjoiIn0sImNhc2VzIjp7Im5leHQiOiJxdWV1ZS1jY18yIn0sInBvcyI6eyJ4IjoxLCJ5IjowfSwibGlua3MiOnsibmV4dCI6eyJwb2ludHMiOlt7ImN4IjoyNzAsImN5Ijo3MH0seyJjeCI6MjcwLCJjeSI6MTI1fSx7ImN4IjoyNzAsImN5IjoxODB9XSwidGV4dF9wb3MiOjAuMn19fSwicXVldWUtY2NfMiI6eyJuYW1lIjoicXVldWUiLCJwYXJhbXMiOnsiZGVzY3JpcHRpb24iOiJjYyIsInF1ZXVlX2lkIjoibGluZTEiLCJwb3NpdGlvbl9ub3RpZmljYXRpb25fbW9kZSI6ImFic29sdXRlIiwidGltZV9wcmVkaWN0aW9uX21vZGUiOiJmYWlyIiwibm90aWZpY2F0aW9uX3NjZW5hcmlvIjpbeyJpdGVtIjoiZW5xdWV1ZWQifSx7Iml0ZW0iOiJwb3NpdGlvbiJ9XSwiZm9uZSI6W3sibG9jYXRpb24iOiJzeXN0ZW0iLCJncm91cCI6InF1ZXVlIiwiZmlsZSI6ImFpX3F1ZXVlX211c2ljLndhdiJ9XSwiaW5xdWV1ZSI6W3sibG9jYXRpb24iOiJzeXN0ZW0iLCJncm91cCI6InF1ZXVlIiwiZmlsZSI6ImFpX3F1ZXVlX2VucXVldWVkLndhdiJ9XSwicHJlZGljdGVkX3RpbWUiOlt7ImxvY2F0aW9uIjoic3lzdGVtIiwiZ3JvdXAiOiJxdWV1ZSIsImZpbGUiOiJhaV9xdWV1ZV9wcmVkaWN0ZWRfdGltZS53YXYifV0sImNhbGxiYWNrX29uX2ZhaWx1cmUiOmZhbHNlLCJjYWxsYmFja19vbl9vdmVybG9hZCI6ZmFsc2UsIm1vZGUiOiJwZXJtYW5lbnQifSwiY2FzZXMiOnsiRnVsbCI6InVuZGVmaW5lZCIsIkVycm9yIjoidW5kZWZpbmVkIiwiT2siOiJ1bmRlZmluZWQifSwicG9zIjp7IngiOjEsInkiOjF9LCJsaW5rcyI6eyJGdWxsIjp7InBvaW50cyI6W3siY3giOjI3MCwiY3kiOjIyMH0seyJjeCI6MTgwLCJjeSI6Mjc1fSx7ImN4Ijo5MCwiY3kiOjMzMH1dLCJ0ZXh0X3BvcyI6MC4yLCJwb3MiOnsieCI6MCwieSI6Mn19LCJFcnJvciI6eyJwb2ludHMiOlt7ImN4IjoyNzAsImN5IjoyMjB9LHsiY3giOjI3MCwiY3kiOjI3NX0seyJjeCI6MjcwLCJjeSI6MzMwfV0sInRleHRfcG9zIjowLjIsInBvcyI6eyJ4IjoxLCJ5IjoyfX0sIk9rIjp7InBvaW50cyI6W3siY3giOjI3MCwiY3kiOjIyMH0seyJjeCI6MzYwLCJjeSI6Mjc1fSx7ImN4Ijo0NTAsImN5IjozMzB9XSwidGV4dF9wb3MiOjAuMiwicG9zIjp7IngiOjIsInkiOjJ9fX19fSwibmFtZSI6InRvX2NjIiwiZGVzY3JpcHRpb24iOiIiLCJ2ZXJzaW9uIjoiMy4xMC4wLjMxIn0="/>
</in>
CODE

Код ответа:

200

Ответ:

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

Пример 2

Изменение уже существующего скрипта

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_import.xsd">
  <request domain="p.city" script_id="script1" body="eyJhY3Rpb25zIjp7IlN2Z2pzRzEwMTEiOnsibmFtZSI6InJpbmciLCJwYXJhbXMiOnt9LCJwb3MiOnsieCI6MSwieSI6MH0sImNhc2VzIjp7Im5leHQiOiJTdmdqc0cxMDMzIn19LCJTdmdqc0cxMDMzIjp7Im5hbWUiOiJjYWxsZXItaW5mbyIsInBhcmFtcyI6e30sInBvcyI6eyJ4IjoxLCJ5IjoxfSwiY2FzZXMiOnsibmV4dCI6IlN2Z2pzRzEwNjQifX0sIlN2Z2pzRzEwNjQiOnsibmFtZSI6Iml2ciIsInBhcmFtcyI6eyJpdnIiOlt7ImNvbW1hbmQiOiIqIiwiZGVzY3JpcHRpb24iOiIifV19LCJwb3MiOnsieCI6MSwieSI6Mn0sImNhc2VzIjp7IioiOiJTdmdqc0cxMTA5IiwiRW1wdHkiOiJTdmdqc0cxMTM5In19LCJTdmdqc0cxMTA5Ijp7Im5hbWUiOiJwbGF5IiwicGFyYW1zIjp7fSwicG9zIjp7IngiOjAsInkiOjN9LCJjYXNlcyI6eyJuZXh0IjoiU3ZnanNHMTI0NCJ9fSwiU3ZnanNHMTEzOSI6eyJuYW1lIjoiZGlnaXRtYXAiLCJwYXJhbXMiOnt9LCJwb3MiOnsieCI6MSwieSI6M30sImNhc2VzIjp7IlllcyI6IlN2Z2pzRzExODQiLCJObyI6IlN2Z2pzRzEyMTQifX0sIlN2Z2pzRzExODQiOnsibmFtZSI6InNhbWUtY2FsbCIsInBhcmFtcyI6e30sInBvcyI6eyJ4IjoxLCJ5Ijo0fSwiY2FzZXMiOnt9fSwiU3ZnanNHMTIxNCI6eyJuYW1lIjoicmVjIiwicGFyYW1zIjp7fSwicG9zIjp7IngiOjIsInkiOjR9LCJjYXNlcyI6eyJuZXh0IjoiU3ZnanNHMTI1OSJ9fSwiU3ZnanNHMTI0NCI6eyJuYW1lIjoidm9pY2UtbWFpbCIsInBhcmFtcyI6e30sInBvcyI6eyJ4IjowLCJ5Ijo0fSwiY2FzZXMiOnt9fSwiU3ZnanNHMTI1OSI6eyJuYW1lIjoiZ290byIsInBhcmFtcyI6eyJnb3RvIjoiU3ZnanNHMTA2NCIsIm1heF9ob3BzIjoxfSwicG9zIjp7IngiOjIsInkiOjV9LCJjYXNlcyI6eyJuZXh0IjoiU3ZnanNHMTA2NCJ9fX19"/>
</in>
CODE

Код ответа:

200

Ответ:

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

Пример 3 (ошибочный)

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_import.xsd">
  <request domain="biysk.local" script_id="script1" body="eyJhY3Rpb25zIjp7IlN2Z2pzRzEwMTEiOnsibmFtZSI6InJpbmciLCJwYXJhbXMiOnt9LCJwb3MiOnsieCI6MSwieSI6MH"/>
</in>
CODE

Код ответа:

404

Ответ:

<?xml version="1.0" encoding="UTF-8"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_import.xsd">
    <error cmd="ivr_script_import" reason="invalid_input_xml" body="{invalid_xml,["Parse xml error: {1,xmerl_b64Bin,[\"syntax error before: \",[\"'$end'\"]]}"]}" entity="<?xml version='1.0' encoding='latin1'?> <in
        xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_import.xsd"> <request domain="biysk.local" script_id="script1" body="eyJhY3Rpb25zIjp7IlN2Z2pzRzEwMTEiOnsibmFtZSI6InJpbmciLCJwYXJhbXMiOnt9LCJwb3MiOnsieCI6MSwieSI6MH"/> </in>"/>
    </out>
CODE

Hс_ivr_script_list

Команда просмотра списка IVR-скриптов в определенном домене.

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

domain/<DOMAIN>/ivr/script/list

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

POST

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

http://host:port/commands/ivr_script_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">
	<!-- Types -->
	<xs:simpleType name="directionType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="incoming"/>
			<xs:enumeration value="outgoing"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ownerType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="system"/>
			<xs:enumeration value="domain"/>
			<xs:enumeration value="user"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- scriptType -->
	<xs:complexType name="scriptType">
		<xs:attribute name="script_id" type="xs:string" use="required"/>
		<xs:attribute name="name" type="xs:string" use="required"/>
		<xs:attribute name="description" type="xs:string" use="optional"/>
		<xs:attribute name="direction" type="directionType" use="required"/>
		<xs:attribute name="owner" type="ownerType" use="required"/>
	</xs:complexType>
	<!-- requestType -->
	<xs:complexType name="requestType">
		<xs:attribute name="domain" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- responseType -->
	<xs:complexType name="responseType">
		<xs:sequence>
			<xs:element name="script" type="scriptType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</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="response" type="responseType"/>
			</xs:all>
		</xs:complexType>
	</xs:element>
</xs:schema>
CODE

Пример:

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

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

Код ответа:

200

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_list.xsd">
    <response>
        <script script_id="062029e4e7ca8ffe" name="dial_to_cc" description="" direction="incoming" owner="user"/>
        <script script_id="enter_number_of_teleconference" name="enter_number_of_teleconference" description="Скрипт вводна номера телеконференции. Номер телеконференции вводится в блоке ivr. Вход в телеконфереции осуществляется блоком dial" direction="incoming" owner="domain"/>
        <script script_id="default_incoming_call" name="default_incoming_call" description="Скрипт для обработки всех входящих вызовов в домен и маршрутизации их через IVR" direction="incoming" owner="domain"/>
        <script script_id="06202b326f2fd9e8" name="dialer" description="" direction="incoming" owner="user"/>
        <script script_id="06260fa4592a4419" name="to_cc" description="" direction="incoming" owner="user"/>
        <script script_id="0622071a81711369" name="custom_cb_out" description="" direction="outgoing" owner="user"/>
        <script script_id="fax_to_email" name="fax_to_email" description="Приём факса и отправка на email, настроенный на уровне алиаса" direction="incoming" owner="domain"/>
        <script script_id="enter_number_of_conference_room" name="enter_number_of_conference_room" description="Скрипт вводна номера комнаты конференции. Номер комнаты конференции вводится в блоке ivr. Вход в комнату конфереции осуществляется блоком dial." direction="incoming" owner="domain"/>
    </response>
</out>
CODE

Hс_ivr_script_show

Команда просмотра конфигурации IVR-скрипта в определенном домене.

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

domain/<DOMAIN>/ivr/script/show

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

POST

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

http://host:port/commands/ivr_script_show

Код 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="error.xsd"/>
	<!-- ownerType -->
	<xs:simpleType name="ownerType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="system"/>
			<xs:enumeration value="domain"/>
			<xs:enumeration value="user"/>
		</xs:restriction>
	</xs:simpleType>
	<!-- scriptType -->
	<xs:complexType name="scriptType">
		<xs:attribute name="script_id" type="xs:string" use="required"/>
		<xs:attribute name="owner" type="ownerType" use="required"/>
		<xs:attribute name="body" type="xs:base64Binary" use="required"/>
	</xs:complexType>
	<!-- requestType -->
	<xs:complexType name="requestType">
		<xs:attribute name="domain" type="xs:string" use="required"/>
		<xs:attribute name="script_id" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- responseType -->
	<xs:complexType name="responseType">
		<xs:choice minOccurs="1" maxOccurs="1">
			<xs:element name="script" type="scriptType"/>
			<xs:element name="error" type="errorType"/>
		</xs:choice>
	</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="response" type="responseType"/>
			</xs:all>
		</xs:complexType>
	</xs:element>
</xs:schema>

CODE

Пример 1

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_show.xsd">
    <request domain="biysk.local" script_id="fax_to_email"/>
</in>
CODE

Ответ: 200

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_show.xsd">
    <response>
        <script script_id="fax_to_email" owner="domain" body="eyJhY3Rpb25zIjp7ImJlZ2luXzEiOnsibmFtZSI6ImJlZ2luIiwicGFyYW1zIjp7ImRlc2NyaXB0aW9uIjoiIn0sImNhc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hbWUiOiJwbGF5IiwicGFyYW1zIjp7ImRlc2NyaXB0aW9uIjoiIiwicGxheSI6W3sibG9jYXRpb24iOiJzeXN0ZW0iLCJncm91cCI6IiIsIm5hbWUiOiJhaV9lcnJvci53YXYiLCJ0eXBlIjoiZmlsZSIsInZhcmlhYmxlX3R5cGUiOiIifV0sInJlcGxheSI6IjEifSwiY2FzZXMiOnsibmV4dCI6InVuZGVmaW5lZCJ9LCJwb3MiOnsieCI6MSwieSI6Mn0sImxpbmtzIjp7Im5leHQiOnsicG9pbnRzIjpbeyJjeCI6MjcwLCJjeSI6MzcwfSx7ImN4IjoyNzAsImN5Ijo0MjV9LHsiY3giOjI3MCwiY3kiOjQ4MH1dLCJ0ZXh0X3BvcyI6MC4yLCJwb3MiOnsieCI6MSwieSI6M319fX19LCJuYW1lIjoiZmF4X3RvX2VtYWlsIiwiZGVzY3JpcHRpb24iOiLQn9GA0LjRkdC8INGE0LDQutGB0LAg0Lgg0L7RgtC/0YDQsNCy0LrQsCDQvdCwIGVtYWlsLCDQvdCw0YHRgtGA0L7QtdC90L3Ri9C5INC90LAg0YPRgNC+0LLQvdC1INCw0LvQuNCw0YHQsCIsInZlcnNpb24iOiIxNC40LjE4Iiwic2V0dGluZ3MiOnsic3BlZWNoIjp7ImtleSI6IiIsImZvbGRlciI6IiIsImxhbmciOiJydS1SVSIsInZvaWNlIjoib2tzYW5hIiwic3BlZWQiOiIxLjAiLCJlbW90aW9uIjoibmV1dHJhbCJ9fSwiaWQiOiJmYXhfdG9fZW1haWwifQ=="/>
    </response>
</out>
CODE

Пример 2

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_show.xsd">
    <request domain="biysk.local" script_id="123456789"/>
</in>
CODE

Ответ: 404

<?xml version="1.0" encoding="UTF-8"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="common_error.xsd">
    <error cmd="ivr_script_show" reason="error" body="<?xml version="1.0"?><out
        xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_show.xsd"><response><error cmd="ivr_script_show" reason="unknown_error" body="not_found"/></response></out>"/>
    </out>
CODE

Hс_ivr_script_validate

Команда позволяет проверить валидность IVR-скрипта в системе.

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

domain/<DOMAIN>/ivr/script/.validate

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

POST

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

http://host:port/commands/ivr_script_validate

Код 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="error.xsd"/>
	<!-- okType -->
	<xs:complexType name="okType"/>
	<!-- requestType -->
	<xs:complexType name="requestType">
		<xs:attribute name="domain" type="xs:string" use="required"/>
		<xs:attribute name="body" type="xs:base64Binary" use="required"/>
	</xs:complexType>
	<!-- responseType -->
	<xs:complexType name="responseType">
		<xs:choice>
			<xs:element name="ok" type="okType"/>
			<xs:element name="error" type="errorType"/>
		</xs:choice>
	</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="response" type="responseType"/>
			</xs:all>
		</xs:complexType>
	</xs:element>
</xs:schema>
CODE

Пример 1

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_validate.xsd">
  <request domain="biysk.local" body="eyJhY3Rpb25zIjp7ImJlZ2luXz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/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_validate.xsd">
    <response>
        <ok/>
    </response>
</out>
CODE

Пример 2

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_validate.xsd">
  <request domain="p.city" name="script1" body="eyJhY3Rpb25zIjp7IlN2Z2pzRzEwMTEiOnsibmFtZSI6InJpbmciLCJwYXJhbXMiOnt9LCJwb3MiOnsieCI6MSwieSI6MH"/>
</in>
CODE

Код ответа:

404

Ответ:

<?xml version="1.0"?>
<out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_validate.xsd">
  <response>
    <error cmd="ivr_script_validate" reason="unknown_error" body="bad_script"/>
  </response>
</out>
CODE

Hc_ivr_script_rename

Команда позволяет переименовать IVR-скрипт в определенном домене.

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

domain/<DOMAIN>/ivr/script/rename

Метод http запроса:

POST

Шаблон http запроса:

http://host:port/commands/ivr_script_rename

Код 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">
	<!-- okType -->
	<xs:complexType name="okType">
		<xs:attribute name="script_id" type="xs:string" use="required"/>
		<xs:attribute name="new_name" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- errorType -->
	<xs:complexType name="errorType">
		<xs:attribute name="script_id" type="xs:string" use="required"/>
		<xs:attribute name="new_name" type="xs:string" use="required"/>
		<xs:attribute name="reason" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- scriptType -->
	<xs:complexType name="scriptType">
		<xs:attribute name="script_id" type="xs:string" use="required"/>
		<xs:attribute name="new_name" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- requestType -->
	<xs:complexType name="requestType">
		<xs:sequence>
			<xs:element name="script" type="scriptType" maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute name="domain" type="xs:string" use="required"/>
	</xs:complexType>
	<!-- responseType -->
	<xs:complexType name="responseType">
		<xs:sequence>
			<xs:element name="ok" type="okType" minOccurs="0" maxOccurs="unbounded"/>
			<xs:element name="error" type="errorType" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</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="response" type="responseType"/>
			</xs:all>
		</xs:complexType>
	</xs:element>
</xs:schema>
CODE

Пример 1

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_rename.xsd">
    <request domain="biysk.local">
        <script script_id="edf3a248c0fbcfde" new_name="new_script_1"/>
        <script script_id="edf3974226aaf4e9" new_name="to_cc2"/>
    </request>
</in>
CODE

Код ответа:

200

Ответ:

<?xml version="1.0"?>
<out
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_ivr_script_rename.xsd">
    <response>
        <ok script_id="edf3a248c0fbcfde" new_name="new_script_1"/>
        <ok script_id="edf3974226aaf4e9" new_name="to_cc2"/>
    </response>
</out>
CODE