]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-7917: [mod_sofia] Fixed default config, we really shouldn’t be setting ext-*-ip...
authorBrian West <brian@freeswitch.org>
Thu, 30 Jul 2015 16:45:46 +0000 (11:45 -0500)
committerMichael Jerris <mike@jerris.com>
Tue, 25 Aug 2015 19:48:42 +0000 (14:48 -0500)
conf/vanilla/sip_profiles/external-ipv6.xml
conf/vanilla/sip_profiles/internal-ipv6.xml
src/mod/endpoints/mod_sofia/sofia_glue.c

index be70ff3b1e3e889b04285ed10baebe4a09d53567..ea66679c37cab9644eb005ff8b7bb9f1f8f47e08 100644 (file)
@@ -63,8 +63,9 @@
     -->
     <param name="rtp-ip" value="$${local_ip_v6}"/>
     <param name="sip-ip" value="$${local_ip_v6}"/>
-    <param name="ext-rtp-ip" value="auto-nat"/>
-    <param name="ext-sip-ip" value="auto-nat"/>
+    <!-- Shouldn't set these on IPv6 -->
+    <!--<param name="ext-rtp-ip" value="auto-nat"/>-->
+    <!--<param name="ext-sip-ip" value="auto-nat"/>-->
     <param name="rtp-timeout-sec" value="300"/>
     <param name="rtp-hold-timeout-sec" value="1800"/>
     <!--<param name="enable-3pcc" value="true"/>-->
index 98efa2ffbbe86bd2e403b81fedc7ceae49a6ea96..21bb1f1e776face5711834753030aed820256361 100644 (file)
@@ -96,6 +96,7 @@
     <param name="auth-calls" value="$${internal_auth_calls}"/>
     <!-- on authed calls, authenticate *all* the packets not just invite -->
     <param name="auth-all-packets" value="false"/>
+    <!-- Shouldn't set these on IPv6 -->
     <!-- <param name="ext-rtp-ip" value="$${external_rtp_ip}"/> -->
     <!-- <param name="ext-sip-ip" value="$${external_sip_ip}"/> -->
     <!-- rtp inactivity timeout -->
index e7a5b54414f03dbe488458bb6c51802ccdc0fd43..c6c1c8d80e6a457e5bd3d198fe0247cd110b790b 100644 (file)
@@ -439,17 +439,18 @@ char *sofia_glue_create_external_via(switch_core_session_t *session, sofia_profi
 
 char *sofia_glue_create_via(switch_core_session_t *session, const char *ip, switch_port_t port, sofia_transport_t transport)
 {
+       char *ipv6 = strchr(ip, ':');
        if (port && port != 5060) {
                if (session) {
-                       return switch_core_session_sprintf(session, "SIP/2.0/%s %s:%d;rport", sofia_glue_transport2str(transport), ip, port);
+                       return switch_core_session_sprintf(session, "SIP/2.0/%s %s%s%s:%d;rport", sofia_glue_transport2str(transport), ipv6 ? "[" : "", ip, ipv6 ? "]" : "", port);
                } else {
-                       return switch_mprintf("SIP/2.0/%s %s:%d;rport", sofia_glue_transport2str(transport), ip, port);
+                       return switch_mprintf("SIP/2.0/%s %s%s%s:%d;rport", sofia_glue_transport2str(transport), ipv6 ? "[" : "", ip, ipv6 ? "]" : "", port);
                }
        } else {
                if (session) {
-                       return switch_core_session_sprintf(session, "SIP/2.0/%s %s;rport", sofia_glue_transport2str(transport), ip);
+                       return switch_core_session_sprintf(session, "SIP/2.0/%s %s%s%s;rport", sofia_glue_transport2str(transport), ipv6 ? "[" : "", ip, ipv6 ? "]" : "");
                } else {
-                       return switch_mprintf("SIP/2.0/%s %s;rport", sofia_glue_transport2str(transport), ip);
+                       return switch_mprintf("SIP/2.0/%s %s%s%s;rport", sofia_glue_transport2str(transport), ipv6 ? "[" : "", ip, ipv6 ? "]" : "");
                }
        }
 }