Repository navigation
Sipral 1.2.0
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
sipral1.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 assipral::ua, the session descriptions assipral::sdp, STIR/SHAKEN assipral::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 withDefaultand 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 cratessipraldepends on are published as its parts, promise nothing of their own, and are named at the release's exact version.scripts/check.shrunscargo-semver-checksonsipralagainst the newest release tag fromv1.2.0on (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 compareruns 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.shread its backstop count withcore show globals, which Asterisk 22 does not have; it readsdialplan show globals. -
VICIdial, by hand: an agent's phone in its session.
scripts/lab.sh vicidial-liveruns 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 byVICIDIAL_LIVE_ENV. The live-PBX script takes an optional<PREFIX>_CODEC(PCMAorPCMU) 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-liveregisters 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 byVITALPBX_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.
LiveCommunicationBridgereports 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 boundCall, behindLiveCommunicationProviding, tested on macOS against a recording provider;LiveCommunicationAdapteris the realConversationManagerbehind it, built for iOS, the simulator and Mac Catalyst.CallKitBridgeandCallKitAdapterare 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 againstopenssl s_server/s_client -dtls1_2 -use_srtpwith 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, theSipral.Mauipackage (not yet published), built byscripts/package/maui.sh: the binding fornet10.0-iosandnet10.0-android, withCSipral.xcframeworklinked into the application on iOS (P/Invokes to__Internal) andlibsipral_ffi.sofor arm64-v8a, armeabi-v7a and x86_64 underruntimes/android-*;SipralMicrophonefor the permission,SipralAudioSessionfor the iOS audio session, andSipralAppLifecycle(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 gainsSipralStack.Suspending,SipralStack.Resumed,Account.FreezeandAccount.Thaw.samples/Sipral.Sample.Mauibuilds 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) andintegrations/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.
PocketVoiceruns Kyutai's Pocket TTS (pocket-tts3.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_voicefalls back tosayon macOS without it and names what to install elsewhere;--tts,--language(English, French, German, Spanish, Portuguese, Italian, Dutch) and--voicein the example; the optional extrasipral-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 withsay, 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 asfields; 59 tests on loopback. -
The resource and
Hostof a WebSocket are the application's to name, and SIP over a secure WebSocket is proven against Asterisk.sipral_account_config_t::websocket_hostandwebsocket_resource(ABI 1.2, appended) set what the handshake of an account's own WS or WSS connection asks for,/wsand the server's address when left out;Account::websocket_targetin Rust. Swift, .NET, Kotlin, Python, Dart, React Native and Node takewsandwssas an account's own connection and the two values beside it; such an account'sContactnaming an IP address names a.invalidhost instead (RFC 7118 §5).scripts/lab.sh wssregisters, calls the echo and hangs up over Asterisk's TLS listener on 8089 (docs/11-testing.md). -
Node.js and TypeScript.
bindings/node, thesipralnpm package (not yet published):tools/abi-genprints its raw layer,src/sipral_abi.ts, for koffi 3.3.2 (MIT, prebuilt, no compiler at install), andStack,Account,CallandMediaare written over it in TypeScript, events as anEventEmitterand 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 fusionpbxruns 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 identityhas the Python layer send aP-Asserted-IdentityAsterisk takes and asserts again to a second account that reads it from a trusted peer, read aDiversionon a call Asterisk marked diverted, and follow a 302 on calls placed asking to (interop/identity/scenarios.py);scripts/lab.sh locateregisters and calls through the second of two SRV targets when the first is dead. VitalPBX is not in the lab: it is closed source with no image, and its installer turns a whole Debian 12 machine into the PBX under systemd, with firewalld and fail2ban, then reboots it (docs/11-testing.md). -
SIP over a WebSocket the stack opens (RFC 7118 on RFC 6455). A TCP connection, or a TLS one the application secured, bound as
WsorWsswith its far end named becomes a WebSocket the stack runs: the handshake asking for thesipsubprotocol, every message in a masked frame, fragments reassembled, pings answered and sent, a close answered or sent (UserAgent::close_websocket), and aViaandContactnaming a random.invalidhost. An account's WebSocket is asked for and reconnected like its TCP or TLS connection (Account::on_stream, orstream_protocolin the C ABI), and a WebSocket given up on isSIPRAL_EVENT_KIND_TRANSPORT_FAILEDwith the reason.UserAgent::set_websocket_targetsets the resource andHost(/wsand the address otherwise). No C ABI change;docs/04-ua.md, a fuzz target for the frame reader, andscripts/lab.sh websocketregistering and calling Asterisk's echo over one. -
A network test before a call (C ABI 1.2).
sipral_stack_network_testasks, without placing a call of its own, whether a STUN server answers and what its answer says about the NAT, whether the TURN server allocates a relay, whether the account's server answers anOPTIONSon the account's own transport and how fast (UserAgent::probe_server), and, given a call the application placed to an echo service, the loss, jitter, round trip and G.107 R and MOS of what comes back before it hangs the call up;SIPRAL_EVENT_KIND_NETWORK_TEST(60) carries every part and a verdict, good, acceptable or poor, by thresholds written down indocs/25-network-test.md. PythonStack.network_test, SwiftSipralStack.networkTest, .NETSipralStack.NetworkTest, Kotlin and the JVM jarSipralClient.networkTestandnetworkTestOf, DartSipralStack.networkTest, React Nativeclient.networkTestand thenetworkTestevent. -
Answering-machine detection on the calls a voice agent places.
sipral_agents.dialplaces a call, lets the library decide who answered, and joins the agent for a person; for a machine it hangs up, connects at the beep to leave a message, or connects anyway, as the account'sMachinePolicysays, with the detector's limits set per policy. The bridge's file carries it as[accounts.machine], andpython -m sipral_agents bridge.toml --dial TARGET --from AORplaces one call (docs/24-voice-agents.md, "Calls the agent places"). Tested on loopback with a synthesised person, a greeting that runs on, and a greeting and its beep. No C ABI change. -
Ringing, header fields and transfer in Python.
Stack.ring_call(a 180, or a 183 withmedia=True),Call.ring,Call.ring_media,Call.transfer,Call.set_headers,headers=onStack.place_callandStack.accept_transfer_placed; .NET gainsSipralStack.AcceptTransferPlaced. The SIP bridge insipral-agentsuses them instead of the C entry points: the caller's context goes on the INVITE to the agent, an outcome on the agent's BYE is read, and a transfer it places itself is reported to the agent's REFER. -
What a bridge between two calls needs (C ABI 1.2). A REFER the far end refuses outright, or never answers, is now
SIPRAL_EVENT_KIND_TRANSFER_DONEwith its status instead of silence;SIPRAL_EVENT_KIND_CALL_ENDEDof a call the far end hung up carries its BYE, so a field on it can be read; andsipral_call_accept_transfer_placed(UserAgent::accept_transfer_placed) answers a REFER 202 and reports a call the application placed itself in the NOTIFYs (docs/08-ffi.md, "What ABI 1.2 added"). -
A phone voice agent in one command.
python -m sipral_agents.demoanswers calls -- directly from a softphone, or on a PBX extension withSIPRAL_REGISTRAR_ADDRESSand the account's settings -- and joins each to OpenAI Realtime whenOPENAI_API_KEYis set, or with no key to a local echo agent speaking the same WebSocket protocol, so the whole path is heard working without an account.integrations/agents/README.md, "A voice agent in five minutes";tests/test_demo.pycalls it on loopback and hears its tone back. -
A ready-to-run bridge from a configuration file.
python -m sipral_agents bridge.toml(thesipral-agentscommand) registers every account a TOML file lists and hands each call to the agent named for its account: one of the five WebSocket services, or a SIP address through the SIP bridge, which moves frombindings/python/examples/agent_bridge.pyinto the package assipral_agents.sip_bridge. Keys and passwords come from the environment variables the file names (api_key_env,auth_password_env) and a secret written in the file is refused;--checkprints the routes without starting.integrations/agents/examples/bridge.toml,docs/24-voice-agents.md; tested with a bridge started from a file against a local OpenAI stand-in and a SIP agent on loopback. -
A call joined to ElevenLabs Agents, Vapi or Deepgram Voice Agent over WebSocket.
sipral-agentsgainsElevenLabsAgent(the conversation WebSocket at the agent's PCM rate, 16 kHz by default, its pings answered and audio from before an interruption dropped),VapiAgent(one Vapi call per SIP call, created withPOST /calland avapi.websockettransport inpcm_s16leat 16 kHz,hangupsent when the caller leaves) andDeepgramAgent(linear16at 24 kHz in binary frames, the listen, think and speak providers named by the application). The core gainsProvider.prepare,Provider.farewell, aReplysignal andSessionRefused, which ends the call with the reasonrefusedinstead of retrying. Tested against local stand-ins written from each vendor's public protocol documentation, read on 7 October 2026;docs/24-voice-agents.mdexamples/livekit_bridge.pyputs a call in a LiveKit room as a participant with LiveKit's Python SDK (Apache-2.0, the example's only), run against a locallivekit-server --dev. -
A call joined to OpenAI Realtime or Gemini Live, with no framework.
sipral-agents, a Python package inintegrations/agents, answers each call withserve(account, factory)(or joins one withAgentCall) and connects it to the service's WebSocket API: the call's frames switched to the service's 24 kHz withMedia.set_app_rate, the agent's audio paced a codec frame at a time with at most 40 ms queued so a barge-in silences it at once (OpenAI's turn truncated to what the caller heard), events for the application, reconnection with exponential backoff (Gemini sessions resumed,goAwayfollowed at once), and either side's end ending the other. AProvidersubclass is all another service needs. Its tests join real calls on loopback to local stand-ins written from each vendor's public protocol documentation, as a new area of the gate,scripts/check.sh --only agents; nothing was run against the vendors' services. No C ABI change. -
OAuth 2.0 sign-in to the PBX (RFC 8898, C ABI 1.2). A server that challenges with
Beareris answered withAuthorization: Bearer <token>(RFC 6750) from the access token the application supplies; the stack never contacts the authorization server.SIPRAL_EVENT_KIND_TOKEN_REQUIRED(UaEvent::TokenRequired) names theauthz_server, thescope, the realm and the server'serrorwhen the account's own server wants a token the account does not have or has had refused (invalid_token);sipral_account_set_access_token(UserAgent::set_access_token) hands it over, and a refused token is never offered to that server again. Offered Digest and Bearer for one realm, the token answers. SwiftAccount.setAccessToken, .NETAccount.SetAccessToken, Kotlin and the JVM jarSipralAccount.setAccessTokenandtokenRequiredOf, PythonAccount.set_access_token, DartSipralAccount.setAccessToken, React Nativeaccount.setAccessTokenand thetokenRequiredevent (docs/04-ua.md, "OAuth 2.0 access tokens";docs/08-ffi.md, "What ABI 1.2 added"). -
A voice agent's first frame and first reply, measured; and a day-long endurance run.
scripts/soak.sh latencytimes three hundred calls through the lab's Asterisk to the headless socket application and its echo agent, both with a new--timingsflag: 31.5 ms median (31.9 ms p95) from the INVITE to the agent's first audio frame, 20.4 ms (20.6 ms p95) from the agent's first reply to the RTP packet carrying it.scripts/soak.sh endurancekeeps the pair taking three-minute calls and registering again every two minutes for a day, sampling memory, processor time, descriptors and errors each minute (docs/19-numbers.md). -
The gate's
windowsarea runs the Python binding's tests on a real Windows x64 machine, against asipral_ffi.dllbuilt there from the tree. -
The platform's echo cancellation is switched on a running stack (C ABI 1.1).
sipral_audio_set_system_echo_cancellation(stack, on)turns the platform's own canceller on or off without a new stack: open devices are reopened at once with or without it (the voice-processing unit on macOS and iOS, the communications stream on Windows, the voice-communication preset on Android), on the devices they were on and with their gain and mute, and a call keeps its media through the short gap;sipral_audio_info_tandsipral_stack_settings_treport the new state. Application mode isSIPRAL_STATUS_WRONG_STATE. SwiftAudioDevices.setSystemEchoCancellation, .NETSipralAudioEngine.SetSystemEchoCancellation, Kotlin and the JVM jarSipralAudioDevices.setSystemEchoCancellation, PythonAudio.set_system_echo_cancellation, DartSipralStack.setSystemEchoCancellation, React Nativeclient.audio.setSystemEchoCancellation(docs/08-ffi.md, "What ABI 1.1 added"). -
The application chooses the rate of a call's frames (C ABI 1.1).
sipral_media_set_app_rate(media, hz)hands out and takes a call's PCM at 8, 16, 24 or 48 kHz whatever the codec negotiated, converted both ways by the library's own resampler, with the frame keeping the call's duration andsipral_media_info_treporting the rate chosen; 0 is the codec's own rate, the default. Any other rate isSIPRAL_STATUS_INVALID_ARGUMENT, and device modeSIPRAL_STATUS_WRONG_STATE. Every binding carries it on its media object: SwiftMedia.setAppRate, .NETCallMedia.SetAppRate, Kotlin and the JVM jarSipralMedia.setAppRate, PythonMedia.set_app_rate, DartSipralMedia.setAppRate, React Nativecall.audio.setAppRate. A binding printed at ABI 1.0 still loads; one printed at 1.1 is refused by a 1.0 library (docs/08-ffi.md, "What ABI 1.1 added"). -
A bridge from a PBX line to a voice agent that answers SIP itself.
crates/sipral/examples/agent-bridge.rsandsipral_agents.sip_bridge(inintegrations/agents) register as an extension, call the agent's SIP address for each caller and join the two calls in a local conference without this end: digits forwarded both ways, either hangup ending the other, the outcome told to the PBX on the BYE or by a REFER, a REFER from the agent passed to the PBX, the caller's number, name andX-fields sent to the agent, and a longest duration for the agent's call.docs/07-headless.md, "Bridging a call to a voice agent that speaks SIP";tests/agent_bridge.rsandscripts/lab.sh bridge. No C ABI change. -
docs/24-voice-agents.md: connecting Sipral to AI voice-agent services. The three paths -- a SIP bridge that answers a call and joins it to a second call placed to the service, a Pipecat transport (sipral-pipecat), and the call's PCM for an application that talks to the service's WebSocket API -- and, for 44 speech-to-speech APIs, hosted agent platforms, frameworks and speech engines, the path that reaches each one, its SIP address, transports, codecs and admission rules or its streaming audio format, with the vendor documentation each fact was read from. -
A Pipecat pipeline runs on a call.
sipral-pipecat, a Python package inintegrations/pipecat, makes one call in application audio mode a Pipecat transport: the caller's frames become input audio frames at the call's own rate, which Pipecat resamples as its services need; the pipeline's audio goes to the call a codec frame at a time in real time, with never more than 40 ms queued, so an interruption silences it at once; keypad digits cross as Pipecat's DTMF frames both ways; the call's end cancels the pipeline and the pipeline's end hangs up.serve(account, factory)answers every call to an account with a pipeline of its own. Its tests run two stacks on loopback with no network and no key, as a new area of the gate,scripts/check.sh --only pipecat. -
.NET: transfer, ringing, screening and a refreshed registration without the raw ABI.
Call.Transfer(target)(blind, RFC 3515) andCall.TransferTo(other)(attended, RFC 3891), withCall.WaitForTransferAsync()returning theTransferDonethe transfer ends with;SipralStack.AcceptReferralandRejectReferraltake aTransferRequestedas they take a referral.SipralStack.RingCall(args)sends 180 andSipralStack.RingCallWithMedia(args, ...)sends 183 with early media and returns theCallto answer.SipralStack.Screen(policy)installs an INVITE screening policy oversipral_stack_screen, each INVITE handed over as aSipralInvitewith its source, bytes and headers.Account.RefreshBinding()sends the REGISTER refresh now. Each is proved on loopback stacks inSipral.Tests/CallControlTests.cs. No C ABI change. -
A call's own codec order in every binding, placing and answering.
sipral_call_config_t::codecsreached Swift and Kotlin already; it now reaches .NET (SipralCallOptions.CodecsforPlaceCallandAnswerCall), Python (codecs=onplace_call,answer_callandCall.answer_with), Dart (codecs:onplaceCallandanswerCall), the JVM jar (SipralJava.placeCallandanswerCall) and React Native (call.answer({codecs}), besideplaceCall's). An answer keeps the offer's order (RFC 3264 §6.1), so an answering list chooses which codecs rather than which comes first. Every binding tests thatPCMA,PCMUsettles on PCMA, placing and answering. No C ABI change. -
A call answered 3xx can be followed. A call placed with
OutgoingCall::follow_redirects(sipral_call_config_t::follow_redirects, new in ABI 1.2;followRedirects,follow_redirectsorSipralCallOptions.FollowRedirectsin the layers) goes again to the 3xx'sContacttargets, most preferred first, as a new INVITE of the same call -- the sameCall-ID,FromandTo, the next number, the target as Request-URI (RFC 3261 §8.1.3.4) -- and a target that refuses is followed by the next one. A 380, a 6xx, a target already tried and a forked call are not followed, and one call places at most eight redirected INVITEs. Off by default: a 3xx still ends the call with its status and itsContactreadable, as ABI 1.0 and 1.1 promised; the voice-agent bridge andscripts/lab.sh identityturn it on (docs/04-ua.md, "Following a call sent somewhere else").
Changed
- What a Rust application meets of the SIP core is the user agent's own. A connection wanted, a next hop to resolve, a dead flow and a refusal at a limit arrive as
UaEvent::TransportWanted,ResolveNeeded,FlowFailedandOverloadedrather than insideUaEvent::Unclaimed, which an application depending onsipralalone could not name;UserAgentanswers a resolution and reads its settings, bound transports, retransmissions, refusals and diagnostics itself. A request an event carries reads its headers by name, its body, method and status fromOwnedMessage, and the SIPREC readers and the DTMF INFO parser take one. What reaches the core's own types (UserAgent::endpoint,UaEvent::Unclaimed,OwnedMessage::as_rawand a few more,docs/08-ffi.md) is kept for the workspace's layers and left out of the promise. Struct literals of a growable type become its constructor (MediaPlan::new,RtpMap::new,Transmit::new,Srv::new,Claims::new,VoipMetricsBlock::newand others) orDefaultwith fields set. - The gate runs the areas that wait on real time alone.
swift,kotlin,pythonandagentsstart once every other area ofscripts/check.shis done and run one at a time, since beside the Rust builds all four missed their deadlines in the complete gate and passed alone (docs/11-testing.md). - The local agent answers in under a second.
LocalAgentServerstarts the answer at the caller's first 200 ms of quiet (EnergyVad.pause_ms, a"pause"and a"resume"fromfeed) and holds all of it, the question's transcript included, until the 700 ms that end a turn have passed, cancelling it unheard if the caller goes on; the reply's first piece ends at its first clause of two words or more (first_clause_words);on_timingcounts from the end of the caller's speech and addsturn_endandreleased;--pause-ms,--end-silence-msand--first-clause-wordsin the example. On an Apple M2 the caller heard an answer begin 0.62 to 0.80 s after the question, against 1.08 to 1.61 s before, and pauses of 350 and 600 ms mid-sentence got no reply (integrations/agents/README.md). - Dependencies brought up to date.
rsa0.10.0-rc.19; the .NET tests onxunit2.9.3,xunit.runner.visualstudio4.0.0 andMicrosoft.NET.Test.Sdk18.10.1; Gradle 9.8.0 for the Kotlin Android build; the Linux build images onrust:1.99-trixie, the toolchain the workspace is pinned to. Every other crate, npm, Maven, Android and Dart dependency was already at its latest release. - Fixed-size blocks are read as arrays. The hashes (MD5, SHA-1, SHA-256, SHA-512), the codecs (G.722, G.729, L16), RTP's CSRC and RTCP's BYE lists and the packet checksum split their input with
as_chunks, so each block has its length in its type and the fallbacks that stood in for a short block are gone; the output is bit for bit what it was. - .NET: the stack's, an account's and a call's raw handles are public (
SipralStack.Handle,Account.Handle,Call.Handle), for an entry point ofsipral.hthe classes do not wrap yet, as the Kotlin, Python and Swift layers already allow. - Every binding's
unregistersays where an editor shows it what the state does. It reads unregistered as soon as the call returns, and the registrar's answer is the registration-changed event after it; an application that closes the stack on the state alone cannot answer a challenge to the un-REGISTER (docs/08-ffi.mdsaid so already). - The gate checks every dependency for known vulnerabilities, in every language.
scripts/check.shrunsosv-scannerover the Cargo, npm, NuGet, Maven and Python dependencies on each run,--hygiene-onlyincluded; the advisories that do not apply are set aside inosv-scanner.tomlwith their reasons, and listed inSECURITY.md. - The .NET assembly names no build path, and the repository asks for a bug report or feature request in a form.
Sipral.csprojmaps the project directory to/_/; GitHub issue forms for bugs and features, with questions sent to Discussions and vulnerabilities to private reporting.
Fixed
- The Node.js package has its packaging script, and carries the licence texts.
scripts/package/node.shcompiles the layer and packs a staged copy withLICENSE,LICENSE-COMMERCIAL.mdandTHIRD-PARTY-NOTICES.mdbeside it, asnpm.shdoes for React Native, and holds the tarball's listing to what it must and must not carry; the gate'snodearea runs it with--dry-run.npm packinbindings/nodeleft all three out. scripts/version.shwrites and checks the Node.js package and the voice-agent connectors' project. Both came after the list of places that carry the version and kept 1.1.0 when the release moved to 1.2.0;--checknow names them too.- The TLS examples build against
rustls0.23.46. RUSTSEC-2026-0348 and RUSTSEC-2026-0349 were published against 0.23.45;rustlsis reached only by theexample-tlsfeature, which nothing the release ships turns on. - A wake or a network change no longer leaves a subscription's dialog counting against
max_dialogs. Recovery starts each subscription again under a newCall-ID, but the dialog the old one's NOTIFY had opened stayed open, so every recovery held one more dialog per subscription. An application watching seven busy lamps reached the default 128 after a few dozen network changes, and from then on every call it placed failed withLimitReachedand every call it was offered was refused with 503. The old dialog is now closed when its subscription starts again. - The headless agent tries a network move again when it could not bind at the new address. The example noted the new route before rebinding there, so a failed bind left it at the old address for good; the route now stays at the old address and the next check, half a second later, tries the move again.
- The VoIP metrics block reports this end's end-system delay, and the call's own rating counts it. RFC 3611 §4.7.3's end system delay was always sent as 0; it is now the jitter buffer's nominal delay plus one packet time, and the one-way delay G.107's
Idis rated on is §4.7.3's "(RTD + ESD(A) + ESD(B)) / 2", with the far end's own end-system delay once its block arrives, rather than half the round trip and nothing else (docs/05-media.md). No C ABI change:voip_end_system_delay_uswas already there. - A G.711 call's own R factor and MOS count its loss concealment. The RTCP XR VoIP metrics block rated PCMU and PCMA with G.113's
Bplof 4.3 for G.711 without concealment, though the stack conceals every lost G.711 frame; ITU-T G.107 Table 3, Note 5, asks for theBplof the concealment in use, now 25.1 (CodecFamily::G711Concealed), so 3.7 % random loss rates R 81 rather than 50. Equation 7-29 is also now as G.107 writes it,Ppl / (Ppl / BurstR + Bpl): loss in bursts weighed less than the same loss at random, where G.107 weighs it more. - The callee of a call a PBX bridges itself hears the caller. A second RTP source sending from the latched address, three packets in a row in sequence with nothing from the first in between, is now the far end's stream: the stream starts again under it, through probation, instead of dropping all of it as a second source. Asterisk's native bridge sends a packet of its own and then the other end's stream under that end's SSRC; on a live VitalPBX the callee heard nothing on four calls of six before, and on every call after. A stray packet or two sources taking turns still never move the stream (
docs/05-media.md). - The lab's "without TURN" negative controls pass only for want of a path.
scripts/lab.shtook any failed call across the blocked NAT pair as the block holding; it now requires the callee's own verdict that it answered, its media started and no path was ever chosen, and says that theFAIL ... no path was ever chosenlines printed there are that expected verdict.scripts/interop-matrix.pyinverts only that failure. No stack change: no full-ICE call that has to find a path failed in any recorded run. - A wildcard bind no longer advertises
0.0.0.0.route_to(and soadvertised_address,sipral_advertised_address, and the addresses the layers built on it advertise for a wildcard bind) took the local address of a socket connected toward the peer, and on macOS under load roughly one connect in 1,500 reports the wildcard there: measured 28 in 44,700. That went intoContactandc=as is, and an ICE agent refused it as a host. Such an answer is now asked again on a fresh socket, and never advertised. The Rust examples and the .NET samples use the library's lookup instead of their own. - .NET: closing a call as its media starts no longer ends the process. The poll thread could look a call up for its
MediaStartedjust beforeCall.Close(orSipralStack.Dispose) closed its media socket, then build the call's media over the closed socket and throw inside the native callback; once in about 40 runs of the .NET tests on a loaded machine, the test host crashed. Starting the media and closing the call (orReaddressswapping its socket) now decide under one lock, and a lateMediaStartedstarts nothing. - An application that never asks for ended calls' RTCP goodbyes no longer keeps them all.
MediaEnginequeued every ended call's RTCP BYE untilpoll_farewell, with no limit, and the soak's own headless application never asked: about 400 bytes held per call, the slow growth the 24-hour endurance run showed. The queue now keeps the 256 newest, the application drains it, andsipral-ffi/tests/endurance_memory.rscounts the bytes and blocks held across thousands of calls and registrations (docs/19-numbers.md, "endurance"). No C ABI change; the C ABI already capped its own queue. - Every other queue an application may leave unread is bounded too.
MappingsandRelaysevents (256 each, for an application that askspublicorholdsinstead),Publicationevents (64, one per refresh), the relaysMediaEnginereturns from refused calls (256) and a stream tap nobody takes from (1,024 messages) dropped nothing before and now drop the oldest first. The endurance test also runs the soak's own voice agent pair, the headless socket application and its echo agent over thesipral-headlesswire: 209,375 bytes in 620 blocks held after 3,000 and 7,000 calls alike. No C ABI change. - The headless socket example sends RTCP.
headless-socket-agentsent no receiver or sender reports and dropped each call's RTCP BYE; it now holds the port after RTP for RTCP, gives it up when the call muxes RTCP, sends each report from the port the call's plan names and the BYE from the ended call's own socket, and printsrtcp_sentandround_trip_mswith each call's figures. - The lab's RFC 4733 digit runs through the proxy to FreeSWITCH. Its 9003 hung up straight after
send_dtmf, which only queues the digit, so the call ended before the digit was sent back; it now stays up on silence until the caller hangs up, as FusionPBX's does instead of a two-second sleep (docs/11-testing.md). - Kotlin and the JVM jar read a caller's identity while the stack is polled.
SipralClient.callerIdentityandansweringread each identity text straight from the stack, so a read that met the client's own poll thread failed withBUSYinstead of waiting it out as every other call does; they now retry the same way. - A digit is reported however its packets were played. RFC 4733 events were read only as the jitter buffer played them, so a key pressed while the buffer skipped a backlog, shortened a pause or found a packet behind its playout point was never reported -- after a receive loop that stalled for a few hundred milliseconds, a press the far end sent was gone for good. They are now read as they arrive, the in-band detector still telling a press heard both ways apart from two. No C ABI change.
- A voice agent hears the caller from the moment its session is connected.
sipral_agentsdropped the caller's queued audio when the task sending it to the service started, which on a loaded machine came well afterCONNECTED: what the caller said first after a connection or a reconnection never reached the service. The audio from before the connection is now dropped beforeCONNECTEDis reported, and nothing after it. - A far end that hands its media to another sender is heard. When a re-INVITE moved the far end's media address and a last packet from the old address was read after it -- Asterisk's
direct_media, handing a call's media from itself to the phone at the other end -- that packet's SSRC became the stream's, and every packet from the new sender was refused as a second source for the rest of the call: no audio either way between two phones Asterisk bridged directly. The stream now starts again under the new sender's SSRC when the latch closes on the new address (sipral-rtp). No C ABI change. - Python on Windows: a TCP or TLS stack whose connection is down keeps running. With no socket to watch -- the first connection refused, or one lost and not yet made again -- the poll thread called
select()on nothing, which Windows refuses with WinError 10022, and the thread ended: no transport-failed event, no reconnection, no REGISTER on the new connection. It now waits out the interval instead, and a SIP datagram the system refuses to send is lost as on the wire rather than ending the thread. The TURN tests' fake server now listens on the address the stacks are bound to, which Windows needs to deliver a datagram to it. - The comparison with PJSIP reads Asterisk's own jitter.
scripts/lab.sh comparetook the jitter under "Receive" inpjsip show channelstats, which is the client's RTCP report of Asterisk's audio relayed back; it now reads the "Transmit" one, Asterisk's own measurement. On the mobile profile Asterisk's jitter on the agent's audio, given as 35.0 ms against pjsua's 22.0 (27 to 40 against 14 to 23 over six runs), is 19 to 28 ms against 18 to 21 over three; on a clean link 0 ms for both, not the 5 and then 1 ms the 1.1.0 entry gave. The agent's own jitter stays higher than pjsua's because it counts every packet as RFC 3550 says, where pjsua leaves out those arriving behind a later one (docs/23-compared-with-pjsip.md). - The gate runs on Linux.
scripts/check.shlooked forlibsipral_ffi.dylibon every system, so on Linux the Python, Pipecat, .NET and Dart areas failed without running; it now looks forlibsipral_ffi.sothere. It sets a UTF-8 locale itself, since under the C locale the language scan read Romanian letters as bytes and flagged two dozen files that hold none. And the Opus fuzz seed is written out rather than encoded on each run: libopus's encoder writes a different packet on x86-64 than on arm64, both valid, so the corpus depended on the machine that checked it. - The bridged-conference test in every binding counts what was heard, not an unbroken run of it. It asked Carol to hear 57 of 60 frames in a row and failed under a loaded gate (47 of 60). Measured with counters on every leg under 48 busy loops of the test's own: no packet was late or dropped on any leg, Carol heard 98 to 100 of Bob's 100 frames in every run, and the gaps were her buffer running dry while all three stacks' threads were held up together and then playing the late frames. The test now asks for 95 of the 100, counting only frames that came through whole, not concealment; a call read by its own thread beside the conference still fails it.
- The Swift binding builds with Swift 6.4 (Xcode 27).
SipralStack.setLoghanded the log callback to C through a conditional, which Swift 6.4 no longer turns into a C function pointer; it now makes one call with the callback and one without. - The release library links again under Xcode 27. Rust 1.95 stripped it with an objcopy whose output the Xcode 27 linker refuses ("mis-aligned LINKEDIT string pool"), so nothing on macOS could link
libsipral_ffi.dylib. The pinned toolchain moves to Rust 1.99.0, which writes a dylib the new linker takes; the minimum supported Rust stays 1.95. - .NET:
Account.Removewaits out a busy stack. It released the account once and ignored the answer, so a stack busy on another thread kept the account while the layer forgot it; it now retriesSIPRAL_STATUS_BUSYas every other call in the layer does, raises a refusal, and forgets the account only once the library has let it go. - Every REGISTER after a challenge carries a higher
CSeq. The REGISTER that answered a registrar's 401 took the next number on the wire, and the account did not count it: its refresh and its un-REGISTER went out again with that number, which RFC 3261 §10.2 forbids. Asterisk let it pass; a stricter registrar refuses it, and an un-REGISTER refused that way leaves the binding on the PBX until it expires. - Presence from Asterisk is read again. Asterisk puts an empty
<dm:person />, with noid, in every presence document it sends, and the stack refused the whole document over it: the NOTIFY was answered 200 and noPRESENCE_CHANGEDfollowed, so every busy lamp watching an extension on Asterisk or FreePBX stayed blank. A person with noidis now left out and the tuples, theirbasicstatus and the notes are read as before.
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.