Update: I’ve fixed a typo – I was suggesting you edit /etc/yum.repos.d/trixbox, but it was actually trixbox.repo. Also, I’ve used the copy-and-paste method a couple of times, and it seems to work well. Note that the current CentOS kernel version is .4, and if there’s a new kernel release, you need to do this:
yum -y update
cd /usr/src/zaptel-1.2.10
make install
This ensures that the zaptel modules are built for the current kernel.
Update2: Upgraded the versions in this document to the latest released by Digium.
Firstly, you should be aware that this will stop the ‘trixbox’ stuff from being updated. This includes HUDlite, SugarCRM, any of the non-CentOS stuff. This isn’t all that much of a hassle, at the time of writing this article and hopefully it won’t become one either. If it does, then I’ll update this article, anyway 8)
Also, as you’re moving away from using trixbox’s updates altogether, ‘trixbox-update.sh’ probably shouldn’t be used any more either. I had a quick look at it, and it does a pile of stuff that isn’t needed (any more). You can just stick with doing a ‘yum update’ every couple of days to make sure that your operating system is up to date.
For those that don’t want to know why or how they’re doing things, at the bottom of this article is 12 or so lines that you can copy-and-paste into a root shell of your Trixbox machine to do the upgrade. No intelligence needed! You can read along with it up here tho.
The first thing you need to do is edit /etc/yum.repos.d/trixbox.repo and change ‘enabled=1’ to ‘enabled=0’. This disables the trixbox specific repository, but leaves it there for you to enable later if you want. (Note that the “cut’n’paste” script below deletes it, so if you want to keep it you might want to not copy and paste the first line of it). Then run ‘yum update’. This ensures that your CentOS installation is up to date. If you’re running a SMP machine (or hyperthreaded, or dual core), you need to do ‘yum install kernel-smp-devel’ too. Delete the old safe_asterisk script (rm -f /usr/sbin/safe_asterisk) and you’re ready to start downloading.
Download and compile the latest libpri, zaptel, asterisk and asterisk-addons (in that order):
cd /usr/src
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.13.tar.gz
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.10.tar.gz
wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.4.tar.gz
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-addons-1.2.5.tar.gz
Uncompress and compile them all:
tar zxvf asterisk-addons-1.2.5.tar.gz
tar zxvf libpri-1.2.4.tar.gz
tar zxvf zaptel-1.2.10.tar.gz
tar zxvf asterisk-1.2.13.tar.gz
cd libpri-1.2.4
make install
cd ../zaptel-1.2.10
make install
cd ../asterisk-1.2.13
make install
cd ../asterisk-addons-1.2.5
make install
And, finally, make sure that app_trunkisavail.so is gone, as it causes nothing but problems!
rm -f /usr/lib/asterisk/modules/app_trunkisavail.so
That’s it. That’ll ‘convert’ a trixbox machine back to a reasonably standard CentOS machine. All the trixbox functionality will still work, but you won’t be using the trixbox ‘yum’ repository any more, so your zaptel and asterisk won’t be clobbered. You can now stop and restart everything:
asterisk -r
stop now
/etc/init.d/zaptel restart
amportal start
If, after that, you get ‘asterisk won’t start’ errors, check /var/log/asterisk/full and you’ll see an error at the bottom of the file, possibly relating to a module. If it’s chan_zap, then for some reason your zaptel didn’t compile. Go back into the zaptel directory and do a ‘make install’ again and look at the error message! If it starts OK, you can check to see that it’s worked. Just ype ‘asterisk -r’ and you should see this:
Asterisk 1.2.13, Copyright (C) 1999 - 2006 Digium, Inc. and others.
Created by Mark Spencer
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'show license' for details.
=========================================================================
Connected to Asterisk 1.2.13 currently running on asterisk1 (pid = 4668)
-- Remote UNIX connection
Verbosity is at least 3
asterisk1*CLI>
asterisk1*CLI>
Note that the version there (in bold) is 1.2.13 – the latest released version from Digium. Typing ‘quit’ brings you back to the console.
Cheat-Sheet
For those that want a simple “Cut’n’Paste” way of doing things, here’s all the information above pasted into a couple of lines:
yum -y install kernel-smp-devel
yum -y update
sed -i s/enabled=1/enabled=0/ /etc/yum.repos.d/trixbox.repo
rm -rf /usr/sbin/safe_asterisk /usr/lib/asterisk/modules/app_trunkisavail.so
cd /usr/src
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.13.tar.gz
wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.10.tar.gz
wget http://ftp.digium.com/pub/libpri/releases/libpri-1.2.4.tar.gz
wget http://ftp.digium.com/pub/asterisk/releases/asterisk-addons-1.2.5.tar.gz
tar zxvf asterisk-addons-1.2.5.tar.gz
tar zxvf libpri-1.2.4.tar.gz
tar zxvf zaptel-1.2.10.tar.gz
tar zxvf asterisk-1.2.13.tar.gz
cd libpri-1.2.4 && make install
cd ../zaptel-1.2.10 && make install
cd ../asterisk-1.2.13 && make install
cd ../asterisk-addons-1.2.5 && make install
asterisk -rx "stop now"
/etc/init.d/zaptel restart
amportal start
Enjoy!