summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Vroon <chainsaw@gentoo.org>2011-04-21 12:16:34 +0000
committerTony Vroon <chainsaw@gentoo.org>2011-04-21 12:16:34 +0000
commit9083b2032245c1dd36434b4cbf077c64d1b87b8d (patch)
tree30754aef6aa27af0bc197fcb78b6b33c46b2fcfd /net-misc/dahdi-tools
parentLast rites for gnustep-libs/camaelon and x11-themes/camaelon-themes (diff)
downloadgentoo-2-9083b2032245c1dd36434b4cbf077c64d1b87b8d.tar.gz
gentoo-2-9083b2032245c1dd36434b4cbf077c64d1b87b8d.tar.bz2
gentoo-2-9083b2032245c1dd36434b4cbf077c64d1b87b8d.zip
Maintenance release, adds support for kernels up to 2.6.38 and increases compatibility with systems that can not support read-line multiple PCI commands. Additional initscripts by Jaco Kroon, closes bug #328143. Compile & install additional binaries, also by Jaco Kroon, closes bug #337472. With thanks to Oliver Jaksch for alerting me to the new version in bug #357311.
(Portage version: 2.1.9.46/cvs/Linux x86_64)
Diffstat (limited to 'net-misc/dahdi-tools')
-rw-r--r--net-misc/dahdi-tools/ChangeLog12
-rw-r--r--net-misc/dahdi-tools/dahdi-tools-2.4.1.ebuild52
-rw-r--r--net-misc/dahdi-tools/files/dahdi-autoconf.conf36
-rw-r--r--net-misc/dahdi-tools/files/dahdi-autoconf.init205
4 files changed, 304 insertions, 1 deletions
diff --git a/net-misc/dahdi-tools/ChangeLog b/net-misc/dahdi-tools/ChangeLog
index 39d4be78e438..aee0aac83716 100644
--- a/net-misc/dahdi-tools/ChangeLog
+++ b/net-misc/dahdi-tools/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for net-misc/dahdi-tools
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dahdi-tools/ChangeLog,v 1.10 2011/02/27 18:58:35 chainsaw Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dahdi-tools/ChangeLog,v 1.11 2011/04/21 12:16:34 chainsaw Exp $
+
+*dahdi-tools-2.4.1 (21 Apr 2011)
+
+ 21 Apr 2011; Tony Vroon <chainsaw@gentoo.org> +dahdi-tools-2.4.1.ebuild,
+ +files/dahdi-autoconf.conf, +files/dahdi-autoconf.init:
+ Maintenance release, adds support for kernels up to 2.6.38 and increases
+ compatibility with systems that can not support read-line multiple PCI
+ commands. Additional initscripts by Jaco Kroon, closes bug #328143. Compile &
+ install additional binaries, also by Jaco Kroon, closes bug #337472. With
+ thanks to Oliver Jaksch for alerting me to the new version in bug #357311.
27 Feb 2011; Tony Vroon <chainsaw@gentoo.org> dahdi-tools-2.4.0.ebuild:
Mark stable on AMD64 for security bug #352059. Arch testing by Agostino "ago"
diff --git a/net-misc/dahdi-tools/dahdi-tools-2.4.1.ebuild b/net-misc/dahdi-tools/dahdi-tools-2.4.1.ebuild
new file mode 100644
index 000000000000..b2ea2adcefc8
--- /dev/null
+++ b/net-misc/dahdi-tools/dahdi-tools-2.4.1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dahdi-tools/dahdi-tools-2.4.1.ebuild,v 1.1 2011/04/21 12:16:34 chainsaw Exp $
+
+EAPI=3
+
+inherit base
+
+DESCRIPTION="Userspace tools to configure the kernel modules from net-misc/dahdi"
+HOMEPAGE="http://www.asterisk.org"
+SRC_URI="http://downloads.digium.com/pub/telephony/dahdi-tools/releases/${P}.tar.gz
+ mirror://gentoo/gentoo-dahdi-tools-patchset-0.2.tar.bz2"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="ppp"
+
+DEPEND="dev-libs/newt
+ ppp? ( net-dialup/ppp )
+ net-misc/dahdi
+ !net-misc/zaptel
+ >=sys-kernel/linux-headers-2.6.35
+ virtual/libusb:0"
+RDEPEND="${DEPEND}"
+
+EPATCH_SUFFIX="diff"
+PATCHES=( "${WORKDIR}/dahdi-tools-patchset" )
+
+src_compile() {
+ default_src_compile
+ emake tests || die "Failed compiling test utilities"
+ if use ppp; then
+ emake -C ppp || die "Failed compiling ppp plugin"
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "Failed to install binaries"
+ if use ppp; then
+ emake DESTDIR="${D}" -C ppp install || die "Failed to install ppp plugin"
+ fi
+ emake DESTDIR="${D}" config || die "Failed to install configuration files"
+
+ dosbin patgen pattest patlooptest hdlcstress hdlctest hdlcgen
+ dosbin hdlcverify timertest
+
+ # install init scripts
+ newinitd "${FILESDIR}"/dahdi.init2 dahdi
+ newinitd "${FILESDIR}"/dahdi-autoconf.init dahdi-autoconf
+ newconfd "${FILESDIR}"/dahdi-autoconf.conf dahdi-autoconf
+}
diff --git a/net-misc/dahdi-tools/files/dahdi-autoconf.conf b/net-misc/dahdi-tools/files/dahdi-autoconf.conf
new file mode 100644
index 000000000000..f0fd8e645bcc
--- /dev/null
+++ b/net-misc/dahdi-tools/files/dahdi-autoconf.conf
@@ -0,0 +1,36 @@
+# Global settings
+# Set this to your country code.
+DAHDI_ZONE=za
+DAHDI_ECHOCAN=oslec # mg2,jpah,kb1,sec,sec2 (there may be more, we recommend oslec)
+
+# Settings for analog
+#Analog signal types, one of:
+# ks - KewlStart (recommended, default)
+# ls - LoopStart
+# gs - GroundStart
+
+# Signalling to be used on FXO ports
+DAHDI_FXO_SIGNALLING=ks
+
+# Signalling to be used on FXS ports
+DAHDI_FXS_SIGNALLING=ks
+
+# Whether or not to echocan:
+DAHDI_FXO_ECHOCAN=yes
+DAHDI_FXS_ECHOCAN=yes
+
+# These settings will be used for BRI cards.
+# Known options: B8ZS,AMI,HDB3
+DAHDI_BRI_CODING=AMI
+
+# Known options: ESF,D4,CCS,CRC4
+DAHDI_BRI_FRAMING=CCS
+
+# Our experience is that it's not required (still defaults to yes)
+DAHDI_BRI_NT_ECHOCAN=no
+DAHDI_BRI_TE_ECHOCAN=no
+
+# PRI (E1/T1) not currently supported.
+# If you have a card that gets loaded but not configured please file a bug on
+# bugs.gentoo.org and add jaco@uls.co.za as a CC. Please do attach the the
+# output of "dahdi_scan" to us.
diff --git a/net-misc/dahdi-tools/files/dahdi-autoconf.init b/net-misc/dahdi-tools/files/dahdi-autoconf.init
new file mode 100644
index 000000000000..c49c3a4e9617
--- /dev/null
+++ b/net-misc/dahdi-tools/files/dahdi-autoconf.init
@@ -0,0 +1,205 @@
+#!/sbin/runscript
+# Copyright 2010-2011 Ultimate Linux Solutions CC
+# Distributed under the terms of the GNU General Public License v2
+
+depend() {
+ before dahdi
+}
+
+dahdi_load_modules() {
+ local hwlist loc status mod mod_vname pciid desc
+
+ hwlist=$(/usr/sbin/dahdi_hardware)
+
+ if [ -z "${hwlist}" ]; then
+ einfo "No digium hardware found."
+ ebegin "Loading module dahdi_dummy"
+ /sbin/modprobe dahdi_dummy
+ eend $?
+ return
+ fi
+
+ echo "${hwlist}" | while read loc mod pciid desc; do
+ status="${mod:${#mod}-1:1}"
+ mod="${mod%[+-]}"
+ mod_vname="mod_${mod}"
+
+ einfo "Found $desc at $loc (module: $mod)"
+
+ if [ "${status}" = "-" -a "${!mod_vname-notloaded}" = "notloaded" ]; then
+ ebegin "Loading module $mod"
+ /sbin/modprobe $mod
+ eend
+
+ [ $? -eq 0 ] && eval "$mod_vname=loaded"
+ fi
+ done
+}
+
+dahdi_module_unload() {
+ local mod=$1 s
+ [ -d /sys/module/${mod} ] || return 0
+
+ for s in $(find /sys/module/${mod}/holders -type l); do
+ dahdi_module_unload $(basename $s)
+ done
+
+ ebegin "Removing dahdi module: $mod"
+ /sbin/rmmod $mod
+ eend $?
+}
+
+dahdi_gen_fxo_config() {
+ local port=$1
+
+ echo "fxs${DAHDI_FXO_SIGNALLING-ks}=${port}"
+ [ "${DAHDI_FXO_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${port}"
+}
+
+dahdi_gen_fxs_config() {
+ local port=$1
+
+ echo "fxo${DAHDI_FXO_SIGNALLING-ks}=${port}"
+ [ "${DAHDI_FXS_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${port}"
+}
+
+dahdi_gen_bri_te_config() {
+ span=$1
+ port=$2
+ basechan=$3
+
+ echo "span=${span},${port},0,${DAHDI_BRI_FRAMING-CSS},${DAHDI_BRI_CODING-AMI}"
+ echo "bchan=${basechan}-$(( basechan + 1 ))"
+ echo "hardhdlc=$(( basechan + 2 ))"
+ [ "${DAHDI_BRI_TE_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${basechan}-$(( basechan + 1 ))"
+}
+
+dahdi_gen_bri_nt_config() {
+ span=$1
+ port=$2
+ basechan=$3
+
+ echo "span=${span},0,0,${DAHDI_BRI_FRAMING-CSS},${DAHDI_BRI_CODING-AMI}"
+ echo "bchan=${basechan}-$(( basechan + 1 ))"
+ echo "hardhdlc=$(( basechan + 2 ))"
+ [ "${DAHDI_BRI_NT_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${basechan}-$(( basechan + 1 ))"
+}
+
+dahdi_gen_e1_te_config() {
+ span=$1
+ port=$2
+ basechan=$3
+
+ echo "span=${span},$(( port + 1 )),0,${DAHDI_E1_FRAMING-CCS},${DAHDI_E1_CODING-HDB3,CRC4}"
+ bchans="${basechan}-$(( basechan + 14 )),$(( basechan + 16 ))-$(( basechan + 30 ))"
+ echo "bchan=${bchans}"
+ echo "dchan=$(( basechan + 15 ))"
+ [ "${DAHDI_E1_TE_ECHOCAN-yes}" = yes ] && echo "echocanceller=${DAHDI_ECHOCAN-mg2},${bchans}"
+}
+
+dahdi_conf_span() {
+ local span=$1
+ local type=$2
+ local desc=$3
+ local port=$4
+ local basechan=$5
+
+ # Analog we need to deal with on a port-by-port basis.
+ [ "${type}" = "analog" ] && return 0
+
+ echo -e "\n# ${desc}"
+ case "${type}" in
+ digital-TE)
+ dahdi_gen_bri_te_config "${span}" "${port}" "${basechan}"
+ ;;
+ digital-NT)
+ dahdi_gen_bri_nt_config "${span}" "${port}" "${basechan}"
+ ;;
+ digital-E1)
+ # For the moment assume TE.
+ dahdi_gen_e1_te_config "${span}" "${port}" "${basechan}"
+ ;;
+ *)
+ echo "# Don't know how to configure this (type=${type})."
+ echo "# Please file a bug on bugs.gentoo.org and add jaco@uls.co.za as CC."
+ ;;
+ esac
+}
+
+dahdi_gen_config() {
+ local type manufacturer devicetype basechan aport atype
+ local span=
+ local tfile="$(mktemp)"
+ local sfile="$(mktemp)"
+ local plocation=""
+ local isdnport=0
+
+ /usr/sbin/dahdi_scan > "${sfile}"
+ exec 3<"${sfile}"
+
+ echo "# Automatically dahdi-autoconf generated file ($(date))." >> "${tfile}"
+ echo "# This file WILL get regenerated whenever you restart dahdi-autoconf." >> "${tfile}"
+
+ while read LINE <&3; do
+ case "$LINE" in
+ [[]*[]])
+ [ -n "${span}" ] && dahdi_conf_span "${span}" "${type}" "${manufacturer} ${devicetype} (${name})" "${isdnport}" "${basechan}" >> "${tfile}"
+ span="${LINE%?}"
+ span="${span#?}"
+ ;;
+ type=*|manufacturer=*|devicetype=*|basechan=*|name=*)
+ eval "${LINE%%=*}='${LINE#*=}'"
+ ;;
+ location=*)
+ eval "${LINE%%=*}='${LINE#*=}'"
+ if [ "${location}" == "${plocation}" ]; then
+ (( ++isdnport ))
+ else
+ plocation="${location}"
+ isdnport=1
+ fi
+ ;;
+ port=*)
+ # For analog cards only.
+ aport="${LINE#*=}"; aport="${aport%,*}"
+ atype="${LINE#*,}"
+ [ "${aport}" -eq "${basechan}" ] && echo -e "\n# ${manufacturer} ${devicetype} (${name})" >> "${tfile}"
+ case "${atype}" in
+ FXO)
+ dahdi_gen_fxo_config $aport >> "${tfile}"
+ ;;
+ FXS)
+ dahdi_gen_fxs_config $aport >> "${tfile}"
+ ;;
+ esac
+ ;;
+ esac
+ done
+
+ [ -n "${span}" ] && dahdi_conf_span "${span}" "${type}" "${manufacturer} ${devicetype} (${name})" "${isdnport}" "${basechan}" >> "${tfile}"
+
+ echo -e "\nloadzone = ${DAHDI_ZONE}\ndefaultzone = ${DAHDI_ZONE}\n## END OF AUTOCONFIGURED FILE ##" >> "${tfile}"
+
+ exec 3<&-
+
+ rm -f "${sfile}"
+ mv /etc/dahdi/system.conf /etc/dahdi/system.conf.bck
+ mv "${tfile}" /etc/dahdi/system.conf
+}
+
+start() {
+ dahdi_load_modules
+
+ if [ ! -r /dev/dahdi/ctl ]; then
+ eerror "No DAHDI compatible cards detected."
+ return 1
+ fi
+
+ ebegin "Generating DAHDI Configuration"
+ dahdi_gen_config
+ eend $?
+}
+
+stop() {
+ dahdi_module_unload dahdi
+}