diff options
-rw-r--r-- | Makefile | 391 | ||||
-rwxr-xr-x | build_tools/make_version_h | 2 | ||||
-rw-r--r-- | dahdi_cfg.c | 372 | ||||
-rw-r--r-- | dahdi_cfg.h | 27 | ||||
-rw-r--r-- | dahdi_diag.c | 10 | ||||
-rw-r--r-- | dahdi_monitor.c | 43 | ||||
-rw-r--r-- | dahdi_scan.c | 68 | ||||
-rw-r--r-- | dahdi_tool.c | 80 | ||||
-rw-r--r-- | fxotune.c | 83 | ||||
-rw-r--r-- | fxstest.c | 25 | ||||
-rw-r--r-- | hdlcstress.c | 24 | ||||
-rw-r--r-- | hdlctest.c | 26 | ||||
-rw-r--r-- | patgen.c | 28 | ||||
-rw-r--r-- | patlooptest.c | 20 | ||||
-rw-r--r-- | pattest.c | 28 | ||||
-rw-r--r-- | sethdlc.c | 5 | ||||
-rw-r--r-- | timertest.c | 10 | ||||
-rw-r--r-- | tonezone.c | 190 | ||||
-rw-r--r-- | tonezone.h | 10 | ||||
-rw-r--r-- | zonedata.c | 738 |
20 files changed, 904 insertions, 1276 deletions
@@ -1,84 +1,11 @@ # -# Makefile for Zaptel driver modules and utilities +# Makefile for DAHDI tools # -# Copyright (C) 2001-2007 Digium, Inc. +# Copyright (C) 2001-2008 Digium, Inc. # # -ifneq ($(KBUILD_EXTMOD),) -# We only get in here if we're from kernel 2.6 <= 2.6.9 and going through -# Kbuild. Later versions will include Kbuild instead of Makefile. -include $(src)/Kbuild - -else - -CFLAGS+=-DSTANDALONE_ZAPATA -DBUILDING_TONEZONE - -ifeq ($(MAKELEVEL),0) -PWD:=$(shell pwd) -endif - -ifeq ($(ARCH),) -ARCH:=$(shell uname -m | sed -e s/i.86/i386/) -endif - -ifeq ($(DEB_HOST_GNU_TYPE),) -UNAME_M:=$(shell uname -m) -else -UNAME_M:=$(DEB_HOST_GNU_TYPE) -endif - -# If you want to build for a kernel other than the current kernel, set KVERS -ifndef KVERS -KVERS:=$(shell uname -r) -endif -ifndef KSRC - ifneq (,$(wildcard /lib/modules/$(KVERS)/build)) - KSRC:=/lib/modules/$(KVERS)/build - else - KSRC_SEARCH_PATH:=/usr/src/linux-2.4 /usr/src/linux - KSRC:=$(shell for dir in $(KSRC_SEARCH_PATH); do if [ -d $$dir ]; then echo $$dir; break; fi; done) - endif -endif -KVERS_MAJ:=$(shell echo $(KVERS) | cut -d. -f1-2) -KINCLUDES:=$(KSRC)/include - -# We use the kernel's .config file as an indication that the KSRC -# directory is indeed a valid and configured kernel source (or partial -# source) directory. -# -# We also source it, as it has the format of Makefile variables list. -# Thus we will have many CONFIG_* variables from there. -KCONFIG:=$(KSRC)/.config -ifneq (,$(wildcard $(KCONFIG))) - HAS_KSRC=yes - include $(KCONFIG) -else - HAS_KSRC=no -endif - -ifeq ($(KVERS_MAJ),2.4) - BUILDVER:=linux24 -else - BUILDVER:=linux26 -endif - -# Set HOTPLUG_FIRMWARE=no to override automatic building with hotplug support -# if it is enabled in the kernel. -ifeq ($(BUILDVER),linux26) - ifneq (,$(wildcard $(DESTDIR)/etc/udev/rules.d)) - DYNFS=yes - UDEVRULES=yes - endif - ifeq (yes,$(HAS_KSRC)) - HOTPLUG_FIRMWARE:=$(shell if grep -q '^CONFIG_FW_LOADER=[ym]' $(KCONFIG); then echo "yes"; else echo "no"; fi) - endif -endif - -ifneq (,$(findstring $(CONFIG_DEVFS_FS),y m)) - DYNFS=yes - HAS_DEVFS=yes -endif +CFLAGS+=-DBUILDING_TONEZONE # If the file .zaptel.makeopts is present in your home directory, you can # include all of your favorite menuselect options so that every time you download @@ -101,57 +28,8 @@ ifeq ($(strip $(foreach var,clean distclean dist-clean update,$(findstring $(var endif endif -ifeq ($(BUILDVER),linux24) -MENUSELECT_MODULES+=xpp wctc4xxp wctdm24xxp zttranscode -endif - -ifeq ($(findstring xpp,$(MENUSELECT_MODULES)),) - BUILD_XPP:=yes -endif - -SUBDIRS_UTILS_ALL:= kernel/xpp/utils ppp -SUBDIRS_UTILS := -ifeq ($(BUILD_XPP),yes) - SUBDIRS_UTILS += kernel/xpp/utils -endif -#SUBDIRS_UTILS += ppp - -TOPDIR_MODULES:=pciradio tor2 torisa wcfxo wct1xxp wctdm wcte11xp wcusb zaptel ztd-eth ztd-loc ztdummy ztdynamic zttranscode -SUBDIR_MODULES:=wct4xxp wctc4xxp xpp wctdm24xxp wcte12xp -TOPDIR_MODULES+=$(MODULES_EXTRA) -SUBDIR_MODULES+=$(SUBDIRS_EXTRA) -BUILD_TOPDIR_MODULES:=$(filter-out $(MENUSELECT_MODULES),$(TOPDIR_MODULES)) -BUILD_SUBDIR_MODULES:=$(filter-out $(MENUSELECT_MODULES),$(SUBDIR_MODULES)) -BUILD_MODULES:=$(BUILD_TOPDIR_MODULES) $(BUILD_SUBDIR_MODULES) - -MOD_DESTDIR:=zaptel - -KERN_DIR:=kernel - -#NOTE NOTE NOTE -# -# all variables set before the include of Makefile.kernel26 are needed by the 2.6 kernel module build process - -ifneq ($(KBUILD_EXTMOD),) - -obj-m:=$(BUILD_TOPDIR_MODULES:%=%.o) -obj-m+=$(BUILD_SUBDIR_MODULES:%=%/) - -include $(src)/Makefile.kernel26 - -else -KBUILD_OBJ_M=$(BUILD_TOPDIR_MODULES:%=%.o) $(BUILD_SUBDIR_MODULES:%=%/) - -ifeq ($(BUILDVER),linux24) - INSTALL_MODULES:=$(BUILD_TOPDIR_MODULES:%=$(KERN_DIR)/%.o) - INSTALL_MODULES+=$(foreach mod,$(BUILD_SUBDIR_MODULES),$(KERN_DIR)/$(mod)/$(mod).o) - ALL_MODULES:=$(TOPDIR_MODULES:%=$(KERN_DIR)/%.o) - ALL_MODULES+=$(SUBDIR_MODULES:%=$(KERN_DIR)/%/%.o) -else - ALL_MODULES:=$(TOPDIR_MODULES:%=%.ko) - ALL_MODULES+=$(foreach mod,$(filter-out xpp,$(SUBDIR_MODULES)),$(mod)/$(mod).ko) - ALL_MODULES+=$(patsubst %,xpp/%.ko,xpp_usb xpd_fxo xpd_fxs xpp) -endif +SUBDIRS_UTILS_ALL:= ppp +SUBDIRS_UTILS := OPTFLAG=-O2 CFLAGS+=-I. $(OPTFLAGS) -g -fPIC -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER @@ -162,66 +40,28 @@ ifneq (,$(findstring x86_64,$(UNAME_M))) CFLAGS_x86_64:=-m64 endif CFLAGS+=$(CFLAGS_PPC) $(CFLAGS_x86_64) -KFLAGS=-I$(KINCLUDES) -O6 -KFLAGS+=-DMODULE -D__KERNEL__ -DEXPORT_SYMTAB -I$(KSRC)/drivers/net \ - -Wall -I. -Wstrict-prototypes -fomit-frame-pointer -I$(KSRC)/drivers/net/wan -I$(KINCLUDES)/net -ifneq (,$(wildcard $(KINCLUDES)/linux/modversions.h)) - KFLAGS+=-DMODVERSIONS -include $(KINCLUDES)/linux/modversions.h -endif -ifneq (,$(findstring ppc,$(UNAME_M))) -KFLAGS_PPC:=-msoft-float -fsigned-char -endif -KFLAGS+=$(KFLAGS_PPC) -ifeq ($(KVERS_MAJ),2.4) - ifneq (,$(findstring x86_64,$(UNAME_M))) - KFLAGS+=-mcmodel=kernel - endif -endif - -# -# Features are now configured in zconfig.h -# - -MODULE_ALIASES=wcfxs wctdm8xxp wct2xxp - -KFLAGS+=-DSTANDALONE_ZAPATA -CFLAGS+=-DSTANDALONE_ZAPATA -ifeq ($(BUILDVER),linux24) -KMAKE = $(MAKE) -C kernel HOTPLUG_FIRMWARE=no \ - HOSTCC=$(HOSTCC) ARCH=$(ARCH) KSRC=$(KSRC) LD=$(LD) CC=$(CC) \ - UNAME_M=$(UNAME_M) \ - BUILD_TOPDIR_MODULES="$(BUILD_TOPDIR_MODULES)" BUILD_SUBDIR_MODULES="$(BUILD_SUBDIR_MODULES)" -else -KMAKE = $(MAKE) -C $(KSRC) ARCH=$(ARCH) SUBDIRS=$(PWD)/kernel \ - HOTPLUG_FIRMWARE=$(HOTPLUG_FIRMWARE) KBUILD_OBJ_M="$(KBUILD_OBJ_M)" -endif -KMAKE_INST = $(KMAKE) \ - INSTALL_MOD_PATH=$(DESTDIR) INSTALL_MOD_DIR=misc modules_install ROOT_PREFIX= -CONFIG_FILE=/etc/zaptel.conf -CFLAGS+=-DZAPTEL_CONFIG=\"$(CONFIG_FILE)\" - -# sample makefile "trace print" -#tracedummy=$(shell echo ====== GOT HERE ===== >&2; echo >&2) +CONFIG_FILE=/etc/dahdi.conf +CFLAGS+=-DDAHDI_CONFIG=\"$(CONFIG_FILE)\" CHKCONFIG := $(wildcard /sbin/chkconfig) UPDATE_RCD := $(wildcard /usr/sbin/update-rc.d) ifeq (,$(DESTDIR)) ifneq (,$(CHKCONFIG)) - ADD_INITD := $(CHKCONFIG) --add zaptel + ADD_INITD := $(CHKCONFIG) --add dahdi else ifndef (,$(UPDATE_RCD)) - ADD_INITD := $(UPDATE_RCD) zaptel defaults 15 30 + ADD_INITD := $(UPDATE_RCD) dahdi defaults 15 30 endif endif endif INITRD_DIR := $(firstword $(wildcard /etc/rc.d/init.d /etc/init.d)) ifneq (,$(INITRD_DIR)) - INIT_TARGET := $(DESTDIR)$(INITRD_DIR)/zaptel - COPY_INITD := install -D zaptel.init $(INIT_TARGET) + INIT_TARGET := $(DESTDIR)$(INITRD_DIR)/dahdi + COPY_INITD := install -D dahdi.init $(INIT_TARGET) endif RCCONF_DIR := $(firstword $(wildcard /etc/sysconfig /etc/default)) @@ -232,10 +72,10 @@ ifneq (,$(NETSCR_DIR)) endif ifneq ($(wildcard .version),) - ZAPTELVERSION:=$(shell cat .version) + TOOLSVERSION:=$(shell cat .version) else ifneq ($(wildcard .svn),) - ZAPTELVERSION=SVN-$(shell build_tools/make_svn_branch_name) + TOOLSVERSION=SVN-$(shell build_tools/make_svn_branch_name) endif endif @@ -252,18 +92,11 @@ LTZ_SO_MINOR_VER:=0 # for historical reasons. BIN_DIR:=/sbin LIB_DIR:=$(libdir) -INC_DIR:=$(includedir)/zaptel MAN_DIR:=$(mandir)/man8 -MOD_DIR:=$(DESTDIR)/lib/modules/$(KVERS)/misc # Utilities we build with a standard build procedure: -UTILS = zttool zttest ztmonitor ztspeed sethdlc-new ztcfg \ - ztcfg-dude usbfxstest fxstest fxotune ztdiag torisatool \ - ztscan - - -# Makefile mentions them. Source is not included (anynore?) -UTILS += fxsdump ztprovision +UTILS = dahdi_tool dahdi_test dahdi_monitor dahdi_speed sethdlc dahdi_cfg \ + fxstest fxotune dahdi_diag dahdi_scan # some tests: UTILS += patgen pattest patlooptest hdlcstress hdlctest hdlcgen \ @@ -271,10 +104,7 @@ UTILS += patgen pattest patlooptest hdlcstress hdlctest hdlcgen \ UTILSO = $(UTILS:%=%.o) -BINS:=fxotune fxstest sethdlc-new ztcfg ztdiag ztmonitor ztspeed zttest ztscan -ifeq (1,$(PBX_LIBNEWT)) - BINS+=zttool -endif +BINS:=fxotune fxstest sethdlc dahdi_cfg dahdi_diag dahdi_monitor dahdi_speed dahdi_test dahdi_scan BINS:=$(filter-out $(MENUSELECT_UTILS),$(BINS)) MAN_PAGES:=$(wildcard $(BINS:%=doc/%.8)) @@ -285,7 +115,7 @@ GROFF_HTML := $(GROFF_PAGES:%=%.html) all: menuselect.makeopts @$(MAKE) _all -_all: $(if $(BUILD_MODULES),modules) programs +_all: programs libs: $(LTZ_SO) $(LTZ_A) @@ -298,15 +128,8 @@ programs: libs utils utils: $(BINS) utils-subdirs -modules: prereq -ifeq (no,$(HAS_KSRC)) - echo "You do not appear to have the sources for the $(KVERS) kernel installed." - exit 1 -endif - $(KMAKE) modules - version.h: - @ZAPTELVERSION="${ZAPTELVERSION}" build_tools/make_version_h > $@.tmp + @TOOLSVERSION="${TOOLSVERSION}" build_tools/make_version_h > $@.tmp @if cmp -s $@.tmp $@ ; then :; else \ mv $@.tmp $@ ; \ fi @@ -319,26 +142,17 @@ zonedata.o: tonezone.h zonedata.lo: zonedata.c tonezone.h $(CC) -c $(CFLAGS) -o $@ $< -tonezone.o: kernel/zaptel.h tonezone.h +tonezone.o: tonezone.h -tonezone.lo: tonezone.c tonezone.h kernel/zaptel.h +tonezone.lo: tonezone.c tonezone.h $(CC) -c $(CFLAGS) -o $@ $< prereq: config.status version.h -zttool.o: kernel/zaptel.h -zttool.o: CFLAGS+=$(NEWT_INCLUDE) -zttool: LDLIBS+=$(NEWT_LIB) - -ztscan.o: kernel/zaptel.h - -ztprovision.o: kernel/zaptel.h - -ztmonitor.o: kernel/zaptel.h +dahdi_tool.o: CFLAGS+=$(NEWT_INCLUDE) +dahdi_tool: LDLIBS+=$(NEWT_LIB) -ztspeed: CFLAGS= - -sethdlc-new: CFLAGS+=-I$(KINCLUDES) +dahdi_speed: CFLAGS= $(LTZ_A): $(LTZ_A_OBJS) ar rcs $@ $^ @@ -347,44 +161,31 @@ $(LTZ_A): $(LTZ_A_OBJS) $(LTZ_SO): $(LTZ_SO_OBJS) $(CC) $(CFLAGS) -shared -Wl,-soname,$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) -o $@ $^ $(LDFLAGS) $(LDLIBS) -lm -ztcfg.o: ztcfg.h kernel/zaptel.h -ztcfg: ztcfg.o $(LTZ_A) -ztcfg: LDLIBS+=-lm +dahdi_cfg: dahdi_cfg.o $(LTZ_A) +dahdi_cfg: LDLIBS+=-lm -ztcfg-shared: ztcfg.o $(LTZ_SO) +dahdi_cfg-shared: dahdi_cfg.o $(LTZ_SO) $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) -lm -ztcfg-dude: ztcfg-dude.o mknotch.o complex.o $(LTZ_SO) -ztcfg-dude: LDLIBS+=-lm -lstdc++ - -data: - $(MAKE) -C datamods datamods - # FIXME: we assume CC can build the C++ modules: complex.o mknotch.o: %.o: %.cc $(CC) $(CFLAGS) -o $@ -c $< -usbfxstest: LDLIBS+=-lzap fxstest: $(LTZ_SO) fxstest: LDLIBS+=-lm fxotune: LDLIBS+=-lm -fxsdump: LDLIBS+=-lm - -stackcheck: checkstack modules - ./checkstack kernel/*.ko kernel/*/*.ko - tonezones.txt: zonedata.c perl -ne 'next unless (/\.(country|description) = *"([^"]*)/); \ print (($$1 eq "country")? "* $$2\t":"$$2\n");' $< \ >$@ -zaptel.conf.asciidoc: zaptel.conf.sample +dahdi.conf.asciidoc: dahdi.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 zaptel.conf.asciidoc tonezones.txt +README.html: README dahdi.conf.asciidoc tonezones.txt $(ASCIIDOC) -n -a toc -a toclevels=3 $< kernel/xpp/README.Astribank.html: kernel/xpp/README.Astribank @@ -396,39 +197,16 @@ kernel/xpp/README.Astribank.html: kernel/xpp/README.Astribank htmlman: $(GROFF_HTML) - -MISDNVERSION=1_1_7_2 -MISDNUSERVERSION=1_1_7_2 -b410p: - @if test "$(DOWNLOAD)" = ":" ; then \ - echo "**************************************************"; \ - echo "*** ***"; \ - echo "*** You must have either wget or fetch to be ***"; \ - echo "*** able to automatically download and install ***"; \ - echo "*** b410p support. ***"; \ - echo "*** ***"; \ - echo "*** Please install one of these. ***"; \ - echo "*** ***"; \ - echo "**************************************************"; \ - exit 1; \ - fi - [ -f mISDN-$(MISDNVERSION).tar.gz ] || $(DOWNLOAD) http://downloads.digium.com/pub/zaptel/b410p/mISDN-$(MISDNVERSION).tar.gz - tar -zxf mISDN-$(MISDNVERSION).tar.gz - $(MAKE) -C mISDN-$(MISDNVERSION) install - [ -f mISDNuser-$(MISDNUSERVERSION).tar.gz ] || $(DOWNLOAD) http://downloads.digium.com/pub/zaptel/b410p/mISDNuser-$(MISDNUSERVERSION).tar.gz - tar -zxf mISDNuser-$(MISDNUSERVERSION).tar.gz - $(MAKE) -C mISDNuser-$(MISDNUSERVERSION) install - $(UTILS): %: %.o $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(LDLIBS) $(UTILSO): %.o: %.c $(CC) $(CFLAGS) -o $@ -c $< -install: all devices install-modules install-programs install-firmware +install: all install-programs @echo "###################################################" @echo "###" - @echo "### Zaptel installed successfully." + @echo "### DAHDI tools installed successfully." @echo "### If you have not done so before, install init scripts with:" @echo "###" @echo "### make config" @@ -445,19 +223,7 @@ ifneq (,$(BINS)) install -m 644 $(MAN_PAGES) $(DESTDIR)$(MAN_DIR)/ endif ifeq (,$(wildcard $(DESTDIR)$(CONFIG_FILE))) - $(INSTALL) -D -m 644 zaptel.conf.sample $(DESTDIR)$(CONFIG_FILE) -endif - -# Pushing those two to a separate target that is not used by default: -install-modconf: - build_tools/genmodconf $(BUILDVER) "$(ROOT_PREFIX)" "$(filter-out zaptel ztdummy xpp zttranscode ztdynamic,$(BUILD_MODULES)) $(MODULE_ALIASES)" - @if [ -d /etc/modutils ]; then \ - /sbin/update-modules ; \ - fi - -install-firmware: -ifeq ($(HOTPLUG_FIRMWARE),yes) - $(MAKE) -C firmware hotplug-install DESTDIR=$(DESTDIR) HOTPLUG_FIRMWARE=$(HOTPLUG_FIRMWARE) + $(INSTALL) -D -m 644 dahdi.conf.sample $(DESTDIR)$(CONFIG_FILE) endif install-libs: libs @@ -485,68 +251,13 @@ install-utils-subdirs: $(MAKE) -C $$dir install; \ done -install-include: - $(INSTALL) -D -m 644 kernel/zaptel.h $(DESTDIR)$(INC_DIR)/zaptel.h - -devices: -ifneq (yes,$(DYNFS)) - mkdir -p $(DESTDIR)/dev/zap - rm -f $(DESTDIR)/dev/zap/ctl - rm -f $(DESTDIR)/dev/zap/channel - rm -f $(DESTDIR)/dev/zap/pseudo - rm -f $(DESTDIR)/dev/zap/timer - rm -f $(DESTDIR)/dev/zap/transcode - rm -f $(DESTDIR)/dev/zap/253 - rm -f $(DESTDIR)/dev/zap/252 - rm -f $(DESTDIR)/dev/zap/251 - rm -f $(DESTDIR)/dev/zap/250 - mknod $(DESTDIR)/dev/zap/ctl c 196 0 - mknod $(DESTDIR)/dev/zap/transcode c 196 250 - mknod $(DESTDIR)/dev/zap/timer c 196 253 - mknod $(DESTDIR)/dev/zap/channel c 196 254 - mknod $(DESTDIR)/dev/zap/pseudo c 196 255 - N=1; \ - while [ $$N -lt 250 ]; do \ - rm -f $(DESTDIR)/dev/zap/$$N; \ - mknod $(DESTDIR)/dev/zap/$$N c 196 $$N; \ - N=$$[$$N+1]; \ - done -else # DYNFS - ifneq (yes,$(UDEVRULES)) #!UDEVRULES - @echo "**** Dynamic filesystem detected -- not creating device nodes" - else # UDEVRULES - install -d $(DESTDIR)/etc/udev/rules.d - build_tools/genudevrules > $(DESTDIR)/etc/udev/rules.d/zaptel.rules - endif -endif - -install-udev: devices - -uninstall-hotplug: - $(MAKE) -C firmware hotplug-uninstall DESTDIR=$(DESTDIR) - -uninstall-modules: -ifneq ($(BUILDVER),linux24) - @./build_tools/uninstall-modules $(DESTDIR)/lib/modules/$(KVERS) $(ALL_MODULES) -endif - -ifeq ($(BUILDVER),linux24) -install-modules: $(INSTALL_MODULES) uninstall-modules - $(INSTALL) -d $(DESTDIR)$(MOD_DIR) - $(INSTALL) -m 644 $(INSTALL_MODULES) $(DESTDIR)$(MOD_DIR) -else -install-modules: uninstall-modules - $(KMAKE_INST) -endif - [ `id -u` = 0 ] && /sbin/depmod -a $(KVERS) || : - config: ifneq (,$(COPY_INITD)) $(COPY_INITD) endif ifneq (,$(RCCONF_DIR)) - ifeq (,$(wildcard $(DESTDIR)$(RCCONF_DIR)/zaptel)) - $(INSTALL) -D -m 644 zaptel.sysconfig $(DESTDIR)$(RCCONF_DIR)/zaptel + ifeq (,$(wildcard $(DESTDIR)$(RCCONF_DIR)/dahdi)) + $(INSTALL) -D -m 644 dahdi.sysconfig $(DESTDIR)$(RCCONF_DIR)/dahdi endif endif ifneq (,$(COPY_NETSCR)) @@ -555,15 +266,14 @@ endif ifneq (,$(ADD_INITD)) $(ADD_INITD) endif - @echo "Zaptel has been configured." + @echo "DAHDI has been configured." @echo "" - @echo "If you have any zaptel hardware it is now recommended to " - @echo "edit /etc/default/zaptel or /etc/sysconfig/zaptel and set there an " + @echo "If you have any DAHDI hardware it is now recommended to " + @echo "edit /etc/default/dahdi or /etc/sysconfig/dahdi and set there an " @echo "optimal value for the variable MODULES ." @echo "" - @echo "I think that the zaptel hardware you have on your system is:" - @kernel/xpp/utils/zaptel_hardware || true - + @echo "I think that the DAHDI hardware you have on your system is:" + @kernel/xpp/utils/dahdi_hardware || true update: @if [ -d .svn ]; then \ @@ -581,35 +291,23 @@ update: clean: -@$(MAKE) -C menuselect clean - rm -f torisatool rm -f $(BINS) - rm -f *.o ztcfg tzdriver sethdlc sethdlc-new + rm -f *.o dahdi_cfg tzdriver sethdlc rm -f $(LTZ_SO) $(LTZ_A) *.lo -ifeq (yes,$(HAS_KSRC)) - $(KMAKE) clean -else - rm -f kernel/*.o kernel/*.ko kernel/*/*.o kernel/*/*.ko -endif @for dir in $(SUBDIRS_UTILS_ALL); do \ $(MAKE) -C $$dir clean; \ done - $(MAKE) -C firmware clean - rm -rf .tmp_versions - rm -f gendigits tones.h rm -f libtonezone* rm -f fxotune rm -f core - rm -f ztcfg-shared fxstest - rm -rf misdn* - rm -rf mISDNuser* + rm -f dahdi_cfg-shared fxstest rm -rf $(GROFF_HTML) - rm -rf README.html xpp/README.Astribank.html zaptel.conf.asciidoc + rm -rf README.html xpp/README.Astribank.html dahdi.conf.asciidoc distclean: dist-clean dist-clean: clean @$(MAKE) -C menuselect dist-clean - @$(MAKE) -C firmware dist-clean rm -f makeopts menuselect.makeopts menuselect-tree rm -f config.log config.status @@ -636,9 +334,4 @@ menuselect-tree: dahdi.xml @echo "Generating input for menuselect ..." @build_tools/make_tree > $@ -.PHONY: menuselect distclean dist-clean clean version.h all _all install b410p devices programs modules tests devel data stackcheck install-udev config update install-programs install-modules install-include install-libs install-utils-subdirs utils-subdirs uninstall-modules - -endif - -#end of: ifneq ($(KBUILD_EXTMOD),) -endif +.PHONY: menuselect distclean dist-clean clean version.h all _all install programs tests devel data config update install-programs install-libs install-utils-subdirs utils-subdirs diff --git a/build_tools/make_version_h b/build_tools/make_version_h index 01d9c31..772c8cf 100755 --- a/build_tools/make_version_h +++ b/build_tools/make_version_h @@ -4,6 +4,6 @@ cat << END * version.h * Automatically generated */ -#define ZAPTEL_VERSION "${ZAPTELVERSION}" +#define TOOLS_VERSION "${TOOLSVERSION}" END diff --git a/dahdi_cfg.c b/dahdi_cfg.c index a880f3e..ec7299d 100644 --- a/dahdi_cfg.c +++ b/dahdi_cfg.c @@ -37,16 +37,14 @@ #include <sys/ioctl.h> #include <fcntl.h> #include <errno.h> -#ifdef STANDALONE_ZAPATA -#include "kernel/zaptel.h" + +#include <dahdi/user.h> #include "tonezone.h" -#else -#include <zaptel/zaptel.h> -#include <zaptel/tonezone.h> -#endif -#include "ztcfg.h" -#define NUM_SPANS ZT_MAX_SPANS +#define CONFIG_FILENAME DAHDI_CONFIG +#define MASTER_DEVICE "/dev/dahdi/ctl" + +#define NUM_SPANS DAHDI_MAX_SPANS #define NUM_TONES 15 @@ -76,15 +74,15 @@ static int errcnt = 0; static int deftonezone = -1; -static struct zt_lineconfig lc[ZT_MAX_SPANS]; +static struct dahdi_lineconfig lc[DAHDI_MAX_SPANS]; -static struct zt_chanconfig cc[ZT_MAX_CHANNELS]; +static struct dahdi_chanconfig cc[DAHDI_MAX_CHANNELS]; -static struct zt_dynamic_span zds[NUM_DYNAMIC]; +static struct dahdi_dynamic_span zds[NUM_DYNAMIC]; -static const char *sig[ZT_MAX_CHANNELS]; /* Signalling */ +static const char *sig[DAHDI_MAX_CHANNELS]; /* Signalling */ -static int slineno[ZT_MAX_CHANNELS]; /* Line number where signalling specified */ +static int slineno[DAHDI_MAX_CHANNELS]; /* Line number where signalling specified */ static int spans=0; @@ -98,7 +96,7 @@ static int stopmode = 0; static int numdynamic = 0; -static char zonestoload[ZT_TONE_ZONE_MAX][10]; +static char zonestoload[DAHDI_TONE_ZONE_MAX][10]; static int numzones = 0; @@ -126,41 +124,41 @@ static const char *sigtype_to_str(const int sig) switch (sig) { case 0: return "Unused"; - case ZT_SIG_EM: + case DAHDI_SIG_EM: return "E & M"; - case ZT_SIG_EM_E1: + case DAHDI_SIG_EM_E1: return "E & M E1"; - case ZT_SIG_FXSLS: + case DAHDI_SIG_FXSLS: return "FXS Loopstart"; - case ZT_SIG_FXSGS: + case DAHDI_SIG_FXSGS: return "FXS Groundstart"; - case ZT_SIG_FXSKS: + case DAHDI_SIG_FXSKS: return "FXS Kewlstart"; - case ZT_SIG_FXOLS: + case DAHDI_SIG_FXOLS: return "FXO Loopstart"; - case ZT_SIG_FXOGS: + case DAHDI_SIG_FXOGS: return "FXO Groundstart"; - case ZT_SIG_FXOKS: + case DAHDI_SIG_FXOKS: return "FXO Kewlstart"; - case ZT_SIG_CAS: + case DAHDI_SIG_CAS: return "CAS / User"; - case ZT_SIG_DACS: + case DAHDI_SIG_DACS: return "DACS"; - case ZT_SIG_DACS_RBS: + case DAHDI_SIG_DACS_RBS: return "DACS w/RBS"; - case ZT_SIG_CLEAR: + case DAHDI_SIG_CLEAR: return "Clear channel"; - case ZT_SIG_SLAVE: + case DAHDI_SIG_SLAVE: return "Slave channel"; - case ZT_SIG_HDLCRAW: + case DAHDI_SIG_HDLCRAW: return "Raw HDLC"; - case ZT_SIG_HDLCNET: + case DAHDI_SIG_HDLCNET: return "Network HDLC"; - case ZT_SIG_HDLCFCS: + case DAHDI_SIG_HDLCFCS: return "HDLC with FCS check"; - case ZT_SIG_HARDHDLC: + case DAHDI_SIG_HARDHDLC: return "Hardware assisted D-channel"; - case ZT_SIG_MTP2: + case DAHDI_SIG_MTP2: return "MTP2"; default: return "Unknown"; @@ -169,12 +167,12 @@ static const char *sigtype_to_str(const int sig) int ind_ioctl(int channo, int fd, int op, void *data) { -ZT_INDIRECT_DATA ind; +DAHDI_INDIRECT_DATA ind; ind.chan = channo; ind.op = op; ind.data = data; - return ioctl(fd,ZT_INDIRECT,&ind); + return ioctl(fd,DAHDI_INDIRECT,&ind); } static void clear_fields() @@ -270,8 +268,8 @@ int dspanconfig(char *keyword, char *args) } - zap_copy_string(zds[numdynamic].driver, realargs[0], sizeof(zds[numdynamic].driver)); - zap_copy_string(zds[numdynamic].addr, realargs[1], sizeof(zds[numdynamic].addr)); + dahdi_copy_string(zds[numdynamic].driver, realargs[0], sizeof(zds[numdynamic].driver)); + dahdi_copy_string(zds[numdynamic].addr, realargs[1], sizeof(zds[numdynamic].addr)); zds[numdynamic].numchans = chans; zds[numdynamic].timing = timing; @@ -310,41 +308,41 @@ int spanconfig(char *keyword, char *args) return -1; } if (!strcasecmp(realargs[3], "d4")) { - lc[spans].lineconfig |= ZT_CONFIG_D4; - lc[spans].lineconfig &= ~ZT_CONFIG_ESF; - lc[spans].lineconfig &= ~ZT_CONFIG_CCS; + lc[spans].lineconfig |= DAHDI_CONFIG_D4; + lc[spans].lineconfig &= ~DAHDI_CONFIG_ESF; + lc[spans].lineconfig &= ~DAHDI_CONFIG_CCS; } else if (!strcasecmp(realargs[3], "esf")) { - lc[spans].lineconfig |= ZT_CONFIG_ESF; - lc[spans].lineconfig &= ~ZT_CONFIG_D4; - lc[spans].lineconfig &= ~ZT_CONFIG_CCS; + lc[spans].lineconfig |= DAHDI_CONFIG_ESF; + lc[spans].lineconfig &= ~DAHDI_CONFIG_D4; + lc[spans].lineconfig &= ~DAHDI_CONFIG_CCS; } else if (!strcasecmp(realargs[3], "ccs")) { - lc[spans].lineconfig |= ZT_CONFIG_CCS; - lc[spans].lineconfig &= ~(ZT_CONFIG_ESF | ZT_CONFIG_D4); + lc[spans].lineconfig |= DAHDI_CONFIG_CCS; + lc[spans].lineconfig &= ~(DAHDI_CONFIG_ESF | DAHDI_CONFIG_D4); } else if (!strcasecmp(realargs[3], "cas")) { - lc[spans].lineconfig &= ~ZT_CONFIG_CCS; - lc[spans].lineconfig &= ~(ZT_CONFIG_ESF | ZT_CONFIG_D4); + lc[spans].lineconfig &= ~DAHDI_CONFIG_CCS; + lc[spans].lineconfig &= ~(DAHDI_CONFIG_ESF | DAHDI_CONFIG_D4); } else { error("Framing(T1)/Signalling(E1) must be one of 'd4', 'esf', 'cas' or 'ccs', not '%s'\n", realargs[3]); return -1; } if (!strcasecmp(realargs[4], "ami")) { - lc[spans].lineconfig &= ~(ZT_CONFIG_B8ZS | ZT_CONFIG_HDB3); - lc[spans].lineconfig |= ZT_CONFIG_AMI; + lc[spans].lineconfig &= ~(DAHDI_CONFIG_B8ZS | DAHDI_CONFIG_HDB3); + lc[spans].lineconfig |= DAHDI_CONFIG_AMI; } else if (!strcasecmp(realargs[4], "b8zs")) { - lc[spans].lineconfig |= ZT_CONFIG_B8ZS; - lc[spans].lineconfig &= ~(ZT_CONFIG_AMI | ZT_CONFIG_HDB3); + lc[spans].lineconfig |= DAHDI_CONFIG_B8ZS; + lc[spans].lineconfig &= ~(DAHDI_CONFIG_AMI | DAHDI_CONFIG_HDB3); } else if (!strcasecmp(realargs[4], "hdb3")) { - lc[spans].lineconfig |= ZT_CONFIG_HDB3; - lc[spans].lineconfig &= ~(ZT_CONFIG_AMI | ZT_CONFIG_B8ZS); + lc[spans].lineconfig |= DAHDI_CONFIG_HDB3; + lc[spans].lineconfig &= ~(DAHDI_CONFIG_AMI | DAHDI_CONFIG_B8ZS); } else { error("Coding must be one of 'ami', 'b8zs' or 'hdb3', not '%s'\n", realargs[4]); return -1; } if (argc > 5) { if (!strcasecmp(realargs[5], "yellow")) - lc[spans].lineconfig |= ZT_CONFIG_NOTOPEN; + lc[spans].lineconfig |= DAHDI_CONFIG_NOTOPEN; else if (!strcasecmp(realargs[5], "crc4")) { - lc[spans].lineconfig |= ZT_CONFIG_CRC4; + lc[spans].lineconfig |= DAHDI_CONFIG_CRC4; } else { error("Only valid fifth arguments are 'yellow' or 'crc4', not '%s'\n", realargs[5]); return -1; @@ -352,7 +350,7 @@ int spanconfig(char *keyword, char *args) } if (argc > 6) { if (!strcasecmp(realargs[6], "yellow")) - lc[spans].lineconfig |= ZT_CONFIG_NOTOPEN; + lc[spans].lineconfig |= DAHDI_CONFIG_NOTOPEN; else { error("Only valid sixth argument is 'yellow', not '%s'\n", realargs[6]); return -1; @@ -367,19 +365,19 @@ int spanconfig(char *keyword, char *args) int apply_channels(int chans[], char *argstr) { - char *args[ZT_MAX_CHANNELS+1]; + char *args[DAHDI_MAX_CHANNELS+1]; char *range[3]; int res,x, res2,y; int chan; int start, finish; char argcopy[256]; - res = parseargs(argstr, args, ZT_MAX_CHANNELS, ','); + res = parseargs(argstr, args, DAHDI_MAX_CHANNELS, ','); if (res < 0) - error("Too many arguments... Max is %d\n", ZT_MAX_CHANNELS); + error("Too many arguments... Max is %d\n", DAHDI_MAX_CHANNELS); for (x=0;x<res;x++) { if (strchr(args[x], '-')) { /* It's a range */ - zap_copy_string(argcopy, args[x], sizeof(argcopy)); + dahdi_copy_string(argcopy, args[x], sizeof(argcopy)); res2 = parseargs(argcopy, range, 2, '-'); if (res2 != 2) { error("Syntax error in range '%s'. Should be <val1>-<val2>.\n", args[x]); @@ -387,18 +385,18 @@ int apply_channels(int chans[], char *argstr) } res2 =sscanf(range[0], "%i", &start); if (res2 != 1) { - error("Syntax error. Start of range '%s' should be a number from 1 to %d\n", args[x], ZT_MAX_CHANNELS - 1); + error("Syntax error. Start of range '%s' should be a number from 1 to %d\n", args[x], DAHDI_MAX_CHANNELS - 1); return -1; - } else if ((start < 1) || (start >= ZT_MAX_CHANNELS)) { - error("Start of range '%s' must be between 1 and %d (not '%d')\n", args[x], ZT_MAX_CHANNELS - 1, start); + } else if ((start < 1) || (start >= DAHDI_MAX_CHANNELS)) { + error("Start of range '%s' must be between 1 and %d (not '%d')\n", args[x], DAHDI_MAX_CHANNELS - 1, start); return -1; } res2 =sscanf(range[1], "%i", &finish); if (res2 != 1) { - error("Syntax error. End of range '%s' should be a number from 1 to %d\n", args[x], ZT_MAX_CHANNELS - 1); + error("Syntax error. End of range '%s' should be a number from 1 to %d\n", args[x], DAHDI_MAX_CHANNELS - 1); return -1; - } else if ((finish < 1) || (finish >= ZT_MAX_CHANNELS)) { - error("end of range '%s' must be between 1 and %d (not '%d')\n", args[x], ZT_MAX_CHANNELS - 1, finish); + } else if ((finish < 1) || (finish >= DAHDI_MAX_CHANNELS)) { + error("end of range '%s' must be between 1 and %d (not '%d')\n", args[x], DAHDI_MAX_CHANNELS - 1, finish); return -1; } if (start > finish) { @@ -411,10 +409,10 @@ int apply_channels(int chans[], char *argstr) /* It's a single channel */ res2 =sscanf(args[x], "%i", &chan); if (res2 != 1) { - error("Syntax error. Channel should be a number from 1 to %d, not '%s'\n", ZT_MAX_CHANNELS - 1, args[x]); + error("Syntax error. Channel should be a number from 1 to %d, not '%s'\n", DAHDI_MAX_CHANNELS - 1, args[x]); return -1; - } else if ((chan < 1) || (chan >= ZT_MAX_CHANNELS)) { - error("Channel must be between 1 and %d (not '%d')\n", ZT_MAX_CHANNELS - 1, chan); + } else if ((chan < 1) || (chan >= DAHDI_MAX_CHANNELS)) { + error("Channel must be between 1 and %d (not '%d')\n", DAHDI_MAX_CHANNELS - 1, chan); return -1; } chans[chan]=1; @@ -431,13 +429,13 @@ int parse_idle(int *i, char *s) if (((a == '0') || (a == '1')) && ((b == '0') || (b == '1')) && ((c == '0') || (c == '1')) && ((d == '0') || (d == '1'))) { *i = 0; if (a == '1') - *i |= ZT_ABIT; + *i |= DAHDI_ABIT; if (b == '1') - *i |= ZT_BBIT; + *i |= DAHDI_BBIT; if (c == '1') - *i |= ZT_CBIT; + *i |= DAHDI_CBIT; if (d == '1') - *i |= ZT_DBIT; + *i |= DAHDI_DBIT; return 0; } } @@ -458,7 +456,7 @@ static int parse_channel(char *channel, int *startchan) static int chanconfig(char *keyword, char *args) { - int chans[ZT_MAX_CHANNELS]; + int chans[DAHDI_MAX_CHANNELS]; int res = 0; int x; int master=0; @@ -474,7 +472,7 @@ static int chanconfig(char *keyword, char *args) res = apply_channels(chans, args); if (res <= 0) return -1; - for (x=1;x<ZT_MAX_CHANNELS;x++) + for (x=1;x<DAHDI_MAX_CHANNELS;x++) if (chans[x]) { if (slineno[x]) { error("Channel %d already configured as '%s' at line %d\n", x, sig[x], slineno[x]); @@ -492,109 +490,109 @@ static int chanconfig(char *keyword, char *args) cc[x].master = x; slineno[x] = lineno; if (!strcasecmp(keyword, "e&m")) { - cc[x].sigtype = ZT_SIG_EM; + cc[x].sigtype = DAHDI_SIG_EM; sig[x] = sigtype_to_str(cc[x].sigtype); } else if (!strcasecmp(keyword, "e&me1")) { - cc[x].sigtype = ZT_SIG_EM_E1; + cc[x].sigtype = DAHDI_SIG_EM_E1; sig[x] = sigtype_to_str(cc[x].sigtype); } else if (!strcasecmp(keyword, "fxsls")) { - cc[x].sigtype = ZT_SIG_FXSLS; + cc[x].sigtype = DAHDI_SIG_FXSLS; sig[x] = sigtype_to_str(cc[x].sigtype); } else if (!strcasecmp(keyword, "fxsgs")) { - cc[x].sigtype = ZT_SIG_FXSGS; + cc[x].sigtype = DAHDI_SIG_FXSGS; sig[x] = sigtype_to_str(cc[x].sigtype); } else if (!strcasecmp(keyword, "fxsks")) { - cc[x].sigtype = ZT_SIG_FXSKS; + cc[x].sigtype = DAHDI_SIG_FXSKS; sig[x] = sigtype_to_str(cc[x].sigtype); } else if (!strcasecmp(keyword, "fxols")) { - cc[x].sigtype = ZT_SIG_FXOLS; + cc[x].sigtype = DAHDI_SIG_FXOLS; sig[x] = sigtype_to_str(cc[x].sigtype); } else if (!strcasecmp(keyword, "fxogs")) { - cc[x].sigtype = ZT_SIG_FXOGS; + cc[x].sigtype = DAHDI_SIG_FXOGS; sig[x] = sigtype_to_str(cc[x].sigtype); } else if (!strcasecmp(keyword, "fxoks")) { - cc[x].sigtype = ZT_SIG_FXOKS; + cc[x].sigtype = DAHDI_SIG_FXOKS; sig[x] = sigtype_to_str(cc[x].sigtype); } else if (!strcasecmp(keyword, "cas") || !strcasecmp(keyword, "user")) { if (parse_idle(&cc[x].idlebits, idle)) return -1; - cc[x].sigtype = ZT_SIG_CAS; + cc[x].sigtype = DAHDI_SIG_CAS; sig[x] = sigtype_to_str(cc[x].sigtype); } else if (!strcasecmp(keyword, "dacs")) { /* Setup channel for monitor */ cc[x].idlebits = dacschan; - cc[x].sigtype = ZT_SIG_DACS; + cc[x].sigtype = DAHDI_SIG_DACS; sig[x] = sigtype_to_str(cc[x].sigtype); /* Setup inverse */ cc[dacschan].idlebits = x; - cc[dacschan].sigtype = ZT_SIG_DACS; + cc[dacschan].sigtype = DAHDI_SIG_DACS; sig[x] = sigtype_to_str(cc[dacschan].sigtype); dacschan++; } else if (!strcasecmp(keyword, "dacsrbs")) { /* Setup channel for monitor */ cc[x].idlebits = dacschan; - cc[x].sigtype = ZT_SIG_DACS_RBS; + cc[x].sigtype = DAHDI_SIG_DACS_RBS; sig[x] = sigtype_to_str(cc[x].sigtype); /* Setup inverse */ cc[dacschan].idlebits = x; - cc[dacschan].sigtype = ZT_SIG_DACS_RBS; + cc[dacschan].sigtype = DAHDI_SIG_DACS_RBS; sig[x] = sigtype_to_str(cc[dacschan].sigtype); dacschan++; } else if (!strcasecmp(keyword, "unused")) { cc[x].sigtype = 0; sig[x] = sigtype_to_str(cc[x].sigtype); } else if (!strcasecmp(keyword, "indclear") || !strcasecmp(keyword, "bchan")) { - cc[x].sigtype = ZT_SIG_CLEAR; + cc[x].sigtype = DAHDI_SIG_CLEAR; sig[x] = sigtype_to_str(cc[x].sigtype); } else if (!strcasecmp(keyword, "clear")) { - sig[x] = sigtype_to_str(ZT_SIG_CLEAR); + sig[x] = sigtype_to_str(DAHDI_SIG_CLEAR); if (master) { - cc[x].sigtype = ZT_SIG_SLAVE; + cc[x].sigtype = DAHDI_SIG_SLAVE; cc[x].master = master; } else { - cc[x].sigtype = ZT_SIG_CLEAR; + cc[x].sigtype = DAHDI_SIG_CLEAR; master = x; } } else if (!strcasecmp(keyword, "rawhdlc")) { - sig[x] = sigtype_to_str(ZT_SIG_HDLCRAW); + sig[x] = sigtype_to_str(DAHDI_SIG_HDLCRAW); if (master) { - cc[x].sigtype = ZT_SIG_SLAVE; + cc[x].sigtype = DAHDI_SIG_SLAVE; cc[x].master = master; } else { - cc[x].sigtype = ZT_SIG_HDLCRAW; + cc[x].sigtype = DAHDI_SIG_HDLCRAW; master = x; } } else if (!strcasecmp(keyword, "nethdlc")) { - sig[x] = sigtype_to_str(ZT_SIG_HDLCNET); + sig[x] = sigtype_to_str(DAHDI_SIG_HDLCNET); memset(cc[x].netdev_name, 0, sizeof(cc[x].netdev_name)); if (master) { - cc[x].sigtype = ZT_SIG_SLAVE; + cc[x].sigtype = DAHDI_SIG_SLAVE; cc[x].master = master; } else { - cc[x].sigtype = ZT_SIG_HDLCNET; + cc[x].sigtype = DAHDI_SIG_HDLCNET; if (idle) { - zap_copy_string(cc[x].netdev_name, idle, sizeof(cc[x].netdev_name)); + dahdi_copy_string(cc[x].netdev_name, idle, sizeof(cc[x].netdev_name)); } master = x; } } else if (!strcasecmp(keyword, "fcshdlc")) { - sig[x] = sigtype_to_str(ZT_SIG_HDLCFCS); + sig[x] = sigtype_to_str(DAHDI_SIG_HDLCFCS); if (master) { - cc[x].sigtype = ZT_SIG_SLAVE; + cc[x].sigtype = DAHDI_SIG_SLAVE; cc[x].master = master; } else { - cc[x].sigtype = ZT_SIG_HDLCFCS; + cc[x].sigtype = DAHDI_SIG_HDLCFCS; master = x; } } else if (!strcasecmp(keyword, "dchan")) { sig[x] = "D-channel"; - cc[x].sigtype = ZT_SIG_HDLCFCS; + cc[x].sigtype = DAHDI_SIG_HDLCFCS; } else if (!strcasecmp(keyword, "hardhdlc")) { sig[x] = "Hardware assisted D-channel"; - cc[x].sigtype = ZT_SIG_HARDHDLC; + cc[x].sigtype = DAHDI_SIG_HARDHDLC; } else if (!strcasecmp(keyword, "mtp2")) { sig[x] = "MTP2"; - cc[x].sigtype = ZT_SIG_MTP2; + cc[x].sigtype = DAHDI_SIG_MTP2; } else { fprintf(stderr, "Huh? (%s)\n", keyword); } @@ -607,23 +605,23 @@ static int setlaw(char *keyword, char *args) int res; int law; int x; - int chans[ZT_MAX_CHANNELS]; + int chans[DAHDI_MAX_CHANNELS]; bzero(chans, sizeof(chans)); res = apply_channels(chans, args); if (res <= 0) return -1; if (!strcasecmp(keyword, "alaw")) { - law = ZT_LAW_ALAW; + law = DAHDI_LAW_ALAW; } else if (!strcasecmp(keyword, "mulaw")) { - law = ZT_LAW_MULAW; + law = DAHDI_LAW_MULAW; } else if (!strcasecmp(keyword, "deflaw")) { - law = ZT_LAW_DEFAULT; + law = DAHDI_LAW_DEFAULT; } else { fprintf(stderr, "Huh??? Don't know about '%s' law\n", keyword); return -1; } - for (x=0;x<ZT_MAX_CHANNELS;x++) { + for (x=0;x<DAHDI_MAX_CHANNELS;x++) { if (chans[x]) cc[x].deflaw = law; } @@ -632,11 +630,11 @@ static int setlaw(char *keyword, char *args) static int registerzone(char *keyword, char *args) { - if (numzones >= ZT_TONE_ZONE_MAX) { + if (numzones >= DAHDI_TONE_ZONE_MAX) { error("Too many tone zones specified\n"); return 0; } - zap_copy_string(zonestoload[numzones++], args, sizeof(zonestoload[0])); + dahdi_copy_string(zonestoload[numzones++], args, sizeof(zonestoload[0])); return 0; } @@ -960,19 +958,19 @@ int cor_thresh(char *keyword, char *args) int rad_apply_channels(int chans[], char *argstr) { - char *args[ZT_MAX_CHANNELS+1]; + char *args[DAHDI_MAX_CHANNELS+1]; char *range[3]; int res,x, res2,y; int chan; int start, finish; char argcopy[256]; - res = parseargs(argstr, args, ZT_MAX_CHANNELS, ','); + res = parseargs(argstr, args, DAHDI_MAX_CHANNELS, ','); if (res < 0) - error("Too many arguments... Max is %d\n", ZT_MAX_CHANNELS); + error("Too many arguments... Max is %d\n", DAHDI_MAX_CHANNELS); for (x=0;x<res;x++) { if (strchr(args[x], '-')) { /* It's a range */ - zap_copy_string(argcopy, args[x], sizeof(argcopy)); + dahdi_copy_string(argcopy, args[x], sizeof(argcopy)); res2 = parseargs(argcopy, range, 2, '-'); if (res2 != 2) { error("Syntax error in range '%s'. Should be <val1>-<val2>.\n", args[x]); @@ -980,18 +978,18 @@ int rad_apply_channels(int chans[], char *argstr) } res2 =sscanf(range[0], "%i", &start); if (res2 != 1) { - error("Syntax error. Start of range '%s' should be a number from 1 to %d\n", args[x], ZT_MAX_CHANNELS - 1); + error("Syntax error. Start of range '%s' should be a number from 1 to %d\n", args[x], DAHDI_MAX_CHANNELS - 1); return -1; - } else if ((start < 1) || (start >= ZT_MAX_CHANNELS)) { - error("Start of range '%s' must be between 1 and %d (not '%d')\n", args[x], ZT_MAX_CHANNELS - 1, start); + } else if ((start < 1) || (start >= DAHDI_MAX_CHANNELS)) { + error("Start of range '%s' must be between 1 and %d (not '%d')\n", args[x], DAHDI_MAX_CHANNELS - 1, start); return -1; } res2 =sscanf(range[1], "%i", &finish); if (res2 != 1) { - error("Syntax error. End of range '%s' should be a number from 1 to %d\n", args[x], ZT_MAX_CHANNELS - 1); + error("Syntax error. End of range '%s' should be a number from 1 to %d\n", args[x], DAHDI_MAX_CHANNELS - 1); return -1; - } else if ((finish < 1) || (finish >= ZT_MAX_CHANNELS)) { - error("end of range '%s' must be between 1 and %d (not '%d')\n", args[x], ZT_MAX_CHANNELS - 1, finish); + } else if ((finish < 1) || (finish >= DAHDI_MAX_CHANNELS)) { + error("end of range '%s' must be between 1 and %d (not '%d')\n", args[x], DAHDI_MAX_CHANNELS - 1, finish); return -1; } if (start > finish) { @@ -1004,10 +1002,10 @@ int rad_apply_channels(int chans[], char *argstr) /* It's a single channel */ res2 =sscanf(args[x], "%i", &chan); if (res2 != 1) { - error("Syntax error. Channel should be a number from 1 to %d, not '%s'\n", ZT_MAX_CHANNELS - 1, args[x]); + error("Syntax error. Channel should be a number from 1 to %d, not '%s'\n", DAHDI_MAX_CHANNELS - 1, args[x]); return -1; - } else if ((chan < 1) || (chan >= ZT_MAX_CHANNELS)) { - error("Channel must be between 1 and %d (not '%d')\n", ZT_MAX_CHANNELS - 1, chan); + } else if ((chan < 1) || (chan >= DAHDI_MAX_CHANNELS)) { + error("Channel must be between 1 and %d (not '%d')\n", DAHDI_MAX_CHANNELS - 1, chan); return -1; } chans[chan]=1; @@ -1018,108 +1016,108 @@ int rad_apply_channels(int chans[], char *argstr) static int rad_chanconfig(char *keyword, char *args) { - int chans[ZT_MAX_CHANNELS]; + int chans[DAHDI_MAX_CHANNELS]; int res = 0; int x,i,n; - struct zt_radio_param p; + struct dahdi_radio_param p; toneindex = 1; bzero(chans, sizeof(chans)); res = rad_apply_channels(chans, args); if (res <= 0) return -1; - for (x=1;x<ZT_MAX_CHANNELS;x++) { + for (x=1;x<DAHDI_MAX_CHANNELS;x++) { if (chans[x]) { - p.radpar = ZT_RADPAR_NUMTONES; - if (ind_ioctl(x,fd,ZT_RADIO_GETPARAM,&p) == -1) + p.radpar = DAHDI_RADPAR_NUMTONES; + if (ind_ioctl(x,fd,DAHDI_RADIO_GETPARAM,&p) == -1) n = 0; else n = p.data; if (n) { - p.radpar = ZT_RADPAR_INITTONE; - if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1) + p.radpar = DAHDI_RADPAR_INITTONE; + if (ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p) == -1) error("Cannot init tones for channel %d\n",x); if (!rxtones[0]) for(i = 1; i <= n; i++) { if (rxtones[i]) { - p.radpar = ZT_RADPAR_RXTONE; + p.radpar = DAHDI_RADPAR_RXTONE; p.index = i; p.data = rxtones[i]; - if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1) + if (ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p) == -1) error("Cannot set rxtone on channel %d\n",x); } if (rxtags[i]) { - p.radpar = ZT_RADPAR_RXTONECLASS; + p.radpar = DAHDI_RADPAR_RXTONECLASS; p.index = i; p.data = rxtags[i]; - if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1) + if (ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p) == -1) error("Cannot set rxtag on channel %d\n",x); } if (txtones[i]) { - p.radpar = ZT_RADPAR_TXTONE; + p.radpar = DAHDI_RADPAR_TXTONE; p.index = i; p.data = txtones[i]; - if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1) + if (ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p) == -1) error("Cannot set txtone on channel %d\n",x); } } else { /* if we may have DCS receive */ if (rxtones[0]) { - p.radpar = ZT_RADPAR_RXTONE; + p.radpar = DAHDI_RADPAR_RXTONE; p.index = 0; p.data = rxtones[0]; - if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1) + if (ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p) == -1) error("Cannot set DCS rxtone on channel %d\n",x); } } if (txtones[0]) { - p.radpar = ZT_RADPAR_TXTONE; + p.radpar = DAHDI_RADPAR_TXTONE; p.index = 0; p.data = txtones[0]; - if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1) + if (ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p) == -1) error("Cannot set default txtone on channel %d\n",x); } } if (debouncetime) { - p.radpar = ZT_RADPAR_DEBOUNCETIME; + p.radpar = DAHDI_RADPAR_DEBOUNCETIME; p.data = debouncetime; - if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1) + if (ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p) == -1) error("Cannot set debouncetime on channel %d\n",x); } if (bursttime) { - p.radpar = ZT_RADPAR_BURSTTIME; + p.radpar = DAHDI_RADPAR_BURSTTIME; p.data = bursttime; - if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1) + if (ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p) == -1) error("Cannot set bursttime on channel %d\n",x); } - p.radpar = ZT_RADPAR_DEEMP; + p.radpar = DAHDI_RADPAR_DEEMP; p.data = deemp; - ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p); - p.radpar = ZT_RADPAR_PREEMP; + ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p); + p.radpar = DAHDI_RADPAR_PREEMP; p.data = preemp; - ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p); - p.radpar = ZT_RADPAR_TXGAIN; + ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p); + p.radpar = DAHDI_RADPAR_TXGAIN; p.data = txgain; - ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p); - p.radpar = ZT_RADPAR_RXGAIN; + ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p); + p.radpar = DAHDI_RADPAR_RXGAIN; p.data = rxgain; - ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p); - p.radpar = ZT_RADPAR_INVERTCOR; + ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p); + p.radpar = DAHDI_RADPAR_INVERTCOR; p.data = invertcor; - ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p); - p.radpar = ZT_RADPAR_EXTRXTONE; + ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p); + p.radpar = DAHDI_RADPAR_EXTRXTONE; p.data = exttone; - ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p); + ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p); if (corthresh) { - p.radpar = ZT_RADPAR_CORTHRESH; + p.radpar = DAHDI_RADPAR_CORTHRESH; p.data = corthresh - 1; - if (ind_ioctl(x,fd,ZT_RADIO_SETPARAM,&p) == -1) + if (ind_ioctl(x,fd,DAHDI_RADIO_SETPARAM,&p) == -1) error("Cannot set corthresh on channel %d\n",x); } } @@ -1135,12 +1133,12 @@ static void printconfig(int fd) int x,y; int ps; int configs=0; - struct zt_versioninfo vi; + struct dahdi_versioninfo vi; strcpy(vi.version, "Unknown"); strcpy(vi.echo_canceller, "Unknown"); - if (ioctl(fd, ZT_GETVERSION, &vi)) + if (ioctl(fd, DAHDI_GETVERSION, &vi)) error("Unable to read Zaptel version information.\n"); printf("\nZaptel Version: %s\n" @@ -1149,12 +1147,12 @@ static void printconfig(int fd) "======================\n\n", vi.version, vi.echo_canceller); for (x=0;x<spans;x++) printf("SPAN %d: %3s/%4s Build-out: %s\n", - x+1, ( lc[x].lineconfig & ZT_CONFIG_D4 ? "D4" : - lc[x].lineconfig & ZT_CONFIG_ESF ? "ESF" : - lc[x].lineconfig & ZT_CONFIG_CCS ? "CCS" : "CAS" ), - ( lc[x].lineconfig & ZT_CONFIG_AMI ? "AMI" : - lc[x].lineconfig & ZT_CONFIG_B8ZS ? "B8ZS" : - lc[x].lineconfig & ZT_CONFIG_HDB3 ? "HDB3" : "???" ), + x+1, ( lc[x].lineconfig & DAHDI_CONFIG_D4 ? "D4" : + lc[x].lineconfig & DAHDI_CONFIG_ESF ? "ESF" : + lc[x].lineconfig & DAHDI_CONFIG_CCS ? "CCS" : "CAS" ), + ( lc[x].lineconfig & DAHDI_CONFIG_AMI ? "AMI" : + lc[x].lineconfig & DAHDI_CONFIG_B8ZS ? "B8ZS" : + lc[x].lineconfig & DAHDI_CONFIG_HDB3 ? "HDB3" : "???" ), lbostr[lc[x].lbo]); for (x=0;x<numdynamic;x++) { printf("Dynamic span %d: driver %s, addr %s, channels %d, timing %d\n", @@ -1162,15 +1160,15 @@ static void printconfig(int fd) } if (verbose > 1) { printf("\nChannel map:\n\n"); - for (x=1;x<ZT_MAX_CHANNELS;x++) { - if ((cc[x].sigtype != ZT_SIG_SLAVE) && (cc[x].sigtype)) { + for (x=1;x<DAHDI_MAX_CHANNELS;x++) { + if ((cc[x].sigtype != DAHDI_SIG_SLAVE) && (cc[x].sigtype)) { configs++; ps = 0; - if ((cc[x].sigtype & __ZT_SIG_DACS) == __ZT_SIG_DACS) + if ((cc[x].sigtype & __DAHDI_SIG_DACS) == __DAHDI_SIG_DACS) printf("Channel %02d %s to %02d", x, sig[x], cc[x].idlebits); else { printf("Channel %02d: %s (%s)", x, sig[x], laws[cc[x].deflaw]); - for (y=1;y<ZT_MAX_CHANNELS;y++) + for (y=1;y<DAHDI_MAX_CHANNELS;y++) if (cc[y].master == x) { printf("%s%02d", ps++ ? " " : " (Slaves: ", y); } @@ -1180,7 +1178,7 @@ static void printconfig(int fd) if (cc[x].sigtype) configs++; } } else - for (x=1;x<ZT_MAX_CHANNELS;x++) + for (x=1;x<DAHDI_MAX_CHANNELS;x++) if (cc[x].sigtype) configs++; printf("\n%d channels to configure.\n\n", configs); @@ -1362,11 +1360,11 @@ int main(int argc, char *argv[]) } for (x=0;x<numdynamic;x++) { /* destroy them all */ - ioctl(fd, ZT_DYNAMIC_DESTROY, &zds[x]); + ioctl(fd, DAHDI_DYNAMIC_DESTROY, &zds[x]); } if (stopmode) { for (x=0;x<spans;x++) { - if (ioctl(fd, ZT_SHUTDOWN, &lc[x].span)) { + if (ioctl(fd, DAHDI_SHUTDOWN, &lc[x].span)) { fprintf(stderr, "Zaptel shutdown failed: %s\n", strerror(errno)); close(fd); exit(1); @@ -1374,21 +1372,21 @@ int main(int argc, char *argv[]) } } else { for (x=0;x<spans;x++) { - if (ioctl(fd, ZT_SPANCONFIG, lc + x)) { - fprintf(stderr, "ZT_SPANCONFIG failed on span %d: %s (%d)\n", lc[x].span, strerror(errno), errno); + if (ioctl(fd, DAHDI_SPANCONFIG, lc + x)) { + fprintf(stderr, "DAHDI_SPANCONFIG failed on span %d: %s (%d)\n", lc[x].span, strerror(errno), errno); close(fd); exit(1); } } for (x=0;x<numdynamic;x++) { - if (ioctl(fd, ZT_DYNAMIC_CREATE, &zds[x])) { + if (ioctl(fd, DAHDI_DYNAMIC_CREATE, &zds[x])) { fprintf(stderr, "Zaptel dynamic span creation failed: %s\n", strerror(errno)); close(fd); exit(1); } } - for (x=1;x<ZT_MAX_CHANNELS;x++) { - struct zt_params current_state; + for (x=1;x<DAHDI_MAX_CHANNELS;x++) { + struct dahdi_params current_state; int master; int needupdate = force; @@ -1401,8 +1399,8 @@ int main(int argc, char *argv[]) if (!needupdate) { memset(¤t_state, 0, sizeof(current_state)); - current_state.channo = cc[x].chan | ZT_GET_PARAMS_RETURN_MASTER; - if (ioctl(fd, ZT_GET_PARAMS, ¤t_state)) + current_state.channo = cc[x].chan | DAHDI_GET_PARAMS_RETURN_MASTER; + if (ioctl(fd, DAHDI_GET_PARAMS, ¤t_state)) needupdate = 1; } @@ -1417,7 +1415,7 @@ int main(int argc, char *argv[]) sigtype_to_str(cc[x].sigtype)); } - if ((cc[x].deflaw != ZT_LAW_DEFAULT) && (cc[x].deflaw != current_state.curlaw)) { + if ((cc[x].deflaw != DAHDI_LAW_DEFAULT) && (cc[x].deflaw != current_state.curlaw)) { needupdate++; if (verbose > 1) printf("Changing law on channel %d from %s to %s\n", @@ -1442,8 +1440,8 @@ int main(int argc, char *argv[]) } } - if (needupdate && ioctl(fd, ZT_CHANCONFIG, &cc[x])) { - fprintf(stderr, "ZT_CHANCONFIG failed on channel %d: %s (%d)\n", x, strerror(errno), errno); + if (needupdate && ioctl(fd, DAHDI_CHANCONFIG, &cc[x])) { + fprintf(stderr, "DAHDI_CHANCONFIG failed on channel %d: %s (%d)\n", x, strerror(errno), errno); if (errno == EINVAL) { fprintf(stderr, "Did you forget that FXS interfaces are configured with FXO signalling\n" "and that FXO interfaces use FXS signalling?\n"); @@ -1466,14 +1464,14 @@ int main(int argc, char *argv[]) fflush(stdout); } if (deftonezone > -1) { - if (ioctl(fd, ZT_DEFAULTZONE, &deftonezone)) { - fprintf(stderr, "ZT_DEFAULTZONE failed: %s (%d)\n", strerror(errno), errno); + if (ioctl(fd, DAHDI_DEFAULTZONE, &deftonezone)) { + fprintf(stderr, "DAHDI_DEFAULTZONE failed: %s (%d)\n", strerror(errno), errno); close(fd); exit(1); } } for (x=0;x<spans;x++) { - if (ioctl(fd, ZT_STARTUP, &lc[x].span)) { + if (ioctl(fd, DAHDI_STARTUP, &lc[x].span)) { fprintf(stderr, "Zaptel startup failed: %s\n", strerror(errno)); close(fd); exit(1); diff --git a/dahdi_cfg.h b/dahdi_cfg.h deleted file mode 100644 index 8ad5d81..0000000 --- a/dahdi_cfg.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * BSD Telephony Of Mexico "Tormenta" card LINUX driver, version 1.6 1/9/01 - * - * Working with the "Tormenta ISA" Card - * - * - * Part of the "Zapata" Computer Telephony Technology. - * - * See http://www.bsdtelephony.com.mx - * - * - * The technologies, software, hardware, designs, drawings, scheumatics, board - * layouts and/or artwork, concepts, methodologies (including the use of all - * of these, and that which is derived from the use of all of these), all other - * intellectual properties contained herein, and all intellectual property - * rights have been and shall continue to be expressly for the benefit of all - * mankind, and are perpetually placed in the public domain, and may be used, - * copied, and/or modified by anyone, in any manner, for any legal purpose, - * without restriction. - */ - -#ifndef _ZTCFG_H -#define _ZTCFG_H - -#define CONFIG_FILENAME ZAPTEL_CONFIG -#define MASTER_DEVICE "/dev/zap/ctl" -#endif diff --git a/dahdi_diag.c b/dahdi_diag.c index 50900a8..1b5b105 100644 --- a/dahdi_diag.c +++ b/dahdi_diag.c @@ -4,11 +4,7 @@ #include <stdlib.h> #include <unistd.h> -#ifdef STANDALONE_ZAPATA -#include "kernel/zaptel.h" -#else -#include <zaptel/zaptel.h> -#endif +#include <dahdi/user.h> int main(int argc, char *argv[]) { @@ -23,8 +19,8 @@ int main(int argc, char *argv[]) perror("open(/dev/zap/ctl"); exit(1); } - if (ioctl(fd, ZT_CHANDIAG, &chan)) { - perror("ioctl(ZT_CHANDIAG)"); + if (ioctl(fd, DAHDI_CHANDIAG, &chan)) { + perror("ioctl(DAHDI_CHANDIAG)"); exit(1); } exit(0); diff --git a/dahdi_monitor.c b/dahdi_monitor.c index 3c8b5ff..77cd1e6 100644 --- a/dahdi_monitor.c +++ b/dahdi_monitor.c @@ -39,13 +39,10 @@ #include <fcntl.h> #include <errno.h> #include <ctype.h> -#ifdef STANDALONE_ZAPATA -#include "kernel/zaptel.h" + +#include <dahdi/user.h> #include "tonezone.h" -#else -#include <zaptel/zaptel.h> -#include <zaptel/tonezone.h> -#endif + #include <linux/soundcard.h> /* @@ -139,13 +136,13 @@ int pseudo_open(void) fprintf(stderr, "Unable to open pseudo channel: %s\n", strerror(errno)); return -1; } - if (ioctl(fd, ZT_SETLINEAR, &x)) { + if (ioctl(fd, DAHDI_SETLINEAR, &x)) { fprintf(stderr, "Unable to set linear mode: %s\n", strerror(errno)); close(fd); return -1; } x = BLOCK_SIZE; - if (ioctl(fd, ZT_SET_BLOCKSIZE, &x)) { + if (ioctl(fd, DAHDI_SET_BLOCKSIZE, &x)) { fprintf(stderr, "unable to set sane block size: %s\n", strerror(errno)); close(fd); return -1; @@ -168,10 +165,10 @@ void draw_barheader() memset(bar+barlen+2, '>', 1); memset(bar+barlen+3, '\0', 1); - zap_copy_string(bar+(barlen/2), "(RX)", 4); + dahdi_copy_string(bar+(barlen/2), "(RX)", 4); printf("%s", bar); - zap_copy_string(bar+(barlen/2), "(TX)", 4); + dahdi_copy_string(bar+(barlen/2), "(TX)", 4); printf(" %s\n", bar); } @@ -283,7 +280,7 @@ int main(int argc, char *argv[]) int limit = 0; int readcount = 0; int x, i, chan; - struct zt_confinfo zc; + struct dahdi_confinfo zc; if ((argc < 2) || (atoi(argv[1]) < 1)) { fprintf(stderr, "Usage: ztmonitor <channel num> [-v[v]] [-m] [-o] [-p] [-l limit] [-f FILE | -s FILE | -r FILE1 -t FILE2] [-F FILE | -S FILE | -R FILE1 -T FILE2]\n"); @@ -430,16 +427,16 @@ int main(int argc, char *argv[]) zc.chan = 0; zc.confno = chan; /* Two pseudo's, one for tx, one for rx */ - zc.confmode = ZT_CONF_MONITOR; - if (ioctl(pfd[MON_BRX], ZT_SETCONF, &zc) < 0) { + zc.confmode = DAHDI_CONF_MONITOR; + if (ioctl(pfd[MON_BRX], DAHDI_SETCONF, &zc) < 0) { fprintf(stderr, "Unable to monitor: %s\n", strerror(errno)); exit(1); } memset(&zc, 0, sizeof(zc)); zc.chan = 0; zc.confno = chan; - zc.confmode = ZT_CONF_MONITORTX; - if (ioctl(pfd[MON_TX], ZT_SETCONF, &zc) < 0) { + zc.confmode = DAHDI_CONF_MONITORTX; + if (ioctl(pfd[MON_TX], DAHDI_SETCONF, &zc) < 0) { fprintf(stderr, "Unable to monitor: %s\n", strerror(errno)); exit(1); } @@ -448,16 +445,16 @@ int main(int argc, char *argv[]) zc.chan = 0; zc.confno = chan; /* Two pseudo's, one for tx, one for rx */ - zc.confmode = ZT_CONF_MONITOR_RX_PREECHO; - if (ioctl(pfd[MON_PRE_BRX], ZT_SETCONF, &zc) < 0) { + zc.confmode = DAHDI_CONF_MONITOR_RX_PREECHO; + if (ioctl(pfd[MON_PRE_BRX], DAHDI_SETCONF, &zc) < 0) { fprintf(stderr, "Unable to monitor: %s\n", strerror(errno)); exit(1); } memset(&zc, 0, sizeof(zc)); zc.chan = 0; zc.confno = chan; - zc.confmode = ZT_CONF_MONITOR_TX_PREECHO; - if (ioctl(pfd[MON_PRE_TX], ZT_SETCONF, &zc) < 0) { + zc.confmode = DAHDI_CONF_MONITOR_TX_PREECHO; + if (ioctl(pfd[MON_PRE_TX], DAHDI_SETCONF, &zc) < 0) { fprintf(stderr, "Unable to monitor: %s\n", strerror(errno)); exit(1); } @@ -466,8 +463,8 @@ int main(int argc, char *argv[]) memset(&zc, 0, sizeof(zc)); zc.chan = 0; zc.confno = chan; - zc.confmode = ZT_CONF_MONITORBOTH; - if (ioctl(pfd[MON_BRX], ZT_SETCONF, &zc) < 0) { + zc.confmode = DAHDI_CONF_MONITORBOTH; + if (ioctl(pfd[MON_BRX], DAHDI_SETCONF, &zc) < 0) { fprintf(stderr, "Unable to monitor: %s\n", strerror(errno)); exit(1); } @@ -475,8 +472,8 @@ int main(int argc, char *argv[]) memset(&zc, 0, sizeof(zc)); zc.chan = 0; zc.confno = chan; - zc.confmode = ZT_CONF_MONITORBOTH_PREECHO; - if (ioctl(pfd[MON_PRE_BRX], ZT_SETCONF, &zc) < 0) { + zc.confmode = DAHDI_CONF_MONITORBOTH_PREECHO; + if (ioctl(pfd[MON_PRE_BRX], DAHDI_SETCONF, &zc) < 0) { fprintf(stderr, "Unable to monitor: %s\n", strerror(errno)); exit(1); } diff --git a/dahdi_scan.c b/dahdi_scan.c index 64298ee..23d5226 100644 --- a/dahdi_scan.c +++ b/dahdi_scan.c @@ -34,19 +34,15 @@ #include <fcntl.h> #include <errno.h> -#ifdef STANDALONE_ZAPATA -#include "kernel/zaptel.h" -#else -#include <zaptel/zaptel.h> -#endif +#include <dahdi/user.h> int main(int argc, char *argv[]) { int ctl; int x, y; - struct zt_params params; + struct dahdi_params params; unsigned int basechan = 1; - struct zt_spaninfo s; + struct dahdi_spaninfo s; char buf[100]; char alarms[50]; @@ -55,25 +51,25 @@ int main(int argc, char *argv[]) exit(1); } - for (x = 1; x < ZT_MAX_SPANS; x++) { + for (x = 1; x < DAHDI_MAX_SPANS; x++) { memset(&s, 0, sizeof(s)); s.spanno = x; - if (ioctl(ctl, ZT_SPANSTAT, &s)) + if (ioctl(ctl, DAHDI_SPANSTAT, &s)) continue; alarms[0] = '\0'; if (s.alarms) { - if (s.alarms & ZT_ALARM_BLUE) + if (s.alarms & DAHDI_ALARM_BLUE) strcat(alarms,"BLU/"); - if (s.alarms & ZT_ALARM_YELLOW) + if (s.alarms & DAHDI_ALARM_YELLOW) strcat(alarms, "YEL/"); - if (s.alarms & ZT_ALARM_RED) + if (s.alarms & DAHDI_ALARM_RED) strcat(alarms, "RED/"); - if (s.alarms & ZT_ALARM_LOOPBACK) + if (s.alarms & DAHDI_ALARM_LOOPBACK) strcat(alarms,"LB/"); - if (s.alarms & ZT_ALARM_RECOVER) + if (s.alarms & DAHDI_ALARM_RECOVER) strcat(alarms,"REC/"); - if (s.alarms & ZT_ALARM_NOTOPEN) + if (s.alarms & DAHDI_ALARM_NOTOPEN) strcat(alarms, "NOP/"); if (!strlen(alarms)) strcat(alarms, "UUU/"); @@ -102,41 +98,41 @@ int main(int argc, char *argv[]) y = basechan; memset(¶ms, 0, sizeof(params)); params.channo = y; - if (ioctl(ctl, ZT_GET_PARAMS, ¶ms)) { + if (ioctl(ctl, DAHDI_GET_PARAMS, ¶ms)) { basechan += s.totalchans; continue; } - if (params.sigcap & (__ZT_SIG_DACS | ZT_SIG_CAS)) { + if (params.sigcap & (__DAHDI_SIG_DACS | DAHDI_SIG_CAS)) { /* this is a digital span */ fprintf(stdout, "type=digital-%s\n", s.spantype); fprintf(stdout, "syncsrc=%d\n", s.syncsrc); fprintf(stdout, "lbo=%s\n", s.lboname); fprintf(stdout, "coding_opts="); buf[0] = '\0'; - if (s.linecompat & ZT_CONFIG_B8ZS) strcat(buf, "B8ZS,"); - if (s.linecompat & ZT_CONFIG_AMI) strcat(buf, "AMI,"); - if (s.linecompat & ZT_CONFIG_HDB3) strcat(buf, "HDB3,"); + if (s.linecompat & DAHDI_CONFIG_B8ZS) strcat(buf, "B8ZS,"); + if (s.linecompat & DAHDI_CONFIG_AMI) strcat(buf, "AMI,"); + if (s.linecompat & DAHDI_CONFIG_HDB3) strcat(buf, "HDB3,"); buf[strlen(buf) - 1] = '\0'; fprintf(stdout, "%s\n", buf); fprintf(stdout, "framing_opts="); buf[0] = '\0'; - if (s.linecompat & ZT_CONFIG_ESF) strcat(buf, "ESF,"); - if (s.linecompat & ZT_CONFIG_D4) strcat(buf, "D4,"); - if (s.linecompat & ZT_CONFIG_CCS) strcat(buf, "CCS,"); - if (s.linecompat & ZT_CONFIG_CRC4) strcat(buf, "CRC4,"); + if (s.linecompat & DAHDI_CONFIG_ESF) strcat(buf, "ESF,"); + if (s.linecompat & DAHDI_CONFIG_D4) strcat(buf, "D4,"); + if (s.linecompat & DAHDI_CONFIG_CCS) strcat(buf, "CCS,"); + if (s.linecompat & DAHDI_CONFIG_CRC4) strcat(buf, "CRC4,"); buf[strlen(buf) - 1] = '\0'; fprintf(stdout, "%s\n", buf); fprintf(stdout, "coding="); - if (s.lineconfig & ZT_CONFIG_B8ZS) fprintf(stdout, "B8ZS"); - else if (s.lineconfig & ZT_CONFIG_AMI) fprintf(stdout, "AMI"); - else if (s.lineconfig & ZT_CONFIG_HDB3) fprintf(stdout, "HDB3"); + if (s.lineconfig & DAHDI_CONFIG_B8ZS) fprintf(stdout, "B8ZS"); + else if (s.lineconfig & DAHDI_CONFIG_AMI) fprintf(stdout, "AMI"); + else if (s.lineconfig & DAHDI_CONFIG_HDB3) fprintf(stdout, "HDB3"); fprintf(stdout, "\n"); fprintf(stdout, "framing="); - if (s.lineconfig & ZT_CONFIG_ESF) fprintf(stdout, "ESF"); - else if (s.lineconfig & ZT_CONFIG_D4) fprintf(stdout, "D4"); - else if (s.lineconfig & ZT_CONFIG_CCS) fprintf(stdout, "CCS"); - else if (s.lineconfig & ZT_CONFIG_CRC4) fprintf(stdout, "/CRC4"); + if (s.lineconfig & DAHDI_CONFIG_ESF) fprintf(stdout, "ESF"); + else if (s.lineconfig & DAHDI_CONFIG_D4) fprintf(stdout, "D4"); + else if (s.lineconfig & DAHDI_CONFIG_CCS) fprintf(stdout, "CCS"); + else if (s.lineconfig & DAHDI_CONFIG_CRC4) fprintf(stdout, "/CRC4"); fprintf(stdout, "\n"); } else { /* this is an analog span */ @@ -144,22 +140,22 @@ int main(int argc, char *argv[]) for (y = basechan; y < (basechan + s.totalchans); y++) { memset(¶ms, 0, sizeof(params)); params.channo = y; - if (ioctl(ctl, ZT_GET_PARAMS, ¶ms)) { + if (ioctl(ctl, DAHDI_GET_PARAMS, ¶ms)) { fprintf(stdout, "port=%d,unknown\n", y); continue; }; fprintf(stdout, "port=%d,", y); - switch (params.sigcap & (__ZT_SIG_FXO | __ZT_SIG_FXS)) { - case __ZT_SIG_FXO: + switch (params.sigcap & (__DAHDI_SIG_FXO | __DAHDI_SIG_FXS)) { + case __DAHDI_SIG_FXO: fprintf(stdout, "FXS"); break; - case __ZT_SIG_FXS: + case __DAHDI_SIG_FXS: fprintf(stdout, "FXO"); break; default: fprintf(stdout, "none"); } - if (params.sigcap & ZT_SIG_BROKEN) + if (params.sigcap & DAHDI_SIG_BROKEN) fprintf(stdout, " FAILED"); fprintf(stdout, "\n"); } diff --git a/dahdi_tool.c b/dahdi_tool.c index c1e97bc..de7067b 100644 --- a/dahdi_tool.c +++ b/dahdi_tool.c @@ -42,20 +42,16 @@ #include <fcntl.h> #include <errno.h> #include <newt.h> -#ifdef STANDALONE_ZAPATA -#include "kernel/zaptel.h" + +#include <dahdi/user.h> #include "tonezone.h" -#else -#include <zaptel/zaptel.h> -#include <zaptel/tonezone.h> -#endif static int ctl = -1; static int span_max_chan_pos; -static ZT_SPANINFO s[ZT_MAX_SPANS]; +static DAHDI_SPANINFO s[DAHDI_MAX_SPANS]; -static char *zt_txlevelnames[] = { +static char *dahdi_txlevelnames[] = { "0 db (CSU)/0-133 feet (DSX-1)", "133-266 feet (DSX-1)", "266-399 feet (DSX-1)", @@ -71,17 +67,17 @@ static char *alarmstr(int span) static char alarms[80]; strcpy(alarms, ""); if (s[span].alarms > 0) { - if (s[span].alarms & ZT_ALARM_BLUE) + if (s[span].alarms & DAHDI_ALARM_BLUE) strcat(alarms,"Blue Alarm/"); - if (s[span].alarms & ZT_ALARM_YELLOW) + if (s[span].alarms & DAHDI_ALARM_YELLOW) strcat(alarms, "Yellow Alarm/"); - if (s[span].alarms & ZT_ALARM_RED) + if (s[span].alarms & DAHDI_ALARM_RED) strcat(alarms, "Red Alarm/"); - if (s[span].alarms & ZT_ALARM_LOOPBACK) + if (s[span].alarms & DAHDI_ALARM_LOOPBACK) strcat(alarms,"Loopback/"); - if (s[span].alarms & ZT_ALARM_RECOVER) + if (s[span].alarms & DAHDI_ALARM_RECOVER) strcat(alarms,"Recovering/"); - if (s[span].alarms & ZT_ALARM_NOTOPEN) + if (s[span].alarms & DAHDI_ALARM_NOTOPEN) strcat(alarms, "Not Open/"); if (!strlen(alarms)) strcat(alarms, "<unknown>/"); @@ -100,7 +96,7 @@ static char *getalarms(int span, int err) static char tmp[256]; char alarms[50]; s[span].spanno = span; - res = ioctl(ctl, ZT_SPANSTAT, &s[span]); + res = ioctl(ctl, DAHDI_SPANSTAT, &s[span]); if (res) { if (err) fprintf(stderr, "Unable to get span info on span %d: %s\n", span, strerror(errno)); @@ -108,17 +104,17 @@ static char *getalarms(int span, int err) } strcpy(alarms, ""); if (s[span].alarms > 0) { - if (s[span].alarms & ZT_ALARM_BLUE) + if (s[span].alarms & DAHDI_ALARM_BLUE) strcat(alarms,"BLU/"); - if (s[span].alarms & ZT_ALARM_YELLOW) + if (s[span].alarms & DAHDI_ALARM_YELLOW) strcat(alarms, "YEL/"); - if (s[span].alarms & ZT_ALARM_RED) + if (s[span].alarms & DAHDI_ALARM_RED) strcat(alarms, "RED/"); - if (s[span].alarms & ZT_ALARM_LOOPBACK) + if (s[span].alarms & DAHDI_ALARM_LOOPBACK) strcat(alarms,"LB/"); - if (s[span].alarms & ZT_ALARM_RECOVER) + if (s[span].alarms & DAHDI_ALARM_RECOVER) strcat(alarms,"REC/"); - if (s[span].alarms & ZT_ALARM_NOTOPEN) + if (s[span].alarms & DAHDI_ALARM_NOTOPEN) strcat(alarms, "NOP/"); if (!strlen(alarms)) strcat(alarms, "UUU/"); @@ -146,7 +142,7 @@ static void add_cards(newtComponent spans) if (spans) prev = newtListboxGetCurrent(spans); newtListboxClear(spans); - for (x=0;x<ZT_MAX_SPANS;x++) { + for (x=0;x<DAHDI_MAX_SPANS;x++) { s = getalarms(x, 0); if (s && spans) { /* Found one! */ @@ -180,7 +176,7 @@ static void sel_callback(newtComponent c, void *cbdata) static void show_bits(int span, newtComponent bitbox, newtComponent inuse, newtComponent levels, newtComponent bpvcount, newtComponent alarms, newtComponent syncsrc, newtComponent irqmisses) { - ZT_PARAMS zp; + DAHDI_PARAMS zp; int x; int res; char c; @@ -213,44 +209,44 @@ static void show_bits(int span, newtComponent bitbox, newtComponent inuse, newtC memset(rcbits,32, span_max_chan_pos); memset(rdbits,32, span_max_chan_pos); - for (x=0;x<ZT_MAX_CHANNELS;x++) { + for (x=0;x<DAHDI_MAX_CHANNELS;x++) { memset(&zp, 0, sizeof(zp)); zp.channo = x; - res = ioctl(ctl, ZT_GET_PARAMS, &zp); + res = ioctl(ctl, DAHDI_GET_PARAMS, &zp); if (!res) { if (zp.spanno == span) { if (zp.sigtype && (zp.rxbits > -1)) { - if (zp.rxbits & ZT_ABIT) + if (zp.rxbits & DAHDI_ABIT) rabits[zp.chanpos - 1] = '1'; else rabits[zp.chanpos - 1] = '0'; - if (zp.rxbits & ZT_BBIT) + if (zp.rxbits & DAHDI_BBIT) rbbits[zp.chanpos - 1] = '1'; else rbbits[zp.chanpos - 1] = '0'; - if (zp.rxbits & ZT_CBIT) + if (zp.rxbits & DAHDI_CBIT) rcbits[zp.chanpos - 1] = '1'; else rcbits[zp.chanpos - 1] = '0'; - if (zp.rxbits & ZT_DBIT) + if (zp.rxbits & DAHDI_DBIT) rdbits[zp.chanpos - 1] = '1'; else rdbits[zp.chanpos - 1] = '0'; - if (zp.txbits & ZT_ABIT) + if (zp.txbits & DAHDI_ABIT) tabits[zp.chanpos - 1] = '1'; else tabits[zp.chanpos - 1] = '0'; - if (zp.txbits & ZT_BBIT) + if (zp.txbits & DAHDI_BBIT) tbbits[zp.chanpos - 1] = '1'; else tbbits[zp.chanpos - 1] = '0'; - if (zp.txbits & ZT_CBIT) + if (zp.txbits & DAHDI_CBIT) tcbits[zp.chanpos - 1] = '1'; else tcbits[zp.chanpos - 1] = '0'; - if (zp.txbits & ZT_DBIT) + if (zp.txbits & DAHDI_DBIT) tdbits[zp.chanpos - 1] = '1'; else tdbits[zp.chanpos - 1] = '0'; @@ -276,8 +272,8 @@ static void show_bits(int span, newtComponent bitbox, newtComponent inuse, newtC newtTextboxSetText(bitbox, tmp); sprintf(tmp, "%3d/%3d/%3d", s[span].totalchans, s[span].numchans, use); newtTextboxSetText(inuse, tmp); - sprintf(tmp, "%s/", zt_txlevelnames[s[span].txlevel]); - strcat(tmp, zt_txlevelnames[s[span].rxlevel]); + sprintf(tmp, "%s/", dahdi_txlevelnames[s[span].txlevel]); + strcat(tmp, dahdi_txlevelnames[s[span].rxlevel]); sprintf(tmp, "%3d/%3d", s[span].txlevel, s[span].rxlevel); newtTextboxSetText(levels, tmp); sprintf(tmp, "%7d", s[span].bpvcount); @@ -299,7 +295,7 @@ static void do_loop(int span, int looped) newtComponent form; newtComponent label; char s1[256]; - struct zt_maintinfo m; + struct dahdi_maintinfo m; int res; struct newtExitStruct es; @@ -309,10 +305,10 @@ static void do_loop(int span, int looped) m.spanno = span; if (looped) { snprintf(s1, sizeof(s1), "Looping UP span %d...\n", span); - m.command = ZT_MAINT_LOOPUP; + m.command = DAHDI_MAINT_LOOPUP; } else { snprintf(s1, sizeof(s1), "Looping DOWN span %d...\n", span); - m.command = ZT_MAINT_LOOPDOWN; + m.command = DAHDI_MAINT_LOOPDOWN; } label = newtLabel(3,1,s1); @@ -321,7 +317,7 @@ static void do_loop(int span, int looped) newtFormSetTimer(form, 200); newtFormRun(form, &es); - res = ioctl(ctl, ZT_MAINT, &m); + res = ioctl(ctl, DAHDI_MAINT, &m); newtFormDestroy(form); newtPopWindow(); newtPopHelpLine(); @@ -370,12 +366,12 @@ static void show_span(int span) newtFormAddComponents(form, back, loop, NULL); span_max_chan_pos = s[span].totalchans; - for (x=0;x<ZT_MAX_CHANNELS;x++) { - ZT_PARAMS zp; + for (x=0;x<DAHDI_MAX_CHANNELS;x++) { + DAHDI_PARAMS zp; int res; memset(&zp, 0, sizeof(zp)); zp.channo = x; - res = ioctl(ctl, ZT_GET_PARAMS, &zp); + res = ioctl(ctl, DAHDI_GET_PARAMS, &zp); if (!res && zp.spanno == span && zp.chanpos > span_max_chan_pos ) span_max_chan_pos = zp.chanpos; } @@ -23,12 +23,9 @@ #include <math.h> #include <sys/time.h> -#ifdef STANDALONE_ZAPATA -#include "kernel/zaptel.h" -#else -#include <zaptel/zaptel.h> -#endif -#include "kernel/wctdm.h" +#include <dahdi/user.h> +#include <dahdi/wctdm_user.h> + #include "fxotune.h" #define TEST_DURATION 2000 @@ -148,29 +145,29 @@ static int ensure_silence(struct silence_info *info) /* do a line reset */ /* prepare line for silence */ /* Do line hookstate reset */ - int x = ZT_ONHOOK; + int x = DAHDI_ONHOOK; - if (ioctl(info->device, ZT_HOOK, &x)) { + if (ioctl(info->device, DAHDI_HOOK, &x)) { fprintf(stderr, "Unable to hang up fd %d\n", info->device); return -1; } sleep(2); - x = ZT_OFFHOOK; - if (ioctl(info->device, ZT_HOOK, &x)) { + x = DAHDI_OFFHOOK; + if (ioctl(info->device, DAHDI_HOOK, &x)) { fprintf(stderr, "Cannot bring fd %d off hook\n", info->device); return -1; } sleep(2); /* Added to ensure that dial can actually takes place */ - struct zt_dialoperation dop; + struct dahdi_dialoperation dop; memset(&dop, 0, sizeof(dop)); - dop.op = ZT_DIAL_OP_REPLACE; + dop.op = DAHDI_DIAL_OP_REPLACE; dop.dialstr[0] = 'T'; - zap_copy_string(dop.dialstr + 1, info->dialstr, sizeof(dop.dialstr)); + dahdi_copy_string(dop.dialstr + 1, info->dialstr, sizeof(dop.dialstr)); - if (ioctl(info->device, ZT_DIAL, &dop)) { + if (ioctl(info->device, DAHDI_DIAL, &dop)) { fprintf(stderr, "Unable to dial!\n"); return -1; } @@ -340,7 +337,7 @@ static int maptone(int whichzap, int freq, char *dialstr, int delayuntilsilence) { int i = 0; int res = 0, x = 0; - struct zt_bufferinfo bi; + struct dahdi_bufferinfo bi; short inbuf[TEST_DURATION]; /* changed from BUFFER_LENGTH - this buffer is for short values, so it should be allocated using the length of the test */ FILE *outfile = NULL; @@ -351,21 +348,21 @@ static int maptone(int whichzap, int freq, char *dialstr, int delayuntilsilence) } x = 1; - if (ioctl(whichzap, ZT_SETLINEAR, &x)) { + if (ioctl(whichzap, DAHDI_SETLINEAR, &x)) { fprintf(stderr, "Unable to set channel to signed linear mode.\n"); return -1; } memset(&bi, 0, sizeof(bi)); - if (ioctl(whichzap, ZT_GET_BUFINFO, &bi)) { + if (ioctl(whichzap, DAHDI_GET_BUFINFO, &bi)) { fprintf(stderr, "Unable to get buffer information!\n"); return -1; } bi.numbufs = 2; bi.bufsize = TEST_DURATION; /* KD - changed from BUFFER_LENGTH; */ - bi.txbufpolicy = ZT_POLICY_IMMEDIATE; - bi.rxbufpolicy = ZT_POLICY_IMMEDIATE; - if (ioctl(whichzap, ZT_SET_BUFINFO, &bi)) { + bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE; + bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE; + if (ioctl(whichzap, DAHDI_SET_BUFINFO, &bi)) { fprintf(stderr, "Unable to set buffer information!\n"); return -1; } @@ -395,8 +392,8 @@ static int maptone(int whichzap, int freq, char *dialstr, int delayuntilsilence) } /* Flush buffers */ - x = ZT_FLUSH_READ | ZT_FLUSH_WRITE | ZT_FLUSH_EVENT; - if (ioctl(whichzap, ZT_FLUSH, &x)) { + x = DAHDI_FLUSH_READ | DAHDI_FLUSH_WRITE | DAHDI_FLUSH_EVENT; + if (ioctl(whichzap, DAHDI_FLUSH, &x)) { fprintf(stderr, "Unable to flush I/O: %s\n", strerror(errno)); return -1; } @@ -414,7 +411,7 @@ retry: if (res != BUFFER_LENGTH) { int x; - ioctl(whichzap, ZT_GETEVENT, &x); + ioctl(whichzap, DAHDI_GETEVENT, &x); goto retry; } @@ -473,7 +470,7 @@ static int acim_tune2(int whichzap, int freq, char *dialstr, int delayuntilsilen int lowesttry = -1; float lowesttryresult = 999999999999.0; float lowestecho = 999999999999.0;; - struct zt_bufferinfo bi; + struct dahdi_bufferinfo bi; short inbuf[TEST_DURATION * 2]; @@ -491,26 +488,26 @@ static int acim_tune2(int whichzap, int freq, char *dialstr, int delayuntilsilen } x = 1; - if (ioctl(whichzap, ZT_SETLINEAR, &x)) { + if (ioctl(whichzap, DAHDI_SETLINEAR, &x)) { fprintf(stderr, "Unable to set channel to signed linear mode.\n"); return -1; } memset(&bi, 0, sizeof(bi)); - if (ioctl(whichzap, ZT_GET_BUFINFO, &bi)) { + if (ioctl(whichzap, DAHDI_GET_BUFINFO, &bi)) { fprintf(stderr, "Unable to get buffer information!\n"); return -1; } bi.numbufs = 2; bi.bufsize = BUFFER_LENGTH; - bi.txbufpolicy = ZT_POLICY_IMMEDIATE; - bi.rxbufpolicy = ZT_POLICY_IMMEDIATE; - if (ioctl(whichzap, ZT_SET_BUFINFO, &bi)) { + bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE; + bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE; + if (ioctl(whichzap, DAHDI_SET_BUFINFO, &bi)) { fprintf(stderr, "Unable to set buffer information!\n"); return -1; } - x = ZT_OFFHOOK; - if (ioctl(whichzap, ZT_HOOK, &x)) { + x = DAHDI_OFFHOOK; + if (ioctl(whichzap, DAHDI_HOOK, &x)) { fprintf(stderr, "Cannot bring fd %d off hook", whichzap); return -1; } @@ -550,8 +547,8 @@ static int acim_tune2(int whichzap, int freq, char *dialstr, int delayuntilsilen } /* Flush buffers */ - x = ZT_FLUSH_READ | ZT_FLUSH_WRITE | ZT_FLUSH_EVENT; - if (ioctl(whichzap, ZT_FLUSH, &x)) { + x = DAHDI_FLUSH_READ | DAHDI_FLUSH_WRITE | DAHDI_FLUSH_EVENT; + if (ioctl(whichzap, DAHDI_FLUSH, &x)) { fprintf(stderr, "Unable to flush I/O: %s\n", strerror(errno)); return -1; } @@ -569,7 +566,7 @@ retry: if (res != BUFFER_LENGTH * 2) { int x; - ioctl(whichzap, ZT_GETEVENT, &x); + ioctl(whichzap, DAHDI_GETEVENT, &x); goto retry; } @@ -630,7 +627,7 @@ static int acim_tune(int whichzap, char *dialstr, int delayuntilsilence, int sil { int i = 0, freq = 0, acim = 0; int res = 0, x = 0; - struct zt_bufferinfo bi; + struct dahdi_bufferinfo bi; struct wctdm_echo_coefs coefs; short inbuf[TEST_DURATION]; /* changed from BUFFER_LENGTH - this buffer is for short values, so it should be allocated using the length of the test */ int lowest = 0; @@ -662,21 +659,21 @@ static int acim_tune(int whichzap, char *dialstr, int delayuntilsilence, int sil } x = 1; - if (ioctl(whichzap, ZT_SETLINEAR, &x)) { + if (ioctl(whichzap, DAHDI_SETLINEAR, &x)) { fprintf(stderr, "Unable to set channel to signed linear mode.\n"); return -1; } memset(&bi, 0, sizeof(bi)); - if (ioctl(whichzap, ZT_GET_BUFINFO, &bi)) { + if (ioctl(whichzap, DAHDI_GET_BUFINFO, &bi)) { fprintf(stderr, "Unable to get buffer information!\n"); return -1; } bi.numbufs = 2; bi.bufsize = BUFFER_LENGTH; - bi.txbufpolicy = ZT_POLICY_IMMEDIATE; - bi.rxbufpolicy = ZT_POLICY_IMMEDIATE; - if (ioctl(whichzap, ZT_SET_BUFINFO, &bi)) { + bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE; + bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE; + if (ioctl(whichzap, DAHDI_SET_BUFINFO, &bi)) { fprintf(stderr, "Unable to set buffer information!\n"); return -1; } @@ -703,8 +700,8 @@ static int acim_tune(int whichzap, char *dialstr, int delayuntilsilence, int sil /* Flush buffers */ - x = ZT_FLUSH_READ | ZT_FLUSH_WRITE | ZT_FLUSH_EVENT; - if (ioctl(whichzap, ZT_FLUSH, &x)) { + x = DAHDI_FLUSH_READ | DAHDI_FLUSH_WRITE | DAHDI_FLUSH_EVENT; + if (ioctl(whichzap, DAHDI_FLUSH, &x)) { fprintf(stderr, "Unable to flush I/O: %s\n", strerror(errno)); return -1; } @@ -723,7 +720,7 @@ retry: if (res != BUFFER_LENGTH) { int x; - ioctl(whichzap, ZT_GETEVENT, &x); + ioctl(whichzap, DAHDI_GETEVENT, &x); goto retry; } @@ -5,16 +5,17 @@ #include <stdlib.h> #include <unistd.h> #include <sys/ioctl.h> -#include "kernel/zaptel.h" +#include <dahdi/user.h> +#include <dahdi/wctdm_user.h> + #include "tonezone.h" -#include "kernel/wctdm.h" static int tones[] = { - ZT_TONE_DIALTONE, - ZT_TONE_BUSY, - ZT_TONE_RINGTONE, - ZT_TONE_CONGESTION, - ZT_TONE_DIALRECALL, + DAHDI_TONE_DIALTONE, + DAHDI_TONE_BUSY, + DAHDI_TONE_RINGTONE, + DAHDI_TONE_CONGESTION, + DAHDI_TONE_DIALRECALL, }; int main(int argc, char *argv[]) @@ -39,8 +40,8 @@ int main(int argc, char *argv[]) } if (!strcasecmp(argv[2], "ring")) { fprintf(stderr, "Ringing phone...\n"); - x = ZT_RING; - res = ioctl(fd, ZT_HOOK, &x); + x = DAHDI_RING; + res = ioctl(fd, DAHDI_HOOK, &x); if (res) { fprintf(stderr, "Unable to ring phone...\n"); } else { @@ -50,18 +51,18 @@ int main(int argc, char *argv[]) } else if (!strcasecmp(argv[2], "polarity")) { fprintf(stderr, "Twiddling polarity...\n"); x = 0; - res = ioctl(fd, ZT_SETPOLARITY, &x); + res = ioctl(fd, DAHDI_SETPOLARITY, &x); if (res) { fprintf(stderr, "Unable to polarity...\n"); } else { fprintf(stderr, "Polarity is forward...\n"); sleep(2); x = 1; - ioctl(fd, ZT_SETPOLARITY, &x); + ioctl(fd, DAHDI_SETPOLARITY, &x); fprintf(stderr, "Polarity is reversed...\n"); sleep(5); x = 0; - ioctl(fd, ZT_SETPOLARITY, &x); + ioctl(fd, DAHDI_SETPOLARITY, &x); fprintf(stderr, "Polarity is forward...\n"); sleep(2); } diff --git a/hdlcstress.c b/hdlcstress.c index 91af39d..694dea0 100644 --- a/hdlcstress.c +++ b/hdlcstress.c @@ -2,13 +2,13 @@ #include <fcntl.h> #include <string.h> #include <errno.h> -#include "kernel/zaptel.h" #include <stdio.h> #include <linux/types.h> #include <linux/ppp_defs.h> #include <sys/ioctl.h> #include <unistd.h> #include <stdlib.h> +#include <dahdi/user.h> #include "bittest.h" #define FAST_HDLC_NEED_TABLES #include "kernel/fasthdlc.h" @@ -113,8 +113,8 @@ void send_packet(unsigned char *buf, int len) int main(int argc, char *argv[]) { int res, x; - ZT_PARAMS tp; - ZT_BUFFERINFO bi; + DAHDI_PARAMS tp; + DAHDI_BUFFERINFO bi; int bs = BLOCK_SIZE; unsigned char c=0; unsigned char outbuf[BLOCK_SIZE]; @@ -127,30 +127,30 @@ int main(int argc, char *argv[]) fprintf(stderr, "Unable to open %s: %s\n", argv[1], strerror(errno)); exit(1); } - if (ioctl(fd, ZT_SET_BLOCKSIZE, &bs)) { + if (ioctl(fd, DAHDI_SET_BLOCKSIZE, &bs)) { fprintf(stderr, "Unable to set block size to %d: %s\n", bs, strerror(errno)); exit(1); } - if (ioctl(fd, ZT_GET_PARAMS, &tp)) { + if (ioctl(fd, DAHDI_GET_PARAMS, &tp)) { fprintf(stderr, "Unable to get channel parameters\n"); exit(1); } - if ((tp.sigtype & ZT_SIG_HDLCRAW) == ZT_SIG_HDLCRAW) { + if ((tp.sigtype & DAHDI_SIG_HDLCRAW) == DAHDI_SIG_HDLCRAW) { printf("In HDLC mode\n"); hdlcmode = 1; - } else if ((tp.sigtype & ZT_SIG_CLEAR) == ZT_SIG_CLEAR) { + } else if ((tp.sigtype & DAHDI_SIG_CLEAR) == DAHDI_SIG_CLEAR) { printf("In CLEAR mode\n"); hdlcmode = 0; } else { fprintf(stderr, "Not in a reasonable mode\n"); exit(1); } - res = ioctl(fd, ZT_GET_BUFINFO, &bi); + res = ioctl(fd, DAHDI_GET_BUFINFO, &bi); if (!res) { - bi.txbufpolicy = ZT_POLICY_IMMEDIATE; - bi.rxbufpolicy = ZT_POLICY_IMMEDIATE; + bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE; + bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE; bi.numbufs = 4; - res = ioctl(fd, ZT_SET_BUFINFO, &bi); + res = ioctl(fd, DAHDI_SET_BUFINFO, &bi); if (res < 0) { fprintf(stderr, "Unable to set buf info: %s\n", strerror(errno)); exit(1); @@ -159,7 +159,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Unable to get buf info: %s\n", strerror(errno)); exit(1); } - ioctl(fd, ZT_GETEVENT); + ioctl(fd, DAHDI_GETEVENT); fasthdlc_precalc(); fasthdlc_init(&fs); #if 0 @@ -2,13 +2,13 @@ #include <fcntl.h> #include <string.h> #include <errno.h> -#include "kernel/zaptel.h" #include <stdio.h> #include <linux/types.h> #include <linux/ppp_defs.h> #include <sys/ioctl.h> #include <unistd.h> #include <stdlib.h> +#include <dahdi/user.h> #include "bittest.h" #define FAST_HDLC_NEED_TABLES #include "kernel/fasthdlc.h" @@ -131,8 +131,8 @@ int main(int argc, char *argv[]) { int fd; int res, x; - ZT_PARAMS tp; - ZT_BUFFERINFO bi; + DAHDI_PARAMS tp; + DAHDI_BUFFERINFO bi; int bs = BLOCK_SIZE; int pos = 0; unsigned char inbuf[BLOCK_SIZE]; @@ -156,30 +156,30 @@ int main(int argc, char *argv[]) fprintf(stderr, "Unable to open %s: %s\n", argv[1], strerror(errno)); exit(1); } - if (ioctl(fd, ZT_SET_BLOCKSIZE, &bs)) { + if (ioctl(fd, DAHDI_SET_BLOCKSIZE, &bs)) { fprintf(stderr, "Unable to set block size to %d: %s\n", bs, strerror(errno)); exit(1); } - if (ioctl(fd, ZT_GET_PARAMS, &tp)) { + if (ioctl(fd, DAHDI_GET_PARAMS, &tp)) { fprintf(stderr, "Unable to get channel parameters\n"); exit(1); } - if ((tp.sigtype & ZT_SIG_HDLCRAW) == ZT_SIG_HDLCRAW) { + if ((tp.sigtype & DAHDI_SIG_HDLCRAW) == DAHDI_SIG_HDLCRAW) { printf("In HDLC mode\n"); hdlcmode = 1; - } else if ((tp.sigtype & ZT_SIG_CLEAR) == ZT_SIG_CLEAR) { + } else if ((tp.sigtype & DAHDI_SIG_CLEAR) == DAHDI_SIG_CLEAR) { printf("In CLEAR mode\n"); hdlcmode = 0; } else { fprintf(stderr, "Not in a reasonable mode\n"); exit(1); } - res = ioctl(fd, ZT_GET_BUFINFO, &bi); + res = ioctl(fd, DAHDI_GET_BUFINFO, &bi); if (!res) { - bi.txbufpolicy = ZT_POLICY_IMMEDIATE; - bi.rxbufpolicy = ZT_POLICY_IMMEDIATE; + bi.txbufpolicy = DAHDI_POLICY_IMMEDIATE; + bi.rxbufpolicy = DAHDI_POLICY_IMMEDIATE; bi.numbufs = 4; - res = ioctl(fd, ZT_SET_BUFINFO, &bi); + res = ioctl(fd, DAHDI_SET_BUFINFO, &bi); if (res < 0) { fprintf(stderr, "Unable to set buf info: %s\n", strerror(errno)); exit(1); @@ -188,7 +188,7 @@ int main(int argc, char *argv[]) fprintf(stderr, "Unable to get buf info: %s\n", strerror(errno)); exit(1); } - ioctl(fd, ZT_GETEVENT); + ioctl(fd, DAHDI_GETEVENT); fasthdlc_precalc(); fasthdlc_init(&fs); for(;;) { @@ -196,7 +196,7 @@ int main(int argc, char *argv[]) if (hdlcmode) { if (res < 0) { if (errno == ELAST) { - if (ioctl(fd, ZT_GETEVENT, &x) < 0) { + if (ioctl(fd, DAHDI_GETEVENT, &x) < 0) { fprintf(stderr, "Unaable to get event: %s\n", strerror(errno)); exit(1); } @@ -10,11 +10,7 @@ #include <stdlib.h> #include "bittest.h" -#ifdef STANDALONE_ZAPATA -#include "kernel/zaptel.h" -#else -#include <zaptel/zaptel.h> -#endif +#include <dahdi/user.h> /* #define BLOCK_SIZE 2048 */ #define BLOCK_SIZE 2041 @@ -32,7 +28,7 @@ int main(int argc, char *argv[]) { int fd; int res, res1, x; - ZT_PARAMS tp; + DAHDI_PARAMS tp; int bs = BLOCK_SIZE; unsigned char c=0; unsigned char outbuf[BLOCK_SIZE]; @@ -45,15 +41,15 @@ int main(int argc, char *argv[]) fprintf(stderr, "Unable to open %s: %s\n", argv[1], strerror(errno)); exit(1); } - if (ioctl(fd, ZT_SET_BLOCKSIZE, &bs)) { + if (ioctl(fd, DAHDI_SET_BLOCKSIZE, &bs)) { fprintf(stderr, "Unable to set block size to %d: %s\n", bs, strerror(errno)); exit(1); } - if (ioctl(fd, ZT_GET_PARAMS, &tp)) { + if (ioctl(fd, DAHDI_GET_PARAMS, &tp)) { fprintf(stderr, "Unable to get channel parameters\n"); exit(1); } - ioctl(fd, ZT_GETEVENT); + ioctl(fd, DAHDI_GETEVENT); #if 0 print_packet(outbuf, res); printf("FCS is %x, PPP_GOODFCS is %x\n", @@ -68,22 +64,22 @@ int main(int argc, char *argv[]) res1 = write(fd, outbuf, res); if (res1 < res) { int e; - ZT_SPANINFO zi; - res = ioctl(fd,ZT_GETEVENT,&e); + DAHDI_SPANINFO zi; + res = ioctl(fd,DAHDI_GETEVENT,&e); if (res == -1) { - perror("ZT_GETEVENT"); + perror("DAHDI_GETEVENT"); exit(1); } - if (e == ZT_EVENT_NOALARM) + if (e == DAHDI_EVENT_NOALARM) printf("ALARMS CLEARED\n"); - if (e == ZT_EVENT_ALARM) + if (e == DAHDI_EVENT_ALARM) { zi.spanno = 0; - res = ioctl(fd,ZT_SPANSTAT,&zi); + res = ioctl(fd,DAHDI_SPANSTAT,&zi); if (res == -1) { - perror("ZT_SPANSTAT"); + perror("DAHDI_SPANSTAT"); exit(1); } printf("Alarm mask %x hex\n",zi.alarms); diff --git a/patlooptest.c b/patlooptest.c index 738da63..c53cf96 100644 --- a/patlooptest.c +++ b/patlooptest.c @@ -8,11 +8,7 @@ #include <stdlib.h> #include <time.h> -#ifdef STANDALONE_ZAPATA -#include "kernel/zaptel.h" -#else -#include <zaptel/zaptel.h> -#endif +#include <dahdi/user.h> #define BLOCK_SIZE 2039 @@ -30,7 +26,7 @@ int main(int argc, char *argv[]) int fd; int res, x; int i; - ZT_PARAMS tp; + DAHDI_PARAMS tp; int bs = BLOCK_SIZE; int skipcount = 10; unsigned char c=0,c1=0; @@ -50,18 +46,18 @@ int main(int argc, char *argv[]) fprintf(stderr, "Unable to open %s: %s\n", argv[1], strerror(errno)); exit(1); } - if (ioctl(fd, ZT_SET_BLOCKSIZE, &bs)) { + if (ioctl(fd, DAHDI_SET_BLOCKSIZE, &bs)) { fprintf(stderr, "Unable to set block size to %d: %s\n", bs, strerror(errno)); exit(1); } - if (ioctl(fd, ZT_GET_PARAMS, &tp)) { + if (ioctl(fd, DAHDI_GET_PARAMS, &tp)) { fprintf(stderr, "Unable to get channel parameters\n"); exit(1); } - ioctl(fd, ZT_GETEVENT); + ioctl(fd, DAHDI_GETEVENT); - i = ZT_FLUSH_ALL; - if (ioctl(fd,ZT_FLUSH,&i) == -1) + i = DAHDI_FLUSH_ALL; + if (ioctl(fd,DAHDI_FLUSH,&i) == -1) { perror("tor_flush"); exit(255); @@ -81,7 +77,7 @@ int main(int argc, char *argv[]) if (res != bs) { printf("Res is %d: %s\n", res, strerror(errno)); - ioctl(fd, ZT_GETEVENT, &x); + ioctl(fd, DAHDI_GETEVENT, &x); printf("Event: %d\n", x); exit(1); } @@ -10,11 +10,7 @@ #include <stdlib.h> #include "bittest.h" -#ifdef STANDALONE_ZAPATA -#include "kernel/zaptel.h" -#else -#include <zaptel/zaptel.h> -#endif +#include <dahdi/user.h> #define BLOCK_SIZE 2039 @@ -31,7 +27,7 @@ int main(int argc, char *argv[]) { int fd; int res, x; - ZT_PARAMS tp; + DAHDI_PARAMS tp; int bs = BLOCK_SIZE; unsigned char c=0; unsigned char outbuf[BLOCK_SIZE]; @@ -47,36 +43,36 @@ int main(int argc, char *argv[]) fprintf(stderr, "Unable to open %s: %s\n", argv[1], strerror(errno)); exit(1); } - if (ioctl(fd, ZT_SET_BLOCKSIZE, &bs)) { + if (ioctl(fd, DAHDI_SET_BLOCKSIZE, &bs)) { fprintf(stderr, "Unable to set block size to %d: %s\n", bs, strerror(errno)); exit(1); } - if (ioctl(fd, ZT_GET_PARAMS, &tp)) { + if (ioctl(fd, DAHDI_GET_PARAMS, &tp)) { fprintf(stderr, "Unable to get channel parameters\n"); exit(1); } - ioctl(fd, ZT_GETEVENT); + ioctl(fd, DAHDI_GETEVENT); for(;;) { res = bs; res = read(fd, outbuf, res); if (res < bs) { int e; - ZT_SPANINFO zi; - res = ioctl(fd,ZT_GETEVENT,&e); + DAHDI_SPANINFO zi; + res = ioctl(fd,DAHDI_GETEVENT,&e); if (res == -1) { - perror("ZT_GETEVENT"); + perror("DAHDI_GETEVENT"); exit(1); } - if (e == ZT_EVENT_NOALARM) + if (e == DAHDI_EVENT_NOALARM) printf("ALARMS CLEARED\n"); - if (e == ZT_EVENT_ALARM) + if (e == DAHDI_EVENT_ALARM) { zi.spanno = 0; - res = ioctl(fd,ZT_SPANSTAT,&zi); + res = ioctl(fd,DAHDI_SPANSTAT,&zi); if (res == -1) { - perror("ZT_SPANSTAT"); + perror("DAHDI_SPANSTAT"); exit(1); } printf("Alarm mask %x hex\n",zi.alarms); @@ -22,7 +22,8 @@ #include <sys/socket.h> #include <linux/if.h> #include <linux/sockios.h> -#include "kernel/zaptel.h" + +#include <dahdi/user.h> #if GENERIC_HDLC_VERSION != 4 #error Generic HDLC layer version mismatch, please get correct sethdlc.c @@ -674,7 +675,7 @@ int main(int arg_c, char *arg_v[]) if (sock < 0) error("Unable to create socket: %s\n", strerror(errno)); - zap_copy_string(req.ifr_name, argv[1], sizeof(req.ifr_name)); /* Device name */ + dahdi_copy_string(req.ifr_name, argv[1], sizeof(req.ifr_name)); /* Device name */ if (argc == 2) show_port(); diff --git a/timertest.c b/timertest.c index 3a0c2e4..28e76ed 100644 --- a/timertest.c +++ b/timertest.c @@ -8,11 +8,7 @@ #include <sys/time.h> #include <errno.h> -#ifdef STANDALONE_ZAPATA -#include "kernel/zaptel.h" -#else -#include <zaptel/zaptel.h> -#endif +#include <dahdi/user.h> int main(int argc, char *argv[]) { @@ -27,7 +23,7 @@ int main(int argc, char *argv[]) exit(1); } printf("Opened timer...\n"); - if (ioctl(fd, ZT_TIMERCONFIG, &x)) { + if (ioctl(fd, DAHDI_TIMERCONFIG, &x)) { fprintf(stderr, "Unable to set timer: %s\n", strerror(errno)); exit(1); } @@ -43,7 +39,7 @@ int main(int argc, char *argv[]) exit(1); } x = -1; - if (ioctl(fd, ZT_TIMERACK, &x)) { + if (ioctl(fd, DAHDI_TIMERACK, &x)) { fprintf(stderr, "Unable to ack timer: %s\n", strerror(errno)); exit(1); } @@ -30,10 +30,10 @@ #include <unistd.h> #include <errno.h> -#include "kernel/zaptel.h" +#include "dahdi/user.h" #include "tonezone.h" -#define DEFAULT_ZT_DEV "/dev/zap/ctl" +#define DEFAULT_DAHDI_DEV "/dev/zap/ctl" #define MAX_SIZE 16384 #define CLIP 32635 @@ -68,7 +68,7 @@ struct tone_zone *tone_zone_find_by_num(int id) static int build_tone(void *data, int size, struct tone_zone_sound *t, int *count) { char *dup, *s; - struct zt_tone_def *td=NULL; + struct dahdi_tone_def *td=NULL; int firstnobang = -1; int freq1, freq2, time; int modulate = 0; @@ -176,27 +176,27 @@ char *tone_zone_tone_name(int id) { static char tmp[80]; switch(id) { - case ZT_TONE_DIALTONE: + case DAHDI_TONE_DIALTONE: return "Dialtone"; - case ZT_TONE_BUSY: + case DAHDI_TONE_BUSY: return "Busy"; - case ZT_TONE_RINGTONE: + case DAHDI_TONE_RINGTONE: return "Ringtone"; - case ZT_TONE_CONGESTION: + case DAHDI_TONE_CONGESTION: return "Congestion"; - case ZT_TONE_CALLWAIT: + case DAHDI_TONE_CALLWAIT: return "Call Waiting"; - case ZT_TONE_DIALRECALL: + case DAHDI_TONE_DIALRECALL: return "Dial Recall"; - case ZT_TONE_RECORDTONE: + case DAHDI_TONE_RECORDTONE: return "Record Tone"; - case ZT_TONE_CUST1: + case DAHDI_TONE_CUST1: return "Custom 1"; - case ZT_TONE_CUST2: + case DAHDI_TONE_CUST2: return "Custom 2"; - case ZT_TONE_INFO: + case DAHDI_TONE_INFO: return "Special Information"; - case ZT_TONE_STUTTER: + case DAHDI_TONE_STUTTER: return "Stutter Dialtone"; default: snprintf(tmp, sizeof(tmp), "Unknown tone %d", id); @@ -207,8 +207,8 @@ char *tone_zone_tone_name(int id) #ifdef TONEZONE_DRIVER static void dump_tone_zone(void *data, int size) { - struct zt_tone_def_header *z; - struct zt_tone_def *td; + struct dahdi_tone_def_header *z; + struct dahdi_tone_def *td; int x; int len = sizeof(*z); @@ -235,85 +235,85 @@ struct mf_tone { }; static struct mf_tone dtmf_tones[] = { - { ZT_TONE_DTMF_0, 941.0, 1336.0 }, - { ZT_TONE_DTMF_1, 697.0, 1209.0 }, - { ZT_TONE_DTMF_2, 697.0, 1336.0 }, - { ZT_TONE_DTMF_3, 697.0, 1477.0 }, - { ZT_TONE_DTMF_4, 770.0, 1209.0 }, - { ZT_TONE_DTMF_5, 770.0, 1336.0 }, - { ZT_TONE_DTMF_6, 770.0, 1477.0 }, - { ZT_TONE_DTMF_7, 852.0, 1209.0 }, - { ZT_TONE_DTMF_8, 852.0, 1336.0 }, - { ZT_TONE_DTMF_9, 852.0, 1477.0 }, - { ZT_TONE_DTMF_s, 941.0, 1209.0 }, - { ZT_TONE_DTMF_p, 941.0, 1477.0 }, - { ZT_TONE_DTMF_A, 697.0, 1633.0 }, - { ZT_TONE_DTMF_B, 770.0, 1633.0 }, - { ZT_TONE_DTMF_C, 852.0, 1633.0 }, - { ZT_TONE_DTMF_D, 941.0, 1633.0 }, + { DAHDI_TONE_DTMF_0, 941.0, 1336.0 }, + { DAHDI_TONE_DTMF_1, 697.0, 1209.0 }, + { DAHDI_TONE_DTMF_2, 697.0, 1336.0 }, + { DAHDI_TONE_DTMF_3, 697.0, 1477.0 }, + { DAHDI_TONE_DTMF_4, 770.0, 1209.0 }, + { DAHDI_TONE_DTMF_5, 770.0, 1336.0 }, + { DAHDI_TONE_DTMF_6, 770.0, 1477.0 }, + { DAHDI_TONE_DTMF_7, 852.0, 1209.0 }, + { DAHDI_TONE_DTMF_8, 852.0, 1336.0 }, + { DAHDI_TONE_DTMF_9, 852.0, 1477.0 }, + { DAHDI_TONE_DTMF_s, 941.0, 1209.0 }, + { DAHDI_TONE_DTMF_p, 941.0, 1477.0 }, + { DAHDI_TONE_DTMF_A, 697.0, 1633.0 }, + { DAHDI_TONE_DTMF_B, 770.0, 1633.0 }, + { DAHDI_TONE_DTMF_C, 852.0, 1633.0 }, + { DAHDI_TONE_DTMF_D, 941.0, 1633.0 }, { 0, 0, 0 } }; static struct mf_tone mfr1_tones[] = { - { ZT_TONE_MFR1_0, 1300.0, 1500.0 }, - { ZT_TONE_MFR1_1, 700.0, 900.0 }, - { ZT_TONE_MFR1_2, 700.0, 1100.0 }, - { ZT_TONE_MFR1_3, 900.0, 1100.0 }, - { ZT_TONE_MFR1_4, 700.0, 1300.0 }, - { ZT_TONE_MFR1_5, 900.0, 1300.0 }, - { ZT_TONE_MFR1_6, 1100.0, 1300.0 }, - { ZT_TONE_MFR1_7, 700.0, 1500.0 }, - { ZT_TONE_MFR1_8, 900.0, 1500.0 }, - { ZT_TONE_MFR1_9, 1100.0, 1500.0 }, - { ZT_TONE_MFR1_KP, 1100.0, 1700.0 }, /* KP */ - { ZT_TONE_MFR1_ST, 1500.0, 1700.0 }, /* ST */ - { ZT_TONE_MFR1_STP, 900.0, 1700.0 }, /* KP' or ST' */ - { ZT_TONE_MFR1_ST2P, 1300.0, 1700.0 }, /* KP'' or ST'' */ - { ZT_TONE_MFR1_ST3P, 700.0, 1700.0 }, /* KP''' or ST''' */ + { DAHDI_TONE_MFR1_0, 1300.0, 1500.0 }, + { DAHDI_TONE_MFR1_1, 700.0, 900.0 }, + { DAHDI_TONE_MFR1_2, 700.0, 1100.0 }, + { DAHDI_TONE_MFR1_3, 900.0, 1100.0 }, + { DAHDI_TONE_MFR1_4, 700.0, 1300.0 }, + { DAHDI_TONE_MFR1_5, 900.0, 1300.0 }, + { DAHDI_TONE_MFR1_6, 1100.0, 1300.0 }, + { DAHDI_TONE_MFR1_7, 700.0, 1500.0 }, + { DAHDI_TONE_MFR1_8, 900.0, 1500.0 }, + { DAHDI_TONE_MFR1_9, 1100.0, 1500.0 }, + { DAHDI_TONE_MFR1_KP, 1100.0, 1700.0 }, /* KP */ + { DAHDI_TONE_MFR1_ST, 1500.0, 1700.0 }, /* ST */ + { DAHDI_TONE_MFR1_STP, 900.0, 1700.0 }, /* KP' or ST' */ + { DAHDI_TONE_MFR1_ST2P, 1300.0, 1700.0 }, /* KP'' or ST'' */ + { DAHDI_TONE_MFR1_ST3P, 700.0, 1700.0 }, /* KP''' or ST''' */ { 0, 0, 0 } }; static struct mf_tone mfr2_fwd_tones[] = { - { ZT_TONE_MFR2_FWD_1, 1380.0, 1500.0 }, - { ZT_TONE_MFR2_FWD_2, 1380.0, 1620.0 }, - { ZT_TONE_MFR2_FWD_3, 1500.0, 1620.0 }, - { ZT_TONE_MFR2_FWD_4, 1380.0, 1740.0 }, - { ZT_TONE_MFR2_FWD_5, 1500.0, 1740.0 }, - { ZT_TONE_MFR2_FWD_6, 1620.0, 1740.0 }, - { ZT_TONE_MFR2_FWD_7, 1380.0, 1860.0 }, - { ZT_TONE_MFR2_FWD_8, 1500.0, 1860.0 }, - { ZT_TONE_MFR2_FWD_9, 1620.0, 1860.0 }, - { ZT_TONE_MFR2_FWD_10, 1740.0, 1860.0 }, - { ZT_TONE_MFR2_FWD_11, 1380.0, 1980.0 }, - { ZT_TONE_MFR2_FWD_12, 1500.0, 1980.0 }, - { ZT_TONE_MFR2_FWD_13, 1620.0, 1980.0 }, - { ZT_TONE_MFR2_FWD_14, 1740.0, 1980.0 }, - { ZT_TONE_MFR2_FWD_15, 1860.0, 1980.0 }, + { DAHDI_TONE_MFR2_FWD_1, 1380.0, 1500.0 }, + { DAHDI_TONE_MFR2_FWD_2, 1380.0, 1620.0 }, + { DAHDI_TONE_MFR2_FWD_3, 1500.0, 1620.0 }, + { DAHDI_TONE_MFR2_FWD_4, 1380.0, 1740.0 }, + { DAHDI_TONE_MFR2_FWD_5, 1500.0, 1740.0 }, + { DAHDI_TONE_MFR2_FWD_6, 1620.0, 1740.0 }, + { DAHDI_TONE_MFR2_FWD_7, 1380.0, 1860.0 }, + { DAHDI_TONE_MFR2_FWD_8, 1500.0, 1860.0 }, + { DAHDI_TONE_MFR2_FWD_9, 1620.0, 1860.0 }, + { DAHDI_TONE_MFR2_FWD_10, 1740.0, 1860.0 }, + { DAHDI_TONE_MFR2_FWD_11, 1380.0, 1980.0 }, + { DAHDI_TONE_MFR2_FWD_12, 1500.0, 1980.0 }, + { DAHDI_TONE_MFR2_FWD_13, 1620.0, 1980.0 }, + { DAHDI_TONE_MFR2_FWD_14, 1740.0, 1980.0 }, + { DAHDI_TONE_MFR2_FWD_15, 1860.0, 1980.0 }, { 0, 0, 0 } }; static struct mf_tone mfr2_rev_tones[] = { - { ZT_TONE_MFR2_REV_1, 1020.0, 1140.0 }, - { ZT_TONE_MFR2_REV_2, 900.0, 1140.0 }, - { ZT_TONE_MFR2_REV_3, 900.0, 1020.0 }, - { ZT_TONE_MFR2_REV_4, 780.0, 1140.0 }, - { ZT_TONE_MFR2_REV_5, 780.0, 1020.0 }, - { ZT_TONE_MFR2_REV_6, 780.0, 900.0 }, - { ZT_TONE_MFR2_REV_7, 660.0, 1140.0 }, - { ZT_TONE_MFR2_REV_8, 660.0, 1020.0 }, - { ZT_TONE_MFR2_REV_9, 660.0, 900.0 }, - { ZT_TONE_MFR2_REV_10, 660.0, 780.0 }, - { ZT_TONE_MFR2_REV_11, 540.0, 1140.0 }, - { ZT_TONE_MFR2_REV_12, 540.0, 1020.0 }, - { ZT_TONE_MFR2_REV_13, 540.0, 900.0 }, - { ZT_TONE_MFR2_REV_14, 540.0, 780.0 }, - { ZT_TONE_MFR2_REV_15, 540.0, 660.0 }, + { DAHDI_TONE_MFR2_REV_1, 1020.0, 1140.0 }, + { DAHDI_TONE_MFR2_REV_2, 900.0, 1140.0 }, + { DAHDI_TONE_MFR2_REV_3, 900.0, 1020.0 }, + { DAHDI_TONE_MFR2_REV_4, 780.0, 1140.0 }, + { DAHDI_TONE_MFR2_REV_5, 780.0, 1020.0 }, + { DAHDI_TONE_MFR2_REV_6, 780.0, 900.0 }, + { DAHDI_TONE_MFR2_REV_7, 660.0, 1140.0 }, + { DAHDI_TONE_MFR2_REV_8, 660.0, 1020.0 }, + { DAHDI_TONE_MFR2_REV_9, 660.0, 900.0 }, + { DAHDI_TONE_MFR2_REV_10, 660.0, 780.0 }, + { DAHDI_TONE_MFR2_REV_11, 540.0, 1140.0 }, + { DAHDI_TONE_MFR2_REV_12, 540.0, 1020.0 }, + { DAHDI_TONE_MFR2_REV_13, 540.0, 900.0 }, + { DAHDI_TONE_MFR2_REV_14, 540.0, 780.0 }, + { DAHDI_TONE_MFR2_REV_15, 540.0, 660.0 }, { 0, 0, 0 } }; static int build_mf_tones(void *data, int size, int *count, struct mf_tone *tone, int low_tone_level, int high_tone_level) { - struct zt_tone_def *td; + struct dahdi_tone_def *td; float gain; int used = 0; @@ -355,7 +355,7 @@ int tone_zone_register_zone(int fd, struct tone_zone *z) int space = MAX_SIZE; void *ptr = buf; int iopenedit = 1; - struct zt_tone_def_header *h; + struct dahdi_tone_def_header *h; memset(buf, 0, sizeof(buf)); @@ -364,12 +364,12 @@ int tone_zone_register_zone(int fd, struct tone_zone *z) space -= sizeof(*h); h->zone = z->zone; - zap_copy_string(h->name, z->description, sizeof(h->name)); + dahdi_copy_string(h->name, z->description, sizeof(h->name)); - for (x = 0; x < ZT_MAX_CADENCE; x++) + for (x = 0; x < DAHDI_MAX_CADENCE; x++) h->ringcadence[x] = z->ringcadence[x]; - for (x = 0; x < ZT_TONE_MAX; x++) { + for (x = 0; x < DAHDI_TONE_MAX; x++) { if (!strlen(z->tones[x].data)) continue; @@ -415,17 +415,17 @@ int tone_zone_register_zone(int fd, struct tone_zone *z) h->count = count; if (fd < 0) { - if ((fd = open(DEFAULT_ZT_DEV, O_RDWR)) < 0) { - fprintf(stderr, "Unable to open %s and fd not provided\n", DEFAULT_ZT_DEV); + if ((fd = open(DEFAULT_DAHDI_DEV, O_RDWR)) < 0) { + fprintf(stderr, "Unable to open %s and fd not provided\n", DEFAULT_DAHDI_DEV); return -1; } iopenedit = 1; } x = z->zone; - if ((res = ioctl(fd, ZT_FREEZONE, &x))) { + if ((res = ioctl(fd, DAHDI_FREEZONE, &x))) { if (errno != EBUSY) - fprintf(stderr, "ioctl(ZT_FREEZONE) failed: %s\n", strerror(errno)); + fprintf(stderr, "ioctl(DAHDI_FREEZONE) failed: %s\n", strerror(errno)); return res; } @@ -433,8 +433,8 @@ int tone_zone_register_zone(int fd, struct tone_zone *z) dump_tone_zone(h, MAX_SIZE - space); #endif - if ((res = ioctl(fd, ZT_LOADZONE, h))) { - fprintf(stderr, "ioctl(ZT_LOADZONE) failed: %s\n", strerror(errno)); + if ((res = ioctl(fd, DAHDI_LOADZONE, h))) { + fprintf(stderr, "ioctl(DAHDI_LOADZONE) failed: %s\n", strerror(errno)); return res; } @@ -462,10 +462,10 @@ int tone_zone_set_zone(int fd, char *country) if (fd > -1) { z = tone_zone_find(country); if (z) - res = ioctl(fd, ZT_SETTONEZONE, &z->zone); + res = ioctl(fd, DAHDI_SETTONEZONE, &z->zone); if ((res < 0) && (errno == ENODATA)) { tone_zone_register_zone(fd, z); - res = ioctl(fd, ZT_SETTONEZONE, &z->zone); + res = ioctl(fd, DAHDI_SETTONEZONE, &z->zone); } } return res; @@ -475,7 +475,7 @@ int tone_zone_get_zone(int fd) { int x=-1; if (fd > -1) { - ioctl(fd, ZT_GETTONEZONE, &x); + ioctl(fd, DAHDI_GETTONEZONE, &x); return x; } return -1; @@ -491,18 +491,18 @@ int tone_zone_play_tone(int fd, int tone) fprintf(stderr, "Playing tone %d (%s) on %d\n", tone, tone_zone_tone_name(tone), fd); #endif if (fd > -1) { - res = ioctl(fd, ZT_SENDTONE, &tone); + res = ioctl(fd, DAHDI_SENDTONE, &tone); if ((res < 0) && (errno == ENODATA)) { - ioctl(fd, ZT_GETTONEZONE, &zone); + ioctl(fd, DAHDI_GETTONEZONE, &zone); z = tone_zone_find_by_num(zone); if (z) { res = tone_zone_register_zone(fd, z); /* Recall the zone */ - ioctl(fd, ZT_SETTONEZONE, &zone); + ioctl(fd, DAHDI_SETTONEZONE, &zone); if (res < 0) { fprintf(stderr, "Failed to register zone '%s': %s\n", z->description, strerror(errno)); } else { - res = ioctl(fd, ZT_SENDTONE, &tone); + res = ioctl(fd, DAHDI_SENDTONE, &tone); } } else fprintf(stderr, "Don't know anything about zone %d\n", zone); @@ -24,11 +24,7 @@ #ifndef _TONEZONE_H #define _TONEZONE_H -#ifdef STANDALONE_ZAPATA -#include "kernel/zaptel.h" -#else -#include <zaptel/zaptel.h> -#endif +#include <dahdi/user.h> struct tone_zone_sound { int toneid; @@ -44,8 +40,8 @@ struct tone_zone { int zone; /* Zone number */ char country[10]; /* Country code */ char description[40]; /* Description */ - int ringcadence[ZT_MAX_CADENCE]; /* Ring cadence */ - struct tone_zone_sound tones[ZT_TONE_MAX]; + int ringcadence[DAHDI_MAX_CADENCE]; /* Ring cadence */ + struct tone_zone_sound tones[DAHDI_TONE_MAX]; int dtmf_high_level; /* Power level of high frequency component of DTMF, expressed in dBm0. */ int dtmf_low_level; /* Power level of low frequency component @@ -32,15 +32,15 @@ struct tone_zone builtin_zones[] = .description = "United States / North America", .ringcadence = { 2000, 4000 }, .tones = { - { ZT_TONE_DIALTONE, "350+440" }, - { ZT_TONE_BUSY, "480+620/500,0/500" }, - { ZT_TONE_RINGTONE, "440+480/2000,0/4000" }, - { ZT_TONE_CONGESTION, "480+620/250,0/250" }, - { ZT_TONE_CALLWAIT, "440/300,0/10000" }, - { ZT_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,0" }, - { ZT_TONE_STUTTER, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, + { DAHDI_TONE_DIALTONE, "350+440" }, + { DAHDI_TONE_BUSY, "480+620/500,0/500" }, + { DAHDI_TONE_RINGTONE, "440+480/2000,0/4000" }, + { DAHDI_TONE_CONGESTION, "480+620/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "440/300,0/10000" }, + { DAHDI_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,0" }, + { DAHDI_TONE_STUTTER, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -52,16 +52,16 @@ struct tone_zone builtin_zones[] = .description = "Australia", .ringcadence = { 400, 200, 400, 2000 }, .tones = { - { ZT_TONE_DIALTONE, "413+438" }, - { ZT_TONE_BUSY, "425/375,0/375" }, - { ZT_TONE_RINGTONE, "413+438/400,0/200,413+438/400,0/2000" }, + { DAHDI_TONE_DIALTONE, "413+438" }, + { DAHDI_TONE_BUSY, "425/375,0/375" }, + { DAHDI_TONE_RINGTONE, "413+438/400,0/200,413+438/400,0/2000" }, /* XXX Congestion: Should reduce by 10 db every other cadence XXX */ - { ZT_TONE_CONGESTION, "425/375,0/375,420/375,0/375" }, - { ZT_TONE_CALLWAIT, "425/100,0/200,425/200,0/4400" }, - { ZT_TONE_DIALRECALL, "413+428" }, - { ZT_TONE_RECORDTONE, "!425/1000,!0/15000,425/360,0/15000" }, - { ZT_TONE_INFO, "425/2500,0/500" }, - { ZT_TONE_STUTTER, "413+438/100,0/40" }, + { DAHDI_TONE_CONGESTION, "425/375,0/375,420/375,0/375" }, + { DAHDI_TONE_CALLWAIT, "425/100,0/200,425/200,0/4400" }, + { DAHDI_TONE_DIALRECALL, "413+428" }, + { DAHDI_TONE_RECORDTONE, "!425/1000,!0/15000,425/360,0/15000" }, + { DAHDI_TONE_INFO, "425/2500,0/500" }, + { DAHDI_TONE_STUTTER, "413+438/100,0/40" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -75,18 +75,18 @@ struct tone_zone builtin_zones[] = .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ /* Dialtone can also be 440+330 */ - { ZT_TONE_DIALTONE, "440" }, - { ZT_TONE_BUSY, "440/500,0/500" }, - { ZT_TONE_RINGTONE, "440/1500,0/3500" }, + { DAHDI_TONE_DIALTONE, "440" }, + { DAHDI_TONE_BUSY, "440/500,0/500" }, + { DAHDI_TONE_RINGTONE, "440/1500,0/3500" }, /* CONGESTION - not specified */ - { ZT_TONE_CONGESTION, "440/250,0/250" }, - { ZT_TONE_CALLWAIT, "440/300,0/10000" }, + { DAHDI_TONE_CONGESTION, "440/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "440/300,0/10000" }, /* DIALRECALL - not specified */ - { ZT_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, + { DAHDI_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,0" }, - { ZT_TONE_STUTTER, "!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,440" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,0" }, + { DAHDI_TONE_STUTTER, "!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,!440/100,!0/100,440" }, }, .dtmf_high_level = -11, .dtmf_low_level = -9, @@ -100,17 +100,17 @@ struct tone_zone builtin_zones[] = .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ /* Most of these 425's can also be 450's */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/500,0/500" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/250,0/250" }, - { ZT_TONE_CALLWAIT, "425/500,0/9500" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/500,0/500" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "425/500,0/9500" }, /* DIALRECALL - not specified */ - { ZT_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, + { DAHDI_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, - { ZT_TONE_STUTTER, "425/500,0/50" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, + { DAHDI_TONE_STUTTER, "425/500,0/50" }, }, .dtmf_high_level = -11, .dtmf_low_level = -9, @@ -123,15 +123,15 @@ struct tone_zone builtin_zones[] = .ringcadence = { 400, 200, 400, 2000 }, .tones = { /* From British Telecom SIN350 v1.2 */ - { ZT_TONE_DIALTONE, "350+440" }, - { ZT_TONE_BUSY, "400/375,0/375" }, - { ZT_TONE_RINGTONE, "400+450/400,0/200,400+450/400,0/2000" }, - { ZT_TONE_CONGESTION, "400/400,0/350,400/225,0/525" }, - { ZT_TONE_CALLWAIT, "400/100,0/4000" }, - { ZT_TONE_DIALRECALL, "350+440" }, - { ZT_TONE_RECORDTONE, "1400/500,0/60000" }, - { ZT_TONE_INFO, "950/330,0/15,1400/330,0/15,1800/330,0/1000" }, - { ZT_TONE_STUTTER, "350+440/750,440/750" }, + { DAHDI_TONE_DIALTONE, "350+440" }, + { DAHDI_TONE_BUSY, "400/375,0/375" }, + { DAHDI_TONE_RINGTONE, "400+450/400,0/200,400+450/400,0/2000" }, + { DAHDI_TONE_CONGESTION, "400/400,0/350,400/225,0/525" }, + { DAHDI_TONE_CALLWAIT, "400/100,0/4000" }, + { DAHDI_TONE_DIALRECALL, "350+440" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/60000" }, + { DAHDI_TONE_INFO, "950/330,0/15,1400/330,0/15,1800/330,0/1000" }, + { DAHDI_TONE_STUTTER, "350+440/750,440/750" }, }, .dtmf_high_level = -11, .dtmf_low_level = -13, @@ -143,15 +143,15 @@ struct tone_zone builtin_zones[] = .description = "Finland", .ringcadence = { 1000, 4000 }, .tones = { - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/300,0/300" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/200,0/200" }, - { ZT_TONE_CALLWAIT, "425/150,0/150,425/150,0/8000" }, - { ZT_TONE_DIALRECALL, "425/650,0/25" }, - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "950/650,0/325,950/325,0/30,1400/1300,0/2600" }, - { ZT_TONE_STUTTER, "425/650,0/25" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/300,0/300" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/200,0/200" }, + { DAHDI_TONE_CALLWAIT, "425/150,0/150,425/150,0/8000" }, + { DAHDI_TONE_DIALRECALL, "425/650,0/25" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "950/650,0/325,950/325,0/30,1400/1300,0/2600" }, + { DAHDI_TONE_STUTTER, "425/650,0/25" }, }, .dtmf_high_level = -11, .dtmf_low_level = -9, @@ -163,15 +163,15 @@ struct tone_zone builtin_zones[] = .description = "Spain", .ringcadence = { 1500, 3000}, .tones = { - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/200,0/200" }, - { ZT_TONE_RINGTONE, "425/1500,0/3000" }, - { ZT_TONE_CONGESTION, "425/200,0/200,425/200,0/200,425/200,0/600" }, - { ZT_TONE_CALLWAIT, "425/175,0/175,425/175,0/3500" }, - { ZT_TONE_DIALRECALL, "!425/200,!0/200,!425/200,!0/200,!425/200,!0/200,425" }, - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "950/330,0/1000" }, - { ZT_TONE_STUTTER, "425/500,0/50" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/200,0/200" }, + { DAHDI_TONE_RINGTONE, "425/1500,0/3000" }, + { DAHDI_TONE_CONGESTION, "425/200,0/200,425/200,0/200,425/200,0/600" }, + { DAHDI_TONE_CALLWAIT, "425/175,0/175,425/175,0/3500" }, + { DAHDI_TONE_DIALRECALL, "!425/200,!0/200,!425/200,!0/200,!425/200,!0/200,425" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "950/330,0/1000" }, + { DAHDI_TONE_STUTTER, "425/500,0/50" }, }, .dtmf_high_level = -11, .dtmf_low_level = -13, @@ -183,15 +183,15 @@ struct tone_zone builtin_zones[] = .description = "Japan", .ringcadence = { 1000, 2000 }, .tones = { - { ZT_TONE_DIALTONE, "400" }, - { ZT_TONE_BUSY, "400/500,0/500" }, - { ZT_TONE_RINGTONE, "400+15/1000,0/2000" }, - { ZT_TONE_CONGESTION, "400/500,0/500" }, - { ZT_TONE_CALLWAIT, "400+16/500,0/8000" }, - { ZT_TONE_DIALRECALL, "!400/200,!0/200,!400/200,!0/200,!400/200,!0/200,400" }, - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,0" }, - { ZT_TONE_STUTTER, "!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400" }, + { DAHDI_TONE_DIALTONE, "400" }, + { DAHDI_TONE_BUSY, "400/500,0/500" }, + { DAHDI_TONE_RINGTONE, "400+15/1000,0/2000" }, + { DAHDI_TONE_CONGESTION, "400/500,0/500" }, + { DAHDI_TONE_CALLWAIT, "400+16/500,0/8000" }, + { DAHDI_TONE_DIALRECALL, "!400/200,!0/200,!400/200,!0/200,!400/200,!0/200,400" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,0" }, + { DAHDI_TONE_STUTTER, "!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400" }, }, .dtmf_high_level = -7, .dtmf_low_level = -7, @@ -203,15 +203,15 @@ struct tone_zone builtin_zones[] = .description = "Norway", .ringcadence = { 1000, 4000 }, .tones = { - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/500,0/500" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/200,0/200" }, - { ZT_TONE_CALLWAIT, "425/200,0/600,425/200,0/10000" }, - { ZT_TONE_DIALRECALL, "470/400,425/400" }, - { ZT_TONE_RECORDTONE, "1400/400,0/15000" }, - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0" }, - { ZT_TONE_STUTTER, "470/400,425/400" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/500,0/500" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/200,0/200" }, + { DAHDI_TONE_CALLWAIT, "425/200,0/600,425/200,0/10000" }, + { DAHDI_TONE_DIALRECALL, "470/400,425/400" }, + { DAHDI_TONE_RECORDTONE, "1400/400,0/15000" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0" }, + { DAHDI_TONE_STUTTER, "470/400,425/400" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -224,16 +224,16 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 5000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "420" }, - { ZT_TONE_BUSY, "420/400,0/400" }, - { ZT_TONE_RINGTONE, "420/1000,0/5000" }, - { ZT_TONE_CONGESTION, "420/200,0/200" }, - { ZT_TONE_CALLWAIT, "420/40,0/1960" }, - { ZT_TONE_DIALRECALL, "420" }, + { DAHDI_TONE_DIALTONE, "420" }, + { DAHDI_TONE_BUSY, "420/400,0/400" }, + { DAHDI_TONE_RINGTONE, "420/1000,0/5000" }, + { DAHDI_TONE_CONGESTION, "420/200,0/200" }, + { DAHDI_TONE_CALLWAIT, "420/40,0/1960" }, + { DAHDI_TONE_DIALRECALL, "420" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/80,0/14920" }, - { ZT_TONE_INFO, "950/330,1450/330,1850/330,0/1000" }, - { ZT_TONE_STUTTER, "380+420" }, + { DAHDI_TONE_RECORDTONE, "1400/80,0/14920" }, + { DAHDI_TONE_INFO, "950/330,1450/330,1850/330,0/1000" }, + { DAHDI_TONE_STUTTER, "380+420" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -245,15 +245,15 @@ struct tone_zone builtin_zones[] = .description = "New Zealand", .ringcadence = { 400, 200, 400, 2000 }, .tones = { - { ZT_TONE_DIALTONE, "400" }, - { ZT_TONE_BUSY, "400/500,0/500" }, - { ZT_TONE_RINGTONE, "400+450/400,0/200,400+450/400,0/2000" }, - { ZT_TONE_CONGESTION, "400/250,0/250" }, - { ZT_TONE_CALLWAIT, "400/250,0/250,400/250,0/3250" }, - { ZT_TONE_DIALRECALL, "!400/100!0/100,!400/100,!0/100,!400/100,!0/100,400" }, - { ZT_TONE_RECORDTONE, "1400/425,0/15000" }, - { ZT_TONE_INFO, "400/750,0/100,400/750,0/100,400/750,0/100,400/750,0/400" }, - { ZT_TONE_STUTTER, "!400/100!0/100,!400/100,!0/100,!400/100,!0/100,!400/100!0/100,!400/100,!0/100,!400/100,!0/100,400" }, + { DAHDI_TONE_DIALTONE, "400" }, + { DAHDI_TONE_BUSY, "400/500,0/500" }, + { DAHDI_TONE_RINGTONE, "400+450/400,0/200,400+450/400,0/2000" }, + { DAHDI_TONE_CONGESTION, "400/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "400/250,0/250,400/250,0/3250" }, + { DAHDI_TONE_DIALRECALL, "!400/100!0/100,!400/100,!0/100,!400/100,!0/100,400" }, + { DAHDI_TONE_RECORDTONE, "1400/425,0/15000" }, + { DAHDI_TONE_INFO, "400/750,0/100,400/750,0/100,400/750,0/100,400/750,0/400" }, + { DAHDI_TONE_STUTTER, "!400/100!0/100,!400/100,!0/100,!400/100,!0/100,!400/100!0/100,!400/100,!0/100,!400/100,!0/100,400" }, }, .dtmf_high_level = -11, .dtmf_low_level = -9, @@ -266,15 +266,15 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 4000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "425/200,0/200,425/600,0/1000" }, - { ZT_TONE_BUSY, "425/500,0/500" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/200,0/200" }, - { ZT_TONE_CALLWAIT, "425/400,0/100,425/250,0/100,425/150,0/14000" }, - { ZT_TONE_DIALRECALL, "470/400,425/400" }, - { ZT_TONE_RECORDTONE, "1400/400,0/15000" }, - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0" }, - { ZT_TONE_STUTTER, "470/400,425/400" }, + { DAHDI_TONE_DIALTONE, "425/200,0/200,425/600,0/1000" }, + { DAHDI_TONE_BUSY, "425/500,0/500" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/200,0/200" }, + { DAHDI_TONE_CALLWAIT, "425/400,0/100,425/250,0/100,425/150,0/14000" }, + { DAHDI_TONE_DIALRECALL, "470/400,425/400" }, + { DAHDI_TONE_RECORDTONE, "1400/400,0/15000" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0" }, + { DAHDI_TONE_STUTTER, "470/400,425/400" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -286,15 +286,15 @@ struct tone_zone builtin_zones[] = .description = "United States Circa 1950 / North America", .ringcadence = { 2000, 4000 }, .tones = { - { ZT_TONE_DIALTONE, "600*120" }, - { ZT_TONE_BUSY, "500*100/500,0/500" }, - { ZT_TONE_RINGTONE, "420*40/2000,0/4000" }, - { ZT_TONE_CONGESTION, "500*100/250,0/250" }, - { ZT_TONE_CALLWAIT, "440/300,0/10000" }, - { ZT_TONE_DIALRECALL, "!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,600*120" }, - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,0" }, - { ZT_TONE_STUTTER, "!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,600*120" }, + { DAHDI_TONE_DIALTONE, "600*120" }, + { DAHDI_TONE_BUSY, "500*100/500,0/500" }, + { DAHDI_TONE_RINGTONE, "420*40/2000,0/4000" }, + { DAHDI_TONE_CONGESTION, "500*100/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "440/300,0/10000" }, + { DAHDI_TONE_DIALRECALL, "!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,600*120" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,0" }, + { DAHDI_TONE_STUTTER, "!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,!600*120/100,!0/100,600*120" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -306,15 +306,15 @@ struct tone_zone builtin_zones[] = .description = "Greece", .ringcadence = { 1000, 4000 }, .tones = { - { ZT_TONE_DIALTONE, "425/200,0/300,425/700,0/800" }, - { ZT_TONE_BUSY, "425/300,0/300" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/200,0/200" }, - { ZT_TONE_CALLWAIT, "425/150,0/150,425/150,0/8000" }, - { ZT_TONE_DIALRECALL, "425/650,0/25" }, - { ZT_TONE_RECORDTONE, "1400/400,0/15000" }, - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0" }, - { ZT_TONE_STUTTER, "425/650,0/25" }, + { DAHDI_TONE_DIALTONE, "425/200,0/300,425/700,0/800" }, + { DAHDI_TONE_BUSY, "425/300,0/300" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/200,0/200" }, + { DAHDI_TONE_CALLWAIT, "425/150,0/150,425/150,0/8000" }, + { DAHDI_TONE_DIALRECALL, "425/650,0/25" }, + { DAHDI_TONE_RECORDTONE, "1400/400,0/15000" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0" }, + { DAHDI_TONE_STUTTER, "425/650,0/25" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -326,15 +326,15 @@ struct tone_zone builtin_zones[] = .description = "Taiwan", .ringcadence = { 1000, 4000 }, .tones = { - { ZT_TONE_DIALTONE, "350+440" }, - { ZT_TONE_BUSY, "480+620/500,0/500" }, - { ZT_TONE_RINGTONE, "440+480/1000,0/2000" }, - { ZT_TONE_CONGESTION, "480+620/250,0/250" }, - { ZT_TONE_CALLWAIT, "350+440/250,0/250,350+440/250,0/3250" }, - { ZT_TONE_DIALRECALL, "300/1500,0/500" }, - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,0" }, - { ZT_TONE_STUTTER, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, + { DAHDI_TONE_DIALTONE, "350+440" }, + { DAHDI_TONE_BUSY, "480+620/500,0/500" }, + { DAHDI_TONE_RINGTONE, "440+480/1000,0/2000" }, + { DAHDI_TONE_CONGESTION, "480+620/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "350+440/250,0/250,350+440/250,0/3250" }, + { DAHDI_TONE_DIALRECALL, "300/1500,0/500" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,0" }, + { DAHDI_TONE_STUTTER, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, }, .dtmf_high_level = -11, .dtmf_low_level = -9, @@ -346,15 +346,15 @@ struct tone_zone builtin_zones[] = .description = "Chile", .ringcadence = { 1000, 3000 }, .tones = { - { ZT_TONE_DIALTONE, "400" }, - { ZT_TONE_BUSY, "400/500,0/500" }, - { ZT_TONE_RINGTONE, "400/1000,0/3000" }, - { ZT_TONE_CONGESTION, "400/200,0/200" }, - { ZT_TONE_CALLWAIT, "400/250,0/8750" }, - { ZT_TONE_DIALRECALL, "!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400" }, - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "!950/333,!1400/333,!1800/333,0" }, - { ZT_TONE_STUTTER, "!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400" }, + { DAHDI_TONE_DIALTONE, "400" }, + { DAHDI_TONE_BUSY, "400/500,0/500" }, + { DAHDI_TONE_RINGTONE, "400/1000,0/3000" }, + { DAHDI_TONE_CONGESTION, "400/200,0/200" }, + { DAHDI_TONE_CALLWAIT, "400/250,0/8750" }, + { DAHDI_TONE_DIALRECALL, "!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "!950/333,!1400/333,!1800/333,0" }, + { DAHDI_TONE_STUTTER, "!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,!400/100,!0/100,400" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -366,20 +366,20 @@ struct tone_zone builtin_zones[] = .description = "Sweden", .ringcadence = { 1000, 5000 }, .tones = { - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/250,0/250" }, - { ZT_TONE_RINGTONE, "425/1000,0/5000" }, - { ZT_TONE_CONGESTION, "425/250,0/750" }, - { ZT_TONE_CALLWAIT, "425/200,0/500,425/200,0/9100" }, - { ZT_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024," + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/250,0/250" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/5000" }, + { DAHDI_TONE_CONGESTION, "425/250,0/750" }, + { DAHDI_TONE_CALLWAIT, "425/200,0/500,425/200,0/9100" }, + { DAHDI_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024," "!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024," "!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024," "!950/332,!0/24,!1400/332,!0/24,!1800/332,!0/2024," "!950/332,!0/24,!1400/332,!0/24,!1800/332,0" }, - /*{ ZT_TONE_STUTTER, "425/320,0/20" }, Real swedish standard, not used for now */ - { ZT_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, + /*{ DAHDI_TONE_STUTTER, "425/320,0/20" }, Real swedish standard, not used for now */ + { DAHDI_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, }, .dtmf_high_level = -9, .dtmf_low_level = -10, @@ -392,17 +392,17 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 3000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/500,0/500" }, - { ZT_TONE_RINGTONE, "425/1000,0/3000" }, - { ZT_TONE_CONGESTION, "425/167,0/167" }, - { ZT_TONE_CALLWAIT, "1400/175,0/175,1400/175,0/3500" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/500,0/500" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/3000" }, + { DAHDI_TONE_CONGESTION, "425/167,0/167" }, + { DAHDI_TONE_CALLWAIT, "1400/175,0/175,1400/175,0/3500" }, /* DIALRECALL - not specified */ - { ZT_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, + { DAHDI_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "900/330,1400/330,1800/330,0/1000" }, - { ZT_TONE_STUTTER, "425/1000,0/250" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "900/330,1400/330,1800/330,0/1000" }, + { DAHDI_TONE_STUTTER, "425/1000,0/250" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -415,17 +415,17 @@ struct tone_zone builtin_zones[] = .ringcadence = { 400, 200, 400, 2000 }, .tones = { /* Reference: http://www.ida.gov.sg/idaweb/doc/download/I397/ida_ts_pstn1_i4r2.pdf */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/750,0/750" }, - { ZT_TONE_RINGTONE, "425*24/400,0/200,425*24/400,0/2000" }, - { ZT_TONE_CONGESTION, "425/250,0/250" }, - { ZT_TONE_CALLWAIT, "425*24/300,0/200,425*24/300,0/3200" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/750,0/750" }, + { DAHDI_TONE_RINGTONE, "425*24/400,0/200,425*24/400,0/2000" }, + { DAHDI_TONE_CONGESTION, "425/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "425*24/300,0/200,425*24/300,0/3200" }, /* DIALRECALL - not specified - use repeating Holding Tone A,B*/ - { ZT_TONE_DIALRECALL, "425*24/500,0/500,425/500,0/2500" }, + { DAHDI_TONE_DIALRECALL, "425*24/500,0/500,425/500,0/2500" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, - { ZT_TONE_STUTTER, "!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,425" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, + { DAHDI_TONE_STUTTER, "!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,!425/200,!0/200,!425/600,!0/200,425" }, }, .dtmf_high_level = -11, .dtmf_low_level = -9, @@ -437,15 +437,15 @@ struct tone_zone builtin_zones[] = .description = "Israel", .ringcadence = { 1000, 3000 }, .tones = { - { ZT_TONE_DIALTONE, "414" }, - { ZT_TONE_BUSY, "414/500,0/500" }, - { ZT_TONE_RINGTONE, "414/1000,0/3000" }, - { ZT_TONE_CONGESTION, "414/250,0/250" }, - { ZT_TONE_CALLWAIT, "414/100,0/100,414/100,0/100,414/600,0/3000" }, - { ZT_TONE_DIALRECALL, "!414/100,!0/100,!414/100,!0/100,!414/100,!0/100,414" }, - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "1000/330,1400/330,1800/330,0/1000" }, - { ZT_TONE_STUTTER, "!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,414" }, + { DAHDI_TONE_DIALTONE, "414" }, + { DAHDI_TONE_BUSY, "414/500,0/500" }, + { DAHDI_TONE_RINGTONE, "414/1000,0/3000" }, + { DAHDI_TONE_CONGESTION, "414/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "414/100,0/100,414/100,0/100,414/600,0/3000" }, + { DAHDI_TONE_DIALRECALL, "!414/100,!0/100,!414/100,!0/100,!414/100,!0/100,414" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "1000/330,1400/330,1800/330,0/1000" }, + { DAHDI_TONE_STUTTER, "!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,!414/160,!0/160,414" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -457,15 +457,15 @@ struct tone_zone builtin_zones[] = .description = "Brazil", .ringcadence = { 1000, 4000 }, .tones = { - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/250,0/250" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/250,0/250,425/750,0/250" }, - { ZT_TONE_CALLWAIT, "425/50,0/1000" }, - { ZT_TONE_DIALRECALL, "350+440" }, - { ZT_TONE_RECORDTONE, "425/250,0/250" }, - { ZT_TONE_INFO, "950/330,1400/330,1800/330" }, - { ZT_TONE_STUTTER, "350+440" } }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/250,0/250" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/250,0/250,425/750,0/250" }, + { DAHDI_TONE_CALLWAIT, "425/50,0/1000" }, + { DAHDI_TONE_DIALRECALL, "350+440" }, + { DAHDI_TONE_RECORDTONE, "425/250,0/250" }, + { DAHDI_TONE_INFO, "950/330,1400/330,1800/330" }, + { DAHDI_TONE_STUTTER, "350+440" } }, .dtmf_high_level = -10, .dtmf_low_level = -12, .mfr1_level = -10, @@ -477,16 +477,16 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1250, 3750 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/300,0/300" }, - { ZT_TONE_RINGTONE, "425/1250,0/3750" }, - { ZT_TONE_CONGESTION, "425/300,0/300" }, - { ZT_TONE_CALLWAIT, "425/40,0/1960" }, - { ZT_TONE_DIALRECALL, "425+450" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/300,0/300" }, + { DAHDI_TONE_RINGTONE, "425/1250,0/3750" }, + { DAHDI_TONE_CONGESTION, "425/300,0/300" }, + { DAHDI_TONE_CALLWAIT, "425/40,0/1960" }, + { DAHDI_TONE_DIALRECALL, "425+450" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/400,0/15000" }, - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0" }, - { ZT_TONE_STUTTER, "350+375+400" }, + { DAHDI_TONE_RECORDTONE, "1400/400,0/15000" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0" }, + { DAHDI_TONE_STUTTER, "350+375+400" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -499,18 +499,18 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 4000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/350,0/350" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/200,0/200" }, - { ZT_TONE_CALLWAIT, "425/150,0/150,425/150,0/4000" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/350,0/350" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/200,0/200" }, + { DAHDI_TONE_CALLWAIT, "425/150,0/150,425/150,0/4000" }, /* DIALRECALL - not specified */ - { ZT_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, + { DAHDI_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0" }, /* STUTTER not specified */ - { ZT_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, + { DAHDI_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -523,18 +523,18 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 4000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/500,0/500" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/500,0/500" }, - { ZT_TONE_CALLWAIT, "425/150,0/150,425/150,0/4000" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/500,0/500" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/500,0/500" }, + { DAHDI_TONE_CALLWAIT, "425/150,0/150,425/150,0/4000" }, /* DIALRECALL - not specified */ - { ZT_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, + { DAHDI_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,0" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,0" }, /* STUTTER not specified */ - { ZT_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, + { DAHDI_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -546,18 +546,18 @@ struct tone_zone builtin_zones[] = .description = "South Africa", .ringcadence = { 400, 200, 400, 2000 }, .tones = { - { ZT_TONE_DIALTONE, "400*33" }, - { ZT_TONE_BUSY, "400/500,0/500" }, - { ZT_TONE_RINGTONE, "400*33/400,0/200,400*33/400,0/2000" }, - { ZT_TONE_CONGESTION, "400/250,0/250" }, - { ZT_TONE_CALLWAIT, "400*33/250,0/250,400*33/250,0/250,400*33/250,0/250,400*33/250,0/250" }, + { DAHDI_TONE_DIALTONE, "400*33" }, + { DAHDI_TONE_BUSY, "400/500,0/500" }, + { DAHDI_TONE_RINGTONE, "400*33/400,0/200,400*33/400,0/2000" }, + { DAHDI_TONE_CONGESTION, "400/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "400*33/250,0/250,400*33/250,0/250,400*33/250,0/250,400*33/250,0/250" }, /* DIALRECALL - not specified */ - { ZT_TONE_DIALRECALL, "350+440" }, + { DAHDI_TONE_DIALRECALL, "350+440" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,!950/330,!1400/330,!1800/330,!0/1000,0" }, /* STUTTER not specified */ - { ZT_TONE_STUTTER, "!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,400*33" }, + { DAHDI_TONE_STUTTER, "!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,!400*33/100,!0/100,400*33" }, }, .dtmf_high_level = -11, .dtmf_low_level = -13, @@ -569,18 +569,18 @@ struct tone_zone builtin_zones[] = .description = "Portugal", .ringcadence = { 1000, 5000 }, .tones = { - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/500,0/500" }, - { ZT_TONE_RINGTONE, "425/1000,0/5000" }, - { ZT_TONE_CONGESTION, "425/200,0/200" }, - { ZT_TONE_CALLWAIT, "425/200,425/200,425/200,0/5000" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/500,0/500" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/5000" }, + { DAHDI_TONE_CONGESTION, "425/200,0/200" }, + { DAHDI_TONE_CALLWAIT, "425/200,425/200,425/200,0/5000" }, /* DIALRECALL - not specified */ - { ZT_TONE_DIALRECALL, "425/1000,0/200" }, + { DAHDI_TONE_DIALRECALL, "425/1000,0/200" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, /* STUTTER not specified */ - { ZT_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, + { DAHDI_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -593,18 +593,18 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 4000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/300,0/300" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/200,0/200" }, - { ZT_TONE_CALLWAIT, "950/650,0/325,950/325,0/30,1400/1300,0/2600" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/300,0/300" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/200,0/200" }, + { DAHDI_TONE_CALLWAIT, "950/650,0/325,950/325,0/30,1400/1300,0/2600" }, /* DIALRECALL - not specified */ - { ZT_TONE_DIALRECALL, "425/650,0/25" }, + { DAHDI_TONE_DIALRECALL, "425/650,0/25" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "950/0,0/325,950/325,0/30,1400/1300,0/2600" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "950/0,0/325,950/325,0/30,1400/1300,0/2600" }, /* STUTTER not specified */ - { ZT_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, + { DAHDI_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -616,15 +616,15 @@ struct tone_zone builtin_zones[] = .description = "Mexico", .ringcadence = { 2000, 4000 }, .tones = { - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/250,0/250" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/250,0/250" }, - { ZT_TONE_CALLWAIT, "425/200,0/600,425/200,0/10000" }, - { ZT_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "950/330,0/30,1400/330,0/30,1800/330,0/1000" }, - { ZT_TONE_STUTTER, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/250,0/250" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "425/200,0/600,425/200,0/10000" }, + { DAHDI_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "950/330,0/30,1400/330,0/30,1800/330,0/1000" }, + { DAHDI_TONE_STUTTER, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, }, .dtmf_high_level = -8, .dtmf_low_level = -6, @@ -637,19 +637,19 @@ struct tone_zone builtin_zones[] = .ringcadence = { 400, 200, 400, 2000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "400*25" }, - { ZT_TONE_BUSY, "400/750,0/750" }, - { ZT_TONE_RINGTONE, "400*25/400,0/200,400*25/400,0/2000" }, - { ZT_TONE_CONGESTION, "400/250,0/250" }, - { ZT_TONE_CALLWAIT, "400/200,0/100,400/200,0/7500" }, + { DAHDI_TONE_DIALTONE, "400*25" }, + { DAHDI_TONE_BUSY, "400/750,0/750" }, + { DAHDI_TONE_RINGTONE, "400*25/400,0/200,400*25/400,0/2000" }, + { DAHDI_TONE_CONGESTION, "400/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "400/200,0/100,400/200,0/7500" }, /* DIALRECALL - not specified */ - { ZT_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, + { DAHDI_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, /* INFO - not specified */ - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,0/1000" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,0/1000" }, /* STUTTER - not specified */ - { ZT_TONE_STUTTER, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, + { DAHDI_TONE_STUTTER, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -662,17 +662,17 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 4000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/480,0/480" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/240,0/240" }, - { ZT_TONE_CALLWAIT, "!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,0" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/480,0/480" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/240,0/240" }, + { DAHDI_TONE_CALLWAIT, "!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,!0/5000,!425/200,!0/200,!425/200,0" }, /* DIALRECALL - not specified */ - { ZT_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, + { DAHDI_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/80,0/15000" }, - { ZT_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, - { ZT_TONE_STUTTER, "425+400" }, + { DAHDI_TONE_RECORDTONE, "1400/80,0/15000" }, + { DAHDI_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, + { DAHDI_TONE_STUTTER, "425+400" }, }, .dtmf_high_level = -11, .dtmf_low_level = -9, @@ -685,17 +685,17 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 4000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/500,0/500" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/200,0/200" }, - { ZT_TONE_CALLWAIT, "425/200,0/200,425/200,0/4000" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/500,0/500" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/200,0/200" }, + { DAHDI_TONE_CALLWAIT, "425/200,0/200,425/200,0/4000" }, /* DIALRECALL - not specified */ - { ZT_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, + { DAHDI_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/80,0/15000" }, - { ZT_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, - { ZT_TONE_STUTTER, "425+340/1100,0/1100" }, + { DAHDI_TONE_RECORDTONE, "1400/80,0/15000" }, + { DAHDI_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, + { DAHDI_TONE_STUTTER, "425+340/1100,0/1100" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -708,18 +708,18 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 4000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/500,0/500" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/200,0/200" }, - { ZT_TONE_CALLWAIT, "!425/200,!0/600,!425/200,!0/3000,!425/200,!0/200,!425/200,0" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/500,0/500" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/200,0/200" }, + { DAHDI_TONE_CALLWAIT, "!425/200,!0/600,!425/200,!0/3000,!425/200,!0/200,!425/200,0" }, /* DIALRECALL - not specified */ - { ZT_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, + { DAHDI_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/80,0/15000" }, - { ZT_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, + { DAHDI_TONE_RECORDTONE, "1400/80,0/15000" }, + { DAHDI_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, /* STUTTER - not specified */ - { ZT_TONE_STUTTER, "425/450,0/50" }, + { DAHDI_TONE_STUTTER, "425/450,0/50" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -732,18 +732,18 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 4000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "425/330,0/330,425/660,0/660" }, - { ZT_TONE_BUSY, "425/330,0/330" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/165,0/165" }, - { ZT_TONE_CALLWAIT, "425/330,0/9000" }, + { DAHDI_TONE_DIALTONE, "425/330,0/330,425/660,0/660" }, + { DAHDI_TONE_BUSY, "425/330,0/330" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/165,0/165" }, + { DAHDI_TONE_CALLWAIT, "425/330,0/9000" }, /* DIALRECALL - not specified */ - { ZT_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425/330,0/330,425/660,0/660" }, + { DAHDI_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425/330,0/330,425/660,0/660" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/500,0/14000" }, - { ZT_TONE_INFO, "950/330,0/30,1400/330,0/30,1800/330,0/1000" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/14000" }, + { DAHDI_TONE_INFO, "950/330,0/30,1400/330,0/30,1800/330,0/1000" }, /* STUTTER - not specified */ - { ZT_TONE_STUTTER, "425/450,0/50" }, + { DAHDI_TONE_STUTTER, "425/450,0/50" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -756,16 +756,16 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 4000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "450" }, - { ZT_TONE_BUSY, "450/350,0/350" }, - { ZT_TONE_RINGTONE, "450/1000,0/4000" }, - { ZT_TONE_CONGESTION, "450/700,0/700" }, - { ZT_TONE_CALLWAIT, "450/400,0/4000" }, - { ZT_TONE_DIALRECALL, "450" }, - { ZT_TONE_RECORDTONE, "950/400,0/10000" }, - { ZT_TONE_INFO, "450/100,0/100,450/100,0/100,450/100,0/100,450/400,0/400" }, + { DAHDI_TONE_DIALTONE, "450" }, + { DAHDI_TONE_BUSY, "450/350,0/350" }, + { DAHDI_TONE_RINGTONE, "450/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "450/700,0/700" }, + { DAHDI_TONE_CALLWAIT, "450/400,0/4000" }, + { DAHDI_TONE_DIALRECALL, "450" }, + { DAHDI_TONE_RECORDTONE, "950/400,0/10000" }, + { DAHDI_TONE_INFO, "450/100,0/100,450/100,0/100,450/100,0/100,450/400,0/400" }, /* STUTTER - not specified */ - { ZT_TONE_STUTTER, "450+425" }, + { DAHDI_TONE_STUTTER, "450+425" }, }, .dtmf_high_level = -11, .dtmf_low_level = -9, @@ -777,15 +777,15 @@ struct tone_zone builtin_zones[] = .description = "Argentina", .ringcadence = { 1000, 4500 }, .tones = { - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/300,0/300" }, - { ZT_TONE_RINGTONE, "425/1000,0/4500" }, - { ZT_TONE_CONGESTION, "425/200,0/300" }, - { ZT_TONE_CALLWAIT, "425/200,0/9000" }, - { ZT_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425/330,0/330,425/660,0/660" }, - { ZT_TONE_RECORDTONE, "1400/500,0/14000" }, - { ZT_TONE_INFO, "425/100,0/100" }, - { ZT_TONE_STUTTER, "425/450,0/50" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/300,0/300" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4500" }, + { DAHDI_TONE_CONGESTION, "425/200,0/300" }, + { DAHDI_TONE_CALLWAIT, "425/200,0/9000" }, + { DAHDI_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425/330,0/330,425/660,0/660" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/14000" }, + { DAHDI_TONE_INFO, "425/100,0/100" }, + { DAHDI_TONE_STUTTER, "425/450,0/50" }, }, .dtmf_high_level = -11, .dtmf_low_level = -9, @@ -797,15 +797,15 @@ struct tone_zone builtin_zones[] = .description = "Malaysia", .ringcadence = { 400, 200, 400, 2000 }, .tones = { - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/500,0/500" }, - { ZT_TONE_RINGTONE, "425/400,0/200,425/400,0/2000" }, - { ZT_TONE_CONGESTION, "425/500,0/500" }, - { ZT_TONE_CALLWAIT, "425/100,0/4000" }, - { ZT_TONE_DIALRECALL, "350+440" }, - { ZT_TONE_RECORDTONE, "1400/500,0/60000" }, - { ZT_TONE_INFO, "950/330,0/15,1400/330,0/15,1800/330,0/1000" }, - { ZT_TONE_STUTTER, "450+425" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/500,0/500" }, + { DAHDI_TONE_RINGTONE, "425/400,0/200,425/400,0/2000" }, + { DAHDI_TONE_CONGESTION, "425/500,0/500" }, + { DAHDI_TONE_CALLWAIT, "425/100,0/4000" }, + { DAHDI_TONE_DIALRECALL, "350+440" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/60000" }, + { DAHDI_TONE_INFO, "950/330,0/15,1400/330,0/15,1800/330,0/1000" }, + { DAHDI_TONE_STUTTER, "450+425" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -818,19 +818,19 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 4000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "400*50" }, - { ZT_TONE_BUSY, "400/500,0/500" }, - { ZT_TONE_RINGTONE, "400/1000,0/4000" }, - { ZT_TONE_CONGESTION, "400/300,0/300" }, - { ZT_TONE_CALLWAIT, "1000/400,10000/400,1000/400" }, + { DAHDI_TONE_DIALTONE, "400*50" }, + { DAHDI_TONE_BUSY, "400/500,0/500" }, + { DAHDI_TONE_RINGTONE, "400/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "400/300,0/300" }, + { DAHDI_TONE_CALLWAIT, "1000/400,10000/400,1000/400" }, /* DIALRECALL - not specified - use special dial tone instead. */ - { ZT_TONE_DIALRECALL, "400*50/400,0/100,400*50/400,0/100" }, + { DAHDI_TONE_DIALRECALL, "400*50/400,0/100,400*50/400,0/100" }, /* RECORDTONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, /* INFO - specified as an announcement - use tones instead. */ - { ZT_TONE_INFO, "950/330,1400/330,1800/330" }, + { DAHDI_TONE_INFO, "950/330,1400/330,1800/330" }, /* STUTTER - not specified */ - { ZT_TONE_STUTTER, "!400/200,!0/200,!400/600,!0/200,!400/200,!0/200,!400/600,!0/200,!400/200,!0/200,!400/600,!0/200,!400/200,!0/200,!400/600,!0/200,400" }, + { DAHDI_TONE_STUTTER, "!400/200,!0/200,!400/600,!0/200,!400/200,!0/200,!400/600,!0/200,!400/200,!0/200,!400/600,!0/200,!400/200,!0/200,!400/600,!0/200,400" }, }, .dtmf_high_level = -11, .dtmf_low_level = -9, @@ -843,15 +843,15 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 4000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/500,0/500" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/250,0/250" }, - { ZT_TONE_CALLWAIT, "425/150,0/150,425/150,0/4000" }, - { ZT_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, - { ZT_TONE_RECORDTONE, "1400/425,0/15000" }, - { ZT_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, - { ZT_TONE_STUTTER, "425/1500,0/100" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/500,0/500" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "425/150,0/150,425/150,0/4000" }, + { DAHDI_TONE_DIALRECALL, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, + { DAHDI_TONE_RECORDTONE, "1400/425,0/15000" }, + { DAHDI_TONE_INFO, "950/330,1400/330,1800/330,0/1000" }, + { DAHDI_TONE_STUTTER, "425/1500,0/100" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -864,16 +864,16 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 4000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/500,0/500" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/250,0/250" }, - { ZT_TONE_CALLWAIT, "400+450/300,0/6000" }, - { ZT_TONE_DIALRECALL, "425" }, - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, - { ZT_TONE_INFO, "!950/330,!1440/330,!1800/330,0/1000" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/500,0/500" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "400+450/300,0/6000" }, + { DAHDI_TONE_DIALRECALL, "425" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_INFO, "!950/330,!1440/330,!1800/330,0/1000" }, /* STUTTER - not specified */ - { ZT_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, + { DAHDI_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, }, .dtmf_high_level = -7, .dtmf_low_level = -9, @@ -886,19 +886,19 @@ struct tone_zone builtin_zones[] = .ringcadence = { 1000, 4000 }, .tones = { /* Reference: http://www.itu.int/ITU-T/inr/forms/files/tones-0203.pdf */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "480+620/500,0/500" }, - { ZT_TONE_RINGTONE, "425+480/1000,0/4000" }, - { ZT_TONE_CONGESTION, "480+620/250,0/250" }, - { ZT_TONE_CALLWAIT, "440/300,0/10000" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "480+620/500,0/500" }, + { DAHDI_TONE_RINGTONE, "425+480/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "480+620/250,0/250" }, + { DAHDI_TONE_CALLWAIT, "440/300,0/10000" }, /* DIAL RECALL - not specified */ - { ZT_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, + { DAHDI_TONE_DIALRECALL, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, /* RECORD TONE - not specified */ - { ZT_TONE_RECORDTONE, "1400/500,0/15000" }, + { DAHDI_TONE_RECORDTONE, "1400/500,0/15000" }, /* INFO TONE - not specified */ - { ZT_TONE_INFO, "!950/330,!1400/330,!1800/330,0" }, + { DAHDI_TONE_INFO, "!950/330,!1400/330,!1800/330,0" }, /* STUTTER TONE - not specified */ - { ZT_TONE_STUTTER, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, + { DAHDI_TONE_STUTTER, "!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,!350+440/100,!0/100,350+440" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, @@ -913,14 +913,14 @@ struct tone_zone builtin_zones[] = /* References: http://www.minsvyaz.ru/site.shtml?id=1806 http://www.aboutphone.info/lib/gost/45-223-2001.html */ - { ZT_TONE_DIALTONE, "425" }, - { ZT_TONE_BUSY, "425/350,0/350" }, - { ZT_TONE_RINGTONE, "425/1000,0/4000" }, - { ZT_TONE_CONGESTION, "425/175,0/175" }, - { ZT_TONE_CALLWAIT, "425/200,0/5000" }, - { ZT_TONE_RECORDTONE, "1400/400,0/15000" }, - { ZT_TONE_INFO, "950/330,1440/330,1800/330,0/1000" }, - { ZT_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, + { DAHDI_TONE_DIALTONE, "425" }, + { DAHDI_TONE_BUSY, "425/350,0/350" }, + { DAHDI_TONE_RINGTONE, "425/1000,0/4000" }, + { DAHDI_TONE_CONGESTION, "425/175,0/175" }, + { DAHDI_TONE_CALLWAIT, "425/200,0/5000" }, + { DAHDI_TONE_RECORDTONE, "1400/400,0/15000" }, + { DAHDI_TONE_INFO, "950/330,1440/330,1800/330,0/1000" }, + { DAHDI_TONE_STUTTER, "!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,!425/100,!0/100,425" }, }, .dtmf_high_level = -10, .dtmf_low_level = -10, |