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

Freeswitch SVN anthm at freeswitch.org
Tue Jun 24 18:14:48 EDT 2008


Author: anthm
Date: Tue Jun 24 18:14:47 2008
New Revision: 8834

Modified:
   freeswitch/trunk/src/switch_ivr_originate.c

Log:
fix small originate issues

Modified: freeswitch/trunk/src/switch_ivr_originate.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr_originate.c	(original)
+++ freeswitch/trunk/src/switch_ivr_originate.c	Tue Jun 24 18:14:47 2008
@@ -771,7 +771,6 @@
 			pass = 0;
 			var = NULL;
 			to = 0;
-			progress_timelimit_sec = 0;
 			sent_ring = 0;
 			progress = 0;
 
@@ -1017,7 +1016,7 @@
 						goto notready;
 					}
 
-					if (!sent_ring && !progress && (switch_timestamp(NULL) - start) > (time_t) progress_timelimit_sec) {
+					if (!sent_ring && !progress && progress_timelimit_sec && (switch_timestamp(NULL) - start) > (time_t) progress_timelimit_sec) {
 						to++;
 						idx = IDX_TIMEOUT;
 						goto notready;
@@ -1417,9 +1416,14 @@
 					continue;
 				}
 				switch_channel_clear_flag(peer_channels[i], CF_ORIGINATING);
-				if (status == SWITCH_STATUS_SUCCESS && bleg && *bleg && *bleg == peer_sessions[i]) {
-					continue;
+				if (status == SWITCH_STATUS_SUCCESS) { 
+					if (bleg && *bleg && *bleg == peer_sessions[i]) {
+						continue;
+					}
+				} else if (switch_channel_get_state(switch_core_session_get_channel(peer_sessions[i])) < CS_HANGUP) {
+					switch_channel_hangup(switch_core_session_get_channel(peer_sessions[i]), *cause);
 				}
+
 				switch_core_session_rwunlock(peer_sessions[i]);
 			}
 



More information about the Freeswitch-svn mailing list