[asterisk-commits] kmoore: branch kmoore/stasis-bridging-channel_events r385998 - /team/kmoore/s...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 18 09:15:09 CDT 2013


Author: kmoore
Date: Thu Apr 18 09:15:06 2013
New Revision: 385998

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385998
Log:
Pull forward more applicable changes

Modified:
    team/kmoore/stasis-bridging-channel_events/res/res_stasis.c

Modified: team/kmoore/stasis-bridging-channel_events/res/res_stasis.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging-channel_events/res/res_stasis.c?view=diff&rev=385998&r1=385997&r2=385998
==============================================================================
--- team/kmoore/stasis-bridging-channel_events/res/res_stasis.c (original)
+++ team/kmoore/stasis-bridging-channel_events/res/res_stasis.c Thu Apr 18 09:15:06 2013
@@ -285,12 +285,12 @@
 }
 
 /*! \brief Typedef for blob handler callbacks */
-typedef struct ast_json *(*blob_handler_cb)(struct ast_channel_blob *);
+typedef struct ast_json *(*channel_blob_handler_cb)(struct ast_channel_blob *);
 
 /*! \brief AO2 refcounted object linking channel blob json type to its handler callback */
 struct blob_handler {
 	char *type;
-	blob_handler_cb handler;
+	channel_blob_handler_cb handler;
 };
 
 static void blob_handler_dtor(void *obj)
@@ -409,15 +409,18 @@
 	return uniqueid ? CMP_MATCH : 0;
 }
 
-static struct ao2_container *get_watching_apps(struct ast_channel_snapshot *snapshot)
+static struct ao2_container *get_watching_apps(const char *uniqueid)
 {
 	RAII_VAR(struct ao2_container *, apps, apps_registry(), ao2_cleanup);
 	struct ao2_container *watching_apps;
+	char *uniqueid_dup;
 	RAII_VAR(struct ao2_iterator *,watching_apps_iter, NULL, ao2_iterator_destroy);
-	ast_assert(snapshot != NULL);
+	ast_assert(uniqueid != NULL);
 	ast_assert(apps != NULL);
 
-	watching_apps_iter = ao2_callback(apps, OBJ_MULTIPLE, app_watching_channel_cb, snapshot);
+	uniqueid_dup = ast_strdupa(uniqueid);
+
+	watching_apps_iter = ao2_callback(apps, OBJ_MULTIPLE, app_watching_channel_cb, uniqueid_dup);
 	watching_apps = watching_apps_iter->c;
 
 	if (!ao2_container_count(watching_apps)) {
@@ -555,7 +558,7 @@
 	struct ast_channel_snapshot *old_snapshot = stasis_message_data(update->old_snapshot);
 	int i;
 
-	watching_apps = get_watching_apps(new_snapshot ? new_snapshot : old_snapshot);
+	watching_apps = get_watching_apps(new_snapshot ? new_snapshot->uniqueid : old_snapshot->uniqueid);
 	if (!watching_apps) {
 		return;
 	}
@@ -601,7 +604,7 @@
 		return;
 	}
 
-	watching_apps = get_watching_apps(obj->snapshot);
+	watching_apps = get_watching_apps(obj->snapshot->uniqueid);
 	if (!watching_apps) {
 		return;
 	}
@@ -802,7 +805,7 @@
 	return app_channel_event_create(ast_str_buffer(event_name), obj->snapshot, obj->blob);
 }
 
-static void register_blob_handler(const char *blob_type, blob_handler_cb blob_type_handler_cb)
+static void register_blob_handler(const char *blob_type, channel_blob_handler_cb blob_type_handler_cb)
 {
 	RAII_VAR(struct blob_handler *, handler, ao2_alloc(sizeof(*handler), blob_handler_dtor), ao2_cleanup);
 




More information about the asterisk-commits mailing list