cd \/usr\/src\/<\/pre>\nand download the asterisk tar archive with the following wget command:<\/p>\n
wget http:\/\/downloads.asterisk.org\/pub\/telephony\/asterisk\/asterisk-15-current.tar.gz<\/pre>\nWhen the download is completed run the following command to extract the asterisk-15-current.tar.gz file:<\/p>\n
tar -zxvf asterisk-15-current.tar.gz<\/pre>\n<\/span>Compile Asterisk<\/span><\/h2>\nOnce the asterisk archive is extracted, change to the asterisk-15.5.0 <\/code> directory with the following command:<\/p>\ncd \/usr\/src\/asterisk-15.5.0<\/pre>\nUse the install_prereq<\/code> script to install all of the missing packages:<\/p>\n.\/contrib\/scripts\/install_prereq install<\/pre>\nDepending on the number of the missing packages the installation may take some time, once it is completed the output will look like the following:<\/p>\n
#############################################\r\n## install completed successfully\r\n#############################################<\/pre>\nNext step is to run the .\/configure<\/code> script which will check your system for missing libraries and binaries and prepare the Asterisk source code for the build process:<\/p>\n.\/configure<\/pre>\nThe output of the successful completion should look like the following:<\/p>\n
configure: Menuselect build configuration successfully completed\r\n\r\n .$$$$$$$$$$$$$$$=..\r\n .$7$7.. .7$$7:.\r\n .$$:. ,$7.7\r\n .$7. 7$$$$ .$$77\r\n ..$$. $$$$$ .$$$7\r\n ..7$ .?. $$$$$ .?. 7$$$.\r\n $.$. .$$$7. $$$$7 .7$$$. .$$$.\r\n .777. .$$$$$$77$$$77$$$$$7. $$$,\r\n $$$~ .7$$$$$$$$$$$$$7. .$$$.\r\n.$$7 .7$$$$$$$7: ?$$$.\r\n$$$ ?7$$$$$$$$$$I .$$$7\r\n$$$ .7$$$$$$$$$$$$$$$$ :$$$.\r\n$$$ $$$$$$7$$$$$$$$$$$$ .$$$.\r\n$$$ $$$ 7$$$7 .$$$ .$$$.\r\n$$$$ $$$$7 .$$$.\r\n7$$$7 7$$$$ 7$$$\r\n $$$$$ $$$\r\n $$$$7. $$ (TM)\r\n $$$$$$$. .7$$$$$$ $$\r\n $$$$$$$$$$$$7$$$$$$$$$.$$$$$$\r\n $$$$$$$$$$$$$$$$.\r\n\r\nconfigure: Package configured for:\r\nconfigure: OS type : linux-gnu\r\nconfigure: Host CPU : x86_64\r\nconfigure: build-cpu:vendor:os: x86_64 : pc : linux-gnu :\r\nconfigure: host-cpu:vendor:os: x86_64 : pc : linux-gnu :<\/pre>\nNow that the configuration is completed start the compilation process using the make <\/code> command:<\/p>\nmake<\/pre>\nDepending on your system resources the build process may take several minutes and once it is completed the following message will be printed on your console which means that the Asterisk was successfully compiled:<\/p>\n
+--------- Asterisk Build Complete ---------+\r\n+ Asterisk has successfully been built, and +\r\n+ can be installed by running: +\r\n+ +\r\n+ make install +\r\n+-------------------------------------------+\r\n<\/pre>\nThe next step is to run the make install<\/code> command which will install Asterisk and all compiled Asterisk modules:<\/p>\nmake install<\/pre>\nUpon successful Asterisk installation you will be presented with the following message on your screen:<\/p>\n
+---- Asterisk Installation Complete -------+\r\n + +\r\n + YOU MUST READ THE SECURITY DOCUMENT +\r\n + +\r\n + Asterisk has successfully been installed. +\r\n + If you would like to install the sample +\r\n + configuration files (overwriting any +\r\n + existing config files), run: +\r\n + +\r\n + For generic reference documentation: +\r\n + make samples +\r\n + +\r\n + For a sample basic PBX: +\r\n + make basic-pbx +\r\n + +\r\n + +\r\n +----------------- or ---------------------+\r\n + +\r\n + You can go ahead and install the asterisk +\r\n + program documentation now or later run: +\r\n + +\r\n + make progdocs +\r\n + +\r\n + **Note** This requires that you have +\r\n + doxygen installed on your local system +\r\n +-------------------------------------------+<\/pre>\nRun the make samples command to install the Asterisk sample configuration files:<\/p>\n
make samples<\/pre>\nInstall the initialization script so that you can manage your Asterisk service using the systemctl command :<\/p>\n
make config<\/pre>\nThe command above will show no output.<\/p>\n
Next install the logrotation script with the following command:<\/p>\n
make install-logrotate<\/pre>\nYou will see the following output indicating that the logrotation configuration has been successfully created:<\/p>\n
if [ ! -d \"\/etc\/asterisk\/..\/logrotate.d\" ]; then \\\r\n \/usr\/bin\/install -c -d \"\/etc\/asterisk\/..\/logrotate.d\" ; \\\r\nfi\r\nsed 's#__LOGDIR__#\/var\/log\/asterisk#g' < contrib\/scripts\/asterisk.logrotate | sed 's#__SBINDIR__#\/usr\/sbin#g' > contrib\/scripts\/asterisk.logrotate.tmp\r\n\/usr\/bin\/install -c -m 0644 contrib\/scripts\/asterisk.logrotate.tmp \"\/etc\/asterisk\/..\/logrotate.d\/asterisk\"\r\nrm -f contrib\/scripts\/asterisk.logrotate.<\/pre>\n