[Freeswitch-svn] [commit] r7094 - freeswitch/trunk/src

Freeswitch SVN anthm at freeswitch.org
Sat Jan 5 09:58:26 EST 2008


Author: anthm
Date: Sat Jan  5 09:58:26 2008
New Revision: 7094

Modified:
   freeswitch/trunk/src/switch_ivr_originate.c

Log:
update

Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c	(original)
+++ freeswitch/trunk/src/switch_ivr_originate.c	Sat Jan  5 09:58:26 2008
@@ -549,7 +549,7 @@
 	char *var_val, *vars = NULL;
 	const char *ringback_data = NULL;
 	switch_codec_t *read_codec = NULL;
-	uint8_t sent_ring = 0, early_ok = 1;
+	uint8_t sent_ring = 0, early_ok = 1, return_ring_ready = 0;
 	switch_core_session_message_t *message = NULL;
 	switch_event_t *var_event = NULL;
 	uint8_t fail_on_single_reject = 0;
@@ -627,6 +627,8 @@
 					ok = 1;
 				} else if (!strcasecmp((char *)hi->name, "ignore_early_media")) {
 					ok = 1;
+				} else if (!strcasecmp((char *)hi->name, "return_ring_ready")) {
+					ok = 1;
 				} else if (!strcasecmp((char *)hi->name, "originate_retries")) {
 					ok = 1;
 				} else if (!strcasecmp((char *)hi->name, "originate_retry_sleep_ms")) {
@@ -708,6 +710,10 @@
 		early_ok = 0;
 	}
 
+	if ((var_val = switch_event_get_header(var_event, "return_ring_ready")) && switch_true(var_val)) {
+		return_ring_ready = 1;
+	}
+
 	if ((var_val = switch_event_get_header(var_event, "originate_retries")) && switch_true(var_val)) {
 		int32_t tmp;
 		tmp = atoi(var_val);
@@ -1108,6 +1114,11 @@
 						break;
 					}
 					
+					if (ring_ready && return_ring_ready) {
+						status = SWITCH_STATUS_SUCCESS;
+						goto done;
+					}
+
 					if (ring_ready && read_frame && !pass) {
 						if (ringback.fh) {
 							uint8_t abuf[1024];



More information about the Freeswitch-svn mailing list