added counter for iax2 show registry CLI output, closes issue 10461, thanks junky
authorDwayne M. Hubbard <dwayne.hubbard@gmail.com>
Thu, 16 Aug 2007 18:23:39 +0000 (18:23 +0000)
committerDwayne M. Hubbard <dwayne.hubbard@gmail.com>
Thu, 16 Aug 2007 18:23:39 +0000 (18:23 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79725 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_iax2.c

index 70122bc..6f41fdb 100644 (file)
@@ -4652,6 +4652,7 @@ static int iax2_show_registry(int fd, int argc, char *argv[])
 
        char host[80];
        char perceived[80];
+       int counter = 0;
        if (argc != 3)
                return RESULT_SHOWUSAGE;
        ast_cli(fd, FORMAT2, "Host", "dnsmgr", "Username", "Perceived", "Refresh", "State");
@@ -4665,8 +4666,10 @@ static int iax2_show_registry(int fd, int argc, char *argv[])
                ast_cli(fd, FORMAT, host, 
                                        (reg->dnsmgr) ? "Y" : "N", 
                                        reg->username, perceived, reg->refresh, regstate2str(reg->regstate));
+               counter++;
        }
        AST_LIST_UNLOCK(&registrations);
+       ast_cli(fd, "%d IAX2 registrations.\n", counter);
        return RESULT_SUCCESS;
 #undef FORMAT
 #undef FORMAT2