Skip to content

Test result and metrics

The Sipfront REST API allows to query the test result status (passed/failed) and recorded metrics data:

  • run (session)
    • status
    • metrics dimensions
    • metrics data
  • test
    • latest run status
    • metrics dimensions
    • metrics data
    • historical results
  • project
    • latest run status
    • project run status

Query a run (session)

A particular run is identified by the session_id.

Query the session status

AUTH="$public_key:$secret"
SESSION_ID="bae59eae-c123-45ee-6789-6cb5e9a2b1c2"
curl "https://app.sipfront.com/api/v2/runs/$SESSION_ID/status" \
    -u "$AUTH"

While a test is running, you will receive run.status set to running:

{
  "run": {
    "status": "running"
  },
  "status": 200
}

A finished test yields the detailed information about the test run, again with run.status indicating whether the test run succeeded or not, and if it failed, run.result_description giving you the reason:

{
  "run": {
    "agentpool_name": "eu-central-1",
    "has_passed": 1,
    "id": 12345,
    "is_failed": 0,
    "is_finished": 1,
    "project_id": 1,
    "project_name": "my-project-name",
    "result_description": "",
    "session_id": "bae59eae-c123-45ee-6789-6cb5e9a2b1c2",
    "started_at": "2024-02-09 08:20:18",
    "status": "passed",
    "stopped_at": "2024-02-09 08:22:13",
    "tags": "[\"media\", \"prod\", \"validation\"]",
    "test_id": 123,
    "test_name": "your-test-name",
    "testcase_name": "Media analysis for Audio Call"
  },
  "status": 200
}

Query the session metrics dimensions

AUTH="$public_key:$secret"
SESSION_ID="bae59eae-c123-45ee-6789-6cb5e9a2b1c2"
curl -u "$AUTH" "https://app.sipfront.com/api/v2/runs/$SESSION_ID/stats"

The response will list all role and direction dimension values for each measure available in the recorded metrics data of the particular session.

{
  "stats_dimensions": [
    {
      "dir": "in",
      "role": "callee",
      "stats_measure": "rtp_byte_per_sec"
    },
    {
      "dir": "out",
      "role": "callee",
      "stats_measure": "rtp_byte_per_sec"
    },
    {
      "dir": "in",
      "role": "callee",
      "stats_measure": "rtp_jitter"
    },
    {
      "dir": "out",
      "role": "callee",
      "stats_measure": "rtp_jitter"
    },
    {
      "dir": "in",
      "role": "callee",
      "stats_measure": "rtp_lost"
    },
    {
      "dir": "out",
      "role": "callee",
      "stats_measure": "rtp_lost"
    },
    {
      "dir": "in",
      "role": "callee",
      "stats_measure": "rtp_lost_per_sec"
    },
    {
      "dir": "out",
      "role": "callee",
      "stats_measure": "rtp_lost_per_sec"
    },
    {
      "dir": "in",
      "role": "callee",
      "stats_measure": "rtp_mos"
    },
    {
      "dir": "out",
      "role": "callee",
      "stats_measure": "rtp_mos"
    },
    {
      "dir": "in",
      "role": "callee",
      "stats_measure": "rtp_pkt_per_sec"
    },
    {
      "dir": "out",
      "role": "callee",
      "stats_measure": "rtp_pkt_per_sec"
    },
    {
      "dir": "in",
      "role": "callee",
      "stats_measure": "rtp_rtt"
    },
    {
      "dir": "out",
      "role": "callee",
      "stats_measure": "rtp_rtt"
    }
  ],
  "status": 200
}

Query the session metrics data

The metrics data of the session can be requested by measure name.

AUTH="$public_key:$secret"
SESSION_ID="bae59eae-c123-45ee-6789-6cb5e9a2b1c2"
curl -u "$AUTH" "https://app.sipfront.com/api/v2/runs/$SESSION_ID/stats/rtp_mos"

The response contains the precalculated stats for the measure data points of the session.

{
  "stats_data": [
    {
      "avg": "0.0",
      "dir": "in",
      "max": "0.0",
      "median": "0.0",
      "min": "0.0",
      "p75": "0.0",
      "p90": "0.0",
      "p95": "0.0",
      "role": "callee",
      "session_id": "da9400e8-f02f-11ef-b072-48c6cf16d63e",
      "stddev": "0.0",
      "time": "2025-02-21 08:42:59"
    },
    {
      "avg": "0.0",
      "dir": "out",
      "max": "0.0",
      "median": "0.0",
      "min": "0.0",
      "p75": "0.0",
      "p90": "0.0",
      "p95": "0.0",
      "role": "callee",
      "session_id": "da9400e8-f02f-11ef-b072-48c6cf16d63e",
      "stddev": "0.0",
      "time": "2025-02-21 08:42:59"
    }
  ],
  "status": 200
}

The metric results can be filtered for dimension values, which can be passed as URL query parameters, eg. https://app.sipfront.com/api/v2/runs/$SESSION_ID/stats/rtp_mos?role=callee&dir=out.

  • role: call party
    • caller
    • callee
    • A, B, C, ...
  • dir: for call direction
    • in
    • out
  • confidence: transcription confidence
    • min
    • max
    • avg

Query a test

A test contains all its sessions and is identified by the test id.

Query the latest session status of a test

AUTH="$public_key:$secret"
curl -u "$AUTH" https://app.sipfront.com/api/v2/tests/1814/status/last

Query the metrics dimensions of sessions of the test

AUTH="$public_key:$secret"
curl -u "$AUTH" https://app.sipfront.com/api/v2/tests/1814/stats

The response lists all role and direction dimension values for a measure available in the recorded metrics data of all sessions of the test.

Query the metrics data of sessions of the test

The metrics data of all sessions of the test can be requested by measure name.

AUTH="$public_key:$secret"
curl -u "$AUTH" https://app.sipfront.com/api/v2/tests/1814/stats/rtp_mos

The metric results can be filtered for dimension values, which can be passed as URL query parameters, eg. https://app.sipfront.com/api/v2/tests/1814/stats/rtp_mos?role=callee&dir=out.

Query a project

A project contains all its tests and is identified by the project id.

Query the latest session status of project tests

AUTH="$public_key:$secret"
curl -u "$AUTH" https://app.sipfront.com/api/v2/projects/149/status/last

The response contains latest session status for each test of the project.

{
  "status": 200,
  "tests": [
    {
      "run": {
        "has_passed": 1,
        "id": 1641196,
        "is_failed": 0,
        "is_finished": 1,
        "result_description": "",
        "session_id": "8da774cc-f2a5-11ef-a72c-d1fc36c8e3f6",
        "started_at": "2025-02-24 11:50:33",
        "status": "passed",
        "stopped_at": "2025-02-24 11:51:43"
      },
      "test": {
        "agentpool_name": "eu-central-1",
        "callback_on_failure": 1,
        "callback_template_name": null,
        "callback_url": "",
        "description": null,
        "id": 1281,
        "name": "Selenium Test TLS v4",
        "retries_on_failure": 0,
        "tags": "[\"selenium-test\"]",
        "testcase_name": "Media analysis for Audio Call"
      }
    },
    {
      "run": {
        "has_passed": 1,
        "id": 1641194,
        "is_failed": 0,
        "is_finished": 1,
        "result_description": "",
        "session_id": "2f998f46-f2a5-11ef-a958-f7e7f115047b",
        "started_at": "2025-02-24 11:47:55",
        "status": "passed",
        "stopped_at": "2025-02-24 11:49:06"
      },
      "test": {
        "agentpool_name": "eu-central-1",
        "callback_on_failure": 1,
        "callback_template_name": null,
        "callback_url": "",
        "description": null,
        "id": 1282,
        "name": "Selenium Test UDP v4",
        "retries_on_failure": 0,
        "tags": "[\"selenium-test\"]",
        "testcase_name": "Media analysis for Audio Call"
      }
    }
  ]
}

Query project run status

After starting a project run via POST /projects/{id}/run, poll its progress using the returned status_url or directly:

AUTH="$public_key:$secret"
PROJECT_RUN_UUID="bae59eae-c123-45ee-6789-6cb5e9a2b1c2"
curl -u "$AUTH" "https://app.sipfront.com/api/v2/projects/run/$PROJECT_RUN_UUID/status"

The response contains the project run summary and a per-test list in the run object.