]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FSMOD-61
authorAnthony Minessale <anthm@freeswitch.org>
Mon, 14 Jun 2010 18:42:06 +0000 (13:42 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Mon, 14 Jun 2010 18:42:06 +0000 (13:42 -0500)
src/mod/endpoints/mod_sofia/sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c

index ac22a235442e75da7c448a0a0077b51f80dca2ed..a04b5641842b993a135bce6e4ad0b8419b82b411 100644 (file)
@@ -2989,6 +2989,9 @@ switch_status_t config_sofia(int reload, char *profile_name)
                                                        if (ip) {
                                                                if (!strncasecmp(ip, "autonat:", 8)) {
                                                                        profile->extrtpip = switch_core_strdup(profile->pool, ip + 8);
+                                                                       if (zstr(profile->extsipip)) {
+                                                                               profile->extsipip = switch_core_strdup(profile->pool, profile->extrtpip);
+                                                                       }
                                                                        sofia_set_pflag(profile, PFLAG_AUTO_NAT);
                                                                } else {
                                                                        profile->extrtpip = switch_core_strdup(profile->pool, ip);
index 29690fe80c15c52d15a00d0b4eb8fe97bd12c599..442a15a8e8bd6ba5b5d0c3a19415e19c85790695 100644 (file)
@@ -1744,18 +1744,18 @@ switch_status_t sofia_glue_do_invite(switch_core_session_t *session)
                        }
                }
 
-               if (!rpid_domain) {
-                       rpid_domain = "cluecon.com";
-               }
-
                if (sofia_test_pflag(tech_pvt->profile, PFLAG_AUTO_NAT)) {
-                       if (!zstr(tech_pvt->remote_ip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) {
+                       if (!zstr(tech_pvt->remote_ip) && !zstr(profile->extsipip) && sofia_glue_check_nat(tech_pvt->profile, tech_pvt->remote_ip)) {
                                rpid_domain = tech_pvt->profile->extsipip;
                        } else {
                                rpid_domain = tech_pvt->profile->sipip;
                        }
                }
 
+               if (zstr(rpid_domain)) {
+                       rpid_domain = "cluecon.com";
+               }
+
                /*
                 * Ignore transport chanvar and uri parameter for gateway connections
                 * since all of them have been already taken care of in mod_sofia.c:sofia_outgoing_channel()