From: Anthony Minessale Date: Wed, 1 Jun 2011 15:59:32 +0000 (-0500) Subject: FS-3324 --resolve I think this is a misconfiguration where you have nat detected... X-Git-Tag: v1.2-rc1~108^2~11^2~40^2~9 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64f8ad3f847dfa62d6411b09fa4794f7237de115;p=thirdparty%2Ffreeswitch.git FS-3324 --resolve I think this is a misconfiguration where you have nat detected and no external ip configured --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 4e5860e8a0..4fc4d9f418 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -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, '@'))) {