Build and Install Instructions
Now we can compile and install Asterisk. To compile Asterisk, simply type make at the Linux command line.
[[email protected] asterisk-14.X.Y]# make
The compiling step will take several minutes, and you'll see the various file names scroll by as they are being compiled. Once Asterisk has finished compiling, you'll see a message that looks like:
+--------- Asterisk Build Complete ---------+ + Asterisk has successfully been built, and + + can be installed by running: + + + + make install + +-------------------------------------------+ +--------- Asterisk Build Complete ---------+
As the message above suggests, our next step is to install the compiled Asterisk program and modules. To do this, use the make install command.
[[email protected] asterisk-14.X.Y]# make install
When finished, Asterisk will display the following warning:
+---- 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 + + + +-------------------------------------------+ +---- Asterisk Installation Complete -------+
Advanced Build and Install Options
Customizing the Build/Installation
In some environments, it may be necessary or useful to modify parts of the build or installation process. Some common scenarios are listed here
Passing compilation and linkage flags to gcc
Specific flags can be passed to gcc
when Asterisk is configured, using the CFLAGS
and LDFLAGS
environment variables:
[[email protected] asterisk-14.X.Y]# ./configure CFLAGS=-pg LDFLAGS=-pg
Debugging compilation
To see all of the flags passed to gcc, build using the NOISY_BUILD
setting set to YES
:
[[email protected] asterisk-14.X.Y]# make NOISY_BUILD=yes
Building for non-native architectures
Generally, Asterisk attempts to optimize itself for the machine on which it is built on. On some virtual machines with virtual CPU architectures, the defaults chosen by Asterisk's compilation options will cause Asterisk to build but fail to run. To disable native architecture support, disable the BUILD_NATIVE
option in menuselect:
[[email protected] asterisk-14.X.Y]# menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts [[email protected] asterisk-14.X.Y]# make
Installing to a custom directory
While there are multiple ways to sandbox an instance of Asterisk, the preferred mechanism is to use the --prefix
option with the configure
script:
[[email protected] asterisk-14.X.Y]# ./configure --prefix=/usr/local/my_special_folder
Note that the default value for prefix
is /usr/local
.
Other Make Targets
Target | Description |
---|---|
Executing | |
all | Compiles everything everything selected through the |
full | This is equivalent to |
install | Installs Asterisk, building Asterisk if it has not already been built. In general, this should be executed after Asterisk has successfully compiled. |
uninstall | Removes Asterisk binaries, sounds, man pages, headers, modules and firmware builds from the system. |
uninstall-all | Same as the |
clean | Remove all files generated by make. |
dist-clean | Remove pretty much all files generated by make and configure. |
samples | Install all sample configuration files (.conf files) to /etc/asterisk/ . Overwrites existing config files. |
config | Install init scripts (startup scripts) on your system. |
progdocs | Uses doxygen to locally generate HTML development documentation from the source code. Generated in the doc/ subdirectory of the source; see doc/index.html . |
2 Comments
Cyril Ramière
Fellows sysadmins using Ubuntu 16.04 LTS distro, read this carefully!
There is an issue with the libunbound2 version provided in the apt repository that could prevent you to make calls with the PJSIP driver if you are using endpoints that relies on DNS.
This happens gradually when Asterisk is handling more thant ~500 channels, the more channels you have, the more likely it will happen.
Note that your calls will be silently discarded with no warning or error messages unless you have debug enabled, this is not an Asterisk bug and it is only affecting Ubuntu 16.04.
Please check this post on the bugtracker for details & solution :
Alexander Traud
make progdocs since commit fd98835, the HTML is put into the subdirectory
doc/api/
which results indoc/api/index.html