SIP Load Testing FreeSWITCH: A Practical Guide for High-Performance VoIP

Introduction

FreeSWITCH is a powerful open-source telephony platform used for building PBXs, softswitches, VoIP gateways, and more. However, like any real-time communication service, performance under load is crucial. Whether you’re preparing for production traffic or debugging call performance issues, SIP load testing is essential.

In this article, we’ll explore how to simulate thousands of SIP calls to test FreeSWITCH’s scalability, monitor system metrics, and identify potential bottlenecks.

Tools for SIP Load Testing

Here are some commonly used tools:

Preparing the Environment

  • Dedicated server or VM (8+ cores, 16GB+ RAM recommended for high-load tests)
  • FreeSWITCH installed and configured (mod_sofia enabled)
  • Network ports (SIP signaling and RTP) open
  • At least one SIP profile configured for external testing (e.g., external)

Tuning FreeSWITCH

Before the test, ensure:

  • ulimit -n is increased (e.g., 65535)
  • FS has enough threads:
<param name="max-sessions" value="10000"/>

• RTP ports are configured in autonat.conf.xml or sofia.conf.xml correctly:

<param name="rtp-start-port" value="16384"/>
<param name="rtp-end-port" value="32768"/>

Using SIPp for Load Testing

Step 1: Install SIPp

sudo apt update
sudo apt install sipp

Step 2: Create a Test Scenario

Here’s a simple uas.xml (acts as UAS – FreeSWITCH is UAC):

<?xml version="1.0" encoding="ISO-8859-1" ?>
<scenario name="Basic SIP UAS">
  <recv request="INVITE"/>
  <send response="180"/>
  <pause milliseconds="1000"/>
  <send response="200"/>
  <recv request="ACK"/>
  <pause milliseconds="30000"/> <!-- Simulate 30s call -->
  <recv request="BYE"/>
  <send response="200"/>
</scenario>

Step 3: Run the Test

To send 100 simultaneous calls to FS:

sipp -sf uas.xml -r 10 -rp 1000 -m 1000 -l 100 192.168.1.10:5060

Flags:

• -r: Calls per second

• -rp: Repeat interval (ms)

• -m: Maximum calls

• -l: Maximum simultaneous calls

To register users first, you can create another register.xml scenario.