[Freeswitch-svn] [commit] r10359 - freeswitch/trunk/src/mod/applications/mod_conference

FreeSWITCH SVN mikej at freeswitch.org
Wed Nov 12 06:15:58 PST 2008


Author: mikej
Date: Wed Nov 12 09:15:58 2008
New Revision: 10359

Log:
better sound prefix handling when using say: and allow say: on kick sounds.

Modified:
   freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c

Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	Wed Nov 12 09:15:58 2008
@@ -2259,6 +2259,7 @@
 	switch_memory_pool_t *pool;
 	uint32_t count;
 	char *dfile = NULL, *expanded = NULL;
+	int say = 0;
 
 	switch_assert(conference != NULL);
 
@@ -2279,13 +2280,17 @@
 		}
 	}
 
-	if (!async && !strncasecmp(file, "say:", 4)) {
+	if (!strncasecmp(file, "say:", 4)) {
+		say = 1;
+	}
+
+	if (!async && say) {
 		status = conference_say(conference, file + 4, leadin);
 		goto done;
 	}
 
 	if (!switch_is_file_path(file)) {
-		if (conference->sound_prefix) {
+		if (!say && conference->sound_prefix) {
 			if (!(dfile = switch_mprintf("%s%s%s", conference->sound_prefix, SWITCH_PATH_SEPARATOR, file))) {
 				goto done;
 			}
@@ -4583,16 +4588,22 @@
 		char *toplay = NULL;
 		char *dfile = NULL;
 
-		if (conference->sound_prefix) {
-			dfile = switch_mprintf("%s%s%s", conference->sound_prefix, SWITCH_PATH_SEPARATOR, conference->kicked_sound);
-			switch_assert(dfile);
-			toplay = dfile;
+		if (!strncasecmp(conference->kicked_sound, "say:", 4)) {
+			if (conference->tts_engine && conference->tts_voice) {
+				switch_ivr_speak_text(session, conference->tts_engine, conference->tts_voice, conference->kicked_sound + 4, NULL);
+			}
 		} else {
-			toplay = conference->kicked_sound;
-		}
+			if (conference->sound_prefix) {
+				dfile = switch_mprintf("%s%s%s", conference->sound_prefix, SWITCH_PATH_SEPARATOR, conference->kicked_sound);
+				switch_assert(dfile);
+				toplay = dfile;
+			} else {
+				toplay = conference->kicked_sound;
+			}
 
-		switch_ivr_play_file(session, NULL, toplay, NULL);
-		switch_safe_free(dfile);
+			switch_ivr_play_file(session, NULL, toplay, NULL);
+			switch_safe_free(dfile);
+		}
 	}
 
 	switch_core_session_reset(session, SWITCH_TRUE);



More information about the Freeswitch-svn mailing list