Página Inicial > Sem categoria > Instalando e configurando DAHDI no Asterisk Debian Lenny

Instalando e configurando DAHDI no Asterisk Debian Lenny

Buenas,

Na correria do dia a dia, estava acostumado a trabalhar com os módulos e drivers da khomp(kserver, channels, kpci), porem surgem novos desafios, o que me levou a ter que instalar e configurar uma placa FXS da digium.

Pensando em sofrer menos googleando com o oráculo, resolvi documentar o processo como ele ocorreu ;-) , claro que alguns filtros aplicados por causa da sujeira no stdout, segue abaixo os procedimentos que segui . . .

==============================

asterisk-server:/usr/src# ls
asterisk-1.4.23.2 dahdi-linux-current.tar.gz libpri-1.4-current.tar.gz linux-kbuild-2.6.26 zaptel-1.4.12.tar.gz
asterisk-1.4.26.2 dahdi-tools-current.tar.gz linux-headers-2.6.26-2-486 pacotes
dahdi-linux-2.2.1 libpri-1.4.10.2 linux-headers-2.6.26-2-common zaptel-1.4.12
asterisk-server:/usr/src# tar xvzf dahdi-tools-current.tar.gz
dahdi-tools-2.2.1/
.
.
dahdi-tools-2.2.1/Makefile

asterisk-server:/usr/src# cd dahdi-linux-2.2.1/
asterisk-server:/usr/src/dahdi-linux-2.2.1# ls -l
total 176
drwxrwxr-x 2 root root 4096 Jan 11 15:31 build_tools
-rw-rw-r– 1 root root 91077 Jan 11 15:31 ChangeLog
drwxrwxr-x 2 root root 6 Jan 11 15:31 doc
drwxrwxr-x 3 root root 18 Jan 11 15:31 drivers
drwxrwxr-x 3 root root 18 Jan 11 15:31 include
-rw-rw-r– 1 root root 18008 Ago 5 2008 LICENSE
-rw-rw-r– 1 root root 26423 Ago 5 2008 LICENSE.LGPL
-rw-rw-r– 1 root root 6834 Nov 9 2009 Makefile
-rw-rw-r– 1 root root 20133 Nov 9 2009 README
-rw-rw-r– 1 root root 3804 Ago 6 2008 UPGRADE.txt

asterisk-server:/usr/src/dahdi-linux-2.2.1# make
make -C drivers/dahdi/firmware firmware-loaders
make[1]: Entrando no diretório `/usr/src/dahdi-linux-2.2.1/drivers/dahdi/firmware’
Attempting to download dahdi-fwload-vpmadt032-1.20.0.tar.gz
–2010-05-19 13:57:21– http://downloads.digium.com/pub/telephony/firmware/releases/dahdi-fwload-vpmadt032-1.20.0.tar.gz
.
.
CC /usr/src/dahdi-linux-2.2.1/drivers/dahdi/xpp/xpp_usb.mod.o
LD [M] /usr/src/dahdi-linux-2.2.1/drivers/dahdi/xpp/xpp_usb.ko
make[1]: Saindo do diretório `/usr/src/linux-headers-2.6.26-2-486′

asterisk-server:/usr/src/dahdi-linux-2.2.1# uname -r
2.6.26-2-486

asterisk-server:/usr/src/dahdi-linux-2.2.1# make install
make -C drivers/dahdi/firmware firmware-loaders
.
.
###################################################
###
### DAHDI installed successfully.
### If you have not done so before, install the package
### dahdi-tools.
###
###################################################

asterisk-server:/etc/init.d# cd /usr/src/dahdi-tools-2.2.1/
asterisk-server:/usr/src/dahdi-tools-2.2.1# ls
acinclude.m4 config.sub dahdi_scan.c fxotune.c ifup-hdlc menuselect README xpp
bittest.h configure dahdi_speed.c fxotune.h init.conf.sample modprobe.conf.sample sethdlc.c zonedata.c
blacklist.sample configure.ac dahdi_test.c fxstest.c install-sh modules.sample system.conf.sample
bootstrap.sh dahdi_cfg.c dahdi_tool.c hdlcgen.c LICENSE patgen.c timertest.c
build_tools dahdi_diag.c dahdi_tools_version.h hdlcstress.c LICENSE.LGPL patlooptest.c tonezone.c
ChangeLog dahdi.init dahdi.xml hdlctest.c Makefile pattest.c tonezone.h
config.guess dahdi_monitor.c doc hdlcverify.c makeopts.in ppp UPGRADE.txt

asterisk-server:/usr/src/dahdi-tools-2.2.1# ./configure
checking for gcc… gcc
checking for C compiler default output file name… a.out
checking whether the C compiler works… yes
.
.
Generating input for menuselect …
menuselect changes saved!
make[1]: Saindo do diretório `/usr/src/dahdi-tools-2.2.1′

asterisk-server:/usr/src/dahdi-tools-2.2.1# make
CC=”" CXX=”g++” LD=”" AR=”" RANLIB=”" CFLAGS=”" make -C menuselect CONFIGURE_SILENT=”–silent” menuselect
make[1]: Entrando no diretório `/usr/src/dahdi-tools-2.2.1/menuselect’
.
.
###################################################
###
### DAHDI tools installed successfully.
### If you have not done so before, install init scripts with:
###
### make config
###
###################################################

asterisk-server:/usr/src/dahdi-tools-2.2.1# make config
install -D dahdi.init /etc/init.d/dahdi
/usr/bin/install -c -D -m 644 init.conf.sample /etc/dahdi/init.conf
/usr/bin/install -c -D -m 644 modules.sample /etc/dahdi/modules
/usr/bin/install -c -D -m 644 xpp/genconf_parameters /etc/dahdi/genconf_parameters
/usr/bin/install -c -D -m 644 modprobe.conf.sample /etc/modprobe.d/dahdi
/usr/bin/install -c -D -m 644 blacklist.sample /etc/modprobe.d/dahdi.blacklist
/usr/sbin/update-rc.d dahdi defaults 15 30
Adding system startup for /etc/init.d/dahdi …
/etc/rc0.d/K30dahdi -> ../init.d/dahdi
/etc/rc1.d/K30dahdi -> ../init.d/dahdi
/etc/rc6.d/K30dahdi -> ../init.d/dahdi
/etc/rc2.d/S15dahdi -> ../init.d/dahdi
/etc/rc3.d/S15dahdi -> ../init.d/dahdi
/etc/rc4.d/S15dahdi -> ../init.d/dahdi
/etc/rc5.d/S15dahdi -> ../init.d/dahdi
DAHDI has been configured.

List of detected DAHDI devices:

driver should be ‘tor2′ but is actually ‘kpci9030′
pci:0000:05:04.0 wctdm- e159:0001 Wildcard TDM400P REV I
pci:0000:05:05.0 tor2+ 10b5:3001 PLX Development Board

run ‘dahdi_genconf modules’ to load support for only
the DAHDI hardware installed in this system. By
default support for all DAHDI hardware is loaded at
DAHDI start.

asterisk-server:/usr/src/dahdi-tools-2.2.1# dahdi_cfg -vvv
DAHDI Tools Version – 2.2.1
Notice: Configuration file is /etc/dahdi/system.conf
line 0: Unable to open master device ‘/dev/dahdi/ctl’

1 error(s) detected

asterisk-server:/usr/src/dahdi-tools-2.2.1# modprobe -l | grep dahdi
/lib/modules/2.6.26-2-486/dahdi/xpp/xpp_usb.ko
/lib/modules/2.6.26-2-486/dahdi/xpp/xpp.ko
/lib/modules/2.6.26-2-486/dahdi/xpp/xpd_pri.ko
/lib/modules/2.6.26-2-486/dahdi/xpp/xpd_fxs.ko
/lib/modules/2.6.26-2-486/dahdi/xpp/xpd_fxo.ko
/lib/modules/2.6.26-2-486/dahdi/xpp/xpd_bri.ko
/lib/modules/2.6.26-2-486/dahdi/wcte12xp/wcte12xp.ko
/lib/modules/2.6.26-2-486/dahdi/wcte11xp.ko
/lib/modules/2.6.26-2-486/dahdi/wctdm24xxp/wctdm24xxp.ko
/lib/modules/2.6.26-2-486/dahdi/wctdm.ko
/lib/modules/2.6.26-2-486/dahdi/wctc4xxp/wctc4xxp.ko
/lib/modules/2.6.26-2-486/dahdi/wct4xxp/wct4xxp.ko
/lib/modules/2.6.26-2-486/dahdi/wct1xxp.ko
/lib/modules/2.6.26-2-486/dahdi/wcfxo.ko
/lib/modules/2.6.26-2-486/dahdi/wcb4xxp/wcb4xxp.ko
/lib/modules/2.6.26-2-486/dahdi/voicebus/dahdi_voicebus.ko
/lib/modules/2.6.26-2-486/dahdi/tor2.ko
/lib/modules/2.6.26-2-486/dahdi/pciradio.ko
/lib/modules/2.6.26-2-486/dahdi/dahdi_vpmadt032_loader.ko
/lib/modules/2.6.26-2-486/dahdi/dahdi_transcode.ko
/lib/modules/2.6.26-2-486/dahdi/dahdi_echocan_sec2.ko
/lib/modules/2.6.26-2-486/dahdi/dahdi_echocan_sec.ko
/lib/modules/2.6.26-2-486/dahdi/dahdi_echocan_mg2.ko
/lib/modules/2.6.26-2-486/dahdi/dahdi_echocan_kb1.ko
/lib/modules/2.6.26-2-486/dahdi/dahdi_echocan_jpah.ko
/lib/modules/2.6.26-2-486/dahdi/dahdi_dynamic_loc.ko
/lib/modules/2.6.26-2-486/dahdi/dahdi_dynamic_eth.ko
/lib/modules/2.6.26-2-486/dahdi/dahdi_dynamic.ko
/lib/modules/2.6.26-2-486/dahdi/dahdi_dummy.ko
/lib/modules/2.6.26-2-486/dahdi/dahdi.ko

asterisk-server:/usr/src/dahdi-tools-2.2.1# /etc/init.d/dahdi start
Loading DAHDI hardware modules:
wct4xxp: done wcte12xp: done wct1xxp: done wcte11xp: done wctdm24xxp: done wcfxo: done wctdm: done wcb4xxp: done wctc4xxp: done xpp_usb: done
/usr/share/dahdi/waitfor_xpds: Missing astribank_is_starting
Running dahdi_cfg: done.
asterisk-server:/usr/src/dahdi-tools-2.2.1# dahdi_cfg -vvv
DAHDI Tools Version – 2.2.1

DAHDI Version: 2.2.1
Echo Canceller(s):
Configuration
======================

Channel map:

0 channels to configure.

asterisk-server:/usr/src/dahdi-tools-2.2.1# dahdi_hardware
pci:0000:05:04.0 wctdm+ e159:0001 Wildcard TDM400P REV I
driver should be ‘tor2′ but is actually ‘kpci9030′
pci:0000:05:05.0 tor2+ 10b5:3001 PLX Development Board

asterisk-server:/usr/src/dahdi-tools-2.2.1# cd /etc/dahdi/

asterisk-server:/etc/dahdi# /etc/init.d/dahdi stop
Unloading DAHDI hardware modules: done

asterisk-server:/etc/dahdi# mv system.conf system.conf.ORIG
asterisk-server:/etc/dahdi# vim system.conf
asterisk-server:/etc/dahdi# cat system.conf
asterisk-server:/etc/asterisk# cat /etc/dahdi/system.conf
fxsks=1-4
loadzone = us
defaultzone = us

asterisk-server:/etc/dahdi# /etc/init.d/dahdi start
Loading DAHDI hardware modules:
tor2: done wctdm: done
/usr/share/dahdi/waitfor_xpds: Missing astribank_is_starting
Running dahdi_cfg: done.

asterisk-server:/etc/dahdi# /etc/init.d/dahdi stop

asterisk-server:/etc/dahdi# dahdi_test
Opened pseudo dahdi interface, measuring accuracy…
99.998% 99.989% 99.992% 99.994% 99.993% 99.994% 99.993% 99.992%
99.993% 99.990% 99.994% 99.952% 99.993% 99.994% 99.994% 99.967%
99.954% 99.990% 99.992% 99.994% 99.975% 99.961% 99.992% 99.993%
99.996% 99.996% 99.997% 99.997% 99.997% 99.996% 99.997% 99.997%
99.997% 99.996% 99.997% 99.997% 99.997% 99.991% 99.997% 99.997%
99.997% 99.996% 99.997% 99.997% 99.997% 99.997% 99.997% 99.997%
99.997% 99.997% 99.997% 99.974% 99.967% 99.997% 99.997% 99.997%
99.996% 99.997% 99.997% 99.997% 99.997% 99.996% 99.997% 99.997%
99.997% 99.997% 99.997% 99.997% 99.997% 99.997% 99.976% 99.970%
99.997% 99.997% 99.997% 99.997% 99.997% 99.997% 99.997% 99.997%
99.997% 99.997% ^C
— Results after 82 passes —
Best: 99.998 — Worst: 99.952 — Average: 99.992419, Difference: 99.995135

asterisk-server:/etc/dahdi# ls /dev/dahdi/
1 2 3 4 channel ctl pseudo timer

asterisk-server:/etc/dahdi# asterisk -r
Asterisk 1.4.23.2, Copyright (C) 1999 – 2008 Digium, Inc. and others.
Created by Mark Spencer
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.
=========================================================================
Connected to Asterisk 1.4.23.2 currently running on asterisk-server (pid = 2303)
Verbosity is at least 3
asterisk-server*CLI> module load chan_dahdi.so
== Parsing ‘/etc/asterisk/chan_dahdi.conf’: Found
– Automatically generated pseudo channel
== Parsing ‘/etc/asterisk/users.conf’: Found
== Registered channel type ‘DAHDI’ (DAHDI Telephony Driver)
== Manager registered action DAHDITransfer
== Manager registered action ZapTransfer
== Manager registered action DAHDIHangup
== Manager registered action ZapHangup
== Manager registered action DAHDIDialOffHook
== Manager registered action ZapDialOffHook
== Manager registered action DAHDIDNDon
== Manager registered action ZapDNDon
== Manager registered action DAHDIDNDoff
== Manager registered action ZapDNDoff
== Manager registered action DAHDIShowChannels
== Manager registered action ZapShowChannels
== Manager registered action DAHDIRestart
== Manager registered action ZapRestart
Loaded chan_dahdi.so => (DAHDI Telephony)
asterisk-server*CLI>
asterisk-server*CLI>
asterisk-server*CLI>
asterisk-server*CLI> dahdi show channels
Chan Extension Context Language MOH Interpret
pseudo default default
asterisk-server*CLI> dahdi show status
Description Alarms IRQ bpviol CRC4
Wildcard TDM400P REV I Board 5 OK 0 0 0
asterisk-server*CLI> dahdi show cadences
r1: 125,125,2000,4000
r2: 250,250,500,1000,250,250,500,4000
r3: 125,125,125,125,125,4000
r4: 1000,500,2500,5000
asterisk-server*CLI> quit
asterisk-server:/etc/dahdi# /etc/init.d/dahdi start

asterisk-server:/etc/dahdi# ls -l
total 36
-rw-r–r– 1 root root 5205 Mai 19 14:02 genconf_parameters
-rw-r–r– 1 root root 439 Mai 19 14:02 init.conf
-rw-r–r– 1 root root 215 Mai 19 14:04 modules
-rw-r–r– 1 root root 215 Mai 19 14:04 modules.bak
-rw-r–r– 1 root root 55 Mai 19 14:08 system.conf
-rw-r–r– 1 root root 11696 Mai 19 14:02 system.conf.ORIG

asterisk-server:/etc/dahdi# vim system.conf
asterisk-server:/etc/dahdi# cat system.conf
fxsks=1-4
loadzone = us
defaultzone = us

asterisk-server:/etc/dahdi# cd /etc/asterisk/

asterisk-server:/etc/asterisk# mv chan_dahdi.conf chan_dahdi.conf.ORIG

asterisk-server:/etc/asterisk# egrep ^[^\;] chan_dahdi.conf.ORIG > chan_dahdi.conf

asterisk-server:/etc/asterisk# vim chan_dahdi.conf

asterisk-server:/etc/asterisk# cat chan_dahdi.conf
[trunkgroups]
[channels]
context=default
switchtype=national
signalling=fxo_ls
rxwink=300 ; Atlas seems to use long (250ms) wink
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1
immediate=no

asterisk-server:/etc/asterisk# /etc/init.d/dahdi start
Loading DAHDI hardware modules:
tor2: done wctdm: done
/usr/share/dahdi/waitfor_xpds: Missing astribank_is_starting
Running dahdi_cfg: done.

asterisk-server:/etc/asterisk# asterisk -r
Asterisk 1.4.23.2, Copyright (C) 1999 – 2008 Digium, Inc. and others.
Created by Mark Spencer
Asterisk comes with ABSOLUTELY NO WARRANTY; type ‘core show warranty’ for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type ‘core show license’ for details.
=========================================================================
Connected to Asterisk 1.4.23.2 currently running on asterisk-server (pid = 2303)
Verbosity is at least 3
– Remote UNIX connection
asterisk-server*CLI> dahdi show channels
Chan Extension Context Language MOH Interpret
pseudo default default
asterisk-server*CLI> quit

asterisk-server:/etc/asterisk# /etc/init.d/dahdi stop
Unloading DAHDI hardware modules: done

asterisk-server:/etc/asterisk# vim chan_dahdi.conf

asterisk-server:/etc/asterisk# cat /etc/asterisk/chan_dahdi.conf
[trunkgroups]

[channels]
context=default
switchtype=national
signalling=fxs_ks
rxwink=300
usecallerid=yes
hidecallerid=no
callwaiting=yes
usecallingpres=yes
callwaitingcallerid=yes
threewaycalling=yes
transfer=yes
canpark=yes
cancallforward=yes
callreturn=yes
echocancel=yes
echocancelwhenbridged=yes
rxgain=0.0
txgain=0.0
group=1
callgroup=1
pickupgroup=1
immediate=no
channel => 1-4
asterisk-server:/etc/asterisk# /etc/init.d/dahdi start

asterisk-server*CLI> module load chan_dahdi.so
== Parsing ‘/etc/asterisk/chan_dahdi.conf’: Found
[May 19 14:36:50] WARNING[6975]: chan_dahdi.c:4089 handle_alarms: Detected alarm on channel 1: Red Alarm
– Registered channel 1, FXS Kewlstart signalling
[May 19 14:36:50] WARNING[6975]: chan_dahdi.c:4089 handle_alarms: Detected alarm on channel 2: Red Alarm
– Registered channel 2, FXS Kewlstart signalling
[May 19 14:36:50] WARNING[6975]: chan_dahdi.c:4089 handle_alarms: Detected alarm on channel 3: Red Alarm
– Registered channel 3, FXS Kewlstart signalling
[May 19 14:36:50] WARNING[6975]: chan_dahdi.c:4089 handle_alarms: Detected alarm on channel 4: Red Alarm
– Registered channel 4, FXS Kewlstart signalling
– Automatically generated pseudo channel
== Parsing ‘/etc/asterisk/users.conf’: Found
== Registered channel type ‘DAHDI’ (DAHDI Telephony Driver)
== Manager registered action DAHDITransfer
== Manager registered action ZapTransfer
== Manager registered action DAHDIHangup
== Manager registered action ZapHangup
== Manager registered action DAHDIDialOffHook
== Manager registered action ZapDialOffHook
== Manager registered action DAHDIDNDon
== Manager registered action ZapDNDon
== Manager registered action DAHDIDNDoff
== Manager registered action ZapDNDoff
== Manager registered action DAHDIShowChannels
== Manager registered action ZapShowChannels
== Manager registered action DAHDIRestart
== Manager registered action ZapRestart
Loaded chan_dahdi.so => (DAHDI Telephony)
asterisk-server*CLI> dahdi show status
Description Alarms IRQ bpviol CRC4
Wildcard TDM400P REV I Board 5 OK 0 0 0
asterisk-server*CLI> dahdi show channels
Chan Extension Context Language MOH Interpret
pseudo default default
1 default default
2 default default
3 default default
4 default default
– Executing [h@default:1] NoOp(“SIP/5720-aafb8448″, “HANGUPCAUSE: 16″) in new stack
– Executing [h@default:2] Hangup(“SIP/5720-aafb8448″, “”) in new stack
== Spawn h extension (default, h, 2) exited non-zero on ‘SIP/5720-aafb8448′
asterisk-server*CLI> quit
asterisk-server:/etc/asterisk#

E era isso :D

Boa sorte . . .

Categories: Sem categoria Tags:
  1. 25, novembro, 2011 em 03:50 | #1

    BRIGADU!!!
    Tenho um Asterisk rodando 1.4 que o DAHDI não mostrava os canais de jeito nenhum…
    Rodava redondo na mesma máquina com 1.6 e 1.8, mesma versão de DAHDI (a última).
    Lendo este post, resolvi em 10 segundos. Só precisava do signalling=fxs_ks. Nas versões mais recentes não faz falta.
    Abraço!

  2. 26, novembro, 2011 em 13:51 | #2

    legal :-) , sempre é bom ajudar.

  1. Nenhum trackback ainda.