mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-30 17:59:21 +00:00
Repair multicast when ipv6 is enabled.
This commit is contained in:
parent
f58754fd81
commit
a5a65227b3
5 changed files with 29 additions and 9 deletions
|
|
@ -637,11 +637,14 @@ static void transfer_already_assigned_payload_types(SalMediaDescription *old, Sa
|
|||
static const char *linphone_call_get_bind_ip_for_stream(LinphoneCall *call, int stream_index){
|
||||
const char *bind_ip = lp_config_get_string(call->core->config,"rtp","bind_address",
|
||||
call->af == AF_INET6 ? "::0" : "0.0.0.0");
|
||||
|
||||
if (stream_index<2 && call->media_ports[stream_index].multicast_ip[0]!='\0'){
|
||||
PortConfig *pc = &call->media_ports[stream_index];
|
||||
if (stream_index<2 && 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*/
|
||||
bind_ip=call->media_localip;
|
||||
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;
|
||||
|
||||
}
|
||||
}
|
||||
return bind_ip;
|
||||
|
|
@ -1152,6 +1155,7 @@ BELLE_SIP_INSTANCIATE_VPTR(LinphoneCall, belle_sip_object_t,
|
|||
NULL, // marshal
|
||||
FALSE
|
||||
);
|
||||
|
||||
void linphone_call_fill_media_multicast_addr(LinphoneCall *call) {
|
||||
if (linphone_call_params_audio_multicast_enabled(call->params)){
|
||||
strncpy(call->media_ports[call->main_audio_stream_index].multicast_ip,
|
||||
|
|
@ -2410,12 +2414,11 @@ static SalMulticastRole linphone_call_get_multicast_role(const LinphoneCall *cal
|
|||
stream_desc = sal_media_description_find_best_stream(remotedesc, type);
|
||||
|
||||
if (stream_desc)
|
||||
multicast_role=stream_desc->multicast_role;
|
||||
else
|
||||
ms_message("Cannot determine multicast role for stream type [%s] on call [%p]",sal_stream_type_to_string(type),call);
|
||||
|
||||
multicast_role = stream_desc->multicast_role;
|
||||
|
||||
end:
|
||||
ms_message("Call [%p], stream type [%s], multicast role is [%s]",call, sal_stream_type_to_string(type),
|
||||
sal_multicast_role_to_string(multicast_role));
|
||||
return multicast_role;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -280,6 +280,7 @@ typedef struct StunCandidate{
|
|||
|
||||
typedef struct _PortConfig{
|
||||
char multicast_ip[LINPHONE_IPADDR_SIZE];
|
||||
char multicast_bind_ip[LINPHONE_IPADDR_SIZE];
|
||||
int rtp_port;
|
||||
int rtcp_port;
|
||||
}PortConfig;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,21 @@ This file contains SAL API functions that do not depend on the underlying implem
|
|||
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
const char *sal_multicast_role_to_string(SalMulticastRole role){
|
||||
switch(role){
|
||||
case SalMulticastInactive:
|
||||
return "inactive";
|
||||
case SalMulticastReceiver:
|
||||
return "receiver";
|
||||
case SalMulticastSender:
|
||||
return "sender";
|
||||
case SalMulticastSenderReceiver:
|
||||
return "sender-receiver";
|
||||
}
|
||||
return "INVALID";
|
||||
}
|
||||
|
||||
const char* sal_transport_to_string(SalTransport transport) {
|
||||
switch (transport) {
|
||||
case SalTransportUDP:return "udp";
|
||||
|
|
|
|||
|
|
@ -272,6 +272,7 @@ typedef struct SalStreamDescription{
|
|||
SalMulticastRole multicast_role;
|
||||
} SalStreamDescription;
|
||||
|
||||
const char *sal_multicast_role_to_string(SalMulticastRole role);
|
||||
const char *sal_stream_description_get_type_as_string(const SalStreamDescription *desc);
|
||||
const char *sal_stream_description_get_proto_as_string(const SalStreamDescription *desc);
|
||||
|
||||
|
|
|
|||
|
|
@ -168,10 +168,10 @@ static void early_media_with_multicast_base(bool_t video) {
|
|||
wait_for_list(lcs, &dummy, 1, 3000);
|
||||
|
||||
BC_ASSERT_GREATER(linphone_core_manager_get_max_audio_down_bw(pauline),70,int,"%i");
|
||||
BC_ASSERT_TRUE(linphone_call_get_audio_stats(linphone_core_get_current_call(pauline->lc))->download_bandwidth<90);
|
||||
BC_ASSERT_LOWER(linphone_call_get_audio_stats(linphone_core_get_current_call(pauline->lc))->download_bandwidth, 90, int, "%i");
|
||||
|
||||
BC_ASSERT_GREATER(linphone_core_manager_get_max_audio_down_bw(pauline2),70,int,"%i");
|
||||
BC_ASSERT_TRUE(linphone_call_get_audio_stats(linphone_core_get_current_call(pauline2->lc))->download_bandwidth<90);
|
||||
BC_ASSERT_LOWER(linphone_call_get_audio_stats(linphone_core_get_current_call(pauline2->lc))->download_bandwidth,90, int, "%i");
|
||||
|
||||
BC_ASSERT_TRUE(linphone_call_params_audio_multicast_enabled(linphone_call_get_current_params(linphone_core_get_current_call(pauline->lc))));
|
||||
BC_ASSERT_TRUE(linphone_call_params_audio_multicast_enabled(linphone_call_get_current_params(linphone_core_get_current_call(marie->lc))));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue