diff options
author | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-05-24 23:52:48 +0000 |
---|---|---|
committer | twilson <twilson@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-05-24 23:52:48 +0000 |
commit | 6b8dfea440d909bc45b4ce606d3c4fed1564363b (patch) | |
tree | 1a535993de0e90956f9d8b4b71332d6f70f62dc6 /main | |
parent | ef55792f03676458d725bfc4aeda38147997b86c (diff) |
Merged revisions 265320,265467 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r265320 | twilson | 2010-05-24 14:06:40 -0500 (Mon, 24 May 2010) | 14 lines
Add the FullyBooted AMI event
It is possible to connect to the manager interface before all Asterisk modules
are loaded. To ensure that an application does not send AMI actions that might
require a module that has not yet loaded, the application can listen for the
FullyBooted manager event. It will be sent upon connection if all modules have
been loaded, or as soon as loading is complete. The event:
Event: FullyBooted
Privilege: system,all
Status: Fully Booted
Review: https://reviewboard.asterisk.org/r/639/
........
r265467 | twilson | 2010-05-24 17:21:58 -0500 (Mon, 24 May 2010) | 1 line
Merge the rest of the FullyBooted patch
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.2@265521 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r-- | main/asterisk.c | 6 | ||||
-rw-r--r-- | main/manager.c | 3 |
2 files changed, 9 insertions, 0 deletions
diff --git a/main/asterisk.c b/main/asterisk.c index 42829addd..187b59416 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -470,6 +470,7 @@ static char *handle_show_settings(struct ast_cli_entry *e, int cmd, struct ast_c ast_cli(a->fd, " -------------\n"); ast_cli(a->fd, " Manager (AMI): %s\n", check_manager_enabled() ? "Enabled" : "Disabled"); ast_cli(a->fd, " Web Manager (AMI/HTTP): %s\n", check_webmanager_enabled() ? "Enabled" : "Disabled"); + ast_cli(a->fd, " Send Manager FullyBooted: %s\n", ast_opt_send_fullybooted ? "Enabled" : "Disabled"); ast_cli(a->fd, " Call data records: %s\n", check_cdr_enabled() ? "Enabled" : "Disabled"); ast_cli(a->fd, " Realtime Architecture (ARA): %s\n", ast_realtime_enabled() ? "Enabled" : "Disabled"); @@ -2997,6 +2998,8 @@ static void ast_readconfig(void) ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_FORCE_BLACK_BACKGROUND); } else if (!strcasecmp(v->name, "hideconnect")) { ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_HIDE_CONSOLE_CONNECT); + } else if (!strcasecmp(v->name, "sendfullybooted")) { + ast_set2_flag(&ast_options, ast_true(v->value), AST_OPT_FLAG_SEND_FULLYBOOTED); } } for (v = ast_variable_browse(cfg, "compat"); v; v = v->next) { @@ -3678,6 +3681,9 @@ 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); + if (ast_opt_send_fullybooted) { + 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 f1d88ded4..66253c543 100644 --- a/main/manager.c +++ b/main/manager.c @@ -1771,6 +1771,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)); ast_log(LOG_EVENT, "%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_opt_send_fullybooted && ast_test_flag(&ast_options, AST_OPT_FLAG_FULLY_BOOTED)) { + manager_event(EVENT_FLAG_SYSTEM, "FullyBooted", "Status: Fully Booted\r\n"); + } return 0; } |