/* * Copyright (c) 2010-2019 Belledonne Communications SARL. * * This file is part of Liblinphone. * * 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 3 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, see . */ #ifndef LINPHONECORE_H #define LINPHONECORE_H #include "ortp/ortp.h" #include "ortp/payloadtype.h" #include "mediastreamer2/mscommon.h" #include "mediastreamer2/msvideo.h" #include "mediastreamer2/mediastream.h" #include "mediastreamer2/bitratecontrol.h" #include "linphone/defs.h" #include "linphone/types.h" #include "linphone/callbacks.h" #include "linphone/sipsetup.h" #include "linphone/account_creator.h" #include "linphone/account_creator_service.h" #include "linphone/buffer.h" #include "linphone/call.h" #include "linphone/call_log.h" #include "linphone/call_params.h" #include "linphone/call_stats.h" #include "linphone/chat.h" #include "linphone/conference.h" #include "linphone/dictionary.h" #include "linphone/error_info.h" #include "linphone/event.h" #include "linphone/factory.h" #include "linphone/friend.h" #include "linphone/friendlist.h" #include "linphone/im_encryption_engine.h" #include "linphone/im_notif_policy.h" #include "linphone/info_message.h" #include "linphone/logging.h" #include "linphone/lpconfig.h" #include "linphone/misc.h" #include "linphone/nat_policy.h" #include "linphone/payload_type.h" #include "linphone/player.h" #include "linphone/presence.h" #include "linphone/proxy_config.h" #include "linphone/ringtoneplayer.h" #include "linphone/vcard.h" #include "linphone/video_definition.h" #include "linphone/xmlrpc.h" #include "linphone/headers.h" // For migration purpose. #include "linphone/api/c-api.h" #ifdef __cplusplus extern "C" { #endif /** * Safely down-cast a belle_sip_object_t into #LinphoneCore * @ingroup initializing */ #define LINPHONE_CORE(object) BELLE_SIP_CAST(object, LinphoneCore) /** * Create a #LinphoneAddress object by parsing the user supplied address, given as a string. * @param core #LinphoneCore object @maybenil * @param address String containing the user supplied address @maybenil * @return The create #LinphoneAddress object @maybenil * @ingroup linphone_address */ LINPHONE_PUBLIC LinphoneAddress * linphone_core_create_address(LinphoneCore *core, const char *address); /** * @addtogroup misc * @{ */ /** * Create an independent media file player. * This player support WAVE and MATROSKA formats. * @param core A #LinphoneCore object @notnil * @param sound_card_name Playback sound card. If NULL, the ringer sound card set in #LinphoneCore will be used @maybenil * @param video_display_name Video display. If NULL, the video display set in #LinphoneCore will be used @maybenil * @param window_id Id of the drawing window. Depend of video out @maybenil * @return A pointer on the new instance. NULL if failed. @maybenil */ LINPHONE_PUBLIC LinphonePlayer *linphone_core_create_local_player(LinphoneCore *core, const char *sound_card_name, const char *video_display_name, void *window_id); /** * Creates an empty info message. * @param core the #LinphoneCore @maybenil * @return a new LinphoneInfoMessage. @notnil * * The info message can later be filled with information using linphone_info_message_add_header() or linphone_info_message_set_content(), * and finally sent with linphone_core_send_info_message(). **/ LINPHONE_PUBLIC LinphoneInfoMessage *linphone_core_create_info_message(LinphoneCore *core); /** * Create a #LinphoneMagicSearch object. * @param core #LinphoneCore object @notnil * @return The created #LinphoneMagicSearch object @notnil */ LINPHONE_PUBLIC LinphoneMagicSearch *linphone_core_create_magic_search(LinphoneCore *core); /** * Checks if a new version of the application is available. * @param core #LinphoneCore object @notnil * @param current_version The current version of the application @notnil */ LINPHONE_PUBLIC void linphone_core_check_for_update(LinphoneCore *core, const char *current_version); /** * Return the global unread chat message count. * @param core #LinphoneCore object. @notnil * @return The global unread chat message count. */ LINPHONE_PUBLIC int linphone_core_get_unread_chat_message_count (const LinphoneCore *core); /** * Return the unread chat message count for a given local address. * @param core #LinphoneCore object. @notnil * @param address #LinphoneAddress object. @notnil * @return The unread chat message count. */ LINPHONE_PUBLIC int linphone_core_get_unread_chat_message_count_from_local ( const LinphoneCore *core, const LinphoneAddress *address ); /** * Return the unread chat message count for all active local address. (Primary contact + proxy configs.) * @param core #LinphoneCore object. @notnil * @return The unread chat message count. */ LINPHONE_PUBLIC int linphone_core_get_unread_chat_message_count_from_active_locals (const LinphoneCore *core); /** * @} */ /** * Get the remote address of the current call. * @param core #LinphoneCore object. @notnil * @return The remote address of the current call or NULL if there is no current call. @maybenil * @ingroup call_control */ LINPHONE_PUBLIC const LinphoneAddress * linphone_core_get_current_call_remote_address(LinphoneCore *core); /** * @addtogroup initializing * @{ **/ /** * Callback prototype */ typedef void (*LinphoneCoreCbFunc)(LinphoneCore *core,void * user_data); /** * This structure holds all callbacks that the application should implement. * None is mandatory. * @donotwrap **/ typedef struct _LinphoneCoreVTable{ LinphoneCoreGlobalStateChangedCb global_state_changed; /**