At $WORK2$ we had the express need to migrate from Asterisk 1.6 to 1.8. We are running Debian squeeze which only provides 1.6.9 as its stable version,which is fine, but when you have a bug that requires vendor support you get forced to upgrade. I didnt really want to rebuild packages from source (i hate building from source on a package managed system).

I discovered that asterisk provides its own debian/ubuntu repository for its packages which is awesome, so on our test box we quickly deployed it. And then during testing we ran into a snag. Namely that its next to impossible to find instructions on how to get the format_mp3.so module for mp3 support. In Debian its packaged with it, but due to some licensing who-ah asterisk doesnt ship them. i tried copying an older copy, and one out of the Debian squeeze repository but it wouldn’t load cause it was built with different compile time options.

After much reading and playing arround, i worked out how to build that module.. ANd since it took me the better part of a night to work it out, heres how i did it 🙂

Grab everything required to build the source for asterisk, some other libraries, the build tools, the actual source, and then configure it for our system.

apt-get install build-essential
apt-get build-dep asterisk
apt-get install libncurses5-dev libncursesw5-dev libxml2-dev
cd /usr/src
apt-get source asterisk
cd asterisk-1.8.11.1
./configure
make menuselect

In the make menu select, go into addons, and tick off format_mp3 (i think x was save and exit)

contrib/scripts/get_mp3_source.sh

This goes and grabs out of SVN the latest mp3 stuff, this is done for the packaging stuff as mentioned above

make addons

Assuming your make addons ran without errors, its built the module.. to install it run:
make addons-install
Now to restart asterisk
/etc/init.d/asterisk restart
and finally to confirm it actually loaded
asterisk -rx 'core show file formats'

as long as mp3 is in your list, your golden!