aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-02 19:56:14 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2010-06-02 19:56:14 +0000
commitfc2a24fdc888e7c8515e40c3d835976819861163 (patch)
treea586a5f5201bda90c3f7f68a48a0c59af79bb7ec /main
parent5253d9b1bdad4a86839bf96ee7176a45efaf74cc (diff)
Add CLI command that blocks until Asterisk has fully booted.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@267183 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/cli.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/main/cli.c b/main/cli.c
index b928fde63..4cb047664 100644
--- a/main/cli.c
+++ b/main/cli.c
@@ -138,6 +138,10 @@ static char group_show_channels_help[] =
" Optional regular expression pattern is matched to group names for each\n"
" channel.\n";
+static char core_wait_fullybooted_help[] =
+"Usage: core waitfullybooted\n"
+" Wait until Asterisk has fully booted.\n";
+
static int handle_load_deprecated(int fd, int argc, char *argv[])
{
if (argc != 2)
@@ -1336,6 +1340,17 @@ static int group_show_channels(int fd, int argc, char *argv[])
#undef FORMAT_STRING
}
+static int handle_cli_wait_fullybooted(int fd, int argc, char *argv[])
+{
+ while (!ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)) {
+ usleep(100);
+ }
+
+ ast_cli(fd, "Asterisk has fully booted.\n");
+
+ return RESULT_SUCCESS;
+}
+
static int handle_help(int fd, int argc, char *argv[]);
static char * complete_help(const char *text, const char *word, int pos, int state)
@@ -1500,6 +1515,10 @@ static struct ast_cli_entry cli_cli[] = {
{ { "soft", "hangup", NULL },
handle_softhangup, "Request a hangup on a given channel",
softhangup_help, complete_ch_3 },
+
+ { { "core", "waitfullybooted", NULL },
+ handle_cli_wait_fullybooted, "Display active channels with group(s)",
+ core_wait_fullybooted_help },
};
/*! \brief initialize the _full_cmd string in * each of the builtins. */