[asterisk-commits] seanbright: trunk r196907 - /trunk/main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue May 26 15:20:17 CDT 2009


Author: seanbright
Date: Tue May 26 15:20:08 2009
New Revision: 196907

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=196907
Log:
Include startup and reload date in the CoreStatus manager message.

The CoreStartupTime and CoreReloadTime name/value pairs in the CoreStatus
response message only included the time and not the date.  This patch,
inspired by the reporter's patch, adds 2 new fields - CoreStartupDate and
CoreReloadDate - which contain the date portion of these values.

(closes issue #15000)
Reported by: sum

Modified:
    trunk/main/manager.c

Modified: trunk/main/manager.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/main/manager.c?view=diff&rev=196907&r1=196906&r2=196907
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Tue May 26 15:20:08 2009
@@ -3354,8 +3354,8 @@
 {
 	const char *actionid = astman_get_header(m, "ActionID");
 	char idText[150];
-	char startuptime[150];
-	char reloadtime[150];
+	char startuptime[150], startupdate[150];
+	char reloadtime[150], reloaddate[150];
 	struct ast_tm tm;
 
 	if (!ast_strlen_zero(actionid)) {
@@ -3366,17 +3366,23 @@
 
 	ast_localtime(&ast_startuptime, &tm, NULL);
 	ast_strftime(startuptime, sizeof(startuptime), "%H:%M:%S", &tm);
+	ast_strftime(startupdate, sizeof(startupdate), "%Y-%m-%d", &tm);
 	ast_localtime(&ast_lastreloadtime, &tm, NULL);
 	ast_strftime(reloadtime, sizeof(reloadtime), "%H:%M:%S", &tm);
+	ast_strftime(reloaddate, sizeof(reloaddate), "%Y-%m-%d", &tm);
 
 	astman_append(s, "Response: Success\r\n"
 			"%s"
+			"CoreStartupDate: %s\r\n"
 			"CoreStartupTime: %s\r\n"
+			"CoreReloadDate: %s\r\n"
 			"CoreReloadTime: %s\r\n"
 			"CoreCurrentCalls: %d\r\n"
 			"\r\n",
 			idText,
+			startupdate,
 			startuptime,
+			reloaddate,
 			reloadtime,
 			ast_active_channels()
 			);




More information about the asterisk-commits mailing list