Starting Asterisk Without Scripts
Asterisk can be loaded in a variety of ways. The easiest way is to start Asterisk by running the binary file directly from the Linux command-line interface. If you are running a system that uses the init.d scripts, you can easily start and restart Asterisk that way as well. However, the preferred way of starting Asterisk is via the safe_asterisk script.
Console Commands
The Asterisk binary is, by default, located at
/usr/sbin/asterisk. If you run
/usr/sbin/asterisk, it will be loaded as a
daemon. There are also a few switches you should be aware of that
allow you to (re)connect to the Asterisk CLI, set the verbosity of CLI
output, and allow core dumps if Asterisk crashes (for debugging with
gdb). To explore the full range of options, run
Asterisk with the -h switch:
# /usr/sbin/asterisk -hHere is a list of the most commonly used options:
-cConsole. This will start Asterisk as a user process (not as a server), and will connect you to the Asterisk CLI. This option is good when you are debugging your startup parameters, but should not be used for a normal system (if Asterisk is already running, this option will not work and will issue a complaint).
-vVerbosity. This is used to set the amount of output for CLI debugging. The more “v”s, the more verbose.
-gCore dump. If Asterisk were to crash unexpectedly, this would cause a core file to be created for later tracing with gdb. You generally do not use this in production, unless you are writing code for Asterisk ...