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 ...
There are really no documentation regarding these kind of changes on structure of kernel header files or at least I'm unable to find if there's any. However what you did is more than enough. I spent two days and I couldn't find anything near to a solution until I came across your gist.
I was wondering why wanpipe is complaining about a not configured kernel source while I am having only kernel headers installed and as far as I know kernel headers suffice for wanpipe build. Anyway, It turned out that I was missing autoconf and automake dependencies. After installing them
Wanpipe Utilities
successfully built despite the warning about a not configured kernel source.Afterward, I encountered another problem with the Wanpipe kernel module which was not copied to
/lib/modules/4.9.0-9-amd64
directory and instead it was placed in/lib/modules/4.9.168
causing them not possible to be loaded into kernel (Symlink didn't help either). I fixed this problem by running two following commands in addition to yours: