If multicast is used, create RTP socket with the same address familly as the multicast address, in order to workaround issues with dual stack sockets and multicast, especially on mac os.

This commit is contained in:
Simon Morlat 2016-11-03 22:57:40 +01:00
parent 1e0661a268
commit 64ac0d5081
2 changed files with 7 additions and 4 deletions

View file

@ -668,13 +668,16 @@ static const char *linphone_call_get_bind_ip_for_stream(LinphoneCall *call, int
const char *bind_ip = lp_config_get_string(call->core->config,"rtp","bind_address",
call->af == AF_INET6 ? "::0" : "0.0.0.0");
PortConfig *pc = &call->media_ports[stream_index];
if (stream_index<2 && pc->multicast_ip[0]!='\0'){
if (pc->multicast_ip[0]!='\0'){
if (call->dir==LinphoneCallOutgoing){
/*as multicast sender, we must decide a local interface to use to send multicast, and bind to it*/
linphone_core_get_local_ip_for(strchr(pc->multicast_ip,':') ? AF_INET6 : AF_INET,
NULL, pc->multicast_bind_ip);
bind_ip = pc->multicast_bind_ip;
}else{
/*otherwise we shall use an address family of the same family of the multicast address, because
* dual stack socket and multicast don't work well on Mac OS (linux is OK, as usual).*/
bind_ip = strchr(pc->multicast_ip,':') ? "::0" : "0.0.0.0";
}
}
return bind_ip;
@ -683,7 +686,7 @@ static const char *linphone_call_get_bind_ip_for_stream(LinphoneCall *call, int
static const char *linphone_call_get_public_ip_for_stream(LinphoneCall *call, int stream_index){
const char *public_ip=call->media_localip;
if (stream_index<2 && call->media_ports[stream_index].multicast_ip[0]!='\0')
if (call->media_ports[stream_index].multicast_ip[0]!='\0')
public_ip=call->media_ports[stream_index].multicast_ip;
return public_ip;
}

@ -1 +1 @@
Subproject commit 3a1db4a3b30bfb3044d3dfb8c977fe66300c44f2
Subproject commit 3f00520a6159dfe53f85f8e6e26ff79dc54f6277