X204 Card Software Installation Manual_Rockey
Installation Environment
System:Rockey Linux (Centos 8)
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 X204 board is detected, the output will be as shown in the figure:
04:00.0 Unassigned class [ff00]: OpenVox Communication Co. Ltd. Device c200 (rev 01) Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx- Status: Cap- 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- Latency: 32, Cache Line Size: 64 bytes Interrupt: pin A routed to IRQ 17 Region 0: Memory at f7d00000 (32-bit, non-prefetchable) [size=32K] Kernel driver in use: x200 Kernel modules: x200
If the system does not detect the card, turn off the power, clear the slot or insert the card into another slot of the same type and re-detect it.
Download and install
Download 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-18-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
2.Installation
Dependency Package Installation
Before installing DAHDI, please check if all the dependencies are successfully installed, if the dependencies are not installed, the subsequent software installation will not proceed smoothly
dnf -y install epel-release dnf group -y install "Development Tools" dnf -y install git wget vim net-tools sqlite-devel psmisc bison ncurses ncurses-devel libtermcap-devel newt-devel libxml2-devel libtiff-devel gtk2-devel libtool libuuid-devel subversion initscripts kernel-devel kernel-devel-$(uname -r) crontabs cronie-anacron libedit libedit-devel zlib zlib-devel openssl openssl-devel gnutls-devel gcc gcc-c++
If the matching kernel-devel is not found in the update source, then you will need to download the matching RPM package and install it manually, or upgrade to the latest stable kernel version by doing the following
# dnf install kernel kernel-devel
After the installation, reboot the system to apply the new kernel and continue with the rest of the operations on the new kernel.
During the above dependency package detection process, if the dependency package is already installed, the system will indicate that it is installed and will not continue installing this package, and the user can run the next command to install other packages.
If it is not installed, it will be installed automatically until the system prompts for a successful installation.
Dahdi installation
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 systemctl enable dahdi
Libpri installation
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
The following problem is encountered when compiling
Solution, comment out the -Wall line in the libpri-1.6.0/Makefile file
Asterisk Installation
Convert the path to asterisk source package directory (XX stands for asterisk version) and run the following command to install asterisk.
cd asterisk-20.xx contrib/scripts/install_prereq install . /configure --libdir=/usr/lib64 --with-jansson-bundled=yes make make install make samples systemctl enable asterisk
3.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 modprobe X200 modprobe d100m modprobe b200m modprobe fxs200m modprobe fxo200m dahdi_genconf dahdi_cfg -vvvvvv
If there are any errors, please track down the cause. Wait until all errors are cleared and you can execute “dahdi_genconf” without any problems, then go to the next step. By running “dahdi_genconf”, it will automatically generate /etc/dahdi/system.conf and /etc/asterisk/dahdi-channels.conf. Check if the information in the generated files is consistent with your hardware settings, if not, you should modify your specific requirements. Don’t forget to make sure that dahdi-channels.conf is included in chan_dahdi.conf, if not, run the command.
#echo “#include dahdi-channels.conf” >> /etc/asterisk/chan_dahdi.conf.
The system.conf shows the following.
# Autogenerated by /usr/sbin/dahdi_genconf on Tue Mar 21 15:06:49 2023 # If you edit this file and execute /usr/sbin/dahdi_genconf again, # your manual changes will be LOST. # Dahdi Configuration File # # This file is parsed by the Dahdi Configurator, dahdi_cfg # # Span 1: D100M1/3 "OpenVox D100M (E1|T1) Card 0/3" span=1,1,0,ccs,hdb3,crc4 # termtype: te bchan=1-15,17-31 dchan=16 echocanceller=mg2,1-15,17-31 # Span 2: B200M/1 "OpenVox B200M (NT|TE) Card 2 Span 1" RED span=2,2,0,ccs,ami # termtype: te bchan=32-33 hardhdlc=34 echocanceller=mg2,32-33 # Span 3: B200M/2 "OpenVox B200M (NT|TE) Card 2 Span 2" RED span=3,3,0,ccs,ami # termtype: te bchan=35-36 hardhdlc=37 echocanceller=mg2,35-36 # Span 4: FXO200M/1 "OpenVox FXO200M Card 1" (MASTER) fxsls=38 echocanceller=mg2,38 fxsls=39 echocanceller=mg2,39 # Global data loadzone = us defaultzone = us The generated dahdi-channels.conf file shows the following # Span 1: D100M1/0 "OpenVox D100M (E1|T1) Card 0/0" CCS/HDB3/CRC4 RED group=0,11 context=from-pstn switchtype = euroisdn signalling = pri_cpe channel => 1-15,17-31 context = default group = 63 ; Span 2: B200M/1 "OpenVox B200M (NT|TE) Card 1 Span 1" AMI/CCS RED group=0,12 context=from-pstn switchtype = euroisdn signalling = bri_cpe_ptmp channel => 32-33 context = default group = 63 ; Span 3: B200M/2 "OpenVox B200M (NT|TE) Card 1 Span 2" AMI/CCS RED group=0,13 context=from-pstn switchtype = euroisdn signalling = bri_cpe_ptmp channel => 35-36 context = default group = 63 ; Span 4: FXO200M/3 "OpenVox FXO200M Card 3" ;;; line="38 FXO200M FXSKS (EC: MG2 - INACTIVE)" signalling=fxs_ks callerid=asreceived group=0 context=from-pstn channel => 38 callerid= group= context=default ;;; line="39 FXO200M FXSKS (EC: MG2 - INACTIVE)" signalling=fxs_ks callerid=asreceived group=0 context=from-pstn channel => 39 callerid= group= context=default
Add the corresponding board driver to /etc/dahdi/modules to automatically load the board driver on boot
#cp /etc/dahdi/modules.sample /etc/dahdi/modules
#chmod 0777 /etc/dahdi/modules
#vi /etc/dahdi/modules
Note: dahdi_gencon does not match with the TE/NT mode of BRI module, the default is TE mode, if the setting is NT mode, you need to change “signalling = bri_net_ptmp” in the above configuration, if you forget your jumper order, you can run the following command to see the TE/NT mode setting information.
# dmesg|grep wcb4xxp
”b200m: bus 0,blade 0,slot 1 module 0 te_mode=0, set to NT
b200m: bus 0,blade 0,slot 1 module 1 te_mode=0, set to NT ”
If you have modified the system.conf or dahdi-channels.conf file, please re-execute the following command to ensure the changes take effect
# dahdi_cfg -vvvvvv
The following is part of the output after executing the above command.
[root@localhost dahdi]# dahdi_cfg -vv
DAHDI Tools Version – 3.2.0
DAHDI Version: 3.2.0
Echo Canceller(s): MG2
Configuration
======================
SPAN 1: CCS/HDB3 Build-out: 0 db (CSU)/0-133 feet (DSX-1) SPAN 2: CCS/ AMI Build-out: 0 db (CSU)/0-133 feet (DSX-1) SPAN 3: CCS/ AMI Build-out: 0 db (CSU)/0-133 feet (DSX-1) Channel map: Channel 01: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 01) Channel 02: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 02) Channel 03: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 03) Channel 04: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 04) Channel 05: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 05) Channel 06: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 06) Channel 07: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 07) Channel 08: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 08) Channel 09: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 09) Channel 10: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 10) Channel 11: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 11) Channel 12: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 12) Channel 13: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 13) Channel 14: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 14) Channel 15: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 15) Channel 16: D-channel (Default) (Echo Canceler: none) (Slaves: 16) Channel 17: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 17) Channel 18: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 18) Channel 19: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 19) Channel 20: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 20) Channel 21: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 21) Channel 22: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 22) Channel 23: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 23) Channel 24: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 24) Channel 25: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 25) Channel 26: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 26) Channel 27: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 27) Channel 28: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 28) Channel 29: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 29) Channel 30: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 30) Channel 31: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 31) Channel 32: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 32) Channel 33: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 33) Channel 34: Hardware assisted D-channel (Default) (Echo Canceler: none) (Slaves: 34) Channel 35: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 35) Channel 36: Clear channel (Default) (Echo Canceler: mg2) (Slaves: 36) Channel 37: Hardware assisted D-channel (Default) (Echo Canceler: none) (Slaves: 37) Channel 38: FXS Loopstart (Default) (Echo Canceler: mg2) (Slaves: 38) Channel 39: FXS Loopstart (Default) (Echo Canceler: mg2) (Slaves: 39) 39 channels to configure.
Start Asterisk
asterisk -vvvvvvgc
If Asterisk is already running, run “asterisk -r” instead. In the CLI interface, run
“dahdi show channels”
localhost*CLI> dahdi show channels 1 from-pstn default In Service 2 from-pstn default In Service 3 from-pstn default In Service 4 from-pstn default In Service 5 from-pstn default In Service 6 from-pstn default In Service 7 from-pstn default In Service 8 from-pstn defaul In Service 9 from-pstn default In Service 10 from-pstn default In Service 11 from-pstn default In Service 12 from-pstn default In Service 13 from-pstn default In Service 14 from-pstn default In Service 15 from-pstn default In Service 17 from-pstn default In Service 1 from-pstn default In Service 19 from-pstn default In Service 20 from-pstn default In Service 21 from-pstn default In Service 22 from-pstn default In Service 23 from-pstn default In Service 24 from-pstn default In Service 25 from-pstn default In Service 26 from-pstn default In Service 27 from-pstn default In Service 38 from-pstn default In Service 39 from-pstn defaul In Service
4.Writing a dial plan
Please write a 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 board, the sip/100 extension will ring. If the extension created is xxxx, then change it to sip/xxxx
[from-pstn] exten => _X.,1,Dial(SIP/100,,r) exten => _X.,n,Hangup()
When SIP extension sets the context to from-internel, the call will go out from the E1 module channel 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.