summaryrefslogtreecommitdiffstats
path: root/client/ivam-autobox
diff options
context:
space:
mode:
Diffstat (limited to 'client/ivam-autobox')
-rwxr-xr-xclient/ivam-autobox57
1 files changed, 57 insertions, 0 deletions
diff --git a/client/ivam-autobox b/client/ivam-autobox
index 8d5063a..2713347 100755
--- a/client/ivam-autobox
+++ b/client/ivam-autobox
@@ -1,2 +1,59 @@
#!/usr/bin/python
+import sys, os, getopt
+
+from ivamCore import log
+import ivamCore, ivamVoiceBox
+
+def usage():
+ log("%s [--record-time=SECS] [--pin=PIN] [--pin-file=PINFILE] [--debug] [DIRECTORY]" % sys.argv[0])
+
+def parseArgs(vb, argv):
+
+ try:
+ opts, args = getopt.getopt(argv[1:], "ht:p:P:de:", ["help", "record-time=", "pin=", "pin-file=", "debug", "message-program"])
+ except getopt.GetoptError:
+ usage()
+ sys.exit(1)
+
+ recordTime = 60
+ pin = "-"
+
+ for o, a in opts:
+ if o in ("-d", "--debug"):
+ ivamCore.DEBUG = True
+
+ elif o in ("-h", "--help"):
+ usage()
+ sys.exit()
+
+ elif o in ("-t", "--record-time"):
+ recordTime = int(a)
+
+ elif o in ("-p", "--pin"):
+ pin = a
+
+ elif o in ("-P", "--pin-file"):
+ pin = getContents(a)
+
+ dname = "msn-" + sys.getenv("RINGMSN")
+
+ if len(args):
+ dname = args[0] + "/" + dname
+
+ try:
+ ivamVoiceBox.setupVoiceBox(dname, pin, recordTime)
+ except OSError:
+ pass
+
+ vb.setDirectory(dname)
+
+def main():
+ vb = ivamVoiceBox.VoiceBox()
+ parseArgs(vb, sys.argv)
+ ivamCore.newConnector(vb).run()
+ sys.exit()
+
+if __name__ == "__main__":
+ main()
+