[asterisk-commits] kmoore: branch kmoore/stasis-cel_refactoring r388951 - /team/kmoore/stasis-ce...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 17 08:40:32 CDT 2013


Author: kmoore
Date: Fri May 17 08:40:30 2013
New Revision: 388951

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=388951
Log:
Do some cleanup

Modified:
    team/kmoore/stasis-cel_refactoring/main/cel.c

Modified: team/kmoore/stasis-cel_refactoring/main/cel.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-cel_refactoring/main/cel.c?view=diff&rev=388951&r1=388950&r2=388951
==============================================================================
--- team/kmoore/stasis-cel_refactoring/main/cel.c (original)
+++ team/kmoore/stasis-cel_refactoring/main/cel.c Fri May 17 08:40:30 2013
@@ -884,26 +884,22 @@
 	cel_channel_linkedid_change,
 };
 
-static void cel_channel_snapshot_update_cb(void *data, struct stasis_subscription *sub,
+static void cel_snapshot_update_cb(void *data, struct stasis_subscription *sub,
 				    struct stasis_topic *topic,
 				    struct stasis_message *message)
 {
-	struct stasis_cache_update *update;
-	struct ast_channel_snapshot *old_snapshot;
-	struct ast_channel_snapshot *new_snapshot;
-	size_t i;
-
-	update = stasis_message_data(message);
-
-	if (ast_channel_snapshot_type() != update->type) {
-		return;
-	}
-
-	old_snapshot = stasis_message_data(update->old_snapshot);
-	new_snapshot = stasis_message_data(update->new_snapshot);
-
-	for (i = 0; i < ARRAY_LEN(cel_channel_monitors); ++i) {
-		cel_channel_monitors[i](old_snapshot, new_snapshot);
+	struct stasis_cache_update *update = stasis_message_data(message);
+	if (ast_channel_snapshot_type() == update->type) {
+		struct ast_channel_snapshot *old_snapshot;
+		struct ast_channel_snapshot *new_snapshot;
+		size_t i;
+
+		old_snapshot = stasis_message_data(update->old_snapshot);
+		new_snapshot = stasis_message_data(update->new_snapshot);
+
+		for (i = 0; i < ARRAY_LEN(cel_channel_monitors); ++i) {
+			cel_channel_monitors[i](old_snapshot, new_snapshot);
+		}
 	}
 }
 
@@ -961,7 +957,7 @@
 
 	ret |= stasis_message_router_add(cel_state_router,
 		stasis_cache_update_type(),
-		cel_channel_snapshot_update_cb,
+		cel_snapshot_update_cb,
 		NULL);
 
 	/* If somehow we failed to add any routes, just shut down the whole




More information about the asterisk-commits mailing list