You are probably interesting to compile Asterisk with H323, after lot of test it has been successfully compiled but is not easy when you don't know Linux so if you follow this tutorial it will be easy for the majority of the people:
Installation of the package necessary on CentOS 5.1:
yum -y install ncurses ncurses-devel openssl openssl-devel zlib zlib-devel bison bison-devel glibc gcc kernel-devel flex
Installation of the package on Debian:
pt-get install libc6 libc6-dev libncurses5 libncurses5-dev libssl-dev openssl libssl0.9.8 flex m4 bison libpopt-dev libdv4-dev libpopt-dev zlib1g zlib1g-dev
Now you need to download the package for Asterisk from the folder /usr/src/:
mkdir -p /usr/src/Asterisk_and_H323
wget -P /usr/src/Asterisk_and_H323 http://www.voxgratia.org/releases/pwlib-v1_10_0-src-tar.gz
wget -P /usr/src/Asterisk_and_H323 http://www.voxgratia.org/releases/openh323-v1_18_0-src-tar.gz
wget -P /usr/src/Asterisk_and_H323 http://downloads.digium.com/pub/libpri/releases/libpri-1.4.3.tar.gz
wget -P /usr/src/Asterisk_and_H323 http://downloads.digium.com/pub/asterisk/releases/asterisk-1.4.19.tar.gz
Do not use another release more recent of OpenH323/Pwlib because the dependencies are not stable.
It can arrives sometimes that the compilation doesn't work due to a missing files /usr/include/linux/compiler.h, so it could be nice to create in all case the file below:
vi /usr/include/linux/compiler.h
Below the content of the compiler.h:
#ifndef __LINUX_COMPILER_H
#define __LINUX_COMPILER_H
#define likely(x) __builtin_expect((x),1)
#define unlikely(x) __builtin_expect((x),0)
#endif /* __LINUX_COMPILER_H */
Compilation de PWLib:
cd /usr/src/Asterisk_and_H323
tar -xvzf pwlib-v1_10_0-src-tar.gz
cd pwlib_v1_10_0/
./configure --prefix=/usr
make opt
make install
export PWLIBDIR=/usr/src/Asterisk_and_H323/pwlib_v1_10_0
Compilation of the library OpenH323:
cd /usr/src/Asterisk_and_H323
tar -xvzf openh323-v1_18_0-src-tar.gz
cd openh323_v1_18_0
./configure --prefix=/usr
make opt
make install
export OPENH323DIR=/usr/src/Asterisk_and_H323/openh323_v1_18_0
Compilation de Libpri:
cd /usr/src/Asterisk_and_H323
tar -xvzf libpri-1.4.3.tar.gz
cd libpri-1.4.3
make install
Compilation d'Asterisk:
You can observe that there is 2 times the make command, it permits to check if the compilation of H323 has been successfully done, if it is not the case please re-check the step above.
cd /usr/src/Asterisk_and_H323
tar -xvzf asterisk-1.4.19.tar.gz
cd asterisk-1.4.19/
./configure --prefix=/usr
make menuselect (The modification can damage the compilation)
make
make
make install
make samples
make config
asterisk
In case of failure:
- Check the version of the software used. I can certify that all version used on CentOS works correctly. Take care about "./configure --prefix=/usr".
To uninstall:
In the installation folder (/usr/src/Asterisk_and_H323/...): make uninstall et rm
Please find the French version of this HOWTO originally made by my colleague Etienne:
Compiler Asterisk avec H323