Async Python library for FreeSWITCH Event Socket Layer (ESL) - Build high-performance telephony applications with asyncio
Project description
Genesis
Genesis is a Python library designed to build asynchronous applications that interact with FreeSWITCH through the Event Socket Layer (ESL).
Features
- Asynchronous by Design: Built with
asynciofor high-performance, non-blocking I/O. - Inbound, Outbound, and Consumer Modes: Supports all major ESL modes for comprehensive FreeSWITCH integration.
- Decorator-Based Event Handling: A simple and intuitive way to handle FreeSWITCH events.
- OpenTelemetry Support: Built-in instrumentation for tracing connections and commands.
- Extensible and Customizable: Easily extend and customize the library to fit your needs.
Installation
Install Genesis using pip:
pip install genesis
Quickstart
Inbound Socket Mode
import asyncio
from genesis import Inbound
async def uptime():
async with Inbound("127.0.0.1", 8021, "ClueCon") as client:
return await client.send("uptime")
async def main():
response = await uptime()
print(response)
asyncio.run(main())
Consumer Mode
import asyncio
from genesis import Consumer
app = Consumer("127.0.0.1", 8021, "ClueCon")
@app.handle("HEARTBEAT")
async def handler(event):
await asyncio.sleep(0.001)
print(event)
asyncio.run(app.start())
Outbound Socket Mode
import asyncio
from genesis import Outbound
async def handler(session):
await session.answer()
await session.playback('ivr/ivr-welcome')
await session.hangup()
app = Outbound(handler, "127.0.0.1", 5000)
asyncio.run(app.start())
Documentation
Full documentation is available on the documentation website.
To preview the docs locally, install Hugo and run:
hugo server --source docs --disableFastRender
Running Tests
Install development dependencies with Poetry and execute the test suite using tox:
poetry install
tox
How to Contribute
Contributions are welcome! Whether it's improving documentation, suggesting new features, or fixing bugs, your help is appreciated.
Please read our Contributing Guide and Code of Conduct to get started.
Contributors
|
Vitor Hugo |
RL |
Dongwoon Kim |
License
This project is licensed under the MIT License - see the LICENSE.md file for details.
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 genesis-2026.2.7.tar.gz.
File metadata
- Download URL: genesis-2026.2.7.tar.gz
- Upload date:
- Size: 34.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.10.2 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a23deedbcdcac08bc11027d880460b2e69fe0691db58e7685b61cdfd824994fd
|
|
| MD5 |
4709ff94cb7f11e6ab01e968d57c58f8
|
|
| BLAKE2b-256 |
b8aab0dc60608144b4216ea4a489d26e76f0fba6ff422be56f0434cb97b3436b
|
File details
Details for the file genesis-2026.2.7-py3-none-any.whl.
File metadata
- Download URL: genesis-2026.2.7-py3-none-any.whl
- Upload date:
- Size: 46.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.10.2 Linux/6.11.0-1018-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba5cca3ef3d4b2cdc54949875ab2c344291905668aeae7e2bf3f21953e4afff2
|
|
| MD5 |
24b46289d047cef1c92f118118fce910
|
|
| BLAKE2b-256 |
64a3e5bceca27d92f647144b068f1eb7f06d6edbbf9f12dacc96f07eca69cbd6
|