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

Tzafrir Cohen tzafrir.cohen at xorcom.com
Sun Dec 9 00:09:10 CST 2007


On Sat, Dec 08, 2007 at 09:43:24PM -0800, Philip Prindeville wrote:
> Jared Smith wrote:
> > On Sat, 2007-12-08 at 13:55 -0800, Philip Prindeville wrote:
> >   
> >> Going back to my original posting, I was also suggesting that the parse 
> >> tree from Asterisk could be read in and then dumped out as XML, so that 
> >> other software could then ingest it... using it as a common format for 
> >> passing configuration from one package to another.
> >>     
> >
> > If you're serious about wanting to do that, it wouldn't be hard to write
> > a program that used the Asterisk manager interface (see the GetConfig
> > action) to read the Asterisk configs and write them out in another
> > format.
> >
> > If you were really ambitious, you could even have Asterisk get it's
> > configs from XML by using the UpdateConfig AMI action, creating use of
> > #exec, or by writing a realtime driver for XML.
> >
> > Personally, even though I'm a big fan of XML (and things like DocBook
> > and XSLT, and having written hundreds of pages of documentation in XML),
> > I don't see what putting the configuration in XML buys you, other than
> > the ability to check the validity of the config file (assuming, of
> > course, that someone writes a DTD and keeps it up to date).
> >
> > In a nutshell, XML is no silver bullet.
> >
> > -Jared Smith
> >   
> 
> No, it's not (a silver bullet) -- agreed.  But a lot of other devices 
> manage their configurations via XML as well, so having a common way of 
> representing shared state would simplify network provisioning, which was 
> the kernel of my original posting.
> 
> 3 of the handset manufacturers that I use, 1 of the firewalls, and 2 of 
> the video-conference engines all use XML.  And the list gets longer 
> every day.

Most of the programs I have don't use XML. And I only feel better.

> 
> Eventually, they will start to converge on common schemas as well...

Asterisk's configuration is mostly hand-written. And also a lot larger
than those of small devices on the network.

jabberd uses an XML for configuration, and I just can't make sense of
it. Unnecessar-ly huge indentations, sections have to be explicitly
ended, etc.

Try to implement '#include' and '#exec' in a sane way with XML.
You can't just include one valid XML in another. You have to make a
partial XML. And apitting it out is usually way more complicated.

Furthermore, there is the issue of partial processing: do you opt for
one big XML file? Or continue with one XML file per .conf file?

That said, I still wonder how to do the equivalent of apache's
'configtest' with Asterisk.

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