[asterisk-commits] russell: trunk r317426 - in /trunk: ./ main/manager.c

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


Author: russell
Date: Thu May  5 16:54:17 2011
New Revision: 317426

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=317426
Log:
Merged revisions 317425 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r317425 | russell | 2011-05-05 16:53:13 -0500 (Thu, 05 May 2011) | 7 lines
  
  Add missing ActioID handling to Events action.
  
  (closes issue #18949)
  Reported by: edersohe
  Patches:
        0018949.patch uploaded by edersohe (license 1228)
........

Modified:
    trunk/   (props changed)
    trunk/main/manager.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: trunk/main/manager.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/manager.c?view=diff&rev=317426&r1=317425&r2=317426
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Thu May  5 16:54:17 2011
@@ -2880,6 +2880,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) {
@@ -2892,20 +2900,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