Add counter for sip show registry CLI command. (issue #9352 reported by junky)
authorJoshua Colp <jcolp@digium.com>
Mon, 9 Apr 2007 00:47:06 +0000 (00:47 +0000)
committerJoshua Colp <jcolp@digium.com>
Mon, 9 Apr 2007 00:47:06 +0000 (00:47 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@60796 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index c8a375d..a954ba3 100644 (file)
@@ -10911,7 +10911,7 @@ static int sip_show_registry(int fd, int argc, char *argv[])
        char host[80];
        char tmpdat[256];
        struct tm tm;
-
+       int counter = 0;
 
        if (argc != 3)
                return RESULT_SHOWUSAGE;
@@ -10926,7 +10926,9 @@ static int sip_show_registry(int fd, int argc, char *argv[])
                        tmpdat[0] = '\0';
                ast_cli(fd, FORMAT, host, iterator->username, iterator->refresh, regstate2str(iterator->regstate), tmpdat);
                ASTOBJ_UNLOCK(iterator);
+               counter++;
        } while(0));
+       ast_cli(fd, "%d SIP registrations.\n", counter);
        return RESULT_SUCCESS;
 #undef FORMAT
 #undef FORMAT2