mod_conference add conference_max_members channel variable that can be set on the first channel calling a conference to override the profiles max-members param

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16597 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2010-02-10 04:50:31 +00:00
parent abbfdbd7e5
commit 36b0bfbb4b
1 changed files with 15 additions and 0 deletions

View File

@ -5234,6 +5234,8 @@ SWITCH_STANDARD_APP(conference_function)
/* if the conference exists, get the pointer to it */
if (!conference) {
const char *max_members_str;
/* couldn't find the conference, create one */
conference = conference_new(conf_name, xml_cfg, NULL);
@ -5260,6 +5262,19 @@ SWITCH_STANDARD_APP(conference_function)
/* Set the minimum number of members (once you go above it you cannot go below it) */
conference->min = 1;
/* check for variable used to specify override for max_members */
if (!zstr(max_members_str = switch_channel_get_variable(channel, "conference_max_members"))) {
uint32_t max_members_val;
errno = 0; /* sanity first */
max_members_val = strtol(max_members_str, NULL, 0); /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */
if (errno == ERANGE || errno == EINVAL || max_members_val < 0 || max_members_val == 1) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
"conference_max_members variable %s is invalid, not setting a limit\n", max_members_str);
} else {
conference->max_members = max_members_val;
}
}
/* Indicate the conference is dynamic */
switch_set_flag_locked(conference, CFLAG_DYNAMIC);