hotplug: run fxotune from span_config:
authorOron Peled <oron.peled@xorcom.com>
Mon, 21 Oct 2013 10:06:18 +0000 (12:06 +0200)
committerTzafrir Cohen <tzafrir.cohen@xorcom.com>
Sun, 24 Nov 2013 14:36:01 +0000 (16:36 +0200)
* Use fxotune -b/-e options to run on wanted channel range

span_config

index c2e87cd..226a37f 100755 (executable)
@@ -42,7 +42,7 @@ DAHDICONFDIR='/etc/dahdi'
 export DAHDICONFDIR
 
 run_dahdi_cfg() {
-       echo "dahdi_cfg: span $spanno <$basechan-$endchan>"
+       echo "dahdi_cfg: span $spanno <$basechan-$endchan> ($DEVPATH)"
        dahdi_cfg -c "$cfg_file" -S "$spanno" -C "$basechan-$endchan"
 }
 
@@ -70,6 +70,11 @@ configure_span() {
                cfg_file='-'
                DAHDI_CONF_FILE="$cfg_file" dahdi_genconf system | run_dahdi_cfg
        fi
+       fxotune_cfg='/etc/fxotune.conf'
+       if [ -r "$fxotune_cfg" ]; then
+               echo "fxotune: span $spanno <$basechan-$endchan> ($DEVPATH)"
+               fxotune -s -b "$basechan" -e "$endchan"
+       fi
 
        # Add to asterisk
        asterisk -rx "dahdi create channels $basechan $endchan"