Appearance
Setup time and its breakdown
Setup time is usually the first thing to break when a PBX runs out of capacity: calls are still answered and the audio is still fine, but callers wait longer and longer. This page explains what PBXsight measures, how the p95 is computed, and how FreeSWITCH's own timestamps split the time into parts so you can see where it goes.
First step: run a call test with ESL connected, then open the run page's Where the setup time goes card.
What setup time is
setup time = first INVITE sent → 200 OK received
It includes the whole call setup as a caller experiences it:
tester ── INVITE ──────────────► SIP entry point ──► FreeSWITCH
tester ◄── 407 Proxy Auth ───── (challenge)
tester ── ACK, INVITE (auth) ──► … dialplan, routing, callee leg …
tester ◄── 100 / 180 ──────────
tester ◄── 200 OK ───────────── ◄── setup time ends here- The authentication round trip (407/401 challenge and the second INVITE) is included.
- The connection is not: calls go over the caller's existing registration connection (callers register as virtual phones first, like real phones), so TLS handshakes happen before, not per call.
- Only answered calls have a setup time. A call that fails or times out has none (it counts in the answer rate).
- For calls to test extensions, the callee's virtual phone answers at once — so the setup time is the PBX's work plus the network, not a human picking up.
Registration tests measure the same way: response time = first REGISTER → 200 OK, including the 401 challenge round, over successful registrations.
Percentiles: why p95
Averages hide slow calls: a few calls of several seconds barely move the average of hundreds of 200 ms calls. p95 is the value that 95 % of calls were faster than (at most 5 % slower), so it lands right on the slow tail. That is why the setup and response time checks use p95.
PBXsight uses the nearest-rank method: sort all values, then
rank = ⌈ 0.95 × n ⌉ p95 = the value at that rank (1-based)
Worked example
20 answered calls, sorted (ms): 180, 190, 195, 200, 205, 210, 212, 215, 220, 225, 230, 232, 238, 240, 248, 255, 270, 310, 1 600, 3 000.
Average = 434 ms — looks fine. Rank = ⌈0.95 × 20⌉ = 19 → p95 = 1 600 ms. A check "p95 ≤ 500 ms" fails: more than 5 % of the calls (2 of 20) took over 500 ms.
With 200 calls the p95 is the 190th value; with 10 calls it is the 10th — the slowest one. That is why trend windows need at least 5 setup times before their p95 is judged.
The same method gives p5 for MOS (the value only the worst 5 % fall below). The run's p95 is over all answered calls of the run; a window's or step's p95 over the calls answered in it.
Where the setup time goes (FreeSWITCH breakdown)
With ESL, FreeSWITCH's CHANNEL_ANSWER event of every answered test call carries its leg's state timestamps (Caller-Channel-Created-Time, Caller-Channel-Answered-Time, …). PBXsight pairs the caller's leg into FreeSWITCH (A leg, inbound) with FreeSWITCH's leg to the callee (B leg, outbound) by Other-Leg-Unique-ID (else variable_originator on the B leg), in either event order, and splits:
| Part | From → to | What happens there |
|---|---|---|
| Before FreeSWITCH | tester setup − in FreeSWITCH | network, SIP entry point (e.g. Kamailio), rtpengine's offer, the 407 round trip |
| In FreeSWITCH | A created → A answered | everything FreeSWITCH saw of the call |
| Dialplan | A created → B created | routing, dialplan, database lookups |
| Callee leg | B created → B answered | out to the callee (through the proxy and relay again) and back |
| Back to caller | B answered → A answered | FreeSWITCH bridging the answer (media, SRTP keys) |
tester setup = before FreeSWITCH + in FreeSWITCH
in FreeSWITCH = dialplan + callee leg + back to caller
in FreeSWITCH = dialplan + callee leg + back to caller
Calls to a number that FreeSWITCH answers itself (the echo test) have no B leg: only in FreeSWITCH and before FreeSWITCH. A part outside 0–120 s means the pairing or the clocks don't fit; that call's split is dropped. Unpaired legs are kept for up to 2 minutes, waiting for their partner. FreeSWITCH's timestamps come in steps of roughly 20 ms, so small values are coarse.

Before FreeSWITCH, per call
Every test INVITE carries X-PBXsight-Call: <Call-ID>. When a call is answered, the tester reports its setup time with that Call-ID; FreeSWITCH's A leg carries the header back as variable_sip_h_X-PBXsight-Call (if the proxy dropped it, the SIP Call-ID is used). The two are joined in either order:
before = tester setup − FreeSWITCH's A created → A answered
- FreeSWITCH's answer time can exceed the tester's setup by a little (its ~20 ms timestamp steps): up to 50 ms more is accepted and counted as 0. More than that means the two records aren't the same call (or the clocks don't fit) — not joined.
- Each side waits up to 2 minutes for the other.
- The card shows before FreeSWITCH as avg · p95 and how many calls were joined.
For runs recorded before the per-call join existed, before FreeSWITCH is the difference of the two averages (tester setup average − in-FreeSWITCH average).
Worked example
A limit run with three steps (test extensions):
| Step | Tester setup avg | Before FS | In FS | Dialplan | Callee leg | Back |
|---|---|---|---|---|---|---|
| 1 CPS | 380 ms | 110 ms | 270 ms | 190 ms | 70 ms | 10 ms |
| 2 CPS | 400 ms | 111 ms | 289 ms | 205 ms | 73 ms | 11 ms |
| 3 CPS | 820 ms | 160 ms | 660 ms | 560 ms | 85 ms | 15 ms |
The growth from step 1 to step 3 (+440 ms) is mostly the dialplan (+370 ms): FreeSWITCH's per-call work, not the network or the callee. The hint "Most of the extra setup time is FreeSWITCH dialplan" says the same (What to look at) — check FreeSWITCH's CPU and its database.
The Steps card of a find-the-limit run has the same table per step (Where the setup time goes), so you see which part grows with the load.
Slowest calls
The card lists the run's 20 slowest answered calls, and the 3 slowest of each trend window or limit step (pick one in the list):
- Ranked by the tester's setup time when the call was joined; otherwise by FreeSWITCH's A created → answered (a lower bound). Ties: the earlier call first.
- Columns: Created (FreeSWITCH) — A leg creation time on FreeSWITCH's clock, to the millisecond; Call (caller → destination, tenant domain); Tester setup; Before FreeSWITCH; In FreeSWITCH; Dialplan, Callee leg, Back (when the B leg was paired); Ids.
- Copy ids copies the SIP Call-ID and both leg UUIDs.
A call that was slow at the tester but quick inside FreeSWITCH lost its time on the way: network, the SIP proxy, rtpengine or the authentication round trip. Search the Call-ID in the Kamailio and rtpengine logs and the UUID in FreeSWITCH's log (uuid_dump while it's up): one slow call followed through every component often shows more than the averages.
Post-dial delay (PBX watch)
A PBX watch places no calls, so there is no tester setup time. Instead it measures post-dial delay inside FreeSWITCH, from each inbound call's own timestamps when the call ends:
PDD = channel created → first ringing (180, or 183 early media — whichever came first)
- Only the FreeSWITCH part: time spent in a proxy before FreeSWITCH is not included.
- Calls FreeSWITCH answered without ringing first (echo test, IVR, voicemail, a device that answers on the INVITE) are counted apart as answered without ringing (median and max): their time includes how long the callee took to answer, which isn't a post-dial delay.
- Values outside 0–120 s are dropped. The watch's Post-dial delay p95 check uses
max_setup_p95_ms(off by default) — see Pass / fail verdict.