]> 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:29:02 +0000 (18:29 +0000)
committerKinsey Moore <kmoore@digium.com>
Wed, 5 Sep 2012 18:29:02 +0000 (18:29 +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
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@372337 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/pbx.c

index d747ee79e7f88517e1cea27a87625bf79eb450f2..9636b7be8a419d923818cd92cc4ee8a73652f42b 100644 (file)
@@ -6752,6 +6752,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));
 
@@ -6775,8 +6776,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 */