System information
Using cat to Quickly Create Files and Add Content to Them
There are many cases in a Linux system where it is necessary to create a file, and then
add some content to it. This is commonly done by using the touch command to create
the file, and then opening it with an editor to add the content. However, there is a less-
known way of doing this that lets you create the file and add the content all at once:
• Use the cat program to redirect output to the file you want (use >> to append, or
> to overwrite).
• Paste or type the content you want to add to the file.
• Press Ctrl
+D to complete your changes.
Presto! File created and content added.
The autoload=yes line will tell Asterisk to automatically load all modules located in
the /usr/lib/asterisk/modules/ directory. If you wanted to, you could leave the file like
this, and Asterisk would simply load any modules it found in the modules folder.
With your new modules.conf file in place, starting Asterisk will cause a whole slew of
modules to be loaded. You can verify this by starting Asterisk and running the module
show command:
$ asterisk -c
*CLI> module show
Module Description Use Count
res_speech.so Generic Speech Recognition API 0
res_monitor.so Call Monitoring Resource 0
...
func_math.so Mathematical dialplan function 0
171 modules loaded
We now have many modules loaded, and many additional dialplan applications and
functions at our disposal. We don’t need all these resources loaded, though, so let’s
filter out some of the more obscure modules that we don’t need at the moment. Modify
your modules.conf file to contain the following noload lines, which will tell Asterisk to
skip loading the identified modules:
; Resource modules
noload => res_speech.so
noload => res_phoneprov.so
noload => res_ael_share.so
noload => res_clialiases.so
noload => res_adsi.so
; PBX modules
noload => pbx_ael.so
noload => pbx_dundi.so
Base Configuration | 57