If you just want the nitty-gritty on how to get Asterisk up and running quickly, perform the following at the shell prompt. We encourage you to read through the entire chapter at least once, though, in order to better understand the full process.[20]
The instructions provided here assume you’ve already installed either CentOS or Ubuntu using the steps outlined in the section called “Distribution Installation”.
Synchronize time and install the NTP (Network Time Protocol) daemon:
CentOS |
|
CentOS 64-bit |
|
Ubuntu |
|
Some additional configuration of text files is required on Ubuntu. See the section called “Enable NTP for accurate system time”.
On CentOS, add a new system user:
See the section called “Adding a system user” for specific information.
Install software dependencies:
CentOS |
|
CentOS 64-bit |
|
Ubuntu |
Create your directory structure:
$mkdir -p ~/src/asterisk-complete/asterisk
$cd ~/src/asterisk-complete/asterisk
Get the latest source code via Subversion:
$ svn co http://svn.asterisk.org/svn/asterisk/branches/1.8
Or alternatively, you could check out a specific tag:
$ svn co http://svn.asterisk.org/svn/asterisk/tags/1.8.1
Build and install the software:
$cd ~/src/asterisk-complete/asterisk/1.8/
$./configure
$make
$sudo make install
$sudo make config
Install additional sound prompts from menuselect:
$cd ~/src/asterisk-complete/asterisk/1.8/
$make menuselect
$sudo make install
Modify the file permissions of the directories Asterisk was installed to:
$
sudo chown -R asteriskpbx:asteriskpbx /usr/lib/asterisk/
$
sudo chown -R asteriskpbx:asteriskpbx /var/lib/asterisk/
$
sudo chown -R asteriskpbx:asteriskpbx /var/spool/asterisk/
$
sudo chown -R asteriskpbx:asteriskpbx /var/log/asterisk/
$
sudo chown -R asteriskpbx:asteriskpbx /var/run/asterisk/
$
sudo chown asteriskpbx:asteriskpbx /usr/sbin/asterisk
$ sudo vim /etc/selinux/config
Change the value of
SELINUX
from enforcing
to
disabled
, then reboot.
Create the
/etc/asterisk/
directory and copy the
indications.conf
sample file into it:
$sudo mkdir -p /etc/asterisk
$sudo chown asteriskpbx:asteriskpbx /etc/asterisk
$cd /etc/asterisk/
$cp ~/src/asterisk-complete/asterisk/1.8/configs/indications.conf.sample \ ./indications.conf
Copy the sample
asterisk.conf
file into
/etc/asterisk
and change
runuser
and rungroup
to have
values of asteriskpbx
:
$ cp ~/src/asterisk-complete/asterisk/1.8/configs/asterisk.conf.sample \
/etc/asterisk/asterisk.conf
$ vim /etc/asterisk/asterisk.conf
See the section called “indications.conf and asterisk.conf” for more information.
Create the
modules.conf
file. Enable loading of modules
automatically, and disable extra modules:
$ cat >> /etc/asterisk/modules.conf
; The modules.conf file, used to define which modules Asterisk should load (or
; not load).
;
[modules]
autoload=yes
; Resource modules currently not needed
noload => res_speech.so
noload => res_phoneprov.so
noload => res_ael_share.so
noload => res_clialiases.so
noload => res_adsi.so
; PBX modules currently not needed
noload => pbx_ael.so
noload => pbx_dundi.so
; Channel modules currently not needed
noload => chan_oss.so
noload => chan_mgcp.so
noload => chan_skinny.so
noload => chan_phone.so
noload => chan_agent.so
noload => chan_unistim.so
noload => chan_alsa.so
; Application modules currently not needed
noload => app_nbscat.so
noload => app_amd.so
noload => app_minivm.so
noload => app_zapateller.so
noload => app_ices.so
noload => app_sendtext.so
noload => app_speech_utils.so
noload => app_mp3.so
noload => app_flash.so
noload => app_getcpeid.so
noload => app_setcallerid.so
noload => app_adsiprog.so
noload => app_forkcdr.so
noload => app_sms.so
noload => app_morsecode.so
noload => app_followme.so
noload => app_url.so
noload => app_alarmreceiver.so
noload => app_disa.so
noload => app_dahdiras.so
noload => app_senddtmf.so
noload => app_sayunixtime.so
noload => app_test.so
noload => app_externalivr.so
noload => app_image.so
noload => app_dictate.so
noload => app_festival.so
Ctrl+D
$cat >> musiconhold.conf
; musiconhold.conf [default] mode=files directory=moh
Ctrl+D
Save your changes and your module configuration is done. Your system is ready to configure your dialplan and channels.
[20] Once you have experience with several Asterisk installations, you’ll agree that it’s a quick and painless process. Nevertheless, this chapter may make the process look complex. This is simply because we have an obligation to ensure you are provided with all the information you need to accomplish a successful install.