Un-Trixbox your trixbox

There’s been a lot of people that have had problems with Trixbox 1.2, not limited to, but including queues not working, the ‘Red Bar of Evil’ not reloading asterisk, dropouts after a short period of time, random audio stutterings, x-lite being unable to connect, and a pile of others. This has caused me to help a pile of people who’ve joined #freepbx (the IRC channel) to update their Asterisk to a nice standard released version. As this has happened quite a few times now, I thought it was time to spell out exactly how to do it. I actually did this for a paying customer, and step-by-step copied and pasted everything I did, so this should work flawlessly for any trixbox-1.2 based machine. Of course, this will also work on a trixbox 1.1 machine too, if you want to bring it up to date.

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 © 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
asterisk1CLI>
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!

Hello,
New to freepbx. I installed a trixbox with centos 5.2, connected to my network, added three extensions and had two x-lite workstation on the internet connect to the box. When I try to call an extension from the other, the x-lite fails after sometime. What AMI doing wrong? I kept most of the settings on the default.My next next test was a a linksysrt31p2 that I managed to unlock and had its settings point to my trixbox, but when I pick the phone it gets a fax tone.
Any help would be appreciated.

ubuntukips,

As you have probably figured out by now. When you posted you did something that should not have been done.

Those items are:

  1. Post non-relevant questions in the forum area not in the news or documentation areas.
  2. do not attach a question to a random subject. You are better off starting a new question that way people will see your question and answer it as what you have asked has NOTHING to do with un-trixing your box.

Are the instructions on how to un-trixbox your system still correct for later versions or did the requirements change?

I’m running Trixbox 2.6.18-92.1.18els (SMP) on CentOS 5.2. I know it’s not the most current version of Trixbox but it’s newer than any reference I see in the thread. With the now silent Trixbox forum there may be more people interested in converting more recent versions.