diff options
author | Guido Falsi <mad@madpilot.net> | 2016-11-22 18:20:06 +0100 |
---|---|---|
committer | Joshua Colp <jcolp@digium.com> | 2016-11-30 14:18:05 -0500 |
commit | 75230f4c0135f4885a49f2e5105b6ad70477f3c6 (patch) | |
tree | 06b7873e9f39475cb49338127f6e41ef91e5e1ed /res/res_pjsip_t38.c | |
parent | a0c0b1c9cb01db6b1b968efc01ff43a7f492795e (diff) |
res_rtp: Fix regression when IPv6 is not available.
The latest Release candidate fails to create RTP streams when IPv6
is not available. Due to the changes made in September the ast_sockaddr
structure passed around to create these streams is always of AF_INET6
type, causing failure when used for IPv4. This patch adds a utility
function to check for availability of IPv6 and applies such check
at startup to determine how to create the ast_sockaddr structures.
ASTERISK-26617 #close
Change-Id: I627a4e91795e821111e1cda523f083a40d0e0c3e
Diffstat (limited to 'res/res_pjsip_t38.c')
-rw-r--r-- | res/res_pjsip_t38.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/res/res_pjsip_t38.c b/res/res_pjsip_t38.c index adc99c30d..79dc9c324 100644 --- a/res/res_pjsip_t38.c +++ b/res/res_pjsip_t38.c @@ -37,6 +37,7 @@ #include <pjmedia.h> #include <pjlib.h> +#include "asterisk/utils.h" #include "asterisk/module.h" #include "asterisk/udptl.h" #include "asterisk/netsock2.h" @@ -916,7 +917,11 @@ static int load_module(void) { CHECK_PJSIP_SESSION_MODULE_LOADED(); - ast_sockaddr_parse(&address, "::", 0); + if (ast_check_ipv6()) { + ast_sockaddr_parse(&address, "::", 0); + } else { + ast_sockaddr_parse(&address, "0.0.0.0", 0); + } if (ast_sip_session_register_supplement(&t38_supplement)) { ast_log(LOG_ERROR, "Unable to register T.38 session supplement\n"); |