Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save maruqmch/27beb98a0dd88bfff1b6da60a1aced9b to your computer and use it in GitHub Desktop.
Save maruqmch/27beb98a0dd88bfff1b6da60a1aced9b to your computer and use it in GitHub Desktop.
Asterisk

Debian 9 + Dahdi 2.11 + libpri 1.6 + Wanpipe 7 + Asterisk 13

1. Installing pre-requisites

1.1. Installing dev packages

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

1.2. Creating a combined Linux kernel header folder

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/.

2. Compiling Dahdi 2.11.1 from source

2.1. Download the source

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

2.2. Compile and Install

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

3. Compiling libpri 1.6.0 from source

3.1. Download the source

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

3.2. Compile and Install

tar -xf libpri-1.6.0.tar.gz -C /usr/src
cd /usr/src/libpri-1.6.0
make -j4
make install

4. Compiling Asterisk LTS 13.18.2 from source

4.1. Download source

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

4.2. Compile and Install

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

4.3. Install init scripts

make config

5. Compiling Sangoma driver (wanpipe) from source

5.1. Getting the source code

wget -c ftp://ftp.sangoma.com/linux/current_wanpipe/wanpipe-7.0.24.tgz
tar -xf wanpipe-7.0.24.tgz -C /usr/src

5.2. Patch wancfg_dahdi

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

5.3. Compile and Install

./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 ...

5.4. Configure card

wancfg_dahdi

... follow steps on the screen, make sure asterisk restarted at the end ...

6. First commands in Asterisk (for rookies)

asterisk -r
pri show spans
dahdi show channels

Tab completion works in the asterisk cli shell ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment