summaryrefslogtreecommitdiff
path: root/main/manager.c
diff options
context:
space:
mode:
authorSean Bright <sean@malleable.com>2009-05-26 20:20:08 +0000
committerSean Bright <sean@malleable.com>2009-05-26 20:20:08 +0000
commitbbd9f040e1bf1ba5a91db9037c34426a89b69f6d (patch)
treed4d810c233acc29350073bcbe9ec376b6ae63973 /main/manager.c
parent83500e9b06ac6ac403dc1ed5a988cf892d38fe44 (diff)
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
Diffstat (limited to 'main/manager.c')
-rw-r--r--main/manager.c10
1 files changed, 8 insertions, 2 deletions
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()
);