我在 Ubuntu 16.04 上设置了 Asterisk 13.20 并运行良好,通过软电话(Zoiper)进行通话,我遇到了 Python“Pycall”中的一个库,它可以让你通过 Python 脚本进行调用。所以我尝试测试一个片段来自网站Pycall
我使用的代码:
from pycall import CallFile, Call, Application
call = Call('SIP/flowroute/18882223333')
action = Application('Playback', 'hello-world')
c = CallFile(call, action)
c.spool()
刚刚对扩展名进行了更改,其中我使用了我的服务器中的一个但是我收到以下错误:
Traceback (most recent call last):
File "test.py", line 10, in <module>
c.spool()
File "/usr/local/lib/python2.7/dist-packages/pycall/callfile.py", line 131, in spool
self.writefile()
File "/usr/local/lib/python2.7/dist-packages/pycall/callfile.py", line 119, in writefile
f.write(self.contents)
File "/usr/local/lib/python2.7/dist-packages/pycall/callfile.py", line 114, in contents
return '\n'.join(self.buildfile())
File "/usr/local/lib/python2.7/dist-packages/pycall/callfile.py", line 96, in buildfile
raise ValidationError
pycall.errors.ValidationError
尝试在线搜索解决方案,但找不到一个,我做错了什么?