[Freeswitch-svn] [commit] r4418 - in freeswitch/trunk/src: . mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Thu Mar 1 11:11:09 EST 2007


Author: anthm
Date: Thu Mar  1 11:11:08 2007
New Revision: 4418

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/trunk/src/switch_ivr.c

Log:
add patch to fix stun issue

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Thu Mar  1 11:11:08 2007
@@ -365,7 +365,7 @@
 
 static switch_status_t tech_choose_port(private_object_t *tech_pvt);
 
-static void do_invite(switch_core_session_t *session);
+static switch_status_t do_invite(switch_core_session_t *session);
 
 static uint8_t negotiate_sdp(switch_core_session_t *session, sdp_session_t *sdp);
 
@@ -889,7 +889,7 @@
 		tech_pvt = switch_core_session_get_private(*session);
 
 		if (tech_pvt) {
-			if (state > CS_INIT && state < CS_HANGUP) {
+			if (state < CS_HANGUP) {
 				switch_channel_hangup(channel, cause);
 			}
 			
@@ -960,7 +960,7 @@
 	return SWITCH_STATUS_SUCCESS;
 }
 
-static void do_invite(switch_core_session_t *session)
+static switch_status_t do_invite(switch_core_session_t *session)
 {
 	char rpid[1024] = { 0 };
 	char alert_info[1024] = { 0 };
@@ -979,6 +979,7 @@
 	void *vval;
 	char *extra_headers = NULL;
 	const void *vvar;
+	switch_status_t status = SWITCH_STATUS_FALSE;
 
     channel = switch_core_session_get_channel(session);
     assert(channel != NULL);
@@ -1010,7 +1011,7 @@
 		}
 
 		if (tech_choose_port(tech_pvt) != SWITCH_STATUS_SUCCESS) {
-            return;
+            return status;
         }
         
 		set_local_sdp(tech_pvt, NULL, 0, NULL, 0);
@@ -1108,9 +1109,12 @@
 				   TAG_END());
 		
 		switch_safe_free(stream.data);
+		status = SWITCH_STATUS_SUCCESS;
 	} else {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Memory Error!\n");
 	}
+
+	return status;
 	
 }
 
@@ -1230,7 +1234,9 @@
 	}
 
 	if (switch_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
-		do_invite(session);
+		if (do_invite(session) != SWITCH_STATUS_SUCCESS) {
+			return SWITCH_STATUS_FALSE;
+		}
 	}
 	
 	/* Move Channel's State Machine to RING */

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Thu Mar  1 11:11:08 2007
@@ -2795,7 +2795,9 @@
 				valid_channels++;
 				state = switch_channel_get_state(peer_channels[i]);
 			
-				if (state >= CS_RING) {
+				if (state >= CS_HANGUP) {
+					goto notready;
+				} else if (state >= CS_RING) {
 					goto endfor1;
 				}
 		



More information about the Freeswitch-svn mailing list