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

Freeswitch SVN anthm at freeswitch.org
Wed Sep 19 12:20:00 EDT 2007


Author: anthm
Date: Wed Sep 19 12:20:00 2007
New Revision: 5714

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

Log:
add endconf member flag to make a specific member cause the conference to end when he leaves

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 Sep 19 12:20:00 2007
@@ -131,7 +131,8 @@
 	MFLAG_NOCHANNEL = (1 << 5),
 	MFLAG_INTREE = (1 << 6),
 	MFLAG_WASTE_BANDWIDTH = (1 << 7),
-	MFLAG_FLUSH_BUFFER = (1 << 8)
+	MFLAG_FLUSH_BUFFER = (1 << 8),
+	MFLAG_ENDCONF = (1 << 9)
 } member_flag_t;
 
 typedef enum {
@@ -626,6 +627,10 @@
 		member->sh = NULL;
 	}
 
+	if (switch_test_flag(member, MFLAG_ENDCONF)) {
+		switch_set_flag_locked(member->conference, CFLAG_DESTRUCT);
+	}
+
 	member->conference = NULL;
 
 	if (!switch_test_flag(member, MFLAG_NOCHANNEL)) {
@@ -3903,6 +3908,8 @@
 			*f &= ~MFLAG_CAN_HEAR;
 		} else if (strstr(flags, "waste")) {
 			*f |= MFLAG_WASTE_BANDWIDTH;
+		} else if (strstr(flags, "endconf")) {
+			*f |= MFLAG_ENDCONF;
 		}
 	}
 
@@ -3973,6 +3980,15 @@
 		return;
 	}
 
+	if ((flags_str = strstr(mydata, flags_prefix))) {
+		char *p;
+
+		*flags_str = '\0';
+		flags_str += strlen(flags_prefix);
+		if ((p = strchr(flags_str, '}'))) {
+			*p = '\0';
+		}
+	}
 
 	/* is this a bridging conference ? */
 	if (!strncasecmp(mydata, bridge_prefix, strlen(bridge_prefix))) {
@@ -4269,15 +4285,6 @@
 	/* Install our Signed Linear codec so we get the audio in that format */
 	switch_core_session_set_read_codec(member.session, &member.read_codec);
 
-	if ((flags_str = strstr(mydata, flags_prefix))) {
-		char *p;
-
-		*flags_str = '\0';
-		flags_str += strlen(flags_prefix);
-		if ((p = strchr(flags_str, '}'))) {
-			*p = '\0';
-		}
-	}
 
 	mflags = conference->mflags;
 	set_mflags(flags_str, &mflags);



More information about the Freeswitch-svn mailing list