我想在我的 Python 应用程序中显示 Asterisk SIP peers。
我可以看到这样的列表正在执行:
dll,plugin_path = find_lib()
ctypes.CDLL('libvlccore.dylib')
self._handle = _dlopen(self._name,mode)
OSError: dlopen(libvlccore.dylib,6): image not found
在 Python 中我使用 [pbx:~] # asterisk -rx "sip show peers"
Name/username Host Dyn Forcerport Comedia ACL Port Status Description
212 (Unspecified) D No No 0 UNKNOWN
213 (Unspecified) D No No 0 UNKNOWN
217/217 169.0.5.17 D No No 5060 OK (29 ms)
....
库:
pyst 0.8
然后我漂亮地打印了响应的一些字段。但我得到的只是:
import asterisk.manager
...
manager = asterisk.manager.Manager()
try:
manager.connect(host,port)
manager.login(usr,passwd)
r = manager.sippeers()
print('------- r ----')
pp.pprint(r)
print('-----------')
# ...
如何使用 ------- r ----
Success
-----------
------ response -----
[ u'Response: Success\r\n',u'actionID: pbx-25332-00000001\r\n',u'EventList: start\r\n',u'Message: Peer status list will follow\r\n']
-----------
------ data -----
u''
-----------
------ headers -----
{ u'actionID': u'pbx-25332-00000001',u'EventList': u'start',u'Message': u'Peer status list will follow',u'Response': u'Success'}
-----------
----- multiheaders ------
{ u'actionID': [u'pbx-25332-00000001'],u'EventList': [u'start'],u'Message': [u'Peer status list will follow'],u'Response': [u'Success']}
-----------
获取 SIP 对等点列表?
星号版本:
pyst