<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>SIP on Rason Yang</title><link>https://rasonyang.dev/tags/sip/</link><description>Recent content in SIP on Rason Yang</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><copyright>© 2026 Rason Yang</copyright><atom:link href="https://rasonyang.dev/tags/sip/index.xml" rel="self" type="application/rss+xml"/><item><title>What One 4-vCPU FreeSBC Carries</title><link>https://rasonyang.dev/posts/freesbc-load-test-results/</link><pubDate>Tue, 20 Oct 2026 08:51:38 +0800</pubDate><guid>https://rasonyang.dev/posts/freesbc-load-test-results/</guid><description>&lt;p&gt;The &lt;a href="https://rasonyang.dev/posts/ai-native-call-center-in-four-projects/#what-i-am-not-claiming-yet" &gt;first post in this series&lt;/a&gt; ended with a promise: FreeSBC&amp;rsquo;s&#10;capacity numbers would get their own post, with the setup next to them.&#10;Here they are. On one 4 vCPU cloud VM, FreeSBC v0.5.0 relayed&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L13" target="_blank" rel="noreferrer"&gt;5000 concurrent G.711 calls with both media legs anchored&lt;/a&gt;,&#10;set up &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L15-L17" target="_blank" rel="noreferrer"&gt;3500 calls per second from a carrier without loss&lt;/a&gt;, added&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L21" target="_blank" rel="noreferrer"&gt;less than 1 ms&lt;/a&gt; to call setup, and ran&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L14" target="_blank" rel="noreferrer"&gt;8 hours at 3500 concurrent calls with no growth&lt;/a&gt; in goroutines,&#10;memory, file descriptors or ports.&lt;/p&gt;&#10;&lt;p&gt;FreeSBC is a &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/README.md#L3-L7" target="_blank" rel="noreferrer"&gt;pure-Go SIP/WebRTC edge proxy: one binary, one YAML file&lt;/a&gt;.&#10;It anchors RTP, &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/README.md#L114" target="_blank" rel="noreferrer"&gt;does no transcoding&lt;/a&gt;, and&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/README.md#L115" target="_blank" rel="noreferrer"&gt;terminates ICE-Lite and DTLS-SRTP&lt;/a&gt; for browsers. Every number&#10;below comes from &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L3" target="_blank" rel="noreferrer"&gt;one formal three-host run&lt;/a&gt; on 2026-10-18 and&#10;2026-10-19, and the harness that produced them is in the repository.&lt;/p&gt;&#10;&lt;p&gt;I have not run Kamailio, OpenSIPS, rtpengine or a commercial SBC on the same&#10;rig, so this post does not say FreeSBC is faster than any of them. It gives&#10;numbers in units you can hold against your own: calls per vCPU, call setups&#10;per second on 4 vCPU, added latency, and drift over 8 hours. It also re-runs&#10;one commercial SBC&amp;rsquo;s own published test.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;The numbers&#10; &lt;div id="the-numbers" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-numbers" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;What&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Result on 4 vCPU&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Kind&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Concurrent G.711 calls, both legs anchored&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L13" target="_blank" rel="noreferrer"&gt;5000, CPU 310 of 400&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;knee at the 80% CPU line&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Call setup, carrier to switch&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L15-L17" target="_blank" rel="noreferrer"&gt;3500 CPS, loss-free&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;knee&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Call setup, switch to carrier&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L15-L17" target="_blank" rel="noreferrer"&gt;3250 CPS&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;knee&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Call setup, client to switch&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L15-L17" target="_blank" rel="noreferrer"&gt;2250 CPS or more&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;lower bound&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Latency added to INVITE → 200&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L21" target="_blank" rel="noreferrer"&gt;below 1 ms&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;measured&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;8 h soak at 3500 concurrent calls&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L14" target="_blank" rel="noreferrer"&gt;432,000 calls, 0 failed, no growth&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;measured&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Registrations held / refreshed&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L18" target="_blank" rel="noreferrer"&gt;19,000 / 20,000 REGISTER/s or more&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;lower bound&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;WebRTC, DTLS-SRTP&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L19" target="_blank" rel="noreferrer"&gt;100 handshakes/s, 600 calls, or more&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;lower bound&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;FreeSWITCH 1.10.0 as the switch&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L20" target="_blank" rel="noreferrer"&gt;3000 calls, 1500 CPS, or more&lt;/a&gt;&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;lower bound&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;A knee is the last step before the first one that failed the pass line. A&#10;lower bound means&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L5" target="_blank" rel="noreferrer"&gt;the generator, the switch or the test range ran out before FreeSBC did&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;The rig&#10; &lt;div id="the-rig" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-rig" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;Three cloud VMs on Alibaba Cloud, &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L70" target="_blank" rel="noreferrer"&gt;all Ubuntu 24.04 on kernel 6.8, with real&#10;NICs on two subnets of one private network&lt;/a&gt;. One subnet plays the&#10;public side, the other the private side. The &lt;a href="https://github.com/rasonyang/freesbc/issues/109#issuecomment-6249040280" target="_blank" rel="noreferrer"&gt;instance types&lt;/a&gt; and&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L72-L76" target="_blank" rel="noreferrer"&gt;CPUs&lt;/a&gt;:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;FreeSBC&lt;/strong&gt;: ecs.c9i.xlarge, Intel Xeon 6982P-C, 4 vCPU (2 physical cores&#10;with hyper-threading), 7.4 GiB usable. &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L78" target="_blank" rel="noreferrer"&gt;v0.5.0, Go 1.27.2, sipgo v1.6.0,&#10;&lt;code&gt;GOMEMLIMIT=6GiB&lt;/code&gt;&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Load generator&lt;/strong&gt;: ecs.c8a.2xlarge, AMD EPYC 9T24, 8 vCPU, running SIPp&#10;3.6.1 and &lt;code&gt;webrtcload&lt;/code&gt;, the repository&amp;rsquo;s WebRTC load client.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Switch&lt;/strong&gt;: ecs.c9i.2xlarge, Xeon 6982P-C, 8 vCPU, running a&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L79" target="_blank" rel="noreferrer"&gt;SIPp UAS that answers at once and echoes RTP&lt;/a&gt;, or FreeSWITCH&#10;1.10.0 for one set of runs.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="low"&#10; alt="Topology: a load generator on the public-side subnet sends SIP over UDP and G.711 RTP to FreeSBC (4 vCPU, Xeon 6982P-C), which relays signaling and media to a switch on the private-side subnet; below it, the pass line every figure must meet"&#10; src="https://rasonyang.dev/posts/freesbc-load-test-results/topology.svg"&#10; &gt;&lt;/figure&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Signaling is UDP. Media is &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L80" target="_blank" rel="noreferrer"&gt;G.711 at 20 ms, in both directions, with both&#10;legs anchored by FreeSBC&lt;/a&gt;, so every RTP packet enters and leaves&#10;FreeSBC on each leg. FreeSBC was &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L82" target="_blank" rel="noreferrer"&gt;restarted before each ladder value&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;A figure only counts if its run had&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L81" target="_blank" rel="noreferrer"&gt;under 0.1% failed calls, FreeSBC under 80% of its cores, RTP sent over&#10;received of at least 0.999 with zero kernel receive-buffer errors, and the&#10;generator and the switch each under 90% of a core&lt;/a&gt;. CPU is quoted&#10;with 100 meaning one vCPU, so the line on this box is 320 of 400. The last&#10;check matters most. &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/test/perf/hosts/MEASURE.md#L68-L70" target="_blank" rel="noreferrer"&gt;SIPp is mostly single-threaded per instance&lt;/a&gt;,&#10;and a fast proxy measured with a saturated generator looks like a slow proxy.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Media: about 1600 calls per vCPU&#10; &lt;div id="media-about-1600-calls-per-vcpu" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#media-about-1600-calls-per-vcpu" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;The concurrent-call ladder &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L125-L137" target="_blank" rel="noreferrer"&gt;stepped from 250 to 5500 calls&lt;/a&gt;,&#10;each with a 60 s ramp and two 60 s holds. CPU grew in a straight line: 20 at&#10;250 calls, 130 at 2000, 251 at 4000. At 5000 calls it was&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L127-L136" target="_blank" rel="noreferrer"&gt;310 average and 338 peak&lt;/a&gt;, with 500,588 RTP packets per second&#10;each way, 373 MB of RSS and 0 failed calls. That is&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L140" target="_blank" rel="noreferrer"&gt;668 Mbit/s each way&lt;/a&gt;. At 5500 the CPU crossed the line and the&#10;generator&amp;rsquo;s SIPp was at 94% of a core, so the figure is&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L139" target="_blank" rel="noreferrer"&gt;5000, or slightly more, generator-bound above&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Divided out, that is &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L33" target="_blank" rel="noreferrer"&gt;about 1600 concurrent calls per vCPU&lt;/a&gt;,&#10;and &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L36" target="_blank" rel="noreferrer"&gt;about 0.07 MB of RSS per call&lt;/a&gt;, baseline included.&#10;The per-vCPU figure is arithmetic: only the 4 vCPU size ran this ladder.&lt;/p&gt;&#10;&lt;p&gt;The profile at 5000 calls shows where the CPU goes:&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L178" target="_blank" rel="noreferrer"&gt;85% cumulative in the forward loop, and about 66 to 70% flat in the&#10;&lt;code&gt;sendto&lt;/code&gt; and &lt;code&gt;recvfrom&lt;/code&gt; syscalls&lt;/a&gt;. One packet in, one packet&#10;out, one syscall each. GC is not among the top entries. Batching the&#10;syscalls per socket &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L25" target="_blank" rel="noreferrer"&gt;would save few of them&lt;/a&gt;, so that issue&#10;was closed as not worth it at this architecture.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Signaling: thousands of setups per second, under 5 ms&#10; &lt;div id="signaling-thousands-of-setups-per-second-under-5-ms" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#signaling-thousands-of-setups-per-second-under-5-ms" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;The call-setup ladders &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L100-L102" target="_blank" rel="noreferrer"&gt;run without media, with 2 s calls, in 40 s steps&#10;from 250 CPS&lt;/a&gt;, one per direction. Each knee then got a confirm&#10;run at 90% of it for 120 s.&lt;/p&gt;&#10;&lt;p&gt;&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="low"&#10; alt="Bar chart of the highest passing call setup rate on 4 vCPU: carrier to switch 3500 CPS loss-free, first failing step 5000; switch to carrier 3250 CPS, first failing step 3500; client to switch at least 2250 CPS, a lower bound, first failing step 2500 on the per-source cap"&#10; src="https://rasonyang.dev/posts/freesbc-load-test-results/cps.svg"&#10; &gt;&lt;/figure&gt;&#10;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Carrier to switch: 3500 CPS.&lt;/strong&gt; CPU averaged&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L104-L108" target="_blank" rel="noreferrer"&gt;190 of 400 at the knee, with 4296 MB of RSS&lt;/a&gt;. Calls kept&#10;succeeding past it: &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L111" target="_blank" rel="noreferrer"&gt;0.047% failed at 4750 CPS, and the first failing step&#10;was 5000&lt;/a&gt;. What ends the loss-free range is the kernel&#10;dropping datagrams on FreeSBC&amp;rsquo;s UDP receive buffers from 3750 CPS, while&#10;the CPU was at 209 to 265 of 400. That is a receive-path limit, open as&#10;&lt;a href="https://github.com/rasonyang/freesbc/issues/235" target="_blank" rel="noreferrer"&gt;#235&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Switch to carrier: 3250 CPS.&lt;/strong&gt; At 3500 the carrier leg&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L104-L108" target="_blank" rel="noreferrer"&gt;timed out on 0.204% of calls&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Client to switch: 2250 CPS or more.&lt;/strong&gt; This one is a floor. FreeSBC&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/internal/edge/invite.go#L35" target="_blank" rel="noreferrer"&gt;allows 64 unanswered INVITEs per public source IP&lt;/a&gt;, and the&#10;generator has one IP. At 2500 CPS &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L110" target="_blank" rel="noreferrer"&gt;all 248 failures were that cap, with&#10;FreeSBC at 37% CPU&lt;/a&gt;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;None of the three knees is a CPU limit:&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L24" target="_blank" rel="noreferrer"&gt;FreeSBC averaged 33 to 48% of its CPU at all of them&lt;/a&gt;.&#10;The confirm runs passed every call:&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L113" target="_blank" rel="noreferrer"&gt;243,000 at 2025 CPS, 378,000 at 3150 and 351,000 at 2925&lt;/a&gt;,&#10;with INVITE-to-200 p95 under 5 ms at the knees.&lt;/p&gt;&#10;&lt;p&gt;FreeSBC&amp;rsquo;s own share of that latency was measured separately at 1000&#10;concurrent calls. INVITE to 200&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L141" target="_blank" rel="noreferrer"&gt;averaged 3.0 ms through FreeSBC and 3.0 ms straight to the switch&lt;/a&gt;.&#10;The difference is below SIPp&amp;rsquo;s 1 ms resolution.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;It doesn&amp;rsquo;t drift&#10; &lt;div id="it-doesnt-drift" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#it-doesnt-drift" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;A proxy that leaks a little per call passes every ladder and fails a week&#10;later. The soak held &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L185" target="_blank" rel="noreferrer"&gt;3500 concurrent calls, 70% of the media maximum, for&#10;8 hours&lt;/a&gt;: 15 new calls per second, each held 240 s.&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L187-L197" target="_blank" rel="noreferrer"&gt;The results&lt;/a&gt;:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;432,000 calls, 0 failed, 0 retransmissions.&lt;/li&gt;&#10;&lt;li&gt;CPU 235 average, 245 peak, out of 400.&lt;/li&gt;&#10;&lt;li&gt;From the first quarter of the run to the last: goroutines +0.0%, RSS&#10;−0.3%, open file descriptors +0.0%, ports in use +0.0%. RSS peaked at&#10;240 MB.&lt;/li&gt;&#10;&lt;li&gt;10.37 billion RTP packets each way, sent over received 1.0000.&lt;/li&gt;&#10;&lt;li&gt;After the load stopped: 33 goroutines, 13 file descriptors, 0 media&#10;ports.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The &lt;a href="https://github.com/rasonyang/freesbc/issues/109#issuecomment-6256238968" target="_blank" rel="noreferrer"&gt;soak report&lt;/a&gt; has the raw medians: 22,113 goroutines in the first&#10;quarter and 22,113 in the last. No host was reclaimed or rebooted during&#10;the 8 hours.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;A commercial SBC&amp;rsquo;s own test, on one vCPU&#10; &lt;div id="a-commercial-sbcs-own-test-on-one-vcpu" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#a-commercial-sbcs-own-test-on-one-vcpu" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;One commercial SBC vendor publishes a load test of its own product:&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/test/perf/hosts/MEASURE.md#L135-L137" target="_blank" rel="noreferrer"&gt;50 calls per second up to 1000 concurrent calls, each held 600 s&lt;/a&gt;,&#10;on a &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/test/perf/hosts/MEASURE.md#L18-L22" target="_blank" rel="noreferrer"&gt;Xeon X5670 with 6 cores and 12 threads, 8 GB of RAM and Debian 10&lt;/a&gt;.&#10;The published result is &amp;ldquo;Used Memory 1730M, CPU Load 26%&amp;rdquo;. I am not naming&#10;the vendor. The test is the useful part.&lt;/p&gt;&#10;&lt;p&gt;The harness &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/test/perf/hosts/MEASURE.md#L153-L160" target="_blank" rel="noreferrer"&gt;reproduces that test&lt;/a&gt;: 2000 calls, G.711 both ways on&#10;both legs, a plateau of about 1180 s. It ran on all four vCPU, then with&#10;FreeSBC limited to two, then to one. &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L88-L94" target="_blank" rel="noreferrer"&gt;The results&lt;/a&gt;:&lt;/p&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;FreeSBC cores&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Failed&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;CPU avg / peak (100 = one vCPU)&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;RSS max&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Verdict&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;4 vCPU&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;0 of 2000&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;64 / 70&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;120 MB&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;PASS&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;2&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;0 of 2000&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;52 / 57&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;117 MB&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;PASS&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;1&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;0 of 2000&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;40 / 44&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;115 MB&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;PASS&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&lt;p&gt;Probe calls inside the plateau measured&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L96" target="_blank" rel="noreferrer"&gt;0.000% loss and 0.47 ms mean jitter&lt;/a&gt;. So one vCPU of this box&#10;carries the vendor&amp;rsquo;s test at 40% of that vCPU. CPU is lower on one core&#10;than on four because &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L97" target="_blank" rel="noreferrer"&gt;with one core the Go runtime has no idle processors&#10;spinning&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Four caveats before reading more into it:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;I ran FreeSBC. I did not run the vendor&amp;rsquo;s product; its numbers are as&#10;published.&lt;/li&gt;&#10;&lt;li&gt;The vendor &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L98" target="_blank" rel="noreferrer"&gt;does not define &amp;ldquo;CPU Load 26%&amp;rdquo;&lt;/a&gt;: it could be one&#10;core, all twelve threads, or a load average.&lt;/li&gt;&#10;&lt;li&gt;&amp;ldquo;Used Memory 1730M&amp;rdquo; is host memory. The comparable figure is&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L98" target="_blank" rel="noreferrer"&gt;the whole FreeSBC host at 855 MB used&lt;/a&gt;, not FreeSBC&amp;rsquo;s 120 MB&#10;RSS. The whole host&amp;rsquo;s CPU averaged 15.9% of its vCPUs.&lt;/li&gt;&#10;&lt;li&gt;The hardware is from different generations. The test plan&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/test/perf/hosts/MEASURE.md#L18-L22" target="_blank" rel="noreferrer"&gt;estimates the two boxes as roughly comparable in total compute, or this&#10;one somewhat lower&lt;/a&gt;: fewer cores here, each much faster than a&#10;2010-era Westmere core.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;h2 class="relative group"&gt;The 32-second goroutine&#10; &lt;div id="the-32-second-goroutine" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-32-second-goroutine" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;The earliest numbers had a problem the three-host run no longer shows. The&#10;first run was a single host, Docker on a laptop, with sipgo v1.4.3. At 2500&#10;CPS &lt;a href="https://github.com/rasonyang/freesbc/issues/170" target="_blank" rel="noreferrer"&gt;FreeSBC had 189,159 goroutines, and 159,195 of them (84%) sat in one&#10;stack&lt;/a&gt;: sipgo&amp;rsquo;s &lt;code&gt;TerminateGracefully&lt;/code&gt;, waiting about 32 s for each&#10;finished transaction&amp;rsquo;s timers. That cost about 76 goroutines and 2.3 MB of&#10;RSS per sustained call per second, and at 3500 CPS the process was killed&#10;at its 8 GiB limit.&lt;/p&gt;&#10;&lt;p&gt;Two changes removed it. &lt;a href="https://github.com/rasonyang/freesbc/pull/231" target="_blank" rel="noreferrer"&gt;sipgo v1.6.0&lt;/a&gt; returns from&#10;&lt;code&gt;TerminateGracefully&lt;/code&gt; at once for a finished UDP transaction and leaves the&#10;rest to its timers. &lt;a href="https://github.com/rasonyang/freesbc/pull/232" target="_blank" rel="noreferrer"&gt;PR #232&lt;/a&gt; stopped ended dialogs from staying&#10;reachable through &lt;code&gt;OnCancel&lt;/code&gt;, &lt;code&gt;watch2xx&lt;/code&gt; and backstop timers&#10;(&lt;a href="https://github.com/rasonyang/freesbc/issues/228" target="_blank" rel="noreferrer"&gt;#228&lt;/a&gt;).&lt;/p&gt;&#10;&lt;p&gt;On the three-host rig, &lt;a href="https://github.com/rasonyang/freesbc/issues/170#issuecomment-6249485186" target="_blank" rel="noreferrer"&gt;RSS came out at 1.22 to 1.31 MB per sustained CPS,&#10;and goroutines at 43.7 to 46.5&lt;/a&gt;, flat from 1000 to 3500 CPS. Flat is&#10;the point: the cost is per call, held for a fixed time, and goroutines fall&#10;back to about 33 after each run. It is not a leak. The before and after&#10;come from different rigs, one laptop against three VMs, so this is not a&#10;controlled comparison.&lt;/p&gt;&#10;&lt;p&gt;&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="low"&#10; alt="Two bar pairs: RSS per sustained call per second fell from about 2.3 MB on the single-host rig with sipgo v1.4.3 to about 1.25 MB on the three-host rig with sipgo v1.6.0 and PR 232; goroutines per sustained call per second fell from about 76 to about 44"&#10; src="https://rasonyang.dev/posts/freesbc-load-test-results/rss-per-cps.svg"&#10; &gt;&lt;/figure&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;What remains is mostly heap. sipgo keeps each UDP transaction, with its&#10;request and response, for 32 s after a 2xx: Timer L, RFC 6026&amp;rsquo;s Accepted&#10;state. &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L58" target="_blank" rel="noreferrer"&gt;I left that alone on purpose&lt;/a&gt;; it is sipgo&amp;rsquo;s to&#10;change. Of the 44 goroutines per CPS, &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L51-L54" target="_blank" rel="noreferrer"&gt;31.7 were FreeSBC&amp;rsquo;s own&#10;&lt;code&gt;drainAcks&lt;/code&gt;&lt;/a&gt;, waiting the same 32 s for an ACK that&#10;follows a 2xx by one round trip. &lt;a href="https://github.com/rasonyang/freesbc/pull/243" target="_blank" rel="noreferrer"&gt;PR #243&lt;/a&gt; bounds that wait at 8 s,&#10;which &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L57" target="_blank" rel="noreferrer"&gt;cut goroutines per CPS from 32.1 to 8.1 in a local in-process&#10;test&lt;/a&gt;. It landed after the run, so every figure in this post&#10;predates it. The next three-host run will measure it.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;What I am not claiming&#10; &lt;div id="what-i-am-not-claiming" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what-i-am-not-claiming" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Other sizes.&lt;/strong&gt; &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L279" target="_blank" rel="noreferrer"&gt;Only 4 vCPU was measured&lt;/a&gt;; one and two&#10;vCPU ran only the 1000-call test above. Per-vCPU figures are division.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Statistics.&lt;/strong&gt; &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L81" target="_blank" rel="noreferrer"&gt;Each ladder ran once, with one confirm run per&#10;knee&lt;/a&gt;. There are no confidence intervals.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Client call rate.&lt;/strong&gt; &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L273" target="_blank" rel="noreferrer"&gt;2250 CPS is bounded by one source IP&lt;/a&gt;,&#10;not by FreeSBC.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Carrier-in above 3500 CPS.&lt;/strong&gt; The kernel drops datagrams from 3750 CPS&#10;&lt;a href="https://github.com/rasonyang/freesbc/issues/109#issuecomment-6256238968" target="_blank" rel="noreferrer"&gt;while FreeSBC is at 52 to 66% CPU&lt;/a&gt;. The cause is open in&#10;&lt;a href="https://github.com/rasonyang/freesbc/issues/235" target="_blank" rel="noreferrer"&gt;#235&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Signaling CPU.&lt;/strong&gt; &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L177" target="_blank" rel="noreferrer"&gt;About half is in sipgo&amp;rsquo;s transaction layer, and GC&#10;takes 20 to 23%&lt;/a&gt;. Allocation per request is open in&#10;&lt;a href="https://github.com/rasonyang/freesbc/issues/173" target="_blank" rel="noreferrer"&gt;#173&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Untested paths.&lt;/strong&gt; &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L277" target="_blank" rel="noreferrer"&gt;SIP over TCP and TLS, SDES-SRTP, and switch-to-client&#10;calls were not loaded&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Memory at high call rates.&lt;/strong&gt; Memory follows calls per second, not&#10;concurrent calls. &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L42" target="_blank" rel="noreferrer"&gt;At 5000 CPS carrier-in RSS reached 5.8 GB&lt;/a&gt;&#10;on this 7.4 GiB host.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Other proxies.&lt;/strong&gt; No other open-source SBC or proxy was run on this rig.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Sizing, and how to rerun it&#10; &lt;div id="sizing-and-how-to-rerun-it" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#sizing-and-how-to-rerun-it" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;A rule of thumb for this hardware class, from the&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L27-L45" target="_blank" rel="noreferrer"&gt;sizing guide&lt;/a&gt;:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&lt;strong&gt;Media&lt;/strong&gt;: &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L33" target="_blank" rel="noreferrer"&gt;about 1600 anchored G.711 calls per vCPU&lt;/a&gt;, and&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L36" target="_blank" rel="noreferrer"&gt;about 0.07 MB of RAM per call&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Call rate&lt;/strong&gt;: &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L42" target="_blank" rel="noreferrer"&gt;about 1.2 GB of RAM per 1000 sustained CPS, plus&#10;headroom&lt;/a&gt;. Set &lt;code&gt;GOMEMLIMIT&lt;/code&gt; to&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L62" target="_blank" rel="noreferrer"&gt;80 to 90% of the memory the process may use&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;&lt;strong&gt;Ports&lt;/strong&gt;: the default RTP range&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L40" target="_blank" rel="noreferrer"&gt;admits about 5000 calls&lt;/a&gt;; widen it above that.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;The kit is in &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/test/perf/hosts/MEASURE.md" target="_blank" rel="noreferrer"&gt;&lt;code&gt;test/perf/hosts/&lt;/code&gt;&lt;/a&gt;. &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/test/perf/hosts/MEASURE.md" target="_blank" rel="noreferrer"&gt;MEASURE.md&lt;/a&gt; defines&#10;each step, its ladder and its pass line, and the&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/test/perf/README.md#L313-L340" target="_blank" rel="noreferrer"&gt;harness README&lt;/a&gt; shows how &lt;code&gt;run.sh&lt;/code&gt; drives three real hosts.&#10;From the generator host, &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/test/perf/hosts/MEASURE.md#L153-L160" target="_blank" rel="noreferrer"&gt;the commercial SBC&amp;rsquo;s test&lt;/a&gt;, the&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/test/perf/hosts/MEASURE.md#L210" target="_blank" rel="noreferrer"&gt;carrier-in ladder&lt;/a&gt;, the &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/test/perf/hosts/MEASURE.md#L245-L247" target="_blank" rel="noreferrer"&gt;concurrent-call ladder&lt;/a&gt; and&#10;the &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/test/perf/hosts/MEASURE.md#L423-L424" target="_blank" rel="noreferrer"&gt;soak&lt;/a&gt;:&lt;/p&gt;&#10;&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-sh" data-lang="sh"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /opt/freesbc &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; . test/perf/hosts/env.sh sipp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;test/perf/hosts/m03.sh all sipp&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;test/perf/run.sh -n -s 250:8000:250:40 -H &lt;span class="m"&gt;2&lt;/span&gt; carrier-in&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;test/perf/hosts/ladder.sh m02 &lt;span class="s2"&gt;&amp;#34;-c @N@ -H 60 -t 180 -u @N@ call&amp;#34;&lt;/span&gt; &lt;span class="m"&gt;250&lt;/span&gt; &lt;span class="m"&gt;500&lt;/span&gt; &lt;span class="m"&gt;750&lt;/span&gt; &lt;span class="m"&gt;1000&lt;/span&gt; &lt;span class="m"&gt;1250&lt;/span&gt; &lt;span class="m"&gt;1500&lt;/span&gt; &lt;span class="m"&gt;2000&lt;/span&gt; &lt;span class="m"&gt;2500&lt;/span&gt; &lt;span class="m"&gt;3000&lt;/span&gt; &lt;span class="m"&gt;4000&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;test/perf/hosts/m08.sh &lt;span class="m"&gt;3500&lt;/span&gt; &lt;span class="m"&gt;8&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#10;&lt;p&gt;MEASURE.md runs each one detached with &lt;code&gt;nohup&lt;/code&gt; and judges every run with&#10;&lt;code&gt;runcheck.sh&lt;/code&gt; and &lt;code&gt;rigcheck.sh&lt;/code&gt;. For a quick look on a laptop, the&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md#L246-L260" target="_blank" rel="noreferrer"&gt;single-host Docker scenarios&lt;/a&gt; still work. Their numbers do&#10;not compare with these.&lt;/p&gt;&#10;&lt;p&gt;Code: &lt;a href="https://github.com/rasonyang/freesbc" target="_blank" rel="noreferrer"&gt;FreeSBC&lt;/a&gt; · &lt;a href="https://github.com/rasonyang/freesbc/blob/26f1d9e631249b51097cc65fd5ebfb2444057b7f/docs/performance.md" target="_blank" rel="noreferrer"&gt;docs/performance.md&lt;/a&gt; · &lt;a href="https://github.com/rasonyang/freesbc/issues/109" target="_blank" rel="noreferrer"&gt;issue #109&lt;/a&gt;&lt;/p&gt;&#10;</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://rasonyang.dev/posts/freesbc-load-test-results/featured.jpg"/></item><item><title>An AI-Native Call Center in Four Open-Source Projects</title><link>https://rasonyang.dev/posts/ai-native-call-center-in-four-projects/</link><pubDate>Mon, 12 Oct 2026 10:54:49 +0800</pubDate><guid>https://rasonyang.dev/posts/ai-native-call-center-in-four-projects/</guid><description>&lt;p&gt;Call a support line and the call usually goes like this. A recording reads&#10;you a menu. You press 3, then 1, then 0 because nothing fits. You wait in a&#10;queue. An agent picks up and asks for the order number you already keyed&#10;into the menu.&lt;/p&gt;&#10;&lt;p&gt;Behind that call there is more pain, just not the caller&amp;rsquo;s:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The agent&amp;rsquo;s desktop softphone has to be installed, configured and kept&#10;registered. When a laptop sleeps, the agent is silently unreachable.&lt;/li&gt;&#10;&lt;li&gt;The PBX is either on the public internet, where it is scanned all night,&#10;or behind a session border controller that costs real money.&lt;/li&gt;&#10;&lt;li&gt;If a voice bot has been bolted onto the front, it is wired to one vendor&amp;rsquo;s&#10;API, and it hands the caller to a person with none of what was said.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Each of those pains sits on a different boundary of the call path: the&#10;public edge, the switch, the model, and the agent&amp;rsquo;s browser. I built one&#10;open-source project per boundary. This post is the map; later posts take&#10;one problem at a time.&lt;/p&gt;&#10;&lt;p&gt;&lt;figure&gt;&lt;img&#10; class="my-0 rounded-md"&#10; loading="lazy"&#10; decoding="async"&#10; fetchpriority="low"&#10; alt="Architecture: callers and agent browsers reach FreeSBC; FreeSWITCH and AICC sit on the private network; AICC talks the Realtime protocol to a hosted model or to Cascade Realtime Gateway"&#10; src="https://rasonyang.dev/posts/ai-native-call-center-in-four-projects/stack.svg"&#10; &gt;&lt;/figure&gt;&#10;&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;One call, end to end&#10; &lt;div id="one-call-end-to-end" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#one-call-end-to-end" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;ol&gt;&#10;&lt;li&gt;A caller dials in. The carrier&amp;rsquo;s SIP reaches &lt;strong&gt;FreeSBC&lt;/strong&gt;, the only host&#10;with a public address, and FreeSBC relays it to FreeSWITCH on a private&#10;network.&lt;/li&gt;&#10;&lt;li&gt;FreeSWITCH hands the call to &lt;strong&gt;AICC&lt;/strong&gt;, which answers it with a realtime&#10;voice model. AICC speaks the OpenAI Realtime protocol, either to a hosted&#10;model (OpenAI, Qwen, Doubao, Gemini) or to &lt;strong&gt;Cascade Realtime Gateway&lt;/strong&gt;,&#10;which runs ASR → LLM → TTS behind the same protocol.&lt;/li&gt;&#10;&lt;li&gt;The model talks; a flow decides the phase and when a person is needed.&#10;When one is, AICC moves the caller into a &lt;code&gt;mod_callcenter&lt;/code&gt; queue together&#10;with a summary of the conversation so far.&lt;/li&gt;&#10;&lt;li&gt;An agent&amp;rsquo;s phone rings. The phone is &lt;strong&gt;Web SIP Phone&lt;/strong&gt;, a Chrome&#10;extension whose audio reaches FreeSWITCH through FreeSBC over WSS and&#10;DTLS-SRTP. The agent answers in the AICC web app; the extension has no&#10;answer button.&lt;/li&gt;&#10;&lt;li&gt;When the call ends, the bot phase, the queue wait and the agent&amp;rsquo;s part&#10;are one record.&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&#10;&lt;h2 class="relative group"&gt;The edge: FreeSBC&#10; &lt;div id="the-edge-freesbc" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-edge-freesbc" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;The pain.&lt;/strong&gt; A SIP server with a public address gets found by scanners&#10;and brute-forced, around the clock. Commercial SBCs fix that for a price. The&#10;open-source route usually means assembling a SIP proxy, a separate media&#10;relay and their configuration, which is a lot to own for one switch.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The project.&lt;/strong&gt; FreeSBC&amp;rsquo;s pitch is &amp;ldquo;the Caddy experience:&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/8bbc4e6ddb9ce752d14c64fa7362145a303ead99/README.md#L3" target="_blank" rel="noreferrer"&gt;one binary, one YAML file, &lt;code&gt;./freesbc run&lt;/code&gt;&lt;/a&gt;&amp;rdquo;. It is the only&#10;element with a public address; FreeSWITCH or Asterisk&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/8bbc4e6ddb9ce752d14c64fa7362145a303ead99/README.md#L8" target="_blank" rel="noreferrer"&gt;stays on a private LAN and only ever talks to FreeSBC&lt;/a&gt;. It is a&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/8bbc4e6ddb9ce752d14c64fa7362145a303ead99/docs/design.md#L14-L20" target="_blank" rel="noreferrer"&gt;stateful SIP proxy, not a B2BUA&lt;/a&gt;, and it terminates ICE-Lite,&#10;DTLS-SRTP and RTCP-mux for browsers so the switch&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/8bbc4e6ddb9ce752d14c64fa7362145a303ead99/README.md#L115" target="_blank" rel="noreferrer"&gt;only sees plain RTP&lt;/a&gt;. The front door has&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/8bbc4e6ddb9ce752d14c64fa7362145a303ead99/README.md#L106" target="_blank" rel="noreferrer"&gt;per-IP rate limits and scanner fingerprinting&lt;/a&gt;, and an INVITE&#10;is &lt;a href="https://github.com/rasonyang/freesbc/blob/8bbc4e6ddb9ce752d14c64fa7362145a303ead99/docs/edge.md#L47" target="_blank" rel="noreferrer"&gt;admitted only from the exact transport address of a live registration,&#10;or from a carrier&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The boundary.&lt;/strong&gt; A feature belongs in FreeSBC only if&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/8bbc4e6ddb9ce752d14c64fa7362145a303ead99/README.md#L144-L156" target="_blank" rel="noreferrer"&gt;only the edge can see or do it&lt;/a&gt;. CPS limits, toll-fraud rules&#10;and CDRs stay on the switch, which already does them well. That rule had a&#10;cost: the whole trunk/B2BUA plane was&#10;&lt;a href="https://github.com/rasonyang/freesbc/commit/c363f6e52afb5ca2ececcccac3a4879b792e8875" target="_blank" rel="noreferrer"&gt;deleted on 2026-10-02&lt;/a&gt; because it failed the test. The same&#10;discipline gives topology hiding by construction:&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/8bbc4e6ddb9ce752d14c64fa7362145a303ead99/README.md#L105" target="_blank" rel="noreferrer"&gt;every SDP body is built by FreeSBC, never copied from the other leg&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;Not done yet.&lt;/strong&gt; Client legs are&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/8bbc4e6ddb9ce752d14c64fa7362145a303ead99/docs/edge.md#L218" target="_blank" rel="noreferrer"&gt;not fully topology-hidden&lt;/a&gt; (issues #166 and #167),&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/8bbc4e6ddb9ce752d14c64fa7362145a303ead99/docs/edge.md#L230" target="_blank" rel="noreferrer"&gt;IPv6 is untested&lt;/a&gt;, and there is&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/8bbc4e6ddb9ce752d14c64fa7362145a303ead99/README.md#L173" target="_blank" rel="noreferrer"&gt;no TURN or full ICE&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;The switch and the call: AICC&#10; &lt;div id="the-switch-and-the-call-aicc" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-switch-and-the-call-aicc" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;The pain.&lt;/strong&gt; DTMF menus. Callers repeating themselves after a transfer.&#10;One call split into an IVR log, a queue log and a recording. Dialplans&#10;spread across XML files.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The project.&lt;/strong&gt; AICC is&#10;&amp;ldquo;&lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/README.md#L3" target="_blank" rel="noreferrer"&gt;an open-source call center where the AI is the default answer, not an add-on&lt;/a&gt;&amp;rdquo;.&#10;There is &lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/docs/phase1-decisions.md#L12" target="_blank" rel="noreferrer"&gt;no DTMF IVR&lt;/a&gt;: every external number answers with a bot&#10;flow. &amp;ldquo;&lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/README.md#L45-L46" target="_blank" rel="noreferrer"&gt;The model owns the dialogue; the flow owns the phase.&lt;/a&gt;&amp;rdquo;&lt;/p&gt;&#10;&lt;p&gt;The handoff is a tool call. &lt;code&gt;transfer_to_agent&lt;/code&gt;&#10;&lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/internal/flow/builtin.go#L213-L222" target="_blank" rel="noreferrer"&gt;requires a queue, a reason and a summary&lt;/a&gt;, plus any slots&#10;collected so far. The agent&amp;rsquo;s screen-pop arrives as a &lt;code&gt;PARTY_RINGING&lt;/code&gt; event&#10;over SSE, and the bot-phase transcript is&#10;&lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/README.md#L55-L59" target="_blank" rel="noreferrer"&gt;already there, because the call id is minted before any leg exists&lt;/a&gt;.&#10;The result is &lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/README.md#L68-L70" target="_blank" rel="noreferrer"&gt;one CDR with one transcript and one recording&lt;/a&gt;,&#10;not three fragments.&lt;/p&gt;&#10;&lt;p&gt;On the switch side, FreeSWITCH&#10;&lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/README.md#L98-L102" target="_blank" rel="noreferrer"&gt;reads its directory and its queues from PostgreSQL through Lua&lt;/a&gt;,&#10;so adding an extension, a queue or a number is a database change. The&#10;whole thing is &lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/README.md#L12-L13" target="_blank" rel="noreferrer"&gt;one Go binary plus PostgreSQL and FreeSWITCH&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The boundary.&lt;/strong&gt; A deployment runs&#10;&lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/internal/provider/profile.go#L392-L394" target="_blank" rel="noreferrer"&gt;exactly one provider, chosen at startup&lt;/a&gt;, and a cascaded&#10;ASR + LLM + TTS pipeline&#10;&lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/README.md#L157-L160" target="_blank" rel="noreferrer"&gt;never enters this repository&lt;/a&gt;. Anything that speaks the Realtime&#10;protocol can be plugged in instead, which is why the next project exists.&lt;/p&gt;&#10;&lt;p&gt;A taste of what this layer has to get right:&#10;&amp;ldquo;&lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/CLAUDE.md#L124" target="_blank" rel="noreferrer"&gt;Turn end ≠ playback end.&lt;/a&gt;&amp;rdquo; The model finishing a response is&#10;not the caller having heard it, so a transfer or a hangup&#10;&lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/docs/design/02-ai-voice.md#L166" target="_blank" rel="noreferrer"&gt;waits for the audio to drain&lt;/a&gt;. That gets its own post.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;The model: Cascade Realtime Gateway&#10; &lt;div id="the-model-cascade-realtime-gateway" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-model-cascade-realtime-gateway" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;The pain.&lt;/strong&gt; Speech-to-speech models are the easy path, but they tie you&#10;to one vendor&amp;rsquo;s voices, languages, regions and prices. Building your own&#10;pipeline looks easy too, and isn&amp;rsquo;t. In Cascade&amp;rsquo;s README:&#10;&amp;ldquo;&lt;a href="https://github.com/rasonyang/cascade-realtime-gateway/blob/74127be2f982b11552d6115b07585815e484d313/README.md#L25-L37" target="_blank" rel="noreferrer"&gt;Wiring ASR → LLM → TTS together takes an afternoon. The rest of a voice agent is what takes months&lt;/a&gt;&amp;rdquo;:&#10;turn detection, barge-in, context after an interrupt, streaming, races, and&#10;a stable client protocol.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The project.&lt;/strong&gt; Cascade&#10;&lt;a href="https://github.com/rasonyang/cascade-realtime-gateway/blob/74127be2f982b11552d6115b07585815e484d313/README.md#L3-L4" target="_blank" rel="noreferrer"&gt;speaks the OpenAI Realtime (GA) WebSocket protocol to clients and runs a cascaded ASR → LLM → TTS pipeline behind it&lt;/a&gt;.&#10;The backend is a &lt;a href="https://github.com/rasonyang/cascade-realtime-gateway/blob/74127be2f982b11552d6115b07585815e484d313/README.md#L44-L45" target="_blank" rel="noreferrer"&gt;named profile, changed at runtime through an Admin API&lt;/a&gt;;&#10;new calls pick up the change and calls in progress don&amp;rsquo;t notice. Providers&#10;today are &lt;a href="https://github.com/rasonyang/cascade-realtime-gateway/blob/74127be2f982b11552d6115b07585815e484d313/README.md#L156-L161" target="_blank" rel="noreferrer"&gt;Deepgram, OpenAI and Qwen&lt;/a&gt;. Tools are declared by&#10;the client and executed by the client, and a tool call&#10;&lt;a href="https://github.com/rasonyang/cascade-realtime-gateway/blob/74127be2f982b11552d6115b07585815e484d313/internal/session/pipeline.go#L89-L90" target="_blank" rel="noreferrer"&gt;is never handed to TTS&lt;/a&gt;, so the caller never hears JSON.&lt;/p&gt;&#10;&lt;p&gt;One number shows why &amp;ldquo;context after an interrupt&amp;rdquo; is on that list. In one&#10;measured barge-in,&#10;&lt;a href="https://github.com/rasonyang/cascade-realtime-gateway/blob/74127be2f982b11552d6115b07585815e484d313/docs/decisions.md#L80" target="_blank" rel="noreferrer"&gt;10260 ms of audio had been generated and the caller had heard 2740 ms&lt;/a&gt;.&#10;Without trimming, 117 characters the caller never heard would have entered&#10;the next turn&amp;rsquo;s context.&lt;/p&gt;&#10;&lt;p&gt;On latency, the gateway itself&#10;&lt;a href="https://github.com/rasonyang/cascade-realtime-gateway/blob/74127be2f982b11552d6115b07585815e484d313/docs/qwen-latency.md#L154-L157" target="_blank" rel="noreferrer"&gt;adds 0.6 ms&lt;/a&gt; between the provider&amp;rsquo;s first audio frame and&#10;the client&amp;rsquo;s. End of user speech to first playable audio was&#10;&lt;a href="https://github.com/rasonyang/cascade-realtime-gateway/blob/74127be2f982b11552d6115b07585815e484d313/docs/qwen-latency.md#L28-L36" target="_blank" rel="noreferrer"&gt;p50 1223 ms&lt;/a&gt; on 2026-09-01, measured from a machine in China&#10;against a dedicated Qwen deployment over 20 turns; 391 ms of that is the&#10;500 ms VAD silence window doing its job.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The boundary.&lt;/strong&gt; Cascade &lt;a href="https://github.com/rasonyang/cascade-realtime-gateway/blob/74127be2f982b11552d6115b07585815e484d313/README.md#L107-L119" target="_blank" rel="noreferrer"&gt;does not speak SIP or G.711&lt;/a&gt;; audio is&#10;24 kHz PCM in and out. The telephone side is AICC&amp;rsquo;s job, which is why AICC&#10;&lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/internal/provider/profile.go#L248-L254" target="_blank" rel="noreferrer"&gt;resamples 8 kHz to 24 kHz and back&lt;/a&gt; when it talks to the&#10;gateway. Cascade is also single-node:&#10;&lt;a href="https://github.com/rasonyang/cascade-realtime-gateway/blob/74127be2f982b11552d6115b07585815e484d313/README.md#L65" target="_blank" rel="noreferrer"&gt;one static API key, no clustering, no persistence&lt;/a&gt;.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;The agent&amp;rsquo;s ear: Web SIP Phone&#10; &lt;div id="the-agents-ear-web-sip-phone" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#the-agents-ear-web-sip-phone" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;&lt;strong&gt;The pain.&lt;/strong&gt; A desktop softphone is one more thing to install and support.&#10;A browser softphone tab has its own failures: refresh the page and the call&#10;drops; close the laptop lid and the agent stays &amp;ldquo;available&amp;rdquo; while being&#10;unreachable.&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;The project.&lt;/strong&gt; Web SIP Phone is a Chrome extension, and&#10;&amp;ldquo;&lt;a href="https://github.com/rasonyang/web-sip-phone/blob/fdb1c2c2f856609762fa6894fb1f3bb407f19cd0/README.md#L22-L26" target="_blank" rel="noreferrer"&gt;it is &lt;strong&gt;not&lt;/strong&gt; a softphone&lt;/a&gt;&amp;rdquo;: all call control comes from the SIP&#10;server, and the page&amp;rsquo;s own softphone bar owns every call-facing button. Its&#10;one job is to keep one agent&amp;rsquo;s WebRTC SIP leg registered and healthy:&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;The SIP runtime lives in an offscreen document, so&#10;&lt;a href="https://github.com/rasonyang/web-sip-phone/blob/fdb1c2c2f856609762fa6894fb1f3bb407f19cd0/README.md#L284-L291" target="_blank" rel="noreferrer"&gt;refreshing the page mid-call does not interrupt audio or change the Call-ID&lt;/a&gt;.&#10;That was &lt;a href="https://github.com/rasonyang/web-sip-phone/blob/fdb1c2c2f856609762fa6894fb1f3bb407f19cd0/docs/FREESWITCH.md#L168" target="_blank" rel="noreferrer"&gt;checked live against FreeSWITCH on 2026-09-02&lt;/a&gt;.&lt;/li&gt;&#10;&lt;li&gt;A &lt;a href="https://github.com/rasonyang/web-sip-phone/blob/fdb1c2c2f856609762fa6894fb1f3bb407f19cd0/src/offscreen/offscreen.ts#L35-L48" target="_blank" rel="noreferrer"&gt;10-second heartbeat&lt;/a&gt; notices a gap of more than 90 seconds,&#10;which means the machine slept, and forces a reconnect.&lt;/li&gt;&#10;&lt;li&gt;With AICC, &lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/docs/web-sip-phone-protocol.md#L5-L6" target="_blank" rel="noreferrer"&gt;nobody configures it&lt;/a&gt;. Signing in mints SIP&#10;credentials and the web app hands them to the extension, as&#10;&lt;a href="https://github.com/rasonyang/web-sip-phone/blob/fdb1c2c2f856609762fa6894fb1f3bb407f19cd0/README.md#L184-L186" target="_blank" rel="noreferrer"&gt;a digest hash, never a plaintext password&lt;/a&gt;.&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Where each pain is handled&#10; &lt;div id="where-each-pain-is-handled" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#where-each-pain-is-handled" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;table&gt;&#10;&#9;&lt;thead&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Pain&lt;/th&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;th&gt;Handled by&lt;/th&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/thead&gt;&#10;&#9;&lt;tbody&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;PBX exposed to scanners and toll fraud&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;FreeSBC&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;One-way audio and dropped calls behind NAT&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;FreeSBC&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Browsers (WebRTC) talking to a plain-RTP switch&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;FreeSBC&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;DTMF menus&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;AICC&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Callers repeating themselves after a transfer&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;AICC&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;One call, three fragmented records&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;AICC&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Dialplan and queue config sprawl&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;AICC&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Locked into one speech-to-speech vendor&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Cascade Realtime Gateway&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Barge-in, turn detection and context after an interrupt&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Cascade and AICC&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Installing and supporting desktop softphones&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Web SIP Phone&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&#9;&#9;&lt;tr&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Agents dropping off on refresh, sleep or Wi-Fi changes&lt;/td&gt;&#10;&#9;&#9;&#9;&#9;&#9;&lt;td&gt;Web SIP Phone&lt;/td&gt;&#10;&#9;&#9;&#9;&lt;/tr&gt;&#10;&#9;&lt;/tbody&gt;&#10;&lt;/table&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Why four repositories&#10; &lt;div id="why-four-repositories" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#why-four-repositories" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;Each project has a written rule about what it refuses to do. FreeSBC&#10;leaves anything the switch can do to the switch. AICC keeps the cascaded&#10;pipeline out. Web SIP Phone&amp;rsquo;s spec says&#10;&amp;ldquo;&lt;a href="https://github.com/rasonyang/web-sip-phone/blob/fdb1c2c2f856609762fa6894fb1f3bb407f19cd0/design.md#L19" target="_blank" rel="noreferrer"&gt;do not add a dial pad, contacts, call history, a CTI API&lt;/a&gt;&amp;rdquo;.&#10;Cascade does not do telephony.&lt;/p&gt;&#10;&lt;p&gt;Those refusals make the pieces usable on their own. FreeSBC can front any&#10;FreeSWITCH or Asterisk. Cascade can serve any Realtime client. AICC runs&#10;fine with a hosted model and no Cascade. The joints between them are&#10;ordinary protocols: SIP and RTP, the OpenAI Realtime protocol, and a small&#10;&lt;code&gt;postMessage&lt;/code&gt; protocol between a web page and an extension.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;What I am not claiming yet&#10; &lt;div id="what-i-am-not-claiming-yet" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#what-i-am-not-claiming-yet" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;p&gt;AICC&#10;&lt;a href="https://github.com/rasonyang/ai-native-callcenter/blob/86ec6e1d05be5dfdcd06d92a1b675a659a3fd76a/docs/load-tests.md#L7-L8" target="_blank" rel="noreferrer"&gt;publishes no performance figures&lt;/a&gt;, because its load tests&#10;have not run. FreeSBC&amp;rsquo;s capacity numbers are&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/8bbc4e6ddb9ce752d14c64fa7362145a303ead99/docs/performance.md#L3-L5" target="_blank" rel="noreferrer"&gt;explicitly preliminary&lt;/a&gt;, and&#10;&lt;a href="https://github.com/rasonyang/freesbc/blob/8bbc4e6ddb9ce752d14c64fa7362145a303ead99/docs/performance.md#L19" target="_blank" rel="noreferrer"&gt;there has been no run against FreeSWITCH&lt;/a&gt;. Everything here&#10;is single-node. When those numbers exist, they will get their own posts,&#10;with the setup next to them.&lt;/p&gt;&#10;&#10;&lt;h2 class="relative group"&gt;Coming up&#10; &lt;div id="coming-up" class="anchor"&gt;&lt;/div&gt;&#10; &#10; &lt;span&#10; class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;&#10; &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#coming-up" aria-label="Anchor"&gt;#&lt;/a&gt;&#10; &lt;/span&gt;&#10; &#10;&lt;/h2&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;Turn end is not playback end: why a bot cuts off its own goodbye&lt;/li&gt;&#10;&lt;li&gt;Barge-in is a truncation problem&lt;/li&gt;&#10;&lt;li&gt;One whitespace cut Qwen TTS first audio from 1.05 s to 0.25 s&lt;/li&gt;&#10;&lt;li&gt;Keeping a browser phone registered through sleep, Wi-Fi changes and F5&lt;/li&gt;&#10;&lt;li&gt;Why FreeSBC is a proxy and not a B2BUA&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;Code: &lt;a href="https://github.com/rasonyang/ai-native-callcenter" target="_blank" rel="noreferrer"&gt;AICC&lt;/a&gt; · &lt;a href="https://github.com/rasonyang/freesbc" target="_blank" rel="noreferrer"&gt;FreeSBC&lt;/a&gt; · &lt;a href="https://github.com/rasonyang/cascade-realtime-gateway" target="_blank" rel="noreferrer"&gt;Cascade Realtime Gateway&lt;/a&gt; · &lt;a href="https://github.com/rasonyang/web-sip-phone" target="_blank" rel="noreferrer"&gt;Web SIP Phone&lt;/a&gt;&lt;/p&gt;&#10;</description><media:content xmlns:media="http://search.yahoo.com/mrss/" url="https://rasonyang.dev/posts/ai-native-call-center-in-four-projects/featured.jpg"/></item></channel></rss>