[asterisk-commits] russell: branch russell/event_performance r183650 - /team/russell/event_perfo...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Mar 22 14:27:06 CDT 2009


Author: russell
Date: Sun Mar 22 14:26:59 2009
New Revision: 183650

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=183650
Log:
Only use the EID as a cache arg if actually needed

Modified:
    team/russell/event_performance/main/devicestate.c

Modified: team/russell/event_performance/main/devicestate.c
URL: http://svn.digium.com/svn-view/asterisk/team/russell/event_performance/main/devicestate.c?view=diff&rev=183650&r1=183649&r2=183650
==============================================================================
--- team/russell/event_performance/main/devicestate.c (original)
+++ team/russell/event_performance/main/devicestate.c Sun Mar 22 14:26:59 2009
@@ -475,10 +475,16 @@
 
 	/* Cache this event, replacing an event in the cache with the same
 	 * device name if it exists. */
-	ast_event_queue_and_cache(event,
-		AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR,
-		AST_EVENT_IE_EID, AST_EVENT_IE_PLTYPE_RAW, sizeof(struct ast_eid),
-		AST_EVENT_IE_END);
+	if (event_type == AST_EVENT_DEVICE_STATE_CHANGE) {
+		ast_event_queue_and_cache(event,
+			AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR,
+			AST_EVENT_IE_EID, AST_EVENT_IE_PLTYPE_RAW, sizeof(struct ast_eid),
+			AST_EVENT_IE_END);
+	} else {
+		ast_event_queue_and_cache(event,
+			AST_EVENT_IE_DEVICE, AST_EVENT_IE_PLTYPE_STR,
+			AST_EVENT_IE_END);
+	}
 }
 
 /*! Called by the state change thread to find out what the state is, and then




More information about the asterisk-commits mailing list