Revision
15916
Author
brian
Date
2009-12-11 14:48:01 -0600 (Fri, 11 Dec 2009)

Log Message

 sign this is a new option when you don't wanna use auto-nat but you wish to toggle the lies of the contact 

Modified Paths

Diff

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


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-12-11 19:22:40 UTC (rev 15915)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2009-12-11 20:48:01 UTC (rev 15916)
@@ -2644,7 +2644,12 @@
 								sofia_clear_pflag(profile, PFLAG_AUTO_NAT);
 							}
 							if (ip) {
-								profile->extrtpip = switch_core_strdup(profile->pool, ip);
+								if (!strncasecmp(ip, "autonat:", 8)) {
+									profile->extrtpip = switch_core_strdup(profile->pool, ip + 8);
+									sofia_set_pflag(profile, PFLAG_AUTO_NAT);
+								} else {
+									profile->extrtpip = switch_core_strdup(profile->pool, ip);
+								}
 							}
 						} else {
 							switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid ext-rtp-ip\n");
@@ -2689,7 +2694,12 @@
 								}
 							}
 							if (ip) {
-								profile->extsipip = switch_core_strdup(profile->pool, ip);
+								if (!strncasecmp(ip, "autonat:", 8)) {
+									profile->extsipip = switch_core_strdup(profile->pool, ip +  8);
+									sofia_set_pflag(profile, PFLAG_AUTO_NAT);
+								} else {
+									profile->extsipip = switch_core_strdup(profile->pool, ip);
+								}
 							}
 						} else {
 							switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Invalid ext-sip-ip\n");