Add timestamp to response to "Ping" manager action.
authorMark Michelson <mmichelson@digium.com>
Fri, 26 Jun 2009 20:52:19 +0000 (20:52 +0000)
committerMark Michelson <mmichelson@digium.com>
Fri, 26 Jun 2009 20:52:19 +0000 (20:52 +0000)
(closes issue #14596)
Reported by: JimDickenson
Patches:
      pong2.diff uploaded by JimDickenson (license 710)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203783 65c4cc65-6c06-0410-ace0-fbb531ad65f3

doc/manager_1_1.txt
main/manager.c

index 5a674e5..d07edcd 100644 (file)
@@ -133,6 +133,9 @@ Changes to manager version 1.1:
 - Action IAXpeers
        Now includes if the IAX link is a trunk or not
 
+- Action Ping
+       Response now includes a timestamp
+
 * NEW ACTIONS
 -------------
 - Action: ModuleLoad
index 76e24d1..0670da3 100644 (file)
@@ -1808,12 +1808,13 @@ static int authenticate(struct mansession *s, const struct message *m)
 static int action_ping(struct mansession *s, const struct message *m)
 {
        const char *actionid = astman_get_header(m, "ActionID");
+       struct timeval now = ast_tvnow();
 
        astman_append(s, "Response: Success\r\n");
        if (!ast_strlen_zero(actionid)){
                astman_append(s, "ActionID: %s\r\n", actionid);
        }
-       astman_append(s, "Ping: Pong\r\n\r\n");
+       astman_append(s, "Ping: Pong\r\nTimestamp:%ld.%06lu\r\n", now.tv_sec, (unsigned long) now.tv_usec);
        return 0;
 }