]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
sign this is a new option when you don't wanna use auto-nat but you wish to toggle...
authorBrian West <brian@freeswitch.org>
Fri, 11 Dec 2009 20:48:01 +0000 (20:48 +0000)
committerBrian West <brian@freeswitch.org>
Fri, 11 Dec 2009 20:48:01 +0000 (20:48 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15916 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/endpoints/mod_sofia/sofia.c

index 1b598027fc0e824c1085680aa24204575b24b54b..1c55b657023b01db03fcfc0fcda3569bd3d4bf92 100644 (file)
@@ -2644,7 +2644,12 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                                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 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                                }
                                                        }
                                                        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");