[asterisk-commits] twilson: trunk r344901 - in /trunk: ./ res/res_musiconhold.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Nov 11 18:36:41 CST 2011


Author: twilson
Date: Fri Nov 11 18:36:37 2011
New Revision: 344901

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=344901
Log:
Don't forget to rescan MOH files for cached realtime classes

Realtime MOH class caching was implemented because without it, you would build
a completely new MOH class and would start the music over at the beginning each
time hold was pressed in a conversation. Unfortunately, this broke re-scanning
for file changes for realtime MOH classes. This patch corrects that issue.

Review: https://reviewboard.asterisk.org/r/1579/
........

Merged revisions 344899 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 344900 from http://svn.asterisk.org/svn/asterisk/branches/10

Modified:
    trunk/   (props changed)
    trunk/res/res_musiconhold.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.

Modified: trunk/res/res_musiconhold.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_musiconhold.c?view=diff&rev=344901&r1=344900&r2=344901
==============================================================================
--- trunk/res/res_musiconhold.c (original)
+++ trunk/res/res_musiconhold.c Fri Nov 11 18:36:37 2011
@@ -1522,11 +1522,20 @@
 			}
 		} else {
 			ast_variables_destroy(var);
+			var = NULL;
 		}
 	}
 
 	if (!mohclass) {
 		return -1;
+	}
+
+	/* If we are using a cached realtime class with files, re-scan the files */
+	if (!var && ast_test_flag(global_flags, MOH_CACHERTCLASSES) && mohclass->realtime && !strcasecmp(mohclass->mode, "files")) {
+		if (!moh_scan_files(mohclass)) {
+			mohclass = mohclass_unref(mohclass, "unreffing potential mohclass (moh_scan_files failed)");
+			return -1;
+		}
 	}
 
 	ast_manager_event(chan, EVENT_FLAG_CALL, "MusicOnHold",




More information about the asterisk-commits mailing list