From: Brian West Date: Tue, 14 Dec 2010 18:00:29 +0000 (-0600) Subject: Do not set nat mode when the device's network_ip is within the acl also so if your... X-Git-Tag: v1.2-rc1~233^2~1^2^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c6eab8c13d2d7dddcd078a25f8d64bf94cfa910;p=thirdparty%2Ffreeswitch.git Do not set nat mode when the device's network_ip is within the acl also so if your FS is behind nat and your phone is too then it will still make the right decisions --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 591cd7f4aa..d429f59672 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -6267,6 +6267,13 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_ for (x = 0; x < profile->nat_acl_count; x++) { last_acl = profile->nat_acl[x]; if (!(ok = switch_check_network_list_ip(contact_host, last_acl))) { + /* override the decision to say this is nat because the network_ip is within the acl too */ + if ((ok = switch_check_network_list_ip(network_ip, last_acl))) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "Endpoint is already inside nat with us.\n"); + ok = 0; + } else { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG10, "Decision stands they are behind nat.\n"); + } break; } }