[sip] Scripts appelé par asterisk dans un sous dossier

This commit is contained in:
Valentin Samir 2013-11-12 17:08:03 +01:00
parent 4060df409c
commit db5de1a8cc
6 changed files with 9 additions and 8 deletions

1
sip/scripts/README Normal file
View file

@ -0,0 +1 @@
Contient des script appelé par asterisk qui lit leur résultat sur stdin

View file

@ -1,8 +1,8 @@
#!/usr/bin/env python
#!/bin/bash /usr/scripts/python.sh
# -*- coding: utf-8 -*-
import sys
from asterisk import Profile
from sip.asterisk import Profile
if __name__ == '__main__' :
if len(sys.argv)>1:

View file

@ -1,12 +1,12 @@
#!/usr/bin/env python
#!/bin/bash /usr/scripts/python.sh
# -*- coding: utf-8 -*-
import sys
from asterisk import Profile
from sip.asterisk import Profile
if __name__ == '__main__' :
if len(sys.argv)>1:
profile = Profile("dbname='django' user='crans' host='pgsql.adm.crans.org'", "voip_profile")
sys.stdout.write(profile.num_to_callerid(sys.argv[1]))
else:
print >> sys.stderr, "Usage %s {user}" % sys.argv[0]
print >> sys.stderr, "Usage %s {user}" % sys.argv[0]

View file

@ -1,11 +1,11 @@
#!/usr/bin/env python
#!/bin/bash /usr/scripts/python.sh
# -*- coding: utf-8 -*-
import sys
from asterisk import Profile
from sip.asterisk import Profile
if __name__ == '__main__' :
if len(sys.argv)>3:
profile = Profile("dbname='django' user='crans' host='pgsql.adm.crans.org'", "voip_profile")
profile.update_pin(sys.argv[2], sys.argv[3])
else:
print >> sys.stderr, "Usage %s {seed} {number} {pin}" % sys.argv[0]
print >> sys.stderr, "Usage %s {seed} {number} {pin}" % sys.argv[0]