Looking over my blog stats, most of you reach me via a Google search for FC7 and Asterisk. With that, this post will detail installing Asterisk on FC6-7 or any modern Linux distribution for that matter as nothing here is Fedora specific anyways.
Getting Asterisk compiled and installed is quite trivial, so I thought it would be wise to spend a few moments examining the hardware you intend to use with Asterisk. If you are using a PSTN interface card through ZapTel such as Digium TDM or something else, you need to be aware that these cards generate a tremendous number of interrupts during their operation and the target system must be able to handle these interrupts quickly.
I’ve deployed Asterisk at the office where it provides call queues, automatic attendant, voice-mail and telephony services for 30+ people. This particular setup runs on a Dell 2850 with 1GB of RAM at 3.0ghz with a Digium TDM2400 card to analog PSTN lines. This setup’s load average rarely peeks over 0.01 during the day and the only complaint is occasional echo on the PSTN lines. We will soon be ditching the PSTN lines in favour of SIP channels from Primus providing both a huge cost savings and improved call quality.
At home, I’ve run Asterisk on a PIII-800 with 256MB of RAM using SIP only (no PSTN hardware) and have never had a problem with load related glitching or call drops.
The point in all this is to ensure that you select hardware appropriate for the application; don’t expect that old surplus P-III550 to serve as a corporate PBX for very long; but for home purposes that’ll only ever have 1 or 2 concurrent calls, it’ll probably be fine.
If you go with PSTN hardware, make sure to run the “zaptest” (or other for non-Zaptel hardware) program to test the interrupt timings.
Getting on with the installation, you should probably start by making sure any distribution specific Asterisk packages or Asterisk look-a-like clones are removed before you start. On FC7, OpenPBX is an available package, but in my opinion isn’t worth wasting the download. Go and get Asterisk from Digium directly and build your own.
This assumes you have a working build environment; generally the development packages for your particular distribution should have installed the basics like “make” and “gcc”… You’re really on your own here.
We’re going to be compiling Asterisk 1.2 at this time. Although 1.4 is out and in reasonable shape, I only have 1.2 experience and I’m quite happy with it so far.
Download the following source packages:
Asterisk 1.2.23 The Asterisk Code
Add-Ons 1.2.7 Asterisk Add-ons
Asterisk Sounds Pre-Recorded PBX sounds.
If you are going to be using ZapTel hardware, you’re going to have to build a kernel module. Download ZapTel as well.
To make things really easy, I’m going to include the commands to get this done. Lets start with Asterisk. Get, untar and build.
[skin@borg ~]$ mkdir asterisk [skin@borg ~]$ cd asterisk/ [skin@borg asterisk]$ ls [skin@borg asterisk]$ wget http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.23.tar.gz --21:22:42-- http://ftp.digium.com/pub/asterisk/releases/asterisk-1.2.23.tar.gz Resolving ftp.digium.com... 216.27.40.102 Connecting to ftp.digium.com|216.27.40.102|:80... connected. ...downloading... [skin@borg asterisk]$ tar -xzvf asterisk-1.2.23.tar.gz ... lots of files... [skin@borg asterisk]$ cd asterisk-1.2.23 [skin@borg asterisk-1.2.23]$ make ...compiling... +--------- Asterisk Build Complete ---------+ + Asterisk has successfully been built, but + + cannot be run before being installed by + + running: + + + + make install + +-------------------------------------------+ [skin@borg asterisk-1.2.23]$ su root -c "make install" [skin@borg asterisk-1.2.23]$ su root -c "make samples"
If everything worked out, you are the proud owner of a new Asterisk installation. There are a couple more things that need to be done though.
Lets do the sounds next.
[skin@borg asterisk-1.2.23]$ cd .. [skin@borg asterisk]$ wget http://ftp.digium.com/pub/asterisk/releases/asterisk-sounds-1.2.1.tar.gz [skin@borg asterisk]$ tar -xzvf asterisk-sounds-1.2.1.tar.gz [skin@borg asterisk]$ cd asterisk-sounds-1.2.1 [skin@borg asterisk-sounds-1.2.1]$ su root -c "make install"
Lets do the add-ons now. If you want to use MySQL for CDR support, you need to make sure the MySQL-devel packages are installed for your distro before you run this. It going to look for mysql.h, errmsg.h and mysql_version.h.
[skin@borg asterisk]$ cd .. [skin@borg asterisk]$ wget http://ftp.digium.com/pub/asterisk/releases/asterisk-addons-1.2.7.tar.gz [skin@borg asterisk]$ tar -xzvf asterisk-addons-1.2.7.tar.gz [skin@borg asterisk]$ cd asterisk-addons-1.2.7 [skin@borg asterisk-addons-1.2.7]$ make [skin@borg asterisk-addons-1.2.7]$ su root -c "make install"
At this point, you should have a fully installed, ready for configuration Asterisk PBX. The installation gets a little more complicated if you need ZapTel for some PSTN hardware. If you’re planning to use the Conference Room feature, you’re going to need a ZapTel timer even if you don’t have hardware. It probably a good idea to build ZapTel anyways.
Like above, Get, untar, and build ZapTel.
[skin@borg asterisk-addons-1.2.7]$ cd .. [skin@borg asterisk]$ wget http://ftp.digium.com/pub/zaptel/releases/zaptel-1.2.19.tar.gz [skin@borg asterisk]$ tar -xzvf zaptel-1.2.19.tar.gz [skin@borg asterisk]$ cd zaptel-1.2.19 [skin@borg asterisk]$ make [skin@borg asterisk]$ su root -c "make install" Building /etc/modprobe.d/zaptel... *** *** WARNING: *** If you had custom settings in /etc/modprobe.d/zaptel, *** they have been moved to /etc/modprobe.d/zaptel.bak. *** *** In the future, do not edit /etc/modprobe.d/zaptel, but *** instead put your changes in another file *** in the same directory so that they will not *** be overwritten by future Zaptel updates. ***
Now we can try the ZapTel basics. Become root and try:
[root@borg ~]# modprobe zaptel [root@borg ~]# lsmod Module Size Used by wctdm 37056 0 zaptel 183972 1 wctdm crc_ccitt 6337 1 zaptel . . .
The lsmod should show ZapTel loaded. This doesn’t imply that your hardware is configured, just that the ZapTel basics are in place. You’ll have to reference the specific module and configuration for your hardware, but the basics should be in place to get you going.