Skip to main content

simple-phone

Português

A SIP phone for testing calls, as a command and as a Python library. PJSIP 2.17 ships compiled inside the wheel, so there is nothing to build.

Install

Linux x86_64 and Windows x64, Python 3.11 to 3.15. macOS is not supported yet. The only system library it needs is ALSA, which every Linux desktop has.

pip install simple-phone                  # or: uv add simple-phone
sudo apt install libasound2t64            # only if ALSA is missing (libasound2 before Ubuntu 24.04)
pip install 'simple-phone[stt,tts]'       # optional: Whisper and Piper for say() and listen()

Or run it without installing, with uv:

uvx simple-phone doctor --server pbx.example.com --user 1001   # REGISTER and OPTIONS
uvx simple-phone call 1002 --server pbx.example.com --user 1001

Check the install, and then your account:

simple-phone doctor                                       # this machine: codecs, audio devices
simple-phone doctor --server pbx.example.com --user 1001  # also REGISTER and OPTIONS

Use it from the terminal

The password comes from $SIP_PASSWORD, or the command asks for it.

export SIP_PASSWORD=...
# Call, stay 30 s, hang up and print the report
simple-phone call 1002 --server pbx.example.com --user 1001 --duration 30
# Wait for one call and send back what it hears (echo)
simple-phone answer --server pbx.example.com --user 1002 --media echo --timeout 600
# Ring 5 s before answering, then echo after 3 s of silence
simple-phone answer --server pbx.example.com --user 1002 --answer-delay 5 --media echo --media-delay 3
# Send a 1 kHz tone, or noise as loud as speech
simple-phone call 1002 --server pbx.example.com --user 1001 --media tone --tone 1000
simple-phone call 1002 --server pbx.example.com --user 1001 --media noise
# Press keys 2 s after the answer (RFC 4733 DTMF)
simple-phone call 600 --server pbx.example.com --user 1001 --dtmf '1234#' --dtmf-delay 2
# Play a WAV (8 kHz mono) over and over, and record what comes back
simple-phone call 1002 --server pbx.example.com --user 1001 --media wav --wav prompt.wav --loop --record back.wav
# Talk: microphone and speaker
simple-phone call 1002 --server pbx.example.com --user 1001 --media mic --speaker
# Send header names in compact form (i:, f:, v:...)
simple-phone call 1002 --server pbx.example.com --user 1001 --compact-headers --trace
# Watch every SIP message and the RTP counters as they happen
simple-phone call 1002 --server pbx.example.com --user 1001 --trace --stats
# No account: dial a host directly, ping it, send it a message
simple-phone call 1002@192.0.2.10
simple-phone options pbx.example.com
simple-phone message 1002@pbx.example.com hello
# Audio devices, for --set capture_device=N
simple-phone devices

call prints the SIP status, the time to answer, and loss, jitter, RTT and MOS for each RTP stream. call and answer exit with 0 when the call was answered with audio, so they work in scripts:

simple-phone call 1002 --profile account.json --json report.json && echo "route ok"

Keep an account in a JSON file and pass --profile: examples for a PBX, a trunk, NAT and a test answerer are in examples/accounts/ and docs/cli.md#profiles.

All options, the report and the exit codes: docs/cli.md.

Use it from Python

import asyncio
from simple_phone import AsyncPhone


async def main():
    async with AsyncPhone(server="pbx", user="1001", password="...") as phone:
        async with phone.call("1002") as call:
            await call.dtmf("1234#")
        print(call.trace.flow())  # ['INVITE', '100', '180', '200', 'ACK', 'BYE', '200']
        print(call.report.mos)


asyncio.run(main())

Phone is the same API without await:

from simple_phone import Phone

with Phone(server="pbx.example.com", user="1001", password="...") as phone:
    with phone.call("1002") as call:
        call.dtmf("1234#")

Answer calls and react to events:

from simple_phone import AsyncPhone, Call

async with AsyncPhone(server="pbx.example.com", user="1002", password="...") as phone:

    @phone.on(AsyncPhone.Incoming)
    async def incoming(event):
        await event.call.answer(media="echo")

    @phone.on(Call.Dtmf, digit="#")
    async def done(event):
        await event.call.hangup()

    await phone.serve()

Check a route in a test:

async with phone.call("1002") as call:
    event = await call.wait_for(Call.Stats, lambda e: e.stats.rx_packets >= 100)
    assert event.stats.rx_loss_percent < 1
assert call.report.mos >= 3.8

The rest of the API: docs/api.md. Examples that run on one machine, without a PBX: examples/api/.

What it does

  • Registers an extension, or uses a trunk without registration.
  • Makes and answers calls over UDP or TCP, with G.711 by default.
  • Sends silence, an echo of what it hears, a WAV file or the microphone. Records what it receives.
  • Sends and receives DTMF by RFC 4733, SIP INFO or in-band tones.
  • Reports per call every SIP message, loss, jitter, RTT and an estimated MOS.
  • Tells who answered an outgoing call: a person, an IVR, voicemail or a network announcement.
  • Holds, transfers and conferences calls.
  • Subscribes to presence, BLF and voicemail (MWI). Sends OPTIONS, MESSAGE and real-time text.
  • Runs up to 64 calls in one process, paced by Limits.
  • Speaks and transcribes with Piper and Whisper.

Docs

License

GPL-2.0-or-later. PJSIP is GPL and is linked into this package, so the package carries the same license. Teluu sells a commercial PJSIP license for closed-source use.

Metadata

Release files for simple-phone 0.1.15

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for simple-phone 0.1.15
File Actions
simple_phone-0.1.15-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details for simple_phone-0.1.15-cp315-cp315-win_amd64.whl
simple_phone-0.1.15-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for simple_phone-0.1.15-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
simple_phone-0.1.15-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details for simple_phone-0.1.15-cp314-cp314-win_amd64.whl
simple_phone-0.1.15-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details for simple_phone-0.1.15-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
simple_phone-0.1.15-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details for simple_phone-0.1.15-cp313-cp313-win_amd64.whl
simple_phone-0.1.15-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for simple_phone-0.1.15-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
simple_phone-0.1.15-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details for simple_phone-0.1.15-cp312-cp312-win_amd64.whl
simple_phone-0.1.15-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for simple_phone-0.1.15-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
simple_phone-0.1.15-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details for simple_phone-0.1.15-cp311-cp311-win_amd64.whl
simple_phone-0.1.15-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details for simple_phone-0.1.15-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Total release size: 24.4 MB

Release files / simple_phone-0.1.15-cp315-cp315-win_amd64.whl

Download URL simple_phone-0.1.15-cp315-cp315-win_amd64.whl
Size 2.4 MB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
bb524a55d0f65f555e9853fc1760773a972ffb021e83469d80110d2a4be0ee01
BLAKE2b-256 checksum
How to use checksums
c2910c401986130c614d1db0cb8c5b63e4e73e8e58963dd7cf8ec0f7070b4013
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Release files / simple_phone-0.1.15-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL simple_phone-0.1.15-cp315-cp315-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.5 MB
Tags CPython 3.15 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
c7817f9e049e82685ffa68de643c0d4c384f849c721cee6926f144c202cb9799
BLAKE2b-256 checksum
How to use checksums
98a0d8368183abd99effd40db056f61ae42433dda926bf9918b282ca9ef072a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Release files / simple_phone-0.1.15-cp314-cp314-win_amd64.whl

Download URL simple_phone-0.1.15-cp314-cp314-win_amd64.whl
Size 2.4 MB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
04093c275aebce787edcb0c948ee8dc2e66af5a0cfed96c240ad2835a72cc13e
BLAKE2b-256 checksum
How to use checksums
a2fb85dbedf7b530c79fa58b304aaa8271df5c672d85766f7d900706966488fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Release files / simple_phone-0.1.15-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL simple_phone-0.1.15-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.5 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
3e62549a195e09ad7a5edf61b33f8ce12182174e304be4e91a9dbbb520b08f02
BLAKE2b-256 checksum
How to use checksums
f7040f46efdaea0400d80b199e63243236bb74e1c978fc7f45778ceb4f07b910
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Release files / simple_phone-0.1.15-cp313-cp313-win_amd64.whl

Download URL simple_phone-0.1.15-cp313-cp313-win_amd64.whl
Size 2.3 MB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
14cda122a2b163fa672f19e28534eb99f230563f1bebe7cd612b9ebc0bebf953
BLAKE2b-256 checksum
How to use checksums
38c9f3bc02518ce1fc521b0240431f17263664493733b56053e75dabbd4c04c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Release files / simple_phone-0.1.15-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL simple_phone-0.1.15-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.5 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
4b15daff43ae2cc05435bc3c8b15d425bc5ddd917e7bf9c2e82ed8c0eb225f9e
BLAKE2b-256 checksum
How to use checksums
724d48edfe18e3bd6b25fb167d6be08c5dbb86cbc1f2b2fbb3ac8675662c7630
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Release files / simple_phone-0.1.15-cp312-cp312-win_amd64.whl

Download URL simple_phone-0.1.15-cp312-cp312-win_amd64.whl
Size 2.3 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
2ea9744c90b2143f993f1a517310ed1bee6fae92b626c08f390a9fce22f55ea5
BLAKE2b-256 checksum
How to use checksums
3fb59f88a3cc570856526e600e11a9623f49303ea7ee3a25e93f3bc2c2618893
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Release files / simple_phone-0.1.15-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL simple_phone-0.1.15-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.5 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
676f8a01dd3a361c9adb488a26ed2929967264bf303503bd35aa3f5e432a9206
BLAKE2b-256 checksum
How to use checksums
dd68ea2ca79c98954b08f196abcd5642935f77af4bd186eb3a69e479a5e5073f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Release files / simple_phone-0.1.15-cp311-cp311-win_amd64.whl

Download URL simple_phone-0.1.15-cp311-cp311-win_amd64.whl
Size 2.3 MB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
74b3bdcdea36a35ebdf47b4fd19f74076f3ed6d24caa9038474df9d8b4cfa040
BLAKE2b-256 checksum
How to use checksums
15544e82e751f58ec481fe06e2ee0ec128eec10501b26df7f48e1e2df009d187
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Release files / simple_phone-0.1.15-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL simple_phone-0.1.15-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 2.5 MB
Tags CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
aa3bcd5db8671782a827cda648fbc3b959d4c4395f252dad4f490760bc2c684d
BLAKE2b-256 checksum
How to use checksums
598740c7130e544aa1ff931613fc4c8016c689ddbfc6707d0a74406a626cc6ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 28, 2026.

Transparency log

Security for simple-phone 0.1.15

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.

Full provenance

All 10 files in this release have been uploaded with provenance metadata.

Select from 10 files

Attestation for simple_phone-0.1.15-cp315-cp315-win_amd64.whl

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 Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page