Python asyncio library for VoIP calls.
Project description
Documentation |
Issues |
Changelog |
Funding ♥
Python VoIP
Async VoIP Python library for the AI age.
[!WARNING] This library is in early development and may contain breaking changes. Use with caution.
Usage
CLI
Answer calls and transcribe them live from the terminal:
SIP_PASSWORD=******** uvx 'voip[cli]' sip sips:alice@sip.example.com transcribe
A simple echo server can be started with:
```console
SIP_PASSWORD=******** uvx 'voip[cli]' sip sips:alice@sip.example.com echo
You can also talk to a local agent (needs Ollama):
SIP_PASSWORD=******** uvx 'voip[cli]' sip sips:alice@sip.example.com agent
Python API
uv add voip[audio,ai,pygments]
Subclass WhisperCall and override transcription_received to handle results.
Pass it as call_class when answering an incoming call:
import asyncio
import ssl
from voip.ai import TranscribeCall
from voip.sip.protocol import SIP
class MyCall(TranscribeCall):
def transcription_received(self, text: str) -> None:
print(f"[{self.caller}] {text}")
class MySession(SIP):
def call_received(self, request) -> None:
asyncio.create_task(self.answer(request=request, call_class=MyCall))
async def main():
loop = asyncio.get_running_loop()
ssl_context = ssl.create_default_context()
await loop.create_connection(
lambda: MySession(
aor="sips:alice@example.com",
username="alice",
password="secret",
),
host="sip.example.com",
port=5061,
ssl=ssl_context,
)
await asyncio.Future()
asyncio.run(main())
For raw audio access without transcription, subclass AudioCall and override
audio_received(self, audio: np.ndarray) instead.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file voip-0.2.1.tar.gz.
File metadata
- Download URL: voip-0.2.1.tar.gz
- Upload date:
- Size: 47.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c9f1be75f3c008edf02ab0c8f7229cb41d647b4dc2d65637b470bf752a7e694d
|
|
| MD5 |
8e672df483037800cdf0cfdf279d6e03
|
|
| BLAKE2b-256 |
c0ed59f0d68186d6c88250f391b0f7f0b1fb49b30bc1cde50474c299778bc534
|
Provenance
The following attestation bundles were made for voip-0.2.1.tar.gz:
Publisher:
release.yml on codingjoe/VoIP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
voip-0.2.1.tar.gz -
Subject digest:
c9f1be75f3c008edf02ab0c8f7229cb41d647b4dc2d65637b470bf752a7e694d - Sigstore transparency entry: 1109354618
- Sigstore integration time:
-
Permalink:
codingjoe/VoIP@aaed58f942e9a1afb82df28a92cd668af1d94435 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/codingjoe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@aaed58f942e9a1afb82df28a92cd668af1d94435 -
Trigger Event:
release
-
Statement type:
File details
Details for the file voip-0.2.1-py3-none-any.whl.
File metadata
- Download URL: voip-0.2.1-py3-none-any.whl
- Upload date:
- Size: 58.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c8a660d2bd270636a872ef64243de7ccc7302c8c8126a14d0bff4a3458477d8
|
|
| MD5 |
2def84df36f1aa5ef7a08db4944bdb1f
|
|
| BLAKE2b-256 |
4737aeee4866be7c8508a5b09293d521e8d308a8eebde9d4280ba00bfae9fa7b
|
Provenance
The following attestation bundles were made for voip-0.2.1-py3-none-any.whl:
Publisher:
release.yml on codingjoe/VoIP
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
voip-0.2.1-py3-none-any.whl -
Subject digest:
1c8a660d2bd270636a872ef64243de7ccc7302c8c8126a14d0bff4a3458477d8 - Sigstore transparency entry: 1109354635
- Sigstore integration time:
-
Permalink:
codingjoe/VoIP@aaed58f942e9a1afb82df28a92cd668af1d94435 -
Branch / Tag:
refs/tags/0.2.1 - Owner: https://github.com/codingjoe
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@aaed58f942e9a1afb82df28a92cd668af1d94435 -
Trigger Event:
release
-
Statement type: