Compared with PJSIP, baresip and Linphone
Four SIP clients. One Asterisk. Every number off the wire.
The results
- The least memory of the four. 5.8 MB registered and idle, against 12.2 MB for baresip, 12.7 MB for pjsua and 57.7 MB for linphonec. A hundred calls up in 14.1 MB, where baresip needs 30.5 MB.
- The least CPU per call. A third to a half of one percent of a core per call; baresip spends 1.5 to 1.9 %, pjsua about 4.7 %. A hundred calls: 30 % of one core, against 151 % for baresip.
- Steady over three hours. Side by side, every call answered and held: 0.45 kB of memory kept per call, against 1.2 to 5.3 kB for the others, and the least processor time per call.
- One file to ship. 6.4 MB with its codecs and cryptography inside, where PJSIP and baresip come to 11 to 13 MB across 22 files and Linphone to 208 MB.
- The only INVITE that never fragments. 1236 bytes for an authenticated ICE call over UDP; the other three send theirs as IP fragments, which NATs and firewalls drop.
- Back in well under a second after a network change. 640 ms from the cut to audio heard again, on its own, the lab's 200 ms reconnection included. baresip and linphonec take over two seconds; pjsua left alone never comes back.
- Ten thousand calls in one process. Audio both ways on every one, set up at 499 a second.
-
Memory, registered and idle
Sipral5.8 MB pjsua12.7 MB baresip12.2 MB linphonec57.7 MB -
Processor time per call, three hours of three-minute calls
Sipral1.77 s pjsua10.46 s baresip4.08 s linphonec2.84 s -
The INVITE that sets up an ICE call
Sipral1236 B pjsua1869 B fragmented baresip1479 B fragmented, one run of two linphonec1594 B fragmented -
Audio back after the network changed
Sipral640 ms pjsuanever baresip2200 ms linphonec2100 ms
Ten thousand calls in one process
Every call G.711 over a UDP socket of its own with a tone both ways, placed at 500 a second and held sixty seconds. About 72 KB of memory and a thousandth of a core per call carrying audio, with more than half of the signalling thread's time still to spare at ten thousand calls.
| This end, over the hold | 5 000 calls | 10 000 calls |
|---|---|---|
| Calls up | 5 000 | 10 000 |
| Setup rate | 500 a second | 499 a second |
| Setup, INVITE to 2xx: p50, p90 | 2.6 ms, 6.3 ms | 7.5 ms, 95.6 ms |
| Processor | 5.32 cores | 8.48 cores |
| Resident memory, peak | 363 MB | 718 MB |
Registering and calling
From the first request to the 200 that accepted it, every client challenged once by Asterisk. Sipral registers and answers first. On a call it places without ICE the four are within a millisecond or two, and there the time is mostly the server's: a capture shows Sipral's authenticated INVITE leaving 0.17 to 0.23 ms after the challenge, pjsua's 0.24 to 0.34 ms.
| Each challenged once | Sipral | pjsua | baresip | linphonec |
|---|---|---|---|---|
| Registration, first REGISTER to its 200 | 3.1 ms | 12.8 ms | 4.4 ms | 25.0 ms |
| Incoming call, INVITE to the client’s 200 | 0.9 ms | 3.3 ms | 2.4 ms | 14.9 ms |
| Outgoing call, first INVITE to its 200 | 5.3 ms | 5.6 ms | 4.2 ms | 7.0 ms |
| Outgoing call with ICE, every codec | 3.5 ms | 4.9 ms | 4.3 ms | 31.0 ms |
Memory
Resident memory with the given number of calls offered. Sipral grows by about 84 kB a call, baresip by about 188 kB, pjsua by about a megabyte. Where a client took fewer calls than it was offered, the cell says how many it held.
| Calls | Sipral | pjsua | baresip | linphonec |
|---|---|---|---|---|
| idle | 5.8 MB | 12.7 MB | 12.2 MB | 57.7 MB |
| 1 | 5.9 MB | 13.7 MB | 12.2 MB | 58.8 MB |
| 4 | 6.2 MB | 16.7 MB | 12.8 MB | 1 up: 58.9 MB |
| 10 | 6.7 MB | 4 up: 16.8 MB | 14.0 MB | 1 up: 59.1 MB |
| 100 | 14.1 MB | 4 up: 16.7 MB | 30.5 MB | 1 up: 60.6 MB |
CPU
Share of one core over twenty seconds with the calls up. Per call above idle: Sipral 0.30 to 0.48 %, baresip 1.5 to 1.9 %, pjsua about 4.7 %. baresip passes a full core at about 65 calls; Sipral carries a hundred on under a third of one.
| Calls | Sipral | pjsua | baresip | linphonec |
|---|---|---|---|---|
| 1 | 1.10 % | 6.95 % | 2.20 % | 1.55 % |
| 4 | 1.95 % | 19.20 % | 7.55 % | 1 up: 1.70 % |
| 10 | 3.90 % | 4 up: 20.15 % | 16.85 % | 1 up: 1.80 % |
| 100 | 30.20 % | 4 up: 21.50 % | 150.75 % | 1 up: 2.10 % |
Three hours side by side
The four registered at once, each with its own account on one Asterisk, each taking one call after another for three hours: three minutes of tone, a keypad digit, then Asterisk hangs up. Registrations are held to one or two minutes, so each registers again all through the run. Memory, processor, descriptors and threads read every minute from each client's own process; growth counted from the end of the first hour. No client lost a call or stopped registering; the one call linphonec did not take was the harness's, which placed a second call over its first.
| Over three hours | Sipral | pjsua | baresip | linphonec |
|---|---|---|---|---|
| Calls placed / answered / held to the end | 59 / 59 / 59 | 59 / 59 / 59 | 59 / 59 / 59 | 60 / 59 / 59 |
| Registrations accepted | 123 | 96 | 103 | 103 |
| Resident memory at one hour, at three | 6.1, 6.2 MB | 13.8, 13.9 MB | 12.4, 12.5 MB | 57.8, 58.1 MB |
| Memory added per call after the first hour | 0.45 kB | 1.18 kB | 1.54 kB | 5.33 kB |
| Processor, mean over three hours | 0.95 % | 5.65 % | 2.21 % | 1.53 % |
| Processor time per call | 1.77 s | 10.46 s | 4.08 s | 2.84 s |
| Open descriptors, threads | 7, 2 | 6, 5 | 16, 7 | 15, 5 |
Three hours is not a day: at these rates a day would add 0.2 MB to Sipral and 0.6 to 2.5 MB to the others. Sipral then ran a week on its own against the same Asterisk: 3,337 calls and 6,795 registrations with no error, resident memory at 6.02 MB after the first day and 6.07 MB after the seventh.
What each ships
What an application has to carry to make calls on Linux x86-64: the stack's library and every shared library it loads, as each distribution installs them, with the codecs, NAT traversal and media encryption Sipral has inside. The C and C++ runtimes are left out for all four. Sipral is one file with Opus and its cryptography linked in, so its own library is larger than the others' own; they load OpenSSL, Opus and the rest from the system, and Debian's Linphone video codecs besides.
| MB of 106 bytes | Sipral | pjsua | baresip | linphonec |
|---|---|---|---|---|
| Everything, as installed | 6.36 MB, 1 file | 11.38 MB, 22 files | 13.22 MB, 22 files | 208.50 MB, 173 files |
| The project’s own libraries | 6.36 MB | 1.94 MB, 11 files | 1.38 MB, 10 files | 18.84 MB, 11 files |
The INVITE on the wire
The first INVITE, then the one sent again with credentials after the PBX's challenge. Sipral offers one ICE candidate per stream with RTCP on the RTP port and writes compact requests, so even its authenticated ICE offer stays under 1300 bytes and goes over UDP whole. A request split into IP fragments is the one a NAT or a firewall drops, and the call never rings.
| First / authenticated | Sipral | pjsua | baresip | linphonec |
|---|---|---|---|---|
| Default codecs, no ICE | 923 / 1222 B | 1371 / 1670 B, fragmented | 945 / 1228 B | 1134 / 1419 B |
| Default codecs, ICE | 1088 / 1236 B | 1570 / 1869 B, both fragmented | 1189 to 1196 / 1472 to 1479 B, fragmented in one run of two | 1309 / 1594 B, fragmented |
| G.711 only, ICE | 955 / 1254 B | 1165 / 1463 B | 1108 / 1391 B | 1213 / 1498 B, fragmented |
| Requests over 1300 bytes sent over UDP | none | yes | yes | yes |
A changed network
One call up, then the client taken off its network and put back at a new address, as a phone moves from Wi-Fi to mobile data. Sipral notices the move itself: it binds its signalling to the new address, registers again and offers the call again from there. Counted from the last audio before the cut; the lab's own reconnection, about 200 ms, is inside every figure alike.
| From the cut | Sipral | pjsua | baresip | linphonec |
|---|---|---|---|---|
| Audio heard again, left alone | 640 ms | never | 2200 ms | 2100 ms |
| Audio heard again, told by the application | 640 ms, noticed on its own | 340 ms | 1420 ms | no command to tell it |
| Call still up after 20 s | yes | yes, one way | yes | yes |
A bad link
One call held thirty seconds over each impairment profile, applied both ways. Each row is one end's view of the audio it received: loss, jitter and the E-model's R factor (ITU-T G.107), rated the same way for every client. All four hold the same band, R 68 to 80; one client moves more between two runs than the four differ from each other. Remeasured on 7 October 2026, two runs, with Asterisk's own jitter reading of each client's audio.
The jitter each client reports of what it received is not counted one way. These profiles put a third of the packets out of order. Sipral and baresip count every packet as it arrives, as RFC 3550 sets out, and read the mobile profile at 33 to 41 ms; pjsua and Asterisk read 17 to 23 ms, the figure the same packets give with those behind a later one left out. Computed both ways from one capture taken after the impairment, the same stream reads 35 to 39 ms and 20 to 28 ms.
| Profile | Measured by | Sipral | pjsua | baresip | linphonec |
|---|---|---|---|---|---|
| lossy | Asterisk, of the client | 7.33 %, 9 ms, R 69.8 | 6.54 %, 9 ms, R 71.8 | 6.51 %, 9 ms, R 71.7 | 7.01 %, 10 ms, R 70.4 |
| lossy | the client, of Asterisk | 7.99 %, 8.0 ms, R 68.2 | 5.7 %, 8.9 ms, R 73.9 | 6.82 %, 9.5 ms, R 71.1 | 6.50 %, no jitter reported |
| mobile | Asterisk, of the client | 3.32 %, 23 ms, R 78.9 | 4.56 %, 27 ms, R 75.2 | 3.92 %, 21 ms, R 77.3 | 4.50 %, 18 ms, R 75.8 |
| mobile | the client, of Asterisk | 4.01 %, 43.0 ms, R 72.9 | 4.0 %, 20.0 ms, R 77.1 | 3.82 %, 32.8 ms, R 77.6 | 3.24 %, no jitter reported |
| satellite | Asterisk, of the client | 0.20 %, 11 ms, R 72.6 | 0.51 %, 9 ms, R 72.4 | 0.59 %, 6 ms, R 73.3 | 0.19 %, 10 ms, R 72.7 |
| satellite | the client, of Asterisk | 0.58 %, 13.4 ms, R 71.5 | 0.3 %, 8.9 ms, R 73.1 | 0.38 %, 11.2 ms, R 72.9 | 0.45 %, no jitter reported |
| Profile | netem, both directions |
|---|---|
| lossy | delay 40ms 15ms loss gemodel 4% 40% 60% 2% reorder 1% 30% |
| mobile | delay 60ms 30ms distribution normal loss gemodel 2% 40% 60% 1% |
| satellite | delay 250ms 10ms distribution normal loss 0.5% |
Memory safety
SIP and SDP arrive from the network, from anyone who can reach the port. In a stack written in C, one wrong length in a parser is a buffer overflow an attacker can aim at. In 2026 alone, 24 vulnerabilities were published against PJSIP, 7 of them rated critical, and 22 of the 24 are memory errors: buffer overflows, use-after-free, reads out of bounds.
Sipral is Rust: that class of error does not compile. Unsafe code is confined to the C boundary and the audio device layer, and the parsers and protocol engines have taken 61 billion fuzzing executions without a crash.
Counted from the National Vulnerability Database on 8 October 2026; PJSIP's own record is in its published security advisories.
Methodology
- Date
- 8 October 2026, two full runs one after the other; the tables show the second, and the first agrees within its noise
- Host
- Debian 13, Linux 6.12.95, 32 cores, 62 GB, x86-64, a virtual machine
- PBX
- Asterisk 22.10.1, one account, G.711, one contact at a time
- Sipral
- 1.1: the headless agent example, release build, Rust 1.99.0, in debian:trixie-slim
- pjsua
- 2.17: PJSIP's own client, Alpine 3.24 package pjsua-2.17-r0
- baresip
- 4.11.0: Fedora 44 packages baresip, baresip-opus and baresip-g722 4.11.0
- linphonec
- 5.3.105: Linphone's command-line client, Debian 13 package linphone-cli 5.3.105
- Timing
- read off a packet capture taken in each client's own network namespace
- Memory, CPU
- resident memory from smaps_rollup, user plus system time over 20 seconds, the same /proc files for every client
- Calls
- originated by Asterisk, G.711 both ways; Sipral, pjsua and baresip echo what they hear, linphonec plays a recording
- A changed network
- the client container disconnected from its network and connected to another; counted from the last audio packet before the cut. Sipral's figure is the first run's; three further runs of the move alone agreed with it
- Three hours
- scripts/soak.sh compare 3, after the two runs, on the same machine and binaries; a row a minute a client, growth by least squares from the end of the first hour
- What each ships
- the stack's library and everything it loads by ldd, each file once, as installed in the images the clients ran from; C and C++ runtimes and the loader left out for all
- INVITE
- sizes and IP fragments read from the capture, on a bridge with an MTU of 1500
- A bad link
- tc netem in both directions; each client's own receive report and Asterisk's, every row rated by one reduced ITU-T G.107 E-model; linphonec prints no receive jitter of its own, so its rows carry no R
- Settings
- pjsua with --max-calls=4, the limit its packaged build was compiled with; baresip with call_max_calls 200 and its echo module; linphonec with max_calls=200, answering by itself; the Sipral agent with --invite-burst 400, its scanner guard raised for a PBX that offers hundreds of calls within a second
- Scale run
- Intel Xeon E5-2698 v4 at 2.2 GHz, 32 vCPUs, Debian 13, kernel 6.12; 29 September 2026; the call ceiling raised to 10 000 (max_dialogs, or --max-calls on the agent)
- Vulnerabilities
- National Vulnerability Database records naming PJSIP, published in 2026, counted on 8 October 2026; critical means a CVSS base score of 9.0 or more
The comparison with pjsua is one script. On a Linux machine with Docker it builds the clients' containers, brings the lab's Asterisk up and runs every scenario for each client in turn; the full method is in docs/23-compared-with-pjsip.md.
cargo build --release -p sipral --example headless-agent
./scripts/lab.sh compare Questions
What is a good alternative to PJSIP without the GPL?
Sipral. It is a SIP client stack written in Rust to replace PJSIP in softphones, mobile apps and voice agents: registration, calls, hold, transfer, DTMF, SRTP, DTLS-SRTP, ICE and TURN behind one C ABI, with Swift, Kotlin, .NET, Python, Dart, React Native and Node.js bindings, a header-only C++ API and a Rust crate. It contains no GPL or LGPL code and ships under AGPL-3.0 or a commercial licence for closed-source products and app stores. Its documentation maps each pjsua concept to its Sipral equivalent.
How does Sipral compare with PJSIP?
Measured against pjsua 2.17, PJSIP's own client, on the same Asterisk on 8 October 2026: 5.8 MB of memory registered and idle against 12.7 MB, about a sixth of the processor time per call over three hours of calls (1.77 s against 10.46 s), and an authenticated INVITE that crosses UDP whole (1236 bytes with ICE) where pjsua sends 1670 to 1869 bytes as IP fragments. After a network change Sipral hears audio again 640 ms after the cut on its own; pjsua left alone does not recover. Sipral is memory-safe Rust; 24 vulnerabilities were published against PJSIP in 2026, 22 of them memory errors.
How does Sipral compare with baresip?
Measured on the same Asterisk on 8 October 2026 against baresip 4.11.0: 5.8 MB of memory idle against 12.2 MB, a hundred calls in 14.1 MB against 30.5 MB, and about a fifth of the CPU per call (a hundred calls on 30 % of one core, against 151 % for baresip). baresip's authenticated ICE INVITE (1472 to 1479 bytes) sits at the edge of a single packet and fragmented in one run of two; Sipral's stays at 1236 bytes on UDP. After a network change Sipral hears audio again in 640 ms, baresip in about 2.2 s on its own. baresip is C only; Sipral has bindings for eight languages and a C++ API.
How does Sipral compare with Linphone?
Measured against linphonec 5.3.105, Linphone's command-line client, on the same Asterisk on 8 October 2026: 5.8 MB of memory idle against 57.7 MB, and an authenticated ICE INVITE of 1236 bytes on UDP where linphonec sends 1594 bytes as IP fragments. After a network change Sipral hears audio again in 640 ms, linphonec in about 2.1 s. Both are offered under AGPL-3.0 or a commercial licence; Sipral is written in memory-safe Rust.
Is there a SIP library in Rust for iOS and Android?
Sipral is a SIP client stack in Rust for iOS, Android, macOS, Windows and Linux. On iOS it ships as an XCFramework with a Swift package and CallKit and PushKit helpers; on Android as an AAR with a Kotlin API, ConnectionService helpers and AAudio for device audio. On iOS 17.4 and later it also reports calls through LiveCommunicationKit. React Native, Flutter (Dart) and .NET MAUI bindings and a header-only C++ API sit over the same C ABI.
Which SIP stack should an AI voice agent use to answer calls on a PBX?
Sipral registers on the PBX as an ordinary extension, the way a desk phone does, and hands each call's audio to the agent as 16-bit PCM frames, taking back what the caller hears; no media server sits in between. A SIP bridge reaches any agent that answers SIP, a Pipecat transport reaches every speech service Pipecat supports, and direct connectors join a call to five realtime speech APIs. The first audio frame reaches the agent 31.5 ms after the INVITE. Python, Node.js, .NET, Kotlin, Swift, Dart and C reach the same API.
How many concurrent calls can Sipral handle?
Ten thousand concurrent calls with audio both ways have been held in one process, set up at 499 a second, at about 72 KB of memory per call. The number of concurrent calls is a setting in every binding.
Is Sipral memory-safe?
Yes. Sipral is written in Rust; unsafe code is confined to the C boundary and the audio device layer, and an unwrap, a panic or an unchecked index fails the build. Its parsers and protocol engines have taken 61 billion fuzzing executions without a crash, and every message of the RFC 4475 SIP torture suite is asserted.
Sipral is built to replace PJSIP in products that cannot take on the GPL: it contains no GPL or LGPL code, and its documentation maps each pjsua concept to its equivalent. For a closed-source product, see licensing. The other SIP stacks written in Rust are set beside Sipral on a page of their own.
Ship SIP in a closed app, without the GPL.
One price per company, perpetual for the versions delivered during maintenance, app stores allowed. Ask privately.
Request a quote