]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-3324 --resolve I think this is a misconfiguration where you have nat detected...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 1 Jun 2011 15:59:32 +0000 (10:59 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 1 Jun 2011 15:59:38 +0000 (10:59 -0500)
src/mod/endpoints/mod_sofia/sofia.c

index 4e5860e8a0d3959e16c120b8b289be490bf028cd..4fc4d9f418ebf06437a3387e18b253445a3a5a8e 100644 (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, '@'))) {