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

Freeswitch SVN mikej at freeswitch.org
Thu Oct 9 18:44:48 EDT 2008


Author: mikej
Date: Thu Oct  9 18:44:48 2008
New Revision: 9917

Modified:
   freeswitch/trunk/src/switch_rtp.c

Log:
don't autoadjust on break packets sent to ourself

Modified: freeswitch/trunk/src/switch_rtp.c
==============================================================================
--- freeswitch/trunk/src/switch_rtp.c	(original)
+++ freeswitch/trunk/src/switch_rtp.c	Thu Oct  9 18:44:48 2008
@@ -975,7 +975,7 @@
 
 SWITCH_DECLARE(void) switch_rtp_break(switch_rtp_t *rtp_session)
 {
-	char o = 42;
+	int o = 42;
 	switch_size_t len = sizeof(o);
 
 	switch_assert(rtp_session != NULL);
@@ -1267,7 +1267,14 @@
 			goto end;
 		}
 		
-		if (bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && switch_sockaddr_get_port(rtp_session->from_addr)) {
+		if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK)) {
+			switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_BREAK);
+			do_2833(rtp_session);
+			bytes = 0;
+			return_cng_frame();
+		}
+
+		if (bytes > 12 && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_AUTOADJ) && switch_sockaddr_get_port(rtp_session->from_addr)) {
 			const char *tx_host;
 			const char *old_host;
 			char bufa[30], bufb[30];
@@ -1308,13 +1315,6 @@
 			}
 		}
 
-		if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK)) {
-			switch_clear_flag_locked(rtp_session, SWITCH_RTP_FLAG_BREAK);
-			do_2833(rtp_session);
-			bytes = 0;
-			return_cng_frame();
-		}
-
 		if (bytes && switch_test_flag(rtp_session, SWITCH_RTP_FLAG_PROXY_MEDIA)) {
 			/* Fast PASS! */
 			*flags |= SFF_PROXY_PACKET;



More information about the Freeswitch-svn mailing list