BRI Card Software Installation Manual_Debion
Installation Environment
Debian 11.6.0
Dahdi-3.2.0
Asterisk-20
Libpri-1.6.0
1.Hardware Detection
lspci -vvvvvv
Check whether the system recognizes the corresponding board by the output of the above command.
If the B100 card is detected, the output will show “Network controller”, as shown in the figure:
04:00.0 Network controller: Cologne Chip Designs GmbH ISDN network controller [HFC-PCI] (rev 02) Subsystem: Cologne Chip Designs GmbH ISDN Board Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 16 (4000ns max) Interrupt: pin A routed to IRQ 17 Region 0: I/O ports at d000 [disabled] [size=8] Region 1: Memory at f7d00000 (32-bit, non-prefetchable) [size=256] Capabilities: [40] Power Management version 1 Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME- Kernel driver in use: vzaphfc Kernel modules: zaphfc
If one of theB200, B400 or B800 cards is detected, the output result will show “ISDN controller”, take B400 as an example:
04:02.0 ISDN controller: Cologne Chip Designs GmbH ISDN network Controller [HFC-4S] (rev 01) Subsystem: Cologne Chip Designs GmbH HFC-4S [OpenVox B200P / B400P] Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Interrupt: pin A routed to IRQ 16 Region 0: I/O ports at d000 [size=8] Region 1: Memory at f7d00000 (32-bit, non-prefetchable) [size=4K] Capabilities: [40] Power Management version 2 Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME+ Kernel driver in use: wcb4xxp Kernel modules: wcb4xxp Take B800 as an example as shown in the figure. 04:01.0 ISDN controller: Cologne Chip Designs GmbH ISDN network Controller [HFC-8S] (rev 01) Subsystem: Cologne Chip Designs GmbH HFC-8S [OpenVox B800P] Control: I/O+ Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Interrupt: pin A routed to IRQ 19 Region 0: I/O ports at d000 [size=8] Region 1: Memory at f7d00000 (32-bit, non-prefetchable) [size=4K] Capabilities: [40] Power Management version 2 Flags: PMEClk- DSI+ D1+ D2+ AuxCurrent=0mA PME(D0+,D1+,D2+,D3hot+,D3cold-) Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME+ Kernel driver in use: wcb4xxp Kernel modules: wcb4xxp
If the system does not detect the card, please turn off the power, clear the slot or insert the card into another slot of the same type and detect it again.
Download and unzip
Download the DAHDI source package from the official OpenVox website
https://www.openvox.cn/pub/drivers/dahdi-linux-complete/openvox_dahdi-linux-complete-current.tar.gz
Get Libpri from the Digium website:
https://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz
Get Asterisk from the Digium website:
https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz
The DAHDI, Asterisk and Libpri are usually downloaded and extracted by running the following command in the directory /usr/src/.
wget https://www.openvox.cn/pub/drivers/dahdi-linux-complete/openvox_dahdi-linux-complete-current.tar.gz wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-20-current.tar.gz wget https://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz tar -xvzf openvox_dahdi-linux-complete-current.tar.gz tar -xvzf asterisk-20-current.tar.gz tar -xvzf libpri-current.tar.gz
Dependency package installation.
apt-get update apt-get install build-essential apt-get install git apt-get install linux-headers-`uname -r`
Install dahdi
Convert the path to the dahdi-linux-complete-XX source package directory (XX stands for DAHDI version) and run the following command to install DAHDI.
# cd /usr/src/dahdi-linux-complete-XX
make make install make config
Install libpri
Convert the path to the directory where the libpri source package is located and run the following command to install Libpri.
cd libpri-XX make make install
Compile problems
Solution, comment out the -wall line in the libss7-1.6.0/Makefile file
Install asterisk
Convert the path to the asterisk source package directory (XX stands for asterisk version) and run the following command to install asterisk.
# cd asterisk-20.xx
Dependency package installation
contrib/scripts/install_prereq install . /configure make make install make samples
2.Configure
Load the driver
After compiling, please run the following command to load the driver according to the corresponding board model: # modprobe dahdi
# modprobe dahdi
If it is a B100 board, please run the following command
# modprobe zaphfc (B100 in TE mode) //if it is NT mode, then modprobe zaphfc modes=1 force_11_up=0
If it is B200/B400/B800 board please execute the following command
# modprobe wcb4xxp (B200,B400,B800) // B800 If there is NT port, then refer to the following explanation to set te_nt_override value according to the corresponding NT port and then execute modprobe wcb4xxp te_nt_override=required value
Then continue to execute the following command to generate the corresponding channel configuration file
# dahdi_genconf -vvv
# dahdi_cfg -vvvvvv
For B100 and B800, if you have NT port, edit /etc/modprobe.d/dahdi.conf according to the following diagram to load the parameters automatically when booting.
vi /etc/modprobe.d/dahdi.conf
Under normal circumstances, after executing the command “dahdi_genconf”, the system will automatically generate the files /etc/dahdi/system.conf and etc/asterisk/dahdi-channels.conf. Check whether the generated configuration files meet your requirements, or you can modify the relevant parameters manually. It is important to make sure that dahdi-channels.conf is included in chan_dahdi.conf, if not, please run the command:
# echo “#include dahdi-channels.conf” >> /etc/asterisk/chan_dahdi.conf
Add the corresponding board driver to /etc/dahdi/modules to automatically load the board driver when booting
cp /etc/dahdi/modules.sample /etc/dahdi/modules
chmod 0777 /etc/dahdi/modules
vi /etc/dahdi/modules
The following is an example of a B100 board to configure
The following shows part of the basic channel configuration file /etc/dahdi/system.conf.
# Span 1: ZTHFC1 "HFC-S PCI A ISDN card 0 [TE] " (MASTER) span=1,1,0,ccs,ami # termtype: te bchan=1-2 hardhdlc=3 echocanceller=mg2,1-2 # Global data loadzone = us defaultzone = us A portion of the file /etc/asterisk/dahdi-channels.conf is shown below: ; Span 1: ZTHFC1 "HFC-S PCI A ISDN card 0 [TE] " (MASTER) group=0,11 context=from-isdn overlapdial=yes # must add this line switchtype = euroisdn signalling = bri_cpe_ptmp channel => 1-2 context = default group = 63
Start Asterisk
# asterisk -vvvvvvgc
If Asterisk is already running, run “asterisk -r” instead. In the CLI interface, run
“dahdi show channels” and “pri show spans”:
3.Writing a dial plan
Please write the dial plan in the extensions.conf file. The following figure describes a simple inbound and outbound plan.
#vi /etc/asterisk/extensions.conf
When a call comes in from the BRI board, the sip/100 extension will ring. If the extension created is xxxx, then change it to sip/xxxx
[from-isdn] exten => _X.,1,Dial(SIP/100,,r) exten => _X.,n,Hangup()
When the extension sets the context to from-internel, the call will go out from the board dahdi/1 (1 for channel 1), ${EXTEN} is the called number.
[from-internal] exten => _X.,1,Dial(dahdi/1/${EXTEN},,r) exten => _X.,n,Hangup()
After setting up the dialplan, please run “asterisk -r”, and execute the command “dialplan reload” in the CLI interface, then you can dial up the number.