[asterisk-commits] tilghman: trunk r86277 - /trunk/res/res_musiconhold.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Oct 18 02:12:19 CDT 2007


Author: tilghman
Date: Thu Oct 18 02:12:18 2007
New Revision: 86277

URL: http://svn.digium.com/view/asterisk?view=rev&rev=86277
Log:
On reload, re-read the files in the specified moh directory (closes issue #10536)

Modified:
    trunk/res/res_musiconhold.c

Modified: trunk/res/res_musiconhold.c
URL: http://svn.digium.com/view/asterisk/trunk/res/res_musiconhold.c?view=diff&rev=86277&r1=86276&r2=86277
==============================================================================
--- trunk/res/res_musiconhold.c (original)
+++ trunk/res/res_musiconhold.c Thu Oct 18 02:12:18 2007
@@ -887,6 +887,23 @@
 	return class->total_files;
 }
 
+static int moh_diff(struct mohclass *old, struct mohclass *new)
+{
+	if (!old || !new)
+		return -1;
+
+	if (strcmp(old->dir, new->dir))
+		return -1;
+	else if (strcmp(old->mode, new->mode))
+		return -1;
+	else if (strcmp(old->args, new->args))
+		return -1;
+	else if (old->flags != new->flags)
+		return -1;
+
+	return 0;
+}
+
 static int moh_register(struct mohclass *moh, int reload)
 {
 #ifdef HAVE_ZAPTEL
@@ -895,7 +912,7 @@
 	struct mohclass *mohclass = NULL;
 
 	AST_RWLIST_WRLOCK(&mohclasses);
-	if ((mohclass = get_mohbyname(moh->name, 0))) {
+	if ((mohclass = get_mohbyname(moh->name, 0)) && !moh_diff(mohclass, moh)) {
 		mohclass->delete = 0;
 		if (reload) {
 			ast_debug(1, "Music on Hold class '%s' left alone from initial load.\n", moh->name);




More information about the asterisk-commits mailing list