mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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
This commit is contained in:
@@ -51,6 +51,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
#include "asterisk/acl.h"
|
||||
#include "asterisk/sdp_srtp.h"
|
||||
#include "asterisk/dsp.h"
|
||||
#include "asterisk/utils.h"
|
||||
|
||||
#include "asterisk/res_pjsip.h"
|
||||
#include "asterisk/res_pjsip_session.h"
|
||||
@@ -1493,7 +1494,11 @@ static int load_module(void)
|
||||
{
|
||||
CHECK_PJSIP_SESSION_MODULE_LOADED();
|
||||
|
||||
ast_sockaddr_parse(&address_rtp, "::", 0);
|
||||
if (ast_check_ipv6()) {
|
||||
ast_sockaddr_parse(&address_rtp, "::", 0);
|
||||
} else {
|
||||
ast_sockaddr_parse(&address_rtp, "0.0.0.0", 0);
|
||||
}
|
||||
|
||||
if (!(sched = ast_sched_context_create())) {
|
||||
ast_log(LOG_ERROR, "Unable to create scheduler context.\n");
|
||||
|
Reference in New Issue
Block a user