Hc_adaptation_context_delete
Команда предназначена для удаления контекста адаптации номеров по имени из определенного домена.
Аналог команды в CoCon:
cluster/storage/<STORAGE>/adaptation/delete
domain/<DOMAIN>/adaptation/delete
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/adaptation_context_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"> <xs:include schemaLocation="error.xsd"/> <!-- 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="context" 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="error" type="errorType"/> </xs:all> </xs:complexType> </xs:element> </xs:schema>
Пример 1
Удаление существующего контекста
Запрос:
http://192.168.1.21:9999/commands/adaptation_context_delete
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_adaptation_context_delete.xsd"> <request domain="biysk.local" context="mod1_adp"/> </in>
Ответ:
204
Пример 2
Удаление несуществующего контекста
Запрос:
http://192.168.1.21:9999/commands/adaptation_context_delete
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_adaptation_context_delete.xsd"> <request domain="biysk.local" context="ctx1"/> </in>
<?xml version="1.0" encoding="UTF-8"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_adaptation_context_delete.xsd"> <error cmd="adaptation_context_delete" reason="not_exists" body="not_found" entity="ctx1"/> </out>
Ответ:
404
Hc_adaptation_context_import
Команда предназначена для импорта контекста адаптации номеров в определенный домен. Если контекст в указанным именем уже существует - контекст будет обновлен.
Аналог команды в CoCon:
cluster/storage/<STORAGE>/adaptation/import
domain/<DOMAIN>/adaptation/import
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/adaptation_context_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" /> <xs:complexType name="valueType"> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> <!-- progressType --> <xs:complexType name="progressType"> <xs:sequence> <xs:element name="ref" minOccurs="1" maxOccurs="1" type="valueType" /> <xs:element name="text" minOccurs="1" maxOccurs="1" type="valueType" /> </xs:sequence> </xs:complexType> <!-- in --> <xs:element name="in"> <xs:complexType> <xs:sequence> <xs:element name="request"> <xs:complexType> <xs:sequence> <xs:element name="context" type="xs:base64Binary" /> </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="error" type="errorType" /> </xs:sequence> </xs:complexType> </xs:element> <!-- progress --> <xs:element name="progress" type="progressType"/> </xs:schema>
Пример 1:
Импорт валидного контекста
Запрос:
http://192.168.1.21:9999/commands/adaptation_context_import
<in> <request domain="p.city"> <context>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCiAgPGFkYXB0YXRpb24geG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4czpub05hbWVzcGFjZVNjaGVtYUxvY2F0aW9uPSJlY3NzX21vZGlmaWNhdG9ycy54c2QiIG5hbWU9ImRlZmF1bHRfYWRhcHRhdGlvbiI+DQogICAgPHJ1bGUgbmFtZT0iY2FsbF9mcm9tX2l2cl8x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Pg0KICAgICAgICA8Y2RwbiBkaWdpdHM9Ijg4MDB7JX0iLz4NCiAgICAgICAgPG9jZHBuIGRpZ2l0cz0iMTIzIi8+DQogICAgICA8L2FjdGlvbnM+DQogICAgICA8cmVzdWx0Pg0KICAgICAgICA8ZmluaXNoLz4NCiAgICAgIDwvcmVzdWx0Pg0KICAgIDwvcnVsZT4NCiAgICA8cnVsZSBuYW1lPSJsb2NhbF9jYWxscyI+DQogICAgICA8Y29uZGl0aW9ucz4NCiAgICAgICAgPGNncG4gZGlnaXRzPSIlIi8+DQogICAgICAgIDxjZHBuIGRpZ2l0cz0iJSIvPg0KICAgICAgPC9jb25kaXRpb25zPg0KICAgICAgPHJlc3VsdD4NCiAgICAgICAgPGZpbmlzaC8+DQogICAgICA8L3Jlc3VsdD4NCiAgICA8L3J1bGU+DQogIDwvYWRhcHRhdGlvbj4=</context> </request> </in>
Ответ:
201
Пример 2
Запрос невалидного контекста
Запрос:
http://192.168.23.34:9999/commands/adaptation_context_import
<in> <request domain="p.city"> <context>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4NCiAgPGFkYXB0YXRpb24geG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4czpub05hbWVzcGFjZVNjaGVtYUxvY2F0aW9uPSJlY3NzX21vZGlmaWNhdG9ycy54c2QiIG5hbWU9ImRlZmF1bHRfYWRhcHRhdGlvbiI+DQogICAgPHJ1bGUgbmFtZT0iY2FsbF9mcm9tX2l2cl8xMTMxMTExMSI+DQogICAgICA8Y29uZGl0aW9ucz4NCiAgICAgICAgPGNuIGRpZ2l0cz0iMTEzIi8+DQogICAgICA8L2NvbmRpdGlvbnM+DQogICAgICA8YWN0aW9ucz4NCiAgICAgICAgPGNuIGRpZ2l0cz0iQUJDRDExM3s1fSIvPg0KICAgICAgPC9hY3Rpb25zPg0KICAgICAgPHJlc3VsdD4NCiAgICAgICAgPG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sb2NhbF9jYWxscyI+DQogICAgICA8Y29uZGl0aW9ucz4NCiAgICAgICAgPGNncG4gZGlnaXRzPSIlIi8+DQogICAgICAgIDxjZHBuIGRpZ2l0cz0iJSIvPg0KICAgICAgPC9jb25kaXRpb25zPg0KICAgICAgPHJlc3VsdD4NCiAgICAgICAgPGZpbmlzaC8+DQogICAgICA8L3Jlc3VsdD4NCiAgICA8L3J1bGU+DQogIDwvYWRhcHRhdGlvbj4=</context> </request> </in>
<?xml version="1.0" encoding="UTF-8"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_adaptation_context_import.xsd"> <error cmd="adaptation_context_import" reason="context_validation_error" body="adaptation context: default_adaptation rule: call_from_ivr_11311111 action: cn digits: "ABCD113{e}" Error: unknown variable "e"" entity="adaptation context: default_adaptation; rule: call_from_ivr_11311111; action: cn; digits: "ABCD113{e}"; Error: unknown variable "e""/> </out>
Ответ:
404
Hc_adaptation_context_list
Команда предназначена для просмотра списка контекстов адаптации номеров в определенном домене.
Аналог команды в CoCon:
cluster/storage/<STORAGE>/adaptation/list
domain/<DOMAIN>/adaptation/list
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/adaptation_context_list
Код HTTP-ответа:
- 200 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-запроса/ответа:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <!-- contextType--> <xs:complexType name="contextType"> <xs:attribute name="name" type="xs:string" use="required"/> </xs:complexType> <!-- in--> <xs:element name="in"> <xs:complexType> <xs:sequence> <xs:element name="request"> <xs:complexType> <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:all> <xs:element name="contexts"> <xs:complexType> <xs:sequence> <xs:element name="context" type="contextType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:all> </xs:complexType> </xs:element> </xs:schema>
Пример:
Запрос:
http://192.168.1.21:9999/commands/adaptation_context_list
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_adaptation_context_list.xsd"> <request domain="biysk.local"/> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_adaptation_context_list.xsd"> <contexts> <context name="mod1_adp"/> <context name="mod2_adp"/> <context name="adp_sorm"/> <context name="default_adaptation"/> </contexts> </out>
Hc_adaptation_context_show
Команда предназначена для получения контекста адаптации номеров по имени из определенного домена.
Аналог команды в CoCon:
cluster/storage/<STORAGE>/adaptation/show
domain/<DOMAIN>/adaptation/show
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/adaptation_context_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"/> <!-- out--> <xs:element name="out"> <xs:complexType> <xs:choice> <xs:element name="context" type="xs:base64Binary"/> <xs:element name="error" type="errorType"/> </xs:choice> </xs:complexType> </xs:element> <!-- in--> <xs:element name="in"> <xs:complexType> <xs:sequence> <xs:element name="request"> <xs:complexType> <xs:attribute name="domain" type="xs:string" use="required"/> <xs:attribute name="context" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:schema>
В поле context в результате в кодировке base64 закодирован контекст адаптации (в формате XML). 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="ecss_acp_common.xsd"/> <!-- booleanType --> <xs:simpleType name="booleanType"> <xs:restriction base="xs:boolean"/> </xs:simpleType> <!-- ruleType --> <xs:complexType name="ruleType"> <xs:sequence> <xs:element name="conditions" minOccurs="0"> <xs:complexType> <xs:all> <xs:element name="cgpn" type="cgpnType" minOccurs="0"/> <xs:element name="cdpn" type="cdpnType" minOccurs="0"/> <xs:element name="rgn" type="rgnConditionType" minOccurs="0"/> <xs:element name="ocdpn" type="ocdpnConditionType" minOccurs="0"/> <xs:element name="cn" type="cnConditionType" minOccurs="0"/> <xs:element name="time" type="valueType" minOccurs="0"/> <xs:element name="date" type="valueType" minOccurs="0"/> <xs:element name="weekday" type="valueType" minOccurs="0"/> <xs:element name="tag" type="valueType" minOccurs="0"/> </xs:all> </xs:complexType> </xs:element> <xs:element name="actions" minOccurs="0"> <xs:complexType> <xs:all> <xs:element name="cgpn" type="cgpnType" minOccurs="0"/> <xs:element name="cdpn" type="cdpnType" minOccurs="0"/> <xs:element name="rgn" type="rgnActionType" minOccurs="0"/> <xs:element name="ocdpn" type="ocdpnActionType" minOccurs="0"/> <xs:element name="cn" type="cnActionType" minOccurs="0"/> <xs:element name="empty_rgn" type="nullType" minOccurs="0"> <xs:annotation><xs:documentation xml:lang="en">Remove routing number.</xs:documentation></xs:annotation> </xs:element> <xs:element name="empty_ocdpn" type="nullType" minOccurs="0"> <xs:annotation><xs:documentation xml:lang="en">Remove original called number.</xs:documentation></xs:annotation> </xs:element> <xs:element name="empty_cn" type="nullType" minOccurs="0"> <xs:annotation><xs:documentation xml:lang="en">Remove connected number.</xs:documentation></xs:annotation> </xs:element> </xs:all> </xs:complexType> </xs:element> <xs:element name="result"> <xs:complexType> <xs:choice> <xs:element name="finish" type="finishResultType"/> <xs:element name="error" type="errorResultType"/> <xs:element name="continue" type="continueResultType"/> </xs:choice> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="description" type="xs:string" use="optional"/> </xs:complexType> <!-- modificatorsType --> <xs:complexType name="modificatorsType"> <xs:all> <xs:element name="in" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="rule" type="ruleType" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="out" minOccurs="0" maxOccurs="1"> <xs:complexType> <xs:sequence> <xs:element name="rule" type="ruleType" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element> </xs:all> <xs:attribute name="name" type="xs:string" use="required"> <xs:annotation> <xs:documentation>The name of the current modificators.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="description" type="xs:string" use="optional"> <xs:annotation> <xs:documentation>Text description of the current modificators.</xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> <!-- adaptationType --> <xs:complexType name="adaptationType"> <xs:sequence> <xs:element name="rule" type="ruleType" maxOccurs="unbounded"/> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required"> <xs:annotation> <xs:documentation>The name of the current adaptation.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="description" type="xs:string" use="optional"> <xs:annotation> <xs:documentation>Text description of the current adaptation.</xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> <!-- modificators --> <xs:element name="modificators" type="modificatorsType"/> <!-- adaptation --> <xs:element name="adaptation" type="adaptationType"/> <!-- cdpnType --> <xs:complexType name="cdpnType"> <xs:attribute name="digits" type="xs:string"/> <xs:attribute name="nai" type="naiType"/> <xs:attribute name="incomplete" type="xs:boolean"/> <xs:attribute name="inni" type="inniType"/> <xs:attribute name="npi" type="npiType"/> <xs:attribute name="ni" type="niType"/> <xs:attribute name="category" type="categoryType"/> </xs:complexType> <!-- cgpnType --> <xs:complexType name="cgpnType"> <xs:attribute name="nai" type="naiType"/> <xs:attribute name="incomplete" type="xs:boolean"/> <xs:attribute name="npi" type="npiType"/> <xs:attribute name="apri" type="apriType"/> <xs:attribute name="screening" type="screeningType"/> <xs:attribute name="digits" type="xs:string"/> <xs:attribute name="ni" type="niType"/> </xs:complexType> <!-- rgnConditionType --> <xs:complexType name="rgnConditionType"> <xs:attribute name="digits" type="xs:string"/> <xs:attribute name="nai" type="naiType"/> <xs:attribute name="incomplete" type="xs:boolean"/> <xs:attribute name="apri" type="apriType"/> <xs:attribute name="npi" type="npiType"/> <xs:attribute name="ni" type="niType"/> <xs:attribute name="empty" type="booleanType"> <xs:annotation> <xs:documentation>In case of empty attribute set - other attributes MUST NOT be set.</xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> <!-- ocdpnConditionType --> <xs:complexType name="ocdpnConditionType"> <xs:attribute name="digits" type="xs:string"/> <xs:attribute name="nai" type="naiType"/> <xs:attribute name="ni" type="niType"/> <xs:attribute name="npi" type="npiType"/> <xs:attribute name="apri" type="apriType"/> <xs:attribute name="category" type="categoryType"/> <xs:attribute name="incomplete" type="xs:boolean"/> <xs:attribute name="empty" type="booleanType"> <xs:annotation> <xs:documentation>In case of empty attribute set - other attributes MUST NOT be set.</xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> <!-- cnConditionType --> <xs:complexType name="cnConditionType"> <xs:attribute name="nai" type="naiType"/> <xs:attribute name="npi" type="npiType"/> <xs:attribute name="apri" type="apriType"/> <xs:attribute name="digits" type="xs:string"/> <xs:attribute name="ni" type="niType"/> <xs:attribute name="empty" type="booleanType"> <xs:annotation> <xs:documentation>In case of empty attribute set - other attributes MUST NOT be set.</xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> <!-- rgnActionType --> <xs:complexType name="rgnActionType"> <xs:attribute name="digits" type="xs:string"/> <xs:attribute name="nai" type="naiType"/> <xs:attribute name="incomplete" type="xs:boolean"/> <xs:attribute name="apri" type="apriType"/> <xs:attribute name="npi" type="npiType"/> <xs:attribute name="ni" type="niType"/> </xs:complexType> <!-- ocdpnActionType --> <xs:complexType name="ocdpnActionType"> <xs:attribute name="digits" type="xs:string"/> <xs:attribute name="nai" type="naiType"/> <xs:attribute name="ni" type="niType"/> <xs:attribute name="npi" type="npiType"/> <xs:attribute name="apri" type="apriType"/> <xs:attribute name="category" type="categoryType"/> <xs:attribute name="incomplete" type="xs:boolean"/> </xs:complexType> <!-- cnActionType --> <xs:complexType name="cnActionType"> <xs:attribute name="nai" type="naiType"/> <xs:attribute name="npi" type="npiType"/> <xs:attribute name="apri" type="apriType"/> <xs:attribute name="digits" type="xs:string"/> <xs:attribute name="ni" type="niType"/> <xs:attribute name="empty" type="booleanType"> <xs:annotation> <xs:documentation>In case of empty attribute set - other attributes MUST NOT be set.</xs:documentation> </xs:annotation> </xs:attribute> </xs:complexType> <!-- valueType --> <xs:complexType name="valueType"> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> <!-- nullType --> <xs:complexType name="nullType"/> <!-- Result types --> <!-- finishResultType --> <xs:complexType name="finishResultType"/> <!-- errorResultType --> <xs:complexType name="errorResultType"> <xs:attribute name="acp_cause" type="xs:string" use="optional"/> <xs:attribute name="isup_cause" type="xs:string" use="optional"/> <xs:attribute name="description" type="xs:string" use="optional"/> </xs:complexType> <!-- continueResultTypeType --> <xs:simpleType name="continueResultTypeType"> <xs:restriction base="xs:string"> <xs:enumeration value="start"/> <xs:enumeration value="next"/> </xs:restriction> </xs:simpleType> <!-- continueResultType --> <xs:complexType name="continueResultType"> <xs:attribute name="tag" type="xs:string" use="optional"/> <xs:attribute name="type" type="continueResultTypeType" default="start" use="optional"/> </xs:complexType> </xs:schema>
Пример 1:
Запрос существующего контекста
Запрос:
http://192.168.1.21:9999/commands/adaptation_context_show
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_adaptation_context_show.xsd"> <request domain="biysk.local" context="default_adaptation"/> </in>
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_adaptation_context_show.xsd"> <context>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48YWRhcHRhdGlvbiB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhzOm5vTmFtZXNwYWNlU2NoZW1hTG9jYXRpb249ImVjc3NfbW9kaWZpY2F0b3JzLnhzZCIgbmFtZT0iZGVmYXVsdF9hZGFwdGF0aW9uIj48cnVsZSBuYW1lPSJsb2NhbF9jYWxscyI+PHJlc3VsdD48ZmluaXNoLz48L3Jlc3VsdD48L3J1bGU+PC9hZGFwdGF0aW9uPg==</context> </out>
Ответ:
200
Пример 2:
Запрос несуществующего контекста
Запрос:
http://192.168.1.21:9999/commands/adaptation_context_show
<in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_adaptation_context_show.xsd"> <request domain="biysk.local" context="ctx1"/> </in>
<?xml version="1.0" encoding="UTF-8"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_adaptation_context_show.xsd"> <error cmd="adaptation_context_show" reason="context_not_found" body="{error,{ctx_not_found,{"biysk.local",ctx1}}}" entity="ctx1"/> </out>
Ответ:
404