异步供电的自由开关群集控制
switchio的Python项目详细描述
switchio(发音为switch ee ooh)是switchy的下一个演变。 (想想bulbasaur->;ivysaur)它利用了现代python的新本机 coroutine语法,现在,asyncio。
从api的角度来看,该项目打算成为voip的flask,但重点是 性能和可伸缩性更像sanic。
使用async和await的力量!
使用python的新coroutine语法构建路由系统:
fromswitchio.apps.routersimportRouterrouter=Router(guards={'Call-Direction':'inbound','variable_sofia_profile':'external'})@router.route('(.*)')asyncdefwelcome(sess,match,router):"""Say hello to inbound calls. """awaitsess.answer()# resumes once call has been fully answeredsess.log.info("Answered call to {}".format(match.groups(0)))sess.playback('ivr/ivr-welcome_to_freeswitch.wav')# non-blockingsess.log.info("Playing welcome message")awaitsess.recv("PLAYBACK_STOP")awaitsess.hangup()# resumes once call has been fully hungup
从shell运行这个应用程序(假设它在dialplan.py中):
$ switchio serve fs-host1 fs-host2 fs-host3 --app ./dialplan.py:router
启动自动拨号程序
运行数千个调用流来使用 内置的auto-dialer:
$ switchio dial fs-tester1 fs-tester2 --profile external --proxy myproxy.com --rate 100 --limit 3000
安装
pip install switchio
文档
哦,我们找到他们了docs!
包括什么?
- 一系列built-in apps
- 完全成熟的auto-dialer最初是为测试voip服务系统而构建的
- 超级详细的ESL事件日志记录
等等,switchio与其他ESL客户端有何不同?
switchio通过支持freeswitch使自己与众不同 process cluster control并专注于利用 最新的python语言特性。switchio引以为豪 作为一个电池的框架,它包含了 关于自由女巫的棘手的事情很简单。
性能监视
如果您想使用 CDRapp,可以使用一些可选的数字包:
Feature | Dependency | Installation |
---|---|---|
Metrics Capture | pandas | ^{tt10}$ |
Graphing | matplotlib | ^{tt11}$ |
HDF5 | pytables[1] | ^{tt12}$ |
[1] | ^{tt13}$ 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. |
许可证
本项目中的所有文件都包含在以下内容中 许可证,除非明确注明。
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/.