This file is not strictly required in an Asterisk
installation; however, without any modules Asterisk won’t really be able
to do anything, so for all practical purposes, you need a modules.conf
file in your /etc/asterisk
folder. If you simply define
autoload=yes
in your modules.conf
file, Asterisk will search for all
modules in the /usr/lib/asterisk/modules
folder and load them
at startup.
Although most modules do not use much in the way of resources, and they all load very quickly, it just seems cleaner to our minds to load only those modules that you are planning on using in your system. Additionally, there are security benefits to not loading modules that accept connections over a network.
In the past we felt that explicitly
loading each desired module was the best way to handle this, but we have
since found that this practice creates extra work. After every upgrade we
found ourselves having to edit the modules.conf
file to correct all the module
differences between releases, and the whole process ended up being
needlessly complicated. What we prefer to do these days is to allow
Asterisk to automatically load the modules that it finds, but to
explicitly tell Asterisk not to load any modules we do not want loaded by
use of the noload
directive. A sample modules.conf
file can be found in the section called “modules.conf”.
The modules.conf
file
contains a single section. The options available in this section are
listed in Table 4.5, “modules.conf [modules] section”. With the exception
of autoload
, all of the options may
be specified more than once.
A list of all loadable modules is available in Chapter 2, Asterisk Architecture, with notes on our opinion regarding the popularity/status of each of them.
Table 4.5. modules.conf [modules] section