core.h 226 KB
Newer Older
aymeric's avatar
aymeric committed
1 2
/*
linphone
3
Copyright (C) 2000 - 2010 Simon MORLAT (simon.morlat@linphone.org)
aymeric's avatar
aymeric committed
4 5 6 7 8 9 10 11 12 13 14 15 16

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
17
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
aymeric's avatar
aymeric committed
18
*/
19

aymeric's avatar
aymeric committed
20 21 22 23 24 25
#ifndef LINPHONECORE_H
#define LINPHONECORE_H

#include "ortp/ortp.h"
#include "ortp/payloadtype.h"
#include "mediastreamer2/mscommon.h"
smorlat's avatar
smorlat committed
26
#include "mediastreamer2/msvideo.h"
Sylvain Berfini's avatar
Sylvain Berfini committed
27
#include "mediastreamer2/mediastream.h"
28
#include "mediastreamer2/bitratecontrol.h"
Ghislain MARY's avatar
Ghislain MARY committed
29

30 31
#include "linphone/defs.h"
#include "linphone/types.h"
32
#include "linphone/callbacks.h"
33
#include "linphone/sipsetup.h"
34 35

#include "linphone/account_creator.h"
36
#include "linphone/account_creator_service.h"
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
#include "linphone/auth_info.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"
Erwan Croze's avatar
Erwan Croze committed
54
#include "linphone/logging.h"
55
#include "linphone/lpconfig.h"
56 57 58 59 60 61 62 63
#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"
64
#include "linphone/video_definition.h"
65
#include "linphone/xmlrpc.h"
66
#include "linphone/headers.h"
67

68 69
// For migration purpose.
#include "linphone/api/c-api.h"
jehan's avatar
jehan committed
70

aymeric's avatar
aymeric committed
71 72 73 74
#ifdef __cplusplus
extern "C" {
#endif

75
/**
76
 * Safely down-cast a belle_sip_object_t into #LinphoneCore
77 78 79
 * @ingroup initializing
 */
#define LINPHONE_CORE(object) BELLE_SIP_CAST(object, LinphoneCore)
80

81

jehan's avatar
jehan committed
82
/**
83 84 85 86
 * Create a #LinphoneAddress object by parsing the user supplied address, given as a string.
 * @param[in] lc #LinphoneCore object
 * @param[in] address String containing the user supplied address
 * @return The create #LinphoneAddress object
87
 * @ingroup linphone_address
88
 */
89
LINPHONE_PUBLIC LinphoneAddress * linphone_core_create_address(LinphoneCore *lc, const char *address);
90 91


92
/**
93 94
 * @addtogroup misc
 * @{
Simon Morlat's avatar
Simon Morlat committed
95
 */
96 97 98 99

/**
 * Create an independent media file player.
 * This player support WAVE and MATROSKA formats.
100 101 102
 * @param lc A #LinphoneCore object
 * @param sound_card_name Playback sound card. If NULL, the ringer sound card set in #LinphoneCore will be used
 * @param video_display_name Video display. If NULL, the video display set in #LinphoneCore will be used
103 104 105
 * @param window_id Id of the drawing window. Depend of video out
 * @return A pointer on the new instance. NULL if faild.
 */
106
LINPHONE_PUBLIC LinphonePlayer *linphone_core_create_local_player(LinphoneCore *lc, const char *sound_card_name, const char *video_display_name, void *window_id);
107

108 109
/**
 * Creates an empty info message.
110
 * @param lc the #LinphoneCore
111 112 113 114 115
 * @return a new LinphoneInfoMessage.
 *
 * 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().
**/
116
LINPHONE_PUBLIC LinphoneInfoMessage *linphone_core_create_info_message(LinphoneCore*lc);
117

118 119 120 121 122 123 124 125
/**
 * Create a #LinphoneMagicSearch object.
 * @param[in] lc #LinphoneCore object
 * @return The create #LinphoneMagicSearch object
 * @ingroup misc
 */
LINPHONE_PUBLIC LinphoneMagicSearch *linphone_core_create_magic_search(LinphoneCore *lc);

Ghislain MARY's avatar
Ghislain MARY committed
126 127
/**
 * Checks if a new version of the application is available.
128
 * @param lc #LinphoneCore object
Ghislain MARY's avatar
Ghislain MARY committed
129 130 131 132
 * @param current_version The current version of the application
 */
LINPHONE_PUBLIC void linphone_core_check_for_update(LinphoneCore *lc, const char *current_version);

133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157
/**
 * Return the global unread chat message count.
 * @param[in] lc #LinphoneCore object.
 * @return The global unread chat message count.
 */
LINPHONE_PUBLIC int linphone_core_get_unread_chat_message_count (const LinphoneCore *lc);

/**
 * Return the unread chat message count for a given local address.
 * @param[in] lc #LinphoneCore object.
 * @param[in] address #LinphoneAddress object.
 * @return The unread chat message count.
 */
LINPHONE_PUBLIC int linphone_core_get_unread_chat_message_count_from_local (
	const LinphoneCore *lc,
	const LinphoneAddress *address
);

/**
 * Return the unread chat message count for all active local address. (Primary contact + proxy configs.)
 * @param[in] lc #LinphoneCore object.
 * @return The unread chat message count.
 */
LINPHONE_PUBLIC int linphone_core_get_unread_chat_message_count_from_active_locals (const LinphoneCore *lc);

Ghislain MARY's avatar
Ghislain MARY committed
158 159 160
/**
 * @}
 */
Simon Morlat's avatar
Simon Morlat committed
161

162 163
/**
 * Get the remote address of the current call.
164
 * @param[in] lc #LinphoneCore object.
165 166 167
 * @return The remote address of the current call or NULL if there is no current call.
 * @ingroup call_control
 */
168
LINPHONE_PUBLIC const LinphoneAddress * linphone_core_get_current_call_remote_address(LinphoneCore *lc);
169

170

Simon Morlat's avatar
Simon Morlat committed
171 172 173 174 175
/**
 * @addtogroup initializing
 * @{
**/

176 177
/**
 * Callback prototype
178
 */
Simon Morlat's avatar
Simon Morlat committed
179
typedef void (*LinphoneCoreCbFunc)(LinphoneCore *lc,void * user_data);
180

smorlat's avatar
smorlat committed
181 182
/**
 * This structure holds all callbacks that the application should implement.
183
 * None is mandatory.
184
 * @donotwrap
smorlat's avatar
smorlat committed
185
**/
Simon Morlat's avatar
Simon Morlat committed
186
typedef struct _LinphoneCoreVTable{
187 188 189
	LinphoneCoreGlobalStateChangedCb global_state_changed; /**<Notifies global state changes*/
	LinphoneCoreRegistrationStateChangedCb registration_state_changed;/**<Notifies registration state changes*/
	LinphoneCoreCallStateChangedCb call_state_changed;/**<Notifies call state changes*/
190
	LinphoneCoreNotifyPresenceReceivedCb notify_presence_received; /**< Notify received presence events*/
191
	LinphoneCoreNotifyPresenceReceivedForUriOrTelCb notify_presence_received_for_uri_or_tel; /**< Notify received presence events*/
192
	LinphoneCoreNewSubscriptionRequestedCb new_subscription_requested; /**< Notify about pending presence subscription request */
193 194
	LINPHONE_DEPRECATED LinphoneCoreAuthInfoRequestedCb auth_info_requested; /** @brief Ask the application some authentication information.
	                                                                             @deprecated Use authentication_requested instead. Deprecated since 2016-09-21 */
195
	LinphoneCoreAuthenticationRequestedCb authentication_requested; /**< Ask the application some authentication information */
196
	LinphoneCoreCallLogUpdatedCb call_log_updated; /**< Notifies that call log list has been updated */
197
	LinphoneCoreMessageReceivedCb message_received; /**< a message is received, can be text or external body*/
198
	LinphoneCoreCbsMessageReceivedUnableDecryptCb message_received_unable_decrypt; /**< an encrypted message is received but we can't decrypt it*/
199
	LinphoneCoreIsComposingReceivedCb is_composing_received; /**< An is-composing notification has been received */
200 201 202 203 204 205 206 207
	LinphoneCoreDtmfReceivedCb dtmf_received; /**< A dtmf has been received received */
	LinphoneCoreReferReceivedCb refer_received; /**< An out of call refer was received */
	LinphoneCoreCallEncryptionChangedCb call_encryption_changed; /**<Notifies on change in the encryption of call streams */
	LinphoneCoreTransferStateChangedCb transfer_state_changed; /**<Notifies when a transfer is in progress */
	LinphoneCoreBuddyInfoUpdatedCb buddy_info_updated; /**< a LinphoneFriend's BuddyInfo has changed*/
	LinphoneCoreCallStatsUpdatedCb call_stats_updated; /**<Notifies on refreshing of call's statistics. */
	LinphoneCoreInfoReceivedCb info_received; /**<Notifies an incoming informational message received.*/
	LinphoneCoreSubscriptionStateChangedCb subscription_state_changed; /**<Notifies subscription state change */
208
	LinphoneCoreNotifyReceivedCb notify_received; /**< Notifies a an event notification, see linphone_core_subscribe() */
209
	LinphoneCoreSubscribeReceivedCb subscribe_received; /**< Notifies a subscribe has been received, see linphone_core_subscribe() */
210
	LinphoneCorePublishStateChangedCb publish_state_changed;/**Notifies publish state change (only from #LinphoneEvent api)*/
211
	LinphoneCoreConfiguringStatusCb configuring_status; /** Notifies configuring status changes */
212 213 214 215 216 217 218 219
	LINPHONE_DEPRECATED LinphoneCoreTextMessageReceivedCb text_received; /**< @brief A text message has been received.
	                                                                          @deprecated Use #message_received instead. Deprecated since 2015-11-19.  */
	LINPHONE_DEPRECATED LinphoneCoreFileTransferRecvCb file_transfer_recv; /**< @brief Callback to store file received attached to a #LinphoneChatMessage.
	                                                                            @deprecated Deprecated since 2015-11-19. */
	LINPHONE_DEPRECATED LinphoneCoreFileTransferSendCb file_transfer_send; /**< @brief Callback to collect file chunk to be sent for a #LinphoneChatMessage.
	                                                                            @deprecated Deprecated since 2015-11-19. */
	LINPHONE_DEPRECATED LinphoneCoreFileTransferProgressIndicationCb file_transfer_progress_indication; /**< @brief Callback to indicate file transfer progress.
	                                                                                                         @deprecated Deprecated since 2015-11-19. */
220 221 222
	LinphoneCoreNetworkReachableCb network_reachable; /**< Callback to report IP network status (I.E up/down )*/
	LinphoneCoreLogCollectionUploadStateChangedCb log_collection_upload_state_changed; /**< Callback to upload collected logs */
	LinphoneCoreLogCollectionUploadProgressIndicationCb log_collection_upload_progress_indication; /**< Callback to indicate log collection upload progress */
223 224
	LinphoneCoreFriendListCreatedCb friend_list_created;
	LinphoneCoreFriendListRemovedCb friend_list_removed;
225
	LinphoneCoreCbsCallCreatedCb call_created;
Ghislain MARY's avatar
Ghislain MARY committed
226
	LinphoneCoreCbsVersionUpdateCheckResultReceivedCb version_update_check_result_received;
227
	LinphoneCoreCbsChatRoomStateChangedCb chat_room_state_changed;
228
	LinphoneCoreCbsQrcodeFoundCb qrcode_found;
229 230 231
	LinphoneCoreCbsEcCalibrationResultCb ec_calibration_result;
	LinphoneCoreCbsEcCalibrationAudioInitCb ec_calibration_audio_init;
	LinphoneCoreCbsEcCalibrationAudioUninitCb ec_calibration_audio_uninit;
Simon Morlat's avatar
Simon Morlat committed
232
	void *user_data; /**<User data associated with the above callbacks */
aymeric's avatar
aymeric committed
233 234
} LinphoneCoreVTable;

235
/**
236 237 238
 * @brief Instantiate a vtable with all arguments set to NULL.
 * @return newly allocated vtable.
 * @donotwrap
239
 */
240
LINPHONE_PUBLIC LinphoneCoreVTable *linphone_core_v_table_new(void);
241

242
/**
243 244 245 246
 * @brief Sets a user data pointer in the vtable.
 * @param table the vtable.
 * @param data the user data to attach.
 * @donotwrap
247 248 249 250
 */
LINPHONE_PUBLIC void linphone_core_v_table_set_user_data(LinphoneCoreVTable *table, void *data);

/**
251 252 253 254
 * @brief Gets a user data pointer in the vtable.
 * @param table the vtable.
 * @return the data attached to the vtable.
 * @donotwrap
255
 */
256
LINPHONE_PUBLIC void* linphone_core_v_table_get_user_data(const LinphoneCoreVTable *table);
257 258 259 260 261

/**
 * Gets the current VTable.
 * This is meant only to be called from a callback to be able to get the user_data associated with the vtable that called the callback.
 * @param lc the linphonecore
262
 * @return the vtable that called the last callback
263
 * @donotwrap
264 265 266
 */
LINPHONE_PUBLIC LinphoneCoreVTable *linphone_core_get_current_vtable(LinphoneCore *lc);

267
/**
268 269 270
 * @brief Destroy a vtable.
 * @param table to be destroyed.
 * @donotwrap
271
 */
272
LINPHONE_PUBLIC void linphone_core_v_table_destroy(LinphoneCoreVTable* table);
273

274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291
/**
 * Increment the reference counter.
 */
LINPHONE_PUBLIC LinphoneCoreCbs *linphone_core_cbs_ref(LinphoneCoreCbs *cbs);

/**
 * Decrement the reference counter.
 */
LINPHONE_PUBLIC void linphone_core_cbs_unref(LinphoneCoreCbs *cbs);

/**
 * Set private data to be get from each callbacks.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_user_data(LinphoneCoreCbs *cbs, void *user_data);

/**
 * Get the user pointer.
 */
Ghislain MARY's avatar
Ghislain MARY committed
292
LINPHONE_PUBLIC void *linphone_core_cbs_get_user_data(const LinphoneCoreCbs *cbs);
293 294 295 296 297 298 299 300 301

/**
 * Gets the current #LinphoneCoreCbs.
 * This is meant only to be called from a callback to be able to get the user_data associated with the #LinphoneCoreCbs that is calling the callback.
 * @param lc the linphonecore
 * @return the #LinphoneCoreCbs that has called the last callback
 */
LINPHONE_PUBLIC LinphoneCoreCbs *linphone_core_get_current_callbacks(const LinphoneCore *lc);

302 303 304 305 306
/**
 * Set the #LinphoneCoreGlobalStateChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
307
LINPHONE_PUBLIC void linphone_core_cbs_set_global_state_changed(LinphoneCoreCbs *cbs, LinphoneCoreCbsGlobalStateChangedCb cb);
308

309 310 311 312 313 314 315
/**
 * Get the # callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsGlobalStateChangedCb linphone_core_cbs_get_global_state_changed(LinphoneCoreCbs *cbs);

316 317 318 319 320 321 322
/**
 * Set the #LinphoneCoreCbsRegistrationStateChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_registration_state_changed(LinphoneCoreCbs *cbs, LinphoneCoreCbsRegistrationStateChangedCb cb);

323 324 325 326 327 328 329
/**
 * Get the #LinphoneCoreCbsRegistrationStateChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsRegistrationStateChangedCb linphone_core_cbs_get_registration_state_changed(LinphoneCoreCbs *cbs);

330 331 332 333 334 335 336
/**
 * Set the #LinphoneCoreCbsCallStateChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_call_state_changed(LinphoneCoreCbs *cbs, LinphoneCoreCbsCallStateChangedCb cb);

337 338 339 340 341 342 343
/**
 * Get the #LinphoneCoreCbsCallStateChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsCallStateChangedCb linphone_core_cbs_get_call_state_changed(LinphoneCoreCbs *cbs);

344 345 346 347 348 349 350
/**
 * Set the #LinphoneCoreCbsNotifyPresenceReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_notify_presence_received(LinphoneCoreCbs *cbs, LinphoneCoreCbsNotifyPresenceReceivedCb cb);

351 352 353 354 355 356 357
/**
 * Get the #LinphoneCoreCbsNotifyPresenceReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsNotifyPresenceReceivedCb linphone_core_cbs_get_notify_presence_received(LinphoneCoreCbs *cbs);

358 359 360 361 362 363 364
/**
 * Set the #LinphoneCoreCbsNotifyPresenceReceivedForUriOrTelCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_notify_presence_received_for_uri_or_tel(LinphoneCoreCbs *cbs, LinphoneCoreCbsNotifyPresenceReceivedForUriOrTelCb cb);

365 366 367 368 369 370 371
/**
 * Get the #LinphoneCoreCbsNotifyPresenceReceivedForUriOrTelCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsNotifyPresenceReceivedForUriOrTelCb linphone_core_cbs_get_notify_presence_received_for_uri_or_tel(LinphoneCoreCbs *cbs);

372 373 374 375 376 377 378
/**
 * Set the #LinphoneCoreCbsNewSubscriptionRequestedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_new_subscription_requested(LinphoneCoreCbs *cbs, LinphoneCoreCbsNewSubscriptionRequestedCb cb);

379 380 381 382 383 384 385
/**
 * Get the #LinphoneCoreCbsNewSubscriptionRequestedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsNewSubscriptionRequestedCb linphone_core_cbs_get_new_subscription_requested(LinphoneCoreCbs *cbs);

386 387 388 389 390 391 392
/**
 * Set the #LinphoneCoreCbsAuthenticationRequestedCb callback.'
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_authentication_requested(LinphoneCoreCbs *cbs, LinphoneCoreCbsAuthenticationRequestedCb cb);

393 394 395 396 397 398 399
/**
 * Get the #LinphoneCoreCbsAuthenticationRequestedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsAuthenticationRequestedCb linphone_core_cbs_get_authentication_requested(LinphoneCoreCbs *cbs);

400 401 402 403 404 405 406
/**
 * Set the #LinphoneCoreCbsCallLogUpdatedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_call_log_updated(LinphoneCoreCbs *cbs, LinphoneCoreCbsCallLogUpdatedCb cb);

407 408 409 410 411 412 413
/**
 * Get the #LinphoneCoreCbsCallLogUpdatedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsCallLogUpdatedCb linphone_core_cbs_get_call_log_updated(LinphoneCoreCbs *cbs);

414 415 416 417 418 419 420
/**
 * Set the #LinphoneCoreCbsMessageReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_message_received(LinphoneCoreCbs *cbs, LinphoneCoreCbsMessageReceivedCb cb);

421 422 423 424 425 426 427
/**
 * Get the #LinphoneCoreCbsMessageReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsMessageReceivedCb linphone_core_cbs_get_message_received(LinphoneCoreCbs *cbs);

428 429 430 431 432 433 434 435 436 437 438 439 440 441
/**
 * Set the #LinphoneCoreCbsMessageReceivedUnableDecryptCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_message_received_unable_decrypt(LinphoneCoreCbs *cbs, LinphoneCoreCbsMessageReceivedUnableDecryptCb cb);

/**
 * Get the #LinphoneCoreCbsMessageReceivedUnableDecryptCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsMessageReceivedUnableDecryptCb linphone_core_cbs_get_message_received_unable_decrypt(LinphoneCoreCbs *cbs);

442 443 444 445 446 447 448
/**
 * Set the #LinphoneCoreCbsIsComposingReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_is_composing_received(LinphoneCoreCbs *cbs, LinphoneCoreCbsIsComposingReceivedCb cb);

449 450 451 452 453 454 455
/**
 * Get the #LinphoneCoreCbsIsComposingReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsIsComposingReceivedCb linphone_core_cbs_get_is_composing_received(LinphoneCoreCbs *cbs);

456 457 458 459 460 461 462
/**
 * Set the #LinphoneCoreCbsDtmfReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_dtmf_received(LinphoneCoreCbs *cbs, LinphoneCoreCbsDtmfReceivedCb cb);

463 464 465 466 467 468 469
/**
 * Get the #LinphoneCoreCbsDtmfReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsDtmfReceivedCb linphone_core_cbs_get_dtmf_received(LinphoneCoreCbs *cbs);

470 471 472 473 474 475 476
/**
 * Set the #LinphoneCoreCbsReferReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_refer_received(LinphoneCoreCbs *cbs, LinphoneCoreCbsReferReceivedCb cb);

477 478 479 480 481 482 483
/**
 * Get the #LinphoneCoreCbsReferReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsReferReceivedCb linphone_core_cbs_get_refer_received(LinphoneCoreCbs *cbs);

484 485 486 487 488 489 490
/**
 * Set the #LinphoneCoreCbsCallEncryptionChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_call_encryption_changed(LinphoneCoreCbs *cbs, LinphoneCoreCbsCallEncryptionChangedCb cb);

491 492 493 494 495 496 497
/**
 * Get the #LinphoneCoreCbsCallEncryptionChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsCallEncryptionChangedCb linphone_core_cbs_get_call_encryption_changed(LinphoneCoreCbs *cbs);

498 499 500 501 502 503 504
/**
 * Set the #LinphoneCoreCbsTransferStateChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_transfer_state_changed(LinphoneCoreCbs *cbs, LinphoneCoreCbsTransferStateChangedCb cb);

505 506 507 508 509 510 511
/**
 * Get the #LinphoneCoreCbsTransferStateChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsTransferStateChangedCb linphone_core_cbs_get_transfer_state_changed(LinphoneCoreCbs *cbs);

512 513 514 515 516 517 518
/**
 * Set the #LinphoneCoreCbsBuddyInfoUpdatedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_buddy_info_updated(LinphoneCoreCbs *cbs, LinphoneCoreCbsBuddyInfoUpdatedCb cb);

519 520 521 522 523 524 525
/**
 * Get the #LinphoneCoreCbsBuddyInfoUpdatedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsBuddyInfoUpdatedCb linphone_core_cbs_get_buddy_info_updated(LinphoneCoreCbs *cbs);

526 527 528 529 530 531 532
/**
 * Set the #LinphoneCoreCbsCallStatsUpdatedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_call_stats_updated(LinphoneCoreCbs *cbs, LinphoneCoreCbsCallStatsUpdatedCb cb);

533 534 535 536 537 538 539
/**
 * Get the #LinphoneCoreCbsCallStatsUpdatedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsCallStatsUpdatedCb linphone_core_cbs_get_call_stats_updated(LinphoneCoreCbs *cbs);

540 541 542 543 544 545 546
/**
 * Set the #LinphoneCoreCbsInfoReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_info_received(LinphoneCoreCbs *cbs, LinphoneCoreCbsInfoReceivedCb cb);

547 548 549 550 551 552 553
/**
 * Get the #LinphoneCoreCbsInfoReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsInfoReceivedCb linphone_core_cbs_get_info_received(LinphoneCoreCbs *cbs);

554 555 556 557 558 559 560
/**
 * Set the #LinphoneCoreCbsSubscriptionStateChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_subscription_state_changed(LinphoneCoreCbs *cbs, LinphoneCoreCbsSubscriptionStateChangedCb cb);

561 562 563 564 565 566 567
/**
 * Get the #LinphoneCoreCbsSubscriptionStateChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsSubscriptionStateChangedCb linphone_core_cbs_get_subscription_state_changed(LinphoneCoreCbs *cbs);

568 569 570 571 572 573 574
/**
 * Set the #LinphoneCoreCbsNotifyReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_notify_received(LinphoneCoreCbs *cbs, LinphoneCoreCbsNotifyReceivedCb cb);

575 576 577 578 579 580 581
/**
 * Get the #LinphoneCoreCbsNotifyReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsNotifyReceivedCb linphone_core_cbs_get_notify_received(LinphoneCoreCbs *cbs);

582 583 584 585 586 587 588 589 590 591 592 593 594 595
/**
 * Set the #LinphoneCoreCbsSubscribeReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_subscribe_received(LinphoneCoreCbs *cbs, LinphoneCoreCbsSubscribeReceivedCb cb);

/**
 * Get the #LinphoneCoreCbsSubscribeReceivedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsSubscribeReceivedCb linphone_core_cbs_get_subscribe_received(LinphoneCoreCbs *cbs);

596 597 598 599 600 601 602
/**
 * Set the #LinphoneCoreCbsPublishStateChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_publish_state_changed(LinphoneCoreCbs *cbs, LinphoneCoreCbsPublishStateChangedCb cb);

603 604 605 606 607 608 609
/**
 * Get the #LinphoneCoreCbsPublishStateChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsPublishStateChangedCb linphone_core_cbs_get_publish_state_changed(LinphoneCoreCbs *cbs);

610 611 612 613 614 615 616
/**
 * Set the #LinphoneCoreCbsConfiguringStatusCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_configuring_status(LinphoneCoreCbs *cbs, LinphoneCoreCbsConfiguringStatusCb cb);

617 618 619 620 621 622 623
/**
 * Get the #LinphoneCoreCbsConfiguringStatusCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsConfiguringStatusCb linphone_core_cbs_get_configuring_status(LinphoneCoreCbs *cbs);

624 625 626 627 628 629 630
/**
 * Set the #LinphoneCoreCbsNetworkReachableCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_network_reachable(LinphoneCoreCbs *cbs, LinphoneCoreCbsNetworkReachableCb cb);

631 632 633 634 635
/**
 * Get the #LinphoneCoreCbsNetworkReachableCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
Sylvain Berfini's avatar
Sylvain Berfini committed
636
LINPHONE_PUBLIC LinphoneCoreCbsNetworkReachableCb linphone_core_cbs_get_network_reachable(LinphoneCoreCbs *cbs);
637

638 639 640 641 642 643 644
/**
 * Set the #LinphoneCoreCbsLogCollectionUploadStateChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_log_collection_upload_state_changed(LinphoneCoreCbs *cbs, LinphoneCoreCbsLogCollectionUploadStateChangedCb cb);

645 646 647 648 649 650 651
/**
 * Get the #LinphoneCoreCbsLogCollectionUploadStateChangedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsLogCollectionUploadStateChangedCb linphone_core_cbs_get_log_collection_upload_state_changed(LinphoneCoreCbs *cbs);

652 653 654 655 656 657 658
/**
 * Set the #LinphoneCoreCbsLogCollectionUploadProgressIndicationCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_log_collection_upload_progress_indication(LinphoneCoreCbs *cbs, LinphoneCoreCbsLogCollectionUploadProgressIndicationCb cb);

659 660 661 662 663 664 665
/**
 * Get the #LinphoneCoreCbsLogCollectionUploadProgressIndicationCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsLogCollectionUploadProgressIndicationCb linphone_core_cbs_get_log_collection_upload_progress_indication(LinphoneCoreCbs *cbs);

666 667 668 669 670 671 672
/**
 * Set the #LinphoneCoreCbsFriendListCreatedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_friend_list_created(LinphoneCoreCbs *cbs, LinphoneCoreCbsFriendListCreatedCb cb);

673 674 675 676 677 678 679
/**
 * Get the #LinphoneCoreCbsFriendListCreatedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsFriendListCreatedCb linphone_core_cbs_get_friend_list_created(LinphoneCoreCbs *cbs);

680 681 682 683 684 685 686
/**
 * Set the #LinphoneCoreCbsFriendListRemovedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @param[in] cb The callback.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_friend_list_removed(LinphoneCoreCbs *cbs, LinphoneCoreCbsFriendListRemovedCb cb);

687 688 689 690 691 692 693
/**
 * Get the #LinphoneCoreCbsFriendListRemovedCb callback.
 * @param[in] cbs A #LinphoneCoreCbs.
 * @return The callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsFriendListRemovedCb linphone_core_cbs_get_friend_list_removed(LinphoneCoreCbs *cbs);

694 695
/**
 * Set the call created callback.
696
 * @param[in] cbs #LinphoneCallCbs object.
697 698 699 700 701 702
 * @param[in] cb The call created callback to be used.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_call_created(LinphoneCoreCbs *cbs, LinphoneCoreCbsCallCreatedCb cb);

/**
 * Get the call created callback.
703
 * @param[in] cbs #LinphoneCoreCbs object.
704 705 706 707
 * @return The current call created callback.
 */
LINPHONE_PUBLIC LinphoneCoreCbsCallCreatedCb linphone_core_cbs_get_call_created(LinphoneCoreCbs *cbs);

Ghislain MARY's avatar
Ghislain MARY committed
708 709
/**
 * Set the version update check result callback.
710
 * @param[in] cbs #LinphoneCoreCbs object
Ghislain MARY's avatar
Ghislain MARY committed
711 712 713 714 715 716
 * @param[in] cb The callback to use
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_version_update_check_result_received(LinphoneCoreCbs *cbs, LinphoneCoreCbsVersionUpdateCheckResultReceivedCb cb);

/**
 * Get the version update check result callback.
717
 * @param[in] cbs #LinphoneCoreCbs object
Ghislain MARY's avatar
Ghislain MARY committed
718 719 720 721
 * @return The current callback
 */
LINPHONE_PUBLIC LinphoneCoreCbsVersionUpdateCheckResultReceivedCb linphone_core_cbs_get_version_update_check_result_received(LinphoneCoreCbs *cbs);

722
/**
723
 * Get the chat room state changed callback.
724
 * @param[in] cbs #LinphoneCoreCbs object
725 726
 * @return The current callback
 */
727
LINPHONE_PUBLIC LinphoneCoreCbsChatRoomStateChangedCb linphone_core_cbs_get_chat_room_state_changed (LinphoneCoreCbs *cbs);
728 729

/**
730
 * Set the chat room state changed callback.
731
 * @param[in] cbs #LinphoneCoreCbs object
732 733
 * @param[in] cb The callback to use
 */
734
LINPHONE_PUBLIC void linphone_core_cbs_set_chat_room_state_changed (LinphoneCoreCbs *cbs, LinphoneCoreCbsChatRoomStateChangedCb cb);
735

736
/**
737
 * Get the qrcode found callback.
738 739 740
 * @param[in] cbs LinphoneCoreCbs object
 * @return The current callback
 */
741
LINPHONE_PUBLIC LinphoneCoreCbsQrcodeFoundCb linphone_core_cbs_get_qrcode_found(LinphoneCoreCbs *cbs);
742 743 744 745 746 747

/**
 * Set the qrcode found callback.
 * @param[in] cbs LinphoneCoreCbs object
 * @param[in] cb The callback to use
 **/
748
LINPHONE_PUBLIC void linphone_core_cbs_set_qrcode_found(LinphoneCoreCbs *cbs, LinphoneCoreCbsQrcodeFoundCb cb);
749

750 751 752 753 754 755 756 757 758 759 760 761 762 763 764
/**
 * @brief Sets a callback to call each time the echo-canceler calibration is completed.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_ec_calibration_result(LinphoneCoreCbs *cbs, LinphoneCoreCbsEcCalibrationResultCb cb);

/**
 * @brief Sets a callback to call when the echo-canceler calibrator has completed its audio graph.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_ec_calibration_audio_init(LinphoneCoreCbs *cbs, LinphoneCoreCbsEcCalibrationAudioInitCb cb);

/**
 * @brief Sets a callback to call when the echo-canceler calibrator destroys its audio graph.
 */
LINPHONE_PUBLIC void linphone_core_cbs_set_ec_calibration_audio_uninit(LinphoneCoreCbs *cbs, LinphoneCoreCbsEcCalibrationAudioUninitCb cb);

smorlat's avatar
smorlat committed
765 766 767 768
/**
 * @}
**/

769
typedef void * (*LinphoneCoreWaitingCallback)(LinphoneCore *lc, void *context, LinphoneWaitingState ws, const char *purpose, float progress);
jehan's avatar
jehan committed
770

aymeric's avatar
aymeric committed
771

Ghislain MARY's avatar
Ghislain MARY committed
772 773 774 775 776
/**
 * @addtogroup initializing
 * @{
**/

Ghislain MARY's avatar
Ghislain MARY committed
777 778
/**
 * Tells whether the linphone core log collection is enabled.
779
 * @return The state of the linphone core log collection.
Ghislain MARY's avatar
Ghislain MARY committed
780 781 782
 */
LINPHONE_PUBLIC LinphoneLogCollectionState linphone_core_log_collection_enabled(void);

783 784
/**
 * Enable the linphone core log collection to upload logs on a server.
785
 * @param[in] state #LinphoneLogCollectionState value telling whether to enable log collection or not.
786
 */
787
LINPHONE_PUBLIC void linphone_core_enable_log_collection(LinphoneLogCollectionState state);
788

Ghislain MARY's avatar
Ghislain MARY committed
789 790
/**
 * Get the path where the log files will be written for log collection.
791
 * @return The path where the log files will be written.
Ghislain MARY's avatar
Ghislain MARY committed
792 793 794
 */
LINPHONE_PUBLIC const char * linphone_core_get_log_collection_path(void);

795
/**
796
 * Set the path of a directory where the log files will be written for log collection.
797 798 799 800
 * @param[in] path The path where the log files will be written.
 */
LINPHONE_PUBLIC void linphone_core_set_log_collection_path(const char *path);

Ghislain MARY's avatar
Ghislain MARY committed
801 802
/**
 * Get the prefix of the filenames that will be used for log collection.
803
 * @return The prefix of the filenames used for log collection.
Ghislain MARY's avatar
Ghislain MARY committed
804 805 806 807 808 809 810 811 812 813 814
 */
LINPHONE_PUBLIC const char * linphone_core_get_log_collection_prefix(void);

/**
 * Set the prefix of the filenames that will be used for log collection.
 * @param[in] prefix The prefix to use for the filenames for log collection.
 */
LINPHONE_PUBLIC void linphone_core_set_log_collection_prefix(const char *prefix);

/**
 * Get the max file size in bytes of the files used for log collection.
815
 * @return The max file size in bytes of the files used for log collection.
Ghislain MARY's avatar
Ghislain MARY committed
816
 */
817
LINPHONE_PUBLIC size_t linphone_core_get_log_collection_max_file_size(void);
Ghislain MARY's avatar
Ghislain MARY committed
818 819 820

/**
 * Set the max file size in bytes of the files used for log collection.
821 822 823 824
 * Warning: this function should only not be used to change size
 * dynamically but instead only before calling @see
 * linphone_core_enable_log_collection. If you increase max size
  * on runtime, logs chronological order COULD be broken.
Ghislain MARY's avatar
Ghislain MARY committed
825 826
 * @param[in] size The max file size in bytes of the files used for log collection.
 */
827
LINPHONE_PUBLIC void linphone_core_set_log_collection_max_file_size(size_t size);
Ghislain MARY's avatar
Ghislain MARY committed
828

829 830
/**
 * Set the url of the server where to upload the collected log files.
831
 * @param[in] core #LinphoneCore object
832 833 834 835
 * @param[in] server_url The url of the server where to upload the collected log files.
 */
LINPHONE_PUBLIC void linphone_core_set_log_collection_upload_server_url(LinphoneCore *core, const char *server_url);

836 837
/**
 * Gets the url of the server where to upload the collected log files.
838
 * @param[in] core #LinphoneCore object
839 840 841 842
 * @return The url of the server where to upload the collected log files.
 */
LINPHONE_PUBLIC const char * linphone_core_get_log_collection_upload_server_url(LinphoneCore *core);

843 844
/**
 * Upload the log collection to the configured server url.
845
 * @param[in] core #LinphoneCore object
846 847 848
 */
LINPHONE_PUBLIC void linphone_core_upload_log_collection(LinphoneCore *core);

849 850 851 852
/**
 * Compress the log collection in a single file.
 * @return The path of the compressed log collection file (to be freed calling ms_free()).
 */
853
LINPHONE_PUBLIC char * linphone_core_compress_log_collection(void);
854

855 856 857
/**
 * Reset the log collection by removing the log files.
 */
858
LINPHONE_PUBLIC void linphone_core_reset_log_collection(void);
859

860
/**
861
 * @brief Define a log handler.
862
 * @param logfunc The function pointer of the log handler.
863
 * @deprecated Use #linphone_logging_service_cbs_set_log_message_written() instead. Deprecated since 2017-10-10.
864
 * @donotwrap
865
 */
866
LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_log_handler(OrtpLogFunc logfunc);
Ghislain MARY's avatar
Ghislain MARY committed
867

868
/**
869
 * @brief Define a log file.
870 871 872
 *
 * If the file pointer passed as an argument is NULL, stdout is used instead.
 * @param file A pointer to the FILE structure of the file to write to.
873
 * @deprecated Use #linphone_log_service_set_file() instead. Deprecated since 2017-10-10.
874
 * @donotwrap
875
 */
876
LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_log_file(FILE *file);
877 878

/**
879
 * @brief Define the minimum level for logging.
880
 * @param loglevel Minimum level for logging messages.
881
 * @deprecated Use #linphone_logging_service_set_log_level() instead. Deprecated since 2017-10-10.
882
 * @donotwrap
883
**/
884
LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_log_level(OrtpLogLevel loglevel);
Ghislain MARY's avatar
Ghislain MARY committed
885

886
/**
887
 * Define the log level using mask.
888 889 890 891
 *
 * The loglevel parameter is a bitmask parameter. Therefore to enable only warning and error
 * messages, use ORTP_WARNING | ORTP_ERROR. To disable logs, simply set loglevel to 0.
 *
892 893
 * @param mask A bitmask of the log levels to set.
 * @deprecated Use #linphone_logging_service_set_log_level() instead. Deprecated since 2017-10-10.
894
 */
895
LINPHONE_PUBLIC LINPHONE_DEPRECATED void linphone_core_set_log_level_mask(unsigned int mask);
896

897 898 899 900 901
/**
 * Get defined log level mask.
 *
 * @return The loglevel parameter is a bitmask parameter. Therefore to enable only warning and error
 * messages, use ORTP_WARNING | ORTP_ERROR. To disable logs, simply set loglevel to 0.
902
 * @deprecated Use #linphone_logging_service_get_log_level_mask() instead. Deprecated since 2017-10-10.
903
 */
904
LINPHONE_PUBLIC LINPHONE_DEPRECATED unsigned int linphone_core_get_log_level_mask(void);
905

906 907 908
/**
 * Enable logs in supplied FILE*.
 * @param file a C FILE* where to fprintf logs. If null stdout is used.
909 910
 * @deprecated Use #linphone_core_set_log_file and #linphone_core_set_log_level() instead.
 * Deprecated since 2017-01-12.
911
 * @donotwrap
912
**/
913
LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_core_enable_logs(FILE *file);
914 915 916 917 918

/**
 * Enable logs through the user's supplied log callback.
 * @param logfunc The address of a OrtpLogFunc callback whose protoype is
 *            	  typedef void (*OrtpLogFunc)(OrtpLogLevel lev, const char *fmt, va_list args);
919
 * @deprecated Use #linphone_core_set_log_handler and #linphone_core_set_log_level instead.
920
 * Deprecated since 2017-01-12.
921
 * @donotwrap
922
**/
923
LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc);
924 925 926

/**
 * Entirely disable logging.
927
 * @deprecated Use #linphone_core_set_log_level() instead. Deprecated since 2017-01-12.
928
 * @donotwrap
929
**/
930
LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_core_disable_logs(void);
931 932 933 934 935 936 937

/**
 * Enable logs serialization (output logs from either the thread that creates the linphone core or the thread that calls linphone_core_iterate()).
 * Must be called before creating the linphone core.
 */
LINPHONE_PUBLIC void linphone_core_serialize_logs(void);

938 939 940
/**
 * Returns liblinphone's version as a string.
**/
941
LINPHONE_PUBLIC const char *linphone_core_get_version(void);
942 943 944 945

/**
 * @return liblinphone's user agent as a string.
**/
946
LINPHONE_PUBLIC const char *linphone_core_get_user_agent(LinphoneCore *lc);
947

948
/**
949 950
 * @deprecated Use #linphone_core_get_user_agent() instead.
 * Deprecated since 2015-11-19.
951
 * @donotwrap
952
**/
953
LINPHONE_PUBLIC LINPHONE_DEPRECATED const char *linphone_core_get_user_agent_name(void);
954

955
/**
956 957
 * @deprecated Use #linphone_core_get_user_agent instead.
 * Deprecated since 2015-11-19.
958
 * @donotwrap
959
**/
960
LINPHONE_PUBLIC LINPHONE_DEPRECATED const char *linphone_core_get_user_agent_version(void);
aymeric's avatar
aymeric committed
961

Ghislain MARY's avatar
Ghislain MARY committed
962 963 964 965
/**
 * @}
**/

966
/**
967
 * Instanciates a #LinphoneCore object.
968 969
 * @ingroup initializing
 *
970
 * The #LinphoneCore object is the primary handle for doing all phone actions.
971
 * It should be unique within your application.
972
 * @param vtable a #LinphoneCoreVTable structure holding your application callbacks
973 974
 * @param config_path a path to a config file. If it does not exists it will be created.
 *        The config file is used to store all settings, call logs, friends, proxies... so that all these settings
975 976
 *        become persistent over the life of the LinphoneCore object.
 *        It is allowed to set a NULL config file. In that case LinphoneCore will not store any settings.
977 978 979 980 981 982 983
 * @param factory_config_path a path to a read-only config file that can be used to
 *        to store hard-coded preference such as proxy settings or internal preferences.
 *        The settings in this factory file always override the one in the normal config file.
 *        It is OPTIONAL, use NULL if unneeded.
 * @param userdata an opaque user pointer that can be retrieved at any time (for example in
 *        callbacks) using linphone_core_get_user_data().
 * @see linphone_core_new_with_config
984
 * @deprecated Use #linphone_factory_create_core() instead. Deprecated since 2017-01-12.
985
 * @donotwrap
986
**/
987
LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_core_new(const LinphoneCoreVTable *vtable,
988
						const char *config_path, const char *factory_config_path, void* userdata);
aymeric's avatar
aymeric committed
989

990
/**
991
 * Instantiates a #LinphoneCore object with a given LpConfig.
992 993
 * @ingroup initializing
 *
994
 * The #LinphoneCore object is the primary handle for doing all phone actions.
995
 * It should be unique within your application.
996 997
 * @param vtable a #LinphoneCoreVTable structure holding your application callbacks
 * @param config a pointer to an LpConfig object holding the configuration of the #LinphoneCore to be instantiated.
998 999 1000
 * @param userdata an opaque user pointer that can be retrieved at any time (for example in
 *        callbacks) using linphone_core_get_user_data().
 * @see linphone_core_new
1001
 * @deprecated Use #linphone_factory_create_core_with_config() instead. Deprecated since 2017-01-12.
1002
 * @donotwrap
1003
**/
1004 1005
LINPHONE_DEPRECATED LINPHONE_PUBLIC LinphoneCore *linphone_core_new_with_config(const LinphoneCoreVTable *vtable, LpConfig *config, void *userdata);

1006
/**
1007
 * Start a #LinphoneCore object after it has been instantiated.
1008 1009 1010 1011 1012
 * @ingroup initializing
 * @param[in] core The #LinphoneCore object to be started
 */
LINPHONE_PUBLIC void linphone_core_start (LinphoneCore *core);

1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027
/**
 * Increment the reference counter of a #LinphoneCore object.
 * @param lc The #LinphoneCore which the ref counter is to be incremented.
 * @return A pointer on the #LinphoneCore passed as parameter.
 * @ingroup initializing
 */
LINPHONE_PUBLIC LinphoneCore *linphone_core_ref(LinphoneCore *lc);

/**
 * Decrement the ref counter of a #LinphoneCore object and destroy it
 * if the counter reach 0.
 * @param lc The #LinphoneCore which the reference counter is to be decreased.
 * @ingroup initializing
 */
LINPHONE_PUBLIC void linphone_core_unref(LinphoneCore *lc);
1028

1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040
/**
 * Main loop function. It is crucial that your application call it periodically.
 *
 * linphone_core_iterate() performs various backgrounds tasks:
 * - receiving of SIP messages
 * - handles timers and timeout
 * - performs registration to proxies
 * - authentication retries
 * The application MUST call this function periodically, in its main loop.
 * Be careful that this function must be called from the same thread as
 * other liblinphone methods. If it is not the case make sure all liblinphone calls are
 * serialized with a mutex.
1041
 * For ICE to work properly it should be called every 20ms.
1042
 * @param[in] lc #LinphoneCore object
1043
 * @ingroup initializing
1044 1045
**/
LINPHONE_PUBLIC void linphone_core_iterate(LinphoneCore *lc);
1046

jehan's avatar
jehan committed
1047 1048
/**
 * @ingroup initializing
1049
 * add a listener to be notified of linphone core events. Once events are received, registered vtable are invoked in order.
1050
 * @param vtable a #LinphoneCoreVTable structure holding your application callbacks. Object is owned by linphone core until linphone_core_remove_listener.
jehan's avatar
jehan committed
1051
 * @param lc object
1052
 * @deprecated Use linphone_core_add_callbacks() instead. Deprecated since 2017-01-12.
1053
 * @donotwrap
jehan's avatar
jehan committed
1054
 */
1055
LINPHONE_DEPRECATED LINPHONE_PUBLIC void linphone_core_add_listener(LinphoneCore *lc, LinphoneCoreVTable *vtable);
1056

1057 1058
/**
 * @ingroup initializing
1059 1060
 * Add a listener in order to be notified of #LinphoneCore events. Once an event is received, registred #LinphoneCoreCbs are
 * invoked sequencially.
1061
 * @param lc The #LinphoneCore object to monitor.
1062
 * @param cbs A #LinphoneCoreCbs object holding the callbacks you need. A reference is taken by #LinphoneCore until you invoke linphone_core_remove_callbacks().
1063 1064
 */
LINPHONE_PUBLIC void linphone_core_add_callbacks(LinphoneCore *lc, LinphoneCoreCbs *cbs);
1065

jehan's avatar
jehan committed
1066 1067
/**
 * @ingroup initializing
1068 1069
 * remove a listener registred by linphone_core_add_listener.
 * @param lc object
1070
 * @param vtable a #LinphoneCoreVTable structure holding your application callbacks.
1071
 * @deprecated Use linphone_core_remove_callbacks() instead. Deprecated since 2017-01-12.