Search

Wednesday, September 28, 2011

Start Asterisk as service

After going through the Asterisk installation steps, we usually want to start it as a service.
 
Usual steps of Asterisk Installation
./configure   -- check if our system is suitable for Asterisk installation
make menuselect  -- it is an optional step, allowing you to select additional module, eg, mysql_cdr
make – the compilation process
make install – setup the paths, copy files to asterisk directory, etc.
make samples – an optional step to put a set of sample config in your installation (it will over-write existing config)
make progdocs – also an optional step to setup the documentation
 
At this stage, you should be able to run Asterisk as 'asterisk –cvvvvvv' in foreground.  But it is more desirable to setup a service and it can be achieved easily by:
 
Setup Asterisk Service
make config
 
There is a set of platform-specific templates in <asterisk-src-dir>/contrib/init.d, designed to be used for service startup script.  The 'make config' will base on one of these templates to create the Asterisk startup script in /etc/init.d.  To verify the result:
 
#chkconfig –list asterisk
#asterisk        0:off   1:off   2:on    3:on    4:on    5:on    6:off
 
Then, you can start asterisk by 'service asterisk start'.
 
 
 

No comments:

Post a Comment