linphonecore.h 58.4 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 17 18 19 20 21 22 23 24

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., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/
#ifndef LINPHONECORE_H
#define LINPHONECORE_H

#include "ortp/ortp.h"
#include "ortp/payloadtype.h"
#include "mediastreamer2/mscommon.h"
smorlat's avatar
smorlat committed
25
#include "mediastreamer2/msvideo.h"
26 27

#ifdef IN_LINPHONE
smorlat's avatar
smorlat committed
28
#include "sipsetup.h"
29 30 31
#else
#include "linphone/sipsetup.h"
#endif
aymeric's avatar
aymeric committed
32

smorlat's avatar
smorlat committed
33
#define LINPHONE_IPADDR_SIZE 64
smorlat's avatar
smorlat committed
34
#define LINPHONE_HOSTNAME_SIZE 128
smorlat's avatar
smorlat committed
35

aymeric's avatar
aymeric committed
36 37 38 39 40 41
#ifdef __cplusplus
extern "C" {
#endif

struct _MSSndCard;
struct _LinphoneCore;
42 43 44 45 46
/**
 * Linphone core main object created by function linphone_core_new() .
 * @ingroup initializing
 */
typedef struct _LinphoneCore LinphoneCore;
47
struct SalOp;
aymeric's avatar
aymeric committed
48 49 50

struct _LpConfig;

51

52 53 54 55 56 57 58 59 60
struct _LCSipTransports{
	int udp_port;
	int tcp_port;
	int dtls_port;
	int tls_port;
};

typedef struct _LCSipTransports LCSipTransports;

smorlat's avatar
smorlat committed
61 62 63 64 65 66 67 68 69 70
/**
 * Object that represents a SIP address.
 *
 * The LinphoneAddress is an opaque object to represents SIP addresses, ie
 * the content of SIP's 'from' and 'to' headers.
 * A SIP address is made of display name, username, domain name, port, and various
 * uri headers (such as tags). It looks like 'Alice <sip:alice@example.net>'.
 * The LinphoneAddress has methods to extract and manipulate all parts of the address.
 * When some part of the address (for example the username) is empty, the accessor methods
 * return NULL.
71
 *
smorlat's avatar
smorlat committed
72 73 74
 * @ingroup linphone_address
 * @var LinphoneAddress
 */
75
typedef struct SalAddress LinphoneAddress;
76 77 78 79 80
#ifdef IN_LINPHONE
#include "linphonefriend.h"
#else
#include "linphone/linphonefriend.h"
#endif
81 82 83 84 85 86 87

LinphoneAddress * linphone_address_new(const char *uri);
LinphoneAddress * linphone_address_clone(const LinphoneAddress *uri);
const char *linphone_address_get_scheme(const LinphoneAddress *u);
const char *linphone_address_get_display_name(const LinphoneAddress* u);
const char *linphone_address_get_username(const LinphoneAddress *u);
const char *linphone_address_get_domain(const LinphoneAddress *u);
jehan's avatar
jehan committed
88 89 90 91 92 93 94 95 96
/**
 * Get port number as an integer value.
 *
 */
int linphone_address_get_port_int(const LinphoneAddress *u);
/**
 * Get port number, null if not present.
 */
const char* linphone_address_get_port(const LinphoneAddress *u);
97 98 99 100 101
void linphone_address_set_display_name(LinphoneAddress *u, const char *display_name);
void linphone_address_set_username(LinphoneAddress *uri, const char *username);
void linphone_address_set_domain(LinphoneAddress *uri, const char *host);
void linphone_address_set_port(LinphoneAddress *uri, const char *port);
void linphone_address_set_port_int(LinphoneAddress *uri, int port);
102
/*remove tags, params etc... so that it is displayable to the user*/
103 104 105
void linphone_address_clean(LinphoneAddress *uri);
char *linphone_address_as_string(const LinphoneAddress *u);
char *linphone_address_as_string_uri_only(const LinphoneAddress *u);
106
bool_t linphone_address_weak_equal(const LinphoneAddress *a1, const LinphoneAddress *a2);
107
void linphone_address_destroy(LinphoneAddress *u);
aymeric's avatar
aymeric committed
108

smorlat's avatar
smorlat committed
109
struct _SipSetupContext;
110

aymeric's avatar
aymeric committed
111

smorlat's avatar
smorlat committed
112 113 114 115 116 117 118 119
/**
 * Enum representing the direction of a call.
 * @ingroup call_logs
**/
enum _LinphoneCallDir {
	LinphoneCallOutgoing, /**< outgoing calls*/
	LinphoneCallIncoming  /**< incoming calls*/
};
aymeric's avatar
aymeric committed
120

smorlat's avatar
smorlat committed
121 122 123 124 125
/**
 * Typedef for enum
 * @ingroup call_logs
**/
typedef enum _LinphoneCallDir LinphoneCallDir;
aymeric's avatar
aymeric committed
126

smorlat's avatar
smorlat committed
127 128 129 130
/**
 * Enum representing the status of a call
 * @ingroup call_logs
**/
131
typedef enum _LinphoneCallStatus {
smorlat's avatar
smorlat committed
132 133
	LinphoneCallSuccess, /**< The call was sucessful*/
	LinphoneCallAborted, /**< The call was aborted */
134 135
	LinphoneCallMissed, /**< The call was missed (unanswered)*/
	LinphoneCallDeclined /**< The call was declined, either locally or by remote end*/
aymeric's avatar
aymeric committed
136 137
} LinphoneCallStatus;

smorlat's avatar
smorlat committed
138 139 140 141
/**
 * Structure representing a call log.
 *
 * @ingroup call_logs
142
 *
smorlat's avatar
smorlat committed
143
**/
aymeric's avatar
aymeric committed
144
typedef struct _LinphoneCallLog{
smorlat's avatar
smorlat committed
145 146 147 148 149 150
	LinphoneCallDir dir; /**< The direction of the call*/
	LinphoneCallStatus status; /**< The status of the call*/
	LinphoneAddress *from; /**<Originator of the call as a LinphoneAddress object*/
	LinphoneAddress *to; /**<Destination of the call as a LinphoneAddress object*/
	char start_date[128]; /**<Human readable string containg the start date*/
	int duration; /**<Duration of the call in seconds*/
151
	char *refkey;
152
	void *user_pointer;
153 154
	rtp_stats_t local_stats;
	rtp_stats_t remote_stats;
155
	float quality;
156
    int video_enabled;
157
	struct _LinphoneCore *lc;
158
	time_t start_date_time; /**Start date of the call in seconds as expressed in a time_t */
aymeric's avatar
aymeric committed
159 160
} LinphoneCallLog;

Simon Morlat's avatar
Simon Morlat committed
161 162 163 164

/**
 * Enum describing type of media encryption types.
**/
165 166 167 168 169
enum LinphoneMediaEncryption {
	LinphoneMediaEncryptionNone,
	LinphoneMediaEncryptionSRTP,
	LinphoneMediaEncryptionZRTP
};
smorlat's avatar
smorlat committed
170

Simon Morlat's avatar
Simon Morlat committed
171 172 173
/**
 * Enum describing type of media encryption types.
**/
174
typedef enum LinphoneMediaEncryption LinphoneMediaEncryption;
aymeric's avatar
aymeric committed
175 176

/*public: */
177 178
void linphone_call_log_set_user_pointer(LinphoneCallLog *cl, void *up);
void *linphone_call_log_get_user_pointer(const LinphoneCallLog *cl);
179 180
void linphone_call_log_set_ref_key(LinphoneCallLog *cl, const char *refkey);
const char *linphone_call_log_get_ref_key(const LinphoneCallLog *cl);
181 182
const rtp_stats_t *linphone_call_log_get_local_stats(const LinphoneCallLog *cl);
const rtp_stats_t *linphone_call_log_get_remote_stats(const LinphoneCallLog *cl);
aymeric's avatar
aymeric committed
183 184
char * linphone_call_log_to_str(LinphoneCallLog *cl);

Simon Morlat's avatar
Simon Morlat committed
185
struct _LinphoneCallParams;
186

187
/**
Guillaume Beraudo's avatar
Guillaume Beraudo committed
188
 * The LinphoneCallParams is an object containing various call related parameters.
189
 * It can be used to retrieve parameters from a currently running call or modify the call's characteristics
190 191 192 193
 * dynamically.
**/
typedef struct _LinphoneCallParams LinphoneCallParams;

194 195
const PayloadType* linphone_call_params_get_used_audio_codec(const LinphoneCallParams *cp);
const PayloadType* linphone_call_params_get_used_video_codec(const LinphoneCallParams *cp);
196
LinphoneCallParams * linphone_call_params_copy(const LinphoneCallParams *cp);
197
void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabled);
198
bool_t linphone_call_params_video_enabled(const LinphoneCallParams *cp);
199 200
LinphoneMediaEncryption linphone_call_params_get_media_encryption(const LinphoneCallParams *cp);
void linphone_call_params_set_media_encryption(LinphoneCallParams *cp, LinphoneMediaEncryption e);
201 202
void linphone_call_params_enable_early_media_sending(LinphoneCallParams *cp, bool_t enabled);
bool_t linphone_call_params_early_media_sending_enabled(const LinphoneCallParams *cp);
Simon Morlat's avatar
Simon Morlat committed
203
bool_t linphone_call_params_local_conference_mode(const LinphoneCallParams *cp);
204
void linphone_call_params_set_audio_bandwidth_limit(LinphoneCallParams *cp, int bw);
205 206
void linphone_call_params_destroy(LinphoneCallParams *cp);

207 208
/**
 * Enum describing failure reasons.
Simon Morlat's avatar
Simon Morlat committed
209
 * @ingroup initializing
210
**/
211 212 213 214 215
enum _LinphoneReason{
	LinphoneReasonNone,
	LinphoneReasonNoResponse, /**<No response received from remote*/
	LinphoneReasonBadCredentials, /**<Authentication failed due to bad or missing credentials*/
	LinphoneReasonDeclined, /**<The call has been declined*/
216 217
	LinphoneReasonNotFound, /**<Destination of the calls was not found.*/
	LinphoneReasonNotAnswered
218 219
};

Simon Morlat's avatar
Simon Morlat committed
220 221 222 223
/**
 * Enum describing failure reasons.
 * @ingroup initializing
**/
224
typedef enum _LinphoneReason LinphoneReason;
225

226
const char *linphone_reason_to_string(LinphoneReason err);
227

228 229
/**
 * Structure describing policy regarding video streams establishments.
Simon Morlat's avatar
Simon Morlat committed
230
 * @ingroup media_parameters
231 232 233 234 235 236 237
**/
struct _LinphoneVideoPolicy{
	bool_t automatically_initiate; /**<Whether video shall be automatically proposed for outgoing calls.*/ 
	bool_t automatically_accept; /**<Whether video shall be automatically accepted for incoming calls*/
	bool_t unused[2];
};

Simon Morlat's avatar
Simon Morlat committed
238 239 240 241
/**
 * Structure describing policy regarding video streams establishments.
 * @ingroup media_parameters
**/
242 243
typedef struct _LinphoneVideoPolicy LinphoneVideoPolicy;

244 245
/**
 * The LinphoneCall object represents a call issued or received by the LinphoneCore
Simon Morlat's avatar
Simon Morlat committed
246
 * @ingroup call_control
247 248
**/
struct _LinphoneCall;
249 250
/**
 * The LinphoneCall object represents a call issued or received by the LinphoneCore
Simon Morlat's avatar
Simon Morlat committed
251
 * @ingroup call_control
252
**/
253
typedef struct _LinphoneCall LinphoneCall;
254 255


Simon Morlat's avatar
Simon Morlat committed
256 257 258 259 260
/**
 * @addtogroup call_misc
 * @{
**/

261 262 263
#define LINPHONE_CALL_STATS_AUDIO 0
#define LINPHONE_CALL_STATS_VIDEO 1

264 265 266 267 268 269
/**
 * Enum describing ICE states.
 * @ingroup initializing
**/
enum _LinphoneIceState{
	LinphoneIceStateNotActivated, /**< ICE has not been activated for this call */
Ghislain MARY's avatar
Ghislain MARY committed
270
	LinphoneIceStateFailed, /**< ICE processing has failed */
271 272 273 274 275 276 277 278 279 280 281 282
	LinphoneIceStateInProgress, /**< ICE process is in progress */
	LinphoneIceStateHostConnection, /**< ICE has established a direct connection to the remote host */
	LinphoneIceStateReflexiveConnection, /**< ICE has established a connection to the remote host through one or several NATs */
	LinphoneIceStateRelayConnection /**< ICE has established a connection through a relay */
};

/**
 * Enum describing Ice states.
 * @ingroup initializing
**/
typedef enum _LinphoneIceState LinphoneIceState;

Simon Morlat's avatar
Simon Morlat committed
283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306
/**
 * The LinphoneCallStats objects carries various statistic informations regarding quality of audio or video streams.
 *
 * To receive these informations periodically and as soon as they are computed, the application is invited to place a #CallStatsUpdated callback in the LinphoneCoreVTable structure
 * it passes for instanciating the LinphoneCore object (see linphone_core_new() ).
 *
 * At any time, the application can access last computed statistics using linphone_call_get_audio_stats() or linphone_call_get_video_stats().
**/
typedef struct _LinphoneCallStats LinphoneCallStats;

/**
 * The LinphoneCallStats objects carries various statistic informations regarding quality of audio or video streams.
 *
 * To receive these informations periodically and as soon as they are computed, the application is invited to place a #CallStatsUpdated callback in the LinphoneCoreVTable structure
 * it passes for instanciating the LinphoneCore object (see linphone_core_new() ).
 *
 * At any time, the application can access last computed statistics using linphone_call_get_audio_stats() or linphone_call_get_video_stats().
**/
struct _LinphoneCallStats {
	int		type; /**< Can be either LINPHONE_CALL_STATS_AUDIO or LINPHONE_CALL_STATS_VIDEO*/
	jitter_stats_t	jitter_stats; /**<jitter buffer statistics, see oRTP documentation for details */
	mblk_t*		received_rtcp; /**<Last RTCP packet received, as a mblk_t structure. See oRTP documentation for details how to extract information from it*/
	mblk_t*		sent_rtcp;/**<Last RTCP packet sent, as a mblk_t structure. See oRTP documentation for details how to extract information from it*/
	float		round_trip_delay; /**<Round trip propagation time in seconds if known, -1 if unknown.*/
307
	LinphoneIceState	ice_state; /**< State of ICE processing. */
308 309
	float download_bandwidth; /**<Download bandwidth measurement of received stream, expressed in kbit/s, including IP/UDP/RTP headers*/
	float upload_bandwidth; /**<Download bandwidth measurement of sent stream, expressed in kbit/s, including IP/UDP/RTP headers*/
Simon Morlat's avatar
Simon Morlat committed
310 311 312 313 314
};

/**
 * @}
**/
315 316 317 318 319

const LinphoneCallStats *linphone_call_get_audio_stats(const LinphoneCall *call);
const LinphoneCallStats *linphone_call_get_video_stats(const LinphoneCall *call);


320 321
/** Callback prototype */
typedef void (*LinphoneCallCbFunc)(struct _LinphoneCall *call,void * user_data);
322

Simon Morlat's avatar
Simon Morlat committed
323 324 325 326 327
/**
 * LinphoneCallState enum represents the different state a call can reach into.
 * The application is notified of state changes through the LinphoneCoreVTable::call_state_changed callback.
 * @ingroup call_control
**/
328
typedef enum _LinphoneCallState{
Simon Morlat's avatar
Simon Morlat committed
329
	LinphoneCallIdle,					/**<Initial call state */
330 331 332 333 334 335 336 337 338 339 340 341 342 343
	LinphoneCallIncomingReceived, /**<This is a new incoming call */
	LinphoneCallOutgoingInit, /**<An outgoing call is started */
	LinphoneCallOutgoingProgress, /**<An outgoing call is in progress */
	LinphoneCallOutgoingRinging, /**<An outgoing call is ringing at remote end */
	LinphoneCallOutgoingEarlyMedia, /**<An outgoing call is proposed early media */
	LinphoneCallConnected, /**<Connected, the call is answered */
	LinphoneCallStreamsRunning, /**<The media streams are established and running*/
	LinphoneCallPausing, /**<The call is pausing at the initiative of local end */
	LinphoneCallPaused, /**< The call is paused, remote end has accepted the pause */
	LinphoneCallResuming, /**<The call is being resumed by local end*/
	LinphoneCallRefered, /**<The call is being transfered to another party, resulting in a new outgoing call to follow immediately*/
	LinphoneCallError, /**<The call encountered an error*/
	LinphoneCallEnd, /**<The call ended normally*/
	LinphoneCallPausedByRemote, /**<The call is paused by remote end*/
Simon Morlat's avatar
Simon Morlat committed
344
	LinphoneCallUpdatedByRemote, /**<The call's parameters change is requested by remote end, used for example when video is added by remote */
345
	LinphoneCallIncomingEarlyMedia, /**<We are proposing early media to an incoming call */
346 347
	LinphoneCallUpdated, /**<The remote accepted the call update initiated by us */
	LinphoneCallReleased /**< The call object is no more retained by the core */
348 349
} LinphoneCallState;

350
const char *linphone_call_state_to_string(LinphoneCallState cs);
351

352
LinphoneCore *linphone_call_get_core(const LinphoneCall *call);
353
LinphoneCallState linphone_call_get_state(const LinphoneCall *call);
354 355 356 357
bool_t linphone_call_asked_to_autoanswer(LinphoneCall *call);
const LinphoneAddress * linphone_core_get_current_call_remote_address(struct _LinphoneCore *lc);
const LinphoneAddress * linphone_call_get_remote_address(const LinphoneCall *call);
char *linphone_call_get_remote_address_as_string(const LinphoneCall *call);
Simon Morlat's avatar
Simon Morlat committed
358
LinphoneCallDir linphone_call_get_dir(const LinphoneCall *call);
359
LinphoneCall * linphone_call_ref(LinphoneCall *call);
360 361
void linphone_call_unref(LinphoneCall *call);
LinphoneCallLog *linphone_call_get_call_log(const LinphoneCall *call);
Simon Morlat's avatar
Simon Morlat committed
362
const char *linphone_call_get_refer_to(const LinphoneCall *call);
363
bool_t linphone_call_has_transfer_pending(const LinphoneCall *call);
364
LinphoneCall *linphone_call_get_replaced_call(LinphoneCall *call);
365
int linphone_call_get_duration(const LinphoneCall *call);
366
const LinphoneCallParams * linphone_call_get_current_params(const LinphoneCall *call);
367
const LinphoneCallParams * linphone_call_get_remote_params(LinphoneCall *call);
368 369
void linphone_call_enable_camera(LinphoneCall *lc, bool_t enabled);
bool_t linphone_call_camera_enabled(const LinphoneCall *lc);
370
int linphone_call_take_video_snapshot(LinphoneCall *call, const char *file);
371
LinphoneReason linphone_call_get_reason(const LinphoneCall *call);
372
const char *linphone_call_get_remote_user_agent(LinphoneCall *call);
Simon Morlat's avatar
Simon Morlat committed
373 374
float linphone_call_get_play_volume(LinphoneCall *call);
float linphone_call_get_record_volume(LinphoneCall *call);
375 376
float linphone_call_get_current_quality(LinphoneCall *call);
float linphone_call_get_average_quality(LinphoneCall *call);
Simon Morlat's avatar
Simon Morlat committed
377 378
const char* linphone_call_get_authentication_token(LinphoneCall *call);
bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call);
379
void linphone_call_set_authentication_token_verified(LinphoneCall *call, bool_t verified);
Simon Morlat's avatar
Simon Morlat committed
380
void linphone_call_send_vfu_request(LinphoneCall *call);
Simon Morlat's avatar
Simon Morlat committed
381 382
void *linphone_call_get_user_pointer(LinphoneCall *call);
void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer);
383
void linphone_call_set_next_video_frame_decoded_callback(LinphoneCall *call, LinphoneCallCbFunc cb, void* user_data);
384
LinphoneCallState linphone_call_get_transfer_state(LinphoneCall *call);
385 386 387 388 389 390 391 392
/**
 * Return TRUE if this call is currently part of a conference
 *@param call #LinphoneCall
 *@return TRUE if part of a conference.
 *
 @ingroup call_control
 */
bool_t linphone_call_is_in_conference(const LinphoneCall *call);
jehan's avatar
jehan committed
393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420
/**
 * Enables or disable echo cancellation for this call
 * @param call
 * @param val
 *
 * @ingroup media_parameters
**/
void linphone_call_enable_echo_cancellation(LinphoneCall *call, bool_t val) ;
/**
 * Returns TRUE if echo cancellation is enabled.
 *
 * @ingroup media_parameters
**/
bool_t linphone_call_echo_cancellation_enabled(LinphoneCall *lc);
/**
 * Enables or disable echo limiter for this call
 * @param call
 * @param val
 *
 * @ingroup media_parameters
**/
void linphone_call_enable_echo_limiter(LinphoneCall *call, bool_t val);
/**
 * Returns TRUE if echo limiter is enabled.
 *
 * @ingroup media_parameters
**/
bool_t linphone_call_echo_limiter_enabled(const LinphoneCall *call);
Simon Morlat's avatar
Simon Morlat committed
421 422

/*keep this in sync with mediastreamer2/msvolume.h*/
Simon Morlat's avatar
Simon Morlat committed
423 424 425 426 427 428

/**
 * Lowest volume measurement that can be returned by linphone_call_get_play_volume() or linphone_call_get_record_volume(), corresponding to pure silence.
 * @ingroup call_misc
**/
#define LINPHONE_VOLUME_DB_LOWEST (-120)
Simon Morlat's avatar
Simon Morlat committed
429

smorlat's avatar
smorlat committed
430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449
/**
 * @addtogroup proxies
 * @{
**/
/**
 * The LinphoneProxyConfig object represents a proxy configuration to be used
 * by the LinphoneCore object.
 * Its fields must not be used directly in favour of the accessors methods.
 * Once created and filled properly the LinphoneProxyConfig can be given to
 * LinphoneCore with linphone_core_add_proxy_config().
 * This will automatically triggers the registration, if enabled.
 *
 * The proxy configuration are persistent to restarts because they are saved
 * in the configuration file. As a consequence, after linphone_core_new() there
 * might already be a list of configured proxy that can be examined with
 * linphone_core_get_proxy_config_list().
 *
 * The default proxy (see linphone_core_set_default_proxy() ) is the one of the list
 * that is used by default for calls.
**/
450
typedef struct _LinphoneProxyConfig LinphoneProxyConfig;
aymeric's avatar
aymeric committed
451

452 453 454 455
/**
 * LinphoneRegistrationState describes proxy registration states.
**/
typedef enum _LinphoneRegistrationState{
Simon Morlat's avatar
Simon Morlat committed
456 457 458 459 460
	LinphoneRegistrationNone, /**<Initial state for registrations */
	LinphoneRegistrationProgress, /**<Registration is in progress */
	LinphoneRegistrationOk,	/**< Registration is successful */
	LinphoneRegistrationCleared, /**< Unregistration succeeded */
	LinphoneRegistrationFailed	/**<Registration failed */
461 462
}LinphoneRegistrationState;

463 464 465 466
/**
 * Human readable version of the #LinphoneRegistrationState
 * @param cs sate
 */
467 468
const char *linphone_registration_state_to_string(LinphoneRegistrationState cs);

aymeric's avatar
aymeric committed
469 470
LinphoneProxyConfig *linphone_proxy_config_new(void);
int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *server_addr);
471 472
int linphone_proxy_config_set_identity(LinphoneProxyConfig *obj, const char *identity);
int linphone_proxy_config_set_route(LinphoneProxyConfig *obj, const char *route);
Simon Morlat's avatar
Simon Morlat committed
473
void linphone_proxy_config_expires(LinphoneProxyConfig *obj, int expires);
474 475 476 477 478 479
/**
 * Indicates  either or not, REGISTRATION must be issued for this #LinphoneProxyConfig .
 * <br> In case this #LinphoneProxyConfig has been added to #LinphoneCore, follows the linphone_proxy_config_edit() rule.
 * @param obj object pointer
 * @param val if true, registration will be engaged
 */
aymeric's avatar
aymeric committed
480 481 482 483
void linphone_proxy_config_enable_register(LinphoneProxyConfig *obj, bool_t val);
#define linphone_proxy_config_enableregister linphone_proxy_config_enable_register
void linphone_proxy_config_edit(LinphoneProxyConfig *obj);
int linphone_proxy_config_done(LinphoneProxyConfig *obj);
jehan's avatar
jehan committed
484 485 486 487 488 489 490
/**
 * Indicates  either or not, PUBLISH must be issued for this #LinphoneProxyConfig .
 * <br> In case this #LinphoneProxyConfig has been added to #LinphoneCore, follows the linphone_proxy_config_edit() rule.
 * @param obj object pointer
 * @param val if true, publish will be engaged
 *
 */
aymeric's avatar
aymeric committed
491
void linphone_proxy_config_enable_publish(LinphoneProxyConfig *obj, bool_t val);
492 493 494
void linphone_proxy_config_set_dial_escape_plus(LinphoneProxyConfig *cfg, bool_t val);
void linphone_proxy_config_set_dial_prefix(LinphoneProxyConfig *cfg, const char *prefix);

495
LinphoneRegistrationState linphone_proxy_config_get_state(const LinphoneProxyConfig *obj);
smorlat's avatar
smorlat committed
496
bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj);
smorlat's avatar
smorlat committed
497
const char *linphone_proxy_config_get_domain(const LinphoneProxyConfig *cfg);
498 499 500 501 502 503 504

const char *linphone_proxy_config_get_route(const LinphoneProxyConfig *obj);
const char *linphone_proxy_config_get_identity(const LinphoneProxyConfig *obj);
bool_t linphone_proxy_config_publish_enabled(const LinphoneProxyConfig *obj);
const char *linphone_proxy_config_get_addr(const LinphoneProxyConfig *obj);
int linphone_proxy_config_get_expires(const LinphoneProxyConfig *obj);
bool_t linphone_proxy_config_register_enabled(const LinphoneProxyConfig *obj);
505
void linphone_proxy_config_refresh_register(LinphoneProxyConfig *obj);
506 507
const char *linphone_proxy_config_get_contact_parameters(const LinphoneProxyConfig *obj);
void linphone_proxy_config_set_contact_parameters(LinphoneProxyConfig *obj, const char *contact_params);
508 509
struct _LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyConfig *obj);

510 511 512
bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg);
const char * linphone_proxy_config_get_dial_prefix(const LinphoneProxyConfig *cfg);

513
LinphoneReason linphone_proxy_config_get_error(const LinphoneProxyConfig *cfg);
514

aymeric's avatar
aymeric committed
515 516
/* destruction is called automatically when removing the proxy config */
void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg);
smorlat's avatar
smorlat committed
517 518
void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type);
SipSetupContext *linphone_proxy_config_get_sip_setup_context(LinphoneProxyConfig *cfg);
519
SipSetup *linphone_proxy_config_get_sip_setup(LinphoneProxyConfig *cfg);
520 521 522 523
/**
 * normalize a human readable phone number into a basic string. 888-444-222 becomes 888444222
 */
int linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const char *username, char *result, size_t result_len);
jehan's avatar
jehan committed
524 525 526 527 528 529 530 531
/*
 *  attached a user data to a proxy config
 */
void linphone_proxy_config_set_user_data(LinphoneProxyConfig *cr, void * ud);
/*
 *  get user data to a proxy config. return null if any
 */
void * linphone_proxy_config_get_user_data(LinphoneProxyConfig *cr);
smorlat's avatar
smorlat committed
532

smorlat's avatar
smorlat committed
533 534 535 536
/**
 * @}
**/

537 538 539 540 541 542
typedef struct _LinphoneAccountCreator{
	struct _LinphoneCore *lc;
	struct _SipSetupContext *ssctx;
	char *username;
	char *password;
	char *domain;
Sylvain Berfini's avatar
Sylvain Berfini committed
543 544 545
	char *route;
	char *email;
	int suscribe;
546 547 548
	bool_t succeeded;
}LinphoneAccountCreator;

549
LinphoneAccountCreator *linphone_account_creator_new(struct _LinphoneCore *core, const char *type);
550 551 552
void linphone_account_creator_set_username(LinphoneAccountCreator *obj, const char *username);
void linphone_account_creator_set_password(LinphoneAccountCreator *obj, const char *password);
void linphone_account_creator_set_domain(LinphoneAccountCreator *obj, const char *domain);
Sylvain Berfini's avatar
Sylvain Berfini committed
553 554 555
void linphone_account_creator_set_route(LinphoneAccountCreator *obj, const char *route);
void linphone_account_creator_set_email(LinphoneAccountCreator *obj, const char *email);
void linphone_account_creator_set_suscribe(LinphoneAccountCreator *obj, int suscribre);
smorlat's avatar
smorlat committed
556 557
const char * linphone_account_creator_get_username(LinphoneAccountCreator *obj);
const char * linphone_account_creator_get_domain(LinphoneAccountCreator *obj);
558
int linphone_account_creator_test_existence(LinphoneAccountCreator *obj);
Sylvain Berfini's avatar
Sylvain Berfini committed
559
int linphone_account_creator_test_validation(LinphoneAccountCreator *obj);
560 561 562
LinphoneProxyConfig * linphone_account_creator_validate(LinphoneAccountCreator *obj);
void linphone_account_creator_destroy(LinphoneAccountCreator *obj);

563 564
struct _LinphoneAuthInfo;

smorlat's avatar
smorlat committed
565 566 567 568 569 570 571 572 573 574 575 576
/**
 * @ingroup authentication
 * Object holding authentication information.
 *
 * @note The object's fields should not be accessed directly. Prefer using
 * the accessor methods.
 *
 * In most case, authentication information consists of a username and password.
 * Sometimes, a userid is required by proxy, and realm can be useful to discriminate
 * different SIP domains.
 *
 * Once created and filled, a LinphoneAuthInfo must be added to the LinphoneCore in
577
 * order to become known and used automatically when needed.
smorlat's avatar
smorlat committed
578 579 580 581 582 583
 * Use linphone_core_add_auth_info() for that purpose.
 *
 * The LinphoneCore object can take the initiative to request authentication information
 * when needed to the application through the auth_info_requested callback of the
 * LinphoneCoreVTable structure.
 *
584 585
 * The application can respond to this information request later using
 * linphone_core_add_auth_info(). This will unblock all pending authentication
smorlat's avatar
smorlat committed
586 587 588
 * transactions and retry them with authentication headers.
 *
**/
589
typedef struct _LinphoneAuthInfo LinphoneAuthInfo;
aymeric's avatar
aymeric committed
590 591 592 593

LinphoneAuthInfo *linphone_auth_info_new(const char *username, const char *userid,
		const char *passwd, const char *ha1,const char *realm);
void linphone_auth_info_set_passwd(LinphoneAuthInfo *info, const char *passwd);
594
void linphone_auth_info_set_username(LinphoneAuthInfo *info, const char *username);
595
void linphone_auth_info_set_userid(LinphoneAuthInfo *info, const char *userid);
596 597 598 599 600

const char *linphone_auth_info_get_username(const LinphoneAuthInfo *i);
const char *linphone_auth_info_get_passwd(const LinphoneAuthInfo *i);
const char *linphone_auth_info_get_userid(const LinphoneAuthInfo *i);

aymeric's avatar
aymeric committed
601 602 603 604
/* you don't need those function*/
void linphone_auth_info_destroy(LinphoneAuthInfo *info);
LinphoneAuthInfo * linphone_auth_info_new_from_config_file(struct _LpConfig *config, int pos);

jehan's avatar
jehan committed
605

606
struct _LinphoneChatRoom;
jehan's avatar
jehan committed
607 608 609 610
/**
 * @addtogroup chatroom
 * @{
 */
611 612 613 614 615 616 617

/**
 * A chat room message to old content to be sent.
 * <br> Can be created by linphone_chat_room_create_message().
 */
typedef struct _LinphoneChatMessage LinphoneChatMessage;
	
jehan's avatar
jehan committed
618 619 620 621
/**
 * A chat room is the place where text messages are exchanged.
 * <br> Can be created by linphone_core_create_chat_room().
 */
aymeric's avatar
aymeric committed
622
typedef struct _LinphoneChatRoom LinphoneChatRoom;
623

jehan's avatar
jehan committed
624 625 626 627 628 629 630 631 632 633 634 635 636
/**
 * Create a new chat room for messaging from a sip uri like sip:joe@sip.linphone.org
 * @param lc #LinphoneCore object
 * @param to destination address for messages
 * @return #LinphoneChatRoom where messaging can take place.
 */
LinphoneChatRoom * linphone_core_create_chat_room(LinphoneCore *lc, const char *to);
/**
 * Destructor
 * @param cr #LinphoneChatRoom object
 */
void linphone_chat_room_destroy(LinphoneChatRoom *cr);

637 638 639 640 641
/**
 * create a message attached to a dedicated chat room;
 */
LinphoneChatMessage* linphone_chat_room_create_message(const LinphoneChatRoom *cr,const char* message);

aymeric's avatar
aymeric committed
642

jehan's avatar
jehan committed
643 644 645 646 647 648 649 650 651 652 653
/**
 * get peer address \link linphone_core_create_chat_room() associated to \endlink this #LinphoneChatRoom
 * @param cr #LinphoneChatRoom object
 * @return #LinphoneAddress peer address
 */
const LinphoneAddress* linphone_chat_room_get_peer_address(LinphoneChatRoom *cr);
/**
 * send a message to peer member of this chat room.
 * @param cr #LinphoneChatRoom object
 * @param msg message to be sent
 */
aymeric's avatar
aymeric committed
654
void linphone_chat_room_send_message(LinphoneChatRoom *cr, const char *msg);
655 656 657 658 659 660 661 662 663 664
/**
 *LinphoneChatMessageStatus used to notify if message has been succesfully delivered or not
 */
typedef enum _LinphoneChatMessageStates {
	LinphoneChatMessageStateIdle, /** initial state*/
	LinphoneChatMessageStateInProgress, /*delivery in progress**/
	LinphoneChatMessageStateDelivered, /** message succesffully delivered an acknoleged by remote end point*/
	LinphoneChatMessageStateNotDelivered /** message was not delivered*/
}LinphoneChatMessageState;

665
	
666 667 668 669
/**
 * to string function
 */
const char* linphone_chat_message_state_to_string(const LinphoneChatMessageState state);
670

671
/**
672 673 674
 * clone a chat message 
 *@param message #LinphoneChatMessage obj
 *@return #LinphoneChatMessage
675
 */
676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710
LinphoneChatMessage* linphone_chat_message_clone(const LinphoneChatMessage* message);
/**
 * set origine of the message
 *@param message #LinphoneChatMessage obj
 *@param from #LinphoneAddress origin of this message (copied)
 */
void linphone_chat_message_set_from(LinphoneChatMessage* message, const LinphoneAddress* from);

/**
 * get origine of the message 
 *@param message #LinphoneChatMessage obj
 *@return #LinphoneAddress
 */
LinphoneAddress* linphone_chat_message_get_from(const LinphoneChatMessage* message);
	
/**
 * Linphone message can carry external body as defined by rfc2017
 * @param message #LinphoneChatMessage
 * @return return external body url null if not present.
 */
const char* linphone_chat_message_get_external_body_url(const LinphoneChatMessage* message);
	
/**
 * Linphone message can carry external body as defined by rfc2017
 * 
 * @param  #LinphoneChatMessage  
 * @param url ex: access-type=URL; URL="http://www.foo.com/file"
 */
void linphone_chat_message_set_external_body_url(LinphoneChatMessage* message,const char* url);

/**
 * get text part of this message
 *@return text or NULL if no text.
 */
const char * linphone_chat_message_get_text(const LinphoneChatMessage* message);	
711 712 713
/**
 * user pointer get function
 */
714

715
void* linphone_chat_message_get_user_data(const LinphoneChatMessage* message);
716 717 718 719
/**
 * user pointer set function
 */
void linphone_chat_message_set_user_data(LinphoneChatMessage* message,void*);
720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735
	
/**
 * Call back used to notify message delivery status
 *@param msg #LinphoneChatMessage object
 *@param status #LinphoneChatMessageStatus
 *@param ud us user data
 */
typedef void (*LinphoneChatMessageStateChangeCb)(LinphoneChatMessage* msg,LinphoneChatMessageState state,void* ud);
/**
 * send a message to peer member of this chat room.
 * @param cr #LinphoneChatRoom object
 * @param msg #LinphoneChatMessage message to be sent
 * @param status_cb #LinphoneChatMessageStatus status call back invoked when to message is delivered or not. May be NULL
 * @param ud user data for the status cb.
 */
void linphone_chat_room_send_message2(LinphoneChatRoom *cr, LinphoneChatMessage* msg,LinphoneChatMessageStateChangeCb status_cb,void* ud);
736 737
LinphoneCore* linphone_chat_room_get_lc(LinphoneChatRoom *cr);
LinphoneChatRoom* linphone_chat_message_get_chat_room(LinphoneChatMessage *msg);
738
char* linphone_chat_message_get_message(LinphoneChatMessage *msg);
739
const LinphoneAddress* linphone_chat_message_get_peer_address(LinphoneChatMessage *msg);
aymeric's avatar
aymeric committed
740 741 742
void linphone_chat_room_set_user_data(LinphoneChatRoom *cr, void * ud);
void * linphone_chat_room_get_user_data(LinphoneChatRoom *cr);

jehan's avatar
jehan committed
743 744 745
/**
 * @}
 */
Simon Morlat's avatar
Simon Morlat committed
746 747 748 749 750 751 752 753 754 755 756


/**
 * @addtogroup initializing
 * @{
**/

/**
 * LinphoneGlobalState describes the global state of the LinphoneCore object.
 * It is notified via the LinphoneCoreVTable::global_state_changed
**/
757 758 759 760 761 762 763
typedef enum _LinphoneGlobalState{
	LinphoneGlobalOff,
	LinphoneGlobalStartup,
	LinphoneGlobalOn,
	LinphoneGlobalShutdown
}LinphoneGlobalState;

764
const char *linphone_global_state_to_string(LinphoneGlobalState gs);
aymeric's avatar
aymeric committed
765

766 767 768 769 770

/**Call state notification callback prototype*/
typedef void (*LinphoneGlobalStateCb)(struct _LinphoneCore *lc, LinphoneGlobalState gstate, const char *message);
/**Call state notification callback prototype*/
typedef void (*LinphoneCallStateCb)(struct _LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *message);
771 772 773
/**Call encryption changed callback prototype*/
typedef void (*CallEncryptionChangedCb)(struct _LinphoneCore *lc, LinphoneCall *call, bool_t on, const char *authentication_token);

774 775 776
/** @ingroup Proxies
 * Registration state notification callback prototype
 * */
777
typedef void (*LinphoneRegistrationStateCb)(struct _LinphoneCore *lc, LinphoneProxyConfig *cfg, LinphoneRegistrationState cstate, const char *message);
smorlat's avatar
smorlat committed
778
/** Callback prototype */
aymeric's avatar
aymeric committed
779
typedef void (*ShowInterfaceCb)(struct _LinphoneCore *lc);
smorlat's avatar
smorlat committed
780
/** Callback prototype */
aymeric's avatar
aymeric committed
781
typedef void (*DisplayStatusCb)(struct _LinphoneCore *lc, const char *message);
smorlat's avatar
smorlat committed
782
/** Callback prototype */
aymeric's avatar
aymeric committed
783
typedef void (*DisplayMessageCb)(struct _LinphoneCore *lc, const char *message);
smorlat's avatar
smorlat committed
784
/** Callback prototype */
aymeric's avatar
aymeric committed
785
typedef void (*DisplayUrlCb)(struct _LinphoneCore *lc, const char *message, const char *url);
smorlat's avatar
smorlat committed
786
/** Callback prototype */
aymeric's avatar
aymeric committed
787
typedef void (*LinphoneCoreCbFunc)(struct _LinphoneCore *lc,void * user_data);
smorlat's avatar
smorlat committed
788
/** Callback prototype */
789
typedef void (*NotifyReceivedCb)(struct _LinphoneCore *lc, LinphoneCall *call, const char *from, const char *event);
jehan's avatar
jehan committed
790 791 792
/**
 * Report status change for a friend previously \link linphone_core_add_friend() added \endlink to #LinphoneCore.
 * @param lc #LinphoneCore object .
793 794 795 796 797 798 799 800 801 802 803 804
 * @param lf Updated #LinphoneFriend .
 */
typedef void (*NotifyPresenceReceivedCb)(struct _LinphoneCore *lc, LinphoneFriend * lf);
/**
 *  Reports that a new subscription request has been received and wait for a decision.
 *  <br> Status on this subscription request is notified by \link linphone_friend_set_inc_subscribe_policy() changing policy \endlink for this friend
 *	@param lc #LinphoneCore object
 *	@param lf #LinphoneFriend corresponding to the subscriber
 *	@param url of the subscriber
 *  Callback prototype
 *  */
typedef void (*NewSubscribtionRequestCb)(struct _LinphoneCore *lc, LinphoneFriend *lf, const char *url);
smorlat's avatar
smorlat committed
805
/** Callback prototype */
aymeric's avatar
aymeric committed
806
typedef void (*AuthInfoRequested)(struct _LinphoneCore *lc, const char *realm, const char *username);
smorlat's avatar
smorlat committed
807
/** Callback prototype */
aymeric's avatar
aymeric committed
808
typedef void (*CallLogUpdated)(struct _LinphoneCore *lc, struct _LinphoneCallLog *newcl);
jehan's avatar
jehan committed
809 810
/**
 * Callback prototype
811
 * @deprecated use #MessageReceived instead.
jehan's avatar
jehan committed
812 813 814 815 816 817 818
 *
 * @param lc #LinphoneCore object
 * @param room #LinphoneChatRoom involved in this conversation. Can be be created by the framework in case \link #LinphoneAddress the from \endlink is not present in any chat room.
 * @param from #LinphoneAddress from
 * @param message incoming message
 *  */
typedef void (*TextMessageReceived)(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from, const char *message);
819 820 821 822 823 824 825 826 827
/**
 * Chat message callback prototype
 *
 * @param lc #LinphoneCore object
 * @param room #LinphoneChatRoom involved in this conversation. Can be be created by the framework in case \link #LinphoneAddress the from \endlink is not present in any chat room.
 * @param LinphoneChatMessage incoming message
 * */
typedef void (*MessageReceived)(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *message);
	
smorlat's avatar
smorlat committed
828
/** Callback prototype */
829
typedef void (*DtmfReceived)(struct _LinphoneCore* lc, LinphoneCall *call, int dtmf);
smorlat's avatar
smorlat committed
830
/** Callback prototype */
831
typedef void (*ReferReceived)(struct _LinphoneCore *lc, const char *refer_to);
smorlat's avatar
smorlat committed
832
/** Callback prototype */
833
typedef void (*BuddyInfoUpdated)(struct _LinphoneCore *lc, LinphoneFriend *lf);
834 835
/** Callback prototype for in progress transfers. The new_call_state is the state of the call resulting of the transfer, at the other party. */
typedef void (*LinphoneTransferStateChanged)(struct _LinphoneCore *lc, LinphoneCall *transfered, LinphoneCallState new_call_state);
Simon Morlat's avatar
Simon Morlat committed
836
/** Callback prototype for receiving quality statistics for calls*/
837
typedef void (*CallStatsUpdated)(struct _LinphoneCore *lc, LinphoneCall *call, const LinphoneCallStats *stats);
838

smorlat's avatar
smorlat committed
839 840
/**
 * This structure holds all callbacks that the application should implement.
841
 *  None is mandatory.
smorlat's avatar
smorlat committed
842
**/
843 844 845 846
typedef struct _LinphoneVTable{
	LinphoneGlobalStateCb global_state_changed; /**<Notifies globlal state changes*/
	LinphoneRegistrationStateCb registration_state_changed;/**<Notifies registration state changes*/
	LinphoneCallStateCb call_state_changed;/**<Notifies call state changes*/
847
	NotifyPresenceReceivedCb notify_presence_recv; /**< Notify received presence events*/
848
	NewSubscribtionRequestCb new_subscription_request; /**< Notify about pending subscription request */
smorlat's avatar
smorlat committed
849 850
	AuthInfoRequested auth_info_requested; /**< Ask the application some authentication information */
	CallLogUpdated call_log_updated; /**< Notifies that call log list has been updated */
851 852
	TextMessageReceived text_received; /** @deprecated, use #message_received instead <br> A text message has been received */
	MessageReceived message_received; /** a message is received, can be text or external body*/
smorlat's avatar
smorlat committed
853
	DtmfReceived dtmf_received; /**< A dtmf has been received received */
Simon Morlat's avatar
Simon Morlat committed
854
	ReferReceived refer_received; /**< An out of call refer was received */
855
	CallEncryptionChangedCb call_encryption_changed; /**<Notifies on change in the encryption of call streams */
856
	LinphoneTransferStateChanged transfer_state_changed; /**<Notifies when a transfer is in progress */
smorlat's avatar
smorlat committed
857
	BuddyInfoUpdated buddy_info_updated; /**< a LinphoneFriend's BuddyInfo has changed*/
858
	NotifyReceivedCb notify_recv; /**< Other notifications*/
Simon Morlat's avatar
Simon Morlat committed
859
	CallStatsUpdated call_stats_updated; /**<Notifies on refreshing of call's statistics. */
Simon Morlat's avatar
Simon Morlat committed
860 861 862 863 864
	DisplayStatusCb display_status; /**< DEPRECATED Callback that notifies various events with human readable text.*/
	DisplayMessageCb display_message;/**< DEPRECATED Callback to display a message to the user */
	DisplayMessageCb display_warning;/**< DEPRECATED Callback to display a warning to the user */
	DisplayUrlCb display_url; /**< DEPRECATED */
	ShowInterfaceCb show; /**< DEPRECATED Notifies the application that it should show up*/
aymeric's avatar
aymeric committed
865 866
} LinphoneCoreVTable;

smorlat's avatar
smorlat committed
867 868 869 870
/**
 * @}
**/

aymeric's avatar
aymeric committed
871 872 873 874 875 876 877 878 879
typedef struct _LCCallbackObj
{
  LinphoneCoreCbFunc _func;
  void * _user_data;
}LCCallbackObj;



typedef enum _LinphoneFirewallPolicy{
880 881
	LinphonePolicyNoFirewall,
	LinphonePolicyUseNatAddress,
882 883
	LinphonePolicyUseStun,
	LinphonePolicyUseIce
aymeric's avatar
aymeric committed
884 885
} LinphoneFirewallPolicy;

886 887 888 889 890 891
typedef enum _LinphoneWaitingState{
	LinphoneWaitingStart,
	LinphoneWaitingProgress,
	LinphoneWaitingFinished
} LinphoneWaitingState;
typedef void * (*LinphoneWaitingCallback)(struct _LinphoneCore *lc, void *context, LinphoneWaitingState ws, const char *purpose, float progress);
892

aymeric's avatar
aymeric committed
893 894 895 896 897 898

/* THE main API */

void linphone_core_enable_logs(FILE *file);
void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc);
void linphone_core_disable_logs(void);
smorlat's avatar
smorlat committed
899 900
/*sets the user-agent string in sip messages, must be set before linphone_core_new() or linphone_core_init() */
void linphone_core_set_user_agent(const char *ua_name, const char *version);
aymeric's avatar
aymeric committed
901 902 903
const char *linphone_core_get_version(void);

LinphoneCore *linphone_core_new(const LinphoneCoreVTable *vtable,
904
						const char *config_path, const char *factory_config, void* userdata);
aymeric's avatar
aymeric committed
905 906

/* function to be periodically called in a main loop */
907
/* For ICE to work properly it should be called every 20ms */
aymeric's avatar
aymeric committed
908
void linphone_core_iterate(LinphoneCore *lc);
jehan's avatar
jehan committed
909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926
#if 0 /*not implemented yet*/
/**
 * @ingroup initializing
 * Provide Linphone Core with an unique identifier. This be later used to identified contact address coming from this device.
 * Value is not saved.
 * @param lc object
 * @param string identifying the device, can be EMEI or UDID
 *
 */
void linphone_core_set_device_identifier(LinphoneCore *lc,const char* device_id);
/**
 * @ingroup initializing
 * get Linphone unique identifier
 *
 */
const char*  linphone_core_get_device_identifier(const LinphoneCore *lc);

#endif
aymeric's avatar
aymeric committed
927

928 929
LinphoneAddress * linphone_core_interpret_url(LinphoneCore *lc, const char *url);

930
LinphoneCall * linphone_core_invite(LinphoneCore *lc, const char *url);
aymeric's avatar
aymeric committed
931

932
LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddress *addr);
933

934 935 936 937
LinphoneCall * linphone_core_invite_with_params(LinphoneCore *lc, const char *url, const LinphoneCallParams *params);

LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const LinphoneAddress *addr, const LinphoneCallParams *params);

938
int linphone_core_transfer_call(LinphoneCore *lc, LinphoneCall *call, const char *refer_to);
aymeric's avatar
aymeric committed
939

940 941
int linphone_core_transfer_call_to_another(LinphoneCore *lc, LinphoneCall *call, LinphoneCall *dest);

aymeric's avatar
aymeric committed
942 943 944 945
bool_t linphone_core_inc_invite_pending(LinphoneCore*lc);

bool_t linphone_core_in_call(const LinphoneCore *lc);

946
LinphoneCall *linphone_core_get_current_call(const LinphoneCore *lc);
947

948 949
int linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call);

950 951
int linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params);

952
int linphone_core_terminate_call(LinphoneCore *lc, LinphoneCall *call);
953

954 955
int linphone_core_redirect_call(LinphoneCore *lc, LinphoneCall *call, const char *redirect_uri);

956
int linphone_core_terminate_all_calls(LinphoneCore *lc);
aymeric's avatar
aymeric committed
957

958 959
int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *call);

960 961
int linphone_core_pause_all_calls(LinphoneCore *lc);

962
int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *call);
aymeric's avatar
aymeric committed
963

964
int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params);
965 966 967 968

int linphone_core_defer_call_update(LinphoneCore *lc, LinphoneCall *call);

int linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params);
969 970 971

LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *lc);

972
LinphoneCall *linphone_core_get_call_by_remote_address(LinphoneCore *lc, const char *remote_address);
aymeric's avatar
aymeric committed
973 974 975 976 977 978 979

void linphone_core_send_dtmf(LinphoneCore *lc,char dtmf);

int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact);

const char *linphone_core_get_primary_contact(LinphoneCore *lc);

980 981
const char * linphone_core_get_identity(LinphoneCore *lc);

aymeric's avatar
aymeric committed
982 983 984 985 986 987
void linphone_core_set_guess_hostname(LinphoneCore *lc, bool_t val);
bool_t linphone_core_get_guess_hostname(LinphoneCore *lc);

bool_t linphone_core_ipv6_enabled(LinphoneCore *lc);
void linphone_core_enable_ipv6(LinphoneCore *lc, bool_t val);

988
LinphoneAddress *linphone_core_get_primary_contact_parsed(LinphoneCore *lc);
jehan's avatar
jehan committed
989
const char * linphone_core_get_identity(LinphoneCore *lc);
aymeric's avatar
aymeric committed
990 991 992 993 994 995
/*0= no bandwidth limit*/
void linphone_core_set_download_bandwidth(LinphoneCore *lc, int bw);
void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw);

int linphone_core_get_download_bandwidth(const LinphoneCore *lc);
int linphone_core_get_upload_bandwidth(const LinphoneCore *lc);
996 997 998

void linphone_core_enable_adaptive_rate_control(LinphoneCore *lc, bool_t enabled);
bool_t linphone_core_adaptive_rate_control_enabled(const LinphoneCore *lc);
jehan's avatar
jehan committed
999
/**
1000
 * set audio packetization time linphone expect to receive from peer
jehan's avatar
jehan committed
1001 1002 1003 1004 1005
 * @ingroup media_parameters
 *
 */
void linphone_core_set_download_ptime(LinphoneCore *lc, int ptime);
/**
1006
 * get audio packetization time linphone expect to receive from peer, 0 means unspecified
jehan's avatar
jehan committed
1007 1008 1009
 * @ingroup media_parameters
 */
int  linphone_core_get_download_ptime(LinphoneCore *lc);
aymeric's avatar
aymeric committed
1010

Simon Morlat's avatar
Simon Morlat committed
1011 1012 1013 1014
void linphone_core_set_upload_ptime(LinphoneCore *lc, int ptime);

int linphone_core_get_upload_ptime(LinphoneCore *lc);

aymeric's avatar
aymeric committed
1015 1016 1017 1018 1019 1020 1021 1022 1023
/* returns a MSList of PayloadType */
const MSList *linphone_core_get_audio_codecs(const LinphoneCore *lc);

int linphone_core_set_audio_codecs(LinphoneCore *lc, MSList *codecs);
/* returns a MSList of PayloadType */
const MSList *linphone_core_get_video_codecs(const LinphoneCore *lc);

int linphone_core_set_video_codecs(LinphoneCore *lc, MSList *codecs);

1024
bool_t linphone_core_payload_type_enabled(LinphoneCore *lc, const PayloadType *pt);
1025 1026 1027

int linphone_core_enable_payload_type(LinphoneCore *lc, PayloadType *pt, bool_t enable);

1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047
/**
 * Wildcard value used by #linphone_core_find_payload_type to ignore rate in search algirithm
 * @ingroup media_parameters
 */
#define LINPHONE_FIND_PAYLOAD_IGNORE_RATE -1
/**
 * Wildcard value used by #linphone_core_find_payload_type to ignore channel in search algirithm
 * @ingroup media_parameters
 */
#define LINPHONE_FIND_PAYLOAD_IGNORE_CHANNELS -1
/**
 * Get payload type  from mime type and clock rate
 * @ingroup media_parameters
 * This function searches in audio and video codecs for the given payload type name and clockrate.
 * @param lc #LinphoneCore object
 * @param type payload mime type (I.E SPEEX, PCMU, VP8)
 * @param rate, can be #LINPHONE_FIND_PAYLOAD_IGNORE_RATE
 * @param channels, number of channels, can be #LINPHONE_FIND_PAYLOAD_IGNORE_CHANNELS
 * @return Returns NULL if not found.
 */	
1048
PayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char* type, int rate, int channels) ;
jehan's avatar
jehan committed
1049

1050
int linphone_core_get_payload_type_number(LinphoneCore *lc, const PayloadType *pt);
1051

1052 1053
const char *linphone_core_get_payload_type_description(LinphoneCore *lc, PayloadType *pt);

aymeric's avatar
aymeric committed
1054 1055
bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, PayloadType *pt);

1056 1057 1058 1059 1060 1061 1062 1063
/**
 * @ingroup proxy 
 *Create a proxy config with default value from Linphone core.
 *@param lc #LinphoneCore object
 *@return #LinphoneProxyConfig with defualt value set 
 */
LinphoneProxyConfig * linphone_core_create_proxy_config(LinphoneCore *lc);
	
aymeric's avatar
aymeric committed
1064 1065
int linphone_core_add_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *config);

1066 1067
void linphone_core_clear_proxy_config(LinphoneCore *lc);

aymeric's avatar
aymeric committed
1068 1069 1070 1071 1072 1073 1074 1075 1076 1077
void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *config);

const MSList *linphone_core_get_proxy_config_list(const LinphoneCore *lc);

void linphone_core_set_default_proxy(LinphoneCore *lc, LinphoneProxyConfig *config);

void linphone_core_set_default_proxy_index(LinphoneCore *lc, int index);

int linphone_core_get_default_proxy(LinphoneCore *lc, LinphoneProxyConfig **config);

1078
void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info);
aymeric's avatar
aymeric committed
1079

1080
void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info);
aymeric's avatar
aymeric committed
1081

smorlat's avatar
smorlat committed
1082 1083
const MSList *linphone_core_get_auth_info_list(const LinphoneCore *lc);

1084
const LinphoneAuthInfo *linphone_core_find_auth_info(LinphoneCore *lc, const char *realm, const char *username);
smorlat's avatar
smorlat committed
1085

aymeric's avatar
aymeric committed
1086 1087 1088 1089
void linphone_core_abort_authentication(LinphoneCore *lc,  LinphoneAuthInfo *info);

void linphone_core_clear_all_auth_info(LinphoneCore *lc);

1090 1091 1092 1093
void linphone_core_enable_audio_adaptive_jittcomp(LinphoneCore *lc, bool_t enable);

bool_t linphone_core_audio_adaptive_jittcomp_enabled(LinphoneCore *lc);

aymeric's avatar
aymeric committed
1094 1095 1096
int linphone_core_get_audio_jittcomp(LinphoneCore *lc);

void linphone_core_set_audio_jittcomp(LinphoneCore *lc, int value);
1097 1098 1099 1100 1101 1102 1103 1104

void linphone_core_enable_video_adaptive_jittcomp(LinphoneCore *lc, bool_t enable);

bool_t linphone_core_video_adaptive_jittcomp_enabled(LinphoneCore *lc);

int linphone_core_get_video_jittcomp(LinphoneCore *lc);

void linphone_core_set_video_jittcomp(LinphoneCore *lc, int value);
aymeric's avatar
aymeric committed
1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121

int linphone_core_get_audio_port(const LinphoneCore *lc);

int linphone_core_get_video_port(const LinphoneCore *lc);

int linphone_core_get_nortp_timeout(const LinphoneCore *lc);

void linphone_core_set_audio_port(LinphoneCore *lc, int port);

void linphone_core_set_video_port(LinphoneCore *lc, int port);

void linphone_core_set_nortp_timeout(LinphoneCore *lc, int port);

void linphone_core_set_use_info_for_dtmf(LinphoneCore *lc, bool_t use_info);

bool_t linphone_core_get_use_info_for_dtmf(LinphoneCore *lc);

1122 1123 1124 1125
void linphone_core_set_use_rfc2833_for_dtmf(LinphoneCore *lc,bool_t use_rfc2833);

bool_t linphone_core_get_use_rfc2833_for_dtmf(LinphoneCore *lc);

1126 1127
void linphone_core_set_sip_port(LinphoneCore *lc, int port);

aymeric's avatar
aymeric committed
1128 1129
int linphone_core_get_sip_port(LinphoneCore *lc);

1130 1131 1132
int linphone_core_set_sip_transports(LinphoneCore *lc, const LCSipTransports *transports);

int linphone_core_get_sip_transports(LinphoneCore *lc, LCSipTransports *transports);
jehan's avatar
jehan committed
1133
/**
1134
 *
jehan's avatar
jehan committed
1135 1136 1137 1138
 * Give access to the UDP sip socket. Can be useful to configure this socket as persistent I.E kCFStreamNetworkServiceType set to kCFStreamNetworkServiceTypeVoIP)
 * @param lc #LinphoneCore
 * @return socket file descriptor
 */
1139 1140
ortp_socket_t linphone_core_get_sip_socket(LinphoneCore *lc);

aymeric's avatar
aymeric committed
1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161
void linphone_core_set_inc_timeout(LinphoneCore *lc, int seconds);

int linphone_core_get_inc_timeout(LinphoneCore *lc);

void linphone_core_set_stun_server(LinphoneCore *lc, const char *server);

const char * linphone_core_get_stun_server(const LinphoneCore *lc);

void linphone_core_set_nat_address(LinphoneCore *lc, const char *addr);

const char *linphone_core_get_nat_address(const LinphoneCore *lc);

void linphone_core_set_firewall_policy(LinphoneCore *lc, LinphoneFirewallPolicy pol);

LinphoneFirewallPolicy linphone_core_get_firewall_policy(const LinphoneCore *lc);

const char * linphone_core_get_relay_addr(const LinphoneCore *lc);

int linphone_core_set_relay_addr(LinphoneCore *lc, const char *addr);

/* sound functions */
1162
/* returns a null terminated static array of string describing the sound devices */
aymeric's avatar
aymeric committed
1163
const char**  linphone_core_get_sound_devices(LinphoneCore *lc);
1164
void linphone_core_reload_sound_devices(LinphoneCore *lc);
smorlat's avatar
smorlat committed
1165 1166
bool_t linphone_core_sound_device_can_capture(LinphoneCore *lc, const char *device);
bool_t linphone_core_sound_device_can_playback(LinphoneCore *lc, const char *device);
aymeric's avatar
aymeric committed
1167 1168 1169 1170 1171
int linphone_core_get_ring_level(LinphoneCore *lc);
int linphone_core_get_play_level(LinphoneCore *lc);
int linphone_core_get_rec_level(LinphoneCore *lc);
void linphone_core_set_ring_level(LinphoneCore *lc, int level);
void linphone_core_set_play_level(LinphoneCore *lc, int level);
1172 1173 1174 1175

void linphone_core_set_playback_gain_db(LinphoneCore *lc, float level);

float linphone_core_get_playback_gain_db(LinphoneCore *lc);
aymeric's avatar
aymeric committed
1176 1177 1178 1179 1180 1181 1182 1183 1184 1185
void linphone_core_set_rec_level(LinphoneCore *lc, int level);
const char * linphone_core_get_ringer_device(LinphoneCore *lc);
const char * linphone_core_get_playback_device(LinphoneCore *lc);
const char * linphone_core_get_capture_device(LinphoneCore *lc);
int linphone_core_set_ringer_device(LinphoneCore *lc, const char * devid);
int linphone_core_set_playback_device(LinphoneCore *lc, const char * devid);
int linphone_core_set_capture_device(LinphoneCore *lc, const char * devid);
char linphone_core_get_sound_source(LinphoneCore *lc);
void linphone_core_set_sound_source(LinphoneCore *lc, char source);
void linphone_core_set_ring(LinphoneCore *lc, const char *path);
1186
const char *linphone_core_get_ring(const LinphoneCore *lc);
1187
void linphone_core_verify_server_certificates(LinphoneCore *lc, bool_t yesno);
1188
void linphone_core_set_root_ca(LinphoneCore *lc, const char *path);
1189 1190
void linphone_core_set_ringback(LinphoneCore *lc, const char *path);
const char * linphone_core_get_ringback(const LinphoneCore *lc);
1191

1192 1193
void linphone_core_set_remote_ringback_tone(LinphoneCore *lc,const char *);
const char *linphone_core_get_remote_ringback_tone(const LinphoneCore *lc);
1194

aymeric's avatar
aymeric committed
1195
int linphone_core_preview_ring(LinphoneCore *lc, const char *ring,LinphoneCoreCbFunc func,void * userdata);
1196 1197
void linphone_core_enable_echo_cancellation(LinphoneCore *lc, bool_t val);
bool_t linphone_core_echo_cancellation_enabled(LinphoneCore *lc);
aymeric's avatar
aymeric committed
1198

smorlat's avatar
smorlat committed
1199 1200 1201
void linphone_core_enable_echo_limiter(LinphoneCore *lc, bool_t val);
bool_t linphone_core_echo_limiter_enabled(const LinphoneCore *lc);

1202 1203 1204
void linphone_core_enable_agc(LinphoneCore *lc, bool_t val);
bool_t linphone_core_agc_enabled(const LinphoneCore *lc);

smorlat's avatar
smorlat committed
1205
void linphone_core_mute_mic(LinphoneCore *lc, bool_t muted);
1206 1207 1208 1209 1210 1211
/**
 * return mic state.
 *
 * @ingroup media_parameters
**/
bool_t linphone_core_is_mic_muted(LinphoneCore *lc);
smorlat's avatar
smorlat committed
1212

Simon Morlat's avatar
Simon Morlat committed
1213 1214 1215 1216 1217 1218
bool_t linphone_core_is_audio_muted(LinphoneCore *lc);
bool_t linphone_core_is_rtp_muted(LinphoneCore *lc);

bool_t linphone_core_get_rtp_no_xmit_on_audio_mute(const LinphoneCore *lc);
void linphone_core_set_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, bool_t val);

aymeric's avatar
aymeric committed
1219 1220

/* returns a list of LinphoneCallLog */
1221
const MSList * linphone_core_get_call_logs(LinphoneCore *lc);
1222
void linphone_core_clear_call_logs(LinphoneCore *lc);
1223
int linphone_core_get_missed_calls_count(LinphoneCore *lc);
1224
void linphone_core_reset_missed_calls_count(LinphoneCore *lc);
Simon Morlat's avatar
Simon Morlat committed
1225
void linphone_core_remove_call_log(LinphoneCore *lc, LinphoneCallLog *call_log);
aymeric's avatar
aymeric committed
1226 1227

/* video support */
1228
bool_t linphone_core_video_supported(LinphoneCore *lc);
aymeric's avatar
aymeric committed
1229 1230
void linphone_core_enable_video(LinphoneCore *lc, bool_t vcap_enabled, bool_t display_enabled);
bool_t linphone_core_video_enabled(LinphoneCore *lc);
1231 1232
void linphone_core_set_video_policy(LinphoneCore *lc, const LinphoneVideoPolicy *policy);
const LinphoneVideoPolicy *linphone_core_get_video_policy(LinphoneCore *lc);
aymeric's avatar
aymeric committed
1233

smorlat's avatar
smorlat committed
1234 1235 1236 1237 1238 1239 1240 1241 1242
typedef struct MSVideoSizeDef{
	MSVideoSize vsize;
	const char *name;
}MSVideoSizeDef;
/* returns a zero terminated table of MSVideoSizeDef*/
const MSVideoSizeDef *linphone_core_get_supported_video_sizes(LinphoneCore *lc);
void linphone_core_set_preferred_video_size(LinphoneCore *lc, MSVideoSize vsize);
MSVideoSize linphone_core_get_preferred_video_size(LinphoneCore *lc);
void linphone_core_set_preferred_video_size_by_name(LinphoneCore *lc, const char *name);
aymeric's avatar
aymeric committed
1243 1244 1245 1246

void linphone_core_enable_video_preview(LinphoneCore *lc, bool_t val);
bool_t linphone_core_video_preview_enabled(const LinphoneCore *lc);

smorlat's avatar
smorlat committed
1247 1248
void linphone_core_enable_self_view(LinphoneCore *lc, bool_t val);
bool_t linphone_core_self_view_enabled(const LinphoneCore *lc);
aymeric's avatar
aymeric committed
1249 1250


1251
/* returns a null terminated static array of string describing the webcams */
1252
void linphone_core_reload_video_devices(LinphoneCore *lc);
aymeric's avatar
aymeric committed
1253 1254 1255 1256
const char**  linphone_core_get_video_devices(const LinphoneCore *lc);
int linphone_core_set_video_device(LinphoneCore *lc, const char *id);
const char *linphone_core_get_video_device(const LinphoneCore *lc);

1257 1258 1259
/* Set static picture to be used when "Static picture" is the video device */
int linphone_core_set_static_picture(LinphoneCore *lc, const char *path);

1260 1261 1262 1263
/* Set and get frame rate for static picture */
int linphone_core_set_static_picture_fps(LinphoneCore *lc, float fps);
float linphone_core_get_static_picture_fps(LinphoneCore *lc);

1264 1265
/*function to be used for eventually setting window decorations (icons, title...)*/
unsigned long linphone_core_get_native_video_window_id(const LinphoneCore *lc);
1266
void linphone_core_set_native_video_window_id(LinphoneCore *lc, unsigned long id);
smorlat's avatar
smorlat committed
1267

1268 1269 1270 1271
unsigned long linphone_core_get_native_preview_window_id(const LinphoneCore *lc);
void linphone_core_set_native_preview_window_id(LinphoneCore *lc, unsigned long id);

void linphone_core_use_preview_window(LinphoneCore *lc, bool_t yesno);
1272
int linphone_core_get_device_rotation(LinphoneCore *lc );
1273
void linphone_core_set_device_rotation(LinphoneCore *lc, int rotation);
smorlat's avatar
smorlat committed
1274

1275 1276 1277
/* start or stop streaming video in case of embedded window */
void linphone_core_show_video(LinphoneCore *lc, bool_t show);

smorlat's avatar
smorlat committed
1278 1279 1280 1281 1282
/*play/record support: use files instead of soundcard*/
void linphone_core_use_files(LinphoneCore *lc, bool_t yesno);
void linphone_core_set_play_file(LinphoneCore *lc, const char *file);
void linphone_core_set_record_file(LinphoneCore *lc, const char *file);

1283
void linphone_core_play_dtmf(LinphoneCore *lc, char dtmf, int duration_ms);
1284 1285
void linphone_core_stop_dtmf(LinphoneCore *lc);

smorlat's avatar
smorlat committed
1286
int linphone_core_get_current_call_duration(const LinphoneCore *lc);
jehan's avatar
jehan committed
1287

smorlat's avatar
smorlat committed
1288

aymeric's avatar
aymeric committed
1289 1290
int linphone_core_get_mtu(const LinphoneCore *lc);
void linphone_core_set_mtu(LinphoneCore *lc, int mtu);
1291

1292
/**
jehan's avatar
jehan committed
1293
 * @ingroup network_parameters
1294
 * This method is called by the application to notify the linphone core library when network is reachable.
Simon Morlat's avatar
Simon Morlat committed
1295 1296
 * Calling this method with true trigger linphone to initiate a registration process for all proxies.
 * Calling this method disables the automatic network detection mode. It means you must call this method after each network state changes.
1297 1298
 */
void linphone_core_set_network_reachable(LinphoneCore* lc,bool_t value);
1299
/**
jehan's avatar
jehan committed
1300
 * @ingroup network_parameters
Simon Morlat's avatar
Simon Morlat committed
1301
 * return network state either as positioned by the application or by linphone itself.
1302
 */
Simon Morlat's avatar
Simon Morlat committed
1303
bool_t linphone_core_is_network_reachable(LinphoneCore* lc);
1304

1305
/**
jehan's avatar
jehan committed
1306
 *  @ingroup network_parameters
1307 1308 1309 1310
 *  enable signaling keep alive. small udp packet sent periodically to keep udp NAT association
 */
void linphone_core_enable_keep_alive(LinphoneCore* lc,bool_t enable);
/**
jehan's avatar
jehan committed
1311
 *  @ingroup network_parameters
1312 1313 1314
 * Is signaling keep alive
 */
bool_t linphone_core_keep_alive_enabled(LinphoneCore* lc);
aymeric's avatar
aymeric committed
1315 1316

void *linphone_core_get_user_data(LinphoneCore *lc);
1317
void linphone_core_set_user_data(LinphoneCore *lc, void *userdata);
aymeric's avatar
aymeric committed
1318 1319 1320 1321 1322

/* returns LpConfig object to read/write to the config file: usefull if you wish to extend
the config file with your own sections */
struct _LpConfig *linphone_core_get_config(LinphoneCore *lc);

1323
/*set a callback for some blocking operations, it takes you informed of the progress of the operation*/
1324
void linphone_core_set_waiting_callback(LinphoneCore *lc, LinphoneWaitingCallback cb, void *user_context);
1325

smorlat's avatar
smorlat committed
1326 1327 1328
/*returns the list of registered SipSetup (linphonecore plugins) */
const MSList * linphone_core_get_sip_setups(LinphoneCore *lc);

aymeric's avatar
aymeric committed
1329 1330
void linphone_core_destroy(LinphoneCore *lc);

1331
/*for advanced users:*/
Guillaume Beraudo's avatar
Guillaume Beraudo committed
1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343
typedef RtpTransport * (*LinphoneRtpTransportFactoryFunc)(void *data, int port);
struct _LinphoneRtpTransportFactories{
	LinphoneRtpTransportFactoryFunc audio_rtp_func;
	void *audio_rtp_func_data;
	LinphoneRtpTransportFactoryFunc audio_rtcp_func;
	void *audio_rtcp_func_data;
	LinphoneRtpTransportFactoryFunc video_rtp_func;
	void *video_rtp_func_data;
	LinphoneRtpTransportFactoryFunc video_rtcp_func;
	void *video_rtcp_func_data;
};
typedef struct _LinphoneRtpTransportFactories LinphoneRtpTransportFactories;
1344

Guillaume Beraudo's avatar
Guillaume Beraudo committed
1345
void linphone_core_set_rtp_transport_factories(LinphoneCore* lc, LinphoneRtpTransportFactories *factories);
1346

1347 1348
int linphone_core_get_current_call_stats(LinphoneCore *lc, rtp_stats_t *local, rtp_stats_t *remote);

1349 1350
int linphone_core_get_calls_nb(const LinphoneCore *lc);

Simon Morlat's avatar
Simon Morlat committed
1351 1352
const MSList *linphone_core_get_calls(LinphoneCore *lc);

1353
LinphoneGlobalState linphone_core_get_global_state(const LinphoneCore *lc);
1354 1355 1356 1357
/**
 * force registration refresh to be initiated upon next iterate
 * @ingroup proxies
 */
1358
void linphone_core_refresh_registers(LinphoneCore* lc);
1359

1360 1361 1362 1363
/* Path to the file storing secrets cache */
void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file);


1364 1365
const LinphoneCall* linphone_core_find_call_from_uri(LinphoneCore *lc, const char *uri);

Simon Morlat's avatar
Simon Morlat committed
1366
int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call);
1367
int linphone_core_add_all_to_conference(LinphoneCore *lc);
Simon Morlat's avatar
Simon Morlat committed
1368
int linphone_core_remove_from_conference(LinphoneCore *lc, LinphoneCall *call);
1369 1370 1371
bool_t linphone_core_is_in_conference(const LinphoneCore *lc);
int linphone_core_enter_conference(LinphoneCore *lc);
int linphone_core_leave_conference(LinphoneCore *lc);
1372
float linphone_core_get_conference_local_input_volume(LinphoneCore *lc);
1373

1374 1375
int linphone_core_terminate_conference(LinphoneCore *lc);
int linphone_core_get_conference_size(LinphoneCore *lc);