AstRecipes » Compiling Asterisk 1.8 on CentOS 5.5 64-bitAfter the first official release of Asterisk 1.8, I decided to test how it is and compiled it on a clean-slate 64-bit CentOS system. The experience went very smoothly and the configure script was able to pick up all the packages needed to activate various interesting extensions (it was not always so with previous releases). Our target is compiling Asterisk 1.8.0 with the following features/extensions:
- MySQL storage and dialplan
- DAHDI drivers (I still call them Zaptel!) for analog lines
- Full docs
- CURL available for usage and dialplan
- HTTP integration
- SNMP agents
- Calendars (they look yummy!)
- Google Talk integration Setting up the environment The following packages have to be installed in order to allow compilation of all required modules. Some of these packages may or may not be already installed on your system.
I use as a reference a CentOS 5.5 x86_64 with kernel 2.6.18-194.17.4.el5-x86_64.
The following packages should all be present to allow compiling Asterisk:
[root@Centos64]# uname -a
Linux Centos64 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
And these are optional and required for specific modules to build:
yum install gcc-c++ make gnutls-devel kernel-devel
yum install libxml2-devel ncurses-devel subversion doxygen texinfo
We will compile under /usr/src . Compiling DAHDI and tools and libpri Since the days of Zaptel, we now have to install both DAHDI and its tools.
yum install curl-devel net-snmp-devel neon-devel
Luckily both are packaged together and can be compiled in a single pass. I immediately relize that the symbolic link used to find the kernel top .configure is broken; in my freshly-installed CentOS system /lib/modules/2.6.18-194.el5/build is a link
to a non-existent ../../../usr/src/kernels/2.6.18-194.el5-x86_64. Finding the correct location for the kernel build is easy-peasy anyway; instead of correcting the link, I
prefer to override the check using an environment variable:
Internet connectivity is needed to download the firmwares for the various modules to be built - wouldn't it be better to package them with the main files? Compiling libpri is - as always - a breeze:
tar zxvf dahdi-linux-complete-2.4.0+2.4.0.tar.gz
Compiling optional dependencies A couple of libraries are not availble in the CentOS repository and need to be installed manually to enjoy the benefits of 1.8. The first is iksemel, an XML parser library for Jabber applications that is needed for GTalk integration:
tar zxvf libpri-1.4.12-beta2.tar.gz
The other one is libical, an iCal library used to activate integration with iCal and WebDAV calendars:
tar zxvf iksemel-1.4.tar.gz
I used version 0.44 because the 0.46 version does not compile out-of-the-box - it misses the template Makefiles from the downloadable archive. By the way, how many projects on the Internet bear the very name name libical? please... On the other side, by adding this library, we get res_calendar_caldav, res_calendar_exchange and res_calendar_icalendar - that's not
tar zxvf libical-0.44.tar.gz
too bad. If you also want to build the PDF manual (but you don't need to, you will need an optional tool called rubber that compiles Latex into a PDF:
tar zxvf rubber-1.1.tar.gz
Run target make pdf after building Asterisk. Compiling Asterisk 1.8 Nothing could be easier than building Asterisk now.
After running menuselect, choose the modules you want to build. I always build docs so that I can copy them to an intranet webserver sand use them as a local reference in case it's needed. Asterisk 1.8 comes with an almost 300-page User Manual available under doc/tex/asterisk.pdf. Starting Asterisk Start Asterisk by typing:
tar zxvf asterisk-1.8.0.tar.gz
#this is ony for format MP3 - SVN required
This will start Asterisk in the background.
Will display the Asterisk version.
[root@Centos64]# asterisk -rx "core show version"
Asterisk 1.8.0 built by root @ Centos64 on a x86_64 running Linux on 2010-10-28 16:12:05 UTC
Will connect you to the Asterisk shell. Good luck! See also
* Compiling Asterisk 1.4 with TDM400 and H323
* Compiling Asterisk with OH323
* Installing the Asterisk GUI for 1.4
* Removing Asterisk