From 5d43e446fe362574ad89b95599411ea4f0fa3192 Mon Sep 17 00:00:00 2001 From: Tzafrir Cohen Date: Wed, 25 Jun 2008 09:16:51 +0000 Subject: * dahdi.conf -> /etc/dahdi/system.conf in the tools this time. * Kill some remaining zaptel strings. git-svn-id: http://svn.asterisk.org/svn/dahdi/tools/trunk@4460 a0bf4364-ded3-4de4-8d8a-66a801d63aff --- Makefile | 8 +++---- dahdi_monitor.c | 14 +++++------ doc/dahdi_cfg.8 | 6 ++--- xpp/genzaptelconf | 68 ++++++++++++++++++++++++++--------------------------- xpp/genzaptelconf.8 | 10 ++++---- 5 files changed, 53 insertions(+), 53 deletions(-) diff --git a/Makefile b/Makefile index 18abc6a..c4e1c1c 100644 --- a/Makefile +++ b/Makefile @@ -180,12 +180,12 @@ tonezones.txt: zonedata.c print (($$1 eq "country")? "* $$2\t":"$$2\n");' $< \ >$@ -dahdi.conf.asciidoc: dahdi.conf.sample +system.conf.asciidoc: system.conf.sample perl -n -e \ 'if (/^#($$|\s)(.*)/){ if (!$$in_doc){print "\n"}; $$in_doc=1; print "$$2\n" } else { if ($$in_doc){print "\n"}; $$in_doc=0; print " $$_" }' \ $< >$@ -README.html: README dahdi.conf.asciidoc tonezones.txt +README.html: README system.conf.asciidoc tonezones.txt $(ASCIIDOC) -n -a toc -a toclevels=3 $< kernel/xpp/README.Astribank.html: kernel/xpp/README.Astribank @@ -223,7 +223,7 @@ ifneq (,$(BINS)) # install -m 644 $(MAN_PAGES) $(DESTDIR)$(MAN_DIR)/ endif ifeq (,$(wildcard $(DESTDIR)$(CONFIG_FILE))) -# $(INSTALL) -D -m 644 dahdi.conf.sample $(DESTDIR)$(CONFIG_FILE) +# $(INSTALL) -D -m 644 system.conf.sample $(DESTDIR)$(CONFIG_FILE) endif install-libs: libs @@ -305,7 +305,7 @@ clean: rm -f core rm -f dahdi_cfg-shared fxstest rm -rf $(GROFF_HTML) - rm -rf README.html xpp/README.Astribank.html dahdi.conf.asciidoc + rm -rf README.html xpp/README.Astribank.html system.conf.asciidoc distclean: dist-clean diff --git a/dahdi_monitor.c b/dahdi_monitor.c index 3eb9511..73c922a 100644 --- a/dahdi_monitor.c +++ b/dahdi_monitor.c @@ -284,7 +284,7 @@ int main(int argc, char *argv[]) struct dahdi_confinfo zc; if ((argc < 2) || (atoi(argv[1]) < 1)) { - fprintf(stderr, "Usage: ztmonitor [-v[v]] [-m] [-o] [-p] [-l limit] [-f FILE | -s FILE | -r FILE1 -t FILE2] [-F FILE | -S FILE | -R FILE1 -T FILE2]\n"); + fprintf(stderr, "Usage: dahdi_monitor [-v[v]] [-m] [-o] [-p] [-l limit] [-f FILE | -s FILE | -r FILE1 -t FILE2] [-F FILE | -S FILE | -R FILE1 -T FILE2]\n"); fprintf(stderr, "Options:\n"); fprintf(stderr, " -v: Visual mode. Implies -m.\n"); fprintf(stderr, " -vv: Visual/Verbose mode. Implies -m.\n"); @@ -302,15 +302,15 @@ int main(int argc, char *argv[]) fprintf(stderr, " -S FILE: Save pre-echocanceled stereo rx/tx stream to FILE. Implies -p.\n"); fprintf(stderr, "Examples:\n"); fprintf(stderr, "Save a stream to a file\n"); - fprintf(stderr, " ztmonitor 1 -f stream.raw\n"); + fprintf(stderr, " dahdi_monitor 1 -f stream.raw\n"); fprintf(stderr, "Visualize an rx/tx stream and save them to separate files.\n"); - fprintf(stderr, " ztmonitor 1 -v -r streamrx.raw -t streamtx.raw\n"); + fprintf(stderr, " dahdi_monitor 1 -v -r streamrx.raw -t streamtx.raw\n"); fprintf(stderr, "Play a combined rx/tx stream via OSS and save it to a file\n"); - fprintf(stderr, " ztmonitor 1 -o -f stream.raw\n"); + fprintf(stderr, " dahdi_monitor 1 -o -f stream.raw\n"); fprintf(stderr, "Save a combined normal rx/tx stream and a combined 'preecho' rx/tx stream to files\n"); - fprintf(stderr, " ztmonitor 1 -p -f stream.raw -F streampreecho.raw\n"); + fprintf(stderr, " dahdi_monitor 1 -p -f stream.raw -F streampreecho.raw\n"); fprintf(stderr, "Save a normal rx/tx stream and a 'preecho' rx/tx stream to separate files\n"); - fprintf(stderr, " ztmonitor 1 -m -p -r streamrx.raw -t streamtx.raw -R streampreechorx.raw -T streampreechotx.raw\n"); + fprintf(stderr, " dahdi_monitor 1 -m -p -r streamrx.raw -t streamtx.raw -R streampreechorx.raw -T streampreechotx.raw\n"); exit(1); } @@ -483,7 +483,7 @@ int main(int argc, char *argv[]) if (visual) { printf("\nVisual Audio Levels.\n"); printf("--------------------\n"); - printf(" Use dahdi.conf file to adjust the gains if needed.\n\n"); + printf(" Use /etc/dahdi/system.conf file to adjust the gains if needed.\n\n"); printf("( # = Audio Level * = Max Audio Hit )\n"); draw_barheader(); } diff --git a/doc/dahdi_cfg.8 b/doc/dahdi_cfg.8 index f9b167f..18e8e58 100644 --- a/doc/dahdi_cfg.8 +++ b/doc/dahdi_cfg.8 @@ -1,7 +1,7 @@ .TH "DAHDI_CFG" "8" "16 Jun 2008" "" "" .SH NAME -dahdi_cfg \- configures dahdi kernel modules from dahdi.conf +dahdi_cfg \- configures dahdi kernel modules from /etc/dahdi/system.conf .SH SYNOPSIS .B dahdi_cfg [-c \fICFG_FILE\fB] [-s] [-f] [-t] [-v [-v ... ] ] @@ -23,7 +23,7 @@ the DAHDI init script. .B -c \fICFG_FILE .RS Use an alternative configuration file instead of -.I /etc/dahdi.conf +.I /etc/dahdi/system.conf .RE .B -s @@ -53,7 +53,7 @@ Display a brief help message. .SH FILES -.I /etc/dahdi.conf +.I /etc/dahdi/system.conf .RS The default location for the configuration file. .RE diff --git a/xpp/genzaptelconf b/xpp/genzaptelconf index 023bd73..c74e573 100755 --- a/xpp/genzaptelconf +++ b/xpp/genzaptelconf @@ -1,7 +1,7 @@ #! /bin/bash # genzaptelconf: generate as smartly as you can: -# /etc/dahdi.conf +# /etc/dahdi/system.conf # /etc/asterisk/zapata-channels.conf (to be #include-d into zapata.conf) # update: # With '-M' /etc/modules (list of modules to load) @@ -56,7 +56,7 @@ group_lines=0 # group for lines # Set fxs_immediate to 'yes' to make all FXS lines answer immediately. fxs_immediate=no -ZAPCONF_FILE=${ZAPCONF_FILE:-/etc/dahdi.conf} +ZAPCONF_FILE=${ZAPCONF_FILE:-/etc/dahdi/system.conf} ZAPCONF_FILE_SYSTEM=$ZAPCONF_FILE ZAPATA_FILE=${ZAPATA_FILE:-/etc/asterisk/zapata-channels.conf} ZAPSCAN_FILE=${ZAPSCAN_FILE:-/etc/asterisk/zapscan.conf} @@ -68,10 +68,10 @@ exten_base_dir=/etc/asterisk/extensions-phones.d exten_defs_file=/etc/asterisk/extensions-defs.conf # perl utilities: xpp_sync=/usr/sbin/xpp_sync -zt_registration=/usr/sbin/zt_registration +dahdi_registration=/usr/sbin/dahdi_registration # how long to wait for /dev/zap/ctl to appear? (seconds) DEVZAP_TIMEOUT=${DEVZAP_TIMEOUT:-20} -ZTCFG=${ZTCFG:-/sbin/ztcfg} +DAHDI_CFG=${DAHDI_CFG:-/sbin/dahdi_cfg} # BRI/PRI spans will be in an additional per-span group whose number # is SPAN_GROUP_BASE + span-number SPAN_GROUP_BASE=10 @@ -115,13 +115,13 @@ ZAPCONF_ASTERISK_CMD=$ZAPCONF_ASTERISK_SCRIPT if [ -r $ZAPTEL_BOOT_DEBIAN ]; then . $ZAPTEL_BOOT_DEBIAN; fi if [ -r $ZAPTEL_BOOT_FEDORA ]; then . $ZAPTEL_BOOT_FEDORA; fi -if [ ! -x "$ZTCFG" ]; then - # Work around a bug in the rpm package: ztcfg should be in +if [ ! -x "$DAHDI_CFG" ]; then + # Work around a bug in the rpm package: dahdi_cfg should be in # /sbin as it may be required for starting a network interface - if [ -x /usr/sbin/ztcfg ]; then - ZTCFG=/usr/sbin/ztcfg + if [ -x /usr/sbin/dahdi_cfg ]; then + DAHDI_CFG=/usr/sbin/dahdi_cfg else - echo >&2 "ztcfg is not on found, do you have dahdi properly installed?" + echo >&2 "dahdi_cfg is not on found, do you have dahdi properly installed?" exit_cleanup 1 fi fi @@ -129,7 +129,7 @@ fi XPP_SYNC=auto # sync mode. can be set to '0' or '1' or HOST explicitly. # it is safe to use -c twice: the last one will be used. -ztcfg_cmd="$ZTCFG -c $ZAPCONF_FILE" +dahdi_cfg_cmd="$DAHDI_CFG -c $ZAPCONF_FILE" # work around a bug (that was already fixed) in the installer: if [ "$lc_country" = '' ]; then lc_country=us; fi @@ -194,17 +194,17 @@ wait_for_zapctl() { done if [ "$devzap_found" != 1 ]; then say "Still no /dev/zap/ctl after $devzap_timeout seconds." - echo >&2 "No /dev/zap/ctl: cannot run ztcfg. Aborting." + echo >&2 "No /dev/zap/ctl: cannot run dahdi_cfg. Aborting." fi } -run_ztcfg() { - # Run ztcfg itself +run_dahdi_cfg() { + # Run dahdi_cfg itself if [ "$verbose" = no ]; then - $ztcfg_cmd "$@" + $dahdi_cfg_cmd "$@" else say "Reconfiguring identified channels" - $ztcfg_cmd -vv "$@" + $dahdi_cfg_cmd -vv "$@" fi } @@ -258,7 +258,7 @@ zap_reg_xpp() { # this will be the case if you set the parameter zap_autoreg=0 to # the module xpp # Append /dev/null to provide a valid file name in case of an empty pattern. - xbusses_pattern=`echo $xbusses| sed -e 's|XBUS-[0-9]*|/proc/xpp/&/XPD-*/zt_registration|g'`' /dev/null' + xbusses_pattern=`echo $xbusses| sed -e 's|XBUS-[0-9]*|/proc/xpp/&/XPD-*/dahdi_registration|g'`' /dev/null' xpds_to_register=`grep -l 0 $xbusses_pattern` for file in $xpds_to_register; do echo 1 >$file @@ -278,9 +278,9 @@ xpp_startup() { # overriding locales for the above two, as perl can be noisy # when locales are missing. # No register all the devices if they didn't auto-register: - LC_ALL=C $zt_registration on + LC_ALL=C $dahdi_registration on - # this one could actually be run after ztcfg: + # this one could actually be run after dahdi_cfg: LC_ALL=C $xpp_sync "$XPP_SYNC" } @@ -289,7 +289,7 @@ xpp_startup() { usage() { program=`basename $0` - echo >&2 "$program: generate dahdi.conf and zapata.conf" + echo >&2 "$program: generate dahdi system.conf and zapata.conf" echo >&2 "(version $VERSION, $rcsid)" echo >&2 "usage:" echo >&2 " $program [-sRdv] [-m k|l|g] [-c ] [-e ] [-F]" @@ -301,7 +301,7 @@ usage() { echo >&2 " -c CODE: set the country code (default: $lc_country)" echo >&2 " -e NUM: set the base extension number (default: $base_exten)" echo >&2 " -F: Don't print FXSs in zapata.conf" - echo >&2 " -l: output a list of detected channels instead of dahdi.conf" + echo >&2 " -l: output a list of detected channels instead of dahdi system.conf" echo >&2 " -d: Perform hardware detection" echo >&2 " -u: Unload dahdi modules (will not restart Asterisk)." echo >&2 " -v: verbose" @@ -374,7 +374,7 @@ print_pattern() { then echo "# astbanktype: $astbank_type" >>$dahdi_file; fi echo "${sig}$method=$chan" >>$dahdi_file - # zap2amp will rewrite those from dahdi.conf and hints there + # zap2amp will rewrite those from dahdi system.conf and hints there if [ "$fxsdisable" = 'yes' ] && [ "$sig" = 'fxo' ]; then return; fi echo "signalling=${sig}_$method" >>$zapata_file @@ -575,10 +575,10 @@ detect() { } # The module configuration generated by dahdi includes a totally useless -# automatic run of ztcfg after modules loading. As a workaround for that, -# we provide an empty dahdi.conf temporarily. +# automatic run of dahdi_cfg after modules loading. As a workaround for that, +# we provide an empty dahdi system.conf temporarily. # -# At hardware detection time we shouldn't really touch dahdi.conf . So we +# At hardware detection time we shouldn't really touch dahdi system.conf . So we # must keep a copy of it somewhere. # # I use ZAPCONF_FILE_SYSTEM rather than ZAPCONF_FILE, as the bogus modprobe @@ -590,15 +590,15 @@ ZAPCONF_FILE_TMP= temporary_zapconf() { case "$1" in save) - say "Temporarily moving dahdi.conf aside to work around broken modprobe.conf" - ZAPCONF_FILE_TMP=`mktemp /tmp/genzaptelconf-dahdi.conf-XXXXXX` || die "Error creating temporary dahdi.conf" + say "Temporarily moving dahdi system.conf aside to work around broken modprobe.conf" + ZAPCONF_FILE_TMP=`mktemp /tmp/genzaptelconf-dahdi-system.conf-XXXXXX` || die "Error creating temporary dahdi system.conf" if [ -f $ZAPCONF_FILE_SYSTEM ]; then cp -a $ZAPCONF_FILE_SYSTEM $ZAPCONF_FILE_TMP fi echo -n >$ZAPCONF_FILE_SYSTEM ;; restore) - # restore original dahdi.conf: + # restore original dahdi system.conf: if [ "$ZAPCONF_FILE_TMP" = '' ]; then return; fi mv $ZAPCONF_FILE_TMP $ZAPCONF_FILE_SYSTEM ZAPCONF_FILE_TMP='' @@ -787,7 +787,7 @@ write_digital_config() { case "$mode" in files) echo span=$span_num,$span_timing,$span_lbo,$span_framing,$span_coding$span_yellow >> $dahdi_file - # leave a comment in dahdi.conf that allows to tell if + # leave a comment in dahdi system.conf that allows to tell if # this span is TE or NT: if [ "$span_termtype" != '' ] then echo "# termtype: $span_termtype" >>$dahdi_file @@ -885,7 +885,7 @@ EOF # Autogenerated by $0 -- do not hand edit # Dahdi Configuration File # -# This file is parsed by the Dahdi Configurator, ztcfg +# This file is parsed by the Dahdi Configurator, dahdi_cfg # # It must be in the module loading order @@ -904,7 +904,7 @@ EOF # For each line in the spanlist: see if it represents a channel. # if it does, test that the channel is usable. - # we do that by configuring it (using ztcfg with a 1-line config file) + # we do that by configuring it (using dahdi_cfg with a 1-line config file) # and then trying to read 1 byte from the device file. # # The '<(command)' syntax creates a temporary file whose content is is the @@ -913,7 +913,7 @@ EOF # Another problem with such an approach is how to include an existing # configuration file. For instance: how to include some default settings. # - # Maybe an 'include' directive should be added to dahdi.conf ? + # Maybe an 'include' directive should be added to dahdi system.conf ? #cat $spanlist | for procfile in $spanlist do @@ -965,8 +965,8 @@ EOF # this can be either FXS or FXO maybe_fxs=0 maybe_fxo=0 - $ztcfg_cmd -c <(echo fxoks=$chan_num) &>/dev/null && maybe_fxs=1 - $ztcfg_cmd -c <(echo fxsks=$chan_num) &>/dev/null && maybe_fxo=1 + $dahdi_cfg_cmd -c <(echo fxoks=$chan_num) &>/dev/null && maybe_fxs=1 + $dahdi_cfg_cmd -c <(echo fxsks=$chan_num) &>/dev/null && maybe_fxo=1 if [ $maybe_fxs = 1 ] && [ $maybe_fxo = 1 ] then # An installed module won't accept both FXS and FXO signalling types: @@ -1164,7 +1164,7 @@ else wait_for_zapctl say "Generating '${ZAPCONF_FILE} and ${ZAPATA_FILE}'" genconf files - run_ztcfg + run_dahdi_cfg fi if [ "$tmp_dir" != '' ] diff --git a/xpp/genzaptelconf.8 b/xpp/genzaptelconf.8 index 0725b6a..60568d2 100644 --- a/xpp/genzaptelconf.8 +++ b/xpp/genzaptelconf.8 @@ -20,7 +20,7 @@ .B genzaptelconf is a script to detect dahdi devices (currently mostly TDM cards are supported). It generates both -.I /etc/dahdi.conf +.I /etc/dahdi/system.conf and .I /etc/asterisk/zapata-channels.conf @@ -36,7 +36,7 @@ configiration is a default that I only hope is sane. Looking for feedback .RS A two-letter country code. Sets the country-code for the zonezone entries in -.I dahdi.conf +.I system.conf , The default is the value of .I lc_country from @@ -205,7 +205,7 @@ is the same for both. .I ZAPCONF_FILE .RS -ztcfg's configuration file. The sane default is /etc/dahdi.conf . +ztcfg's configuration file. The sane default is /etc/dahdi/system.conf . .RE .I ZAPATA_FILE @@ -246,14 +246,14 @@ as a last resort. .RE .SH FILES -.I /etc/dahdi.conf +.I /etc/dahdi/system.conf .RS The configuration file used by .I ztcfg to configure dahdi devices. re-written by .I genzaptelconf . A backup copy is saved to -.I /etc/dahdi.conf.bak +.I /etc/dahdi/system.conf.bak . .RE -- cgit v1.2.3