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

FreeSWITCH SVN anthm at freeswitch.org
Tue Feb 10 16:22:41 PST 2009


Author: anthm
Date: Tue Feb 10 18:22:41 2009
New Revision: 11740

Log:
add {instant_ringback=true} to make ringback not wait for indication to generate ringback

Modified:
   freeswitch/trunk/src/switch_ivr_originate.c

Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c	(original)
+++ freeswitch/trunk/src/switch_ivr_originate.c	Tue Feb 10 18:22:41 2009
@@ -97,6 +97,7 @@
 	char key[80];
 	uint8_t early_ok;
 	uint8_t ring_ready;
+	uint8_t instant_ringback;
 	uint8_t sent_ring;
 	uint8_t progress;
 	uint8_t return_ring_ready;
@@ -1024,6 +1025,8 @@
 					ok = 1;
 				} else if (!strcasecmp((char *) hi->name, "ring_ready")) {
 					ok = 1;
+				} else if (!strcasecmp((char *) hi->name, "instant_ringback")) {
+					ok = 1;
 				} else if (!strcasecmp((char *) hi->name, "originate_retries")) {
 					ok = 1;
 				} else if (!strcasecmp((char *) hi->name, "originate_timeout")) {
@@ -1155,6 +1158,10 @@
 		oglobals.ring_ready = 1;
 	}
 
+	if ((var_val = switch_event_get_header(var_event, "instant_ringback")) && switch_true(var_val)) {
+		oglobals.instant_ringback = 1;
+	}
+
 	if ((var_val = switch_event_get_header(var_event, "originate_timeout"))) {
 		int tmp = atoi(var_val);
 		if (tmp > 0) {
@@ -1762,7 +1769,7 @@
 						read_frame = NULL;
 					}
 					
-					if (oglobals.ring_ready && read_frame && !pass) {
+					if ((oglobals.ring_ready || oglobals.instant_ringback) && read_frame && !pass) {
 						if (ringback.fh) {
 							switch_size_t mlen, olen;
 							unsigned int pos = 0;



More information about the Freeswitch-svn mailing list