Make udev run dahdi_cfg on each device:

* New script: dahdi_cfg_device_args:
   - Just like span_assignments, span_types: may be given
     one or more sysfs devpath's
   - Output the required options for dahdi_cfg. E.g:
       "-S 8 -C 15-28"
   - This may be passed (with any other wanted options)
     to the new dahdi_cfg (which supports '-S' and '-C')

 * Use dahdi_cfg_device_args in handle_device so we configure
   each span from udev.

Signed-off-by: Oron Peled <oron.peled@xorcom.com>
Signed-off-by: Russ Meyerriecks <rmeyerriecks@digium.com>
This commit is contained in:
Oron Peled
2011-10-06 21:03:03 +02:00
committed by Russ Meyerriecks
parent 79fff3e278
commit ba3289ac9a
2 changed files with 41 additions and 0 deletions

View File

@@ -22,6 +22,12 @@ PATH="$dir:/usr/sbin:/sbin:/usr/bin:/bin"
set -e
run_dahdi_cfg() {
args="-c $DAHDICONFDIR/system.conf $@"
echo "Running dahdi_cfg $args"
dahdi_cfg $args
}
echo >&2 "$0($ACTION): DEBUG($# args): '$*'"
case "$ACTION" in
@@ -31,6 +37,9 @@ add)
#export DAHDICONFDIR="/tmp/xortel/dahdi"
span_types set "/sys/$DEVPATH" 2>&1 | $LOGGER
span_assignments add "/sys/$DEVPATH" 2>&1 | $LOGGER
dahdi_cfg_device_args | while read args; do
run_dahdi_cfg $args 2>&1 | $LOGGER
done
;;
remove)
echo "$ACTION: $DEVPATH" | $LOGGER