D.1. modules.conf
The modules.conf file controls which modules are
loaded or not loaded at Asterisk startup. This is done through the
use of the load => or noload =>
constructs.
|
This file is a key component to building a
secure Asterisk installation: best practice suggests that only
required modules be loaded.
|
|
The modules.conf file always starts with the
[modules] header. The autoload statement tells
Asterisk whether to automatically load all modules contained within
the modules directory or to load only those modules specifically
defined by load => statements. We recommend you
manually load only those modules you need, but many people find it
easier to let Asterisk attempt to autoload whatever it
finds in /usr/lib/asterisk/modules. You can then
exclude certain modules with noload => statements.
Here's a sample modules.conf file:
[modules]
autoload=no ; set this to yes and Asterisk will load any
; modules it finds in /usr/lib/asterisk/modules
load => res_adsi.so
load => pbx_config.so ; Requires: N/A
load => chan_iax2.so ; Requires: res_crypto.so, res_features.so
load => chan_sip.so ; Requires: res_features.so
load => codec_alaw.so ; Requires: N/A
load => codec_gsm.so ; Requires: N/A
load => codec_ulaw.so ; Requires: N/A
load => format_gsm.so ; Requires: N/A
load => app_dial.so ; Requires: res_features.so, res_musiconhold.so
Since we assume Asterisk is built on Linux, all
the module names we use end in a .so extension. However, this may not be the
case if you have built Asterisk on a different operating
system.
As of this writing, there are eight module
types: resources , applications, Call
Detail Record database connectors, channels, codecs, formats, pbx
modules, and standalone
functions. Let's take a look at each of them.
D.1.1. Resources
A resource
provides a connection to a static repository of a particular type
of information, such as a unique regional requirement or a library
of constant elements. This information must be configurable for
each system, but once loaded it doesn't need to change in the
course of normal operations.
For each resource below, we have outlined the
applications and features it provides to other Asterisk modules
We've indicated the .conf file
used to define the resource, where needed; if no file is listed,
then a configuration file isn't required. The resource modules
are:
res_adsi.so
-
Configuration file: adsi.conf
Provides: ADSI functions to ADSIProg( )
and Voicemail( )
res_agi.so
-
Provides: DeadAGI( ), EAGI( ),
AGI( )
res_crypto.so
-
Provides: Loads public and private keys located
in /var/lib/asterisk/keys/
res_features.so
-
Configuration file: features.conf
Provides: ParkedCall( ), Park(
)
res_indications.so
-
Configuration file: indications.conf
Provides: Playtones( ),
StopPlaytones( )
res_monitor.so
-
Provides: Monitor( ), StopMonitor(
), ChangeMonitor( ), action Monitor, action
StopMonitor, action ChangeMonitor
res_musiconhold.so
-
Configuration file: musiconhold.conf
Provides: MusicOnHold( ),
WaitMusicOnHold( ), SetMusicOnHold( ),
StartMusicOnHold( ), StopMusicOnHold( )
res_odbc.so
-
Configuration file: res_odbc.conf
Provides: Connectivity information to the
ODBC driverthe purpose is to store
configuration file information in a database and retrieve that
information from the database; however, a reload is required to
make changes take effect
D.1.2. Applications
If you build an Asterisk dialplan of any size,
you are going to use at least oneand more likely dozensof
applications. If an application is never going to be used, it
is not strictly required that it be loaded. For
performance-challenged systems (or if you just like to keep it
lean), you may elect to load only those applications that are
referenced in your dialplan.
For each application module, we will define any
resource requirements and name the applications that the module
provides. Unless we have stated otherwise, the application does not
require a configuration file or any other modules. The available
application modules are:
app_adsiprog.so
-
Requires: res_adsi.so
Provides: ADSIProg( )
app_alarmreceiver.so
-
Provides: AlarmReceiver( )
app_authenticate.so
-
Provides: Authenticate( )
app_cdr.so
-
Provides: NoCDR( )
app_chanisavail.so
-
Provides: ChanIsAvail( )
app_chanspy.so
-
Provides: ChanSpy( )
app_controlplayback.so
-
Provides: ControlPlayback( )
app_curl.so
-
Provides: Curl( )
app_cut.so
-
Provides: Cut( )
app_db.so
-
Provides: DBget( ), DBput( ),
DBdel( ), DBdeltree( )
app_dial.so
-
Requires: res_features.so, res_musiconhold.so
Provides: Dial( ), RetryDial(
)
app_dictate.so
-
Provides: Dictate( )
app_directory.so
-
Provides: Directory( )
app_disa.so
-
Provides: DISA( )
app_dumpchan.so
-
Provides: DumpChan( )
app_echo.so
-
Provides: Echo( )
app_enumlookup.so
-
Configuration file: enum.conf
Provides: EnumLookup( )
app_eval.so
-
Provides: Eval( )
app_exec.so
-
Provides: Exec( )
app_festival.so
-
Provides: Festival( )
app_forkcdr.so
-
Provides: ForkCDR( )
app_getcpeid.so
-
Requires: res_adsi.so
Provides: GetCPEID( )
app_groupcount.so
-
Provides: GetGroupCount( ),
SetGroup( ), CheckGroup( ),
GetGroupMatchCount( )
app_hasnewvoicemail.so
-
Provides: HasVoicemail( ),
HasNewVoicemail( )
app_ices.so
-
Provides: ICES( )
app_image.so
-
Provides: SendImage( )
app_lookupblacklist.so
-
Provides: LookupBlacklist( )
app_lookupcidname.so
-
Provides: LookupCIDName( )
app_macro.so
-
Provides: Macro( ), MacroExit(
), MacroIf( )
app_math.so
-
Provides: Math( )
app_md5.so
-
Provides: MD5( ), MD5Check(
)
app_milliwatt.so
-
Provides: Milliwatt( )
app_mp3.so
-
Provides: MP3Player( )
app_nbscat.so
-
Provides: NBScat( )
app_parkandannounce.so
-
Requires: res_features.so
Provides: ParkAndAnnounce( )
app_playback.so
-
Provides: Playback( )
app_privacy.so
-
Provides: PrivacyManager( )
app_queue.so
-
Requires: res_features.so, res_monitor.so, res_musiconhold.so
Provides: Queue( ), AddQueueMember(
), RemoveQueueMember( ), PauseQueueMember(
), UnpauseQueueMember( ), action Queues,
action QueueStatus, action QueueAdd, action
QueueRemove, action QueuePause
app_random.so
-
Provides: Random( )
app_read.so
-
Provides: Read( )
app_readfile.so
-
Provides: ReadFile( )
app_realtime.so
-
Provides: RealTime( ),
RealTimeUpdate( )
app_record.so
-
Provides: Record( )
app_sayunixtime.so
-
Provides: SayUnixTime( ), DateTime(
)
app_senddtmf.so
-
Provides: SendDTMF( )
app_sendtext.so
-
Provides: SendText( )
app_setcallerid.so
-
Provides: SetCallerPres( ),
SetCallerID( )
app_setcdruserfield.so
-
Provides: SetCDRUserField( ),
AppendCDRUserField( ), action SetCDRUserField
app_setcidname.so
-
Provides: SetCIDName( )
app_setcidnum.so
-
Provides: SetCIDNum( )
app_setrdnis.so
-
Provides: SetRDNIS( )
app_settransfercapability.so
-
Provides: SetTransferCapability( )
app_sms.so
-
Provides: SMS( )
app_softhangup.so
-
Provides: SoftHangup( )
app_striplsd.so
-
Provides: StripLSD( )
app_substring.so (deprecated)
-
Provides: SubString( )
app_system.so
-
Provides: System( ), TRySystem(
)
app_talkdetect.so
-
Provides: BackgroundDetect( )
app_test.so
-
Provides: TestClient( ),
TestServer( )
app_transfer.so
-
Provides: transfer( )
app_txtcidname.so
-
Configuration file: enum.conf
Provides: TXTCIDName( )
app_url.so
-
Provides: SendURL( )
app_userevent.so
-
Provides: UserEvent( )
app_verbose.so
-
Provides: Verbose( )
app_voicemail.so
-
Configuration file: voicemail.conf
Requires: res_adsi.so
Provides: VoiceMail( ),
VoiceMailMain( ), MailboxExists( ),
VMAuthenticate( )
app_waitforring.so
-
Provides: WaitForRing( )
app_waitforsilence.so
-
Provides: WaitForSilence( )
app_while.so
-
Provides: While( ), ExecIf( ),
EndWhile( )
app_zapateller.so
-
Provides: Zapateller( )
D.1.3. Database-Stored Call Detail
Records
Asterisk normally stores Call Detail Records
(CDRs) in a Comma-Separated Values (CSV) file. If you want CDRs to be stored
in a database, you'll need to load the appropriate module and
define the relevant .conf
file.
For each module below, we state the database
type it supports, and specify the configuration file, if required.
The CDR database connector modules are:
cdr_csv.so
-
Provides: CSV CDR backend
cdr_custom.so
-
Configuration file: cdr_custom.conf
Provides: Customizable CSV CDR backend
cdr_manager.so
-
Configuration file: cdr_manager.conf
Provides: Asterisk Call Manager CDR backend
cdr_odbc.so
-
Configuration file: cdr_odbc.conf
Provides: ODBC CDR backend
cdr_pgsql.so
-
Configuration file: cdr_pgsql.conf
Provides: PostgreSQL CDR backend
D.1.4. Channels
Next, let's take a look at the channel modules.
For each channel module, we identify dependencies and list the
capabilities the module provides. We show the configuratin file, if
one is required. The available modules are:
chan_agent.so
-
Configuration file: agents.conf
Requires: res_features.so, res_monitor.so, res_musiconhold.so
Provides: channel Agent, AgentLogin( ),
AgentCallbackLogin( ), AgentMonitorOutgoing( ),
action Agents
chan_features.so
-
Provides: channel Feature
chan_iax2.so
-
Configuration file: iax.conf, iaxprov.conf
Requires: res_crypto.so, res_features.so, res_musiconhold.so
Provides: channel IAX2, IAX2Provision(
), function IAXPEER, action IAXPEERS, action
IAXnetstats
chan_local.so
-
Provides: channel Local
chan_mgcp.so
-
Configuration file: mgcp.conf
Requires: res_features.so
Provides: channel MGCP
chan_modem.so
-
Configuration file: modem.conf
Provides: channel Modem
chan_modem_aopen.so
-
Requires: chan_modem.so
Provides: A/Open (Rockwell Chipset) ITU-2
VoiceModem Driver
chan_modem_bestdata.so
-
Requires: chan_modem.so
Provides: BestData (Conexant V.90 Chipset)
VoiceModem Driver
chan_modem_i4l.so
-
Requires: chan_modem.so
Provides: ISDN4Linux Emulated Modem Driver
chan_oss.so
-
Provides: channel Console (soundcard
required)
chan_phone.so
-
Configuration file: phone.conf
Provides: channel Phone
chan_sip.so
-
Configuration file: sip.conf, sip_notify.conf
Requires: res_features.so
Provides: channel SIP, SIPDtmfMode( ),
SIPAddHeader( ), SIPGetHeader( ), action
SIPpeers, action SIPshowpeer, function
SIP_HEADER
chan_skinny.so
-
Configuration file: skinny.conf
Requires: res_features.so
Provides: channel Skinny
D.1.5. Codecs
There are several acceptable ways to pass audio
information in digital form. The formulas used to encode and decode
(or compress and decompress) this information are collectively
referred to as codecs. Most of
Asterisk's codecs are provided free of license requirements;
however, some (such as G.729) are encumbered by patents and thus
must be licensed before they can be used.
Asterisk will load these codecs without
complaint, but if you attempt to transcode a channel using an
unlicensed codec, your calls will be dropped as soon as they
connect.
Here, then, are the codec modulesif there are
parameters that can be defined, they will be configurable in the
codecs.conf file:
codec_a_mu.so
-
Provides: translator alawtoulaw,
translator ulawtoalaw
codec_adpcm.so
-
Configuration file: codecs.conf
Provides: translator adpcmtolin,
TRanslator lintoadpcm
codec_alaw.so
-
Configuration file: codecs.conf
Provides: translator alawtolin,
translator lintoalaw
codec_g726.so
-
Configuration file: codecs.conf
Provides: translator g726tolin,
TRanslator lintog726
codec_gsm.so
-
Configuration file: codecs.conf
Provides: translator gsmtolin,
translator lintogsm
codec_ilbc.so
-
Configuration file: not required
Provides: translator ilbctolin,
translator lintoilbc
codec_lpc10.so
-
Configuration file: codecs.conf
Provides: translator lpc10tolin,
translator lintolpc10
codec_ulaw.so
-
Configuration file: codecs.conf
Provides: translator ulawtolin,
translator lintoulaw
D.1.6. Formats
Formats are
essentially the same as codecs, except that they relate to handling
files instead of live media streams. If you are talking to someone,
a codec (or two) will be employed. If you are leaving a voicemail
or listening to Music on Hold, a format will be involved.
Here are the current Asterisk formats. Formats
do not have associated configuration files:
format_g723.so
-
Provides: format g723sf
format_g726.so
-
Provides: format g726-40, format
g726-32, format g726-24, format
g726-16
format_g729.so
-
Provides: format g729
format_gsm.so
-
Provides: format gsm
format_h263.so
-
Provides: format H263
format_ilbc.so
-
Provides: format ilbc
format_jpeg.so
-
Provides: format jpg
format_pcm.so
-
Provides: format pcm
format_pcm_alaw.so
-
Provides: format alaw
format_sln.so
-
Provides: format sln
format_vox.so
-
Provides: format vox
format_wav.so
-
Provides: format wav
format_wav_gsm.so
-
Provides: format wav49
D.1.7. PBX Core Modules
The PBX modules deliver the core functionality
of the system. For each module, we show the services it provides,
and list the configuration file, if one is required. At minimum,
config, functions, and spool are required. dundi, loopback, and realtime are needed only if you are going to
make use of their capabilities. The PBX core modules are:
pbx_config.so
-
Configuration file: extensions.conf
Provides: Loads dialplan into memory
pbx_dundi.so
-
Configuration file: dundi.conf
Requires: res_crypto.so
Provides: DUNDiLookup( )
pbx_functions.so
-
Configuration file: not required
Provides: function CDR, function
CHECK_MD5, function DB, function
DB_EXISTS, function ENV, function EVAL,
function EXISTS, function FIELDQTY, function
GROUP_COUNT, function GROUP_MATCH_COUNT, function
GROUP, function GROUP_LIST, function IF,
function ISNULL, function LANGUAGE, function
LEN, function MD5, function REGEX,
function STRFTIME, function SET, function
TIMEOUT
pbx_loopback.so
-
Provides: Loopback switch
pbx_realtime.so
-
Provides: Realtime switch
pbx_spool.so
-
Provides: Outgoing spool support
D.1.8. Standalone Functions
There is currently only one standalone function
available. This function operates identically to those in
pbx_functions.so, but because it
is standalone, it can be loaded (or not) completely independently
of the pbx functions. The function
is:
func_callerid.so
-
Configuration file: not required
Provides: function CALLERID
|