Pycall 抛出 ValidationError
Pycall throws ValidationError
我正在尝试 运行 atom
和 python3.6
中的这些代码行:
from pycall import CallFile, Call, Application
import sys
def call():
c = Call('SIP/200')
a = Application('Playback', 'hello-world')
cf = CallFile(c, a)
cf.spool()
if __name__ == '__main__':
call()
但是我收到这个错误:
Traceback (most recent call last):
File "/home/pd/gits/voiphone/main.py", line 12, in <module>
call()
File "/home/pd/gits/voiphone/main.py", line 9, in call
cf.spool()
File "/home/pd/telephonerelayEnv/lib/python3.6/site-packages/pycall/callfile.py", line 135, in spool
self.writefile()
File "/home/pd/telephonerelayEnv/lib/python3.6/site-packages/pycall/callfile.py", line 123, in writefile
f.write(self.contents)
File "/home/pd/telephonerelayEnv/lib/python3.6/site-packages/pycall/callfile.py", line 118, in contents
return '\n'.join(self.buildfile())
File "/home/pd/telephonerelayEnv/lib/python3.6/site-packages/pycall/callfile.py", line 100, in buildfile
raise ValidationError
pycall.errors.ValidationError
如果你能帮我解决我的问题,我将不胜感激。
提前谢谢你
查看 source code for the validity check,似乎唯一可以让您脱颖而出的检查是验证假脱机目录的检查。默认设置为 /var/spool/asterisk/outgoing
但可以在创建调用文件时更改:
cf = CallFile(c, a, spool_dir='/my/asterisk/spool/outgoing')
我正在尝试 运行 atom
和 python3.6
中的这些代码行:
from pycall import CallFile, Call, Application
import sys
def call():
c = Call('SIP/200')
a = Application('Playback', 'hello-world')
cf = CallFile(c, a)
cf.spool()
if __name__ == '__main__':
call()
但是我收到这个错误:
Traceback (most recent call last):
File "/home/pd/gits/voiphone/main.py", line 12, in <module>
call()
File "/home/pd/gits/voiphone/main.py", line 9, in call
cf.spool()
File "/home/pd/telephonerelayEnv/lib/python3.6/site-packages/pycall/callfile.py", line 135, in spool
self.writefile()
File "/home/pd/telephonerelayEnv/lib/python3.6/site-packages/pycall/callfile.py", line 123, in writefile
f.write(self.contents)
File "/home/pd/telephonerelayEnv/lib/python3.6/site-packages/pycall/callfile.py", line 118, in contents
return '\n'.join(self.buildfile())
File "/home/pd/telephonerelayEnv/lib/python3.6/site-packages/pycall/callfile.py", line 100, in buildfile
raise ValidationError
pycall.errors.ValidationError
如果你能帮我解决我的问题,我将不胜感激。 提前谢谢你
查看 source code for the validity check,似乎唯一可以让您脱颖而出的检查是验证假脱机目录的检查。默认设置为 /var/spool/asterisk/outgoing
但可以在创建调用文件时更改:
cf = CallFile(c, a, spool_dir='/my/asterisk/spool/outgoing')