If multiple [general] contexts occur from sip.conf (usually due to external includes), merge them.

The original implementation of this did the merging of all contexts with the
same name in the realtime layer, but that implementation severely breaks
drivers which use the same context name (e.g. iax.conf, type={peer,user}).
Therefore, the implementation needs to do the merging for particular entries
only, based upon what contexts would allow that in the channel driver itself.
This implementation is for chan_sip only, but others could be added in the
future.

(closes issue #17957)
 Reported by: marcelloceschia
 Patches: 
       chan-sip_parsing-general_branch162.patch uploaded by marcelloceschia (license 1079)
 Tested by: tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316428 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2011-05-03 23:36:35 +00:00
parent 95561bd37a
commit ed56ae3ef7
2 changed files with 488 additions and 476 deletions

View File

@@ -108,6 +108,11 @@ FollowMe
compatability for a FollowMe call with certain dialplan apps, options, and
functions.
SIP Changes
-----------
* Multiple [general] contexts are now permitted within sip.conf. They will be
merged at load time.
------------------------------------------------------------------------------
--- Functionality changes from Asterisk 1.6.2 to Asterisk 1.8 ----------------
------------------------------------------------------------------------------

View File

@@ -27228,8 +27228,13 @@ static int reload_config(enum channelreloadreason reason)
ast_clear_flag(&global_flags[1], SIP_PAGE2_IGNORESDPVERSION);
/* Read the [general] config section of sip.conf (or from realtime config) */
for (v = ast_variable_browse(cfg, "general"); v; v = v->next) {
/* Read all [general] config sections of sip.conf (or from realtime config) */
for (cat = ast_category_browse(cfg, "general"); cat; cat = ast_category_browse(cfg, cat)) {
if (strcmp(cat, "general")) {
continue;
}
for (v = ast_variable_browse(cfg, cat); v; v = v->next) {
if (handle_common_options(&global_flags[0], &dummy[0], v)) {
continue;
}
@@ -27728,6 +27733,8 @@ static int reload_config(enum channelreloadreason reason)
}
}
} /* for (...ast_category_browse(cfg, "general")...) */
if (subscribe_network_change) {
network_change_event_subscribe();
} else {