[asterisk-users] Using XML for configuration management, single-source-of-truth, etc.

Philip Prindeville philipp_subx at redfish-solutions.com
Sat Dec 8 00:51:44 CST 2007


Tilghman Lesher wrote:
> 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.
>
>   

Well, after hand-coding HTML and SGML for 15+ years, XML isn't all that 
much of a stretch.

More to the point though, there are some excellent schema-driven 
configuration managers for XML, so you wouldn't have to edit the files 
by hand.

-Philip





More information about the asterisk-users mailing list