simple-phone
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.
pip install simple-phone
Make a call from the terminal and get a report of the SIP exchange and the RTP quality:
simple-phone call 1002 --server pbx.example.com --user 1001 --media echo
Or 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#")
Linux x86_64, Python 3.14. The only system library it needs is ALSA (libasound2), which every Linux desktop has.
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:
pip install 'simple-phone[stt,tts]'.
Command line
simple-phone call 1002 --server pbx.example.com --user 1001 # dial, report, exit
simple-phone answer --server pbx.example.com --user 1002 # wait for one call
simple-phone doctor --server pbx.example.com --user 1001 # check the setup
simple-phone devices # audio devices
The password comes from $SIP_PASSWORD, or the command asks for it. 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"
All options, the report and the exit codes: docs/cli.md.
Python
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/.
More
- docs/cli.md: the command, its options and its report.
- docs/api.md: the Python API.
- docs/development.md: building, tests, CI and releases.
- docs/architecture.md: how the code is organized.
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.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| simple_phone-0.1.0-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.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
Release files / simple_phone-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | simple_phone-0.1.0-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 |
faa42015a050b47673c9ba809af53fbf1dbfc6e681c736f662af254826e21a2e
|
|
BLAKE2b-256 checksum How to use checksums |
cbe3ffb13a91c40d33bb5d37b031c163cc12b0f761c81085361f2ba80221cca8
|
| 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 25, 2026.
Transparency logSecurity for simple-phone 0.1.0
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
1 file in this release has been uploaded with provenance metadata.
Attestation for simple_phone-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.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 25, 2026.
Transparency logA 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.