Wednesday, April 1, 2009

Compiling Asterisk 1.4.x with H323 channel driver




This is just a step by step procedure I followed to compile Asterisk 1.4 version with H323 channel driver

apt-get install flex bison

  • Here we download and compile Asterisk
Compile zaptel driver

cd /usr/src
wget http://downloads.digium.com/pub/zaptel/releases/zaptel-1.4.10.1.tar.gz
cd zaptel-1.4.10
./install_prereq test
./configure
make
make install


Compile libpri

cd /usr/src
wget http://downloads.digium.com/pub/libpri/releases/libpri-1.4.4.tar.gz
cd libpri-1.4.4
make
make install


Compile Asterisk

cd /usr/src
wget http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.20.tar.gz
cd asterisk-1.4.20
./configure
make menuselect
make
make install
make samples


  • Compiling pwlib and openH323 for H323 channel driver
NOTE: openH323 v1.19.0.1 with corresponding pwlib v1.11.0. not pwlib_v1.11.1.

This is required since openh323 will look for compiler.h
touch /usr/include/linux/compiler.h

Compile pwlib

cd /usr/src
wget http://downloads.sourceforge.net/openh323/pwlib-v1_11_0-src-tar.gz?use_mirror=nchc
tar zxvf pwlib-v1_11_0-src-tar.gz
cd pwlib_v1_9_0
./configure
make
make install
make opt
export PWLIBDIR=/usr/src/
pwlib-v1_11_0

Compile openh323

cd /usr/src
wget http://downloads.sourceforge.net/openh323/openh323-v1_19_0_1-src-tar.gz?use_mirror=jaist
tar zxvf openh323-v1_19_0_1-src-tar.gz
cd openh323-v1_19_0_1
./configure
make
make install
make opt
export OPENH323DIR=/usr/src/openh323-v1_19_0_1


OpenH323 generates its libs in /usr/local/lib but my Linux uses /usr/lib for shared libraries, we'll need to copy the genberated libraries from /usr/local/lib to /usr/lib.

cp /usr/local/lib/* /usr/lib
Compile Asterisk

cd /usr/src/asterisk-1.4.20
./configure
make menuselect ## check if h323 is enabled under channels
cd channels/h323
make
make opt
cd ..
cd ..
make install



Now we make sure the channel driver exists and is loadable:

ldd /usr/lib/asterisk/modules/chan_h323.so

start asterisk

/etc/init.d/asterisk start