apt-get update
apt-get install -y build-essential flex bison libreadline-dev libssl-dev gettext libtiff-dev uuid-dev libjansson-dev libxml2-dev libsqlite3-dev doxygen libncurses-dev libtool automake autoconf linux-headers-4.9.0-4-amd64 linux-headers-4.9.0-4-common linux-kbuild-4.9 wget vim
Sangoma driver needs this, is Debian a supported OS?
cd /usr/src
ln -s linux-headers-4.9.0-4-common linux
cd /usr/src/linux
ln -s /usr/src/linux-headers-4.9.0-4-amd64/.config .
ln -s /usr/src/linux-headers-4.9.0-4-amd64/.kernelvariables .
ln -s /usr/src/linux-headers-4.9.0-4-amd64/Module.symvers .
ln -s /usr/src/linux-headers-4.9.0-4-amd64/include/config include/.
ln -s /usr/src/linux-headers-4.9.0-4-amd64/include/generated include/.
ln -s /usr/src/linux-headers-4.9.0-4-amd64/arch/x86/kernel arch/x86/.
ln -s /usr/src/linux-headers-4.9.0-4-amd64/arch/x86/include/generated arch/x86/include/.
wget -c http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-2.11.1+2.11.1.tar.gz
... or alternatively ...
wget -c http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gz
tar -xf dahdi-linux-complete-2.11.1+2.11.1.tar.gz -C /usr/src
cd /usr/src/dahdi-linux-complete-2.11.1+2.11.1
make -j4
make install
wget -c http://downloads.asterisk.org/pub/telephony/libpri/libpri-1.6.0.tar.gz
... or alternatively ...
wget -c http://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gz
tar -xf libpri-1.6.0.tar.gz -C /usr/src
cd /usr/src/libpri-1.6.0
make -j4
make install
wget -c http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13.18.2.tar.gz
... or alternatively ...
wget -c http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gz
tar -xf asterisk-13.18.2.tar.gz -C /usr/src
cd /usr/src/asterisk-13.18.2
./configure
# optional: make menuselect
make -j4
make install
make config
wget -c ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-7.0.24.tgz
tar -xf wanpipe-7.0.24.tgz -C /usr/src
cd /usr/src/wanpipe-7.0.24
vim util/wancfg_zaptel/wancfg_dahdi
Update at the end from
./wancfg_zaptel.pl --dahdi --conf_dir=$WAN_BASE $ARGS
to
/usr/bin/perl -I ${WAN_HOME}/wancfg_zaptel ./wancfg_zaptel.pl --dahdi --conf_dir=$WAN_BASE $ARGS
./Setup install
Tips:
- Specify /usr/src/linux as your kernel source folder ...
- Don't worry about the kernel version mismatch ...
- Visually verify the compilation ...
- If kernel module does not load check output of dmesg ...
wancfg_dahdi
... follow steps on the screen, make sure asterisk restarted at the end ...
asterisk -r
pri show spans
dahdi show channels
Tab completion works in the asterisk cli shell ...
The kernel header files used to be under one folder, but then distributions started to split it up into different packages based on architecture by some reason so they ended up in different subfolders. These links just reunite the folders again, I guess there is a better way of doing it, but it did the job.
make dep is history, it used to calculate the dependencies required to compile the kernel after the linux kernel's configuration was done. You can try
make menuconfig
and then save and exit without touching anything. It will pickup the proper values from the .config file which was already linked.