Call tracing and log collection

Requests

HTTP verb Endpoint Description

GET

/api/monitor/v1/trace/calls

Receiving call data

GET

/api/monitor/v1/trace/clear

Deleting call data

GET

/api/monitor/v1/trace/closure

Receiving closures by call

GET

/api/monitor/v1/trace/closure_total

Obtaining closure on a call across all roles

GET

/api/monitor/v1/trace/trn

Building trn logs

GET

/api/monitor/v1/trace/trn_sec

Collection of trn logs for the last N sec

GET

/api/monitor/v1/trace/activity_diagram

Building a call activity diagram

POST

/api/monitor/v1/diagram/trn

Building a diagram of call activity based on the previously collected archive with logs

GET

/api/monitor/v1/trace/scripts

Collecting scenario logs

GET

/api/monitor/v1/trace/starttrace

starttrace

GET

/api/monitor/v1/trace/stoptrace

stoptrace

GET

/api/monitor/v1/trace/cleartrace

cleartrace

GET

/api/monitor/v1/trace/downloadtrace

downloadtrace

GET

/api/monitor/v1/trace/whereis

whereis

GET

/api/monitor/v1/trace/processnode

processnode

GET

/api/monitor/v1/trace/processinfo

processinfo

GET

/api/monitor/v1/trace/processstatistics

processstatistics

GET

/api/monitor/v1/trace/processdebug

processdebug

Receiving call data

Domain Type: any

Information about parties of calls processed in the system for the last 20 minutes. Data from incoming sip requests are used to generate the result (invite packets).

Request

Request example
GET /api/monitor/v1/trace/calls HTTP/1.1

Response

Response example
HTTP/1.1 200 OK

{
  "resultcode": 0,
  "resultmsg": "OK",
  "data": [
    {
      "site": "central",
      "servers": [
        {
          "srvidx": 10,
          "role": "b2bua",
          "node": "b2bua1@192.168.0.84",
          "addr": "192.168.0.84",
          "online": true,
          "calls": [
            {
              "callid": "1870585125@192.168.0.204",
              "from": "<sip:sip1@test.ceceron.ru>",
              "remoteip": "192.168.0.84",
              "tick": 1573719378842,
              "time": "2019-11-14T08:16:18.84+00:00",
              "to": "<sip:13@test.ceceron.ru>",
              "media": {
                "mgc": "r_mgc_3",
                "mgc_srvidx": 4,
                "mgc_node": "mgc1@192.168.0.84",
                "mg": "rtx_mg_192.168.0.84_def_804",
                "msid": "rDlg-00A-RW0JeV_O9rV",
                "ctx": 447234580
              }
            }
          ]
        },
        {
          "srvidx": 30,
          "role": "sg",
          "node": "mix1ws1gate2@192.168.0.84",
          "addr": "192.168.0.84",
          "online": true,
          "calls": [
            {
              "callid": "rB2-00A-RW0JeV-01-1870585125@192.168.0.204",
              "from": "<sip:11@test.ceceron.ru>",
              "remoteip": "192.168.0.84",
              "tick": 1573719378950,
              "time": "2019-11-14T08:16:18.95+00:00",
              "to": "<sip:sip3@test.ceceron.ru>"
            },
            {
              "callid": "1870585125@192.168.0.204",
              "from": "<sip:sip3@test.ceceron.ru>",
              "remoteip": "192.168.0.84",
              "tick": 1573719380369,
              "time": "2019-11-14T08:16:20.36+00:00",
              "to": "\"test_sip1\" <sip:sip1@test.ceceron.ru>"
            }
          ]
        }
      ]
    }
  ]
}
Table 1. Key Description
Name Description

srvidx

Role ID (roleid).

role

Role type.

node

The node on which the role is running.

addr

Node address.

online

Availability of node for statistics collection.

calls

Call shoulders served by the role.

calls.callid

callid sides A.

calls.from

uri sides A

calls.remoteip

B side address.

calls.tick

Timestamp (in ms) of receiving the request.

calls.time

Time of receipt of request.

calls.to

uri B sides.

calls.media

Media usage data.

calls.media.mgc

Role key mgc serving side of the call

calls.media.mgc_srvidx

Role ID (roleid) mgc.

calls.media.mgc_node

Noda mgc.

calls.media.mg

Key of the role used mg.

calls.media.msid

Media owner’s sip ID.

calls.media.ctx

Context number.

Deleting call data

Domain type: master

Deleting call information temporarily placed in the trace cache.
Data is automatically deleted after 3 hours from the time of posting.

Request

Request example
GET /api/monitor/v1/trace/clear HTTP/1.1

Response

Response example
HTTP/1.1 200 OK

{
  "resultcode": 0,
  "resultmsg": "OK",
  "data": [
    {
      "site": "central",
      "servers": [
        {
          "srvidx": 10,
          "role": "b2bua",
          "node": "b2bua1@192.168.0.84",
          "addr": "192.168.0.84",
          "online": true,
          "result": true
        },
        {
          "srvidx": 30,
          "role": "sg",
          "node": "mix1ws1gate2@192.168.0.84",
          "addr": "192.168.0.84",
          "online": true,
          "result": true
        }
      ]
    }
  ]
}
Table 2. Key Description
Name Description

srvidx

Role ID (roleid).

role

Role type.

node

The node on which the role is running.

addr

Node address.

online

Availability of node for statistics collection.

result

Result of the operation.

Receiving closures by call

Domain type: master

Search for related callid in binding to each instance of microservices responsible for SIP signaling (b2b, esg, sg, ivr, conf, prompt).
Related are considered:

  • all shoulders of a single dialog (including parallel call forks, intercepts, forwarding);

  • chains of translated calls (REFER requests and headers) Referred-By);

  • shoulders of spoofed calls (headers Replaces);

  • external callids cut off by microservice esg.

Closure is constructed by chain discovery of the entire closed group of connected callid.
The closure data is stored in the cache for 3 hours, after which it is automatically deleted. After partial deletion of linkage information from microservices caches, the closure is narrowed down.

The return value contains an enumeration of all the SIP microservices, each of which is correlated with those callid values from the closure that passed through it.

Request

Table 3. Request parameters
Specification Description

Name: callid
Type: str

Callid to be searched.

Name: callids
Type: str

Comma separated list of callid to be searched by.

Request example
GET /api/monitor/v1/trace/closure?callid=2354976089@192.168.0.204 HTTP/1.1

Response

Response example
HTTP/1.1 200 OK

{
  "resultcode": 0,
  "resultmsg": "OK",
  "data": [
    {
      "site": "central",
      "servers": [
        {
          "srvidx": 10,
          "role": "b2bua",
          "node": "b2bua1@192.168.0.84",
          "addr": "192.168.0.84",
          "online": true,
          "closure": [
            "2354976089@192.168.0.204",
            "rB2-00A-DV5ylJ-01-2354976089@192.168.0.204"
          ]
        },
        {
          "srvidx": 30,
          "role": "sg",
          "node": "mix1ws1gate2@192.168.0.84",
          "addr": "192.168.0.84",
          "online": true,
          "closure": [
            "2354976089@192.168.0.204"
          ]
        }
      ]
    }
  ]
}
Table 4. Key Description
Name Description

srvidx

Role ID (roleid).

role

Role type.

node

The node on which the role is running.

addr

Node address.

online

Availability of node for statistics collection.

closure

List of related callids within a role.

Obtaining closure on a call across all roles

Domain type: master

Search for related callid across all instances of microservices responsible for SIP signaling (b2b, esg, sg, ivr, conf, prompt).
Related are considered:

  • all shoulders of a single dialog (including parallel call forks, intercepts, forwarding);

  • chains of translated calls (REFER requests and headers) Referred-By);

  • shoulders of spoofed calls (headers Replaces);

  • external callids cut off by microservice esg.

Closure is constructed by chain discovery of the entire closed group of connected callid.
The closure data is stored in the cache for 3 hours, after which it is automatically deleted. After partial deletion of linkage information from microservices caches, the closure is narrowed down.

The return value contains a total list of all the entries in the closure callid.

Request

Table 5. Request parameters
Specification Description

Name: callid
Type: str

Callid to be searched.

Name: callids
Type: str

Comma separated list of callid to be searched by.

Request example
GET /api/monitor/v1/trace/closure_total?callid=3001546688@192.168.0.204 HTTP/1.1

Response

Response example
HTTP/1.1 200 OK

{
  "resultcode": 0,
  "resultmsg": "OK",
  "data": {
    "closure": [
      "3001546688@192.168.0.204",
      "rB2-00A-GTKZJR-01-3001546688@192.168.0.204"
    ]
  }
}
Table 6. Key Description
Name Description

closure

List of related callid for all roles.

Building trn logs

Domain Type: any

Trn logs from all sip roles in the system are collected based on a closure built on the specified callid or group callids.

The result is returned in the selected format ('format'):

  • A sequence diagram where the actors are all the devices and microservices that participated in call servicing and are mentioned in the logs.

  • An archive with trn logs of all participating microservice instances responsible for SIP signaling and participating in the service of at least one callid from the closure.

Adequate assembly of logs is possible only:

  • within the last 3 hours, since it is built based on closures, which in turn are built based on the links between callids stored in the cache for just over 3 hours.

  • based on data from microservices where trn logging is enabled (parameter 'log_trn' of the microservice in configuration).

Request

Table 7. Request parameters
Specification Description

Name: callid
Type: str

Callid to be searched.

Name: callids
Type: str

Comma separated list of callid to be searched by.

Name: format
Type: str
Default: svg

Result return format. Possible values:

  • svg – page containing plantuml diagram in format svg.

  • plantuml – chart text.

  • logs – log files.

You can save a diagram created in svg format.
In order for the saved diagram to be clickable, it should be saved in the mode "Webpage, complete".
You can also manually place a js directory with the two libraries referenced by the html page.
You need to download these files, place them in the 'js' directory next to the html page, and in the html content, replace the paths to the js libraries (e.g., from '/js/…​' to './js/…​').

Request example
GET /api/monitor/v1/trace/trn?callid=2627900225@192.168.0.204&mode=logs HTTP/1.1

Response

Response example
HTTP/1.1 200 OK

<content> (1)
1 <content> – result in *.zip format, which contains log files.

Collection of trn logs for the last N sec

Collect logs for the last N seconds from all microservices instances serving SIP signaling.

Assembly is possible only on those microservices where trn logging is enabled (microservice 'log_trn' parameter in configuration).

Request

Table 8. Request parameters
Specification Description

Name: callid
Type: str

Callid to be searched.

Name: callids
Type: str

Comma separated list of callid to be searched by.

Name: sec
Type: int

Number of seconds into the past. Possible values: from 1 to 3600 inclusive.

Request example
GET /api/monitor/v1/trace/trn_sec?callid=3935249258@192.168.0.204 HTTP/1.1

Response

Response example
HTTP/1.1 200 OK

<content> (1)
1 <content> – result in *.zip format, which contains log files.

Building a call activity diagram

Domain Type: any

Forming a UML diagram of the sequence from trn logs of all microservices instances serving SIP signaling.

Actors are all devices and microservices that participated in call servicing and are mentioned in the logs.

Adequate assembly of logs is possible only:

  • within the last 3 hours, since it is built based on closures, which in turn are built based on the links between callids stored in the cache for just over 3 hours.

  • based on data from microservices where trn logging is enabled (parameter 'log_trn' of the microservice in configuration).

In order for the saved diagram to be clickable, it should be saved in the mode "Webpage, complete".
You can also manually place a js directory with the two libraries referenced by the html page.
You need to download these files, place them in the 'js' directory next to the html page, and in the html content, replace the paths to the js libraries (e.g., from '/js/…​' to './js/…​').

Request

Table 9. Request parameters
Specification Description

Name: callid
Type: str

Callid to be searched.

Name: callids
Type: str

Comma separated list of callid to be searched by.

Name: format
Type: str
Default: svg

Result return format. Possible values:

  • svg – page containing plantuml diagram in format svg.

  • plantuml – chart text.

Request example
GET /api/monitor/v1/trace/activity_diagram?callid=2627900225@192.168.0.204&mode=svg HTTP/1.1

Response

Response example
HTTP/1.1 200 OK

<content> (1)
1 <content> – html page containing a diagram in the format svg.

Building a diagram of call activity based on the previously collected archive with logs

Domain Type: any

Forming UML sequence diagram from the archive with trn logs collected earlier, including on another instance of the system, using a query /api/monitor/v1/trace/trn?mode=logs.

Actors are all devices and microservices that participated in call servicing and are mentioned in the logs.

In order for the saved diagram to be clickable, it should be saved in the mode "Webpage, complete".
You can also manually place a js directory with the two libraries referenced by the html page.
You need to download these files, place them in the 'js' directory next to the html page, and in the html content, replace the paths to the js libraries (e.g., from '/js/…​' to './js/…​').

Request

Request example
POST /api/monitor/v1/diagram/trn HTTP/1.1
Content-Type: multipart/form-data

<content> (1)
1 <content> – zip-log archive trn..

Response

Response example
HTTP/1.1 200 OK

<content> (1)
1 <content> – html page containing a diagram in the format svg.

Collecting scenario logs

Collect logs of the specified type of scenarios from roles at the current site.

Request

Table 10. Request parameters
Specification Description

Name: type
Type: str

Type of scenario for which logs should be collected. Possible values: ivr, svc.

Name: start
Type: int

Number of minutes in the past.

Name: duration
Type: int

The duration of the log for assembly in minutes. Possible values from 1 to 1440.

Name: code
Type: str
Default: empty

The code of the scenario for which the logs should be collected.

Request example
GET /api/monitor/v1/trace/scripts?type=svc&start=60&duration=30 HTTP/1.1

Response

Response example
HTTP/1.1 200 OK

<content> (1)
1 <content> – result in *.zip format, which contains log files.

starttrace

Description in progress

stoptrace

Description in progress

cleartrace

Description in progress

downloadtrace

Description in progress

whereis

Description in progress

processnode

Description in progress

processinfo

Description in progress

processstatistics

Description in progress

processdebug

Description in progress