]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Ensure counts generated in manager_show_dialplan_helper are correct
authorKinsey Moore <kmoore@digium.com>
Wed, 5 Sep 2012 18:30:49 +0000 (18:30 +0000)
committerKinsey Moore <kmoore@digium.com>
Wed, 5 Sep 2012 18:30:49 +0000 (18:30 +0000)
When manager_show_dialplan_helper was written, the counter increment
for the total number of contexts was placed with the extensions
increment instead of in the enclosing loop.  This function should
now generate correct context counts.

(closes issue AST-970)
Reported-by: John Bigelow
........

Merged revisions 372337 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@372338 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/pbx.c

index f24973134b5850e2daf3ecebbf0db578b62e936f..165cf22627b04ab31b6b55ad1e4dbabe8abf0da7 100644 (file)
@@ -6911,6 +6911,7 @@ static int manager_show_dialplan_helper(struct mansession *s, const struct messa
                        continue;       /* not the name we want */
 
                dpc->context_existence = 1;
+               dpc->total_context++;
 
                ast_debug(3, "manager_show_dialplan: Found Context: %s \n", ast_get_context_name(c));
 
@@ -6934,8 +6935,6 @@ static int manager_show_dialplan_helper(struct mansession *s, const struct messa
 
                        dpc->extension_existence = 1;
 
-                       /* may we print context info? */
-                       dpc->total_context++;
                        dpc->total_exten++;
 
                        p = NULL;               /* walk next extension peers */