Revision
16472
Author
anthm
Date
2010-01-22 16:17:17 -0600 (Fri, 22 Jan 2010)

Log Message

only hack sdp in proxy or bypass

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (16471 => 16472)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2010-01-22 21:56:20 UTC (rev 16471)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2010-01-22 22:17:17 UTC (rev 16472)
@@ -3958,17 +3958,22 @@
 		r_sdp = tech_pvt->last_sdp_str;
 	}
 	
-	/* This marr in our code brought to you by people who can't read........*/
-	if (profile->ndlb & PFLAG_NDLB_ALLOW_BAD_IANANAME && r_sdp && (p = (char *) switch_stristr("g729a/8000", r_sdp))) {
-		p += 4;
-		*p++ = '/';
-		*p++ = '8';
-		*p++ = '0';
-		*p++ = '0';
-		*p++ = '0';
-		*p++ = ' ';
+	if ((channel && (switch_channel_test_flag(channel, CF_PROXY_MODE) || switch_channel_test_flag(channel, CF_PROXY_MEDIA))) || 
+		(sofia_test_flag(profile, TFLAG_INB_NOMEDIA) || sofia_test_flag(profile, TFLAG_PROXY_MEDIA))) {
+
+		/* This marr in our code brought to you by people who can't read........*/
+		if (profile->ndlb & PFLAG_NDLB_ALLOW_BAD_IANANAME && r_sdp && (p = (char *) switch_stristr("g729a/8000", r_sdp))) {
+			p += 4;
+			*p++ = '/';
+			*p++ = '8';
+			*p++ = '0';
+			*p++ = '0';
+			*p++ = '0';
+			*p++ = ' ';
+		}
 	}
 
+
 	if (ss_state == nua_callstate_terminated) {
 
 		if ((status == 300 || status == 302 || status == 305) && session) {