[asterisk-commits] jpeeler: branch jpeeler/bug11261 r182157 - in /team/jpeeler/bug11261/channels...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Mar 13 17:32:45 CDT 2009


Author: jpeeler
Date: Fri Mar 13 17:32:37 2009
New Revision: 182157

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=182157
Log:
add CLI h323 show version command

Modified:
    team/jpeeler/bug11261/channels/chan_h323.c
    team/jpeeler/bug11261/channels/h323/ast_h323.cxx
    team/jpeeler/bug11261/channels/h323/chan_h323.h

Modified: team/jpeeler/bug11261/channels/chan_h323.c
URL: http://svn.digium.com/svn-view/asterisk/team/jpeeler/bug11261/channels/chan_h323.c?view=diff&rev=182157&r1=182156&r2=182157
==============================================================================
--- team/jpeeler/bug11261/channels/chan_h323.c (original)
+++ team/jpeeler/bug11261/channels/chan_h323.c Fri Mar 13 17:32:37 2009
@@ -2729,12 +2729,34 @@
 	return CLI_SUCCESS;
 }
 
+static char *handle_cli_h323_show_version(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	switch (cmd) {
+	case CLI_INIT:
+		e->command = "h323 show version";
+		e->usage =
+			"Usage: h323 show version\n"
+			"		Show the version of the H.323 library in use\n";
+		return NULL;
+	case CLI_GENERATE:
+		return NULL;
+	}
+
+	if (a->argc != 3)
+		return CLI_SHOWUSAGE;
+
+	h323_show_version();
+	
+	return CLI_SUCCESS;
+}
+
 static struct ast_cli_entry cli_h323[] = {
-	AST_CLI_DEFINE(handle_cli_h323_set_trace,   "Enable/Disable H.323 Stack Tracing"),
-	AST_CLI_DEFINE(handle_cli_h323_set_debug,   "Enable/Disable H.323 Debugging"),
-	AST_CLI_DEFINE(handle_cli_h323_cycle_gk,    "Manually re-register with the Gatekeper"),
-	AST_CLI_DEFINE(handle_cli_h323_hangup,      "Manually try to hang up a call"),
-	AST_CLI_DEFINE(handle_cli_h323_show_tokens, "Show all active call tokens"),
+	AST_CLI_DEFINE(handle_cli_h323_set_trace,    "Enable/Disable H.323 Stack Tracing"),
+	AST_CLI_DEFINE(handle_cli_h323_set_debug,    "Enable/Disable H.323 Debugging"),
+	AST_CLI_DEFINE(handle_cli_h323_cycle_gk,     "Manually re-register with the Gatekeper"),
+	AST_CLI_DEFINE(handle_cli_h323_hangup,       "Manually try to hang up a call"),
+	AST_CLI_DEFINE(handle_cli_h323_show_tokens,  "Show all active call tokens"),
+	AST_CLI_DEFINE(handle_cli_h323_show_version, "Show the version of the H.323 library in use"),
 };
 
 static void delete_users(void)

Modified: team/jpeeler/bug11261/channels/h323/ast_h323.cxx
URL: http://svn.digium.com/svn-view/asterisk/team/jpeeler/bug11261/channels/h323/ast_h323.cxx?view=diff&rev=182157&r1=182156&r2=182157
==============================================================================
--- team/jpeeler/bug11261/channels/h323/ast_h323.cxx (original)
+++ team/jpeeler/bug11261/channels/h323/ast_h323.cxx Fri Mar 13 17:32:37 2009
@@ -2447,6 +2447,11 @@
 	cout << "Current call tokens: " << setprecision(2) << endPoint->GetAllConnections() << endl;
 }
 
+void h323_show_version(void)
+{
+    cout << "H.323 version: " << OPENH323_MAJOR << "." << OPENH323_MINOR << "." << OPENH323_BUILD << endl;
+}
+
 /** Establish Gatekeeper communiations, if so configured,
   *	register aliases for the H.323 endpoint to respond to.
   */

Modified: team/jpeeler/bug11261/channels/h323/chan_h323.h
URL: http://svn.digium.com/svn-view/asterisk/team/jpeeler/bug11261/channels/h323/chan_h323.h?view=diff&rev=182157&r1=182156&r2=182157
==============================================================================
--- team/jpeeler/bug11261/channels/h323/chan_h323.h (original)
+++ team/jpeeler/bug11261/channels/h323/chan_h323.h Fri Mar 13 17:32:37 2009
@@ -242,6 +242,7 @@
 	int h323_set_gk(int, char *, char *);
 	void h323_set_id(char *);
 	void h323_show_tokens(void);
+	void h323_show_version(void);
 
 	/* H323 listener related funcions */
 	int h323_start_listener(int, struct sockaddr_in);




More information about the asterisk-commits mailing list