BreadCrumbs: Asterisk Install

Asterisk Install

From Luke Jackson

Jump to: navigation, search

Contents

Software Install

Fedora Core

Summary

A friend called and asked me for some help installing Asterisk 1.4 on his system so lets begin.

Download the tars from digium

Make yourself a nice little place to place in /usr/src/

mkdir /usr/src/asterisk
cd /usr/src/asterisk
wget http://ftp1.digium.com/pub/asterisk/asterisk-1.4.4.tar.gz
wget http://ftp1.digium.com/pub/asterisk/asterisk-addons-1.4.1.tar.gz
wget http://ftp1.digium.com/pub/zaptel/zaptel-1.4.2.1.tar.gz
wget http://ftp1.digium.com/pub/libpri/libpri-1.4.0.tar.gz

Extract the tars

tar zxvf asterisk-1.4.4.tar.gz
tar zxvf asterisk-addons-1.4.1.tar.gz
tar zxvf libpri-1.4.0.tar.gz
tar zxvf zaptel-1.4.2.1.tar.gz

Check the Kernel for compatibility

This is probably the most complex part so pay attention.

You will need the kernel sources to compile zaptel sounds easy right? Wrong with dual core CPUs being so common these days you need to make sure you have either one core or 1< cores.

For those of you with only one core issue this command:

yum install kernel-devel

For those of you with more than one issue this command:

yum install kernel-smp-devel

Compile zaptel

Some people have issues with linking to there kernel sources. If you get errors like this:

You do not appear to have the sources for the kernel installed.

You need to symlink to the kernel source as stated in the Readme.Linux26

ln -s /lib/modules/`uname -r`/build/ `uname -r`

Now you are ready to configure and compile zaptel. Change to the zaptel directory and lets get dirty!

cd /usr/src/asterisk/zaptel*

Lets check out what it is actually installing and then save the make config by pressing 'x'

make menuconfig

Now you are ready to make if everything goes right you shouldn't see any errors.

make

Now install...

make install

If everything went well you should end up with something like this and your prompt returning below.

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.
***
[root@localhost zaptel-1.4.2.1]# 

Last we have to generate the configuration files.

make config

Compile libpri

If you will be using a Digium or Sangoma telephony card that supports T1/E1 signaling do this step as well.

cd /usr/src/asterisk/libpri*
make install

Compile Asterisk

Finally you are in the home stretch! Now all thats left is compiling asterisk and its addons.

cd /usr/src/asterisk/asterisk*

Lets configure make and check out the options via menuconfig

./configure

More output for fun:

configure: creating ./config.status
config.status: creating build_tools/menuselect-deps
config.status: creating makeopts
config.status: creating channels/h323/Makefile
config.status: creating include/asterisk/autoconfig.h

               .$$$$$$$$$$$$$$$=..      
            .$7$7..          .7$$7:.    
          .$$:.                 ,$7.7   
        .$7.     7$$$$           .$$77  
     ..$$.       $$$$$            .$$$7 
    ..7$   .?.   $$$$$   .?.       7$$$.
   $.$.   .$$$7. $$$$7 .7$$$.      .$$$.
 .777.   .$$$$$$77$$$77$$$$$7.      $$$,
 $$$~      .7$$$$$$$$$$$$$7.       .$$$.
.$$7          .7$$$$$$$7:          ?$$$.
$$$          ?7$$$$$$$$$$I        .$$$7 
$$$       .7$$$$$$$$$$$$$$$$      :$$$. 
$$$       $$$$$$7$$$$$$$$$$$$    .$$$.  
$$$        $$$   7$$$7  .$$$    .$$$.   
$$$$             $$$$7         .$$$.    
7$$$7            7$$$$        7$$$      
 $$$$$                        $$$       
  $$$$7.                       $$  (TM)     
   $$$$$$$.           .7$$$$$$  $$      
     $$$$$$$$$$$$7$$$$$$$$$.$$$$$$      
       $$$$$$$$$$$$$$$$.                

configure: Package configured for: 
configure: OS type  : linux-gnu
configure: Host CPU : i686

So now lets get into menuconfig where we can see exactly how it will be configured.

make menuconfig

You should end up with a screen like below:

*************************************
      Asterisk Module Selection
*************************************

         Press 'h' for help.

   ---> 1.  Applications
        2.  Call Detail Recording
        3.  Channel Drivers
        4.  Codec Translators
        5.  Format Interpreters
        6.  Dialplan Functions
        7.  PBX Modules
        8.  Resource Modules
        9.  Voicemail Build Options
        10. Compiler Flags
        11. Module Embedding
        12. Core Sound Packages
        13. Music On Hold File Packages
        14. Extras Sound Packages

Hit 'h' to get a basic idea of how to use menuconfig

*************************************
      Asterisk Module Selection
*************************************

         Press 'h' for help.

   scroll              => up/down arrows
   toggle selection    => Enter
   select              => y
   deselect            => n
   select all          => F8
   deselect all        => F7
   back                => left arrow
   quit                => q
   save and quit       => x

   XXX means dependencies have not been met
       or a conflict exists

   < > means a dependency has been deselected
       and will be automatically re-selected
       if this item is selected

   ( ) means a conflicting item has been
       selected

Once you are satisfied and done nosing around hit 'x' and it will save and quit. Now lets stop messing around and make + make install

make
 +--------- Asterisk Build Complete ---------+
 + Asterisk has successfully been built, and +
 + can be installed by running:              +
 +                                           +
 +               make install                +
 +-------------------------------------------+
make install
 +---- Asterisk Installation Complete -------+
 +                                           +
 +    YOU MUST READ THE SECURITY DOCUMENT    +
 +                                           +
 + Asterisk has successfully been installed. +
 + If you would like to install the sample   +
 + configuration files (overwriting any      +
 + existing config files), run:              +
 +                                           +
 +               make samples                +
 +                                           +
 +-----------------  or ---------------------+
 +                                           +
 + You can go ahead and install the asterisk +
 + program documentation now or later run:   +
 +                                           +
 +              make progdocs                +
 +                                           +
 + **Note** This requires that you have      +
 + doxygen installed on your local system    +
 +-------------------------------------------+

I would recommend reading the security documentation since it is in ALL CAPS.

I usually generate the sample files as they haven't caused me any issues yet but you don't really have to if you know what you are doing.

make samples

Lastly we have to setup and configure the addons.

cd /usr/src/asterisk/asterisk-addons*
make
make install

Thats it you should now have a fully functioning Asterisk box. Check it out by moving yourself to:

cd /etc/asterisk

Only thing left to figure out now is how to administrate it?

Running

Startup

Standard

/usr/sbin/safe_asterisk

/etc/init.d/

Starting processes at boot time are different among the different operating systems so it is best to consult your OS documentation for how to do this.

However there are some sample scripts located in the original asterisk tar. For instance i found mine under:

/usr/src/asterisk/asterisk-1.4.4/contrib/init.d

Using screen

Start Asterisk at boot time with a program called "screen". Include this command in the /etc/rc.local:

/usr/bin/screen -L -d -m /usr/sbin/asterisk -vvvvvvvvvvvvvvvvvvvvvgc

This will launch the very verbose asterisk console detached with screen logging. You can reattach to it by typing:

screen -r

The screen log is saved to /screenlog.0

Hardware Install

Sangoma

http://wiki.sangoma.com/wanpipe-linux-asterisk-install

FAQs

configure: error: *** termcap support not found

yum install libtermcap libtermcap-devel newt newt-devel ncurses ncurses-devel
Personal tools