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()
[general]
disallow=all
allow=g729
allow=ulaw
allow=alaw
context=local_test
allowguest=no
allowoverlap=no
bindport=5060
bindaddr=0.0.0.0
srvlookup=no
alwaysauthreject=yes
canreinvite=no
nat=yes
session-timers=refuse
localnet=192.168.1.0/255.255.255.0
host=dynamic
callevents=yes
notifyhold = yes
callcounter=yes
[100]
type=friend
host=dynamic
secret=123
context=local_test
[200]
type=friend
host=dynamic
secret=123
context=local_test
[local_test]
exten => 1234,1,Answer ; answer the call
exten => 1234,2,Playback(tt-weasels) ; play an audio file that simulates the voice of the called user
exten => 1234,3,Hangup ; hang up the call
exten => 100,1,Set(VOLUME(RX)=10) ; set the RX volume
exten => 100,2,Set(VOLUME(TX)=10) ; set the RX volume
exten => 100,hint,SIP/100; hint '100' used for presence notification
exten => 100,3,Dial(SIP/100) ; call the user 100'
exten => 200,1,Set(VOLUME(RX)=10) ; set the RX volume
exten => 200,2,Set(VOLUME(TX)=10) ; set the RX volume
exten => 200,hint,SIP/100; hint '200' used for presence notification
exten => 200,3,Dial(SIP/200) call the user '200' used for presence notification
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
i would appreciate if you help me solving my problem.
thank you in advance