[sip] Factorisation et mise au propre des scripts pour asterisk

This commit is contained in:
Valentin Samir 2013-06-16 21:58:47 +02:00
parent 9b5c5eb93d
commit 399bf75dbe
20 changed files with 475 additions and 201 deletions

12
sip/num_to_callerid Executable file
View file

@ -0,0 +1,12 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from 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]