Revision
15144
Author
anthm
Date
2009-10-12 18:27:01 -0500 (Mon, 12 Oct 2009)

Log Message

doh

Modified Paths

Diff

Modified: freeswitch/trunk/src/switch_ivr.c (15143 => 15144)


--- freeswitch/trunk/src/switch_ivr.c	2009-10-12 22:30:40 UTC (rev 15143)
+++ freeswitch/trunk/src/switch_ivr.c	2009-10-12 23:27:01 UTC (rev 15144)
@@ -640,12 +640,17 @@
 
 SWITCH_DECLARE(switch_status_t) switch_ivr_parse_all_events(switch_core_session_t *session)
 {
+	int x = 0;
 
 
-	while (switch_ivr_parse_next_event(session) == SWITCH_STATUS_SUCCESS);
 	switch_ivr_parse_all_messages(session);
-	switch_ivr_sleep(session, 0, SWITCH_TRUE, NULL);
 
+	while (switch_ivr_parse_next_event(session) == SWITCH_STATUS_SUCCESS) x++;
+
+	if (x) {
+		switch_ivr_sleep(session, 0, SWITCH_TRUE, NULL);
+	}
+
 	return SWITCH_STATUS_SUCCESS;
 }