[svn-commits] mmichelson: trunk r203783 - in /trunk: doc/manager_1_1.txt main/manager.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Jun 26 15:52:23 CDT 2009


Author: mmichelson
Date: Fri Jun 26 15:52:19 2009
New Revision: 203783

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=203783
Log:
Add timestamp to response to "Ping" manager action.

(closes issue #14596)
Reported by: JimDickenson
Patches:
      pong2.diff uploaded by JimDickenson (license 710)


Modified:
    trunk/doc/manager_1_1.txt
    trunk/main/manager.c

Modified: trunk/doc/manager_1_1.txt
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/doc/manager_1_1.txt?view=diff&rev=203783&r1=203782&r2=203783
==============================================================================
--- trunk/doc/manager_1_1.txt (original)
+++ trunk/doc/manager_1_1.txt Fri Jun 26 15:52:19 2009
@@ -133,6 +133,9 @@
 - Action IAXpeers
 	Now includes if the IAX link is a trunk or not
 
+- Action Ping
+	Response now includes a timestamp
+
 * NEW ACTIONS
 -------------
 - Action: ModuleLoad

Modified: trunk/main/manager.c
URL: http://svn.asterisk.org/svn-view/asterisk/trunk/main/manager.c?view=diff&rev=203783&r1=203782&r2=203783
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Fri Jun 26 15:52:19 2009
@@ -1808,12 +1808,13 @@
 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;
 }
 




More information about the svn-commits mailing list