From 71e39c10faad49c5af2396a3ea1b67298f62d14d Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 12 Jun 2018 13:29:26 +0200 Subject: [PATCH] Let mediastreamer2 try to bind the RTP socket for IPv6 and if it fails fallback to IPv4. This is to enable to call starting in IPv4 to continue in IPv6 in case of network switch. --- src/conference/session/media-session.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp index 7bf709279..9266ff998 100644 --- a/src/conference/session/media-session.cpp +++ b/src/conference/session/media-session.cpp @@ -1122,7 +1122,7 @@ void MediaSessionPrivate::discoverMtu (const Address &remoteAddr) { string MediaSessionPrivate::getBindIpForStream (int streamIndex) { L_Q(); - string bindIp = lp_config_get_string(linphone_core_get_config(q->getCore()->getCCore()), "rtp", "bind_address", (af == AF_INET6) ? "::0" : "0.0.0.0"); + string bindIp = lp_config_get_string(linphone_core_get_config(q->getCore()->getCCore()), "rtp", "bind_address", ""); PortConfig *pc = &mediaPorts[streamIndex]; if (!pc->multicastIp.empty()){ if (direction == LinphoneCallOutgoing) { @@ -2367,7 +2367,7 @@ void MediaSessionPrivate::initializeAudioStream () { if (remoteDesc) streamDesc = sal_media_description_find_best_stream(remoteDesc, SalAudio); - audioStream = audio_stream_new2(q->getCore()->getCCore()->factory, getBindIpForStream(mainAudioStreamIndex).c_str(), + audioStream = audio_stream_new2(q->getCore()->getCCore()->factory, L_STRING_TO_C(getBindIpForStream(mainAudioStreamIndex)), (multicastRole == SalMulticastReceiver) ? streamDesc->rtp_port : mediaPorts[mainAudioStreamIndex].rtpPort, (multicastRole == SalMulticastReceiver) ? 0 /* Disabled for now */ : mediaPorts[mainAudioStreamIndex].rtcpPort); if (multicastRole == SalMulticastReceiver) @@ -2473,7 +2473,7 @@ void MediaSessionPrivate::initializeTextStream () { if (remoteDesc) streamDesc = sal_media_description_find_best_stream(remoteDesc, SalText); - textStream = text_stream_new2(q->getCore()->getCCore()->factory, getBindIpForStream(mainTextStreamIndex).c_str(), + textStream = text_stream_new2(q->getCore()->getCCore()->factory, L_STRING_TO_C(getBindIpForStream(mainTextStreamIndex)), (multicastRole == SalMulticastReceiver) ? streamDesc->rtp_port : mediaPorts[mainTextStreamIndex].rtpPort, (multicastRole == SalMulticastReceiver) ? 0 /* Disabled for now */ : mediaPorts[mainTextStreamIndex].rtcpPort); if (multicastRole == SalMulticastReceiver) @@ -2517,7 +2517,7 @@ void MediaSessionPrivate::initializeVideoStream () { if (remoteDesc) streamDesc = sal_media_description_find_best_stream(remoteDesc, SalVideo); - videoStream = video_stream_new2(q->getCore()->getCCore()->factory, getBindIpForStream(mainVideoStreamIndex).c_str(), + videoStream = video_stream_new2(q->getCore()->getCCore()->factory, L_STRING_TO_C(getBindIpForStream(mainVideoStreamIndex)), (multicastRole == SalMulticastReceiver) ? streamDesc->rtp_port : mediaPorts[mainVideoStreamIndex].rtpPort, (multicastRole == SalMulticastReceiver) ? 0 /* Disabled for now */ : mediaPorts[mainVideoStreamIndex].rtcpPort); if (multicastRole == SalMulticastReceiver)