From 6cf983638429e38e4d60b9a7348d67a7ee0bb80f Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Mon, 19 Oct 2009 23:19:37 +0000 Subject: [PATCH] prevent unsolicted ring_ready git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15179 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- src/switch_ivr_originate.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/switch_ivr_originate.c b/src/switch_ivr_originate.c index 67cb3f873c..ca4e11eb0f 100644 --- a/src/switch_ivr_originate.c +++ b/src/switch_ivr_originate.c @@ -386,6 +386,7 @@ static uint8_t check_channel_status(originate_global_t *oglobals, originate_stat oglobals->ring_ready = 1; if (caller_channel && !oglobals->ignore_ring_ready) { switch_channel_ring_ready(caller_channel); + oglobals->sent_ring = 1; } } } @@ -1828,7 +1829,8 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess goto notready; } - if (!oglobals.sent_ring && !oglobals.progress && (progress_timelimit_sec && elapsed > (time_t) progress_timelimit_sec)) { + if (!oglobals.sent_ring && !oglobals.ignore_ring_ready && + !oglobals.progress && (progress_timelimit_sec && elapsed > (time_t) progress_timelimit_sec)) { to++; oglobals.idx = IDX_TIMEOUT; goto notready; @@ -1977,11 +1979,6 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_originate(switch_core_session_t *sess while ((!caller_channel || switch_channel_ready(caller_channel) || switch_channel_test_flag(caller_channel, CF_XFER_ZOMBIE)) && check_channel_status(&oglobals, originate_status, and_argc)) { time_t elapsed = switch_epoch_time_now(NULL) - start; - if (caller_channel && !oglobals.sent_ring && oglobals.ring_ready && !oglobals.return_ring_ready) { - switch_channel_ring_ready(caller_channel); - oglobals.sent_ring = 1; - } - /* 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(&oglobals, originate_status, and_argc, start);