Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

asyncio powered FreeSWITCH cluster control using pure Python 3.5+

pypi travis versions license docs

switchio (pronounced Switch Ee OoH) is the next evolution of switchy (think Bulbasaur -> Ivysaur) which leverages modern Python’s new native coroutine syntax and, for now, asyncio.

API-wise the project intends to be the flask for VoIP but with a focus on performance and scalability more like sanic.

Use the power of async and await!

Build a routing system using Python’s new coroutine syntax:

from switchio.apps.routers import Router

router = Router(guards={
    'Call-Direction': 'inbound',
    'variable_sofia_profile': 'external'})

@router.route('(.*)')
async def welcome(sess, match, router):
    """Say hello to inbound calls.
    """
    await sess.answer()  # resumes once call has been fully answered
    sess.log.info("Answered call to {}".format(match.groups(0)))

    sess.playback('ivr/ivr-welcome_to_freeswitch.wav') # non-blocking
    sess.log.info("Playing welcome message")
    await sess.recv("PLAYBACK_STOP")

    await sess.hangup()  # resumes once call has been fully hungup

Run this app (assuming it’s in dialplan.py) from the shell:

$ switchio serve fs-host1 fs-host2 fs-host3 --app ./dialplan.py:router

Spin up an auto-dialer

Run thousands of call flows to stress test your service system using the built-in auto-dialer:

$ switchio dial fs-tester1 fs-tester2 --profile external --proxy myproxy.com --rate 100 --limit 3000

Install

pip install switchio

Docs

Oh we’ve got them docs!

How do I deploy my FreeSWITCH cluster?

See the docs for the deats!

What’s included?

  • A slew of built-in apps

  • A full blown auto-dialer originally built for stress testing VoIP service systems

  • Super detailed ESL event logging

How can I contribute?

Have an idea for a general purpose switchio app or helper? Make a PR here on GitHub!

Also, if you like switchio let us know on Riot!

Wait, how is switchio different from other ESL clients?

switchio differentiates itself by supporting FreeSWITCH process cluster control as well as focusing on leveraging the most modern Python language features. switchio takes pride in being a batteries included framework that tries to make all the tricky things about FreeSWITCH a cinch.

What if I’m stuck on Python 2?

Check out these other great projects:

Performance monitoring

If you’d like to record performance measurements using the CDR app, some optional numerical packages can be used:

Feature

Dependency

Installation

Metrics Capture

pandas

pip install switchio[metrics]

Graphing

matplotlib

pip install switchio[graphing]

HDF5

pytables [1]

pip install switchio[hdf5]

License

All files that are part of this project are covered by the following license, except where explicitly noted.

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.

Metadata

Release files for switchio 0.1.0a1

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

Source distribution (sdist)

Source distribution for switchio 0.1.0a1
File Size Uploaded
switchio-0.1.0a1.tar.gz 69.1 kB Details

Release files / switchio-0.1.0a1.tar.gz

Download URL switchio-0.1.0a1.tar.gz
Size 69.1 kB
Tags Source
SHA-256 checksum
How to use checksums
203c9ef1471e50ce7723149ca04c4e912de6c3c5e3bec48ff380ce17ae4dbcc3
BLAKE2b-256 checksum
How to use checksums
b817bf60e39fcb972f6990695aa33f96d9637c04363564bf10219cb149fcfed9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.1.0a1 This release

1 release file

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