17.2. Asterisk's Configuration FilesAsterisk's operations are governed by a set of text configuration files, like Apache and other common Unix software. Everything from the assignment of extension numbers to call queuing to low-level hardware interfacing is established by these files, which are located in /etc/asterisk . Now would be a good time to peruse a few of the most important ones:
There are many other configuration files. At a bare minimum, you'll need to familiarize yourself with extensions.conf and SIP.conf , h323.conf , or skinny.conf in order to build a bare-bones VoIP server that can handle simple calls. If you're using legacy interface hardware such as the X100P card, you'll also need to learn about zaptel.conf and zapata.conf . The files in /etc/asterisk follow a similar convention, mostly. Many have organizational sections that begin with a string of text in square brackets ( [ and ] ). Following each bracketed heading is a list of configuration settings and directives. A setting is a string followed by = and a user -specifiable value, like this: writeprotect=yes A directive has a slightly different syntax than a setting. Directives tend to have a more complex definition, and convention dictates that they use the => operator rather than simply = (though either will work). This definition's structure will vary depending on what kind of directive is instantiating it. For example, variable assignments are directives that have a simple syntax in extensions.conf : LINE1 => Zap/1 But an extension directive appears more complex: exten => 2101,1,Dial(Zap/3/5552101) A directive could be an extension assignment or a priority of an extension assignment (more on this later). Many directives and settings only work in one of the configuration files and are invalid in the others. For example, you can't use voicemail settings in the extensions.conf file; you can only use them in voicemail.conf . 17.2.1. Including Configuration FilesYou can't assign extensions in any files other than extensions.conf , unless you specifically include those other configuration files. All of the configuration files support an inclusion directive, which allows them to pull settings and commands from another file that you specify, like this: #include myCustomExtensions.conf If you put this line in extensions.conf , Asterisk would read the file called myCustomExtensions.conf and treat it as though it were a part of extensions.conf . The file you included would need to have a structure that is valid for extensions.conf , too. Included configuration files are expected to have a structure that is also valid for the file they are included into . |