[asterisk-users] Sample config files installed to /etc

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sun Jun 9 12:18:50 CDT 2013


On Fri, Jun 07, 2013 at 11:53:57AM +0200, Daniel Pocock wrote:
> 
> The sample config files in the Asterisk distribution and packages are
> really good for getting the demo up and running quickly, for example, to
> extend the demo to run behind a WebRTC proxy only required about 6 lines
> of extra code to define a peer in sip.conf and enable TCP

The "sample" config files are mostly reference. They are also examples
for some sorts. But they are the best documentation installed in a
typical installation.

> 
> However, I'm not sure that they should be installed by default by packages.
> 
> Most package managers provide a way to diff the files and merge new
> config options that appear in a new release

Rather: dpkg is rather unique with this feature, IIRC.

> 
> However, because a lot of things have to be ripped out of the default
> config to harden it and disable the demo, a simple diff doesn't really
> help somebody upgrading to a new version, because usually they've
> altered the files quite dramatically
> 
> I'd suggest that the config for the demo could be placed under
> /usr/share/asterisk/samples while the configs installed to /etc/asterisk
> should be fairly minimal

s|/usr/share/asterisk|$astdatadir|

Some folks like the value of /var/lib/asterisk for astdatadir.

To complement that you'd need to have a simple way to revert back to the
"standard" configuration.

Do you think it's a good idea to have asterisk look at
$astdatadir/configs/ first if the file in $astetcdir does not exist?

Failing that, you could use something along the lines of

#include /path/to/astdatadir/configs/<origname>.conf
[content to override]


This could be handy for the likes of cli_aliases.conf and say.conf where
you really don't like to start from scratch.

Do you think it would be a good idea to have a directive that will
include a file from under $astdatadir/configs , so the above would
become:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#includedef ali_aliases.conf
[general](+)
template = myown

[myown](asterisk11)
restart now = core stop now
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

The downside of this is that on upgrades you don't see the real
changes.

> 
> My own workaround at the moment involves tracking the released configs
> in a git repository and tracking my changes on a branch.  However,
> working with the package manager diff output would help a lot more
> people and make it much more like other packages they are familiar with.

-- 
               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