]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't print misleading info here either if nat_type isn't set even if the add is...
authorBrian West <brian@freeswitch.org>
Mon, 8 Jun 2009 23:28:51 +0000 (23:28 +0000)
committerBrian West <brian@freeswitch.org>
Mon, 8 Jun 2009 23:28:51 +0000 (23:28 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13705 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/event_handlers/mod_event_socket/mod_event_socket.c

index f6b0095fc11438d5795d36b207a572460c4c0db1..edd8394e5abdfc418712146769ad3afb12192300 100644 (file)
@@ -2213,7 +2213,7 @@ static int config(void)
                                } else if (!strcmp(var, "debug")) {
                                        globals.debug = atoi(val);
                                } else if (!strcmp(var, "nat-map")) {
-                                       if (switch_true(val)) {
+                                       if (switch_true(val) && switch_core_get_variable("nat_type")) {
                                                prefs.nat_map = 1;
                                        }
                                } else if (!strcmp(var, "listen-port")) {
@@ -2244,7 +2244,7 @@ static int config(void)
                prefs.nat_map = 0;
        }
 
-       if (prefs.nat_map && switch_check_network_list_ip(prefs.ip, "loopback.auto")) {
+       if (prefs.nat_map) {
                prefs.nat_map = 0;
        }
 
@@ -2345,7 +2345,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_socket_runtime)
 
        close_socket(&listen_list.sock);
        
-       if (prefs.nat_map) {
+       if (prefs.nat_map && switch_core_get_variable("nat_type")) {
                switch_nat_del_mapping(prefs.port, SWITCH_NAT_TCP);
        }