]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
maxwait
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 25 Oct 2011 19:09:49 +0000 (14:09 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 25 Oct 2011 19:09:49 +0000 (14:09 -0500)
src/mod/applications/mod_conference/mod_conference.c

index 41f44501056e6ea4781f4499340b8ce7692d6fed..5fb7aec1a1d7b5b3d195d91151a771ccc72d5207 100644 (file)
@@ -2790,7 +2790,10 @@ static void conference_loop_output(conference_member_t *member)
                const char *profile = switch_channel_get_variable(channel, "conference_auto_outcall_profile");
                const char *ann = switch_channel_get_variable(channel, "conference_auto_outcall_announce");
                const char *prefix = switch_channel_get_variable(channel, "conference_auto_outcall_prefix");
+               const char *maxwait = switch_channel_get_variable(channel, "conference_auto_outcall_maxwait");
                int to = 60;
+               int wait_sec = 2;
+               int loops = 0;
 
                if (ann && !switch_channel_test_app_flag_key("conf_silent", channel, CONF_SILENT_REQ)) {
                        member->conference->special_announce = switch_core_strdup(member->conference->pool, ann);
@@ -2825,10 +2828,20 @@ static void conference_loop_output(conference_member_t *member)
                        switch_safe_free(cpstr);
                }
 
+               if (maxwait) {
+                       int tmp = atoi(maxwait);
+                       if (tmp > 0) {
+                               wait_sec = tmp;
+                       }
+               }
+
+
+               loops = wait_sec * 10;
+               
                switch_channel_set_app_flag(channel, CF_APP_TAGGED);
                do {
-                       switch_ivr_sleep(member->session, 500, SWITCH_TRUE, NULL);
-               } while(switch_channel_up(channel) && member->conference->originating);
+                       switch_ivr_sleep(member->session, 100, SWITCH_TRUE, NULL);
+               } while(switch_channel_up(channel) && (member->conference->originating && --loops));
                switch_channel_clear_app_flag(channel, CF_APP_TAGGED);
 
                if (!switch_channel_ready(channel)) {