[asterisk-commits] russell: branch 1.6.2 r267139 - in /branches/1.6.2: ./ main/cli.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jun 2 13:57:05 CDT 2010


Author: russell
Date: Wed Jun  2 13:57:02 2010
New Revision: 267139

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=267139
Log:
Merged revisions 267138 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

........
  r267138 | russell | 2010-06-02 13:53:38 -0500 (Wed, 02 Jun 2010) | 4 lines
  
  Add a CLI command that blocks until Asterisk has fully booted.
  
  Review: https://reviewboard.asterisk.org/r/684/
........

Modified:
    branches/1.6.2/   (props changed)
    branches/1.6.2/main/cli.c

Propchange: branches/1.6.2/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.2/main/cli.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/main/cli.c?view=diff&rev=267139&r1=267138&r2=267139
==============================================================================
--- branches/1.6.2/main/cli.c (original)
+++ branches/1.6.2/main/cli.c Wed Jun  2 13:57:02 2010
@@ -1465,6 +1465,28 @@
 #undef FORMAT_STRING
 }
 
+static char *handle_cli_wait_fullybooted(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
+{
+	switch (cmd) {
+	case CLI_INIT:
+		e->command = "core waitfullybooted";
+		e->usage =
+			"Usage: core waitfullybooted\n"
+			"	Wait until Asterisk has fully booted.\n";
+		return NULL;
+	case CLI_GENERATE:
+		return NULL;
+	}
+
+	while (!ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)) {
+		usleep(100);
+	}
+
+	ast_cli(a->fd, "Asterisk has fully booted.\n");
+
+	return CLI_SUCCESS;
+}
+
 static char *handle_help(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a);
 
 static struct ast_cli_entry cli_cli[] = {
@@ -1508,6 +1530,8 @@
 	AST_CLI_DEFINE(handle_cli_show_permissions, "Show CLI permissions"),
 
 	AST_CLI_DEFINE(handle_cli_check_permissions, "Try a permissions config for a user"),
+
+	AST_CLI_DEFINE(handle_cli_wait_fullybooted, "Wait for Asterisk to be fully booted"),
 };
 
 /*!




More information about the asterisk-commits mailing list