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

FreeSWITCH SVN anthm at freeswitch.org
Wed Apr 1 06:57:16 PDT 2009


Author: anthm
Date: Wed Apr  1 08:57:16 2009
New Revision: 12863

Log:
add conference_enforce_security variable to bypass or require pin or locked flag

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 Apr  1 08:57:16 2009
@@ -4727,6 +4727,13 @@
 		launch_conference_thread(conference);
 
 	} else {
+		int enforce_security = !switch_channel_test_flag(channel, CF_OUTBOUND);
+		const char *pvar = switch_channel_get_variable(channel, "conference_enforce_security");
+
+		if (pvar) {
+			enforce_security = switch_true(pvar);
+		}
+
 		/* if the conference exists, get the pointer to it */
 		if (!(conference = (conference_obj_t *) switch_core_hash_find(globals.conference_hash, conf_name))) {
 			/* couldn't find the conference, create one */
@@ -4763,7 +4770,7 @@
 		rl++;
 
 		/* if this is not an outbound call, deal with conference pins */
-		if (!switch_channel_test_flag(channel, CF_OUTBOUND) && conference->pin && *(conference->pin)) {
+		if (enforce_security && conference->pin && *(conference->pin)) {
 			char pin_buf[80] = "";
 			int pin_retries = 3;	/* XXX - this should be configurable - i'm too lazy to do it right now... */
 			int pin_valid = 0;
@@ -4815,7 +4822,7 @@
 		}
 
 		/* don't allow more callers if the conference is locked, unless we invited them */
-		if (switch_test_flag(conference, CFLAG_LOCKED) && !switch_channel_test_flag(channel, CF_OUTBOUND)) {
+		if (switch_test_flag(conference, CFLAG_LOCKED) && enforce_security) {
 			switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Conference %s is locked.\n", conf_name);
 			if (conference->locked_sound) {
 				/* Answer the channel */



More information about the Freeswitch-svn mailing list