Revision
16314
Author
anthm
Date
2010-01-14 15:31:40 -0600 (Thu, 14 Jan 2010)

Log Message

FSCORE-527

Modified Paths

Diff

Modified: freeswitch/trunk/src/switch_ivr_originate.c (16313 => 16314)


--- freeswitch/trunk/src/switch_ivr_originate.c	2010-01-14 21:02:11 UTC (rev 16313)
+++ freeswitch/trunk/src/switch_ivr_originate.c	2010-01-14 21:31:40 UTC (rev 16314)
@@ -235,7 +235,8 @@
 static int check_per_channel_timeouts(originate_global_t *oglobals,
 									  originate_status_t *originate_status, 
 									  int max,
-									  time_t start)
+									  time_t start,
+									  switch_call_cause_t *force_reason)
 {
 	int x = 0,i,delayed_channels=0,active_channels=0;
 	uint32_t early_exit_time=0, delayed_min=0;
@@ -304,6 +305,7 @@
 				  )
 				) {
 				switch_channel_hangup(originate_status[i].peer_channel, SWITCH_CAUSE_PROGRESS_TIMEOUT);
+				*force_reason = SWITCH_CAUSE_PROGRESS_TIMEOUT;
 				x++;
 			}
 			if (originate_status[i].per_channel_timelimit_sec && elapsed > originate_status[i].per_channel_timelimit_sec) {
@@ -2444,13 +2446,14 @@
 						!oglobals.progress && (progress_timelimit_sec && elapsed > (time_t) progress_timelimit_sec)) {
 						to++;
 						oglobals.idx = IDX_TIMEOUT;
+						force_reason = SWITCH_CAUSE_PROGRESS_TIMEOUT;
 						goto notready;
 					}
 					
 					switch_cond_next();
 				}
 
-				check_per_channel_timeouts(&oglobals, originate_status, and_argc, start);
+				check_per_channel_timeouts(&oglobals, originate_status, and_argc, start, &force_reason);
 
 
 				if (valid_channels == 0) {
@@ -2498,7 +2501,7 @@
 					goto notready;
 				}
 
-				check_per_channel_timeouts(&oglobals, originate_status, and_argc, start);
+				check_per_channel_timeouts(&oglobals, originate_status, and_argc, start, &force_reason);
 
 				if (oglobals.session) {
 					switch_ivr_parse_all_events(oglobals.session);