System information
-T
This option will add a timestamp to CLI output.
-x
This command allows you to pass a string to Asterisk that will be executed as if it
had been typed at the CLI. As an example, to get a quick listing of all the channels
in use without having to start the Asterisk console, simply type asterisk -rx 'core
show channels' from the shell, and you’ll get the output you are looking for.
-g
This option instructs Asterisk to dump a core file if it crashes.
We recommend you try out a few combinations of these commands to see what they do.
safe_asterisk
When you install Asterisk using the make config directive it will create a script called
safe_asterisk, which is run during the init process of Linux each time you boot.
The safe_asterisk script provides the following benefits:
• Restarts Asterisk automatically after a crash
• Can be configured to email the administrator if a crash has occurred
• Defines where crash files are stored (/tmp by default)
• Executes a script if a crash has occurred
You don’t need to know too much about this script, other than to understand that it
should normally be running. In most environments this script works fine in its default
format.
modules.conf
So, we’ve managed to get Asterisk running, but it’s not able to do anything useful for
us yet. To tell Asterisk what modules we expect it to load, we’ll need a modules.conf file.
Create the file modules.conf in your /etc/asterisk/ directory with the following command
(replace the >> with > if you instead want to overwrite an existing file):
$ cat >> /etc/asterisk/modules.conf
Type (or paste) the following lines, and press Ctrl+D on a new line when you’re
finished:
; The modules.conf file, used to define which modules Asterisk should load (or
; not load).
;
[modules]
autoload=yes
56 | Chapter 3: Installing Asterisk