https://github.com/otoru/genesis
Implementation of FreeSWITCH Event Socket protocol with asyncio
https://github.com/otoru/genesis
esl freeswitch integration telephony
Last synced: 11 days ago
JSON representation
Implementation of FreeSWITCH Event Socket protocol with asyncio
- Host: GitHub
- URL: https://github.com/otoru/genesis
- Owner: Otoru
- License: mit
- Created: 2021-07-15T14:25:47.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2026-01-18T02:28:14.000Z (about 2 months ago)
- Last Synced: 2026-01-18T16:58:52.038Z (about 2 months ago)
- Topics: esl, freeswitch, integration, telephony
- Language: Python
- Homepage: https://otoru.github.io/Genesis/
- Size: 2.05 MB
- Stars: 38
- Watchers: 4
- Forks: 12
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
- Agents: AGENTS.md
Awesome Lists containing this project
README
# Genesis
[](https://github.com/Otoru/Genesis/actions/workflows/pypi.yml)
[](https://github.com/Otoru/Genesis/blob/master/LICENSE.md)
[](https://pypi.org/project/genesis/)
[](https://pypi.org/project/genesis/)
[](https://pypi.org/project/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 `asyncio` for 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`:
```bash
pip install genesis
```
## Quickstart
### Inbound Socket Mode
```python
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
```python
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
```python
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](https://otoru.github.io/Genesis/).
To preview the docs locally, install [Hugo](https://gohugo.io) and run:
```bash
hugo server --source docs --disableFastRender
```
## Running Tests
Install development dependencies with [Poetry](https://python-poetry.org) and execute the test suite using [tox](https://tox.wiki):
```bash
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](CONTRIBUTING.md) and [Code of Conduct](CODE_OF_CONDUCT.md) to get started.
## Contributors
## License
This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details.