From 403c4f58338e226c066956865218eeec64d71ed1 Mon Sep 17 00:00:00 2001 From: Joshua Colp Date: Mon, 19 Sep 2016 11:13:21 +0000 Subject: pjsip: Support dual stack automatically. This change adds support for dual stack automatically. No configuration is required and the IP address and version in the SIP messages and SDP will be automatically changed based on the transport over which the message is being sent. RTP usage has also been changed to listen on both IPv4 and IPv6 simultaneously to allow media to flow, and to allow ICE support on both simultaneously. This also allows failover between IPv6 and IPv4 to work as expected. ASTERISK-26309 #close Change-Id: I235a421d8f9a326606d861b449fa6fe3a030572d --- res/res_pjsip_t38.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) (limited to 'res/res_pjsip_t38.c') diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c index 150336a08..b052cc428 100644 --- a/res/res_pjsip_t38.c +++ b/res/res_pjsip_t38.c @@ -51,11 +51,8 @@ ASTERISK_REGISTER_FILE() /*! \brief The number of seconds after receiving a T.38 re-invite before automatically rejecting it */ #define T38_AUTOMATIC_REJECTION_SECONDS 5 -/*! \brief Address for IPv4 UDPTL */ -static struct ast_sockaddr address_ipv4; - -/*! \brief Address for IPv6 UDPTL */ -static struct ast_sockaddr address_ipv6; +/*! \brief Address for UDPTL */ +static struct ast_sockaddr address; /*! \brief T.38 state information */ struct t38_state { @@ -259,8 +256,7 @@ static int t38_initialize_session(struct ast_sip_session *session, struct ast_si return 0; } - if (!(session_media->udptl = ast_udptl_new_with_bindaddr(NULL, NULL, 0, - session->endpoint->media.t38.ipv6 ? &address_ipv6 : &address_ipv4))) { + if (!(session_media->udptl = ast_udptl_new_with_bindaddr(NULL, NULL, 0, &address))) { return -1; } @@ -922,8 +918,7 @@ static int load_module(void) { CHECK_PJSIP_SESSION_MODULE_LOADED(); - ast_sockaddr_parse(&address_ipv4, "0.0.0.0", 0); - ast_sockaddr_parse(&address_ipv6, "::", 0); + ast_sockaddr_parse(&address, "::", 0); if (ast_sip_session_register_supplement(&t38_supplement)) { ast_log(LOG_ERROR, "Unable to register T.38 session supplement\n"); -- cgit v1.2.3