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

Leif Madsen leif.madsen at asteriskdocs.org
Wed Apr 15 12:54:52 CDT 2009



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.

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.

-- 
Leif Madsen.
http://www.leifmadsen.com
http://www.oreilly.com/catalog/asterisk



More information about the asterisk-dev mailing list