From e42a90d2da9fa0b81c6b8f62ef3a93d2082d7e57 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Wed, 24 Feb 2016 15:33:44 +0100 Subject: [PATCH 01/12] tester: fix bandwidth computation to only update current stream estimation, not all of them at once --- tester/call_tester.c | 14 ++++++++------ tester/liblinphone_tester.h | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index 5d7af52b2..77c787f02 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -95,12 +95,14 @@ void call_stats_updated(LinphoneCore *lc, LinphoneCall *call, const LinphoneCall } if (lstats->updated & LINPHONE_CALL_STATS_PERIODICAL_UPDATE ) { int tab_size = sizeof (counters->audio_download_bandwidth)/sizeof(int); - int index = (counters->current_bandwidth_index++) % tab_size; - - counters->audio_download_bandwidth[index] = (int)linphone_call_get_audio_stats(call)->download_bandwidth; - counters->audio_upload_bandwidth[index] = (int)linphone_call_get_audio_stats(call)->upload_bandwidth; - counters->video_download_bandwidth[index] = (int)linphone_call_get_video_stats(call)->download_bandwidth; - counters->video_upload_bandwidth[index] = (int)linphone_call_get_video_stats(call)->upload_bandwidth; + int index = (counters->current_bandwidth_index[lstats->type]++) % tab_size; + if (lstats->type == LINPHONE_CALL_STATS_AUDIO) { + counters->audio_download_bandwidth[index] = (int)linphone_call_get_audio_stats(call)->download_bandwidth; + counters->audio_upload_bandwidth[index] = (int)linphone_call_get_audio_stats(call)->upload_bandwidth; + } else { + counters->video_download_bandwidth[index] = (int)linphone_call_get_video_stats(call)->download_bandwidth; + counters->video_upload_bandwidth[index] = (int)linphone_call_get_video_stats(call)->upload_bandwidth; + } } } diff --git a/tester/liblinphone_tester.h b/tester/liblinphone_tester.h index 9c9898983..f0938839a 100644 --- a/tester/liblinphone_tester.h +++ b/tester/liblinphone_tester.h @@ -238,7 +238,7 @@ typedef struct _stats { int video_download_bandwidth[3]; int video_upload_bandwidth[3]; - int current_bandwidth_index; + int current_bandwidth_index[2] /*audio and video only*/; int number_of_rtcp_generic_nack; }stats; From 2fc3b377ed372676feb7777795894c2986fc1a20 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 24 Feb 2016 17:54:16 +0100 Subject: [PATCH 02/12] Update oRTP and ms2 submodules. --- mediastreamer2 | 2 +- oRTP | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mediastreamer2 b/mediastreamer2 index 0b367d23f..83ace6b88 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 0b367d23fac75167d61795a49003663958f03f14 +Subproject commit 83ace6b88dfa819b04c2dc6bca21961f457c90d6 diff --git a/oRTP b/oRTP index ba12aea51..92b6ef1cf 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit ba12aea51f115d72b044ec383ec42d321834f5e6 +Subproject commit 92b6ef1cf4884699f07a212f8ceeb06f284fae2c From c64cf6b4caa05710c9040e1e98fc4ff148452016 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 24 Feb 2016 17:54:29 +0100 Subject: [PATCH 03/12] Allow building both shared and static libraries with CMake. --- CMakeLists.txt | 33 ++++++++++++-------- console/CMakeLists.txt | 6 ++-- coreapi/CMakeLists.txt | 62 ++++++++++++++++++++++++------------- coreapi/help/CMakeLists.txt | 2 +- gtk/CMakeLists.txt | 6 ++-- tester/CMakeLists.txt | 16 +++++----- tools/CMakeLists.txt | 22 ++++++------- 7 files changed, 84 insertions(+), 63 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f4c2d5232..d1d10d336 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,13 +21,13 @@ ############################################################################ cmake_minimum_required(VERSION 3.0) -project(LINPHONE C CXX) +project(linphone VERSION 3.9.1 LANGUAGES C CXX) -set(LINPHONE_MAJOR_VERSION "3") -set(LINPHONE_MINOR_VERSION "9") -set(LINPHONE_MICRO_VERSION "1") -set(LINPHONE_VERSION "${LINPHONE_MAJOR_VERSION}.${LINPHONE_MINOR_VERSION}.${LINPHONE_MICRO_VERSION}") +set(LINPHONE_MAJOR_VERSION ${PROJECT_VERSION_MAJOR}) +set(LINPHONE_MINOR_VERSION ${PROJECT_VERSION_MINOR}) +set(LINPHONE_MICRO_VERSION ${PROJECT_VERSION_PATCH}) +set(LINPHONE_VERSION ${PROJECT_VERSION}) set(LINPHONE_SO_VERSION "8") file(GLOB LINPHONE_PO_FILES RELATIVE "${CMAKE_CURRENT_LIST_DIR}/po" "${CMAKE_CURRENT_LIST_DIR}/po/*.po") @@ -36,7 +36,8 @@ string(REPLACE ";" " " LINPHONE_ALL_LANGS "${LINPHONE_ALL_LANGS_LIST}") include(CMakeDependentOption) -option(ENABLE_STATIC "Build static library (default is shared library)." NO) +option(ENABLE_SHARED "Build shared library." YES) +option(ENABLE_STATIC "Build static library." YES) option(ENABLE_CONSOLE_UI "Turn on or off compilation of console interface." YES) option(ENABLE_DATE "Use build date in internal version number." NO) option(ENABLE_DOC "Enable documentation generation with Doxygen." YES) @@ -79,6 +80,12 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(CheckSymbolExists) include(CMakePushCheckState) +include(GNUInstallDirs) + +if(NOT CMAKE_INSTALL_RPATH AND CMAKE_INSTALL_PREFIX) + set(CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_FULL_LIBDIR}) + message(STATUS "Setting install rpath to ${CMAKE_INSTALL_RPATH}") +endif() set(MSVC_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/MSVC") if(MSVC) @@ -251,13 +258,13 @@ if(ENABLE_RELATIVE_PREFIX) else() set(LINPHONE_DATA_DIR "${CMAKE_INSTALL_PREFIX}") endif() -set(LINPHONE_PLUGINS_DIR "${LINPHONE_DATA_DIR}/lib/liblinphone/plugins") +set(LINPHONE_PLUGINS_DIR "${LINPHONE_DATA_DIR}/${CMAKE_INSTALL_LIBDIR}/liblinphone/plugins") if(WIN32) set(LINPHONE_CONFIG_DIR "Linphone") endif() -set(PACKAGE_LOCALE_DIR "${LINPHONE_DATA_DIR}/share/locale") -set(PACKAGE_DATA_DIR "${LINPHONE_DATA_DIR}/share") -set(PACKAGE_SOUND_DIR "${LINPHONE_DATA_DIR}/share/sounds/linphone") +set(PACKAGE_LOCALE_DIR "${LINPHONE_DATA_DIR}/${CMAKE_INSTALL_DATADIR}/locale") +set(PACKAGE_DATA_DIR "${LINPHONE_DATA_DIR}/${CMAKE_INSTALL_DATADIR}") +set(PACKAGE_SOUND_DIR "${LINPHONE_DATA_DIR}/${CMAKE_INSTALL_DATADIR}/sounds/linphone") set(PACKAGE_RING_DIR "${PACKAGE_SOUND_DIR}/rings") set(PACKAGE_FREEDESKTOP_DIR "${PACKAGE_DATA_DIR}/applications") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h) @@ -309,13 +316,13 @@ configure_file(cmake/LinphoneConfig.cmake.in @ONLY ) -set(ConfigPackageLocation lib/cmake/Linphone) +set(CONFIG_PACKAGE_LOCATION "${CMAKE_INSTALL_DATADIR}/Linphone/cmake") install(EXPORT ${EXPORT_TARGETS_NAME}Targets FILE LinphoneTargets.cmake - DESTINATION ${ConfigPackageLocation} + DESTINATION ${CONFIG_PACKAGE_LOCATION} ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/LinphoneConfig.cmake" "${CMAKE_CURRENT_BINARY_DIR}/LinphoneConfigVersion.cmake" - DESTINATION ${ConfigPackageLocation} + DESTINATION ${CONFIG_PACKAGE_LOCATION} ) diff --git a/console/CMakeLists.txt b/console/CMakeLists.txt index 4b7f4df24..3ec2b9e44 100644 --- a/console/CMakeLists.txt +++ b/console/CMakeLists.txt @@ -47,8 +47,8 @@ if(WIN32) endif() install(TARGETS ${INSTALL_TARGETS} - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index defbd1849..e0f9e263f 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -176,47 +176,65 @@ if(INTL_FOUND) list(APPEND LIBS ${INTL_LIBRARIES}) endif() +add_library(linphone-objects OBJECT ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC}) +set_target_properties(linphone-objects PROPERTIES POSITION_INDEPENDENT_CODE TRUE) +add_dependencies(linphone-objects liblinphone-git-version) + if(ENABLE_STATIC) - add_library(linphone STATIC ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC}) - target_link_libraries(linphone ${LIBS}) -else() - add_library(linphone SHARED ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX} ${LINPHONE_SOURCE_FILES_OBJC}) + add_library(linphone-static STATIC $) + set_target_properties(linphone-static PROPERTIES OUTPUT_NAME linphone) + target_link_libraries(linphone-static ${LIBS}) + if(IOS) + target_link_libraries(linphone-static "-framework Foundation" "-framework AVFoundation") + endif() + install(TARGETS linphone-static EXPORT ${EXPORT_TARGETS_NAME}Targets + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) +endif() +if(ENABLE_SHARED) + add_library(linphone SHARED $) set_target_properties(linphone PROPERTIES VERSION ${LINPHONE_SO_VERSION} LINKER_LANGUAGE CXX) target_link_libraries(linphone ${LIBS}) + if(WIN32 AND CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") + set_target_properties(linphone PROPERTIES PREFIX "lib") + endif() if(MSVC) if(CMAKE_BUILD_TYPE STREQUAL "Debug") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/linphone.pdb - DESTINATION bin + DESTINATION ${CMAKE_INSTALL_BINDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) endif() endif() -endif() -if(IOS) - target_link_libraries(linphone "-framework Foundation" "-framework AVFoundation") -endif() -add_dependencies(linphone liblinphone-git-version) -if(WIN32 AND CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" AND NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - set_target_properties(linphone PROPERTIES PREFIX "lib") + install(TARGETS linphone EXPORT ${EXPORT_TARGETS_NAME}Targets + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + ) endif() if(ICONV_FOUND) if(APPLE) # Prevent conflict between the system iconv.h header and the one from macports. - target_compile_options(linphone PRIVATE "-include" "${ICONV_INCLUDE_DIRS}/iconv.h") + if(ENABLE_STATIC) + target_compile_options(linphone-static PRIVATE "-include" "${ICONV_INCLUDE_DIRS}/iconv.h") + endif() + if(ENABLE_SHARED) + target_compile_options(linphone PRIVATE "-include" "${ICONV_INCLUDE_DIRS}/iconv.h") + endif() else() - target_include_directories(linphone PRIVATE ${ICONV_INCLUDE_DIRS}) + if(ENABLE_STATIC) + target_include_directories(linphone-static PRIVATE ${ICONV_INCLUDE_DIRS}) + endif() + if(ENABLE_SHARED) + target_include_directories(linphone PRIVATE ${ICONV_INCLUDE_DIRS}) + endif() endif() endif() -install(TARGETS linphone EXPORT ${EXPORT_TARGETS_NAME}Targets - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE -) - install(FILES ${LINPHONE_HEADER_FILES} - DESTINATION include/linphone + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/linphone PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) diff --git a/coreapi/help/CMakeLists.txt b/coreapi/help/CMakeLists.txt index 3a550e294..f3062f307 100644 --- a/coreapi/help/CMakeLists.txt +++ b/coreapi/help/CMakeLists.txt @@ -38,7 +38,7 @@ if(DOXYGEN_FOUND) ) add_custom_target(linphone-doc ALL DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/doc/html/index.html") install(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/doc/html" "${CMAKE_CURRENT_BINARY_DIR}/doc/xml" - DESTINATION "share/doc/linphone-${LINPHONE_VERSION}") + DESTINATION "${CMAKE_INSTALL_DATADIR}/doc/linphone-${LINPHONE_VERSION}") else() message(WARNING "The dot program is needed to generate the linphone documentation. You can get it from http://www.graphviz.org/.") endif() diff --git a/gtk/CMakeLists.txt b/gtk/CMakeLists.txt index 436a6919b..aa04fdcce 100644 --- a/gtk/CMakeLists.txt +++ b/gtk/CMakeLists.txt @@ -120,9 +120,9 @@ set_target_properties(linphone-gtk PROPERTIES XCODE_ATTRIBUTE_WARNING_CFLAGS "") install(TARGETS linphone-gtk - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) diff --git a/tester/CMakeLists.txt b/tester/CMakeLists.txt index ff819df51..c6caa5d21 100644 --- a/tester/CMakeLists.txt +++ b/tester/CMakeLists.txt @@ -66,13 +66,13 @@ if(IOS) target_include_directories(linphonetester PUBLIC ${CUNIT_INCLUDE_DIRS} PRIVATE common) target_link_libraries(linphonetester linphone ${CUNIT_LIBRARIES}) install(TARGETS linphonetester - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) install(FILES "liblinphone_tester.h" "common/bc_tester_utils.h" - DESTINATION include/linphone + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/linphone PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ ) elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") @@ -93,15 +93,15 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") set_target_properties(linphone_tester_runtime PROPERTIES LINK_FLAGS "/WINMDFILE:BelledonneCommunications.Linphone.Tester.winmd") install(TARGETS linphone_tester_runtime - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/BelledonneCommunications.Linphone.Tester.winmd" DESTINATION lib) if(CMAKE_BUILD_TYPE STREQUAL "Debug") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/BelledonneCommunications.Linphone.Tester.pdb - DESTINATION lib + DESTINATION ${CMAKE_INSTALL_LIBDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) endif() diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 88cd09173..0a871aba5 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -49,9 +49,9 @@ target_link_libraries(lp-gen-wrappers ${LP_GEN_WRAPPERS_LIBS}) install(TARGETS lp-gen-wrappers - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) @@ -69,9 +69,9 @@ target_link_libraries(lp-auto-answer linphone) install(TARGETS lp-auto-answer - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) @@ -89,12 +89,8 @@ target_link_libraries(lp-sendmsg linphone) install(TARGETS lp-sendmsg - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE ) - - - - From 55900bbf6631995d1ce86412b4d385cf9ebbc776 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 25 Feb 2016 11:30:31 +0100 Subject: [PATCH 04/12] chat: add possibility to use Lime conditionnally (when secrets have been shared only) --- coreapi/chat.c | 6 +++++- coreapi/chat_file_transfer.c | 3 ++- coreapi/linphonecore.c | 14 +++++++++----- coreapi/linphonecore.h | 10 ++++++++-- coreapi/private.h | 19 ++++++++++--------- 5 files changed, 34 insertions(+), 18 deletions(-) diff --git a/coreapi/chat.c b/coreapi/chat.c index e25eecb25..3f9d6692c 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -264,6 +264,10 @@ LinphoneChatRoom *linphone_core_get_chat_room_from_uri(LinphoneCore *lc, const c return _linphone_core_get_or_create_chat_room(lc, to); } +bool_t linphone_chat_room_lime_enabled(LinphoneChatRoom *cr) { + return linphone_core_lime_enabled(cr->lc) != LinphoneLimeDisabled/*&& TODO: check that cr->peer_url has a verified token */; +} + static void linphone_chat_room_delete_composing_idle_timer(LinphoneChatRoom *cr) { if (cr->composing_idle_timer) { if (cr->lc && cr->lc->sal) @@ -377,7 +381,7 @@ void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatMessage char *peer_uri = linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(cr)); const char *content_type; - if (linphone_core_lime_enabled(cr->lc)) { + if (linphone_chat_room_lime_enabled(cr)) { /* ref the msg or it may be destroyed by callback if the encryption failed */ if (msg->content_type && strcmp(msg->content_type, "application/vnd.gsma.rcs-ft-http+xml") == 0) { /* it's a file transfer, content type shall be set to diff --git a/coreapi/chat_file_transfer.c b/coreapi/chat_file_transfer.c index 4dc39ec07..e4c55f152 100644 --- a/coreapi/chat_file_transfer.c +++ b/coreapi/chat_file_transfer.c @@ -172,7 +172,8 @@ static void linphone_chat_message_process_response_from_post_file(void *data, belle_sip_body_handler_t *first_part_bh; /* shall we encrypt the file */ - if (linphone_core_lime_for_file_sharing_enabled(msg->chat_room->lc)) { + if (linphone_chat_room_lime_enabled(msg->chat_room) && + linphone_core_lime_for_file_sharing_enabled(msg->chat_room->lc)) { char keyBuffer [FILE_TRANSFER_KEY_SIZE]; /* temporary storage of generated key: 192 bits of key + 64 bits of initial vector */ diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 375ad5a56..a39f28447 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1856,18 +1856,22 @@ bool_t linphone_core_get_guess_hostname(LinphoneCore *lc){ return lc->sip_conf.guess_hostname; } -void linphone_core_enable_lime(LinphoneCore *lc, bool_t val){ +void linphone_core_enable_lime(LinphoneCore *lc, LinphoneLimeState val){ if (linphone_core_ready(lc)){ lp_config_set_int(lc->config,"sip","lime",val); } } -bool_t linphone_core_lime_enabled(const LinphoneCore *lc){ - return (lp_config_get_int(lc->config,"sip", "lime", FALSE) && lime_is_available()); +LinphoneLimeState linphone_core_lime_enabled(const LinphoneCore *lc){ + return lime_is_available() ? lp_config_get_int(lc->config,"sip", "lime", LinphoneLimeDisabled) : LinphoneLimeDisabled; } -bool_t linphone_core_lime_for_file_sharing_enabled(const LinphoneCore *lc){ - return linphone_core_lime_enabled(lc) && (lp_config_get_int(lc->config,"sip", "lime_for_file_sharing", TRUE) && lime_is_available()); +LinphoneLimeState linphone_core_lime_for_file_sharing_enabled(const LinphoneCore *lc){ + LinphoneLimeState s = linphone_core_lime_enabled(lc); + if (s != LinphoneLimeDisabled) { + s = lp_config_get_int(lc->config,"sip", "lime_for_file_sharing", LinphoneLimeMandatory); + } + return s; } LinphoneAddress *linphone_core_get_primary_contact_parsed(LinphoneCore *lc){ diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 42d326353..6494848fe 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -1241,6 +1241,12 @@ typedef enum _LinphoneChatMessageState { LinphoneChatMessageStateFileTransferDone /**< File transfer has been completed successfully. */ } LinphoneChatMessageState; +typedef enum _LinphoneLimeState { + LinphoneLimeDisabled, /**< Lime is not used at all */ + LinphoneLimeMandatory, /**< Lime is always used */ + LinphoneLimePreferred, /**< Lime is used only if we already shared a secret with remote */ +} LinphoneLimeState; + /** * Call back used to notify message delivery status * @param msg #LinphoneChatMessage object @@ -2566,8 +2572,8 @@ LINPHONE_PUBLIC bool_t linphone_core_get_guess_hostname(LinphoneCore *lc); * Tells to LinphoneCore to use Linphone Instant Messaging encryption * */ -LINPHONE_PUBLIC void linphone_core_enable_lime(LinphoneCore *lc, bool_t val); -LINPHONE_PUBLIC bool_t linphone_core_lime_enabled(const LinphoneCore *lc); +LINPHONE_PUBLIC void linphone_core_enable_lime(LinphoneCore *lc, LinphoneLimeState val); +LINPHONE_PUBLIC LinphoneLimeState linphone_core_lime_enabled(const LinphoneCore *lc); LINPHONE_PUBLIC bool_t linphone_core_ipv6_enabled(LinphoneCore *lc); LINPHONE_PUBLIC void linphone_core_enable_ipv6(LinphoneCore *lc, bool_t val); diff --git a/coreapi/private.h b/coreapi/private.h index a041c8126..7c9bfbb12 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -153,16 +153,16 @@ struct _LinphoneCallParams{ bool_t has_video; bool_t avpf_enabled; /* RTCP feedback messages are enabled */ bool_t implicit_rtcp_fb; - + bool_t real_early_media; /*send real media even during early media (for outgoing calls)*/ bool_t in_conference; /*in conference mode */ bool_t low_bandwidth; bool_t no_user_consent;/*when set to TRUE an UPDATE request will be used instead of reINVITE*/ - + uint16_t avpf_rr_interval; /*in milliseconds*/ bool_t internal_call_update; /*use mark that call update was requested internally (might be by ice) - unused for the moment*/ bool_t video_multicast_enabled; - + bool_t audio_multicast_enabled; bool_t realtimetext_enabled; bool_t update_call_when_ice_completed; @@ -356,7 +356,7 @@ struct _LinphoneCall{ bool_t paused_by_app; bool_t broken; /*set to TRUE when the call is in broken state due to network disconnection or transport */ - + LinphoneConference *conf_ref; /**> Point on the associated conference if this call is part of a conference. NULL instead. */ }; @@ -399,7 +399,7 @@ void linphone_proxy_config_stop_refreshing(LinphoneProxyConfig *obj); void linphone_proxy_config_write_all_to_config_file(LinphoneCore *lc); void _linphone_proxy_config_release(LinphoneProxyConfig *cfg); void _linphone_proxy_config_unpublish(LinphoneProxyConfig *obj); - + /* * returns service route as defined in as defined by rfc3608, might be a list instead of just one. * Can be NULL @@ -574,6 +574,7 @@ int linphone_chat_room_upload_file(LinphoneChatMessage *msg); void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatMessage *msg); LinphoneChatMessageCbs *linphone_chat_message_cbs_new(void); LinphoneChatRoom *_linphone_core_create_chat_room_from_call(LinphoneCall *call); +bool_t linphone_chat_room_lime_enabled(LinphoneChatRoom *cr); /**/ struct _LinphoneProxyConfig @@ -930,12 +931,12 @@ struct _LinphoneCore bool_t auto_net_state_mon; bool_t sip_network_reachable; bool_t media_network_reachable; - + bool_t network_reachable_to_be_notified; /*set to true when state must be notified in next iterate*/ bool_t use_preview_window; bool_t network_last_status; bool_t ringstream_autorelease; - + bool_t vtables_running; bool_t send_call_stats_periodical_updates; bool_t forced_ice_relay; @@ -1440,14 +1441,14 @@ LINPHONE_PUBLIC void _linphone_core_add_listener(LinphoneCore *lc, LinphoneCoreV LINPHONE_PUBLIC MSWebCam *linphone_call_get_video_device(const LinphoneCall *call); MSWebCam *get_nowebcam_device(MSFactory *f); #endif -bool_t linphone_core_lime_for_file_sharing_enabled(const LinphoneCore *lc); +LinphoneLimeState linphone_core_lime_for_file_sharing_enabled(const LinphoneCore *lc); BELLE_SIP_DECLARE_VPTR(LinphoneTunnelConfig); int linphone_core_get_default_proxy_config_index(LinphoneCore *lc); char *linphone_presence_model_to_xml(LinphonePresenceModel *model) ; - + #ifdef __cplusplus } #endif From 3df89f60e0132af237b15e31e1d812f1e87d05fd Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 25 Feb 2016 12:26:35 +0100 Subject: [PATCH 05/12] gtk: add lime "preferred" choice --- coreapi/friend.c | 6 +++--- coreapi/linphonecore.c | 6 +++++- coreapi/linphonecore.h | 1 + gtk/linphone.h | 1 + gtk/parameters.ui | 34 ++++++++++++++++++---------------- gtk/propertybox.c | 12 +++++++----- 6 files changed, 35 insertions(+), 25 deletions(-) diff --git a/coreapi/friend.c b/coreapi/friend.c index c5e515e20..f0a519d49 100644 --- a/coreapi/friend.c +++ b/coreapi/friend.c @@ -230,7 +230,7 @@ void linphone_friend_remove_incoming_subscription(LinphoneFriend *lf, SalOp *op) sal_op_release(op); lf->insubs = ms_list_remove(lf->insubs, op); } - + } static void linphone_friend_unsubscribe(LinphoneFriend *lf){ @@ -632,7 +632,7 @@ LinphoneFriend * linphone_friend_new_from_config_file(LinphoneCore *lc, int inde if (tmp==NULL) { return NULL; } - lf=linphone_friend_new_with_address(tmp); + lf=linphone_core_create_friend_with_address(lc, tmp); if (lf==NULL) { return NULL; } @@ -742,4 +742,4 @@ BELLE_SIP_INSTANCIATE_VPTR(LinphoneFriend, belle_sip_object_t, NULL, // clone _linphone_friend_marshall, FALSE -); \ No newline at end of file +); diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index a39f28447..6031a8831 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -1862,8 +1862,12 @@ void linphone_core_enable_lime(LinphoneCore *lc, LinphoneLimeState val){ } } +bool_t linphone_core_lime_available(const LinphoneCore *lc){ + return lime_is_available(); +} + LinphoneLimeState linphone_core_lime_enabled(const LinphoneCore *lc){ - return lime_is_available() ? lp_config_get_int(lc->config,"sip", "lime", LinphoneLimeDisabled) : LinphoneLimeDisabled; + return linphone_core_lime_available(lc) ? lp_config_get_int(lc->config,"sip", "lime", LinphoneLimeDisabled) : LinphoneLimeDisabled; } LinphoneLimeState linphone_core_lime_for_file_sharing_enabled(const LinphoneCore *lc){ diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 6494848fe..fc8325c5f 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -2574,6 +2574,7 @@ LINPHONE_PUBLIC bool_t linphone_core_get_guess_hostname(LinphoneCore *lc); */ LINPHONE_PUBLIC void linphone_core_enable_lime(LinphoneCore *lc, LinphoneLimeState val); LINPHONE_PUBLIC LinphoneLimeState linphone_core_lime_enabled(const LinphoneCore *lc); +LINPHONE_PUBLIC bool_t linphone_core_lime_available(const LinphoneCore *lc); LINPHONE_PUBLIC bool_t linphone_core_ipv6_enabled(LinphoneCore *lc); LINPHONE_PUBLIC void linphone_core_enable_ipv6(LinphoneCore *lc, bool_t val); diff --git a/gtk/linphone.h b/gtk/linphone.h index 5ef4b2ea9..041520706 100644 --- a/gtk/linphone.h +++ b/gtk/linphone.h @@ -292,6 +292,7 @@ LINPHONE_PUBLIC void linphone_gtk_mtu_set(GtkWidget *w); LINPHONE_PUBLIC void linphone_gtk_mtu_changed(GtkWidget *w); LINPHONE_PUBLIC void linphone_gtk_use_sip_info_dtmf_toggled(GtkWidget *w); LINPHONE_PUBLIC void linphone_gtk_ipv6_toggled(GtkWidget *w); +LINPHONE_PUBLIC void linphone_gtk_lime_changed(GtkComboBoxText *comboext); LINPHONE_PUBLIC void linphone_gtk_disabled_udp_port_toggle(GtkCheckButton *button); LINPHONE_PUBLIC void linphone_gtk_random_udp_port_toggle(GtkCheckButton *button); LINPHONE_PUBLIC void linphone_gtk_udp_port_value_changed(GtkSpinButton *button); diff --git a/gtk/parameters.ui b/gtk/parameters.ui index 93ad5ffe9..7326a5070 100644 --- a/gtk/parameters.ui +++ b/gtk/parameters.ui @@ -1,6 +1,6 @@ - + -1 @@ -2244,24 +2244,10 @@ True False - 0.49000000953674316 + 0.51999998092651367 Use Lime for outgoing chat messages - - - True - True - False - 0.40000000596046448 - True - - - - 1 - 2 - - True @@ -2289,6 +2275,22 @@ 3 + + + True + False + + Disabled + Mandatory + Preferred + + + + + 1 + 2 + + diff --git a/gtk/propertybox.c b/gtk/propertybox.c index a94322980..60b22b1df 100644 --- a/gtk/propertybox.c +++ b/gtk/propertybox.c @@ -1309,8 +1309,8 @@ void linphone_gtk_set_media_encryption_mandatory(GtkWidget *button){ linphone_core_set_media_encryption_mandatory(linphone_gtk_get_core(),gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))); } -void linphone_gtk_enable_lime(GtkWidget *button){ - linphone_core_enable_lime(linphone_gtk_get_core(), gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button))); +void linphone_gtk_lime_changed(GtkComboBoxText *combotext) { + linphone_core_enable_lime(linphone_gtk_get_core(), gtk_combo_box_get_active(GTK_COMBO_BOX(combotext))); } static void linphone_gtk_show_media_encryption(GtkWidget *pb){ @@ -1366,7 +1366,7 @@ static void linphone_gtk_show_media_encryption(GtkWidget *pb){ LinphoneMediaEncryption menc=linphone_core_get_media_encryption(lc); gtk_widget_show(linphone_gtk_get_widget(pb,"encryption_label")); gtk_widget_show(linphone_gtk_get_widget(pb,"encryption_table")); - + switch(menc){ case LinphoneMediaEncryptionNone: gtk_combo_box_set_active(GTK_COMBO_BOX(combo),0); @@ -1395,8 +1395,10 @@ static void linphone_gtk_show_media_encryption(GtkWidget *pb){ } gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb,"media_encryption_mandatory_checkbox")), linphone_core_is_media_encryption_mandatory(lc)); - gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(pb,"chat_lime_checkbox")), - linphone_core_lime_enabled(lc)); + + gtk_combo_box_set_active(GTK_COMBO_BOX(linphone_gtk_get_widget(pb,"chat_lime_combo")), linphone_core_lime_enabled(lc)); + gtk_widget_set_sensitive(linphone_gtk_get_widget(pb,"chat_lime_combo"), linphone_core_lime_available(lc)); + g_object_unref(G_OBJECT(model)); } From bc2d0a046d7089387b45f89791c76a6e5e592f71 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 25 Feb 2016 14:03:44 +0100 Subject: [PATCH 06/12] fix indirect table overflow with JNI's getFriend() --- coreapi/linphonecore_jni.cc | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index c83d2e27d..48f12f7be 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -498,9 +498,11 @@ jobject getChatMessage(JNIEnv *env, LinphoneChatMessage *msg){ return jobj; } -jobject getFriend(JNIEnv *env, LinphoneFriend *lfriend){ +jobject getFriend(JNIEnv *env, LinphoneFriend *lfriend, int *isLocalRef){ jobject jobj=0; + if (isLocalRef) *isLocalRef = FALSE; + if (lfriend != NULL){ LinphoneCore *lc = linphone_friend_get_core(lfriend); LinphoneJavaBindings *ljb = (LinphoneJavaBindings *)linphone_core_get_user_data(lc); @@ -517,6 +519,9 @@ jobject getFriend(JNIEnv *env, LinphoneFriend *lfriend){ if (jobj == NULL){ jobj=env->NewObject(ljb->friendClass, ljb->friendCtrId, (jlong)lfriend); linphone_friend_set_user_data(lfriend,(void*)env->NewWeakGlobalRef(jobj)); + }else{ + //java object is still valid, we will return a local ref to it. + if (isLocalRef) *isLocalRef = TRUE; } } } @@ -809,6 +814,9 @@ public: static void notify_presence_received(LinphoneCore *lc, LinphoneFriend *my_friend) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); + int isLocalRef = FALSE; + jobject jfriend = NULL; + if (result != 0) { ms_error("cannot attach VM"); return; @@ -820,8 +828,9 @@ public: env->CallVoidMethod(lcData->listener ,ljb->notifyPresenceReceivedId ,lcData->core - ,getFriend(env,my_friend)); + ,(jfriend=getFriend(env,my_friend, &isLocalRef))); handle_possible_java_exception(env, lcData->listener); + if (isLocalRef) env->DeleteLocalRef(jfriend); } static void new_subscription_requested(LinphoneCore *lc, LinphoneFriend *my_friend, const char* url) { JNIEnv *env = 0; @@ -837,7 +846,7 @@ public: env->CallVoidMethod(lcData->listener ,ljb->newSubscriptionRequestId ,lcData->core - ,getFriend(env,my_friend) + ,getFriend(env,my_friend, NULL) ,url ? env->NewStringUTF(url) : NULL); handle_possible_java_exception(env, lcData->listener); } @@ -1965,9 +1974,11 @@ extern "C" jobjectArray Java_org_linphone_core_LinphoneCoreImpl_getFriendList(JN for (int i = 0; i < friendsSize; i++) { LinphoneFriend* lfriend = (LinphoneFriend*)friends->data; - jobject jfriend = getFriend(env,lfriend); + int isLocalRef; + jobject jfriend = getFriend(env,lfriend,&isLocalRef); if(jfriend != NULL){ env->SetObjectArrayElement(jFriends, i, jfriend); + if (isLocalRef) env->DeleteLocalRef(jfriend); } friends = friends->next; } @@ -3254,7 +3265,7 @@ extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_getFriendByAddress(JN LinphoneFriend *lf = linphone_core_get_friend_by_address((LinphoneCore*)ptr, address); env->ReleaseStringUTFChars(jaddress, address); if(lf != NULL) { - jobject jfriend = getFriend(env,lf); + jobject jfriend = getFriend(env,lf, NULL); return jfriend; } else { return NULL; From f38ccbc88a3f0a7ffe8b50e31ebf8fd845b2521d Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 25 Feb 2016 14:44:55 +0100 Subject: [PATCH 07/12] Export correct libraries when building with CMake. --- cmake/LinphoneConfig.cmake.in | 6 +++++- mediastreamer2 | 2 +- oRTP | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmake/LinphoneConfig.cmake.in b/cmake/LinphoneConfig.cmake.in index 9bcd9dfa4..b636612a5 100644 --- a/cmake/LinphoneConfig.cmake.in +++ b/cmake/LinphoneConfig.cmake.in @@ -41,7 +41,11 @@ endif() get_filename_component(LINPHONE_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) set(LINPHONE_INCLUDE_DIRS "${LINPHONE_CMAKE_DIR}/../../../include") -set(LINPHONE_LIBRARIES linphone) +if(@ENABLE_SHARED@) + set(LINPHONE_LIBRARIES linphone) +else() + set(LINPHONE_LIBRARIES linphone-static) +endif() set(LINPHONE_LDFLAGS @LINK_FLAGS@) list(APPEND LINPHONE_INCLUDE_DIRS ${MEDIASTREAMER2_INCLUDE_DIRS} ${BELLESIP_INCLUDE_DIRS}) list(APPEND LINPHONE_LIBRARIES ${MEDIASTREAMER2_LIBRARIES} ${BELLESIP_LIBRARIES}) diff --git a/mediastreamer2 b/mediastreamer2 index 83ace6b88..685beb165 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 83ace6b88dfa819b04c2dc6bca21961f457c90d6 +Subproject commit 685beb165ee050e38ea33eb0e4a1d6a87f7b5520 diff --git a/oRTP b/oRTP index 92b6ef1cf..de0aee3f2 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 92b6ef1cf4884699f07a212f8ceeb06f284fae2c +Subproject commit de0aee3f2024cfd1a24fee5f4ed56be5a2032206 From 07d92908ca10bb934cb12ff153c8e79c501e3826 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 25 Feb 2016 14:46:07 +0100 Subject: [PATCH 08/12] linphonecore.c: linphone_core_sound_resources_locked should return YES if ICE in progress --- coreapi/linphonecore.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index 6031a8831..eb8bcefba 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -7005,6 +7005,11 @@ bool_t linphone_core_sound_resources_locked(LinphoneCore *lc){ MSList *elem; for(elem=lc->calls;elem!=NULL;elem=elem->next) { LinphoneCall *c=(LinphoneCall*)elem->data; + + if (linphone_call_media_in_progress(c)) { + return TRUE; + } + switch (c->state) { case LinphoneCallOutgoingInit: case LinphoneCallOutgoingProgress: From cc981d329a91f1bf0715cbcfd7953c0c94256de3 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Thu, 25 Feb 2016 15:51:28 +0100 Subject: [PATCH 09/12] Fix CMake script to search for zlib. --- cmake/FindZlib.cmake | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/cmake/FindZlib.cmake b/cmake/FindZlib.cmake index 17b2d1e39..f29d2a8db 100644 --- a/cmake/FindZlib.cmake +++ b/cmake/FindZlib.cmake @@ -26,10 +26,6 @@ # ZLIB_INCLUDE_DIRS - the zlib include directory # ZLIB_LIBRARIES - The libraries needed to use zlib -set(_ZLIB_ROOT_PATHS - ${CMAKE_INSTALL_PREFIX} -) - find_path(ZLIB_INCLUDE_DIRS NAMES zlib.h HINTS _ZLIB_ROOT_PATHS @@ -41,20 +37,13 @@ if(ZLIB_INCLUDE_DIRS) endif() if(ENABLE_STATIC) - if(IOS OR QNX) - set(_ZLIB_STATIC_NAMES z) - else() - set(_ZLIB_STATIC_NAMES zstatic zlibstatic zlibstaticd) - endif() find_library(ZLIB_LIBRARIES - NAMES ${_ZLIB_STATIC_NAMES} - HINTS ${_ZLIB_ROOT_PATHS} + NAMES zstatic zlibstatic zlibstaticd z PATH_SUFFIXES bin lib ) else() find_library(ZLIB_LIBRARIES NAMES z zlib zlibd - HINTS ${_ZLIB_ROOT_PATHS} PATH_SUFFIXES bin lib ) endif() From 3df8f6f3d236e991a5b1cca41137255717ce8fe7 Mon Sep 17 00:00:00 2001 From: Jehan Monnier Date: Thu, 25 Feb 2016 16:22:29 +0100 Subject: [PATCH 10/12] set rpath for liblinphone_tester --- README | 1 + tester/Makefile.am | 2 ++ 2 files changed, 3 insertions(+) diff --git a/README b/README index 7e0b97524..7b54bdd42 100644 --- a/README +++ b/README @@ -11,6 +11,7 @@ This is Linphone, a free (GPL) video softphone based on the SIP protocol. - belle-sip>=1.3.0 - speex>=1.2.0 (including libspeexdsp part) - libxml2 + - bctoolbox + if you want the gtk/glade interface: - libgtk >=2.16.0 diff --git a/tester/Makefile.am b/tester/Makefile.am index 40dabb7e2..3a16c9ae1 100644 --- a/tester/Makefile.am +++ b/tester/Makefile.am @@ -161,6 +161,8 @@ AM_CFLAGS += $(LIBGTK_CFLAGS) $(LIBGTKMAC_CFLAGS) -DHAVE_GTK endif +AM_LDFLAGS=-Wl,-rpath -Wl,$(libdir) + bin_PROGRAMS= if !BUILD_IOS From 30e504c26342d6a319f4320c3e306c9e6b8fec88 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 25 Feb 2016 16:40:46 +0100 Subject: [PATCH 11/12] TunnelManager.cc: invoke sal_set_tunnel when destroying tunnel --- coreapi/TunnelManager.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/coreapi/TunnelManager.cc b/coreapi/TunnelManager.cc index 99e84f293..b74baedb2 100644 --- a/coreapi/TunnelManager.cc +++ b/coreapi/TunnelManager.cc @@ -165,6 +165,7 @@ TunnelManager::~TunnelManager(){ udpMirror->stop(); } if(mTunnelClient) delete mTunnelClient; + sal_set_tunnel(mCore->sal,NULL); linphone_core_remove_listener(mCore, mVTable); linphone_core_v_table_destroy(mVTable); } @@ -197,7 +198,7 @@ void TunnelManager::processTunnelEvent(const Event &ev){ _linphone_core_apply_transports(mCore); doRegistration(); } - + } } else { ms_error("TunnelManager: tunnel has been disconnected"); @@ -336,6 +337,7 @@ void TunnelManager::processUdpMirrorEvent(const Event &ev){ ms_message("TunnelManager: UDP mirror test succeed"); if(mTunnelClient) { if(mTunnelizeSipPackets) doUnregistration(); + sal_set_tunnel(mCore->sal,NULL); delete mTunnelClient; mTunnelClient = NULL; if(mTunnelizeSipPackets) doRegistration(); From 4b91e2b029a1f313c2211c86ee43659719eb1db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Fri, 26 Feb 2016 13:48:36 +0100 Subject: [PATCH 12/12] Add a pre-condition to linphone_conference_remove_participant() --- coreapi/conference.cc | 18 ++++++++++++++---- coreapi/conference.h | 1 + 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/coreapi/conference.cc b/coreapi/conference.cc index 215f5d462..02f6d3763 100644 --- a/coreapi/conference.cc +++ b/coreapi/conference.cc @@ -686,15 +686,25 @@ int RemoteConference::addParticipant(LinphoneCall *call) { } int RemoteConference::removeParticipant(const LinphoneAddress *uri) { - char *tmp, *refer_to; + char *refer_to; + LinphoneAddress *refer_to_addr; int res; switch(m_state) { case LinphoneConferenceReady: - tmp = linphone_address_as_string_uri_only(uri); - refer_to = ms_strdup_printf("%s;method=BYE", tmp); + if(findParticipant(uri) == NULL) { + char *tmp = linphone_address_as_string(uri); + ms_error("Conference: could not remove participant '%s': not in the participants list", tmp); + ms_free(tmp); + return -1; + } + +// refer_to = ms_strdup_printf("%s;method=BYE", tmp); + refer_to_addr = linphone_address_clone(uri); + linphone_address_set_method_param(refer_to_addr, "BYE"); + refer_to = linphone_address_as_string(refer_to_addr); + linphone_address_unref(refer_to_addr); res = sal_call_refer(m_focusCall->op, refer_to); - ms_free(tmp); ms_free(refer_to); if(res == 0) { diff --git a/coreapi/conference.h b/coreapi/conference.h index cc9762bf1..d14ff2f9d 100644 --- a/coreapi/conference.h +++ b/coreapi/conference.h @@ -86,6 +86,7 @@ LINPHONE_PUBLIC bool_t linphone_conference_params_video_requested(const Linphone * Remove a participant from a conference * @param obj A #LinphoneConference * @param uri SIP URI of the participant to remove + * @warning The passed SIP URI must be one of the URIs returned by linphone_conference_get_participants() * @return 0 if succeeded, -1 if failed */ LINPHONE_PUBLIC int linphone_conference_remove_participant(LinphoneConference *obj, const LinphoneAddress *uri);