Asterisk的Python接口

pyst2的Python项目详细描述


pyst2 Releasepyst2 Downloadspyst2 BuildSnake Sketch

note:这个项目现在由francesco rana负责。 请耐心点,因为我还不习惯这份工作,但我会尽力的。 感谢兰德尔·德格斯的精彩工作。我实际上在用 图书馆在我的某个项目,所以我非常乐意帮助和推动它,如果我可以的话。 我很乐意接受拉取请求并根据需要减少释放。 如果你想为这个项目做贡献,请做!

目的

pyst2由一组接口和库组成,允许对 python中的星号。库当前支持agi、ami和解析 星号配置文件。该库还包括调试工具 为了阿吉。

此项目已从pyst(http://sf.net/projects/pyst/)派生,因为 我不可能联系项目维护人员(几次之后 尝试),我想更新项目,修复错误,并使 总的来说更有用。

我现在的计划包括添加完整的文档,重新编写一些 在核心例程中,添加一个测试套件,并接受拉取请求。

如果您是当前的维护人员之一,并且希望接管 fork,请联系我:r@rdegges.com,这样我们就可以得到设置!

安装

要安装pyst2,只需运行:

$ pip install pyst2

这将自动安装库的最新版本。

文档

文档目前只在python docstrings中提供,您可以使用 Python内置帮助设施:

import asterisk
help (asterisk)
import asterisk.agi
help (asterisk.agi)
import asterisk.manager
help (asterisk.manager)
import asterisk.config
help (asterisk.config)

关于平台的一些注意事项:我们现在在 setup.py。这意味着,包中的管理器部分可能 在任何平台上跑步。另一方面,agi脚本被称为 直接在运行星号的主机上。因为星号不是 在Windows平台上运行(可能永远不会)的AGI部分 包只能在星号平台上运行。

法斯塔吉

fastagi支持是一个基于python的原始socketserver,用于启动服务器 python fastagi.py应该在本地主机上开始监听,默认情况下 星号Fastagi端口。这需要最新版本的pyst2。 FastAgi服务器作为fork操作为每个请求运行,在 一种防止单一坏服务阻塞的尝试。因此 FastAgi服务器可能比单个进程消耗更多内存。如果你需要 要使用单个进程,只需取消对相应行的注释。未来版本 其中将使用配置文件设置选项。

学分

感谢卡尔·普特兰写下了原始的包裹。

感谢matthew nicholson多年来一直维护这个包 在他不再感兴趣的时候交维修费。

感谢Randall Degges的维护和接受 拉取请求。

为PYST做的事情

这是合并到自述文件中的原始变更日志。我不是这样的 当然我真的很想改变这些事情(特别是 线程实现对我来说很好)。我会保留一个部分 总结本自述文件中的更改。具体变更如下 在版本控制工具(当前为git)中提供。

  • 更改日志: 需要从单调日志更新changelog。

  • 文件: pyst的所有内联文档都需要更新。

  • 经理.py: 应该将其转换为单线程。还有一场比赛 用户调用manager.logoff()后接 manager.close().函数的作用仍然是再次调用logoff如果 套接字线程尚未清除“已连接”标志。

    应该为每个经理操作创建一个类,而不是 管理器类中的函数。经理班应该适应 有一个知道类的一般格式的send方法。

Matthew Nicholson写在邮件列表上(注意,我不确定我是否会这样做 现在,我对线程实现感到满意:

For pyst 0.3 I am planning to clean up the manager.py. There are several know issues with the code. No one has actually reported these as problems, but I have personally had trouble with these. Currently manager.py runs in several threads, the main program thread, a thread to read from the network, and an event distribution thread. This causes problems with non thread safe code such as the MySQLdb libraries. This design also causes problems when an event handler throws an exception that causes the event processing thread to terminate.

The second problem is with the way actions are sent. Each action has a specific function associated with it in the manager object that takes all possible arguments that may ever be passed to that action. This makes the api somewhat rigid and the Manager object cluttered.

To solve these problems I am basically going to copy the design of my Astxx manager library (written in c++) and make it more python like. Each action will be a different object with certain methods to handle various tasks, with one function in the actual Manager class to send the action. This will make the Manager class much smaller and much more flexible. The current code will be consolidated into a single threaded design with hooks to have the library process events and such. These hooks will be called from the host application’s main loop.

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java文件分块,获取长度字节   java嵌入式Tomcat不执行jsf页面   java我的数据库中有2个实体,但hibernate返回其中6个。   java如何基于逗号拆分字符串   java取消已经运行的CompletableFutures的预期模式是什么   java如何在informix中从另一个数据库复制表ddl和数据   为什么图片是黑色的?   java根据字符串数组中的单词筛选列表   Java8的集合。平行流有效吗?   Kotlin中的java静态内部类   java如何在GUI中生成一列字符串   javafx如何正确使用高对比度主题?   带空格的javascript Httpurlconnection参数   java如何设置GridBagLayout的约束   java如何在一个线程可能尚未初始化时关闭另一个线程   java将简单时间格式转换为特殊时间格式(hhmmt)   安卓/java阵列重复过滤器的问题   java在队列的链接实现下,入队和出队是如何工作的   java更新sql外键约束