Philip Prindeville
2007-Dec-07 21:51 UTC
[asterisk-users] Using XML for configuration management, single-source-of-truth, etc.
I'm starting work on some provisioning tools to simplify plugging in and configuring hard SIP handsets and conference bridges (maybe eventually MPEG-4 PoE video cameras that speak SIP as well). Issue is that I'd like to glean as much information out of the configuration files... but don't want to write a whole new parser to do it (especially not one that understands templates and macros). For instance, from the voicemail.conf, extensions.conf, and sip.conf files, I should be able to generate 90% of the configuration state needed for provisioning an out-of-the-box Sipura SPA941... if only those files were in some more parsable format, like XML. How much effort would it be to add an application that traverses the configuration state and writes it out as an XML flat file? Or perhaps at some point in the future, Asterisk's configuration files could be represented as XML natively (did someone in the back row just show "gconf"???). I'm a relative newbie, so if I'm missing something obvious or there's been a religious war on the subject in the past, apologies... -Philip
Darryl Dunkin
2007-Dec-08 00:25 UTC
[asterisk-users] Using XML for configuration management, single-source-of-truth, etc.
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. -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Philip Prindeville Sent: Friday, December 07, 2007 13:51 To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Using XML for configuration management,single-source-of-truth, etc. I'm starting work on some provisioning tools to simplify plugging in and configuring hard SIP handsets and conference bridges (maybe eventually MPEG-4 PoE video cameras that speak SIP as well). Issue is that I'd like to glean as much information out of the configuration files... but don't want to write a whole new parser to do it (especially not one that understands templates and macros). For instance, from the voicemail.conf, extensions.conf, and sip.conf files, I should be able to generate 90% of the configuration state needed for provisioning an out-of-the-box Sipura SPA941... if only those files were in some more parsable format, like XML. How much effort would it be to add an application that traverses the configuration state and writes it out as an XML flat file? Or perhaps at some point in the future, Asterisk's configuration files could be represented as XML natively (did someone in the back row just show "gconf"???). I'm a relative newbie, so if I'm missing something obvious or there's been a religious war on the subject in the past, apologies... -Philip _______________________________________________ --Bandwidth and Colocation Provided by http://www.api-digital.com-- asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users
Ryan Burke
2007-Dec-08 13:43 UTC
[asterisk-users] Using XML for configuration management, single-source-of-truth, etc.
> 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 >Can these configuration managers run from a command line? Or do they require a graphical environment?
Tzafrir Cohen
2007-Dec-08 20:50 UTC
[asterisk-users] Using XML for configuration management, single-source-of-truth, etc.
On Sat, Dec 08, 2007 at 09:31:28PM +0100, Per Jessen wrote:> Tilghman Lesher wrote: > > > And finally, another person has already made the point that most XML > > editors are graphical in nature. A great many Asterisk installations > > are installed in locations where a graphical front end is not > > practical. > > "ssh -X" will deal with that.it does not survive a reconnect. screen helps me with that. It also has a huge bandwidth requirement. Oh, and you need tons of extra softwares actually installed, and running on your Asterisk server. -- 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
Apparently Analagous Threads
- US "Truth in caller id act"... and it's impact on services
- G729/MOH Quality
- [Bug 1733] New: Enhance support for QoS (ToS) by supporting DSCP/CS and adding option
- [Bug 1856] New: Wrong QoS naming and obsolete defaults
- Bunch of set-up/usage questions (SLA, MWI, SMS proxy's, crypto, Fax, etc)