FS-3324 --resolve I think this is a misconfiguration where you have nat detected and no external ip configured

This commit is contained in:
Anthony Minessale 2011-06-01 10:59:32 -05:00
parent 3b81d1fcdd
commit 64f8ad3f84
1 changed files with 13 additions and 1 deletions

View File

@ -6900,7 +6900,7 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
if (sip->sip_to && sip->sip_to->a_url) {
const char *host, *user;
int port;
int port, check_nat = 0;
url_t *transport_url;
if (sip->sip_record_route && sip->sip_record_route->r_url) {
@ -6940,10 +6940,22 @@ void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_
if (sofia_glue_check_nat(profile, tech_pvt->remote_ip)) {
url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_public_url : profile->public_url;
check_nat = 1;
} else {
url = (sofia_glue_transport_has_tls(transport)) ? profile->tls_url : profile->url;
}
if (!url) {
if (check_nat) {
switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Nat detected but no external address configured.\n");
}
url = profile->url;
}
if (!url) {
switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER);
}
tmp = sofia_overcome_sip_uri_weakness(session, url, transport, SWITCH_TRUE, NULL);
if ((at = strchr(tmp, '@'))) {