diff --git a/configure.ac b/configure.ac index 3932ab2e1..8392b79f4 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ if test "$LINPHONE_EXTRA_VERSION" != "" ;then LINPHONE_VERSION=$LINPHONE_VERSION.${LINPHONE_EXTRA_VERSION} fi -LIBLINPHONE_SO_CURRENT=8 dnl increment this number when you add/change/remove an interface +LIBLINPHONE_SO_CURRENT=9 dnl increment this number when you add/change/remove an interface LIBLINPHONE_SO_REVISION=0 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT LIBLINPHONE_SO_AGE=0 dnl increment this number when you add an interface, set to 0 if you remove an interface diff --git a/coreapi/TunnelManager.cc b/coreapi/TunnelManager.cc index 859394f17..d7ce537f5 100644 --- a/coreapi/TunnelManager.cc +++ b/coreapi/TunnelManager.cc @@ -163,7 +163,7 @@ TunnelManager::~TunnelManager(){ void TunnelManager::doRegistration(){ LinphoneProxyConfig* lProxy; - linphone_core_get_default_proxy(mCore, &lProxy); + lProxy = linphone_core_get_default_proxy_config(mCore); if (lProxy) { ms_message("TunnelManager: New registration"); lProxy->commit = TRUE; @@ -172,7 +172,7 @@ void TunnelManager::doRegistration(){ void TunnelManager::doUnregistration() { LinphoneProxyConfig *lProxy; - linphone_core_get_default_proxy(mCore, &lProxy); + lProxy = linphone_core_get_default_proxy_config(mCore); if(lProxy) { _linphone_proxy_config_unregister(lProxy); } diff --git a/coreapi/bellesip_sal/sal_impl.c b/coreapi/bellesip_sal/sal_impl.c index c98dbec7f..123aadb3a 100644 --- a/coreapi/bellesip_sal/sal_impl.c +++ b/coreapi/bellesip_sal/sal_impl.c @@ -82,8 +82,8 @@ void _belle_sip_log(belle_sip_log_level lev, const char *fmt, va_list args) { ortp_level=ORTP_DEBUG; break; } - if (ortp_log_level_enabled(ortp_level)){ - ortp_logv(ortp_level,fmt,args); + if (ortp_log_level_enabled("belle-sip", ortp_level)){ + ortp_logv("belle-sip", ortp_level,fmt,args); } } diff --git a/coreapi/chat.c b/coreapi/chat.c index 77d63d32d..3cabe976c 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -675,7 +675,7 @@ bool_t linphone_chat_room_is_remote_composing(const LinphoneChatRoom *cr) { } LinphoneCore *linphone_chat_room_get_lc(LinphoneChatRoom *cr) { - return cr->lc; + return linphone_chat_room_get_core(cr); } LinphoneCore *linphone_chat_room_get_core(LinphoneChatRoom *cr) { @@ -704,7 +704,7 @@ LinphoneChatMessage *linphone_chat_room_create_message_2(LinphoneChatRoom *cr, c const char *external_body_url, LinphoneChatMessageState state, time_t time, bool_t is_read, bool_t is_incoming) { LinphoneChatMessage *msg = linphone_chat_room_create_message(cr, message); - LinphoneCore *lc = linphone_chat_room_get_lc(cr); + LinphoneCore *lc = linphone_chat_room_get_core(cr); msg->external_body_url = external_body_url ? ms_strdup(external_body_url) : NULL; msg->time = time; msg->is_read = is_read; diff --git a/coreapi/chat_file_transfer.c b/coreapi/chat_file_transfer.c index 03190ce7f..4dc39ec07 100644 --- a/coreapi/chat_file_transfer.c +++ b/coreapi/chat_file_transfer.c @@ -460,7 +460,7 @@ static void linphone_chat_process_response_from_get_file(void *data, const belle int _linphone_chat_room_start_http_transfer(LinphoneChatMessage *msg, const char* url, const char* action, const belle_http_request_listener_callbacks_t *cbs) { belle_generic_uri_t *uri = NULL; - char* ua; + const char* ua = linphone_core_get_user_agent(msg->chat_room->lc); if (url == NULL) { ms_warning("Cannot process file transfer msg: no file remote URI configured."); @@ -472,9 +472,7 @@ int _linphone_chat_room_start_http_transfer(LinphoneChatMessage *msg, const char goto error; } - ua = ms_strdup_printf("%s/%s", linphone_core_get_user_agent_name(), linphone_core_get_user_agent_version()); msg->http_request = belle_http_request_create(action, uri, belle_sip_header_create("User-Agent", ua), NULL); - ms_free(ua); if (msg->http_request == NULL) { ms_warning("Could not create http request for uri %s", url); diff --git a/coreapi/linphone_tunnel.cc b/coreapi/linphone_tunnel.cc index 6cedfc2fd..a751bc948 100644 --- a/coreapi/linphone_tunnel.cc +++ b/coreapi/linphone_tunnel.cc @@ -289,7 +289,7 @@ static void tunnelLogHandler(int level, const char *fmt, va_list l){ ms_fatal("Unexepcted tunnel log %i: %s",level,fmt); break; } - tunnelOrtpLogHandler(ortp_level,fmt,l); + tunnelOrtpLogHandler("tunnel", ortp_level,fmt,l); } } @@ -330,8 +330,8 @@ bool_t linphone_tunnel_sip_enabled(const LinphoneTunnel *tunnel) { return bcTunnel(tunnel)->tunnelizeSipPacketsEnabled() ? TRUE : FALSE; } -static void my_ortp_logv(OrtpLogLevel level, const char *fmt, va_list args){ - ortp_logv(level,fmt,args); +static void my_ortp_logv(const char *domain, OrtpLogLevel level, const char *fmt, va_list args){ + ortp_logv(domain, level,fmt,args); } diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index d1025888e..cb88c019c 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -527,22 +527,19 @@ static void setup_rtcp_fb(LinphoneCall *call, SalMediaDescription *md) { if (!sal_stream_description_active(&md->streams[i])) continue; md->streams[i].rtcp_fb.generic_nack_enabled = lp_config_get_int(lc->config, "rtp", "rtcp_fb_generic_nack_enabled", 0); md->streams[i].rtcp_fb.tmmbr_enabled = lp_config_get_int(lc->config, "rtp", "rtcp_fb_tmmbr_enabled", 0); - md->streams[i].implicit_rtcp_fb = call->params->implicit_rtcp_fb; - - for (pt_it = md->streams[i].payloads; pt_it != NULL; pt_it = pt_it->next) { + md->streams[i].implicit_rtcp_fb = call->params->implicit_rtcp_fb; + + for (pt_it = md->streams[i].payloads; pt_it != NULL; pt_it = pt_it->next) { pt = (PayloadType *)pt_it->data; - - if (call->params->avpf_enabled == FALSE && call->params->implicit_rtcp_fb == FALSE) { - payload_type_unset_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED); - memset(&avpf_params, 0, sizeof(avpf_params)); - } - else { - payload_type_set_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED); - avpf_params = payload_type_get_avpf_params(pt); - avpf_params.trr_interval = call->params->avpf_rr_interval; - - } - + + if (call->params->avpf_enabled == FALSE && call->params->implicit_rtcp_fb == FALSE) { + payload_type_unset_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED); + memset(&avpf_params, 0, sizeof(avpf_params)); + }else { + payload_type_set_flag(pt, PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED); + avpf_params = payload_type_get_avpf_params(pt); + avpf_params.trr_interval = call->params->avpf_rr_interval; + } payload_type_set_avpf_params(pt, avpf_params); } } @@ -2325,11 +2322,9 @@ void linphone_call_init_audio_stream(LinphoneCall *call){ AudioStream *audiostream; const char *location; int dscp; - char rtcp_tool[128]={0}; + const char *rtcp_tool=linphone_core_get_user_agent(call->core); char* cname; - snprintf(rtcp_tool,sizeof(rtcp_tool)-1,"%s-%s",linphone_core_get_user_agent_name(),linphone_core_get_user_agent_version()); - 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); @@ -2425,9 +2420,7 @@ void linphone_call_init_video_stream(LinphoneCall *call){ #ifdef VIDEO_ENABLED LinphoneCore *lc=call->core; char* cname; - char rtcp_tool[128]; - - snprintf(rtcp_tool,sizeof(rtcp_tool)-1,"%s-%s",linphone_core_get_user_agent_name(),linphone_core_get_user_agent_version()); + const char *rtcp_tool = linphone_core_get_user_agent(call->core); if (call->videostream == NULL){ int video_recv_buf_size=lp_config_get_int(lc->config,"video","recv_buf_size",0); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 0e48a2c4c..093ef6733 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -164,7 +164,7 @@ const LinphoneAddress *linphone_core_get_current_call_remote_address(struct _Lin return linphone_call_get_remote_address(call); } -static void linphone_core_log_collection_handler(OrtpLogLevel level, const char *fmt, va_list args); +static void linphone_core_log_collection_handler(const char *domain, OrtpLogLevel level, const char *fmt, va_list args); void linphone_core_set_log_handler(OrtpLogFunc logfunc) { if (ortp_logv_out == linphone_core_log_collection_handler) { @@ -201,7 +201,7 @@ void linphone_core_set_log_level(OrtpLogLevel loglevel) { } void linphone_core_set_log_level_mask(OrtpLogLevel loglevel) { - ortp_set_log_level_mask(loglevel); + ortp_set_log_level_mask(NULL, loglevel); if (loglevel == 0) { sal_disable_log(); } else { @@ -264,7 +264,7 @@ static void _close_log_collection_file(void) { } } -static void linphone_core_log_collection_handler(OrtpLogLevel level, const char *fmt, va_list args) { +static void linphone_core_log_collection_handler(const char *domain, OrtpLogLevel level, const char *fmt, va_list args) { const char *lname="undef"; char *msg; struct timeval tp; @@ -276,12 +276,12 @@ static void linphone_core_log_collection_handler(OrtpLogLevel level, const char #ifndef _WIN32 va_list args_copy; va_copy(args_copy, args); - liblinphone_log_func(level, fmt, args_copy); + liblinphone_log_func(domain, level, fmt, args_copy); va_end(args_copy); #else /* This works on 32 bits, luckily. */ /* TODO: va_copy is available in Visual Studio 2013. */ - liblinphone_log_func(level, fmt, args); + liblinphone_log_func(domain, level, fmt, args); #endif } diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 6212991e6..98b60209f 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -110,7 +110,7 @@ void linphone_android_log_handler(int prio, char *str) { } } -static void linphone_android_ortp_log_handler(OrtpLogLevel lev, const char *fmt, va_list args) { +static void linphone_android_ortp_log_handler(const char *domain, OrtpLogLevel lev, const char *fmt, va_list args) { char str[4096]; const char *levname="undef"; vsnprintf(str, sizeof(str) - 1, fmt, args); @@ -4328,7 +4328,7 @@ extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_createConference(JNIE LinphoneConference *conference; jobject jconference; - if(jparams) params = (LinphoneConferenceParams *)env->GetLongField(params_class, params_native_ptr_attr); + if(jparams) params = (LinphoneConferenceParams *)env->GetLongField(jparams, params_native_ptr_attr); conference = linphone_core_create_conference_with_params((LinphoneCore *)corePtr, params); if(conference) return env->NewObject(conference_class, conference_constructor, (jlong)conference); else return NULL; diff --git a/coreapi/upnp.c b/coreapi/upnp.c index 72257ac60..5ec118247 100644 --- a/coreapi/upnp.c +++ b/coreapi/upnp.c @@ -189,7 +189,7 @@ void linphone_upnp_igd_print(void *cookie, upnp_igd_print_level level, const cha default: break; } - ortp_logv(ortp_level, fmt, list); + ortp_logv(ORTP_LOG_DOMAIN, ortp_level, fmt, list); } void linphone_upnp_igd_callback(void *cookie, upnp_igd_event event, void *arg) { diff --git a/gtk/friendlist.c b/gtk/friendlist.c index c1a497c3d..906d80668 100644 --- a/gtk/friendlist.c +++ b/gtk/friendlist.c @@ -615,7 +615,7 @@ void linphone_gtk_show_directory_search(void){ GtkWidget *mw=linphone_gtk_get_main_window(); GtkWidget *search_box=linphone_gtk_get_widget(mw,"directory_search_box"); - linphone_core_get_default_proxy(linphone_gtk_get_core(),&cfg); + cfg = linphone_core_get_default_proxy_config(linphone_gtk_get_core()); if (cfg){ ssc=linphone_proxy_config_get_sip_setup_context(cfg); if (ssc!=NULL && sip_setup_context_get_capabilities(ssc) & SIP_SETUP_CAP_BUDDY_LOOKUP){ diff --git a/gtk/main.c b/gtk/main.c index 9ba13b2d9..5a170a552 100644 --- a/gtk/main.c +++ b/gtk/main.c @@ -1888,7 +1888,7 @@ static void linphone_gtk_init_main_window(void){ #endif } -void linphone_gtk_log_handler(OrtpLogLevel lev, const char *fmt, va_list args){ +void linphone_gtk_log_handler(const char*domain, OrtpLogLevel lev, const char *fmt, va_list args){ if (verbose){ const char *lname="undef"; char *msg; @@ -2199,6 +2199,8 @@ core_start: linphone_gtk_create_log_window(); linphone_core_enable_logs_with_cb(linphone_gtk_log_handler); + /*it is possible to filter in or out some logs by configuring per log domain:*/ + /*ortp_set_log_level_mask("belle-sip", ORTP_ERROR);*/ chat_messages_db_file=linphone_gtk_message_storage_get_db_file(NULL); call_logs_db_file = linphone_gtk_call_logs_storage_get_db_file(NULL); diff --git a/mediastreamer2 b/mediastreamer2 index 68ec6e611..8680e3a03 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 68ec6e6113d0bdada57fdfac462e0dd8ebc6a53e +Subproject commit 8680e3a0368bce945c68ebd7664fdafb02c3a2f0 diff --git a/oRTP b/oRTP index 761cfd7c0..0c8d9ddae 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 761cfd7c0eb76359b0dabeffd6533071b41a2914 +Subproject commit 0c8d9ddaea8c1afdc0e9b8c37a31c9d158e57efd diff --git a/tester/liblinphone_tester.c b/tester/liblinphone_tester.c index 2363fb886..f6531ea75 100644 --- a/tester/liblinphone_tester.c +++ b/tester/liblinphone_tester.c @@ -73,7 +73,7 @@ void liblinphone_android_log_handler(int prio, const char *fmt, va_list args) { } } -static void liblinphone_android_ortp_log_handler(OrtpLogLevel lev, const char *fmt, va_list args) { +static void liblinphone_android_ortp_log_handler(const char *domain, OrtpLogLevel lev, const char *fmt, va_list args) { int prio; switch(lev){ case ORTP_DEBUG: prio = ANDROID_LOG_DEBUG; break; @@ -151,7 +151,7 @@ static void log_handler(int lev, const char *fmt, va_list args) { va_end(cap); #endif if (log_file){ - ortp_logv_out(lev, fmt, args); + ortp_logv_out(ORTP_LOG_DOMAIN, lev, fmt, args); } }