From 478efc5f714c3999000f4e4980ccbf333d935f5c Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 3 Feb 2009 20:33:24 +0000 Subject: [PATCH] tweaks to call setup code git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@11616 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_channel.c | 2 -- src/switch_ivr.c | 2 ++ src/switch_ivr_originate.c | 11 ++++++----- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/switch_channel.c b/src/switch_channel.c index f5722bffe5..e2ec5bb536 100644 --- a/src/switch_channel.c +++ b/src/switch_channel.c @@ -1623,8 +1623,6 @@ SWITCH_DECLARE(switch_status_t) switch_channel_perform_mark_pre_answered(switch_ { switch_event_t *event; - switch_channel_perform_mark_ring_ready(channel, file, func, line); - if (!switch_channel_test_flag(channel, CF_EARLY_MEDIA)) { const char *uuid; switch_core_session_t *other_session; diff --git a/src/switch_ivr.c b/src/switch_ivr.c index 73cd2db849..9edd2a1a61 100644 --- a/src/switch_ivr.c +++ b/src/switch_ivr.c @@ -54,6 +54,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, int sval = 0; const char *var; + /* if (!switch_channel_test_flag(channel, CF_OUTBOUND) && !switch_channel_test_flag(channel, CF_PROXY_MODE) && !switch_channel_media_ready(channel) && !switch_channel_test_flag(channel, CF_SERVICE)) { if ((status = switch_channel_pre_answer(channel)) != SWITCH_STATUS_SUCCESS) { @@ -61,6 +62,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_sleep(switch_core_session_t *session, return SWITCH_STATUS_FALSE; } } + */ if (!switch_channel_media_ready(channel)) { switch_yield(ms * 1000); diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index c54b3314a7..c3adf54abf 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -216,7 +216,8 @@ static void launch_collect_thread(struct key_collect *collect) switch_thread_create(&thread, thd_attr, collect_thread_run, collect, switch_core_session_get_pool(collect->session)); } -static int check_per_channel_timeouts(originate_status_t *originate_status, +static int check_per_channel_timeouts(originate_global_t *oglobals, + originate_status_t *originate_status, int max, time_t start) { @@ -229,7 +230,7 @@ static int check_per_channel_timeouts(originate_status_t *originate_status, !( switch_channel_test_flag(originate_status[i].peer_channel, CF_RING_READY) || switch_channel_test_flag(originate_status[i].peer_channel, CF_ANSWERED) || - switch_channel_test_flag(originate_status[i].peer_channel, CF_EARLY_MEDIA) + (!oglobals->monitor_early_media_ring && switch_channel_test_flag(originate_status[i].peer_channel, CF_EARLY_MEDIA)) ) ) { switch_channel_hangup(originate_status[i].peer_channel, SWITCH_CAUSE_PROGRESS_TIMEOUT); @@ -445,7 +446,7 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat if (!oglobals->progress) { oglobals->progress = 1; } - + if (!oglobals->ring_ready && !oglobals->ignore_ring_ready) { oglobals->ring_ready = 1; } @@ -1533,7 +1534,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess switch_yield(100000); } - check_per_channel_timeouts(originate_status, and_argc, start); + check_per_channel_timeouts(&oglobals, originate_status, and_argc, start); if (valid_channels == 0) { @@ -1662,7 +1663,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess } /* When the AND operator is being used, and fail_on_single_reject is set, a hangup indicates that the call should fail. */ - check_per_channel_timeouts(originate_status, and_argc, start); + check_per_channel_timeouts(&oglobals, originate_status, and_argc, start); if (oglobals.session && switch_core_session_private_event_count(oglobals.session)) { switch_ivr_parse_all_events(oglobals.session);