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

Russell Bryant russell at digium.com
Tue Apr 14 16:23:44 CDT 2009


Kevin P. Fleming wrote:
> Olle E. Johansson wrote:
> 
>> I personally favour #1, even though it's not very beautiful. It's used  
>> today in Asterisk.
> 
> I prefer that as well, although there is of course the risk that the
> chosen naming pattern will conflict with actual peer/user entry names
> that some user is already using.

I actually disagree.

Personally, I would prefer option #2 (type=domain) versus option #1
([domain_<whatever>]).  In both cases, you're defining what type of
object it is.  In option #2, you're just encoding the object type into
the context name, where as with type=domain you're being much more
explicit about it.

There are certainly examples of both methods being used in Asterisk.
However, I think the type=something method is used more often, is more
explicit, and is more palatable.

I also don't think that type=domain implies realtime support.  When
setting up realtime in extconfig.conf, each realtime family is pretty
explicit about what is being stored there (sippeers, for example).

> There is a third option, not necessarily prettier, but that is to just
> create another configuration file (sip_domains.conf or something
> similar). The Asterisk configuration mechanism is really only designed
> to handle one type of 'object' per configuration file, and even the
> example you specified for extensions.conf they are still all the same
> type of 'object' (a dialplan context), they just have different semantic
> meaning.

I'm sort of neutral on this idea.  If you go with multiple configuration
files for chan_sip (or any other module), it does buy you another level
in your tree of config.  There is even a precedent for this example
today for SIP (sip_notify.conf).

However, I'm not convinced there is a problem with defining object type
with type= syntax.  People can still split it up into multiple files if
they want to using #includes.

-- 
Russell Bryant
Digium, Inc. | Senior Software Engineer, Open Source Team Lead
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: www.digium.com & www.asterisk.org



More information about the asterisk-dev mailing list