[Freeswitch-svn] [commit] r5307 - in freeswitch/trunk: conf src/mod/applications/mod_conference
Freeswitch SVN
anthm at freeswitch.org
Mon Jun 11 17:44:42 EDT 2007
Author: anthm
Date: Mon Jun 11 17:44:41 2007
New Revision: 5307
Modified:
freeswitch/trunk/conf/conference.conf.xml
freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
Log:
add perpetual-sound option to conference
Modified: freeswitch/trunk/conf/conference.conf.xml
==============================================================================
--- freeswitch/trunk/conf/conference.conf.xml (original)
+++ freeswitch/trunk/conf/conference.conf.xml Mon Jun 11 17:44:41 2007
@@ -62,6 +62,8 @@
<!--<param name="unmuted-sound" value="unmuted.wav"/>-->
<!-- File to play if you are alone in the conference -->
<!--<param name="alone-sound" value="yactopitc.wav"/>-->
+ <!-- File to play endlessly (nobody will ever be able to talk) -->
+ <!--<param name="perpetual-sound" value="music.wav"/>-->
<!-- File to play when you join the conference -->
<!--<param name="enter-sound" value="welcome.wav"/>-->
<!-- File to play when you leave the conference -->
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 Mon Jun 11 17:44:41 2007
@@ -175,6 +175,7 @@
char *enter_sound;
char *exit_sound;
char *alone_sound;
+ char *perpetual_sound;
char *ack_sound;
char *nack_sound;
char *muted_sound;
@@ -516,7 +517,7 @@
if (conference->count >= conference->anounce_count && conference->anounce_count > 1) {
snprintf(msg, sizeof(msg), "There are %d callers", conference->count);
conference_member_say(member, msg, CONF_DEFAULT_LEADIN);
- } else if (conference->count == 1) {
+ } else if (conference->count == 1 && !conference->perpetual_sound) {
if (conference->alone_sound) {
conference_play_file(conference, conference->alone_sound, CONF_DEFAULT_LEADIN, switch_core_session_get_channel(member->session), 0);
} else {
@@ -684,6 +685,10 @@
switch_size_t file_data_len = samples * 2;
int has_file_data = 0;
+ if (conference->perpetual_sound && !conference->fnode) {
+ conference_play_file(conference, conference->perpetual_sound, CONF_DEFAULT_LEADIN, NULL, 0);
+ }
+
/* Sync the conference to a single timing source */
if (switch_core_timer_next(&timer) != SWITCH_STATUS_SUCCESS) {
switch_set_flag(conference, CFLAG_DESTRUCT);
@@ -4536,6 +4541,7 @@
char *caller_id_number = NULL;
char *caller_controls = NULL;
char *member_flags = NULL;
+ char *perpetual_sound = NULL;
uint32_t max_members = 0;
uint32_t anounce_count = 0;
char *maxmember_sound = NULL;
@@ -4583,6 +4589,8 @@
exit_sound = val;
} else if (!strcasecmp(var, "alone-sound")) {
alone_sound = val;
+ } else if (!strcasecmp(var, "perpetual-sound")) {
+ perpetual_sound = val;
} else if (!strcasecmp(var, "ack-sound")) {
ack_sound = val;
} else if (!strcasecmp(var, "nack-sound")) {
@@ -4696,7 +4704,13 @@
conference->caller_id_name = switch_core_strdup(conference->pool, caller_id_name);
conference->caller_id_number = switch_core_strdup(conference->pool, caller_id_number);
- conference->mflags = MFLAG_CAN_SPEAK | MFLAG_CAN_HEAR;
+
+ if (!switch_strlen_zero(perpetual_sound)) {
+ conference->perpetual_sound = switch_core_strdup(conference->pool, perpetual_sound);
+ conference->mflags = MFLAG_CAN_HEAR;
+ } else {
+ conference->mflags = MFLAG_CAN_SPEAK | MFLAG_CAN_HEAR;
+ }
if (member_flags) {
set_mflags(member_flags, &conference->mflags);
More information about the Freeswitch-svn
mailing list