Asterisk Compile

Compile Asterisk

Ok, you have the source code to Asterisk sitting in your /usr/src/asterisk directory. Now what?

cd /usr/src/asterisk
make clean
make install

Note: By default, Asterisk runs as the root user. This is a security liability. Consider:

Executable files installed:
  • /usr/sbin/asterisk: The Asterisk daemon that runs your PBX
  • /usr/sbin/safe_asterisk: A shell script to make sure Asterisk keeps on running
  • /usr/sbin/astgenkey
  • /usr/sbin/astman: A very very basic manager interface. See astman for details.

Other directories structures created:
  • /usr/include/asterisk: Contains header files required for building asterisk applications, channel drivers, and other loadable modules.
  • /usr/lib/asterisk: Contains binary objects related to Asterisk which are architecture-specific.
  • /var/lib/asterisk: Contains variable data used by Asterisk in its normal operation.
  • /var/spool/asterisk: Used for runtime spooled files of voicemail, outgoing calls, etc.

Install Configuration Files

Now you are almost ready for configuration. Do this:

cd /usr/src/asterisk
make samples

This will copy a set of sample configuration files to your /etc/asterisk directory.

(:exclaim:) If you have existing configuration files in your /etc/asterisk directory, they will be renamed with ".old" appended to their filenames.

You should be able to start Asterisk with no changes needed to the sample configuration files:

Or you may go ahead and start turning all the knobs and pressing all the buttons:

Compilation Notes

VIA ITX mainboards

Asterisk 1.2.x

The VIA would aspire to be a i686, but it is actually a i586 from a compiler standpoint. So with that, you need to make a change to your /usr/src/asterisk/Makefile and change the following:

#ifeq (${OSARCH},Linux)
  1. PROC=$(shell uname -m)
  2. endif
  3. Pentium Pro Optimize
  4. PROC=i686
  5. Pentium & VIA processors optimize

Make sure that you comment out the ifeq (${OSARCH},Linux) or else when the Makefile is running, it will reset the PROC value from i586 back to i686.

Asterisk 1.4.x

Run configure with the following arguments: "--build=i586 --host=i586".

The above also needs the following addition in the Makefile (or variable defined)

ASTLDFLAGS+=$(LDOPTS) -lpthread -ldl -lresolv

Solaris 8 SPARC

On the prerequirement it is noted to use ginstall for doing "make install" but it is not noted what to do if it is not exist!

Under Makefile.defs

  1. ifeq ($(OS), solaris)
  2. use GNU versions
  3. INSTALL ?= ginstall >> change the following to INSTALL ?= install
  4. TAR ?= gtar
  5. else
  6. INSTALL ?= install
  7. TAR ?= tar
  8. endif

Good Luck


Installing Asterisk on Debian

Asterisk | Asterisk Installation
Created by: JazEzork, Last modification: Wed 02 of Dec, 2015 (09:55 UTC) by godson
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+