Revision
15179
Author
anthm
Date
2009-10-19 18:19:37 -0500 (Mon, 19 Oct 2009)

Log Message

prevent unsolicted ring_ready

Modified Paths

Diff

Modified: freeswitch/trunk/src/switch_ivr_originate.c (15178 => 15179)


--- freeswitch/trunk/src/switch_ivr_originate.c	2009-10-19 22:36:44 UTC (rev 15178)
+++ freeswitch/trunk/src/switch_ivr_originate.c	2009-10-19 23:19:37 UTC (rev 15179)
@@ -386,6 +386,7 @@
 				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 @@
 						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 @@
 			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);