mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-13 16:21:01 +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
|
- Action IAXpeers
|
||||||
Now includes if the IAX link is a trunk or not
|
Now includes if the IAX link is a trunk or not
|
||||||
|
|
||||||
|
- Action Ping
|
||||||
|
Response now includes a timestamp
|
||||||
|
|
||||||
* NEW ACTIONS
|
* NEW ACTIONS
|
||||||
-------------
|
-------------
|
||||||
- Action: ModuleLoad
|
- 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)
|
static int action_ping(struct mansession *s, const struct message *m)
|
||||||
{
|
{
|
||||||
const char *actionid = astman_get_header(m, "ActionID");
|
const char *actionid = astman_get_header(m, "ActionID");
|
||||||
|
struct timeval now = ast_tvnow();
|
||||||
|
|
||||||
astman_append(s, "Response: Success\r\n");
|
astman_append(s, "Response: Success\r\n");
|
||||||
if (!ast_strlen_zero(actionid)){
|
if (!ast_strlen_zero(actionid)){
|
||||||
astman_append(s, "ActionID: %s\r\n", 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user