]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4123 --resolve slightly modified patch applied
authorRaymond Chandler <intralanman@gmail.com>
Wed, 10 Jul 2013 21:53:42 +0000 (17:53 -0400)
committerRaymond Chandler <intralanman@gmail.com>
Wed, 10 Jul 2013 21:53:42 +0000 (17:53 -0400)
src/mod/applications/mod_conference/mod_conference.c

index 7abdd9710cb153693b0757d588184c7ca7a00d0b..a841f2d371247a29608c41c4d29907fa6ccecd1e 100644 (file)
@@ -7543,6 +7543,8 @@ SWITCH_STANDARD_APP(conference_function)
                /* if the conference exists, get the pointer to it */
                if (!conference) {
                        const char *max_members_str;
+                       const char *endconf_grace_time_str;
+                       const char *auto_record_str;
 
                        /* couldn't find the conference, create one */
                        conference = conference_new(conf_name, xml_cfg, session, NULL);
@@ -7562,11 +7564,19 @@ SWITCH_STANDARD_APP(conference_function)
                        if (zstr(conference->moh_sound)) {
                                conference->moh_sound = switch_core_strdup(conference->pool, switch_channel_get_variable(channel, "conference_moh_sound"));
                        }
+
                        /* Set perpetual-sound from variable if not set */
                        if (zstr(conference->perpetual_sound)) {
                                conference->perpetual_sound = switch_core_strdup(conference->pool, switch_channel_get_variable(channel, "conference_perpetual_sound"));
                        }
 
+                       /* Override auto-record profile parameter from variable */
+                       if (!zstr(auto_record_str = switch_channel_get_variable(channel, "conference_auto_record"))) {
+                               conference->auto_record = switch_core_strdup(conference->pool, auto_record_str);
+                               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
+                                                                 "conference_auto_record set from variable to %s\n", auto_record_str);
+                       }
+
                        /* Set the minimum number of members (once you go above it you cannot go below it) */
                        conference->min = 1;
 
@@ -7583,6 +7593,21 @@ SWITCH_STANDARD_APP(conference_function)
                                }
                        }
 
+                       /* check for variable to override endconf_grace_time profile value */
+                       if (!zstr(endconf_grace_time_str = switch_channel_get_variable(channel, "conference_endconf_grace_time"))) {
+                               uint32_t grace_time_val;
+                               errno = 0;              /* sanity first */
+                               grace_time_val = strtol(endconf_grace_time_str, NULL, 0);       /* base 0 lets 0x... for hex 0... for octal and base 10 otherwise through */
+                               if (errno == ERANGE || errno == EINVAL || (int32_t) grace_time_val < 0) {
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR,
+                                                                         "conference_endconf_grace_time variable %s is invalid, not setting a time limit\n", endconf_grace_time_str);
+                               } else {
+                                       conference->endconf_grace_time = grace_time_val;
+                                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG,
+                                                                         "conference endconf_grace_time set from variable to %d\n", grace_time_val);
+                               }
+                       }
+
                        /* Indicate the conference is dynamic */
                        switch_set_flag_locked(conference, CFLAG_DYNAMIC);