[asterisk-users] Using XML for configuration management, single-source-of-truth, etc.
Tilghman Lesher
tilghman at mail.jeffandtilghman.com
Fri Dec 7 23:16:18 CST 2007
On Friday 07 December 2007 20:12:12 Philip Prindeville wrote:
> Darryl Dunkin wrote:
> > You can store most of the configurations in a database which may be more
> > accessable to you.
> >
> > Perl can also parse these configurations quickly enough if you know how
> > to use the input record seperator ($/) properly.
> >
> > The only thing Asterisk will not store which you would probably need is
> > the actual MAC address of the phones themselves. This may be done easily
> > enough as comments in the users sip.conf section.
>
> That's sort of my point: that you have to reinvent it, and it's easy to
> get wrong.
XML wouldn't make it any less wrong. There's a difference between parsing
it syntactically (which XML fixes) and parsing it semantically (which XML does
not).
In fact, I find the configuration files, as they are now are much EASIER to
parse than XML. With XML, you need to load up a whole state engine to ensure
the config is properly formatted. At the simplest level, the config file
as-is is simply a set of key/value pairs, which syntactically is very easy to
parse.
Part of the allure of the current format is also that it is human readable,
which assists in manual editing. I'm not sure what part of the universe you
have be from to make XML human readable (or more importantly, human-editable),
but I am quite sure it is not from this planet.
--
Tilghman
More information about the asterisk-users
mailing list