From 3695bdd9e4e0d925ab7296d2f4ce120bf656f623 Mon Sep 17 00:00:00 2001 From: Hristo Trendev Date: Wed, 24 Sep 2014 14:55:50 +0200 Subject: [PATCH] set conference flags from a dial plan variable or via +flags{ } This patch allows conference flags to be set dynamically from the dial plan by either passing them to the conference application in the +flags{ } string or by setting the "conference_flags" dial plan variable. The +flags{ } string is currently used to set *user* flags only. This patch changes this by allowing the +flags{ } string to contain conference related flags as well (for example wait_mod). It shouldn't be a problem to pass both types of flags via +flags{ } as long as the user and conference flag names are kept unique. FS-5099 #resolve --- .../applications/mod_conference/mod_conference.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index c431f11286..9ac4dd18ae 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -9066,6 +9066,7 @@ SWITCH_STANDARD_APP(conference_function) char *profile_name = NULL; switch_xml_t cxml = NULL, cfg = NULL, profiles = NULL; const char *flags_str, *v_flags_str; + const char *cflags_str, *v_cflags_str; member_flag_t mflags = 0; switch_core_session_message_t msg = { 0 }; uint8_t rl = 0, isbr = 0; @@ -9129,6 +9130,16 @@ SWITCH_STANDARD_APP(conference_function) } } + cflags_str = flags_str; + + if ((v_cflags_str = switch_channel_get_variable(channel, "conference_flags"))) { + if (zstr(cflags_str)) { + cflags_str = v_cflags_str; + } else { + cflags_str = switch_core_session_sprintf(session, "%s|%s", cflags_str, v_cflags_str); + } + } + /* is this a bridging conference ? */ if (!strncasecmp(mydata, bridge_prefix, strlen(bridge_prefix))) { isbr = 1; @@ -9219,6 +9230,8 @@ SWITCH_STANDARD_APP(conference_function) goto done; } + set_cflags(cflags_str, &conference->flags); + if (locked) { switch_mutex_unlock(globals.setup_mutex); locked = 0; @@ -9294,6 +9307,8 @@ SWITCH_STANDARD_APP(conference_function) goto done; } + set_cflags(cflags_str, &conference->flags); + if (locked) { switch_mutex_unlock(globals.setup_mutex); locked = 0;