From 30ffe287da18316a409cfe7738c39e3946397ff1 Mon Sep 17 00:00:00 2001 From: Brian West Date: Thu, 30 Jul 2015 11:45:46 -0500 Subject: [PATCH] =?UTF-8?q?FS-7917:=20[mod=5Fsofia]=20Fixed=20default=20co?= =?UTF-8?q?nfig,=20we=20really=20shouldn=E2=80=99t=20be=20setting=20ext-*-?= =?UTF-8?q?ip=20settings=20for=20ipv6=20profiles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/vanilla/sip_profiles/external-ipv6.xml | 5 +++-- conf/vanilla/sip_profiles/internal-ipv6.xml | 1 + src/mod/endpoints/mod_sofia/sofia_glue.c | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/conf/vanilla/sip_profiles/external-ipv6.xml b/conf/vanilla/sip_profiles/external-ipv6.xml index be70ff3b1e..ea66679c37 100644 --- a/conf/vanilla/sip_profiles/external-ipv6.xml +++ b/conf/vanilla/sip_profiles/external-ipv6.xml @@ -63,8 +63,9 @@ --> - - + + + diff --git a/conf/vanilla/sip_profiles/internal-ipv6.xml b/conf/vanilla/sip_profiles/internal-ipv6.xml index 98efa2ffbb..21bb1f1e77 100644 --- a/conf/vanilla/sip_profiles/internal-ipv6.xml +++ b/conf/vanilla/sip_profiles/internal-ipv6.xml @@ -96,6 +96,7 @@ + diff --git a/src/mod/endpoints/mod_sofia/sofia_glue.c b/src/mod/endpoints/mod_sofia/sofia_glue.c index e7a5b54414..c6c1c8d80e 100644 --- a/src/mod/endpoints/mod_sofia/sofia_glue.c +++ b/src/mod/endpoints/mod_sofia/sofia_glue.c @@ -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 ? "]" : ""); } } }