2010-08-18 21:49:24 +08:00
|
|
|
DAHDI Telephony Interface Driver
|
|
|
|
=================================
|
|
|
|
Asterisk Development Team <asteriskteam@digium.com>
|
|
|
|
$Revision$, $Date$
|
|
|
|
|
|
|
|
DAHDI stands for Digium Asterisk Hardware Device Interface. This
|
2011-08-03 01:20:01 +08:00
|
|
|
package contains the user-space tools to configure the kernel modules
|
2010-08-18 21:49:24 +08:00
|
|
|
included in the package dahdi-linux.
|
|
|
|
|
|
|
|
Build Requirements
|
|
|
|
------------------
|
|
|
|
This package needs the headers from dahdi-linux. Thus you should install
|
|
|
|
dahdi-linux before building dahdi-tools.
|
|
|
|
|
|
|
|
Build System
|
|
|
|
~~~~~~~~~~~~
|
2011-08-03 01:20:01 +08:00
|
|
|
GCC and friends. Generally you will need to install the package gcc.
|
2010-08-18 21:49:24 +08:00
|
|
|
There may be cases where you will need a specific version of gcc to build
|
|
|
|
kernel modules.
|
|
|
|
|
|
|
|
|
|
|
|
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.
|
|
|
|
- libnewt is needed to build the optional but useful utility dahdi_tool.
|
|
|
|
|
|
|
|
|
|
|
|
Installation
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
Note: If using `sudo` to build/install, you may need to add /sbin to your PATH.
|
|
|
|
----------------------------------
|
|
|
|
./configure
|
|
|
|
make
|
|
|
|
make install
|
|
|
|
# To install init scripts and config files:
|
|
|
|
#make config
|
|
|
|
----------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
Build Tweaks
|
|
|
|
~~~~~~~~~~~~
|
|
|
|
Partial Build/Install
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
There are some make targets that are provided to build or install just
|
|
|
|
parts of DAHDI:
|
|
|
|
|
|
|
|
. Build targets:
|
2013-12-31 01:24:23 +08:00
|
|
|
- make: Build DAHDI user-space programs and libraries. partial
|
2010-08-18 21:49:24 +08:00
|
|
|
targets of it:
|
|
|
|
* make 'utilname': builds 'utilname' alone (e.g: `make dahdi_diag`)
|
2013-12-31 01:24:23 +08:00
|
|
|
* make utils: Build just the programs.
|
2010-08-18 21:49:24 +08:00
|
|
|
* make libs: Build libtonezone.
|
2013-12-31 01:24:23 +08:00
|
|
|
* make tests: Build testing binaries.
|
2010-08-18 21:49:24 +08:00
|
|
|
. Install targets:
|
2013-12-31 01:24:23 +08:00
|
|
|
- make install: Install everything. Sub-targets of it:
|
|
|
|
* make install-utils: Installs most things.
|
|
|
|
* make install-libs: Installs libtonezone.
|
|
|
|
- make config: install configuration files (overriding existing ones).
|
|
|
|
- make install-test: Install testing binaries.
|
2010-08-18 21:49:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
Installation to a Subtree
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
The following may be useful when testing the package or when preparing a
|
|
|
|
package for a binary distribution (such as an rpm package) installing
|
2011-08-03 01:28:23 +08:00
|
|
|
onto a subtree rather than on the real system.
|
2010-08-18 21:49:24 +08:00
|
|
|
|
|
|
|
make install DESTDIR=targetdir
|
|
|
|
|
|
|
|
This can be useful for any partial install target from the list above.
|
|
|
|
|
|
|
|
|
|
|
|
Options For ./configure
|
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^
|
2012-09-22 03:43:49 +08:00
|
|
|
The configure script executes various tests and based on them generates
|
|
|
|
makeopts. You can pass it --with options and variable settings, for
|
|
|
|
instance:
|
2010-08-18 21:49:24 +08:00
|
|
|
|
|
|
|
./configure --without-ncurses CC="gcc-4.10"
|
|
|
|
|
|
|
|
If you just want to recreate the same files without a full detection
|
|
|
|
run, use:
|
|
|
|
|
|
|
|
./config.status
|
|
|
|
|
|
|
|
To re-run ./configure with the same parameters it was run with last
|
|
|
|
time, use:
|
|
|
|
|
2011-08-03 01:20:01 +08:00
|
|
|
./config.status --recheck
|
2010-08-18 21:49:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
Configuration
|
|
|
|
-------------
|
|
|
|
Configuration for DAHDI resides under /etc/dahdi .
|
|
|
|
|
|
|
|
/etc/dahdi/system.conf
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
The main method to configure DAHDI devices is using the utility
|
|
|
|
*dahdi_cfg*. dahdi_cfg reads data from the configuration file
|
|
|
|
/etc/dahdi/system.conf , figures out what configuration to send to
|
|
|
|
channels, and send it to the kernel.
|
|
|
|
|
|
|
|
A sample annotated system.conf is included in this directory and
|
|
|
|
installed by default. Edit it to suit your configuration. Alternatively
|
|
|
|
use the script dahdi_genconf to generate one that should work with your
|
2010-12-10 06:44:52 +08:00
|
|
|
system. Note that while dahdi_genconf will generate a working configuration,
|
|
|
|
it will not automatically detect hardware echo cancellation modules. These
|
|
|
|
will have to be enabled manually in system.conf.
|
2010-08-18 21:49:24 +08:00
|
|
|
|
|
|
|
/etc/dahdi/init.conf
|
|
|
|
~~~~~~~~~~~~~~~~~~~~
|
|
|
|
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.
|
|
|
|
|
|
|
|
Reference Configuration
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
Sample system.conf
|
2013-12-29 19:43:05 +08:00
|
|
|
^^^^^^^^^^^^^^^^^^
|
2010-08-18 21:49:24 +08:00
|
|
|
include::system.conf.asciidoc[]
|
|
|
|
|
|
|
|
|
|
|
|
Sample init.conf
|
2013-12-29 19:43:05 +08:00
|
|
|
^^^^^^^^^^^^^^^^
|
2010-08-18 21:49:24 +08:00
|
|
|
include::init.conf.asciidoc[]
|
|
|
|
|
|
|
|
|
|
|
|
Sample genconf_parameters
|
2013-12-29 19:43:05 +08:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^
|
2010-08-18 21:49:24 +08:00
|
|
|
FIXME: still not properly formatted.
|
|
|
|
|
|
|
|
include::genconf_parameters.asciidoc[]
|
|
|
|
|
|
|
|
|
2013-10-18 14:27:30 +08:00
|
|
|
Sample assigned-spans.conf
|
2013-12-29 19:43:05 +08:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2013-10-18 14:27:30 +08:00
|
|
|
include::assigned-spans.conf.asciidoc[]
|
|
|
|
|
|
|
|
|
|
|
|
Sample span-types.conf
|
2013-12-29 19:43:05 +08:00
|
|
|
^^^^^^^^^^^^^^^^^^^^^^
|
2013-10-18 14:27:30 +08:00
|
|
|
include::span-types.conf.asciidoc[]
|
|
|
|
|
|
|
|
|
2010-08-18 21:49:24 +08:00
|
|
|
Tonezones
|
|
|
|
~~~~~~~~~
|
|
|
|
The file zonedata.c contains the information about the tone zones used
|
2011-08-03 01:28:23 +08:00
|
|
|
in libtonezone (and hence also in dahdi_cfg). Here is a list of those zones:
|
2010-08-18 21:49:24 +08:00
|
|
|
|
|
|
|
include::tonezones.txt[]
|
|
|
|
|
|
|
|
|
|
|
|
DAHDI PERL modules
|
|
|
|
~~~~~~~~~~~~~~~~~~
|
|
|
|
The directory xpp has, in addition to helper utilities for the
|
2011-08-03 01:20:01 +08:00
|
|
|
Xorcom Astribank, a collection of PERL modules to provide information
|
|
|
|
related to DAHDI. The PERL modules themselves are under xpp/perl_modules/ .
|
2010-08-18 21:49:24 +08:00
|
|
|
In xpp/ there are several utilities that use those modules:
|
|
|
|
- xpp-specific: dahdi_registration, xpp_sync, xpp_blink .
|
|
|
|
- General: lsdahdi, dahdi_genconf, dahdi_hardware, dahdi_drivers
|
|
|
|
|
2011-08-03 01:20:01 +08:00
|
|
|
The DAHDI PERL modules will currently only be automatically installed if you
|
|
|
|
happen to install the xpp directory. Those utilities require the PERL modules
|
2010-08-18 21:49:24 +08:00
|
|
|
to be installed, however they will also look for them in the directory
|
|
|
|
perl_modules, and thus can be run directly from the DAHDI source tree. For
|
|
|
|
example:
|
|
|
|
|
|
|
|
./xpp/dahdi_hardware -v
|
|
|
|
|
|
|
|
To get usage information on a program, you can also use perldoc
|
|
|
|
(sometimes provided in a package separate from perl itself). For
|
|
|
|
instance:
|
|
|
|
|
|
|
|
perldoc ./xpp/lsdahdi
|
|
|
|
|
|
|
|
Some of them are specific for the Xorcom Astribank and described in its
|
2011-08-03 01:20:01 +08:00
|
|
|
documentation. the others are:
|
2010-08-18 21:49:24 +08:00
|
|
|
|
|
|
|
lsdahdi::
|
|
|
|
A somewhat glorified `cat /proc/dahdi/*`.
|
|
|
|
dahdi_genconf::
|
|
|
|
Generates configuration based on the existing DAHDI channels and on
|
|
|
|
/etc/dahdi/genconf_parameters (replaces genzaptelconf as well).
|
|
|
|
dahdi_drivers::
|
|
|
|
A two-liner script (not installed by default) that simply returns the
|
2011-08-03 01:20:01 +08:00
|
|
|
modules that should be modprobe-d on this system.
|
2010-08-18 21:49:24 +08:00
|
|
|
dahdi_hardware::
|
2011-08-03 01:20:01 +08:00
|
|
|
Uses the information from SysFS and its own knowledge to show
|
2010-08-18 21:49:24 +08:00
|
|
|
what PCI/USB DAHDI hardware is connected and if it is currently used
|
|
|
|
by a driver. Shows also some more information for Astribanks from
|
|
|
|
/proc/xpp .
|
|
|
|
|
|
|
|
|
|
|
|
PPP Support
|
|
|
|
~~~~~~~~~~~
|
2011-08-03 01:20:01 +08:00
|
|
|
DAHDI digital cards can provide data channels through PPP as
|
|
|
|
point-to-point connections. This requires a plug-in to the PPP daemon
|
2010-08-18 21:49:24 +08:00
|
|
|
that is included in the ppp/ subdirectory. To install it:
|
|
|
|
|
|
|
|
1. Make sure you have the PPP source / headers installed. On Debian:
|
|
|
|
|
|
|
|
apt-get install ppp-dev
|
|
|
|
|
|
|
|
2. Run 'make' on the ppp subdirectory:
|
|
|
|
|
|
|
|
make -C ppp
|
|
|
|
make -C ppp install
|
|
|
|
|
|
|
|
3. Make sure your kernel has support for both PPP (which is common is
|
|
|
|
distribution kernels and for HDLC (much less common) - CONFIG_PPP and
|
|
|
|
CONFIG_HDLC .
|
|
|
|
|
|
|
|
|
2013-12-30 20:38:49 +08:00
|
|
|
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
|
2014-01-28 17:42:33 +08:00
|
|
|
device, which runs all the scripts in `/usr/share/dahdi/handle_device.d`.
|
|
|
|
Those scripts will:
|
2013-12-30 20:38:49 +08:00
|
|
|
|
|
|
|
* 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
|
2014-01-28 17:42:33 +08:00
|
|
|
`/usr/share/dahdi/dahdi_span_config` which runs all the scripts in
|
|
|
|
`/usr/share/dahdi/span_config.d`. Those script configures the new
|
2013-12-30 20:38:49 +08:00
|
|
|
span:
|
|
|
|
|
|
|
|
* If system.conf does not exist, generates a temporary configuration
|
|
|
|
for the span using link:doc/dahdi_genconf.8.html[dahdi_genconf
|
|
|
|
system].
|
2014-01-28 17:42:33 +08:00
|
|
|
|
2013-12-30 20:38:49 +08:00
|
|
|
* 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.
|
|
|
|
|
|
|
|
|
2010-08-18 21:49:24 +08:00
|
|
|
include::UPGRADE.txt[]
|
|
|
|
|
|
|
|
|
|
|
|
License
|
|
|
|
-------
|
|
|
|
This package is distributed under the terms of the GNU General Public License
|
|
|
|
Version 2, except for some components which are distributed under the terms of
|
|
|
|
the GNU Lesser General Public License Version 2.1. Both licenses are included
|
|
|
|
in this directory, and each file is clearly marked as to which license applies.
|
|
|
|
|
|
|
|
If you wish to use the DAHDI drivers in an application for which the license
|
|
|
|
terms are not appropriate (e.g. a proprietary embedded system), licenses under
|
|
|
|
more flexible terms can be readily obtained through Digium, Inc. at reasonable
|
|
|
|
cost.
|
|
|
|
|
|
|
|
|
|
|
|
Reporting Bugs
|
|
|
|
--------------
|
|
|
|
Please report bug and patches to the Asterisk bug tracker at
|
|
|
|
http://bugs.digium.com/[] in the "DAHDI" category.
|
|
|
|
|
|
|
|
|
|
|
|
Links
|
|
|
|
-----
|
|
|
|
- http://asterisk.org/[] - The Asterisk PBX
|
|
|
|
- http://voip-info.org/[]
|
|
|
|
- http://voip-info.org/wiki/view/DAHDI[]
|
|
|
|
- http://docs.tzafrir.org.il/dahdi-tools/README.html[Up-to-date HTML version
|
|
|
|
of this file]
|