Skip to content

Stuck calls ​

A PBX under load (or with a bug) can leave call legs behind: a leg that never stops ringing, a call whose phone vanished without a BYE, a channel FreeSWITCH forgot to clean up, media still flowing through rtpengine for a call FreeSWITCH already ended. Such legs cost channels, ports and licences, and they distort every count. The stuck-call check looks for them during call tests and PBX watches and lists each one with what you need to find — and if you decide so, end — it.

First step: switch Stuck calls on in the profile (ESL needed; rtpengine adds the media rules), then look at the Stuck calls card of a call test or watch.

PBXsight never ends a call

The check only flags. Each flagged leg comes with a ready-made uuid_kill <uuid> to copy into fs_cli; run uuid_dump <uuid> first to see what the channel is. Killing is your decision.

Stuck calls card listing flagged legs
Stuck calls: rule, leg, call, age and why — with the UUID and a uuid_kill to copy.

When it runs ​

  • Run types: call tests, busy hour, find the limit and PBX watch. Not registration tests.
  • Needs ESL and the profile's stuck-call check switched on (stuck_calls.enabled, on by default).
  • Scope: in a load test only the run's own test legs are tracked (FreeSWITCH events tagged as test traffic); a PBX watch tracks all traffic, including calls that were already up when it started (from FreeSWITCH's channel list).
  • Checked every second; flagged legs are shown live and kept in the run's summary.

The data it joins ​

SourceWhat it givesHow often
FreeSWITCH events (ESL)every leg's create, answer and hangup, with UUID, SIP Call-ID, caller, destination, domainas they happen
FreeSWITCH's channel list (show channels as json)what FreeSWITCH really still has, and the call state (e.g. HELD)every 5 s while a run with the check is active
rtpengine per-call data (via pbxsight-agent, API 2)per session (SIP Call-ID): when it was created, each side's last packetevery rtpengine poll during the run (default 5 s)

The three are joined by UUID and SIP Call-ID (rtpengine keeps one session per SIP leg). The channel list is FreeSWITCH's truth: a leg PBXsight thinks is live but that is missing from two lists in a row lost its hangup event and is dropped quietly (not flagged). rtpengine data older than twice the poll interval plus 5 s (agent down) is ignored, so a frozen session list can't create false suspects.

The rules ​

Rule (card label)Flags a leg when…SettingDefault
Ringing too longit has not been answered for this longring_after3 min
Very long callit has been answered for this longlong_after4 h
No mediaFreeSWITCH still has the answered call (for at least this long), and rtpengine saw one side send no packet for this long (or never, since the session started)no_media_after30 s
Listed after hangupFreeSWITCH sent its hangup event but still lists the channel 15 s laterfixed15 s
rtpengine onlyan rtpengine session started during the watch whose Call-ID no FreeSWITCH channel has, older than thisorphan_after2 min

Allowed values: ring_after ≥ 10 s, long_after ≥ 1 min, no_media_after ≥ 10 s, orphan_after ≥ 40 s. Set them in the profile (stuck_calls section).

Details per rule:

  • No media needs rtpengine's per-call data. A leg FreeSWITCH lists as HELD is skipped (a held phone may legitimately send nothing). The detail says which side was silent and for how long.
  • Listed after hangup catches channels FreeSWITCH didn't clean up. Ended legs are forgotten 5 minutes after their hangup unless they are still listed.
  • rtpengine only runs only in a PBX watch with the channel list available (a load test sees only its own legs, so it can't tell). It skips sessions FreeSWITCH ended less than orphan_after ago (rtpengine keeps ended sessions for its delete-delay, ~30 s by default), sessions created in the first 10 s of the watch (they may predate its events), and sessions created within 10 s of a FreeSWITCH leg whose Call-ID is unknown (e.g. known only from the channel list after an ESL reconnect).

Not flagged on purpose ​

  • Ended calls that rtpengine still keeps for its delete-delay: FreeSWITCH no longer has them.
  • Legs whose hangup event was lost: the channel list shows they're gone.
  • Calls ringing or answered for less than the thresholds — which is why the defaults are generous: a real call may ring a minute or last an hour.

What the card shows ​

  • Per flagged leg: Rule, Leg (UUID, channel, direction), Call (caller → destination, domain, SIP Call-ID), Age (since the leg or session was created), Why (the rule's detail), when it was first flagged, and the uuid_kill command.
  • Tiles: Flagged now (live) / Flagged at the end with the peak flagged at once; During the run: distinct legs flagged at any time; a count per rule; the Limits in use.
  • A chart of flagged legs over time (the per-second count is also in the samples as suspects).
  • The list: Flagged now while running (Show all during the run switches), Flagged during the run afterwards — the first 100 distinct legs with their latest state. Copy all uuid_kill copies a command per listed leg (check them first).
  • The header names the sources the check had and its scope (this run's calls / all traffic). Without the channel list (or with its error, e.g. -ERR) only legs seen in events are checked; without rtpengine's per-call data the No media and rtpengine only rules can't run.

Stuck calls or just not answered? ​

Not every leg without media is stuck. rtpengine also lists legs of calls that were never answered — busy, rejected or cancelled offers. No side sent media on them, and none was expected. PBXsight counts those as not answered on the run page's Media path card and leaves them out of the stuck-call rules: No media only applies to calls FreeSWITCH still has answered, where one side stopped sending. In a busy hour, where many calls hit a busy callee, expect a sizeable not answered count and no stuck calls.

The criterion ​

CheckKeyDefaultValue
Stuck callsmax_suspect_callsoff (the form suggests 0)distinct flagged legs during the run — a leg flagged by two rules counts once per rule

The note shows the peak flagged at once, and "without FreeSWITCH's channel list" if that wasn't available. With the check switched off (or no ESL) the check is skipped. See Pass / fail verdict.

Worked example

A busy-hour run with rtpengine: a callee phone loses its network 40 s into a call. FreeSWITCH keeps the bridged call (no BYE arrives); rtpengine shows side B's last packet 31 s ago → No media: "rtpengine: side B sent no packet for 31 s, FreeSWITCH still has the call". If FreeSWITCH's RTP timeout ends the call later, the leg stays in seen during the run — the run's max_suspect_calls: 0 fails with value 1.

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