Hc_change_context
Команда предназначена для импорта контекста в домен (Виртуальную АТС).
Если контекст с данным именем уже существует, он будет обновлен, если контекст маршрутизации с данным именем не существует, он будет создан.
Аналог команды в CoCon:
/domain/<DOMAIN>/routing/import
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/change_context
Код HTTP-ответа:
При выполнение команды HTTP-терминал может ответить следующими сообщениями:
- 201 – в случае успеха;
- 404 – в случае ошибки.
XSD-схема XML-файла c запросом:
<?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>
context.xsd:
Схема XML-файла определена в разделе show_context.
Пример:
Запрос: http://192.168.1.21:9999/commands/change_context
Параметры:
<?xml version="1.0" encoding="UTF-8"?> <in> <request domain="ct.office"> <context>PGNvbnRleHQgeG1sbnM6eHM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDEvWE1MU2NoZW1hLWluc3RhbmNlIiB4czpub05hbWVzcGFjZVNjaGVtYUxvY2F0aW9uPSJlY3NzX3JvdXRpbmcueHNkIgogbmFtZT0iY3R4X3RvX2V3c2QiIG5wPSJucF9vZmZpY2UiIGRpZ2l0bWFwPSJhdXRvIj4KICA8cnVsZSBuYW1lPSJ0b19ld3NkX3Nvcm0iPgogICAgPGNvbmRpdGlvbnM+CiAgICAgIDxjZHBuIGRpZ2l0cz0iJSIvPgogICAgPC9jb25kaXRpb25zPgogICAgPGFjdGlvbnM+CiAgICAgIDxjZHBuIGRpZ2l0cz0ieyV9Ii8+CiAgICA8L2FjdGlvbnM+CiAgICA8cmVzdWx0PgogICAgICA8ZXh0ZXJuYWw+CiAgICAgICAgPHRydW5rIHZhbHVlPSJzbWctNCIgd2VpZ2h0PSIxIi8+CiAgICAgIDwvZXh0ZXJuYWw+CiAgICA8L3Jlc3VsdD4KICA8L3J1bGU+CjwvY29udGV4dD4K</context> </request> </in>
Данная base64 строка соответствует контексту:
<context xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="ecss_routing.xsd" name="ctx_to_ewsd" np="np_office" digitmap="auto"> <rule name="to_ewsd_sorm"> <conditions> <cdpn digits="%"/> </conditions> <actions> <cdpn digits="{%}"/> </actions> <result> <external> <trunk value="smg-4" weight="1"/> </external> </result> </rule> </context>
Hc_list_of_context
Аналог команды в CoCon отсутствует, просмотреть доступные в системе контексты маршрутизации можно,
например, введя команду domain/<DOMAIN>/routing/show и нажать tab.
Команда возвращает список контекстов маршрутизации импортированных в домен (Виртуальную АТС).
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/list_of_context
Код HTTP-ответа:
При выполнение команды 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/list_of_context
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="list_of_context.xsd"> <request domain="biysk.local"/> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="list_of_context.xsd"> <contexts> <context name="ctx_from_ewsd"/> <context name="default_routing"/> <context name="ctx_to_ivr"/> <context name="ctx_city_common"/> <context name="ctx_to_ewsd"/> <context name="ctx_from_local"/> </contexts> </out>
Hc_show_context
Аналог команд в CoCon:
/cluster/storage/<CLUSTER>/routing/show test.domain
/domain/<DOMAIN>/routing/show
Команда позволяет просмотреть содержание контекста маршрутизации.
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/show_context
Код HTTP-ответа:
При выполнение команды HTTP-терминал может ответить следующими сообщениями:
200 – в случае успеха;
404 – в случае ошибки.
XSD-схема XML-файла запроса/ответа::
hc_show_context.xsd
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <!-- out--> <xs:element name="out"> <xs:complexType> <xs:all> <xs:element name="context" type="xs:base64Binary"/> </xs:all> </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>
ecss_routing.xsd:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <!-- type for calling arguments--> <xs:simpleType name="atomType"> <xs:restriction base="xs:string"/> </xs:simpleType> <xs:simpleType name="booleanType"> <xs:restriction base="xs:boolean"/> </xs:simpleType> <xs:simpleType name="termType"> <xs:restriction base="xs:string"/> </xs:simpleType> <xs:simpleType name="listType"> <xs:restriction base="xs:string"/> </xs:simpleType> <xs:simpleType name="binaryType"> <xs:restriction base="xs:string"/> </xs:simpleType> <xs:simpleType name="integerType"> <xs:restriction base="xs:integer"/> </xs:simpleType> <xs:simpleType name="positiveIntegerType"> <xs:restriction base="xs:integer"> <xs:minInclusive value="0"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="negativeIntegerType"> <xs:restriction base="xs:integer"> <xs:maxInclusive value="0"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="floatType"> <xs:restriction base="xs:float"/> </xs:simpleType> <xs:simpleType name="positiveFloatType"> <xs:restriction base="xs:float"> <xs:minInclusive value="0"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="negativeFloatType"> <xs:restriction base="xs:float"> <xs:maxInclusive value="0"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="stringType"> <xs:restriction base="xs:string"/> </xs:simpleType> <xs:simpleType name="nonemptyStringType"> <xs:restriction base="xs:string"/> </xs:simpleType> <xs:simpleType name="enumType"> <xs:restriction base="xs:string"> <xs:enumeration value="first"/> <xs:enumeration value="second"/> <xs:enumeration value="third"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="digitmapType"> <xs:restriction base="xs:string"/> </xs:simpleType> <xs:simpleType name="enumDaysType"> <xs:restriction base="xs:string"> <xs:enumeration value="sun"/> <xs:enumeration value="mon"/> <xs:enumeration value="thu"/> </xs:restriction> </xs:simpleType> <!-- externalRoutingType --> <xs:complexType name="externalRoutingType"> <xs:attribute name="service" type="xs:string" use="required"/> <xs:attribute name="id" type="xs:string" use="optional"> <xs:annotation> <xs:documentation> Service specific identifier. Used to distribute different rules by different service's instances. For radius_route_service id - the RADIUS servers' ids separated by semicolon (;) </xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="args" type="xs:string" use="optional"/> <xs:attribute name="timeout" type="positiveIntegerType" use="optional"/> </xs:complexType> <xs:complexType name="contextType"> <xs:sequence> <xs:element name="rule" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="conditions" minOccurs="0"> <xs:complexType> <xs:all> <xs:element name="calling" type="conditionCallingType" minOccurs="0"/> <xs:element name="called" type="calledType" minOccurs="0"/> <xs:element name="rgn" type="rgnConditionType" minOccurs="0"/> <xs:element name="cdpn" type="cdpnType" minOccurs="0"/> <xs:element name="cgpn" type="cgpnType" 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:element name="final" type="boolType" minOccurs="0"/> <xs:element name="cause" type="valueType" minOccurs="0"/> </xs:all> </xs:complexType> </xs:element> <xs:element name="actions" minOccurs="0"> <xs:complexType> <xs:all> <xs:element name="external_routing" type="externalRoutingType" minOccurs="0"/> <xs:element name="set_options" type="optionsType" minOccurs="0"/> <xs:element name="cgpn" type="cgpnType" minOccurs="0"/> <xs:element name="cdpn" type="cdpnType" minOccurs="0"/> <xs:element name="restore_cgpn" type="nullType" minOccurs="0"/> <xs:element name="restore_cdpn" type="nullType" minOccurs="0"/> <xs:element name="restore_rgn" type="nullType" minOccurs="0"/> <xs:element name="empty_rgn" type="nullType" minOccurs="0"/> <xs:element name="calling" type="actionCallingType" minOccurs="0"/> <xs:element name="called" type="calledType" minOccurs="0"/> <xs:element name="rgn" type="rgnActionType" minOccurs="0"/> <xs:element name="callerid" type="xs:string" minOccurs="0"/> <xs:element name="final" type="boolType" minOccurs="0"/> <xs:element name="alarm" type="alarmType" minOccurs="0"/> <xs:element name="log" type="logType" minOccurs="0"/> </xs:all> </xs:complexType> </xs:element> <xs:element name="result"> <xs:complexType> <xs:choice> <xs:element name="local" type="localResultType"/> <xs:element name="teleconference" type="teleconferenceResultType"/> <xs:element name="ivr" type="ivrResultType"/> <xs:element name="direction" type="directionResultType"/> <xs:element name="external" type="externalResultType"/> <xs:element name="incomplete" type="incompleteResultType"/> <xs:element name="no_route" type="no_routeResultType"/> <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> </xs:element> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required"> <xs:annotation> <xs:documentation>The name of the current context.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="domain" type="xs:string" use="optional"> <xs:annotation> <xs:documentation>Deprecated. Now domain name get form the context of the commands' execution.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="type" type="contextTypeType" use="optional"> <xs:annotation> <xs:documentation>Deprecated. Now domain name get form the context of the commands' execution.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="np" type="xs:string" default="default" use="optional"> <xs:annotation> <xs:documentation>Numbering plan for current routing context. By default np = default.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="digitmap" type="digitmapType" use="optional"> <xs:annotation> <xs:documentation>Manual-set digitmap for the current routing context.</xs:documentation> </xs:annotation> </xs:attribute> <xs:attribute name="description" type="xs:string" use="optional"> <xs:annotation> <xs:documentation>Text description of the current routing context.</xs:documentation> </xs:annotation> </xs:attribute> <!--obsolete--> </xs:complexType> <xs:complexType name="templateContextType"> <xs:sequence> <xs:element name="rule" maxOccurs="unbounded"> <xs:complexType> <xs:sequence> <xs:element name="conditions" minOccurs="0"> <xs:complexType> <xs:all> <xs:element name="calling" type="conditionCallingType" minOccurs="0"/> <xs:element name="called" type="calledType" minOccurs="0"/> <xs:element name="rgn" type="rgnConditionType" minOccurs="0"/> <xs:element name="cdpn" type="cdpnType" minOccurs="0"/> <xs:element name="cgpn" type="cgpnType" 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:element name="final" type="boolType" minOccurs="0"/> <xs:element name="cause" type="valueType" minOccurs="0"/> </xs:all> </xs:complexType> </xs:element> <xs:element name="actions" minOccurs="0"> <xs:complexType> <xs:all> <xs:element name="external_routing" type="externalRoutingType" minOccurs="0"/> <xs:element name="set_options" type="optionsType" minOccurs="0"/> <xs:element name="cgpn" type="cgpnType" minOccurs="0"/> <xs:element name="cdpn" type="cdpnType" minOccurs="0"/> <xs:element name="restore_cgpn" type="nullType" minOccurs="0"/> <xs:element name="restore_cdpn" type="nullType" minOccurs="0"/> <xs:element name="restore_rgn" type="nullType" minOccurs="0"/> <xs:element name="calling" type="actionCallingType" minOccurs="0"/> <xs:element name="called" type="calledType" minOccurs="0"/> <xs:element name="rgn" type="rgnActionType" minOccurs="0"/> <xs:element name="callerid" type="xs:string" minOccurs="0"/> <xs:element name="final" type="boolType" minOccurs="0"/> <xs:element name="alarm" type="alarmType" minOccurs="0"/> <xs:element name="log" type="logType" minOccurs="0"/> </xs:all> </xs:complexType> </xs:element> <xs:element name="result"> <xs:complexType> <xs:choice> <xs:element name="local" type="localResultType"/> <xs:element name="teleconference" type="teleconferenceResultType"/> <xs:element name="ivr" type="ivrResultType"/> <xs:element name="external" type="templateExternalResultType"/> <xs:element name="incomplete" type="incompleteResultType"/> <xs:element name="no_route" type="no_routeResultType"/> <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> </xs:element> </xs:sequence> <xs:attribute name="name" type="xs:string" use="required"/> <xs:attribute name="type" type="contextTypeType" use="optional"/> <xs:attribute name="digitmap" type="digitmapType" use="optional"/> <xs:attribute name="description" type="xs:string" use="optional"/> <!--obsolete--> </xs:complexType> <xs:element name="context" type="contextType"/> <xs:element name="template_context" type="templateContextType"/> <!-- actionCallingType --> <xs:complexType name="actionCallingType"> <xs:attribute name="category" type="categoryType" use="optional"/> <xs:attribute name="caller_id" type="stringType" use="optional"/> <xs:attribute name="display_name" type="stringType" use="optional"/> <xs:attribute name="sorm_digits" type="stringType" use="optional"/> <xs:attribute name="sorm_ni" type="enumNiType" use="optional"/> </xs:complexType> <!-- conditionCallingType --> <xs:complexType name="conditionCallingType"> <xs:attribute name="access_private" type="booleanType" use="optional"/> <xs:attribute name="access_local" type="booleanType" use="optional"/> <xs:attribute name="access_zone" type="booleanType" use="optional"/> <xs:attribute name="access_international" type="booleanType" use="optional"/> <xs:attribute name="access_intercity" type="booleanType" use="optional"/> <xs:attribute name="access_emergency" type="booleanType" use="optional"/> <xs:attribute name="have_access_to" type="atomType" use="optional"/> <xs:attribute name="category" type="categoryType" use="optional"/> <xs:attribute name="caller_id" type="stringType" use="optional"/> <xs:attribute name="display_name" type="stringType" use="optional"/> <xs:attribute name="source_ip" type="stringType" use="optional"/> <xs:attribute name="sorm_digits" type="stringType" use="optional"/> <xs:attribute name="sorm_ni" type="enumNiType" use="optional"/> <xs:attribute name="interface_group" type="stringType" use="optional"/> <xs:attribute name="iface" type="binaryType" use="optional"/> </xs:complexType> <xs:complexType name="calledType"> <xs:attribute name="sorm_digits" type="stringType" use="optional"/> <xs:attribute name="sorm_ni" type="enumNiType" use="optional"/> </xs:complexType> <xs:simpleType name="contextTypeType"> <xs:restriction base="xs:string"> <xs:enumeration value="local"/> <xs:enumeration value="transit"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="categoryType"> <xs:restriction base="xs:string"> <xs:enumeration value="unknownAtThisTime"/> <xs:enumeration value="operatorFrench"/> <xs:enumeration value="operatorEngish"/> <xs:enumeration value="operatorGerman"/> <xs:enumeration value="operatorRussian"/> <xs:enumeration value="operatorSpanish"/> <xs:enumeration value="reserved"/> <xs:enumeration value="ordinarySubscriber"/> <xs:enumeration value="subscriberWithPriority"/> <xs:enumeration value="dataCall"/> <xs:enumeration value="testCall"/> <xs:enumeration value="spare"/> <xs:enumeration value="payphone"/> <xs:enumeration value="category0"/> <xs:enumeration value="hotelsSubscriber"/> <xs:enumeration value="freeSubscriber"/> <xs:enumeration value="paidSubscriber"/> <xs:enumeration value="localSubscriber"/> <xs:enumeration value="localTaksofon"/> <xs:enumeration value="autoCallI"/> <xs:enumeration value="semiautoCallI"/> <xs:enumeration value="autoCallII"/> <xs:enumeration value="semiautoCallII"/> <xs:enumeration value="autoCallIII"/> <xs:enumeration value="semiautoCallIII"/> <xs:enumeration value="autoCallIV"/> <xs:enumeration value="semiautoCallIV"/> <xs:enumeration value="0"/> <xs:enumeration value="1"/> <xs:enumeration value="2"/> <xs:enumeration value="3"/> <xs:enumeration value="4"/> <xs:enumeration value="5"/> <xs:enumeration value="6"/> <xs:enumeration value="7"/> <xs:enumeration value="8"/> <xs:enumeration value="9"/> <xs:enumeration value="10"/> <xs:enumeration value="11"/> <xs:enumeration value="12"/> <xs:enumeration value="13"/> <xs:enumeration value="14"/> <xs:enumeration value="15"/> <xs:enumeration value="16"/> <xs:enumeration value="17"/> <xs:enumeration value="18"/> <xs:enumeration value="19"/> <xs:enumeration value="20"/> <xs:enumeration value="21"/> <xs:enumeration value="22"/> <xs:enumeration value="23"/> <xs:enumeration value="24"/> <xs:enumeration value="25"/> <xs:enumeration value="26"/> <xs:enumeration value="27"/> <xs:enumeration value="28"/> <xs:enumeration value="29"/> <xs:enumeration value="30"/> <xs:enumeration value="31"/> <xs:enumeration value="32"/> <xs:enumeration value="33"/> <xs:enumeration value="34"/> <xs:enumeration value="35"/> <xs:enumeration value="36"/> <xs:enumeration value="37"/> <xs:enumeration value="38"/> <xs:enumeration value="39"/> <xs:enumeration value="40"/> <xs:enumeration value="41"/> <xs:enumeration value="42"/> <xs:enumeration value="43"/> <xs:enumeration value="44"/> <xs:enumeration value="45"/> <xs:enumeration value="46"/> <xs:enumeration value="47"/> <xs:enumeration value="48"/> <xs:enumeration value="49"/> <xs:enumeration value="50"/> <xs:enumeration value="51"/> <xs:enumeration value="52"/> <xs:enumeration value="53"/> <xs:enumeration value="54"/> <xs:enumeration value="55"/> <xs:enumeration value="56"/> <xs:enumeration value="57"/> <xs:enumeration value="58"/> <xs:enumeration value="59"/> <xs:enumeration value="60"/> <xs:enumeration value="61"/> <xs:enumeration value="62"/> <xs:enumeration value="63"/> <xs:enumeration value="64"/> <xs:enumeration value="65"/> <xs:enumeration value="66"/> <xs:enumeration value="67"/> <xs:enumeration value="68"/> <xs:enumeration value="69"/> <xs:enumeration value="70"/> <xs:enumeration value="71"/> <xs:enumeration value="72"/> <xs:enumeration value="73"/> <xs:enumeration value="74"/> <xs:enumeration value="75"/> <xs:enumeration value="76"/> <xs:enumeration value="77"/> <xs:enumeration value="78"/> <xs:enumeration value="79"/> <xs:enumeration value="80"/> <xs:enumeration value="81"/> <xs:enumeration value="82"/> <xs:enumeration value="83"/> <xs:enumeration value="84"/> <xs:enumeration value="85"/> <xs:enumeration value="86"/> <xs:enumeration value="87"/> <xs:enumeration value="88"/> <xs:enumeration value="89"/> <xs:enumeration value="90"/> <xs:enumeration value="91"/> <xs:enumeration value="92"/> <xs:enumeration value="93"/> <xs:enumeration value="94"/> <xs:enumeration value="95"/> <xs:enumeration value="96"/> <xs:enumeration value="97"/> <xs:enumeration value="98"/> <xs:enumeration value="99"/> <xs:enumeration value="100"/> <xs:enumeration value="101"/> <xs:enumeration value="102"/> <xs:enumeration value="103"/> <xs:enumeration value="104"/> <xs:enumeration value="105"/> <xs:enumeration value="106"/> <xs:enumeration value="107"/> <xs:enumeration value="108"/> <xs:enumeration value="109"/> <xs:enumeration value="110"/> <xs:enumeration value="111"/> <xs:enumeration value="112"/> <xs:enumeration value="113"/> <xs:enumeration value="114"/> <xs:enumeration value="115"/> <xs:enumeration value="116"/> <xs:enumeration value="117"/> <xs:enumeration value="118"/> <xs:enumeration value="119"/> <xs:enumeration value="120"/> <xs:enumeration value="121"/> <xs:enumeration value="122"/> <xs:enumeration value="123"/> <xs:enumeration value="124"/> <xs:enumeration value="125"/> <xs:enumeration value="126"/> <xs:enumeration value="127"/> <xs:enumeration value="128"/> <xs:enumeration value="129"/> <xs:enumeration value="130"/> <xs:enumeration value="131"/> <xs:enumeration value="132"/> <xs:enumeration value="133"/> <xs:enumeration value="134"/> <xs:enumeration value="135"/> <xs:enumeration value="136"/> <xs:enumeration value="137"/> <xs:enumeration value="138"/> <xs:enumeration value="139"/> <xs:enumeration value="140"/> <xs:enumeration value="141"/> <xs:enumeration value="142"/> <xs:enumeration value="143"/> <xs:enumeration value="144"/> <xs:enumeration value="145"/> <xs:enumeration value="146"/> <xs:enumeration value="147"/> <xs:enumeration value="148"/> <xs:enumeration value="149"/> <xs:enumeration value="150"/> <xs:enumeration value="151"/> <xs:enumeration value="152"/> <xs:enumeration value="153"/> <xs:enumeration value="154"/> <xs:enumeration value="155"/> <xs:enumeration value="156"/> <xs:enumeration value="157"/> <xs:enumeration value="158"/> <xs:enumeration value="159"/> <xs:enumeration value="160"/> <xs:enumeration value="161"/> <xs:enumeration value="162"/> <xs:enumeration value="163"/> <xs:enumeration value="164"/> <xs:enumeration value="165"/> <xs:enumeration value="166"/> <xs:enumeration value="167"/> <xs:enumeration value="168"/> <xs:enumeration value="169"/> <xs:enumeration value="170"/> <xs:enumeration value="171"/> <xs:enumeration value="172"/> <xs:enumeration value="173"/> <xs:enumeration value="174"/> <xs:enumeration value="175"/> <xs:enumeration value="176"/> <xs:enumeration value="177"/> <xs:enumeration value="178"/> <xs:enumeration value="179"/> <xs:enumeration value="180"/> <xs:enumeration value="181"/> <xs:enumeration value="182"/> <xs:enumeration value="183"/> <xs:enumeration value="184"/> <xs:enumeration value="185"/> <xs:enumeration value="186"/> <xs:enumeration value="187"/> <xs:enumeration value="188"/> <xs:enumeration value="189"/> <xs:enumeration value="190"/> <xs:enumeration value="191"/> <xs:enumeration value="192"/> <xs:enumeration value="193"/> <xs:enumeration value="194"/> <xs:enumeration value="195"/> <xs:enumeration value="196"/> <xs:enumeration value="197"/> <xs:enumeration value="198"/> <xs:enumeration value="199"/> <xs:enumeration value="200"/> <xs:enumeration value="201"/> <xs:enumeration value="202"/> <xs:enumeration value="203"/> <xs:enumeration value="204"/> <xs:enumeration value="205"/> <xs:enumeration value="206"/> <xs:enumeration value="207"/> <xs:enumeration value="208"/> <xs:enumeration value="209"/> <xs:enumeration value="210"/> <xs:enumeration value="211"/> <xs:enumeration value="212"/> <xs:enumeration value="213"/> <xs:enumeration value="214"/> <xs:enumeration value="215"/> <xs:enumeration value="216"/> <xs:enumeration value="217"/> <xs:enumeration value="218"/> <xs:enumeration value="219"/> <xs:enumeration value="220"/> <xs:enumeration value="221"/> <xs:enumeration value="222"/> <xs:enumeration value="223"/> <xs:enumeration value="224"/> <xs:enumeration value="225"/> <xs:enumeration value="226"/> <xs:enumeration value="227"/> <xs:enumeration value="228"/> <xs:enumeration value="229"/> <xs:enumeration value="230"/> <xs:enumeration value="231"/> <xs:enumeration value="232"/> <xs:enumeration value="233"/> <xs:enumeration value="234"/> <xs:enumeration value="235"/> <xs:enumeration value="236"/> <xs:enumeration value="237"/> <xs:enumeration value="238"/> <xs:enumeration value="239"/> <xs:enumeration value="240"/> <xs:enumeration value="241"/> <xs:enumeration value="242"/> <xs:enumeration value="243"/> <xs:enumeration value="244"/> <xs:enumeration value="245"/> <xs:enumeration value="246"/> <xs:enumeration value="247"/> <xs:enumeration value="248"/> <xs:enumeration value="249"/> <xs:enumeration value="250"/> <xs:enumeration value="251"/> <xs:enumeration value="252"/> <xs:enumeration value="253"/> <xs:enumeration value="254"/> <xs:enumeration value="255"/> </xs:restriction> </xs:simpleType> <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="enumNiType"/> </xs:complexType> <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="enumNiType"/> <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> <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="enumNiType"/> </xs:complexType> <xs:simpleType name="naiType"> <xs:restriction base="xs:string"> <xs:enumeration value="spare"/> <xs:enumeration value="subscriberNumber"/> <xs:enumeration value="unknown"/> <xs:enumeration value="nationalNumber"/> <xs:enumeration value="internationNumber"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="inniType"> <xs:restriction base="xs:string"> <xs:enumeration value="routingToInternalNumberAllowed"/> <xs:enumeration value="routingToInternalNumberNotAllowed"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="npiType"> <xs:restriction base="xs:string"> <xs:enumeration value="spare"/> <xs:enumeration value="isdnTelephony"/> <xs:enumeration value="dataNumberingPlan"/> <xs:enumeration value="telexNumberingPlan"/> <xs:enumeration value="reserved1"/> <xs:enumeration value="reserved2"/> <xs:enumeration value="reserved3"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="enumNiType"> <xs:restriction base="xs:string"> <xs:enumeration value="private"/> <xs:enumeration value="local"/> <xs:enumeration value="zone"/> <xs:enumeration value="intercity"/> <xs:enumeration value="international"/> <xs:enumeration value="emergency"/> </xs:restriction> </xs:simpleType> <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="enumNiType"/> </xs:complexType> <xs:simpleType name="apriType"> <xs:restriction base="xs:string"> <xs:enumeration value="presentationAllowed"/> <xs:enumeration value="presentationRestricted"/> <xs:enumeration value="addressNotAvailable"/> <xs:enumeration value="spare"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="screeningType"> <xs:restriction base="xs:string"> <xs:enumeration value="userProvidedNotVerified"/> <xs:enumeration value="userProvidedVerifiedAndPassed"/> <xs:enumeration value="userProvidedVerifiedAndFailed"/> <xs:enumeration value="networkProvided"/> </xs:restriction> </xs:simpleType> <xs:complexType name="valueType"> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> <xs:simpleType name="maxLoadType"> <xs:restriction base="xs:string"> <xs:pattern value="([0-9]+)|([0-9]{1,2}%)|(100%)"/> </xs:restriction> </xs:simpleType> <xs:complexType name="trunkType"> <xs:attribute name="value" type="xs:string" use="required"/> <xs:attribute name="weight" type="xs:integer" use="optional"/> <xs:attribute name="max_load" type="maxLoadType" use="optional"/> </xs:complexType> <xs:complexType name="boolType"> <xs:attribute name="value" type="xs:boolean" use="required"/> </xs:complexType> <xs:complexType name="alarmType"> <xs:attribute name="severity" type="alarmSeverity" use="required"/> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="logType"> <xs:attribute name="severity" type="logSeverity" use="required"/> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> <xs:simpleType name="alarmSeverity"> <xs:restriction base="xs:string"> <xs:enumeration value="warning"/> <xs:enumeration value="minor"/> <xs:enumeration value="major"/> <xs:enumeration value="critical"/> <xs:enumeration value="indeterminate"/> <xs:enumeration value="cleared"/> </xs:restriction> </xs:simpleType> <xs:simpleType name="logSeverity"> <xs:restriction base="xs:string"> <xs:enumeration value="error"/> <xs:enumeration value="warning"/> <xs:enumeration value="info"/> </xs:restriction> </xs:simpleType> <xs:complexType name="nullType"/> <xs:complexType name="optionsType"> <xs:sequence> <xs:element name="option" type="keyvalType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="keyvalType"> <xs:attribute name="key" type="xs:string" use="required"/> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="externalResultType"> <xs:sequence> <xs:element name="trunk" type="trunkType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <xs:complexType name="templateExternalResultType"> <xs:sequence> <xs:element name="trunk" type="trunkType" minOccurs="0" maxOccurs="unbounded"/> <xs:element name="template_trunk" type="trunkType" minOccurs="0" maxOccurs="unbounded"/> </xs:sequence> </xs:complexType> <!-- Result types --> <xs:complexType name="localResultType"/> <xs:complexType name="callcenterResultType"/> <xs:complexType name="teleconferenceResultType"/> <xs:complexType name="ivrResultType"> <xs:attribute name="script" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="directionResultType"> <xs:attribute name="value" type="xs:string" use="required"/> </xs:complexType> <xs:complexType name="incompleteResultType"> <xs:attribute name="timeout" type="xs:decimal" use="optional"/> </xs:complexType> <xs:complexType name="no_routeResultType"> <xs:attribute name="isup_cause" type="xs:string" use="optional"/> </xs:complexType> <xs:complexType name="continueResultType"> <xs:attribute name="tag" type="xs:string" use="optional"/> <xs:attribute name="context" type="xs:string" use="optional"/> </xs:complexType> </xs:schema>
Более подробную информацию о параметрах можно посмотреть в разделе: Детальное описание конфигурационного файла маршрутизации .
Пример:
Запрос: http://192.168.1.21:9999/commands/show_context
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="hc_show_context.xsd"> <request domain="biysk.local" context="ctx_city_common"/> </in>
Ответ:
<?xml version="1.0"?> <out xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_show_context.xsd"> <context>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz48Y29udGV4dCB4bWxuczp4cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhzOm5vTmFtZXNwYWNlU2NoZW1hTG9jYXRpb249ImVjc3Nfcm91dGluZy54c2QiIG5hbWU9ImN0eF9jaXR5X2NvbW1vbiIgbnA9Im5wXzI0MCIgZGlnaXRtYXA9ImF1dG8iPjxydWxlIG5hbWU9InNzd19sb2NhbCI+PGNvbmRpdGlvbnM+PGNkcG4gZGlnaXRzPSIzODU0MjQwPz8/IiBuYWk9Im5hdGlvbmFsTnVtYmVyIi8+PC9jb25kaXRpb25zPjxhY3Rpb25zPjxjZHBuIG5pPSJwcml2YXRlIiBkaWdpdHM9Ins1LDYsNyw4LDksMTB9IiBuYWk9InN1YnNjcmliZXJOdW1iZXIiLz48L2FjdGlvbnM+PHJlc3VsdD48bG9jYWwvPjwvcmVzdWx0PjwvcnVsZT48cnVsZSBuYW1lPSJ0b19lbXMxIj48Y29uZGl0aW9ucz48Y2RwbiBkaWdpdHM9IjM4NTQyNDU/Pz8iIG5haT0ibmF0aW9uYWxOdW1iZXIiLz48L2NvbmRpdGlvbnM+PGFjdGlvbnM+PGNkcG4gbmk9ImxvY2FsIiBkaWdpdHM9Ins1LDYsNyw4LDksMTB9IiBuYWk9InN1YnNjcmliZXJOdW1iZXIiLz48L2FjdGlvbnM+PHJlc3VsdD48ZXh0ZXJuYWw+PHRydW5rIHZhbHVlPSJlbXMxIiB3ZWlnaHQ9IjEiLz48L2V4dGVybmFsPjwvcmVzdWx0PjwvcnVsZT48cnVsZSBuYW1lPSJ0b19lbXMyIj48Y29uZGl0aW9ucz48Y2RwbiBkaWdpdHM9IjM4NTQyNDY/Pz8iIG5ha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48Y2RwbiBuaT0iaW50ZXJuYXRpb25hbCIvPjwvYWN0aW9ucz48cmVzdWx0Pjxjb250aW51ZSBjb250ZXh0PSJjdHhfdG9fZXdzZCIvPjwvcmVzdWx0PjwvcnVsZT48L2NvbnRleHQ+</context> </out>
Hc_delete_context
Команда предназначена для удаления контекста маршрутизации из системы.
Аналог команды в CoCon:
/domain/test.domain/routing/delete
Метод HTTP-запроса:
POST
Шаблон HTTP-запроса:
http://host:port/commands/delete_context
Код HTTP-ответа:
При выполнение команды HTTP-терминал может ответить следующими сообщениями:
204 – в случае успеха;
404 – в случае ошибки.
XSD-схема XML-файла c запросом:
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified"> <!-- 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> </xs:schema>
Пример:
Запрос: http://192.168.1.21:9999/commands/delete_context
<?xml version="1.0" encoding="UTF-8"?> <in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="hc_delete_context.xsd"> <request domain="ct.office" context="default_routing" /> </in>