Hc_sip_pcap_trace_start

Команда позволяет начать запись tcp-dump на SIP-адаптере.

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

cluster/adapter/<PA_SIP>/pcap-trace/start

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

POST

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

http://host:port/commands/sip_pcap_trace_start

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

  • 201 – в случае успеха;
  • 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" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:attribute name="id" use="required" type="xs:string">
                            <xs:annotation>
                                <xs:documentation xml:lang="en">
                                    Unique identifier of the pcap trace. Used to stop current pcap trace.
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="cluster" use="required" type="xs:string">
                            <xs:annotation>
                                <xs:documentation xml:lang="en">
                                    SIP adapter's cluster name.
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="node" use="required" type="xs:string"/>
                        <xs:attribute name="ip" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation xml:lang="en">
                                    One of the properties ip, ip_set must be defiled.
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="ip_set" use="optional" type="xs:string">
                            <xs:annotation>
                                <xs:documentation xml:lang="en">
                                    One of the properties ip, ip_set must be defiled.
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="port" use="optional" type="xs:string"/>
                        <xs:attribute name="reply_host" use="required" type="xs:string"/>
                        <xs:attribute name="reply_port" use="required" type="xs:integer"/>
                    </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>


CODE

Пример 1:

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
    <request port="" reply_port="51679" ip="192.168.2.61" node="sip1@ecss1" cluster="sip1" reply_host="192.168.2.21" id="51679"/>
</in>
CODE

Ответ: 201

Пример 2:

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

<?xml version="1.0" encoding="UTF-8"?>
<in
    xmlns:xs="http://www.w3.org/2001/XMLSchema-instance">
    <request port="" reply_port="4444" ip="192.168.2.21" node="sip1@ecss1" cluster="sip1" reply_host="192.168.2.21" id="4444"/>
</in>
CODE

Ответ:  201

Hc_sip_pcap_trace_stop

Команда позволяет остановить запись tcp-dump на SIP-адаптере.

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

cluster/adapter/<PA_SIP>/pcap-trace/stop

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

POST

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

http://host:port/commands/sip_pcap_trace_stop

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

  • 204 – в случае успеха;
  • 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:element name = "in">
        <xs:complexType>
            <xs:all>
                <xs:element name="request" minOccurs="1" maxOccurs="1">
                    <xs:complexType>
                        <xs:attribute name="id" use="required" type="xs:string">
                            <xs:annotation>
                                <xs:documentation xml:lang="en">
                                    Unique identifier of the pcap trace. Used to stop current pcap trace.
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                        <xs:attribute name="cluster" use="required" type="xs:string">
                            <xs:annotation>
                                <xs:documentation xml:lang="en">
                                    SIP adapter's cluster name.
                                </xs:documentation>
                            </xs:annotation>
                        </xs:attribute>
                    </xs:complexType>
                </xs:element>
            </xs:all>
        </xs:complexType>
    </xs:element>
</xs:schema>


CODE

Пример:

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

<?xml version="1.0" encoding="UTF-8"?>
<in xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" xs:noNamespaceSchemaLocation="sip_pcap_trace_stop.xsd">
    <request id="4444" cluster="sip1" />
</in>
CODE

Ответ: 204