[asterisk-commits] dlee: branch dlee/better-nicknames r402526 - in /team/dlee/better-nicknames: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Nov 7 14:43:38 CST 2013


Author: dlee
Date: Thu Nov  7 14:43:19 2013
New Revision: 402526

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402526
Log:
Merged revisions 401706-402517 from http://svn.asterisk.org/svn/asterisk/branches/12

Added:
    team/dlee/better-nicknames/contrib/scripts/sip_to_pjsip/
      - copied from r402517, branches/12/contrib/scripts/sip_to_pjsip/
Removed:
    team/dlee/better-nicknames/contrib/scripts/sip_to_res_sip/
Modified:
    team/dlee/better-nicknames/   (props changed)
    team/dlee/better-nicknames/UPGRADE-11.txt
    team/dlee/better-nicknames/UPGRADE.txt
    team/dlee/better-nicknames/addons/cdr_mysql.c
    team/dlee/better-nicknames/apps/app_confbridge.c
    team/dlee/better-nicknames/apps/app_queue.c
    team/dlee/better-nicknames/apps/app_voicemail.c
    team/dlee/better-nicknames/apps/confbridge/conf_config_parser.c
    team/dlee/better-nicknames/apps/confbridge/conf_state.c
    team/dlee/better-nicknames/apps/confbridge/conf_state_inactive.c
    team/dlee/better-nicknames/apps/confbridge/conf_state_multi.c
    team/dlee/better-nicknames/apps/confbridge/conf_state_multi_marked.c
    team/dlee/better-nicknames/apps/confbridge/conf_state_single.c
    team/dlee/better-nicknames/apps/confbridge/conf_state_single_marked.c
    team/dlee/better-nicknames/apps/confbridge/include/confbridge.h
    team/dlee/better-nicknames/bridges/bridge_native_rtp.c
    team/dlee/better-nicknames/cdr/cdr_adaptive_odbc.c
    team/dlee/better-nicknames/cdr/cdr_csv.c
    team/dlee/better-nicknames/cdr/cdr_custom.c
    team/dlee/better-nicknames/cdr/cdr_manager.c
    team/dlee/better-nicknames/cdr/cdr_odbc.c
    team/dlee/better-nicknames/cdr/cdr_pgsql.c
    team/dlee/better-nicknames/cdr/cdr_radius.c
    team/dlee/better-nicknames/cdr/cdr_sqlite.c
    team/dlee/better-nicknames/cdr/cdr_sqlite3_custom.c
    team/dlee/better-nicknames/cdr/cdr_syslog.c
    team/dlee/better-nicknames/cdr/cdr_tds.c
    team/dlee/better-nicknames/channels/chan_dahdi.c
    team/dlee/better-nicknames/channels/chan_iax2.c
    team/dlee/better-nicknames/channels/chan_pjsip.c
    team/dlee/better-nicknames/channels/chan_sip.c
    team/dlee/better-nicknames/codecs/ilbc/doCPLC.c
    team/dlee/better-nicknames/configs/confbridge.conf.sample
    team/dlee/better-nicknames/doc/   (props changed)
    team/dlee/better-nicknames/include/asterisk/acl.h
    team/dlee/better-nicknames/include/asterisk/app.h
    team/dlee/better-nicknames/include/asterisk/bridge.h
    team/dlee/better-nicknames/include/asterisk/cdr.h
    team/dlee/better-nicknames/include/asterisk/lock.h
    team/dlee/better-nicknames/include/asterisk/netsock2.h
    team/dlee/better-nicknames/include/asterisk/pbx.h
    team/dlee/better-nicknames/include/asterisk/res_pjsip_session.h
    team/dlee/better-nicknames/include/asterisk/rtp_engine.h
    team/dlee/better-nicknames/include/asterisk/stasis_app.h
    team/dlee/better-nicknames/include/asterisk/vector.h
    team/dlee/better-nicknames/main/app.c
    team/dlee/better-nicknames/main/asterisk.c
    team/dlee/better-nicknames/main/astobj2.c
    team/dlee/better-nicknames/main/bridge.c
    team/dlee/better-nicknames/main/cdr.c
    team/dlee/better-nicknames/main/channel.c
    team/dlee/better-nicknames/main/config.c
    team/dlee/better-nicknames/main/data.c
    team/dlee/better-nicknames/main/jitterbuf.c
    team/dlee/better-nicknames/main/loader.c
    team/dlee/better-nicknames/main/logger.c
    team/dlee/better-nicknames/main/manager_bridges.c
    team/dlee/better-nicknames/main/media_index.c
    team/dlee/better-nicknames/main/pbx.c
    team/dlee/better-nicknames/main/rtp_engine.c
    team/dlee/better-nicknames/main/stasis.c
    team/dlee/better-nicknames/main/stasis_channels.c
    team/dlee/better-nicknames/main/stasis_message_router.c
    team/dlee/better-nicknames/main/taskprocessor.c
    team/dlee/better-nicknames/main/translate.c
    team/dlee/better-nicknames/main/utils.c
    team/dlee/better-nicknames/main/xmldoc.c
    team/dlee/better-nicknames/res/ari/ari_model_validators.c
    team/dlee/better-nicknames/res/ari/ari_model_validators.h
    team/dlee/better-nicknames/res/ari/resource_bridges.c
    team/dlee/better-nicknames/res/ari/resource_channels.c
    team/dlee/better-nicknames/res/ari/resource_channels.h
    team/dlee/better-nicknames/res/res_ari_bridges.c
    team/dlee/better-nicknames/res/res_ari_channels.c
    team/dlee/better-nicknames/res/res_ari_playback.c
    team/dlee/better-nicknames/res/res_ari_recordings.c
    team/dlee/better-nicknames/res/res_pjsip/pjsip_distributor.c
    team/dlee/better-nicknames/res/res_pjsip_endpoint_identifier_user.c
    team/dlee/better-nicknames/res/res_pjsip_messaging.c
    team/dlee/better-nicknames/res/res_rtp_asterisk.c
    team/dlee/better-nicknames/res/res_stasis.c
    team/dlee/better-nicknames/res/res_stasis_playback.c
    team/dlee/better-nicknames/res/res_stasis_recording.c
    team/dlee/better-nicknames/res/stasis/app.c
    team/dlee/better-nicknames/res/stasis/control.c
    team/dlee/better-nicknames/rest-api-templates/api.wiki.mustache
    team/dlee/better-nicknames/rest-api/api-docs/bridges.json
    team/dlee/better-nicknames/rest-api/api-docs/channels.json
    team/dlee/better-nicknames/rest-api/api-docs/events.json
    team/dlee/better-nicknames/rest-api/api-docs/playback.json
    team/dlee/better-nicknames/rest-api/api-docs/recordings.json
    team/dlee/better-nicknames/sounds/Makefile
    team/dlee/better-nicknames/tests/test_linkedlists.c
    team/dlee/better-nicknames/utils/clicompat.c
    team/dlee/better-nicknames/utils/refcounter.c

Propchange: team/dlee/better-nicknames/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Propchange: team/dlee/better-nicknames/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Nov  7 14:43:19 2013
@@ -1,1 +1,1 @@
-/branches/12:1-401701
+/branches/12:1-402525

Modified: team/dlee/better-nicknames/UPGRADE-11.txt
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/UPGRADE-11.txt?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/UPGRADE-11.txt (original)
+++ team/dlee/better-nicknames/UPGRADE-11.txt Thu Nov  7 14:43:19 2013
@@ -19,6 +19,23 @@
 === UPGRADE-10.txt -- Upgrade info for 1.8 to 10
 ===
 ===========================================================
+
+From 11.6 to 11.7:
+ConfBridge
+ - ConfBridge now has the ability to set the language of announcements to the
+   conference.  The language can be set on a bridge profile in confbridge.conf
+   or by the dialplan function CONFBRIDGE(bridge,language)=en.
+chan_sip - Clarify The "sip show peers" Forcerport Column And Add Comedia
+ - Under the "Forcerport" column, the "N" used to mean NAT (i.e. Yes).  With
+   the additon of auto_* NAT settings, the meaning changed and there was a
+   certain combination of letters added to indicate the current setting. The
+   combination of using "Y", "N", "A" or "a", can be confusing.  Therefore, we
+   now display clearly what the current Forcerport setting is: "Yes", "No",
+   "Auto (Yes)", "Auto (No)".
+ - Since we are clarifying the Forcerport column, we have added a column to
+   display the Comedia setting since this is useful information as well.  We
+   no longer have a simple "NAT" setting like other versions before 11.
+
 From 11.5 to 11.6:
 * res_agi will now properly indicate if there was an error in streaming an
   audio file.  The result code will be -1 and the result returned from the

Modified: team/dlee/better-nicknames/UPGRADE.txt
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/UPGRADE.txt?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/UPGRADE.txt (original)
+++ team/dlee/better-nicknames/UPGRADE.txt Thu Nov  7 14:43:19 2013
@@ -337,6 +337,9 @@
    associated with the current CDR for the channel, as opposed to a cumulative
    measurement of all CDRs for that channel.
 
+ - CDR backends can no longer be unloaded while billing data is in flight. This
+   helps to prevent loss of billing data during restarts and shutdowns.
+
 CEL:
  - The Uniqueid field for a channel is now a stable identifier, and will not
    change due to transfers, parking, etc.

Modified: team/dlee/better-nicknames/addons/cdr_mysql.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/addons/cdr_mysql.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/addons/cdr_mysql.c (original)
+++ team/dlee/better-nicknames/addons/cdr_mysql.c Thu Nov  7 14:43:19 2013
@@ -384,9 +384,11 @@
 	}
 
 	dbport = 0;
-	ast_cdr_unregister(name);
-	
-	return 0;
+	if (reload) {
+		return ast_cdr_backend_suspend(name);
+	} else {
+		return ast_cdr_unregister(name);
+	}
 }
 
 static int my_load_config_string(struct ast_config *cfg, const char *category, const char *variable, struct ast_str **field, const char *def)
@@ -660,7 +662,11 @@
 		return AST_MODULE_LOAD_FAILURE;
 	}
 
-	res = ast_cdr_register(name, desc, mysql_log);
+	if (!reload) {
+		res = ast_cdr_register(name, desc, mysql_log);
+	} else {
+		res = ast_cdr_backend_unsuspend(name);
+	}
 	if (res) {
 		ast_log(LOG_ERROR, "Unable to register MySQL CDR handling\n");
 	} else {

Modified: team/dlee/better-nicknames/apps/app_confbridge.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/apps/app_confbridge.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/apps/app_confbridge.c (original)
+++ team/dlee/better-nicknames/apps/app_confbridge.c Thu Nov  7 14:43:19 2013
@@ -963,6 +963,32 @@
 	return 0;
 }
 
+void conf_update_user_mute(struct confbridge_user *user)
+{
+	int mute_user;
+	int mute_system;
+	int mute_effective;
+
+	/* User level mute request. */
+	mute_user = user->muted;
+
+	/* System level mute request. */
+	mute_system = user->playing_moh
+		/*
+		 * Do not allow waitmarked users to talk to anyone unless there
+		 * is a marked user present.
+		 */
+		|| (!user->conference->markedusers
+			&& ast_test_flag(&user->u_profile, USER_OPT_WAITMARKED));
+
+	mute_effective = mute_user || mute_system;
+
+	ast_debug(1, "User %s is %s: user:%d system:%d.\n",
+		ast_channel_name(user->chan), mute_effective ? "muted" : "unmuted",
+		mute_user, mute_system);
+	user->features.mute = mute_effective;
+}
+
 void conf_moh_stop(struct confbridge_user *user)
 {
 	user->playing_moh = 0;
@@ -1108,9 +1134,7 @@
 	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;
-	}
+	conf_update_user_mute(first_user);
 }
 
 void conf_ended(struct confbridge_conference *conference)
@@ -1630,7 +1654,8 @@
 
 	/* If the caller should be joined already muted, make it so */
 	if (ast_test_flag(&user.u_profile, USER_OPT_STARTMUTED)) {
-		user.features.mute = 1;
+		/* Set user level mute request. */
+		user.muted = 1;
 	}
 
 	if (ast_test_flag(&user.u_profile, USER_OPT_DROP_SILENCE)) {
@@ -1748,17 +1773,28 @@
 	struct confbridge_user *user,
 	struct ast_channel *chan)
 {
-	/* Mute or unmute yourself, note we only allow manipulation if they aren't waiting for a marked user or if marked users exist */
-	if (!ast_test_flag(&user->u_profile, USER_OPT_WAITMARKED) || conference->markedusers) {
-		user->features.mute = (!user->features.mute ? 1 : 0);
-		ast_test_suite_event_notify("CONF_MUTE", "Message: participant %s %s\r\nConference: %s\r\nChannel: %s", ast_channel_name(chan), user->features.mute ? "muted" : "unmuted", user->b_profile.name, ast_channel_name(chan));
-		if (user->features.mute) {
-			send_mute_event(chan, conference);
-		} else {
-			send_unmute_event(chan, conference);
-		}
-	}
-	return ast_stream_and_wait(chan, (user->features.mute ?
+	int mute;
+
+	/* Toggle user level mute request. */
+	mute = !user->muted;
+	user->muted = mute;
+
+	conf_update_user_mute(user);
+	ast_test_suite_event_notify("CONF_MUTE",
+		"Message: participant %s %s\r\n"
+		"Conference: %s\r\n"
+		"Channel: %s",
+		ast_channel_name(chan),
+		mute ? "muted" : "unmuted",
+		user->b_profile.name,
+		ast_channel_name(chan));
+	if (mute) {
+		send_mute_event(chan, conference);
+	} else {
+		send_unmute_event(chan, conference);
+	}
+
+	return ast_stream_and_wait(chan, (mute ?
 		conf_get_sound(CONF_SOUND_MUTED, user->b_profile.sounds) :
 		conf_get_sound(CONF_SOUND_UNMUTED, user->b_profile.sounds)),
 		"");
@@ -1768,21 +1804,26 @@
 {
 	struct confbridge_user *cur_user = NULL;
 	const char *sound_to_play;
+	int mute;
 
 	ao2_lock(conference);
 
-	/* If already muted, then unmute */
-	conference->muted = conference->muted ? 0 : 1;
-	sound_to_play = conf_get_sound((conference->muted ? CONF_SOUND_PARTICIPANTS_MUTED : CONF_SOUND_PARTICIPANTS_UNMUTED),
-		user->b_profile.sounds);
+	/* Toggle bridge level mute request. */
+	mute = !conference->muted;
+	conference->muted = mute;
 
 	AST_LIST_TRAVERSE(&conference->active_list, cur_user, list) {
 		if (!ast_test_flag(&cur_user->u_profile, USER_OPT_ADMIN)) {
-			cur_user->features.mute = conference->muted;
+			/* Set user level to bridge level mute request. */
+			cur_user->muted = mute;
+			conf_update_user_mute(cur_user);
 		}
 	}
 
 	ao2_unlock(conference);
+
+	sound_to_play = conf_get_sound((mute ? CONF_SOUND_PARTICIPANTS_MUTED : CONF_SOUND_PARTICIPANTS_UNMUTED),
+		user->b_profile.sounds);
 
 	/* The host needs to hear it seperately, as they don't get the audio from play_sound_helper */
 	ast_stream_and_wait(user->chan, sound_to_play, "");
@@ -2203,7 +2244,7 @@
 
 static void handle_cli_confbridge_list_item(struct ast_cli_args *a, struct confbridge_user *user, int waiting)
 {
-	char flag_str[5 + 1];/* Max flags + terminator */
+	char flag_str[6 + 1];/* Max flags + terminator */
 	int pos = 0;
 
 	/* Build flags column string. */
@@ -2219,18 +2260,22 @@
 	if (ast_test_flag(&user->u_profile, USER_OPT_ENDMARKED)) {
 		flag_str[pos++] = 'E';
 	}
+	if (user->muted) {
+		flag_str[pos++] = 'm';
+	}
 	if (waiting) {
 		flag_str[pos++] = 'w';
 	}
 	flag_str[pos] = '\0';
 
-	ast_cli(a->fd, "%-29s ", ast_channel_name(user->chan));
-	ast_cli(a->fd, "%-5s ", flag_str);
-	ast_cli(a->fd, "%-17s", user->u_profile.name);
-	ast_cli(a->fd, "%-17s", user->b_profile.name);
-	ast_cli(a->fd, "%-17s", user->menu_name);
-	ast_cli(a->fd, "%-17s", S_COR(ast_channel_caller(user->chan)->id.number.valid, ast_channel_caller(user->chan)->id.number.str, "<unknown>"));
-	ast_cli(a->fd, "\n");
+	ast_cli(a->fd, "%-30s %-6s %-16s %-16s %-16s %s\n",
+		ast_channel_name(user->chan),
+		flag_str,
+		user->u_profile.name,
+		user->b_profile.name,
+		user->menu_name,
+		S_COR(ast_channel_caller(user->chan)->id.number.valid,
+			ast_channel_caller(user->chan)->id.number.str, "<unknown>"));
 }
 
 static char *handle_cli_confbridge_list(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
@@ -2252,6 +2297,7 @@
 			"         M - The user is a marked user\n"
 			"         W - The user must wait for a marked user to join\n"
 			"         E - The user will be kicked after the last marked user leaves the conference\n"
+			"         m - The user is muted\n"
 			"         w - The user is waiting for a marked user to join\n";
 		return NULL;
 	case CLI_GENERATE:
@@ -2283,8 +2329,8 @@
 			ast_cli(a->fd, "No conference bridge named '%s' found!\n", a->argv[2]);
 			return CLI_SUCCESS;
 		}
-		ast_cli(a->fd, "Channel                       Flags User Profile     Bridge Profile   Menu             CallerID\n");
-		ast_cli(a->fd, "============================= ===== ================ ================ ================ ================\n");
+		ast_cli(a->fd, "Channel                        Flags  User Profile     Bridge Profile   Menu             CallerID\n");
+		ast_cli(a->fd, "============================== ====== ================ ================ ================ ================\n");
 		ao2_lock(conference);
 		AST_LIST_TRAVERSE(&conference->active_list, user, list) {
 			handle_cli_confbridge_list_item(a, user, 0);
@@ -2348,14 +2394,23 @@
 		}
 	}
 	if (user) {
-		user->features.mute = mute;
-		ast_channel_lock(user->chan);
-		if (user->features.mute) {
+		/* Set user level mute request. */
+		user->muted = mute ? 1 : 0;
+
+		conf_update_user_mute(user);
+		ast_test_suite_event_notify("CONF_MUTE",
+			"Message: participant %s %s\r\n"
+			"Conference: %s\r\n"
+			"Channel: %s",
+			ast_channel_name(user->chan),
+			mute ? "muted" : "unmuted",
+			conference->b_profile.name,
+			ast_channel_name(user->chan));
+		if (mute) {
 			send_mute_event(user->chan, conference);
 		} else {
 			send_unmute_event(user->chan, conference);
 		}
-		ast_channel_unlock(user->chan);
 	} else {
 		res = -2;;
 	}
@@ -2614,6 +2669,7 @@
 		"WaitMarked: %s\r\n"
 		"EndMarked: %s\r\n"
 		"Waiting: %s\r\n"
+		"Muted: %s\r\n"
 		"\r\n",
 		id_text,
 		conference->name,
@@ -2624,7 +2680,8 @@
 		ast_test_flag(&user->u_profile, USER_OPT_MARKEDUSER) ? "Yes" : "No",
 		ast_test_flag(&user->u_profile, USER_OPT_WAITMARKED) ? "Yes" : "No",
 		ast_test_flag(&user->u_profile, USER_OPT_ENDMARKED) ? "Yes" : "No",
-		waiting ? "Yes" : "No");
+		waiting ? "Yes" : "No",
+		user->muted ? "Yes" : "No");
 }
 
 static int action_confbridgelist(struct mansession *s, const struct message *m)
@@ -3057,11 +3114,11 @@
 {
 	struct confbridge_user *only_user = AST_LIST_FIRST(&conference->active_list);
 
-	/* Turn on MOH/mute if the single participant is set up for it */
+	/* Turn on MOH if the single participant is set up for it */
 	if (ast_test_flag(&only_user->u_profile, USER_OPT_MUSICONHOLD)) {
-		only_user->features.mute = 1;
 		conf_moh_start(only_user);
 	}
+	conf_update_user_mute(only_user);
 }
 
 void conf_remove_user_waiting(struct confbridge_conference *conference, struct confbridge_user *user)

Modified: team/dlee/better-nicknames/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/apps/app_queue.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/apps/app_queue.c (original)
+++ team/dlee/better-nicknames/apps/app_queue.c Thu Nov  7 14:43:19 2013
@@ -4467,6 +4467,8 @@
 						}
 						prev = o;
 					}
+				} else if (prev) {
+					prev->call_next = NULL;
 				}
 				numlines++;
 			}
@@ -4927,7 +4929,9 @@
 
 	if (!*to) {
 		for (o = start; o; o = o->call_next) {
-			rna(orig, qe, o->chan, o->interface, o->member->membername, 1);
+			if (o->chan) {
+				rna(orig, qe, o->chan, o->interface, o->member->membername, 1);
+			}
 		}
 
 		publish_dial_end_event(qe->chan, outgoing, NULL, "NOANSWER");

Modified: team/dlee/better-nicknames/apps/app_voicemail.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/apps/app_voicemail.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/apps/app_voicemail.c (original)
+++ team/dlee/better-nicknames/apps/app_voicemail.c Thu Nov  7 14:43:19 2013
@@ -11994,6 +11994,7 @@
 
 static int acf_vm_info(struct ast_channel *chan, const char *cmd, char *args, char *buf, size_t len)
 {
+	struct ast_vm_user svm;
 	struct ast_vm_user *vmu = NULL;
 	char *tmp, *mailbox, *context, *parse;
 	int res = 0;
@@ -12027,7 +12028,7 @@
 		 context = "default";
 	}
 
-	vmu = find_user(NULL, context, mailbox);
+	vmu = find_user(&svm, context, mailbox);
 
 	if (!strncasecmp(arg.attribute, "exists", 5)) {
 		ast_copy_string(buf, vmu ? "1" : "0", len);
@@ -13788,6 +13789,7 @@
 {
 	int i, j, res = AST_TEST_PASS, syserr;
 	struct ast_vm_user *vmu;
+	struct ast_vm_user svm;
 	struct vm_state vms;
 #ifdef IMAP_STORAGE
 	struct ast_channel *chan = NULL;
@@ -13840,7 +13842,7 @@
 	}
 #endif
 
-	if (!(vmu = find_user(NULL, testcontext, testmailbox)) &&
+	if (!(vmu = find_user(&svm, testcontext, testmailbox)) &&
 		!(vmu = find_or_create(testcontext, testmailbox))) {
 		ast_test_status_update(test, "Cannot create vmu structure\n");
 		ast_unreplace_sigchld();

Modified: team/dlee/better-nicknames/apps/confbridge/conf_config_parser.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/apps/confbridge/conf_config_parser.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/apps/confbridge/conf_config_parser.c (original)
+++ team/dlee/better-nicknames/apps/confbridge/conf_config_parser.c Thu Nov  7 14:43:19 2013
@@ -427,6 +427,13 @@
 					is passed in to ConfBridge as an argument in the dialplan.</para>
 					<para>Below is a list of menu actions that can be assigned to a DTMF sequence.</para>
 					<note><para>
+						To have the first DTMF digit in a sequence be the '#' character, you need to
+						escape it.  If it is not escaped then normal config file processing will
+						think it is a directive like #include.  For example: The mute setting is
+						toggled when <literal>#1</literal> is pressed.</para>
+						<para><literal>\#1=toggle_mute</literal></para>
+					</note>
+					<note><para>
 					A single DTMF sequence can have multiple actions associated with it. This is
 					accomplished by stringing the actions together and using a <literal>,</literal> as the
 					delimiter.  Example:  Both listening and talking volume is reset when <literal>5</literal> is
@@ -450,7 +457,7 @@
 						<enum name="toggle_mute"><para>
 							Toggle turning on and off mute.  Mute will make the user silent
 							to everyone else, but the user will still be able to listen in.
-							continue to collect the dtmf sequence.</para></enum>
+							</para></enum>
 						<enum name="no_op"><para>
 							This action does nothing (No Operation). Its only real purpose exists for
 							being able to reserve a sequence in the config as a menu exit sequence.</para></enum>

Modified: team/dlee/better-nicknames/apps/confbridge/conf_state.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/apps/confbridge/conf_state.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/apps/confbridge/conf_state.c (original)
+++ team/dlee/better-nicknames/apps/confbridge/conf_state.c Thu Nov  7 14:43:19 2013
@@ -57,12 +57,11 @@
  */
 static void conf_mute_moh_inactive_waitmarked(struct confbridge_user *user)
 {
-	/* Be sure we are muted so we can't talk to anybody else waiting */
-	user->features.mute = 1;
 	/* Start music on hold if needed */
 	if (ast_test_flag(&user->u_profile, USER_OPT_MUSICONHOLD)) {
 		conf_moh_start(user);
 	}
+	conf_update_user_mute(user);
 }
 
 void conf_default_join_waitmarked(struct confbridge_user *user)

Modified: team/dlee/better-nicknames/apps/confbridge/conf_state_inactive.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/apps/confbridge/conf_state_inactive.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/apps/confbridge/conf_state_inactive.c (original)
+++ team/dlee/better-nicknames/apps/confbridge/conf_state_inactive.c Thu Nov  7 14:43:19 2013
@@ -61,7 +61,7 @@
 static void join_marked(struct confbridge_user *user)
 {
 	conf_add_user_marked(user->conference, user);
-	conf_handle_second_active(user->conference);
+	conf_update_user_mute(user);
 
 	conf_change_state(user, CONF_STATE_MULTI_MARKED);
 }

Modified: team/dlee/better-nicknames/apps/confbridge/conf_state_multi.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/apps/confbridge/conf_state_multi.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/apps/confbridge/conf_state_multi.c (original)
+++ team/dlee/better-nicknames/apps/confbridge/conf_state_multi.c Thu Nov  7 14:43:19 2013
@@ -54,11 +54,13 @@
 static void join_unmarked(struct confbridge_user *user)
 {
 	conf_add_user_active(user->conference, user);
+	conf_update_user_mute(user);
 }
 
 static void join_marked(struct confbridge_user *user)
 {
 	conf_add_user_marked(user->conference, user);
+	conf_update_user_mute(user);
 
 	conf_change_state(user, CONF_STATE_MULTI_MARKED);
 }

Modified: team/dlee/better-nicknames/apps/confbridge/conf_state_multi_marked.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/apps/confbridge/conf_state_multi_marked.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/apps/confbridge/conf_state_multi_marked.c (original)
+++ team/dlee/better-nicknames/apps/confbridge/conf_state_multi_marked.c Thu Nov  7 14:43:19 2013
@@ -60,11 +60,13 @@
 static void join_active(struct confbridge_user *user)
 {
 	conf_add_user_active(user->conference, user);
+	conf_update_user_mute(user);
 }
 
 static void join_marked(struct confbridge_user *user)
 {
 	conf_add_user_marked(user->conference, user);
+	conf_update_user_mute(user);
 }
 
 static void leave_active(struct confbridge_user *user)
@@ -95,8 +97,8 @@
 		AST_LIST_TRAVERSE_SAFE_BEGIN(&user->conference->active_list, user_iter, list) {
 			/* Kick ENDMARKED user_iters */
 			if (ast_test_flag(&user_iter->u_profile, USER_OPT_ENDMARKED)) {
-				if (ast_test_flag(&user_iter->u_profile, USER_OPT_WAITMARKED) &&
-						  !ast_test_flag(&user_iter->u_profile, USER_OPT_MARKEDUSER)) {
+				if (ast_test_flag(&user_iter->u_profile, USER_OPT_WAITMARKED)
+					&& !ast_test_flag(&user_iter->u_profile, USER_OPT_MARKEDUSER)) {
 					AST_LIST_REMOVE_CURRENT(list);
 					user_iter->conference->activeusers--;
 					AST_LIST_INSERT_TAIL(&user_iter->conference->waiting_list, user_iter, list);
@@ -104,17 +106,18 @@
 				}
 				user_iter->kicked = 1;
 				ast_bridge_remove(user_iter->conference->bridge, user_iter->chan);
-			} else if (ast_test_flag(&user_iter->u_profile, USER_OPT_WAITMARKED) &&
-					!ast_test_flag(&user_iter->u_profile, USER_OPT_MARKEDUSER)) {
+			} else if (ast_test_flag(&user_iter->u_profile, USER_OPT_WAITMARKED)
+				&& !ast_test_flag(&user_iter->u_profile, USER_OPT_MARKEDUSER)) {
 				AST_LIST_REMOVE_CURRENT(list);
 				user_iter->conference->activeusers--;
 				AST_LIST_INSERT_TAIL(&user_iter->conference->waiting_list, user_iter, list);
 				user_iter->conference->waitingusers++;
-				/* Handle muting/moh of user_iter if necessary */
+
+				/* Handle moh of user_iter if necessary */
 				if (ast_test_flag(&user_iter->u_profile, USER_OPT_MUSICONHOLD)) {
-					user_iter->features.mute = 1;
 					conf_moh_start(user_iter);
 				}
+				conf_update_user_mute(user_iter);
 			}
 		}
 		AST_LIST_TRAVERSE_SAFE_END;
@@ -170,7 +173,7 @@
 		conf_handle_first_marked_common(user);
 	}
 
-	/* Move all waiting users to active, stopping MOH and umuting if necessary */
+	/* Move all waiting users to active, stopping MOH and unmuting if necessary */
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&user->conference->waiting_list, user_iter, list) {
 		AST_LIST_REMOVE_CURRENT(list);
 		user->conference->waitingusers--;
@@ -179,10 +182,7 @@
 		if (user_iter->playing_moh) {
 			conf_moh_stop(user_iter);
 		}
-		/* only unmute them if they are not supposed to start muted */
-		if (!ast_test_flag(&user_iter->u_profile, USER_OPT_STARTMUTED)) {
-			user_iter->features.mute = 0;
-		}
+		conf_update_user_mute(user_iter);
 	}
 	AST_LIST_TRAVERSE_SAFE_END;
 }

Modified: team/dlee/better-nicknames/apps/confbridge/conf_state_single.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/apps/confbridge/conf_state_single.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/apps/confbridge/conf_state_single.c (original)
+++ team/dlee/better-nicknames/apps/confbridge/conf_state_single.c Thu Nov  7 14:43:19 2013
@@ -55,6 +55,7 @@
 {
 	conf_add_user_active(user->conference, user);
 	conf_handle_second_active(user->conference);
+	conf_update_user_mute(user);
 
 	conf_change_state(user, CONF_STATE_MULTI);
 }
@@ -63,6 +64,7 @@
 {
 	conf_add_user_marked(user->conference, user);
 	conf_handle_second_active(user->conference);
+	conf_update_user_mute(user);
 
 	conf_change_state(user, CONF_STATE_MULTI_MARKED);
 }

Modified: team/dlee/better-nicknames/apps/confbridge/conf_state_single_marked.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/apps/confbridge/conf_state_single_marked.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/apps/confbridge/conf_state_single_marked.c (original)
+++ team/dlee/better-nicknames/apps/confbridge/conf_state_single_marked.c Thu Nov  7 14:43:19 2013
@@ -54,6 +54,7 @@
 {
 	conf_add_user_active(user->conference, user);
 	conf_handle_second_active(user->conference);
+	conf_update_user_mute(user);
 
 	conf_change_state(user, CONF_STATE_MULTI_MARKED);
 }
@@ -62,6 +63,7 @@
 {
 	conf_add_user_marked(user->conference, user);
 	conf_handle_second_active(user->conference);
+	conf_update_user_mute(user);
 
 	conf_change_state(user, CONF_STATE_MULTI_MARKED);
 }

Modified: team/dlee/better-nicknames/apps/confbridge/include/confbridge.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/apps/confbridge/include/confbridge.h?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/apps/confbridge/include/confbridge.h (original)
+++ team/dlee/better-nicknames/apps/confbridge/include/confbridge.h Thu Nov  7 14:43:19 2013
@@ -241,6 +241,7 @@
 	struct ast_bridge_features features;         /*!< Bridge features structure */
 	struct ast_bridge_tech_optimizations tech_args; /*!< Bridge technology optimizations for talk detection */
 	unsigned int suspended_moh;                  /*!< Count of active suspended MOH actions. */
+	unsigned int muted:1;                        /*!< Has the user requested to be muted? */
 	unsigned int kicked:1;                       /*!< User has been kicked from the conference */
 	unsigned int playing_moh:1;                  /*!< MOH is currently being played to the user */
 	AST_LIST_HEAD_NOLOCK(, post_join_action) post_join_list; /*!< List of sounds to play after joining */;
@@ -367,6 +368,15 @@
 void conf_ended(struct confbridge_conference *conference);
 
 /*!
+ * \brief Update the actual mute status of the user and set it on the bridge.
+ *
+ * \param user User to update the mute status.
+ *
+ * \return Nothing
+ */
+void conf_update_user_mute(struct confbridge_user *user);
+
+/*!
  * \brief Stop MOH for the conference user.
  *
  * \param user Conference user to stop MOH on.

Modified: team/dlee/better-nicknames/bridges/bridge_native_rtp.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/bridges/bridge_native_rtp.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/bridges/bridge_native_rtp.c (original)
+++ team/dlee/better-nicknames/bridges/bridge_native_rtp.c Thu Nov  7 14:43:19 2013
@@ -183,89 +183,10 @@
 	return 0;
 }
 
-/*!
- * \internal
- * \brief Given a bridge channel, get its RTP instance
- *
- * The returned ast_rtp_instance has its refcount bumped.
- *
- * \param bridge_channel Take a guess
- * \retval NULL No RTP instance on this bridge channel
- * \retval non-NULL The RTP instance on this bridge channel
- */
-static struct ast_rtp_instance *bridge_channel_get_rtp_instance(struct ast_bridge_channel *bridge_channel)
-{
-	struct ast_rtp_glue *glue;
-	struct ast_rtp_instance *instance;
-
-	glue = ast_rtp_instance_get_glue(ast_channel_tech(bridge_channel->chan)->type);
-	if (!glue) {
-		return NULL;
-	}
-
-	glue->get_rtp_info(bridge_channel->chan, &instance);
-	return instance;
-}
-
-/*!
- * \internal
- * \brief Determine which two channels are bridged together
- *
- * Because of the nature of swapping, when the time comes for a channel to
- * leave a native RTP bridge, it may be that there are more than two channels
- * in the list of bridge channels. Therefore, it is important to correctly
- * determine which two channels were bridged together.
- *
- * \param bridge The involved bridge
- * \param leaving The bridge channel that is leaving the native RTP bridge
- * \param[out] c0 The first bridged channel
- * \param[out] c1 The second bridged channel
- */
-static void find_bridged_channels(struct ast_bridge *bridge, struct ast_bridge_channel *leaving,
-		struct ast_bridge_channel **c0, struct ast_bridge_channel **c1)
-{
-	RAII_VAR(struct ast_rtp_instance *, leaving_instance, bridge_channel_get_rtp_instance(leaving), ao2_cleanup);
-	struct ast_bridge_channel *iter;
-
-	if (!leaving_instance) {
-		return;
-	}
-
-	AST_LIST_TRAVERSE(&bridge->channels, iter, entry) {
-		RAII_VAR(struct ast_rtp_instance *, instance, NULL, ao2_cleanup);
-
-		if (iter == leaving) {
-			continue;
-		}
-
-		instance = bridge_channel_get_rtp_instance(iter);
-		if (!instance) {
-			continue;
-		}
-
-		if (instance == ast_rtp_instance_get_bridged(leaving_instance)) {
-			break;
-		}
-	}
-	*c0 = leaving;
-	*c1 = iter;
-	return;
-}
-
-/*!
- * \internal
- * \brief Stop native RTP bridging of two channels
- *
- * \param bridge The bridge that had native RTP bridging happening on it
- * \param target If remote RTP bridging, the channel that is placed on hold.
- * \param leaving If this is called because a channel is leaving, this is the
- * bridge channel that is leaving the bridge
- */
-static void native_rtp_bridge_stop(struct ast_bridge *bridge, struct ast_channel *target,
-		struct ast_bridge_channel *leaving)
-{
-	struct ast_bridge_channel *c0 = NULL;
-	struct ast_bridge_channel *c1 = NULL;
+static void native_rtp_bridge_stop(struct ast_bridge *bridge, struct ast_channel *target)
+{
+	struct ast_bridge_channel *c0 = AST_LIST_FIRST(&bridge->channels);
+	struct ast_bridge_channel *c1 = AST_LIST_LAST(&bridge->channels);
 	enum ast_rtp_glue_result native_type;
 	struct ast_rtp_glue *glue0, *glue1 = NULL;
 	RAII_VAR(struct ast_rtp_instance *, instance0, NULL, ao2_cleanup);
@@ -273,17 +194,7 @@
 	RAII_VAR(struct ast_rtp_instance *, vinstance0, NULL, ao2_cleanup);
 	RAII_VAR(struct ast_rtp_instance *, vinstance1, NULL, ao2_cleanup);
 
-	if (bridge->num_channels == 2) {
-		c0 = AST_LIST_FIRST(&bridge->channels);
-		c1 = AST_LIST_LAST(&bridge->channels);
-	} else if (bridge->num_channels > 2) {
-		/* When a channel leaves a native RTP bridge, it is possible for
-		 * more channels to exist in the bridge than when the RTP bridge
-		 * was started. Thus we need to determine which two channels were
-		 * bridged based on the leaving channel
-		 */
-		find_bridged_channels(bridge, leaving, &c0, &c1);
-	} else {
+	if (c0 == c1) {
 		return;
 	}
 
@@ -347,7 +258,7 @@
 
 	if (bridge) {
 		if (f->subclass.integer == AST_CONTROL_HOLD) {
-			native_rtp_bridge_stop(bridge, chan, NULL);
+			native_rtp_bridge_stop(bridge, chan);
 		} else if ((f->subclass.integer == AST_CONTROL_UNHOLD) || (f->subclass.integer == AST_CONTROL_UPDATE_RTP_PEER)) {
 			native_rtp_bridge_start(bridge, chan);
 		}
@@ -511,9 +422,33 @@
 
 static void native_rtp_bridge_leave(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
 {
+	struct ast_rtp_glue *glue;
+	RAII_VAR(struct ast_rtp_instance *, instance, NULL, ao2_cleanup);
+	RAII_VAR(struct ast_rtp_instance *, vinstance, NULL, ao2_cleanup);
+	RAII_VAR(struct ast_rtp_instance *, tinstance, NULL, ao2_cleanup);
+
 	native_rtp_bridge_framehook_detach(bridge_channel);
 
-	native_rtp_bridge_stop(bridge, NULL, bridge_channel);
+	glue = ast_rtp_instance_get_glue(ast_channel_tech(bridge_channel->chan)->type);
+	glue->get_rtp_info(bridge_channel->chan, &instance);
+	glue->get_vrtp_info ? glue->get_vrtp_info(bridge_channel->chan, &vinstance) : AST_RTP_GLUE_RESULT_FORBID;
+	glue->get_trtp_info ? glue->get_trtp_info(bridge_channel->chan, &tinstance) : AST_RTP_GLUE_RESULT_FORBID;
+
+	/* Tear down P2P bridges */
+	if (instance) {
+		ast_rtp_instance_set_bridged(instance, NULL);
+	}
+	if (vinstance) {
+		ast_rtp_instance_set_bridged(vinstance, NULL);
+	}
+	if (tinstance) {
+		ast_rtp_instance_set_bridged(tinstance, NULL);
+	}
+
+	/* Direct RTP may have occurred, tear it down */
+	glue->update_peer(bridge_channel->chan, NULL, NULL, NULL, NULL, 0);
+
+	native_rtp_bridge_stop(bridge, NULL);
 }
 
 static int native_rtp_bridge_write(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel, struct ast_frame *frame)

Modified: team/dlee/better-nicknames/cdr/cdr_adaptive_odbc.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/cdr/cdr_adaptive_odbc.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/cdr/cdr_adaptive_odbc.c (original)
+++ team/dlee/better-nicknames/cdr/cdr_adaptive_odbc.c Thu Nov  7 14:43:19 2013
@@ -767,7 +767,10 @@
 
 static int unload_module(void)
 {
-	ast_cdr_unregister(name);
+	if (ast_cdr_unregister(name)) {
+		return -1;
+	}
+
 	if (AST_RWLIST_WRLOCK(&odbc_tables)) {
 		ast_cdr_register(name, ast_module_info->description, odbc_log);
 		ast_log(LOG_ERROR, "Unable to lock column list.  Unload failed.\n");

Modified: team/dlee/better-nicknames/cdr/cdr_csv.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/cdr/cdr_csv.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/cdr/cdr_csv.c (original)
+++ team/dlee/better-nicknames/cdr/cdr_csv.c Thu Nov  7 14:43:19 2013
@@ -315,7 +315,10 @@
 
 static int unload_module(void)
 {
-	ast_cdr_unregister(name);
+	if (ast_cdr_unregister(name)) {
+		return -1;
+	}
+
 	loaded = 0;
 	return 0;
 }

Modified: team/dlee/better-nicknames/cdr/cdr_custom.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/cdr/cdr_custom.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/cdr/cdr_custom.c (original)
+++ team/dlee/better-nicknames/cdr/cdr_custom.c Thu Nov  7 14:43:19 2013
@@ -184,7 +184,9 @@
 
 static int unload_module(void)
 {
-	ast_cdr_unregister(name);
+	if (ast_cdr_unregister(name)) {
+		return -1;
+	}
 
 	if (AST_RWLIST_WRLOCK(&sinks)) {
 		ast_cdr_register(name, ast_module_info->description, custom_log);

Modified: team/dlee/better-nicknames/cdr/cdr_manager.c
URL: http://svnview.digium.com/svn/asterisk/team/dlee/better-nicknames/cdr/cdr_manager.c?view=diff&rev=402526&r1=402525&r2=402526
==============================================================================
--- team/dlee/better-nicknames/cdr/cdr_manager.c (original)
+++ team/dlee/better-nicknames/cdr/cdr_manager.c Thu Nov  7 14:43:19 2013
@@ -86,8 +86,9 @@
 	if (!cfg) {
 		/* Standard configuration */
 		ast_log(LOG_WARNING, "Failed to load configuration file. Module not activated.\n");
-		if (enablecdr)
-			ast_cdr_unregister(name);
+		if (enablecdr) {
+			ast_cdr_backend_suspend(name);
+		}
 		enablecdr = 0;
 		return -1;
 	}
@@ -135,10 +136,11 @@
 
 	ast_config_destroy(cfg);
 
-	if (enablecdr && !newenablecdr)
-		ast_cdr_unregister(name);
-	else if (!enablecdr && newenablecdr)

[... 6129 lines stripped ...]



More information about the asterisk-commits mailing list