(closes issue #13993)
authorJeff Peeler <jpeeler@digium.com>
Thu, 18 Dec 2008 21:43:17 +0000 (21:43 +0000)
committerJeff Peeler <jpeeler@digium.com>
Thu, 18 Dec 2008 21:43:17 +0000 (21:43 +0000)
Reported by: mika

Add ActionID response to ping if sent with request.

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

main/manager.c

index c5dbfe6..2069cb8 100644 (file)
@@ -1109,9 +1109,13 @@ static char mandescr_ping[] =
 
 static int action_ping(struct mansession *s, const struct message *m)
 {
-       astman_append(s, "Response: Success\r\n"
-               "Ping: Pong\r\n"
-               "\r\n");
+       const char *actionid = astman_get_header(m, "ActionID");
+
+       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");
        return 0;
 }