diff options
author | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-15 23:41:22 +0000 |
---|---|---|
committer | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-07-15 23:41:22 +0000 |
commit | 769f7cd1db40ef3e620c53a5a30c56851a8d0ecc (patch) | |
tree | 86b4549e15b17bc8134f6dd3fc17d0dfe6c1ae8b /main/pbx.c | |
parent | 5599ffdc36bfbd46a56de8385dc929ddf8149760 (diff) |
Merged revisions 131129 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r131129 | murf | 2008-07-15 17:36:19 -0600 (Tue, 15 Jul 2008) | 21 lines
(closes issue #12960)
Reported by: mnicholson
Spent most of the day on this bug, and the
solution was so simple. Just had to find and
understand the problem.
The problem was, that the routine to copy
the existing switches, includes, and ignorepats
from the old context to the new one, wasn't
getting called when the context is already
existent. (In other words, if AEL is adding
a new context to the mix, they get copied,
but if pbx_config already defined a context,
then the copy wasn't happening. This made
no sense, so I moved the call to copy the
includes & etc, no matter the case.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@131131 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/main/pbx.c b/main/pbx.c index 591a07bbd..e2e29b983 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -4077,6 +4077,7 @@ int ast_context_remove_include2(struct ast_context *con, const char *include, co if (!strcmp(i->name, include) && (!registrar || !strcmp(i->registrar, registrar))) { /* remove from list */ + ast_verb(3, "Removing inclusion of context '%s' in context '%s; registrar=%s'\n", include, ast_get_context_name(con), registrar); if (pi) pi->next = i->next; else @@ -4131,6 +4132,7 @@ int ast_context_remove_switch2(struct ast_context *con, const char *sw, const ch if (!strcmp(i->name, sw) && !strcmp(i->data, data) && (!registrar || !strcmp(i->registrar, registrar))) { /* found, remove from list */ + ast_verb(3, "Removing switch '%s' from context '%s; registrar=%s'\n", sw, ast_get_context_name(con), registrar); AST_LIST_REMOVE_CURRENT(list); ast_free(i); /* free switch and return */ ret = 0; @@ -5620,6 +5622,7 @@ static void context_merge_incls_swits_igps_other_registrars(struct ast_context * struct ast_ignorepat *ip; struct ast_sw *sw; + ast_verb(3, "merging incls/swits/igpats from old(%s) to new(%s) context, registrar = %s\n", ast_get_context_name(old), ast_get_context_name(new), registrar); /* copy in the includes, switches, and ignorepats */ /* walk through includes */ for (i = NULL; (i = ast_walk_context_includes(old, i)) ; ) { @@ -5681,10 +5684,10 @@ static void context_merge(struct ast_context **extcontexts, struct ast_hashtab * /* make sure the new context exists, so we have somewhere to stick this exten/prio */ if (!new) { new = ast_context_find_or_create(extcontexts, exttable, context->name, prio_item->registrar); /* a new context created via priority from a different context in the old dialplan, gets its registrar from the prio's registrar */ - - /* copy in the includes, switches, and ignorepats */ - context_merge_incls_swits_igps_other_registrars(new, context, registrar); } + + /* copy in the includes, switches, and ignorepats */ + context_merge_incls_swits_igps_other_registrars(new, context, registrar); if (!new) { ast_log(LOG_ERROR,"Could not allocate a new context for %s in merge_and_delete! Danger!\n", context->name); return; /* no sense continuing. */ |