Repository navigation
Sipral 1.1.0
The headless agent sends its audio on a steady 20 ms clock and waits on its socket instead of sleeping, Opus rebuilds lost frames from in-band FEC, the in-band DTMF detector costs a fraction of what it did, and the gate holds every published figure to its budget.
The fixes: a forked INVITE rings on both lines of one stack, a waiting de-registration goes as one, the agent echoes every frame, and more below. Still at C ABI 1.0: no surface changed.
Added
- The published figures are held by the gate. A new area,
scripts/check.sh --only numbers, part of the complete gate, measures what the README,docs/19-numbers.md,docs/23-compared-with-pjsip.mdand the website publish -- the shared library's size, the first and authenticated INVITE of the lab's call with and without ICE, a live call's memory and an idle stack's, counted by the signalling test's allocator, and a frame of the in-band digit detector, timed against a fixed loop on the same thread so that a loaded machine does not read as a regression -- and fails when one passes its budget indocs/numbers.toml, naming the figure, what it now measures, the budget and every place it is published.docs/11-testing.md, "The published figures", says how each is measured and how to change one on purpose.
Changed
- Sytek holds the copyright in Sipral and grants the commercial licence. Every file's copyright line and the package manifests name it;
AUTHORSandLICENSE-COMMERCIAL.mdgive its full legal identity. - A security report is acknowledged within 7 business days.
SECURITY.mdpromised 3; the triage, fix and disclosure commitments are unchanged. - Listening for keypad digits in a call's audio costs a fraction of what it did. The in-band detector, which runs on every frame of a call that negotiated no telephone event, passes over a window whose samples alone carry too little energy for a digit before any of its filters runs, keeps that window's samples so that the next window's frequency reading still has the one before it, runs its filters beside the window's own power in one pass, and takes the square root and the phase of only the filters it goes on to read. What it hears is unchanged: every reading it takes is the same to the bit, and so is every digit, edge and refusal, on every test in the tree and on three thousand generated cases compared against 1.0. Measured on an Apple M2 (
docs/19-numbers.md): the load test's frame, which carries silence, from 7.2 to 0.72 µs with two hundred calls; the detector alone on speech from 6.7 to 1.35 µs a frame, and on loud noise, where every window runs the filters, from 7.2 to 2.7 µs. - The headless agent waits for SIP instead of sleeping. Its loop slept 5 ms whenever a turn read nothing, and an answer decided in one turn went out in the next. It now writes what a turn decided before the turn ends, and waits until a SIP datagram arrives or the next thing it has to do falls due: the stack's next timer, the next look at the route, the next instant of its audio grid while it holds calls (below), and a look at standard input every 50 ms while that is open. Every call's own socket is still read on every turn rather than waited on, so a thousand calls with audio waiting cost no extra wake-up. Measured on the Linux lab machine, two runs each, logs kept (
docs/19-numbers.md): a call set up on loopback, INVITE to 200 at the caller, in a median 1.3 ms where it took 8.9 to 10.0 ms; no measurable processor time idle; and a thousand calls held with the median set-up at 8.0 to 11.0 ms where it was 14.8 to 16.2 ms, at 0.86 of one core where the loop that rested after each turn took 0.78. Against the lab's Asterisk (docs/23-compared-with-pjsip.md), it registers in 3.3 to 6.7 ms, places a call in 5.2 to 7.6 ms and answers one in 0.7 to 1.1 ms, where the comparison's run read 7.7, 10.8 and 9.5 ms. - The headless agent sends its audio on a steady clock. On Linux its frames left 16, 24 or 28 ms apart rather than 20, because its loop's waits ended on scheduler ticks, and Asterisk measured 5 ms of jitter on its audio over a clean link. One thread now reads the SIP socket and hands each datagram over a channel, whose waits end on time; while calls have audio the loop turns on a fixed 10 ms grid and sends every frame on it, with no thread per call and no busy wait. Measured in the lab (
docs/19-numbers.md): the gaps between one call's frames from a standard deviation of 5.7 ms to 0.05 to 0.20 ms, against pjsua's 0.5 to 0.7 ms, and Asterisk's jitter on the agent's audio over a clean link from 5 ms to 0 or 1; a hundred calls on loopback at 13.3 to 13.9 % of a core where the waiting loop cost 11.7 to 12.4 % and 1.0.0 13.7 to 15.0 %. On the mobile profile Asterisk still reads more jitter on the agent's audio than on pjsua's; captured where it leaves the impaired link, the two streams carry the same jitter (docs/23-compared-with-pjsip.md). - Opus sizes its in-band FEC by the loss the far end reports. The encoder was told to expect 5 % loss on every call and paid for a copy of each spoken frame whatever the link did. It now starts at 5 % and follows the fraction lost in the far end's reception reports — believed at once when it rises, halfway each report when it falls, at most 30 % — so a clean link stops paying for copies after the first report; the payload stays the size libopus chooses for the rate.
Fixed
- Opus rebuilds a lost frame from the copy the next packet carries. The stack offered
useinbandfec=1, which says this end decodes Opus's in-band forward error correction (RFC 7587), and concealed every lost frame anyway. When the jitter buffer finds a frame missing and already holds the packet after it, and that packet carries a copy — read from its first header bits with RFC 6716's range decoder,sipral_media::opus::carries_fec— the frame is decoded from the copy;StreamStatistics::fec_recoveredcounts them, and the headless agent's last line of a call saysrecovered=. No C ABI change. Measured between two stacks over the lab'slossyandmobileprofiles emulated in process (docs/19-numbers.md): 37 % and 39 % of the lost frames rebuilt, the loss left to concealment from 7.6 % to 4.8 % and from 3.9 % to 2.4 %. - The headless agent echoes every frame it hears. It kept only what the latest turn of its loop heard, and its loop turns more than once a frame, so the frame it said back was most often an empty one: 355 of 1 527 packets it sent in a lab capture carried audio. A turn that moves no frame now leaves what was heard for the turn that does.
- A de-registration that has to wait goes as one. Asked for while the account waited for its registrar's lookup or for its own connection, it reads
UNREGISTEREDat once, as one sent at once does, and goes asExpires: 0when the wait ends; it used to keep the old state and could be sent, or retried, as a REGISTER asking for the binding back. - A stack on every interface keeps choosing its own address after a move. A stack created with no bind address keeps choosing its own address after a network change, in the Swift, Kotlin, .NET and Python layers: its socket stays on every interface and its port, and it advertises the route toward its first account's server again, and each account the route toward its own. It used to take the new address as fixed from then on, so a server reached over a VPN, or a second account's server reached another way, was told an address it could not reach.
- The examples take their RTP and RTCP ports as a pair. The examples' media socket holds the RTCP port next to its RTP port from the moment it binds, where it bound RTCP only once the call's plan named it and lost that port to another call in about one call in twenty-five at a thousand at once.
- The scripts read a listing to its end. The gate, the lab and the packaging scripts read a whole listing before deciding a line is not in it:
grep -qstopping at the first match made the writer die of SIGPIPE underpipefail, which read a match as none under load — the parallel gate's AAR dry run missing classes it had, a lab call's log missing the packets it counted — and could pass the check that libopus is out of a graph that has it. - One INVITE forked to two lines of one stack rings on both. RFC 3261 §8.2.2.2's merged-request check now compares the Request-URI too: a request with no
Totag that repeats another'sFromtag,Call-IDandCSeqis answered 482 only when it reaches the same line (the same Request-URI, or one equivalent by §19.1.4), and a copy a proxy forwards to another contact the stack registered is that line's call. A parallel fork or ring group to two accounts of one stack used to ring one line and refuse the other 482, and a ring group hunting to the next line within five seconds over UDP met the same 482. A branch whoseTonames one line's address of record and whose Request-URI names another line's contact is now the second line's call, where the oldest of the two accounts took it. A STIR-signed call forked this way verifies on both lines. No C ABI change. - The Linux packaging runs to the end. The AAR's POM links the commercial licence at https://sipral.org/terms/, as the JVM POM does; the
--with-opuswheel for x86_64 Linux checksTHIRD-PARTY-LICENSES.txtagainst the all-target graph it lists rather than its own target's; andbindings/c/smoke.ccompiles under gcc's-Wextra -Werrorat ABI minor 0, which the linux-arm64 wheel's run under qemu builds it with. - The NuGet package names only the runtimes it carries. Its README listed win-arm64, which no release has built yet: Windows on ARM64 needs the MSVC ARM64 build tools, and the package carries win-x64, osx-arm64, osx-x64, linux-x64 and linux-arm64.
- The npm package carries THIRD-PARTY-NOTICES.md, like every other package, and SECURITY.md says whose business days and clock its deadlines count in (Monday to Friday outside Romania's public holidays, Romanian time).
- Packaged natives name no path of the machine that built them. Source paths read
/cargo/...,/rustc/...and/sipral/...instead of the builder's home directory and checkout, the macOS dylib's install name is@rpath/libsipral_ffi.dylib, and every packaging script fails a native that still holds such a path.
Packages: PyPI sipral and sipral-opus, NuGet Sipral and Sipral.Opus, Maven Central org.sipral (sipral, sipral-opus, sipral-jvm, sipral-jvm-opus), npm sipral-react-native, pub.dev sipral, and the Swift package from this repository with the XCFramework attached below.