From: Joshua Colp Date: Mon, 9 Apr 2007 00:47:06 +0000 (+0000) Subject: Add counter for sip show registry CLI command. (issue #9352 reported by junky) X-Git-Tag: 1.6.0-beta1~3^2~2886 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ed75ded0480f5e7005f656879c683844b3363fe8;p=thirdparty%2Fasterisk.git Add counter for sip show registry CLI command. (issue #9352 reported by junky) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@60796 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/chan_sip.c b/channels/chan_sip.c index c8a375d6b3..a954ba36fc 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -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