[svn-commits] kmoore: branch kmoore/stasis-bridging_events-rework r390430 - in /team/kmoore...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 4 13:51:52 CDT 2013


Author: kmoore
Date: Tue Jun  4 13:51:50 2013
New Revision: 390430

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=390430
Log:
Resolve merge conflict and enable automerge

Modified:
    team/kmoore/stasis-bridging_events-rework/   (props changed)
    team/kmoore/stasis-bridging_events-rework/Makefile
    team/kmoore/stasis-bridging_events-rework/addons/chan_ooh323.c
    team/kmoore/stasis-bridging_events-rework/apps/app_confbridge.c
    team/kmoore/stasis-bridging_events-rework/apps/app_userevent.c
    team/kmoore/stasis-bridging_events-rework/apps/confbridge/confbridge_manager.c
    team/kmoore/stasis-bridging_events-rework/apps/confbridge/include/confbridge.h
    team/kmoore/stasis-bridging_events-rework/bridges/bridge_builtin_features.c
    team/kmoore/stasis-bridging_events-rework/configure
    team/kmoore/stasis-bridging_events-rework/configure.ac
    team/kmoore/stasis-bridging_events-rework/include/asterisk.h
    team/kmoore/stasis-bridging_events-rework/include/asterisk/autoconfig.h.in
    team/kmoore/stasis-bridging_events-rework/include/asterisk/bridging.h
    team/kmoore/stasis-bridging_events-rework/include/asterisk/channel.h
    team/kmoore/stasis-bridging_events-rework/include/asterisk/manager.h
    team/kmoore/stasis-bridging_events-rework/include/asterisk/security_events.h
    team/kmoore/stasis-bridging_events-rework/include/asterisk/stasis.h
    team/kmoore/stasis-bridging_events-rework/include/asterisk/stasis_bridging.h
    team/kmoore/stasis-bridging_events-rework/include/asterisk/stasis_channels.h
    team/kmoore/stasis-bridging_events-rework/main/Makefile
    team/kmoore/stasis-bridging_events-rework/main/app.c
    team/kmoore/stasis-bridging_events-rework/main/asterisk.c
    team/kmoore/stasis-bridging_events-rework/main/bridging.c
    team/kmoore/stasis-bridging_events-rework/main/channel.c
    team/kmoore/stasis-bridging_events-rework/main/channel_internal_api.c
    team/kmoore/stasis-bridging_events-rework/main/devicestate.c
    team/kmoore/stasis-bridging_events-rework/main/manager.c
    team/kmoore/stasis-bridging_events-rework/main/named_acl.c
    team/kmoore/stasis-bridging_events-rework/main/pbx.c
    team/kmoore/stasis-bridging_events-rework/main/presencestate.c
    team/kmoore/stasis-bridging_events-rework/main/security_events.c
    team/kmoore/stasis-bridging_events-rework/main/stasis.c
    team/kmoore/stasis-bridging_events-rework/main/stasis_bridging.c
    team/kmoore/stasis-bridging_events-rework/main/stasis_cache.c
    team/kmoore/stasis-bridging_events-rework/main/stasis_channels.c
    team/kmoore/stasis-bridging_events-rework/main/test.c
    team/kmoore/stasis-bridging_events-rework/makeopts.in

Propchange: team/kmoore/stasis-bridging_events-rework/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/kmoore/stasis-bridging_events-rework/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/kmoore/stasis-bridging_events-rework/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Jun  4 13:51:50 2013
@@ -1,1 +1,1 @@
-/trunk:1-390096
+/trunk:1-390429

Modified: team/kmoore/stasis-bridging_events-rework/Makefile
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/Makefile?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/Makefile (original)
+++ team/kmoore/stasis-bridging_events-rework/Makefile Tue Jun  4 13:51:50 2013
@@ -468,7 +468,7 @@
 	@echo "<docs xmlns:xi=\"http://www.w3.org/2001/XInclude\">" >> $@
 	@for x in $(MOD_SUBDIRS); do \
 		printf "$$x " ; \
-		for i in `find $$x -name *.c`; do \
+		for i in `find $$x -name '*.c'`; do \
 			$(AWK) -f build_tools/get_documentation $$i >> $@ ; \
 		done ; \
 	done

Modified: team/kmoore/stasis-bridging_events-rework/addons/chan_ooh323.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/addons/chan_ooh323.c?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/addons/chan_ooh323.c (original)
+++ team/kmoore/stasis-bridging_events-rework/addons/chan_ooh323.c Tue Jun  4 13:51:50 2013
@@ -307,6 +307,8 @@
 int onCallCleared(ooCallData *call);
 void onModeChanged(ooCallData *call, int t38mode);
 
+extern OOH323EndPoint gH323ep;
+
 static char gLogFile[256] = DEFAULT_LOGFILE;
 static int  gPort = 1720;
 static char gIP[2+8*4+7];	/* Max for IPv6 addr */
@@ -642,6 +644,7 @@
 		ooh323_destroy(p);
 		ast_mutex_unlock(&iflock);
 		ast_log(LOG_ERROR, "Destination format is not supported\n");
+		*cause = AST_CAUSE_INVALID_NUMBER_FORMAT;
 		return NULL;
 	}
 
@@ -688,6 +691,10 @@
 			ast_mutex_unlock(&p->lock);
 			ooh323_destroy(p);
 			ast_mutex_unlock(&iflock);
+			return NULL;
+		} else if (gH323ep.gkClient && gH323ep.gkClient->state != GkClientRegistered) {
+			ast_log(LOG_ERROR, "Gatekeeper client is configured but not registered\n");
+			*cause = AST_CAUSE_NORMAL_TEMPORARY_FAILURE;
 			return NULL;
 		}
 		p->g729onlyA = g729onlyA;
@@ -2615,8 +2622,6 @@
 
 static int ooh323_do_reload(void)
 {
-	extern OOH323EndPoint gH323ep;
-
 	if (gH323Debug) {
 		ast_verb(0, "---   ooh323_do_reload\n");
 	}
@@ -3369,7 +3374,6 @@
 static char *handle_cli_ooh323_show_gk(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
 {
 	char value[FORMAT_STRING_SIZE];
-	extern OOH323EndPoint gH323ep;
 
 	switch (cmd) {
 	case CLI_INIT:

Modified: team/kmoore/stasis-bridging_events-rework/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/apps/app_confbridge.c?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/apps/app_confbridge.c (original)
+++ team/kmoore/stasis-bridging_events-rework/apps/app_confbridge.c Tue Jun  4 13:51:50 2013
@@ -415,13 +415,12 @@
 	return "";
 }
 
-static void send_conf_stasis(struct confbridge_conference *conference, struct ast_channel *chan, const char *type, struct ast_json *extras, int channel_topic)
+static void send_conf_stasis(struct confbridge_conference *conference, struct ast_channel *chan, struct stasis_message_type *type, struct ast_json *extras, int channel_topic)
 {
 	RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_json *, json_object, NULL, ast_json_unref);
 
-	json_object = ast_json_pack("{s: s, s: s}",
-		"type", type,
+	json_object = ast_json_pack("{s: s}",
 		"conference", conference->name);
 
 	if (!json_object) {
@@ -432,10 +431,10 @@
 		ast_json_object_update(json_object, extras);
 	}
 
-	msg = ast_bridge_blob_create(confbridge_message_type(),
-					 conference->bridge,
-					 chan,
-					 json_object);
+	msg = ast_bridge_blob_create(type,
+		conference->bridge,
+		chan,
+		json_object);
 	if (!msg) {
 		return;
 	}
@@ -450,42 +449,42 @@
 
 static void send_conf_start_event(struct confbridge_conference *conference)
 {
-	send_conf_stasis(conference, NULL, "confbridge_start", NULL, 0);
+	send_conf_stasis(conference, NULL, confbridge_start_type(), NULL, 0);
 }
 
 static void send_conf_end_event(struct confbridge_conference *conference)
 {
-	send_conf_stasis(conference, NULL, "confbridge_end", NULL, 0);
+	send_conf_stasis(conference, NULL, confbridge_end_type(), NULL, 0);
 }
 
 static void send_join_event(struct ast_channel *chan, struct confbridge_conference *conference)
 {
-	send_conf_stasis(conference, chan, "confbridge_join", NULL, 0);
+	send_conf_stasis(conference, chan, confbridge_join_type(), NULL, 0);
 }
 
 static void send_leave_event(struct ast_channel *chan, struct confbridge_conference *conference)
 {
-	send_conf_stasis(conference, chan, "confbridge_leave", NULL, 0);
+	send_conf_stasis(conference, chan, confbridge_leave_type(), NULL, 0);
 }
 
 static void send_start_record_event(struct confbridge_conference *conference)
 {
-	send_conf_stasis(conference, NULL, "confbridge_record", NULL, 0);
+	send_conf_stasis(conference, NULL, confbridge_start_record_type(), NULL, 0);
 }
 
 static void send_stop_record_event(struct confbridge_conference *conference)
 {
-	send_conf_stasis(conference, NULL, "confbridge_stop_record", NULL, 0);
+	send_conf_stasis(conference, NULL, confbridge_stop_record_type(), NULL, 0);
 }
 
 static void send_mute_event(struct ast_channel *chan, struct confbridge_conference *conference)
 {
-	send_conf_stasis(conference, chan, "confbridge_mute", NULL, 1);
+	send_conf_stasis(conference, chan, confbridge_mute_type(), NULL, 1);
 }
 
 static void send_unmute_event(struct ast_channel *chan, struct confbridge_conference *conference)
 {
-	send_conf_stasis(conference, chan, "confbridge_unmute", NULL, 1);
+	send_conf_stasis(conference, chan, confbridge_unmute_type(), NULL, 1);
 }
 
 static void set_rec_filename(struct confbridge_conference *conference, struct ast_str **filename, int is_new)
@@ -1420,7 +1419,7 @@
 		return;
 	}
 
-	send_conf_stasis(conference, bridge_channel->chan, "confbridge_talking", talking_extras, 0);
+	send_conf_stasis(conference, bridge_channel->chan, confbridge_talking_type(), talking_extras, 0);
 	ast_json_unref(talking_extras);
 }
 

Modified: team/kmoore/stasis-bridging_events-rework/apps/app_userevent.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/apps/app_userevent.c?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/apps/app_userevent.c (original)
+++ team/kmoore/stasis-bridging_events-rework/apps/app_userevent.c Tue Jun  4 13:51:50 2013
@@ -76,7 +76,6 @@
 		AST_APP_ARG(extra)[100];
 	);
 	RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref);
-	RAII_VAR(struct stasis_message *, msg, NULL, ao2_cleanup);
 
 	if (ast_strlen_zero(data)) {
 		ast_log(LOG_WARNING, "UserEvent requires an argument (eventname,optional event body)\n");
@@ -115,14 +114,7 @@
 		}
 	}
 
-	msg = ast_channel_blob_create(
-		chan, ast_channel_user_event_type(), blob);
-	if (!msg) {
-		return -1;
-	}
-
-	stasis_publish(ast_channel_topic(chan), msg);
-
+	ast_channel_publish_blob(chan, ast_channel_user_event_type(), blob);
 	return 0;
 }
 

Modified: team/kmoore/stasis-bridging_events-rework/apps/confbridge/confbridge_manager.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/apps/confbridge/confbridge_manager.c?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/apps/confbridge/confbridge_manager.c (original)
+++ team/kmoore/stasis-bridging_events-rework/apps/confbridge/confbridge_manager.c Tue Jun  4 13:51:50 2013
@@ -206,61 +206,24 @@
 		header, value);
 }
 
-static void stasis_confbridge_cb(void *data, struct stasis_subscription *sub,
-					struct stasis_topic *topic,
-					struct stasis_message *message)
+static void confbridge_publish_manager_event(
+	struct stasis_message *message,
+	const char *event,
+	struct ast_str *extra_text)
 {
 	struct ast_bridge_blob *blob = stasis_message_data(message);
-	const char *type = ast_bridge_blob_json_type(blob);
 	const char *conference_name;
-	RAII_VAR(struct ast_str *, bridge_text, NULL, ast_free);
+	RAII_VAR(struct ast_str *, bridge_text,
+		ast_manager_build_bridge_state_string(blob->bridge, ""),
+		ast_free);
 	RAII_VAR(struct ast_str *, channel_text, NULL, ast_free);
-	RAII_VAR(struct ast_str *, extra_text, NULL, ast_free);
-	char *event;
-
-	if (!blob || !type) {
-		ast_assert(0);
-		return;
-	}
-
-	if (!strcmp("confbridge_start", type)) {
-		event = "ConfbridgeStart";
-	} else if (!strcmp("confbridge_end", type)) {
-		event = "ConfbridgeEnd";
-	} else if (!strcmp("confbridge_leave", type)) {
-		event = "ConfbridgeLeave";
-	} else if (!strcmp("confbridge_join", type)) {
-		event = "ConfbridgeJoin";
-	} else if (!strcmp("confbridge_record", type)) {
-		event = "ConfbridgeRecord";
-	} else if (!strcmp("confbridge_stop_record", type)) {
-		event = "ConfbridgeStopRecord";
-	} else if (!strcmp("confbridge_mute", type)) {
-		event = "ConfbridgeMute";
-	} else if (!strcmp("confbridge_unmute", type)) {
-		event = "ConfbridgeUnmute";
-	} else if (!strcmp("confbridge_talking", type)) {
-		const char *talking_status = ast_json_string_get(ast_json_object_get(blob->blob, "talking_status"));
-		event = "ConfbridgeTalking";
-
-		if (!talking_status) {
-			return;
-		}
-
-		append_event_header(&extra_text, "TalkingStatus", talking_status);
-
-	} else {
-		return;
-	}
+
+	ast_assert(blob != NULL);
+	ast_assert(event != NULL);
 
 	conference_name = ast_json_string_get(ast_json_object_get(blob->blob, "conference"));
-
-	if (!conference_name) {
-		ast_assert(0);
-		return;
-	}
-
-	bridge_text = ast_manager_build_bridge_state_string(blob->bridge, "");
+	ast_assert(conference_name != NULL);
+
 	if (blob->channel) {
 		channel_text = ast_manager_build_channel_state_string(blob->channel);
 	}
@@ -272,20 +235,105 @@
 		"%s",
 		conference_name,
 		ast_str_buffer(bridge_text),
-		channel_text ? ast_str_buffer(channel_text) : "",
-		extra_text ? ast_str_buffer(extra_text) : "");
-}
-
-static struct stasis_message_type *confbridge_msg_type;
-
-struct stasis_message_type *confbridge_message_type(void)
-{
-	return confbridge_msg_type;
-}
+		S_COR(channel_text, ast_str_buffer(channel_text), ""),
+		S_COR(extra_text, ast_str_buffer(extra_text), ""));
+}
+
+static void confbridge_start_cb(void *data, struct stasis_subscription *sub,
+	struct stasis_topic *topic,
+	struct stasis_message *message)
+{
+	confbridge_publish_manager_event(message, "ConfbridgeStart", NULL);
+}
+
+static void confbridge_end_cb(void *data, struct stasis_subscription *sub,
+	struct stasis_topic *topic,
+	struct stasis_message *message)
+{
+	confbridge_publish_manager_event(message, "ConfbridgeEnd", NULL);
+}
+
+static void confbridge_leave_cb(void *data, struct stasis_subscription *sub,
+	struct stasis_topic *topic,
+	struct stasis_message *message)
+{
+	confbridge_publish_manager_event(message, "ConfbridgeLeave", NULL);
+}
+
+static void confbridge_join_cb(void *data, struct stasis_subscription *sub,
+	struct stasis_topic *topic,
+	struct stasis_message *message)
+{
+	confbridge_publish_manager_event(message, "ConfbridgeJoin", NULL);
+}
+
+static void confbridge_start_record_cb(void *data, struct stasis_subscription *sub,
+	struct stasis_topic *topic,
+	struct stasis_message *message)
+{
+	confbridge_publish_manager_event(message, "ConfbridgeRecord", NULL);
+}
+
+static void confbridge_stop_record_cb(void *data, struct stasis_subscription *sub,
+	struct stasis_topic *topic,
+	struct stasis_message *message)
+{
+	confbridge_publish_manager_event(message, "ConfbridgeStopRecord", NULL);
+}
+
+static void confbridge_mute_cb(void *data, struct stasis_subscription *sub,
+	struct stasis_topic *topic,
+	struct stasis_message *message)
+{
+	confbridge_publish_manager_event(message, "ConfbridgeMute", NULL);
+}
+
+static void confbridge_unmute_cb(void *data, struct stasis_subscription *sub,
+	struct stasis_topic *topic,
+	struct stasis_message *message)
+{
+	confbridge_publish_manager_event(message, "ConfbridgeUnmute", NULL);
+}
+
+static void confbridge_talking_cb(void *data, struct stasis_subscription *sub,
+	struct stasis_topic *topic,
+	struct stasis_message *message)
+{
+	RAII_VAR(struct ast_str *, extra_text, NULL, ast_free);
+	struct ast_bridge_blob *blob = stasis_message_data(message);
+	const char *talking_status = ast_json_string_get(ast_json_object_get(blob->blob, "talking_status"));
+	if (!talking_status) {
+		return;
+	}
+
+	append_event_header(&extra_text, "TalkingStatus", talking_status);
+	if (!extra_text) {
+		return;
+	}
+
+	confbridge_publish_manager_event(message, "ConfbridgeTalking", extra_text);
+}
+
+STASIS_MESSAGE_TYPE_DEFN(confbridge_start_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_end_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_join_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_leave_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_start_record_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_stop_record_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_mute_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_unmute_type);
+STASIS_MESSAGE_TYPE_DEFN(confbridge_talking_type);
 
 void manager_confbridge_shutdown(void) {
-	ao2_cleanup(confbridge_msg_type);
-	confbridge_msg_type = NULL;
+	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_start_type);
+	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_end_type);
+	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_join_type);
+	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_leave_type);
+	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_start_record_type);
+	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_stop_record_type);
+	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_mute_type);
+	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_unmute_type);
+	STASIS_MESSAGE_TYPE_CLEANUP(confbridge_talking_type);
 
 	if (bridge_state_router) {
 		stasis_message_router_unsubscribe(bridge_state_router);
@@ -300,9 +348,15 @@
 
 int manager_confbridge_init(void)
 {
-	if (!(confbridge_msg_type = stasis_message_type_create("confbridge"))) {
-		return -1;
-	}
+	STASIS_MESSAGE_TYPE_INIT(confbridge_start_type);
+	STASIS_MESSAGE_TYPE_INIT(confbridge_end_type);
+	STASIS_MESSAGE_TYPE_INIT(confbridge_join_type);
+	STASIS_MESSAGE_TYPE_INIT(confbridge_leave_type);
+	STASIS_MESSAGE_TYPE_INIT(confbridge_start_record_type);
+	STASIS_MESSAGE_TYPE_INIT(confbridge_stop_record_type);
+	STASIS_MESSAGE_TYPE_INIT(confbridge_mute_type);
+	STASIS_MESSAGE_TYPE_INIT(confbridge_unmute_type);
+	STASIS_MESSAGE_TYPE_INIT(confbridge_talking_type);
 
 	bridge_state_router = stasis_message_router_create(
 		stasis_caching_get_topic(ast_bridge_topic_all_cached()));
@@ -312,9 +366,65 @@
 	}
 
 	if (stasis_message_router_add(bridge_state_router,
-					 confbridge_message_type(),
-					 stasis_confbridge_cb,
-					 NULL)) {
+			confbridge_start_type(),
+			confbridge_start_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(bridge_state_router,
+			confbridge_end_type(),
+			confbridge_end_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(bridge_state_router,
+			confbridge_join_type(),
+			confbridge_join_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(bridge_state_router,
+			confbridge_leave_type(),
+			confbridge_leave_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(bridge_state_router,
+			confbridge_start_record_type(),
+			confbridge_start_record_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(bridge_state_router,
+			confbridge_stop_record_type(),
+			confbridge_stop_record_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(bridge_state_router,
+			confbridge_mute_type(),
+			confbridge_mute_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(bridge_state_router,
+			confbridge_unmute_type(),
+			confbridge_unmute_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(bridge_state_router,
+			confbridge_talking_type(),
+			confbridge_talking_cb,
+			NULL)) {
 		manager_confbridge_shutdown();
 		return -1;
 	}
@@ -328,9 +438,65 @@
 	}
 
 	if (stasis_message_router_add(channel_state_router,
-					 confbridge_message_type(),
-					 stasis_confbridge_cb,
-					 NULL)) {
+			confbridge_start_type(),
+			confbridge_start_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(channel_state_router,
+			confbridge_end_type(),
+			confbridge_end_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(channel_state_router,
+			confbridge_join_type(),
+			confbridge_join_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(channel_state_router,
+			confbridge_leave_type(),
+			confbridge_leave_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(channel_state_router,
+			confbridge_start_record_type(),
+			confbridge_start_record_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(channel_state_router,
+			confbridge_stop_record_type(),
+			confbridge_stop_record_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(channel_state_router,
+			confbridge_mute_type(),
+			confbridge_mute_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(channel_state_router,
+			confbridge_unmute_type(),
+			confbridge_unmute_cb,
+			NULL)) {
+		manager_confbridge_shutdown();
+		return -1;
+	}
+	if (stasis_message_router_add(channel_state_router,
+			confbridge_talking_type(),
+			confbridge_talking_cb,
+			NULL)) {
 		manager_confbridge_shutdown();
 		return -1;
 	}

Modified: team/kmoore/stasis-bridging_events-rework/apps/confbridge/include/confbridge.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/apps/confbridge/include/confbridge.h?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/apps/confbridge/include/confbridge.h (original)
+++ team/kmoore/stasis-bridging_events-rework/apps/confbridge/include/confbridge.h Tue Jun  4 13:51:50 2013
@@ -465,12 +465,84 @@
 
 /*!
  * \since 12.0
- * \brief get the confbridge stasis message type
- *
- * \retval stasis message type for confbridge messages if it's available
- * \retval NULL if it isn't
- */
-struct stasis_message_type *confbridge_message_type(void);
+ * \brief get the confbridge start stasis message type
+ *
+ * \retval stasis message type for confbridge start messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_start_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge end stasis message type
+ *
+ * \retval stasis message type for confbridge end messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_end_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge join stasis message type
+ *
+ * \retval stasis message type for confbridge join messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_join_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge leave stasis message type
+ *
+ * \retval stasis message type for confbridge leave messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_leave_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge start_record stasis message type
+ *
+ * \retval stasis message type for confbridge start_record messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_start_record_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge stop_record stasis message type
+ *
+ * \retval stasis message type for confbridge stop_record messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_stop_record_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge mute stasis message type
+ *
+ * \retval stasis message type for confbridge mute messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_mute_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge unmute stasis message type
+ *
+ * \retval stasis message type for confbridge unmute messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_unmute_type(void);
+
+/*!
+ * \since 12.0
+ * \brief get the confbridge talking stasis message type
+ *
+ * \retval stasis message type for confbridge talking messages if it's available
+ * \retval NULL if it isn't
+ */
+struct stasis_message_type *confbridge_talking_type(void);
 
 /*!
  * \since 12.0

Modified: team/kmoore/stasis-bridging_events-rework/bridges/bridge_builtin_features.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/bridges/bridge_builtin_features.c?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/bridges/bridge_builtin_features.c (original)
+++ team/kmoore/stasis-bridging_events-rework/bridges/bridge_builtin_features.c Tue Jun  4 13:51:50 2013
@@ -182,7 +182,8 @@
 	const char *context;
 	char *goto_on_blindxfr;
 
-/* BUGBUG the peer needs to be put on hold for the transfer. */
+	ast_bridge_channel_write_hold(bridge_channel, NULL);
+
 	ast_channel_lock(bridge_channel->chan);
 	context = ast_strdupa(get_transfer_context(bridge_channel->chan,
 		blind_transfer ? blind_transfer->context : NULL));
@@ -192,6 +193,7 @@
 
 	/* Grab the extension to transfer to */
 	if (grab_transfer(bridge_channel->chan, exten, sizeof(exten), context)) {
+		ast_bridge_channel_write_unhold(bridge_channel);
 		return 0;
 	}
 
@@ -264,9 +266,10 @@
 	const char *context;
 	enum atxfer_code transfer_code = ATXFER_INCOMPLETE;
 
+	ast_bridge_channel_write_hold(bridge_channel, NULL);
+
 	bridge = ast_bridge_channel_merge_inhibit(bridge_channel, +1);
 
-/* BUGBUG the peer needs to be put on hold for the transfer. */
 	ast_channel_lock(bridge_channel->chan);
 	context = ast_strdupa(get_transfer_context(bridge_channel->chan,
 		attended_transfer ? attended_transfer->context : NULL));
@@ -276,6 +279,7 @@
 	if (grab_transfer(bridge_channel->chan, exten, sizeof(exten), context)) {
 		ast_bridge_merge_inhibit(bridge, -1);
 		ao2_ref(bridge, -1);
+		ast_bridge_channel_write_unhold(bridge_channel);
 		return 0;
 	}
 
@@ -286,6 +290,7 @@
 		ao2_ref(bridge, -1);
 /* BUGBUG beeperr needs to be configurable from features.conf */
 		ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE);
+		ast_bridge_channel_write_unhold(bridge_channel);
 		return 0;
 	}
 
@@ -313,6 +318,7 @@
 		ao2_ref(bridge, -1);
 /* BUGBUG beeperr needs to be configurable from features.conf */
 		ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE);
+		ast_bridge_channel_write_unhold(bridge_channel);
 		return 0;
 	}
 
@@ -326,6 +332,7 @@
 		ao2_ref(bridge, -1);
 /* BUGBUG beeperr needs to be configurable from features.conf */
 		ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE);
+		ast_bridge_channel_write_unhold(bridge_channel);
 		return 0;
 	}
 	ast_bridge_merge_inhibit(attended_bridge, +1);
@@ -340,6 +347,7 @@
 		ao2_ref(bridge, -1);
 /* BUGBUG beeperr needs to be configurable from features.conf */
 		ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE);
+		ast_bridge_channel_write_unhold(bridge_channel);
 		return 0;
 	}
 
@@ -384,6 +392,7 @@
 		break;
 	case ATXFER_COMPLETE:
 		/* The peer takes our place in the bridge. */
+		ast_bridge_channel_write_unhold(bridge_channel);
 		ast_bridge_change_state(bridge_channel, AST_BRIDGE_CHANNEL_STATE_HANGUP);
 		xfer_failed = ast_bridge_impart(bridge_channel->bridge, peer, bridge_channel->chan, NULL, 1);
 		break;
@@ -394,6 +403,7 @@
 		 * Just impart the peer onto the bridge and have us return to it
 		 * as normal.
 		 */
+		ast_bridge_channel_write_unhold(bridge_channel);
 		xfer_failed = ast_bridge_impart(bridge_channel->bridge, peer, NULL, NULL, 1);
 		break;
 	case ATXFER_ABORT:
@@ -407,6 +417,7 @@
 		if (!ast_check_hangup_locked(bridge_channel->chan)) {
 			ast_stream_and_wait(bridge_channel->chan, "beeperr", AST_DIGIT_NONE);
 		}
+		ast_bridge_channel_write_unhold(bridge_channel);
 	}
 
 	return 0;

Modified: team/kmoore/stasis-bridging_events-rework/configure.ac
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/configure.ac?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/configure.ac (original)
+++ team/kmoore/stasis-bridging_events-rework/configure.ac Tue Jun  4 13:51:50 2013
@@ -497,8 +497,6 @@
 AST_EXT_LIB_CHECK([TINFO], [tinfo], [tgetent], [])
 AST_EXT_LIB_CHECK([CURSES], [curses], [initscr], [curses.h])
 AST_EXT_LIB_CHECK([NCURSES], [ncurses], [initscr], [curses.h])
-AST_EXT_LIB_CHECK([UUID], [uuid], [uuid_generate_random], [uuid/uuid.h], [-luuid])
-AST_EXT_LIB_CHECK([JANSSON], [jansson], [json_dumps], [jansson.h])
 
 EDITLINE_LIB=""
 if test "x$TERMCAP_LIB" != "x" ; then
@@ -514,9 +512,31 @@
 fi
 AC_SUBST(EDITLINE_LIB)
 
-if test "x$UUID_LIB" == "x"; then
+# Find required UUID support.
+#  * -luuid on Linux
+#  * -le2fs-uuid on OpenBSD
+#  * in libsystem on OS X
+AST_EXT_LIB_CHECK([LIBUUID], [uuid], [uuid_generate_random], [uuid/uuid.h], [])
+AST_EXT_LIB_CHECK([E2FSUUID], [e2fs-uuid], [uuid_generate_random], [uuid/uuid.h], [])
+AC_CHECK_FUNCS([uuid_generate_random], [SYSUUID=true], [SYSUUID=""])
+
+if test "x$LIBUUID_LIB" != "x" ; then
+  UUID_INCLUDE="$LIBUUID_INCLUDE"
+  UUID_LIB="$LIBUUID_LIB"
+elif test "x$E2FSUUID_LIB" != "x" ; then
+  UUID_INCLUDE="$E2FSUUID_INCLUDE"
+  UUID_LIB="$E2FSUUID_LIB"
+elif test "x$SYSUUID" != "x" ; then
+  UUID_INCLUDE=""
+  UUID_LIB=""
+else
   AC_MSG_ERROR([*** uuid support not found (this typically means the uuid development package is missing)])
 fi
+AC_SUBST(UUID_INCLUDE)
+AC_SUBST(UUID_LIB)
+
+# Find required JSON support.
+AST_EXT_LIB_CHECK([JANSSON], [jansson], [json_dumps], [jansson.h])
 
 if test "x$JANSSON_LIB" == "x"; then
   AC_MSG_ERROR([*** JSON support not found (this typically means the libjansson development package is missing)])

Modified: team/kmoore/stasis-bridging_events-rework/include/asterisk.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/include/asterisk.h?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/include/asterisk.h (original)
+++ team/kmoore/stasis-bridging_events-rework/include/asterisk.h Tue Jun  4 13:51:50 2013
@@ -90,6 +90,22 @@
 int ast_register_atexit(void (*func)(void));
 
 /*!
+ * \since 12
+ * \brief Register a function to be executed before Asterisk gracefully exits.
+ *
+ * If Asterisk is immediately shutdown (core stop now, or sending the TERM
+ * signal), the callback is not run. When the callbacks are run, they are run in
+ * sequence with ast_register_atexit() callbacks, in the reverse order of
+ * registration.
+ *
+ * \param func The callback function to use.
+ *
+ * \retval 0 on success.
+ * \retval -1 on error.
+ */
+int ast_register_cleanup(void (*func)(void));
+
+/*!
  * \brief Unregister a function registered with ast_register_atexit().
  * \param func The callback function to unregister.
  */

Modified: team/kmoore/stasis-bridging_events-rework/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/include/asterisk/autoconfig.h.in?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/include/asterisk/autoconfig.h.in (original)
+++ team/kmoore/stasis-bridging_events-rework/include/asterisk/autoconfig.h.in Tue Jun  4 13:51:50 2013
@@ -1021,6 +1021,9 @@
 
 /* Define to 1 if `utime(file, NULL)' sets file's timestamp to the present. */
 #undef HAVE_UTIME_NULL
+
+/* Define to 1 if you have the `uuid_generate_random' function. */
+#undef HAVE_UUID_GENERATE_RANDOM
 
 /* Define to 1 if your system can support larger than default select bitmasks.
    */

Modified: team/kmoore/stasis-bridging_events-rework/include/asterisk/bridging.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/include/asterisk/bridging.h?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/include/asterisk/bridging.h (original)
+++ team/kmoore/stasis-bridging_events-rework/include/asterisk/bridging.h Tue Jun  4 13:51:50 2013
@@ -1110,6 +1110,27 @@
 void ast_bridge_channel_write_control_data(struct ast_bridge_channel *bridge_channel, enum ast_control_frame_type control, const void *data, size_t datalen);
 
 /*!
+ * \brief Write a hold frame into the bridge.
+ * \since 12.0.0
+ *
+ * \param bridge_channel Which channel is putting the hold into the bridge.
+ * \param moh_class The suggested music class for the other end to use.
+ *
+ * \return Nothing
+ */
+void ast_bridge_channel_write_hold(struct ast_bridge_channel *bridge_channel, const char *moh_class);
+
+/*!
+ * \brief Write an unhold frame into the bridge.
+ * \since 12.0.0
+ *
+ * \param bridge_channel Which channel is putting the hold into the bridge.
+ *
+ * \return Nothing
+ */
+void ast_bridge_channel_write_unhold(struct ast_bridge_channel *bridge_channel);
+
+/*!
  * \brief Run an application on the bridge channel.
  * \since 12.0.0
  *

Modified: team/kmoore/stasis-bridging_events-rework/include/asterisk/channel.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/include/asterisk/channel.h?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/include/asterisk/channel.h (original)
+++ team/kmoore/stasis-bridging_events-rework/include/asterisk/channel.h Tue Jun  4 13:51:50 2013
@@ -872,8 +872,6 @@
 	AST_FLAG_MOH =           (1 << 6),
 	/*! This channel is spying on another channel */
 	AST_FLAG_SPYING =        (1 << 7),
-	/*! This channel is in a native bridge */
-	AST_FLAG_NBRIDGE =       (1 << 8),
 	/*! the channel is in an auto-incrementing dialplan processor,
 	 *  so when ->priority is set, it will get incremented before
 	 *  finding the next priority to run */
@@ -927,7 +925,6 @@
 	AST_FEATURE_AUTOMON =      (1 << 4),
 	AST_FEATURE_PARKCALL =     (1 << 5),
 	AST_FEATURE_AUTOMIXMON =   (1 << 6),
-	AST_FEATURE_WARNING_ACTIVE = (1 << 8),
 };
 
 /*! \brief bridge configuration */
@@ -2003,21 +2000,6 @@
  * \return Returns 0 on success and -1 if it could not be done
  */
 int ast_channel_early_bridge(struct ast_channel *c0, struct ast_channel *c1);
-
-/*!
- * \brief Bridge two channels together
- * \param c0 first channel to bridge
- * \param c1 second channel to bridge
- * \param config config for the channels
- * \param fo destination frame(?)
- * \param rc destination channel(?)
- * \details
- * Bridge two channels (c0 and c1) together.  If an important frame occurs, we return that frame in
- * *rf (remember, it could be NULL) and which channel (0 or 1) in rc
- */
-/* int ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc); */
-int ast_channel_bridge(struct ast_channel *c0,struct ast_channel *c1,
-	struct ast_bridge_config *config, struct ast_frame **fo, struct ast_channel **rc);
 
 /*!
  * \brief Weird function made for call transfers

Modified: team/kmoore/stasis-bridging_events-rework/include/asterisk/manager.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/include/asterisk/manager.h?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/include/asterisk/manager.h (original)
+++ team/kmoore/stasis-bridging_events-rework/include/asterisk/manager.h Tue Jun  4 13:51:50 2013
@@ -401,7 +401,9 @@
 
 /*!
  * \since 12
- * \brief Construct a \ref snapshot_manager_event.
+ * \brief Construct a \ref ast_manager_event_blob.
+ *
+ * The returned object is AO2 managed, so clean up with ao2_cleanup().
  *
  * \param event_flags Flags the event should be raised with.
  * \param manager_event The event to be raised, should be a string literal.
@@ -475,17 +477,18 @@
 
 /*!
  * \since 12
- * \brief Publish a generic \ref stasis_message_type to the \ref stasis_topic for AMI
+ * \brief Publish an event to AMI
+ *
+ * \param type The type of AMI event to publish
+ * \param class_type The class on which to publish the event
+ * \param obj The event data to be published.
  *
  * Publishes a message to the \ref stasis message bus solely for the consumption of AMI.
  * The message will be of the type provided by \ref ast_manager_get_type, and will be
  * published to the topic provided by \ref ast_manager_get_topic. As such, the JSON must
  * be constructed as defined by the \ref ast_manager_get_type message.
- *
- * \retval 0 on success
- * \retval -1 on failure
- */
-int ast_manager_publish_message(struct ast_json *json);
+ */
+void ast_manager_publish_event(const char *type, int class_type, struct ast_json *obj);
 
 /*!
  * \since 12

Modified: team/kmoore/stasis-bridging_events-rework/include/asterisk/security_events.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/include/asterisk/security_events.h?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/include/asterisk/security_events.h (original)
+++ team/kmoore/stasis-bridging_events-rework/include/asterisk/security_events.h Tue Jun  4 13:51:50 2013
@@ -87,12 +87,6 @@
 int ast_security_stasis_init(void);
 
 /*!
- * \brief removes stasis topic/event types for \ref ast_security_topic and \ref ast_security_event_type
- * \since 12
- */
-void ast_security_stasis_cleanup(void);
-
-/*!
  * \brief Get the list of required IEs for a given security event sub-type
  *
  * \param[in] event_type security event sub-type

Modified: team/kmoore/stasis-bridging_events-rework/include/asterisk/stasis.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/stasis-bridging_events-rework/include/asterisk/stasis.h?view=diff&rev=390430&r1=390429&r2=390430
==============================================================================
--- team/kmoore/stasis-bridging_events-rework/include/asterisk/stasis.h (original)
+++ team/kmoore/stasis-bridging_events-rework/include/asterisk/stasis.h Tue Jun  4 13:51:50 2013
@@ -633,6 +633,12 @@
 /*! @{ */
 
 /*!
+ * \internal
+ * \brief Log a message about invalid attempt to access a type.
+ */
+void stasis_log_bad_type_access(const char *name);
+
+/*!
  * \brief Boiler-plate removing macro for defining message types.
  *
  * \param name Name of message type.
@@ -641,7 +647,9 @@
 #define STASIS_MESSAGE_TYPE_DEFN(name)				\
 	static struct stasis_message_type *_priv_ ## name;	\
 	struct stasis_message_type *name(void) {		\
-		ast_assert(_priv_ ## name != NULL);		\
+		if (_priv_ ## name == NULL) {			\
+			stasis_log_bad_type_access(#name);	\
+		}						\
 		return _priv_ ## name;				\
 	}
 
@@ -663,6 +671,15 @@
 /*!
  * \brief Boiler-plate removing macro for cleaning up message types.
  *
+ * Note that if your type is defined in core instead of a loadable module, you
+ * should call message type cleanup from an ast_register_cleanup() handler
+ * instead of an ast_register_atexit() handler.
+ *
+ * The reason is that during an immediate shutdown, loadable modules (which may
+ * refer to core message types) are not unloaded. While the atexit handlers are

[... 1870 lines stripped ...]



More information about the svn-commits mailing list