[asterisk-commits] seanbright: branch group/1.6.1-maintenance r265839 - in /team/group/1.6.1-mai...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed May 26 08:59:51 CDT 2010


Author: seanbright
Date: Wed May 26 08:59:48 2010
New Revision: 265839

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=265839
Log:
Merged revisions 265519 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.6.1

................
  r265519 | twilson | 2010-05-24 19:25:58 -0400 (Mon, 24 May 2010) | 25 lines
  
  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
  ........
................

Modified:
    team/group/1.6.1-maintenance/   (props changed)
    team/group/1.6.1-maintenance/Makefile
    team/group/1.6.1-maintenance/doc/manager_1_1.txt
    team/group/1.6.1-maintenance/doc/tex/manager.tex
    team/group/1.6.1-maintenance/include/asterisk/options.h
    team/group/1.6.1-maintenance/main/asterisk.c
    team/group/1.6.1-maintenance/main/manager.c

Propchange: team/group/1.6.1-maintenance/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/group/1.6.1-maintenance/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed May 26 08:59:48 2010
@@ -1,1 +1,1 @@
-/branches/1.6.1:1-263194
+/branches/1.6.1:1-265838

Modified: team/group/1.6.1-maintenance/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/group/1.6.1-maintenance/Makefile?view=diff&rev=265839&r1=265838&r2=265839
==============================================================================
--- team/group/1.6.1-maintenance/Makefile (original)
+++ team/group/1.6.1-maintenance/Makefile Wed May 26 08:59:48 2010
@@ -691,6 +691,7 @@
 		echo "                        ; to the device.  It is for this reason that this is optional, as it may result in requiring a" ; \
 		echo "                        ; temporary codec translation path for a channel that may not otherwise require one." ; \
 		echo ";transcode_via_sln = yes ; Build transcode paths via SLINEAR, instead of directly" ; \
+		echo ";sendfullybooted = yes  ; Send the FullyBooted AMI event on AMI login and when all modules are finished loading" ; \
 		echo ";runuser = asterisk ; The user to run as" ; \
 		echo ";rungroup = asterisk ; The group to run as" ; \
 		echo "" ; \

Modified: team/group/1.6.1-maintenance/doc/manager_1_1.txt
URL: http://svnview.digium.com/svn/asterisk/team/group/1.6.1-maintenance/doc/manager_1_1.txt?view=diff&rev=265839&r1=265838&r2=265839
==============================================================================
--- team/group/1.6.1-maintenance/doc/manager_1_1.txt (original)
+++ team/group/1.6.1-maintenance/doc/manager_1_1.txt Wed May 26 08:59:48 2010
@@ -200,6 +200,22 @@
 * 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:

Modified: team/group/1.6.1-maintenance/doc/tex/manager.tex
URL: http://svnview.digium.com/svn/asterisk/team/group/1.6.1-maintenance/doc/tex/manager.tex?view=diff&rev=265839&r1=265838&r2=265839
==============================================================================
--- team/group/1.6.1-maintenance/doc/tex/manager.tex (original)
+++ team/group/1.6.1-maintenance/doc/tex/manager.tex Wed May 26 08:59:48 2010
@@ -28,8 +28,6 @@
 headers and their interpretation. If you are unsure, discuss on
 the asterisk-dev mailing list.
 
-\section{Device status reports}
-
 Manager subscribes to extension status reports from all channels,
 to be able to generate events when an extension or device changes
 state. The level of details in these events may depend on the channel
@@ -110,6 +108,21 @@
 There are a number of GUI tools that use the manager interface, please search
 the mailing list archives and the documentation page on the
 \url{http://www.asterisk.org} web site for more information.
+
+\section{Ensuring all modules are loaded}
+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:
+
+\begin{verbatim}
+   Event: FullyBooted
+   Privilege: system,all
+   Status: Fully Booted
+\end{verbatim}
+
+\section{Device status reports}
 
 
 \section{Some standard AMI headers}

Modified: team/group/1.6.1-maintenance/include/asterisk/options.h
URL: http://svnview.digium.com/svn/asterisk/team/group/1.6.1-maintenance/include/asterisk/options.h?view=diff&rev=265839&r1=265838&r2=265839
==============================================================================
--- team/group/1.6.1-maintenance/include/asterisk/options.h (original)
+++ team/group/1.6.1-maintenance/include/asterisk/options.h Wed May 26 08:59:48 2010
@@ -85,7 +85,9 @@
 	/*! There is a per-file verbose setting */
 	AST_OPT_FLAG_VERBOSE_FILE = (1 << 24),
 	/*! Generic PLC */
-	AST_OPT_FLAG_GENERIC_PLC = (1 << 30),
+	AST_OPT_FLAG_GENERIC_PLC = (1 << 25),
+	/*! Send the FullyBooted AMI event when all modules are loaded */
+	AST_OPT_FLAG_SEND_FULLYBOOTED = (1 << 26),
 };
 
 /*! These are the options that set by default when Asterisk starts */
@@ -120,6 +122,8 @@
 #define ast_opt_dbg_file		ast_test_flag(&ast_options, AST_OPT_FLAG_DEBUG_FILE)
 #define ast_opt_verb_file		ast_test_flag(&ast_options, AST_OPT_FLAG_VERBOSE_FILE)
 #define ast_opt_generic_plc         ast_test_flag(&ast_options, AST_OPT_FLAG_GENERIC_PLC)
+#define ast_opt_send_fullybooted	ast_test_flag(&ast_options, AST_OPT_FLAG_SEND_FULLYBOOTED)
+
 
 extern struct ast_flags ast_options;
 

Modified: team/group/1.6.1-maintenance/main/asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/group/1.6.1-maintenance/main/asterisk.c?view=diff&rev=265839&r1=265838&r2=265839
==============================================================================
--- team/group/1.6.1-maintenance/main/asterisk.c (original)
+++ team/group/1.6.1-maintenance/main/asterisk.c Wed May 26 08:59:48 2010
@@ -437,6 +437,7 @@
 	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");
 
@@ -2848,6 +2849,8 @@
 				ast_eid_default = tmp_eid;
 			} else
 				ast_verbose("Invalid Entity ID '%s' provided\n", v->value);
+		} 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) {
@@ -3505,6 +3508,9 @@
 		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();
 

Modified: team/group/1.6.1-maintenance/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/team/group/1.6.1-maintenance/main/manager.c?view=diff&rev=265839&r1=265838&r2=265839
==============================================================================
--- team/group/1.6.1-maintenance/main/manager.c (original)
+++ team/group/1.6.1-maintenance/main/manager.c Wed May 26 08:59:48 2010
@@ -1753,6 +1753,9 @@
 		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;
 }
 




More information about the asterisk-commits mailing list