Upgrade 3CX to v18 and get it hosted free!

Asterisk Compile

Author image

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
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.

! 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

PROC=i586

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

Update

Installing Asterisk on Debian


Asterisk | Asterisk Installation


Article Reviews

Write a Review

Your email address will not be published. Required fields are marked *

Required Field. Minimum 5 characters.

Required Field. Minimum 5 characters, maximum 50.

Required field.There is an error with this field.

Required Field.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

There are no reviews for this article. Be the first one to write a review.

Related Posts:

Get 3CX - Absolutely Free!
Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.