aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-24 22:21:58 +0000
committertwilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b>2010-05-24 22:21:58 +0000
commit0c7add2a03853889c326ba56c1cde3025b23722e (patch)
tree18c1cdd9756be0e1dc1ea3d6b3e30a54547a2ae4
parentd73af600f34c55dd7d5c8514e467e8a66875ceac (diff)
Merge the rest of the FullyBooted patch
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@265467 f38db490-d61c-443f-a65b-d21fe96a405b
-rw-r--r--doc/manager_1_1.txt16
-rw-r--r--main/asterisk.c1
-rw-r--r--main/manager.c3
3 files changed, 20 insertions, 0 deletions
diff --git a/doc/manager_1_1.txt b/doc/manager_1_1.txt
index a9b47def5..30ba876ca 100644
--- a/doc/manager_1_1.txt
+++ b/doc/manager_1_1.txt
@@ -314,6 +314,22 @@ Changes to manager version 1.1:
* NEW EVENTS
------------
+- Event: FullyBooted
+ Modules: loader.c
+ Purpose:
+ It is handy to have a single event notification for when all Asterisk
+ modules have been loaded--especially for situations like running
+ automated tests. This event will fire 1) immediately upon all modules
+ loading or 2) upon connection to the AMI interface if the modules have
+ already finished loading before the connection was made. This ensures
+ that a user will never miss getting a FullyBooted event. In vary rare
+ circumstances, it might be possible to get two copies of the message
+ if the AMI connection is made right as the modules finish loading.
+ Example:
+ Event: FullyBooted
+ Privilege: system,all
+ Status: Fully Booted
+
- Event: Transfer
Modules: res_features, chan_sip
Purpose:
diff --git a/main/asterisk.c b/main/asterisk.c
index fd29a6f64..a9844de96 100644
--- a/main/asterisk.c
+++ b/main/asterisk.c
@@ -3723,6 +3723,7 @@ int main(int argc, char *argv[])
sig_alert_pipe[0] = sig_alert_pipe[1] = -1;
ast_set_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED);
+ manager_event(EVENT_FLAG_SYSTEM, "FullyBooted", "Status: Fully Booted\r\n");
ast_process_pending_reloads();
diff --git a/main/manager.c b/main/manager.c
index 297e94f5f..f23cec8a2 100644
--- a/main/manager.c
+++ b/main/manager.c
@@ -2740,6 +2740,9 @@ static int action_login(struct mansession *s, const struct message *m)
ast_verb(2, "%sManager '%s' logged on from %s\n", (s->session->managerid ? "HTTP " : ""), s->session->username, ast_inet_ntoa(s->session->sin.sin_addr));
}
astman_send_ack(s, m, "Authentication accepted");
+ if (ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)) {
+ manager_event(EVENT_FLAG_SYSTEM, "FullyBooted", "Status: Fully Booted\r\n");
+ }
return 0;
}