Commit 2f1d16a3 authored by Ghislain MARY's avatar Ghislain MARY

Use c-wrapper for the Core object.

parent 2b8e1cca
......@@ -38,6 +38,7 @@ list(APPEND LINPHONE_PRIVATE_HEADER_FILES
carddav.h
conference_private.h
contact_providers_priv.h
core_private.h
enum.h
lime.h
lpc2xml.h
......
......@@ -30,6 +30,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <bctoolbox/crypto.h>
// TODO: From coreapi. Remove me later.
#include "private.h"
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneAccountCreatorCbs);
BELLE_SIP_INSTANCIATE_VPTR(LinphoneAccountCreatorCbs, belle_sip_object_t,
......
......@@ -22,6 +22,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneAccountCreatorService);
BELLE_SIP_INSTANCIATE_VPTR(LinphoneAccountCreatorService, belle_sip_object_t,
......
......@@ -28,6 +28,9 @@
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
static void _linphone_auth_info_uninit(LinphoneAuthInfo *obj);
static void _linphone_auth_info_copy(LinphoneAuthInfo *dst, const LinphoneAuthInfo *src);
......
......@@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
static void linphone_buffer_destroy(LinphoneBuffer *buffer) {
if (buffer->content) belle_sip_free(buffer->content);
}
......
......@@ -35,6 +35,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
typedef struct _CallLogStorageResult {
LinphoneCore *core;
bctbx_list_t *result;
......
......@@ -54,22 +54,6 @@ using namespace LinphonePrivate;
static void register_failure(SalOp *op);
static bool_t already_a_call_with_remote_address(const LinphoneCore *lc, const LinphoneAddress *remote) {
bctbx_list_t *elem;
ms_message("Searching for already_a_call_with_remote_address.");
for(elem=lc->calls;elem!=NULL;elem=elem->next){
const LinphoneCall *call=(LinphoneCall*)elem->data;
const LinphoneAddress *cRemote=linphone_call_get_remote_address(call);
if (linphone_address_weak_equal(cRemote,remote)) {
ms_warning("already_a_call_with_remote_address found.");
return TRUE;
}
}
return FALSE;
}
static LinphoneCall * look_for_broken_call_to_replace(LinphonePrivate::SalOp *h, LinphoneCore *lc) {
const bctbx_list_t *calls = linphone_core_get_calls(lc);
const bctbx_list_t *it = calls;
......@@ -128,7 +112,7 @@ static void call_received(SalCallOp *h) {
} else if (sal_address_has_param(h->get_remote_contact_address(), "text")) {
linphone_address_unref(toAddr);
linphone_address_unref(fromAddr);
shared_ptr<ChatRoom> chatRoom = lc->cppCore->findChatRoom(
shared_ptr<ChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
ChatRoomId(IdentityAddress(h->get_to()), IdentityAddress(h->get_to()))
);
if (chatRoom) {
......@@ -169,7 +153,7 @@ static void call_received(SalCallOp *h) {
}
}
if (!linphone_core_can_we_add_call(lc)) { /* Busy */
if (!L_GET_PRIVATE_FROM_C_OBJECT(lc)->canWeAddCall()) { /* Busy */
h->decline(SalReasonBusy, nullptr);
LinphoneErrorInfo *ei = linphone_error_info_new();
linphone_error_info_set(ei, nullptr, LinphoneReasonBusy, 486, "Busy - too many calls", nullptr);
......@@ -186,7 +170,7 @@ static void call_received(SalCallOp *h) {
fromAddressToSearchIfMe = linphone_address_new(pAssertedId);
else
ms_warning("Hidden from identity, don't know if it's me");
if (fromAddressToSearchIfMe && already_a_call_with_remote_address(lc, fromAddressToSearchIfMe)) {
if (fromAddressToSearchIfMe && L_GET_PRIVATE_FROM_C_OBJECT(lc)->isAlreadyInCallWithAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(fromAddressToSearchIfMe))) {
char *addr = linphone_address_as_string(fromAddr);
ms_warning("Receiving a call while one with same address [%s] is initiated, refusing this one with busy message", addr);
h->decline(SalReasonBusy, nullptr);
......@@ -767,7 +751,7 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
if (addr.hasUriParam("method") && (addr.getUriParamValue("method") == "BYE")) {
if (linphone_core_conference_server_enabled(lc)) {
// Removal of a participant at the server side
shared_ptr<ChatRoom> chatRoom = lc->cppCore->findChatRoom(
shared_ptr<ChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
ChatRoomId(IdentityAddress(op->get_to()), IdentityAddress(op->get_to()))
);
if (chatRoom) {
......@@ -785,7 +769,7 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
} else {
// The server asks a participant to leave a chat room
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(
lc->cppCore->findChatRoom(ChatRoomId(addr, IdentityAddress(op->get_to())))
L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(ChatRoomId(addr, IdentityAddress(op->get_to())))
);
if (cr) {
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->leave();
......@@ -795,7 +779,7 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
static_cast<SalReferOp *>(op)->reply(SalReasonDeclined);
}
} else if (addr.hasParam("admin")) {
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(lc->cppCore->findChatRoom(
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
ChatRoomId(IdentityAddress(op->get_to()), IdentityAddress(op->get_to()))
));
if (cr) {
......@@ -814,7 +798,7 @@ static void refer_received(SalOp *op, const SalAddress *refer_to){
return;
}
} else {
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(lc->cppCore->findChatRoom(ChatRoomId(addr, IdentityAddress(op->get_to()))));
LinphoneChatRoom *cr = L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(ChatRoomId(addr, IdentityAddress(op->get_to()))));
if (!cr)
cr = _linphone_client_group_chat_room_new(lc, addr.asString().c_str(), nullptr);
L_GET_CPP_PTR_FROM_C_OBJECT(cr)->join();
......
......@@ -60,12 +60,12 @@ bool_t linphone_core_chat_enabled(const LinphoneCore *lc) {
const bctbx_list_t *linphone_core_get_chat_rooms (LinphoneCore *lc) {
if (lc->chat_rooms)
bctbx_list_free_with_data(lc->chat_rooms, (bctbx_list_free_func)linphone_chat_room_unref);
lc->chat_rooms = L_GET_RESOLVED_C_LIST_FROM_CPP_LIST(lc->cppCore->getChatRooms());
lc->chat_rooms = L_GET_RESOLVED_C_LIST_FROM_CPP_LIST(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getChatRooms());
return lc->chat_rooms;
}
static LinphoneChatRoom *linphone_chat_room_new (LinphoneCore *core, const LinphoneAddress *addr) {
return L_GET_C_BACK_PTR(core->cppCore->getOrCreateBasicChatRoom(
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(core)->getOrCreateBasicChatRoom(
*L_GET_CPP_PTR_FROM_C_OBJECT(addr),
linphone_core_realtime_text_enabled(core)
));
......@@ -79,11 +79,11 @@ LinphoneChatRoom *_linphone_core_create_chat_room_from_call(LinphoneCall *call){
}
LinphoneChatRoom *linphone_core_get_chat_room (LinphoneCore *lc, const LinphoneAddress *addr) {
return L_GET_C_BACK_PTR(lc->cppCore->getOrCreateBasicChatRoom(*L_GET_CPP_PTR_FROM_C_OBJECT(addr)));
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getOrCreateBasicChatRoom(*L_GET_CPP_PTR_FROM_C_OBJECT(addr)));
}
LinphoneChatRoom *linphone_core_create_client_group_chat_room (LinphoneCore *lc, const char *subject) {
return L_GET_C_BACK_PTR(lc->cppCore->createClientGroupChatRoom(L_C_TO_STRING(subject)));
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->createClientGroupChatRoom(L_C_TO_STRING(subject)));
}
LinphoneChatRoom *_linphone_core_join_client_group_chat_room (LinphoneCore *lc, const LinphonePrivate::Address &addr) {
......@@ -101,7 +101,7 @@ void linphone_core_delete_chat_room (LinphoneCore *, LinphoneChatRoom *cr) {
}
LinphoneChatRoom *linphone_core_get_chat_room_from_uri(LinphoneCore *lc, const char *to) {
return L_GET_C_BACK_PTR(lc->cppCore->getOrCreateBasicChatRoomFromUri(L_C_TO_STRING(to)));
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->getOrCreateBasicChatRoomFromUri(L_C_TO_STRING(to)));
}
LinphoneChatRoom *linphone_core_find_chat_room(
......@@ -109,7 +109,7 @@ LinphoneChatRoom *linphone_core_find_chat_room(
const LinphoneAddress *peer_addr,
const LinphoneAddress *local_addr
) {
return L_GET_C_BACK_PTR(lc->cppCore->findChatRoom(LinphonePrivate::ChatRoomId(
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(LinphonePrivate::ChatRoomId(
LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(peer_addr)),
LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(local_addr))
)));
......@@ -120,7 +120,7 @@ LinphoneChatRoom *linphone_core_find_one_to_one_chat_room (
const LinphoneAddress *local_addr,
const LinphoneAddress *participant_addr
) {
return L_GET_C_BACK_PTR(lc->cppCore->findOneToOneChatRoom(
return L_GET_C_BACK_PTR(L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findOneToOneChatRoom(
LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(local_addr)),
LinphonePrivate::IdentityAddress(*L_GET_CPP_PTR_FROM_C_OBJECT(participant_addr))
));
......@@ -137,7 +137,7 @@ int linphone_core_message_received(LinphoneCore *lc, LinphonePrivate::SalOp *op,
localAddress = op->get_to();
}
shared_ptr<LinphonePrivate::ChatRoom> chatRoom = lc->cppCore->findChatRoom(
shared_ptr<LinphonePrivate::ChatRoom> chatRoom = L_GET_CPP_PTR_FROM_C_OBJECT(lc)->findChatRoom(
LinphonePrivate::ChatRoomId(LinphonePrivate::IdentityAddress(peerAddress), LinphonePrivate::IdentityAddress(localAddress))
);
......
......@@ -36,6 +36,9 @@
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
using namespace std;
namespace Linphone {
......@@ -535,6 +538,7 @@ int LocalConference::remoteParticipantsCount() {
int LocalConference::convertConferenceToCall(){
int err=0;
#if 0
bctbx_list_t *calls=m_core->calls;
if (remoteParticipantsCount()!=1){
......@@ -551,6 +555,7 @@ int LocalConference::convertConferenceToCall(){
break;
}
}
#endif
return err;
}
......@@ -583,6 +588,7 @@ int LocalConference::removeParticipant(const LinphoneAddress *uri) {
}
int LocalConference::terminate() {
#if 0
bctbx_list_t *calls=m_core->calls;
m_terminating =TRUE;
......@@ -596,11 +602,12 @@ int LocalConference::terminate() {
Conference::terminate();
m_terminating = FALSE;
#endif
return 0;
}
int LocalConference::enter() {
#if 0
if (linphone_core_sound_resources_locked(m_core)) {
return -1;
}
......@@ -608,6 +615,7 @@ int LocalConference::enter() {
_linphone_call_pause(m_core->current_call);
}
if (m_localParticipantStream==NULL) addLocalEndpoint();
#endif
return 0;
}
......
......@@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
static void linphone_content_set_sal_body_handler(LinphoneContent *content, SalBodyHandler *body_handler) {
if (content->body_handler != NULL) {
sal_body_handler_unref(content->body_handler);
......
/*
* core_private.h
* Copyright (C) 2010-2017 Belledonne Communications SARL
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _CORE_PRIVATE_H_
#define _CORE_PRIVATE_H_
#include "linphone/types.h"
#include "private_structs.h"
#include "private_types.h"
struct _LinphoneCore {
belle_sip_object_t base;
std::shared_ptr<LinphonePrivate::Core> cppPtr;
std::weak_ptr<LinphonePrivate::Core> weakCppPtr;
int owner;
LINPHONE_CORE_STRUCT_FIELDS
};
#endif /* _CORE_PRIVATE_H_ */
......@@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneErrorInfo);
static void linphone_error_info_reset(LinphoneErrorInfo *ei);
......
......@@ -23,6 +23,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
using namespace LinphonePrivate;
const char * linphone_subscription_dir_to_string(LinphoneSubscriptionDir dir){
......
......@@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
#ifndef PACKAGE_SOUND_DIR
#define PACKAGE_SOUND_DIR "."
#endif
......
......@@ -42,6 +42,9 @@
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
using namespace std;
using namespace LinphonePrivate;
......
......@@ -23,6 +23,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneFriendListCbs);
BELLE_SIP_INSTANCIATE_VPTR(LinphoneFriendListCbs, belle_sip_object_t,
......
......@@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneImNotifPolicy);
BELLE_SIP_INSTANCIATE_VPTR(LinphoneImNotifPolicy, belle_sip_object_t,
......
......@@ -24,6 +24,9 @@
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
struct _LinphoneTunnelConfig {
belle_sip_object_t base;
char *host;
......
This diff is collapsed.
......@@ -60,6 +60,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
void linphone_core_update_allocated_audio_bandwidth(LinphoneCore *lc){
const bctbx_list_t *elem;
int maxbw=LinphonePrivate::PayloadTypeHandler::getMinBandwidth(linphone_core_get_download_bandwidth(lc),
......@@ -176,7 +179,7 @@ int parse_hostname_to_addr(const char *server, struct sockaddr_storage *ss, sock
/* this functions runs a simple stun test and return the number of milliseconds to complete the tests, or -1 if the test were failed.*/
int linphone_run_stun_tests(LinphoneCore *lc, int audioPort, int videoPort, int textPort,
char *audioCandidateAddr, int *audioCandidatePort, char *videoCandidateAddr, int *videoCandidatePort, char *textCandidateAddr, int *textCandidatePort) {
LinphonePrivate::StunClient *client = new LinphonePrivate::StunClient(lc->cppCore);
LinphonePrivate::StunClient *client = new LinphonePrivate::StunClient(L_GET_CPP_PTR_FROM_C_OBJECT(lc));
int ret = client->run(audioPort, videoPort, textPort);
strncpy(audioCandidateAddr, client->getAudioCandidate().address.c_str(), LINPHONE_IPADDR_SIZE);
*audioCandidatePort = client->getAudioCandidate().port;
......
......@@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
static LinphoneNatPolicy * _linphone_nat_policy_new_with_ref(LinphoneCore *lc, const char *ref) {
LinphoneNatPolicy *policy = belle_sip_object_new(LinphoneNatPolicy);
policy->lc = lc;
......
......@@ -25,6 +25,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
#include "utils/payload-type-handler.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
struct _LinphonePayloadType {
belle_sip_object_t base;
OrtpPayloadType *pt;
......
......@@ -20,6 +20,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphonePlayer);
BELLE_SIP_INSTANCIATE_VPTR(LinphonePlayer, belle_sip_object_t,
......
......@@ -23,6 +23,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
using namespace LinphonePrivate;
extern const char *__policy_enum_to_str(LinphoneSubscribePolicy pol);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* private_types.h
* Copyright (C) 2010-2017 Belledonne Communications SARL
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _PRIVATE_TYPES_H_
#define _PRIVATE_TYPES_H_
typedef struct _CallCallbackObj CallCallbackObj;
typedef struct StunCandidate StunCandidate;
typedef struct _PortConfig PortConfig;
typedef struct _LinphoneChatMessageCharacter LinphoneChatMessageCharacter;
typedef struct _LinphoneFriendPresence LinphoneFriendPresence;
typedef struct _LinphoneFriendPhoneNumberSipUri LinphoneFriendPhoneNumberSipUri;
typedef struct sip_config sip_config_t;
typedef struct rtp_config rtp_config_t;
typedef struct net_config net_config_t;
typedef struct sound_config sound_config_t;
typedef struct codecs_config codecs_config_t;
typedef struct video_config video_config_t;
typedef struct text_config text_config_t;
typedef struct ui_config ui_config_t;
typedef struct autoreplier_config autoreplier_config_t;
typedef struct _LinphoneToneDescription LinphoneToneDescription;
typedef struct _LinphoneTaskList LinphoneTaskList;
typedef struct _LCCallbackObj LCCallbackObj;
typedef struct _EcCalibrator EcCalibrator;
typedef struct _xmlparsing_context xmlparsing_context_t;
typedef struct _VTableReference VTableReference;
typedef struct _EchoTester EchoTester;
typedef struct _LinphoneXmlRpcArg LinphoneXmlRpcArg;
#endif /* _PRIVATE_TYPES_H_ */
......@@ -22,6 +22,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
static void linphone_video_definition_destroy(LinphoneVideoDefinition *vdef) {
if (vdef->name) bctbx_free(vdef->name);
}
......
......@@ -25,6 +25,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "c-wrapper/c-wrapper.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES(LinphoneXmlRpcRequestCbs);
BELLE_SIP_INSTANCIATE_VPTR(LinphoneXmlRpcRequestCbs, belle_sip_object_t,
......
......@@ -159,6 +159,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
c-wrapper/api/c-chat-message.cpp
c-wrapper/api/c-chat-room-cbs.cpp
c-wrapper/api/c-chat-room.cpp
c-wrapper/api/c-core.cpp
c-wrapper/api/c-dial-plan.cpp
c-wrapper/api/c-event-log.cpp
c-wrapper/api/c-participant.cpp
......@@ -202,6 +203,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES
content/file-content.cpp
content/file-transfer-content.cpp
core/core-accessor.cpp
core/core-call.cpp
core/core-chat-room.cpp
core/core.cpp
core/paths/paths.cpp
......
......@@ -22,6 +22,7 @@
#include "address-p.h"
#include "address/identity-address.h"
#include "c-wrapper/c-wrapper.h"
#include "c-wrapper/internal/c-sal.h"
#include "logger/logger.h"
// =============================================================================
......
......@@ -17,6 +17,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "linphone/utils/utils.h"
#include "address.h"
#include "identity-address-p.h"
#include "c-wrapper/c-wrapper.h"
#include "identity-address-p.h"
#include "logger/logger.h"
......
......@@ -18,9 +18,12 @@
*/
#include "c-wrapper/c-wrapper.h"
#include "core/core.h"
#include "conference/params/call-session-params-p.h"
#include "conference/params/media-session-params-p.h"
#include "linphone/call_params.h"
// =============================================================================
L_DECLARE_C_CLONABLE_OBJECT_IMPL(CallParams)
......@@ -502,7 +505,7 @@ LinphoneCallParams *linphone_call_params_new (LinphoneCore *core) {
LinphoneCallParams *params = _linphone_CallParams_init();
auto mediaSessionParams = new LinphonePrivate::MediaSessionParams();
L_SET_CPP_PTR_FROM_C_OBJECT(params, mediaSessionParams);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->initDefault(core->cppCore);
L_GET_CPP_PTR_FROM_C_OBJECT(params)->initDefault(L_GET_CPP_PTR_FROM_C_OBJECT(core));
delete mediaSessionParams;
return params;
}
......
......@@ -1140,11 +1140,11 @@ LinphoneCall *linphone_call_new_outgoing (LinphoneCore *lc, const LinphoneAddres
shared_ptr<LinphonePrivate::Call> call;
string confType = lp_config_get_string(linphone_core_get_config(lc), "misc", "conference_type", "local");
if (confType == "remote") {
call = make_shared<LinphonePrivate::RemoteConferenceCall>(lc->cppCore, LinphoneCallOutgoing,
call = make_shared<LinphonePrivate::RemoteConferenceCall>(L_GET_CPP_PTR_FROM_C_OBJECT(lc), LinphoneCallOutgoing,
*L_GET_CPP_PTR_FROM_C_OBJECT(from), *L_GET_CPP_PTR_FROM_C_OBJECT(to),
cfg, nullptr, L_GET_CPP_PTR_FROM_C_OBJECT(params));
} else {
call = make_shared<LinphonePrivate::LocalConferenceCall>(lc->cppCore, LinphoneCallOutgoing,
call = make_shared<LinphonePrivate::LocalConferenceCall>(L_GET_CPP_PTR_FROM_C_OBJECT(lc), LinphoneCallOutgoing,
*L_GET_CPP_PTR_FROM_C_OBJECT(from), *L_GET_CPP_PTR_FROM_C_OBJECT(to),
cfg, nullptr, L_GET_CPP_PTR_FROM_C_OBJECT(params));
}
......@@ -1161,11 +1161,11 @@ LinphoneCall *linphone_call_new_incoming (LinphoneCore *lc, const LinphoneAddres
shared_ptr<LinphonePrivate::Call> call;
string confType = lp_config_get_string(linphone_core_get_config(lc), "misc", "conference_type", "local");
if (confType == "remote") {
call = make_shared<LinphonePrivate::RemoteConferenceCall>(lc->cppCore, LinphoneCallIncoming,
call = make_shared<LinphonePrivate::RemoteConferenceCall>(L_GET_CPP_PTR_FROM_C_OBJECT(lc), LinphoneCallIncoming,
*L_GET_CPP_PTR_FROM_C_OBJECT(from), *L_GET_CPP_PTR_FROM_C_OBJECT(to),
nullptr, op, nullptr);
} else {
call = make_shared<LinphonePrivate::LocalConferenceCall>(lc->cppCore, LinphoneCallIncoming,
call = make_shared<LinphonePrivate::LocalConferenceCall>(L_GET_CPP_PTR_FROM_C_OBJECT(lc), LinphoneCallIncoming,
*L_GET_CPP_PTR_FROM_C_OBJECT(from), *L_GET_CPP_PTR_FROM_C_OBJECT(to),
nullptr, op, nullptr);
}
......
......@@ -379,7 +379,7 @@ LinphoneChatRoom *_linphone_client_group_chat_room_new (LinphoneCore *core, cons
LinphonePrivate::IdentityAddress me(from);
LinphoneChatRoom *cr = L_INIT(ChatRoom);
L_SET_CPP_PTR_FROM_C_OBJECT(cr, make_shared<LinphonePrivate::ClientGroupChatRoom>(
core->cppCore, L_C_TO_STRING(uri), me, L_C_TO_STRING(subject))
L_GET_CPP_PTR_FROM_C_OBJECT(core), L_C_TO_STRING(uri), me, L_C_TO_STRING(subject))
);
L_GET_PRIVATE_FROM_C_OBJECT(cr)->setState(LinphonePrivate::ChatRoom::State::Instantiated);
return cr;
......@@ -388,7 +388,7 @@ LinphoneChatRoom *_linphone_client_group_chat_room_new (LinphoneCore *core, cons
LinphoneChatRoom *_linphone_server_group_chat_room_new (LinphoneCore *core, LinphonePrivate::SalCallOp *op) {
LinphoneChatRoom *cr = L_INIT(ChatRoom);
L_SET_CPP_PTR_FROM_C_OBJECT(cr, make_shared<LinphonePrivate::ServerGroupChatRoom>(
core->cppCore,
L_GET_CPP_PTR_FROM_C_OBJECT(core),
op
));
L_GET_PRIVATE_FROM_C_OBJECT(cr)->setState(LinphonePrivate::ChatRoom::State::Instantiated);
......
/*
* c-core.cpp
* Copyright (C) 2010-2017 Belledonne Communications SARL
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "linphone/wrapper_utils.h"
#include "c-wrapper/c-wrapper.h"
#include "core/core.h"
#include "private_structs.h"
// =============================================================================
using namespace std;
static void _linphone_core_constructor (LinphoneCore *lc);
static void _linphone_core_destructor (LinphoneCore *lc);
L_DECLARE_C_OBJECT_IMPL_WITH_XTORS(
Core,
_linphone_core_constructor, _linphone_core_destructor,
LINPHONE_CORE_STRUCT_FIELDS
)
static void _linphone_core_constructor (LinphoneCore *lc) {
}
static void _linphone_core_destructor (LinphoneCore *lc) {
if (lc->callsCache)
bctbx_list_free(lc->callsCache);
_linphone_core_uninit(lc);
}
......@@ -19,6 +19,7 @@
#include "linphone/api/c-participant.h"
#include "address/address.h"
#include "c-wrapper/c-wrapper.h"
#include "conference/participant.h"
......
......@@ -25,7 +25,7 @@
#include "internal/c-tools.h"
// TODO: From coreapi. Remove me later.
#include "private.h"
#include "private_functions.h"
// =============================================================================
// Declare exported C types.
......@@ -36,12 +36,15 @@
F(Call, Call) \
F(ChatMessage, ChatMessage) \
F(ChatRoom, ChatRoom) \
F(Core, Core) \
F(DialPlan, DialPlan) \
F(EventLog, EventLog) \
F(MediaSessionParams, CallParams) \
F(Participant, Participant)
#define L_REGISTER_SUBTYPES(F) \
F(Call, LocalConferenceCall) \
F(Call, RemoteConferenceCall) \