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.
(: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)
- PROC=$(shell uname -m)
- endif
- Pentium Pro Optimize
- PROC=i686
- 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
- ifeq ($(OS), solaris)
- use GNU versions
- INSTALL ?= ginstall >> change the following to INSTALL ?= install
- TAR ?= gtar
- else
- INSTALL ?= install
- TAR ?= tar
- endif
Good Luck