From 4c1e3e045fa0cb6908221cec3d46038a69397ea4 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Wed, 18 Aug 2010 14:27:20 +0000 Subject: live_dahdi: allow testing dynamic local spans Adds support for configuring dynamic spans through live_dahdi. To enable, set in live/live.conf: DYNAMIC_LOC="yes" It will generate an extra live/etc/dahdi/dynamic.conf (if one does not exist) and use it to configure extra dynamic spans in the system. Note that ATM this will make the system hang pretty easily at 'load' time. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9162 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- build_tools/live_dahdi | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/build_tools/live_dahdi b/build_tools/live_dahdi index f31cb7f..e7e29ef 100755 --- a/build_tools/live_dahdi +++ b/build_tools/live_dahdi @@ -2,6 +2,7 @@ LINUX_DIR=${LINUX_DIR:=.} TOOLS_DIR=${TOOLS_DIR:=../dahdi-tools} +DYNAMIC_LOC="${DYNAMIC_LOC:-no}" DESTDIR=$PWD/live KVERS=${KVERS:-`uname -r`} XPP_SYNC=${XPP_SYNC:-auto} @@ -56,7 +57,11 @@ export ASTRIBANK_HEXLOAD # make sure Astribank initialization scripts are from our tree. xpp_ARGS="$xpp_ARGS initdir=$FIRMWARE_DIR" -dahdi_ARGS="$dahdi_ARGS initdir=$FIRMWARE_DIR" +#dahdi_ARGS="$dahdi_ARGS initdir=$FIRMWARE_DIR" + +if [ "$DYNAMIC_LOC" = 'yes' ]; then + MODULES_LOAD="$MODULES_LOAD dahdi_dynamic dahdi_dynamic_loc" +fi # the same as xpp/utils/dahdi_drivers . # With the remote mode, I can't rely on files in the source directory. @@ -157,12 +162,29 @@ unload_module() { rmmod $module } +load_dynamic() { + if [ "$DYNAMIC_LOC" != yes ]; then return; fi + + local conf_file="$DESTDIR/etc/dahdi/dynamic.conf" + if [ ! -r "$conf_file" ]; then + cat <"$conf_file" +dynamic=loc,1:0,5,0 +dynamic=loc,1:1,5,0 +EOF + fi + + dahdi_cfg -c "$conf_file" +} + genconf() { GENCONF_PARAMETERS=$DESTDIR/etc/dahdi/genconf_parameters \ DAHDI_CONF_FILE=$DESTDIR/etc/dahdi/system.conf \ DAHDI_MODS_FILE=$DESTDIR/etc/dahdi/modules \ CHAN_DAHDI_CHANNELS_FILE=$DESTDIR/etc/asterisk/dahdi-channels.conf \ dahdi_genconf + if [ "$DYNAMIC_LOC" = yes ]; then + cat "$DESTDIR/etc/dahdi/dynamic.conf" >>"$DESTDIR/etc/dahdi/system.conf" + fi dahdi_cfg -c $DESTDIR/etc/dahdi/system.conf # TODO: fxotune, hpec } @@ -207,6 +229,12 @@ config) shift cd "$TOOLS_DIR"; make config DESTDIR=$DESTDIR "$@" mkdir -p $DESTDIR/etc/asterisk + cat >"$FIRMWARE_DIR/live-init.conf" <