[Asterisk-Dev] CVS Head-- Dialplan disappeared! -- RESOLUTION

Tzafrir Cohen tzafrir.cohen at xorcom.com
Mon Jun 27 21:18:54 MST 2005


On Mon, Jun 27, 2005 at 08:18:28PM -0500, Eric Wieling aka ManxPower wrote:
> James Golovich wrote:
> 
> >
> >On Mon, 27 Jun 2005, Steve Murphy wrote:
> >
> >
> >>Here I answer my question:
> >>
> >>QUESTION_ If there's a syntax error in the extensions.conf file, won't
> >>it tell you?
> >>
> >>ANSWER: No!
> >
> >
> >There should be some kind of message printed in the logs, but sometimes
> >its not exactly obvious.  The message you probably got was "No category
> >context for line X of extensions.conf"
> >
> >I uncovered the fact that it drops everything when working on a memory
> >leak related to config parsing.  There needs to be a decision made about
> >how we handle these cases.  Do we assume that if theres a bad line that
> >the whole file is junk?  Should we just ignore invalid lines?  Maybe
> >process everything up to the error and ignore the rest?
> >
> >I'm not sure what the right answer is.
> 
> all the config files seem to ignore invalid lines.  I used to think 
> this was a bad thing.  Until I wrote an external application that 
> parses voicemail.conf to do something, but needed additional 
> information for the mailbox that is not normally in voicemail.conf.  I 
> just added the info and asterisk ignored what it doesn't understand.

To the best of my understanding, a line can be:

[section]
^\s*\[[a-zA-Z0-9_-]\]\s*

variable=vale
\s*[a-zA-Z0-9_-]+\s*=\s*not_sure

directive=>value
\s*[a-zA-Z0-9_-]+\s*=>\s*not_sure

#specials
\s*#.*

A parser should still be able to tell that:

  this comment line is missing a ';' in the beginnin

is nither of those.

-- 
Tzafrir Cohen     icq#16849755  +972-50-7952406
tzafrir.cohen at xorcom.com  http://www.xorcom.com



More information about the asterisk-dev mailing list