Skip to content

Test extensions on the PBX ​

PBXsight tests the PBX the way phones use it: its callers and callees register with real SIP accounts and authenticate with digest, exactly like desk phones or softphones. So the PBX needs accounts that only the tester uses, a number that answers calls by itself (the echo test), and a CSV file that tells PBXsight those accounts. This page covers the extensions, the CSV format, and the PBX settings that change how tests behave.

First step: create a few test extensions on the PBX (a separate domain or range nobody else uses) — Create the test extensions.

Why dedicated test extensions ​

  • No real phone rings. In calls between test extensions, the PBX rings every device registered on the callee's extension. If a person's phone shares that extension, it rings too.
  • Counts stay clean. PBX-side numbers (Registered on PBX, hangup causes, FreeSWITCH MOS) are matched to the test by tags in the SIP requests and by extension + domain. A separate tenant makes the match exact.
  • Limits fit the test. Per-extension call limits and registration settings can be set for load without touching real users.

Create the test extensions ​

  1. A dedicated domain if the PBX is multi-tenant, e.g. loadtest.example.com. Extension 1000 in this domain can't collide with 1000 of a real tenant, and PBXsight's ESL matching is per domain, so a real 1000 elsewhere is never counted as test traffic.

  2. Directory users for the test extensions. In plain FreeSWITCH that is one file per extension in conf/directory/default/ (vanilla FreeSWITCH ships 1000–1019); a management GUI on top of FreeSWITCH creates the same users from its extension pages. A minimal user:

    xml
    <include>
      <user id="2000">
        <params>
          <param name="password" value="a-long-random-secret"/>
        </params>
        <variables>
          <variable name="user_context" value="default"/>
        </variables>
      </user>
    </include>

    Don't keep the vanilla default password ($${default_password}, 1234) on a reachable PBX. Apply with fs_cli -x 'reloadxml'. The domain in the CSV is the directory's domain (by default the host's IP or $${domain}).

  3. Per-extension call limits. If the PBX caps concurrent calls per extension (a limit in the dialplan or a setting of a management GUI), remember that call tests spread calls round-robin over the callers: pick at least max concurrent calls ÷ the limit callers, or raise the limit. Otherwise the extra calls fail with 486 USER_BUSY — a tester setting, not a PBX problem.

    Worked example

    A call test at 5 CPS with a 30 s hold keeps about 5 × 30 = 150 calls up. With a limit of 5 calls per extension that needs at least 150 ÷ 5 = 30 callers; take 40 for headroom.

  4. The echo test. Calls to a number need a destination the PBX answers by itself. In the vanilla FreeSWITCH dialplan that is extension 9196 (conf/dialplan/default.xml, extension echo: answer + echo): it sends every packet back, so the tester measures the round trip. Some FreeSWITCH-based platforms use *9196 instead. Both are in the profile's Allowed call destinations by default; the number must exist in the test domain's dialplan.

Write the CSV file ​

Upload it on the Extensions page; each set belongs to the profile selected in the top bar.

csv
username,password,domain,auth_user,display_name
1000,Secret-1000,loadtest.example.com,,Test 1000
1001,Secret-1001,loadtest.example.com,,
2000,Secret-2000,other.example.com,2000-auth,
ColumnRequiredMeaning
usernameyesthe extension (SIP user); aliases user, extension, ext
passwordyesits SIP password; aliases pass, secret
domainnoSIP domain = digest realm (the tenant on a multi-tenant PBX); aliases realm, host. Empty: the profile's Default domain
auth_usernodigest user name if it differs from the extension; aliases authuser, auth_username. Empty: username
display_namenoshown in From; aliases displayname, name

Rules, as the parser applies them:

  • Header row optional. A first row counts as a header when it names at least a username and a password column (any alias, any case); then columns can be in any order and unknown columns are ignored. Without a header the order is username,password,domain,auth_user,display_name.
  • Comma or semicolon: whichever appears more often in the first data line. A UTF-8 byte order mark (Excel) is ignored. Lines starting with # and blank lines are skipped.
  • Domains are lowercased. One set may mix tenants (domain per row); callers in calls between test extensions only call callees of their own domain.
  • Rejected values: ;, ", <, > and line breaks anywhere, and spaces or tabs in any column except display_name — they would break SIP headers.
  • Duplicates (same username + domain, case-insensitive) are rejected.
  • At most 20 000 extensions per set (file at most 10 MB).
  • All or nothing: if any line has a problem, nothing is imported and the problems are listed with their line numbers (the first 50).

Passwords are encrypted in the database (Secrets at rest), never returned by the API and never written to run files or logs.

Which extensions a test uses

Tests take extensions from the top of the set: a registration test with 50 extensions uses rows 1–50; calls between test extensions use the first callers rows as callers and the next callees rows as callees. Order the CSV accordingly.

Check the PBX settings that matter ​

Registrations and OPTIONS pings ​

Every test extension is a registered phone: callers in call, limit and busy hour tests register before the calls start (expiry 3600 s; a test with a fixed number of calls registers no more callers than calls), callees in calls between test extensions register too. Over TCP/TLS each keeps its connection open with a CRLF keepalive every 25 s and re-registers at a random 60–90 % of the granted expiry, so phones that registered together don't re-register together.

FreeSWITCH can ping registered contacts with OPTIONS (sofia's NAT / all-registrations options ping). The tester answers OPTIONS (and INFO, NOTIFY, MESSAGE) with 200 OK on the extension's connection, as a phone does — otherwise FreeSWITCH would consider the contacts dead and expire them.

The Registrar (sofia profile) field of the profile (internal by default) names the sofia profile the extensions register on; it is used for registration counts.

If PBXsight is killed before it can un-register, the registrations expire on their own (callers after up to 1 h, callees after up to 5 minutes).

sip_copy_custom_headers (calls between test extensions) ​

Each test INVITE carries X-PBXsight-Run: <run id> and X-PBXsight-Call: <Call-ID>. FreeSWITCH copies X- headers from the A leg to the B leg when sip_copy_custom_headers is true, which is the default. On the callee side the tester uses them to:

  • answer only calls of its own run (anything else gets 603 Decline);
  • pair the caller's and callee's audio streams, which gives one-way delay per direction (both ends share the tester's clock).

If your dialplan sets sip_copy_custom_headers=false, calls still work (the callee also accepts calls whose From is a caller of the run), but one-way delay can't be measured.

Test-traffic tagging ​

FreeSWITCH sees test traffic through these tags, so keep them intact anywhere in front of it:

  • X-PBXsight-Run: <run id> on every REGISTER and INVITE (FreeSWITCH exposes it as variable_sip_h_X-PBXsight-Run);
  • User-Agent: pbxsight/<run id>;
  • the extension + domain from the uploaded set.

A proxy that strips X- headers loses the first; the other two still match. See Kamailio.

Media ​

FreeSWITCH or the relay in front of it must accept the tester's audio: G.722 (default), PCMU or PCMA, over RTP or SDES-SRTP (a=crypto, AES_CM_128_HMAC_SHA1_80). Holds longer than FreeSWITCH's media timeout need media mode RTP or SRTP in the profile; with None the calls are hung up with MEDIA_TIMEOUT. See Audio quality and MOS.

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