From a6af82fc864e809d98094820f07d7dd4470edf34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Grisez?= Date: Tue, 3 Nov 2015 10:42:37 +0100 Subject: [PATCH 01/19] Fix bug in the setup wizard Prevent the user to go next until its account is validated while a new account has been created --- gtk/setup_wizard.ui | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gtk/setup_wizard.ui b/gtk/setup_wizard.ui index 65b106a77..337163f3d 100644 --- a/gtk/setup_wizard.ui +++ b/gtk/setup_wizard.ui @@ -28,6 +28,9 @@ + + + True @@ -715,7 +718,6 @@ Please go back and try again. Error - True From 22e116014c8b9fbd07bfb99243dc990b6979c554 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Tue, 3 Nov 2015 12:46:37 +0100 Subject: [PATCH 02/19] proxy.c: fix overflow in linphone_proxy_config_normalize_phone_number API resulting in invalid writes --- coreapi/proxy.c | 12 ++++--- tester/proxy_config_tester.c | 63 ++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 5 deletions(-) diff --git a/coreapi/proxy.c b/coreapi/proxy.c index ae60dd071..918c6d1b8 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -868,15 +868,15 @@ char* linphone_proxy_config_normalize_phone_number(LinphoneProxyConfig *proxy, c if (linphone_proxy_config_is_phone_number(tmpproxy, username)){ dial_plan_t dialplan = {0}; char * flatten=flatten_number(username); - ms_debug("Flattened number is '%s'",flatten); + ms_error("Flattened number is '%s' for '%s'",flatten, username); /*if proxy has a dial prefix, modify phonenumber accordingly*/ if (tmpproxy->dial_prefix!=NULL && tmpproxy->dial_prefix[0]!='\0'){ lookup_dial_plan_by_ccc(tmpproxy->dial_prefix,&dialplan); - ms_debug("Using dial plan '%s'",dialplan.country); + ms_error("Using dial plan '%s'",dialplan.country); /* the number already starts with + or international prefix*/ if (flatten[0]=='+'||strstr(flatten,dialplan.icp)==flatten){ - ms_debug("Prefix already present."); + ms_error("Prefix already present."); if (tmpproxy->dial_escape_plus) { result = replace_plus_with_icp(flatten,dialplan.icp); } else { @@ -884,15 +884,17 @@ char* linphone_proxy_config_normalize_phone_number(LinphoneProxyConfig *proxy, c } }else{ /*0. keep at most national number significant digits */ - char* flatten_start = flatten + MAX(0, strlen(flatten) - dialplan.nnl); + char* flatten_start = flatten + MAX(0, (int)strlen(flatten) - (int)dialplan.nnl); + ms_error("Prefix not present. Keeping at most %d digits: %s", dialplan.nnl, flatten_start); + /*1. First prepend international calling prefix or +*/ /*2. Second add prefix*/ /*3. Finally add user digits */ - result = ms_strdup_printf("%s%s%s" , tmpproxy->dial_escape_plus ? dialplan.icp : "+" , dialplan.ccc , flatten_start); + ms_error("Prepended prefix resulted in %s", result); } } if (result==NULL) { diff --git a/tester/proxy_config_tester.c b/tester/proxy_config_tester.c index ac8e266a5..771403e84 100644 --- a/tester/proxy_config_tester.c +++ b/tester/proxy_config_tester.c @@ -41,6 +41,18 @@ static void phone_normalization_without_proxy(void) { BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "+3301234567891"), "+3301234567891"); BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "+33 01234567891"), "+3301234567891"); BC_ASSERT_PTR_NULL(phone_normalization(NULL, "I_AM_NOT_A_NUMBER")); // invalid phone number + + BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "0"), "0"); + BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "01"), "01"); + BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "012"), "012"); + BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "0123"), "0123"); + BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "01234"), "01234"); + BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "012345"), "012345"); + BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "0123456"), "0123456"); + BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "01234567"), "01234567"); + BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "012345678"), "012345678"); + BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "0123456789"), "0123456789"); + BC_ASSERT_STRING_EQUAL(phone_normalization(NULL, "01234567890"), "01234567890"); } static void phone_normalization_with_proxy(void) { @@ -70,8 +82,45 @@ static void phone_normalization_with_proxy(void) { BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0033952636505"), "+33952636505"); BC_ASSERT_PTR_NULL(phone_normalization(proxy, "toto")); + + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0"), "+330"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "01"), "+3301"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "012"), "+33012"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0123"), "+330123"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "01234"), "+3301234"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "012345"), "+33012345"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0123456"), "+330123456"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "01234567"), "+3301234567"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "012345678"), "+33012345678"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0123456789"), "+33123456789"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "01234567890"), "+33234567890"); + + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+330"), "+330"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+3301"), "+3301"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+33012"), "+33012"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+330123"), "+330123"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+3301234"), "+3301234"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+33012345"), "+33012345"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+330123456"), "+330123456"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+3301234567"), "+3301234567"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+33012345678"), "+33012345678"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+330123456789"), "+330123456789"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+3301234567890"), "+3301234567890"); + + // invalid prefix - use a generic dialplan with 10 max length linphone_proxy_config_set_dial_prefix(proxy, "99"); BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0012345678"), "+12345678"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0"), "+990"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "01"), "+9901"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "012"), "+99012"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0123"), "+990123"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "01234"), "+9901234"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "012345"), "+99012345"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0123456"), "+990123456"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "01234567"), "+9901234567"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "012345678"), "+99012345678"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0123456789"), "+990123456789"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "01234567890"), "+991234567890"); linphone_proxy_config_destroy(proxy); } @@ -83,6 +132,20 @@ static void phone_normalization_with_dial_escape_plus(void){ BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0033952636505"), "0033952636505"); BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0952636505"), "0033952636505"); BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "+34952636505"), "0034952636505"); + + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0"), "00330"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "01"), "003301"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "012"), "0033012"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0123"), "00330123"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "01234"), "003301234"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "012345"), "0033012345"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0123456"), "00330123456"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "01234567"), "003301234567"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "012345678"), "0033012345678"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "0123456789"), "0033123456789"); + BC_ASSERT_STRING_EQUAL(phone_normalization(proxy, "01234567890"), "0033234567890"); + + linphone_proxy_config_destroy(proxy); } From 0f6874a96ebf347d6e38c24592fbc047082713a3 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Tue, 3 Nov 2015 14:34:43 +0100 Subject: [PATCH 03/19] proxy.c: remove debug statements --- coreapi/proxy.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 918c6d1b8..1543f5ab1 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -868,15 +868,15 @@ char* linphone_proxy_config_normalize_phone_number(LinphoneProxyConfig *proxy, c if (linphone_proxy_config_is_phone_number(tmpproxy, username)){ dial_plan_t dialplan = {0}; char * flatten=flatten_number(username); - ms_error("Flattened number is '%s' for '%s'",flatten, username); + ms_debug("Flattened number is '%s' for '%s'",flatten, username); /*if proxy has a dial prefix, modify phonenumber accordingly*/ if (tmpproxy->dial_prefix!=NULL && tmpproxy->dial_prefix[0]!='\0'){ lookup_dial_plan_by_ccc(tmpproxy->dial_prefix,&dialplan); - ms_error("Using dial plan '%s'",dialplan.country); + ms_debug("Using dial plan '%s'",dialplan.country); /* the number already starts with + or international prefix*/ if (flatten[0]=='+'||strstr(flatten,dialplan.icp)==flatten){ - ms_error("Prefix already present."); + ms_debug("Prefix already present."); if (tmpproxy->dial_escape_plus) { result = replace_plus_with_icp(flatten,dialplan.icp); } else { @@ -885,7 +885,7 @@ char* linphone_proxy_config_normalize_phone_number(LinphoneProxyConfig *proxy, c }else{ /*0. keep at most national number significant digits */ char* flatten_start = flatten + MAX(0, (int)strlen(flatten) - (int)dialplan.nnl); - ms_error("Prefix not present. Keeping at most %d digits: %s", dialplan.nnl, flatten_start); + ms_debug("Prefix not present. Keeping at most %d digits: %s", dialplan.nnl, flatten_start); /*1. First prepend international calling prefix or +*/ /*2. Second add prefix*/ @@ -894,7 +894,7 @@ char* linphone_proxy_config_normalize_phone_number(LinphoneProxyConfig *proxy, c , tmpproxy->dial_escape_plus ? dialplan.icp : "+" , dialplan.ccc , flatten_start); - ms_error("Prepended prefix resulted in %s", result); + ms_debug("Prepended prefix resulted in %s", result); } } if (result==NULL) { From 4385557cd8e4b82d74194db094edabe8dd708c35 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 3 Nov 2015 14:36:15 +0100 Subject: [PATCH 04/19] add LinphoneCallLog.getCallId() java wrapper --- coreapi/linphonecore_jni.cc | 10 ++++++++++ java/common/org/linphone/core/LinphoneCallLog.java | 4 ++-- java/impl/org/linphone/core/LinphoneCallLogImpl.java | 4 ++-- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 7cc1edf23..6ff983bbc 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -6465,3 +6465,13 @@ JNIEXPORT void JNICALL Java_org_linphone_core_TunnelConfigImpl_destroy(JNIEnv *e } +/* + * Class: org_linphone_core_LinphoneCallLogImpl + * Method: getCallId + * Signature: (J)I + */ +JNIEXPORT jstring JNICALL Java_org_linphone_core_LinphoneCallLogImpl_getCallId(JNIEnv *env, jobject jobj, jlong pcl){ + const char *str = linphone_call_log_get_call_id((LinphoneCallLog*)pcl); + return str ? env->NewStringUTF(str) : NULL; +} + diff --git a/java/common/org/linphone/core/LinphoneCallLog.java b/java/common/org/linphone/core/LinphoneCallLog.java index f1dd742b3..67b1977e1 100644 --- a/java/common/org/linphone/core/LinphoneCallLog.java +++ b/java/common/org/linphone/core/LinphoneCallLog.java @@ -118,7 +118,7 @@ public interface LinphoneCallLog { public int getCallDuration(); /** * Call id from signaling - * @return int + * @return the SIP call-id. */ - public int getCallId(); + public String getCallId(); } diff --git a/java/impl/org/linphone/core/LinphoneCallLogImpl.java b/java/impl/org/linphone/core/LinphoneCallLogImpl.java index 7078a2a9f..3c78e4046 100644 --- a/java/impl/org/linphone/core/LinphoneCallLogImpl.java +++ b/java/impl/org/linphone/core/LinphoneCallLogImpl.java @@ -29,7 +29,7 @@ class LinphoneCallLogImpl implements LinphoneCallLog { private native int getStatus(long nativePtr); private native String getStartDate(long nativePtr); private native int getCallDuration(long nativePtr); - private native int getCallId(long nativePtr); + private native String getCallId(long nativePtr); private native long getTimestamp(long nativePtr); LinphoneCallLogImpl(long aNativePtr) { @@ -62,7 +62,7 @@ class LinphoneCallLogImpl implements LinphoneCallLog { public int getCallDuration() { return getCallDuration(nativePtr); } - public int getCallId() { + public String getCallId() { return getCallId(nativePtr); } From 280d2ad3bf3eeef60eca009394353336606baadf Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 3 Nov 2015 15:25:55 +0100 Subject: [PATCH 05/19] Fixed test with custom rtp transport modifier (sometimes on_send was called more often than on_schedule, causing packet loss) --- tester/call_tester.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tester/call_tester.c b/tester/call_tester.c index 8424bdff2..7ac14e7f5 100644 --- a/tester/call_tester.c +++ b/tester/call_tester.c @@ -4871,8 +4871,8 @@ end: typedef struct _RtpTransportModifierData { uint64_t packetSentCount; uint64_t packetReceivedCount; - mblk_t *msg_to_send; - mblk_t *msg_to_recv; + MSQueue to_send; + MSQueue to_recv; } RtpTransportModifierData; const char *XOR_KEY = "BELLEDONNECOMMUNICATIONS"; @@ -4889,7 +4889,7 @@ static int rtptm_on_send(RtpTransportModifier *rtptm, mblk_t *msg) { } data->packetSentCount += 1; - data->msg_to_send = dupmsg(msg); + ms_queue_put(&data->to_send, dupmsg(msg)); return 0; // Return 0 to drop the packet, it will be injected later } @@ -4905,15 +4905,15 @@ static int rtptm_on_receive(RtpTransportModifier *rtptm, mblk_t *msg) { } data->packetReceivedCount += 1; - data->msg_to_recv = dupmsg(msg); + ms_queue_put(&data->to_recv, dupmsg(msg)); return 0; // Return 0 to drop the packet, it will be injected later } static void rtptm_on_schedule(RtpTransportModifier *rtptm) { RtpTransportModifierData *data = rtptm->data; + mblk_t *msg = NULL; - if (data->msg_to_send != NULL) { - mblk_t *msg = data->msg_to_send; + while ((msg = ms_queue_get(&data->to_send)) != NULL) { int size = 0; unsigned char *src; int i = 0; @@ -4931,11 +4931,10 @@ static void rtptm_on_schedule(RtpTransportModifier *rtptm) { } meta_rtp_transport_modifier_inject_packet_to_send(rtptm->transport, rtptm, msg, 0); - data->msg_to_send = NULL; } - if (data->msg_to_recv != NULL) { - mblk_t *msg = data->msg_to_recv; + msg = NULL; + while ((msg = ms_queue_get(&data->to_recv)) != NULL) { int size = 0; unsigned char *src; int i = 0; @@ -4950,7 +4949,6 @@ static void rtptm_on_schedule(RtpTransportModifier *rtptm) { } meta_rtp_transport_modifier_inject_packet_to_recv(rtptm->transport, rtptm, msg, 0); - data->msg_to_recv = NULL; } } @@ -4969,6 +4967,8 @@ void static call_state_changed_4(LinphoneCore *lc, LinphoneCall *call, LinphoneC RtpTransport *rtpt = NULL; RtpTransportModifierData *data = ms_new0(RtpTransportModifierData, 1); RtpTransportModifier *rtptm = ms_new0(RtpTransportModifier, 1); + ms_queue_init(&data->to_send); + ms_queue_init(&data->to_recv); rtptm->data = data; rtptm->t_process_on_send = rtptm_on_send; rtptm->t_process_on_receive = rtptm_on_receive; @@ -5133,7 +5133,8 @@ static void custom_rtp_modifier(bool_t pauseResumeTest, bool_t recordTest) { ms_message("Pauline sent %i RTP packets and received %i (for real)", (int)pauline_rtp_stats.packet_sent, (int)pauline_rtp_stats.packet_recv); BC_ASSERT_TRUE(data_marie->packetReceivedCount == marie_rtp_stats.packet_recv); BC_ASSERT_TRUE(data_marie->packetSentCount == marie_rtp_stats.packet_sent); - BC_ASSERT_TRUE(data_pauline->packetReceivedCount == pauline_rtp_stats.packet_recv); + // There can be a small difference between the number of packets received in the modifier and the number processed in reception because the processing is asynchronous + BC_ASSERT_TRUE(data_pauline->packetReceivedCount - pauline_rtp_stats.packet_recv < 20); BC_ASSERT_TRUE(data_pauline->packetSentCount == pauline_rtp_stats.packet_sent); } From e1477de9ffb9dde1998c73a8200a6036a68e0306 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 3 Nov 2015 16:42:15 +0100 Subject: [PATCH 06/19] Update oRTP and ms2 submodules. --- mediastreamer2 | 2 +- oRTP | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mediastreamer2 b/mediastreamer2 index e1ef3c611..0fd136f2d 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit e1ef3c611053df919b962be8b77d40b7c1d11b5f +Subproject commit 0fd136f2d194b154a8580231773556b3c2e4403f diff --git a/oRTP b/oRTP index 055c29e5b..f1e68f67a 160000 --- a/oRTP +++ b/oRTP @@ -1 +1 @@ -Subproject commit 055c29e5b3be15ada48c7c6b195e6f6ee732c0c0 +Subproject commit f1e68f67a0701667d39037f53b36f0a380b1219c From 7f2a985d84dc875f279498faf2861261d45f3066 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 3 Nov 2015 17:40:24 +0100 Subject: [PATCH 07/19] Handle strict compilation flags when building with CMake. --- CMakeLists.txt | 46 +++++++++++++++++++++++++++++++----------- console/CMakeLists.txt | 1 + coreapi/CMakeLists.txt | 14 ++++++++----- gtk/CMakeLists.txt | 1 + tester/CMakeLists.txt | 4 +++- tools/CMakeLists.txt | 1 + 6 files changed, 49 insertions(+), 18 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e89ccdb4..7e9e6e7c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ option(ENABLE_LIME "Enable Instant Messaging Encryption." NO) option(ENABLE_MSG_STORAGE "Turn on compilation of message storage." YES) cmake_dependent_option(ENABLE_NOTIFY "Enable libnotify support." YES "ENABLE_GTK_UI" NO) option(ENABLE_RELATIVE_PREFIX "Find resources relatively to the installation directory." NO) +option(ENABLE_STRICT "Build with strict compile options." YES) option(ENABLE_TOOLS "Turn on or off compilation of tools." YES) option(ENABLE_TUNNEL "Turn on compilation of tunnel support." NO) option(ENABLE_TUTORIALS "Enable compilation of tutorials." YES) @@ -58,6 +59,22 @@ option(ENABLE_NLS "Build with internationalisation support" YES) option(ENABLE_CALL_LOGS_STORAGE "Turn on compilation of call logs storage." YES) +macro(apply_compile_flags SOURCE_FILES) + if(${SOURCE_FILES}) + set(options "") + foreach(a ${ARGV}) + if(STRICT_OPTIONS_${a}) + string(REPLACE ";" " " options_${a} "${STRICT_OPTIONS_${a}}") + set(options "${options} ${options_${a}}") + endif() + endforeach() + if(options) + set_source_files_properties(${${SOURCE_FILES}} PROPERTIES COMPILE_FLAGS "${options}") + endif() + endif() +endmacro() + + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") include(CheckSymbolExists) @@ -197,22 +214,27 @@ if(ENABLE_DEBUG_LOGS) add_definitions("-DDEBUG") endif() -if(MSVC) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W3") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3") -else() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wuninitialized -Wdeclaration-after-statement -fno-strict-aliasing -Werror") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wuninitialized -Werror") +set(STRICT_OPTIONS_CPP ) +set(STRICT_OPTIONS_C ) +set(STRICT_OPTIONS_OBJC ) +if(NOT MSVC) + list(APPEND STRICT_OPTIONS_CPP "-Wall" "-Wuninitialized") + list(APPEND STRICT_OPTIONS_C "-Wdeclaration-after-statement") if(CMAKE_C_COMPILER_ID STREQUAL "Clang") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -Wno-array-bounds") - endif() - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -Wno-array-bounds") + list(APPEND STRICT_OPTIONS_CPP "-Qunused-arguments" "-Wno-array-bounds") endif() if(APPLE) - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-error=unknown-warning-option -Wno-tautological-compare -Wno-unused-function") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=unknown-warning-option -Wno-tautological-compare -Wno-unused-function") + list(APPEND STRICT_OPTIONS_CPP "-Wno-error=unknown-warning-option" "-Qunused-arguments" "-Wno-tautological-compare" "-Wno-unused-function" "-Wno-array-bounds") endif() + if(ENABLE_STRICT) + list(APPEND STRICT_OPTIONS_CPP "-Werror" "-fno-strict-aliasing") + endif() +endif() +if(STRICT_OPTIONS_CPP) + list(REMOVE_DUPLICATES STRICT_OPTIONS_CPP) +endif() +if(STRICT_OPTIONS_C) + list(REMOVE_DUPLICATES STRICT_OPTIONS_C) endif() diff --git a/console/CMakeLists.txt b/console/CMakeLists.txt index 328fdbcf2..4b7f4df24 100644 --- a/console/CMakeLists.txt +++ b/console/CMakeLists.txt @@ -29,6 +29,7 @@ set(LINPHONECSH_SOURCE_FILES shell.c ) +apply_compile_flags(LINPHONEC_SOURCE_FILES "CPP" "C") add_executable(linphonec ${LINPHONEC_SOURCE_FILES}) target_link_libraries(linphonec linphone) diff --git a/coreapi/CMakeLists.txt b/coreapi/CMakeLists.txt index 238db5bd4..2f2d59712 100644 --- a/coreapi/CMakeLists.txt +++ b/coreapi/CMakeLists.txt @@ -50,7 +50,7 @@ set(LINPHONE_HEADER_FILES xmlrpc.h ) -set(LINPHONE_SOURCE_FILES +set(LINPHONE_SOURCE_FILES_C account_creator.c address.c authentication.c @@ -111,15 +111,16 @@ set(LINPHONE_SOURCE_FILES xmlrpc.c vtables.c ) +set(LINPHONE_SOURCE_FILES_CXX ) if(ENABLE_TUNNEL) - list(APPEND LINPHONE_SOURCE_FILES + list(APPEND LINPHONE_SOURCE_FILES_CXX linphone_tunnel.cc TunnelManager.cc ) add_definitions(-DTUNNEL_ENABLED) else() - list(APPEND LINPHONE_SOURCE_FILES linphone_tunnel_stubs.c) + list(APPEND LINPHONE_SOURCE_FILES_C linphone_tunnel_stubs.c) endif() find_package(Git) @@ -133,6 +134,9 @@ add_definitions( -DLIBLINPHONE_EXPORTS ) +apply_compile_flags(LINPHONE_SOURCE_FILES_C "CPP" "C") +apply_compile_flags(LINPHONE_SOURCE_FILES_CXX "CPP" "CXX") + set(LIBS ${BELLESIP_LIBRARIES} ${MEDIASTREAMER2_LIBRARIES} @@ -161,10 +165,10 @@ if(INTL_FOUND) endif() if(ENABLE_STATIC) - add_library(linphone STATIC ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES}) + add_library(linphone STATIC ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX}) target_link_libraries(linphone ${LIBS}) else() - add_library(linphone SHARED ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES}) + add_library(linphone SHARED ${LINPHONE_HEADER_FILES} ${LINPHONE_SOURCE_FILES_C} ${LINPHONE_SOURCE_FILES_CXX}) set_target_properties(linphone PROPERTIES VERSION ${LINPHONE_SO_VERSION} LINKER_LANGUAGE CXX) target_link_libraries(linphone ${LIBS}) if(MSVC) diff --git a/gtk/CMakeLists.txt b/gtk/CMakeLists.txt index 604a845d3..ce3166cc3 100644 --- a/gtk/CMakeLists.txt +++ b/gtk/CMakeLists.txt @@ -78,6 +78,7 @@ if(WIN32) list(APPEND SOURCE_FILES linphone.rc) endif() +apply_compile_flags(SOURCE_FILES "CPP" "C") if(WIN32) add_executable(linphone-gtk WIN32 ${SOURCE_FILES}) else() diff --git a/tester/CMakeLists.txt b/tester/CMakeLists.txt index 656de9bfe..7ed25ecaa 100644 --- a/tester/CMakeLists.txt +++ b/tester/CMakeLists.txt @@ -46,7 +46,9 @@ set(SOURCE_FILES tunnel_tester.c upnp_tester.c video_tester.c - ) +) + +apply_compile_flags(SOURCE_FILES "CPP" "C") #executable must be available on root path, not host one find_program(SIPP_PROGRAM NAMES sipp sipp.exe ONLY_CMAKE_FIND_ROOT_PATH) diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 6d383a4a7..104f2346c 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -43,6 +43,7 @@ set(LP_GEN_WRAPPERS_LIBS ${XML2_LIBRARIES} ) +apply_compile_flags(LP_GEN_WRAPPERS_SOURCE_FILES "CPP" "CXX") add_executable(lp-gen-wrappers ${LP_GEN_WRAPPERS_SOURCE_FILES}) target_link_libraries(lp-gen-wrappers ${LP_GEN_WRAPPERS_LIBS}) From b0647d6638bba9b9d9593f48eda21e419add4a4d Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 3 Nov 2015 17:55:22 +0100 Subject: [PATCH 08/19] Update ms2 submodule. --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index 0fd136f2d..e8eb77dca 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit 0fd136f2d194b154a8580231773556b3c2e4403f +Subproject commit e8eb77dca5ef04f1517e5403f1e1f8177aafd218 From 8b6433fad51f4beae712c0e6109cfe01da3469bf Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 3 Nov 2015 17:55:30 +0100 Subject: [PATCH 09/19] Fix build on Windows. --- tester/message_tester.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tester/message_tester.c b/tester/message_tester.c index 756d8ee73..0e9aa0adf 100644 --- a/tester/message_tester.c +++ b/tester/message_tester.c @@ -1557,7 +1557,7 @@ static void real_time_text_message_accented_chars() { BC_ASSERT_EQUAL(linphone_chat_room_get_char(marie_chat_room), message[i], unsigned long, "%lu"); } - _linphone_chat_room_send_message(pauline_chat_room, rtt_message); + linphone_chat_room_send_chat_message(pauline_chat_room, rtt_message); BC_ASSERT_TRUE(wait_for(pauline->lc, marie->lc, &marie->stat.number_of_LinphoneMessageReceived, 1)); BC_ASSERT_EQUAL(strcmp(marie->stat.last_received_chat_message->message, "ãæçéîøùÿ"), 0, int, "%i"); } From eb172d1049fdba9cf713287b6dcfadcf17096856 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Tue, 3 Nov 2015 18:10:31 +0100 Subject: [PATCH 10/19] Update ms2 submodule. --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index e8eb77dca..c550e08a0 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit e8eb77dca5ef04f1517e5403f1e1f8177aafd218 +Subproject commit c550e08a0564490791731aa4e9223dc881ebd3a4 From faa60922366ddb62f35ec4fe05bfd4bc8fc87aa6 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Tue, 3 Nov 2015 18:29:47 +0100 Subject: [PATCH 11/19] fix crashes in android when doing things with LinphoneCore within the globalStateChanged callbacks. Add wrappers for the http proxy api. --- coreapi/linphonecore_jni.cc | 55 +++++++++++++++++++ .../org/linphone/core/LinphoneCore.java | 18 ++++++ .../org/linphone/core/LinphoneCoreImpl.java | 23 ++++++++ 3 files changed, 96 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 6ff983bbc..df6699c40 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -659,6 +659,15 @@ public: env->DeleteLocalRef(d); } } + static void setCoreIfNotDone(JNIEnv *env, jobject jcore, LinphoneCore *lc){ + jclass objClass = env->GetObjectClass(jcore); + jfieldID myFieldID = env->GetFieldID(objClass, "nativePtr", "J"); + jlong fieldVal = env->GetLongField(jcore, myFieldID); + if (fieldVal == 0){ + env->SetLongField(jcore, myFieldID, (jlong)lc); + } + } + static void globalStateChange(LinphoneCore *lc, LinphoneGlobalState gstate,const char* message) { JNIEnv *env = 0; jint result = jvm->AttachCurrentThread(&env,NULL); @@ -668,6 +677,11 @@ public: } LinphoneCoreVTable *table = linphone_core_get_current_vtable(lc); LinphoneCoreData* lcData = (LinphoneCoreData*)linphone_core_v_table_get_user_data(table); + + jobject jcore = lcData->core; + /*at this stage, the java object may not be aware of its C object, because linphone_core_new() hasn't returned yet.*/ + setCoreIfNotDone(env,jcore, lc); + jstring msg = message ? env->NewStringUTF(message) : NULL; env->CallVoidMethod(lcData->listener ,lcData->globalStateId @@ -6475,3 +6489,44 @@ JNIEXPORT jstring JNICALL Java_org_linphone_core_LinphoneCallLogImpl_getCallId(J return str ? env->NewStringUTF(str) : NULL; } +/* + * Class: org_linphone_core_LinphoneCoreImpl + * Method: setHttpProxyHost + * Signature: (JLjava/lang/String;)V + */ +JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_setHttpProxyHost(JNIEnv *env, jobject jobj, jlong core, jstring jhost){ + const char *host = jhost ? env->GetStringUTFChars(jhost, NULL) : NULL; + linphone_core_set_http_proxy_host((LinphoneCore*)core, host); + if (host) env->ReleaseStringUTFChars(jhost, host); +} + +/* + * Class: org_linphone_core_LinphoneCoreImpl + * Method: setHttpProxyPort + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_setHttpProxyPort(JNIEnv *env, jobject jobj, jlong core, jint port){ + linphone_core_set_http_proxy_port((LinphoneCore*)core, port); +} + +/* + * Class: org_linphone_core_LinphoneCoreImpl + * Method: getHttpProxyHost + * Signature: (J)Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_linphone_core_LinphoneCoreImpl_getHttpProxyHost(JNIEnv *env , jobject jobj, jlong core){ + const char * host = linphone_core_get_http_proxy_host((LinphoneCore *)core); + return host ? env->NewStringUTF(host) : NULL; +} + +/* + * Class: org_linphone_core_LinphoneCoreImpl + * Method: getHttpProxyPort + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCoreImpl_getHttpProxyPort(JNIEnv *env, jobject jobj, jlong core){ + return linphone_core_get_http_proxy_port((LinphoneCore *)core); +} + + + diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 70c71d799..595b1a2e9 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -2179,4 +2179,22 @@ public interface LinphoneCore { * Get the provisioning URI previously set. **/ public String getProvisioningUri(); + + /** + * Set an http proxy hostname or IP address to use for SIP connection. + */ + public void setHttpProxyHost(String host); + /** + * Set an http proxy port to use for SIP connection. + */ + public void setHttpProxyPort(int port); + /** + * Get the http proxy host previously set. + **/ + public String getHttpProxyHost(); + /** + * Get the http proxy port previously set. + **/ + public int getHttpProxyPort(); + } diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index 297ebc0f1..7f2bdfd34 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -1535,4 +1535,27 @@ class LinphoneCoreImpl implements LinphoneCore { public GlobalState getGlobalState(){ return GlobalState.fromInt(getGlobalState(nativePtr)); } + private native void setHttpProxyHost(long nativePtr, String host); + @Override + public void setHttpProxyHost(String host){ + setHttpProxyHost(nativePtr, host); + } + + private native void setHttpProxyPort(long nativePtr, int port); + @Override + public void setHttpProxyPort(int port){ + setHttpProxyPort(nativePtr, port); + } + + private native String getHttpProxyHost(long nativePtr); + @Override + public String getHttpProxyHost(){ + return getHttpProxyHost(nativePtr); + } + + private native int getHttpProxyPort(long nativePtr); + @Override + public int getHttpProxyPort(){ + return getHttpProxyPort(nativePtr); + } } From e7e063352edf09ab43a84ee62a40c5e4111ab7e0 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 4 Nov 2015 11:08:37 +0100 Subject: [PATCH 12/19] Update ms2 submodule. --- mediastreamer2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mediastreamer2 b/mediastreamer2 index c550e08a0..ecba8b90c 160000 --- a/mediastreamer2 +++ b/mediastreamer2 @@ -1 +1 @@ -Subproject commit c550e08a0564490791731aa4e9223dc881ebd3a4 +Subproject commit ecba8b90c533c609d2e8e1ebf7aef6eaeb8df801 From f0b9d0fffec8048c1f11ee313a08cce5efbfc1ed Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 4 Nov 2015 17:54:46 +0100 Subject: [PATCH 13/19] add linphone_core_set_transport_timeout() wrapper for java --- coreapi/linphonecore_jni.cc | 18 ++++++++++++++++++ .../common/org/linphone/core/LinphoneCore.java | 12 ++++++++++++ .../org/linphone/core/LinphoneCoreImpl.java | 12 ++++++++++++ 3 files changed, 42 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index df6699c40..b3cbb37ee 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -6529,4 +6529,22 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCoreImpl_getHttpProxyPort( } +/* + * Class: org_linphone_core_LinphoneCoreImpl + * Method: setSipTransportTimeout + * Signature: (JI)V + */ +JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCoreImpl_setSipTransportTimeout(JNIEnv *env, jobject jobj, jlong pcore, jint timeout){ + linphone_core_set_sip_transport_timeout((LinphoneCore*)pcore, timeout); +} + +/* + * Class: org_linphone_core_LinphoneCoreImpl + * Method: getSipTransportTimeout + * Signature: (J)I + */ +JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCoreImpl_getSipTransportTimeout(JNIEnv *env, jobject jobj, jlong pcore){ + return linphone_core_get_sip_transport_timeout((LinphoneCore*)pcore); +} + diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 595b1a2e9..2a2c93766 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -959,6 +959,18 @@ public interface LinphoneCore { */ void setSipDscp(int dscp); + /** + * Set the timeout in milliseconds for SIP transport (TCP or TLS connection establishment maximum time). + * @param timeout_ms + **/ + void setSipTransportTimeout(int timeout_ms); + + /** + * Get the current SIP transport timeout. + * @param timeout_ms + **/ + int getSipTransportTimeout(); + /** * Get DSCP used for SIP socket. * @return the DSCP value used for the SIP socket. diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index 7f2bdfd34..67f019232 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -1558,4 +1558,16 @@ class LinphoneCoreImpl implements LinphoneCore { public int getHttpProxyPort(){ return getHttpProxyPort(nativePtr); } + private native void setSipTransportTimeout(long nativePtr, int timeout_ms); + @Override + public void setSipTransportTimeout(int timeout_ms){ + setSipTransportTimeout(nativePtr, timeout_ms); + } + + private native int getSipTransportTimeout(long nativePtr); + @Override + public int getSipTransportTimeout(){ + return getSipTransportTimeout(nativePtr); + } + } From 1d85405c459d995cff457df7a6a728c582e71054 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 5 Nov 2015 11:44:16 +0100 Subject: [PATCH 14/19] remote_provisioning.c: modify linphone_core_set_provisioning_uri to return -1 if URI cannot be parsed, 0 otherwise --- coreapi/linphonecore.h | 5 +++-- coreapi/remote_provisioning.c | 11 +++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 7c6934221..60a704ca5 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -3926,10 +3926,11 @@ typedef void (*ContactSearchCallback)( LinphoneContactSearch* id, MSList* friend * Calling this function does not load the configuration. It will write the value into configuration so that configuration * from remote URI will take place at next LinphoneCore start. * @param lc the linphone core - * @param uri the http or https uri to use in order to download the configuration. + * @param uri the http or https uri to use in order to download the configuration. Passing NULL will disable remote provisionning. + * @return -1 if uri could not be parsed, 0 otherwise. Note that this does not check validity of URI endpoint nor scheme and download may still fail. * @ingroup initializing **/ -LINPHONE_PUBLIC void linphone_core_set_provisioning_uri(LinphoneCore *lc, const char*uri); +LINPHONE_PUBLIC int linphone_core_set_provisioning_uri(LinphoneCore *lc, const char*uri); /** * Get provisioning URI. diff --git a/coreapi/remote_provisioning.c b/coreapi/remote_provisioning.c index 2d7091bd7..9d638307c 100644 --- a/coreapi/remote_provisioning.c +++ b/coreapi/remote_provisioning.c @@ -129,8 +129,15 @@ int linphone_remote_provisioning_download_and_apply(LinphoneCore *lc, const char } } -void linphone_core_set_provisioning_uri(LinphoneCore *lc, const char *uri) { - lp_config_set_string(lc->config,"misc","config-uri",uri); +int linphone_core_set_provisioning_uri(LinphoneCore *lc, const char *remote_provisioning_uri) { + belle_generic_uri_t *uri=remote_provisioning_uri?belle_generic_uri_parse(remote_provisioning_uri):NULL; + if (!remote_provisioning_uri||uri) { + lp_config_set_string(lc->config,"misc","config-uri",remote_provisioning_uri); + return 0; + } + ms_error("Invalid provisioning URI [%s] (could not be parsed)",remote_provisioning_uri); + return -1; + } const char*linphone_core_get_provisioning_uri(const LinphoneCore *lc){ From 9333714b9e7b842235ef0e930bafe0a3aac9da80 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 5 Nov 2015 11:46:12 +0100 Subject: [PATCH 15/19] proxy.c: invoking linphone_core_remove_proxy_config with a proxy not registered will change registration state to LinphoneRegistrationNone before removal --- coreapi/proxy.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coreapi/proxy.c b/coreapi/proxy.c index 1543f5ab1..c7351522e 100644 --- a/coreapi/proxy.c +++ b/coreapi/proxy.c @@ -1151,6 +1151,8 @@ void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *cf linphone_proxy_config_enable_register(cfg,FALSE); linphone_proxy_config_done(cfg); linphone_proxy_config_update(cfg); + } else if (cfg->state != LinphoneRegistrationNone) { + linphone_proxy_config_set_state(cfg, LinphoneRegistrationNone,"Registration disabled"); } linphone_proxy_config_write_all_to_config_file(lc); } From 53dcc192fd1fb9cefb8d083cb488a8b3b8bb5a92 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 5 Nov 2015 11:46:58 +0100 Subject: [PATCH 16/19] account_creator: change return values to distinguish network error from XMLRPC answer + fix some crashs --- coreapi/account_creator.c | 62 +++++++++++++++++++-------------------- coreapi/account_creator.h | 37 ++++++++++++++--------- gtk/setupwizard.c | 19 +++++++----- 3 files changed, 65 insertions(+), 53 deletions(-) diff --git a/coreapi/account_creator.c b/coreapi/account_creator.c index c588fa7d5..4646806f0 100644 --- a/coreapi/account_creator.c +++ b/coreapi/account_creator.c @@ -162,7 +162,7 @@ static LinphoneAccountCreatorStatus validate_uri(const char* username, const cha } linphone_address_unref(addr); - return LinphoneAccountCreatorOk; + return LinphoneAccountCreatorOK; } static bool_t is_matching_regex(const char *entry, const char* regex) { @@ -198,11 +198,11 @@ LinphoneAccountCreatorStatus linphone_account_creator_set_username(LinphoneAccou return LinphoneAccountCreatorUsernameInvalid; } else if (regex && !is_matching_regex(username, regex)) { return LinphoneAccountCreatorUsernameInvalid; - } else if ((status = validate_uri(username, NULL, NULL, NULL)) != LinphoneAccountCreatorOk) { + } else if ((status = validate_uri(username, NULL, NULL, NULL)) != LinphoneAccountCreatorOK) { return status; } set_string(&creator->username, username, TRUE); - return LinphoneAccountCreatorOk; + return LinphoneAccountCreatorOK; } const char * linphone_account_creator_get_username(const LinphoneAccountCreator *creator) { @@ -215,7 +215,7 @@ LinphoneAccountCreatorStatus linphone_account_creator_set_password(LinphoneAccou return LinphoneAccountCreatorPasswordTooShort; } set_string(&creator->password, password, FALSE); - return LinphoneAccountCreatorOk; + return LinphoneAccountCreatorOK; } const char * linphone_account_creator_get_password(const LinphoneAccountCreator *creator) { @@ -227,7 +227,7 @@ LinphoneAccountCreatorStatus linphone_account_creator_set_transport(LinphoneAcco return LinphoneAccountCreatorTransportNotSupported; } creator->transport = transport; - return LinphoneAccountCreatorOk; + return LinphoneAccountCreatorOK; } LinphoneTransportType linphone_account_creator_get_transport(const LinphoneAccountCreator *creator) { @@ -239,7 +239,7 @@ LinphoneAccountCreatorStatus linphone_account_creator_set_domain(LinphoneAccount return LinphoneAccountCreatorDomainInvalid; } set_string(&creator->domain, domain, TRUE); - return LinphoneAccountCreatorOk; + return LinphoneAccountCreatorOK; } const char * linphone_account_creator_get_domain(const LinphoneAccountCreator *creator) { @@ -251,7 +251,7 @@ LinphoneAccountCreatorStatus linphone_account_creator_set_route(LinphoneAccountC return LinphoneAccountCreatorRouteInvalid; } set_string(&creator->route, route, TRUE); - return LinphoneAccountCreatorOk; + return LinphoneAccountCreatorOK; } const char * linphone_account_creator_get_route(const LinphoneAccountCreator *creator) { @@ -263,7 +263,7 @@ LinphoneAccountCreatorStatus linphone_account_creator_set_display_name(LinphoneA return LinphoneAccountCreatorDisplayNameInvalid; } set_string(&creator->display_name, display_name, FALSE); - return LinphoneAccountCreatorOk; + return LinphoneAccountCreatorOK; } const char * linphone_account_creator_get_display_name(const LinphoneAccountCreator *creator) { @@ -275,7 +275,7 @@ LinphoneAccountCreatorStatus linphone_account_creator_set_email(LinphoneAccountC return LinphoneAccountCreatorEmailInvalid; } set_string(&creator->email, email, TRUE); - return LinphoneAccountCreatorOk; + return LinphoneAccountCreatorOK; } const char * linphone_account_creator_get_email(const LinphoneAccountCreator *creator) { @@ -297,10 +297,10 @@ LinphoneAccountCreatorCbs * linphone_account_creator_get_callbacks(const Linphon static void _test_existence_cb(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); if (creator->callbacks->existence_tested != NULL) { - LinphoneAccountCreatorStatus status = LinphoneAccountCreatorFailed; - if ((linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) - && (linphone_xml_rpc_request_get_int_response(request) == 0)) { - status = LinphoneAccountCreatorOk; + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorReqFailed; + if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { + int resp = linphone_xml_rpc_request_get_int_response(request); + status = (resp == 0) ? LinphoneAccountCreatorAccountNotExist : LinphoneAccountCreatorAccountExist; } creator->callbacks->existence_tested(creator, status); } @@ -312,9 +312,9 @@ LinphoneAccountCreatorStatus linphone_account_creator_test_existence(LinphoneAcc if (!creator->username || !creator->domain) { if (creator->callbacks->existence_tested != NULL) { - creator->callbacks->existence_tested(creator, LinphoneAccountCreatorFailed); + creator->callbacks->existence_tested(creator, LinphoneAccountCreatorReqFailed); } - return LinphoneAccountCreatorFailed; + return LinphoneAccountCreatorReqFailed; } identity = ms_strdup_printf("%s@%s", creator->username, creator->domain); request = linphone_xml_rpc_request_new_with_args("check_account", LinphoneXmlRpcArgInt, @@ -325,16 +325,16 @@ LinphoneAccountCreatorStatus linphone_account_creator_test_existence(LinphoneAcc linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); ms_free(identity); - return LinphoneAccountCreatorOk; + return LinphoneAccountCreatorOK; } static void _test_validation_cb(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); if (creator->callbacks->validation_tested != NULL) { - LinphoneAccountCreatorStatus status = LinphoneAccountCreatorFailed; - if ((linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) - && (linphone_xml_rpc_request_get_int_response(request) == 1)) { - status = LinphoneAccountCreatorOk; + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorReqFailed; + if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { + int resp = linphone_xml_rpc_request_get_int_response(request); + status = (resp == 0) ? LinphoneAccountCreatorAccountNotValidated : LinphoneAccountCreatorAccountValidated; } creator->callbacks->validation_tested(creator, status); } @@ -346,9 +346,9 @@ LinphoneAccountCreatorStatus linphone_account_creator_test_validation(LinphoneAc if (!creator->username || !creator->domain) { if (creator->callbacks->validation_tested != NULL) { - creator->callbacks->validation_tested(creator, LinphoneAccountCreatorFailed); + creator->callbacks->validation_tested(creator, LinphoneAccountCreatorReqFailed); } - return LinphoneAccountCreatorFailed; + return LinphoneAccountCreatorReqFailed; } identity = ms_strdup_printf("%s@%s", creator->username, creator->domain); @@ -360,16 +360,16 @@ LinphoneAccountCreatorStatus linphone_account_creator_test_validation(LinphoneAc linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); ms_free(identity); - return LinphoneAccountCreatorOk; + return LinphoneAccountCreatorOK; } static void _create_account_cb(LinphoneXmlRpcRequest *request) { LinphoneAccountCreator *creator = (LinphoneAccountCreator *)linphone_xml_rpc_request_get_user_data(request); if (creator->callbacks->create_account != NULL) { - LinphoneAccountCreatorStatus status = LinphoneAccountCreatorFailed; - if ((linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) - && (linphone_xml_rpc_request_get_int_response(request) == 0)) { - status = LinphoneAccountCreatorOk; + LinphoneAccountCreatorStatus status = LinphoneAccountCreatorReqFailed; + if (linphone_xml_rpc_request_get_status(request) == LinphoneXmlRpcStatusOk) { + int resp = linphone_xml_rpc_request_get_int_response(request); + status = (resp == 0) ? LinphoneAccountCreatorAccountCreated : LinphoneAccountCreatorAccountNotCreated; } creator->callbacks->create_account(creator, status); } @@ -379,11 +379,11 @@ LinphoneAccountCreatorStatus linphone_account_creator_create_account(LinphoneAcc LinphoneXmlRpcRequest *request; char *identity; - if (!creator->username || !creator->domain) { + if (!creator->username || !creator->domain || !creator->email) { if (creator->callbacks->create_account != NULL) { - creator->callbacks->create_account(creator, LinphoneAccountCreatorFailed); + creator->callbacks->create_account(creator, LinphoneAccountCreatorReqFailed); } - return LinphoneAccountCreatorFailed; + return LinphoneAccountCreatorReqFailed; } identity = ms_strdup_printf("%s@%s", creator->username, creator->domain); @@ -398,7 +398,7 @@ LinphoneAccountCreatorStatus linphone_account_creator_create_account(LinphoneAcc linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request); linphone_xml_rpc_request_unref(request); ms_free(identity); - return LinphoneAccountCreatorOk; + return LinphoneAccountCreatorOK; } LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCreator *creator) { diff --git a/coreapi/account_creator.h b/coreapi/account_creator.h index 87a31149e..fe6c46c3d 100644 --- a/coreapi/account_creator.h +++ b/coreapi/account_creator.h @@ -36,18 +36,27 @@ extern "C" { * Enum describing the status of a LinphoneAccountCreator operation. **/ typedef enum _LinphoneAccountCreatorStatus { - LinphoneAccountCreatorOk = 0, - LinphoneAccountCreatorFailed = 1 << 0, + LinphoneAccountCreatorOK, + LinphoneAccountCreatorReqFailed, - LinphoneAccountCreatorEmailInvalid = 1 << 1, - LinphoneAccountCreatorUsernameInvalid = 1 << 2, - LinphoneAccountCreatorUsernameTooShort = 1 << 3, - LinphoneAccountCreatorUsernameInvalidSize = 1 << 4, - LinphoneAccountCreatorPasswordTooShort = 1 << 5, - LinphoneAccountCreatorDomainInvalid = 1 << 6, - LinphoneAccountCreatorRouteInvalid = 1 << 7, - LinphoneAccountCreatorDisplayNameInvalid = 1 << 8, - LinphoneAccountCreatorTransportNotSupported = 1 << 9, + LinphoneAccountCreatorAccountCreated, + LinphoneAccountCreatorAccountNotCreated, + + LinphoneAccountCreatorAccountExist, + LinphoneAccountCreatorAccountNotExist, + + LinphoneAccountCreatorAccountValidated, + LinphoneAccountCreatorAccountNotValidated, + + LinphoneAccountCreatorEmailInvalid, + LinphoneAccountCreatorUsernameInvalid, + LinphoneAccountCreatorUsernameTooShort, + LinphoneAccountCreatorUsernameInvalidSize, + LinphoneAccountCreatorPasswordTooShort, + LinphoneAccountCreatorDomainInvalid, + LinphoneAccountCreatorRouteInvalid, + LinphoneAccountCreatorDisplayNameInvalid, + LinphoneAccountCreatorTransportNotSupported, } LinphoneAccountCreatorStatus; /** @@ -245,21 +254,21 @@ LINPHONE_PUBLIC LinphoneAccountCreatorCbs * linphone_account_creator_get_callbac /** * Send an XML-RPC request to test the existence of a Linphone account. * @param[in] creator LinphoneAccountCreator object - * @return LinphoneAccountCreatorOk if the request has been sent, LinphoneAccountCreatorFailed otherwise + * @return LinphoneAccountCreatorOk if the request has been sent, LinphoneAccountCreatorReqFailed otherwise **/ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_test_existence(LinphoneAccountCreator *creator); /** * Send an XML-RPC request to test the validation of a Linphone account. * @param[in] creator LinphoneAccountCreator object - * @return LinphoneAccountCreatorOk if the request has been sent, LinphoneAccountCreatorFailed otherwise + * @return LinphoneAccountCreatorOk if the request has been sent, LinphoneAccountCreatorReqFailed otherwise **/ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_test_validation(LinphoneAccountCreator *creator); /** * Send an XML-RPC request to create a Linphone account. * @param[in] creator LinphoneAccountCreator object - * @return LinphoneAccountCreatorOk if the request has been sent, LinphoneAccountCreatorFailed otherwise + * @return LinphoneAccountCreatorOk if the request has been sent, LinphoneAccountCreatorReqFailed otherwise **/ LINPHONE_PUBLIC LinphoneAccountCreatorStatus linphone_account_creator_create_account(LinphoneAccountCreator *creator); diff --git a/gtk/setupwizard.c b/gtk/setupwizard.c index ffd5a8ba7..63b6cec6f 100644 --- a/gtk/setupwizard.c +++ b/gtk/setupwizard.c @@ -33,7 +33,7 @@ static LinphoneAccountCreator * linphone_gtk_assistant_get_creator(GtkWidget *w) static void linphone_gtk_create_account_cb(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status) { GtkWidget *assistant = (GtkWidget *)linphone_account_creator_get_user_data(creator); - if (status == LinphoneAccountCreatorOk) { + if (status == LinphoneAccountCreatorAccountCreated) { // Go to page_6_linphone_account_validation_wait gtk_assistant_set_current_page(GTK_ASSISTANT(assistant), 6); } else { // Error when attempting to create the account @@ -50,7 +50,7 @@ static void create_account(GtkWidget *assistant) { static void linphone_gtk_test_account_validation_cb(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status) { GtkWidget *assistant = (GtkWidget *)linphone_account_creator_get_user_data(creator); - if (status == LinphoneAccountCreatorOk) { + if (status == LinphoneAccountCreatorAccountValidated) { // Go to page_9_finish gtk_assistant_set_current_page(GTK_ASSISTANT(assistant), 9); } else { @@ -209,14 +209,18 @@ static gboolean update_interface_with_username_availability(GtkWidget *page) { GtkWidget *assistant = gtk_widget_get_toplevel(page); GtkImage* isUsernameOk = GTK_IMAGE(linphone_gtk_get_widget(assistant, "p4_image_username_ok")); GtkLabel* usernameError = GTK_LABEL(linphone_gtk_get_widget(assistant, "p4_label_error")); - int account_existing = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(page), "is_username_used")); + int account_status = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(page), "is_username_used")); - if (account_existing == 0) { + if (account_status == LinphoneAccountCreatorAccountNotExist) { g_object_set_data(G_OBJECT(page), "is_username_available", GINT_TO_POINTER(1)); gtk_image_set_from_stock(isUsernameOk, GTK_STOCK_OK, GTK_ICON_SIZE_LARGE_TOOLBAR); gtk_label_set_text(usernameError, ""); + } else if (account_status == LinphoneAccountCreatorAccountExist) { + gtk_label_set_text(usernameError, _("Username is already in use!")); + g_object_set_data(G_OBJECT(page), "is_username_available", GINT_TO_POINTER(0)); + gtk_image_set_from_stock(isUsernameOk, GTK_STOCK_NO, GTK_ICON_SIZE_LARGE_TOOLBAR); } else { - gtk_label_set_text(usernameError, "Username is already in use!"); + gtk_label_set_text(usernameError, _("Failed to check username availability. Please try again later.")); g_object_set_data(G_OBJECT(page), "is_username_available", GINT_TO_POINTER(0)); gtk_image_set_from_stock(isUsernameOk, GTK_STOCK_NO, GTK_ICON_SIZE_LARGE_TOOLBAR); } @@ -227,8 +231,7 @@ static gboolean update_interface_with_username_availability(GtkWidget *page) { static void linphone_gtk_test_account_existence_cb(LinphoneAccountCreator *creator, LinphoneAccountCreatorStatus status) { GtkWidget *assistant = (GtkWidget *)linphone_account_creator_get_user_data(creator); GtkWidget *page = gtk_assistant_get_nth_page(GTK_ASSISTANT(assistant), gtk_assistant_get_current_page(GTK_ASSISTANT(assistant))); - gboolean account_existing = (status != LinphoneAccountCreatorOk); - g_object_set_data(G_OBJECT(page), "is_username_used", GINT_TO_POINTER(account_existing)); + g_object_set_data(G_OBJECT(page), "is_username_used", GINT_TO_POINTER(status)); gdk_threads_add_idle((GSourceFunc)update_interface_with_username_availability, page); } @@ -323,7 +326,7 @@ static void linphone_gtk_assistant_init(GtkWidget *w) { linphone_account_creator_cbs_set_validation_tested(cbs, linphone_gtk_test_account_validation_cb); linphone_account_creator_cbs_set_create_account(cbs, linphone_gtk_create_account_cb); g_object_set_data(G_OBJECT(w), "creator", creator); - + gtk_assistant_set_forward_page_func(GTK_ASSISTANT(w), linphone_gtk_assistant_forward, w, NULL); } From 8c2a440fd9804ea3dacd27737afd3f18911e0379 Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Thu, 5 Nov 2015 16:51:35 +0100 Subject: [PATCH 17/19] remote_provisioning: free URI in linphone_core_set_provisioning_uri when we are done with it --- NEWS | 16 ++++++++-------- coreapi/linphonecore.h | 2 +- coreapi/remote_provisioning.c | 11 ++++++++++- gtk/main.ui | 2 +- 4 files changed, 20 insertions(+), 11 deletions(-) diff --git a/NEWS b/NEWS index 3791448b8..1e8481d78 100644 --- a/NEWS +++ b/NEWS @@ -28,7 +28,7 @@ linphone-3.8.2 -- May 7th, 2015 * add support of the StatusNotifierItem standard to display a status icon on KDE5 * auto-answering can be set through the preferences panel * bug fixes - + Liblinphone level improvements: * fix audio bug with opus codec * fix ICE corner case not properly handled and resulting bad final ice status @@ -76,14 +76,14 @@ linphone-3.7.0 -- February 20th, 2014 * Keyboard can be used for DTMF input * Faster and higly responsive UI thanks to fully asynchronous operation of the liblinphone. * Addon of opus codec - * Possibility to specify a remote provisionning http URI for configuration + * Possibility to specify a remote provisioning http URI for configuration * LDAP search integration for Linux and MacOSX - * is-composing notification in chat area + * is-composing notification in chat area Liblinphone level improvements thanks to new "belle-sip" SIP stack: * multiple SIP transports simultaneously now allowed * IP dual stack: can use IPv6 and IPv4 simultaneously - * fully asynchronous behavior: no more lengthly DNS or connections + * fully asynchronous behavior: no more lengthly DNS or connections * +sip.instance parameter (RFC5626) * alias parameter (RFC5923) * better management of network disconnections @@ -101,7 +101,7 @@ linphone-3.7.0 -- February 20th, 2014 linphone-3.6.1 -- June 17, 2013 * fix memory leak with some video cameras on windows. - + Requires: mediastreamer2 = 2.9.1 and ortp = 0.22.0 linphone-3.6.0 -- May 27, 2013 @@ -166,9 +166,9 @@ linphone-3.4.1 -- February 17th, 2011 Requires mediastreamer-2.7.1 linphone-3.4.0 -- February 7th, 2011 - * implement multiple calls feature: + * implement multiple calls feature: - call hold (with possibility to play a music file) - - call resume + - call resume - acceptance of 2nd call while putting the others on hold - creation of another outgoing call while already in call - blind call transfer @@ -339,7 +339,7 @@ linphone-1.4.1 -- September 18, 2006 * do not change mixer settings at startup linphone-1.4.0 -- September 11, 2006 - * no more glib dependency at all + * no more glib dependency at all * new mediastreamer2 framework for audio/video streaming * stable video support with H.263-1998 * echo cancelation diff --git a/coreapi/linphonecore.h b/coreapi/linphonecore.h index 60a704ca5..d2920ad34 100644 --- a/coreapi/linphonecore.h +++ b/coreapi/linphonecore.h @@ -3926,7 +3926,7 @@ typedef void (*ContactSearchCallback)( LinphoneContactSearch* id, MSList* friend * Calling this function does not load the configuration. It will write the value into configuration so that configuration * from remote URI will take place at next LinphoneCore start. * @param lc the linphone core - * @param uri the http or https uri to use in order to download the configuration. Passing NULL will disable remote provisionning. + * @param uri the http or https uri to use in order to download the configuration. Passing NULL will disable remote provisioning. * @return -1 if uri could not be parsed, 0 otherwise. Note that this does not check validity of URI endpoint nor scheme and download may still fail. * @ingroup initializing **/ diff --git a/coreapi/remote_provisioning.c b/coreapi/remote_provisioning.c index 9d638307c..d79598758 100644 --- a/coreapi/remote_provisioning.c +++ b/coreapi/remote_provisioning.c @@ -108,8 +108,10 @@ int linphone_remote_provisioning_download_and_apply(LinphoneCore *lc, const char if( scheme && (strcmp(scheme,"file") == 0) ){ // We allow for 'local remote-provisioning' in case the file is to be opened from the hard drive. const char* file_path = remote_provisioning_uri + strlen("file://"); // skip scheme + if (uri) { + belle_sip_object_unref(uri); + } return linphone_remote_provisioning_load_file(lc, file_path); - } else if( scheme && strncmp(scheme, "http", 4) == 0 && host && strlen(host) > 0) { belle_http_request_listener_callbacks_t belle_request_listener={0}; belle_http_request_t *request; @@ -122,9 +124,13 @@ int linphone_remote_provisioning_download_and_apply(LinphoneCore *lc, const char lc->provisioning_http_listener = belle_http_request_listener_create_from_callbacks(&belle_request_listener, lc); request=belle_http_request_create("GET",uri, NULL); + return belle_http_provider_send_request(lc->http_provider, request, lc->provisioning_http_listener); } else { ms_error("Invalid provisioning URI [%s] (missing scheme or host ?)",remote_provisioning_uri); + if (uri) { + belle_sip_object_unref(uri); + } return -1; } } @@ -133,6 +139,9 @@ int linphone_core_set_provisioning_uri(LinphoneCore *lc, const char *remote_prov belle_generic_uri_t *uri=remote_provisioning_uri?belle_generic_uri_parse(remote_provisioning_uri):NULL; if (!remote_provisioning_uri||uri) { lp_config_set_string(lc->config,"misc","config-uri",remote_provisioning_uri); + if (uri) { + belle_sip_object_unref(uri); + } return 0; } ms_error("Invalid provisioning URI [%s] (could not be parsed)",remote_provisioning_uri); diff --git a/gtk/main.ui b/gtk/main.ui index b40737c07..98dc3400a 100644 --- a/gtk/main.ui +++ b/gtk/main.ui @@ -171,7 +171,7 @@ - + True False Set configuration URI From 6a5880b2fdf0aeb0c2a04b53338f03db8393501a Mon Sep 17 00:00:00 2001 From: Gautier Pelloux-Prayer Date: Fri, 6 Nov 2015 11:42:51 +0100 Subject: [PATCH 18/19] enum.c: fix crash in create_enum_domain (use int, not size_t when strlen == 1) --- coreapi/enum.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/coreapi/enum.c b/coreapi/enum.c index 1c0651675..419e7000e 100644 --- a/coreapi/enum.c +++ b/coreapi/enum.c @@ -33,8 +33,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. static char *create_enum_domain(const char *number){ size_t len=strlen(number); char *domain=ms_malloc((len*2)+10); - size_t i,j; - + long i,j; + for (i=0,j=len-1;j>=0;j--){ domain[i]=number[j]; i++; @@ -105,11 +105,11 @@ int enum_lookup(const char *enum_domain, enum_lookup_res_t **res){ /* ns_msg handle; int count; - + memset(&handle,0,sizeof(handle)); *res=NULL; ms_message("Resolving %s...",enum_domain); - + err=res_search(enum_domain,ns_c_in,ns_t_naptr,dns_answer,DNS_ANSWER_MAX_SIZE); if (err<0){ ms_warning("Error resolving enum:",herror(h_errno)); @@ -117,7 +117,7 @@ int enum_lookup(const char *enum_domain, enum_lookup_res_t **res){ } ns_initparse(dns_answer,DNS_ANSWER_MAX_SIZE,&handle); count=ns_msg_count(handle,ns_s_an); - + for(i=0;i Date: Fri, 6 Nov 2015 15:56:23 +0100 Subject: [PATCH 19/19] Fix auto-answer activation in Linphone GTK+ --- gtk/linphone.h | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/linphone.h b/gtk/linphone.h index 0ae175dd9..fd7dd074f 100644 --- a/gtk/linphone.h +++ b/gtk/linphone.h @@ -349,3 +349,4 @@ LINPHONE_PUBLIC void linphone_gtk_reload_video_devices(void); LINPHONE_PUBLIC bool_t linphone_gtk_is_friend(LinphoneCore *lc, const char *contact); LINPHONE_PUBLIC gboolean linphone_gtk_auto_answer_enabled(void); LINPHONE_PUBLIC void linphone_gtk_update_status_bar_icons(void); +LINPHONE_PUBLIC void linphone_gtk_enable_auto_answer(GtkToggleButton *checkbox, gpointer user_data);