Commit a0d62ffa authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Merge branch 'release/4.3'

parents 020c3127 ad41dbf3
# CMakeLists.txt
# Copyright (C) 2014 Belledonne Communications, Grenoble France
# Copyright (C) 2010-2019 Belledonne Communications, Grenoble France
#
############################################################################
#
......@@ -21,8 +21,8 @@
############################################################################
cmake_minimum_required(VERSION 3.1)
project(belle-sip VERSION 1.7.0 LANGUAGES C CXX)
cmake_minimum_required(VERSION 3.11) # we need CMake 3.11 for defining 'package_source' target as custom target
project(belle-sip VERSION 4.3.0 LANGUAGES C CXX)
......
......@@ -13,12 +13,13 @@ It also comprises a simple HTTP/HTTPS client implementation.
License
-------
<Copyright 2012 © Belledonne Communications SARL>, all rights reserved.
Copyright © Belledonne Communications
Belle-sip is dual licensed:
- under a GNU GPLv3 license for free (see LICENSE.md file for details)
- under a proprietary license, for closed source projects. Contact <sales@belledonne-communications.com> for costs and other service information.
Belle-sip is dual licensed, and is available either :
- under a [GNU/GPLv3 license](https://www.gnu.org/licenses/gpl-3.0.en.html), for free (open source). Please make sure that you understand and agree with the terms of this license before using it (see LICENSE.txt file for details).
- under a proprietary license, for a fee, to be used in closed source applications. Contact [Belledonne Communications](https://www.linphone.org/contact) for any question about costs and services.
Features
--------
......
############################################################################
# CMakeLists.txt
# Copyright (C) 2017-2018 Belledonne Communications, Grenoble France
# Copyright (C) 2010-2019 Belledonne Communications, Grenoble France
#
############################################################################
#
......@@ -24,30 +24,9 @@ if(NOT CPACK_PACKAGE_NAME)
set(CPACK_PACKAGE_NAME "belle-sip")
ENDIF()
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/../LICENSE.txt")
set(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}-${PROJECT_VERSION})
set(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_IGNORE_FILES
"${CMAKE_BINARY_DIR}"
"^${PROJECT_SOURCE_DIR}/.git*"
)
bc_project_build_version(${PROJECT_VERSION} PROJECT_VERSION_BUILD)
if(PROJECT_VERSION_BUILD)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-${PROJECT_VERSION_BUILD}")
endif()
message("-- Package file name is ${CPACK_PACKAGE_FILE_NAME}" )
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
bc_generate_rpm_specfile("rpm/belle-sip.spec.cmake" "${PROJECT_SOURCE_DIR}/belle-sip.spec")
include(CPack)
bc_make_package_source_target()
......@@ -2,6 +2,7 @@
%define _prefix @CMAKE_INSTALL_PREFIX@
%define pkg_prefix @BC_PACKAGE_NAME_PREFIX@
%define package_name @CPACK_PACKAGE_NAME@-${FULL_VERSION}
# re-define some directories for older RPMBuild versions which don't. This messes up the doc/ dir
# taken from https://fedoraproject.org/wiki/Packaging:RPMMacros?rd=Packaging/RPMMacros
......@@ -9,19 +10,16 @@
%define _datadir %{_datarootdir}
%define _docdir %{_datadir}/doc
%define build_number @PROJECT_VERSION_BUILD@
Name: @CPACK_PACKAGE_NAME@
Version: @PROJECT_VERSION@
Release: %build_number%{?dist}
Version: ${RPM_VERSION}
Release: ${RPM_RELEASE}%{?dist}
Summary: Linphone's sip stack
Group: Applications/Communications
License: GPL
URL: http://www.belle-sip.org
Source0: %{name}-%{version}.tar.gz
Source0: %{package_name}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Requires: %{pkg_prefix}bctoolbox
......@@ -51,7 +49,7 @@ Libraries and headers required to develop software with belle-sip
%custom_debug_package
%prep
%setup -n %{name}-%{version}
%setup -n %{package_name}
%build
%{expand:%%%cmake_name} . -DCMAKE_BUILD_TYPE=@CMAKE_BUILD_TYPE@ -DCMAKE_PREFIX_PATH:PATH=%{_prefix} @RPM_ALL_CMAKE_OPTIONS@
......
......@@ -163,6 +163,9 @@ BELLESIP_EXPORT void belle_sip_end_background_task(unsigned long id);
*/
BELLESIP_EXPORT int belle_sip_mkdir(const char *path);
BELLESIP_EXPORT char* belle_sip_uri_to_escaped_username(const char* buff);
BELLESIP_EXPORT char* belle_sip_to_unescaped_string(const char* buff);
BELLE_SIP_END_DECLS
#endif
......@@ -1010,7 +1010,6 @@ belle_sip_refresher_t* belle_sip_refresher_new(belle_sip_client_transaction_t* t
* returns a char, even if entry is escaped*/
size_t belle_sip_get_char (const char*a,char*out);
/*return an escaped string*/
BELLESIP_EXPORT char* belle_sip_uri_to_escaped_username(const char* buff) ;
BELLESIP_EXPORT char* belle_sip_uri_to_escaped_userpasswd(const char* buff) ;
BELLESIP_EXPORT char* belle_sip_uri_to_escaped_parameter(const char* buff) ;
BELLESIP_EXPORT char* belle_sip_uri_to_escaped_header(const char* buff) ;
......
......@@ -588,7 +588,7 @@ int belle_sip_dialog_update(belle_sip_dialog_t *obj, belle_sip_transaction_t* tr
belle_sip_dialog_establish(obj,req,resp);
if (code<200){
set_state(obj,BELLE_SIP_DIALOG_EARLY);
if ((code == 180 || code == 183) && !as_uas) {
if (!as_uas) {
belle_sip_dialog_process_response_100rel(obj, resp);
}
break;
......@@ -625,7 +625,7 @@ int belle_sip_dialog_update(belle_sip_dialog_t *obj, belle_sip_transaction_t* tr
/*no response establishing the dialog, and transaction terminated (transport errors)*/
delete_dialog=TRUE;
}
if ((code == 180 || code == 183) && !as_uas) {
if ((code > 100 && code < 200) && !as_uas) {
belle_sip_dialog_process_response_100rel(obj, resp);
}
break;
......
......@@ -53,7 +53,8 @@ static int http_channel_context_handle_authentication(belle_http_channel_context
const char *username=NULL;
const char *passwd=NULL;
const char *ha1=NULL;
char computed_ha1[33];
const char *algorithm=NULL;
char computed_ha1[65];
belle_sip_header_www_authenticate_t* authenticate;
int ret=0;
......@@ -103,9 +104,10 @@ static int http_channel_context_handle_authentication(belle_http_channel_context
username=ev->username;
passwd=ev->passwd;
ha1=ev->ha1;
algorithm=ev->algorithm;
}
if (!ha1 && username && passwd) {
belle_sip_auth_helper_compute_ha1(username,realm,passwd, computed_ha1);
belle_sip_auth_helper_compute_ha1_for_algorithm(username,realm,passwd, computed_ha1, belle_sip_auth_define_size(algorithm), algorithm);
ha1=computed_ha1;
} else if (!ha1){
belle_sip_error("No auth info found for request [%p], cannot authenticate",req);
......@@ -122,6 +124,7 @@ static int http_channel_context_handle_authentication(belle_http_channel_context
belle_sip_header_authorization_set_nonce_count(BELLE_SIP_HEADER_AUTHORIZATION(authorization),1); /*we don't store nonce count for now*/
belle_sip_header_authorization_set_username(BELLE_SIP_HEADER_AUTHORIZATION(authorization),username);
belle_http_header_authorization_set_uri(authorization,belle_http_request_get_uri(req));
belle_sip_header_authorization_set_algorithm(BELLE_SIP_HEADER_AUTHORIZATION(authorization), algorithm);
if (belle_sip_auth_helper_fill_authorization(BELLE_SIP_HEADER_AUTHORIZATION(authorization),belle_http_request_get_method(req),ha1)) {
belle_sip_error("Cannot fill auth header for request [%p]",req);
if (authorization) belle_sip_object_unref(authorization);
......
......@@ -42,7 +42,6 @@ static BELLESIP_INLINE int belle_sip_strcasecmp(const char*a, const char* b) {
BELLESIP_EXPORT belle_sip_header_t* belle_sip_header_get_next(const belle_sip_header_t* headers);
BELLESIP_EXPORT void belle_sip_header_set_next(belle_sip_header_t* header,belle_sip_header_t* next);
BELLESIP_EXPORT char* belle_sip_to_unescaped_string(const char* buff);
belle_sip_param_pair_t* belle_sip_param_pair_new(const char* name,const char* value);
char* _belle_sip_str_dup_and_unquote_string(const char* quoted_string);
......
......@@ -217,7 +217,7 @@ static void process_response_event(belle_sip_listener_t *user_ctx, const belle_s
belle_sip_header_retry_after_t *retry_after_header;
int will_retry = TRUE; /*most error codes are retryable*/
retry_after_header = belle_sip_message_get_header_by_type(response,belle_sip_header_retry_after_t);
int retry_after_time = retry_after_header ? belle_sip_header_retry_after_get_retry_after(retry_after_header):0;
int retry_after_time = retry_after_header ? belle_sip_header_retry_after_get_retry_after(retry_after_header) : DEFAULT_RETRY_AFTER;
if (refresher && (client_transaction !=refresher->transaction))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment