Debugging
Several methods of debugging are available in Asterisk. Once you’ve connected to the console, you can enable different levels of verbosity and debugging output, as well as protocol packet tracing. We’ll take a look at the various options in this section. (The Asterisk console is discussed in more detail in Appendix E.)
Connecting to the Console
To connect to the Asterisk console, you can either start the server in the console directly (in which case you will not be able to exit out of the console without killing the Asterisk process), or start Asterisk as a daemon and then connect to a remote console.
To start the Asterisk process directly in the console, use the console flag:
# /usr/sbin/asterisk -cTo connect to a remote Asterisk console, start the daemon first,
then connect with the -r
flag:
#/usr/sbin/asterisk#/usr/sbin/asterisk -r
If you are having a problem with a specific module not loading,
or a module causing Asterisk to not load, start the Asterisk process
with the -c flag to monitor the
status of modules loading. For example, if you attempt to load the OSS
channel driver (which allows the use of the CONSOLE channel), and Asterisk is unable to
open /dev/dsp, you will receive the following
error on startup:
WARNING[32174]: chan_oss.c:470 soundcard_init: Unable to open /dev/dsp:
No such file or directory
== No sound card detected -- console channel will be unavailable
== Turn off OSS support by adding 'noload=chan_oss.so' in /etc/
asterisk/modules.confEnabling Verbosity ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access