mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
Merged revisions 87168 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r87168 | murf | 2007-10-26 10:34:02 -0600 (Fri, 26 Oct 2007) | 1 line closes issue #11086 where a user complains that references to following contexts report a problem; The problem was REALLy that he was referring to empty contexts, which were being ignored. Reporter stated that empty contexts should be OK. I checked it out against extensions.conf, and sure enough, empty contexts ARE ok. So, I removed the restriction from AEL. This, though, highlighted a problem with multiple contexts of the same name. This should be OK, also. So, I added the extend keyword to AEL, and it can preceed the 'context' keyword (mixed with 'abstract', if nec.). This will turn off the warnings in AEL if the same context name is used 2 or more times. Also, I now call ast_context_find_or_create for contexts now, instead of just ast_context_create; I did this because pbx_config does this. The 'extend' keyword thus becomes a statement of intent. AEL can now duplicate the behavior of pbx_config, ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87187 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2293,9 +2293,9 @@ static void check_context_names(void)
|
||||
if (i->type == PV_CONTEXT || i->type == PV_MACRO) {
|
||||
for (j=i->next; j; j=j->next) {
|
||||
if ( j->type == PV_CONTEXT || j->type == PV_MACRO ) {
|
||||
if ( !strcmp(i->u1.str, j->u1.str) )
|
||||
if ( !strcmp(i->u1.str, j->u1.str) && !(i->u3.abstract&2) && !(j->u3.abstract&2) )
|
||||
{
|
||||
ast_log(LOG_WARNING,"Warning: file %s, line %d-%d: The context name (%s) is also declared in file %s, line %d-%d!\n",
|
||||
ast_log(LOG_WARNING,"Warning: file %s, line %d-%d: The context name (%s) is also declared in file %s, line %d-%d! (and neither is marked 'extend')\n",
|
||||
i->filename, i->startline, i->endline, i->u1.str, j->filename, j->startline, j->endline);
|
||||
warns++;
|
||||
}
|
||||
@@ -4031,7 +4031,7 @@ void ast_compile_ael2(struct ast_context **local_contexts, struct pval *root)
|
||||
break;
|
||||
|
||||
case PV_CONTEXT:
|
||||
context = ast_context_create(local_contexts, p->u1.str, registrar);
|
||||
context = ast_context_find_or_create(local_contexts, p->u1.str, registrar);
|
||||
|
||||
/* contexts contain: ignorepat, includes, switches, eswitches, extensions, */
|
||||
for (p2=p->u2.statements; p2; p2=p2->next) {
|
||||
|
Reference in New Issue
Block a user