summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-02-22 11:38:49 -0600
committerShaun Ruffell <sruffell@digium.com>2011-04-15 14:21:13 -0500
commit9c8aa9db7eca1c91bd37bd5b55add0cee40d7cd9 (patch)
treebfc2085dcc4eab5646319c0b60cf7cf75f21e8f3
parenta252159ad7fff13d9f136e72d82ed400c2cb62f8 (diff)
delete: adding dahdi_helper to inspect the uvents we want.
-rwxr-xr-xbuild_tools/genudevrules1
-rwxr-xr-xdahdi_helper.py28
2 files changed, 29 insertions, 0 deletions
diff --git a/build_tools/genudevrules b/build_tools/genudevrules
index cfd3c90..2a73c05 100755
--- a/build_tools/genudevrules
+++ b/build_tools/genudevrules
@@ -37,4 +37,5 @@ KERNEL${match}"dahdi[0-9]*", NAME="dahdi/%n"
# DAHDI devices with ownership/permissions for running as non-root
SUBSYSTEM${match}"dahdi", OWNER="asterisk", GROUP="asterisk", MODE="0660"
+SUBSYSTEM${match}"dahdi_devices", RUN="/home/sruffell/dahdi-linux/dahdi_helper.py"
EOF
diff --git a/dahdi_helper.py b/dahdi_helper.py
new file mode 100755
index 0000000..672f6fe
--- /dev/null
+++ b/dahdi_helper.py
@@ -0,0 +1,28 @@
+#!/usr/bin/python
+#
+# This is just a debugging aide.
+# Add:
+#
+# SUBSYSTEM=="dahdi_devices", RUN="/home/sruffell/dahdi_helper.py"
+#
+# to /etc/udev/rules.d/dahdi.rules in order to watch the events.
+
+import sys
+import os
+
+log = file("/home/sruffell/log.txt", "a")
+log.write("*" * 80 + "\n")
+log.write("ARGUMENTS: ")
+for arg in sys.argv:
+ log.write(arg + " ")
+
+log.write("\nENVIRONMENT:\n")
+
+keys = os.environ.keys()
+keys.sort()
+for key in keys:
+ log.write(key + " : " + os.environ[key] + "\n")
+
+# This will cause this device to automatically register all of it's spans.
+#filename = "/sys" + os.environ["DEVPATH"] + "/auto_register"
+#file(filename, "w").write("1\n")