Commit c1e60086 authored by Valentin Samir's avatar Valentin Samir

[sip] Vieux fichier plus utilisé

parent 37b3832b
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
from asterisk import History
if __name__ == '__main__' :
if len(sys.argv)>1:
history = History("dbname='django' user='crans' host=''", "voip_history")
if sys.argv[1] == "add":
if len(sys.argv)>4:history.add(sys.argv[2], sys.argv[3], sys.argv[4])
else:print >> sys.stderr, "Usage %s %s {id} {src} {dst}" % (sys.argv[0], sys.argv[1])
elif sys.argv[1] =="delete":
if len(sys.argv)>2:history.delete(sys.argv[2])
else:print >> sys.stderr, "Usage %s %s {id}" % (sys.argv[0], sys.argv[1])
elif sys.argv[1] =="update":
if len(sys.argv)>3:history.update(sys.argv[2], sys.argv[3])
else:print >> sys.stderr, "Usage %s %s {id} {duration}" % (sys.argv[0], sys.argv[1])
print >> sys.stderr, "Usage {add | delete | update } ..."
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment