Compile source files as C++.

This commit is contained in:
Ghislain MARY 2017-07-13 16:04:08 +02:00
parent f2121d520c
commit b9b283dcdb
95 changed files with 372 additions and 384 deletions

View file

@ -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);

View file

@ -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) {

View file

@ -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';
}

View file

@ -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)

View file

@ -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)
}

View file

@ -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)
continue;
cl=linphone_call_log_new(lp_config_get_int(cfg,logsection,"dir",0),from,to);
cl->status=lp_config_get_int(cfg,logsection,"status",0);
cl=linphone_call_log_new(static_cast<LinphoneCallDir>(lp_config_get_int(cfg,logsection,"dir",0)),from,to);
cl->status=static_cast<LinphoneCallStatus>(lp_config_get_int(cfg,logsection,"status",0));
sec=lp_config_get_int64(cfg,logsection,"start_date_time",0);
if (sec) {
/*new call log format with date expressed in seconds */
@ -224,7 +224,7 @@ void linphone_call_log_set_ref_key(LinphoneCallLog *cl, const char *refkey){
}
char * linphone_call_log_to_str(LinphoneCallLog *cl){
char *status;
const char *status;
char *tmp;
char *from=linphone_address_as_string (cl->from);
char *to=linphone_address_as_string (cl->to);
@ -418,7 +418,7 @@ void linphone_core_call_log_storage_close(LinphoneCore *lc) {
static LinphoneCallLog * find_call_log_by_storage_id(bctbx_list_t *call_logs, unsigned int storage_id) {
bctbx_list_t *item;
for (item = call_logs; item != NULL; item = bctbx_list_next(item)) {
LinphoneCallLog *call_log = bctbx_list_get_data(item);
LinphoneCallLog *call_log = reinterpret_cast<LinphoneCallLog *>(bctbx_list_get_data(item));
if (call_log->storage_id == storage_id) return call_log;
}
return NULL;

View file

@ -309,7 +309,8 @@ static void call_received(SalOp *h){
case LinphonePresenceActivityPermanentAbsence:
alt_contact = linphone_presence_model_get_contact(lc->presence_model);
if (alt_contact != NULL) {
SalErrorInfo sei = { 0 };
SalErrorInfo sei;
memset(&sei, 0, sizeof(sei));
sal_error_info_set(&sei,SalReasonRedirect, "SIP", 0, NULL, NULL);
sal_call_decline_with_error_info(h, &sei,alt_contact);
ms_free(alt_contact);
@ -704,9 +705,10 @@ static void call_updated_by_remote(LinphoneCore *lc, LinphoneCall *call){
/* this callback is called when an incoming re-INVITE/ SIP UPDATE modifies the session*/
static void call_updated(LinphoneCore *lc, LinphoneCall *call, SalOp *op, bool_t is_update){
SalErrorInfo sei = { 0 };
SalErrorInfo sei;
SalMediaDescription *rmd=sal_call_get_remote_media_description(op);
memset(&sei, 0, sizeof(sei));
call->defer_update = lp_config_get_int(lc->config, "sip", "defer_update_default", FALSE);
switch(call->state){
@ -766,12 +768,13 @@ static void call_updating(SalOp *op, bool_t is_update){
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
SalMediaDescription *rmd=sal_call_get_remote_media_description(op);
SalErrorInfo sei = {0};
SalErrorInfo sei;
if (!call) {
ms_error("call_updating(): call doesn't exist anymore");
return ;
}
memset(&sei, 0, sizeof(sei));
linphone_call_fix_call_parameters(call, rmd);
if (call->state!=LinphoneCallPaused){
/*Refresh the local description, but in paused state, we don't change anything.*/
@ -825,7 +828,7 @@ static void call_ack_received(SalOp *op, SalCustomHeader *ack){
ms_warning("call_ack(): no call for which an ack is expected");
return;
}
linphone_call_notify_ack_processing(call, ack, TRUE);
linphone_call_notify_ack_processing(call, reinterpret_cast<LinphoneHeaders *>(ack), TRUE);
if (call->expect_media_in_ack){
switch(call->state){
case LinphoneCallStreamsRunning:
@ -847,7 +850,7 @@ static void call_ack_being_sent(SalOp *op, SalCustomHeader *ack){
ms_warning("call_ack(): no call for which an ack is supposed to be sent");
return;
}
linphone_call_notify_ack_processing(call, ack, FALSE);
linphone_call_notify_ack_processing(call, reinterpret_cast<LinphoneHeaders *>(ack), FALSE);
}
static void call_terminated(SalOp *op, const char *from){
@ -910,11 +913,11 @@ static int resume_call_after_failed_transfer(LinphoneCall *call){
static void call_failure(SalOp *op){
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal_op_get_sal(op));
const SalErrorInfo *ei=sal_op_get_error_info(op);
char *msg486=_("User is busy.");
char *msg480=_("User is temporarily unavailable.");
/*char *retrymsg=_("%s. Retry after %i minute(s).");*/
char *msg600=_("User does not want to be disturbed.");
char *msg603=_("Call declined.");
const char *msg486=_("User is busy.");
const char *msg480=_("User is temporarily unavailable.");
/*const char *retrymsg=_("%s. Retry after %i minute(s).");*/
const char *msg600=_("User does not want to be disturbed.");
const char *msg603=_("Call declined.");
const char *msg=ei->full_string;
LinphoneCall *referer;
LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);

View file

@ -572,9 +572,9 @@ static LinphoneCardDavQuery* linphone_carddav_create_put_query(LinphoneCardDavCo
static char* generate_url_from_server_address_and_uid(const char *server_url) {
char *result = NULL;
if (server_url) {
char *uuid = ms_malloc(64);
char *uuid = reinterpret_cast<char *>(ms_malloc(64));
if (sal_generate_uuid(uuid, 64) == 0) {
char *url = ms_malloc(300);
char *url = reinterpret_cast<char *>(ms_malloc(300));
snprintf(url, 300, "%s/linphone-%s.vcf", server_url, uuid);
ms_debug("Generated url is %s", url);
result = ms_strdup(url);

View file

@ -626,10 +626,10 @@ static void create_file_transfer_information_from_vnd_gsma_rcs_ft_http_xml(Linph
/* there is a key in the msg: file has been encrypted */
/* convert the key from base 64 */
xmlChar *keyb64 = xmlNodeListGetString(xmlMessageBody, cur->xmlChildrenNode, 1);
size_t keyLength = b64_decode((char *)keyb64, strlen((char *)keyb64), NULL, 0);
size_t keyLength = b64::b64_decode((char *)keyb64, strlen((char *)keyb64), NULL, 0);
uint8_t *keyBuffer = (uint8_t *)malloc(keyLength);
/* decode the key into local key buffer */
b64_decode((char *)keyb64, strlen((char *)keyb64), keyBuffer, keyLength);
b64::b64_decode((char *)keyb64, strlen((char *)keyb64), keyBuffer, keyLength);
linphone_content_set_key(msg->file_transfer_information, (char *)keyBuffer, keyLength);
/* duplicate key value into the linphone content private structure */
xmlFree(keyb64);
@ -1302,7 +1302,7 @@ void linphone_chat_message_send_display_notification(LinphoneChatMessage *cm) {
}
static char* utf8_to_char(uint32_t ic) {
char *result = ms_malloc(sizeof(char) * 5);
char *result = reinterpret_cast<char *>(ms_malloc(sizeof(char) * 5));
int size = 0;
if (ic < 0x80) {
result[0] = ic;

View file

@ -293,11 +293,11 @@ static void linphone_chat_message_process_response_from_post_file(void *data,
->xmlChildrenNode; /* need to parse the children node to update the file-name
one */
/* convert key to base64 */
size_t b64Size = b64_encode(NULL, content_key_size, NULL, 0);
size_t b64Size = b64::b64_encode(NULL, content_key_size, NULL, 0);
char *keyb64 = (char *)ms_malloc0(b64Size + 1);
int xmlStringLength;
b64Size = b64_encode(content_key, content_key_size, keyb64, b64Size);
b64Size = b64::b64_encode(content_key, content_key_size, keyb64, b64Size);
keyb64[b64Size] = '\0'; /* libxml need a null terminated string */
/* add the node containing the key to the file-info node */

View file

@ -25,7 +25,7 @@
#include "linphone/core.h"
#include "private.h"
#include "conference_private.h"
#include "Conference.h"
#include <mediastreamer2/msvolume.h>
#include <typeinfo>
#include <list>

View file

@ -27,7 +27,7 @@
#include "private.h"
#include "bctoolbox/vfs.h"
#include "belle-sip/object.h"
#include "xml2lpc.h"
#include "Xml2Lpc.h"
#include <stdio.h>
#include <stdlib.h>
@ -59,7 +59,7 @@
#define lp_new0(type,n) (type*)calloc(sizeof(type),n)
#include "linphone/lpconfig.h"
#include "lpc2xml.h"
#include "Lpc2Xml.h"
typedef struct _LpItem{
char *key;
@ -263,9 +263,9 @@ static LpSection* linphone_config_parse_line(LpConfig* lpconfig, const char* lin
char *pos1,*pos2;
int nbs;
size_t size=strlen(line)+1;
char *secname=ms_malloc(size);
char *key=ms_malloc(size);
char *value=ms_malloc(size);
char *secname=reinterpret_cast<char *>(ms_malloc(size));
char *key=reinterpret_cast<char *>(ms_malloc(size));
char *value=reinterpret_cast<char *>(ms_malloc(size));
LpItem *item;
pos1=strchr(line,'[');
@ -1115,7 +1115,7 @@ const char** linphone_config_get_sections_names(LpConfig *lpconfig) {
int i;
ndev = bctbx_list_size(sections);
sections_names = ms_malloc((ndev + 1) * sizeof(const char *));
sections_names = reinterpret_cast<const char **>(ms_malloc((ndev + 1) * sizeof(const char *)));
for (i = 0; sections != NULL; sections = sections->next, i++) {
LpSection *section = (LpSection *)sections->data;

View file

@ -14,7 +14,7 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "contact_providers_priv.h"
#include "ContactProvider.h"
#include "linphone/contactprovider.h"
#include <linphone/core.h>

View file

@ -185,7 +185,7 @@ void linphone_content_set_key(LinphoneContent *content, const char *key, const s
content->key = NULL;
}
if (key != NULL) {
content->key = belle_sip_malloc(keyLength + 1);
content->key = reinterpret_cast<char *>(belle_sip_malloc(keyLength + 1));
memcpy(content->key, key, keyLength);
content->key[keyLength] = '\0';
content->keyLength = keyLength;

View file

@ -22,12 +22,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "linphone/sipsetup.h"
#include "linphone/lpconfig.h"
#include "private.h"
#include "quality_reporting.h"
#include "lime.h"
#include "conference_private.h"
#include "QualityReporting.h"
#include "Lime.h"
#include "Conference.h"
#ifdef SQLITE_STORAGE_ENABLED
#include "sqlite3_bctbx_vfs.h"
#include "Sqlite3BctbxVfs.h"
#endif
#include <math.h>
@ -92,6 +92,13 @@ static const char *liblinphone_version=
LIBLINPHONE_VERSION
#endif
;
inline OrtpLogLevel operator|=(OrtpLogLevel a, OrtpLogLevel b) {
int ia = static_cast<int>(a);
int ib = static_cast<int>(b);
return static_cast<OrtpLogLevel>(ia |= ib);
}
static OrtpLogFunc liblinphone_log_func = NULL;
static LinphoneLogCollectionState liblinphone_log_collection_state = LinphoneLogCollectionDisabled;
static char * liblinphone_log_collection_path = NULL;
@ -109,8 +116,8 @@ static void linphone_core_uninit(LinphoneCore *lc);
static void linphone_core_zrtp_cache_close(LinphoneCore *lc);
void linphone_core_zrtp_cache_db_init(LinphoneCore *lc, const char *fileName);
#include "enum.h"
#include "contact_providers_priv.h"
#include "Enum.h"
#include "ContactProvider.h"
const char *linphone_core_get_nat_address_resolved(LinphoneCore *lc);
@ -1095,7 +1102,7 @@ static void build_sound_devices_table(LinphoneCore *lc){
int i;
const bctbx_list_t *elem=ms_snd_card_manager_get_list(ms_factory_get_snd_card_manager(lc->factory));
ndev=bctbx_list_size(elem);
devices=ms_malloc((ndev+1)*sizeof(const char *));
devices=reinterpret_cast<const char **>(ms_malloc((ndev+1)*sizeof(const char *)));
for (i=0;elem!=NULL;elem=elem->next,i++){
devices[i]=ms_snd_card_get_string_id((MSSndCard *)elem->data);
}
@ -1136,7 +1143,7 @@ static void sound_config_read(LinphoneCore *lc)
MSSndCard* card;
const char* delim=",";
size_t l=strlen(devid);
char* d=malloc(l+1);
char* d=reinterpret_cast<char *>(malloc(l+1));
char* i;
memcpy(d,devid,l+1);
for (l=0,i=strpbrk(d+l,delim);i;i=strpbrk(d+l,delim)){
@ -1325,8 +1332,8 @@ static void sip_config_read(LinphoneCore *lc) {
tmp=lp_config_get_int(lc->config,"sip","guess_hostname",1);
linphone_core_set_guess_hostname(lc,tmp);
tmp=lp_config_get_int(lc->config,"sip","lime",FALSE);
linphone_core_enable_lime(lc,tmp);
tmp=lp_config_get_int(lc->config,"sip","lime",LinphoneLimeDisabled);
linphone_core_enable_lime(lc,static_cast<LinphoneLimeState>(tmp));
tmp=lp_config_get_int(lc->config,"sip","inc_timeout",30);
linphone_core_set_inc_timeout(lc,tmp);
@ -1435,7 +1442,7 @@ static void rtp_config_read(LinphoneCore *lc) {
adaptive_jitt_comp_enabled = lp_config_get_int(lc->config, "rtp", "video_adaptive_jitt_comp_enabled", TRUE);
linphone_core_enable_video_adaptive_jittcomp(lc, adaptive_jitt_comp_enabled);
lc->rtp_conf.disable_upnp = lp_config_get_int(lc->config, "rtp", "disable_upnp", FALSE);
linphone_core_set_avpf_mode(lc,lp_config_get_int(lc->config,"rtp","avpf",0));
linphone_core_set_avpf_mode(lc,static_cast<LinphoneAVPFMode>(lp_config_get_int(lc->config,"rtp","avpf",LinphoneAVPFDisabled)));
if ((tmp=lp_config_get_string(lc->config,"rtp","audio_multicast_addr",NULL)))
linphone_core_set_audio_multicast_addr(lc,tmp);
else
@ -1695,7 +1702,7 @@ static void build_video_devices_table(LinphoneCore *lc){
/* retrieve all video devices */
elem=ms_web_cam_manager_get_list(ms_factory_get_web_cam_manager(lc->factory));
ndev=bctbx_list_size(elem);
devices=ms_malloc((ndev+1)*sizeof(const char *));
devices=reinterpret_cast<const char **>(ms_malloc((ndev+1)*sizeof(const char *)));
for (i=0;elem!=NULL;elem=elem->next,i++){
devices[i]=ms_web_cam_get_string_id((MSWebCam *)elem->data);
}
@ -2103,7 +2110,7 @@ static void linphone_core_internal_notify_received(LinphoneCore *lc, LinphoneEve
if (strcmp(notified_event, "Presence") == 0) {
const bctbx_list_t* friendLists = linphone_core_get_friends_lists(lc);
while( friendLists != NULL ){
LinphoneFriendList* list = friendLists->data;
LinphoneFriendList* list = reinterpret_cast<LinphoneFriendList *>(friendLists->data);
ms_message("notify presence for list %p", list);
linphone_friend_list_notify_presence_received(list, lev, body);
friendLists = friendLists->next;
@ -2211,7 +2218,7 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig
/* Create the http provider in dual stack mode (ipv4 and ipv6.
* If this creates problem, we may need to implement parallel ipv6/ ipv4 http requests in belle-sip.
*/
lc->http_provider = belle_sip_stack_create_http_provider(sal_get_stack_impl(lc->sal), "::0");
lc->http_provider = belle_sip_stack_create_http_provider(reinterpret_cast<belle_sip_stack_t *>(sal_get_stack_impl(lc->sal)), "::0");
lc->http_crypto_config = belle_tls_crypto_config_new();
belle_http_provider_set_tls_crypto_config(lc->http_provider,lc->http_crypto_config);
@ -2443,13 +2450,13 @@ bool_t linphone_core_lime_available(const LinphoneCore *lc){
}
LinphoneLimeState linphone_core_lime_enabled(const LinphoneCore *lc){
return linphone_core_lime_available(lc) ? lp_config_get_int(lc->config,"sip", "lime", LinphoneLimeDisabled) : LinphoneLimeDisabled;
return linphone_core_lime_available(lc) ? static_cast<LinphoneLimeState>(lp_config_get_int(lc->config,"sip", "lime", LinphoneLimeDisabled)) : LinphoneLimeDisabled;
}
LinphoneLimeState linphone_core_lime_for_file_sharing_enabled(const LinphoneCore *lc){
LinphoneLimeState s = linphone_core_lime_enabled(lc);
if (s != LinphoneLimeDisabled) {
s = lp_config_get_int(lc->config,"sip", "lime_for_file_sharing", 1);
s = static_cast<LinphoneLimeState>(lp_config_get_int(lc->config,"sip", "lime_for_file_sharing", LinphoneLimeMandatory));
}
return s;
}
@ -3891,7 +3898,7 @@ void linphone_core_set_delayed_timeout(LinphoneCore *lc, int seconds){
void linphone_core_set_presence_info(LinphoneCore *lc, int minutes_away, const char *contact, LinphoneOnlineStatus os) {
LinphonePresenceModel *presence = NULL;
LinphonePresenceActivity *activity = NULL;
char *description = NULL;
const char *description = NULL;
LinphonePresenceActivityType acttype = LinphonePresenceActivityUnknown;
if (minutes_away>0) lc->minutes_away=minutes_away;
@ -4829,7 +4836,7 @@ void linphone_core_migrate_logs_from_rc_to_db(LinphoneCore *lc) {
lp_config_clean_section(lpc, logsection);
}
} else {
ms_error("not as many logs saved in db has logs read from rc ("FORMAT_SIZE_T" in rc against "FORMAT_SIZE_T" in db)!", original_logs_count, migrated_logs_count);
ms_error("not as many logs saved in db has logs read from rc (" FORMAT_SIZE_T " in rc against " FORMAT_SIZE_T " in db)!", original_logs_count, migrated_logs_count);
}
bctbx_list_free_with_data(logs_to_migrate, (void (*)(void*))linphone_call_log_unref);
@ -6039,7 +6046,7 @@ static void linphone_core_uninit(LinphoneCore *lc)
lc->video_conf.show_local = FALSE;
while(lc->calls) {
LinphoneCall *the_call = lc->calls->data;
LinphoneCall *the_call = reinterpret_cast<LinphoneCall *>(lc->calls->data);
linphone_call_terminate(the_call);
linphone_core_iterate(lc);
ms_usleep(10000);
@ -6300,7 +6307,7 @@ void linphone_core_soundcard_hint_check( LinphoneCore* lc){
/* check if the remaining calls are paused */
while( the_calls ){
call = the_calls->data;
call = reinterpret_cast<LinphoneCall *>(the_calls->data);
if( call->state != LinphoneCallPausing && call->state != LinphoneCallPaused && call->state != LinphoneCallEnd && call->state != LinphoneCallError){
dont_need_sound = FALSE;
break;
@ -6527,7 +6534,7 @@ void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file){
/* shall we perform cache migration ? */
if (!lp_config_get_int(lc->config,"sip","zrtp_cache_migration_done",FALSE)) {
char *tmpFile = bctbx_malloc(strlen(file)+6);
char *tmpFile = reinterpret_cast<char *>(bctbx_malloc(strlen(file)+6));
/* check we have a valid xml cache file given in path */
FILE *CACHEFD = NULL;
/* load the xml cache */
@ -6555,7 +6562,7 @@ void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file){
linphone_core_zrtp_cache_db_init(lc, tmpFile);
/* migrate */
char *bkpFile = bctbx_malloc(strlen(file)+6);
char *bkpFile = reinterpret_cast<char *>(bctbx_malloc(strlen(file)+6));
sprintf(bkpFile,"%s.bkp", file);
if ((ret = ms_zrtp_cache_migration((void *)cacheXml, linphone_core_get_zrtp_cache_db(lc), linphone_core_get_identity(lc))) == 0) {
@ -6607,7 +6614,7 @@ void linphone_core_zrtp_cache_db_init(LinphoneCore *lc, const char *fileName) {
int ret;
const char *errmsg;
const char *backupExtension = "_backup";
char *backupName = malloc(snprintf(NULL, 0, "%s%s", fileName, backupExtension) + 1);
char *backupName = reinterpret_cast<char *>(malloc(snprintf(NULL, 0, "%s%s", fileName, backupExtension) + 1));
sprintf(backupName, "%s%s", fileName, backupExtension);
sqlite3 *db;

View file

@ -31,7 +31,8 @@ static void ecc_init_filters(EcCalibrator *ecc){
unsigned int rate;
int channels = 1;
int ecc_channels = 1;
MSTickerParams params={0};
MSTickerParams params;
memset(&params, 0, sizeof(params));
params.name="Echo calibrator";
params.prio=MS_TICKER_PRIO_HIGH;
ecc->ticker=ms_ticker_new_with_params(&params);

View file

@ -39,7 +39,8 @@ static void ect_init_filters(EchoTester *ect) {
unsigned int rate;
int channels = 1;
int ect_channels = 1;
MSTickerParams params={0};
MSTickerParams params;
memset(&params, 0, sizeof(params));
params.name="Echo tester";
params.prio=MS_TICKER_PRIO_HIGH;
ect->ticker=ms_ticker_new_with_params(&params);

View file

@ -25,14 +25,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <string.h>
#include "enum.h"
#include "Enum.h"
#define DNS_ANSWER_MAX_SIZE 2048
static char *create_enum_domain(const char *number){
long len=(long)strlen(number);
char *domain=ms_malloc((len*2)+10);
char *domain=reinterpret_cast<char *>(ms_malloc((len*2)+10));
long i,j;
for (i=0,j=len-1;j>=0;j--){
@ -144,7 +144,7 @@ int enum_lookup(const char *enum_domain, enum_lookup_res_t **res){
ms_warning("No sip address found in dns naptr answer.");
return -1;
}
*res=ms_malloc0(sizeof(enum_lookup_res_t));
*res=reinterpret_cast<enum_lookup_res_t *>(ms_malloc0(sizeof(enum_lookup_res_t)));
err=0;
for(i=0;i<MAX_ENUM_LOOKUP_RESULTS;i++){
end=strstr(begin,"!");

View file

@ -680,7 +680,7 @@ const LinphonePresenceModel * linphone_friend_get_presence_model(const LinphoneF
phones = linphone_friend_get_phone_numbers(const_lf);
for (it = phones; it!= NULL; it = it->next) {
presence = linphone_friend_get_presence_model_for_uri_or_tel(const_lf, it->data);
presence = linphone_friend_get_presence_model_for_uri_or_tel(const_lf, reinterpret_cast<const char *>(it->data));
if (presence) break;
}
bctbx_list_free(phones);
@ -1409,7 +1409,7 @@ static int create_friend(void *data, int argc, char **argv, char **colName) {
}
}
}
linphone_friend_set_inc_subscribe_policy(lf, atoi(argv[3]));
linphone_friend_set_inc_subscribe_policy(lf, static_cast<LinphoneSubscribePolicy>(atoi(argv[3])));
linphone_friend_send_subscribe(lf, atoi(argv[4]));
linphone_friend_set_ref_key(lf, ms_strdup(argv[5]));
lf->presence_received = atoi(argv[9]);

View file

@ -171,7 +171,7 @@ static char * create_resource_list_xml(const LinphoneFriendList *list) {
bctbx_list_t* entries = uri_list(list);
bctbx_list_t* it;
for(it = entries; it != NULL; it = it->next){
err = add_uri_entry(writer, err, it->data);
err = add_uri_entry(writer, err, reinterpret_cast<const char *>(it->data));
}
bctbx_list_free_with_data(entries, ms_free);
}
@ -762,7 +762,7 @@ void linphone_friend_list_synchronize_friends_from_server(LinphoneFriendList *li
LinphoneFriend * linphone_friend_list_find_friend_by_address(const LinphoneFriendList *list, const LinphoneAddress *address) {
LinphoneFriend *result = NULL;
char *uri = linphone_address_as_string_uri_only(address);
bctbx_iterator_t* it = bctbx_map_cchar_find_key(list->friends_map_uri, (void*)uri);
bctbx_iterator_t* it = bctbx_map_cchar_find_key(list->friends_map_uri, uri);
if (!bctbx_iterator_cchar_equals(it, bctbx_map_cchar_end(list->friends_map_uri))) {
bctbx_pair_t *pair = bctbx_iterator_cchar_get_pair(it);
result = (LinphoneFriend *)bctbx_pair_cchar_get_second(pair);
@ -784,7 +784,7 @@ LinphoneFriend * linphone_friend_list_find_friend_by_uri(const LinphoneFriendLis
LinphoneFriend * linphone_friend_list_find_friend_by_ref_key(const LinphoneFriendList *list, const char *ref_key) {
if(list) {
bctbx_iterator_t* it = bctbx_map_cchar_find_key(list->friends_map, (void*)ref_key);
bctbx_iterator_t* it = bctbx_map_cchar_find_key(list->friends_map, ref_key);
if (!bctbx_iterator_cchar_equals(it, bctbx_map_cchar_end(list->friends_map))) {
bctbx_pair_t *pair = bctbx_iterator_cchar_get_pair(it);
return (LinphoneFriend *)bctbx_pair_cchar_get_second(pair);
@ -836,7 +836,7 @@ static void linphone_friend_list_send_list_subscription(LinphoneFriendList *list
int expires = lp_config_get_int(list->lc->config, "sip", "rls_presence_expires", 3600);
list->expected_notification_version = 0;
if (list->content_digest != NULL) ms_free(list->content_digest);
list->content_digest = ms_malloc(sizeof(digest));
list->content_digest = reinterpret_cast<unsigned char *>(ms_malloc(sizeof(digest)));
memcpy(list->content_digest, digest, sizeof(digest));
if (list->event != NULL) {
linphone_event_terminate(list->event);

View file

@ -32,7 +32,7 @@ BELLE_SIP_INSTANCIATE_VPTR(LinphoneImNotifPolicy, belle_sip_object_t,
static void load_im_notif_policy_from_config(LinphoneImNotifPolicy *policy) {
bctbx_list_t *default_list = bctbx_list_append(NULL, "all");
bctbx_list_t *default_list = bctbx_list_append(NULL, (void *)"all");
bctbx_list_t *values = lp_config_get_string_list(policy->lc->config, "sip", "im_notif_policy", default_list);
bctbx_list_t *elem;
@ -87,20 +87,20 @@ static void save_im_notif_policy_to_config(LinphoneImNotifPolicy *policy) {
&& (policy->recv_imdn_delivered == FALSE)
&& (policy->send_imdn_displayed == FALSE)
&& (policy->recv_imdn_displayed == FALSE)) {
values = bctbx_list_append(values, "none");
values = bctbx_list_append(values, (void *)"none");
} else {
if (policy->send_is_composing == TRUE)
values = bctbx_list_append(values, "send_is_comp");
values = bctbx_list_append(values, (void *)"send_is_comp");
if (policy->recv_is_composing == TRUE)
values = bctbx_list_append(values, "recv_is_comp");
values = bctbx_list_append(values, (void *)"recv_is_comp");
if (policy->send_imdn_delivered == TRUE)
values = bctbx_list_append(values, "send_imdn_delivered");
values = bctbx_list_append(values, (void *)"send_imdn_delivered");
if (policy->recv_imdn_delivered == TRUE)
values = bctbx_list_append(values, "recv_imdn_delivered");
values = bctbx_list_append(values, (void *)"recv_imdn_delivered");
if (policy->send_imdn_displayed == TRUE)
values = bctbx_list_append(values, "send_imdn_displayed");
values = bctbx_list_append(values, (void *)"send_imdn_displayed");
if (policy->recv_imdn_displayed == TRUE)
values = bctbx_list_append(values, "recv_imdn_displayed");
values = bctbx_list_append(values, (void *)"recv_imdn_displayed");
}
lp_config_set_string_list(policy->lc->config, "sip", "im_notif_policy", values);
if (values != NULL) bctbx_list_free(values);

View file

@ -17,7 +17,7 @@
#include "linphone/ldapprovider.h"
#include "private.h"
#include "linphone/lpconfig.h"
#include "contact_providers_priv.h"
#include "ContactProvider.h"
#include "mediastreamer2/mscommon.h"
#include <belle-sip/dict.h>

View file

@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "lime.h"
#include "Lime.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
@ -252,8 +252,8 @@ int lime_getCachedRcvKeyByZid(void *cachedb, limeKey_t *associatedKey, const cha
int lime_setCachedKey(void *cachedb, limeKey_t *associatedKey, uint8_t role, uint64_t validityTimeSpan) {
bctoolboxTimeSpec currentTime;
/* columns to be written in cache */
char *colNamesSender[] = {"sndKey", "sndSId", "sndIndex"}; /* Sender never update the validity period */
char *colNamesReceiver[] = {"rcvKey", "rcvSId", "rcvIndex", "valid"};
const char *colNamesSender[] = {"sndKey", "sndSId", "sndIndex"}; /* Sender never update the validity period */
const char *colNamesReceiver[] = {"rcvKey", "rcvSId", "rcvIndex", "valid"};
uint8_t *colValues[4];
uint8_t sessionIndex[4]; /* buffer to hold the uint32_t buffer index in big endian */
size_t colLength[] = {32, 32, 4, 8}; /* data length: keys and session ID : 32 bytes, Index: 4 bytes(uint32_t), validity : 8 bytes(UTC time as int64_t) */
@ -534,7 +534,7 @@ int lime_createMultipartMessage(void *cachedb, const char *contentType, uint8_t
/* convert the cipherText to base 64 */
bctbx_base64_encode(NULL, &b64Size, encryptedMessage, encryptedMessageLength); /* b64Size is 0, so it is set to the requested output buffer size */
encryptedMessageb64 = ms_malloc(b64Size+1); /* allocate a buffer of requested size +1 for NULL termination */
encryptedMessageb64 = reinterpret_cast<unsigned char *>(ms_malloc(b64Size+1)); /* allocate a buffer of requested size +1 for NULL termination */
bctbx_base64_encode(encryptedMessageb64, &b64Size, encryptedMessage, encryptedMessageLength); /* b64Size is 0, so it is set to the requested output buffer size */
encryptedMessageb64[b64Size] = '\0'; /* libxml need a null terminated string */
xmlNewTextChild(msgNode, NULL, (const xmlChar *)"text", (const xmlChar *)encryptedMessageb64);
@ -544,7 +544,7 @@ int lime_createMultipartMessage(void *cachedb, const char *contentType, uint8_t
/* convert the encrypted content-type to base 64 */
b64Size = 0;
bctbx_base64_encode(NULL, &b64Size, encryptedContentType, encryptedContentTypeLength); /* b64Size is 0, so it is set to the requested output buffer size */
encryptedContentTypeb64 = ms_malloc(b64Size+1); /* allocate a buffer of requested size +1 for NULL termination */
encryptedContentTypeb64 = reinterpret_cast<unsigned char *>(ms_malloc(b64Size+1)); /* allocate a buffer of requested size +1 for NULL termination */
bctbx_base64_encode(encryptedContentTypeb64, &b64Size, encryptedContentType, encryptedContentTypeLength); /* b64Size is 0, so it is set to the requested output buffer size */
encryptedContentTypeb64[b64Size] = '\0'; /* libxml need a null terminated string */
xmlNewTextChild(msgNode, NULL, (const xmlChar *)"content-type", (const xmlChar *)encryptedContentTypeb64);
@ -824,7 +824,7 @@ int lime_im_encryption_engine_process_incoming_message_cb(LinphoneImEncryptionEn
int lime_im_encryption_engine_process_outgoing_message_cb(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room, LinphoneChatMessage *msg) {
LinphoneCore *lc = linphone_im_encryption_engine_get_core(engine);
int errcode = -1;
char *new_content_type = "xml/cipher";
const char *new_content_type = "xml/cipher";
if(linphone_core_lime_enabled(room->lc)) {
if (linphone_chat_room_lime_available(room)) {
void *zrtp_cache_db = NULL; /* use a void * instead of sqlite3 * to avoid problems and ifdef when SQLITE is not available(the get function shall return NULL in that case) */
@ -969,7 +969,7 @@ void lime_im_encryption_engine_generate_file_transfer_key_cb(LinphoneImEncryptio
}
#endif /* HAVE_LIME */
char *lime_error_code_to_string(int errorCode) {
const char *lime_error_code_to_string(int errorCode) {
switch (errorCode) {
case LIME_INVALID_CACHE: return "Invalid ZRTP cache";
case LIME_UNABLE_TO_DERIVE_KEY: return "Unable to derive Key";

View file

@ -61,6 +61,10 @@ typedef struct limeURIKeys_struct {
char *selfURI; /**< the local sip URI used to send messages, must be a null terminated string */
} limeURIKeys_t;
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Get from cache all the senders keys associated to the given URI
* peerKeys field from associatedKeys param must be NULL when calling this function.
@ -201,7 +205,7 @@ LINPHONE_PUBLIC int lime_decryptMultipartMessage(void *cachedb, uint8_t *message
* @param[in] errorCode The error code
* @return a string containing the error description
*/
LINPHONE_PUBLIC char *lime_error_code_to_string(int errorCode);
LINPHONE_PUBLIC const char *lime_error_code_to_string(int errorCode);
/**
* @brief Check if Lime was enabled at build time
@ -222,4 +226,9 @@ bool_t lime_im_encryption_engine_is_file_encryption_enabled_cb(LinphoneImEncrypt
void lime_im_encryption_engine_generate_file_transfer_key_cb(LinphoneImEncryptionEngine *engine, LinphoneChatRoom *room, LinphoneChatMessage *msg);
#ifdef __cplusplus
}
#endif
#endif /* LIME_H */

View file

@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "lpc2xml.h"
#include "Lpc2Xml.h"
#include <string.h>
#include <libxml/xmlsave.h>
#include <libxml/xmlversion.h>
@ -33,7 +33,7 @@ static xmlChar* convert_iso_to_utf8(const char *in) {
size = (int)strlen(in) + 1;
out_size = size * 2 - 1;
out = ms_malloc((size_t)out_size);
out = reinterpret_cast<xmlChar *>(ms_malloc((size_t)out_size));
if (out) {
handler = xmlFindCharEncodingHandler(ISO_ENCODING);
@ -48,7 +48,7 @@ static xmlChar* convert_iso_to_utf8(const char *in) {
ms_free(out);
return NULL;
} else {
out = ms_realloc(out, out_size + 1);
out = reinterpret_cast<xmlChar *>(ms_realloc(out, out_size + 1));
out[out_size] = '\0';
}
}
@ -93,7 +93,7 @@ static void lpc2xml_context_clear_logs(lpc2xml_context *ctx) {
ctx->warningBuffer[0]='\0';
}
static void lpc2xml_log(lpc2xml_context *xmlCtx, int level, const char *fmt, ...) {
static void lpc2xml_log(lpc2xml_context *xmlCtx, lpc2xml_log_level level, const char *fmt, ...) {
va_list args;
va_start(args, fmt);
if(xmlCtx->cbf != NULL) {

View file

@ -246,7 +246,7 @@ static int create_chat_message(void *data, int argc, char **argv, char **colName
new_message->time = (time_t)atol(argv[9]);
new_message->is_read=atoi(argv[6]);
new_message->state=atoi(argv[7]);
new_message->state=static_cast<LinphoneChatMessageState>(atoi(argv[7]));
new_message->storage_id=storage_id;
new_message->external_body_url= ms_strdup(argv[8]);
new_message->appdata = ms_strdup(argv[10]);
@ -567,7 +567,7 @@ bctbx_list_t *linphone_chat_room_get_history_range(LinphoneChatRoom *cr, int sta
cr->messages_hist = NULL;
/*since we want to append query parameters depending on arguments given, we use malloc instead of sqlite3_mprintf*/
buf=ms_malloc(buf_max_size);
buf=reinterpret_cast<char *>(ms_malloc(buf_max_size));
buf=sqlite3_snprintf(buf_max_size-1,buf,"SELECT * FROM history WHERE remoteContact = %Q ORDER BY id DESC",peer);
@ -605,7 +605,7 @@ bctbx_list_t *linphone_chat_room_get_history_range(LinphoneChatRoom *cr, int sta
LinphoneAddress* local_addr = linphone_address_new(linphone_core_get_identity(cr->lc));
bctbx_list_t* it = cr->messages_hist;
while (it) {
LinphoneChatMessage* msg = it->data;
LinphoneChatMessage* msg = reinterpret_cast<LinphoneChatMessage *>(it->data);
if (msg->dir == LinphoneChatMessageOutgoing) {
if (msg->from != NULL) linphone_address_unref(msg->from);
msg->from = linphone_address_ref(local_addr);

View file

@ -180,7 +180,7 @@ bool_t lp_spawn_command_line_sync(const char *command, char **result,int *comman
FILE *f=popen(command,"r");
if (f!=NULL){
int err;
*result=ms_malloc(4096);
*result=reinterpret_cast<char *>(ms_malloc(4096));
err=(int)fread(*result,1,4096-1,f);
if (err<0){
ms_warning("Error reading command output:%s",strerror(errno));
@ -881,7 +881,7 @@ void _update_local_media_description_from_ice(SalMediaDescription *desc, IceSess
memset(stream->ice_candidates, 0, sizeof(stream->ice_candidates));
for (j = 0; j < MIN((int)bctbx_list_size(cl->local_candidates), SAL_MEDIA_DESCRIPTION_MAX_ICE_CANDIDATES); j++) {
SalIceCandidate *sal_candidate = &stream->ice_candidates[nb_candidates];
IceCandidate *ice_candidate = bctbx_list_nth_data(cl->local_candidates, j);
IceCandidate *ice_candidate = reinterpret_cast<IceCandidate *>(bctbx_list_nth_data(cl->local_candidates, j));
const char *default_addr = NULL;
int default_port = 0;
if (ice_candidate->componentID == 1) {
@ -1354,7 +1354,7 @@ const MSCryptoSuite * linphone_core_get_srtp_crypto_suites(LinphoneCore *lc){
np.params=params;
suite=ms_crypto_suite_build_from_name_params(&np);
if (suite!=MS_CRYPTO_SUITE_INVALID){
result=ms_realloc(result,(found+2)*sizeof(MSCryptoSuite));
result=reinterpret_cast<MSCryptoSuite *>(ms_realloc(result,(found+2)*sizeof(MSCryptoSuite)));
result[found]=suite;
result[found+1]=MS_CRYPTO_SUITE_INVALID;
found++;
@ -1504,7 +1504,7 @@ const char ** linphone_core_get_supported_file_formats(LinphoneCore *core){
static const char *mkv="mkv";
static const char *wav="wav";
if (core->supported_formats==NULL){
core->supported_formats=ms_malloc0(3*sizeof(char*));
core->supported_formats=reinterpret_cast<const char **>(ms_malloc0(3*sizeof(char*)));
core->supported_formats[0]=wav;
if (ms_factory_lookup_filter_by_id(core->factory,MS_MKV_RECORDER_ID)){
core->supported_formats[1]=mkv;

View file

@ -72,11 +72,11 @@ static void _linphone_nat_policy_save_to_config(const LinphoneNatPolicy *policy,
lp_config_set_string(config, section, "stun_server", policy->stun_server);
lp_config_set_string(config, section, "stun_server_username", policy->stun_server_username);
if (linphone_nat_policy_upnp_enabled(policy)) {
l = bctbx_list_append(l, "upnp");
l = bctbx_list_append(l, (void *)"upnp");
} else {
if (linphone_nat_policy_stun_enabled(policy)) l = bctbx_list_append(l, "stun");
if (linphone_nat_policy_turn_enabled(policy)) l = bctbx_list_append(l, "turn");
if (linphone_nat_policy_ice_enabled(policy)) l = bctbx_list_append(l, "ice");
if (linphone_nat_policy_stun_enabled(policy)) l = bctbx_list_append(l, (void *)"stun");
if (linphone_nat_policy_turn_enabled(policy)) l = bctbx_list_append(l, (void *)"turn");
if (linphone_nat_policy_ice_enabled(policy)) l = bctbx_list_append(l, (void *)"ice");
}
lp_config_set_string_list(config, section, "protocols", l);
belle_sip_free(section);

View file

@ -18,7 +18,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "sal/sal.h"
#include "offeranswer.h"
#include "OfferAnswer.h"
#include "private.h"
static bool_t only_telephone_event(const bctbx_list_t *l){

View file

@ -25,6 +25,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
It can be used by implementations of SAL directly.
**/
#ifdef __cplusplus
extern "C" {
#endif
/**
* Returns a media description to run the streams with, based on a local offer
@ -43,5 +46,8 @@ int offer_answer_initiate_incoming(MSFactory* factory, const SalMediaDescription
const SalMediaDescription *remote_offer,
SalMediaDescription *result, bool_t one_matching_codec);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -178,7 +178,7 @@ static void call_player_close(LinphonePlayer *player){
}
static void on_call_destroy(void *obj, belle_sip_object_t *call_being_destroyed){
linphone_player_unref(obj);
linphone_player_unref(reinterpret_cast<LinphonePlayer *>(obj));
}
LinphonePlayer *linphone_call_build_player(LinphoneCall *call){

View file

@ -553,7 +553,7 @@ LinphoneStatus linphone_presence_model_add_note(LinphonePresenceModel *model, co
return -1;
/* Will put the note in the first service. */
service = bctbx_list_nth_data(model->services, 0);
service = reinterpret_cast<LinphonePresenceService *>(bctbx_list_nth_data(model->services, 0));
if (service == NULL) {
/* If no service exists, create one. */
service = presence_service_new(generate_presence_id(), LinphonePresenceBasicStatusClosed);
@ -1920,7 +1920,7 @@ end:
void linphone_notify_recv(LinphoneCore *lc, SalOp *op, SalSubscribeStatus ss, SalPresenceModel *model){
char *tmp;
LinphoneFriend *lf = NULL;
const LinphoneAddress *friend=NULL;
const LinphoneAddress *lfa=NULL;
LinphonePresenceModel *presence;
if (model != NULL) {
@ -1940,9 +1940,9 @@ void linphone_notify_recv(LinphoneCore *lc, SalOp *op, SalSubscribeStatus ss, Sa
LinphonePresenceActivity *activity = NULL;
char *activity_str;
activity = linphone_presence_model_get_activity(presence);
friend=linphone_friend_get_address(lf);
if (friend != NULL) {
tmp=linphone_address_as_string(friend);
lfa=linphone_friend_get_address(lf);
if (lfa != NULL) {
tmp=linphone_address_as_string(lfa);
if (activity == NULL) {
activity_str = linphone_presence_basic_status_to_string(linphone_presence_model_get_basic_status(presence));
} else {

View file

@ -24,7 +24,7 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org)
#include "linphone/lpconfig.h"
#include "private.h"
#include "mediastreamer2/mediastream.h"
#include "enum.h"
#include "Enum.h"
#include <ctype.h>
/*store current config related to server location*/
@ -124,7 +124,7 @@ static void linphone_proxy_config_init(LinphoneCore* lc, LinphoneProxyConfig *cf
cfg->quality_reporting_interval = lc ? lp_config_get_default_int(lc->config, "proxy", "quality_reporting_interval", 0) : 0;
cfg->contact_params = contact_params ? ms_strdup(contact_params) : NULL;
cfg->contact_uri_params = contact_uri_params ? ms_strdup(contact_uri_params) : NULL;
cfg->avpf_mode = lc ? lp_config_get_default_int(lc->config, "proxy", "avpf", LinphoneAVPFDefault) : LinphoneAVPFDefault;
cfg->avpf_mode = lc ? static_cast<LinphoneAVPFMode>(lp_config_get_default_int(lc->config, "proxy", "avpf", LinphoneAVPFDefault)) : LinphoneAVPFDefault;
cfg->avpf_rr_interval = lc ? lp_config_get_default_int(lc->config, "proxy", "avpf_rr_interval", 5) : 5;
cfg->publish_expires= lc ? lp_config_get_default_int(lc->config, "proxy", "publish_expires", -1) : -1;
cfg->publish = lc ? lp_config_get_default_int(lc->config, "proxy", "publish", FALSE) : FALSE;
@ -609,7 +609,7 @@ bool_t linphone_proxy_config_is_phone_number(LinphoneProxyConfig *proxy, const c
//remove anything but [0-9] and +
static char *flatten_number(const char *number){
char *result=ms_malloc0(strlen(number)+1);
char *result=reinterpret_cast<char *>(ms_malloc0(strlen(number)+1));
char *w=result;
const char *r;
for(r=number;*r!='\0';++r){
@ -1074,7 +1074,7 @@ void linphone_core_set_default_proxy_config(LinphoneCore *lc, LinphoneProxyConfi
void linphone_core_set_default_proxy_index(LinphoneCore *lc, int index){
if (index<0) linphone_core_set_default_proxy(lc,NULL);
else linphone_core_set_default_proxy(lc,bctbx_list_nth_data(lc->sip_conf.proxies,index));
else linphone_core_set_default_proxy(lc,reinterpret_cast<LinphoneProxyConfig *>(bctbx_list_nth_data(lc->sip_conf.proxies,index)));
}
int linphone_core_get_default_proxy(LinphoneCore *lc, LinphoneProxyConfig **config){
@ -1188,7 +1188,7 @@ LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore* lc
CONFIGURE_INT_VALUE(cfg,config,key,expires,"reg_expires")
CONFIGURE_BOOL_VALUE(cfg,config,key,register,"reg_sendregister")
CONFIGURE_BOOL_VALUE(cfg,config,key,publish,"publish")
CONFIGURE_INT_VALUE(cfg,config,key,avpf_mode,"avpf")
linphone_proxy_config_set_avpf_mode(cfg,static_cast<LinphoneAVPFMode>(lp_config_get_int(config,key,"avpf",linphone_proxy_config_get_avpf_mode(cfg))));
CONFIGURE_INT_VALUE(cfg,config,key,avpf_rr_interval,"avpf_rr_interval")
CONFIGURE_INT_VALUE(cfg,config,key,dial_escape_plus,"dial_escape_plus")
CONFIGURE_STRING_VALUE(cfg,config,key,dial_prefix,"dial_prefix")

View file

@ -347,7 +347,7 @@ static int send_report(LinphoneCall* call, reporting_session_report_t * report,
ms_free(buffer);
if (call->log->reporting.on_report_sent != NULL) {
SalStreamType type = report == call->log->reporting.reports[0] ? LINPHONE_CALL_STATS_AUDIO : report == call->log->reporting.reports[1] ? LINPHONE_CALL_STATS_VIDEO : LINPHONE_CALL_STATS_TEXT;
SalStreamType type = report == call->log->reporting.reports[0] ? SalAudio : report == call->log->reporting.reports[1] ? SalVideo : SalText;
call->log->reporting.on_report_sent(call, type, content);
}
@ -681,7 +681,7 @@ static int publish_report(LinphoneCall *call, const char *event_type){
}
int linphone_reporting_publish_session_report(LinphoneCall* call, bool_t call_term) {
char * session_type = call_term?"VQSessionReport: CallTerm":"VQSessionReport";
const char * session_type = call_term?"VQSessionReport: CallTerm":"VQSessionReport";
return publish_report(call, session_type);
}

View file

@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "private.h"
#include "xml2lpc.h"
#include "Xml2Lpc.h"
#include "linphone/lpconfig.h"
#define XML2LPC_CALLBACK_BUFFER_SIZE 1024

View file

@ -537,7 +537,7 @@ const SalAddress*sal_op_get_remote_contact_address(const SalOp* op)
void sal_op_set_route(SalOp *op, const char *route){
char* route_string=(void *)0;
char* route_string=NULL;
SalOpBase* op_base = (SalOpBase*)op;
if (op_base->route_addresses) {
bctbx_list_for_each(op_base->route_addresses,(void (*)(void *))sal_address_destroy);

View file

@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifdef SQLITE_STORAGE_ENABLED
#include "private.h"
#include "sqlite3_bctbx_vfs.h"
#include "Sqlite3BctbxVfs.h"
#include <sqlite3.h>
#ifndef _WIN32_WCE

View file

@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "vcard_private.h"
#include "Vcard.h"
#include "belcard/belcard.hpp"
#include "belcard/belcard_parser.hpp"
#include "sal/sal.h"

View file

@ -18,7 +18,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "xml2lpc.h"
#include "Xml2Lpc.h"
#include <string.h>
#include <libxml/xmlreader.h>
@ -69,7 +69,7 @@ static void xml2lpc_context_clear_logs(xml2lpc_context *ctx) {
ctx->warningBuffer[0]='\0';
}
static void xml2lpc_log(xml2lpc_context *xmlCtx, int level, const char *fmt, ...) {
static void xml2lpc_log(xml2lpc_context *xmlCtx, xml2lpc_log_level level, const char *fmt, ...) {
va_list args;
va_start(args, fmt);
if(xmlCtx->cbf != NULL) {

View file

@ -261,14 +261,14 @@ static LinphoneXmlRpcRequest * _linphone_xml_rpc_request_new(LinphoneXmlRpcArgTy
}
static void _linphone_xml_rpc_request_add_int_arg(LinphoneXmlRpcRequest *request, int value) {
LinphoneXmlRpcArg *arg = belle_sip_malloc0(sizeof(LinphoneXmlRpcArg));
LinphoneXmlRpcArg *arg = reinterpret_cast<LinphoneXmlRpcArg *>(belle_sip_malloc0(sizeof(LinphoneXmlRpcArg)));
arg->type = LinphoneXmlRpcArgInt;
arg->data.i = value;
request->arg_list = belle_sip_list_append(request->arg_list, arg);
}
static void _linphone_xml_rpc_request_add_string_arg(LinphoneXmlRpcRequest *request, const char *value) {
LinphoneXmlRpcArg *arg = belle_sip_malloc0(sizeof(LinphoneXmlRpcArg));
LinphoneXmlRpcArg *arg = reinterpret_cast<LinphoneXmlRpcArg *>(belle_sip_malloc0(sizeof(LinphoneXmlRpcArg)));
arg->type = LinphoneXmlRpcArgString;
arg->data.s = belle_sip_strdup(value);
request->arg_list = belle_sip_list_append(request->arg_list, arg);
@ -312,31 +312,6 @@ LinphoneXmlRpcRequest * linphone_xml_rpc_request_new(LinphoneXmlRpcArgType retur
return request;
}
LinphoneXmlRpcRequest * linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgType return_type, const char *method, ...) {
bool_t cont = TRUE;
va_list args;
LinphoneXmlRpcArgType arg_type;
LinphoneXmlRpcRequest *request = _linphone_xml_rpc_request_new(return_type, method);
va_start(args, method);
while (cont) {
arg_type = va_arg(args, LinphoneXmlRpcArgType);
switch (arg_type) {
case LinphoneXmlRpcArgNone:
cont = FALSE;
break;
case LinphoneXmlRpcArgInt:
_linphone_xml_rpc_request_add_int_arg(request, va_arg(args, int));
break;
case LinphoneXmlRpcArgString:
_linphone_xml_rpc_request_add_string_arg(request, va_arg(args, char *));
break;
}
}
va_end(args);
format_request(request);
return request;
}
LinphoneXmlRpcRequest * linphone_xml_rpc_request_ref(LinphoneXmlRpcRequest *request) {
belle_sip_object_ref(request);
return request;

View file

@ -23,9 +23,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "config.h"
#endif
typedef struct belle_sip_certificates_chain_t _SalCertificatesChain;
typedef struct belle_sip_signing_key_t _SalSigningKey;
/*
rfc3323
4.2 Expressing Privacy Preferences
@ -63,7 +60,7 @@ void sal_op_set_privacy_from_message(SalOp* op,belle_sip_message_t* msg) {
static void set_tls_properties(Sal *ctx);
void _belle_sip_log(const char *domain, belle_sip_log_level lev, const char *fmt, va_list args) {
int ortp_level;
OrtpLogLevel ortp_level;
switch(lev) {
case BELLE_SIP_LOG_FATAL:
ortp_level=ORTP_FATAL;
@ -192,7 +189,7 @@ void sal_process_authentication(SalOp *op) {
static void process_dialog_terminated(void *sal, const belle_sip_dialog_terminated_event_t *event){
belle_sip_dialog_t* dialog = belle_sip_dialog_terminated_event_get_dialog(event);
SalOp* op = belle_sip_dialog_get_application_data(dialog);
SalOp* op = reinterpret_cast<SalOp *>(belle_sip_dialog_get_application_data(dialog));
if (op && op->callbacks && op->callbacks->process_dialog_terminated) {
op->callbacks->process_dialog_terminated(op,event);
} else {
@ -491,7 +488,7 @@ static void process_transaction_terminated(void *user_ctx, const belle_sip_trans
static void process_auth_requested(void *sal, belle_sip_auth_event_t *event) {
SalAuthInfo* auth_info = sal_auth_info_create(event);
((Sal*)sal)->callbacks.auth_requested(sal,auth_info);
((Sal*)sal)->callbacks.auth_requested(reinterpret_cast<Sal *>(sal),auth_info);
belle_sip_auth_event_set_passwd(event,(const char*)auth_info->password);
belle_sip_auth_event_set_ha1(event,(const char*)auth_info->ha1);
belle_sip_auth_event_set_userid(event,(const char*)auth_info->userid);
@ -937,13 +934,13 @@ SalAuthInfo* sal_auth_info_create(belle_sip_auth_event_t* event) {
}
SalAuthMode sal_auth_info_get_mode(const SalAuthInfo* auth_info) { return auth_info->mode; }
SalSigningKey *sal_auth_info_get_signing_key(const SalAuthInfo* auth_info) { return auth_info->key; }
SalCertificatesChain *sal_auth_info_get_certificates_chain(const SalAuthInfo* auth_info) { return auth_info->certificates; }
belle_sip_signing_key_t *sal_auth_info_get_signing_key(const SalAuthInfo* auth_info) { return auth_info->key; }
belle_sip_certificates_chain_t *sal_auth_info_get_certificates_chain(const SalAuthInfo* auth_info) { return auth_info->certificates; }
void sal_auth_info_set_mode(SalAuthInfo* auth_info, SalAuthMode mode) { auth_info->mode = mode; }
void sal_certificates_chain_delete(SalCertificatesChain *chain) {
void sal_certificates_chain_delete(belle_sip_certificates_chain_t *chain) {
belle_sip_object_unref((belle_sip_object_t *)chain);
}
void sal_signing_key_delete(SalSigningKey *key) {
void sal_signing_key_delete(belle_sip_signing_key_t *key) {
belle_sip_object_unref((belle_sip_object_t *)key);
}
@ -1127,7 +1124,7 @@ static void make_supported_header(Sal *sal){
for(it=sal->supported_tags;it!=NULL;it=it->next){
const char *tag=(const char*)it->data;
size_t taglen=strlen(tag);
if (alltags==NULL || (written+taglen+1>=buflen)) alltags=ms_realloc(alltags,(buflen=buflen*2));
if (alltags==NULL || (written+taglen+1>=buflen)) alltags=reinterpret_cast<char *>(ms_realloc(alltags,(buflen=buflen*2)));
written+=snprintf(alltags+written,buflen-written,it->next ? "%s, " : "%s",tag);
}
if (alltags){
@ -1229,7 +1226,7 @@ void sal_enable_unconditional_answer(Sal *sal,int value) {
* @param format either PEM or DER
*/
void sal_certificates_chain_parse_file(SalAuthInfo* auth_info, const char* path, SalCertificateRawFormat format) {
auth_info->certificates = (SalCertificatesChain*) belle_sip_certificates_chain_parse_file(path, (belle_sip_certificate_raw_format_t)format);
auth_info->certificates = (belle_sip_certificates_chain_t*) belle_sip_certificates_chain_parse_file(path, (belle_sip_certificate_raw_format_t)format);
if (auth_info->certificates) belle_sip_object_ref((belle_sip_object_t *) auth_info->certificates);
}
@ -1239,7 +1236,7 @@ void sal_certificates_chain_parse_file(SalAuthInfo* auth_info, const char* path,
* @param passwd password (optionnal)
*/
void sal_signing_key_parse_file(SalAuthInfo* auth_info, const char* path, const char *passwd) {
auth_info->key = (SalSigningKey *) belle_sip_signing_key_parse_file(path, passwd);
auth_info->key = (belle_sip_signing_key_t *) belle_sip_signing_key_parse_file(path, passwd);
if (auth_info->key) belle_sip_object_ref((belle_sip_object_t *) auth_info->key);
}
@ -1250,7 +1247,7 @@ void sal_signing_key_parse_file(SalAuthInfo* auth_info, const char* path, const
*/
void sal_certificates_chain_parse(SalAuthInfo* auth_info, const char* buffer, SalCertificateRawFormat format) {
size_t len = buffer != NULL ? strlen(buffer) : 0;
auth_info->certificates = (SalCertificatesChain*) belle_sip_certificates_chain_parse(buffer, len, (belle_sip_certificate_raw_format_t)format);
auth_info->certificates = (belle_sip_certificates_chain_t*) belle_sip_certificates_chain_parse(buffer, len, (belle_sip_certificate_raw_format_t)format);
if (auth_info->certificates) belle_sip_object_ref((belle_sip_object_t *) auth_info->certificates);
}
@ -1261,7 +1258,7 @@ void sal_certificates_chain_parse(SalAuthInfo* auth_info, const char* buffer, Sa
*/
void sal_signing_key_parse(SalAuthInfo* auth_info, const char* buffer, const char *passwd) {
size_t len = buffer != NULL ? strlen(buffer) : 0;
auth_info->key = (SalSigningKey *) belle_sip_signing_key_parse(buffer, len, passwd);
auth_info->key = (belle_sip_signing_key_t *) belle_sip_signing_key_parse(buffer, len, passwd);
if (auth_info->key) belle_sip_object_ref((belle_sip_object_t *) auth_info->key);
}
@ -1309,7 +1306,7 @@ unsigned char * sal_get_random_bytes(unsigned char *ret, size_t size){
}
char *sal_get_random_token(int size){
return belle_sip_random_token(ms_malloc(size),size);
return belle_sip_random_token(reinterpret_cast<char *>(ms_malloc(size)),size);
}
unsigned int sal_get_random(void){

View file

@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "sal_impl.h"
#include "offeranswer.h"
#include "OfferAnswer.h"
#include <bctoolbox/defs.h>
@ -109,7 +109,7 @@ static int set_sdp(belle_sip_message_t *msg,belle_sdp_session_description_t* ses
if (session_desc) {
size_t bufLen = 2048;
size_t hardlimit = 16*1024; /* 16k SDP limit seems reasonable */
char* buff = belle_sip_malloc(bufLen);
char* buff = reinterpret_cast<char *>(belle_sip_malloc(bufLen));
content_type = belle_sip_header_content_type_create("application","sdp");
/* try to marshal the description. This could go higher than 2k so we iterate */
@ -118,7 +118,7 @@ static int set_sdp(belle_sip_message_t *msg,belle_sdp_session_description_t* ses
if( error != BELLE_SIP_OK ){
bufLen *= 2;
length = 0;
buff = belle_sip_realloc(buff,bufLen);
buff = reinterpret_cast<char *>(belle_sip_realloc(buff,bufLen));
}
}
/* give up if hard limit reached */
@ -277,7 +277,7 @@ static void call_process_response(void *op_base, const belle_sip_response_event_
}
}
} else if (code >= 180 && code<200) {
belle_sip_response_t *prev_response=belle_sip_object_data_get(BELLE_SIP_OBJECT(dialog),"early_response");
belle_sip_response_t *prev_response=reinterpret_cast<belle_sip_response_t *>(belle_sip_object_data_get(BELLE_SIP_OBJECT(dialog),"early_response"));
if (!prev_response || code>belle_sip_response_get_status_code(prev_response)){
handle_sdp_from_response(op,response);
op->base.root->callbacks.call_ringing(op);
@ -496,8 +496,9 @@ static int is_media_description_acceptable(SalMediaDescription *md){
static SalReason process_sdp_for_invite(SalOp* op,belle_sip_request_t* invite) {
belle_sdp_session_description_t* sdp;
SalReason reason = SalReasonNone;
SalErrorInfo sei = {0};
SalErrorInfo sei;
memset(&sei, 0, sizeof(sei));
if (extract_sdp(op,BELLE_SIP_MESSAGE(invite),&sdp,&reason)==0) {
if (sdp){
op->sdp_offering=FALSE;
@ -1097,11 +1098,12 @@ int sal_call_send_dtmf(SalOp *h, char dtmf){
int sal_call_terminate_with_error(SalOp *op, const SalErrorInfo *info){
SalErrorInfo sei = { 0 };
SalErrorInfo sei;
const SalErrorInfo *p_sei;
belle_sip_dialog_state_t dialog_state = op->dialog ? belle_sip_dialog_get_state(op->dialog) : BELLE_SIP_DIALOG_NULL;
int ret = 0;
memset(&sei, 0, sizeof(sei));
if (info == NULL && dialog_state != BELLE_SIP_DIALOG_CONFIRMED && op->dir == SalOpDirIncoming){
/*the purpose of this line is to set a default SalErrorInfo for declining an incoming call (not yet established of course) */
sal_error_info_set(&sei,SalReasonDeclined, "SIP", 0, NULL, NULL);

View file

@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "sal_impl.h"
#include "offeranswer.h"
#include "OfferAnswer.h"

View file

@ -558,7 +558,7 @@ SalReason _sal_reason_from_sip_code(int code) {
const SalErrorInfo *sal_error_info_none(void){
static SalErrorInfo none={
SalReasonNone,
"Ok",
(char *)"Ok",
200,
NULL,
NULL,

View file

@ -132,7 +132,7 @@ static void presence_response_event(void *op_base, const belle_sip_response_even
return;
}
}
set_or_update_dialog(op_base,belle_sip_response_event_get_dialog(event));
set_or_update_dialog(reinterpret_cast<SalOp *>(op_base),belle_sip_response_event_get_dialog(event));
if (!op->dialog) {
ms_message("presence op [%p] receive out of dialog answer [%i]",op,code);
return;

View file

@ -20,6 +20,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "sal_impl.h"
#define keywordcmp(key,b) strncmp(key,b,sizeof(key))
inline OrtpRtcpXrStatSummaryFlag operator|=(OrtpRtcpXrStatSummaryFlag a, OrtpRtcpXrStatSummaryFlag b) {
int ia = static_cast<int>(a);
int ib = static_cast<int>(b);
return static_cast<OrtpRtcpXrStatSummaryFlag>(ia |= ib);
}
static void add_ice_candidates(belle_sdp_media_description_t *md, const SalStreamDescription *desc){
char buffer[1024];
@ -194,7 +199,7 @@ static void stream_description_to_sdp ( belle_sdp_session_description_t *session
bctbx_list_t* pt_it;
PayloadType* pt;
char buffer[1024];
char* dir=NULL;
const char* dir=NULL;
const char *rtp_addr;
const char *rtcp_addr;
int rtp_port;
@ -506,7 +511,7 @@ static void sdp_parse_media_crypto_parameters(belle_sdp_media_description_t *med
cs=ms_crypto_suite_build_from_name_params(&np);
if (cs==MS_CRYPTO_SUITE_INVALID){
ms_warning ( "Failed to parse crypto-algo: '%s'", tmp );
stream->crypto[valid_count].algo = 0;
stream->crypto[valid_count].algo = MS_CRYPTO_SUITE_INVALID;
}else{
char *sep;
strncpy ( stream->crypto[valid_count].master_key, tmp2, sizeof(stream->crypto[valid_count].master_key)-1 );
@ -684,7 +689,7 @@ static void sal_init_rtcp_xr_description(OrtpRtcpXrConfiguration *config) {
config->enabled = FALSE;
config->rcvr_rtt_mode = OrtpRtcpXrRcvrRttNone;
config->rcvr_rtt_max_size = -1;
config->stat_summary_flags = 0;
config->stat_summary_flags = OrtpRtcpXrStatSummaryNone;
config->voip_metrics_enabled = FALSE;
}

View file

@ -33,10 +33,10 @@
#include "linphone/conference.h"
#include "sal/sal.h"
#include "linphone/sipsetup.h"
#include "quality_reporting.h"
#include "QualityReporting.h"
#include "linphone/ringtoneplayer.h"
#include "vcard_private.h"
#include "carddav.h"
#include "Vcard.h"
#include "CardDav.h"
#include "linphone/player.h"
#include "bctoolbox/port.h"
@ -418,7 +418,7 @@ void linphone_call_notify_encryption_changed(LinphoneCall *call, bool_t on, cons
void linphone_call_notify_transfer_state_changed(LinphoneCall *call, LinphoneCallState cstate);
void linphone_call_notify_stats_updated(LinphoneCall *call, const LinphoneCallStats *stats);
void linphone_call_notify_info_message_received(LinphoneCall *call, const LinphoneInfoMessage *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);
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, const LinphoneCallParams *params, LinphoneProxyConfig *cfg);
LinphoneCall * linphone_call_new_incoming(struct _LinphoneCore *lc, LinphoneAddress *from, LinphoneAddress *to, SalOp *op);
@ -596,7 +596,7 @@ void linphone_proxy_config_write_to_config_file(LinphoneConfig* config,LinphoneP
LinphoneReason linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessage *msg);
void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *cr, uint32_t character, LinphoneCall *call);
void linphone_call_init_stats(LinphoneCallStats *stats, int type);
void linphone_call_init_stats(LinphoneCallStats *stats, LinphoneStreamType type);
void linphone_call_fix_call_parameters(LinphoneCall *call, SalMediaDescription *rmd);
void linphone_call_init_audio_stream(LinphoneCall *call);
void linphone_call_init_video_stream(LinphoneCall *call);

View file

@ -92,7 +92,7 @@ typedef struct _BuddyLookupFuncs{
struct _SipSetup{
char *name;
const char *name;
unsigned int capabilities;
int initialized;
bool_t (*init)(void);

View file

@ -42,14 +42,6 @@ extern "C" {
**/
LINPHONE_PUBLIC LinphoneXmlRpcRequest * linphone_xml_rpc_request_new(LinphoneXmlRpcArgType return_type, const char *method);
/**
* Create a new LinphoneXmlRpcRequest object giving the arguments to the method call.
* @param[in] return_type The expected XML-RPC response type.
* @param[in] method The XML-RPC method to call.
* @return A new LinphoneXmlRpcRequest object.
**/
LINPHONE_PUBLIC LinphoneXmlRpcRequest * linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgType return_type, const char *method, ...);
/**
* Acquire a reference to the XML-RPC request.
* @param[in] request LinphoneXmlRpcRequest object.

View file

@ -461,11 +461,6 @@ typedef enum SalAuthMode { /*this enum must be same as belle_sip_auth_mode_t*/
SalAuthModeTls /** Client certificate requested*/
}SalAuthMode;
struct _SalCertificatesChain;
typedef struct _SalCertificatesChain SalCertificatesChain;
struct _SalSigningKey;
typedef struct _SalSigningKey SalSigningKey;
/**
* Format of certificate buffer
* */
@ -484,8 +479,8 @@ typedef struct SalAuthInfo{
char *domain;
char *ha1;
SalAuthMode mode;
SalSigningKey *key;
SalCertificatesChain *certificates;
belle_sip_signing_key_t *key;
belle_sip_certificates_chain_t *certificates;
}SalAuthInfo;
typedef void (*SalOnCallReceived)(SalOp *op);
@ -572,8 +567,8 @@ SalAuthInfo* sal_auth_info_clone(const SalAuthInfo* auth_info);
void sal_auth_info_delete(SalAuthInfo* auth_info);
LINPHONE_PUBLIC int sal_auth_compute_ha1(const char* userid,const char* realm,const char* password, char ha1[33]);
SalAuthMode sal_auth_info_get_mode(const SalAuthInfo* auth_info);
SalSigningKey *sal_auth_info_get_signing_key(const SalAuthInfo* auth_info);
SalCertificatesChain *sal_auth_info_get_certificates_chain(const SalAuthInfo* auth_info);
belle_sip_signing_key_t *sal_auth_info_get_signing_key(const SalAuthInfo* auth_info);
belle_sip_certificates_chain_t *sal_auth_info_get_certificates_chain(const SalAuthInfo* auth_info);
void sal_auth_info_set_mode(SalAuthInfo* auth_info, SalAuthMode mode);
/** Parse a file containing either a certificate chain order in PEM format or a single DER cert
@ -616,8 +611,8 @@ void sal_signing_key_parse(SalAuthInfo* auth_info, const char* buffer, const cha
*/
void sal_certificates_chain_parse_directory(char **certificate_pem, char **key_pem, char **fingerprint, const char* path, const char *subject, SalCertificateRawFormat format, bool_t generate_certificate, bool_t generate_dtls_fingerprint);
void sal_certificates_chain_delete(SalCertificatesChain *chain);
void sal_signing_key_delete(SalSigningKey *key);
void sal_certificates_chain_delete(belle_sip_certificates_chain_t *chain);
void sal_signing_key_delete(belle_sip_signing_key_t *key);
@ -841,8 +836,8 @@ typedef enum _SalPrivacy {
typedef unsigned int SalPrivacyMask;
const char* sal_privacy_to_string(SalPrivacy privacy);
void sal_op_set_privacy(SalOp* op,SalPrivacy privacy);
SalPrivacy sal_op_get_privacy(const SalOp* op);
void sal_op_set_privacy(SalOp* op,SalPrivacyMask privacy);
SalPrivacyMask sal_op_get_privacy(const SalOp* op);

View file

@ -359,12 +359,10 @@ LinphoneAccountCreatorStatus get_activation_code_account_cb(LinphoneAccountCreat
return LinphoneAccountCreatorStatusMissingArguments;
}
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "get_confirmation_key",
LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number,
LinphoneXmlRpcArgString, creator->password,
LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "get_confirmation_key");
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);
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_activation_code_cb);
linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request);
@ -397,12 +395,10 @@ LinphoneAccountCreatorStatus delete_account_cb(LinphoneAccountCreator *creator)
return LinphoneAccountCreatorStatusMissingArguments;
}
request = linphone_xml_rpc_request_new_with_args(LinphoneXmlRpcArgString, "delete_account",
LinphoneXmlRpcArgString, creator->username ? creator->username : creator->phone_number,
LinphoneXmlRpcArgString, creator->password,
LinphoneXmlRpcArgString, linphone_proxy_config_get_domain(creator->proxy_cfg),
LinphoneXmlRpcArgNone);
request = linphone_xml_rpc_request_new(LinphoneXmlRpcArgString, "delete_account");
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);
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), _delete_account_cb);
linphone_xml_rpc_session_send_request(creator->xmlrpc_session, request);

View file

@ -21,7 +21,7 @@
#include "linphone/core.h"
#include "private.h"
#include "liblinphone_tester.h"
#include "lime.h"
#include "Lime.h"
#include "bctoolbox/crypto.h"
#ifdef SQLITE_STORAGE_ENABLED

View file

@ -23,7 +23,7 @@
#include "liblinphone_tester.h"
#include "carddav.h"
#include "CardDav.h"
#include <time.h>
#define CARDDAV_SERVER "http://dav.linphone.org/card.php/addressbooks/tester/default"

View file

@ -88,7 +88,6 @@ blacklisted_functions = [
'linphone_proxy_config_set_privacy', # missing LinphonePrivacyMask
'linphone_tunnel_get_http_proxy', # to be handwritten because of double pointer indirection
'linphone_vcard_get_belcard', # specific to C++
'linphone_xml_rpc_request_new_with_args', # to be handwritten because of va_list
]
hand_written_functions = [
HandWrittenClassMethod('Buffer', 'new_from_data', 'linphone_buffer_new_from_data', "Create a new LinphoneBuffer object from existing data.\n\n:param data: The initial data to store in the LinphoneBuffer.\n:type data: ByteArray\n:returns: A new LinphoneBuffer object.\n:rtype: linphone.Buffer"),