don't set auto-nat on ipv6 profiles

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15829 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2009-12-07 16:29:52 +00:00
parent 714a7bebd9
commit 0863bbcbae
1 changed files with 14 additions and 11 deletions

View File

@ -2435,17 +2435,6 @@ switch_status_t config_sofia(int reload, char *profile_name)
profile->local_network = "localnet.auto";
if (switch_core_get_variable("nat_type")) {
const char *ip = switch_core_get_variable("nat_public_addr");
if (ip) {
profile->extrtpip = switch_core_strdup(profile->pool, ip);
profile->extsipip = switch_core_strdup(profile->pool, ip);
sofia_set_pflag(profile, PFLAG_AUTO_NAT);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "NAT detected setting external ip to %s\n", ip);
}
}
for (param = switch_xml_child(settings, "param"); param; param = param->next) {
char *var = (char *) switch_xml_attr_soft(param, "name");
char *val = (char *) switch_xml_attr_soft(param, "value");
@ -2996,6 +2985,20 @@ switch_status_t config_sofia(int reload, char *profile_name)
profile->rtpip = switch_core_strdup(profile->pool, mod_sofia_globals.guess_ip);
}
if (switch_core_get_variable("nat_type")) {
const char *ip = switch_core_get_variable("nat_public_addr");
if (ip && !strchr(profile->sipip, ':')) {
if (!profile->extrtpip) {
profile->extrtpip = switch_core_strdup(profile->pool, ip);
}
if (!profile->extsipip) {
profile->extsipip = switch_core_strdup(profile->pool, ip);
}
sofia_set_pflag(profile, PFLAG_AUTO_NAT);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "NAT detected setting external ip to %s\n", ip);
}
}
if (profile->nonce_ttl < 60) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Setting nonce TTL to 60 seconds\n");
profile->nonce_ttl = 60;