[asterisk-commits] mmichelson: branch mmichelson/outbound_auth r383043 - in /team/mmichelson/out...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 13 16:53:29 CDT 2013


Author: mmichelson
Date: Wed Mar 13 16:53:24 2013
New Revision: 383043

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


Added:
    team/mmichelson/outbound_auth/include/asterisk/stasis.h
      - copied unchanged from r383013, team/group/pimp_my_sip/include/asterisk/stasis.h
    team/mmichelson/outbound_auth/main/stasis.c
      - copied unchanged from r383013, team/group/pimp_my_sip/main/stasis.c
    team/mmichelson/outbound_auth/main/stasis_cache.c
      - copied unchanged from r383013, team/group/pimp_my_sip/main/stasis_cache.c
    team/mmichelson/outbound_auth/main/stasis_message.c
      - copied unchanged from r383013, team/group/pimp_my_sip/main/stasis_message.c
    team/mmichelson/outbound_auth/tests/test_stasis.c
      - copied unchanged from r383013, team/group/pimp_my_sip/tests/test_stasis.c
Removed:
    team/mmichelson/outbound_auth/res/pjproject/
Modified:
    team/mmichelson/outbound_auth/   (props changed)
    team/mmichelson/outbound_auth/CHANGES
    team/mmichelson/outbound_auth/addons/res_config_mysql.c
    team/mmichelson/outbound_auth/apps/app_confbridge.c
    team/mmichelson/outbound_auth/apps/app_voicemail.c
    team/mmichelson/outbound_auth/apps/confbridge/conf_config_parser.c
    team/mmichelson/outbound_auth/apps/confbridge/conf_state.c
    team/mmichelson/outbound_auth/apps/confbridge/conf_state_empty.c
    team/mmichelson/outbound_auth/apps/confbridge/conf_state_inactive.c
    team/mmichelson/outbound_auth/apps/confbridge/conf_state_multi.c
    team/mmichelson/outbound_auth/apps/confbridge/conf_state_multi_marked.c
    team/mmichelson/outbound_auth/apps/confbridge/conf_state_single.c
    team/mmichelson/outbound_auth/apps/confbridge/conf_state_single_marked.c
    team/mmichelson/outbound_auth/apps/confbridge/include/conf_state.h
    team/mmichelson/outbound_auth/apps/confbridge/include/confbridge.h
    team/mmichelson/outbound_auth/build_tools/menuselect-deps.in
    team/mmichelson/outbound_auth/channels/Makefile
    team/mmichelson/outbound_auth/channels/chan_gulp.c
    team/mmichelson/outbound_auth/channels/chan_sip.c
    team/mmichelson/outbound_auth/channels/chan_unistim.c
    team/mmichelson/outbound_auth/channels/sip/include/sip.h
    team/mmichelson/outbound_auth/configure
    team/mmichelson/outbound_auth/configure.ac
    team/mmichelson/outbound_auth/contrib/realtime/mysql/sippeers.sql
    team/mmichelson/outbound_auth/contrib/realtime/postgresql/realtime.sql
    team/mmichelson/outbound_auth/include/asterisk/autoconfig.h.in
    team/mmichelson/outbound_auth/include/asterisk/channel.h
    team/mmichelson/outbound_auth/include/asterisk/channel_internal.h
    team/mmichelson/outbound_auth/include/asterisk/res_sip.h
    team/mmichelson/outbound_auth/include/asterisk/rtp_engine.h
    team/mmichelson/outbound_auth/main/asterisk.c
    team/mmichelson/outbound_auth/main/asterisk.exports.in
    team/mmichelson/outbound_auth/main/channel.c
    team/mmichelson/outbound_auth/main/channel_internal_api.c
    team/mmichelson/outbound_auth/main/logger.c
    team/mmichelson/outbound_auth/main/manager.c
    team/mmichelson/outbound_auth/main/pbx.c
    team/mmichelson/outbound_auth/main/rtp_engine.c
    team/mmichelson/outbound_auth/main/threadpool.c
    team/mmichelson/outbound_auth/main/xmldoc.c
    team/mmichelson/outbound_auth/makeopts.in
    team/mmichelson/outbound_auth/res/Makefile
    team/mmichelson/outbound_auth/res/res_config_ldap.c
    team/mmichelson/outbound_auth/res/res_rtp_asterisk.c
    team/mmichelson/outbound_auth/res/res_sip.c
    team/mmichelson/outbound_auth/res/res_sip.exports.in
    team/mmichelson/outbound_auth/res/res_sip/config_auth.c
    team/mmichelson/outbound_auth/res/res_sip/config_transport.c
    team/mmichelson/outbound_auth/res/res_sip/sip_configuration.c
    team/mmichelson/outbound_auth/res/res_sip/sip_distributor.c
    team/mmichelson/outbound_auth/res/res_sip/sip_options.c
    team/mmichelson/outbound_auth/res/res_sip_acl.c
    team/mmichelson/outbound_auth/res/res_sip_authenticator_digest.c
    team/mmichelson/outbound_auth/res/res_sip_endpoint_identifier_constant.c
    team/mmichelson/outbound_auth/res/res_sip_endpoint_identifier_ip.c
    team/mmichelson/outbound_auth/res/res_sip_endpoint_identifier_user.c
    team/mmichelson/outbound_auth/res/res_sip_logger.c
    team/mmichelson/outbound_auth/res/res_sip_rfc3326.c
    team/mmichelson/outbound_auth/res/res_sip_sdp_audio.c
    team/mmichelson/outbound_auth/res/res_sip_session.c
    team/mmichelson/outbound_auth/res/res_sip_session.exports.in
    team/mmichelson/outbound_auth/res/res_sorcery_config.c
    team/mmichelson/outbound_auth/res/res_sorcery_memory.c
    team/mmichelson/outbound_auth/res/res_xmpp.c

Propchange: team/mmichelson/outbound_auth/
------------------------------------------------------------------------------
    automerge = *

Propchange: team/mmichelson/outbound_auth/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/mmichelson/outbound_auth/
------------------------------------------------------------------------------
--- outbound_auth-integrated (original)
+++ outbound_auth-integrated Wed Mar 13 16:53:24 2013
@@ -1,1 +1,1 @@
-/team/group/pimp_my_sip:1-382444
+/team/group/pimp_my_sip:1-383041

Propchange: team/mmichelson/outbound_auth/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Mar 13 16:53:24 2013
@@ -1,1 +1,1 @@
-/trunk:1-382441
+/trunk:1-383012

Modified: team/mmichelson/outbound_auth/CHANGES
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/outbound_auth/CHANGES?view=diff&rev=383043&r1=383042&r2=383043
==============================================================================
--- team/mmichelson/outbound_auth/CHANGES (original)
+++ team/mmichelson/outbound_auth/CHANGES Wed Mar 13 16:53:24 2013
@@ -111,6 +111,12 @@
  * LDAP realtime configurations for SIP Users now have the AstAccountPathSupport
    objectIdentifier. This maps to the supportpath option in sip.conf. 
 
+RTP
+------------------
+ * ICE/STUN/TURN support in res_rtp_asterisk has been made optional.  To enable
+   them, an Asterisk-specific version of pjproject needs to be installed.
+   Tarballs are available from https://github.com/asterisk/pjproject/tags/.
+
 ------------------------------------------------------------------------------
 --- Functionality changes from Asterisk 10 to Asterisk 11 --------------------
 ------------------------------------------------------------------------------
@@ -472,6 +478,9 @@
    when using Transfer application. See refer_addheaders in sip.conf.sample.
 
  * Added support to use private party ID information with calls.
+
+ * Adds an option discard_remote_hold_retrieval that when set stops telling
+   the peer to start music on hold.
 
 
 chan_skinny

Modified: team/mmichelson/outbound_auth/addons/res_config_mysql.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/outbound_auth/addons/res_config_mysql.c?view=diff&rev=383043&r1=383042&r2=383043
==============================================================================
--- team/mmichelson/outbound_auth/addons/res_config_mysql.c (original)
+++ team/mmichelson/outbound_auth/addons/res_config_mysql.c Wed Mar 13 16:53:24 2013
@@ -937,7 +937,7 @@
 		return NULL;
 	}
 
-	ast_str_set(&sql, 0, "SELECT category, var_name, var_val, cat_metric FROM %s WHERE filename='%s' and commented=0 ORDER BY filename, cat_metric desc, var_metric asc, category, var_name, var_val, id", table, file);
+	ast_str_set(&sql, 0, "SELECT category, var_name, var_val, cat_metric FROM %s WHERE filename='%s' and commented=0 ORDER BY filename, category, cat_metric desc, var_metric asc, var_name, var_val, id", table, file);
 
 	ast_debug(1, "MySQL RealTime: Static SQL: %s\n", ast_str_buffer(sql));
 

Modified: team/mmichelson/outbound_auth/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/mmichelson/outbound_auth/apps/app_confbridge.c?view=diff&rev=383043&r1=383042&r2=383043
==============================================================================
--- team/mmichelson/outbound_auth/apps/app_confbridge.c (original)
+++ team/mmichelson/outbound_auth/apps/app_confbridge.c Wed Mar 13 16:53:24 2013
@@ -305,10 +305,10 @@
 /*! \brief Container to hold all conference bridges in progress */
 static struct ao2_container *conference_bridges;
 
-static void leave_conference(struct conference_bridge_user *user);
-static int play_sound_number(struct conference_bridge *conference_bridge, int say_number);
-static int execute_menu_entry(struct conference_bridge *conference_bridge,
-	struct conference_bridge_user *conference_bridge_user,
+static void leave_conference(struct confbridge_user *user);
+static int play_sound_number(struct confbridge_conference *conference, int say_number);
+static int execute_menu_entry(struct confbridge_conference *conference,
+	struct confbridge_user *user,
 	struct ast_bridge_channel *bridge_channel,
 	struct conf_menu_entry *menu_entry,
 	struct conf_menu *menu);
@@ -316,15 +316,15 @@
 /*! \brief Hashing function used for conference bridges container */
 static int conference_bridge_hash_cb(const void *obj, const int flags)
 {
-	const struct conference_bridge *conference_bridge = obj;
-	return ast_str_case_hash(conference_bridge->name);
+	const struct confbridge_conference *conference = obj;
+	return ast_str_case_hash(conference->name);
 }
 
 /*! \brief Comparison function used for conference bridges container */
 static int conference_bridge_cmp_cb(void *obj, void *arg, int flags)
 {
-	const struct conference_bridge *conference_bridge0 = obj, *conference_bridge1 = arg;
-	return (!strcasecmp(conference_bridge0->name, conference_bridge1->name) ? CMP_MATCH | CMP_STOP : 0);
+	const struct confbridge_conference *conference0 = obj, *conference1 = arg;
+	return (!strcasecmp(conference0->name, conference1->name) ? CMP_MATCH | CMP_STOP : 0);
 }
 
 const char *conf_get_sound(enum conf_sounds sound, struct bridge_profile_sounds *custom_sounds)
@@ -596,13 +596,13 @@
 	return tmp;
 }
 
-static void set_rec_filename(struct conference_bridge *bridge, struct ast_str **filename, int is_new)
-{
-	char *rec_file = bridge->b_profile.rec_file;
+static void set_rec_filename(struct confbridge_conference *conference, struct ast_str **filename, int is_new)
+{
+	char *rec_file = conference->b_profile.rec_file;
 	time_t now;
 	char *ext;
 
-	if (ast_str_strlen(*filename) && ast_test_flag(&bridge->b_profile, BRIDGE_OPT_RECORD_FILE_APPEND) && !is_new) {
+	if (ast_str_strlen(*filename) && ast_test_flag(&conference->b_profile, BRIDGE_OPT_RECORD_FILE_APPEND) && !is_new) {
 		    return;
 	}
 
@@ -610,7 +610,7 @@
 
 	ast_str_reset(*filename);
 	if (ast_strlen_zero(rec_file)) {
-		ast_str_set(filename, 0, "confbridge-%s-%u.wav", bridge->name, (unsigned int)now);
+		ast_str_set(filename, 0, "confbridge-%s-%u.wav", conference->name, (unsigned int)now);
 	} else {
 		/* insert time before file extension */
 		ext = strrchr(rec_file, '.');
@@ -622,7 +622,7 @@
 		}
 	}
 
-	if (ast_test_flag(&bridge->b_profile, BRIDGE_OPT_RECORD_FILE_APPEND)) {
+	if (ast_test_flag(&conference->b_profile, BRIDGE_OPT_RECORD_FILE_APPEND)) {
 		ast_str_append(filename, 0, ",a");
 	}
 }
@@ -644,69 +644,69 @@
 
 static void *record_thread(void *obj)
 {
-	struct conference_bridge *conference_bridge = obj;
+	struct confbridge_conference *conference = obj;
 	struct ast_app *mixmonapp = pbx_findapp("MixMonitor");
 	struct ast_channel *chan;
 	struct ast_str *filename = ast_str_alloca(PATH_MAX);
 	struct ast_str *orig_rec_file = NULL;
 
-	ast_mutex_lock(&conference_bridge->record_lock);
+	ast_mutex_lock(&conference->record_lock);
 	if (!mixmonapp) {
 		ast_log(LOG_WARNING, "Can not record ConfBridge, MixMonitor app is not installed\n");
-		conference_bridge->record_thread = AST_PTHREADT_NULL;
-		ast_mutex_unlock(&conference_bridge->record_lock);
-		ao2_ref(conference_bridge, -1);
+		conference->record_thread = AST_PTHREADT_NULL;
+		ast_mutex_unlock(&conference->record_lock);
+		ao2_ref(conference, -1);
 		return NULL;
 	}
 
 	/* XXX If we get an EXIT right here, START will essentially be a no-op */
-	while (conference_bridge->record_state != CONF_RECORD_EXIT) {
-		set_rec_filename(conference_bridge, &filename,
-				 is_new_rec_file(conference_bridge->b_profile.rec_file, &orig_rec_file));
-		chan = ast_channel_ref(conference_bridge->record_chan);
+	while (conference->record_state != CONF_RECORD_EXIT) {
+		set_rec_filename(conference, &filename,
+				 is_new_rec_file(conference->b_profile.rec_file, &orig_rec_file));
+		chan = ast_channel_ref(conference->record_chan);
 		ast_answer(chan);
 		pbx_exec(chan, mixmonapp, ast_str_buffer(filename));
-		ast_bridge_join(conference_bridge->bridge, chan, NULL, NULL, NULL);
+		ast_bridge_join(conference->bridge, chan, NULL, NULL, NULL);
 
 		ast_hangup(chan); /* This will eat this thread's reference to the channel as well */
 		/* STOP has been called. Wait for either a START or an EXIT */
-		ast_cond_wait(&conference_bridge->record_cond, &conference_bridge->record_lock);
+		ast_cond_wait(&conference->record_cond, &conference->record_lock);
 	}
 	ast_free(orig_rec_file);
-	ast_mutex_unlock(&conference_bridge->record_lock);
-	ao2_ref(conference_bridge, -1);
+	ast_mutex_unlock(&conference->record_lock);
+	ao2_ref(conference, -1);
 	return NULL;
 }
 
 /*! \brief Returns whether or not conference is being recorded.
- * \param conference_bridge The bridge to check for recording
+ * \param conference The bridge to check for recording
  * \retval 1, conference is recording.
  * \retval 0, conference is NOT recording.
  */
-static int conf_is_recording(struct conference_bridge *conference_bridge)
-{
-	return conference_bridge->record_state == CONF_RECORD_START;
+static int conf_is_recording(struct confbridge_conference *conference)
+{
+	return conference->record_state == CONF_RECORD_START;
 }
 
 /*! \brief Stop recording a conference bridge
  * \internal
- * \param conference_bridge The conference bridge on which to stop the recording
+ * \param conference The conference bridge on which to stop the recording
  * \retval -1 Failure
  * \retval 0 Success
  */
-static int conf_stop_record(struct conference_bridge *conference_bridge)
+static int conf_stop_record(struct confbridge_conference *conference)
 {
 	struct ast_channel *chan;
-	if (conference_bridge->record_thread == AST_PTHREADT_NULL || !conf_is_recording(conference_bridge)) {
+	if (conference->record_thread == AST_PTHREADT_NULL || !conf_is_recording(conference)) {
 		return -1;
 	}
-	conference_bridge->record_state = CONF_RECORD_STOP;
-	chan = ast_channel_ref(conference_bridge->record_chan);
-	ast_bridge_remove(conference_bridge->bridge, chan);
+	conference->record_state = CONF_RECORD_STOP;
+	chan = ast_channel_ref(conference->record_chan);
+	ast_bridge_remove(conference->bridge, chan);
 	ast_queue_frame(chan, &ast_null_frame);
 	chan = ast_channel_unref(chan);
-	ast_test_suite_event_notify("CONF_STOP_RECORD", "Message: stopped conference recording channel\r\nConference: %s", conference_bridge->b_profile.name);
-	send_stop_record_event(conference_bridge->name);
+	ast_test_suite_event_notify("CONF_STOP_RECORD", "Message: stopped conference recording channel\r\nConference: %s", conference->b_profile.name);
+	send_stop_record_event(conference->name);
 
 	return 0;
 }
@@ -715,26 +715,26 @@
  * \internal
  * \brief Stops the confbridge recording thread.
  *
- * \note Must be called with the conference_bridge locked
+ * \note Must be called with the conference locked
  */
-static int conf_stop_record_thread(struct conference_bridge *conference_bridge)
-{
-	if (conference_bridge->record_thread == AST_PTHREADT_NULL) {
+static int conf_stop_record_thread(struct confbridge_conference *conference)
+{
+	if (conference->record_thread == AST_PTHREADT_NULL) {
 		return -1;
 	}
-	conf_stop_record(conference_bridge);
-
-	ast_mutex_lock(&conference_bridge->record_lock);
-	conference_bridge->record_state = CONF_RECORD_EXIT;
-	ast_cond_signal(&conference_bridge->record_cond);
-	ast_mutex_unlock(&conference_bridge->record_lock);
-
-	pthread_join(conference_bridge->record_thread, NULL);
-	conference_bridge->record_thread = AST_PTHREADT_NULL;
+	conf_stop_record(conference);
+
+	ast_mutex_lock(&conference->record_lock);
+	conference->record_state = CONF_RECORD_EXIT;
+	ast_cond_signal(&conference->record_cond);
+	ast_mutex_unlock(&conference->record_lock);
+
+	pthread_join(conference->record_thread, NULL);
+	conference->record_thread = AST_PTHREADT_NULL;
 
 	/* this is the reference given to the channel during the channel alloc */
-	if (conference_bridge->record_chan) {
-		conference_bridge->record_chan = ast_channel_unref(conference_bridge->record_chan);
+	if (conference->record_chan) {
+		conference->record_chan = ast_channel_unref(conference->record_chan);
 	}
 
 	return 0;
@@ -742,18 +742,18 @@
 
 /*! \brief Start recording the conference
  * \internal
- * \note conference_bridge must be locked when calling this function
- * \param conference_bridge The conference bridge to start recording
+ * \note The conference must be locked when calling this function
+ * \param conference The conference bridge to start recording
  * \retval 0 success
  * \rteval non-zero failure
  */
-static int conf_start_record(struct conference_bridge *conference_bridge)
+static int conf_start_record(struct confbridge_conference *conference)
 {
 	struct ast_format_cap *cap;
 	struct ast_format tmpfmt;
 	int cause;
 
-	if (conference_bridge->record_state != CONF_RECORD_STOP) {
+	if (conference->record_state != CONF_RECORD_STOP) {
 		return -1;
 	}
 
@@ -768,45 +768,45 @@
 
 	ast_format_cap_add(cap, ast_format_set(&tmpfmt, AST_FORMAT_SLINEAR, 0));
 
-	if (!(conference_bridge->record_chan = ast_request("ConfBridgeRec", cap, NULL, conference_bridge->name, &cause))) {
+	if (!(conference->record_chan = ast_request("ConfBridgeRec", cap, NULL, conference->name, &cause))) {
 		cap = ast_format_cap_destroy(cap);
 		return -1;
 	}
 
 	cap = ast_format_cap_destroy(cap);
 
-	conference_bridge->record_state = CONF_RECORD_START;
-	ast_mutex_lock(&conference_bridge->record_lock);
-	ast_cond_signal(&conference_bridge->record_cond);
-	ast_mutex_unlock(&conference_bridge->record_lock);
-	ast_test_suite_event_notify("CONF_START_RECORD", "Message: started conference recording channel\r\nConference: %s", conference_bridge->b_profile.name);
-	send_start_record_event(conference_bridge->name);
+	conference->record_state = CONF_RECORD_START;
+	ast_mutex_lock(&conference->record_lock);
+	ast_cond_signal(&conference->record_cond);
+	ast_mutex_unlock(&conference->record_lock);
+	ast_test_suite_event_notify("CONF_START_RECORD", "Message: started conference recording channel\r\nConference: %s", conference->b_profile.name);
+	send_start_record_event(conference->name);
 
 	return 0;
 }
 
 /*! \brief Start the recording thread on a conference bridge
  * \internal
- * \param conference_bridge The conference bridge on which to start the recording thread
+ * \param conference The conference bridge on which to start the recording thread
  * \retval 0 success
  * \retval -1 failure
  */
-static int start_conf_record_thread(struct conference_bridge *conference_bridge)
-{
-	conf_start_record(conference_bridge);
+static int start_conf_record_thread(struct confbridge_conference *conference)
+{
+	conf_start_record(conference);
 
 	/*
 	 * if the thread has already been started, don't start another
 	 */
-	if (conference_bridge->record_thread != AST_PTHREADT_NULL) {
-		return 0;
-	}
-
-	ao2_ref(conference_bridge, +1); /* give the record thread a ref */
-
-	if (ast_pthread_create_background(&conference_bridge->record_thread, NULL, record_thread, conference_bridge)) {
-		ast_log(LOG_WARNING, "Failed to create recording channel for conference %s\n", conference_bridge->name);
-		ao2_ref(conference_bridge, -1); /* error so remove ref */
+	if (conference->record_thread != AST_PTHREADT_NULL) {
+		return 0;
+	}
+
+	ao2_ref(conference, +1); /* give the record thread a ref */
+
+	if (ast_pthread_create_background(&conference->record_thread, NULL, record_thread, conference)) {
+		ast_log(LOG_WARNING, "Failed to create recording channel for conference %s\n", conference->name);
+		ao2_ref(conference, -1); /* error so remove ref */
 		return -1;
 	}
 
@@ -833,52 +833,52 @@
 /*!
  * \brief Announce number of users in the conference bridge to the caller
  *
- * \param conference_bridge Conference bridge to peek at
- * \param conference_bridge_user Optional Caller
+ * \param conference Conference bridge to peek at
+ * \param user Optional Caller
  *
  * \note if caller is NULL, the announcment will be sent to all participants in the conference.
  * \return Returns 0 on success, -1 if the user hung up
  */
-static int announce_user_count(struct conference_bridge *conference_bridge, struct conference_bridge_user *conference_bridge_user)
-{
-	const char *other_in_party = conf_get_sound(CONF_SOUND_OTHER_IN_PARTY, conference_bridge->b_profile.sounds);
-	const char *only_one = conf_get_sound(CONF_SOUND_ONLY_ONE, conference_bridge->b_profile.sounds);
-	const char *there_are = conf_get_sound(CONF_SOUND_THERE_ARE, conference_bridge->b_profile.sounds);
-
-	if (conference_bridge->activeusers <= 1) {
+static int announce_user_count(struct confbridge_conference *conference, struct confbridge_user *user)
+{
+	const char *other_in_party = conf_get_sound(CONF_SOUND_OTHER_IN_PARTY, conference->b_profile.sounds);
+	const char *only_one = conf_get_sound(CONF_SOUND_ONLY_ONE, conference->b_profile.sounds);
+	const char *there_are = conf_get_sound(CONF_SOUND_THERE_ARE, conference->b_profile.sounds);
+
+	if (conference->activeusers <= 1) {
 		/* Awww we are the only person in the conference bridge OR we only have waitmarked users */
 		return 0;
-	} else if (conference_bridge->activeusers == 2) {
-		if (conference_bridge_user) {
+	} else if (conference->activeusers == 2) {
+		if (user) {
 			/* Eep, there is one other person */
-			if (ast_stream_and_wait(conference_bridge_user->chan,
+			if (ast_stream_and_wait(user->chan,
 				only_one,
 				"")) {
 				return -1;
 			}
 		} else {
-			play_sound_file(conference_bridge, only_one);
+			play_sound_file(conference, only_one);
 		}
 	} else {
 		/* Alas multiple others in here */
-		if (conference_bridge_user) {
-			if (ast_stream_and_wait(conference_bridge_user->chan,
+		if (user) {
+			if (ast_stream_and_wait(user->chan,
 				there_are,
 				"")) {
 				return -1;
 			}
-			if (ast_say_number(conference_bridge_user->chan, conference_bridge->activeusers - 1, "", ast_channel_language(conference_bridge_user->chan), NULL)) {
+			if (ast_say_number(user->chan, conference->activeusers - 1, "", ast_channel_language(user->chan), NULL)) {
 				return -1;
 			}
-			if (ast_stream_and_wait(conference_bridge_user->chan,
+			if (ast_stream_and_wait(user->chan,
 				other_in_party,
 				"")) {
 				return -1;
 			}
 		} else if (sound_file_exists(there_are) && sound_file_exists(other_in_party)) {
-			play_sound_file(conference_bridge, there_are);
-			play_sound_number(conference_bridge, conference_bridge->activeusers - 1);
-			play_sound_file(conference_bridge, other_in_party);
+			play_sound_file(conference, there_are);
+			play_sound_number(conference, conference->activeusers - 1);
+			play_sound_file(conference, other_in_party);
 		}
 	}
 	return 0;
@@ -887,7 +887,7 @@
 /*!
  * \brief Play back an audio file to a channel
  *
- * \param cbu User to play audio prompt to
+ * \param user User to play audio prompt to
  * \param filename Prompt to play
  *
  * \return Returns 0 on success, -1 if the user hung up
@@ -895,78 +895,79 @@
  * the entire conference while the sound is played. But don't unlock the conference bridge
  * in the middle of a state transition.
  */
-static int play_prompt_to_user(struct conference_bridge_user *cbu, const char *filename)
-{
-	return ast_stream_and_wait(cbu->chan, filename, "");
-}
-
-static void handle_video_on_join(struct conference_bridge *conference_bridge, struct ast_channel *chan, int marked)
+static int play_prompt_to_user(struct confbridge_user *user, const char *filename)
+{
+	return ast_stream_and_wait(user->chan, filename, "");
+}
+
+static void handle_video_on_join(struct confbridge_conference *conference, struct ast_channel *chan, int marked)
 {
 	/* Right now, only marked users are automatically set as the single src of video.*/
 	if (!marked) {
 		return;
 	}
 
-	if (ast_test_flag(&conference_bridge->b_profile, BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED)) {
+	if (ast_test_flag(&conference->b_profile, BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED)) {
 		int set = 1;
-		struct conference_bridge_user *tmp_user = NULL;
-		ao2_lock(conference_bridge);
+		struct confbridge_user *user = NULL;
+
+		ao2_lock(conference);
 		/* see if anyone is already the video src */
-		AST_LIST_TRAVERSE(&conference_bridge->active_list, tmp_user, list) {
-			if (tmp_user->chan == chan) {
+		AST_LIST_TRAVERSE(&conference->active_list, user, list) {
+			if (user->chan == chan) {
 				continue;
 			}
-			if (ast_bridge_is_video_src(conference_bridge->bridge, tmp_user->chan)) {
+			if (ast_bridge_is_video_src(conference->bridge, user->chan)) {
 				set = 0;
 				break;
 			}
 		}
-		ao2_unlock(conference_bridge);
+		ao2_unlock(conference);
 		if (set) {
-			ast_bridge_set_single_src_video_mode(conference_bridge->bridge, chan);
-		}
-	} else if (ast_test_flag(&conference_bridge->b_profile, BRIDGE_OPT_VIDEO_SRC_LAST_MARKED)) {
+			ast_bridge_set_single_src_video_mode(conference->bridge, chan);
+		}
+	} else if (ast_test_flag(&conference->b_profile, BRIDGE_OPT_VIDEO_SRC_LAST_MARKED)) {
 		/* we joined and are video capable, we override anyone else that may have already been the video feed */
-		ast_bridge_set_single_src_video_mode(conference_bridge->bridge, chan);
-	}
-}
-
-static void handle_video_on_exit(struct conference_bridge *conference_bridge, struct ast_channel *chan)
-{
-	struct conference_bridge_user *tmp_user = NULL;
+		ast_bridge_set_single_src_video_mode(conference->bridge, chan);
+	}
+}
+
+static void handle_video_on_exit(struct confbridge_conference *conference, struct ast_channel *chan)
+{
+	struct confbridge_user *user = NULL;
 
 	/* if this isn't a video source, nothing to update */
-	if (!ast_bridge_is_video_src(conference_bridge->bridge, chan)) {
+	if (!ast_bridge_is_video_src(conference->bridge, chan)) {
 		return;
 	}
 
-	ast_bridge_remove_video_src(conference_bridge->bridge, chan);
+	ast_bridge_remove_video_src(conference->bridge, chan);
 
 	/* If in follow talker mode, make sure to restore this mode on the
 	 * bridge when a source is removed.  It is possible this channel was
 	 * only set temporarily as a video source by an AMI or DTMF action. */
-	if (ast_test_flag(&conference_bridge->b_profile, BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER)) {
-		ast_bridge_set_talker_src_video_mode(conference_bridge->bridge);
+	if (ast_test_flag(&conference->b_profile, BRIDGE_OPT_VIDEO_SRC_FOLLOW_TALKER)) {
+		ast_bridge_set_talker_src_video_mode(conference->bridge);
 	}
 
 	/* if the video_mode isn't set to automatically pick the video source, do nothing on exit. */
-	if (!ast_test_flag(&conference_bridge->b_profile, BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED) &&
-		!ast_test_flag(&conference_bridge->b_profile, BRIDGE_OPT_VIDEO_SRC_LAST_MARKED)) {
+	if (!ast_test_flag(&conference->b_profile, BRIDGE_OPT_VIDEO_SRC_FIRST_MARKED) &&
+		!ast_test_flag(&conference->b_profile, BRIDGE_OPT_VIDEO_SRC_LAST_MARKED)) {
 		return;
 	}
 
 	/* Make the next available marked user the video src.  */
-	ao2_lock(conference_bridge);
-	AST_LIST_TRAVERSE(&conference_bridge->active_list, tmp_user, list) {
-		if (tmp_user->chan == chan) {
+	ao2_lock(conference);
+	AST_LIST_TRAVERSE(&conference->active_list, user, list) {
+		if (user->chan == chan) {
 			continue;
 		}
-		if (ast_test_flag(&tmp_user->u_profile, USER_OPT_MARKEDUSER)) {
-			ast_bridge_set_single_src_video_mode(conference_bridge->bridge, tmp_user->chan);
+		if (ast_test_flag(&user->u_profile, USER_OPT_MARKEDUSER)) {
+			ast_bridge_set_single_src_video_mode(conference->bridge, user->chan);
 			break;
 		}
 	}
-	ao2_unlock(conference_bridge);
+	ao2_unlock(conference);
 }
 
 /*!
@@ -978,75 +979,75 @@
  */
 static void destroy_conference_bridge(void *obj)
 {
-	struct conference_bridge *conference_bridge = obj;
-
-	ast_debug(1, "Destroying conference bridge '%s'\n", conference_bridge->name);
-
-	if (conference_bridge->playback_chan) {
-		struct ast_channel *underlying_channel = ast_channel_tech(conference_bridge->playback_chan)->bridged_channel(conference_bridge->playback_chan, NULL);
+	struct confbridge_conference *conference = obj;
+
+	ast_debug(1, "Destroying conference bridge '%s'\n", conference->name);
+
+	if (conference->playback_chan) {
+		struct ast_channel *underlying_channel = ast_channel_tech(conference->playback_chan)->bridged_channel(conference->playback_chan, NULL);
 		if (underlying_channel) {
 			ast_hangup(underlying_channel);
 		}
-		ast_hangup(conference_bridge->playback_chan);
-		conference_bridge->playback_chan = NULL;
+		ast_hangup(conference->playback_chan);
+		conference->playback_chan = NULL;
 	}
 
 	/* Destroying a conference bridge is simple, all we have to do is destroy the bridging object */
-	if (conference_bridge->bridge) {
-		ast_bridge_destroy(conference_bridge->bridge);
-		conference_bridge->bridge = NULL;
-	}
-
-	conf_bridge_profile_destroy(&conference_bridge->b_profile);
-	ast_cond_destroy(&conference_bridge->record_cond);
-	ast_mutex_destroy(&conference_bridge->record_lock);
-	ast_mutex_destroy(&conference_bridge->playback_lock);
+	if (conference->bridge) {
+		ast_bridge_destroy(conference->bridge);
+		conference->bridge = NULL;
+	}
+
+	conf_bridge_profile_destroy(&conference->b_profile);
+	ast_cond_destroy(&conference->record_cond);
+	ast_mutex_destroy(&conference->record_lock);
+	ast_mutex_destroy(&conference->playback_lock);
 }
 
 /*! \brief Call the proper join event handler for the user for the conference bridge's current state
  * \internal
- * \param cbu The conference bridge user that is joining
+ * \param user The conference bridge user that is joining
  * \retval 0 success
  * \retval -1 failure
  */
-static int handle_conf_user_join(struct conference_bridge_user *cbu)
+static int handle_conf_user_join(struct confbridge_user *user)
 {
 	conference_event_fn handler;
-	if (ast_test_flag(&cbu->u_profile, USER_OPT_MARKEDUSER)) {
-		handler = cbu->conference_bridge->state->join_marked;
-	} else if (ast_test_flag(&cbu->u_profile, USER_OPT_WAITMARKED)) {
-		handler = cbu->conference_bridge->state->join_waitmarked;
+	if (ast_test_flag(&user->u_profile, USER_OPT_MARKEDUSER)) {
+		handler = user->conference->state->join_marked;
+	} else if (ast_test_flag(&user->u_profile, USER_OPT_WAITMARKED)) {
+		handler = user->conference->state->join_waitmarked;
 	} else {
-		handler = cbu->conference_bridge->state->join_unmarked;
+		handler = user->conference->state->join_unmarked;
 	}
 
 	ast_assert(handler != NULL);
 
 	if (!handler) {
-		conf_invalid_event_fn(cbu);
+		conf_invalid_event_fn(user);
 		return -1;
 	}
 
-	handler(cbu);
+	handler(user);
 
 	return 0;
 }
 
 /*! \brief Call the proper leave event handler for the user for the conference bridge's current state
  * \internal
- * \param cbu The conference bridge user that is leaving
+ * \param user The conference bridge user that is leaving
  * \retval 0 success
  * \retval -1 failure
  */
-static int handle_conf_user_leave(struct conference_bridge_user *cbu)
+static int handle_conf_user_leave(struct confbridge_user *user)
 {
 	conference_event_fn handler;
-	if (ast_test_flag(&cbu->u_profile, USER_OPT_MARKEDUSER)) {
-		handler = cbu->conference_bridge->state->leave_marked;
-	} else if (ast_test_flag(&cbu->u_profile, USER_OPT_WAITMARKED)) {
-		handler = cbu->conference_bridge->state->leave_waitmarked;
+	if (ast_test_flag(&user->u_profile, USER_OPT_MARKEDUSER)) {
+		handler = user->conference->state->leave_marked;
+	} else if (ast_test_flag(&user->u_profile, USER_OPT_WAITMARKED)) {
+		handler = user->conference->state->leave_waitmarked;
 	} else {
-		handler = cbu->conference_bridge->state->leave_unmarked;
+		handler = user->conference->state->leave_unmarked;
 	}
 
 	ast_assert(handler != NULL);
@@ -1055,16 +1056,16 @@
 		/* This should never happen. If it does, though, it is bad. The user will not have been removed
 		 * from the appropriate list, so counts will be off and stuff. The conference won't be torn down, etc.
 		 * Shouldn't happen, though. */
-		conf_invalid_event_fn(cbu);
+		conf_invalid_event_fn(user);
 		return -1;
 	}
 
-	handler(cbu);
+	handler(user);
 
 	return 0;
 }
 
-void conf_moh_stop(struct conference_bridge_user *user)
+void conf_moh_stop(struct confbridge_user *user)
 {
 	user->playing_moh = 0;
 	if (!user->suspended_moh) {
@@ -1075,23 +1076,23 @@
 		 * call to ast_bridge_join() in confbridge_exec() from
 		 * interfering with the bridge and MOH operations here.
 		 */
-		ast_bridge_lock(user->conference_bridge->bridge);
+		ast_bridge_lock(user->conference->bridge);
 
 		/*
 		 * Temporarily suspend the user from the bridge so we have
 		 * control to stop MOH if needed.
 		 */
-		in_bridge = !ast_bridge_suspend(user->conference_bridge->bridge, user->chan);
+		in_bridge = !ast_bridge_suspend(user->conference->bridge, user->chan);
 		ast_moh_stop(user->chan);
 		if (in_bridge) {
-			ast_bridge_unsuspend(user->conference_bridge->bridge, user->chan);
-		}
-
-		ast_bridge_unlock(user->conference_bridge->bridge);
-	}
-}
-
-void conf_moh_start(struct conference_bridge_user *user)
+			ast_bridge_unsuspend(user->conference->bridge, user->chan);
+		}
+
+		ast_bridge_unlock(user->conference->bridge);
+	}
+}
+
+void conf_moh_start(struct confbridge_user *user)
 {
 	user->playing_moh = 1;
 	if (!user->suspended_moh) {
@@ -1102,19 +1103,19 @@
 		 * call to ast_bridge_join() in confbridge_exec() from
 		 * interfering with the bridge and MOH operations here.
 		 */
-		ast_bridge_lock(user->conference_bridge->bridge);
+		ast_bridge_lock(user->conference->bridge);
 
 		/*
 		 * Temporarily suspend the user from the bridge so we have
 		 * control to start MOH if needed.
 		 */
-		in_bridge = !ast_bridge_suspend(user->conference_bridge->bridge, user->chan);
+		in_bridge = !ast_bridge_suspend(user->conference->bridge, user->chan);
 		ast_moh_start(user->chan, user->u_profile.moh_class, NULL);
 		if (in_bridge) {
-			ast_bridge_unsuspend(user->conference_bridge->bridge, user->chan);
-		}
-
-		ast_bridge_unlock(user->conference_bridge->bridge);
+			ast_bridge_unsuspend(user->conference->bridge, user->chan);
+		}
+
+		ast_bridge_unlock(user->conference->bridge);
 	}
 }
 
@@ -1126,13 +1127,13 @@
  *
  * \return Nothing
  */
-static void conf_moh_unsuspend(struct conference_bridge_user *user)
-{
-	ao2_lock(user->conference_bridge);
+static void conf_moh_unsuspend(struct confbridge_user *user)
+{
+	ao2_lock(user->conference);
 	if (--user->suspended_moh == 0 && user->playing_moh) {
 		ast_moh_start(user->chan, user->u_profile.moh_class, NULL);
 	}
-	ao2_unlock(user->conference_bridge);
+	ao2_unlock(user->conference);
 }
 
 /*!
@@ -1143,40 +1144,40 @@
  *
  * \return Nothing
  */
-static void conf_moh_suspend(struct conference_bridge_user *user)
-{
-	ao2_lock(user->conference_bridge);
+static void conf_moh_suspend(struct confbridge_user *user)
+{
+	ao2_lock(user->conference);
 	if (user->suspended_moh++ == 0 && user->playing_moh) {
 		ast_moh_stop(user->chan);
 	}
-	ao2_unlock(user->conference_bridge);
-}
-
-int conf_handle_first_marked_common(struct conference_bridge_user *cbu)
-{
-	if (!ast_test_flag(&cbu->u_profile, USER_OPT_QUIET) && play_prompt_to_user(cbu, conf_get_sound(CONF_SOUND_PLACE_IN_CONF, cbu->b_profile.sounds))) {
+	ao2_unlock(user->conference);
+}
+
+int conf_handle_first_marked_common(struct confbridge_user *user)
+{
+	if (!ast_test_flag(&user->u_profile, USER_OPT_QUIET) && play_prompt_to_user(user, conf_get_sound(CONF_SOUND_PLACE_IN_CONF, user->b_profile.sounds))) {
 		return -1;
 	}
 	return 0;
 }
 
-int conf_handle_inactive_waitmarked(struct conference_bridge_user *cbu)
+int conf_handle_inactive_waitmarked(struct confbridge_user *user)
 {
 	/* If we have not been quieted play back that they are waiting for the leader */
-	if (!ast_test_flag(&cbu->u_profile, USER_OPT_QUIET) && play_prompt_to_user(cbu,
-			conf_get_sound(CONF_SOUND_WAIT_FOR_LEADER, cbu->b_profile.sounds))) {
+	if (!ast_test_flag(&user->u_profile, USER_OPT_QUIET) && play_prompt_to_user(user,
+			conf_get_sound(CONF_SOUND_WAIT_FOR_LEADER, user->b_profile.sounds))) {
 		/* user hungup while the sound was playing */
 		return -1;
 	}
 	return 0;
 }
 
-int conf_handle_only_unmarked(struct conference_bridge_user *cbu)
+int conf_handle_only_unmarked(struct confbridge_user *user)
 {
 	/* If audio prompts have not been quieted or this prompt quieted play it on out */
-	if (!ast_test_flag(&cbu->u_profile, USER_OPT_QUIET | USER_OPT_NOONLYPERSON)) {
-		if (play_prompt_to_user(cbu,
-			conf_get_sound(CONF_SOUND_ONLY_PERSON, cbu->b_profile.sounds))) {
+	if (!ast_test_flag(&user->u_profile, USER_OPT_QUIET | USER_OPT_NOONLYPERSON)) {
+		if (play_prompt_to_user(user,
+			conf_get_sound(CONF_SOUND_ONLY_PERSON, user->b_profile.sounds))) {
 			/* user hungup while the sound was playing */
 			return -1;
 		}
@@ -1184,217 +1185,217 @@
 	return 0;
 }
 
-int conf_add_post_join_action(struct conference_bridge_user *cbu, int (*func)(struct conference_bridge_user *cbu))
+int conf_add_post_join_action(struct confbridge_user *user, int (*func)(struct confbridge_user *user))
 {
 	struct post_join_action *action;
 	if (!(action = ast_calloc(1, sizeof(*action)))) {
 		return -1;
 	}
 	action->func = func;
-	AST_LIST_INSERT_TAIL(&cbu->post_join_list, action, list);
+	AST_LIST_INSERT_TAIL(&user->post_join_list, action, list);
 	return 0;
 }
 
 
-void conf_handle_first_join(struct conference_bridge *conference_bridge)
-{
-	ast_devstate_changed(AST_DEVICE_INUSE, AST_DEVSTATE_CACHABLE, "confbridge:%s", conference_bridge->name);
-}
-
-void conf_handle_second_active(struct conference_bridge *conference_bridge)
+void conf_handle_first_join(struct confbridge_conference *conference)
+{
+	ast_devstate_changed(AST_DEVICE_INUSE, AST_DEVSTATE_CACHABLE, "confbridge:%s", conference->name);
+}
+
+void conf_handle_second_active(struct confbridge_conference *conference)
 {
 	/* If we are the second participant we may need to stop music on hold on the first */
-	struct conference_bridge_user *first_participant = AST_LIST_FIRST(&conference_bridge->active_list);
-
-	if (ast_test_flag(&first_participant->u_profile, USER_OPT_MUSICONHOLD)) {
-		conf_moh_stop(first_participant);
-	}
-	if (!ast_test_flag(&first_participant->u_profile, USER_OPT_STARTMUTED)) {
-		first_participant->features.mute = 0;
-	}
-}
-
-void conf_ended(struct conference_bridge *conference_bridge)
-{
-	/* Called with a reference to conference_bridge */
-	ao2_unlink(conference_bridges, conference_bridge);
-	send_conf_end_event(conference_bridge->name);
-	conf_stop_record_thread(conference_bridge);
+	struct confbridge_user *first_user = AST_LIST_FIRST(&conference->active_list);
+
+	if (ast_test_flag(&first_user->u_profile, USER_OPT_MUSICONHOLD)) {
+		conf_moh_stop(first_user);
+	}
+	if (!ast_test_flag(&first_user->u_profile, USER_OPT_STARTMUTED)) {
+		first_user->features.mute = 0;
+	}
+}
+
+void conf_ended(struct confbridge_conference *conference)
+{
+	/* Called with a reference to conference */
+	ao2_unlink(conference_bridges, conference);
+	send_conf_end_event(conference->name);
+	conf_stop_record_thread(conference);
 }
 
 /*!
  * \brief Join a conference bridge
  *
- * \param name The conference name

[... 6078 lines stripped ...]



More information about the asterisk-commits mailing list