Skip to content

Releases

Sipral 1.3.2

Choose a tag to compare

@samybalasa samybalasa released this 16 Nov 08:37
419ff19

Sipral 1.3.2, at C ABI 1.13 (unchanged). A fix release for iOS.

Fixed

  • iOS: the move to the background no longer crashes after the stack was replaced. SipralAppLifecycle kept the accounts given to keep(_:key:) and the subscriptions given to endInBackground(_:) across a stack's close, and on the next move to the background wrote down or ended them through the closed stack, which their unowned reference had already lost, so the runtime stopped the process. What was handed over on another stack is now let go by launched(_:) and skipped in the background; only the applied stack's own are written down and ended.

Nothing else changed: the library, the C ABI and every other binding are as in 1.3.1.

Install

  • Swift: .package(url: "https://github.com/SIPRAL/sipral", exact: "1.3.2"), with traits: ["Opus"] for the Opus variant (both XCFrameworks are attached below)
  • Rust: sipral = "1.3.2" on crates.io
  • Python: pip install sipral==1.3.2 (or sipral-opus)
  • .NET: Sipral, Sipral.Opus, Sipral.Maui 1.3.2 on NuGet
  • Node.js: sipral 1.3.2 on npm
  • Android, the JVM and React Native: 1.3.2 changed nothing there; Maven Central's org.sipral artefacts and npm's sipral-react-native stay at 1.3.1 for now and follow at 1.3.2 later
  • Dart and Flutter: sipral 1.3.2 on pub.dev

The full list of changes is in CHANGELOG.md.

Sipral 1.3.1

Choose a tag to compare

@samybalasa samybalasa released this 12 Nov 16:23
e981149

A push whose call screen iOS refuses now says why, a removed account takes its subscriptions with it, and the .NET package targets .NET 10.
At C ABI 1.13, unchanged: an application built on any earlier 1.x release works unchanged.

Added

  • A push whose call screen iOS refuses says so, and why. Under a Focus (filteredByDoNotDisturb) or for a blocked caller CallKit refuses the report; PushKitBridge.receive now answers PushOutcome.refused(VoipPush?, Error) with CallKit's error instead of unusable, PushKitAdapter.refused is told the same, and the binding is refreshed (RFC 8599 §4.1.3), so the INVITE still arrives for the application to refuse, busy (486) under a Focus, rather than the PBX waiting out its timer with no answer. A switch over PushOutcome that lists every case needs the new one.

Fixed

  • A removed account's subscriptions go with it. remove_account (sipral_account_remove) dropped the account's registration and publications but kept its subscriptions, which went on firing their refreshes with no account to send from and ended, one by one, as unreachable with no status, long after the application had removed the account; an application that removes and adds its account on every configuration change saw its presence and dialog subscriptions die that way. They are now dropped with the account, with no event, and lapse at the notifier.

Changed

  • The Sipral NuGet package targets .NET 10. .NET 8 and .NET 9 left Microsoft's support on 10 November 2026, so the package moves from net8.0 to net10.0, the one runtime still receiving security fixes; an application on .NET 8 or 9 keeps 1.3.0.

Sipral 1.3.0

Choose a tag to compare

@samybalasa samybalasa released this 05 Nov 06:59
7905f0c

Real phones, PBX WebRTC lines, browsers, SIP-I trunks, client certificates held by the platform, networking ready to use from C and Rust, a C++ API and a hook on every SIP message.
At C ABI 1.13: an application built on any earlier 1.x release works unchanged.

Added

  • Sipral from C++. bindings/cpp/include/sipral.hpp, header only and C++17, puts the stack, its accounts and calls, its events, the message hook and the networking component in classes over the C ABI: a stack destroyed and an account removed with its object, a failed call a sipral::Error with its status and the library's sentence, handlers as std::function whose exceptions never cross into the library (docs/27-cpp.md). bindings/cpp/smoke.cpp runs in the gate, and scripts/lab.sh network runs interop/network/register-and-hold.cpp after its C twin.

  • Networking ready to use, for a program with none of its own (C ABI 1.6). The new sipral-net crate runs the sockets, TLS (rustls, against the platform's trust store, a private authority beside it or alone, or one pinned certificate, with a client certificate when asked) and RFC 3263's NAPTR, SRV, A and AAAA lookups (hickory's resolver, the system's configuration or named servers) for the core; behind sipral-ffi's network feature, off by default, sipral_network_start, sipral_network_run and six more entry points run a stack's whole loop, a call's media socket included, reporting every refused connection with the reasons the bindings give (docs/26-network.md). scripts/lab.sh network registers a C program with no networking code over TLS at Asterisk, found by NAPTR and SRV, and holds and resumes a call.

  • Opus from the Swift package, and the telecom helper on Maven. The root Package.swift carries both variants as package traits, Standard by default and Opus (traits: ["Opus"], Swift 6.1 or later) over CSipral-opus.xcframework.zip, which now holds CSipralOpus.xcframework; xcframework.sh --release --with-opus writes its pair of constants. android.sh writes org.sipral:sipral-telecom with its POM and sources jar and puts it in the local Maven repository beside org.sipral:sipral.

  • A PBX WebRTC line. CodecCatalog::with_webrtc, and per account AccountSrtp::webrtc, describe a call the way Asterisk's webrtc=yes and the gateways in front of a WebRTC service expect: UDP/TLS/RTP/SAVPF keyed by DTLS-SRTP alone, ICE, a=rtcp-mux-only (RFC 8858), the stream alone in a BUNDLE group with a=mid, the MID header extension (RFC 8843, RFC 8285), a=msid (RFC 8830) and a=ssrc with its CNAME; the tag rides the first RTP packets and every RTCP report. Any catalogue now answers an offer that bundles as RFC 8843 asks, and an offer with a=rtcp-mux-only with mux (docs/05-media.md, "A WebRTC line"). Through the C ABI it is sipral_account_config_t::webrtc (ABI 1.4; a binding printed at 1.3 loads unchanged), and each idiomatic layer takes it with the account's SRTP settings, React Native's addAccount({webrtc: true}) and C++'s AccountOptions::webrtc among them. scripts/lab.sh webrtc places and receives calls on Asterisk's webrtc=yes endpoints over UDP and over a WebSocket and calls FreeSWITCH through Kamailio the same way, audio heard both ways on every call.

  • Trickle ICE (RFC 8838), carried in SIP by RFC 8840's trickle-ice Info Package (C ABI 1.4). IceTrickle::Half offers every candidate as before and takes a far end's late ones; IceTrickle::Full places or answers a call before its STUN mapping or TURN relay is back, sends them in INFO requests as they come, then a=end-of-candidates, and requires trickle-ice of the far end. sipral_stack_config_t::ice_trickle and sipral_call_config_t::ice_trickle take a sipral_ice_trickle_t, and the Python, Swift, .NET and Kotlin layers take it on the stack and on a call; the full agent pairs late candidates, unfreezes by RFC 8838 §12 and keeps a checklist open while candidates may still come (docs/06-nat.md, "Trickle ICE"; docs/08-ffi.md, "What ABI 1.4 added"). scripts/lab.sh trickle proves it through Kamailio and two NATs, and half trickle against Asterisk.

  • SIP-T and SIP-I: a carrier gateway's ISUP is read, not refused (C ABI 1.4). An INVITE, re-INVITE, UPDATE, PRACK or INFO carrying RFC 3204's application/ISUP, alone or in multipart/mixed beside the SDP, is taken, the SDP part read as the session description wherever one is; ISUP this end cannot read (ANSI, TTC) is refused 415 when required and ignored when optional, and a 415 lists application/sdp, application/isup, multipart/mixed. sipral_core::isup reads and writes the ISUP itself, from ITU-T Q.763: IAM, ACM, CPG, ANM, CON, REL and RLC with their numbers, redirection information, cause indicators and call indicators, every other message type recognised; a fuzz target holds it to never panicking. The IAM is CallerIdentity::isup, and fills in what the headers did not say (RFC 3398, ITU-T Q.1912.5): a withheld calling number asks for Privacy: id, a vouched international one from a trusted gateway is the asserted identity, the redirecting and original called numbers are the diversions; a REL in the BYE, CANCEL or refusal gives the call's end its Q.850 cause and name when no Reason did. No ISUP is sent (RFC 3372 §4.1). In C: SIPRAL_IDENTITY_TEXT_ISUP_CALLING, _ADDITIONAL_CALLING, _ORIGINAL_CALLED, _REDIRECTING, and sipral_message_isup, sipral_isup_read with sipral_isup_t, sipral_isup_number; the Swift and Kotlin layers carry CallerIdentity.isup and SipralCallerIdentity.isup. scripts/lab.sh isup runs a scripted SIP-I gateway's calls both ways through the C ABI.

  • A message hook: every SIP message seen, changed or dropped just before it is sent and just after it arrives (C ABI 1.5). Endpoint::set_message_hook in Rust, with Rewrite to set, add and remove header fields and change the body while keeping Content-Length true; sipral_stack_message_hook and sipral_hooked_message_replace in C; Stack.set_message_hook in Python; SipralStack.setMessageHook(_:) in Swift; SipralClient.setMessageHook in Kotlin; SipralStack.SetMessageHook in .NET, SipralStack.setMessageHook in Dart and Stack.setMessageHook in Node.js, each with a typed keep, replace or drop verdict; Stack::set_message_hook in C++; and in React Native, whose JavaScript answers too late to decide inside the stack, client.setMessageRules (fields set, added or removed by direction and method, applied by the Swift and Kotlin layers' hooks) and client.watchMessages, every message handed over after the fact. Retransmissions pass it again, keep-alives never do (docs/03-core-signalling.md, "A message hook"). scripts/lab.sh has Asterisk receive a REGISTER the hook gave a header, a changed Max-Forwards and no Expires.

  • A client certificate on SIP over TLS, its private key kept and used by the platform (C ABI 1.4). Swift ClientIdentity (a Keychain identity, or a certificate joined to a Secure Enclave key, with the key and its PKCS#10 request made on the device), Kotlin SipralClientCertificate (Android Keystore by alias, or any KeyStore), .NET SipralClientCertificate (CNG, the Keychain, or files on Linux), and PEM files in Python, Dart and Node.js, presented on the stack's TLS connection, an account's own and, where the layer opens one, TURN over TLS. A certificate that cannot be presented and a server that refuses it are told apart, as four values appended to sipral_tls_failure_t — client certificate required (5), refused (6), key unavailable (7), expired (8) — carried by SIPRAL_EVENT_KIND_TRANSPORT_FAILED, a TLS 1.3 server's late refusal included, and Asterisk's, which closes the connection with no alert at all (docs/22-tls.md, "A client certificate"; docs/08-ffi.md, "What ABI 1.4 added"). scripts/lab.sh tls gains Asterisk transports that require one, at TLS 1.3 and 1.2, for the Python, Kotlin and .NET agents and for C with OpenSSL (interop/tls/client-cert.c), each refusal to be reported as its own.

  • A mailbox's state taken unasked, by an account that says so (C ABI 1.10). Account::accepts_unsolicited_message_summary, in C sipral_account_config_t::unsolicited_mwi, takes a message-summary NOTIFY no subscription asked for, from the address the account registers with, for a PBX such as VitalPBX that ties the mailbox to the extension, refuses a subscription and notifies unasked: it is answered 200 and raised as UaEvent::MessagesWaitingUnasked, in C SIPRAL_EVENT_KIND_MESSAGES_WAITING with the account and no subscription. Off by default, when RFC 6665 §4.1.3's 481 still answers it; the Swift, Kotlin, JVM, .NET, Python, Dart, Node.js, React Native and C++ layers take it on the account (unsolicitedMwi, unsolicited_mwi), and Dart's SipralStackEvent.messageSummary now carries a messages-waiting event's counts (docs/04-ua.md, "Notifications outside a subscription we created are refused"; docs/08-ffi.md, "What ABI 1.10 added").

  • One TLS connection per identity, in every layer (C ABI 1.11). Accounts of different SIP domains or pinned certificates that one address serves, as a multi-tenant PBX does, are no longer put on the first account's connection and held to its name: sipral_transport_wanted_event_t names the server name and the pin the connection is for, and sipral_stack_stream_opening says, before connecting, which identity a connection is checked against, so the stack keeps it to the accounts of that identity. The Swift, Kotlin, JVM, .NET, Python, Dart and Node.js layers open one connection for each identity asked for and reuse one already open for it; their events carry the two new members (serverName, tlsPinSha256), and an explicit tlsServerName still wins (docs/08-ffi.md, "What ABI 1.11 added"; docs/26-network.md). A binding printed at 1.10 works with a 1.11 library as it did.

  • **An account's own client certificate gets a TLS connection of its o...

Read more

Sipral 1.2.3

Choose a tag to compare

@samybalasa samybalasa released this 21 Oct 12:58
bae1025

A move behind a NAT keeps the account registered at an Asterisk that rewrites the Contact: the old address is withdrawn on its own before the new one is added, and a 200 that lists no binding is asked again.
At C ABI 1.2, unchanged: an application built on 1.0, 1.1 or 1.2.x works unchanged.

Fixed

  • A move behind a NAT no longer leaves the account unregistered at Asterisk with rewrite_contact. When a STUN answer moved an account onto a new public address, the REGISTER that added it also removed the old address with expires=0. Asterisk's rewrite_contact, on by default for FreePBX extensions behind a NAT, rewrites a REGISTER's Contact to the request's source address, so a removal sent from the new socket can name the new binding. On an Asterisk 18.9 PBX a phone that moved from a cable to Wi-Fi lost its new binding to the REGISTER sent right after the move, was answered 200 with no Contact, and read as registered while calls to it went nowhere until the next refresh, up to an hour later. The old address is now removed in a REGISTER of its own, first, and the new one added once that is answered, so whatever a rewritten removal takes is added back (docs/06-nat.md, "When the mapping changes"); an old address the registrar's last 2xx showed it holds under another one is not removed at all, since that removal would be rewritten too. A 2xx that lists no Contact at all is asked once more before the account reads as registered; a registrar that never lists any is believed the second time. The lab runs the move against an account set up the way FreePBX sets one up (scripts/lab.sh natmove). At C ABI 1.2, unchanged.

Packages: crates.io sipral, and the Swift package from this repository with the XCFramework attached below. The other registries (PyPI, NuGet, Maven Central, npm, pub.dev) stay at 1.2.1 for now; an application that builds Sipral from source takes the fix from this tag.

Sipral 1.2.2

Choose a tag to compare

@samybalasa samybalasa released this 20 Oct 14:55
c9b317f

The start of a call heard in device mode: the devices open as the call is placed, the far end's first words are held until the loudspeaker runs, and on macOS the voice unit is built ahead of the call on the chosen devices.
At C ABI 1.2, unchanged: an application built on 1.0, 1.1 or 1.2.x works unchanged.

Fixed

  • In device mode the start of a call is heard. A far end that answers with a recorded greeting starts speaking within a fraction of a second, and the devices used to start opening only then: on a Mac, with a USB DECT headset chosen beside the Mac's own microphone, the voice unit took 3.4 seconds to open, stopped the headset twice on the way (the base drops its radio link each time, heard as the sound connecting and reconnecting) and the far end's audio was let go of until it had. Three changes, each on every platform where it applies (docs/05-media.md, "The built-in engine: device mode"):

    • the devices open as a managed call is placed or answered, not when its media starts (Engine::expect); the microphone indicator comes on with the call rather than with its answer;
    • the far end's audio is held while the loudspeaker opens, its newest second and a half, and played from its start; the loudspeaker catches up by skipping the quiet frames in what was held, and a call's echo canceller is told the held audio as part of the loudspeaker's delay;
    • on macOS the voice unit is built ahead of the first call, on the chosen devices, whenever nothing is open (sipral_io_coreaudio::prepare), instead of on the system's defaults and then moved at the start of the call. On the same headset the open then took 1.1 seconds, starting the headset once and never stopping it, and the engine's loudspeaker ran 0.4 seconds after the call was attached. Building the unit still interrupts what else plays on those devices for a few seconds; that now happens when no call is up.

    On a loopback device, a three-second greeting starting with the call was heard for 0.73 seconds before and for all of it after. At C ABI 1.2, unchanged.

  • A voice unit reused after echo cancellation was switched off processes again when it is switched back on. The unit a closed stream leaves for the next one kept the bypass the stream before it asked for, since an open only ever set the bypass on; it is now set either way. Found in the code while making the change above.

Packages: crates.io sipral, and the Swift package from this repository with the XCFramework attached below. The other registries (PyPI, NuGet, Maven Central, npm, pub.dev) stay at 1.2.1 for now; an application that builds Sipral from source takes the fix from this tag.

Sipral 1.2.1

Choose a tag to compare

@samybalasa samybalasa released this 19 Oct 06:47
5e364ed

A fix for subscriptions on Asterisk's chan_sip, one for messages read off TCP and TLS, every dependency and build tool at its newest release, and the lab's flows run against FreePBX, a VitalPBX tenant and a ViciBox.
At C ABI 1.2, unchanged: an application built on 1.0, 1.1 or 1.2.0 works unchanged.

Fixed

  • A NOTIFY that reuses the branch of the one before it is answered as its own request. Asterisk's chan_sip (VICIdial, older FreePBX) sends a subscription's NOTIFYs under one Via branch, and the stack took the second for a retransmission of the first and answered it with the first's 200 OK. chan_sip refused that answer and kept resending, so a message-waiting count, or anything else a subscription reports, never changed after its first NOTIFY. Every request but INVITE is now also matched on its CSeq number, which a retransmission repeats (docs/03-core-signalling.md). Found on a ViciBox, where message waiting now passes.
  • Where a TCP or TLS read ends no longer changes what the stack reads. The search for the blank line that ends a message's header fields stepped back three bytes to catch a blank line split between two reads, and after one message had been taken from a read, those three bytes were the end of that message. Its blank line, joined to a line feed at the start of what followed, could pass for the next message's, so a malformed head that arrived in the same read as the message before it was refused at once, where the same bytes in separate reads were held until their head ended. The search no longer steps back past the message it is looking for. Found by the framer fuzz target, whose input is now one of its seeds.
  • The voice-agent demo starts on the sipral wheel from PyPI. It asked for Opus first, and the sipral package is built without Opus, so the stack refused the codec order and the demo never answered; it now offers Opus only where the build has it. The demo runs from a checkout over pip install sipral websockets, with no native build.
  • The gate builds sipral-aec-webrtc with the abseil-cpp it names. On a machine where another package had installed abseil (Homebrew's Node.js 26 brings one), meson linked that copy rather than building the version its wrap pins, and the crate's licence list no longer matched what it was built from. scripts/check.sh now builds the crate with an empty pkg-config path, so meson always builds abseil-cpp from its own wrap.

Added

  • The lab's flows run against a FreePBX. scripts/lab.sh freepbx-live runs the lab's flows against the Asterisk under a FreePBX 16, on accounts and numbers interop/live/freepbx/install.sh adds beside FreePBX's own extensions, in the files FreePBX keeps for additions. On 16 October 2026 all thirteen passed on a FreePBX 17 (Asterisk 22, Debian 12), and all but DTLS-SRTP on a FreePBX 16 whose OpenSSL 1.0.2 predates the extended master secret, without which the stack does not key SRTP (docs/11-testing.md). The VitalPBX step also runs interop/live/pbx_features.py on four extensions of one tenant: both transfers, a SIP INFO digit and a MESSAGE passed there; message waiting did not, since that PBX sends it unsolicited.
  • The lab's flows run against the Asterisk inside a ViciBox. scripts/lab.sh vicidial-live first runs register, call, hold, both transfers, digits by RFC 4733 and SIP INFO, SDES, DTLS-SRTP, MESSAGE, G.729 (decoded there), message waiting on a message VoiceMail() records, and the compact form against VICIdial's own Asterisk 18 with chan_sip, on accounts and numbers interop/live/vicibox/install.sh puts on the box apart from the dialer's; all passed on 15 October 2026, message waiting once the fix above was in (docs/11-testing.md).
  • The lab runs MESSAGE through Kamailio and OpenSIPS and on FusionPBX, message waiting through both proxies and on FusionPBX, and digits both ways against baresip. Each proxy sends a MESSAGE to a user registered at it to that user's binding and anything else, with a SUBSCRIBE, to FreeSWITCH, which echoes 9006 from its chatplan and reports a message left on 9007 to the mailbox's subscription; FusionPBX echoes 9006 the same way. baresip has no dialplan, so interop/baresip/dtmf_echo.py sends back each digit it hears, by RFC 4733 and by SIP INFO. FusionPBX answers message-summary from its own MWI script, which it ships switched off and which stops at its first event as shipped (its configuration replaces Lua's debug library); the lab switches it on with debug.traceback kept (interop/fusionpbx/setup.sh).
  • The lab runs digits by SIP INFO, SDES and G.729 against FreeSWITCH and FusionPBX, and RFC 4733 digits through OpenSIPS. FreeSWITCH, behind Kamailio and behind OpenSIPS, and FusionPBX answer the numbers Asterisk answers for them (interop/freeswitch/lab.xml, interop/fusionpbx/lab_dialplan.xml), with the digit by INFO on 9013 since FreeSWITCH chooses the method per extension, and G.729 among the codecs their profiles accept. G.729 comes back as this end wrote it, as through Asterisk, and FreeSWITCH answers annexb=yes, so the call runs with Annex B on (docs/11-testing.md).

Changed

  • The .NET tests, samples and lab agents run on .NET 10. .NET 8 leaves Microsoft's support on 10 November 2026, so what this repository runs itself moves to net10.0 (net10.0-windows for the WPF sample) and the lab's containers to the .NET 10 SDK. The Sipral package itself stays on net8.0, the oldest runtime it supports, so an application on .NET 8, 9 or 10 takes it unchanged. The tests run on xunit v3, in its mtp-off variant: without the Microsoft Testing Platform and the telemetry client that platform brings in.
  • Dependencies and build tools at their newest releases. Rust 1.99.1 is the pinned toolchain, and the Docker images the packages and the lab build in name rust:1.99.1-trixie exactly, which the gate holds them to (the minimum supported Rust stays 1.95); sha2 0.11.1, zeroize 1.9.1 and the compatible releases beneath them; koffi 3.3.3 in the Node.js package; React Native 0.88.0, React 19.3.1 and Babel 8.0.7 for the React Native package's build and tests, whose react-native peer range is unchanged; Kotlin 2.4.21 for the JVM and Android builds and Gradle 9.8.1 for Android; the lab on Swift 6.4, Temurin 25, .NET 10 and a fresh Debian trixie image; fuzzing on the nightly of 17 October. Four stay where they are, each for a reason: rsa on 0.10.0-rc.19, since 0.10 has no release yet; getrandom on 0.2, which ring brings in; the React Native package's Android build on Gradle 9.4.1 and the Android Gradle Plugin 9.2.1, what React Native 0.88 itself builds with; and the Android command-line tools on 22.0.

Packages: PyPI sipral and sipral-opus, NuGet Sipral, Sipral.Opus and Sipral.Maui, Maven Central org.sipral (sipral, sipral-opus, sipral-jvm, sipral-jvm-opus), npm sipral and sipral-react-native, pub.dev sipral, crates.io sipral, and the Swift package from this repository with the XCFramework attached below.

Sipral 1.2.0

Choose a tag to compare

@samybalasa samybalasa released this 15 Oct 11:21
c29852d

A PBX line bridged to any voice agent, with a Pipecat transport and connectors to five speech services; OAuth2 sign-in to the PBX, SIP over a WebSocket the stack opens, LiveCommunicationKit on iOS, and Node.js and .NET MAUI packages. The sipral crate's Rust API is promised between releases and published on crates.io, and a week of calls held with no error.
At C ABI 1.2, which only adds: an application built on 1.0 or 1.1 works unchanged.

Added

  • The Rust API is promised, and published on crates.io. From 1.2.0 a program that builds against sipral 1.k builds against every later 1.x, as a binding built against an ABI minor loads against every later one. Promised is everything the crate names and documents: its root, the whole user agent as sipral::ua, the session descriptions as sipral::sdp, STIR/SHAKEN as sipral::stir, and every type their functions, fields and events hand over, each of which now has a name an application can write. A type that can grow is #[non_exhaustive], built with its constructor or with Default and field assignment; enumerations a standard closes, and the ones every variant of which a stack has to handle for its security (SRTP suites, keying, how RTCP travels), stay exhaustive and grow only in 2.0. The workspace crates sipral depends on are published as its parts, promise nothing of their own, and are named at the release's exact version. scripts/check.sh runs cargo-semver-checks on sipral against the newest release tag from v1.2.0 on (docs/08-ffi.md, "The Rust crates"). No C ABI change.
  • The comparison takes in baresip and linphonec, measures what each ships, and runs them side by side for hours. scripts/lab.sh compare runs the same scenarios for the headless agent, pjsua (Alpine), baresip (Fedora) and linphonec (Debian), each from its distribution's packages, and counts the shared libraries an application ships to make calls with each (interop/compare/size.sh); scripts/soak.sh compare [HOURS] keeps the four registered and taking three-minute calls from one Asterisk, sampled every minute. Run on 8 October 2026: idle memory 5.8 MB resident (5.4 on 2 October, a fixed 0.5 MB the 2 October agent run beside it does not have), anonymous memory growing 8.6 KB an hour against 23 to 106 for the others, and 6.36 MB shipped against 11.4, 13.2 and 208.5 (docs/23-compared-with-pjsip.md). scripts/soak.sh read its backstop count with core show globals, which Asterisk 22 does not have; it reads dialplan show globals.
  • VICIdial, by hand: an agent's phone in its session. scripts/lab.sh vicidial-live runs the two-extension calls against a ViciBox 12 (VICIdial, Asterisk 18) on the lab's LAN, then logs an agent in with phone 101 and checks what a dialer asks of an agent's phone: its call into the agent's conference answered, a caller joined to that conference with a tone heard both ways, a digit passed through it, the session kept when the caller leaves, and the call ended by the dialer when the agent is logged out (interop/live/vicidial.py); the account file is named by VICIDIAL_LIVE_ENV. The live-PBX script takes an optional <PREFIX>_CODEC (PCMA or PCMU) for a server that allows one only (docs/11-testing.md, "VICIdial: an agent's phone").
  • A live VitalPBX, by hand. scripts/lab.sh vitalpbx-live registers two extensions of a test tenant on a live VitalPBX 4.5 (Asterisk 20) through the Python layer and places two short calls between them -- a tone measured each way, an RFC 4733 digit, hold and resume, a BYE from each side -- then unregisters both; the account file is named by VITALPBX_LIVE_ENV, and the step is never part of a run that names nothing. (docs/11-testing.md).
  • LiveCommunicationKit on iOS 17.4 and later, as an alternative to CallKit. LiveCommunicationBridge reports incoming and outgoing calls to the system and routes its join, end, mute, pause and tone actions, its audio session and its reset to the bound Call, behind LiveCommunicationProviding, tested on macOS against a recording provider; LiveCommunicationAdapter is the real ConversationManager behind it, built for iOS, the simulator and Mac Catalyst. CallKitBridge and CallKitAdapter are unchanged (docs/15-mobile.md, "LiveCommunicationKit"). No C ABI change.
  • DTLS-SRTP proven against OpenSSL, and its state machines fuzzed as a pair. scripts/lab.sh dtls-interop, part of a run that names nothing, runs the handshake against openssl s_server/s_client -dtls1_2 -use_srtp with no SIP in between: in both roles and on all four profiles the RFC 5764 keying material is identical on both ends, and a certificate the fingerprint does not name, no common profile and DTLS 1.0 are refused either way round (docs/11-testing.md, "DTLS-SRTP against OpenSSL"). A new fuzz target, dtls_connection, puts the fuzzer on the path between a real client and server; five minutes found nothing.
  • .NET MAUI on iOS and Android. bindings/dotnet/Sipral.Maui, the Sipral.Maui package (not yet published), built by scripts/package/maui.sh: the binding for net10.0-ios and net10.0-android, with CSipral.xcframework linked into the application on iOS (P/Invokes to __Internal) and libsipral_ffi.so for arm64-v8a, armeabi-v7a and x86_64 under runtimes/android-*; SipralMicrophone for the permission, SipralAudioSession for the iOS audio session, and SipralAppLifecycle (builder.UseSipral), which writes registrations down into secure storage and suspends the stack on the way into the background, resumes it on the way back, and thaws them in a new process. The desktop package gains SipralStack.Suspending, SipralStack.Resumed, Account.Freeze and Account.Thaw. samples/Sipral.Sample.Maui builds and starts on the iOS simulator and an Android emulator; nothing has run on a phone. No C ABI change.
  • A voice agent with no key, all on one machine. sipral_agents.local (LocalAgentServer, LocalAgent, WhisperServer, Ollama, SystemVoice, CommandVoice, EnergyVad) and integrations/agents/examples/local_agent.py: whisper.cpp listens, a small Ollama model answers a sentence at a time, the system voice speaks, a turn ends on 700 ms of quiet and the caller talking over the agent cuts it short. On an Apple M2 the caller heard the first sound of an answer 4.3 to 7.1 s after the question; the example places such a call itself (--ask, --barge-in). No new dependency.
  • The local agent speaks with Pocket TTS, streamed. PocketVoice runs Kyutai's Pocket TTS (pocket-tts 3.3.0, MIT; weights and voices CC BY 4.0, fetched at first use) in the agent's process, loaded once, and streams each sentence into the call in 80 ms pieces resampled from 24 kHz (Resampler), the model stopped when the caller talks over it; local_voice falls back to say on macOS without it and names what to install elsewhere; --tts, --language (English, French, German, Spanish, Portuguese, Italian, Dutch) and --voice in the example; the optional extra sipral-agents[local]. On an Apple M2 the caller heard an answer begin 1.3 to 3.0 s after the question (five calls in six under 1.4 s), against 3.4 to 5.1 s with say, and talking over it stopped it in 0.21 s.
  • The Node.js layer reaches the whole ABI. SIP over TCP and TLS (TlsTrust: the platform's authorities, a private one, only one, or a pinned certificate; the connection made again with back-off), an account's own TCP or TLS connection, a request too large for a datagram moved to a stream, device mode (the engine's packets cross from a worker thread, so the engine never waits on the application's), Audio, LocalConference, subscriptions with presence, dialogs and a conference's picture, MESSAGE, OAuth 2.0 tokens (TokenRequired), the network test, servers located by name through a resolver, STUN and TURN on media sockets, ringing, redirects, real-time text, recording, three-way calls, screening, processors, logs and diagnostics, and every event's whole payload as fields; 59 tests on loopback.
  • The resource and Host of a WebSocket are the application's to name, and SIP over a secure WebSocket is proven against Asterisk. sipral_account_config_t::websocket_host and websocket_resource (ABI 1.2, appended) set what the handshake of an account's own WS or WSS connection asks for, /ws and the server's address when left out; Account::websocket_target in Rust. Swift, .NET, Kotlin, Python, Dart, React Native and Node take ws and wss as an account's own connection and the two values beside it; such an account's Contact naming an IP address names a .invalid host instead (RFC 7118 §5). scripts/lab.sh wss registers, calls the echo and hangs up over Asterisk's TLS listener on 8089 (docs/11-testing.md).
  • Node.js and TypeScript. bindings/node, the sipral npm package (not yet published): tools/abi-gen prints its raw layer, src/sipral_abi.ts, for koffi 3.3.2 (MIT, prebuilt, no compiler at install), and Stack, Account, Call and Media are written over it in TypeScript, events as an EventEmitter and an async iterator, each call's PCM in the application's hands. Tested on loopback with a tone each way, DTMF, a transfer refused and one taken, and a registration through a simulated registrar's digest challenge, as a new area of the gate, scripts/check.sh --only node (docs/08-ffi.md, "Node.js"). No C ABI change.
  • The lab proves FusionPBX, caller identity, diversion, redirection and failover. scripts/lab.sh fusionpbx runs FusionPBX 5.6.5 -- its database, schema, domain, extension and dialplan, and FreeSWITCH on FusionPBX's own configuration and scripts (interop/fusionpbx) -- and the harness's registration, call, hold, both transfers, RFC 4733 digit, DTLS-SRTP and compact flows straight at it, then a call to its own echo. scripts/lab.sh identity has the Python layer send a P-Asserted-Identity Asterisk takes and asserts again to a second account that re...
Read more

Sipral 1.1.0

Choose a tag to compare

@samybalasa samybalasa released this 04 Oct 18:43
5a6148d

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.md and 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 in docs/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; AUTHORS and LICENSE-COMMERCIAL.md give its full legal identity.
  • A security report is acknowledged within 7 business days. SECURITY.md promised 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_recovered counts them, and the headless agent's last line of a call says recovered=. No C ABI change. Measured between two stacks over the lab's lossy and mobile profiles 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 UNREGISTERED at once, as one sent at once does, and goes as Expires: 0 when 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 -q stopping at the first match made the writer die of SIGPIPE under pipefail, 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 To tag that repeats another's From tag, Call-ID and CSeq is 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 whose To names 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-opus wheel for x86_64 Linux checks THIRD-PARTY-LICENSES.txt against the all-target graph it lists rather than its own target's; and bindings/c/smoke.c compiles under gcc's -Wextra -Werror at 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 Roma...
Read more

Sipral 1.0.0

Choose a tag to compare

@samybalasa samybalasa released this 04 Oct 18:43

The first release, at C ABI 1.0. What it promises, for every 1.x release:
the C ABI surface frozen at minor 0.33 and carried into ABI 1.0 unchanged —
names, numbers, struct layouts, the behaviour a caller sizes buffers or
retries by, and ownership — stands, a later minor only appends to it, and a
binding built against ABI 1.k loads against every library at 1.m with
m ≥ k (docs/08-ffi.md, "The freeze" and "ABI 1.0"). What it
publishes is the C library and the language packages over it: the Swift
package with its XCFramework, NuGet, the Python wheels, the Android AAR and
the JVM jar on Maven as org.sipral, the Dart package and the React Native
package. The Rust crates are not part of it, and their API promises
nothing. Security fixes reach the current minor release and the one before
it.

The full list of what 1.0.0 adds, changes and fixes is in CHANGELOG.md at this tag: https://github.com/SIPRAL/sipral/blob/v1.0.0/CHANGELOG.md

1.0.0 is published as this tag only. The packages above reach their registries first at 1.1.0, which is fully compatible with it (same C ABI 1.0).