2

我正在尝试在atomand中运行这些代码行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

如果您能帮我解决我的问题,我将不胜感激。先感谢您

4

1 回答 1

0

查看有效性检查的源代码,似乎唯一可能引起您注意的检查是验证假脱机目录的检查。默认情况下,这设置为/var/spool/asterisk/outgoing但可以在创建调用文件时更改:

cf = CallFile(c, a, spool_dir='/my/asterisk/spool/outgoing')
于 2018-08-13T18:05:07.127 回答