[asterisk-dev] Defining new section type in sip.conf - question about syntax

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Wed Apr 15 13:19:27 CDT 2009


On Wednesday 15 April 2009 12:54:52 Leif Madsen wrote:
> Jared Smith wrote:
> > On Tue, 2009-04-14 at 21:47 +0200, Olle E. Johansson wrote:
> >> I want to find a way to define settings per domain, that applies as
> >> defaults for devices within that domain. Instead of having only one
> >> set of default settings in the general section, I want to be able to
> >> have multiple default settings. I see two alternatives:
> >>
> >> 1. Using a prefix
> >> =============
> >>
> >> 2. Using type=
> >> ============
> >
> > I'm strongly in favor of *not* using method number two.  It's hard
> > enough to explain users/peers/friends to people trying to learn Asterisk
> > (especially as we have cases where calls come into peers).  Overloading
> > the "type=" field for a totally different type of construct just further
> > muddies the waters.
> >
> > I personally don't have a problem with doing [domain-jaredsmith.net], as
> > long as we use a hyphen and not an underscore after the word "domain" to
> > be consistent with macros, etc. (We have enough inconsistencies in
> > Asterisk as it is, and don't need to be adding more!)
> >
> > If people would rather move the per-domain settings to a separate config
> > file (say sip_domains.conf) I'm OK with it as well, as long as we
> > document that fact in both sip.conf and the new configuration file, so
> > that it doesn't surprise people too much.
>
> My first instinct was that I'd prefer to see the 'type' method used,
> however Jared and Olle do bring up good points about not wanting to
> overload that method to get something else.

My inclination is also the type method, but I suggest that we make that field
a comma-delimited field, such that type=friend is the same as type=user,peer.
Additionally, the type could be along the lines of type=peer,domain or
whatever syntax makes the most sense.

> I'm not a big fan of using the prefix method, so would much prefer to see
> the separate .conf file used. It seemed to be the best middle ground, as it
> were.

I'm also in opposition to the prefix, but I think comma-separated type is
preferable to a separate configuration file.  The only reason why we made
sip_notify.conf a separate file is that the notify structure conflicted with
the present sip.conf and the amount of information was not conducive to
presenting multiple bits of information on a single line, as the present
sip.conf would have necessitated.

I'd like to see some discussion about the differences that force the need
to use a separate configuration file before we go down that path.  If the
question is merely one of ease of coding, then I don't think the standard
is met.

-- 
Tilghman



More information about the asterisk-dev mailing list