[asterisk-users] RFC: multiple packages editing asterisk config files

Tzafrir Cohen tzafrir.cohen at xorcom.com
Fri Nov 7 04:13:39 CST 2008


On Thu, Nov 06, 2008 at 12:57:15PM +0200, Tzafrir Cohen wrote:
> Hi
> 
> I'm lately bothered with the need to provide a set of Asterisk
> configuration files in a package that will be good for a wide range of 
> Asterisk users.
> 
> Asterisk configuration files support #include and a number of other
> interesting tricks, as mentioned in
> http://svn.digium.com/svn/asterisk/branches/1.4/doc/configuration.txt [0].

Let's look at asterisk.conf .

Unlike most configuration files, asterisk.conf is not read on reload .
Only at startup and restart. It is read by the main asterisk thread and
variables from there are globals that may affect all parts of Asterisk.

The [directories] section is most useful for anybody who uses a custom
installation of Asterisk. Though for distributors I would recommend to
patch those values in the source. It is still very handy if you want to
have more than one copy of Asterisk on the system.

The [options] section has grown over time and includes many options.
Some of them corespond to command-line switches. It is interesting to
note that values in the configuration file override Asterisk
command-line switches of Asterisk and not vice-versa as it is the common
with Unix programs. Thus relying on setting parameters through
controlling the command-line of Asterisk is not as robust as editing
asterisk.conf . The reason for that is that on 'reastart', asterisk
re-execs itself. It retains the same command-line options. But it
re-reads asterisk.conf , and thus changes to the command-line options
would require stopping the Asterisk process and starting it again, as
opposed to using the 'restart' command in asterisk.

The [compat] section is new in the game for asterisk 1.6 . It makes it
actively danbgerous to write asterisk from scratch (as done by, well,
someone, in
http://svn.digium.com/svn/asterisk/trunk/contrib/scripts/live_ast ). In
fact, the only way blessed by the Asterisk developers to write a valid
asterisk.conf is to use the output of 'make install' .

-- 
               Tzafrir Cohen
icq#16849755              jabber:tzafrir.cohen at xorcom.com
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir



More information about the asterisk-users mailing list