El 10/04/15 a las 14:16, Alex Villací­s Lasso escribió:
El 08/04/15 a las 08:22, Vinicius Fontes escribió:
Have you tried Asterisk 13? The bridging mechanism has been completely rewritten on Asterisk 12, so there's no longer channel masquerading and zombie channels. Might be worth a try.

Sorry, this client is very hard to talk into stopping its operations long enough to install changes, let alone a major Asterisk version change. I already had trouble convincing him of the need to install a debugging version with DEBUG_THREADS enabled.
After reviewing a "core show locks" output, I am very sure I have hit an Asterisk bug involving a deadlock in cdr_mysql . When doing a "core reload" on the CLI, cdr_mysql calls ast_cdr_unregister() with its internal lock held (mysql_lock). However, writing a CDR involves adquiring the cdr lock and then the internal lock. Therefore, deadlock. None of the other cdr modules does that.

However, I know that cdr_mysql is currently deprecated for Asterisk 11. I have a patch to fix the issue mentioned above (attached), but I want to know how to get it reviewed, if only to see whether the fix is sane.
diff -ur asterisk-11.17.0-bak/addons/cdr_mysql.c asterisk-11.17.0/addons/cdr_mysql.c
--- asterisk-11.17.0-bak/addons/cdr_mysql.c	2015-04-11 15:43:02.231033422 -0500
+++ asterisk-11.17.0/addons/cdr_mysql.c	2015-04-11 15:51:33.483522241 -0500
@@ -382,7 +382,9 @@
 	}
 
 	dbport = 0;
-	ast_cdr_unregister(name);
+	if (!reload) {
+		ast_cdr_unregister(name);
+	}
 	
 	return 0;
 }
@@ -658,7 +660,7 @@
 		return AST_MODULE_LOAD_FAILURE;
 	}
 
-	res = ast_cdr_register(name, desc, mysql_log);
+	res = reload ? 0 : ast_cdr_register(name, desc, mysql_log);
 	if (res) {
 		ast_log(LOG_ERROR, "Unable to register MySQL CDR handling\n");
 	} else {
-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

Reply via email to