Skip to content

0.9.0 — PJSIP from fork e675aef5e (VPX loss recovery in-tree)

Latest

Choose a tag to compare

@laconicman laconicman released this 20 Nov 09:51
70cdb53

PJSIP.xcframework — build release notes

Generated by scripts/build.sh notes on 2026-11-20 09:50 UTC.

Sources

Component Requested Resolved ref Commit Origin
PJSIP commit=e675aef5ee4f7bef347e8d646126c0b2cf5839cb e675aef5ee4f7bef347e8d646126c0b2cf5839cb e675aef5ee4f7bef347e8d646126c0b2cf5839cb https://github.com/laconicman/pjproject/archive/e675aef5ee4f7bef347e8d646126c0b2cf5839cb.zip
bcg729 tag=1.1.2 1.1.2 fb195811fe630415c9bf433c0c0bebde14314ff2 https://github.com/BelledonneCommunications/bcg729.git
opus tag=v1.6.1 v1.6.1 22244de5a79bd1d6d623c32e72bf1954b56235be https://github.com/xiph/opus.git
libvpx tag=v1.17.0 v1.17.0 6df3ec34557879fff673706f4a1d9fbd0f3a6f0e https://github.com/webmproject/libvpx.git

Build parameters

  • Slices: ios-arm64 (device), ios-arm64-simulator
  • Minimum iOS: 15.0
  • configure flags: --disable-gsm-codec --disable-speex-codec --disable-speex-aec --enable-darwin-ssl --enable-video --with-bcg729=<bcg729 install> --with-opus=<opus install> --with-vpx=<libvpx install>
  • Extra configure flags: none
  • LDFLAGS: -framework Network -framework Security -framework MetalKit
  • CFLAGS (pjproject only): -O2 -Wno-unused-label -g

Local patches applied to the PJSIP source

None — built from unmodified upstream source.

config_site.h

The exact compile-time configuration (fixes the ABI — do not override downstream):

/*
 * config_site-ios.h — compile-time configuration for the iOS device and
 * simulator slices of PJSIP.xcframework.
 *
 * THIS FILE IS THE ABI. It is compiled into libpjproject.a and fixes struct
 * layouts, buffer sizes and which subsystems exist at all. A consumer cannot
 * override it: the binary is already built. Changing anything here means a
 * rebuild and a new package version (docs/Versioning.md).
 *
 * The macOS slice gets its own file (config_site-macos.h) rather than
 * TARGET_OS_* branches in this one — see TASK-code-swift-pjsip-macos-slice.md
 * §2 and docs/ARCHITECTURE.md decision 11. A shared file would hide which
 * preset a given binary actually got.
 *
 * HOUSE RULE: every #define below states WHY, and what it costs. A bare
 * "Disable switching to TCP" as the whole comment is what let PJSIP_DONT_SWITCH_TO_TCP sit
 * here for a year silently breaking every authenticated call over UDP.
 * A comment that names the tradeoff would have caught it.
 *
 * Line references are pjproject @ e675aef5e (laconicman/pjproject —
 * upstream master 48290cd9b plus pjsip/pjproject#5419; 2026-11-20). Each one
 * carries the `token` that must sit at that line; scripts/check-cites.sh
 * verifies them against the tree build.sh is about to compile, so the line
 * above is checked on every download rather than claimed by the last edit.
 */

/* ---------------------------------------------------------------------------
 * Upstream iOS preset
 *
 * Brings in PJMEDIA_AUDIO_DEV_HAS_COREAUDIO, iLBC, the float/CPU settings and
 * a set of deliberately small table sizes. Anything this preset decides that
 * we disagree with is #undef'd and redefined BELOW the include — the sample
 * uses bare #define, not #ifndef, so defining before it has no effect.
 *
 * Note what the preset also means: upstream ships Apple-platform features via
 * PJ_CONFIG_IPHONE, so they reach iOS only. The macOS header must set them by
 * hand (ARCHITECTURE.md decision 11).
 * ------------------------------------------------------------------------- */
#define PJ_CONFIG_IPHONE 1
#include <pj/config_site_sample.h>

/* ---------------------------------------------------------------------------
 * Capacity — the 2012-iPhone preset's cuts, undone
 *
 * All three are #undef'd first because config_site_sample.h has already
 * defined them; the sample uses bare #define, so defining before it has no
 * effect.
 *
 * Note the shape of the first and third: an #undef with NO redefinition. That
 * hands the macro back to pjsua.h's own #ifndef default, so if upstream ever
 * raises one of these we inherit the new value. Restating today's default as a
 * literal would look identical in this build and silently cap a future one —
 * and it would be an override we cannot justify, since the only thing wrong
 * with those two was the preset lowering them. Only override a default that is
 * actually insufficient; PJSUA_MAX_CALLS and PJSIP_MAX_PKT_LEN are the two that
 * clear that bar, and both say so where they are set.
 * ------------------------------------------------------------------------- */

/* Accounts: whatever upstream defaults to — 8 as of 2.17/master,
 * pjsua-lib/pjsua.h:4132 `define PJSUA_MAX_ACC`; the preset cuts it to 4.
 *
 * WHY: 4 is the whole account table, so the live SIP test suite could not add
 * a second provider pair without retiring an existing one. Upstream's own
 * default is already enough — the preset is the only thing in the way.
 *
 * COST: pjsua_var.acc[] is a FIXED array inside the pjsua_data singleton
 * (pjsua_internal.h:682 `acc[PJSUA_MAX_ACC]`) and init_data() walks all of
 * it at startup, so four extra pjsua_acc entries are paid unconditionally,
 * even with one account configured. Measured against this build:
 * sizeof(pjsua_acc) = 7168 B, so +4 accounts = +28 KB, and sizeof(pjsua_data)
 * is 106680 B in total.
 */
#undef  PJSUA_MAX_ACC

/* 8 simultaneous calls (the preset AND upstream both say 4 —
 * pjsua-lib/pjsua.h:6154 `define PJSUA_MAX_CALLS` — so this is a departure
 * from upstream, not a restoration, and the only literal in this section).
 *
 * WHY: 4 is genuinely insufficient, which is what earns the override — the
 * live suite's test05 saturates the limit at exactly 4 by design and has no
 * headroom to test anything past it, and 4 is low for a conference-capable
 * softphone. It does pin: were upstream to raise its own default past 8, this
 * line would hold us at 8 until someone edits it.
 *
 * COST: unlike PJSUA_MAX_ACC this is only a ceiling — pjsua_var.calls is
 * pool-allocated at pjsua_init() to ua_cfg.max_calls
 * (pjsua_call.c:264-266 `sizeof(pjsua_call) *`), which pjsua_config_default()
 * sets to this macro (pjsua_core.c:115 `cfg->max_calls = PJSUA_MAX_CALLS`).
 * Measured sizeof(pjsua_call) = 22328 B, so leaving the default costs
 * +87 KB. An app that wants the old footprint can lower max_calls at runtime;
 * it cannot raise it past this.
 */
#undef  PJSUA_MAX_CALLS
#define PJSUA_MAX_CALLS 8

/* Conference slots: whatever upstream defaults to — 254 as of 2.17/master,
 * pjsua-lib/pjsua.h:8379 `define PJSUA_MAX_CONF_PORTS`.
 *
 * WHY: this — not PJSUA_MAX_CALLS — is the real ceiling on a locally mixed
 * conference. The preset replaces it with (PJSUA_MAX_CALLS + 2*PJSUA_MAX_PLAYERS),
 * i.e. 16 with the calls value above, while every call, player and recorder
 * occupies a slot. Handing it back to upstream beats inventing a number.
 *
 * Note the macro is only the DEFAULT for pjsua_media_config.max_media_ports
 * (pjsua_core.c:450 `cfg->max_media_ports = PJSUA_MAX_CONF_PORTS`), and that
 * runtime field is what actually sizes the bridge
 * (pjsua_aud.c:349 `param.max_slots`). The two must nevertheless agree,
 * because pjsua_conf_get_active_ports() enumerates into a fixed array
 * (pjsua_aud.c:944 `ports[PJSUA_MAX_CONF_PORTS]`) — safe, since the array
 * size bounds the enumeration, but it silently UNDER-REPORTS once the live
 * bridge is larger than the compile-time value.
 *
 * COST: 8 bytes per unused slot in conf->ports
 * (conference.c:848-850 `conf->ports =`), plus max_ports*8 bytes per LIVE
 * port for its listener_slots/listener_adj_level arrays
 * (conference.c:501-509 `conf_port->listener_adj_level =`) — ~2 KB per live
 * port at 254. The mixing loop walks the port array but exits once every
 * live port has been seen (conference.c:3312 `ci < conf->port_cnt`), so an
 * idle slot costs a NULL check per tick, not a mix. (conference.c, not
 * conf_thread.c: see the PJMEDIA_CONF_BACKEND note below.)
 */
#undef  PJSUA_MAX_CONF_PORTS

/* PJSIP_MAX_TSX_COUNT / PJSIP_MAX_DIALOG_COUNT stay at the preset's 31.
 * They look like caps but are pj_hash_create() bucket counts
 * (hash.c:254-282 `pj_hash_create`,
 * sip_transaction.c:534 `pjsip_cfg()->tsx.max_count`): entries chain,
 * nothing is ever rejected, and the
 * only consequence at 8 calls + 8 registering accounts is slightly longer
 * collision chains. PJSIP_MAX_TIMER_COUNT derives from them for its INITIAL
 * timer-heap size and resizes itself. Left alone deliberately. */

/* ---------------------------------------------------------------------------
 * Media
 * ------------------------------------------------------------------------- */

/* Video on. Upstream default is 0. Costs binary size and pulls in the
 * VideoToolbox / AVFoundation / MetalKit link dependencies the README lists.
 * Required by the softphone's video calling. */
#define PJMEDIA_HAS_VIDEO                 1

/* iOS capture/render backend (darwin_dev.m / ios_dev.m). Upstream enables it
 * under PJ_CONFIG_IPHONE only; set explicitly so the file states which backend
 * this slice has. The macOS slice needs PJMEDIA_VIDEO_DEV_HAS_AV_DEV instead —
 * a different backend, not a rename. */
#define PJMEDIA_VIDEO_DEV_HAS_IOS         1

/* Hardware H.264 via VideoToolbox. Upstream default 0. Software H.264
 * (openh264) is not built, so without this there is no H.264 at all.
 * Requires the app to link VideoToolbox.framework. */
#define PJMEDIA_HAS_VID_TOOLBOX_CODEC     1

/* G.729 via bcg729 (LGPL, statically folded into libpjproject.a — see
 * docs/ARCHITECTURE.md "what is inside the archive"). The Intel IPP codec is
 * explicitly off: it needs a commercial IPP that we do not ship, and leaving
 * both on makes which implementation answers ambiguous. */
#define PJMEDIA_HAS_INTEL_IPP_CODEC_G729  0
#define PJMEDIA_HAS_BCG729                1

/* Opus via libopus (BSD-3-Clause + the Opus patent licence; statically folded
 * into libpjproject.a like bcg729 — see docs/ARCHITECTURE.md "what is inside
 * the archive"). Upstream's configure AC_DEFINE lands in
 * pjmedia-codec/config_auto.h, whose template guards it with
 * #ifndef PJMEDIA_HAS_OPUS_CODEC — so this line wins silently (same value, no
 * redefinition warning). It exists because the house rule is that every
 * feature macro is stated explicitly per slice; what actually proves libopus
 * was found and linked is the configure-log assertion in build.sh and the
 * verifier's symbol checks, not this macro.
 *
 * COST: libopus.a is 619 KB (device) / 654 KB (simulator), adding 138 members
 * to libpjproject.a — 586 total vs 448 on 0.3.1 (+1.5 MB merged; the delta is
 * libopus plus the 36 upstream commits' code changes, not libopus alone).
 * Runtime shape (clock rate, bitrate, complexity, VBR)
 * is NOT pinned here — PJMEDIA_CODEC_OPUS_DEFAULT_* stay at upstream defaults
 * (48000 / 0 = auto / 5 / VBR) and are settable via
 * pjmedia_codec_opus_set_config(). */
#define PJMEDIA_HAS_OPUS_CODEC            1

/* VP8 + VP9 via libvpx (BSD-3-Clause + the libvpx PATENTS grant; statically
 * folded into libpjproject.a like bcg729 and opus — see docs/ARCHITECTURE.md
 * "what is inside the archive"). Unlike Opus, upstream does not AC_DEFINE
 * PJMEDIA_HAS_VPX_CODEC into config_auto.h — it injects -DPJMEDIA_HAS_VPX_CODEC=1
 * on the compile line via VPX_CFLAGS (build.mak.in:198 `VPX_CFLAGS`) when the
 * --with-vpx link test passes, so the macro comes from two places at once, at
 * the same value. What proves libvpx was actually found and linked is the
 * 'checking VPX usability... yes' assertion in build.sh and the verifier's
 * symbol checks, not this macro.
 *
 * Registration is automatic once the macro is on:
 * pjsua_vid.c:117-118 `pjmedia_codec_vpx_vid_init`. VP8 defaults on upstream
 * (pjmedia-codec/config.h:716-717 `PJMEDIA_HAS_VPX_CODEC_VP8`), VP9 defaults
 * OFF (pjmedia-codec/config.h:725-726 `PJMEDIA_HAS_VPX_CODEC_VP9`) — set to 1
 * here so the SDP set covers the whole royalty-free pair a WebRTC peer is
 * likely to offer. pjsua_vid_enum_codecs() ids them as encoding_name/PT
 * (VP8/102, VP9/105 measured); the SDP form is VP8/90000, VP9/90000.
 *
 * COST, measured on this build: libvpx.a is 2289040 B (device) /
 * 2296032 B (simulator), 232 members, ~1.6 MB of __TEXT — the largest folded
 * library, ~3.7x libopus. VP9 is most of that: a --disable-vp9 build is
 * 942984 B / 119 members, so VP9 alone costs +1.35 MB. The macOS slice
 * (config_site-macos.h, not yet shipped) can take these same three lines —
 * libvpx has native arm64-darwinNN-gcc targets, no -target override needed. */
#define PJMEDIA_HAS_VPX_CODEC             1
#define PJMEDIA_HAS_VPX_CODEC_VP8         1
#define PJMEDIA_HAS_VPX_CODEC_VP9         1

/* RFC 4733 telephone-event payload type pinned to 101 (upstream default is
 * 96). WHY: legacy infrastructure on the provider side does not renegotiate
 * and expects 101; with the default, DTMF is signalled on a PT the far end
 * ignores. This is a wire-visible choice, not a preference. */
#define PJMEDIA_RTP_PT_TELEPHONE_EVENTS   101

/* Voice-activity-driven ducking of other audio while VoiceProcessingIO is
 * running, instead of a fixed duck for the whole call. Upstream default is 0
 * (pjmedia-audiodev/config.h:153 `COREAUDIO_ADVANCED_DUCKING 0`) and
 * config_site_sample.h already turns it on
 * for iOS; set explicitly because the macOS slice must NOT inherit it — the
 * maintainer deliberately left macOS on the old behaviour when merging our
 * pjproject#5178. Requires iOS 17 / macOS 14; a no-op below that.
 *
 * NOT YET LISTENED TO. The upstream PR notes record that no listening test was
 * ever done. See swift-pjsua/Upstream/pjproject-5178-*.md. */
#define PJMEDIA_AUDIO_DEV_COREAUDIO_ADVANCED_DUCKING 1

/* ---------------------------------------------------------------------------
 * Transports
 * ------------------------------------------------------------------------- */

/* All three transports compiled in. UDP and TCP are upstream defaults already;
 * stated here because a SIP stack that silently lost one of them is a very
 * confusing thing to debug, and because the macOS header must match. */
#define PJSIP_HAS_UDP_TRANSPORT 1
#define PJSIP_HAS_TCP_TRANSPORT 1

/* TLS via Apple's Network.framework (PJ_SSL_SOCK_IMP_APPLE), NOT OpenSSL and
 * NOT the deprecated SecureTransport backend. WHY: no OpenSSL to vendor,
 * update or license, and the App Store treats the system TLS stack as the
 * expected one. The #undef is required — pj/config.h has already defaulted
 * PJ_SSL_SOCK_IMP by the time this file is read. */
#define PJSIP_HAS_TLS_TRANSPORT 1
#define PJ_HAS_SSL_SOCK 1
#undef  PJ_SSL_SOCK_IMP
#define PJ_SSL_SOCK_IMP PJ_SSL_SOCK_IMP_APPLE

/* 16000-byte SIP message buffer (upstream default ~4000).
 * WHY: real-world INVITEs with a full video SDP, ICE candidates, long Route
 * sets and Authorization headers exceed 4 KB, and PJSIP_MAX_PKT_LEN is a hard
 * truncation point, not a soft one.
 * It bounds received messages too: rdata's packet buffer is
 * char[PJSIP_MAX_PKT_LEN] (sip_transport.h:360 `packet[PJSIP_MAX_PKT_LEN]`),
 * and a TCP message that fills it is dropped, the rest of the stream with it
 * (sip_transport.c:2293-2301 `dd_status = PJSIP_ERXOVERFLOW`). A REGISTER 200
 * lists every binding of the AOR,
 * and with long +sip.instance values that grows fast: in a lab run, a 200
 * that still listed the bindings of a length test (instance values of up to
 * 2048 characters, ~4.3 KB together) came to ~4.7 KB and was lost at
 * upstream's 4000, so the registration timed out with 408. 16000 covers
 * that with room to spare; realistic UUID instance values (~47 bytes) do not
 * come close.
 * COST: this is a per-transport receive-buffer size — it is ABI, and it is
 * why a consumer must never override this header. */
#define PJSIP_MAX_PKT_LEN 16000

/* PJSIP_DONT_SWITCH_TO_TCP is deliberately NOT defined (upstream default 0).
 *
 * It used to be 1 here, commented only "Disable switching to TCP".
 * That single line disabled RFC 3261 §18.1.1 outright: the guard at
 * sip_util.c:1430 `disable_tcp_switch==0` covers the ENTIRE block — size
 * check and TCP-transport lookup alike. The consequence was that no
 * authenticated call
 * could be placed over a UDP transport at all: adding the digest pushes the
 * INVITE past the 1300-byte threshold, it went out on UDP anyway, fragmented,
 * and was dropped. Measured at two independent providers (Flexisip
 * 1322→1634 B, antisip 1289→1578 B). See offhook/docs/SIP-Test-Infrastructure.md
 * §6. Do not re-add it; if a specific peer ever needs it, it is runtime
 * settable via pjsip_cfg()->endpt.disable_tcp_switch. */

/* PJSIP_TCP_KEEP_ALIVE_INTERVAL is deliberately left at its default. It is
 * runtime-settable (pjsip_cfg()->tcp.keep_alive_interval) and is the mechanism
 * behind the 126 s transport-death detection measured in
 * swift-pjsua/docs/Call-Termination-Paths.md §4.1 — changing it at build time
 * silently moves a number other documents quote. */

/* PJMEDIA_CONF_BACKEND stays at upstream's default: the parallel
 * conf_thread.c bridge that pjproject#5297 made the default wherever
 * PJ_HAS_THREADS (pjmedia/config.h `ifndef PJMEDIA_CONF_BACKEND`).
 *
 * 0.7.0 pinned the serial bridge (conference.c) because the parallel
 * bridge's mix_and_transmit() asserted a fresh timestamp per tick — an
 * invariant reachable from legal pjsua use when a sound-device reopen
 * restarts the clock at 0 (docs/Tech-Debt.md TD-1 has the full analysis).
 * Upstream fixed the assert in pjproject#5377 (ddf55c302), vendored
 * since 48290cd9, so the pin is dropped: op-queue and BYE ordering
 * return to the parallel semantics the artifact ran 0.3.0–0.6.0. */

/* Assert policy moved from abort() to the log. Upstream defaults PJ_DEBUG to
 * !NDEBUG (pj/config.h:379-385 `ifndef PJ_DEBUG`) and this build defines no
 * NDEBUG, so pj_assert has been assert() — abort() — in every artifact
 * shipped through 0.6.0. With PJ_DEBUG 0, pj_assert(expr) instead emits a
 * level-1 PJ_LOG(1, (__FILE__, "Assert failed: %s", #expr)) synchronously
 * from the asserting frame, but only on PJLIB-registered threads
 * (pj/assert.h:48-60 `Assert failed:`); PJ_ASSERT_RETURN then returns its
 * error code to the caller (pj/assert.h:96-100 `define PJ_ASSERT_RETURN`)
 * and PJ_ASSERT_ON_FAIL still runs its recovery path
 * (pj/assert.h:110-114 `define PJ_ASSERT_ON_FAIL`). The abort-or-continue
 * decision thereby moves to the application's log callback, which can still
 * abort() on a line starting "Assert failed:" where crash telemetry is
 * wanted — with the asserting function still on the stack.
 *
 * WHY: the conf_thread.c assert above aborted a consumer build on a legal
 * pjsua sequence, and an assertion that kills the process cannot be
 * survived, reported, or triaged by the application.
 *
 * COST: pj_mutex_t loses its owner/nesting bookkeeping
 * (os_core_unix.c:144-148 `#if PJ_DEBUG`), so mutex-misuse diagnostics go
 * quiet; pj_assert is silent on threads that never registered with PJLIB;
 * and internal invariant violations now CONTINUE past the assert — a
 * consumer MUST watch for level-1 log lines starting "Assert failed:", or
 * the same violations become invisible.
 */
#define PJ_DEBUG 0

/* ---------------------------------------------------------------------------
 * Deliberately NOT enabled — reasoning in docs/Build-Time-Feature-Gates.md
 *
 *   PJMEDIA_HAS_RTCP_XR / PJMEDIA_STREAM_ENABLE_XR — RFC 3611 extended
 *     reports. Decided 2026-08-17: off. Adds `a=rtcp-xr` to every SDP (a
 *     signalling change every registrar and SBC sees) in exchange for a debug
 *     statistic that pjmedia_jb_state.avg_burst already approximates.
 *   PJMEDIA_STREAM_ENABLE_KA — RTP keep-alive. Transmitter only; it does NOT
 *     buy media-liveness detection. Undecided; enable if NAT bindings are
 *     observed expiring mid-call.
 * ------------------------------------------------------------------------- */

Toolchain & environment

Item Value
Build date (device build) 2026-11-20T09:47:15Z
macOS 27.2 (arm64)
Xcode Xcode 27.2 Build version 27B52
Developer dir /Applications/Xcode.app/Contents/Developer
iPhoneOS SDK 27.2
iPhoneSimulator SDK 27.2
clang Apple clang version 21.0.0 (clang-2100.4.1.1)
CMake (bcg729, opus) cmake version 4.1.1

Artifacts

File Size SHA-256
ios-arm64/libpjproject.a 27344872 bytes 5e519ebe8210d03372c6bdd2954ad8ed46075f2ea7959e041b34f4815f5dc0c1
ios-arm64-simulator/libpjproject.a 27486024 bytes 6114b45ecbb3641e4b491ad0a811a7da9a0288d480776151e36c945a974170d3

Verification

Build-parameter adoption checks (scripts/verify-xcframework.sh): PASSED

The checks confirm, against the binary itself: arm64 slices, device/simulator
platform tags, minimum iOS version, native Darwin SSL (Network/Security symbol
references, no OpenSSL), TLS transport, video + VideoToolbox codec, bcg729
G.729, Opus, libvpx VP8+VP9, libyuv, SRTP, the parallel conference
bridge (upstream default again — the 0.7.0 serial pin was dropped),
PJ_DEBUG 0 assert logging and DWARF debug info in the objects (all three
since 0.7.0), and that disabled codecs (GSM/Speex, G.722.1, L16) are absent.