[svn-commits] jrose: branch 1.8 r313048 - in /branches/1.8: ./ main/features.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Thu Apr 7 08:35:39 CDT 2011
Author: jrose
Date: Thu Apr 7 08:35:33 2011
New Revision: 313048
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=313048
Log:
Merged revisions 313047 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2
........
r313047 | jrose | 2011-04-07 08:23:01 -0500 (Thu, 07 Apr 2011) | 9 lines
Makes parking lots clear and rebuild properly when features reload is invoked from CLI
Before, default parkinglot in context parkedcalls with ext 700 would always be present and when reload was invoked, the previous parkinglots would not be cleared.
(closes issue #18801)
Reported by: mickecarlsson
Review: https://reviewboard.asterisk.org/r/1161/
........
Modified:
branches/1.8/ (props changed)
branches/1.8/main/features.c
Propchange: branches/1.8/
------------------------------------------------------------------------------
Binary property 'branch-1.6.2-merged' - no diff available.
Modified: branches/1.8/main/features.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/features.c?view=diff&rev=313048&r1=313047&r2=313048
==============================================================================
--- branches/1.8/main/features.c (original)
+++ branches/1.8/main/features.c Thu Apr 7 08:35:33 2011
@@ -4838,6 +4838,17 @@
"applicationmap"
};
+ /* Clear the existing parkinglots in the parkinglots container. */
+ {
+ struct ast_parkinglot *p;
+ struct ao2_iterator iter = ao2_iterator_init(parkinglots, 0);
+ while ((p = ao2_iterator_next(&iter))) {
+ ao2_unlink(parkinglots, p);
+ ao2_ref(p,-1);
+ }
+ ao2_iterator_destroy(&iter);
+ }
+
default_parkinglot = build_parkinglot(DEFAULT_PARKINGLOT, NULL);
if (default_parkinglot) {
ao2_lock(default_parkinglot);
@@ -4887,7 +4898,19 @@
ast_log(LOG_WARNING,"Could not load features.conf\n");
return 0;
}
- for (var = ast_variable_browse(cfg, "general"); var; var = var->next) {
+
+ if ((var = ast_variable_browse(cfg, "general"))) {
+ /* Find a general context in features.conf, we need to clear our existing default context */
+ /* Can't outright destroy the parking lot because it's needed in a little while. */
+ if ((con = ast_context_find(default_parkinglot->parking_con))) {
+ ast_context_destroy(con, registrar);
+ }
+ if ((con = ast_context_find(default_parkinglot->parking_con_dial))) {
+ ast_context_destroy(con, registrar);
+ }
+ }
+
+ for (; var; var = var->next) {
if (!strcasecmp(var->name, "parkext")) {
ast_copy_string(default_parkinglot->parkext, var->value, sizeof(default_parkinglot->parkext));
} else if (!strcasecmp(var->name, "context")) {
More information about the svn-commits
mailing list