From 55d01a855c17bdaca2ea273d419f7a24752d4f15 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 1 Apr 2009 13:57:16 +0000 Subject: [PATCH] add conference_enforce_security variable to bypass or require pin or locked flag git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12863 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/mod/applications/mod_conference/mod_conference.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 304ea201cb..c2f722ad6b 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -4727,6 +4727,13 @@ SWITCH_STANDARD_APP(conference_function) 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 @@ SWITCH_STANDARD_APP(conference_function) 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 @@ SWITCH_STANDARD_APP(conference_function) } /* 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 */