channel = switch_core_session_get_channel(member->session);
if (!new_conference) {
- switch_mutex_lock(globals.setup_mutex);
- locked = 1;
+ if (!locked) {
+ switch_mutex_lock(globals.setup_mutex);
+ locked = 1;
+ }
+
+ if ((new_conference = conference_find(conf_name))) {
+ if (locked) {
+ switch_mutex_unlock(globals.setup_mutex);
+ locked = 0;
+ }
+ }
if (!(new_conference = conference_find(conf_name))) {
/* build a new conference if it doesn't exist */
xml_cfg.profile = switch_xml_find_child(profiles, "profile", "name", profile_name);
}
- if (!xml_cfg.profile) {
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Cannot find profile: %s\n", profile_name);
- switch_xml_free(cxml);
- cxml = NULL;
- goto done;
- }
-
xml_cfg.controls = switch_xml_child(cfg, "caller-controls");
/* Release the config registry handle */
goto done;
}
- switch_mutex_unlock(globals.setup_mutex);
- locked = 0;
+ if (locked) {
+ switch_mutex_unlock(globals.setup_mutex);
+ locked = 0;
+ }
/* Set the minimum number of members (once you go above it you cannot go below it) */
new_conference->min = 1;
/* if this is a bridging call, and it's not a duplicate, build a */
/* conference object, and skip pin handling, and locked checking */
- switch_mutex_lock(globals.setup_mutex);
- locked = 1;
+ if (!locked) {
+ switch_mutex_lock(globals.setup_mutex);
+ locked = 1;
+ }
if (isbr) {
char *uuid = switch_core_session_get_uuid(session);
goto done;
}
- switch_mutex_unlock(globals.setup_mutex);
- locked = 0;
+ if (locked) {
+ switch_mutex_unlock(globals.setup_mutex);
+ locked = 0;
+ }
switch_channel_set_variable(channel, "conference_name", conference->name);
enforce_security = switch_true(pvar);
}
+ if ((conference = conference_find(conf_name))) {
+ if (locked) {
+ switch_mutex_unlock(globals.setup_mutex);
+ locked = 0;
+ }
+ }
+
/* if the conference exists, get the pointer to it */
- if (!(conference = conference_find(conf_name))) {
+ if (!conference) {
/* couldn't find the conference, create one */
conference = conference_new(conf_name, xml_cfg, NULL);
goto done;
}
- switch_mutex_unlock(globals.setup_mutex);
- locked = 0;
+ if (locked) {
+ switch_mutex_unlock(globals.setup_mutex);
+ locked = 0;
+ }
switch_channel_set_variable(channel, "conference_name", conference->name);