From bbd9f040e1bf1ba5a91db9037c34426a89b69f6d Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Tue, 26 May 2009 20:20:08 +0000 Subject: 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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196907 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- main/manager.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'main/manager.c') diff --git a/main/manager.c b/main/manager.c index ba1d2f56b..25e976a0a 100644 --- a/main/manager.c +++ b/main/manager.c @@ -3354,8 +3354,8 @@ static int action_corestatus(struct mansession *s, const struct message *m) { 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 @@ static int action_corestatus(struct mansession *s, const struct message *m) 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() ); -- cgit v1.2.3