Using the added features


Options specific to TDM400P and clones


The big advantage of using DKMS is that the kernel modules will be automatically rebuilt whenever a new kernel is installed.

Unfortunately, DKMS is horribly broken on Red Hat-based systems. Here's what happens:

  • Install a DKMS-enabled module.
  • Update your kernel a few times.
  • Watch in horror as the module(s) fail to load, because the old kernel they were compiled against gets deleted.
  • Spend lots of time cleaning up the mess.

  • Basically, the problem is that Red Hat-based systems try to save you some time by making symlinks to your original modules, pointing at the first kernel on which they were installed. When that kernel gets deleted, the symlinks end up pointing nowhere.

    Because of this, I don't recommend DKMS unless you're using a Debian-based system.

    You will need to install DKMS on your system. If you are using CentOS and the repoforge (formerly rpmforge) repo, you can install it with yum. Ubuntu has a package that can be installed with apt-get.

    Example (assuming drivers and 2.4.1 tools):

    dkms add -m dahdi-cnet-linux -v -k `uname -r`
    dkms install -m dahdi-cnet-linux -v -k `uname -r`
    cd /usr/src/dahdi-cnet-tools-2.4.1
    make install

    Ignore Flash Forward

    A phone attached to a DAHDI (or legacy Zaptel) FXS channel that is not configured for three-way calling can send a flash forward signal, which can be propagated via IAX to an FXO port on a remote Asterisk system. This can allow the caller to drop to a dial tone on the remote FXO port. If this is undesirable to you, it is possible to configure your FXOs to ignore flash forward.

    Settings for /etc/dahdi/system.conf:


    Dial Pulse Mapping

    Oslo, Norway, New Zealand, and Sweden used different arrangements for rotary dials than the rest of the world.

    World: 1-2-3-4-5-6-7-8-9-0
    Sweden: 0-1-2-3-4-5-6-7-8-9
    New Zealand, Oslo 9-8-7-6-5-4-3-2-1-0

    Let's say you have New Zealand-spec UAX13 switch hooked to FXO ports 1 and 2 for incoming traffic, FXS ports 3 and 4 for outgoing access, a rotary dial phone intended for Sweden on port 5, and an Oslo or New Zealand rotary dial phone on port 8.

    Settings for /etc/dahdi/system.conf:


    Additional Tone Zones and Secondary Dial Tones

    Additional tone zones are available, which also provide distinctively different secondary dial tones when you use the ignorepat option in /etc/asterisk/extensions.conf. Use the names below with loadzone= and defaultzone= settings in /etc/dahdi/system.conf, and the numbers below with the tonezone= parameter in /etc/asterisk/chan_dahdi.conf. The following tone zones are available:

    system.conf name chan_dahdi.conf number Description
    xm 100 Tones used in the 1960 Bell Labs experimental ESS trial in Morris, Illinois. Also provides a 350+440 Hz secondary dial tone.
    xp 101 North American tones with 500+640 primary and 350+440 secondary dial tones.
    xu 102 Old style UK tones, with "purring" primary dial tone and 350+440 secondary.
    x1 103 Standard US tones with 500+640 secondary dial tone.

    Configurable Digit Timeouts

    The digit timeouts for chan_dahdi can now be configured from the chan_dahdi.conf file. Note that they affect all DAHDI channels. Values are in milliseconds.

    Settings for /etc/asterisk/chan_dahdi.conf:

    global_firstdigittimeout=30000 ; wait 30 seconds for first digit
    global_gendigittimeout=10000 ; wait 10 seconds for subsequent digits
    global_matchdigittimeout=2000 ; wait 2 seconds if an ambiguous match occurs
    ; continue with the rest of your channel options

    Dial Speed Testing

    Support for dial speed testing is built-in; no options need to be set. You may either use the dial speed AGI application, or roll your own using the hookswitch logs. Each DAHDI channel will have a log that holds the pulse count for the last pulse digit dialed, plus the last 20 hook state transitions (corresponding to ten pulses). These will be found in the /proc/dahdi_dial directory. For example, /proc/dahdi_dial/3 holds the hook state log for channel 3. Here's an example log, immediately after dialing a 0 into the dial speed test AGI:

    Last pulse count: 10
    zt_hooksig 0: 1310683117:229935
    zt_hooksig 1: 1310683117:293936
    zt_hooksig 0: 1310683117:325937
    zt_hooksig 1: 1310683117:389941
    zt_hooksig 0: 1310683117:437941
    zt_hooksig 1: 1310683117:485942
    zt_hooksig 0: 1310683117:533944
    zt_hooksig 1: 1310683117:597947
    zt_hooksig 0: 1310683117:629972
    zt_hooksig 1: 1310683117:693951
    zt_hooksig 0: 1310683117:725954
    zt_hooksig 1: 1310683117:789956
    zt_hooksig 0: 1310683117:837956
    zt_hooksig 1: 1310683117:901960
    zt_hooksig 0: 1310683117:933959
    zt_hooksig 1: 1310683117:997962
    zt_hooksig 0: 1310683118:045966
    zt_hooksig 1: 1310683118:109968
    zt_hooksig 0: 1310683118:141969
    zt_hooksig 1: 1310683118:205972

    A value of 0 for the zt_hooksig indicates a "break" (on-hook) condition, while a value of 1 indicates a "make" (off-hook) state. The numbers that follow are a standard UNIX-style timestamp (seconds past the epoch), followed by the number of microseconds. Strictly speaking, a decimal point could have been put there instead of a colon.

    Dial Pulse Debounce Setting (TDM400P and clones)

    The wctdm driver has a dialdebounce option specified in milliseconds. In the official Digium version, this defaults to 64 ms, but that doesn't work very well for real pulse-dialing phones. The C*NET version defaults to 32, and works better. However, if you still have problems using rotary-dial phones, you can change this in /etc/modprobe.d/dahdi or /etc/modprobe.conf file. The value must be a multiple of 4. It is not necessary to set fxshonormode when using this option.


    options wctdm dialdebounce=48

    FXS ring frequency selection (TDM400P and clones)

    If you have a US-spec phone with a frequency-selective ringer, you can configure the TDM400P to supply ring current at different frequencies than 20 Hz by using the opermode parameter. This sets the default frequency for all FXS ports on the card. The default may be overridden on individual ports by using the ringfreqX=YY parameter, where X is the port number (1-4), and YY is the frequency (17, 20, 25, 30, 33, 40, 42, 50, 54, 60, or 67). The opermode and ringfreq overrides must be set when loading the module; this is done in /etc/modprobe.d/dahdi or /etc/modprobe.conf depending on your distro. The fxshonormode option needs to be set to 1, and it is a good idea to set boostringer to 1 as well.

    Mode Frequency
    FCC17 16.67 Hz
    FCC 20 Hz (default)
    FCC25 25 Hz
    FCC30 30 Hz
    FCC33 33.33 Hz
    FCC40 40 Hz
    FCC42 42 Hz
    FCC50 50 Hz
    FCC54 54 Hz
    FCC60 60 Hz
    FCC67 66.66 Hz

    To set 50 Hz ringing as default, with 30 Hz on port 4:

    options wctdm opermode=FCC50 ringfreq4=30 fxshonormode=1 boostringer=1