Skip to content

Audio quality and MOS ​

Call tests with media send real audio and measure it. Three different parties report on that audio: the tester (PBXsight's own media engine), FreeSWITCH (over ESL, at hangup) and, if configured, rtpengine (from RTCP). They look at different parts of the path, in different directions. This page explains how each number is computed, what limits it has, and how to read them together.

First step: on a call run's page, look at the Audio quality card and the Media path card; when the MOS is missing, the card says why.

The test signal ​

The media engine sends one RTP (or SRTP) stream per answered call, in the call's codec (G.722 by default, or G.711 μ-law / A-law): one packet every 20 ms, 50 per second, for the hold time. The audio is a 400.5 Hz tone, 1 s on / 1 s off, at about −12 dBFS, looped every 2 s.

The odd 400.5 Hz is deliberate: the tone's phase shifts in every 20 ms frame, so every tone frame is unique. When a frame comes back (an echo) or arrives at the other leg, the tester can look it up and know exactly when it was sent. Silence frames are all alike and are not used for timing.

Packet loss (RFC 3550) ​

Every RTP packet carries a 16-bit sequence number. The receiver tracks the highest sequence number seen (with wrap-around past 65 535) and counts what arrived:

expected = highest extended sequence number − first sequence number + 1
lost     = max(0, expected − received)
loss %   = lost ÷ expected × 100

For a run (or a window), loss is summed over calls, not averaged: Σ lost ÷ Σ expected. A long call weighs more than a short one, as it should. A new SSRC (e.g. after a re-INVITE) restarts the count for that stream.

Jitter (RFC 3550 interarrival jitter) ​

Packets leave exactly 20 ms apart but arrive at 18, 25, 15, 22 ms… For each packet i after the first:

D = (arrivali − arrivali−1) − (timestampi − timestampi−1)   (in RTP clock units, 8 kHz)
J = J + (|D| − J) ÷ 16
jitter ms = J ÷ 8000 × 1000

The per-call value is the estimate at the end of the call (the highest estimate during the call is kept too). G.711 and G.722 both use an 8 kHz RTP clock.

Round trip (echo destinations) ​

With an echo destination (9196 or *9196) the audio that comes back is the tester's own. Each returning tone frame is looked up by its payload; the time since that frame was sent is one round-trip sample (samples above 1.5 s are discarded, the signal loops every 2 s). Per call the average round trip is kept; the run's Round trip p95 is the 95th percentile of the per-call averages.

If the returning audio doesn't match any sent frame — no echo, or the PBX transcoded the audio (a different codec changes every byte) — there is no round trip. Loss and jitter still work.

One-way delay (calls between test extensions) ​

Calls between test extensions have a media stream on each side: the callers' engine and the virtual phones' engine run in the same PBXsight process, on the same clock. The two streams of a call are linked by the X-PBXsight-Call header the caller puts on its INVITE (the PBX passes it on to the callee). Each side looks up the frames it receives in the other side's send log:

one-way delay = arrival time − the time the peer sent that frame

Both directions are measured separately: caller → callee (what the phones received) and callee → caller (what the callers received). The verdict's Round trip p95 for such calls is the sum of the two one-way p95 values — an upper bound of the real round trip p95. If the PBX drops the header, the legs can't be linked: loss and jitter are still measured per direction, the delay isn't.

The MOS estimate (E-model) ​

MOS (Mean Opinion Score) is a 1–5 rating of call quality, originally from real listeners. Network tools estimate it. PBXsight uses the simplified ITU-T G.107 E-model common in VoIP monitors (Cole & Rosenbluth): one-way delay = round trip ÷ 2, jitter counted twice as de-jitter buffer delay, 10 ms of codec/processing delay, 2.5 R-points per percent of loss.

effective latency L = RTT ÷ 2 + 2 × jitter + 10   (ms)
R = 93.2 − L ÷ 40           if L < 160
R = 93.2 − (L − 120) ÷ 10   if L ≥ 160
R = R − 2.5 × loss %
MOS = 1 + 0.035 R + 0.000007 × R × (R − 60) × (100 − R)   (MOS = 1 if R ≤ 0; capped at 1…4.5; rounded to 2 decimals)
  • Echo calls: RTT = the call's average round trip.
  • Calls between test extensions: RTT = 2 × the call's average one-way delay (the formula halves it again).
  • The run's MOS is the average of the per-call values; p5 is the value only the worst 5 % of calls fall below; min the worst call. Calls with no audio back are counted apart (they'd otherwise read as perfect) and don't enter the average.
Worked example 1: a healthy echo call

Round trip 60 ms, jitter 2 ms, loss 0.5 %.

L = 60 ÷ 2 + 2 × 2 + 10 = 44 ms → R = 93.2 − 44 ÷ 40 = 92.1 → R = 92.1 − 2.5 × 0.5 = 90.85

MOS = 1 + 0.035 × 90.85 + 0.000007 × 90.85 × 30.85 × 9.15 = 1 + 3.180 + 0.180 = 4.36

Worked example 2: a bad path

Round trip 400 ms, jitter 30 ms, loss 3 %.

L = 200 + 60 + 10 = 270 ms (≥ 160) → R = 93.2 − (270 − 120) ÷ 10 = 78.2 → R = 78.2 − 7.5 = 70.7

MOS = 1 + 2.475 + 0.000007 × 70.7 × 10.7 × 29.3 = 3.63

RTTJitterLossMOS
0 ms0 ms0 %4.40
20 ms1 ms0 %4.40
90 ms3 ms0 %4.38
150 ms5 ms1 %4.30
40 ms2 ms2 %4.27
400 ms30 ms3 %3.63

The estimate's ceiling ​

With a perfect path (no delay, no jitter, no loss) the formula still gives R = 92.95 → MOS 4.40: the E-model's narrowband ceiling. So the tester's MOS never reaches 4.5, and a value of 4.3–4.4 is excellent. This is a narrowband-style comparison figure, not a perceptual score — G.722's wideband audio doesn't score higher. Use it to compare runs and to catch degradation, with thresholds around 4.0 (the default).

FreeSWITCH's MOS ​

With ESL, FreeSWITCH reports per channel at hangup what it received on that leg (rtp_audio_in_* channel variables): its own MOS estimate (rtp_audio_in_mos, 1–4.5), a quality percentage, media packets and skipped packets (lost or too late). PBXsight averages the MOS over the test calls that carried audio and computes:

FreeSWITCH loss % = skipped ÷ (media packets + skipped) × 100

In a load test these are the run's inbound test legs — what FreeSWITCH received from the tester's callers. In a PBX watch it is every SIP leg (each party's upstream), with legs below MOS 3.6 counted as poor, and legs answered for 2 s or more without any media packet as silent. FreeSWITCH's MOS has no delay in it: only loss and jitter.

rtpengine's MOS (RTCP) ​

rtpengine computes MOS, jitter, round trip and loss from the RTCP reports the endpoints send, and reports them as averages over every call it relays (host totals, all traffic). The tester's media engine sends RTCP (tester.rtcp, on by default): every 5 s per stream a compound Sender Report with a reception report of the audio it receives, plus the CNAME, from the RTP port + 1 to the remote's RTP port + 1 (SRTCP in SRTP mode). A round-trip time — and with it rtpengine's MOS — needs RTCP from the other side too; FreeSWITCH sends none by default (the Media path card shows how many RTCP reports the tester sent and received). See rtpengine metrics.

Which direction each one sees ​

caller (tester) ──► rtpengine ──► FreeSWITCH ──► (callee / echo) ──► FreeSWITCH ──► rtpengine ──► tester
       └──────── FreeSWITCH MOS ────────┘
       └──────────────────────── tester MOS (echo: round trip, incl. delay) ─────────────────────┘
                 └── rtpengine RTCP MOS: from the endpoints' reports, all calls ──┘
Tester MOSFreeSWITCH MOSrtpengine MOS
Measured byPBXsight's media engineFreeSWITCHrtpengine, from RTCP
Which audiowhat came back (echo) or arrived from the other legwhat FreeSWITCH received from the callerwhat endpoints report in RTCP
Directionecho: round trip · test extensions: each direction one wayone way, into FreeSWITCHper call, as reported
Delay includedyesnoyes, when both sides send RTCP
Scopethis run's callsthis run's calls (watch: all legs)all calls through rtpengine
Needsmedia rtp/srtpESL + mediartpengine source + RTCP

Reading them together ​

Tester MOSFreeSWITCH MOSLikely meaning
highhighthe audio path is healthy in both directions
a bit lower (e.g. 4.3 vs 4.4)highnormal: the tester covers both directions plus delay
lowhightrouble on the way back (FreeSWITCH → relay → tester), or a lot of delay
lowlowtrouble already on the way to FreeSWITCH, or in the relay

The tester's MOS is closest to what a caller hears; FreeSWITCH's tells you which half of the path a problem is in. The Media path card adds packet counts per hop (and, with rtpengine, what the relay received from the tester and forwarded), which usually settles it.

Media path card
Media path: what the tester sent and received, what FreeSWITCH reported, and the relay in between.

"No audio back" ​

A call where audio was sent but nothing arrived is counted as no audio — it doesn't enter the MOS average (an empty stream would look perfect). If no call of a run received audio, the tester's MOS and loss checks fail rather than being skipped: silence is a real result. Typical causes: the PBX or relay sends RTP to an address the tester can't receive on (NAT, a wrong tester.media_ip), SRTP keys that don't decrypt (counted as undecryptable), or a firewall dropping the tester's RTP ports.

Late frames: when the tester itself falls behind ​

Each send worker checks every 5 ms which frames are due. A frame sent 60 ms or more after its time, or never sent before the stream ended, is counted as late (Media path card: Late). Late frames look like jitter and loss to the far end, so the tester's own audio numbers would understate the real quality. At 0.1 % late frames or more, the hint "The tester's media engine fell behind" appears (What to look at). Remedies: more media sockets (tester.media_sockets, default 4; the OS serializes one UDP socket's packets), fewer concurrent calls with audio, or a less busy tester machine.

PBXsight — load testing and monitoring for FreeSWITCH PBXes. Only test systems you own or may test.