Commit b9b283dc authored by Ghislain MARY's avatar Ghislain MARY

Compile source files as C++.

parent f2121d52
......@@ -680,11 +680,9 @@ LinphoneAccountCreatorStatus linphone_account_creator_is_account_exist_linphone(
(creator->username) ? "username" : "phone number",
(creator->username) ? creator->username : creator->phone_number,
linphone_proxy_config_get_domain(creator->proxy_cfg));
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "get_phone_number_for_account",
LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number,
LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "get_phone_number_for_account");
linphone_xml_rpc_request_add_string_arg(request, creator->username ? creator->username : creator->phone_number);
linphone_xml_rpc_request_add_string_arg(request, linphone_proxy_config_get_domain(creator->proxy_cfg));
linphone_xml_rpc_request_set_user_data(request, creator);
linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _is_account_exist_response_cb);
linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request);
......@@ -722,14 +720,14 @@ static LinphoneXmlRpcRequest * _create_account_with_phone_custom(LinphoneAccount
linphone_proxy_config_get_domain(creator->proxy_cfg),
creator->language);
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "create_phone_account",
LinphoneXmlRpcArgString, creator->phone_number,
LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number,
LinphoneXmlRpcArgString, creator->password ? ha1_for_passwd(creator->username ? creator->username : creator->phone_number, linphone_proxy_config_get_domain(creator->proxy_cfg), creator->password) : "",
LinphoneXmlRpcArgString, linphone_core_get_user_agent(creator->core),
LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgString, creator->language,
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "create_phone_account");
linphone_xml_rpc_request_add_string_arg(request, creator->phone_number);
linphone_xml_rpc_request_add_string_arg(request, creator->username ? creator->username : creator->phone_number);
linphone_xml_rpc_request_add_string_arg(request, creator->password ?
ha1_for_passwd(creator->username ? creator->username : creator->phone_number, linphone_proxy_config_get_domain(creator->proxy_cfg), creator->password) : "");
linphone_xml_rpc_request_add_string_arg(request, linphone_core_get_user_agent(creator->core));
linphone_xml_rpc_request_add_string_arg(request, linphone_proxy_config_get_domain(creator->proxy_cfg));
linphone_xml_rpc_request_add_string_arg(request, creator->language);
return request;
}
......@@ -743,13 +741,13 @@ static LinphoneXmlRpcRequest * _create_account_with_email_custom(LinphoneAccount
creator->email,
linphone_proxy_config_get_domain(creator->proxy_cfg));
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "create_email_account",
LinphoneXmlRpcArgString, creator->username,
LinphoneXmlRpcArgString, creator->email,
LinphoneXmlRpcArgString, ha1_for_passwd(creator->username ? creator->username : creator->phone_number, linphone_proxy_config_get_domain(creator->proxy_cfg), creator->password),
LinphoneXmlRpcArgString, linphone_core_get_user_agent(creator->core),
LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "create_email_account");
linphone_xml_rpc_request_add_string_arg(request, creator->username);
linphone_xml_rpc_request_add_string_arg(request, creator->email);
linphone_xml_rpc_request_add_string_arg(request,
ha1_for_passwd(creator->username ? creator->username : creator->phone_number, linphone_proxy_config_get_domain(creator->proxy_cfg), creator->password));
linphone_xml_rpc_request_add_string_arg(request, linphone_core_get_user_agent(creator->core));
linphone_xml_rpc_request_add_string_arg(request, linphone_proxy_config_get_domain(creator->proxy_cfg));
return request;
}
......@@ -808,13 +806,11 @@ LinphoneAccountCreatorStatus linphone_account_creator_activate_account_linphone(
creator->activation_code,
linphone_proxy_config_get_domain(creator->proxy_cfg));
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "activate_phone_account",
LinphoneXmlRpcArgString, creator->phone_number,
LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number,
LinphoneXmlRpcArgString, creator->activation_code,
linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "activate_phone_account");
linphone_xml_rpc_request_add_string_arg(request, creator->phone_number);
linphone_xml_rpc_request_add_string_arg(request, creator->username ? creator->username : creator->phone_number);
linphone_xml_rpc_request_add_string_arg(request, creator->activation_code);
linphone_xml_rpc_request_add_string_arg(request, linphone_proxy_config_get_domain(creator->proxy_cfg));
linphone_xml_rpc_request_set_user_data(request, creator);
linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _activate_account_cb_custom);
linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request);
......@@ -836,12 +832,10 @@ LinphoneAccountCreatorStatus linphone_account_creator_activate_email_account_lin
creator->activation_code,
linphone_proxy_config_get_domain(creator->proxy_cfg));
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "activate_email_account",
LinphoneXmlRpcArgString, creator->username,
LinphoneXmlRpcArgString, creator->activation_code,
linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "activate_email_account");
linphone_xml_rpc_request_add_string_arg(request, creator->username);
linphone_xml_rpc_request_add_string_arg(request, creator->activation_code);
linphone_xml_rpc_request_add_string_arg(request, linphone_proxy_config_get_domain(creator->proxy_cfg));
linphone_xml_rpc_request_set_user_data(request, creator);
linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _activate_account_cb_custom);
linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request);
......@@ -876,10 +870,9 @@ LinphoneAccountCreatorStatus linphone_account_creator_is_account_activated_linph
creator->username ? creator->username : creator->phone_number,
linphone_proxy_config_get_domain(creator->proxy_cfg));
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "is_account_activated",
LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number,
LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "is_account_activated");
linphone_xml_rpc_request_add_string_arg(request, creator->username ? creator->username : creator->phone_number);
linphone_xml_rpc_request_add_string_arg(request, linphone_proxy_config_get_domain(creator->proxy_cfg));
linphone_xml_rpc_request_set_user_data(request, creator);
linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _is_account_activated_cb_custom);
linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request);
......@@ -919,10 +912,9 @@ LinphoneAccountCreatorStatus linphone_account_creator_is_phone_number_used_linph
creator->phone_number,
linphone_proxy_config_get_domain(creator->proxy_cfg));
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "is_phone_number_used",
LinphoneXmlRpcArgString, creator->phone_number,
LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "is_phone_number_used");
linphone_xml_rpc_request_add_string_arg(request, creator->phone_number);
linphone_xml_rpc_request_add_string_arg(request, linphone_proxy_config_get_domain(creator->proxy_cfg));
linphone_xml_rpc_request_set_user_data(request, creator);
linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _is_phone_number_used_cb_custom);
linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request);
......@@ -961,12 +953,11 @@ LinphoneAccountCreatorStatus linphone_account_creator_link_phone_number_with_acc
linphone_proxy_config_get_domain(creator->proxy_cfg),
creator->language);
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "link_phone_number_with_account",
LinphoneXmlRpcArgString, creator->phone_number,
LinphoneXmlRpcArgString, creator->username,
LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgString, creator->language,
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "link_phone_number_with_account");
linphone_xml_rpc_request_add_string_arg(request, creator->phone_number);
linphone_xml_rpc_request_add_string_arg(request, creator->username);
linphone_xml_rpc_request_add_string_arg(request, linphone_proxy_config_get_domain(creator->proxy_cfg));
linphone_xml_rpc_request_add_string_arg(request, creator->language);
linphone_xml_rpc_request_set_user_data(request, creator);
linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _link_phone_number_with_account_cb_custom);
linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request);
......@@ -998,10 +989,9 @@ LinphoneAccountCreatorStatus linphone_account_creator_is_account_linked_linphone
creator->username,
linphone_proxy_config_get_domain(creator->proxy_cfg));
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "get_phone_number_for_account",
LinphoneXmlRpcArgString, creator->username,
LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "get_phone_number_for_account");
linphone_xml_rpc_request_add_string_arg(request, creator->username);
linphone_xml_rpc_request_add_string_arg(request, linphone_proxy_config_get_domain(creator->proxy_cfg));
linphone_xml_rpc_request_set_user_data(request, creator);
linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _get_phone_number_for_account_cb_custom);
linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request);
......@@ -1038,13 +1028,12 @@ LinphoneAccountCreatorStatus linphone_account_creator_activate_phone_number_link
creator->activation_code,
linphone_proxy_config_get_domain(creator->proxy_cfg));
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "activate_phone_number_link",
LinphoneXmlRpcArgString, creator->phone_number,
LinphoneXmlRpcArgString, creator->username,
LinphoneXmlRpcArgString, creator->activation_code,
LinphoneXmlRpcArgString, creator->ha1 ? creator->ha1 : ha1_for_passwd(creator->username, linphone_proxy_config_get_domain(creator->proxy_cfg), creator->password),
LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "activate_phone_number_link");
linphone_xml_rpc_request_add_string_arg(request, creator->phone_number);
linphone_xml_rpc_request_add_string_arg(request, creator->username);
linphone_xml_rpc_request_add_string_arg(request, creator->activation_code);
linphone_xml_rpc_request_add_string_arg(request, creator->ha1 ? creator->ha1 : ha1_for_passwd(creator->username, linphone_proxy_config_get_domain(creator->proxy_cfg), creator->password));
linphone_xml_rpc_request_add_string_arg(request, linphone_proxy_config_get_domain(creator->proxy_cfg));
linphone_xml_rpc_request_set_user_data(request, creator);
linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _activate_phone_number_link_cb_custom);
linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request);
......@@ -1087,11 +1076,10 @@ LinphoneAccountCreatorStatus linphone_account_creator_recover_phone_account_linp
linphone_proxy_config_get_domain(creator->proxy_cfg),
creator->language);
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "recover_phone_account",
LinphoneXmlRpcArgString, creator->phone_number,
LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgString, creator->language,
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "recover_phone_account");
linphone_xml_rpc_request_add_string_arg(request, creator->phone_number);
linphone_xml_rpc_request_add_string_arg(request, linphone_proxy_config_get_domain(creator->proxy_cfg));
linphone_xml_rpc_request_add_string_arg(request, creator->language);
linphone_xml_rpc_request_set_user_data(request, creator);
linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _recover_phone_account_cb_custom);
linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request);
......@@ -1143,13 +1131,11 @@ LinphoneAccountCreatorStatus linphone_account_creator_update_password_linphone(L
creator->username,
linphone_proxy_config_get_domain(creator->proxy_cfg));
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "update_hash",
LinphoneXmlRpcArgString, username,
LinphoneXmlRpcArgString, ha1,
LinphoneXmlRpcArgString, new_ha1,
LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "update_hash");
linphone_xml_rpc_request_add_string_arg(request, username);
linphone_xml_rpc_request_add_string_arg(request, ha1);
linphone_xml_rpc_request_add_string_arg(request, new_ha1);
linphone_xml_rpc_request_add_string_arg(request, linphone_proxy_config_get_domain(creator->proxy_cfg));
linphone_xml_rpc_request_set_user_data(request, creator);
linphone_xml_rpc_request_cbs_set_response(linphone_xml_rpc_request_get_callbacks(request), _password_updated_cb_custom);
linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request);
......
......@@ -229,7 +229,7 @@ void linphone_auth_info_write_config(LpConfig *config, LinphoneAuthInfo *obj, in
}
if (!obj->ha1 && obj->realm && obj->passwd && (obj->username || obj->userid) && store_ha1_passwd) {
/*compute ha1 to avoid storing clear text password*/
obj->ha1 = ms_malloc(33);
obj->ha1 = reinterpret_cast<char *>(ms_malloc(33));
sal_auth_compute_ha1(obj->userid ? obj->userid : obj->username, obj->realm, obj->passwd, obj->ha1);
}
if (obj->username != NULL) {
......
......@@ -78,7 +78,7 @@ const uint8_t * linphone_buffer_get_content(const LinphoneBuffer *buffer) {
void linphone_buffer_set_content(LinphoneBuffer *buffer, const uint8_t *content, size_t size) {
buffer->size = size;
if (buffer->content) belle_sip_free(buffer->content);
buffer->content = belle_sip_malloc(size + 1);
buffer->content = reinterpret_cast<uint8_t *>(belle_sip_malloc(size + 1));
memcpy(buffer->content, content, size);
((char *)buffer->content)[size] = '\0';
}
......
......@@ -36,90 +36,93 @@ endif()
set(LINPHONE_PRIVATE_HEADER_FILES
bellesip_sal/sal_impl.h
carddav.h
conference_private.h
contact_providers_priv.h
enum.h
lime.h
lpc2xml.h
offeranswer.h
CardDav.h
Conference.h
ContactProvider.h
Enum.h
Lime.h
Lpc2Xml.h
OfferAnswer.h
private.h
quality_reporting.h
sqlite3_bctbx_vfs.h
vcard_private.h
xml2lpc.h
QualityReporting.h
Sqlite3BctbxVfs.h
Vcard.h
Xml2Lpc.h
)
set(LINPHONE_SOURCE_FILES_C
account_creator.c
account_creator_service.c
address.c
authentication.c
bellesip_sal/sal_address_impl.c
bellesip_sal/sal_impl.c
bellesip_sal/sal_op_call.c
bellesip_sal/sal_op_call_transfer.c
bellesip_sal/sal_op_events.c
bellesip_sal/sal_op_impl.c
bellesip_sal/sal_op_info.c
bellesip_sal/sal_op_message.c
bellesip_sal/sal_op_presence.c
bellesip_sal/sal_op_publish.c
bellesip_sal/sal_op_registration.c
bellesip_sal/sal_sdp.c
buffer.c
callbacks.c
call_log.c
call_params.c
carddav.c
chat.c
chat_file_transfer.c
contactprovider.c
content.c
dial_plan.c
dict.c
ec-calibrator.c
echo-tester.c
enum.c
error_info.c
event.c
factory.c
friend.c
friendlist.c
im_notif_policy.c
info.c
ldapprovider.c
lime.c
im_encryption_engine.c
linphonecall.c
linphonecore.c
linphone_tunnel_config.c
localplayer.c
lpc2xml.c
lpconfig.c
lsd.c
message_storage.c
misc.c
nat_policy.c
offeranswer.c
payload_type.c
player.c
presence.c
proxy.c
quality_reporting.c
remote_provisioning.c
ringtoneplayer.c
sal.c
siplogin.c
sipsetup.c
sqlite3_bctbx_vfs.c
video_definition.c
xml2lpc.c
xml.c
xmlrpc.c
vtables.c
bellesip_sal/sal_address_impl.cc
bellesip_sal/sal_impl.cc
bellesip_sal/sal_op_call.cc
bellesip_sal/sal_op_call_transfer.cc
bellesip_sal/sal_op_events.cc
bellesip_sal/sal_op_impl.cc
bellesip_sal/sal_op_info.cc
bellesip_sal/sal_op_message.cc
bellesip_sal/sal_op_presence.cc
bellesip_sal/sal_op_publish.cc
bellesip_sal/sal_op_registration.cc
bellesip_sal/sal_sdp.cc
)
set(LINPHONE_SOURCE_FILES_CXX conference.cc)
set(LINPHONE_SOURCE_FILES_CXX
AccountCreator.cc
AccountCreatorService.cc
Address.cc
Authentication.cc
Buffer.cc
Call.cc
Callbacks.cc
CallLog.cc
CallParams.cc
CardDav.cc
Chat.cc
ChatFileTransfer.cc
Conference.cc
Config.cc
ContactProvider.cc
Content.cc
Core.cc
DialPlan.cc
Dict.cc
EcCalibrator.cc
EchoTester.cc
Enum.cc
ErrorInfo.cc
Event.cc
Factory.cc
Friend.cc
FriendList.cc
ImEncryptionEngine.cc
ImNotifPolicy.cc
Info.cc
LdapProvider.cc
Lime.cc
LocalPlayer.cc
Lpc2Xml.cc
Lsd.cc
MessageStorage.cc
Misc.cc
NatPolicy.cc
OfferAnswer.cc
PayloadType.cc
Player.cc
Presence.cc
Proxy.cc
QualityReporting.cc
RemoteProvisioning.cc
RingTonePlayer.cc
Sal.cc
SipLogin.cc
SipSetup.cc
Sqlite3BctbxVfs.cc
TunnelConfig.cc
VideoDefinition.cc
Vtables.cc
Xml.cc
Xml2Lpc.cc
XmlRpc.cc
)
if(ANDROID)
list(APPEND LINPHONE_SOURCE_FILES_CXX linphonecore_jni.cc)
set_source_files_properties(linphonecore_jni.cc PROPERTIES COMPILE_DEFINITIONS "USE_JAVAH")
......@@ -134,12 +137,12 @@ endif()
if(ENABLE_TUNNEL)
list(APPEND LINPHONE_SOURCE_FILES_CXX
linphone_tunnel.cc
Tunnel.cc
TunnelManager.cc
)
add_definitions(-DTUNNEL_ENABLED)
else()
list(APPEND LINPHONE_SOURCE_FILES_C linphone_tunnel_stubs.c)
list(APPEND LINPHONE_SOURCE_FILES_CXX TunnelStubs.cc)
endif()
bc_git_version(liblinphone ${PROJECT_VERSION})
......@@ -185,7 +188,7 @@ if(INTL_FOUND)
endif()
if(BELCARD_FOUND)
list(APPEND LIBS ${BELCARD_LIBRARIES})
list(APPEND LINPHONE_SOURCE_FILES_CXX vcard.cc)
list(APPEND LINPHONE_SOURCE_FILES_CXX Vcard.cc)
if(NOT MSVC)
list(APPEND STRICT_OPTIONS_CXX "-std=c++11")
endif()
......@@ -193,7 +196,7 @@ if(BELCARD_FOUND)
list(APPEND STRICT_OPTIONS_CXX "-stdlib=libc++")
endif()
else()
list(APPEND LINPHONE_SOURCE_FILES_C vcard_stubs.c)
list(APPEND LINPHONE_SOURCE_FILES_CXX VcardStubs.c)
endif()
bc_apply_compile_flags(LINPHONE_SOURCE_FILES_C STRICT_OPTIONS_CPP STRICT_OPTIONS_C)
......
......@@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "linphone/sipsetup.h"
#include "linphone/lpconfig.h"
#include "private.h"
#include "conference_private.h"
#include "Conference.h"
#include <ortp/event.h>
#include <ortp/b64.h>
......@@ -44,6 +44,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <bctoolbox/defs.h>
inline OrtpRtcpXrStatSummaryFlag operator|(OrtpRtcpXrStatSummaryFlag a, OrtpRtcpXrStatSummaryFlag b) {
return static_cast<OrtpRtcpXrStatSummaryFlag>(static_cast<int>(a) | static_cast<int>(b));
}
static const char *EC_STATE_STORE = ".linphone.ecstate";
#define EC_STATE_MAX_LEN 1048576 // 1Mo
......@@ -186,7 +191,7 @@ static bool_t generate_b64_crypto_key(size_t key_length, char* key_out, size_t k
return FALSE;
}
b64_size = b64_encode((const char*)tmp, key_length, NULL, 0);
b64_size = b64::b64_encode((const char*)tmp, key_length, NULL, 0);
if (b64_size == 0) {
ms_error("Failed to get b64 result size");
ms_free(tmp);
......@@ -197,7 +202,7 @@ static bool_t generate_b64_crypto_key(size_t key_length, char* key_out, size_t k
ms_free(tmp);
return FALSE;
}
b64_size=b64_encode((const char*)tmp, key_length, key_out, key_out_size);
b64_size = b64::b64_encode((const char*)tmp, key_length, key_out, key_out_size);
if (b64_size == 0) {
ms_error("Failed to b64 encode key");
ms_free(tmp);
......@@ -588,7 +593,7 @@ static int setup_encryption_key(SalSrtpCryptoAlgo *crypto, MSCryptoSuite suite,
}
if (keylen==0 || !generate_b64_crypto_key(keylen, crypto->master_key, SAL_SRTP_KEY_SIZE)){
ms_error("Could not generate SRTP key.");
crypto->algo = 0;
crypto->algo = MS_CRYPTO_SUITE_INVALID;
return -1;
}
return 0;
......@@ -1116,9 +1121,9 @@ static void linphone_call_init_common(LinphoneCall *call, LinphoneAddress *from,
linphone_core_get_text_port_range(call->core, &min_port, &max_port);
port_config_set(call,call->main_text_stream_index,min_port,max_port);
linphone_call_init_stats(call->audio_stats, LINPHONE_CALL_STATS_AUDIO);
linphone_call_init_stats(call->video_stats, LINPHONE_CALL_STATS_VIDEO);
linphone_call_init_stats(call->text_stats, LINPHONE_CALL_STATS_TEXT);
linphone_call_init_stats(call->audio_stats, LinphoneStreamTypeAudio);
linphone_call_init_stats(call->video_stats, LinphoneStreamTypeVideo);
linphone_call_init_stats(call->text_stats, LinphoneStreamTypeText);
if (call->dest_proxy == NULL) {
/* Try to define the destination proxy if it has not already been done to have a correct contact field in the SIP messages */
......@@ -1135,7 +1140,7 @@ static void linphone_call_init_common(LinphoneCall *call, LinphoneAddress *from,
}
void linphone_call_init_stats(LinphoneCallStats *stats, int type) {
void linphone_call_init_stats(LinphoneCallStats *stats, LinphoneStreamType type) {
stats->type = type;
stats->received_rtcp = NULL;
stats->sent_rtcp = NULL;
......@@ -2712,7 +2717,7 @@ void linphone_call_init_audio_stream(LinphoneCall *call){
framesize=lp_config_get_int(lc->config,"sound","ec_framesize",0);
audio_stream_set_echo_canceller_params(audiostream,len,delay,framesize);
if (audiostream->ec) {
char *statestr=ms_malloc0(EC_STATE_MAX_LEN);
char *statestr=(char *)ms_malloc0(EC_STATE_MAX_LEN);
if (lp_config_relative_file_exists(lc->config, EC_STATE_STORE)
&& lp_config_read_relative_file(lc->config, EC_STATE_STORE, statestr, EC_STATE_MAX_LEN) == 0) {
ms_filter_call_method(audiostream->ec, MS_ECHO_CANCELLER_SET_STATE_STRING, statestr);
......@@ -5312,9 +5317,10 @@ LinphoneStatus linphone_call_terminate(LinphoneCall *call) {
LinphoneStatus linphone_call_terminate_with_error_info(LinphoneCall *call , const LinphoneErrorInfo *ei){
SalErrorInfo sei={0};
SalErrorInfo sei;
LinphoneErrorInfo* p_ei = (LinphoneErrorInfo*) ei;
memset(&sei, 0, sizeof(sei));
ms_message("Terminate call [%p] which is currently in state %s", call, linphone_call_state_to_string(call->state));
switch (call->state) {
case LinphoneCallReleased:
......@@ -5352,7 +5358,7 @@ LinphoneStatus linphone_call_redirect(LinphoneCall *call, const char *redirect_u
char *real_url = NULL;
LinphoneCore *lc;
LinphoneAddress *real_parsed_url;
SalErrorInfo sei = {0};
SalErrorInfo sei;
if (call->state != LinphoneCallIncomingReceived) {
ms_error("Bad state for call redirection.");
......@@ -5367,6 +5373,7 @@ LinphoneStatus linphone_call_redirect(LinphoneCall *call, const char *redirect_u
return -1;
}
memset(&sei, 0, sizeof(sei));
real_url = linphone_address_as_string(real_parsed_url);
sal_error_info_set(&sei,SalReasonRedirect, "SIP", 0, NULL, NULL);
sal_call_decline_with_error_info(call->op, &sei, real_url);
......@@ -5390,9 +5397,11 @@ LinphoneStatus linphone_call_decline(LinphoneCall * call, LinphoneReason reason)
LinphoneStatus linphone_call_decline_with_error_info(LinphoneCall * call, const LinphoneErrorInfo *ei) {
SalErrorInfo sei = {0};
SalErrorInfo sub_sei = {0};
SalErrorInfo sei;
SalErrorInfo sub_sei;
memset(&sei, 0, sizeof(sei));
memset(&sub_sei, 0, sizeof(sub_sei));
sei.sub_sei = &sub_sei;
if ((call->state != LinphoneCallIncomingReceived) && (call->state != LinphoneCallIncomingEarlyMedia)) {
......@@ -6005,10 +6014,12 @@ void linphone_call_reinvite_to_recover_from_connection_loss(LinphoneCall *call)
}
void linphone_call_repair_if_broken(LinphoneCall *call){
SalErrorInfo sei = {0};
SalErrorInfo sei;
if (!call->broken) return;
if (!call->core->media_network_reachable) return;
memset(&sei, 0, sizeof(sei));
/*Make sure that the proxy from which we received this call, or to which we routed this call is registered first*/
if (call->dest_proxy){
/*in all other cases, ie no proxy config, or a proxy config for which no registration was requested, we can start the
......@@ -6174,7 +6185,7 @@ void linphone_call_notify_info_message_received(LinphoneCall *call, const Linpho
linphone_core_notify_info_received(linphone_call_get_core(call), call, msg);
}
void linphone_call_notify_ack_processing(LinphoneCall *call, void *msg, bool_t is_received) {
void linphone_call_notify_ack_processing(LinphoneCall *call, LinphoneHeaders *msg, bool_t is_received) {
NOTIFY_IF_EXIST(ack_processing, call, msg, is_received)
}
......@@ -135,8 +135,8 @@ bctbx_list_t * call_logs_read_from_config_file(LinphoneCore *lc){
if (tmp) to=linphone_address_new(tmp);
if (!from || !to)