From cdb00f132b055be4d8c4e7e5fafa42aca89278e3 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 25 Oct 2011 14:09:49 -0500 Subject: [PATCH] maxwait --- .../mod_conference/mod_conference.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 41f4450105..5fb7aec1a1 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -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)) {