...
 
Commits (4)
......@@ -429,45 +429,6 @@ void TunnelManager::sOnIterate(TunnelManager *zis){
zis->onIterate();
}
#ifdef __ANDROID__
extern void linphone_android_log_handler(int prio, char *str);
static void linphone_android_tunnel_log_handler(int lev, const char *fmt, va_list args) {
char str[4096];
vsnprintf(str, sizeof(str) - 1, fmt, args);
str[sizeof(str) - 1] = '\0';
int prio;
switch(lev){
case TUNNEL_DEBUG: prio = ANDROID_LOG_DEBUG; break;
case TUNNEL_INFO: prio = ANDROID_LOG_INFO; break;
case TUNNEL_NOTICE: prio = ANDROID_LOG_INFO; break;
case TUNNEL_WARN: prio = ANDROID_LOG_WARN; break;
case TUNNEL_ERROR: prio = ANDROID_LOG_ERROR; break;
default: prio = ANDROID_LOG_DEFAULT; break;
}
linphone_android_log_handler(prio, str);
}
#endif /* __ANDROID__ */
void TunnelManager::enableLogs(bool value) {
enableLogs(value,NULL);
}
void TunnelManager::enableLogs(bool isEnabled,LogHandler logHandler) {
if (logHandler != NULL) SetLogHandler(logHandler);
#ifdef __ANDROID__
else SetLogHandler(linphone_android_tunnel_log_handler);
#else
else SetLogHandler(tunnel_default_log_handler);
#endif
if (isEnabled) {
SetLogLevel(TUNNEL_ERROR|TUNNEL_WARN|TUNNEL_INFO);
} else {
SetLogLevel(TUNNEL_ERROR|TUNNEL_WARN);
}
}
LinphoneTunnelMode TunnelManager::getMode() const {
return mMode;
}
......
......@@ -118,14 +118,6 @@ namespace belledonnecomm {
* @return #LinphoneTunnelMode
*/
LinphoneTunnelMode getMode() const;
/**
* Enables debug logs of the Tunnel subsystem.
**/
void enableLogs(bool isEnabled);
/**
* Enables debugs logs of the Tunnel subsystem and specify a callback where to receive the debug messages.
**/
void enableLogs(bool isEnabled,LogHandler logHandler);
/**
* iOS only feature: specify http proxy credentials.
* When the iOS device has an http proxy configured in the iOS settings, the tunnel client will connect to the server
......
......@@ -344,56 +344,6 @@ bool_t linphone_tunnel_get_activated(const LinphoneTunnel *tunnel){
return bcTunnel(tunnel)->isActivated();
}
static OrtpLogFunc tunnelOrtpLogHandler=NULL;
/*
#define TUNNEL_DEBUG (1)
#define TUNNEL_INFO (1<<1)
#define TUNNEL_NOTICE (1<<2)
#define TUNNEL_WARN (1<<3)
#define TUNNEL_ERROR (1<<4)
#define TUNNEL_ALERT (1<<5)
#define TUNNEL_FATAL (1<<6)
*/
static void tunnelLogHandler(int level, const char *fmt, va_list l){
if (tunnelOrtpLogHandler){
OrtpLogLevel ortp_level=ORTP_DEBUG;
switch(level){
case TUNNEL_DEBUG:
ortp_level=ORTP_DEBUG;
break;
case TUNNEL_INFO:
ortp_level=ORTP_MESSAGE;
break;
case TUNNEL_NOTICE:
ortp_level=ORTP_MESSAGE;
break;
case TUNNEL_WARN:
ortp_level=ORTP_WARNING;
break;
case TUNNEL_ERROR:
ortp_level=ORTP_ERROR;
break;
case TUNNEL_ALERT:
ortp_level=ORTP_ERROR;
break;
case TUNNEL_FATAL:
ortp_level=ORTP_FATAL;
break;
default:
ms_fatal("Unexepcted tunnel log %i: %s",level,fmt);
break;
}
tunnelOrtpLogHandler("tunnel", ortp_level,fmt,l);
}
}
void linphone_tunnel_enable_logs_with_handler(LinphoneTunnel *tunnel, bool_t enabled, OrtpLogFunc logHandler){
tunnelOrtpLogHandler=logHandler;
bcTunnel(tunnel)->enableLogs(enabled == FALSE ? false : true, tunnelLogHandler);
}
void linphone_tunnel_set_http_proxy_auth_info(LinphoneTunnel *tunnel, const char* username,const char* passwd){
bcTunnel(tunnel)->setHttpProxyAuthInfo(username, passwd);
}
......@@ -435,10 +385,6 @@ bool_t linphone_tunnel_verify_server_certificate_enabled(const LinphoneTunnel *t
return bcTunnel(tunnel)->verifyServerCertificateEnabled() ? TRUE : FALSE;
}
static void my_ortp_logv(const char *domain, OrtpLogLevel level, const char *fmt, va_list args){
ortp_logv(domain, level,fmt,args);
}
/**
* Startup tunnel using configuration.
......@@ -455,7 +401,6 @@ void linphone_tunnel_configure(LinphoneTunnel *tunnel){
bcTunnel(tunnel)->setHttpProxy(http_host, http_port, http_username, http_passwd);
linphone_tunnel_enable_dual_mode(tunnel, useDualMode);
linphone_tunnel_enable_logs_with_handler(tunnel,TRUE,my_ortp_logv);
linphone_tunnel_load_config(tunnel);
linphone_tunnel_enable_sip(tunnel, tunnelizeSIPPackets);
linphone_tunnel_verify_server_certificate(tunnel, tunnelVerifyServerCertificate);
......
......@@ -82,9 +82,6 @@ bool_t linphone_tunnel_get_activated(const LinphoneTunnel *tunnel){
return FALSE;
}
void linphone_tunnel_enable_logs_with_handler(LinphoneTunnel *tunnel, bool_t enabled, OrtpLogFunc logHandler){
}
void linphone_tunnel_set_http_proxy_auth_info(LinphoneTunnel *tunnel, const char* username,const char* passwd){
}
......
......@@ -766,21 +766,24 @@ 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");
const char *bind_ip = lp_config_get_string(call->core->config,"rtp", "bind_address", NULL);
PortConfig *pc = &call->media_ports[stream_index];
if (pc->multicast_ip[0]!='\0'){
if (call->dir==LinphoneCallOutgoing){
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).*/
} 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";
}
}
} else if (!bind_ip && !linphone_core_ipv6_enabled(linphone_call_get_core(call)))
/* If ipv6 is not enabled, for listening to 0.0.0.0. The default behavior of mediastreamer when no IP is passed is
* to try ::0, and in case of failure try 0.0.0.0. But we don't want this if IPv6 is explicitely disabled. */
bind_ip = "0.0.0.0";
return bind_ip;
}
......@@ -1225,7 +1228,7 @@ static void linphone_call_outgoing_select_ip_version(LinphoneCall *call, Linphon
char ipv6[LINPHONE_IPADDR_SIZE];
bool_t have_ipv6 = FALSE;
bool_t have_ipv4 = FALSE;
call->af = AF_UNSPEC;
if (linphone_core_get_local_ip_for(AF_INET, NULL, ipv4) == 0){
have_ipv4 = TRUE;
......@@ -1240,8 +1243,8 @@ static void linphone_call_outgoing_select_ip_version(LinphoneCall *call, Linphon
}else if (sal_address_is_ipv6((SalAddress*)to)){
call->af = AF_INET6;
}
if (lp_config_get_int(call->core->config, "rtp", "prefer_ipv6", 1) == 0 && have_ipv4){
if (lp_config_get_int(call->core->config, "rtp", "prefer_ipv6", 1) == 0 && have_ipv4){
/* This is the case where ipv4 is to be prefered if both are available.*/
call->af = AF_INET; /*we'll use IPv4*/
ms_message("prefer_ipv6 is set to false, as both IP versions are available we are going to use IPv4");
......@@ -1384,7 +1387,7 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddr
/*reserve the sockets immediately*/
linphone_call_init_media_streams(call);
call->current_params->update_call_when_ice_completed = call->params->update_call_when_ice_completed; /*copy param*/
linphone_call_fill_media_multicast_addr(call);
......@@ -2365,7 +2368,7 @@ void linphone_call_enable_camera (LinphoneCall *call, bool_t enable){
void linphone_call_send_vfu_request(LinphoneCall *call) {
#ifdef VIDEO_ENABLED
const LinphoneCallParams *current_params = linphone_call_get_current_params(call);
if (call->videostream && call->videostream->ms.decoder) {
ms_filter_call_method_noarg(call->videostream->ms.decoder, MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION);
}
......@@ -2739,7 +2742,7 @@ void linphone_call_init_audio_stream(LinphoneCall *call){
char* cname;
if (call->audiostream != NULL) return;
if (call->sessions[call->main_audio_stream_index].rtp_session==NULL){
SalMulticastRole multicast_role = linphone_call_get_multicast_role(call,SalAudio);
SalMediaDescription *remotedesc=NULL;
......@@ -3161,7 +3164,7 @@ static int get_video_bw(LinphoneCall *call, const SalMediaDescription *md, const
/*case where b=AS is given globally, not per stream*/
remote_bw=get_remaining_bandwidth_for_video(md->bandwidth,call->audio_bw);
}
bw=get_min_bandwidth(get_remaining_bandwidth_for_video(linphone_core_get_upload_bandwidth(call->core),call->audio_bw),remote_bw);
return bw;
}
......@@ -3723,7 +3726,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, LinphoneCallSta
call->current_params->video_codec = rtp_profile_get_payload(call->video_profile, used_pt);
call->current_params->has_video=TRUE;
media_stream_set_max_network_bitrate(&call->videostream->ms, linphone_core_get_upload_bandwidth(lc) * 1000);
rtp_session_enable_rtcp_mux(call->videostream->ms.sessions.rtp_session, vstream->rtcp_mux);
if (lc->video_conf.preview_vsize.width!=0)
......@@ -4898,7 +4901,7 @@ void linphone_call_handle_stream_events(LinphoneCall *call, int stream_index){
stats_index = LINPHONE_CALL_STATS_TEXT;
stats = call->text_stats;
}
/*This MUST be done before any call to "linphone_call_stats_fill" since it has ownership over evd->packet*/
if (evt == ORTP_EVENT_RTCP_PACKET_RECEIVED) {
do {
......
......@@ -1293,7 +1293,7 @@ static void certificates_config_read(LinphoneCore *lc) {
linphone_core_verify_server_certificates(lc,lp_config_get_int(lc->config,"sip","verify_server_certs",TRUE));
linphone_core_verify_server_cn(lc,lp_config_get_int(lc->config,"sip","verify_server_cn",TRUE));
bctbx_free(root_ca_path);
sal_set_tls_postcheck_callback(lc->sal, _linphone_core_tls_postcheck_callback, lc);
}
......@@ -1338,7 +1338,12 @@ static void sip_config_read(LinphoneCore *lc) {
const char *username=NULL;
#if !defined(LINPHONE_WINDOWS_UNIVERSAL) && !defined(LINPHONE_WINDOWS_PHONE) // Using getenv is forbidden on Windows 10 and Windows Phone
hostname=getenv("HOST");
username=getenv("USER");
#if defined _WIN32
username = getenv("USERNAME");
#else
username = getenv("USER");
#endif // if defined _WIN32
if (hostname==NULL) hostname=getenv("HOSTNAME");
#endif
if (hostname==NULL)
......@@ -6396,7 +6401,7 @@ void linphone_core_soundcard_hint_check( LinphoneCore* lc){
bool_t use_rtp_io_enable_local_output = lp_config_get_int(lc->config, "sound", "rtp_io_enable_local_output", FALSE);
if (lc->conf_ctx && linphone_conference_get_size(lc->conf_ctx) >= 1) return;
/* check if the remaining calls are paused */
while( the_calls ){
call = reinterpret_cast<LinphoneCall *>(the_calls->data);
......
......@@ -1185,7 +1185,6 @@ BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneEvent);
LinphoneTunnel *linphone_core_tunnel_new(LinphoneCore *lc);
void linphone_tunnel_configure(LinphoneTunnel *tunnel);
void linphone_tunnel_enable_logs_with_handler(LinphoneTunnel *tunnel, bool_t enabled, OrtpLogFunc logHandler);
/**
* Check if we do not have exceed the number of simultaneous call
......
......@@ -43,7 +43,7 @@ public class LinphoneCoreFactoryImpl extends LinphoneCoreFactory {
}
static {
System.loadLibrary("gnustl_shared");
System.loadLibrary("c++_shared");
loadOptionalLibrary("ffmpeg-linphone");
System.loadLibrary("bctoolbox");
System.loadLibrary("ortp");
......