[Asterisk-doc] Running Asterisk at boot time and loading modules
Randy Resnick
asterisk-doc@lists.digium.com
Sat, 12 Jun 2004 10:57:36 +0200
By the way, you may like to add Slackware 9.1 to the distros tested with
Asterisk, I have been running it in production with no issues for three
months.
I think you *should* include general information in the book in spite of
the argument that "... we can leave it to the users own device to learn
how to load modules at startup on their own systems." It doesn't waste
much space to include a paragraph very useful information to help hook
users on Asterisk, especially if they need to get running quickly.
-----------
Installing Asterisk ->
Loading Drivers ->
Using "modprobe", Adding zaptel modules to your startup file
-----------
See also : Starting Asterisk using safe_asterisk
Once you are satisfied with the operation of Asterisk on your machine,
you will usually want to automatically run it when the box boots up. You
should look at the /usr/sbin/safe_asterisk script and understand what it
does and then insert a call to it in a local startup config file. These
are usually in the /etc/rc.d directory.
Example from a Slackware 9.1 installion of Asterisk
/etc/rc.d/rc.local
----------------------
# Loading hardware drivers for Asterisk
modprobe zaptel
# Wildcard X100
modprobe wcfxo
# TDM400
modprobe wcfxs
sleep 1
# configure the modules for asterisk
# see /etc/zaptel.conf
ztcfg -vv
sleep 1
# start the pppoe connection if needed
# since Asterisk won't work too well with no Internet connection
#/usr/sbin/adsl-start
# start firewall etc
# Start Asterisk with a console on tty9
/usr/local/sbin/safe_asterisk
#
#Insert less urgent stuff here like numlock
#
-------------
On most distros, Alt/F9 will switch you to the terminal running
Asterisk. Some typical things you may want to see when Asterisk first
boots might be the state of SIP and/or IAX clients or the registry:
*CLI> sip show peers
*CLI> iax2 show peers
*CLI> sip show registry
*CLI> iax2 show registry
The system console will be a constant source of information on the state
of things in Asterisk. When clients become unreachable or "too lagged"
you will learn of it here. If users try to log in with bad passwords you
will see the event on the console. You will also see all dialing and
arriving call activity. Many messages will help you see why a call is
not working out. Naturally, this is also the way you will debug
extensions, macros and your own applications.