Compare commits
202 Commits
v2.8.0-rc1
...
master
Author | SHA1 | Date |
---|---|---|
Harald Welte | 7160050851 | |
Harald Welte | 8b1300c64f | |
Harald Welte | 25db1de549 | |
Tzafrir Cohen | 99e1eb3931 | |
Tzafrir Cohen | b4d232a16b | |
Tzafrir Cohen | 55cd742b33 | |
Tzafrir Cohen | 980780d920 | |
Tzafrir Cohen | 5cf4228733 | |
Tzafrir Cohen | 2522272bb0 | |
Tzafrir Cohen | b32b05b65c | |
Tzafrir Cohen | e97af70c68 | |
Tzafrir Cohen | b5f85ef682 | |
Tzafrir Cohen | e89188c691 | |
Tzafrir Cohen | c47c863de8 | |
Tzafrir Cohen | 3b4ebbb6f2 | |
Tzafrir Cohen | 950ac20608 | |
Tzafrir Cohen | b87cbc284f | |
Tzafrir Cohen | 845b5cad9d | |
Tzafrir Cohen | 7d85dfbec2 | |
Tzafrir Cohen | 78754c91e2 | |
Tzafrir Cohen | a018543a58 | |
Tzafrir Cohen | 01c96f1dbe | |
Tzafrir Cohen | 12a607fe15 | |
Tzafrir Cohen | cd6136cec1 | |
Tzafrir Cohen | 49fd3ad883 | |
Tzafrir Cohen | b262662bf4 | |
Tzafrir Cohen | 3a3f5811fd | |
Tzafrir Cohen | 5f8a26faed | |
Tzafrir Cohen | 7d1b43d757 | |
Bernhard Schmidt | e91aa93bfb | |
Tzafrir Cohen | 9882223b59 | |
Tzafrir Cohen | e8300f5f29 | |
Tzafrir Cohen | 30a76fb778 | |
Tzafrir Cohen | 0a75720af7 | |
Tzafrir Cohen | 040980e53f | |
Tzafrir Cohen | cdefb75ff6 | |
Tzafrir Cohen | 8d6fda37df | |
Tzafrir Cohen | c26ed816ec | |
Tzafrir Cohen | bbc4932178 | |
Tzafrir Cohen | 256de21b96 | |
Tzafrir Cohen | 456ee492d8 | |
Tzafrir Cohen | 6fedac79bf | |
Tzafrir Cohen | 429b411e26 | |
Tzafrir Cohen | af067a3de7 | |
Tzafrir Cohen | 6f8f532d5a | |
Tzafrir Cohen | fe918dcc3e | |
Tzafrir Cohen | c371dfa38e | |
Tzafrir Cohen | 015484237d | |
Tzafrir Cohen | 955a8dcb4a | |
Tzafrir Cohen | b2d27998c4 | |
Tzafrir Cohen | bbffe6b910 | |
Tzafrir Cohen | 08e710ef27 | |
Tzafrir Cohen | d36171a88f | |
Tzafrir Cohen | 0465400ea8 | |
Oron Peled | 99e3c572d1 | |
Tzafrir Cohen | 6057ef25e9 | |
Oron Peled | e1da7b5284 | |
Tzafrir Cohen | f105a09eda | |
Oron Peled | 212b247e68 | |
Oron Peled | f225a5692c | |
Tzafrir Cohen | cffc5158cc | |
Oron Peled | 42850dba35 | |
Oron Peled | 06ae8473d7 | |
Oron Peled | dbb5ba6db6 | |
Oron Peled | 2097f1adc5 | |
Oron Peled | d02361e99f | |
Oron Peled | 77a3d8b0a7 | |
Oron Peled | bd49fc9d95 | |
Oron Peled | 0e6b068e89 | |
Oron Peled | 9c61e40187 | |
Oron Peled | 5ee15a2337 | |
Oron Peled | 01faf597d6 | |
Tzafrir Cohen | 48b25e849f | |
Tzafrir Cohen | d239b8dc4d | |
Tzafrir Cohen | 4676ad6671 | |
Tzafrir Cohen | b471526700 | |
Russ Meyerriecks | 855772135c | |
Oron Peled | ec1ebffa89 | |
Tzafrir Cohen | 9afcde3f1e | |
Russ Meyerriecks | 9a181ccfbc | |
Tzafrir Cohen | 10c1cd196e | |
Tzafrir Cohen | 65ba28fe4a | |
Oron Peled | 66e2c3ba11 | |
Oron Peled | 94ca4a1bb4 | |
Oron Peled | af920cd079 | |
Tzafrir Cohen | b375bb80b8 | |
Oron Peled | 0090086bce | |
Oron Peled | f21b592f68 | |
Oron Peled | d63812bd73 | |
Oron Peled | bf9500ab32 | |
Oron Peled | 703db3bcc3 | |
Oron Peled | b5b32a438f | |
Oron Peled | 4cc7df1089 | |
Oron Peled | ac6f437317 | |
Oron Peled | b054abb7e9 | |
Oron Peled | ee83afa669 | |
Oron Peled | 5ac7fef4b2 | |
Oron Peled | 6df9a492a0 | |
Oron Peled | fc620819b6 | |
Oron Peled | 723b3ce87f | |
Oron Peled | 5fd1ce5ca0 | |
Oron Peled | 41532ca8a1 | |
Oron Peled | fbb6c1a17e | |
Oron Peled | 131d694054 | |
Oron Peled | 010c4d836c | |
Oron Peled | 025b9a5593 | |
Oron Peled | c863d1d2c2 | |
Tzafrir Cohen | 77730a9059 | |
Tzafrir Cohen | 3f55dd78de | |
Tzafrir Cohen | 283f01bd67 | |
Oron Peled | 631d32680f | |
Oron Peled | 44fe560f3b | |
Oron Peled | 1a78b71fac | |
Oron Peled | f11b937659 | |
Oron Peled | cd6083b6ce | |
Oron Peled | 0eb77e626e | |
Oron Peled | 2e1c15baa3 | |
Russ Meyerriecks | 094bb2c1e8 | |
Oron Peled | 9aee76a3a5 | |
Tzafrir Cohen | d4537e46ce | |
Tzafrir Cohen | 60401c5f49 | |
Armen Karlozian | a109763160 | |
Shaun Ruffell | 6c40704fec | |
Russ Meyerriecks | 95e9dd71d8 | |
Russ Meyerriecks | df47721962 | |
Russ Meyerriecks | 4e14561508 | |
Shaun Ruffell | 49361e5ce7 | |
Shaun Ruffell | 8045f7f493 | |
Tzafrir Cohen | 64e7c688d3 | |
Oron Peled | b28ec382bb | |
Oron Peled | 412c3f0fe3 | |
Oron Peled | fc459c374c | |
Oron Peled | ca09f327ed | |
Tzafrir Cohen | b1d55683ae | |
Oron Peled | 9285e86492 | |
Oron Peled | ca7c04e9cb | |
Oron Peled | ae02edacb4 | |
Shaun Ruffell | 2abfd165ae | |
Oron Peled | 1e6b2741db | |
Oron Peled | 794c8eb048 | |
Oron Peled | ffe36c63e0 | |
Oron Peled | f2628eeedd | |
Oron Peled | 1292ea9078 | |
Oron Peled | cfee27106b | |
Shaun Ruffell | 066fa2aff3 | |
Aslan Laoz | bce5afacf1 | |
Tzafrir Cohen | dd752529f0 | |
Shaun Ruffell | 27d07446ef | |
Shaun Ruffell | 8e2a5def27 | |
Tzafrir Cohen | e553ffde2b | |
Tzafrir Cohen | d1fb614ac8 | |
Tzafrir Cohen | 98ecc272d1 | |
Russ Meyerriecks | 91768d360c | |
Tzafrir Cohen | 63842cc4f3 | |
Tzafrir Cohen | b8d1e467e4 | |
Tzafrir Cohen | de1ee8494a | |
Tzafrir Cohen | d3feed5c4c | |
Oron Peled | b621c02b7f | |
Oron Peled | 451a8b4d6f | |
Tzafrir Cohen | 09fd3f53b1 | |
Oron Peled | c3b020a155 | |
Oron Peled | 7f826a7d35 | |
Oron Peled | cdedf024ae | |
Russ Meyerriecks | a6203e151f | |
Shaun Ruffell | 69ce6f07e0 | |
Shaun Ruffell | 9989b8779c | |
Shaun Ruffell | a4f79134c9 | |
Shaun Ruffell | d8074f434f | |
Shaun Ruffell | 15875924f0 | |
Tzafrir Cohen | a5bf1d3a2e | |
Tzafrir Cohen | bf960799ea | |
Shaun Ruffell | 4f259cd569 | |
Tzafrir Cohen | 4d5ca04ad6 | |
Tzafrir Cohen | 2d3580a3db | |
Tzafrir Cohen | d96be70986 | |
Tzafrir Cohen | 41a725adea | |
Shaun Ruffell | 6ed0adc086 | |
Tzafrir Cohen | 5e75fa48f4 | |
Tzafrir Cohen | 4ab8e95d0b | |
Shaun Ruffell | 5ca600c7c7 | |
Oron Peled | 98736e1add | |
Oron Peled | a9338d9b74 | |
Shaun Ruffell | c0e19d47e8 | |
Shaun Ruffell | ffced0cad2 | |
Shaun Ruffell | e298eb1237 | |
Tzafrir Cohen | a97d373d95 | |
Shaun Ruffell | c27664dc1b | |
Tzafrir Cohen | 365a12f42a | |
Oron Peled | 2a84216fe4 | |
Oron Peled | 791a596c07 | |
Oron Peled | d145364c00 | |
Oron Peled | 0afba16b2e | |
Oron Peled | c163caca00 | |
Oron Peled | c9e8ec7499 | |
Oron Peled | 1356a55d77 | |
Oron Peled | 10a6622774 | |
Oron Peled | a4217f6977 | |
Oron Peled | fb1a2b5572 | |
Oron Peled | 6d10525863 | |
Oron Peled | a1d4355c20 | |
Oron Peled | b303802658 | |
Shaun Ruffell | 8d9a6bdd80 |
|
@ -1,23 +1,60 @@
|
|||
*~
|
||||
*.o
|
||||
*.lo
|
||||
*.a
|
||||
*.so
|
||||
*.la
|
||||
.*.o.d
|
||||
.*.lo.d
|
||||
*.asciidoc
|
||||
*.html
|
||||
.deps
|
||||
.libs
|
||||
.dirstamp
|
||||
.version
|
||||
/.pc
|
||||
Makefile
|
||||
Makefile.in
|
||||
auxdir/
|
||||
build_tools/menuselect-deps
|
||||
aclocal.m4
|
||||
autom4te.cache/
|
||||
autoconfig.h
|
||||
autoconfig.h.in
|
||||
config.log
|
||||
config.status
|
||||
config.guess
|
||||
config.ignore
|
||||
configure
|
||||
dahdi_cfg
|
||||
dahdi_diag
|
||||
dahdi_maint
|
||||
dahdi_monitor
|
||||
dahdi_pcap
|
||||
dahdi_scan
|
||||
dahdi_speed
|
||||
dahdi_test
|
||||
dahdi_tool
|
||||
fxotune
|
||||
libtonezone.a
|
||||
libtonezone.so
|
||||
fxstest
|
||||
genconf_parameters.sample
|
||||
hdlcgen
|
||||
hdlcstress
|
||||
hdlctest
|
||||
hdlcverify
|
||||
libtool
|
||||
m4/
|
||||
makeopts
|
||||
patgen
|
||||
patlooptest
|
||||
pattest
|
||||
sethdlc
|
||||
stamp-h1
|
||||
timertest
|
||||
tonezone.lo
|
||||
tonezones.txt
|
||||
version.c
|
||||
xpp/*.check
|
||||
xpp/.depend
|
||||
xpp/.octasic.depend
|
||||
xpp/.perlcheck
|
||||
|
@ -33,4 +70,10 @@ xpp/test_parse
|
|||
xpp/twinstar.8
|
||||
xpp/xpp_blink.8
|
||||
xpp/xpp_sync.8
|
||||
xpp/xtalk/xlist_test
|
||||
xpp/xtalk/xtalk_raw_test
|
||||
xpp/xtalk/xtalk_send
|
||||
xpp/xtalk/xtalk_test
|
||||
xpp/xtalk/xusb_test
|
||||
xpp/xtalk/xusb_test_bypath
|
||||
zonedata.lo
|
||||
|
|
369
Makefile
369
Makefile
|
@ -1,369 +0,0 @@
|
|||
#
|
||||
# Makefile for DAHDI tools
|
||||
#
|
||||
# Copyright (C) 2001-2010 Digium, Inc.
|
||||
#
|
||||
#
|
||||
|
||||
ifeq ($(strip $(foreach var,clean distclean dist-clean update,$(findstring $(var),$(MAKECMDGOALS)))),)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(foreach var,clean distclean dist-clean update,$(findstring $(var),$(MAKECMDGOALS)))),)
|
||||
ifneq ($(wildcard makeopts),)
|
||||
include makeopts
|
||||
endif
|
||||
endif
|
||||
|
||||
SUBDIRS_UTILS_ALL:= ppp
|
||||
SUBDIRS_UTILS := xpp
|
||||
|
||||
OPTFLAGS=-O2
|
||||
CFLAGS+=-I. $(OPTFLAGS) -g -fPIC -Wall -DBUILDING_TONEZONE #-DTONEZONE_DRIVER
|
||||
ifneq (,$(findstring ppc,$(UNAME_M)))
|
||||
CFLAGS+=-fsigned-char
|
||||
endif
|
||||
ifneq (,$(findstring x86_64,$(UNAME_M)))
|
||||
CFLAGS+=-m64
|
||||
endif
|
||||
|
||||
ifeq ($(DAHDI_DEVMODE),yes)
|
||||
CFLAGS+=-Werror -Wunused -Wundef $(DAHDI_DECLARATION_AFTER_STATEMENT) -Wmissing-format-attribute -Wformat-security #-Wformat=2
|
||||
endif
|
||||
|
||||
ROOT_PREFIX=
|
||||
|
||||
# extra cflags to build dependencies. Recursively expanded.
|
||||
MAKE_DEPS= -MD -MT $@ -MF .$(subst /,_,$@).d -MP
|
||||
|
||||
CFLAGS+=$(DAHDI_INCLUDE)
|
||||
|
||||
CHKCONFIG := $(wildcard /sbin/chkconfig)
|
||||
UPDATE_RCD := $(wildcard /usr/sbin/update-rc.d)
|
||||
ifeq (,$(DESTDIR))
|
||||
ifneq (,$(CHKCONFIG))
|
||||
ADD_INITD := $(CHKCONFIG) --add dahdi
|
||||
else
|
||||
ifneq (,$(UPDATE_RCD))
|
||||
ADD_INITD := $(UPDATE_RCD) dahdi defaults 15 30
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
INITRD_DIR := $(firstword $(wildcard $(DESTDIR)/etc/rc.d/init.d $(DESTDIR)/etc/init.d))
|
||||
ifneq (,$(INITRD_DIR))
|
||||
INIT_TARGET := $(INITRD_DIR)/dahdi
|
||||
COPY_INITD := install -D dahdi.init $(INIT_TARGET)
|
||||
endif
|
||||
|
||||
RCCONF_FILE = /etc/dahdi/init.conf
|
||||
MODULES_FILE = /etc/dahdi/modules
|
||||
GENCONF_FILE = /etc/dahdi/genconf_parameters
|
||||
MODPROBE_FILE = /etc/modprobe.d/dahdi.conf
|
||||
BLACKLIST_FILE = /etc/modprobe.d/dahdi.blacklist.conf
|
||||
|
||||
NETSCR_DIR := $(firstword $(wildcard $(DESTDIR)/etc/sysconfig/network-scripts ))
|
||||
ifneq (,$(NETSCR_DIR))
|
||||
NETSCR_TARGET := $(NETSCR_DIR)/ifup-hdlc
|
||||
COPY_NETSCR := install -D ifup-hdlc $(NETSCR_TARGET)
|
||||
endif
|
||||
|
||||
TOOLSVERSION=$(shell build_tools/make_version . dahdi/tools)
|
||||
|
||||
LTZ_A:=libtonezone.a
|
||||
LTZ_A_OBJS:=zonedata.o tonezone.o version.o
|
||||
LTZ_SO:=libtonezone.so
|
||||
LTZ_SO_OBJS:=zonedata.lo tonezone.lo version.o
|
||||
LTZ_SO_MAJOR_VER:=2
|
||||
LTZ_SO_MINOR_VER:=0
|
||||
|
||||
# sbindir, libdir, includedir and mandir are defined in makeopts
|
||||
# (from configure).
|
||||
BIN_DIR:=$(sbindir)
|
||||
LIB_DIR:=$(libdir)
|
||||
INC_DIR:=$(includedir)/dahdi
|
||||
MAN_DIR:=$(mandir)/man8
|
||||
DATA_DIR:=${datadir}/dahdi
|
||||
CONFIG_DIR:=$(sysconfdir)/dahdi
|
||||
CONFIG_FILE:=$(CONFIG_DIR)/system.conf
|
||||
|
||||
# Utilities we build with a standard build procedure:
|
||||
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 \
|
||||
hdlcverify timertest dahdi_maint
|
||||
|
||||
|
||||
BINS:=fxotune dahdi_cfg dahdi_monitor dahdi_speed dahdi_test dahdi_scan dahdi_maint
|
||||
ifeq (1,$(PBX_NEWT))
|
||||
BINS += dahdi_tool
|
||||
endif
|
||||
ifeq (1,$(PBX_HDLC))
|
||||
BINS += sethdlc
|
||||
endif
|
||||
MAN_PAGES:=$(wildcard $(BINS:%=doc/%.8))
|
||||
|
||||
PINNED_DATA_SCRIPTS:=handle_device span_config
|
||||
PINNED_UTILS:=span_assignments span_types
|
||||
PINNED_CONF:=pinned-spans.conf spantype.conf
|
||||
|
||||
TEST_BINS:=patgen pattest patlooptest hdlcstress hdlctest hdlcgen hdlcverify timertest dahdi_maint
|
||||
# All the man pages. Not just installed ones:
|
||||
GROFF_PAGES := $(wildcard doc/*.8 xpp/*.8)
|
||||
GROFF_HTML := $(GROFF_PAGES:%=%.html)
|
||||
|
||||
GENERATED_DOCS := $(GROFF_HTML) README.html README.Astribank.html
|
||||
|
||||
all: prereq programs
|
||||
|
||||
libs: $(LTZ_SO) $(LTZ_A)
|
||||
|
||||
utils-subdirs:
|
||||
@for dir in $(SUBDIRS_UTILS); do \
|
||||
$(MAKE) -C $$dir; \
|
||||
done
|
||||
|
||||
programs: libs utils
|
||||
|
||||
utils: $(BINS) utils-subdirs
|
||||
|
||||
version.c: FORCE
|
||||
@TOOLSVERSION="${TOOLSVERSION}" build_tools/make_version_c > $@.tmp
|
||||
@if cmp -s $@.tmp $@ ; then :; else \
|
||||
mv $@.tmp $@ ; \
|
||||
fi
|
||||
@rm -f $@.tmp
|
||||
|
||||
tests: $(TEST_BINS)
|
||||
|
||||
$(UTILS): %: %.o
|
||||
|
||||
$(UTILS): version.o
|
||||
|
||||
%.o: %.c
|
||||
$(CC) $(CFLAGS) $(MAKE_DEPS) -c -o $@ $<
|
||||
|
||||
%.lo: %.c
|
||||
$(CC) $(CFLAGS) $(MAKE_DEPS) -c -o $@ $<
|
||||
|
||||
%: %.o
|
||||
$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
|
||||
|
||||
prereq: config.status
|
||||
|
||||
dahdi_tool: CFLAGS+=$(NEWT_INCLUDE)
|
||||
dahdi_tool: LIBS+=$(NEWT_LIB)
|
||||
|
||||
dahdi_speed: CFLAGS+=-O0
|
||||
|
||||
$(LTZ_A): $(LTZ_A_OBJS)
|
||||
ar rcs $@ $^
|
||||
ranlib $@
|
||||
|
||||
$(LTZ_SO): $(LTZ_SO_OBJS)
|
||||
$(CC) $(CFLAGS) -shared -Wl,-soname,$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) -o $@ $^ -lm
|
||||
|
||||
dahdi_cfg: $(LTZ_A)
|
||||
dahdi_cfg: LIBS+=-lm
|
||||
dahdi_pcap:
|
||||
$(CC) $(CFLAGS) dahdi_pcap.c -lpcap -o $@ $<
|
||||
|
||||
|
||||
fxstest: $(LTZ_SO)
|
||||
fxstest: LIBS+=-lm
|
||||
fxotune: LIBS+=-lm
|
||||
|
||||
tonezones.txt: zonedata.c
|
||||
perl -ne 'next unless (/\.(country|description) = *"([^"]*)/); \
|
||||
print (($$1 eq "country")? "* $$2\t":"$$2\n");' $< \
|
||||
>$@
|
||||
|
||||
%.asciidoc: %.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 " $$_" }' \
|
||||
$< \
|
||||
| perl -p -e 'if (/^ #?(\w+)=/ && ! exists $$cfgs{$$1}){my $$cfg = $$1; $$cfgs{$$cfg} = 1; s/^/\n[[cfg_$$cfg]]\n/}' >$@
|
||||
|
||||
docs: $(GENERATED_DOCS)
|
||||
|
||||
genconf_parameters.sample: xpp/genconf_parameters
|
||||
cp $< $@
|
||||
|
||||
README.html: README system.conf.asciidoc init.conf.asciidoc tonezones.txt \
|
||||
UPGRADE.txt genconf_parameters.asciidoc
|
||||
$(ASCIIDOC) -n -a toc -a toclevels=3 $<
|
||||
|
||||
README.Astribank.html: xpp/README.Astribank
|
||||
$(ASCIIDOC) -o $@ -n -a toc -a toclevels=4 $<
|
||||
|
||||
# on Debian: this requires the full groof, not just groff-base.
|
||||
%.8.html: %.8
|
||||
man -Thtml $^ >$@
|
||||
|
||||
htmlman: $(GROFF_HTML)
|
||||
|
||||
install: all install-programs
|
||||
@echo "###################################################"
|
||||
@echo "###"
|
||||
@echo "### DAHDI tools installed successfully."
|
||||
@echo "### If you have not done so before, install init scripts with:"
|
||||
@echo "###"
|
||||
@echo "### make config"
|
||||
@echo "###"
|
||||
@echo "###################################################"
|
||||
|
||||
install-programs: install-utils install-libs
|
||||
|
||||
install-utils: utils install-utils-subdirs
|
||||
ifneq (,$(BINS))
|
||||
install -d $(DESTDIR)$(BIN_DIR)
|
||||
install $(BINS) $(DESTDIR)$(BIN_DIR)/
|
||||
install -d $(DESTDIR)$(MAN_DIR)
|
||||
install -m 644 $(MAN_PAGES) $(DESTDIR)$(MAN_DIR)/
|
||||
endif
|
||||
ifeq (,$(wildcard $(DESTDIR)$(CONFIG_FILE)))
|
||||
$(INSTALL) -d $(DESTDIR)$(CONFIG_DIR)
|
||||
$(INSTALL) -m 644 system.conf.sample $(DESTDIR)$(CONFIG_FILE)
|
||||
endif
|
||||
ifeq ($(DAHDI_PINNED),yes)
|
||||
install -d $(DESTDIR)$(DATA_DIR)
|
||||
install $(PINNED_DATA_SCRIPTS) $(DESTDIR)$(DATA_DIR)/
|
||||
install $(PINNED_UTILS) $(DESTDIR)/$(BIN_DIR)/
|
||||
install -m 644 $(PINNED_CONF) $(DESTDIR)/$(CONFIG_DIR)/
|
||||
endif
|
||||
|
||||
install-libs: libs
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)/$(LIB_DIR)
|
||||
$(INSTALL) -m 755 $(LTZ_A) $(DESTDIR)$(LIB_DIR)/
|
||||
$(INSTALL) -m 755 $(LTZ_SO) $(DESTDIR)$(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER)
|
||||
ifeq (,$(DESTDIR))
|
||||
if [ `id -u` = 0 ]; then \
|
||||
/sbin/ldconfig || : ;\
|
||||
fi
|
||||
endif
|
||||
rm -f $(DESTDIR)$(LIB_DIR)/$(LTZ_SO)
|
||||
$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
|
||||
$(DESTDIR)$(LIB_DIR)/$(LTZ_SO).$(LTZ_SO_MAJOR_VER)
|
||||
$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
|
||||
$(DESTDIR)$(LIB_DIR)/$(LTZ_SO)
|
||||
# Overwrite the 1.0 links out there. dahdi-tools 2.0.0 installed
|
||||
# 1.0 links but dahdi-tools changed them to 2.0 in order to explicitly
|
||||
# break applications linked with zaptel. But, this also meant that
|
||||
# applications linked with libtonezone.so.1.0 broke when dahdi-tools
|
||||
# 2.1.0 was installed.
|
||||
$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
|
||||
$(DESTDIR)$(LIB_DIR)/$(LTZ_SO).1.0
|
||||
$(LN) -sf $(LTZ_SO).$(LTZ_SO_MAJOR_VER).$(LTZ_SO_MINOR_VER) \
|
||||
$(DESTDIR)$(LIB_DIR)/$(LTZ_SO).1
|
||||
ifneq (no,$(USE_SELINUX))
|
||||
ifeq (,$(DESTDIR))
|
||||
/sbin/restorecon -v $(DESTDIR)$(LIB_DIR)/$(LTZ_SO)
|
||||
endif
|
||||
endif
|
||||
$(INSTALL) -d -m 755 $(DESTDIR)/$(INC_DIR)
|
||||
$(INSTALL) -m 644 tonezone.h $(DESTDIR)$(INC_DIR)/
|
||||
|
||||
install-utils-subdirs:
|
||||
@for dir in $(SUBDIRS_UTILS); do \
|
||||
$(MAKE) -C $$dir install; \
|
||||
done
|
||||
|
||||
install-tests: tests
|
||||
ifneq (,$(TEST_BINS))
|
||||
install -d $(DESTDIR)$(BIN_DIR)
|
||||
install $(TEST_BINS) $(DESTDIR)$(BIN_DIR)/
|
||||
endif
|
||||
|
||||
config:
|
||||
ifneq (,$(COPY_INITD))
|
||||
$(COPY_INITD)
|
||||
endif
|
||||
ifeq (,$(wildcard $(DESTDIR)$(RCCONF_FILE)))
|
||||
$(INSTALL) -D -m 644 init.conf.sample $(DESTDIR)$(RCCONF_FILE)
|
||||
endif
|
||||
ifeq (,$(wildcard $(DESTDIR)$(MODULES_FILE)))
|
||||
$(INSTALL) -D -m 644 modules.sample $(DESTDIR)$(MODULES_FILE)
|
||||
endif
|
||||
ifeq (,$(wildcard $(DESTDIR)$(GENCONF_FILE)))
|
||||
$(INSTALL) -D -m 644 xpp/genconf_parameters $(DESTDIR)$(GENCONF_FILE)
|
||||
endif
|
||||
ifeq (,$(wildcard $(DESTDIR)$(MODPROBE_FILE)))
|
||||
$(INSTALL) -D -m 644 modprobe.conf.sample $(DESTDIR)$(MODPROBE_FILE)
|
||||
endif
|
||||
ifeq (,$(wildcard $(DESTDIR)$(BLACKLIST_FILE)))
|
||||
$(INSTALL) -D -m 644 blacklist.sample $(DESTDIR)$(BLACKLIST_FILE)
|
||||
endif
|
||||
ifneq (,$(COPY_NETSCR))
|
||||
$(COPY_NETSCR)
|
||||
endif
|
||||
ifneq (,$(ADD_INITD))
|
||||
$(ADD_INITD)
|
||||
endif
|
||||
@echo "DAHDI has been configured."
|
||||
@echo ""
|
||||
@echo "List of detected DAHDI devices:"
|
||||
@echo ""
|
||||
@if [ `xpp/dahdi_hardware | tee /dev/stderr | wc -l` -eq 0 ]; then \
|
||||
echo "No hardware found"; \
|
||||
else \
|
||||
echo ""; \
|
||||
echo "run 'dahdi_genconf modules' to load support for only " ;\
|
||||
echo "the DAHDI hardware installed in this system. By "; \
|
||||
echo "default support for all DAHDI hardware is loaded at "; \
|
||||
echo "DAHDI start. "; \
|
||||
fi
|
||||
|
||||
update:
|
||||
@if [ -d .svn ]; then \
|
||||
echo "Updating from Subversion..." ; \
|
||||
svn update | tee update.out; \
|
||||
rm -f .version; \
|
||||
if [ `grep -c ^C update.out` -gt 0 ]; then \
|
||||
echo ; echo "The following files have conflicts:" ; \
|
||||
grep ^C update.out | cut -b4- ; \
|
||||
fi ; \
|
||||
rm -f update.out; \
|
||||
else \
|
||||
echo "Not under version control"; \
|
||||
fi
|
||||
|
||||
clean:
|
||||
rm -f $(BINS) $(TEST_BINS)
|
||||
rm -f *.o dahdi_cfg tzdriver sethdlc
|
||||
rm -f $(LTZ_SO) $(LTZ_A) *.lo
|
||||
@for dir in $(SUBDIRS_UTILS_ALL); do \
|
||||
$(MAKE) -C $$dir clean; \
|
||||
done
|
||||
@for dir in $(SUBDIRS_UTILS); do \
|
||||
$(MAKE) -C $$dir clean; \
|
||||
done
|
||||
rm -f libtonezone*
|
||||
rm -f fxotune
|
||||
rm -f core
|
||||
rm -f dahdi_cfg-shared fxstest
|
||||
rm -rf $(GENERATED_DOCS) *.asciidoc tonezones.txt
|
||||
rm -f dahdi_pcap
|
||||
|
||||
distclean: dist-clean
|
||||
|
||||
dist-clean: clean
|
||||
rm -f makeopts
|
||||
rm -f config.log config.status
|
||||
rm -f .*.d
|
||||
|
||||
config.status: configure
|
||||
@CFLAGS="" ./configure
|
||||
@echo "****"
|
||||
@echo "**** The configure script was just executed, so 'make' needs to be"
|
||||
@echo "**** restarted."
|
||||
@echo "****"
|
||||
@exit 1
|
||||
|
||||
.PHONY: distclean dist-clean clean all install programs tests devel data config update install-programs install-libs install-utils-subdirs utils-subdirs prereq
|
||||
|
||||
FORCE:
|
||||
|
||||
ifneq ($(wildcard .*.d),)
|
||||
include .*.d
|
||||
endif
|
|
@ -0,0 +1,197 @@
|
|||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
LEGACY_MAKE = \
|
||||
$(MAKE) -f $(srcdir)/Makefile.legacy \
|
||||
top_srcdir=$(top_srcdir) \
|
||||
srcdir=$(srcdir)
|
||||
|
||||
CFLAGS += -g -Wall -O2 $(DAHDI_INCLUDE)
|
||||
if DAHDI_DEVMODE
|
||||
CFLAGS += \
|
||||
-Werror \
|
||||
-Wunused \
|
||||
-Wundef \
|
||||
$(DAHDI_DECLARATION_AFTER_STATEMENT) \
|
||||
-Wmissing-format-attribute \
|
||||
-Wformat-security \
|
||||
#-Wformat=2
|
||||
endif
|
||||
|
||||
SUBDIRS = xpp doc hotplug
|
||||
|
||||
if PPPD
|
||||
SUBDIRS += ppp
|
||||
endif
|
||||
|
||||
noinst_HEADERS = \
|
||||
bittest.h \
|
||||
dahdi_tools_version.h \
|
||||
fxotune.h \
|
||||
wavformat.h \
|
||||
#
|
||||
|
||||
sbin_PROGRAMS = \
|
||||
dahdi_test \
|
||||
dahdi_maint \
|
||||
dahdi_monitor \
|
||||
dahdi_cfg \
|
||||
dahdi_speed \
|
||||
dahdi_scan \
|
||||
fxotune
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
fxstest \
|
||||
patgen \
|
||||
pattest \
|
||||
patlooptest \
|
||||
dahdi_diag \
|
||||
timertest
|
||||
|
||||
dist_sbin_SCRIPTS = \
|
||||
dahdi_span_assignments \
|
||||
dahdi_waitfor_span_assignments \
|
||||
dahdi_span_types
|
||||
|
||||
if PBX_HDLC
|
||||
sbin_PROGRAMS += sethdlc
|
||||
noinst_PROGRAMS += hdlcstress hdlctest hdlcgen hdlcverify
|
||||
endif
|
||||
|
||||
# Libtool versioning for libtonezone:
|
||||
# Bump when interface changes
|
||||
LTZ_CURRENT = 2
|
||||
# Bump if interface change is backward compatible
|
||||
LTZ_AGE = 0
|
||||
# Bump if only implementation change
|
||||
LTZ_REVISION = 0
|
||||
|
||||
lib_LTLIBRARIES = libtonezone.la
|
||||
|
||||
libtonezone_la_SOURCES = \
|
||||
zonedata.c \
|
||||
tonezone.c \
|
||||
version.c
|
||||
dahdiinclude_HEADERS = tonezone.h
|
||||
libtonezone_la_CFLAGS = $(CFLAGS) -I$(srcdir) -DBUILDING_TONEZONE
|
||||
libtonezone_la_LDFLAGS = -version-info "$(LTZ_CURRENT):$(LTZ_REVISION):$(LTZ_AGE)"
|
||||
libtonezone_la_LIBADD = -lm
|
||||
|
||||
if PBX_PCAP
|
||||
noinst_PROGRAMS += dahdi_pcap
|
||||
dahdi_pcap_LDADD = -lpcap
|
||||
endif
|
||||
|
||||
patlooptest_LDADD = libtonezone.la
|
||||
fxstest_LDADD = libtonezone.la
|
||||
fxotune_LDADD = -lm
|
||||
dahdi_speed_CFLAGS = -O2
|
||||
|
||||
dahdi_maint_SOURCES = dahdi_maint.c version.c
|
||||
|
||||
if PBX_NEWT
|
||||
sbin_PROGRAMS += dahdi_tool
|
||||
dahdi_tool_CFLAGS = $(CFLAGS) $(NEWT_INCLUDE)
|
||||
dahdi_tool_LDADD = $(NEWT_LIB)
|
||||
endif
|
||||
|
||||
dahdi_cfg_LDFLAGS = -lpthread
|
||||
dahdi_cfg_LDADD = libtonezone.la
|
||||
|
||||
udevrulesdir = @udevrulesdir@
|
||||
udevrules_DATA = dahdi.rules
|
||||
|
||||
all-local:
|
||||
$(LEGACY_MAKE) all
|
||||
|
||||
clean-local:
|
||||
$(LEGACY_MAKE) clean
|
||||
|
||||
install-exec-hook:
|
||||
$(LEGACY_MAKE) install
|
||||
@echo "Compatibility symlinks (should be removed in the future)"
|
||||
ln -sf libtonezone.so.2.0.0 $(DESTDIR)$(libdir)/libtonezone.so.2.0
|
||||
|
||||
bashcompdir = $(sysconfdir)/bash_completion.d
|
||||
|
||||
install-data-hook:
|
||||
mkdir -p $(DESTDIR)$(bashcompdir)
|
||||
install -m 644 $(srcdir)/dahdi-bash-completion $(DESTDIR)$(bashcompdir)/dahdi
|
||||
|
||||
# Handle these files specially -- install them only with 'install-config'
|
||||
special_config_files = \
|
||||
init.conf.sample \
|
||||
blacklist.sample \
|
||||
modprobe.conf.sample \
|
||||
#
|
||||
|
||||
install-config:
|
||||
mkdir -p $(DESTDIR)$(dahdiconfdir)
|
||||
mkdir -p $(DESTDIR)$(sysconfdir)/modprobe.d
|
||||
install -m644 xpp/genconf_parameters $(DESTDIR)$(dahdiconfdir)/genconf_parameters
|
||||
install -m644 init.conf.sample $(DESTDIR)$(dahdiconfdir)/init.conf
|
||||
install -m644 blacklist.sample $(DESTDIR)$(sysconfdir)/modprobe.d/dahdi-blacklist.conf
|
||||
install -m644 modprobe.conf.sample $(DESTDIR)$(sysconfdir)/modprobe.d/dahdi.conf
|
||||
$(LEGACY_MAKE) config
|
||||
|
||||
dahdiconfdir = @sysconfdir@/dahdi
|
||||
dahdiconf_DATA = \
|
||||
system.conf.sample \
|
||||
assigned-spans.conf.sample \
|
||||
span-types.conf.sample \
|
||||
modules.sample \
|
||||
#
|
||||
|
||||
build_scripts = \
|
||||
build_tools/dahdi_svn_tarball \
|
||||
build_tools/dahdi_sysfs_copy \
|
||||
build_tools/dump_sys_state \
|
||||
build_tools/make_firmware_object.in \
|
||||
build_tools/make_tree \
|
||||
build_tools/make_version \
|
||||
build_tools/test_kernel_git \
|
||||
build_tools/uninstall-modules \
|
||||
#
|
||||
|
||||
.version:
|
||||
if ./build_tools/make_version . dahdi/tools > $@.tmp; then \
|
||||
mv "$@.tmp" "$@"; \
|
||||
fi
|
||||
|
||||
uninstall-hook:
|
||||
$(RM) $(DESTDIR)$(sysconfdir)/dahdi/span-types.conf.sample
|
||||
$(RM) $(DESTDIR)$(sysconfdir)/dahdi/assigned-spans.conf.sample
|
||||
$(RM) $(DESTDIR)$(sysconfdir)/dahdi/system.conf
|
||||
$(RM) $(DESTDIR)$(bashcompdir)/dahdi
|
||||
|
||||
docs:
|
||||
$(LEGACY_MAKE) $@
|
||||
|
||||
DISTCLEANFILES = makeopts config.log config.status .*.d
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
m4/libtool.m4 \
|
||||
m4/ltoptions.m4 \
|
||||
m4/ltsugar.m4 \
|
||||
m4/ltversion.m4 \
|
||||
m4/lt~obsolete.m4 \
|
||||
#
|
||||
|
||||
EXTRA_DIST = \
|
||||
.version \
|
||||
LICENSE \
|
||||
LICENSE.LGPL \
|
||||
UPGRADE.txt \
|
||||
bootstrap.sh \
|
||||
Makefile.legacy \
|
||||
dahdi.init \
|
||||
dahdi.xml \
|
||||
dahdi_pcap.c \
|
||||
ifup-hdlc \
|
||||
dahdi-bash-completion \
|
||||
$(special_config_files) \
|
||||
$(dahdiconf_DATA) \
|
||||
$(udevrules_DATA) \
|
||||
$(build_scripts) \
|
||||
#
|
||||
|
||||
.PHONY: docs config
|
|
@ -0,0 +1,133 @@
|
|||
#
|
||||
# Makefile for DAHDI tools
|
||||
#
|
||||
# Copyright (C) 2001-2010 Digium, Inc.
|
||||
#
|
||||
#
|
||||
|
||||
ifeq ($(strip $(foreach var,clean,$(findstring $(var),$(MAKECMDGOALS)))),)
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(foreach var,clean,$(findstring $(var),$(MAKECMDGOALS)))),)
|
||||
ifneq ($(wildcard makeopts),)
|
||||
include makeopts
|
||||
endif
|
||||
endif
|
||||
|
||||
CHKCONFIG := $(wildcard /sbin/chkconfig)
|
||||
UPDATE_RCD := $(wildcard /usr/sbin/update-rc.d)
|
||||
ifeq (,$(DESTDIR))
|
||||
ifneq (,$(CHKCONFIG))
|
||||
ADD_INITD := $(CHKCONFIG) --add dahdi
|
||||
else
|
||||
ifneq (,$(UPDATE_RCD))
|
||||
ADD_INITD := $(UPDATE_RCD) dahdi defaults 15 30
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
INITRD_DIR := $(firstword $(wildcard $(DESTDIR)/etc/rc.d/init.d $(DESTDIR)/etc/init.d))
|
||||
ifneq (,$(INITRD_DIR))
|
||||
INIT_TARGET := $(INITRD_DIR)/dahdi
|
||||
COPY_INITD := install -D dahdi.init $(INIT_TARGET)
|
||||
endif
|
||||
|
||||
NETSCR_DIR := $(firstword $(wildcard $(DESTDIR)/etc/sysconfig/network-scripts ))
|
||||
ifneq (,$(NETSCR_DIR))
|
||||
NETSCR_TARGET := $(NETSCR_DIR)/ifup-hdlc
|
||||
COPY_NETSCR := install -D ifup-hdlc $(NETSCR_TARGET)
|
||||
endif
|
||||
|
||||
# sbindir, libdir, includedir and mandir are defined in makeopts
|
||||
# (from configure).
|
||||
LIB_DIR:=$(libdir)
|
||||
|
||||
# All the man pages. Not just installed ones:
|
||||
GROFF_PAGES := $(wildcard doc/*.8 xpp/*.8)
|
||||
GROFF_HTML := $(GROFF_PAGES:%=%.html)
|
||||
|
||||
GENERATED_DOCS := $(GROFF_HTML) README.html README.Astribank.html
|
||||
|
||||
all:
|
||||
|
||||
tonezones.txt: zonedata.c
|
||||
perl -ne 'next unless (/\.(country|description) = *"([^"]*)/); \
|
||||
print (($$1 eq "country")? "* $$2\t":"$$2\n");' $< \
|
||||
>$@
|
||||
|
||||
%.asciidoc: %.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 " $$_" }' \
|
||||
$< \
|
||||
| perl -p -e 'if (/^ #?(\w+)=/ && ! exists $$cfgs{$$1}){my $$cfg = $$1; $$cfgs{$$cfg} = 1; s/^/\n[[cfg_$$cfg]]\n/}' >$@
|
||||
|
||||
docs: $(GENERATED_DOCS)
|
||||
|
||||
genconf_parameters.sample: xpp/genconf_parameters
|
||||
cp $< $@
|
||||
|
||||
README.html: README system.conf.asciidoc init.conf.asciidoc tonezones.txt \
|
||||
UPGRADE.txt genconf_parameters.asciidoc assigned-spans.conf.asciidoc \
|
||||
span-types.conf.asciidoc
|
||||
TZ=UTC $(ASCIIDOC) -n -a toc -a toclevels=4 $<
|
||||
|
||||
README.Astribank.html: xpp/README.Astribank
|
||||
TZ=UTC $(ASCIIDOC) -o $@ -n -a toc -a toclevels=4 $<
|
||||
|
||||
# on Debian: this requires the full groff, not just groff-base.
|
||||
%.8.html: %.8
|
||||
man -Thtml $^ >$@
|
||||
|
||||
htmlman: $(GROFF_HTML)
|
||||
|
||||
install: all install-programs
|
||||
@echo "###################################################"
|
||||
@echo "###"
|
||||
@echo "### DAHDI tools installed successfully."
|
||||
@echo "### If you have not done so before, install init scripts with:"
|
||||
@echo "###"
|
||||
@echo "### make install-config"
|
||||
@echo "###"
|
||||
@echo "###################################################"
|
||||
|
||||
install-programs: install-libs
|
||||
|
||||
install-libs:
|
||||
ifneq (no,$(USE_SELINUX))
|
||||
ifeq (,$(DESTDIR))
|
||||
/sbin/restorecon -v $(DESTDIR)$(LIB_DIR)/$(LTZ_SO)
|
||||
endif
|
||||
endif
|
||||
|
||||
config:
|
||||
ifneq (,$(COPY_INITD))
|
||||
$(COPY_INITD)
|
||||
endif
|
||||
ifneq (,$(COPY_NETSCR))
|
||||
$(COPY_NETSCR)
|
||||
endif
|
||||
ifneq (,$(ADD_INITD))
|
||||
$(ADD_INITD)
|
||||
endif
|
||||
@echo "DAHDI has been configured."
|
||||
@echo ""
|
||||
@echo "List of detected DAHDI devices:"
|
||||
@echo ""
|
||||
@if [ `xpp/dahdi_hardware | tee /dev/stderr | wc -l` -eq 0 ]; then \
|
||||
echo "No hardware found"; \
|
||||
else \
|
||||
echo ""; \
|
||||
echo "run 'dahdi_genconf modules' to load support for only " ;\
|
||||
echo "the DAHDI hardware installed in this system. By "; \
|
||||
echo "default support for all DAHDI hardware is loaded at "; \
|
||||
echo "DAHDI start. "; \
|
||||
fi
|
||||
|
||||
clean:
|
||||
rm -f *.o tzdriver
|
||||
rm -f core
|
||||
rm -rf $(GENERATED_DOCS) *.asciidoc tonezones.txt
|
||||
|
||||
.PHONY: clean all install devel data config install-programs install-libs
|
||||
|
||||
FORCE:
|
198
README
198
README
|
@ -15,8 +15,9 @@ dahdi-linux before building dahdi-tools.
|
|||
Build System
|
||||
~~~~~~~~~~~~
|
||||
GCC and friends. Generally you will need to install the package gcc.
|
||||
There may be cases where you will need a specific version of gcc to build
|
||||
kernel modules.
|
||||
|
||||
Autotools (autoconf, automake and libtool) are needed if you clone from
|
||||
Git.
|
||||
|
||||
|
||||
Extra Libraries
|
||||
|
@ -24,20 +25,25 @@ Extra Libraries
|
|||
Some libraries are needed for extra utilities that are provided with
|
||||
DAHDI.
|
||||
|
||||
- libusb is needed for building fpga_load, needed for firmware loading of
|
||||
the Xorcom Astribank.
|
||||
- libusb is needed for building astribank_hexload, needed for firmware
|
||||
loading of the Xorcom Astribank.
|
||||
- libnewt is needed to build the optional but useful utility dahdi_tool.
|
||||
- libpcap is needed for building dahdi_pcap.
|
||||
- pppd is needed to build the dahdi pppd plugin.
|
||||
|
||||
|
||||
Installation
|
||||
~~~~~~~~~~~~
|
||||
Note: If using `sudo` to build/install, you may need to add /sbin to your PATH.
|
||||
----------------------------------
|
||||
# Only if you cloned from git:
|
||||
autoreconf -i
|
||||
|
||||
./configure
|
||||
make
|
||||
make install
|
||||
# To install init scripts and config files:
|
||||
#make config
|
||||
# To install some extra configuration files:
|
||||
#make install-config
|
||||
----------------------------------
|
||||
|
||||
|
||||
|
@ -49,15 +55,11 @@ There are some make targets that are provided to build or install just
|
|||
parts of DAHDI:
|
||||
|
||||
. Build targets:
|
||||
- make: Build DAHDI user-space programs. partial
|
||||
targets of it:
|
||||
* make 'utilname': builds 'utilname' alone (e.g: `make dahdi_diag`)
|
||||
* make utils: Build libtonezone.
|
||||
* make libs: Build libtonezone.
|
||||
- make: Build DAHDI user-space programs and libraries.
|
||||
- make docs: Generate some extra documentation files.
|
||||
. Install targets:
|
||||
- make install: Installs user space tools into /usr/sbin/ (TODO - list
|
||||
partial targets)
|
||||
- make config: should be run once to configure
|
||||
- make install: Install everything
|
||||
- make install-config: install configuration files
|
||||
|
||||
|
||||
Installation to a Subtree
|
||||
|
@ -73,8 +75,8 @@ This can be useful for any partial install target from the list above.
|
|||
|
||||
Options For ./configure
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
The configure script executes various tests and based on them generates
|
||||
makeopts. You can pass it --with options and variable settings, for
|
||||
The configure script executes various tests and the build will depend on
|
||||
their result. You can pass it --with options and variable settings, for
|
||||
instance:
|
||||
|
||||
./configure --without-ncurses CC="gcc-4.10"
|
||||
|
@ -114,25 +116,58 @@ The configuration file of the dahdi init.d script is
|
|||
/etc/dahdi/init.conf . That file is used to override defaults that are
|
||||
set at the beginning of the init.d script.
|
||||
|
||||
/etc/dahdi/assigned-spans.conf
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Assigns span number and initial channel number for spans in each device.
|
||||
Just like system.conf it may be generated with dahdi_genconf:
|
||||
|
||||
dahdi_span_assignments auto
|
||||
dahdi_genconf
|
||||
|
||||
It may also be edited manually to allow reserving span and channel
|
||||
numbers for specific devices.
|
||||
|
||||
/etc/dahdi/span-types.conf
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Theoretically, this file is similar to assigned-spans.conf. It allows
|
||||
setting the type (E1/T1) of a "PRI" span. This cannot be configured
|
||||
anywhere else: it needs to be done before the span is assigned as it
|
||||
changes the number of channels the span has.
|
||||
|
||||
In practice most systems don't mix E1 and T1 and thus this file will
|
||||
typically have at most a single wild-card line setting all cards to be
|
||||
either E1 or T1.
|
||||
|
||||
|
||||
Reference Configuration
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Sample system.conf
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
include::system.conf.asciidoc[]
|
||||
|
||||
|
||||
Sample init.conf
|
||||
~~~~~~~~~~~~~~~~
|
||||
^^^^^^^^^^^^^^^^
|
||||
include::init.conf.asciidoc[]
|
||||
|
||||
|
||||
Sample genconf_parameters
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
FIXME: still not properly formatted.
|
||||
|
||||
include::genconf_parameters.asciidoc[]
|
||||
|
||||
|
||||
Sample assigned-spans.conf
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
include::assigned-spans.conf.asciidoc[]
|
||||
|
||||
|
||||
Sample span-types.conf
|
||||
^^^^^^^^^^^^^^^^^^^^^^
|
||||
include::span-types.conf.asciidoc[]
|
||||
|
||||
|
||||
Tonezones
|
||||
~~~~~~~~~
|
||||
The file zonedata.c contains the information about the tone zones used
|
||||
|
@ -202,6 +237,131 @@ that is included in the ppp/ subdirectory. To install it:
|
|||
CONFIG_HDLC .
|
||||
|
||||
|
||||
Initialization
|
||||
--------------
|
||||
This section documents the start up sequence of the DAHDI modules.
|
||||
|
||||
There are generally two options: explicit (using an init script) and
|
||||
implicit (run from UDEV hook scripts).
|
||||
|
||||
Explicit
|
||||
~~~~~~~~
|
||||
The dahdi init scripts does the following tasks:
|
||||
|
||||
* Loading the module dahdi and any other module listed in
|
||||
/etc/dahdi/modules.
|
||||
* For xpp (Astribanks) - some specific initializations. See
|
||||
README.Astribank.
|
||||
* Runs link:doc/dahdi_cfg.8.html[dahdi_cfg] after all modules were
|
||||
loaded.
|
||||
* A number of other tools may need to be run:
|
||||
** link:doc/fxotune.8.html[fxotune]
|
||||
** dahdihpec_enable
|
||||
|
||||
Only at this point Asterisk (or any other user of DAHDI) can be run.
|
||||
|
||||
|
||||
Implicit
|
||||
~~~~~~~~
|
||||
(Also known as "hot-plug" or "pinned-spans". This requires:
|
||||
|
||||
* dahdi >= 2.8.0
|
||||
* Setting the module parameter auto_assign_spans of dahdi to 0
|
||||
* (Recommended) Asterisk >= 12 - which supports "dahdi create channels".
|
||||
|
||||
When a device driver of a DAHDI device finishes initialization, it
|
||||
creates a dahdi_device kernel object. A dahdi_device represents a single
|
||||
DAHDI device (such as a PCI card) and may have several spans. If the
|
||||
value of auto_assign_spans is 1 when dahdi_device is created, spans are
|
||||
assigned automatically - each new span gets the first available span
|
||||
number and range of channels. However if it is set to 0, spans will not
|
||||
get assigned, and user space programs need to assign them. The
|
||||
low-level interface for doing so is explained in the section "Span
|
||||
Assignment" in the README of DAHDI-Linux.
|
||||
|
||||
New Devices
|
||||
^^^^^^^^^^^
|
||||
When a kernel object is created or destroyed, the kernel sends an event
|
||||
to user space. Those events are normally handled by udevd. Configurations
|
||||
for udevd ("udev rules") may be placed in /etc/udev/rules.d or
|
||||
/lib/udev/rules.d. This package installs rules that instruct udevd to
|
||||
run the script `/usr/share/dahdi/dahdi_handle_device` on each new
|
||||
device, which runs all the scripts in `/usr/share/dahdi/handle_device.d`.
|
||||
Those scripts will:
|
||||
|
||||
* If `/etc/dahdi/span-types.conf` exists, apply it to the device. It is
|
||||
used for E1/T1/J1 settings. See
|
||||
<<_sample_span_types_conf,sample span-types.conf>>.
|
||||
|
||||
* If `/etc/dahdi/assigned-spans.conf` exists, assign the span according
|
||||
to it (if it is not specified there: don't assign it).
|
||||
used for E1/T1/J1 settings. See
|
||||
<<_sample_assigned_spans_conf,sample assigned-spans.conf>>.
|
||||
|
||||
* But if that file does not exist, assign the span to the first
|
||||
available place.
|
||||
|
||||
This script mainly uses the commands
|
||||
link:doc/dahdi_span_types.8.html[dahdi_span_types] and
|
||||
link:doc/dahdi_span_assignments.8.html[dahdi_span_assignments].
|
||||
|
||||
DAHDI devices are listed under `/sys/bus/dahdi_devices/devices`.
|
||||
|
||||
If you want to disable running this script, add the following line to
|
||||
`/etc/dahdi/init.conf`:
|
||||
.............................
|
||||
DAHDI_UDEV_DISABLE_DEVICES=yes
|
||||
.............................
|
||||
|
||||
|
||||
New Spans
|
||||
^^^^^^^^^
|
||||
Once a span is assigned, a kernel object will appear for it. It will be
|
||||
listed under its device. As a new kernel object was created, an event is
|
||||
sent to udev.
|
||||
|
||||
The standard DAHDI udev rules instruct udevd to run the script
|
||||
`/usr/share/dahdi/dahdi_span_config` which runs all the scripts in
|
||||
`/usr/share/dahdi/span_config.d`. Those script configures the new
|
||||
span:
|
||||
|
||||
* If system.conf does not exist, generates a temporary configuration
|
||||
for the span using link:doc/dahdi_genconf.8.html[dahdi_genconf
|
||||
system].
|
||||
|
||||
* Runs link:doc/dahdi_cfg.8.html[dahdi_cfg] on the new span (using `-S`
|
||||
and -C`).
|
||||
|
||||
* Runs `asterisk -rx 'dahdi create channels'` to add the new channels
|
||||
and spans to Asterisk (if they were configured in advance).
|
||||
|
||||
If you want to disable running this script, add the following line to
|
||||
`/etc/dahdi/init.conf`:
|
||||
.............................
|
||||
DAHDI_UDEV_DISABLE_SPANS=yes
|
||||
.............................
|
||||
|
||||
|
||||
New Channels
|
||||
^^^^^^^^^^^^
|
||||
DAHDI channels have their own representation in the kernel. The standard
|
||||
udev rules that dahdi-tools includes for them, however, don't run a
|
||||
script for each device. Each DAHDI channel creates a block device file
|
||||
at /dev/dahdi/chan/'span'/'rel-chan', where 'span' and 'rel-chan' are
|
||||
each three-digit numbers (e.g: 035). 'span' is the span number and
|
||||
'rel-chan' is the channel number relative to the span.
|
||||
|
||||
The udev rules generate the following extra symlinks under /dev/dahdi:
|
||||
|
||||
* /dev/dahdi/'num' - the channel number. As it was originally (but
|
||||
continues beyond 250).
|
||||
* /dev/dahdi/devices/'hardware_id'/'rel-span'/'rel-chan' - if the DAHDI
|
||||
device has a hardware ID field, provide listing of the device's span
|
||||
and channels.
|
||||
* /dev/dahdi/devices/@'hardware_id'/'rel-span'/'rel-chan' - likewise for
|
||||
the connector field. It has a "@" prefix.
|
||||
|
||||
|
||||
include::UPGRADE.txt[]
|
||||
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#
|
||||
# /etc/dahdi/pinned-spans.conf:
|
||||
# /etc/dahdi/assigned-spans.conf:
|
||||
#
|
||||
# This file assigns span and channel numbers to dahdi devices
|
||||
#
|
||||
|
@ -10,6 +10,7 @@
|
|||
# * The <id> field may be either:
|
||||
# hardware_id
|
||||
# @location
|
||||
# devpath (in sysfs)
|
||||
# * Shell-style globbing is allowed for the <id> field
|
||||
# * There may one or more of <spanspec>
|
||||
# * Each <spanspec> is composed as:
|
||||
|
@ -44,13 +45,13 @@
|
|||
# Astribank with 4*BRI without hardware_id :-(
|
||||
# We use the location on the bus (ie: where it is physically
|
||||
# located). Note the '@' prefix that indicate the location key.
|
||||
#@pci0000:00/0000:00:03.3/usb1/1-6/xbus-01/astribanks:xbus-01 1:1:50
|
||||
#@pci0000:00/0000:00:03.3/usb1/1-6/xbus-01/astribanks:xbus-01 2:2:100
|
||||
#@pci0000:00/0000:00:03.3/usb1/1-6/xbus-01/astribanks:xbus-01 3:3:150
|
||||
#@pci0000:00/0000:00:03.3/usb1/1-6/xbus-01/astribanks:xbus-01 4:4:200
|
||||
#@usb-0000:00:1d.7-3 1:1:50
|
||||
#@usb-0000:00:1d.7-3 2:2:100
|
||||
#@usb-0000:00:1d.7-3 3:3:150
|
||||
#@usb-0000:00:1d.7-3 4:4:200
|
||||
|
||||
# Same configuration with globbing:
|
||||
#@*/usb1/1-6/* 1:1:50
|
||||
#@*/usb1/1-6/* 2:2:100
|
||||
#@*/usb1/1-6/* 3:3:150
|
||||
#@*/usb1/1-6/* 4:4:200
|
||||
#/sys/*/usb1/1-6/* 1:1:50
|
||||
#/sys/*/usb1/1-6/* 2:2:100
|
||||
#/sys/*/usb1/1-6/* 3:3:150
|
||||
#/sys/*/usb1/1-6/* 4:4:200
|
114
autoconfig.h.in
114
autoconfig.h.in
|
@ -1,114 +0,0 @@
|
|||
/* autoconfig.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define if your system has the DAHDI headers. */
|
||||
#undef HAVE_DAHDI
|
||||
|
||||
/* Define if your system has the DAHDI23 headers. */
|
||||
#undef HAVE_DAHDI23
|
||||
|
||||
/* Define DAHDI23 headers version */
|
||||
#undef HAVE_DAHDI23_VERSION
|
||||
|
||||
/* Define DAHDI headers version */
|
||||
#undef HAVE_DAHDI_VERSION
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <linux/soundcard.h> header file. */
|
||||
#undef HAVE_LINUX_SOUNDCARD_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define this to indicate the ${NEWT_DESCRIP} library */
|
||||
#undef HAVE_NEWT
|
||||
|
||||
/* Define to indicate the ${NEWT_DESCRIP} library version */
|
||||
#undef HAVE_NEWT_VERSION
|
||||
|
||||
/* Define to 1 if you have the `semtimedop' function. */
|
||||
#undef HAVE_SEMTIMEDOP
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/soundcard.h> header file. */
|
||||
#undef HAVE_SYS_SOUNDCARD_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define this to indicate the ${USB_DESCRIP} library */
|
||||
#undef HAVE_USB
|
||||
|
||||
/* Define to indicate the ${USB_DESCRIP} library version */
|
||||
#undef HAVE_USB_VERSION
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Enable extensions on AIX 3, Interix. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# undef _GNU_SOURCE
|
||||
#endif
|
||||
/* Enable threading extensions on Solaris. */
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
# undef _POSIX_PTHREAD_SEMANTICS
|
||||
#endif
|
||||
/* Enable extensions on HP NonStop. */
|
||||
#ifndef _TANDEM_SOURCE
|
||||
# undef _TANDEM_SOURCE
|
||||
#endif
|
||||
/* Enable general extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# undef __EXTENSIONS__
|
||||
#endif
|
||||
|
||||
|
||||
/* Define to 1 if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
||||
this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
|
@ -68,6 +68,8 @@ elif [ -d ${1}/.git ]; then
|
|||
# options.
|
||||
VERSION=GIT-`git rev-parse --short --verify HEAD`${MODIFIED}
|
||||
fi
|
||||
VERSION=${VERSION##*/} # Remove leading slashes: upsteram/2.10.2
|
||||
VERSION=${VERSION#[1-9]%} # Remove 1% from tag (tag from Debian epoch)
|
||||
echo ${VERSION}
|
||||
else
|
||||
PARTS=`LANG=C git log --pretty=full | grep -F "git-svn-id:" | head -1 | awk '{print $2;}' | sed -e s:^.*/svn/$2/:: | sed -e 's:/: :g' | sed -e 's/@.*$//g'`
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
#!/bin/sh
|
||||
cat << END
|
||||
/*
|
||||
* version.c
|
||||
* Automatically generated
|
||||
*/
|
||||
|
||||
const char dahdi_tools_version[] = "DAHDI Tools Version - ${TOOLSVERSION}";
|
||||
|
||||
END
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
216
configure.ac
216
configure.ac
|
@ -2,29 +2,65 @@
|
|||
|
||||
AC_PREREQ(2.59)
|
||||
|
||||
m4_define([TOOLSVERSION],
|
||||
m4_define([short_version],
|
||||
m4_bpatsubst(m4_esyscmd([build_tools/make_version . dahdi/tools]),
|
||||
[\([0-9.]*\)\(\w\|\W\)*],
|
||||
[\1]))
|
||||
AC_INIT(dahdi, TOOLSVERSION, www.asterisk.org)
|
||||
AC_INIT([dahdi-tools], short_version, [www.asterisk.org])
|
||||
|
||||
# check existence of the package
|
||||
AC_CONFIG_SRCDIR([dahdi_cfg.c])
|
||||
AC_CONFIG_AUX_DIR([auxdir])
|
||||
AC_CONFIG_MACRO_DIR([m4])
|
||||
AM_INIT_AUTOMAKE([foreign subdir-objects])
|
||||
|
||||
build_version=`build_tools/make_version . dahdi/tools`
|
||||
AC_SUBST([BUILD_VERSION], "$build_version")
|
||||
|
||||
# enable nice build output on automake1.11
|
||||
m4_pattern_allow([AM_DEFAULT_VERBOSITY])
|
||||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],[AM_DEFAULT_VERBOSITY=1])
|
||||
AM_CONDITIONAL([SILENT_RULES], [test "$AM_DEFAULT_VERBOSITY" = '0'])
|
||||
|
||||
AC_COPYRIGHT("dahdi-tools")
|
||||
AC_REVISION($Revision$)
|
||||
|
||||
ac_default_prefix=/usr
|
||||
if test ${sysconfdir} = '${prefix}/etc'; then
|
||||
sysconfdir=/etc
|
||||
fi
|
||||
if test ${mandir} = '${prefix}/man'; then
|
||||
mandir=/usr/share/man
|
||||
fi
|
||||
# Preserve old defaults if called without --prefix or --prefix=/usr
|
||||
# prefix=/usr
|
||||
# sysconfdir=/etc
|
||||
|
||||
if test ${localstatedir} = '${prefix}/var'; then
|
||||
localstatedir=/var
|
||||
ac_default_prefix=/usr
|
||||
if test "$prefix" = 'NONE' -o "$prefix" = '/usr'; then
|
||||
if test ${sysconfdir} = '${prefix}/etc'; then
|
||||
sysconfdir=/etc
|
||||
fi
|
||||
if test ${mandir} = '${prefix}/man'; then
|
||||
mandir=/usr/share/man
|
||||
fi
|
||||
|
||||
if test ${localstatedir} = '${prefix}/var'; then
|
||||
localstatedir=/var
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([dahditoolsdir], ['${datadir}/dahdi'])
|
||||
AC_SUBST([dahdiincludedir], ['${includedir}/dahdi'])
|
||||
|
||||
# Where to install udev rules?
|
||||
# * Our default is $sysconfdir/udev/rules.d:
|
||||
# - This preserve legacy location.
|
||||
# - It doesn't write into modern vendor supplied location (/lib/udev/rules.d)
|
||||
# - It doesn't break "make distcheck" (where everything should be relative
|
||||
# to prefix.
|
||||
# * Packagers are encouraged to use --udevrules=/lib/udev/rules.d
|
||||
#
|
||||
m4_define([_UDEV_RULES_DIR_DEFAULT], [${sysconfdir}/udev/rules.d])dnl
|
||||
AC_ARG_WITH(udevrules,
|
||||
[AS_HELP_STRING([--with-udevrules=PATH],
|
||||
[Location of UDEV rules @<:@default=]_UDEV_RULES_DIR_DEFAULT[@:>@])],
|
||||
[udevrulesdir=$withval],
|
||||
[udevrulesdir=]'_UDEV_RULES_DIR_DEFAULT'
|
||||
)
|
||||
AC_SUBST([udevrulesdir], "$udevrulesdir")
|
||||
|
||||
# specify output header file
|
||||
AC_CONFIG_HEADER(autoconfig.h)
|
||||
|
@ -32,15 +68,18 @@ AC_CONFIG_HEADER(autoconfig.h)
|
|||
# This needs to be before any macros that use the C compiler
|
||||
AC_GNU_SOURCE
|
||||
|
||||
AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h])
|
||||
|
||||
AC_CHECK_TOOL([LD], [ld])
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CXX
|
||||
AC_PROG_CC
|
||||
AC_PROG_CPP
|
||||
AM_PROG_CC_C_O
|
||||
AC_PROG_INSTALL
|
||||
AC_PROG_LN_S
|
||||
AC_PROG_MAKE_SET
|
||||
AC_PROG_AWK
|
||||
AC_PROG_LIBTOOL
|
||||
AST_CHECK_GNU_MAKE
|
||||
|
||||
test_obj=conftest.o
|
||||
|
@ -70,6 +109,35 @@ AC_SUBST(DOWNLOAD)
|
|||
|
||||
AC_LANG(C)
|
||||
|
||||
AC_PATH_PROG([PERL], [perl])
|
||||
if test "$PERL" = ''; then
|
||||
AC_MSG_ERROR(perl is mandatory)
|
||||
fi
|
||||
# Where to install perl modules?
|
||||
# * Packagers are encouraged to use the result of "perl -V:vendorlib"
|
||||
# * Our default is:
|
||||
# - The result of "perl -V:sitelib" for our default prefix (/usr)
|
||||
# - The "$datadir/perl5" directory otherwise (e.g: during "make distcheck")
|
||||
#
|
||||
AC_MSG_CHECKING(for perl libdir)
|
||||
m4_define([_PERL_LIBDIR_DEFAULT], [${datadir}/perl5])dnl
|
||||
AC_ARG_WITH(perllib,
|
||||
[AS_HELP_STRING([--with-perllib=PATH],
|
||||
[Location of perl modules @<:@default=]_PERL_LIBDIR_DEFAULT[, or perl -V:sitelib@:>@])],
|
||||
[perllibdir=$withval],
|
||||
[
|
||||
if test "$prefix" = 'NONE' -o "$prefix" = '/usr'; then
|
||||
eval `"$PERL" -V:sitelib`
|
||||
perllibdir="$sitelib"
|
||||
else
|
||||
perllibdir='_PERL_LIBDIR_DEFAULT'
|
||||
fi
|
||||
]
|
||||
)
|
||||
AC_SUBST([perllibdir], "$perllibdir")
|
||||
AC_MSG_RESULT([$perllibdir])
|
||||
AM_CONDITIONAL([PERL], [test "$perllibdir" != ''])
|
||||
|
||||
AC_ARG_ENABLE(dev-mode,
|
||||
[ --enable-dev-mode Turn on developer mode],
|
||||
[case "${enableval}" in
|
||||
|
@ -78,15 +146,7 @@ AC_ARG_ENABLE(dev-mode,
|
|||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-dev-mode) ;;
|
||||
esac])
|
||||
AC_SUBST(DAHDI_DEVMODE)
|
||||
|
||||
AC_ARG_ENABLE(pinned,
|
||||
[ --enable-pinned Install pinned-spans support],
|
||||
[case "${enableval}" in
|
||||
y|ye|yes) DAHDI_PINNED=yes ;;
|
||||
n|no) DAHDI_PINNED=no ;;
|
||||
*) AC_MSG_ERROR(bad value ${enableval} for --enable-pinned) ;;
|
||||
esac])
|
||||
AC_SUBST(DAHDI_PINNED)
|
||||
AM_CONDITIONAL([DAHDI_DEVMODE], [test "$DAHDI_DEVMODE" = 'yes'])
|
||||
|
||||
AC_MSG_CHECKING(for -Wdeclaration-after-statement support)
|
||||
if $(${CC} -Wdeclaration-after-statement -S -o /dev/null -xc /dev/null > /dev/null 2>&1); then
|
||||
|
@ -98,17 +158,104 @@ else
|
|||
fi
|
||||
AC_SUBST(DAHDI_DECLARATION_AFTER_STATEMENT)
|
||||
|
||||
# Checks for header files.
|
||||
AC_CHECK_HEADERS([sys/soundcard.h linux/soundcard.h])
|
||||
AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h syslog.h unistd.h])
|
||||
|
||||
# Checks for typedefs, structures, and compiler characteristics.
|
||||
AC_C_INLINE
|
||||
AC_TYPE_SIZE_T
|
||||
AC_TYPE_SSIZE_T
|
||||
AC_TYPE_UINT16_T
|
||||
AC_TYPE_UINT32_T
|
||||
AC_TYPE_UINT8_T
|
||||
|
||||
# Checks for libraries.
|
||||
AC_CHECK_LIB([m], [cos])
|
||||
AC_CHECK_LIB([pthread], [pthread_create])
|
||||
|
||||
AST_EXT_LIB_SETUP([DAHDI], [DAHDI], [dahdi])
|
||||
AST_EXT_LIB_SETUP([NEWT], [newt], [newt])
|
||||
AST_EXT_LIB_SETUP([USB], [usb], [usb])
|
||||
AST_EXT_LIB_SETUP([PCAP], [pcap], [pcap])
|
||||
|
||||
AST_C_DEFINE_CHECK([DAHDI], [DAHDI_CODE], [dahdi/user.h])
|
||||
DAHDI23_DIR="${DAHDI_DIR}"
|
||||
AST_C_DEFINE_CHECK([DAHDI23], [DAHDI_CONFIG_NTTE], [dahdi/user.h])
|
||||
AST_EXT_LIB_CHECK([NEWT], [newt], [newtBell], [newt.h])
|
||||
AST_EXT_LIB_CHECK([USB], [usb], [usb_init], [usb.h])
|
||||
AST_EXT_LIB_CHECK([PCAP], [pcap], [pcap_compile], [pcap.h])
|
||||
|
||||
saved_CPPFLAGS="$CPPFLAGS"
|
||||
CPPFLAGS="$CPPFLAGS $DAHDI_INCLUDE"
|
||||
AC_CHECK_DECL([DAHDI_TXMIRROR], [DAHDI_TXMIRROR=1], [DAHDI_TXMIRROR=0], [#include <dahdi/user.h>])
|
||||
CPPFLAGS="$saved_CPPFLAGS"
|
||||
|
||||
AM_CONDITIONAL([PBX_NEWT], [test "$PBX_NEWT" = "1"])
|
||||
AM_CONDITIONAL([PBX_PCAP], [test "$PBX_PCAP" = "1" -a "$DAHDI_TXMIRROR" = "1"])
|
||||
|
||||
AC_CHECK_FUNCS([semtimedop])
|
||||
AC_CHECK_FUNCS([alarm bzero gettimeofday memset pow regcomp select socket strcasecmp strchr strdup strerror strrchr strstr strtol strtoul])
|
||||
AC_FUNC_ERROR_AT_LINE
|
||||
AC_FUNC_MALLOC
|
||||
|
||||
# What the user asked for? libusb/libusbx
|
||||
AC_ARG_WITH([libusbx],
|
||||
[AS_HELP_STRING([--without-libusbx], [Disable libusbx @<:@default=check@:>@])],
|
||||
[],
|
||||
[with_libusbx=check])
|
||||
AC_ARG_WITH([libusb],
|
||||
[AS_HELP_STRING([--without-libusb], [Disable libusb-0.1 @<:@default=check@:>@])],
|
||||
[],
|
||||
[with_libusb=check])
|
||||
|
||||
# LIBUSBX tests
|
||||
have_libusbx=
|
||||
AS_IF([test "$with_libusbx" != "no"],
|
||||
[PKG_CHECK_MODULES([LIBUSBX], [libusb-1.0],
|
||||
[AC_CHECK_LIB([usb-1.0], [libusb_error_name],
|
||||
[
|
||||
have_libusbx="yes"
|
||||
AC_DEFINE([HAVE_LIBUSBX], [1], [Define to 1 if you have <libusb.h>.])
|
||||
AC_SUBST([PBX_USB], [1])
|
||||
], [
|
||||
if test "$with_libusbx" != "yes"; then
|
||||
AC_MSG_NOTICE([Ignoring old libusb-1.0, trying fallback to old libusb])
|
||||
fi
|
||||
])
|
||||
], [:])
|
||||
], [])
|
||||
|
||||
AS_IF([test "$with_libusbx" = "yes" -a "$have_libusbx" = ""],
|
||||
[AC_MSG_ERROR([No libusbx found (--with-libusbx was given)])])
|
||||
|
||||
# LIBUSB tests
|
||||
have_libusb=
|
||||
AS_IF([test "$with_libusb" != "no"],
|
||||
[AS_IF([test "$have_libusbx" != ""],
|
||||
[
|
||||
AS_IF([test "$with_libusbx" = "check"], [
|
||||
AC_MSG_NOTICE([Skipping LIBUSB tests (have good LIBUSBX)])
|
||||
])
|
||||
], [
|
||||
PKG_CHECK_MODULES([LIBUSB], [libusb],
|
||||
[
|
||||
have_libusb="yes"
|
||||
AC_SUBST([PBX_USB], [1])
|
||||
]
|
||||
[AC_DEFINE([HAVE_LIBUSB], [1], [Define to 1 if you have <usb.h>.])],
|
||||
[:]
|
||||
)
|
||||
])
|
||||
], [])
|
||||
|
||||
AS_IF([test "$with_libusb" = "yes" -a "$have_libusb" = ""],
|
||||
[AC_MSG_ERROR([No libusb found (--with-libusb was given)])])
|
||||
|
||||
AM_CONDITIONAL([LIBUSBX], [test "$have_libusbx" != ""])
|
||||
AM_CONDITIONAL([LIBUSB], [test "$have_libusb" != ""])
|
||||
AM_CONDITIONAL([PBX_USB], [test "$PBX_USB" = "1"])
|
||||
|
||||
|
||||
PBX_HDLC=0
|
||||
AC_MSG_CHECKING([for GENERIC_HDLC_VERSION version 4 in linux/hdlc.h])
|
||||
|
@ -147,6 +294,7 @@ if test "x${PBX_HDLC}" != "x1"; then
|
|||
fi
|
||||
|
||||
AC_SUBST(PBX_HDLC)
|
||||
AM_CONDITIONAL([PBX_HDLC], [test "$PBX_HDLC" = "1"])
|
||||
|
||||
AC_ARG_WITH(selinux,
|
||||
[AS_HELP_STRING([--with-selinux],
|
||||
|
@ -202,6 +350,9 @@ case "$with_ppp" in
|
|||
;;
|
||||
esac
|
||||
|
||||
AC_SUBST(PPPD_VERSION)
|
||||
AM_CONDITIONAL([PPPD], [test "$PPPD_VERSION" != ''])
|
||||
|
||||
if test "x${PBX_DAHDI}" != "x1"; then
|
||||
AC_MSG_NOTICE([***])
|
||||
AC_MSG_NOTICE([*** Building this package requires DAHDI support. *** ])
|
||||
|
@ -220,7 +371,26 @@ fi
|
|||
|
||||
AC_SUBST(PPPD_VERSION)
|
||||
|
||||
AC_CONFIG_FILES([makeopts])
|
||||
# Taken from octasic-helper
|
||||
AC_SUBST([USE_OCTASIC], [yes])
|
||||
AM_CONDITIONAL([USE_OCTASIC], [test "$USE_OCTASIC" = 'yes'])
|
||||
octasic_dir='$(top_srcdir)/xpp/oct612x'
|
||||
AC_SUBST([OCTASIC_CFLAGS], ["-I$octasic_dir/include -I$octasic_dir/octdeviceapi -I$octasic_dir/octdeviceapi/oct6100api"])
|
||||
|
||||
AC_SUBST([TOOLSVERSION], m4_esyscmd([build_tools/make_version . dahdi/tools]))
|
||||
|
||||
AC_CONFIG_FILES([
|
||||
makeopts
|
||||
version.c
|
||||
Makefile
|
||||
doc/Makefile
|
||||
hotplug/Makefile
|
||||
ppp/Makefile
|
||||
xpp/Makefile
|
||||
xpp/xtalk/Makefile
|
||||
xpp/oct612x/Makefile
|
||||
xpp/perl_modules/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
|
||||
AC_MSG_NOTICE(*** dahdi-tools build successfully configured ***)
|
||||
|
|
|
@ -0,0 +1,133 @@
|
|||
# Check for bash
|
||||
[ -z "$BASH_VERSION" ] && return
|
||||
|
||||
__dahdi_span_assignments() {
|
||||
local cur prev has_cmd i
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
|
||||
has_cmd=0
|
||||
for (( i=0; i < COMP_CWORD; i++)); do
|
||||
case "${COMP_WORDS[$i]}" in
|
||||
add | auto | dumpconfig | list | remove)
|
||||
has_cmd=1
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
case "$prev" in
|
||||
-k | --key) COMPREPLY=( $(compgen -W 'devpath hwid location' -- $cur) ) ;;
|
||||
*)
|
||||
case "$cur" in
|
||||
-*) COMPREPLY=( ${COMPREPLY[@]} $(compgen -W \
|
||||
'-h -k -n -v --help --key --dry-run --verbose' -- $cur ) )
|
||||
;;
|
||||
*)
|
||||
if [ "$has_cmd" = 1 ]; then
|
||||
COMPREPLY=( ${COMPREPLY[@]} $(shopt -s nullglob; \
|
||||
echo /sys/bus/dahdi_devices/devices/* ) )
|
||||
else
|
||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W \
|
||||
'add auto dumpconfig list remove' -- $cur) )
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
complete -F __dahdi_span_assignments dahdi_span_assignments
|
||||
|
||||
__dahdi_span_types() {
|
||||
local cur prev has_cmd i
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
|
||||
has_cmd=0
|
||||
for (( i=0; i < COMP_CWORD; i++)); do
|
||||
case "${COMP_WORDS[$i]}" in
|
||||
dumpconfig | list | set | compare)
|
||||
has_cmd=1
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
case "$prev" in
|
||||
-k | --key) COMPREPLY=( $(compgen -W 'devpath hwid location' -- $cur) ) ;;
|
||||
--line-type) COMPREPLY=( $(compgen -W 'E1 J1 T1' -- $cur) ) ;;
|
||||
*)
|
||||
case "$cur" in
|
||||
-*) COMPREPLY=( ${COMPREPLY[@]} $(compgen -W \
|
||||
'-h -k -n -v --help --key --dry-run --line-type --verbose' -- $cur ) )
|
||||
;;
|
||||
*)
|
||||
if [ "$has_cmd" = 1 ]; then
|
||||
# FIXME: check if devices are settable?
|
||||
COMPREPLY=( ${COMPREPLY[@]} $( \
|
||||
grep -l '[EJT]1' /sys/devices/pci0000:00/0000:00:10.4/usb1/1-1/xbus-00/*/spantype 2>/dev/null | sed -e 's|/spantype||') )
|
||||
else
|
||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W \
|
||||
'dumpconfig list set compare' -- $cur) )
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
complete -F __dahdi_span_types dahdi_span_types
|
||||
|
||||
|
||||
__dahdi_genconf() {
|
||||
local cur
|
||||
COMPREPLY=()
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
|
||||
case "$prev" in
|
||||
--line-type) COMPREPLY=( $(compgen -W 'E1 J1 T1' -- $cur) ) ;;
|
||||
*)
|
||||
case "$cur" in
|
||||
-*) COMPREPLY+=( $(compgen -W '-F -v -V --freepbx --version --verbose --line-type' -- $cur ) ) ;;
|
||||
*)
|
||||
COMPREPLY+=( $(compgen -W "$( perl -e 'my $file = "\u$ARGV[0]";
|
||||
# Complete module name. Translate the case of the
|
||||
# first letter
|
||||
my @pats = map {"$_/Dahdi/Config/Gen/$file*.pm"} @INC;
|
||||
foreach (@pats) {
|
||||
foreach(glob) {
|
||||
s|.*/||;
|
||||
s|.pm$||;
|
||||
s|^(.)|lc($1)|e;
|
||||
print "$_ "
|
||||
}
|
||||
}')" -- $cur ) )
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
complete -F __dahdi_genconf dahdi_genconf
|
||||
|
||||
__dahdi_cfg() {
|
||||
local cur prev
|
||||
COMPREPLY=()
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
prev=${COMP_WORDS[COMP_CWORD-1]}
|
||||
|
||||
case "$prev" in
|
||||
-c) COMPREPLY=( $(compgen -f -- $cur) ) ;;
|
||||
-S) COMPREPLY=( $(ls -d /sys/bus/dahdi_spans/devices/* 2>/dev/null | sed -e 's/.*-//') ) ;;
|
||||
# FIXME: A similar completion for -C (<chan1>-<chan2>)
|
||||
*)
|
||||
COMPREPLY=( ${COMPREPLY[@]} $(compgen -W \
|
||||
'-c -C -f -h -s -S -t -v ' -- $cur ) )
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Disable until -c works properly
|
||||
#complete -F __dahdi_cfg dahdi_cfg
|
29
dahdi.init
29
dahdi.init
|
@ -144,15 +144,18 @@ hotplug_exit_after_load() {
|
|||
|
||||
# Initialize the Xorcom Astribank (xpp/) using perl utiliites:
|
||||
xpp_startup() {
|
||||
if [ "$ASTERISK_SUPPORTS_DAHDI_HOTPLUG" = yes ]; then
|
||||
aas_param='/sys/module/dahdi/parameters/auto_assign_spans'
|
||||
aas=`cat "$aas_param" 2>/dev/null`
|
||||
if [ "$aas" = 0 ]; then
|
||||
echo 1>&2 "Don't wait for Astribanks (use Asterisk hotplug-support)"
|
||||
return 0
|
||||
fi
|
||||
fi
|
||||
# do nothing if there are no astribank devices:
|
||||
if ! /usr/share/dahdi/waitfor_xpds; then return 0; fi
|
||||
|
||||
hotplug_exit_after_load
|
||||
|
||||
# overriding locales for the above two, as perl can be noisy
|
||||
# when locales are missing.
|
||||
# No register all the devices if they didn't auto-register:
|
||||
LC_ALL=C dahdi_registration on
|
||||
}
|
||||
|
||||
|
||||
|
@ -237,11 +240,6 @@ if [ ! -x "$DAHDI_CFG" ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -f /etc/dahdi/system.conf ]; then
|
||||
echo "/etc/dahdi/system.conf not found. Nothing to do."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
RETVAL=0
|
||||
|
||||
# See how we were called.
|
||||
|
@ -268,6 +266,9 @@ case "$1" in
|
|||
|
||||
xpp_startup
|
||||
|
||||
# Assign all spans that weren't handled via udev + /etc/dahdi/assigned-spans.conf
|
||||
/usr/share/dahdi/dahdi_auto_assign_compat
|
||||
|
||||
if [ $system = debian ]; then
|
||||
echo -n "Running dahdi_cfg: "
|
||||
$DAHDI_CFG_CMD 2> /dev/null && echo -n "done"
|
||||
|
@ -286,8 +287,12 @@ case "$1" in
|
|||
$FXOTUNE -s || :
|
||||
fi
|
||||
|
||||
# Set the right Astribanks ticker:
|
||||
LC_ALL=C xpp_sync "$XPP_SYNC"
|
||||
# Do not try to call xpp_sync if there are no Astribank devices
|
||||
# installed.
|
||||
if test -e /sys/bus/astribanks; then
|
||||
# Set the right Astribanks ticker:
|
||||
LC_ALL=C xpp_sync "$XPP_SYNC"
|
||||
fi
|
||||
|
||||
hpec_start
|
||||
;;
|
||||
|
|
18
dahdi.rules
18
dahdi.rules
|
@ -1,4 +1,18 @@
|
|||
|
||||
ACTION!="add", GOTO="dahdi_add_end"
|
||||
|
||||
# DAHDI devices with ownership/permissions for running as non-root
|
||||
SUBSYSTEM=="dahdi", OWNER="asterisk", GROUP="asterisk", MODE="0660"
|
||||
SUBSYSTEM=="dahdi_devices", RUN="/usr/share/dahdi/handle_device"
|
||||
SUBSYSTEM=="dahdi_spans", RUN="/usr/share/dahdi/span_config"
|
||||
|
||||
# Backward compat names: /dev/dahdi/<channo>
|
||||
SUBSYSTEM=="dahdi_channels", SYMLINK+="dahdi/%m"
|
||||
|
||||
# Add persistant names as well
|
||||
SUBSYSTEM=="dahdi_channels", ATTRS{hardware_id}!="", SYMLINK+="dahdi/devices/%s{hardware_id}/%s{local_spanno}/%n"
|
||||
SUBSYSTEM=="dahdi_channels", ATTRS{location}!="", SYMLINK+="dahdi/devices/@%s{location}/%s{local_spanno}/%n"
|
||||
|
||||
LABEL="dahdi_add_end"
|
||||
|
||||
# hotplug scripts
|
||||
SUBSYSTEM=="dahdi_devices", RUN+="%E{DAHDI_TOOLS_ROOTDIR}/usr/share/dahdi/dahdi_handle_device"
|
||||
SUBSYSTEM=="dahdi_spans", RUN+="%E{DAHDI_TOOLS_ROOTDIR}/usr/share/dahdi/dahdi_span_config"
|
||||
|
|
275
dahdi_cfg.c
275
dahdi_cfg.c
|
@ -29,13 +29,18 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include <getopt.h>
|
||||
#include <signal.h>
|
||||
#include <string.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <semaphore.h>
|
||||
#include <errno.h>
|
||||
#include <dirent.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <dahdi/user.h>
|
||||
#include "tonezone.h"
|
||||
|
@ -85,11 +90,9 @@ static struct dahdi_lineconfig lc[DAHDI_MAX_SPANS];
|
|||
|
||||
static struct dahdi_chanconfig cc[DAHDI_MAX_CHANNELS];
|
||||
|
||||
static int current_span = 0;
|
||||
static int only_span = 0;
|
||||
static int restrict_channels = 0;
|
||||
static int selected_channels[DAHDI_MAX_CHANNELS];
|
||||
static int chan2span[DAHDI_MAX_CHANNELS];
|
||||
static int declared_spans[DAHDI_MAX_SPANS];
|
||||
|
||||
static struct dahdi_attach_echocan ae[DAHDI_MAX_CHANNELS];
|
||||
|
@ -104,7 +107,7 @@ static int fiftysixkhdlc[DAHDI_MAX_CHANNELS];
|
|||
|
||||
static int spans=0;
|
||||
|
||||
static int fo_real = 1;
|
||||
static int dry_run = 0;
|
||||
|
||||
static int verbose = 0;
|
||||
|
||||
|
@ -137,6 +140,97 @@ static const char *laws[] = {
|
|||
"A-law"
|
||||
};
|
||||
|
||||
static bool _are_all_spans_assigned(const char *device_path)
|
||||
{
|
||||
char attribute[1024];
|
||||
int res;
|
||||
FILE *fp;
|
||||
int span_count;
|
||||
DIR *dirp;
|
||||
struct dirent *dirent;
|
||||
|
||||
snprintf(attribute, sizeof(attribute) - 1,
|
||||
"%s/span_count", device_path);
|
||||
fp = fopen(attribute, "r");
|
||||
if (NULL == fp) {
|
||||
fprintf(stderr, "Failed to open '%s'.\n", attribute);
|
||||
return false;
|
||||
}
|
||||
res = fscanf(fp, "%d", &span_count);
|
||||
fclose(fp);
|
||||
|
||||
if (EOF == res) {
|
||||
fprintf(stderr, "Failed to read '%s'.\n", attribute);
|
||||
return false;
|
||||
}
|
||||
|
||||
dirp = opendir(device_path);
|
||||
while (span_count) {
|
||||
dirent = readdir(dirp);
|
||||
if (NULL == dirent)
|
||||
break;
|
||||
if (!strncmp("span-", dirent->d_name, 5)) {
|
||||
--span_count;
|
||||
}
|
||||
}
|
||||
closedir(dirp);
|
||||
return (span_count > 0) ? false : true;
|
||||
}
|
||||
|
||||
/**
|
||||
* are_all_spans_assigned - Look in sysfs to see if all spans for a device are assigned.
|
||||
*
|
||||
* Returns true if there are $span_count child spans of all devices, or false
|
||||
* otherwise.
|
||||
*/
|
||||
static bool are_all_spans_assigned(void)
|
||||
{
|
||||
DIR *dirp;
|
||||
struct dirent *dirent;
|
||||
bool res = true;
|
||||
char device_path[1024];
|
||||
|
||||
dirp = opendir("/sys/bus/dahdi_devices/devices");
|
||||
if (!dirp) {
|
||||
/* If we cannot open dahdi_devices, either dahdi isn't loaded,
|
||||
* or we're using an older version of DAHDI that doesn't use
|
||||
* sysfs. */
|
||||
return true;
|
||||
}
|
||||
|
||||
while (true && res) {
|
||||
|
||||
dirent = readdir(dirp);
|
||||
if (NULL == dirent)
|
||||
break;
|
||||
|
||||
if (!strcmp(dirent->d_name, ".") ||
|
||||
!strcmp(dirent->d_name, ".."))
|
||||
continue;
|
||||
|
||||
snprintf(device_path, sizeof(device_path)-1,
|
||||
"/sys/bus/dahdi_devices/devices/%s", dirent->d_name);
|
||||
res = _are_all_spans_assigned(device_path);
|
||||
}
|
||||
|
||||
closedir(dirp);
|
||||
errno = 0;
|
||||
return res;
|
||||
}
|
||||
|
||||
static bool wait_for_all_spans_assigned(unsigned long timeout_sec)
|
||||
{
|
||||
bool all_assigned = are_all_spans_assigned();
|
||||
unsigned int timeout = 10*timeout_sec;
|
||||
|
||||
while (!all_assigned && --timeout) {
|
||||
usleep(100000);
|
||||
all_assigned = are_all_spans_assigned();
|
||||
}
|
||||
|
||||
return all_assigned;
|
||||
}
|
||||
|
||||
static const char *sigtype_to_str(const int sig)
|
||||
{
|
||||
switch (sig) {
|
||||
|
@ -237,20 +331,9 @@ static char *trim(char *buf)
|
|||
|
||||
static int skip_channel(int x)
|
||||
{
|
||||
int spanno = chan2span[x];
|
||||
|
||||
if (restrict_channels) {
|
||||
if (!selected_channels[x])
|
||||
return 1;
|
||||
/* sanity check */
|
||||
if (only_span) {
|
||||
if (spanno != 0 && only_span != spanno) {
|
||||
fprintf(stderr,
|
||||
"Only span %d. Skip selected channel %d from span %d\n",
|
||||
only_span, x, spanno);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (only_span && !declared_spans[only_span]) {
|
||||
fprintf(stderr,
|
||||
|
@ -258,8 +341,6 @@ static int skip_channel(int x)
|
|||
only_span);
|
||||
exit(1);
|
||||
}
|
||||
if (only_span && only_span != spanno)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -346,7 +427,6 @@ int spanconfig(char *keyword, char *args)
|
|||
error("Span number should be a valid span number, not '%s'\n", realargs[0]);
|
||||
return -1;
|
||||
}
|
||||
current_span = span;
|
||||
declared_spans[span] = 1;
|
||||
res = sscanf(realargs[1], "%d", &timing);
|
||||
if ((res != 1) || (timing < 0) || (timing > MAX_TIMING)) {
|
||||
|
@ -519,7 +599,6 @@ static int chanconfig(char *keyword, char *args)
|
|||
int master=0;
|
||||
int dacschan = 0;
|
||||
char *idle;
|
||||
int is_digital;
|
||||
bzero(chans, sizeof(chans));
|
||||
strtok(args, ":");
|
||||
idle = strtok(NULL, ":");
|
||||
|
@ -531,7 +610,6 @@ static int chanconfig(char *keyword, char *args)
|
|||
if (res <= 0)
|
||||
return -1;
|
||||
for (x=1;x<DAHDI_MAX_CHANNELS;x++) {
|
||||
is_digital = 0;
|
||||
if (chans[x]) {
|
||||
if (slineno[x]) {
|
||||
error("Channel %d already configured as '%s' at line %d\n", x, sig[x], slineno[x]);
|
||||
|
@ -577,7 +655,6 @@ static int chanconfig(char *keyword, char *args)
|
|||
return -1;
|
||||
cc[x].sigtype = DAHDI_SIG_CAS;
|
||||
sig[x] = sigtype_to_str(cc[x].sigtype);
|
||||
is_digital = 1;
|
||||
} else if (!strcasecmp(keyword, "dacs")) {
|
||||
/* Setup channel for monitor */
|
||||
cc[x].idlebits = dacschan;
|
||||
|
@ -588,7 +665,6 @@ static int chanconfig(char *keyword, char *args)
|
|||
cc[dacschan].sigtype = DAHDI_SIG_DACS;
|
||||
sig[x] = sigtype_to_str(cc[dacschan].sigtype);
|
||||
dacschan++;
|
||||
is_digital = 1;
|
||||
} else if (!strcasecmp(keyword, "dacsrbs")) {
|
||||
/* Setup channel for monitor */
|
||||
cc[x].idlebits = dacschan;
|
||||
|
@ -598,7 +674,6 @@ static int chanconfig(char *keyword, char *args)
|
|||
cc[dacschan].idlebits = x;
|
||||
cc[dacschan].sigtype = DAHDI_SIG_DACS_RBS;
|
||||
sig[x] = sigtype_to_str(cc[dacschan].sigtype);
|
||||
is_digital = 1;
|
||||
dacschan++;
|
||||
} else if (!strcasecmp(keyword, "unused")) {
|
||||
cc[x].sigtype = 0;
|
||||
|
@ -606,7 +681,6 @@ static int chanconfig(char *keyword, char *args)
|
|||
} else if (!strcasecmp(keyword, "indclear") || !strcasecmp(keyword, "bchan")) {
|
||||
cc[x].sigtype = DAHDI_SIG_CLEAR;
|
||||
sig[x] = sigtype_to_str(cc[x].sigtype);
|
||||
is_digital = 1;
|
||||
} else if (!strcasecmp(keyword, "clear")) {
|
||||
sig[x] = sigtype_to_str(DAHDI_SIG_CLEAR);
|
||||
if (master) {
|
||||
|
@ -616,7 +690,6 @@ static int chanconfig(char *keyword, char *args)
|
|||
cc[x].sigtype = DAHDI_SIG_CLEAR;
|
||||
master = x;
|
||||
}
|
||||
is_digital = 1;
|
||||
} else if (!strcasecmp(keyword, "rawhdlc")) {
|
||||
sig[x] = sigtype_to_str(DAHDI_SIG_HDLCRAW);
|
||||
if (master) {
|
||||
|
@ -626,7 +699,6 @@ static int chanconfig(char *keyword, char *args)
|
|||
cc[x].sigtype = DAHDI_SIG_HDLCRAW;
|
||||
master = x;
|
||||
}
|
||||
is_digital = 1;
|
||||
} else if (!strcasecmp(keyword, "nethdlc")) {
|
||||
sig[x] = sigtype_to_str(DAHDI_SIG_HDLCNET);
|
||||
memset(cc[x].netdev_name, 0, sizeof(cc[x].netdev_name));
|
||||
|
@ -640,7 +712,6 @@ static int chanconfig(char *keyword, char *args)
|
|||
}
|
||||
master = x;
|
||||
}
|
||||
is_digital = 1;
|
||||
} else if (!strcasecmp(keyword, "fcshdlc")) {
|
||||
sig[x] = sigtype_to_str(DAHDI_SIG_HDLCFCS);
|
||||
if (master) {
|
||||
|
@ -650,26 +721,26 @@ static int chanconfig(char *keyword, char *args)
|
|||
cc[x].sigtype = DAHDI_SIG_HDLCFCS;
|
||||
master = x;
|
||||
}
|
||||
is_digital = 1;
|
||||
} else if (!strcasecmp(keyword, "dchan")) {
|
||||
sig[x] = "D-channel";
|
||||
cc[x].sigtype = DAHDI_SIG_HDLCFCS;
|
||||
is_digital = 1;
|
||||
} else if (!strcasecmp(keyword, "hardhdlc")) {
|
||||
sig[x] = "Hardware assisted D-channel";
|
||||
cc[x].sigtype = DAHDI_SIG_HARDHDLC;
|
||||
is_digital = 1;
|
||||
} else if (!strcasecmp(keyword, "mtp2")) {
|
||||
sig[x] = "MTP2";
|
||||
cc[x].sigtype = DAHDI_SIG_MTP2;
|
||||
is_digital = 1;
|
||||
} else {
|
||||
fprintf(stderr, "Huh? (%s)\n", keyword);
|
||||
}
|
||||
if (is_digital)
|
||||
chan2span[x] = current_span;
|
||||
else
|
||||
current_span = 0;
|
||||
|
||||
if (cc[x].sigtype != DAHDI_SIG_CAS &&
|
||||
cc[x].sigtype != DAHDI_SIG_DACS &&
|
||||
cc[x].sigtype != DAHDI_SIG_DACS_RBS) {
|
||||
if (NULL != idle) {
|
||||
fprintf(stderr, "WARNING: idlebits are not valid on %s channels.\n", sig[x]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -714,21 +785,22 @@ static int setfiftysixkhdlc(char *keyword, char *args)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void apply_fiftysix(void)
|
||||
static int apply_fiftysix(void)
|
||||
{
|
||||
int x;
|
||||
int rate;
|
||||
int chanfd;
|
||||
|
||||
for (x = 1; x < DAHDI_MAX_CHANNELS; x++) {
|
||||
if (skip_channel(x))
|
||||
if (skip_channel(x) || !cc[x].sigtype)
|
||||
continue;
|
||||
|
||||
chanfd = open("/dev/dahdi/channel", O_RDWR);
|
||||
if (chanfd == -1) {
|
||||
fprintf(stderr,
|
||||
"Couldn't open /dev/dahdi/channel: %s\n",
|
||||
strerror(errno));
|
||||
exit(-1);
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (ioctl(chanfd, DAHDI_SPECIFY, &x)) {
|
||||
|
@ -749,6 +821,7 @@ static void apply_fiftysix(void)
|
|||
}
|
||||
close(chanfd);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int setechocan(char *keyword, char *args)
|
||||
|
@ -1444,12 +1517,27 @@ static int span_restrict(char *str)
|
|||
return 1;
|
||||
}
|
||||
|
||||
static const char *SEM_NAME = "dahdi_cfg";
|
||||
static sem_t *lock = SEM_FAILED;
|
||||
|
||||
static void signal_handler(int signal)
|
||||
{
|
||||
if (SEM_FAILED != lock) {
|
||||
sem_unlink(SEM_NAME);
|
||||
}
|
||||
/* The default handler should have been restored before this handler was
|
||||
* called, so we can let the "normal" processing finish the cleanup. */
|
||||
raise(signal);
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int c;
|
||||
char *buf;
|
||||
char *key, *value;
|
||||
int x,found;
|
||||
int exit_code = 0;
|
||||
struct sigaction act;
|
||||
|
||||
while((c = getopt(argc, argv, "fthc:vsd::C:S:")) != -1) {
|
||||
switch(c) {
|
||||
|
@ -1469,7 +1557,7 @@ int main(int argc, char *argv[])
|
|||
force++;
|
||||
break;
|
||||
case 't':
|
||||
fo_real = 0;
|
||||
dry_run = 1;
|
||||
break;
|
||||
case 's':
|
||||
stopmode = 1;
|
||||
|
@ -1495,6 +1583,19 @@ int main(int argc, char *argv[])
|
|||
fprintf(stderr, "%s\n", dahdi_tools_version);
|
||||
}
|
||||
|
||||
if (!restrict_channels && only_span) {
|
||||
error("-S requires -C\n");
|
||||
goto finish;
|
||||
}
|
||||
if (!restrict_channels && !only_span) {
|
||||
bool all_assigned = wait_for_all_spans_assigned(5);
|
||||
|
||||
if (!all_assigned) {
|
||||
fprintf(stderr,
|
||||
"Timeout waiting for all spans to be assigned.\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (fd == -1) fd = open(MASTER_DEVICE, O_RDWR);
|
||||
if (fd < 0) {
|
||||
error("Unable to open master device '%s'\n", MASTER_DEVICE);
|
||||
|
@ -1553,18 +1654,48 @@ finish:
|
|||
if (verbose) {
|
||||
printconfig(fd);
|
||||
}
|
||||
if (!fo_real)
|
||||
exit(0);
|
||||
|
||||
if (dry_run)
|
||||
exit(0);
|
||||
|
||||
if (debug & DEBUG_APPLY) {
|
||||
printf("About to open Master device\n");
|
||||
fflush(stdout);
|
||||
}
|
||||
for (x=0;x<numdynamic;x++) {
|
||||
/* destroy them all */
|
||||
ioctl(fd, DAHDI_DYNAMIC_DESTROY, &zds[x]);
|
||||
|
||||
sigemptyset(&act.sa_mask);
|
||||
act.sa_handler = signal_handler;
|
||||
act.sa_flags = SA_RESETHAND;
|
||||
|
||||
if (sigaction(SIGTERM, &act, NULL) == -1) {
|
||||
perror("Failed to install SIGTERM handler.");
|
||||
exit(1);
|
||||
}
|
||||
if (sigaction(SIGINT, &act, NULL) == -1) {
|
||||
perror("Failed to install SIGINT handler.");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
lock = sem_open(SEM_NAME, O_CREAT, O_RDWR, 1);
|
||||
if (SEM_FAILED == lock) {
|
||||
perror("Unable to create 'dahdi_cfg' mutex");
|
||||
exit_code = 1;
|
||||
goto release_sem;
|
||||
}
|
||||
|
||||
if (-1 == sem_wait(lock)) {
|
||||
perror("Failed to wait for 'dahdi_cfg' mutex");
|
||||
exit_code = 1;
|
||||
goto unlink_sem;
|
||||
}
|
||||
|
||||
if (!restrict_channels && !only_span) {
|
||||
for (x=0;x<numdynamic;x++) {
|
||||
/* destroy them all */
|
||||
ioctl(fd, DAHDI_DYNAMIC_DESTROY, &zds[x]);
|
||||
}
|
||||
}
|
||||
|
||||
if (stopmode) {
|
||||
for (x=0;x<spans;x++) {
|
||||
if (only_span && lc[x].span != only_span)
|
||||
|
@ -1572,10 +1703,12 @@ finish:
|
|||
if (ioctl(fd, DAHDI_SHUTDOWN, &lc[x].span)) {
|
||||
fprintf(stderr, "DAHDI shutdown failed: %s\n", strerror(errno));
|
||||
close(fd);
|
||||
exit(1);
|
||||
exit_code = 1;
|
||||
goto release_sem;
|
||||
}
|
||||
}
|
||||
exit(1);
|
||||
exit_code = 1;
|
||||
goto release_sem;
|
||||
}
|
||||
for (x=0;x<spans;x++) {
|
||||
if (only_span && lc[x].span != only_span)
|
||||
|
@ -1583,16 +1716,32 @@ finish:
|
|||
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);
|
||||
exit_code = 1;
|
||||
goto release_sem;
|
||||
}
|
||||
}
|
||||
for (x=0;x<numdynamic;x++) {
|
||||
if (ioctl(fd, DAHDI_DYNAMIC_CREATE, &zds[x])) {
|
||||
fprintf(stderr, "DAHDI dynamic span creation failed: %s\n", strerror(errno));
|
||||
close(fd);
|
||||
exit(1);
|
||||
|
||||
if (!restrict_channels && !only_span) {
|
||||
|
||||
sem_post(lock);
|
||||
|
||||
for (x=0;x<numdynamic;x++) {
|
||||
if (ioctl(fd, DAHDI_DYNAMIC_CREATE, &zds[x])) {
|
||||
fprintf(stderr, "DAHDI dynamic span creation failed: %s\n", strerror(errno));
|
||||
close(fd);
|
||||
exit_code = 1;
|
||||
goto release_sem;
|
||||
}
|
||||
wait_for_all_spans_assigned(1);
|
||||
}
|
||||
|
||||
if (-1 == sem_wait(lock)) {
|
||||
perror("Failed to wait for 'dahdi_cfg' mutex after creating dynamic spans");
|
||||
exit_code = 1;
|
||||
goto unlink_sem;
|
||||
}
|
||||
}
|
||||
|
||||
for (x=1;x<DAHDI_MAX_CHANNELS;x++) {
|
||||
struct dahdi_params current_state;
|
||||
int master;
|
||||
|
@ -1715,7 +1864,8 @@ finish:
|
|||
" to channel 16 of an E1 CAS span\n");
|
||||
}
|
||||
close(fd);
|
||||
exit(1);
|
||||
exit_code = 1;
|
||||
goto release_sem;
|
||||
}
|
||||
|
||||
ae[x].chan = x;
|
||||
|
@ -1726,7 +1876,8 @@ finish:
|
|||
if (ioctl(fd, DAHDI_ATTACH_ECHOCAN, &ae[x])) {
|
||||
fprintf(stderr, "DAHDI_ATTACH_ECHOCAN failed on channel %d: %s (%d)\n", x, strerror(errno), errno);
|
||||
close(fd);
|
||||
exit(1);
|
||||
exit_code = 1;
|
||||
goto release_sem;
|
||||
}
|
||||
}
|
||||
if (0 == numzones) {
|
||||
|
@ -1753,7 +1904,8 @@ finish:
|
|||
if (ioctl(fd, DAHDI_DEFAULTZONE, &deftonezone)) {
|
||||
fprintf(stderr, "DAHDI_DEFAULTZONE failed: %s (%d)\n", strerror(errno), errno);
|
||||
close(fd);
|
||||
exit(1);
|
||||
exit_code = 1;
|
||||
goto release_sem;
|
||||
}
|
||||
}
|
||||
for (x=0;x<spans;x++) {
|
||||
|
@ -1762,9 +1914,18 @@ finish:
|
|||
if (ioctl(fd, DAHDI_STARTUP, &lc[x].span)) {
|
||||
fprintf(stderr, "DAHDI startup failed: %s\n", strerror(errno));
|
||||
close(fd);
|
||||
exit(1);
|
||||
exit_code = 1;
|
||||
goto release_sem;
|
||||
}
|
||||
}
|
||||
apply_fiftysix();
|
||||
exit(0);
|
||||
exit_code = apply_fiftysix();
|
||||
|
||||
release_sem:
|
||||
if (SEM_FAILED != lock)
|
||||
sem_post(lock);
|
||||
|
||||
unlink_sem:
|
||||
if (SEM_FAILED != lock)
|
||||
sem_unlink(SEM_NAME);
|
||||
exit(exit_code);
|
||||
}
|
||||
|
|
|
@ -1,22 +1,22 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# /usr/sbin/span_assignments:
|
||||
# /usr/sbin/dahdi_span_assignments:
|
||||
#
|
||||
# this script can be used both from udev and
|
||||
# from the command line to assign/unassign and list
|
||||
# current span assignments.
|
||||
#
|
||||
# It uses a configuration file: $DAHDICONFDIR/pinned-spans.conf
|
||||
# It uses a configuration file: $DAHDICONFDIR/assigned-spans.conf
|
||||
# (default DAHDICONFDIR=/etc/dahdi)
|
||||
#
|
||||
# The first argument is an action:
|
||||
# "auto" - trigger driver auto_assign attribute for given devices
|
||||
# (no configuration file is used)
|
||||
# "add" - assign (spans which are not already assigned), according
|
||||
# to /etc/dahdi/pinned-spans.conf configuration file
|
||||
# to /etc/dahdi/assigned-spans.conf configuration file
|
||||
# "remove" - unassign spans which are not already unassigned
|
||||
# "list" - human-readable list of all spans (with/without assignments)
|
||||
# "dumpconfig" - dump current assignments in a /etc/dahdi/pinned-spans.conf
|
||||
# "dumpconfig" - dump current assignments in a /etc/dahdi/assigned-spans.conf
|
||||
# compatible format
|
||||
#
|
||||
# Without further arguments, it operates on all existing spans
|
||||
|
@ -45,16 +45,16 @@
|
|||
# variable.
|
||||
#
|
||||
# Examples:
|
||||
# span_assignments list
|
||||
# span_assignments add # all unassigned devices
|
||||
# span_assignments add /sys/bus/dahdi_devices/devices/astribanks:xbus-00
|
||||
# span_assignments remove # all assigned devices
|
||||
# span_assignments -k location dumpconfig
|
||||
# dahdi_span_assignments list
|
||||
# dahdi_span_assignments add # all unassigned devices
|
||||
# dahdi_span_assignments add /sys/bus/dahdi_devices/devices/astribanks:xbus-00
|
||||
# dahdi_span_assignments remove # all assigned devices
|
||||
# dahdi_span_assignments -k location dumpconfig
|
||||
#
|
||||
|
||||
devbase='/sys/bus/dahdi_devices/devices'
|
||||
DAHDICONFDIR="${DAHDICONFDIR:-/etc/dahdi}"
|
||||
pinned_spans_conf="$DAHDICONFDIR/pinned-spans.conf"
|
||||
DAHDISASSIGNEDSPANSCONF="${DAHDIASSIGNEDSPANSCONF:-"${DAHDICONFDIR}/assigned-spans.conf"}"
|
||||
SPAN_ASSIGNMENTS_KEY=${SPAN_ASSIGNMENTS_KEY:-hwid}
|
||||
dry_run=
|
||||
verbose=
|
||||
|
@ -63,9 +63,11 @@ usage() {
|
|||
echo >&2 "Usage: $0 [options] action [devpath ...]"
|
||||
echo >&2 " action:"
|
||||
echo >&2 " auto - trigger driver auto_assign attribute for given devices"
|
||||
echo >&2 " add - assign spans, according to /etc/dahdi/pinned-spans.conf"
|
||||
echo >&2 " add - assign spans, according to /etc/dahdi/assigned-spans.conf"
|
||||
echo >&2 " remove - unassign spans"
|
||||
echo >&2 " list - human-readable list of all spans"
|
||||
echo >&2 " matched - found spans matched in configuration"
|
||||
echo >&2 " unmatched - found spans not matched in configuration"
|
||||
echo >&2 " dumpconfig - dump current state as new configuration"
|
||||
echo >&2 ""
|
||||
echo >&2 " options:"
|
||||
|
@ -109,7 +111,7 @@ while true ; do
|
|||
break
|
||||
;;
|
||||
*)
|
||||
echo "Internal error!"
|
||||
echo >&2 "Internal error!"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
@ -141,7 +143,7 @@ fi
|
|||
if [ "$#" -gt 0 ]; then
|
||||
DEVICES="$@"
|
||||
else
|
||||
DEVICES=`echo $devbase/*`
|
||||
DEVICES=`ls -d $devbase/* 2>/dev/null`
|
||||
fi
|
||||
|
||||
# Beware of special characters in attributes
|
||||
|
@ -215,10 +217,10 @@ unassign_all_spans() {
|
|||
sort | while read spandir; do
|
||||
local_spanno=`cat "$spandir/local_spanno"`
|
||||
if [ "$dry_run" = true ]; then
|
||||
echo "(dry-run) unassign $device $local_spanno"
|
||||
echo >&2 "(dry-run) unassign $device $local_spanno"
|
||||
continue
|
||||
fi
|
||||
echo "unassign $device $local_spanno"
|
||||
echo >&2 "unassign $device $local_spanno"
|
||||
if ! echo "$local_spanno" > "$device/unassign_span"; then
|
||||
echo >&2 "$0: failed unassigning '$local_spanno' in '$device'"
|
||||
fi
|
||||
|
@ -228,7 +230,7 @@ unassign_all_spans() {
|
|||
|
||||
# Allow comments and empty lines in config file
|
||||
filter_conf() {
|
||||
sed -e 's/#.*//' -e '/^[ \t]*$/d' "$pinned_spans_conf"
|
||||
sed -e 's/#.*//' -e '/^[ \t]*$/d' "$DAHDISASSIGNEDSPANSCONF"
|
||||
}
|
||||
|
||||
assign_device_spans() {
|
||||
|
@ -245,12 +247,12 @@ assign_device_spans() {
|
|||
if [ -d "$span" ]; then
|
||||
span_local_spanno=`cat "$span/local_spanno"`
|
||||
if [ "$span_local_spanno" != "$local_spanno" ]; then
|
||||
echo "WARNING: $span_local_spanno != $local_spanno"
|
||||
echo >&2 "WARNING: $span_local_spanno != $local_spanno"
|
||||
fi
|
||||
echo "$device [$local_spanno] already assigned to span $spanno. Skipping..."
|
||||
echo >&2 "$device [$local_spanno] already assigned to span $spanno. Skipping..."
|
||||
continue
|
||||
fi
|
||||
echo "assign $device: $s"
|
||||
echo >&2 "assign $device: $s"
|
||||
if ! echo "$s" > "$device/assign_span"; then
|
||||
echo >&2 "$0: failed assigning '$s' to '$device'"
|
||||
fi
|
||||
|
@ -267,21 +269,21 @@ match_device() {
|
|||
# We use case to enable shell-style globbing in configuration
|
||||
case "$hardware_id" in
|
||||
$id)
|
||||
[ "$verbose" = true ] && echo "match by hwid ($id ~ $hardware_id): $spanspecs"
|
||||
[ "$verbose" = true ] && echo >&2 "match by hwid ($id ~ $hardware_id): $spanspecs"
|
||||
assign_device_spans "$device"
|
||||
;;
|
||||
esac
|
||||
# We use case to enable shell-style globbing in configuration
|
||||
case "$location" in
|
||||
$id)
|
||||
[ "$verbose" = true ] && echo "match by location ($id ~ $location): $spanspecs"
|
||||
[ "$verbose" = true ] && echo >&2 "match by location ($id ~ $location): $spanspecs"
|
||||
assign_device_spans "$device"
|
||||
;;
|
||||
esac
|
||||
# We use case to enable shell-style globbing in configuration
|
||||
case "$devpath" in
|
||||
$id)
|
||||
[ "$verbose" = true ] && echo "match by devpath ($id ~ $devpath): $spanspecs"
|
||||
[ "$verbose" = true ] && echo >&2 "match by devpath ($id ~ $devpath): $spanspecs"
|
||||
assign_device_spans "$device"
|
||||
;;
|
||||
esac
|
||||
|
@ -289,11 +291,11 @@ match_device() {
|
|||
}
|
||||
|
||||
assign_devices() {
|
||||
if [ ! -f "$pinned_spans_conf" ]; then
|
||||
echo >&2 "$0: Missing '$pinned_spans_conf'"
|
||||
if [ ! -f "$DAHDISASSIGNEDSPANSCONF" ]; then
|
||||
echo >&2 "$0: Missing '$DAHDISASSIGNEDSPANSCONF'"
|
||||
exit 1
|
||||
fi
|
||||
echo "using '$pinned_spans_conf'"
|
||||
echo >&2 "using '$DAHDISASSIGNEDSPANSCONF'"
|
||||
for device in $DEVICES
|
||||
do
|
||||
match_device "$device"
|
||||
|
@ -303,13 +305,71 @@ assign_devices() {
|
|||
auto_assign_devices() {
|
||||
for device in $DEVICES
|
||||
do
|
||||
echo "auto-assign $device"
|
||||
echo >&2 "auto-assign $device"
|
||||
if [ "$dry_run" != true ]; then
|
||||
echo 1 > "$device/auto_assign"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
dev_match_conf() {
|
||||
local devpath="$1"
|
||||
local location="$2"
|
||||
local hardware_id="$3"
|
||||
local local_spanno="$4"
|
||||
filter_conf | while read id spanspecs
|
||||
do
|
||||
spanno=`echo "$spanspecs" | cut -d: -f1`
|
||||
match_dev=no
|
||||
# We use case to enable shell-style globbing in configuration
|
||||
case "$hardware_id" in
|
||||
$id)
|
||||
match_dev=yes
|
||||
;;
|
||||
esac
|
||||
# We use case to enable shell-style globbing in configuration
|
||||
case "$location" in
|
||||
$id)
|
||||
match_dev=yes
|
||||
;;
|
||||
esac
|
||||
# We use case to enable shell-style globbing in configuration
|
||||
case "$devpath" in
|
||||
$id)
|
||||
match_dev=yes
|
||||
;;
|
||||
esac
|
||||
if [ "$match_dev" = 'yes' -a "$local_spanno" = "$spanno" ]; then
|
||||
#printf "%-8s (%s) %-14s %s %s\n" "$local_spanno" "$spanno" "[$hardware_id]" "$location" "$devpath"
|
||||
echo "[$hardware_id]:$local_spanno"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
list_devices() {
|
||||
wanted="$1"
|
||||
if [ ! -f "$DAHDISASSIGNEDSPANSCONF" ]; then
|
||||
echo >&2 "$0: Missing '$DAHDISASSIGNEDSPANSCONF'"
|
||||
exit 1
|
||||
fi
|
||||
echo >&2 "using '$DAHDISASSIGNEDSPANSCONF'"
|
||||
for device in $DEVICES
|
||||
do
|
||||
devpath=`cd "$device" && pwd -P`
|
||||
location='@'`attr_clean "$device/location"`
|
||||
hardware_id=`attr_clean "$device/hardware_id"`
|
||||
for local_spanno in `cut -d: -f1 "$device/spantype"`
|
||||
do
|
||||
found=`dev_match_conf "$devpath" "$location" "$hardware_id" "$local_spanno"`
|
||||
if [ "$wanted" = "unmatched" ]; then
|
||||
[ -z "$found" ] && echo "[$hardware_id]:$local_spanno"
|
||||
else
|
||||
[ -z "$found" ] || echo "[$hardware_id]:$local_spanno"
|
||||
fi
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
case "$action" in
|
||||
auto)
|
||||
auto_assign_devices
|
||||
|
@ -326,6 +386,12 @@ list)
|
|||
dumpconfig)
|
||||
dump_config
|
||||
;;
|
||||
matched)
|
||||
list_devices "matched"
|
||||
;;
|
||||
unmatched)
|
||||
list_devices "unmatched"
|
||||
;;
|
||||
*)
|
||||
echo >&2 "Bad action='$action'"
|
||||
usage
|
|
@ -0,0 +1,397 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# /usr/sbin/dahdi_span_types
|
||||
#
|
||||
# This script can be used both from udev and
|
||||
# from the command line to manage PRI spans
|
||||
# type (E1/T1/J1).
|
||||
#
|
||||
# Span types can be set only *BEFORE* span are assigned.
|
||||
#
|
||||
# It uses a configuration file: $DAHDICONFDIR/span-types.conf
|
||||
# (default DAHDICONFDIR=/etc/dahdi)
|
||||
# (the format is documented inside that file)
|
||||
#
|
||||
# The first argument is an action:
|
||||
# "set" - actually write the setting to the driver
|
||||
# "list" - human-readable list of E1/T1/J1 types
|
||||
# "dumpconfig" - dump current assignments in a /etc/dahdi/span-types.conf
|
||||
# compatible format
|
||||
#
|
||||
# Without further arguments, it operates on all existing spans
|
||||
# With one or more sysfs dahdi_devices it is limited to those.
|
||||
#
|
||||
# We may use alternative "keys" for device matching:
|
||||
# * Available keys:
|
||||
# - "hwid" - Hardware id attribute from sysfs
|
||||
# - "@location" - Location attribute from sysfs (embeded inside '<>')
|
||||
# - "/devpath" - The sysfs absolute devpath
|
||||
#
|
||||
# * Wildcard are allowed in the configuration file:
|
||||
# - In the device specifiers (keys)
|
||||
# - In the span numbers
|
||||
# - Example for "match-all": * *:T1
|
||||
#
|
||||
# * During "set":
|
||||
# - If there are multiple matches, for a span, all are applied
|
||||
# - They are always applied in their order in the configuration file
|
||||
# - This means the last match wins
|
||||
# - Example:
|
||||
# * *:T1 # All span on all devices are T1
|
||||
# usb:X1234567 [34]:E1 # Except spans 3,4 on specific device
|
||||
#
|
||||
# * During "dumpconfig", for each device we take the first available key:
|
||||
# - The preference is: "hwid" or else "@location" or else "/devpath"
|
||||
# - This can be overriden via the SPAN_ASSIGNMENTS_KEY environment variable
|
||||
# or the '{-k|--key} key' command line option.
|
||||
#
|
||||
# Command line options:
|
||||
# - The '-h|--help' show a usage message.
|
||||
# - The '-v|--verbose' show debugging messages (on stderr)
|
||||
# - The '-n|--dry-run' During "set", only show what would be done
|
||||
# - The '-k <key>|--key <key>' overrides the SPAN_ASSIGNMENTS_KEY environment
|
||||
# variable.
|
||||
#
|
||||
# Examples:
|
||||
# dahdi_span_types list
|
||||
# dahdi_span_types set # all devices
|
||||
# dahdi_span_types set /sys/bus/dahdi_devices/devices/astribanks:xbus-00
|
||||
# dahdi_span_types -k location dumpconfig
|
||||
#
|
||||
|
||||
|
||||
devbase='/sys/bus/dahdi_devices/devices'
|
||||
DAHDICONFDIR="${DAHDICONFDIR:-/etc/dahdi}"
|
||||
DAHDISPANTYPESCONF="${DAHDISPANTYPESCONF:-"${DAHDICONFDIR}/span-types.conf"}"
|
||||
SPAN_ASSIGNMENTS_KEY=${SPAN_ASSIGNMENTS_KEY:-hwid}
|
||||
|
||||
usage() {
|
||||
echo >&2 "Usage: $0 [options] action [devpath ...]"
|
||||
echo >&2 " action:"
|
||||
echo >&2 " set - set spans to E1/T1 according to /etc/dahdi/span-types.conf"
|
||||
echo >&2 " compare - show config values that differ from system"
|
||||
echo >&2 " list - human-readable list of all spans"
|
||||
echo >&2 " dumpconfig - dump current state in /etc/dahdi/span-types.conf format"
|
||||
echo >&2 ""
|
||||
echo >&2 " options:"
|
||||
echo >&2 " -h|--help - Show this help"
|
||||
echo >&2 " -v|--verbose' - Show debugging messages (on stderr)"
|
||||
echo >&2 " -n|--dry-run' - During 'set', only show what would be done"
|
||||
echo >&2 " -k|--key <k> - Override prefered key during dumpconfig action"
|
||||
echo >&2 " --line-mode <m> - Set default line mode to <m> (E1/T1/J1)"
|
||||
exit 1
|
||||
}
|
||||
|
||||
# Parse command line options
|
||||
TEMP=`getopt -o hnvk: --long help,dry-run,verbose,key:,line-mode: -n "$0" -- "$@"`
|
||||
if [ $? != 0 ]; then
|
||||
echo >&2 "Bad options"
|
||||
usage
|
||||
fi
|
||||
|
||||
compare=false
|
||||
|
||||
# Note the quotes around `$TEMP': they are essential!
|
||||
eval set -- "$TEMP"
|
||||
|
||||
while true ; do
|
||||
case "$1" in
|
||||
-h|--help)
|
||||
usage
|
||||
;;
|
||||
-n|--dry-run)
|
||||
shift
|
||||
dry_run=true
|
||||
;;
|
||||
-v|--verbose)
|
||||
shift
|
||||
verbose=true
|
||||
;;
|
||||
-k|--key)
|
||||
SPAN_ASSIGNMENTS_KEY="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
--line-mode)
|
||||
DEFAULT_LINE_MODE="$2"
|
||||
shift
|
||||
shift
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
*)
|
||||
echo "Internal error!"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
echo >&2 "Missing action argument"
|
||||
usage
|
||||
fi
|
||||
action="$1"
|
||||
shift
|
||||
|
||||
# Validate SPAN_ASSIGNMENTS_KEY
|
||||
case "$SPAN_ASSIGNMENTS_KEY" in
|
||||
hwid|location|devpath)
|
||||
;;
|
||||
*)
|
||||
echo >&2 "Bad --key='$SPAN_ASSIGNMENTS_KEY' (should be: hwid|location|devpath)"
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
# Validate DEFAULT_LINE_MODE
|
||||
case "$DEFAULT_LINE_MODE" in
|
||||
E1|T1|J1|'')
|
||||
;;
|
||||
*)
|
||||
echo >&2 "Bad --line-mode='$DEFAULT_LINE_MODE' (should be: E1|T1|J1)"
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
if [ ! -d "$devbase" ]; then
|
||||
echo >&2 "$0: Missing '$devbase' (DAHDI driver unloaded?)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use given devices or otherwise, all existing devices
|
||||
if [ "$#" -gt 0 ]; then
|
||||
DEVICES="$@"
|
||||
else
|
||||
DEVICES=`ls -d $devbase/* 2>/dev/null`
|
||||
fi
|
||||
|
||||
# Beware of special characters in attributes
|
||||
attr_clean() {
|
||||
cat "$1" 2>/dev/null | tr -d '\n' | tr '!' '/' | tr -c 'a-zA-Z0-9/:.-' '_'
|
||||
}
|
||||
|
||||
show_spantypes() {
|
||||
echo "# PRI span types (E1/T1/J1)"
|
||||
for device in $DEVICES
|
||||
do
|
||||
devpath=`cd "$device" && pwd -P`
|
||||
location='@'`attr_clean "$device/location"`
|
||||
hardware_id=`attr_clean "$device/hardware_id"`
|
||||
cat "$device/spantype" | while read st; do
|
||||
case "$st" in
|
||||
*:[ETJ]1)
|
||||
printf "%-10s %-20s %-30s %s\n" \
|
||||
"$st" "[$hardware_id]" "$location" \
|
||||
"$devpath"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
list_pri_spantypes() {
|
||||
find $DEVICES -follow -maxdepth 1 -name spantype | \
|
||||
xargs cat | \
|
||||
sed -n '/:[ETJ]1$/s/^.*://p' | \
|
||||
sort -u | \
|
||||
tr '\n' ' ' | \
|
||||
sed -e 's/^ *//' -e 's/ *$//'
|
||||
}
|
||||
|
||||
dump_config() {
|
||||
pri_spantypes=`list_pri_spantypes`
|
||||
num_spantypes=`echo "$pri_spantypes" | wc -w`
|
||||
gen_default=''
|
||||
echo '#'
|
||||
echo "# Autogenerated by $0 on `date`"
|
||||
echo "# Map PRI DAHDI devices to span types for E1/T1/J1"
|
||||
echo "#"
|
||||
|
||||
echo "# Summary:"
|
||||
if [ "$DEFAULT_LINE_MODE" != '' ]; then
|
||||
gen_default="$DEFAULT_LINE_MODE"
|
||||
echo "# * Generating wildcard match of $gen_default."
|
||||
echo "# - Was run with '--line-mode=$DEFAULT_LINE_MODE'"
|
||||
elif [ "$num_spantypes" -eq 1 ]; then
|
||||
gen_default="$pri_spantypes"
|
||||
echo "# * Generating wildcard match of $gen_default."
|
||||
echo "# - Spans were $pri_spantypes"
|
||||
else
|
||||
echo "# * Not generating wildcard match."
|
||||
echo "# - Was run without '--line-mode' option and span were of mixed types [$pri_spantypes]"
|
||||
fi
|
||||
echo "#"
|
||||
if [ "$num_spantypes" -eq 1 ]; then
|
||||
echo "# * Generating a list of commented out configurations for spans."
|
||||
echo "# - Spans were $pri_spantypes"
|
||||
echo "# - Uncomment for specific overrides"
|
||||
else
|
||||
echo "# * Generating a list of specific span configurations."
|
||||
echo "# - Spans were of mixed types: $pri_spantypes"
|
||||
fi
|
||||
echo "#"
|
||||
echo ''
|
||||
|
||||
fmt="%-65s %s"
|
||||
printf "$fmt\n" '# @location/hardware_id' 'span_type'
|
||||
|
||||
if [ "$gen_default" != '' ]; then
|
||||
printf "$fmt\t\t# Wildcard line-mode" "*" "*:$gen_default"
|
||||
echo ""
|
||||
fi
|
||||
echo ""
|
||||
for device in $DEVICES
|
||||
do
|
||||
devpath=`cd "$device" && pwd -P`
|
||||
location=`attr_clean "$device/location"`
|
||||
hardware_id=`attr_clean "$device/hardware_id"`
|
||||
if [ "$SPAN_ASSIGNMENTS_KEY" = 'hwid' -a "$hardware_id" != '' ]; then
|
||||
id="$hardware_id"
|
||||
elif [ "$SPAN_ASSIGNMENTS_KEY" = 'location' -a "$location" != '' ]; then
|
||||
id="@$location"
|
||||
else
|
||||
id="$devpath"
|
||||
fi
|
||||
echo "# Device: [$hardware_id] @$location $devpath"
|
||||
cat "$device/spantype" | while read st; do
|
||||
case "$st" in
|
||||
*:[ETJ]1)
|
||||
if [ "$num_spantypes" -eq 1 ]; then
|
||||
printf "#$fmt\n" "$id" "$st"
|
||||
else
|
||||
printf "$fmt\n" "$id" "$st"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
#echo "# Skipped local span `echo $st | sed 's/:/ -- /'`"
|
||||
;;
|
||||
esac
|
||||
done | sort -n
|
||||
echo ''
|
||||
done
|
||||
}
|
||||
|
||||
# Allow comments and empty lines in config file
|
||||
filter_conf() {
|
||||
sed -e 's/#.*//' -e '/^[ \t]*$/d' "$DAHDISPANTYPESCONF"
|
||||
}
|
||||
|
||||
handle_span() {
|
||||
device="$1"
|
||||
spantype="$2"
|
||||
attr_file="$device/spantype"
|
||||
devpath=`cd "$device" && pwd -P`
|
||||
devname=`echo "$device" | sed "s,$devbase/,,"`
|
||||
location='@'`attr_clean "$device/location"`
|
||||
hardware_id=`attr_clean "$device/hardware_id"`
|
||||
spanno=`echo "$spantype" | cut -d: -f1`
|
||||
#echo >&2 "DEBUG: $device $spanno ($spantype)"
|
||||
filter_conf | while read id span_spec; do
|
||||
sn=`echo "$span_spec" | cut -d: -f1`
|
||||
val=`echo "$span_spec" | cut -d: -f2`
|
||||
case "$spanno" in
|
||||
$sn)
|
||||
;;
|
||||
*)
|
||||
#echo >&2 "no-match($device $spanno): $sn"
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
found=no
|
||||
# GLOBBING
|
||||
case "$location" in
|
||||
$id)
|
||||
#echo >&2 "match($id): $span_spec"
|
||||
found=yes
|
||||
;;
|
||||
esac
|
||||
case "$hardware_id" in
|
||||
$id)
|
||||
#echo >&2 "match([$id]): $span_spec"
|
||||
found=yes
|
||||
;;
|
||||
esac
|
||||
case "$devpath" in
|
||||
$id)
|
||||
#echo >&2 "match([$id]): $span_spec"
|
||||
found=yes
|
||||
;;
|
||||
esac
|
||||
if [ "$found" = 'yes' ]; then
|
||||
if [ "$dry_run" = 'true' -o "$verbose" = 'true' ]; then
|
||||
echo >&2 "Set $devname span $spanno = $val"
|
||||
fi
|
||||
if [ "$dry_run" != 'true' ]; then
|
||||
if [ "$compare" = 'true' ]; then
|
||||
config="$spanno:$val"
|
||||
system=`grep "$spanno:" "$attr_file"`
|
||||
if [ "$config" != "$system" ]; then
|
||||
|
||||
active_val=`echo $system | cut -d: -f2`
|
||||
echo "$devname $spanno $val $active_val" >>"$compare_results_file"
|
||||
fi
|
||||
else
|
||||
echo "$spanno:$val" > "$attr_file"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
set_all_devices() {
|
||||
span_differs='false'
|
||||
SPANS_DIFFER='false'
|
||||
|
||||
if [ ! -f "$DAHDISPANTYPESCONF" ]; then
|
||||
echo >&2 "$0: Missing configuration '$DAHDISPANTYPESCONF'"
|
||||
exit 1
|
||||
fi
|
||||
for device in $DEVICES
|
||||
do
|
||||
devname=`echo "$device" | sed "s,$devbase/,,"`
|
||||
cat "$device/spantype" | while read spantype; do
|
||||
case "$spantype" in
|
||||
*:[ETJ]1)
|
||||
handle_span "$device" "$spantype"
|
||||
;;
|
||||
*)
|
||||
if [ "$dry_run" = 'true' -o "$verbose" = 'true' ]; then
|
||||
echo >&2 "Skipping non-E1/T1/J1 span ($devname -- $spantype)"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
done
|
||||
done
|
||||
if [ "$compare" = 'true' ]; then
|
||||
if [ -s "$compare_results_file" ]; then
|
||||
echo "# Device Unit Config Active"
|
||||
cat "$compare_results_file"
|
||||
rm -f "$compare_results_file"
|
||||
exit 5
|
||||
fi
|
||||
rm -f "$compare_results_file"
|
||||
exit 0
|
||||
fi
|
||||
}
|
||||
|
||||
case "$action" in
|
||||
list)
|
||||
show_spantypes
|
||||
;;
|
||||
dumpconfig)
|
||||
dump_config
|
||||
;;
|
||||
set)
|
||||
set_all_devices
|
||||
;;
|
||||
compare)
|
||||
compare=true
|
||||
compare_results_file=`mktemp`
|
||||
set_all_devices
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
|
@ -64,7 +64,7 @@ void hup_handler(int sig)
|
|||
printf("\n--- Results after %d passes ---\n", pass);
|
||||
printf("Best: %.3f%% -- Worst: %.3f%% -- Average: %f%%\n",
|
||||
best, worst, pass ? total/pass : 100.00);
|
||||
printf("Cummulative Accuracy (not per pass): %0.3f\n",
|
||||
printf("Cumulative Accuracy (not per pass): %0.3f\n",
|
||||
pass ? accuracy : 0.0);
|
||||
exit(0);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
#! /bin/sh
|
||||
|
||||
usage() {
|
||||
echo >&2 "Usage: $0 {assigned|unassigned}"
|
||||
echo >&2 "# wait until all spans known are assigned/unassigned"
|
||||
exit 1
|
||||
}
|
||||
|
||||
TIMEOUT=5 # How much time to wait for spans
|
||||
|
||||
if [ "$#" -lt 1 ]; then
|
||||
usage
|
||||
fi
|
||||
wanted_event="$1"
|
||||
shift
|
||||
|
||||
case "$wanted_event" in
|
||||
assigned)
|
||||
;;
|
||||
unassigned)
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
||||
|
||||
devbase='/sys/bus/dahdi_devices/devices'
|
||||
|
||||
spans_of() {
|
||||
dev="$1"
|
||||
wc -l < "$dev/spantype"
|
||||
}
|
||||
|
||||
assigned_spans_of() {
|
||||
dev="$1"
|
||||
ls -d "$dev/span-"* 2>/dev/null | wc -l
|
||||
}
|
||||
|
||||
|
||||
waitfor_span_assignments() {
|
||||
wanted_state="$1"
|
||||
device_list=`ls -d "$devbase/"* 2> /dev/null`
|
||||
finished=''
|
||||
count="$TIMEOUT"
|
||||
echo -n "Waiting for spans to become $wanted_state: "
|
||||
while [ "$count" -gt 0 ]; do
|
||||
finished='yes'
|
||||
for dev in $device_list
|
||||
do
|
||||
spans=`spans_of "$dev"`
|
||||
assigned_spans=`assigned_spans_of "$dev"`
|
||||
if [ "$wanted_state" = 'assigned' -a "$assigned_spans" -ne "$spans" ]; then
|
||||
finished='no'
|
||||
elif [ "$wanted_state" = 'unassigned' -a "$assigned_spans" -ne 0 ]; then
|
||||
finished='no'
|
||||
fi
|
||||
done
|
||||
if [ "$finished" = 'yes' ]; then
|
||||
break
|
||||
else
|
||||
sleep 1
|
||||
echo -n "."
|
||||
fi
|
||||
count=`expr "$count" - 1`
|
||||
done
|
||||
if [ "$finished" = 'yes' ]; then
|
||||
echo "done"
|
||||
else
|
||||
echo "timeout"
|
||||
fi
|
||||
}
|
||||
|
||||
waitfor_span_assignments "$wanted_event"
|
|
@ -0,0 +1,12 @@
|
|||
*debhelper*
|
||||
*.substvars
|
||||
.debhelper/
|
||||
autoreconf.after
|
||||
autoreconf.before
|
||||
dahdi.udev
|
||||
dahdi/
|
||||
files
|
||||
libtonezone-dev/
|
||||
libtonezone2.0/
|
||||
savedfiles.cpio
|
||||
tmp/
|
|
@ -0,0 +1,89 @@
|
|||
Echo Canceller
|
||||
--------------
|
||||
In DAHDI (software) echo cancellers are separate modules, that are
|
||||
automatically loaded if their name is used in /etc/dahdi/system.conf .
|
||||
dahdi_genconf, the configuration generator, thus defaults to creating a
|
||||
system.conf with an echocanceller line for each channel. By default it is
|
||||
'mg2' (the MG2 echo canceller) but this can be changed by setting
|
||||
'echocanceller' (see the sample genconf_parameters file).
|
||||
|
||||
The Debian package of dahdi-linux is patched to include support of the
|
||||
echo canceller OSLEC. Thus dahdi-tools has been patched accordingly to
|
||||
make it the default echo canceller, and to remove 'echo' as well when
|
||||
unloading modules.
|
||||
|
||||
However if you, for any strange reason, use a version of the DAHDI
|
||||
kernel modules that does not include a working dahdi_echocan_oslec.ko,
|
||||
just set in /etc/dahdi/genconf_parameters:
|
||||
|
||||
echo_can mg2
|
||||
|
||||
|
||||
FXOTune
|
||||
-------
|
||||
FXOTune is a utility provided by Digium for fine-tuning parameters of the
|
||||
FXO modules of their TDM cards and compatibles, as well as of those of the
|
||||
Xorcom Astribank.
|
||||
|
||||
This package includes the fxotune utility. It will also load configuration
|
||||
from /etc/fxotune.conf if fxotune was used to tune the FXO modules. Note
|
||||
that fxotune will not work with X100P and similar cards.
|
||||
|
||||
|
||||
Supported tone-zones
|
||||
--------------------
|
||||
DAHDI is capable of playing ring tone, buy tone etc. for a large variety of
|
||||
countries. This is done using the loadzone and defaultzone settings in
|
||||
system.conf. A list of tone-zones supported by DAHDI and libtonezone is
|
||||
included in the file tonezones.txt in the documentation directory.
|
||||
|
||||
Example section of system.conf:
|
||||
loadzone=us,uk,de
|
||||
defaultzone=us
|
||||
|
||||
|
||||
dahdi vs. dahdi-linux
|
||||
---------------------
|
||||
Upstream DAHDI is split to two parts: dahdi-linux are parts that are
|
||||
supposed to be linux-specific, whereas dahdi-tools are supposed to be
|
||||
generic utilities to use the DAHDI interface.
|
||||
|
||||
DAHDI-linux includes mostly kernel modules, but also udev rules, xpp
|
||||
initialization scripts and firmwares (latter are stripped from the
|
||||
Debian package). Those are included in the package dahdi-linux.
|
||||
|
||||
Most of the dahdi utilities, e.g. dahdi_cfg, dahdi_test, dahdi_monitor
|
||||
and the dahdi-perl utilities are included in the package 'dahdi' that is
|
||||
built from the source package dahdi-tools.
|
||||
|
||||
|
||||
Automatic startup
|
||||
-----------------
|
||||
There is work in progress to start DAHDI devices automatically.
|
||||
See also http://docs.tzafrir.org.il/dahdi-tools/#_initialization and for
|
||||
the low-level description:
|
||||
http://docs.tzafrir.org.il/dahdi-linux/#_span_assignments
|
||||
|
||||
The dahdi-linux package sets dahdi.auto_assigned_spans to 0 by default,
|
||||
but the dahdi-tools should have the required scriptary in place to make
|
||||
sure an upgrade will not break an existing system. That said, if your
|
||||
system has more than one DAHDI device, you should create a
|
||||
/etc/dahdi/assigned-spans.conf using 'dahdi_genconf assignedspan' (or
|
||||
manually) rather than relying on any other ordering mechanism.
|
||||
|
||||
Much work has been put in place to make sure configurations
|
||||
work as before if there are no changes. It is still recommended to create
|
||||
a span-assignments file for your setup if you have more than one device:
|
||||
|
||||
dahdi_genconf assigedspans
|
||||
|
||||
The udev hook scripts run two main hooks:
|
||||
* /usr/share/dahdi/dahdi_handle_device:
|
||||
Run when a new DAHDI device is added or removed. Mainly to assign
|
||||
spans.
|
||||
* /usr/share/dahdi/dahdi_config_span:
|
||||
Run when a new DAHDI span is added or removed. Mainly to configure
|
||||
the new spans.
|
||||
|
||||
As you would expect, there are .d directories for the scripts and those
|
||||
are places for your hooks, if needed.
|
|
@ -0,0 +1,9 @@
|
|||
The packaging is based on the upstream git repository. However, the
|
||||
upstream release tarballs are different.
|
||||
|
||||
* We use pristine-tar.
|
||||
* We manually clean some generated files at build time (we re-create
|
||||
them anyway).
|
||||
|
||||
Before building a new release, be sure to download the tarball and
|
||||
commit it with pristine-tar.
|
|
@ -0,0 +1,3 @@
|
|||
* Transition from zaptel?
|
||||
* Fix copyright
|
||||
* xpp/README.Astribank.html
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,28 @@
|
|||
dahdi_tool
|
||||
autoconfig.h
|
||||
genconf_parameters.sample
|
||||
version.c
|
||||
debian/dahdi.udev
|
||||
xpp/dahdi_genconf.8.html
|
||||
xpp/dahdi_hardware.8.html
|
||||
xpp/dahdi_registration.8.html
|
||||
xpp/lsdahdi.8.html
|
||||
xpp/twinstar.8.html
|
||||
xpp/xpp_blink.8.html
|
||||
xpp/xpp_sync.8.html
|
||||
|
||||
# Autotools files:
|
||||
Makefile
|
||||
config.log
|
||||
config.status
|
||||
doc/Makefile
|
||||
hotplug/Makefile
|
||||
libtool
|
||||
makeopts
|
||||
ppp/Makefile
|
||||
stamp-h1
|
||||
xpp/Makefile
|
||||
xpp/oct612x/Makefile
|
||||
xpp/perl_modules/Makefile
|
||||
xpp/xtalk/Makefile
|
||||
|
|
@ -0,0 +1 @@
|
|||
10
|
|
@ -0,0 +1,57 @@
|
|||
Source: dahdi-tools
|
||||
Section: comm
|
||||
Priority: optional
|
||||
Maintainer: Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>
|
||||
Uploaders: Tzafrir Cohen <tzafrir@debian.org>, Mark Purcell <msp@debian.org>
|
||||
# groff, man-db and asciidoc are required for generating documentation
|
||||
Build-Depends: debhelper (>= 10),
|
||||
autoconf,
|
||||
automake,
|
||||
cpio,
|
||||
pkg-config,
|
||||
linux-libc-dev,
|
||||
libnewt-dev,
|
||||
bzip2,
|
||||
libusb-1.0-0-dev,
|
||||
asciidoc-base | asciidoc,
|
||||
groff,
|
||||
man-db,
|
||||
Standards-Version: 4.3.0
|
||||
Homepage: http://www.asterisk.org/
|
||||
Vcs-Git: https://salsa.debian.org/pkg-voip-team/dahdi-tools.git
|
||||
Vcs-Browser: https://salsa.debian.org/pkg-voip-team/dahdi-tools
|
||||
Rules-Requires-Root: no
|
||||
|
||||
Package: dahdi
|
||||
Architecture: linux-any
|
||||
Multi-Arch: foreign
|
||||
Depends: ${shlibs:Depends}, ${perl:Depends}, ${misc:Depends}, procps, fxload, usbutils
|
||||
Description: utilities for using the DAHDI kernel modules
|
||||
DAHDI (formly Zaptel) is an interface for telephony devices used by e.g.
|
||||
the Asterisk PBX software. The dahdi-* packages provide the kernel
|
||||
DAHDI kernel modules and their required setup environment.
|
||||
.
|
||||
This package includes userspace utilities required to configure DAHDI
|
||||
modules.
|
||||
|
||||
Package: libtonezone2.0
|
||||
Section: libs
|
||||
Architecture: linux-any
|
||||
Multi-Arch: same
|
||||
Depends: ${shlibs:Depends}, ${misc:Depends}
|
||||
Description: tonezone library (runtime)
|
||||
A library for generating tones to be sent through the DAHDI telephony
|
||||
interface.
|
||||
.
|
||||
This package contains the runtime library files.
|
||||
|
||||
Package: libtonezone-dev
|
||||
Section: libdevel
|
||||
Architecture: linux-any
|
||||
Multi-Arch: same
|
||||
Depends: libtonezone2.0 (= ${binary:Version}), ${misc:Depends}
|
||||
Description: tonezone library (development)
|
||||
A library for generating tones to be sent through the DAHDI telephony
|
||||
interface.
|
||||
.
|
||||
This package contains the development files.
|
|
@ -0,0 +1,17 @@
|
|||
Source: zaptel
|
||||
Section: comm
|
||||
Priority: extra
|
||||
Maintainer: Debian VoIP Team <pkg-voip-maintainers@lists.alioth.debian.org>
|
||||
Uploaders: Kilian Krause <kk@verfaction.de>, Jose Carlos Garcia Sogo <jsogo@debian.org>, Mark Purcell <msp@debian.org>, Santiago Garcia Mantinan <manty@debian.org>, Santiago Ruano Rincon <santiago@unicauca.edu.co>
|
||||
Build-Depends: debhelper (>> 3.0.0), bzip2
|
||||
Standards-Version: 3.6.1.1
|
||||
|
||||
Package: zaptel-modules-_KVERS_
|
||||
Architecture: any
|
||||
Provides: zaptel-modules
|
||||
Description: zaptel modules for Linux (kernel _KVERS_).
|
||||
This package contains the set of loadable kernel modules for the
|
||||
zapata telephony API.
|
||||
This package contains the compiled kernel modules for _KVERS_
|
||||
.
|
||||
In order to compile these modules use the module-assistant utility.
|
|
@ -0,0 +1,114 @@
|
|||
This package was debianized by Tzafrir Cohen <tzafrir.cohen@xorcom.com> on
|
||||
Tue, 26 Aug 2008 10:06:40 +0300
|
||||
|
||||
It was downloaded from
|
||||
http://downloads.asterisk.org/pub/telephony/dahdi-tools/
|
||||
|
||||
Copyright: (from dahdi_cfg.c)
|
||||
|
||||
* Written by Mark Spencer <markster@digium.com>
|
||||
* Based on previous works, designs, and architectures conceived and
|
||||
* written by Jim Dixon <jim@lambdatel.com>.
|
||||
*
|
||||
* Copyright (C) 2001 Jim Dixon / Zapata Telephony.
|
||||
* Copyright (C) 2001-2008 Digium, Inc.
|
||||
*
|
||||
* All rights reserved.
|
||||
*
|
||||
* Primary Author: Mark Spencer <markster@digium.com>
|
||||
* Radio Support by Jim Dixon <jim@lambdatel.com>
|
||||
*
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2 as published by the
|
||||
* Free Software Foundation. See the LICENSE file included with
|
||||
* this program for more details.
|
||||
|
||||
On Debian systems, a copy of the GNU General Public License Version 2
|
||||
may be found in /usr/share/common-licenses/GPL-2 .
|
||||
|
||||
Other Portions:
|
||||
dahdi_monitor.c: * Copyright (C) 2001 Jim Dixon / Zapata Telephony.
|
||||
dahdi_monitor.c: * Copyright (C) 2001-2008 Digium, Inc.
|
||||
dahdi_scan.c: * Copyright (C) 2007 Digium, Inc.
|
||||
dahdi_tool.c: * Copyright (C) 2001 Jim Dixon / Zapata Telephony.
|
||||
dahdi_tool.c: * Copyright (C) 2001-2008 Digium, Inc.
|
||||
sethdlc.c: * Copyright (C) 1999 - 2002 Krzysztof Halasa <khc@pm.waw.pl>
|
||||
sethdlc.c: "Copyright (C) 2000 - 2003 Krzysztof Halasa <khc@pm.waw.pl>\n"
|
||||
|
||||
Files in the xpp/ subdirectory:
|
||||
|
||||
* Written by Oron Peled <oron@actcom.co.il>
|
||||
* Copyright (C) 2004-2010, Xorcom
|
||||
|
||||
Perl programs and modules in the xpp/ directory:
|
||||
# This program is free software; you can redistribute and/or
|
||||
# modify it under the same terms as Perl itself.
|
||||
|
||||
Other scripts in the xpp directory:
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
|
||||
|
||||
|
||||
Files in menuselect/:
|
||||
|
||||
menuselect is a GPLed program used in the build process of Asterisk and
|
||||
other Digium programs. Thus expect to find the same on those packages,
|
||||
and also not to find it in any binary package.
|
||||
|
||||
menuselect/Makefile:# Copyright (C) 2005-2008, Digium, Inc.
|
||||
menuselect/menuselect.c: * Copyright (C) 2005 - 2006, Russell Bryant
|
||||
menuselect/menuselect_curses.c: * Copyright (C) 2005 - 2006, Russell Bryant
|
||||
menuselect/menuselect.h: * Copyright (C) 2005-2006, Russell Bryant
|
||||
menuselect/menuselect_newt.c: * Copyright (C) 2008 Sean Bright
|
||||
menuselect/menuselect_stub.c: * Copyright (C) 2005 - 2006, Russell Bryant
|
||||
menuselect/missing:# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005
|
||||
menuselect/README:Copyright (C) 2005-2006, Digium, Inc.
|
||||
menuselect/strcompat.c: * Copyright (C) 1999 - 2006, Digium, Inc.
|
||||
|
||||
* This program is free software, distributed under the terms of
|
||||
* the GNU General Public License Version 2. See the LICENSE file
|
||||
* at the top of the source tree.
|
||||
|
||||
Portions of menuselect/strcompat.c:
|
||||
* Based on Code from bsd-asprintf from OpenSSH
|
||||
* Copyright (c) 2004 Darren Tucker.
|
||||
*
|
||||
* Based originally on asprintf.c from OpenBSD:
|
||||
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
*
|
||||
* Permission to use, copy, modify, and distribute this software for any
|
||||
* purpose with or without fee is hereby granted, provided that the above
|
||||
* copyright notice and this permission notice appear in all copies.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
|
||||
|
||||
Files under menuselect/mxml/:
|
||||
|
||||
mxml is a minimal XML parsing library used by Asterisk and co. Likewise
|
||||
used at build time for building menuselect above.
|
||||
|
||||
* Copyright 2003-2005 by Michael Sweet.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Library General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
|
||||
|
||||
On Debian systems, a copy of the GNU General Public License may be found in
|
||||
/usr/share/common-licenses/GPL-2.
|
|
@ -0,0 +1 @@
|
|||
etc/init.d
|
|
@ -0,0 +1,13 @@
|
|||
Document: dahdi.astribank
|
||||
Title: Xorcom Astribank Documentation
|
||||
Author: Tzafrir Cohen
|
||||
Abstract: Technical Documentation of the Xorcom Astribank
|
||||
Section: Network/Communication
|
||||
|
||||
Format: HTML
|
||||
Index: /usr/share/doc/dahdi/README.Astribank.html
|
||||
Files: /usr/share/doc/dahdi/README.Astribank.html
|
||||
|
||||
Format: text
|
||||
Files: /usr/share/doc/dahdi/README.Astribank.gz
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
Document: dahdi
|
||||
Title: DAHDI Telephony Interface Driver
|
||||
Author: Tzafrir Cohen
|
||||
Abstract: Basic documentation of the DAHDI telephony interface
|
||||
Section: Network/Communication
|
||||
|
||||
Format: HTML
|
||||
Index: /usr/share/doc/dahdi/README.html
|
||||
Files: /usr/share/doc/dahdi/README.html
|
||||
|
||||
Format: text
|
||||
Files: /usr/share/doc/dahdi/README.gz
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
hotplug/span_config.d/50-asterisk
|
||||
xpp/genconf_parameters
|
||||
*.conf.sample
|
|
@ -0,0 +1,6 @@
|
|||
usr/sbin/*
|
||||
usr/share/perl5/Dahdi*
|
||||
usr/share/dahdi/*
|
||||
usr/share/man/man8/*
|
||||
usr/lib/dracut/dracut.conf.d/50-dahdi.conf
|
||||
usr/share/bash-completion/completions/dahdi
|
|
@ -0,0 +1 @@
|
|||
dahdi: mknod-in-maintainer-script postinst:16
|
|
@ -0,0 +1,5 @@
|
|||
README
|
||||
README.html
|
||||
tonezones.txt
|
||||
xpp/README.Astribank
|
||||
README.Astribank.html
|
|
@ -0,0 +1,3 @@
|
|||
usr/include/dahdi/tonezone.h
|
||||
usr/lib/*/lib*.a
|
||||
usr/lib/*/lib*.so
|
|
@ -0,0 +1 @@
|
|||
tonezones.txt
|
|
@ -0,0 +1 @@
|
|||
usr/lib/*/lib*.so.2*
|
|
@ -0,0 +1,12 @@
|
|||
libtonezone.so.2.0 libtonezone2.0 #MINVER#
|
||||
* Build-Depends-Package: libtonezone-dev
|
||||
builtin_zones@Base 1:2.2.1.1
|
||||
dahdi_tools_version@Base 1:2.2.1.1
|
||||
tone_zone_find@Base 1:2.2.1.1
|
||||
tone_zone_find_by_num@Base 1:2.2.1.1
|
||||
tone_zone_get_zone@Base 1:2.2.1.1
|
||||
tone_zone_play_tone@Base 1:2.2.1.1
|
||||
tone_zone_register@Base 1:2.2.1.1
|
||||
tone_zone_register_zone@Base 1:2.2.1.1
|
||||
tone_zone_set_zone@Base 1:2.2.1.1
|
||||
tone_zone_tone_name@Base 1:2.2.1.1
|
|
@ -0,0 +1,71 @@
|
|||
#!/bin/sh
|
||||
|
||||
# debian/modulestest: a postbuild script to build zaptel modules
|
||||
# example usage:
|
||||
#
|
||||
# svn-buildpackage --svn-postbuild='debian/modulestest -r' --svn-ignore-new
|
||||
|
||||
# At least one of the following two must be set to a sensible value:
|
||||
# If both are empty, the script does nothing useful)
|
||||
#
|
||||
# kernel versions: Comma-separated. Use those if you have their
|
||||
# kernel-headers/linux-headers packages installed
|
||||
#
|
||||
|
||||
# Full pathes to trees:
|
||||
# Use this to provide a full path to a custom kernel tree:
|
||||
#KERNEL_SOURCES=$HOME/Proj/Debs/Kernel/SwSusp/linux-2.6.15-rc5
|
||||
KERNEL_HEADERS=
|
||||
KERNEL_SOURCES=
|
||||
# run module-asustant with environment params that will generate
|
||||
# .changes files even without signing
|
||||
MODASS="env SIGNCHANGES=1 DEBSIGNCOMMAND=not_an_executable m-a"
|
||||
me=`basename $0`
|
||||
|
||||
# workaround for silly bash parsing issue in our build scripts:
|
||||
if [ "$#" -lt 1 ]; then
|
||||
set -- $MODULESTEST_ARGS
|
||||
fi
|
||||
|
||||
while getopts ah:rs:t arg
|
||||
do
|
||||
case "$arg" in
|
||||
a) # All of the kernel-headers packages installed:
|
||||
KERNEL_HEADERS=`COLUMNS=160 dpkg -l 'kernel-headers-2.[46].*-*-*' | awk '/^.i/{print $2}' | sed -e 's/^kernel-headers-//'| xargs| tr ' ' ,`
|
||||
;;
|
||||
h) KERNEL_HEADERS=$OPTARG;;
|
||||
s) KERNEL_SOURCES=$OPTARG;;
|
||||
r) KERNEL_HEADERS=`uname -r`;;
|
||||
t) # TODO: make this test per-distro or something
|
||||
KERNEL_HEADERS=2.4.27-2-386,2.6.8-2-686-smp
|
||||
;;
|
||||
esac
|
||||
done
|
||||
shift $(( $OPTIND-1 ))
|
||||
|
||||
echo "Building for: Headers: $KERNEL_HEADERS, Sources: $KERNEL_SOURCES"
|
||||
|
||||
if [ "$KERNEL_HEADERS" != '' ]; then hdrs_sw="-l $KERNEL_HEADERS"; fi
|
||||
if [ "$KERNEL_SOURCES" != '' ]; then srcs_sw="-k $KERNEL_SOURCES"; fi
|
||||
|
||||
# must be absolute for m-a ta accept TARBALL:
|
||||
# Also note that $PWD is ugly and is about to be deleted. We need
|
||||
# $PWD/..
|
||||
TOP_DIR=`dirname $PWD`
|
||||
MODS_DIR=$TOP_DIR/modules
|
||||
TAR_BALL=$MODS_DIR/usr/src/zaptel.tar.bz2
|
||||
DEB=$TOP_DIR/$PACKAGE-source_${TAG_VERSION}_all.deb
|
||||
LOG_FILE=$TOP_DIR/$PACKAGE-modules-build-$TAG_VERSION.log
|
||||
|
||||
rm -f $LOG_FILE
|
||||
dpkg -x $DEB $MODS_DIR
|
||||
|
||||
if [ "$hdrs_sw" != '' ]; then
|
||||
TARBALL=$TAR_BALL $MODASS -u $TOP_DIR -t -i -f $hdrs_sw build $PACKAGE >>$LOG_FILE
|
||||
fi
|
||||
if [ "$srcs_sw" != '' ]; then
|
||||
TARBALL=$TAR_BALL $MODASS -u $TOP_DIR -t -i -f $srcs_sw build $PACKAGE >>$LOG_FILE
|
||||
fi
|
||||
|
||||
ls -l $TOP_DIR/$PACKAGE-modules-*_$TAG_VERSION+*.deb
|
||||
echo "$me: Log file: $LOG_FILE"
|
|
@ -0,0 +1,43 @@
|
|||
From: Jaco Kroon <jaco@uls.co.za>
|
||||
Subject: Remove unused union names that break build
|
||||
Bug: https://issues.asterisk.org/jira/browse/DAHTOOL-85
|
||||
|
||||
diff --git a/xpp/mpptalk.c b/xpp/mpptalk.c
|
||||
index fdb34f1..8fb3687 100644
|
||||
--- a/xpp/mpptalk.c
|
||||
+++ b/xpp/mpptalk.c
|
||||
@@ -237,7 +237,7 @@ union XTALK_PDATA(MPP) {
|
||||
MEMBER(MPP, TWS_PORT_GET_REPLY);
|
||||
MEMBER(MPP, TWS_PWR_GET);
|
||||
MEMBER(MPP, TWS_PWR_GET_REPLY);
|
||||
-} PACKED members;
|
||||
+} PACKED;
|
||||
|
||||
/*
|
||||
* Statuses
|
||||
diff --git a/xpp/xtalk/xtalk_raw.c b/xpp/xtalk/xtalk_raw.c
|
||||
index 49e47d5..251a502 100644
|
||||
--- a/xpp/xtalk/xtalk_raw.c
|
||||
+++ b/xpp/xtalk/xtalk_raw.c
|
||||
@@ -48,7 +48,7 @@ CMD_DEF(XTALK, ACK,
|
||||
|
||||
union XTALK_PDATA(XTALK) {
|
||||
MEMBER(XTALK, ACK);
|
||||
-} PACKED members;
|
||||
+} PACKED;
|
||||
|
||||
const struct xtalk_protocol xtalk_raw_proto = {
|
||||
.name = "XTALK-RAW",
|
||||
diff --git a/xpp/xtalk/xtalk_sync.c b/xpp/xtalk/xtalk_sync.c
|
||||
index 18a5cad..ffa79d2 100644
|
||||
--- a/xpp/xtalk/xtalk_sync.c
|
||||
+++ b/xpp/xtalk/xtalk_sync.c
|
||||
@@ -60,7 +60,7 @@ union XTALK_PDATA(XTALK) {
|
||||
MEMBER(XTALK, ACK);
|
||||
MEMBER(XTALK, PROTO_GET);
|
||||
MEMBER(XTALK, PROTO_GET_REPLY);
|
||||
-} PACKED members;
|
||||
+} PACKED;
|
||||
|
||||
const struct xtalk_protocol xtalk_sync_proto = {
|
||||
.name = "XTALK-SYNC",
|
|
@ -0,0 +1,134 @@
|
|||
From: Tzafrir Cohen <tzafrir@debian.org>
|
||||
Date: Sat, 2 Mar 2019 01:37:51 +0200
|
||||
Bug: https://issues.asterisk.org/jira/browse/DAHTOOL-82
|
||||
Subject: [PATCH] handle both spantypes and dahdi_spantypes in sysfs
|
||||
|
||||
dahdi_span_types and dahdi_span_assignments use information from sysfs.
|
||||
As of kernel 4.13, the name of the attribute chnaged. Handle both old
|
||||
and new name.
|
||||
|
||||
Signed-off-by: Tzafrir Cohen <tzafrir@debian.org>
|
||||
---
|
||||
dahdi_span_assignments | 15 ++++++++++++---
|
||||
dahdi_span_types | 23 ++++++++++++++++++-----
|
||||
2 files changed, 30 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/dahdi_span_assignments b/dahdi_span_assignments
|
||||
index 9b4f305..235d61e 100755
|
||||
--- a/dahdi_span_assignments
|
||||
+++ b/dahdi_span_assignments
|
||||
@@ -151,6 +151,15 @@ attr_clean() {
|
||||
cat "$1" 2>/dev/null | tr -d '\n' | tr '!' '/' | tr -c 'a-zA-Z0-9/:.-' '_'
|
||||
}
|
||||
|
||||
+get_device_spannos() {
|
||||
+ device=$1
|
||||
+ sp_file="dahdi_spantype"
|
||||
+ if [ ! -f "$device/$sp_file" ]; then
|
||||
+ sp_file="spantype"
|
||||
+ fi
|
||||
+ cut -d: -f1 "$device/$sp_file"
|
||||
+}
|
||||
+
|
||||
show_devices() {
|
||||
|
||||
for device in $DEVICES
|
||||
@@ -158,7 +167,7 @@ show_devices() {
|
||||
devpath=`cd "$device" && pwd -P`
|
||||
location='@'`attr_clean "$device/location"`
|
||||
hardware_id=`attr_clean "$device/hardware_id"`
|
||||
- for local_spanno in `cut -d: -f1 "$device/spantype"`
|
||||
+ for local_spanno in `get_device_spannos "$device"`
|
||||
do
|
||||
span=`grep 2>/dev/null -Hw "$local_spanno" "$device/span-"*"/local_spanno" | \
|
||||
sed -e 's,/local_spanno:.*,,' -e 's,.*/,,'`
|
||||
@@ -193,7 +202,7 @@ dump_config() {
|
||||
id="$devpath"
|
||||
fi
|
||||
echo "# Device: [$hardware_id] @$location $devpath"
|
||||
- for local_spanno in `cut -d: -f1 "$device/spantype"`
|
||||
+ for local_spanno in `get_device_spannos "$device"`
|
||||
do
|
||||
span=`grep 2>/dev/null -Hw "$local_spanno" "$device/span-"*"/local_spanno" | \
|
||||
sed -e 's,/local_spanno:.*,,' -e 's,.*/,,'`
|
||||
@@ -358,7 +367,7 @@ list_devices() {
|
||||
devpath=`cd "$device" && pwd -P`
|
||||
location='@'`attr_clean "$device/location"`
|
||||
hardware_id=`attr_clean "$device/hardware_id"`
|
||||
- for local_spanno in `cut -d: -f1 "$device/spantype"`
|
||||
+ for local_spanno in `get_device_spannos "$device"`
|
||||
do
|
||||
found=`dev_match_conf "$devpath" "$location" "$hardware_id" "$local_spanno"`
|
||||
if [ "$wanted" = "unmatched" ]; then
|
||||
diff --git a/dahdi_span_types b/dahdi_span_types
|
||||
index 5fce110..f44b494 100755
|
||||
--- a/dahdi_span_types
|
||||
+++ b/dahdi_span_types
|
||||
@@ -172,6 +172,15 @@ attr_clean() {
|
||||
cat "$1" 2>/dev/null | tr -d '\n' | tr '!' '/' | tr -c 'a-zA-Z0-9/:.-' '_'
|
||||
}
|
||||
|
||||
+get_device_spantype_file() {
|
||||
+ device=$1
|
||||
+ sp_file="dahdi_spantype"
|
||||
+ if [ ! -f "$device/$sp_file" ]; then
|
||||
+ sp_file="spantype"
|
||||
+ fi
|
||||
+ echo "$device/$sp_file"
|
||||
+}
|
||||
+
|
||||
show_spantypes() {
|
||||
echo "# PRI span types (E1/T1/J1)"
|
||||
for device in $DEVICES
|
||||
@@ -179,7 +188,8 @@ show_spantypes() {
|
||||
devpath=`cd "$device" && pwd -P`
|
||||
location='@'`attr_clean "$device/location"`
|
||||
hardware_id=`attr_clean "$device/hardware_id"`
|
||||
- cat "$device/spantype" | while read st; do
|
||||
+ sp_file=`get_device_spantype_file "$device"`
|
||||
+ cat "$sp_file" | while read st; do
|
||||
case "$st" in
|
||||
*:[ETJ]1)
|
||||
printf "%-10s %-20s %-30s %s\n" \
|
||||
@@ -192,7 +202,7 @@ show_spantypes() {
|
||||
}
|
||||
|
||||
list_pri_spantypes() {
|
||||
- find $DEVICES -follow -maxdepth 1 -name spantype | \
|
||||
+ find $DEVICES -follow -maxdepth 1 -name spantype -or -name dahdi_spantype | \
|
||||
xargs cat | \
|
||||
sed -n '/:[ETJ]1$/s/^.*://p' | \
|
||||
sort -u | \
|
||||
@@ -255,7 +265,8 @@ dump_config() {
|
||||
id="$devpath"
|
||||
fi
|
||||
echo "# Device: [$hardware_id] @$location $devpath"
|
||||
- cat "$device/spantype" | while read st; do
|
||||
+ sp_file=`get_device_spantype_file "$device"`
|
||||
+ cat "$sp_file" | while read st; do
|
||||
case "$st" in
|
||||
*:[ETJ]1)
|
||||
if [ "$num_spantypes" -eq 1 ]; then
|
||||
@@ -281,7 +292,8 @@ filter_conf() {
|
||||
handle_span() {
|
||||
device="$1"
|
||||
spantype="$2"
|
||||
- attr_file="$device/spantype"
|
||||
+ sp_file=`get_device_spantype_file "$device"`
|
||||
+ attr_file="$sp_file"
|
||||
devpath=`cd "$device" && pwd -P`
|
||||
devname=`echo "$device" | sed "s,$devbase/,,"`
|
||||
location='@'`attr_clean "$device/location"`
|
||||
@@ -351,7 +363,8 @@ set_all_devices() {
|
||||
for device in $DEVICES
|
||||
do
|
||||
devname=`echo "$device" | sed "s,$devbase/,,"`
|
||||
- cat "$device/spantype" | while read spantype; do
|
||||
+ sp_file=`get_device_spantype_file "$device"`
|
||||
+ cat "$sp_file" | while read spantype; do
|
||||
case "$spantype" in
|
||||
*:[ETJ]1)
|
||||
handle_span "$device" "$spantype"
|
||||
--
|
||||
2.20.1
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
Subject: Make OSLEC the default DAHDI echo canceller
|
||||
Author: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
|
||||
Forwarded: no
|
||||
|
||||
Our dahdi-linux packages provide OSLEC, which is generally a better echo
|
||||
canceller than those included with DAHDI. Thus we should make it the
|
||||
default echo canceller in generated configurations.
|
||||
|
||||
Debian-specific configuration tweak.
|
||||
|
||||
--- a/xpp/perl_modules/Dahdi/Config/Params.pm
|
||||
+++ b/xpp/perl_modules/Dahdi/Config/Params.pm
|
||||
@@ -111,7 +111,7 @@ sub item($$@) {
|
||||
group_lines => '0',
|
||||
brint_overlap => 'no',
|
||||
bri_sig_style => 'bri_ptmp',
|
||||
- echo_can => 'mg2',
|
||||
+ echo_can => 'oslec',
|
||||
bri_hardhdlc => 'auto',
|
||||
pri_connection_type => 'PRI',
|
||||
r2_idle_bits => '1101',
|
|
@ -0,0 +1,16 @@
|
|||
From: Tzafrir Cohen <tzafrir@debian.org>
|
||||
Subject: Change defaults for some install paths
|
||||
|
||||
Index: dahdi-tools/Makefile.am
|
||||
===================================================================
|
||||
--- dahdi-tools.orig/Makefile.am 2020-08-19 23:41:45.003051626 +0300
|
||||
+++ dahdi-tools/Makefile.am 2020-08-19 23:41:44.999051671 +0300
|
||||
@@ -111,7 +111,7 @@
|
||||
@echo "Compatibility symlinks (should be removed in the future)"
|
||||
ln -sf libtonezone.so.2.0.0 $(DESTDIR)$(libdir)/libtonezone.so.2.0
|
||||
|
||||
-bashcompdir = $(sysconfdir)/bash_completion.d
|
||||
+bashcompdir = $(datadir)/bash-completion/completions
|
||||
|
||||
install-data-hook:
|
||||
mkdir -p $(DESTDIR)$(bashcompdir)
|
|
@ -0,0 +1,22 @@
|
|||
Author: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
|
||||
Description: Remove the useless utility dahdi_speed
|
||||
|
||||
It was useful long ago, but pointless now.
|
||||
|
||||
diff --git a/Makefile.am b/Makefile.am
|
||||
index d43ce91..09e4f12 100644
|
||||
--- a/Makefile.am
|
||||
+++ b/Makefile.am
|
||||
@@ -35,11 +35,11 @@ sbin_PROGRAMS = \
|
||||
dahdi_maint \
|
||||
dahdi_monitor \
|
||||
dahdi_cfg \
|
||||
- dahdi_speed \
|
||||
dahdi_scan \
|
||||
fxotune
|
||||
|
||||
noinst_PROGRAMS = \
|
||||
+ dahdi_speed \
|
||||
fxstest \
|
||||
patgen \
|
||||
pattest \
|
|
@ -0,0 +1,8 @@
|
|||
zaptel_perl
|
||||
echocan_oslec
|
||||
remove_dahdi_speed
|
||||
soname.patch
|
||||
dahdi_spantypes.patch
|
||||
typos.patch
|
||||
dahdi-tools-3.1.0-fno-common.patch
|
||||
fix_install_paths.patch
|
|
@ -0,0 +1,17 @@
|
|||
From: Tzafrir Cohen <tzafrir@debian.org>
|
||||
Subject: add extra digit to library SO name: 2.0
|
||||
|
||||
Asterisk and various other programs were already looking for that SO
|
||||
name.
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 826a7ec..2afe476 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -392,5 +392,6 @@ AC_CONFIG_FILES([
|
||||
xpp/perl_modules/Makefile
|
||||
])
|
||||
AC_OUTPUT
|
||||
+sed -i -e '/^soname_spec=/s/major/&.\\$revision/' libtool
|
||||
|
||||
AC_MSG_NOTICE(*** dahdi-tools build successfully configured ***)
|
|
@ -0,0 +1,14 @@
|
|||
Index: dahdi-tools/xpp/astribank_is_starting.8
|
||||
===================================================================
|
||||
--- dahdi-tools.orig/xpp/astribank_is_starting.8 2019-03-03 23:44:05.883016682 +0200
|
||||
+++ dahdi-tools/xpp/astribank_is_starting.8 2019-03-04 01:34:40.398114773 +0200
|
||||
@@ -85,7 +85,7 @@
|
||||
.SH BUGS
|
||||
Option ordering matter. The \fB\-v\fR and \fB\-d\fR options should precede
|
||||
the actions (\fB\-a\fR, \fB\-r\fR and \fB\-w\fR).
|
||||
-The \fB\-t\fItimeout\fR option should preceed the \fB\-w\fR option.
|
||||
+The \fB\-t\fItimeout\fR option should precede the \fB\-w\fR option.
|
||||
|
||||
.SH SEE ALSO
|
||||
semctl(3)
|
||||
|
|
@ -0,0 +1,39 @@
|
|||
Subject: Set perl installation path to vendorlib
|
||||
Author: Tzafrir Cohen <tzafrir.cohen@xorcom.com>
|
||||
Forwarded: no
|
||||
|
||||
Point DAHDI PERL modules to the right directory under which to install
|
||||
perl modules.
|
||||
|
||||
(sitelib in Debian is under /usr/local. We don't want to install there)
|
||||
|
||||
Debian-specific configuration.
|
||||
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -120,20 +120,22 @@ fi
|
||||
# - The "$datadir/perl5" directory otherwise (e.g: during "make distcheck")
|
||||
#
|
||||
AC_MSG_CHECKING(for perl libdir)
|
||||
+set -x
|
||||
m4_define([_PERL_LIBDIR_DEFAULT], [${datadir}/perl5])dnl
|
||||
AC_ARG_WITH(perllib,
|
||||
[AS_HELP_STRING([--with-perllib=PATH],
|
||||
- [Location of perl modules @<:@default=]_PERL_LIBDIR_DEFAULT[, or perl -V:sitelib@:>@])],
|
||||
+ [Location of perl modules @<:@default=]_PERL_LIBDIR_DEFAULT[, or perl -V:vendorlib@:>@])],
|
||||
[perllibdir=$withval],
|
||||
[
|
||||
if test "$prefix" = 'NONE' -o "$prefix" = '/usr'; then
|
||||
- eval `"$PERL" -V:sitelib`
|
||||
- perllibdir="$sitelib"
|
||||
+ eval `"$PERL" -V:vendorlib`
|
||||
+ perllibdir="$vendorlib"
|
||||
else
|
||||
perllibdir='_PERL_LIBDIR_DEFAULT'
|
||||
fi
|
||||
]
|
||||
)
|
||||
+set +x
|
||||
AC_SUBST([perllibdir], "$perllibdir")
|
||||
AC_MSG_RESULT([$perllibdir])
|
||||
AM_CONDITIONAL([PERL], [test "$perllibdir" != ''])
|
|
@ -0,0 +1,58 @@
|
|||
#!/usr/bin/make -f
|
||||
# Sample debian/rules that uses debhelper.
|
||||
# GNU copyright 1997 to 1999 by Joey Hess.
|
||||
|
||||
# Uncomment this to turn on verbose mode.
|
||||
#export DH_VERBOSE=1
|
||||
|
||||
DEB_BUILD_MAINT_OPTIONS = hardening=+all
|
||||
|
||||
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
|
||||
CFLAGS += -g
|
||||
endif
|
||||
|
||||
CHANGED_FILES_LIST = debian/savedfiles.lst
|
||||
CHANGED_FILES_ARCHIVE = debian/savedfiles.cpio
|
||||
|
||||
%:
|
||||
dh $@ --with autoreconf
|
||||
|
||||
override_dh_autoreconf:
|
||||
if [ ! -f "$(CHANGED_FILES_ARCHIVE)" -a -f Makefile.in ]; then \
|
||||
cpio -o < $(CHANGED_FILES_LIST) > $(CHANGED_FILES_ARCHIVE); \
|
||||
fi
|
||||
dh_autoreconf
|
||||
|
||||
override_dh_autoreconf_clean:
|
||||
dh_autoreconf_clean
|
||||
if [ -f "$(CHANGED_FILES_ARCHIVE)" ]; then \
|
||||
cpio -idu < $(CHANGED_FILES_ARCHIVE) && \
|
||||
rm -f $(CHANGED_FILES_ARCHIVE); \
|
||||
fi
|
||||
|
||||
# An ugly workaround because those files are included in the tarball
|
||||
override_dh_clean:
|
||||
dh_clean -X autom4te.cache
|
||||
|
||||
|
||||
override_dh_auto_build:
|
||||
$(MAKE) all docs
|
||||
cat dahdi.rules xpp/xpp.rules >debian/dahdi.udev
|
||||
|
||||
override_dh_auto_clean:
|
||||
ifeq ($(wildcard Makefile),)
|
||||
$(MAKE) -f Makefile.legacy clean
|
||||
else
|
||||
$(MAKE) clean
|
||||
endif
|
||||
|
||||
override_dh_auto_configure:
|
||||
dh_auto_configure
|
||||
|
||||
override_dh_auto_install:
|
||||
# also run the 'config' target, in addition to the 'install' target:
|
||||
dh_auto_install -- config
|
||||
rm $(CURDIR)/debian/tmp/usr/share/dahdi/span_config.d/50-asterisk
|
||||
rm $(CURDIR)/debian/tmp/usr/lib/*/libtonezone.la
|
||||
rm -rf $(CURDIR)/debian/tmp/etc/dahdi
|
||||
rm -rf $(CURDIR)/debian/tmp/etc/udev/rules.d
|
|
@ -0,0 +1,27 @@
|
|||
Makefile.in
|
||||
aclocal.m4
|
||||
autoconfig.h.in
|
||||
autom4te.cache/output.0
|
||||
autom4te.cache/output.1
|
||||
autom4te.cache/output.2
|
||||
autom4te.cache/requests
|
||||
autom4te.cache/traces.0
|
||||
autom4te.cache/traces.1
|
||||
autom4te.cache/traces.2
|
||||
auxdir/config.guess
|
||||
auxdir/config.sub
|
||||
auxdir/install-sh
|
||||
auxdir/ltmain.sh
|
||||
configure
|
||||
doc/Makefile.in
|
||||
hotplug/Makefile.in
|
||||
m4/libtool.m4
|
||||
m4/ltoptions.m4
|
||||
m4/ltsugar.m4
|
||||
m4/ltversion.m4
|
||||
m4/lt~obsolete.m4
|
||||
ppp/Makefile.in
|
||||
xpp/Makefile.in
|
||||
xpp/oct612x/Makefile.in
|
||||
xpp/perl_modules/Makefile.in
|
||||
xpp/xtalk/Makefile.in
|
|
@ -0,0 +1 @@
|
|||
3.0 (quilt)
|
|
@ -0,0 +1,184 @@
|
|||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
|
||||
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
|
||||
g3LstQ==
|
||||
=vz6h
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
|
@ -0,0 +1,4 @@
|
|||
version=3
|
||||
opts=uversionmangle=s/\-rc/~rc/,pgpsigurlmangle=s/$/.asc/ \
|
||||
https://downloads.asterisk.org/pub/telephony/dahdi-tools/releases/dahdi-tools-(.*)\.tar\.gz\
|
||||
debian uupdate
|
|
@ -0,0 +1,19 @@
|
|||
man_MANS = \
|
||||
dahdi_cfg.8 \
|
||||
dahdi_maint.8 \
|
||||
dahdi_monitor.8 \
|
||||
dahdi_scan.8 \
|
||||
dahdi_span_assignments.8 \
|
||||
dahdi_span_types.8 \
|
||||
dahdi_test.8 \
|
||||
dahdi_tool.8 \
|
||||
dahdi_waitfor_span_assignments.8 \
|
||||
fxotune.8
|
||||
|
||||
noinst_MANS = \
|
||||
dahdi_diag.8 \
|
||||
fxstest.8 \
|
||||
patgen.8 \
|
||||
pattest.8
|
||||
|
||||
EXTRA_DIST = $(man_MANS) $(noinst_MANS)
|
|
@ -4,7 +4,7 @@
|
|||
dahdi_cfg \- configures DAHDI kernel modules from /etc/dahdi/system.conf
|
||||
.SH SYNOPSIS
|
||||
|
||||
.B dahdi_cfg [\-c \fICFG_FILE\fB] [\-S\fINUM\fB [-S\fICHANS\fB]] [\-s] [\-f] [\-t] [\-v [\-v ... ] ]
|
||||
.B dahdi_cfg [\-c \fICFG_FILE\fB] [\-S\fINUM\fB [\-S\fICHANS\fB]] [\-s] [\-f] [\-t] [\-v [\-v ... ] ]
|
||||
|
||||
.B dahdi_cfg \-h
|
||||
|
||||
|
@ -41,10 +41,8 @@ Only shutdown spans.
|
|||
|
||||
.B \-S \fISPAN
|
||||
.RS
|
||||
Only apply changes to span no. \fISPAN\fR. For a digital span (with
|
||||
a 'span=' line in the configuration file) this will do. For an analog
|
||||
span you'll have to explicitly tell dahdi_cfg the range of channels,
|
||||
using \-C .
|
||||
Only apply changes to span no. \fISPAN\fR. You also need to specify the
|
||||
range of channels in the span explicitly with \-C.
|
||||
.RE
|
||||
|
||||
.B \-f
|
||||
|
|
|
@ -43,11 +43,11 @@ Insert an error of a specific type
|
|||
.SH EXAMPLES
|
||||
Enable network line loopback on span 1:
|
||||
|
||||
dahdi_maint -s 1 --loopback networkline
|
||||
dahdi_maint \-s 1 \-\-loopback networkline
|
||||
|
||||
Disable network line loopback on span 1:
|
||||
|
||||
dahdi_maint -s 1 --loopback off
|
||||
dahdi_maint \-s 1 \-\-loopback off
|
||||
|
||||
|
||||
.SH SEE ALSO
|
||||
|
|
|
@ -35,7 +35,7 @@ Normally there's a different option that you need that implies it.
|
|||
|
||||
.B \-o
|
||||
.RS
|
||||
Plays the output to OSS (/dev/dsp). Requires -m not to be used.
|
||||
Plays the output to OSS (/dev/dsp). Requires \-m not to be used.
|
||||
.RE
|
||||
|
||||
.B \-v
|
||||
|
@ -44,7 +44,7 @@ Display Visual audio levels. With two v-s, Verbose mode is enabled, that
|
|||
shows the actual levels as numbers. Note that this requires a terminal
|
||||
wider than 80 columns to be properly displayed.
|
||||
|
||||
Implies -m.
|
||||
Implies \-m.
|
||||
.RE
|
||||
|
||||
.B \-f \fIFILE
|
||||
|
@ -62,14 +62,14 @@ to a file.
|
|||
.RS
|
||||
Record the content of the Rx channel to a file.
|
||||
|
||||
Implies -m.
|
||||
Implies \-m.
|
||||
.RE
|
||||
|
||||
.B \-R \fIFILE
|
||||
.RS
|
||||
Record the content of the R channel before the echo canceler to a file.
|
||||
|
||||
Implies -m.
|
||||
Implies \-m.
|
||||
.RE
|
||||
|
||||
.B \-s \fIFILE
|
||||
|
@ -87,47 +87,47 @@ canceler to a file.
|
|||
.RS
|
||||
Record the content of the Tx channel to a file.
|
||||
|
||||
Implies -m.
|
||||
Implies \-m.
|
||||
.RE
|
||||
|
||||
.B \-T \fIFILE
|
||||
.RS
|
||||
Record the content of the Tx channel before the echo canceler to a file.
|
||||
|
||||
Implies -m.
|
||||
Implies \-m.
|
||||
.RE
|
||||
|
||||
.SH EXAMPLES
|
||||
|
||||
Visualize audio levels on DAHDI channel 2:
|
||||
|
||||
dahdi_monitor 2 -v
|
||||
dahdi_monitor 2 \-v
|
||||
|
||||
|
||||
Record channel 3 to a file:
|
||||
|
||||
dahdi_monitor 3 -f output.raw
|
||||
dahdi_monitor 3 \-f output.raw
|
||||
|
||||
This will create a raw PCM file (signed-linear, 8kHz, mono, 16 bits per
|
||||
sample). Both the Tx and Rx will be multiplexed in a single channel.
|
||||
It can be converted to a WAV file using e.g.:
|
||||
|
||||
sox -s -c1 -2 -r8000 output.raw output.wav
|
||||
sox \-s \-c1 \-2 \-r8000 output.raw output.wav
|
||||
|
||||
|
||||
Record Tx and Rx of channel 5 to separate files. This time directly to
|
||||
WAV files:
|
||||
|
||||
dahdi_monitor 5 -r output_rx.wav -t output_tx.wav
|
||||
dahdi_monitor 5 \-r output_rx.wav \-t output_tx.wav
|
||||
|
||||
|
||||
Record channel 8 to a stereo file (Tx and Rx on its two channels):
|
||||
|
||||
dahdi_monitor 8 -s output.raw
|
||||
dahdi_monitor 8 \-s output.raw
|
||||
|
||||
Converting it to a WAV file:
|
||||
|
||||
sox -s -c2 -2 -r8000 output.raw output.wav
|
||||
sox \-s \-c2 \-2 \-r8000 output.raw output.wav
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,251 @@
|
|||
.TH "DAHDI_SPAN_ASSIGNMENTS" "8" "23 Jan 2014" "" ""
|
||||
|
||||
.SH NAME
|
||||
dahdi_span_assignments \- handle DAHDI spans assignments
|
||||
.SH SYNOPSIS
|
||||
|
||||
.B dahdi_span_assignments [\-v|\-\-verbose] [\-n|\-\-dry\-run] <add|remove|auto> \fB[\fIdevpath\fB...]
|
||||
|
||||
.B dahdi_span_assignments [\-v|\-\-verbose] list \fB[\fIdevpath\fB...]
|
||||
|
||||
.B dahdi_span_assignments [\-v|\-\-verbose] [\-k|\-\-key \fIkey\fB] dumpconfig
|
||||
|
||||
.B dahdi_span_assignments \-h|\-\-help
|
||||
|
||||
.SH DESCRIPTION
|
||||
Channels in DAHDI devices (such as DAHDI PCI cards) are groups to logical
|
||||
units called "spans" (for example: a port in a digital card is a span).
|
||||
When the kernel module parameter \fBdahdi.auto_assign_span\fR is unset,
|
||||
DAHDI devices that register with DAHDI don't cause their spans to be
|
||||
automatically assigned.
|
||||
|
||||
This allows user-space to order DAHDI to assign them to specific span
|
||||
and channel numbers. That way, specific spans on specific DAHDI devices
|
||||
may be assigned with specific span and channel numbers \fBregardless\fR
|
||||
of the registration order of the hardware (or if all hardware is present
|
||||
at all).
|
||||
|
||||
.B dahdi_span_assignments
|
||||
is used to assign those spans or to help creating the configuration
|
||||
file used in their assignment:
|
||||
.B /etc/dahdi/assigned\-spans.conf .
|
||||
|
||||
.SH SUB-COMMANDS
|
||||
|
||||
There are several sub-commands.
|
||||
|
||||
All sub-commands take an optional list of paths to SysFS nodes of
|
||||
devices. If given, the command will only operate on those DAHDI
|
||||
devices. The default is to operate on all devices (which would normally
|
||||
be the sane case when running from the command-line).
|
||||
|
||||
.B add \fB[\fIdevpath \fB...]
|
||||
.RS
|
||||
Applies to all devices or to those listed on the command line.
|
||||
Parameters are paths (in SysFS) to DAHDI devices with unassigned
|
||||
spans.
|
||||
|
||||
The command will assign spans with DAHDI according to
|
||||
configuration in \fBassigned\-spans.conf\fR.
|
||||
|
||||
If no line matches the span, or if the assignment for it fails (it is
|
||||
not available) it will remain unassigned.
|
||||
|
||||
If any of the span settings fails (the span number or range of channels
|
||||
is already in use), the program will print a message, but continue
|
||||
applying the others. In such a case you should fix assigned\-spans.conf
|
||||
and re-run \fBadd\fR (or run \fBauto\fR to give those channels the
|
||||
first available range and regenerate the file with 'dahdi_genconf
|
||||
assignedspans').
|
||||
.RE
|
||||
|
||||
.B remove \fB[\fIdevpath \fB...]
|
||||
.RS
|
||||
Applies to all devices or to those listed on the command line.
|
||||
Parameters are paths (in SysFS) to DAHDI devices with assigned
|
||||
spans.
|
||||
|
||||
The command will un-assign them.
|
||||
.RE
|
||||
|
||||
.B auto \fB[\fIdevpath \fB...]
|
||||
.RS
|
||||
Applies to all devices or to those listed on the command line.
|
||||
Parameters are paths (in SysFS) to DAHDI devices with unassigned
|
||||
spans.
|
||||
|
||||
Each span is assigned to first available span number and channel
|
||||
numbers, as if \fBdahdi.auto_assign_span\fR was set. The configuration
|
||||
file doesn't affect these assignments.
|
||||
.RE
|
||||
|
||||
.B list
|
||||
.RS
|
||||
List all spans in the system.
|
||||
.RE
|
||||
|
||||
.B dumpconfig
|
||||
.RS
|
||||
List all assigned spans in the system in a format fit to be used in
|
||||
\fBassigned\-spans.conf\fR. Use this to generate a configuration file after
|
||||
you have (automatically or manually) assigned all existing spans.
|
||||
|
||||
.B dahdi_genconf assignedspans
|
||||
uses this command internally.
|
||||
.RE
|
||||
|
||||
.SH OPTIONS
|
||||
|
||||
.B \-v \-\-verbose
|
||||
.RS
|
||||
Verbose output.
|
||||
.RE
|
||||
|
||||
.B \-n \-\-dry\-run
|
||||
.RS
|
||||
Don't assign / un-assign spans. Only print commands used to do so.
|
||||
.RE
|
||||
|
||||
.B \-k \fIkey
|
||||
.RS
|
||||
For \fBdumpconfig\fR \- The key by which to identify the hardware in the
|
||||
generated configuration. Legal values:
|
||||
|
||||
.B hwid
|
||||
.RS
|
||||
Hardware identifier (e.g.: software-readable serial number). This is the
|
||||
default. If the device has no hwid, devpath is used.
|
||||
.RE
|
||||
|
||||
.B location
|
||||
.RS
|
||||
The location field (file) in the SysFS device node (directory) for the
|
||||
DAHDI device. If not available (typically: DAHDI version <= 2.7.x),
|
||||
devpath is used.
|
||||
.RE
|
||||
|
||||
.B devpath
|
||||
.RS
|
||||
Path in SysFS to the device node.
|
||||
.RE
|
||||
.RE
|
||||
|
||||
.SH CONFIGURATION
|
||||
.B /etc/dahdi/assigned\-spans.conf
|
||||
is a file with lines specifying assignment of spans.
|
||||
|
||||
Empty lines or lines beginning with '#' are ignored.
|
||||
|
||||
Each line is in the format of:
|
||||
|
||||
.I ID spanspec ...
|
||||
|
||||
The \fIID\fR field specifies the DAHDI device and the \fIspanspecs\fR
|
||||
define how to assign its spans. A line may have multiple
|
||||
\fIspanspecs\fR in a single line (though dumpconfig generates a
|
||||
configuration with one per line).
|
||||
|
||||
.SS Span Identifier
|
||||
A DAHDI device may be specified either by a hardware identifier (a
|
||||
software readable serial number or whatever) or the location in which
|
||||
it is installed on the system. The former makes it simpler to change
|
||||
connector / slot whereas the latter makes it simpler to replace a unit.
|
||||
|
||||
The value in this field is matched (when the commands \fBadd\fR and
|
||||
\fBremove\fR) are used) to the following values:
|
||||
|
||||
\fIhwid\fR
|
||||
\fB@\fIlocation\fR
|
||||
\fIdevpath\fR
|
||||
|
||||
See above for their descriptions. The value may include shell wildcards:
|
||||
*, ? and [], which are used in the match. The values to be matched are
|
||||
first cleaned up: '!' is replaced with '/' and any character beyond
|
||||
"a\-zA\-Z0\-9/:.\-" is removed.
|
||||
|
||||
.SS Span Specification
|
||||
|
||||
Each line should have one or more span specifications: this is the value
|
||||
used to assign a span with DAHDI in the SysFS interface. A
|
||||
specification has three colon-separated numbers:
|
||||
|
||||
.I rel_span_no:span_no:first_chan
|
||||
|
||||
for instance, the following are four span specifications for a quad-E1
|
||||
device: 1:6:53 2:7:84 3:8:115 4:9:146 occupying spans 6-9 and channels
|
||||
53-176.
|
||||
|
||||
.B rel_span_no
|
||||
.RS
|
||||
The relative number of the span in the device. E.g.: port number.
|
||||
.RE
|
||||
|
||||
.B span_no
|
||||
.RS
|
||||
The desired DAHDI span number. Must be available.
|
||||
.RE
|
||||
|
||||
.B first_chan
|
||||
.RS
|
||||
The desired DAHDI channel number for the first DAHDI channel in the span.
|
||||
All channels of the span will be assigned following it and hence that
|
||||
space must be available.
|
||||
.RE
|
||||
|
||||
|
||||
.SH ENVIRONMENT
|
||||
|
||||
.B DAHDICONFDIR
|
||||
.RS
|
||||
The directory in which assigned\-spans.conf resides. /etc/dahdi if not
|
||||
overridden from the environment.
|
||||
.RE
|
||||
|
||||
.B DAHDISASSIGNEDSPANSCONF
|
||||
.RS
|
||||
The path to assigned-spans.conf resides. /etc/dahdi/assigned\-spans.conf if
|
||||
not overridden from the environment.
|
||||
.RE
|
||||
|
||||
.B SPAN_ASSIGNMENTS_KEY
|
||||
.RS
|
||||
The default value for \-k . Defaults to "hwid" if not overridden from the
|
||||
environment.
|
||||
.RE
|
||||
|
||||
|
||||
.SH FILES
|
||||
|
||||
.B /etc/dahdi/assigned\-spans.conf
|
||||
.RS
|
||||
The default location for the configuration file.
|
||||
.RE
|
||||
|
||||
.B /sys/bus/dahdi_devices/devices/\fIdevice\fR
|
||||
.RS
|
||||
SysFS node for the device. In this directory reside the following
|
||||
files, among others:
|
||||
|
||||
.B location
|
||||
.RS
|
||||
The value of the device's location field.
|
||||
.RE
|
||||
|
||||
.B assign_span, unassign_span, auto_assign
|
||||
.RS
|
||||
Write only files for the operations. Used by \fBadd\fR, \fBremove\fR and
|
||||
\fBauto\fR, respectively.
|
||||
.RE
|
||||
|
||||
.RE
|
||||
|
||||
.SH SEE ALSO
|
||||
dahdi_span_types(8), dahdi_genconf(8), dahdi_cfg(8)
|
||||
|
||||
.SH AUTHOR
|
||||
dahdi_span_assignments was written by Oron Peled. This manual page was
|
||||
written by Tzafrir Cohen. Permission is granted to copy, distribute
|
||||
and/or modify this document under the terms of the GNU General Public
|
||||
License, Version 2 any later version published by the Free Software
|
||||
Foundation.
|
||||
|
|
@ -0,0 +1,207 @@
|
|||
.TH "DAHDI_SPAN_TYPES" "8" "23 Jan 2014" "" ""
|
||||
|
||||
.SH NAME
|
||||
dahdi_span_types \- set line modes of DAHDI spans before assignment
|
||||
.SH SYNOPSIS
|
||||
|
||||
.B dahdi_span_types [\fIoptions\fB] <list|dumpconfig|compare|set> \fB[\fIdevpath \fB...]
|
||||
|
||||
.SH DESCRIPTION
|
||||
The span type (the line mode: E1/T1/J1) must be set to a span before
|
||||
DAHDI assigns it a span number, as E1 spans use more channels.
|
||||
\fBdahdi_span_types\fR applies the span type configuration to an
|
||||
un-assigned span.
|
||||
|
||||
Using it only makes sense when the kernel module parameter
|
||||
\fBdahdi.auto_assign_span\fR is unset, otherwise DAHDI automatically
|
||||
assign span numbers during device registration.
|
||||
|
||||
.B dahdi_span_types
|
||||
takes a command and an optional list of devices. If no device is given,
|
||||
the command is applied to all devices.
|
||||
|
||||
The device is marked as a path in the SysFS tree.
|
||||
|
||||
.SH OPTIONS
|
||||
|
||||
.B \-h|\-\-help
|
||||
.RS
|
||||
Output usage message and exit
|
||||
.RE
|
||||
|
||||
.B \-n|\-\-dry\-run
|
||||
.RS
|
||||
During \fB"set"\fR operation, only show what would be done, without actually
|
||||
changing anything.
|
||||
.RE
|
||||
|
||||
.B \-v|\-\-verbose
|
||||
.RS
|
||||
During \fB"set"\fR operation, show the actions that are being performed.
|
||||
.RE
|
||||
|
||||
.BI \-\-line\-mode= <E1|T1|J1>
|
||||
.RS
|
||||
During \fB"dumpconfig"\fR operation, force special generation mode:
|
||||
.IP \(bu 3
|
||||
First, generates a "wildcard" entry with the fiven \fBline\-mode\fR.
|
||||
.IP \(bu 3
|
||||
Comment out all span entries. Each of them may be manually un-commented
|
||||
to override the "wildcard".
|
||||
.RE
|
||||
|
||||
.SH SUB-COMMANDS
|
||||
.B set
|
||||
.RS
|
||||
Reads settings from \fBspan\-types.conf\fR and applies them to the
|
||||
device(s) specified in the command line (or all devices, if none
|
||||
specified).
|
||||
.RE
|
||||
|
||||
.B compare
|
||||
.RS
|
||||
Compare the settings on the system to those in the configuration file.
|
||||
For each line that applies to a device on the system, print it if the
|
||||
value to be set and the active value on the system differ.
|
||||
|
||||
The exit status is 0 if there is no difference and non-zero if a
|
||||
difference was detected.
|
||||
.RE
|
||||
|
||||
.B list
|
||||
.RS
|
||||
List line modes for all spans in the system which may be set with
|
||||
dahdi_span_types (E1/T1/J1 spans).
|
||||
.RE
|
||||
|
||||
.B dumpconfig
|
||||
.RS
|
||||
List types for the spans in a format fit to be used in
|
||||
\fBspan\-types.conf\fR. Use this to generate a configuration file after
|
||||
you have (perhaps manually) set all existing spans.
|
||||
|
||||
.B dahdi_genconf spantypes
|
||||
uses this command internally.
|
||||
.RE
|
||||
|
||||
.SH CONFIGURATION
|
||||
.SS General structure
|
||||
.B span\-types.conf
|
||||
is a file with lines specifying line modes of spans.
|
||||
|
||||
Empty lines or lines beginning with '#' are ignored.
|
||||
|
||||
Each line is in the format of:
|
||||
|
||||
.I ID spanspec ...
|
||||
|
||||
The \fIID\fR field specifies the DAHDI device and the \fIspanspecs\fR
|
||||
define the line modes of its spans. A line may have multiple
|
||||
\fIspanspecs\fR in a single line (though dumpconfig generates a
|
||||
configuration with one per line).
|
||||
|
||||
.SS Span Identifier
|
||||
A DAHDI device may be specified either by a hardware identifier (a
|
||||
software readable serial number or whatever) or the location in which
|
||||
it is installed on the system. The former makes it simpler to change
|
||||
connector / slot whereas the latter makes it simpler to replace a unit.
|
||||
|
||||
The value in this field is matched (when the command \fBset\fR is
|
||||
used) to the following values:
|
||||
|
||||
\fIhwid\fR
|
||||
\fB@\fIlocation\fR
|
||||
\fIdevpath\fR
|
||||
|
||||
See above for their descriptions. The value may include shell wildcards:
|
||||
*, ? and [], which are used in the match. The values to be matched are
|
||||
first cleaned up: '!' is replaced with '/' and any character not in
|
||||
"a\-zA\-Z0\-9/:.\-" is replaced by "_".
|
||||
|
||||
Note that while span\-types.conf allows an arbitrarily-complex
|
||||
combination of E1, J1 and T1 ports, it would normally have just a single
|
||||
wildcard line setting the line mode (the first line in the example below).
|
||||
|
||||
.SS Span Specification
|
||||
|
||||
Each line should have one or more span specifications: this is the value
|
||||
used to set span type with DAHDI in the SysFS interface. A
|
||||
specification has two colon-separated fields:
|
||||
|
||||
.I rel_span_no:span_type
|
||||
|
||||
for instance, the following are four span specifications specify ports 1
|
||||
and 2 as E1 and ports 3 and 4 as T1: [12]:E1 [34]:T1 .
|
||||
|
||||
.B rel_span_no
|
||||
.RS
|
||||
The relative number of the span in the device. E.g.: port number.
|
||||
This field may contain shell wildcards (*, ? and [])
|
||||
.RE
|
||||
|
||||
.B span_type
|
||||
.RS
|
||||
E1/T1/J1
|
||||
.RE
|
||||
|
||||
.SS Multiple matches
|
||||
During \fBset\fR operation, the \fBdahdi_span_types\fR applies all
|
||||
matching settings to a span. This is done in the order of lines in the
|
||||
configuration files.
|
||||
|
||||
Thus, if there are multiple matches to a span -- the last match
|
||||
will \fIwin\fR (all will be applied to the kernel in order. The last
|
||||
one in the file will be applied last).
|
||||
|
||||
Example:
|
||||
.EX
|
||||
* *:T1 # All spans on all devices will be T1
|
||||
usb:X1234567 [34]:E1 # Except spans 3,4 on the device which will be E1
|
||||
.EE
|
||||
|
||||
|
||||
.SH ENVIRONMENT
|
||||
|
||||
.B DAHDICONFDIR
|
||||
.RS
|
||||
The directory in which span\-types.conf resides. /etc/dahdi if not
|
||||
overridden from the environment.
|
||||
.RE
|
||||
|
||||
.B DAHDISPANTYPESCONF
|
||||
.RS
|
||||
The path to span\-types.conf resides. /etc/dahdi/span\-types.conf if
|
||||
not overridden from the environment.
|
||||
.RE
|
||||
|
||||
|
||||
.SH FILES
|
||||
|
||||
.B /etc/dahdi/span\-types.conf
|
||||
.RS
|
||||
The default location for the configuration file.
|
||||
.RE
|
||||
|
||||
.B /sys/bus/dahdi_devices/devices/\fIdevice\fR
|
||||
.RS
|
||||
SysFS node for the device. In this directory reside the following
|
||||
files, among others:
|
||||
|
||||
.B spantype
|
||||
.RS
|
||||
read/write file. Reading from it returns current configuration for spans
|
||||
of the device. Span-specifications can be written to it to change line
|
||||
modes (but only for a span that is not assigned yet).
|
||||
.RE
|
||||
|
||||
|
||||
.SH SEE ALSO
|
||||
dahdi_span_assignments(8), dahdi_genconf(8), dahdi_cfg(8)
|
||||
|
||||
.SH AUTHOR
|
||||
dahdi_span_types was written by Oron Peled. This manual page was
|
||||
written by Tzafrir Cohen. Permission is granted to copy, distribute
|
||||
and/or modify this document under the terms of the GNU General Public
|
||||
License, Version 2 any later version published by the Free Software
|
||||
Foundation.
|
||||
|
|
@ -7,7 +7,7 @@ dahdi_tool \- Shows status of DAHDI interfaces
|
|||
.B dahdi_tool
|
||||
|
||||
.SH DESCRIPTION
|
||||
dahdi_tool shows the current status the DAHDI inteface cards plugged
|
||||
dahdi_tool shows the current status the DAHDI interface cards plugged
|
||||
to the computer.
|
||||
|
||||
It displays values like Current Alarms, SyncSource, Tx/Rx
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
.TH "DAHDI_WAITFOR_SPAN_ASSIGNMENTS" "8" "22 Jan 2014" "" ""
|
||||
|
||||
.SH NAME
|
||||
dahdi_waitfor_span_assignments \- wait for DAHDI spans to get (un)assigned
|
||||
.SH SYNOPSIS
|
||||
|
||||
.B dahdi_span_assignments assigned
|
||||
|
||||
.B dahdi_span_assignments unassigned
|
||||
|
||||
.SH DESCRIPTION
|
||||
DAHDI spans get assigned / unassigned asynchronously.
|
||||
|
||||
.B dahdi_span_assignments
|
||||
is a helper script that allows running commands after all the spans have
|
||||
been assigned or unassigned.
|
||||
|
||||
It takes a single command: \fBassigned\fR or \fBunassigned\fR and waits
|
||||
(up until a timeout of 5 seconds) for all the DAHDI spans in the system
|
||||
to do so.
|
||||
|
||||
Note that if the system has a span that will not get assigned
|
||||
automatically (e.g.: it's not in assigned\-spans.conf), this program
|
||||
does not know and will wait until a timeout.
|
||||
|
||||
.SH EXAMPLES
|
||||
|
||||
modprobe wctdm24xxp
|
||||
dahdi_waitfor_span_assignments assigned
|
||||
do_something
|
||||
|
||||
dahdi_span_assignments add
|
||||
dahdi_waitfor_span_assignments assigned
|
||||
do_something_else
|
||||
|
||||
dahdi_span_assignments remove
|
||||
dahdi_span_assignments unassigned
|
||||
do_something_completely_different
|
||||
|
||||
.SH SEE ALSO
|
||||
dahdi_span_assignments(8)
|
||||
|
||||
.SH AUTHOR
|
||||
dahdi_waitfor_span_assignments was written by Oron Peled. This manual
|
||||
page was written by Tzafrir Cohen. Permission is granted to copy,
|
||||
distribute and/or modify this document under the terms of the GNU
|
||||
General Public License, Version 2 any later version published by the
|
||||
Free Software Foundation.
|
||||
|
|
@ -11,6 +11,7 @@ fxotune \- automatically tune DAHDI FXO channels
|
|||
\- dump mode
|
||||
|
||||
.B fxotune \-s
|
||||
.I [ options ]
|
||||
\- Startup mode
|
||||
.SH
|
||||
.SH DESCRIPTION
|
||||
|
@ -32,7 +33,7 @@ is generated in the current directory.
|
|||
fxotune just reads the settings from fxotune.conf into the FXO modules.
|
||||
|
||||
You are advised to run fxotune on all FXO ports you have that support
|
||||
it and that are connected. Note that the tunning is affected by e.g.
|
||||
it and that are connected. Note that the tuning is affected by e.g.
|
||||
the physical parameters of the connection, and thus if it has been
|
||||
radically changed, you may need to re-run fxotune.
|
||||
|
||||
|
@ -43,7 +44,7 @@ cards and clones) do not have the hardware to support such tuning.
|
|||
The tuning process needs a clear line to do the tuning. In order to do
|
||||
that, it runs in cycles of the following: sets the line off-hook, dials
|
||||
a dial string (which should set the PSTN provider waiting for the next
|
||||
digit), and then starts tuning. It has a limited ammount of time for
|
||||
digit), and then starts tuning. It has a limited amount of time for
|
||||
tuning before the PSTN gives up and gives a busy tone. So after a while
|
||||
it hangs up and starts a new cycle.
|
||||
|
||||
|
@ -179,7 +180,7 @@ so if you stop it half-way, you may get a half-configured system. If you
|
|||
have already tuned your FXO channels and wish to test-run fxotune again,
|
||||
you are advised to backup /etc/fxotune.conf .
|
||||
|
||||
The default for \-m is 18 seconds. This asusmes that you get a clear line
|
||||
The default for \-m is 18 seconds. This assumes that you get a clear line
|
||||
for at least 18 seconds. It is advised that you test that timeout earlier
|
||||
by connecting a phone to the FXO line, dialing 4 (or whatever dial string
|
||||
you put with \-n) and see how much time of silence you have.
|
||||
|
|
|
@ -1,222 +0,0 @@
|
|||
.TH "SPAN_ASSIGNMENTS" "8" "13 Oct 2013" "" ""
|
||||
|
||||
.SH NAME
|
||||
span_assignments \- handle DAHDI spans registration
|
||||
.SH SYNOPSIS
|
||||
|
||||
.B span_assignments [\-v|\-\-verbose] [\-n|\-\-dry\-run] <add|remove> \fIdevpath
|
||||
\fB[\fIdevpath \fB...]
|
||||
|
||||
.B span_assignments [\-v|\-\-verbose] [\-n|\-\-dry\-run] auto
|
||||
|
||||
.B span_assignments [\-v|\-\-verbose] list
|
||||
|
||||
.B span_assignments [\-v|\-\-verbose] [\-k|\-\-key \fIkey\fB] dumpconfig
|
||||
|
||||
.B span_assignments \-h|\-\-help
|
||||
|
||||
.SH DESCRIPTION
|
||||
When the kernel module parameter \fBdahdi.auto_assign_span\fR is unset,
|
||||
DAHDI devices (such as DAHDI PCI cards) that register with DAHDI don't
|
||||
register their spans (e.g.: each digital port is normally a span) with
|
||||
DAHDI. This allows user-space to order DAHDI to register them to specific
|
||||
span and channel numbers. This allows registering different spans out of
|
||||
order.
|
||||
|
||||
.B span_assignments
|
||||
is used to register those spans or to help creating the configuration
|
||||
file used in their registration:
|
||||
.B /etc/dahdi/pinned-spans.conf .
|
||||
|
||||
.SH OPTIONS
|
||||
|
||||
There are several sub-commands:
|
||||
|
||||
.B add \fIdevpath \fB[\fIdevpath \fB...]
|
||||
.RS
|
||||
Parameters are paths (in SysFS) to DAHDI devices with unregistered
|
||||
spans. The command will register with DAHDI according to according to
|
||||
configuration in \fBpinned-spans.conf\fR.
|
||||
.RE
|
||||
|
||||
.B remove \fIdevpath \fB[\fIdevpath \fB...]
|
||||
.RS
|
||||
Parameters are paths (in SysFS) to DAHDI devices with registered
|
||||
spans. The command will unregister with DAHDI.
|
||||
.RE
|
||||
|
||||
.B auto
|
||||
.RS
|
||||
Register all non-registered spans. Each span registers to first
|
||||
available span number and channel numbers, as if
|
||||
\fBdahdi.auto_assign_span\fR was set.
|
||||
.RE
|
||||
|
||||
.B list
|
||||
.RS
|
||||
List all spans in the system.
|
||||
.RE
|
||||
|
||||
.B dumpconfig
|
||||
.RS
|
||||
List all registered spans in the system in a format fit to be used in
|
||||
\fBpinned-spans.conf\fR. Use this to generate a configuration file after
|
||||
you have (perhaps manually) registered all existing spans.
|
||||
|
||||
.B dahdi_genconf pinnedspans
|
||||
uses this command internally.
|
||||
.RE
|
||||
|
||||
.B \-v \-\-verbose
|
||||
.RS
|
||||
Verbose output.
|
||||
.RE
|
||||
|
||||
.B \-n \-\-dry\-run
|
||||
.RS
|
||||
Don't register / unregister spans. Only print commands used to do so.
|
||||
.RE
|
||||
|
||||
.B \-k \fIkey
|
||||
.RS
|
||||
For \fBdumpconfig\fR \- The key by which to identify the hardware in the
|
||||
generated configuration. Legal values:
|
||||
|
||||
.B hwid
|
||||
.RS
|
||||
Hardware identifier (e.g.: software-readable serial number). This is the
|
||||
default. If the device has no hwid, devpath is used.
|
||||
.RE
|
||||
|
||||
.B location
|
||||
.RS
|
||||
The location field (file) in the SysFS device node (directory) for the
|
||||
DAHDI device. If not available (typically: DAHDI version <= 2.7.x),
|
||||
devpath is used.
|
||||
.RE
|
||||
|
||||
.B devpath
|
||||
.RS
|
||||
Path in SysFS to the device node.
|
||||
.RE
|
||||
.RE
|
||||
|
||||
.SH CONFIGURATOIN
|
||||
.B pinned-spans.conf
|
||||
is a file with lines specifying registration of spans.
|
||||
|
||||
Empty lines or lines beginning with '#' are ignored.
|
||||
|
||||
Each line is in the format of:
|
||||
|
||||
.I ID spanspec ...
|
||||
|
||||
The \fIID\fR field specifies the DAHDI device and the \fIspanspecs\fR
|
||||
define how to register its spans. A line may have multiple
|
||||
\fIspanspecs\fR in a single line (though dumpconfig generates a
|
||||
configuration with one per line).
|
||||
|
||||
.SS Span Identifier
|
||||
A DAHDI device may be specified either by a hardware identifier (a
|
||||
software readable serial number or whatever) or the location in which
|
||||
it is installed on the system. The former makes it simpler to change
|
||||
connector / slot whereas the latter makes it simpler to replace a unit.
|
||||
|
||||
The value in this field is matched (when the commands \fBadd\fR and
|
||||
\fBremove\fR) are used) to the following values:
|
||||
|
||||
\fIhwid\fR
|
||||
\fB@\fIlocation\fR
|
||||
\fIdevpath\fR
|
||||
|
||||
See above for their descriptions. The value may include shell wildcards:
|
||||
*, ? and [], which are used in the match. The values to be matched are
|
||||
first cleaned up: '!' is replaced with '/' and any character beyond
|
||||
"a-zA-Z0-9/:.-" is removed.
|
||||
|
||||
.SS Span Specification
|
||||
|
||||
Each line should have one or more span specifications: this is the value
|
||||
used to register a span with DAHDI in the SysFS interface. A
|
||||
specification has three colon-separated numbers:
|
||||
|
||||
.I rel_span_no:span_no:first_chan
|
||||
|
||||
for instance, the following are four span specifications for a quad-E1
|
||||
device: 1:6:53 2:7:84 3:8:115 4:9:146 occupying spans 6-9 and channels
|
||||
53-176.
|
||||
|
||||
.B rel_span_no
|
||||
.RS
|
||||
The relative number of the span in the device. E.g.: port number.
|
||||
.RE
|
||||
|
||||
.B span_no
|
||||
.RS
|
||||
The desired DAHDI span number. Must be available.
|
||||
.RE
|
||||
|
||||
.B first_chan
|
||||
.RS
|
||||
The desired DAHDI channel number for the first DAHDI channel in the span.
|
||||
All channels of the span will be registered following it and hence that
|
||||
space must be available.
|
||||
.RE
|
||||
|
||||
|
||||
.SH ENVIRONMENT
|
||||
|
||||
.B DAHDICONFDIR
|
||||
.RS
|
||||
The directory in which pinned-spans.conf resides. /etc/dahdi if not
|
||||
overridden from the environment.
|
||||
.RE
|
||||
|
||||
.B pinned_spans_conf
|
||||
.RS
|
||||
The path to pinned-spans.conf resides. /etc/dahdi/pinned-spans.conf if
|
||||
not overridden from the environment.
|
||||
.RE
|
||||
|
||||
.B SPAN_ASSIGNMENTS_KEY
|
||||
.RS
|
||||
The default value for \-k . Defaults to "hwid" if not overridden from the
|
||||
environment.
|
||||
.RE
|
||||
|
||||
|
||||
.SH FILES
|
||||
|
||||
.B /etc/dahdi/pinned-spans.conf
|
||||
.RS
|
||||
The default location for the configuration file.
|
||||
.RE
|
||||
|
||||
.B /sys/bus/dahdi_devices/devices/\fIdevice\fR
|
||||
.RS
|
||||
SysFS node for the device. In this directory reside the following
|
||||
files, among others:
|
||||
|
||||
.B location
|
||||
.RS
|
||||
The value of the device's location field.
|
||||
.RE
|
||||
|
||||
.B assign_span, unassign_span, auto_assign
|
||||
.RS
|
||||
Write only files for the operations. Used by \fBadd\fR, \fBremove\fR and
|
||||
\fBauto\fR, respectively.
|
||||
.RE
|
||||
|
||||
.RE
|
||||
|
||||
.SH SEE ALSO
|
||||
span_types(8), dahdi_genconf(8), dahdi_cfg(8)
|
||||
|
||||
.SH AUTHOR
|
||||
span_assignments was written by Oron Peled. This manual page was
|
||||
written by Tzafrir Cohen. Permission is granted to copy, distribute
|
||||
and/or modify this document under the terms of the GNU General Public
|
||||
License, Version 2 any later version published by the Free Software
|
||||
Foundation.
|
||||
|
146
doc/span_types.8
146
doc/span_types.8
|
@ -1,146 +0,0 @@
|
|||
.TH "SPAN_TYPES" "8" "13 Oct 2013" "" ""
|
||||
|
||||
.SH NAME
|
||||
span_types \- set DAHDI spans properties before registration (E1/T1)
|
||||
.SH SYNOPSIS
|
||||
|
||||
.B span_types <list|dumpconfig|set> [\fIdevpath \fB[\fIdevpath \fB...]]
|
||||
|
||||
.SH DESCRIPTION
|
||||
The span type (E1/T1/J1) must be set to a span before registering it
|
||||
with DAHDI, as E1 spans use more channels. \fBspan_types\fR applies the
|
||||
span type configuration to an unregistered span.
|
||||
|
||||
Using it only makes sense when the kernel module parameter
|
||||
\fBdahdi.auto_assign_span\fR is unset, otherwise the DAHDI spans register
|
||||
automatically.
|
||||
|
||||
.SH OPTIONS
|
||||
.B span_types
|
||||
takes a command and an optional list of devices. If no device is given,
|
||||
the command is applied to all devices.
|
||||
|
||||
The device is marked as a path in the SysFS tree.
|
||||
|
||||
.B set
|
||||
.RS
|
||||
Reads settings from \fBspan-types.conf\fR and applies them to the
|
||||
device(s) specified in the command line (or all devices, if none
|
||||
specified).
|
||||
.RE
|
||||
|
||||
.B list
|
||||
.RS
|
||||
List types for all spans in the system which may be set with span_types
|
||||
(E1/T1/J1 spans).
|
||||
.RE
|
||||
|
||||
.B dumpconfig
|
||||
.RS
|
||||
List types for the spans in a format fit to be used in
|
||||
\fBspan-types.conf\fR. Use this to generate a configuration file after
|
||||
you have (perhaps manually) set all existing spans.
|
||||
|
||||
.B dahdi_genconf spantypes
|
||||
uses this command internally.
|
||||
.RE
|
||||
|
||||
.SH CONFIGURATION
|
||||
.B span-types.conf
|
||||
is a file with lines specifying registration of spans.
|
||||
|
||||
Empty lines or lines beginning with '#' are ignored.
|
||||
|
||||
Each line is in the format of:
|
||||
|
||||
.I ID spanspec ...
|
||||
|
||||
The \fIID\fR field specifies the DAHDI device and the \fIspanspecs\fR
|
||||
define how to register its spans. A line may have multiple
|
||||
\fIspanspecs\fR in a single line (though dumpconfig generates a
|
||||
configuration with one per line).
|
||||
|
||||
.SS Span Identifier
|
||||
A DAHDI device may be specified either by a hardware identifier (a
|
||||
software readable serial number or whatever) or the location in which
|
||||
it is installed on the system. The former makes it simpler to change
|
||||
connector / slot whereas the latter makes it simpler to replace a unit.
|
||||
|
||||
The value in this field is matched (when the commands \fBadd\fR and
|
||||
\fBremove\fR) are used) to the following values:
|
||||
|
||||
\fIhwid\fR
|
||||
\fB@\fIlocation\fR
|
||||
\fIdevpath\fR
|
||||
|
||||
See above for their descriptions. The value may include shell wildcards:
|
||||
*, ? and [], which are used in the match. The values to be matched are
|
||||
first cleaned up: '!' is replaced with '/' and any character beyond
|
||||
"a-zA-Z0-9/:.-" is removed.
|
||||
|
||||
.SS Span Specification
|
||||
|
||||
Each line should have one or more span specifications: this is the value
|
||||
used to register a span with DAHDI in the SysFS interface. A
|
||||
specification has three colon-separated numbers:
|
||||
|
||||
.I rel_span_no:span_type
|
||||
|
||||
for instance, the following are four span specifications specify ports 1 and 2 as E1 and ports 3 and 4 as T1: [12]:E1 [34]:T1 .
|
||||
|
||||
.B rel_span_no
|
||||
.RS
|
||||
The relative number of the span in the device. E.g.: port number.
|
||||
.RE
|
||||
|
||||
.B span_type
|
||||
.RS
|
||||
E1/T1/J1
|
||||
.RE
|
||||
|
||||
|
||||
.SH ENVIRONMENT
|
||||
|
||||
.B DAHDICONFDIR
|
||||
.RS
|
||||
The directory in which span-types.conf resides. /etc/dahdi if not
|
||||
overridden from the environment.
|
||||
.RE
|
||||
|
||||
.B span_types_conf
|
||||
.RS
|
||||
The path to span-types.conf resides. /etc/dahdi/span-types.conf if
|
||||
not overridden from the environment.
|
||||
.RE
|
||||
|
||||
|
||||
.SH FILES
|
||||
|
||||
.B /etc/dahdi/span-types.conf
|
||||
.RS
|
||||
The default location for the configuration file.
|
||||
.RE
|
||||
|
||||
.B /sys/bus/dahdi_devices/devices/\fIdevice\fR
|
||||
.RS
|
||||
SysFS node for the device. In this directory reside the following
|
||||
files, among others:
|
||||
|
||||
.B spantype
|
||||
.RS
|
||||
read/write file. Reading from it returns current configuration for spans
|
||||
of the device. Span-specifications can be written to it to change types
|
||||
(but only for a span that is not registered).
|
||||
.RE
|
||||
|
||||
|
||||
.SH SEE ALSO
|
||||
span_assignments(8), dahdi_genconf(8), dahdi_cfg(8)
|
||||
|
||||
.SH AUTHOR
|
||||
span_types was written by Oron Peled. This manual page was
|
||||
written by Tzafrir Cohen. Permission is granted to copy, distribute
|
||||
and/or modify this document under the terms of the GNU General Public
|
||||
License, Version 2 any later version published by the Free Software
|
||||
Foundation.
|
||||
|
13
fxotune.c
13
fxotune.c
|
@ -980,7 +980,7 @@ static int channel_open(int channo)
|
|||
*
|
||||
* @return 0 if successful, !0 otherwise
|
||||
*/
|
||||
static int do_set(char *configfilename)
|
||||
static int do_set(char *configfilename, int dev_range, int startdev, int stopdev)
|
||||
{
|
||||
FILE *fp = NULL;
|
||||
int res = 0;
|
||||
|
@ -1007,6 +1007,8 @@ static int do_set(char *configfilename)
|
|||
if (res == EOF) {
|
||||
break;
|
||||
}
|
||||
if (dev_range && (mydahdi < startdev || mydahdi > stopdev))
|
||||
continue;
|
||||
|
||||
/* Check to be sure conversion is done correctly */
|
||||
if (OUT_OF_BOUNDS(myacim) || OUT_OF_BOUNDS(mycoef1)||
|
||||
|
@ -1028,6 +1030,8 @@ static int do_set(char *configfilename)
|
|||
mycoefs.coef7 = mycoef7;
|
||||
mycoefs.coef8 = mycoef8;
|
||||
|
||||
if (debug >= 2)
|
||||
printf("fxotune: set channel %d\n", mydahdi);
|
||||
fd = channel_open(mydahdi);
|
||||
if (fd < 0) {
|
||||
return -1;
|
||||
|
@ -1187,6 +1191,7 @@ int main(int argc , char **argv)
|
|||
{
|
||||
int startdev = 1; /* -b */
|
||||
int stopdev = 252; /* -e */
|
||||
int dev_range = 0; /* false */
|
||||
int calibtype = 2; /* -t */
|
||||
int waveformtype = -1; /* -w multi-tone by default. If > 0, single tone of specified frequency */
|
||||
int delaytosilence = 0; /* -l */
|
||||
|
@ -1228,9 +1233,11 @@ int main(int argc , char **argv)
|
|||
continue;
|
||||
case 'b':
|
||||
startdev = moreargs ? atoi(argv[++i]) : startdev;
|
||||
dev_range = 1;
|
||||
break;
|
||||
case 'e':
|
||||
stopdev = moreargs ? atoi(argv[++i]) : stopdev;
|
||||
dev_range = 1;
|
||||
break;
|
||||
case 't':
|
||||
calibtype = moreargs ? atoi(argv[++i]) : calibtype;
|
||||
|
@ -1300,13 +1307,13 @@ int main(int argc , char **argv)
|
|||
if (docalibrate){
|
||||
res = do_calibrate(startdev, stopdev, calibtype, configfile, dialstr, delaytosilence, silencegoodfor);
|
||||
if (!res)
|
||||
return do_set(configfile);
|
||||
return do_set(configfile, dev_range, startdev, stopdev);
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (doset)
|
||||
return do_set(configfile);
|
||||
return do_set(configfile, dev_range, startdev, stopdev);
|
||||
|
||||
if (dodump){
|
||||
res = do_dump(startdev, dialstr, delaytosilence, silencegoodfor, waveformtype);
|
||||
|
|
|
@ -1,70 +0,0 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# /usr/share/dahdi/handle_device
|
||||
#
|
||||
# Called by UDEV when a dahdi device is added/removed
|
||||
#
|
||||
|
||||
me=`basename $0`
|
||||
dir=`dirname $0`
|
||||
LOGGER="logger -i -t '$me'"
|
||||
NAME=`basename "$DEVPATH" | tr -c 'A-Za-z0-9-' '_'`
|
||||
|
||||
# Always redirect stderr somewhere, otherwise the shell script will die
|
||||
# when it tries to do I/O related stuff on closed file descriptor.
|
||||
# Our default is to throw it down the bit-bucket.
|
||||
exec 2> /dev/null
|
||||
# If you wish to trace this script:
|
||||
#exec 2> "/tmp/${me}.$NAME" 1>&2
|
||||
#exec 2> /dev/console
|
||||
|
||||
# Our directory in the beginning, so we can use local lab setup
|
||||
PATH="$dir:/usr/sbin:/sbin:/usr/bin:/bin"
|
||||
|
||||
set -e
|
||||
|
||||
#echo >&2 "$0($ACTION): DEBUG($# args): '$*'"
|
||||
|
||||
# Check if we can safely do our job
|
||||
if [ ! -f /sys/module/dahdi/parameters/auto_assign_spans ]; then
|
||||
echo "Old driver (no auto_assign_spans parameter). Skip $DEVPATH" | $LOGGER
|
||||
exit 0
|
||||
fi
|
||||
if [ `cat /sys/module/dahdi/parameters/auto_assign_spans` -eq 1 ]; then
|
||||
echo "auto_assign_spans=1. Skip $DEVPATH" | $LOGGER
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Can we pass a different value so we can use
|
||||
# alternate (testing) configuration?
|
||||
# Meanwhile, make it hard-coded.
|
||||
DAHDICONFDIR='/etc/dahdi'
|
||||
export DAHDICONFDIR
|
||||
|
||||
case "$ACTION" in
|
||||
add)
|
||||
echo "$ACTION: $DEVPATH" | $LOGGER
|
||||
# Can have alternate dahdi configuration directory for debugging
|
||||
# export DAHDICONFDIR="/tmp/xortel/dahdi"
|
||||
|
||||
# Don't block udev for too long
|
||||
(
|
||||
if [ -r "$DAHDICONFDIR/span-types.conf" ]; then
|
||||
span_types set "/sys$DEVPATH"
|
||||
fi
|
||||
if [ -r "$DAHDICONFDIR/pinned-spans.conf" ]; then
|
||||
span_assignments add "/sys$DEVPATH"
|
||||
else
|
||||
# No configuration. No order guaranteed
|
||||
span_assignments auto
|
||||
fi
|
||||
) 2>&1 < /dev/null | $LOGGER &
|
||||
;;
|
||||
remove)
|
||||
# Nothing to do yet...
|
||||
echo "$ACTION: $DEVPATH" | $LOGGER
|
||||
;;
|
||||
*)
|
||||
echo "UNHANDLED: $ACTION: $DEVPATH" | $LOGGER
|
||||
;;
|
||||
esac
|
|
@ -40,7 +40,7 @@
|
|||
#define RANDOM "/dev/urandom" /* Not genuinely random */
|
||||
/* #define RANDOM "/dev/random" */ /* Quite genuinely random */
|
||||
|
||||
int myread(int fd, char *buf, int len)
|
||||
int myread(int fd, unsigned char *buf, int len)
|
||||
{
|
||||
int sofar;
|
||||
int res;
|
||||
|
|
|
@ -107,13 +107,12 @@ static struct fasthdlc_state fs;
|
|||
|
||||
void send_packet(unsigned char *buf, int len)
|
||||
{
|
||||
int res;
|
||||
int x;
|
||||
unsigned char outbuf[BLOCK_SIZE];
|
||||
int pos=0;
|
||||
unsigned int fcs = PPP_INITFCS;
|
||||
if (hdlcmode)
|
||||
res = write(fd, buf, len + 2);
|
||||
write(fd, buf, len + 2);
|
||||
else {
|
||||
for (x=0;x<len;x++) {
|
||||
if (fasthdlc_tx_load(&fs, buf[x]))
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
nobase_dist_dahditools_SCRIPTS = \
|
||||
dahdi_handle_device \
|
||||
dahdi_span_config \
|
||||
dahdi_auto_assign_compat \
|
||||
span_config.d/10-dahdi-cfg \
|
||||
span_config.d/20-fxotune \
|
||||
span_config.d/50-asterisk \
|
||||
handle_device.d/10-span-types \
|
||||
handle_device.d/20-span-assignments \
|
||||
#
|
|
@ -0,0 +1,30 @@
|
|||
#! /bin/sh
|
||||
|
||||
devdir='/sys/bus/dahdi_devices/devices'
|
||||
|
||||
# DAHDI is loaded?
|
||||
if [ ! -d "$devdir" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
devices_by_registration_time() {
|
||||
grep -H '' $devdir/*/registration_time 2>/dev/null | \
|
||||
sed 's,/registration_time:,\t,' | \
|
||||
sort -k 2,2
|
||||
}
|
||||
|
||||
# First assign non-Astribank devices
|
||||
devices_by_registration_time | \
|
||||
grep -v '/astribanks:' | \
|
||||
while read devpath time; do
|
||||
echo >&2 "D: auto '$devpath'"
|
||||
dahdi_span_assignments auto "$devpath"
|
||||
done
|
||||
|
||||
# Now handle Astribanks
|
||||
unmatched="`dahdi_span_assignments unmatched`"
|
||||
if [ -n "$unmatched" ]; then
|
||||
# Only if astribanks are not matched in span-assignments.conf
|
||||
# TODO: have dahdi_registration run only on "$unmatched"
|
||||
LC_ALL=C dahdi_registration -Rv on
|
||||
fi
|
|
@ -0,0 +1,87 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# /usr/share/dahdi/dahdi_handle_device
|
||||
#
|
||||
# Called by UDEV when a dahdi device is added/removed
|
||||
#
|
||||
|
||||
me=`basename $0`
|
||||
dir=`dirname $0`
|
||||
LOGGER="logger -i -t '$me'"
|
||||
NAME=`basename "$DEVPATH" | tr -c 'A-Za-z0-9-' '_'`
|
||||
|
||||
# Always redirect stderr somewhere, otherwise the shell script will die
|
||||
# when it tries to do I/O related stuff on closed file descriptor.
|
||||
# Our default is to throw it down the bit-bucket.
|
||||
exec 2> /dev/null
|
||||
# If you wish to trace this script:
|
||||
#exec 2> "/tmp/${me}.$NAME" 1>&2
|
||||
#exec 2> /dev/console
|
||||
|
||||
# Our directory in the beginning, so we can use local lab setup
|
||||
PATH="$dir:/usr/sbin:/sbin:/usr/bin:/bin"
|
||||
export PATH
|
||||
|
||||
set -e
|
||||
|
||||
#echo >&2 "$0($ACTION): DEBUG($# args): '$*'"
|
||||
|
||||
# Do we have a configuration?
|
||||
if [ -f /etc/dahdi/init.conf ]; then
|
||||
. /etc/dahdi/init.conf
|
||||
fi
|
||||
|
||||
if [ "$DAHDI_UDEV_DISABLE_DEVICES" = 'yes' ]; then
|
||||
echo "DAHDI_UDEV_DISABLE_DEVICES=yes. Skip $DEVPATH" | $LOGGER
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Can we pass a different value so we can use
|
||||
# alternate (testing) configuration?
|
||||
# Meanwhile, make it hard-coded.
|
||||
DAHDICONFDIR='/etc/dahdi'
|
||||
export DAHDICONFDIR
|
||||
|
||||
run_parts() {
|
||||
# Have our internal "run-parts" (adapted from Fedora),
|
||||
# as implementations differ
|
||||
for i in `LC_ALL=C; ls -d $dir/handle_device.d/*[!~,] 2>/dev/null` ; do
|
||||
[ -d "$i" ] && continue
|
||||
[ ! -x "$i" ] && continue
|
||||
# Don't run *.{rpmsave,rpmorig,rpmnew,swp,cfsaved} files
|
||||
case "$i" in
|
||||
*.cfsaved|*.rpmsave|*.rpmorig|*.rpmnew|*.swp|*,v)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
echo "D: Running '$i'"
|
||||
"$i"
|
||||
done
|
||||
}
|
||||
|
||||
case "$ACTION" in
|
||||
add)
|
||||
echo "$ACTION: $DEVPATH" | $LOGGER
|
||||
|
||||
# Check if we can safely do our job
|
||||
if [ ! -f /sys/module/dahdi/parameters/auto_assign_spans ]; then
|
||||
echo "Old driver (no auto_assign_spans parameter). Skip $DEVPATH" | $LOGGER
|
||||
exit 0
|
||||
fi
|
||||
if [ `cat /sys/module/dahdi/parameters/auto_assign_spans` -ne 0 ]; then
|
||||
echo "auto_assign_spans=1. Skip $DEVPATH" | $LOGGER
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Background run -- don't block udev
|
||||
run_parts 2>&1 < /dev/null | $LOGGER &
|
||||
;;
|
||||
remove)
|
||||
echo "$ACTION: $DEVPATH" | $LOGGER
|
||||
# Background run -- don't block udev
|
||||
run_parts 2>&1 < /dev/null | $LOGGER &
|
||||
;;
|
||||
*)
|
||||
echo "UNHANDLED: $ACTION: $DEVPATH" | $LOGGER
|
||||
;;
|
||||
esac
|
|
@ -0,0 +1,97 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# /usr/share/dahdi/dahdi_span_config
|
||||
#
|
||||
# Called by UDEV when a dahdi span is added/removed
|
||||
#
|
||||
|
||||
me=`basename $0`
|
||||
dir=`dirname $0`
|
||||
LOGGER="logger -i -t '$me'"
|
||||
NAME=`basename "$DEVPATH" | tr -c 'A-Za-z0-9-' '_'`
|
||||
|
||||
exec 2> /dev/null
|
||||
# Always redirect stderr somewhere, otherwise the shell script will die
|
||||
# when it tries to do I/O related stuff on closed file descriptor.
|
||||
# Our default is to throw it down the bit-bucket.
|
||||
#exec 2> /dev/console
|
||||
## If you wish to trace this script:
|
||||
#exec 2> "/tmp/${me}.$NAME" 1>&2
|
||||
|
||||
# Our directory in the beginning, so we can use local lab setup
|
||||
PATH="$dir:/usr/sbin:/sbin:/usr/bin:/bin"
|
||||
export PATH
|
||||
|
||||
set -e
|
||||
|
||||
#echo >&2 "$0($ACTION): DEBUG($# args): '$*'"
|
||||
|
||||
# Do we have a configuration?
|
||||
if [ -f /etc/dahdi/init.conf ]; then
|
||||
. /etc/dahdi/init.conf
|
||||
fi
|
||||
|
||||
if [ "$DAHDI_UDEV_DISABLE_SPANS" = 'yes' ]; then
|
||||
echo "DAHDI_UDEV_DISABLE_SPANS=yes. Skip $DEVPATH" | $LOGGER
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Can we pass a different value so we can use
|
||||
# alternate (testing) configuration?
|
||||
# Meanwhile, make it hard-coded.
|
||||
DAHDICONFDIR='/etc/dahdi'
|
||||
export DAHDICONFDIR
|
||||
|
||||
run_parts() {
|
||||
# Have our internal "run-parts" (adapted from Fedora),
|
||||
# as implementations differ
|
||||
for i in `LC_ALL=C; ls -d $dir/span_config.d/*[!~,] 2>/dev/null` ; do
|
||||
[ -d "$i" ] && continue
|
||||
[ ! -x "$i" ] && continue
|
||||
# Don't run *.{rpmsave,rpmorig,rpmnew,swp,cfsaved} files
|
||||
case "$i" in
|
||||
*.cfsaved|*.rpmsave|*.rpmorig|*.rpmnew|*.swp|*,v)
|
||||
continue
|
||||
;;
|
||||
esac
|
||||
#echo "D: Running '$i'"
|
||||
"$i"
|
||||
done
|
||||
}
|
||||
|
||||
case "$ACTION" in
|
||||
add)
|
||||
echo "$ACTION: $DEVPATH" | $LOGGER
|
||||
|
||||
# Old driver. These scripts probably won't work anyway.
|
||||
if [ ! -f /sys/module/dahdi/parameters/auto_assign_spans ]; then
|
||||
if [ -f /sys/module/dahdi ]; then
|
||||
$LOGGER "Old driver (no auto_assign_spans parameter). Skip $DEVPATH"
|
||||
exit 0
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ $(cat /sys/module/dahdi/parameters/auto_assign_spans) -ne 0 ]; then
|
||||
$LOGGER "auto_assign_spans=1. Skip $DEVPATH"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Set variables
|
||||
span_devpath="/sys$DEVPATH"
|
||||
SPANNO=`echo "$span_devpath" | sed 's,.*/span-,,'`
|
||||
BASECHAN=`cat "$span_devpath/basechan"`
|
||||
CHANNELS=`cat "$span_devpath/channels"`
|
||||
ENDCHAN=`expr "$BASECHAN" + "$CHANNELS" - 1`
|
||||
export SPANNO BASECHAN CHANNELS ENDCHAN
|
||||
# Background run -- don't block udev
|
||||
run_parts 2>&1 < /dev/null | $LOGGER &
|
||||
;;
|
||||
remove|online|offline)
|
||||
# Nothing to do yet...
|
||||
echo "$ACTION: $DEVPATH" | $LOGGER
|
||||
;;
|
||||
*)
|
||||
echo "UNHANDLED: $ACTION: $DEVPATH" | $LOGGER
|
||||
;;
|
||||
esac
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
#! /bin/sh
|
||||
|
||||
case "$ACTION" in
|
||||
add)
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
esac
|
||||
|
||||
if [ -r "$DAHDICONFDIR/span-types.conf" ]; then
|
||||
dahdi_span_types set "/sys$DEVPATH"
|
||||
fi
|
|
@ -0,0 +1,15 @@
|
|||
#! /bin/sh
|
||||
|
||||
case "$ACTION" in
|
||||
add)
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
esac
|
||||
|
||||
# For now, handle only spans in assigned-spans.conf
|
||||
# We leave other cases to /etc/init.d/dahdi, so
|
||||
# legacy ordering can be preserved.
|
||||
if [ -r "$DAHDICONFDIR/assigned-spans.conf" ]; then
|
||||
dahdi_span_assignments add "/sys$DEVPATH"
|
||||
fi
|
|
@ -0,0 +1,18 @@
|
|||
#! /bin/sh
|
||||
|
||||
# Run xpp_sync whenever an Astribank is connected.
|
||||
|
||||
# May be set in /etc/dahdi/init.conf
|
||||
XPP_SYNC=${XPP_SYNC:-auto}
|
||||
|
||||
case "$ACTION" in
|
||||
add) ;;
|
||||
*) exit 0 ;;
|
||||
esac
|
||||
|
||||
case "${DEVPATH##*/}" in
|
||||
astribanks:*) ;;
|
||||
*) exit 0 ;;
|
||||
esac
|
||||
|
||||
xpp_sync "$XPP_SYNC"
|
|
@ -0,0 +1,28 @@
|
|||
#! /bin/sh
|
||||
|
||||
if [ "$ACTION" != 'add' ]; then
|
||||
# Nothing to do here
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Sanity check
|
||||
checkit=`"dahdi_cfg" --help 2>&1 | grep -- '-S' | wc -l`
|
||||
if [ "$checkit" != 1 ]; then
|
||||
echo "Bad dahdi_cfg (no -S support). Skipping"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
run_dahdi_cfg() {
|
||||
echo "dahdi_cfg: span $SPANNO <$BASECHAN-$ENDCHAN> ($DEVPATH)"
|
||||
dahdi_cfg -c "$cfg_file" -S "$SPANNO" -C "$BASECHAN-$ENDCHAN"
|
||||
}
|
||||
|
||||
# Configure DAHDI
|
||||
cfg_file="$DAHDICONFDIR/system.conf"
|
||||
if [ -r "$cfg_file" ]; then
|
||||
run_dahdi_cfg
|
||||
else
|
||||
echo "Using auto-generated config for dahdi_cfg"
|
||||
cfg_file='-'
|
||||
DAHDI_CONF_FILE="$cfg_file" dahdi_genconf system | run_dahdi_cfg
|
||||
fi
|
|
@ -0,0 +1,12 @@
|
|||
#! /bin/sh
|
||||
|
||||
if [ "$ACTION" != 'add' ]; then
|
||||
# Nothing to do here
|
||||
exit 0
|
||||
fi
|
||||
|
||||
fxotune_cfg='/etc/fxotune.conf'
|
||||
if [ -r "$fxotune_cfg" ]; then
|
||||
echo "fxotune: span $SPANNO <$BASECHAN-$ENDCHAN> ($DEVPATH)"
|
||||
fxotune -s -b "$BASECHAN" -e "$ENDCHAN"
|
||||
fi
|
|
@ -0,0 +1,14 @@
|
|||
#! /bin/sh
|
||||
|
||||
# This file, if installed under /usr/share/dahdi/span_config.d/ , will
|
||||
# attempt to add a newly-generated span to a running copy of Asterisk.
|
||||
# Asterisk has to be running (if not: it will pick the span on its
|
||||
# startup), and has to have the channels already configured.
|
||||
|
||||
if [ "$ACTION" != 'add' ]; then
|
||||
# Nothing to do here
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Add to asterisk
|
||||
asterisk -rx "dahdi create channels $BASECHAN $ENDCHAN"
|
|
@ -17,3 +17,8 @@
|
|||
#XPP_FIRMWARE_DIR=/usr/share/dahdi
|
||||
#XPP_HOTPLUG_DISABLED=yes
|
||||
#XPP_HOTPLUG_DAHDI=yes
|
||||
#ASTERISK_SUPPORTS_DAHDI_HOTPLUG=yes
|
||||
|
||||
# Disable udev handling:
|
||||
#DAHDI_UDEV_DISABLE_DEVICES=yes
|
||||
#DAHDI_UDEV_DISABLE_SPANS=yes
|
||||
|
|
|
@ -30,8 +30,6 @@ DOWNLOAD=@DOWNLOAD@
|
|||
DAHDI_DEVMODE=@DAHDI_DEVMODE@
|
||||
DAHDI_DECLARATION_AFTER_STATEMENT=@DAHDI_DECLARATION_AFTER_STATEMENT@
|
||||
|
||||
DAHDI_PINNED=@DAHDI_PINNED@
|
||||
|
||||
PBX_NEWT=@PBX_NEWT@
|
||||
NEWT_LIB=@NEWT_LIB@
|
||||
NEWT_INCLUDE=@NEWT_INCLUDE@
|
||||
|
|
|
@ -15,6 +15,8 @@ wct4xxp
|
|||
|
||||
# Digium TE435
|
||||
# Digium TE235
|
||||
# Digium TE436
|
||||
# Digium TE236
|
||||
wcte43x
|
||||
|
||||
# Digium TE120P: PCI single-port T1/E1/J1
|
||||
|
@ -24,6 +26,8 @@ wcte12xp
|
|||
|
||||
# Digium TE131: PCI-Express single-port T1/E1/J1
|
||||
# Digium TE132: PCI single-port T1/E1/J1
|
||||
# Digium TE133: PCI-Express single-port T1/E1/J1 with hardware echocan
|
||||
# Digium TE134: PCI single-port T1/E1/J1 with hardware echocan
|
||||
wcte13xp
|
||||
|
||||
# Digium T100P: PCI single-port T1
|
||||
|
@ -49,6 +53,10 @@ wcfxo
|
|||
wctdm
|
||||
|
||||
# Digium B410P: 4 NT/TE BRI ports
|
||||
# Digium B433P: 4 NT/TE BRI ports pci-e
|
||||
# Digium B434P: 4 NT/TE BRI ports
|
||||
# Digium B233P: 2 NT/TE BRI ports pci-e
|
||||
# Digium B234P: 2 NT/TE BRI ports
|
||||
wcb4xxp
|
||||
|
||||
# Digium TC400B: G729 / G723 Transcoding Engine
|
||||
|
|
2
patgen.c
2
patgen.c
|
@ -45,7 +45,6 @@
|
|||
#define BLOCK_SIZE 2041
|
||||
#define DEVICE "/dev/dahdi/channel"
|
||||
|
||||
static const char rcsid[] = "$Id$";
|
||||
char *prog_name;
|
||||
|
||||
static void usage(void)
|
||||
|
@ -53,7 +52,6 @@ static void usage(void)
|
|||
fprintf(stderr, "Usage: %s <dahdi_chan>\n", prog_name);
|
||||
fprintf(stderr, " e.g.: %s /dev/dahdi/55\n", prog_name);
|
||||
fprintf(stderr, " %s 455\n", prog_name);
|
||||
fprintf(stderr, "%s version %s\n", prog_name, rcsid);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
|
@ -168,6 +168,7 @@ int main(int argc, char *argv[])
|
|||
int opt;
|
||||
int oldstyle_cmdline = 1;
|
||||
unsigned int event_count = 0;
|
||||
time_t start_time = 0;
|
||||
|
||||
/* Parse the command line arguments */
|
||||
while((opt = getopt(argc, argv, "b:s:t:r:v?h")) != -1) {
|
||||
|
@ -218,8 +219,6 @@ int main(int argc, char *argv[])
|
|||
if (oldstyle_cmdline && argc > optind +1) {
|
||||
timeout = strtoul(argv[optind+1], NULL, 10);
|
||||
}
|
||||
|
||||
time_t start_time = 0;
|
||||
|
||||
fd = channel_open(device, &bs);
|
||||
if (fd < 0)
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
#define BLOCK_SIZE 2039
|
||||
#define DEVICE "/dev/dahdi/channel"
|
||||
|
||||
static const char rcsid[] = "$Id$";
|
||||
char *prog_name;
|
||||
|
||||
static void usage(void)
|
||||
|
@ -52,7 +51,6 @@ static void usage(void)
|
|||
fprintf(stderr, "Usage: %s <dahdi_chan>\n", prog_name);
|
||||
fprintf(stderr, " e.g.: %s /dev/dahdi/55\n", prog_name);
|
||||
fprintf(stderr, " %s 455\n", prog_name);
|
||||
fprintf(stderr, "%s version %s\n", prog_name, rcsid);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
|
|
29
ppp/Makefile
29
ppp/Makefile
|
@ -1,29 +0,0 @@
|
|||
#COPTS = -O2 -g
|
||||
|
||||
-include ../makeopts
|
||||
|
||||
CFLAGS += $(COPTS) -fPIC
|
||||
LDFLAGS += -shared
|
||||
|
||||
INCLUDE_DIR = $(includedir)/pppd
|
||||
|
||||
LIBDIR = $(libdir)/pppd/$(PPPD_VERSION)
|
||||
|
||||
PLUGINS := dahdi.so
|
||||
|
||||
all: $(PLUGINS)
|
||||
|
||||
%.so: %.c
|
||||
ifeq (,$(PPPD_VERSION))
|
||||
@echo "pppd version not found (in patchlevel.h)."
|
||||
@echo "Install ppp source/headers and/or ./configure --with-ppp=PATH."
|
||||
exit 1
|
||||
endif
|
||||
$(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS)
|
||||
|
||||
install: $(PLUGINS)
|
||||
$(INSTALL) -d $(DESTDIR)$(LIBDIR)
|
||||
$(INSTALL) -m 0644 $? $(DESTDIR)$(LIBDIR)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.so *.a
|
|
@ -0,0 +1,7 @@
|
|||
plugindir = $(libdir)/pppd/$(PPPD_VERSION)
|
||||
plugin_LTLIBRARIES = dahdi.la
|
||||
|
||||
dahdi_la_CFLAGS = $(DAHDI_INCLUDE)
|
||||
dahdi_la_LDFLAGS = -module -avoid-version
|
||||
|
||||
CLEANFILES = dahdi.so
|
|
@ -8,6 +8,7 @@
|
|||
# * The <id> field may be either:
|
||||
# hardware_id
|
||||
# @location
|
||||
# devpath (in sysfs)
|
||||
# * The <local_spanno> is the relative span number
|
||||
# in the device (starting from 1)
|
||||
# In this filed globbing rules apply. E.g:
|
||||
|
@ -24,4 +25,4 @@
|
|||
|
||||
# Set the first two spans of an Astribank to T1. The
|
||||
# Astribanks is specified by its location instead of hardware_id
|
||||
#@pci0000:00/0000:00:03.3/usb1/1-5/xbus-01/astribanks:xbus-01 [12]:T1
|
||||
#@usb-0000:00:1d.7-3 [12]:T1
|
84
span_config
84
span_config
|
@ -1,84 +0,0 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# /usr/share/dahdi/span_config
|
||||
#
|
||||
# Called by UDEV when a dahdi span is added/removed
|
||||
#
|
||||
|
||||
me=`basename $0`
|
||||
dir=`dirname $0`
|
||||
LOGGER="logger -i -t '$me'"
|
||||
NAME=`basename "$DEVPATH" | tr -c 'A-Za-z0-9-' '_'`
|
||||
|
||||
exec 2> /dev/null
|
||||
# Always redirect stderr somewhere, otherwise the shell script will die
|
||||
# when it tries to do I/O related stuff on closed file descriptor.
|
||||
# Our default is to throw it down the bit-bucket.
|
||||
#exec 2> /dev/console
|
||||
## If you wish to trace this script:
|
||||
#exec 2> "/tmp/${me}.$NAME" 1>&2
|
||||
|
||||
# Our directory in the beginning, so we can use local lab setup
|
||||
PATH="$dir:/usr/sbin:/sbin:/usr/bin:/bin"
|
||||
|
||||
set -e
|
||||
|
||||
#echo >&2 "$0($ACTION): DEBUG($# args): '$*'"
|
||||
|
||||
# Can we pass a different value so we can use
|
||||
# alternate (testing) configuration?
|
||||
# Meanwhile, make it hard-coded.
|
||||
DAHDICONFDIR='/etc/dahdi'
|
||||
export DAHDICONFDIR
|
||||
|
||||
run_dahdi_cfg() {
|
||||
echo "dahdi_cfg: span $spanno <$basechan-$endchan>"
|
||||
dahdi_cfg -c "$cfg_file" -S "$spanno" -C "$basechan-$endchan"
|
||||
}
|
||||
|
||||
configure_span() {
|
||||
span_devpath="$1"
|
||||
# Sanity check
|
||||
checkit=`"dahdi_cfg" --help 2>&1 | grep -- '-S' | wc -l`
|
||||
if [ "$checkit" != 1 ]; then
|
||||
echo "Bad dahdi_cfg (no -S support). Skipping"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Set variables
|
||||
spanno=`echo "$span_devpath" | sed 's,.*/span-,,'`
|
||||
basechan=`cat "$span_devpath/basechan"`
|
||||
channels=`cat "$span_devpath/channels"`
|
||||
endchan=`expr "$basechan" + "$channels" - 1`
|
||||
|
||||
# Configure DAHDI
|
||||
cfg_file="$DAHDICONFDIR/system.conf"
|
||||
if [ -r "$cfg_file" ]; then
|
||||
run_dahdi_cfg
|
||||
else
|
||||
echo "Using auto-generated config for dahdi_cfg"
|
||||
cfg_file='-'
|
||||
DAHDI_CONF_FILE="$cfg_file" dahdi_genconf system | run_dahdi_cfg
|
||||
fi
|
||||
|
||||
# Add to asterisk
|
||||
asterisk -rx "dahdi create channels $basechan $endchan"
|
||||
}
|
||||
|
||||
case "$ACTION" in
|
||||
add)
|
||||
echo "$ACTION: $DEVPATH" | $LOGGER
|
||||
# Can have alternate dahdi configuration directory for debugging
|
||||
# export DAHDICONFDIR="/tmp/xortel/dahdi"
|
||||
|
||||
configure_span "/sys$DEVPATH" 2>&1 | $LOGGER
|
||||
;;
|
||||
remove|online|offline)
|
||||
# Nothing to do yet...
|
||||
echo "$ACTION: $DEVPATH" | $LOGGER
|
||||
;;
|
||||
*)
|
||||
echo "UNHANDLED: $ACTION: $DEVPATH" | $LOGGER
|
||||
;;
|
||||
esac
|
||||
|
185
span_types
185
span_types
|
@ -1,185 +0,0 @@
|
|||
#! /bin/sh
|
||||
#
|
||||
# /usr/sbin/span_types
|
||||
#
|
||||
# This script can be used both from udev and
|
||||
# from the command line to manage PRI spans
|
||||
# type (E1/T1/J1).
|
||||
#
|
||||
# Span types can be set only *BEFORE* span are assigned.
|
||||
#
|
||||
# It reads a configuration file /etc/dahdi/span-types.conf
|
||||
# (the format is documented inside that file)
|
||||
#
|
||||
# A mandatory first argument is:
|
||||
# list - to show existing E1/T1/J1 types
|
||||
# dumpconfig - the same, but in a format (almost) suitable
|
||||
# for the configuration file
|
||||
# set - actually write the setting to the driver
|
||||
#
|
||||
# Examples:
|
||||
# span_types list
|
||||
# span_types dumpconfig
|
||||
# span_types set # all devices
|
||||
# span_types set /sys/bus/dahdi_devices/devices/astribanks:xbus-00
|
||||
#
|
||||
|
||||
|
||||
devbase='/sys/bus/dahdi_devices/devices'
|
||||
DAHDICONFDIR="${DAHDICONFDIR:-/etc/dahdi}"
|
||||
spantypes_conf="$DAHDICONFDIR/span-types.conf"
|
||||
|
||||
usage() {
|
||||
echo >&2 "Usage: $0 {list|dumpconfig|set} [devpath ...]"
|
||||
exit 1
|
||||
}
|
||||
|
||||
if [ "$#" -eq 0 ]; then
|
||||
usage
|
||||
fi
|
||||
action="$1"
|
||||
shift
|
||||
|
||||
if [ ! -d "$devbase" ]; then
|
||||
echo >&2 "$0: Missing '$devbase' (DAHDI driver unloaded?)"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Use given devices or otherwise, all existing devices
|
||||
if [ "$#" -gt 0 ]; then
|
||||
DEVICES="$@"
|
||||
else
|
||||
DEVICES=`echo $devbase/*`
|
||||
fi
|
||||
|
||||
show_spantypes() {
|
||||
echo "# PRI span types (E1/T1/J1)"
|
||||
for device in $DEVICES
|
||||
do
|
||||
hw_id=`cat "$device/hardware_id"`
|
||||
location='@'`cd "$device" && pwd -P | sed 's,/sys/devices/,,'`
|
||||
cat "$device/spantype" | while read st; do
|
||||
case "$st" in
|
||||
*:[ETJ]1)
|
||||
printf "%-10s %-20s %s\n" \
|
||||
"$st" "[$hw_id]" "$location"
|
||||
;;
|
||||
esac
|
||||
done | sort -n
|
||||
done
|
||||
}
|
||||
|
||||
dump_config() {
|
||||
echo '#'
|
||||
echo "# Autogenerated by $0 on `date`"
|
||||
echo "# Map PRI DAHDI devices to span types for E1/T1/J1"
|
||||
echo ''
|
||||
fmt="%-65s %s\n"
|
||||
printf "$fmt" '# @location/hardware_id' 'span_type'
|
||||
for device in $DEVICES
|
||||
do
|
||||
hw_id=`cat "$device/hardware_id"`
|
||||
location='@'`cd "$device" && pwd -P | sed 's,/sys/devices/,,'`
|
||||
if [ -n "$hw_id" ]; then
|
||||
id="$hw_id"
|
||||
else
|
||||
id="$location"
|
||||
fi
|
||||
#echo "# Device: [$hw_id] $location"
|
||||
cat "$device/spantype" | while read st; do
|
||||
case "$st" in
|
||||
*:[ETJ]1)
|
||||
printf "$fmt" "$id" "$st"
|
||||
;;
|
||||
*)
|
||||
#echo "# Skipped local span `echo $st | sed 's/:/ -- /'`"
|
||||
;;
|
||||
esac
|
||||
done | sort -n
|
||||
#echo ''
|
||||
done
|
||||
}
|
||||
|
||||
# Allow comments and empty lines in config file
|
||||
filter_conf() {
|
||||
sed -e 's/#.*//' -e '/^[ \t]*$/d' "$spantypes_conf"
|
||||
}
|
||||
|
||||
conf_spans() {
|
||||
hw_id="$1"
|
||||
location="$2"
|
||||
filter_conf | (
|
||||
# Collect device spans
|
||||
# in a subshell, so $SPANS is not lost
|
||||
SPANS=''
|
||||
while read id spans; do
|
||||
# GLOBBING
|
||||
case "$location" in
|
||||
$id)
|
||||
#echo >&2 "match($id): $spans"
|
||||
SPANS="$SPANS $spans"
|
||||
;;
|
||||
esac
|
||||
case "$hw_id" in
|
||||
$id)
|
||||
#echo >&2 "match([$id]): $spans"
|
||||
SPANS="$SPANS $spans"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
echo "$SPANS"
|
||||
)
|
||||
}
|
||||
|
||||
# Beware of special characters in attributes
|
||||
attr_clean() {
|
||||
cat "$1" | tr -d '\n' | tr '!' '/' | tr -c 'a-zA-Z0-9/:.-' '_'
|
||||
}
|
||||
|
||||
device_set_spantype() {
|
||||
device="$1"
|
||||
attr_file="$device/spantype"
|
||||
hw_id=`attr_clean "$device/hardware_id"`
|
||||
location='@'`cd "$device" && pwd -P | sed 's,/sys/devices/,,'`
|
||||
spanspecs=`conf_spans "$hw_id" "$location"`
|
||||
#echo >&2 "MATCHED($device): $spanspecs"
|
||||
cut -d: -f1 "$attr_file" | while read spanno; do
|
||||
for sp in $spanspecs
|
||||
do
|
||||
s=`echo "$sp" | cut -d: -f1`
|
||||
v=`echo "$sp" | cut -d: -f2`
|
||||
case "$spanno" in
|
||||
$s)
|
||||
#echo >&2 "conf($attr_file): $spanno:$v"
|
||||
echo "$spanno:$v" > "$attr_file"
|
||||
;;
|
||||
esac
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
set_spantypes() {
|
||||
if [ ! -f "$spantypes_conf" ]; then
|
||||
echo >&2 "$0: Missing configuration '$spantypes_conf'"
|
||||
exit 1
|
||||
fi
|
||||
for device in $DEVICES
|
||||
do
|
||||
device_set_spantype "$device"
|
||||
done
|
||||
}
|
||||
|
||||
case "$action" in
|
||||
list)
|
||||
show_spantypes
|
||||
;;
|
||||
dumpconfig)
|
||||
dump_config
|
||||
;;
|
||||
set)
|
||||
set_spantypes
|
||||
;;
|
||||
*)
|
||||
usage
|
||||
;;
|
||||
esac
|
|
@ -4,7 +4,7 @@
|
|||
# This file is parsed by the DAHDI Configurator, dahdi_cfg
|
||||
#
|
||||
# Span Configuration
|
||||
# ^^^^^^^^^^^^^^^^^^
|
||||
# ++++++++++++++++++
|
||||
# First come the span definitions, in the format
|
||||
#
|
||||
# span=<span num>,<timing source>,<line build out (LBO)>,<framing>,<coding>[,yellow]
|
||||
|
@ -69,7 +69,7 @@
|
|||
#span=3,0,0,ccs,hdb3,crc4
|
||||
#
|
||||
# Dynamic Spans
|
||||
# ^^^^^^^^^^^^^
|
||||
# +++++++++++++
|
||||
# Next come the dynamic span definitions, in the form:
|
||||
#
|
||||
# dynamic=<driver>,<address>,<numchans>,<timing>
|
||||
|
@ -87,7 +87,7 @@
|
|||
# have the non-zero value.
|
||||
#
|
||||
# Channel Configuration
|
||||
# ^^^^^^^^^^^^^^^^^^^^^
|
||||
# +++++++++++++++++++++
|
||||
# Next come the definitions for using the channels. The format is:
|
||||
# <device>=<channel list>
|
||||
#
|
||||
|
@ -111,17 +111,6 @@
|
|||
# Channel(s) are signalled using FXO Groundstart protocol.
|
||||
# fxoks::
|
||||
# Channel(s) are signalled using FXO Koolstart protocol.
|
||||
# sf::
|
||||
# Channel(s) are signalled using in-band single freq tone.
|
||||
# Syntax as follows:
|
||||
#
|
||||
# channel# => sf:<rxfreq>,<rxbw>,<rxflag>,<txfreq>,<txlevel>,<txflag>
|
||||
#
|
||||
# rxfreq is rx tone freq in Hz, rxbw is rx notch (and decode)
|
||||
# bandwith in hz (typically 10.0), rxflag is either 'normal' or
|
||||
# 'inverted', txfreq is tx tone freq in hz, txlevel is tx tone
|
||||
# level in dbm, txflag is either 'normal' or 'inverted'. Set
|
||||
# rxfreq or txfreq to 0.0 if that tone is not desired.
|
||||
#
|
||||
# unused::
|
||||
# No signalling is performed, each channel in the list remains idle
|
||||
|
@ -204,7 +193,7 @@
|
|||
#dacsrbs=1-24:48
|
||||
#
|
||||
# Tone Zone Data
|
||||
# ^^^^^^^^^^^^^^
|
||||
# ++++++++++++++
|
||||
# Finally, you can preload some tone zones, to prevent them from getting
|
||||
# overwritten by other users (if you allow non-root users to open /dev/dahdi/*
|
||||
# interfaces anyway. Also this means they won't have to be loaded at runtime.
|
||||
|
@ -232,7 +221,7 @@ loadzone = us
|
|||
defaultzone=us
|
||||
#
|
||||
# PCI Radio Interface
|
||||
# ^^^^^^^^^^^^^^^^^^^
|
||||
# +++++++++++++++++++
|
||||
# (see http://www.zapatatelephony.org/app_rpt.html)
|
||||
#
|
||||
# The PCI Radio Interface card interfaces up to 4 two-way radios (either
|
||||
|
@ -298,7 +287,7 @@ defaultzone=us
|
|||
#channels=1-4
|
||||
#
|
||||
# Overiding PCM encoding
|
||||
# ^^^^^^^^^^^^^^^^^^^^^^
|
||||
# ++++++++++++++++++++++
|
||||
# Usually the channel driver sets the encoding of the PCM for the
|
||||
# channel (mulaw / alaw. That is: g711u or g711a). However there are
|
||||
# some cases where you would like to override that. 'mulaw' and 'alaw'
|
||||
|
@ -313,7 +302,7 @@ defaultzone=us
|
|||
#deflaw=5
|
||||
#
|
||||
# Echo Cancellers
|
||||
# ^^^^^^^^^^^^^^^
|
||||
# +++++++++++++++
|
||||
# DAHDI uses modular echo cancellers that are configured per channel. The echo
|
||||
# cancellers are compiled and installed as part of the dahdi-linux package.
|
||||
# You can specify in this file the echo canceller to be used for each
|
||||
|
|
17
tonezone.c
17
tonezone.c
|
@ -89,18 +89,20 @@ static int build_tone(void *data, size_t size, struct tone_zone_sound *t, int *c
|
|||
int firstnobang = -1;
|
||||
int freq1, freq2, time;
|
||||
int modulate = 0;
|
||||
float db = 1.0;
|
||||
float gain;
|
||||
int used = 0;
|
||||
dup = strdup(t->data);
|
||||
s = strtok(dup, ",");
|
||||
while(s && strlen(s)) {
|
||||
/* Handle optional ! which signifies don't start here*/
|
||||
if (s[0] == '!')
|
||||
if (s[0] == '!') {
|
||||
s++;
|
||||
else if (firstnobang < 0) {
|
||||
} else if (firstnobang < 0) {
|
||||
PRINT_DEBUG("First no bang: %s\n", s);
|
||||
firstnobang = *count;
|
||||
}
|
||||
|
||||
if (sscanf(s, "%d+%d/%d", &freq1, &freq2, &time) == 3) {
|
||||
/* f1+f2/time format */
|
||||
PRINT_DEBUG("f1+f2/time format: %d, %d, %d\n", freq1, freq2, time);
|
||||
|
@ -118,6 +120,15 @@ static int build_tone(void *data, size_t size, struct tone_zone_sound *t, int *c
|
|||
} else if (sscanf(s, "%d/%d", &freq1, &time) == 2) {
|
||||
PRINT_DEBUG("f1/time format: %d, %d\n", freq1, time);
|
||||
freq2 = 0;
|
||||
} else if (sscanf(s, "%d@/%d", &freq1, &time) == 2) {
|
||||
/* The "@" character has been added to enable an
|
||||
* approximately -20db tone generation of any frequency This has been done
|
||||
* primarily to generate the Australian congestion tone.
|
||||
* Example: "425/375,0/375,425@/375,0/375"
|
||||
*/
|
||||
PRINT_DEBUG("f1 reduced amplitude/time format: %d, %d\n", freq1,time);
|
||||
db = 0.3;
|
||||
freq2 = 0;
|
||||
} else if (sscanf(s, "%d", &freq1) == 1) {
|
||||
PRINT_DEBUG("f1 format: %d\n", freq1);
|
||||
firstnobang = *count;
|
||||
|
@ -137,7 +148,7 @@ static int build_tone(void *data, size_t size, struct tone_zone_sound *t, int *c
|
|||
td = data;
|
||||
|
||||
/* Bring it down -8 dbm */
|
||||
gain = pow(10.0, (LEVEL - 3.14) / 20.0) * 65536.0 / 2.0;
|
||||
gain = db*(pow(10.0, (LEVEL - 3.14) / 20.0) * 65536.0 / 2.0);
|
||||
|
||||
td->fac1 = 2.0 * cos(2.0 * M_PI * (freq1 / 8000.0)) * 32768.0;
|
||||
td->init_v2_1 = sin(-4.0 * M_PI * (freq1 / 8000.0)) * gain;
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
/*
|
||||
* version.c.in
|
||||
*/
|
||||
|
||||
const char dahdi_tools_version[] = "DAHDI Tools Version - @TOOLSVERSION@";
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
# A dracut.conf(5) snippet
|
||||
# Disable loading the Astribank (xpp_usb) drivers. This is because
|
||||
# it relies on files in the root filesystem:
|
||||
# See https://issues.asterisk.org/jira/browse/DAHLIN-352
|
||||
omit_drivers+=" xpp_usb "
|
173
xpp/Makefile
173
xpp/Makefile
|
@ -1,173 +0,0 @@
|
|||
PEDANTIC = -ansi -pedantic -std=c99
|
||||
|
||||
INSTALL = install
|
||||
INSTALL_DATA = install -m 644
|
||||
|
||||
#
|
||||
# Ugly hack to find kernel directories before/after the split
|
||||
# to kernel/user-space.
|
||||
#
|
||||
# These variables should be passed to us. But until then...
|
||||
#
|
||||
DAHDI_TOOLSDIR ?= ..
|
||||
DAHDI_KERNELDIR =
|
||||
|
||||
-include $(DAHDI_TOOLSDIR)/makeopts
|
||||
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
|
||||
# In 1.4 those are provided by autoconf through makeopts
|
||||
prefix ?= /usr
|
||||
datadir ?= $(prefix)/share
|
||||
mandir ?= $(datadir)/man
|
||||
INSTALL ?= install
|
||||
|
||||
INSTALL_DATA = $(INSTALL) -m 644
|
||||
|
||||
SBINDIR = $(prefix)/sbin
|
||||
DATADIR = $(datadir)/dahdi
|
||||
MANDIR = $(mandir)/man8
|
||||
HOTPLUG_USB_DIR = $(sysconfdir)/hotplug/usb
|
||||
PERLLIBDIR := $(shell eval `perl -V:sitelib`; echo "$$sitelib")
|
||||
PERL_DIRS := $(shell cd perl_modules; find * -name '[A-Z]*' -type d| xargs)
|
||||
PERL_MODS_PAT := *.pm $(PERL_DIRS:%=%/*.pm)
|
||||
PERL_MODS := $(shell cd perl_modules; echo $(PERL_MODS_PAT))
|
||||
|
||||
# Variables that should be defined above, but need sane defaults:
|
||||
# FIXME: Are those values really sane?
|
||||
HOSTCC ?= $(CC)
|
||||
|
||||
USE_OCTASIC := yes
|
||||
OCTASIC_DIR := oct612x
|
||||
|
||||
ifneq (no,$(USE_OCTASIC))
|
||||
|
||||
OCT_OBJS = $(shell $(OCTASIC_DIR)/octasic-helper objects $(OCTASIC_DIR))
|
||||
OCT_SRCS = $(shell echo $(OCT_OBJS) | tr -s ' ' '\n' | sed 's/\.o$$/.c/g')
|
||||
OCT_HERE_OBJS = $(shell echo $(OCT_OBJS) | tr -s ' ' '\n' | sed 's,^.*/,,')
|
||||
OCT_CFLAGS = $(shell $(OCTASIC_DIR)/octasic-helper cflags $(OCTASIC_DIR))
|
||||
OCT_DEFINES = \
|
||||
-DPTR_TYPE=uint32_t \
|
||||
-DcOCT6100_INTERNAL_SUPER_ARRAY_SIZE=1024 \
|
||||
-DcOCT6100_MAX_ECHO_CHANNELS=672 \
|
||||
-DcOCT6100_MAX_MIXER_EVENTS=1344
|
||||
|
||||
ECHO_LOADER = echo_loader.o
|
||||
endif
|
||||
|
||||
%.8: %
|
||||
pod2man --section 8 $^ > $@ || $(RM) $@
|
||||
PERL_SCRIPTS = \
|
||||
dahdi_registration \
|
||||
xpp_sync \
|
||||
lsdahdi \
|
||||
xpp_blink \
|
||||
dahdi_genconf \
|
||||
dahdi_hardware \
|
||||
twinstar \
|
||||
#
|
||||
|
||||
PERL_MANS = $(PERL_SCRIPTS:%=%.8)
|
||||
|
||||
XTALK_OBJS = xtalk/xtalk.o xtalk/xusb.o xtalk/xlist.o xtalk/debug.o
|
||||
ASTRIBANK_OBJS = astribank_usb.o mpptalk.o $(XTALK_OBJS)
|
||||
|
||||
ABHEXLOAD_OBJS = astribank_hexload.o hexfile.o pic_loader.o $(ECHO_LOADER) $(ASTRIBANK_OBJS) $(OCT_HERE_OBJS)
|
||||
ABTOOL_OBJS = astribank_tool.o $(ASTRIBANK_OBJS)
|
||||
ABALLOW_OBJS = astribank_allow.o astribank_license.o $(ASTRIBANK_OBJS)
|
||||
|
||||
TARGETS = .perlcheck astribank_is_starting
|
||||
PROG_INSTALL = astribank_is_starting
|
||||
MAN_INSTALL = $(PROG_INSTALL:%=%.8)
|
||||
ifeq (1,$(PBX_USB))
|
||||
TARGETS += \
|
||||
astribank_tool \
|
||||
astribank_hexload \
|
||||
astribank_allow \
|
||||
test_parse
|
||||
PROG_INSTALL += astribank_tool astribank_hexload astribank_allow
|
||||
endif
|
||||
ifneq (,$(PERLLIBDIR))
|
||||
PROG_INSTALL += $(PERL_SCRIPTS)
|
||||
TARGETS += $(PERL_MANS)
|
||||
endif
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
docs: $(PERL_MANS)
|
||||
|
||||
install: all
|
||||
$(INSTALL) -d $(DESTDIR)$(SBINDIR)
|
||||
$(INSTALL) $(PROG_INSTALL) $(DESTDIR)$(SBINDIR)/
|
||||
$(INSTALL) -d $(DESTDIR)$(DATADIR)
|
||||
$(INSTALL) xpp_fxloader astribank_hook $(DESTDIR)$(DATADIR)/
|
||||
$(INSTALL) waitfor_xpds $(DESTDIR)$(DATADIR)/
|
||||
$(INSTALL) -d $(DESTDIR)$(MANDIR)
|
||||
$(INSTALL_DATA) $(MAN_INSTALL) $(DESTDIR)$(MANDIR)/
|
||||
$(INSTALL) -d $(DESTDIR)$(HOTPLUG_USB_DIR)
|
||||
$(INSTALL_DATA) xpp_fxloader.usermap $(DESTDIR)$(HOTPLUG_USB_DIR)/
|
||||
# for backward compatibility and for hotplug users:
|
||||
ln -sf $(DATADIR)/xpp_fxloader $(DESTDIR)$(HOTPLUG_USB_DIR)/
|
||||
ifneq (,$(PERLLIBDIR))
|
||||
$(INSTALL) -d $(DESTDIR)$(PERLLIBDIR)
|
||||
for i in $(PERL_DIRS); \
|
||||
do \
|
||||
$(INSTALL) -d "$(DESTDIR)$(PERLLIBDIR)/$$i"; \
|
||||
done
|
||||
for i in $(PERL_MODS); \
|
||||
do \
|
||||
$(INSTALL_DATA) "perl_modules/$$i" "$(DESTDIR)$(PERLLIBDIR)/$$i"; \
|
||||
done
|
||||
endif
|
||||
|
||||
CFLAGS += -I. -Ixtalk
|
||||
|
||||
astribank_hexload: $(ABHEXLOAD_OBJS)
|
||||
astribank_hexload: LIBS+=$(EXTRA_LIBS) $(USB_LIB)
|
||||
astribank_hexload: CFLAGS+=$(OCT_CFLAGS)
|
||||
|
||||
astribank_tool: $(ABTOOL_OBJS)
|
||||
astribank_tool: LIBS+=$(EXTRA_LIBS) $(USB_LIB)
|
||||
|
||||
astribank_allow: $(ABALLOW_OBJS)
|
||||
astribank_allow: LIBS+=$(EXTRA_LIBS) $(USB_LIB)
|
||||
|
||||
astribank_is_starting: astribank_is_starting.o
|
||||
astribank_is_starting: LIBS+=$(EXTRA_LIBS)
|
||||
|
||||
hex2iic: hex2iic.o iic.o hexfile.o
|
||||
|
||||
test_parse: test_parse.o hexfile.o
|
||||
test_parse: LIBS+=$(EXTRA_LIBS) $(USB_LIB)
|
||||
|
||||
ifneq (no,$(USE_OCTASIC))
|
||||
.octasic.depend: $(OCTASIC_DIR)/octasic-helper Makefile ../config.status
|
||||
$(CC) -MM $(OCT_CFLAGS) \
|
||||
`$(OCTASIC_DIR)/octasic-helper objects | \
|
||||
tr -s ' ' '\n' | \
|
||||
sed -e 's,.*,$(OCTASIC_DIR)/&,' -e 's/\.o$$/.c/'` > $@
|
||||
|
||||
-include .octasic.depend
|
||||
|
||||
$(OCT_HERE_OBJS): Makefile
|
||||
$(CC) -c $(CFLAGS) $(OCT_CFLAGS) $(OCT_DEFINES) $(OCT_SRCS)
|
||||
|
||||
endif
|
||||
|
||||
|
||||
%: %.o
|
||||
$(CC) $(LDFLAGS) $^ $(LIBS) -o $@
|
||||
|
||||
.perlcheck: $(PERL_SCRIPTS)
|
||||
for i in $^; do perl -I./perl_modules -c $$i || exit 1; done
|
||||
touch $@
|
||||
|
||||
clean:
|
||||
$(RM) .depend .octasic.depend *.o xtalk/*.o $(OCT_HERE_OBJS) $(TARGETS)
|
||||
|
||||
.PHONY: depend
|
||||
depend: .depend
|
||||
.depend: *.c *.h xtalk/*.c xtalk/*.h
|
||||
@$(CC) $(CFLAGS) -MM *.c xtalk/*.c > $@ || rm -f $@
|
||||
|
||||
include .depend
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue