This release is a pre-release and may not be stable for production use.
baresip-python
Python bindings for the baresip SIP stack — a complete, embeddable SIP user agent for Python applications: registration, inbound and outbound calls, programmatic PCM audio access, and DTMF, with an asyncio-native API.
Status: pre-alpha, under active development. Nothing here is ready for use yet. The first usable release will be
v0.1.0a1on TestPyPI.
What this is
pip install baresip-python,import baresip— no compiler, no system SIP stack needed (wheels statically bundle libre and libbaresip).- A generic binding: nothing framework-specific inside. Audio can go to/from WAV files
(baresip's built-in drivers) or to/from your application as raw PCM (the
aumemdriver) — which is how frameworks like pipecat consume it. - BSD-2-Clause, on top of baresip/libre (BSD-3). No GPL code is ever published in our binaries.
Quick start
Until the first release lands on PyPI, install from a source checkout. You need
uv, a C compiler, cmake, and the OpenSSL and opus development
headers (apt install cmake libssl-dev libopus-dev on Debian/Ubuntu,
brew install cmake openssl@3 opus on macOS):
git clone --recurse-submodules https://github.com/daily-co/baresip-python.git
cd baresip-python
uv sync --group dev
make native ext
Everything below runs against the bundled FreeSWITCH bench — a docker compose setup with
test users (1001/1002, password bench1234) and an echo service at extension 9196
(see bench/README.md):
make bench-up
The examples are the tutorial, written to be read in order. Each is self-contained,
heavily commented, and configured entirely through SIP_USER/SIP_PASS/SIP_DOMAIN
environment variables whose defaults match the bench.
01 — register. The core lifecycle: one Runtime per process
(it owns the SIP thread), a UserAgent bound to an Account, register(), a clean
shutdown. Re-registration is automatic while it runs.
uv run python examples/01_register.py
02 — dial. An outbound call to the echo service and a call that
fails: dial(), wait_established(), custom INVITE headers, and telephony outcomes as
typed exceptions (CallBusy, CallDeclined, ...) instead of error codes.
uv run python examples/02_dial.py
03 — programmatic audio. The aumem driver, the shape a
voice agent needs: call.audio.read() returns the far end's PCM, call.audio.write()
queues yours — plain bytes, no sound card, no files.
uv run python examples/03_echo_aumem.py
04 — answer + WAV bot. A bot with zero custom audio code: answer an incoming call, play a greeting from a WAV file, record the caller — audio drivers as pure configuration. Have the bench call the bot from a second terminal:
uv run python examples/04_answer_wav_bot.py
docker exec baresip-bench-freeswitch fs_cli -x "originate user/1001 &echo()"
05 — DTMF IVR. DTMF in both directions: run one instance as a mini-IVR (press 1 for a tone, 2 to hang up), a second as the caller that presses the keys.
uv run python examples/05_dtmf_ivr.py
SIP_USER=1002 SIP_PASS=bench1234 uv run python examples/05_dtmf_ivr.py sip:1001@127.0.0.1:15060
Audio and device selection
Audio drivers are chosen when the runtime starts — Config(audio_source=..., audio_player=...), one driver per direction — and stay put for the runtime's lifetime;
there is no mid-call driver switching. This is deliberate for v0.1: audio a program decides
on at runtime is what the aumem driver is for (it is just bytes your code reads and
writes), and richer switching APIs are planned for a later release. What a "device" means
belongs to each driver: a WAV path for aufile, a tone frequency for ausine, nothing at
all for aumem.
Custom headers
Outbound INVITEs take custom headers directly: ua.dial(uri, headers={...}) (example 02).
On the receiving side, Config(expose_headers=[...]) allowlists header names whose values
then ride along on call events.
One deliberate absence: the 100 Trying that answers an incoming INVITE cannot carry
custom headers. The stack sends it automatically, before the application ever sees the
call — and it is a hop-by-hop response, so a header on it would die at the first proxy
anyway. Headers on the final response (answer/reject) are planned for a later release.
Logging
The library logs into the standard baresip.* logger hierarchy and never touches handlers
or output itself. Records carry correlation fields in extra — most importantly
sip_call_id, the spine that ties Python-side events, native-stack lines, and SIP traces
to one call. The native stack's own logs surface under baresip.native, and a full SIP
message trace is available under baresip.native.sip. Per-call DEBUG on a busy server is a
filter problem, not a level problem — see PerCallFilter in
docs/LOGGING.md, along with the loguru bridge for applications (pipecat
among them) that log through loguru.
Platform support
Linux (x86_64, aarch64) and macOS (Apple Silicon and Intel), CPython 3.11–3.13. On Windows, WSL2 is the supported path for now — the Linux build runs there as-is; native Windows support is a design goal the code keeps its door open for, but it is not built or tested today.
Call transfer (hold/resume, blind and attended REFER) is not in v0.1; it is the headline of the next release.
Building with GPL codecs (H.264)
The published wheels never contain GPL code. H.264 via ffmpeg's avcodec is available as a
source-build opt-in — your machine, your build, your license terms — documented in
docs/GPL-CODECS.md, including the x264 encode-vs-decode nuance that
decides whether GPL applies at all. Support level, honestly: the avcodec build is
compile-verified weekly in CI (built and unit-tested, never distributed); its runtime
behavior is community-supported.
Security
See SECURITY.md — how to report a vulnerability, which versions receive fixes, and a short threat-model note for operators: a registered user agent is a server as well as a client, and a publicly addressable one will receive unsolicited INVITEs and scanner traffic.
API stability policy
The public API is exactly what baresip.__all__ exports and these docs describe; everything
else is internal. Versioning is SemVer with the 0.x caveat: minor bumps before 1.0 may break,
and every break is called out in the CHANGELOG. Deprecated names keep working for one minor
version with a DeprecationWarning before removal. The package is fully typed (py.typed).
License
BSD 2-Clause. Copyright (c) 2026, Daily. Bundled third-party components (libre, libbaresip) are BSD-3-Clause; their notices ship with every distribution. Built wheels additionally bundle OpenSSL and libopus under their respective licenses — see docs/UPGRADING.md for how security releases in those propagate here.
Release files for baresip-python 0.1.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
Total release size: 37.1 MB
Release files / baresip_python-0.1.0a1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | baresip_python-0.1.0a1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
9da430dfbfdb6e694a03c720143de791318295fe6b1ecf0beaf4bbf1cf74dd05
|
|
BLAKE2b-256 checksum How to use checksums |
dd73cb7424e1e0723217c6c233ce4e467a4c5ac041169c8b8aa2daeaad54145c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / baresip_python-0.1.0a1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | baresip_python-0.1.0a1-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
1bf369f4fb531ee63a606178741374f782dcde9a3cb0486deea346d15c5aeb8f
|
|
BLAKE2b-256 checksum How to use checksums |
359caace11907f43ba460016e7821d2287644a6f446c14749607cc03e965cc01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / baresip_python-0.1.0a1-cp313-cp313-macosx_15_0_x86_64.whl
| Download URL | baresip_python-0.1.0a1-cp313-cp313-macosx_15_0_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.13 macOS 15.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
8802dda269d4d1a7026d36473ad17ed254d79a5ac942838ccdacdfe045729ba9
|
|
BLAKE2b-256 checksum How to use checksums |
7477cf1c49f0c6262611403c7ccd1f3b6844bf2fb87767884b96f0ec418f6015
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / baresip_python-0.1.0a1-cp313-cp313-macosx_15_0_arm64.whl
| Download URL | baresip_python-0.1.0a1-cp313-cp313-macosx_15_0_arm64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | CPython 3.13 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
38fa6971966f5b9bd5b1ed49b2a50e8303b3adce88b6487bf84c288975b659ca
|
|
BLAKE2b-256 checksum How to use checksums |
8fd985cb7ff1fd7149285cb049317279eb3e599c2ae3739a53538ee1b0222060
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / baresip_python-0.1.0a1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | baresip_python-0.1.0a1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ee61e086a7a6cb547fff0f6477662145bf557cd3d8314c1882f72e5775e2f21c
|
|
BLAKE2b-256 checksum How to use checksums |
d815915c73fd89115eed72f437dde608c1195b5760282590c12ee0ba5da57610
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / baresip_python-0.1.0a1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | baresip_python-0.1.0a1-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
f9ed278e2d8f72c74b54519468eb8aefc4b48b23e71ee9b7ecbd82822cd9b6af
|
|
BLAKE2b-256 checksum How to use checksums |
39867f7693373c8502ac050265fb12d8509e70df699f53564fb74bbaf310e865
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / baresip_python-0.1.0a1-cp312-cp312-macosx_15_0_x86_64.whl
| Download URL | baresip_python-0.1.0a1-cp312-cp312-macosx_15_0_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.12 macOS 15.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
4d70f55318a934daf9e75233c45b2a76eadb5c7a97602c954a7f522edcb8ee21
|
|
BLAKE2b-256 checksum How to use checksums |
6a867c69a7bc28309d175a1b7b98d57544f0d784f7bc3f223dd0e42fb18c4e04
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / baresip_python-0.1.0a1-cp312-cp312-macosx_15_0_arm64.whl
| Download URL | baresip_python-0.1.0a1-cp312-cp312-macosx_15_0_arm64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | CPython 3.12 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
537511ad78bfc58ca7cacafbb8067717230fd2b28a03cbcee5fbddaf35193b6b
|
|
BLAKE2b-256 checksum How to use checksums |
350ff5dd3c1e2b7542d7224dfdf26fd801a6c1bf883d2917d8cd2f9c8c2473a7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / baresip_python-0.1.0a1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
| Download URL | baresip_python-0.1.0a1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
edd62aa6feffb7a24870d6de87006e42c92fbf5d323dd6c2f71c79c1b7979f8a
|
|
BLAKE2b-256 checksum How to use checksums |
c4975860dd233f7651276e660b583013099e4105a738773c1a05af2f0ba21663
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / baresip_python-0.1.0a1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
| Download URL | baresip_python-0.1.0a1-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl |
|---|---|
| Size | 2.9 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 |
|
SHA-256 checksum How to use checksums |
a9e40c1123a9e8c667085f45e8bcb1beb62d68507d987b9f75740617eb5dcca5
|
|
BLAKE2b-256 checksum How to use checksums |
47f3c2c36b30754e1a9e5bc6ec62ecba9991f3d4db0216c0fa441037f464807d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / baresip_python-0.1.0a1-cp311-cp311-macosx_15_0_x86_64.whl
| Download URL | baresip_python-0.1.0a1-cp311-cp311-macosx_15_0_x86_64.whl |
|---|---|
| Size | 3.1 MB |
| Tags | CPython 3.11 macOS 15.0+ x86-64 |
|
SHA-256 checksum How to use checksums |
526bfa59245208bf4ee0afcc7e9cbd7ec337ca272bfde3717208217044f97486
|
|
BLAKE2b-256 checksum How to use checksums |
19443bbdcea8fa2daf18225be0b6e6a9a5a0117b576ecda26d5706d078c15bfe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency logRelease files / baresip_python-0.1.0a1-cp311-cp311-macosx_15_0_arm64.whl
| Download URL | baresip_python-0.1.0a1-cp311-cp311-macosx_15_0_arm64.whl |
|---|---|
| Size | 3.3 MB |
| Tags | CPython 3.11 macOS 15.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2350128547fe3b5ab68d80045a81091898bcb17be2dd27e3d0200b92b89a275b
|
|
BLAKE2b-256 checksum How to use checksums |
7968f95c64a7b991aa3a7a72c14cc7bae2c42906517c85e53942db2843edf071
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 24, 2026.
Transparency log