[asterisk-commits] russell: branch russell/ais r78746 - in /team/russell/ais: include/asterisk/ ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 9 11:42:57 CDT 2007


Author: russell
Date: Thu Aug  9 11:42:56 2007
New Revision: 78746

URL: http://svn.digium.com/view/asterisk?view=rev&rev=78746
Log:
remove silly and unnecessary event API change

Modified:
    team/russell/ais/include/asterisk/event.h
    team/russell/ais/main/event.c

Modified: team/russell/ais/include/asterisk/event.h
URL: http://svn.digium.com/view/asterisk/team/russell/ais/include/asterisk/event.h?view=diff&rev=78746&r1=78745&r2=78746
==============================================================================
--- team/russell/ais/include/asterisk/event.h (original)
+++ team/russell/ais/include/asterisk/event.h Thu Aug  9 11:42:56 2007
@@ -208,20 +208,7 @@
  * This creates a MWI event with 3 information elements, a mailbox which is
  * a string, and the number of new and old messages, specified as integers.
  */
-#define ast_event_new(event_type, ...) \
-	__ast_event_new(0, event_type, __VA_ARGS__)
-
-/*!
- * \brief Create a new event that came from a remote server
- *
- * This function is handled the same as ast_event_new(), except that it indicates
- * that this event was received from a remote server, as opposed to being generated
- * as the result of something happening on this one.
- */
-#define ast_remote_event_new(event_type, ...) \
-	__ast_event_new(1, event_type, __VA_ARGS__)
-
-struct ast_event *__ast_event_new(int remote, enum ast_event_type event_type, ...);
+struct ast_event *ast_event_new(enum ast_event_type event_type, ...);
 
 /*!
  * \brief Destroy an event

Modified: team/russell/ais/main/event.c
URL: http://svn.digium.com/view/asterisk/team/russell/ais/main/event.c?view=diff&rev=78746&r1=78745&r2=78746
==============================================================================
--- team/russell/ais/main/event.c (original)
+++ team/russell/ais/main/event.c Thu Aug  9 11:42:56 2007
@@ -473,7 +473,7 @@
 	return 0;
 }
 
-struct ast_event *__ast_event_new(int remote, enum ast_event_type type, ...)
+struct ast_event *ast_event_new(enum ast_event_type type, ...)
 {
 	va_list ap;
 	struct ast_event *event;
@@ -511,7 +511,17 @@
 	event->type = htons(type);
 	event->event_len = htons(sizeof(*event));
 
-	if (!remote) {
+	AST_LIST_TRAVERSE(&ie_vals, ie_val, entry) {
+		if (ie_val->ie_pltype == AST_EVENT_IE_PLTYPE_STR)
+			ast_event_append_ie_str(&event, ie_val->ie_type, ie_val->payload.str);
+		else if (ie_val->ie_pltype == AST_EVENT_IE_PLTYPE_UINT)
+			ast_event_append_ie_uint(&event, ie_val->ie_type, ie_val->payload.uint);
+
+		if (!event)
+			break;
+	}
+
+	if (!ast_event_get_ie_raw(event, AST_EVENT_IE_EID)) {
 		char buf[32] = "";
 		/* If the event is originating on this server, add the server's
 		 * entity ID to the event. */
@@ -519,15 +529,6 @@
 		ast_event_append_ie_str(&event, AST_EVENT_IE_EID, buf);
 	}
 
-	AST_LIST_TRAVERSE(&ie_vals, ie_val, entry) {
-		if (ie_val->ie_pltype == AST_EVENT_IE_PLTYPE_STR)
-			ast_event_append_ie_str(&event, ie_val->ie_type, ie_val->payload.str);
-		else if (ie_val->ie_pltype == AST_EVENT_IE_PLTYPE_UINT)
-			ast_event_append_ie_uint(&event, ie_val->ie_type, ie_val->payload.uint);
-
-		if (!event)
-			break;
-	}
 
 	return event;
 }




More information about the asterisk-commits mailing list