Dahdi For Analog
Q1, Where to get lastest openvox dahdi driver?
Q2, How can you compile dahdi?
Openvox hardware requires drivers and libraries that are not integrated with the Linux kernel. These drivers and libraries including application software
For an introduction to Asterisk®setup and features, please refer to: http://www.asterisk.org.
- Linux 2.6.18 or later
- Development libraries and headers for ncurses, zlib, openssl and libnewt
- GCC and standard software build tools
Red Hat like OS: # yum install gcc ncurses-devel libtermcap-devel kernel-devel gcc-c++ newt-devel zlib-devel unixODBC-devel libtool make
Note: These commands includes optional libaries which are used by Asterisk and Asterisk-addons
It is recommended that you use the most recent version of the Asterisk, DAHDI, and libpri software for the best results. If you have previously installed any of these, Openvox recommends that you upgrade to the latest “-current” version of each.
Also, please be aware that you may need to re-compile Asterisk if you are upgrading DAHDI or libpri. The Application programming interface (API) of these packges tends to change between versions, re-compilation is the only way that you make Asterisk’s adapt to the new API.
- Download and install the latest DAHDI drivers. DAHDI is available for download from: http://www.openvox.cn/pub/drivers/dahdi-linux-complete/openvox_dahdi-linux-complete-current.tar.gz
# tar -zxvf openvox_dahdi-linux-complete-current.tar.gz
# cd dahdi-linux-complete-X.X.X+X.X.X.tar.gz
# make install
# make config
- If you are installing a Openvox Digital Card, download and install the latest version of libpri after installing DAHDI. libpri is available for download from: http://downloads.digium.com/pub/telephony/libpri
# tar -zxvf libpri-X.X.X.tar.gz
# cd libpri-X.X.X/
# make install
Q3, How to use fxstest tool for DAHDI FXS adapters?
Hardware Environment:A800P(2FXS+1FXO),A400P(2FXS+1FXO),BBK HCD007(6082)TSDL
Software Environment:Centos 5.5,dahdi-linux-complete-18.104.22.168+2.3.0
1.Compiling and installation
1)Please input following commands:
Select “fxstest” in the menu Then Save&Exit.
2)Beginning to compile dahdi.Input commands like below:
#make && make install && make config
3)Reloading the drivers.Perform the following command:
#service dahdi stop
#modprobe –r wctdm
#modprobe –r opvxa1200
#modprobe –r dahdi
#modprobe opvxa1200 opermode=YOUR COUNTRY
#modprobe wctdm opermode= YOUR COUNTRY
#dahdi_cfg –vvv(If there is no error,then installed OK)
#dahdi_scan(It prints information about DAHDI spans in the system.For analog spans it provides a list of channels.)
2.Beginning to test
All of thoses tests operate on a single dahdi channel which has to be an FXS port,and must not be in use by Asterisk or any other program.Analog adapters should be intended to connect phones. The command has two mandatory parameters.The first parameters is the device file to operate on.It is typically /dev/dahdi/NN,a device file under /dev/dahdi. The second parameter is the name of the command to run on that channel.
#fxstest /dev/dahdi/1 stats //A800P volts of channel 1
TIP: -5.6400 Volts RING: -54.1440 Volts VBAT: -62.7920 Volts
#fxstest /dev/dahdi/11 stats //A400P volts of channel 3
TIP: -5.6400 Volts RING: -54.8960 Volts VBAT: -63.9200 Volts
2)Dumping ProSLIC registers:
#fxstest /dev/dahdi/1 regdump //A800P registers of channel 1
Direct registers: 0. 05 1. 28 2. 18 3. 00 4. 18 5. 00 6. 00 7. 00 8. 00 9. 00 10. 08 11. 33 12. 80 13. 10 14. 00 15. 00 …. Indirect registers: 0. 55c2 1. 51e6 2. 4b85 3. 4937 4. 3333 5. 0202 6. 0202 7. 0198 8. 0198 9. 0611 10. 0202 11. 00e5 ….
3)Playing a series of tones:
#fxstest /dev/dahdi/1 tones
Then picking up the phone,you could hear of a series of tones.Press Ctrl+C to stop this command.
4)Creating a dtmf cid spill without polarity reversal:
#fxstest /dev/dahdi/1 dtmfcid
Going to send a set of DTMF tones >A5551212C< Phone is ringing Ringing Done
5)Testing polarity reversal(This test must be followd in creating a dtmf cid):
#fxstest /dev/dahdi/1 polarity
Twiddling polarity... Polarity is forward... Polarity is reversed... Polarity is forward...
6)Sending a sequence of dtmf tones:
#fxstest /dev/dahdi/1 dtmf “12324” 70
Going to send a set of DTMF tones >12324< Using a duration of 70 mS per tone
Then you can see the set of DTMF tones”12324” sent on the phone. Note:The duration should be 70ms or above to display whole sequence on the phone.
7)Toggling VMWI lamp(A800P not supported):
#fxstest /dev/dahdi/11 vmwi
Twiddling vmwi ... Set 1 Voice Message... Set 2 Voice Messages... Set No Voice messages...
Q4, Unable to create channel of type ‘DAHDI’ (Cause 0 – Unknown)
This is most commonly caused by the absence of chan_dahdi module Run the command module load chan_dahdi.so within the Asterisk CLI to correct the problem. In the event that the module cannot be loaded, you will need to confirm if the module exist or check the module configuration for any issues.
In order to generate the default configuration for your OpenVox cards you can use the following steps
- Log into the system as root
- Execute dahdi_genconf -vv
- Add #include dahdi-channels.conf at the end of the file /etc/asterisk/chan_dahdi.conf
Note: dahdi_genconf generates the default configuration for the modules loaded that detected the cards, it for some reason dahdi_genconf output is empty you will may need to update your DAHDI version and make sure that all the modules are being loaded. (Before you compile and install DAHDI, make sure that the file /etc/dahdi/module is removed so the update process will generate a new file)
Q5, How do I record calls using dahdi_monitor?
- dahdi_monitor 1 -m -r vpm-rx-on.wav -t vpm-tx-on.wav
- dahdi_monitor 1 -m -r hpec-v10.04.001-post-rx.wav -t hpec-post-tx.wav -R hpec–pre-rx.wav -T hpec-v10.04.001-pre-tx.wav
- dahdi_monitor 1 -m -v -R hpec-pre-rx.wav -T hpec-pre-tx.wav
Q6, How to confirm if hardware EC detected in your system?
1) You can execute the command #dmesg | grep -i VPM
2) After confirm hardware EC detected, you need to enable echocancel under /etc/asterisk/chan-dahdi.conf file .
Once you’ve verified that the VPM firmware loaded successfully, check the file /etc/asterisk/chan_dahdi.conf for the “echocancel” line. To enable the VPM, this setting needs to be set to “yes”
It’s very important to mention that Asterisk also allows a numerical value as echocancel parameter but it only applies when your system is using software echo cancellation. When hardware is installed the numerical value will be ignored.
Q7, How to use fxotune?
-‘#’ indicates a command to be entered in the bash prompt as root. Do not type the ‘#’ or the command will not execute.
– It’s best to do this during a maintanance window, as you will be using the lines and may be restarting Dahdi and Asterisk.
1) Verify that you are using the latest version of dahdi-linux and dahdi tools. If not, follow the README directions to upgrade.
-To find your Dahdi-Tools version and Dahdi-linux version, at the bash prompt enter the command:
# dahdi_cfg -v
– If dahdi doesn’t show up on this list, reboot the system and run the command again
and examine the options listed.
The most commonly used command option is ‘-i’ ‘[0-9]’ which will run fxotune on every channel from 1 to 252. Another common option is -n which will set the number to dial that cancels dialtone.
An example command that will calibrate echo settings on channels 1 through 24 is:
# fxotune -i -n 4 -b 1 -e 24 -p -vvv
The -p option is added to print the top five detected echo cancellation parameters. See the note below about detuning the fxotune output.
4) After determining what options your system needs, type the entire command at the bash prompt, formatted as the example above. Fxotune should take about a minute per channel.
5) When fxotune is complete, restart the system, or restart dahdi using
# /etc/init.d/dahdi stop
# /etc/init.d/dahdi start
# service dahdi stop
# service dahdi start
The recommend step is to restart the system. This will apply the changes to the module. If the system or dahdi isn’t restarted, then the changes are only written to /etc/fxotune.conf but not loaded onto the module.
For more detailed information about fxotune and it’s options, read the man page by entering the command:
# man fxotune
About the -p option to fxotune: this can be useful in “detuning” the hardware echo canceler, since allowing more noise into the system may allow the echo canceler to be more effective. To detune the fxotune settings, choose one of the top five scores from fxotune, select a line that does not have coefficients of all zeroes, and place this line in /etc/fxotune.conf.
Here is a simulated fxotune result, taken from fxotune -p:
To detune the line, replace that line with the second result (first result without all zeroes for the from above:
Again, this was simulated, your values will be much more appropriate for your system.
Q8, Analog card is not being detected
If you have PBX system (such as FreePBX, Elastix or AsteriskNOW) that is unable to detect the card, you may need to reinstall DAHDI.
How to determine if the card is being detected by the Operating System?
Before installing the latest DAHDI driver, it’s important to check if the analog card is detected by the Operating System by running the command: #lspci (This process will rule out any potential hardware issue with the card or the motherboard)
The next step would be to confirm if you have the correct version of DAHDI installed. You can run the command asterisk -rx”dahdi show version” or dmesg | grep -i dahdi
# asterisk -rx”dahdi show version”
DAHDI Version: 22.214.171.124 Echo Canceller:
# dmesg | grep -i dahdi
[ 19.430444] dahdi: Version: 126.96.36.199
[ 19.433360] dahdi: Telephony Interface Registered on major 196
[ 20.408099] dahdi_transcode: Loaded.
[ 20.580588] INFO-xpp: FEATURE: with sync_tick() from DAHDI
The output of dmesg may not show the version of DAHDI; please make sure to reboot your system if you encounter this issue.
If your PBX does not have 188.8.131.52 or later, you won’t be able to use our new generation of cards.
How to get help
PBX system such as Elastix, FreePBX and AsteriskNOW are third party software packages that are supported by their respective developers. Digium recommend to contact them for instruction of how to install the DAHDI-2.8+
AsteriskNOW is a project maintained by the Asterisk Community; it’s our understanding that they are working on including DAHDI-2.8 in a future release.
How to install DAHDI-2.8+ from source.
Please be aware that this process may break your system, some versions of DAHDI do not have the necessary API that Asterisk uses to communicate. Please make sure to make a backup of your system before continuing.
Connect to the Linux shell on your PBX using ssh (or an ssh client, such as Putty).
- Update your system to the last version available
- Install DAHDI dependencies
- Linux 2.6 kernel headers
- Development libraries and headers for ncurses, zlib, libnewt and openssl
- GCC and standard software build tools
#yum install gcc ncurses-devel libtermcap-devel gcc-c++ newt-devel zlib-devel libtool make libxml2 libxml2-devel
- Navigate to the /usr/src folder:
- Download the source code for DAHDI using the ‘wget’ command:
- Extract the source tarball:
- Navigate to the newly created folder containing the extracted source, and run the commands to install it:
- Restart DAHDI and Asterisk
- To confirm the version of DAHDI that is installed