diff --git a/doc/manager_1_1.txt b/doc/manager_1_1.txt index 5a674e596d5b7fb44f375132356fd0bc6d9f9c92..d07edcdc605215a51bb086e04664aef76d05b8f0 100644 --- a/doc/manager_1_1.txt +++ b/doc/manager_1_1.txt @@ -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 diff --git a/main/manager.c b/main/manager.c index 76e24d170f4b56c827bec96d041c9aceef4ba51e..0670da36d8150e6ddd2d86cf259c76bdf366bb53 100644 --- a/main/manager.c +++ b/main/manager.c @@ -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; }