All Projects → friends-of-freeswitch → Switchio

friends-of-freeswitch / Switchio

Licence: mpl-2.0
asyncio powered FreeSWITCH cluster control

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Switchio

Aiotutorial
code snippets for asyncio tutorial
Stars: ✭ 257 (+60.63%)
Mutual labels:  asyncio, coroutines
Baresip
Baresip is a modular SIP User-Agent with audio and video support
Stars: ✭ 817 (+410.63%)
Mutual labels:  voip, telephony
Awesome Asyncio
A curated list of awesome Python asyncio frameworks, libraries, software and resources
Stars: ✭ 3,279 (+1949.38%)
Mutual labels:  asyncio, coroutines
Core
Free, easy to setup PBX for small business based on Asterisk 16 core
Stars: ✭ 190 (+18.75%)
Mutual labels:  telephony, voip
Pytask Io
Python Async Task Queue
Stars: ✭ 81 (-49.37%)
Mutual labels:  asyncio, coroutines
asynchronous
A D port of Python's asyncio library
Stars: ✭ 35 (-78.12%)
Mutual labels:  coroutines, asyncio
Gevent
Coroutine-based concurrency library for Python
Stars: ✭ 5,656 (+3435%)
Mutual labels:  asyncio, coroutines
think-async
🌿 Exploring cooperative concurrency primitives in Python
Stars: ✭ 178 (+11.25%)
Mutual labels:  coroutines, asyncio
Freeswitch
FreeSWITCH is a Software Defined Telecom Stack enabling the digital transformation from proprietary telecom switches to a versatile software implementation that runs on any commodity hardware. From a Raspberry PI to a multi-core server, FreeSWITCH can unlock the telecommunications potential of any device.
Stars: ✭ 1,213 (+658.13%)
Mutual labels:  voip, telephony
Asterisk Cdr Viewer Mod
Simple and fast viewer for Asterisk CDRs and Recordings (Mod)
Stars: ✭ 76 (-52.5%)
Mutual labels:  voip, telephony
Kalbi
Kalbi - Golang Session Initiated Protocol Framework
Stars: ✭ 85 (-46.87%)
Mutual labels:  telephony, voip
Ivozprovider
IVOZ Provider - Multitenant solution for VoIP telephony providers
Stars: ✭ 127 (-20.62%)
Mutual labels:  voip, telephony
somleng
Open Source Implementation of Twilio's REST API
Stars: ✭ 33 (-79.37%)
Mutual labels:  telephony, voip
Katari
Katari - Python Session Initiated Protocol Framework
Stars: ✭ 29 (-81.87%)
Mutual labels:  telephony, voip
fonoster
🚀 The open-source alternative to Twilio
Stars: ✭ 5,072 (+3070%)
Mutual labels:  telephony, voip
Aiotasks
A Celery like task manager that distributes Asyncio coroutines
Stars: ✭ 375 (+134.38%)
Mutual labels:  asyncio, coroutines
awesome-rtc
📡 A curated list of awesome Real Time Communications resources
Stars: ✭ 196 (+22.5%)
Mutual labels:  telephony, voip
human-call-filter
Captcha for phone calls
Stars: ✭ 41 (-74.37%)
Mutual labels:  telephony, voip
Lofty
Coroutines, stack traces and smart I/O for C++11, inspired by Python and Golang.
Stars: ✭ 5 (-96.87%)
Mutual labels:  asyncio, coroutines
Kamailio
Kamailio - The Open Source SIP Server for large VoIP and real-time communication platforms -
Stars: ✭ 1,358 (+748.75%)
Mutual labels:  voip, telephony

switchio

asyncio_ powered FreeSWITCH_ cluster control using pure Python_ 3.5+

|pypi| |travis| |versions| |license| |docs|

.. |versions| image:: https://img.shields.io/pypi/pyversions/switchio.svg :target: https://pypi.org/project/switchio .. |pypi| image:: https://img.shields.io/pypi/v/switchio.svg :target: https://pypi.org/project/switchio .. |travis| image:: https://img.shields.io/travis/friends-of-freeswitch/switchio/master.svg :target: https://travis-ci.org/friends-of-freeswitch/switchio .. |license| image:: https://img.shields.io/pypi/l/switchio.svg :target: https://pypi.org/project/switchio .. |docs| image:: https://readthedocs.org/projects/switchio/badge/?version=latest :target: http://switchio.readthedocs.io

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_.

.. _asyncio: https://docs.python.org/3.6/library/asyncio.html .. _FreeSWITCH: https://freeswitch.org/ .. _Python: https://www.python.org/ .. _switchy: https://github.com/sangoma/switchy .. _coroutine: https://docs.python.org/3.6/library/asyncio-task.html .. _flask: http://flask.pocoo.org/ .. _sanic: https://github.com/channelcat/sanic .. _docs: https://switchio.readthedocs.org/

Use the power of async and await!

Build a routing system using Python's new coroutine_ syntax:

.. code:: python

from switchio.apps.routers import Router

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

@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(  # non-blocking
        'en/us/callie/ivr/8000/ivr-founder_of_freesource.wav')
    await sess.recv("PLAYBACK_START")
    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

You can also run it from your own script:

.. code:: python

if __name__ == '__main__':
    from switchio import Service
    service = Service(['fs-host1', 'fs-host2', 'fs-host3'])
    service.apps.load_app(router, app_id='default')
    service.run()

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

.. _auto-dialer: http://switchio.readthedocs.io/en/latest/callgen.html

Install

::

pip install switchio

Docs

Oh we've got them docs_!

How do I deploy my FreeSWITCH cluster?

  • Enable inbound ESL_ connections
  • Add a park-only_ dialplan (Hint: we include one here_)

See the docs_ for the deats!

.. _inbound ESL: https://freeswitch.org/confluence/display/FREESWITCH/mod_event_socket#mod_event_socket-Configuration .. _park-only: https://freeswitch.org/confluence/display/FREESWITCH/mod_dptools%3A+park .. _here: https://github.com/friends-of-freeswitch/switchio/blob/master/conf/switchiodp.xml

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

.. _built-in apps: http://switchio.readthedocs.io/en/latest/apps.html .. _auto-dialer: http://switchio.readthedocs.io/en/latest/callgen.html

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_!

.. _Riot: https://riot.im/app/#/room/#freeswitch:matrix.org

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:

  • greenswitch_
  • eventsocket_
  • pySWITCH_
  • python-ESL_

.. _greenswitch: https://github.com/EvoluxBR/greenswitch .. _eventsocket: https://github.com/fiorix/eventsocket .. _pySWITCH: http://pyswitch.sourceforge.net/ .. _python-ESL: https://github.com/sangoma/python-ESL

Performance monitoring

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

.. _CDR: http://switchio.readthedocs.io/en/latest/apps.html#cdr

=============== ================ ================================ Feature Dependency Installation =============== ================ ================================ Metrics Capture pandas_ pip install switchio[metrics] Graphing matplotlib_ pip install switchio[graphing] HDF5 pytables_ [#]_ pip install switchio[hdf5] =============== ================ ================================

.. [#] pytables support is a bit shaky and not recommended unless you intend to locally process massive data sets worth of CDRs. The default CSV backend is usually sufficient on a modern file system.

.. _pandas: http://pandas.pydata.org/ .. _matplotlib: http://matplotlib.org/ .. _pytables: http://www.pytables.org/

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/.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].