Managing Asterisk modules

Let’s connect to the Asterisk console:

sudo asterisk -rvv

Let’s see what modules are already in use:

module show

Files of modules with the extension * .so are in the directory /usr/lib/asterisk/modules/

To load and unload a module, commands are used (the module name is specified without a file extension, for example, not chan_sip.so, but chan_sip):

module load NAME
module unload NAME

In order for the necessary modules to be loaded automatically when starting Asterisk, they must be specified in the file /etc/asterisk/modules.conf, for example, open it in the text editor nano:

sudo nano /etc/asterisk/modules.conf

You can enable the autoloading of all existing modules in the folder /usr/lib/asterisk/modules/:

[modules]
autoload=yes

And then we can exclude unnecessary ones using the following commands:

noload => module.so

Either prohibit downloading all and specify only those that are needed, for example:

;SIP VoIP driver
load => chan_sip.so
load => res_rtp_asterisk.so
load => app_dial.so
load => bridge_simple.so
load => res_features.so
load => res_musiconhold.so
load => res_adsi.so
load => pbx_config.so
; List of required codecs
load => codec_a_mu.so
load => codec_adpcm.so
load => codec_alaw.so
load => codec_ulaw.so
load => codec_gsm.so
load => codec_ilbc.so
load => codec_lpc10.so
; If you use Dahdi cards for analog lines
load => chan_dahdi.so
; Call parking
load => res_parking.so 
; Below are the modules I needed when setting up call recording
; требуется если используется res_monitor.so
load => func_periodic_hook.so
; Required if res_monitor.so is used, the function STRFTIME
load => func_strings.so
; Required if res_monitor.so is used to determine the number, function CALLERID
load => func_callerid.so
; Required if res_monitor.so is used for MixMonitor
load => app_dial.so
; For recording calls
load => res_monitor.so
; To support WAV format
load => format_wav.so
; For MP3 format support
load => format_mp3.so
; To record statistics of calls to MySQL database
load => cdr_mysql.so
; To enable SNMP functionality, for example, to collect statistics by various monitoring systems
load => res_snmp.so
; To make calls from the context of the placed files to the directory /var/spool/asterisk/outgoing/
load => pbx_spool.so

To apply the changes in the /etc/asterisk/modules.conf file, execute the command from the Asterisk console:

module reload

If necessary, you can reboot Asterisk as follows:

sudo service asterisk restart

Leave a comment

Leave a Reply