[asterisk-commits] russell: branch 1.8 r317425 - /branches/1.8/main/manager.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu May 5 16:53:18 CDT 2011


Author: russell
Date: Thu May  5 16:53:13 2011
New Revision: 317425

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=317425
Log:
Add missing ActioID handling to Events action.

(closes issue #18949)
Reported by: edersohe
Patches:
      0018949.patch uploaded by edersohe (license 1228)

Modified:
    branches/1.8/main/manager.c

Modified: branches/1.8/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/manager.c?view=diff&rev=317425&r1=317424&r2=317425
==============================================================================
--- branches/1.8/main/manager.c (original)
+++ branches/1.8/main/manager.c Thu May  5 16:53:13 2011
@@ -2888,6 +2888,14 @@
 {
 	const char *mask = astman_get_header(m, "EventMask");
 	int res, x;
+	const char *id = astman_get_header(m, "ActionID");
+	char id_text[256];
+
+	if (!ast_strlen_zero(id)) {
+		snprintf(id_text, sizeof(id_text), "ActionID: %s\r\n", id);
+	} else {
+		id_text[0] = '\0';
+	}
 
 	res = set_eventmask(s, mask);
 	if (broken_events_action) {
@@ -2900,20 +2908,20 @@
 					return 0;
 				}
 			}
-			astman_append(s, "Response: Success\r\n"
-					 "Events: On\r\n\r\n");
+			astman_append(s, "Response: Success\r\n%s"
+					 "Events: On\r\n\r\n", id_text);
 		} else if (res == 0)
-			astman_append(s, "Response: Success\r\n"
-					 "Events: Off\r\n\r\n");
+			astman_append(s, "Response: Success\r\n%s"
+					 "Events: Off\r\n\r\n", id_text);
 		return 0;
 	}
 
 	if (res > 0)
-		astman_append(s, "Response: Success\r\n"
-				 "Events: On\r\n\r\n");
+		astman_append(s, "Response: Success\r\n%s"
+				 "Events: On\r\n\r\n", id_text);
 	else if (res == 0)
-		astman_append(s, "Response: Success\r\n"
-				 "Events: Off\r\n\r\n");
+		astman_append(s, "Response: Success\r\n%s"
+				 "Events: Off\r\n\r\n", id_text);
 	else
 		astman_send_error(s, m, "Invalid event mask");
 




More information about the asterisk-commits mailing list