[asterisk-commits] bebuild: tag 1.8.21.0-rc2 r383969 - in /tags/1.8.21.0-rc2: ./ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Mar 27 08:52:51 CDT 2013


Author: bebuild
Date: Wed Mar 27 08:52:47 2013
New Revision: 383969

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=383969
Log:
Update version, remove summaries, merge blockers

* Merged r381281 for ASTERISK-20650
* Merged r383839 for ASTERISK-21162


Removed:
    tags/1.8.21.0-rc2/asterisk-1.8.21.0-rc1-summary.html
    tags/1.8.21.0-rc2/asterisk-1.8.21.0-rc1-summary.txt
Modified:
    tags/1.8.21.0-rc2/   (props changed)
    tags/1.8.21.0-rc2/.version
    tags/1.8.21.0-rc2/main/cdr.c
    tags/1.8.21.0-rc2/main/rtp_engine.c

Propchange: tags/1.8.21.0-rc2/
------------------------------------------------------------------------------
    svn:mergeinfo = /branches/1.8:381281,383839

Modified: tags/1.8.21.0-rc2/.version
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.21.0-rc2/.version?view=diff&rev=383969&r1=383968&r2=383969
==============================================================================
--- tags/1.8.21.0-rc2/.version (original)
+++ tags/1.8.21.0-rc2/.version Wed Mar 27 08:52:47 2013
@@ -1,1 +1,1 @@
-1.8.21.0-rc1
+1.8.21.0-rc2

Modified: tags/1.8.21.0-rc2/main/cdr.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.21.0-rc2/main/cdr.c?view=diff&rev=383969&r1=383968&r2=383969
==============================================================================
--- tags/1.8.21.0-rc2/main/cdr.c (original)
+++ tags/1.8.21.0-rc2/main/cdr.c Wed Mar 27 08:52:47 2013
@@ -108,6 +108,8 @@
 
 static int batchsafeshutdown;
 static const int BATCH_SAFE_SHUTDOWN_DEFAULT = 1;
+
+AST_MUTEX_DEFINE_STATIC(cdr_sched_lock);
 
 AST_MUTEX_DEFINE_STATIC(cdr_batch_lock);
 
@@ -1300,17 +1302,24 @@
 {
 	ast_cdr_submit_batch(0);
 	/* manually reschedule from this point in time */
+	ast_mutex_lock(&cdr_sched_lock);
 	cdr_sched = ast_sched_add(sched, batchtime * 1000, submit_scheduled_batch, NULL);
+	ast_mutex_unlock(&cdr_sched_lock);
 	/* returning zero so the scheduler does not automatically reschedule */
 	return 0;
 }
 
+/*! Do not hold the batch lock while calling this function */
 static void submit_unscheduled_batch(void)
 {
+	/* Prevent two deletes from happening at the same time */
+	ast_mutex_lock(&cdr_sched_lock);
 	/* this is okay since we are not being called from within the scheduler */
 	AST_SCHED_DEL(sched, cdr_sched);
 	/* schedule the submission to occur ASAP (1 ms) */
 	cdr_sched = ast_sched_add(sched, 1, submit_scheduled_batch, NULL);
+	ast_mutex_unlock(&cdr_sched_lock);
+
 	/* signal the do_cdr thread to wakeup early and do some work (that lazy thread ;) */
 	ast_mutex_lock(&cdr_pending_lock);
 	ast_cond_signal(&cdr_pending_cond);
@@ -1321,6 +1330,7 @@
 {
 	struct ast_cdr_batch_item *newtail;
 	int curr;
+	int submit_batch = 0;
 
 	if (!cdr)
 		return;
@@ -1367,10 +1377,14 @@
 
 	/* if we have enough stuff to post, then do it */
 	if (curr >= (batchsize - 1)) {
+		submit_batch = 1;
+	}
+	ast_mutex_unlock(&cdr_batch_lock);
+
+	/* Don't call submit_unscheduled_batch with the cdr_batch_lock held */
+	if (submit_batch) {
 		submit_unscheduled_batch();
 	}
-
-	ast_mutex_unlock(&cdr_batch_lock);
 }
 
 static void *do_cdr(void *data)
@@ -1522,7 +1536,9 @@
 	}
 
 	/* don't run the next scheduled CDR posting while reloading */
+	ast_mutex_lock(&cdr_sched_lock);
 	AST_SCHED_DEL(sched, cdr_sched);
+	ast_mutex_unlock(&cdr_sched_lock);
 
 	if (config) {
 		if ((enabled_value = ast_variable_retrieve(config, "general", "enable"))) {
@@ -1565,7 +1581,9 @@
 	if (enabled && !batchmode) {
 		ast_log(LOG_NOTICE, "CDR simple logging enabled.\n");
 	} else if (enabled && batchmode) {
+		ast_mutex_lock(&cdr_sched_lock);
 		cdr_sched = ast_sched_add(sched, batchtime * 1000, submit_scheduled_batch, NULL);
+		ast_mutex_unlock(&cdr_sched_lock);
 		ast_log(LOG_NOTICE, "CDR batch mode logging enabled, first of either size %d or time %d seconds.\n", batchsize, batchtime);
 	} else {
 		ast_log(LOG_NOTICE, "CDR logging disabled, data will be lost.\n");
@@ -1577,7 +1595,9 @@
 		ast_cond_init(&cdr_pending_cond, NULL);
 		if (ast_pthread_create_background(&cdr_thread, NULL, do_cdr, NULL) < 0) {
 			ast_log(LOG_ERROR, "Unable to start CDR thread.\n");
+			ast_mutex_lock(&cdr_sched_lock);
 			AST_SCHED_DEL(sched, cdr_sched);
+			ast_mutex_unlock(&cdr_sched_lock);
 		} else {
 			ast_cli_register(&cli_submit);
 			ast_register_atexit(ast_cdr_engine_term);

Modified: tags/1.8.21.0-rc2/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/tags/1.8.21.0-rc2/main/rtp_engine.c?view=diff&rev=383969&r1=383968&r2=383969
==============================================================================
--- tags/1.8.21.0-rc2/main/rtp_engine.c (original)
+++ tags/1.8.21.0-rc2/main/rtp_engine.c Wed Mar 27 08:52:47 2013
@@ -1273,6 +1273,7 @@
 	enum ast_rtp_dtmf_mode dmode;
 	format_t codec0 = 0, codec1 = 0;
 	int unlock_chans = 1;
+	int read_ptime0, read_ptime1, write_ptime0, write_ptime1;
 
 	/* Lock both channels so we can look for the glue that binds them together */
 	ast_channel_lock(c0);
@@ -1348,6 +1349,18 @@
 	codec1 = glue1->get_codec ? glue1->get_codec(c1) : 0;
 	if (codec0 && codec1 && !(codec0 & codec1)) {
 		ast_debug(1, "Channel codec0 = %s is not codec1 = %s, cannot native bridge in RTP.\n", ast_getformatname(codec0), ast_getformatname(codec1));
+		res = AST_BRIDGE_FAILED_NOWARN;
+		goto done;
+	}
+
+	read_ptime0 = (ast_codec_pref_getsize(&instance0->codecs.pref, c0->rawreadformat)).cur_ms;
+	read_ptime1 = (ast_codec_pref_getsize(&instance1->codecs.pref, c1->rawreadformat)).cur_ms;
+	write_ptime0 = (ast_codec_pref_getsize(&instance0->codecs.pref, c0->rawwriteformat)).cur_ms;
+	write_ptime1 = (ast_codec_pref_getsize(&instance1->codecs.pref, c1->rawwriteformat)).cur_ms;
+
+	if (read_ptime0 != write_ptime1 || read_ptime1 != write_ptime0) {
+		ast_debug(1, "Packetization differs between RTP streams (%d != %d or %d != %d). Cannot native bridge in RTP\n",
+				read_ptime0, write_ptime1, read_ptime1, write_ptime0);
 		res = AST_BRIDGE_FAILED_NOWARN;
 		goto done;
 	}




More information about the asterisk-commits mailing list