mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-16 06:48:25 +00:00
Add timestamp to response to "Ping" manager action.
(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
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user