linphonecore.h 69.1 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

jehan's avatar
jehan committed
36 37
#ifndef LINPHONE_PUBLIC
	#define LINPHONE_PUBLIC MS2_PUBLIC
38 39
#endif

aymeric's avatar
aymeric committed
40 41 42 43 44
#ifdef __cplusplus
extern "C" {
#endif

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

struct _LpConfig;

53

jehan's avatar
jehan committed
54 55 56 57 58
/**
 * Linphone core SIP transport ports.
 * Use with #linphone_core_set_sip_transports
 * @ingroup initializing
 */
59
typedef struct _LCSipTransports{
jehan's avatar
jehan committed
60 61 62
	/**
	 * udp port to listening on, negative value if not set
	 * */
63
	int udp_port;
jehan's avatar
jehan committed
64 65 66
	/**
	 * tcp port to listening on, negative value if not set
	 * */
67
	int tcp_port;
jehan's avatar
jehan committed
68 69 70
	/**
	 * dtls port to listening on, negative value if not set
	 * */
71
	int dtls_port;
jehan's avatar
jehan committed
72 73 74
	/**
	 * tls port to listening on, negative value if not set
	 * */
75
	int tls_port;
76 77
} LCSipTransports;

78

smorlat's avatar
smorlat committed
79 80 81 82 83 84 85 86 87 88
/**
 * 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.
89
 *
smorlat's avatar
smorlat committed
90 91 92
 * @ingroup linphone_address
 * @var LinphoneAddress
 */
93
typedef struct SalAddress LinphoneAddress;
94 95 96 97 98
#ifdef IN_LINPHONE
#include "linphonefriend.h"
#else
#include "linphone/linphonefriend.h"
#endif
99

100
LINPHONE_PUBLIC	LinphoneAddress * linphone_address_new(const char *uri);
101 102
LinphoneAddress * linphone_address_clone(const LinphoneAddress *uri);
const char *linphone_address_get_scheme(const LinphoneAddress *u);
103 104 105
LINPHONE_PUBLIC	const char *linphone_address_get_display_name(const LinphoneAddress* u);
LINPHONE_PUBLIC	const char *linphone_address_get_username(const LinphoneAddress *u);
LINPHONE_PUBLIC	const char *linphone_address_get_domain(const LinphoneAddress *u);
jehan's avatar
jehan committed
106 107 108 109
/**
 * Get port number as an integer value.
 *
 */
Ghislain MARY's avatar
Ghislain MARY committed
110
LINPHONE_PUBLIC int linphone_address_get_port_int(const LinphoneAddress *u);
jehan's avatar
jehan committed
111 112 113
/**
 * Get port number, null if not present.
 */
114
LINPHONE_PUBLIC	const char* linphone_address_get_port(const LinphoneAddress *u);
115 116 117
LINPHONE_PUBLIC	void linphone_address_set_display_name(LinphoneAddress *u, const char *display_name);
LINPHONE_PUBLIC	void linphone_address_set_username(LinphoneAddress *uri, const char *username);
LINPHONE_PUBLIC	void linphone_address_set_domain(LinphoneAddress *uri, const char *host);
118 119
LINPHONE_PUBLIC	void linphone_address_set_port(LinphoneAddress *uri, const char *port);
LINPHONE_PUBLIC	void linphone_address_set_port_int(LinphoneAddress *uri, int port);
120
/*remove tags, params etc... so that it is displayable to the user*/
121 122
LINPHONE_PUBLIC	void linphone_address_clean(LinphoneAddress *uri);
LINPHONE_PUBLIC	char *linphone_address_as_string(const LinphoneAddress *u);
Sylvain Berfini's avatar
Sylvain Berfini committed
123
LINPHONE_PUBLIC	char *linphone_address_as_string_uri_only(const LinphoneAddress *u);
124 125
LINPHONE_PUBLIC	bool_t linphone_address_weak_equal(const LinphoneAddress *a1, const LinphoneAddress *a2);
LINPHONE_PUBLIC	void linphone_address_destroy(LinphoneAddress *u);
aymeric's avatar
aymeric committed
126

smorlat's avatar
smorlat committed
127
struct _SipSetupContext;
128

aymeric's avatar
aymeric committed
129

smorlat's avatar
smorlat committed
130 131 132 133 134 135 136 137
/**
 * Enum representing the direction of a call.
 * @ingroup call_logs
**/
enum _LinphoneCallDir {
	LinphoneCallOutgoing, /**< outgoing calls*/
	LinphoneCallIncoming  /**< incoming calls*/
};
aymeric's avatar
aymeric committed
138

smorlat's avatar
smorlat committed
139 140 141 142 143
/**
 * Typedef for enum
 * @ingroup call_logs
**/
typedef enum _LinphoneCallDir LinphoneCallDir;
aymeric's avatar
aymeric committed
144

smorlat's avatar
smorlat committed
145 146 147 148
/**
 * Enum representing the status of a call
 * @ingroup call_logs
**/
149
typedef enum _LinphoneCallStatus {
smorlat's avatar
smorlat committed
150 151
	LinphoneCallSuccess, /**< The call was sucessful*/
	LinphoneCallAborted, /**< The call was aborted */
152 153
	LinphoneCallMissed, /**< The call was missed (unanswered)*/
	LinphoneCallDeclined /**< The call was declined, either locally or by remote end*/
aymeric's avatar
aymeric committed
154 155
} LinphoneCallStatus;

smorlat's avatar
smorlat committed
156 157 158 159
/**
 * Structure representing a call log.
 *
 * @ingroup call_logs
160
 *
smorlat's avatar
smorlat committed
161
**/
162
typedef struct _LinphoneCallLog LinphoneCallLog;
Simon Morlat's avatar
Simon Morlat committed
163 164 165 166

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

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

/*public: */
Sylvain Berfini's avatar
Sylvain Berfini committed
179 180 181 182 183 184 185 186 187 188 189
LINPHONE_PUBLIC	LinphoneAddress *linphone_call_log_get_from(LinphoneCallLog *cl);
LINPHONE_PUBLIC	LinphoneAddress *linphone_call_log_get_to(LinphoneCallLog *cl);
LINPHONE_PUBLIC	LinphoneAddress *linphone_call_log_get_remote_address(LinphoneCallLog *cl);
LINPHONE_PUBLIC	LinphoneCallDir linphone_call_log_get_dir(LinphoneCallLog *cl);
LINPHONE_PUBLIC	LinphoneCallStatus linphone_call_log_get_status(LinphoneCallLog *cl);
LINPHONE_PUBLIC	LinphoneCallStatus linphone_call_log_video_enabled(LinphoneCallLog *cl);
LINPHONE_PUBLIC	time_t linphone_call_log_get_start_date(LinphoneCallLog *cl);
LINPHONE_PUBLIC	int linphone_call_log_get_duration(LinphoneCallLog *cl);
LINPHONE_PUBLIC	float linphone_call_log_get_quality(LinphoneCallLog *cl);
LINPHONE_PUBLIC	void linphone_call_log_set_user_pointer(LinphoneCallLog *cl, void *up);
LINPHONE_PUBLIC	void *linphone_call_log_get_user_pointer(const LinphoneCallLog *cl);
190 191
void linphone_call_log_set_ref_key(LinphoneCallLog *cl, const char *refkey);
const char *linphone_call_log_get_ref_key(const LinphoneCallLog *cl);
192 193
LINPHONE_PUBLIC	const rtp_stats_t *linphone_call_log_get_local_stats(const LinphoneCallLog *cl);
LINPHONE_PUBLIC	const rtp_stats_t *linphone_call_log_get_remote_stats(const LinphoneCallLog *cl);
Sylvain Berfini's avatar
Sylvain Berfini committed
194 195
LINPHONE_PUBLIC	const char *linphone_call_log_get_call_id(const LinphoneCallLog *cl);
LINPHONE_PUBLIC	char * linphone_call_log_to_str(LinphoneCallLog *cl);
aymeric's avatar
aymeric committed
196

Simon Morlat's avatar
Simon Morlat committed
197
struct _LinphoneCallParams;
198

199
/**
Guillaume Beraudo's avatar
Guillaume Beraudo committed
200
 * The LinphoneCallParams is an object containing various call related parameters.
201
 * It can be used to retrieve parameters from a currently running call or modify the call's characteristics
202 203 204 205
 * dynamically.
**/
typedef struct _LinphoneCallParams LinphoneCallParams;

206 207
LINPHONE_PUBLIC	const PayloadType* linphone_call_params_get_used_audio_codec(const LinphoneCallParams *cp);
LINPHONE_PUBLIC	const PayloadType* linphone_call_params_get_used_video_codec(const LinphoneCallParams *cp);
208 209 210
LINPHONE_PUBLIC	LinphoneCallParams * linphone_call_params_copy(const LinphoneCallParams *cp);
LINPHONE_PUBLIC	void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabled);
LINPHONE_PUBLIC	bool_t linphone_call_params_video_enabled(const LinphoneCallParams *cp);
211 212 213 214 215 216 217 218 219 220 221 222 223
LINPHONE_PUBLIC	LinphoneMediaEncryption linphone_call_params_get_media_encryption(const LinphoneCallParams *cp);
LINPHONE_PUBLIC	void linphone_call_params_set_media_encryption(LinphoneCallParams *cp, LinphoneMediaEncryption e);
LINPHONE_PUBLIC	void linphone_call_params_enable_early_media_sending(LinphoneCallParams *cp, bool_t enabled);
LINPHONE_PUBLIC	bool_t linphone_call_params_early_media_sending_enabled(const LinphoneCallParams *cp);
LINPHONE_PUBLIC	bool_t linphone_call_params_local_conference_mode(const LinphoneCallParams *cp);
LINPHONE_PUBLIC	void linphone_call_params_set_audio_bandwidth_limit(LinphoneCallParams *cp, int bw);
LINPHONE_PUBLIC	void linphone_call_params_destroy(LinphoneCallParams *cp);
LINPHONE_PUBLIC	bool_t linphone_call_params_low_bandwidth_enabled(const LinphoneCallParams *cp);
LINPHONE_PUBLIC	void linphone_call_params_enable_low_bandwidth(LinphoneCallParams *cp, bool_t enabled);
LINPHONE_PUBLIC	void linphone_call_params_set_record_file(LinphoneCallParams *cp, const char *path);
LINPHONE_PUBLIC	const char *linphone_call_params_get_record_file(const LinphoneCallParams *cp);
LINPHONE_PUBLIC	void linphone_call_params_add_custom_header(LinphoneCallParams *params, const char *header_name, const char *header_value);
LINPHONE_PUBLIC	const char *linphone_call_params_get_custom_header(const LinphoneCallParams *params, const char *header_name);
224 225
/**
 * Enum describing failure reasons.
Simon Morlat's avatar
Simon Morlat committed
226
 * @ingroup initializing
227
**/
228 229 230 231 232
enum _LinphoneReason{
	LinphoneReasonNone,
	LinphoneReasonNoResponse, /**<No response received from remote*/
	LinphoneReasonBadCredentials, /**<Authentication failed due to bad or missing credentials*/
	LinphoneReasonDeclined, /**<The call has been declined*/
233
	LinphoneReasonNotFound, /**<Destination of the calls was not found.*/
234 235
	LinphoneReasonNotAnswered, /**<The call was not answered in time*/
	LinphoneReasonBusy /**<Phone line was busy */
236 237
};

Simon Morlat's avatar
Simon Morlat committed
238 239 240 241
/**
 * Enum describing failure reasons.
 * @ingroup initializing
**/
242
typedef enum _LinphoneReason LinphoneReason;
243

244
const char *linphone_reason_to_string(LinphoneReason err);
245

246 247
/**
 * Structure describing policy regarding video streams establishments.
Simon Morlat's avatar
Simon Morlat committed
248
 * @ingroup media_parameters
249 250 251 252 253 254 255
**/
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
256 257 258 259
/**
 * Structure describing policy regarding video streams establishments.
 * @ingroup media_parameters
**/
260 261
typedef struct _LinphoneVideoPolicy LinphoneVideoPolicy;

262 263
/**
 * The LinphoneCall object represents a call issued or received by the LinphoneCore
Simon Morlat's avatar
Simon Morlat committed
264
 * @ingroup call_control
265 266
**/
struct _LinphoneCall;
267 268
/**
 * The LinphoneCall object represents a call issued or received by the LinphoneCore
Simon Morlat's avatar
Simon Morlat committed
269
 * @ingroup call_control
270
**/
271
typedef struct _LinphoneCall LinphoneCall;
272 273


Simon Morlat's avatar
Simon Morlat committed
274 275 276 277 278
/**
 * @addtogroup call_misc
 * @{
**/

279 280 281
#define LINPHONE_CALL_STATS_AUDIO 0
#define LINPHONE_CALL_STATS_VIDEO 1

282 283 284 285 286 287
/**
 * Enum describing ICE states.
 * @ingroup initializing
**/
enum _LinphoneIceState{
	LinphoneIceStateNotActivated, /**< ICE has not been activated for this call */
Ghislain MARY's avatar
Ghislain MARY committed
288
	LinphoneIceStateFailed, /**< ICE processing has failed */
289 290 291 292 293 294 295 296 297 298 299 300
	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;

Yann Diorcet's avatar
Yann Diorcet committed
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321
/**
 * Enum describing uPnP states.
 * @ingroup initializing
**/
enum _LinphoneUpnpState{
	LinphoneUpnpStateIdle, /**< uPnP is not activate */
	LinphoneUpnpStatePending, /**< uPnP process is in progress */
	LinphoneUpnpStateAdding,   /**< Internal use: Only used by port binding */
	LinphoneUpnpStateRemoving, /**< Internal use: Only used by port binding */
	LinphoneUpnpStateNotAvailable,  /**< uPnP is not available */
	LinphoneUpnpStateOk, /**< uPnP is enabled */
	LinphoneUpnpStateKo, /**< uPnP processing has failed */
};

/**
 * Enum describing uPnP states.
 * @ingroup initializing
**/
typedef enum _LinphoneUpnpState LinphoneUpnpState;


Simon Morlat's avatar
Simon Morlat committed
322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
/**
 * 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.*/
346
	LinphoneIceState	ice_state; /**< State of ICE processing. */
Yann Diorcet's avatar
Yann Diorcet committed
347
	LinphoneUpnpState	upnp_state; /**< State of uPnP processing. */
348 349
	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*/
350 351
	float local_late_rate; /**<percentage of packet received too late over last second*/
	float local_loss_rate; /**<percentage of lost packet over last second*/
Simon Morlat's avatar
Simon Morlat committed
352 353 354 355 356
};

/**
 * @}
**/
357

358 359
const LinphoneCallStats *linphone_call_get_audio_stats(LinphoneCall *call);
const LinphoneCallStats *linphone_call_get_video_stats(LinphoneCall *call);
360 361


362 363
/** Callback prototype */
typedef void (*LinphoneCallCbFunc)(struct _LinphoneCall *call,void * user_data);
364

Simon Morlat's avatar
Simon Morlat committed
365 366 367 368 369
/**
 * 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
**/
370
typedef enum _LinphoneCallState{
Simon Morlat's avatar
Simon Morlat committed
371
	LinphoneCallIdle,					/**<Initial call state */
372 373 374 375 376 377 378 379 380 381 382 383 384 385
	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
386
	LinphoneCallUpdatedByRemote, /**<The call's parameters change is requested by remote end, used for example when video is added by remote */
387
	LinphoneCallIncomingEarlyMedia, /**<We are proposing early media to an incoming call */
388
	LinphoneCallUpdating, /**<A call update has been initiated by us */
389
	LinphoneCallReleased /**< The call object is no more retained by the core */
390 391
} LinphoneCallState;

392
LINPHONE_PUBLIC	const char *linphone_call_state_to_string(LinphoneCallState cs);
393

394
LinphoneCore *linphone_call_get_core(const LinphoneCall *call);
395
LINPHONE_PUBLIC	LinphoneCallState linphone_call_get_state(const LinphoneCall *call);
396
bool_t linphone_call_asked_to_autoanswer(LinphoneCall *call);
397
LINPHONE_PUBLIC	const LinphoneAddress * linphone_core_get_current_call_remote_address(struct _LinphoneCore *lc);
Sylvain Berfini's avatar
Sylvain Berfini committed
398 399 400
LINPHONE_PUBLIC	const LinphoneAddress * linphone_call_get_remote_address(const LinphoneCall *call);
LINPHONE_PUBLIC	char *linphone_call_get_remote_address_as_string(const LinphoneCall *call);
LINPHONE_PUBLIC	LinphoneCallDir linphone_call_get_dir(const LinphoneCall *call);
401 402 403
LINPHONE_PUBLIC	LinphoneCall * linphone_call_ref(LinphoneCall *call);
LINPHONE_PUBLIC	void linphone_call_unref(LinphoneCall *call);
LINPHONE_PUBLIC	LinphoneCallLog *linphone_call_get_call_log(const LinphoneCall *call);
Simon Morlat's avatar
Simon Morlat committed
404
const char *linphone_call_get_refer_to(const LinphoneCall *call);
405
bool_t linphone_call_has_transfer_pending(const LinphoneCall *call);
406
LINPHONE_PUBLIC	LinphoneCall *linphone_call_get_replaced_call(LinphoneCall *call);
Sylvain Berfini's avatar
Sylvain Berfini committed
407
LINPHONE_PUBLIC	int linphone_call_get_duration(const LinphoneCall *call);
408
LINPHONE_PUBLIC	const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *call);
409
LINPHONE_PUBLIC	const LinphoneCallParams * linphone_call_get_remote_params(LinphoneCall *call);
410 411
void linphone_call_enable_camera(LinphoneCall *lc, bool_t enabled);
bool_t linphone_call_camera_enabled(const LinphoneCall *lc);
412
int linphone_call_take_video_snapshot(LinphoneCall *call, const char *file);
413
LINPHONE_PUBLIC	LinphoneReason linphone_call_get_reason(const LinphoneCall *call);
414
LINPHONE_PUBLIC	const char *linphone_call_get_remote_user_agent(LinphoneCall *call);
415
LINPHONE_PUBLIC	const char *linphone_call_get_remote_contact(LinphoneCall *call);
416 417 418 419 420 421 422
LINPHONE_PUBLIC	float linphone_call_get_play_volume(LinphoneCall *call);
LINPHONE_PUBLIC	float linphone_call_get_record_volume(LinphoneCall *call);
LINPHONE_PUBLIC	float linphone_call_get_current_quality(LinphoneCall *call);
LINPHONE_PUBLIC	float linphone_call_get_average_quality(LinphoneCall *call);
LINPHONE_PUBLIC	const char* linphone_call_get_authentication_token(LinphoneCall *call);
LINPHONE_PUBLIC	bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call);
LINPHONE_PUBLIC	void linphone_call_set_authentication_token_verified(LinphoneCall *call, bool_t verified);
423 424
LINPHONE_PUBLIC void linphone_call_send_vfu_request(LinphoneCall *call);
LINPHONE_PUBLIC void *linphone_call_get_user_pointer(LinphoneCall *call);
Sylvain Berfini's avatar
Sylvain Berfini committed
425
LINPHONE_PUBLIC	void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer);
426
LINPHONE_PUBLIC	void linphone_call_set_next_video_frame_decoded_callback(LinphoneCall *call, LinphoneCallCbFunc cb, void* user_data);
427
LinphoneCallState linphone_call_get_transfer_state(LinphoneCall *call);
428
void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float* cx, float* cy);
429 430
LINPHONE_PUBLIC	void linphone_call_start_recording(LinphoneCall *call);
LINPHONE_PUBLIC	void linphone_call_stop_recording(LinphoneCall *call);
431 432 433 434 435 436 437
/**
 * Return TRUE if this call is currently part of a conference
 *@param call #LinphoneCall
 *@return TRUE if part of a conference.
 *
 @ingroup call_control
 */
438
LINPHONE_PUBLIC	bool_t linphone_call_is_in_conference(const LinphoneCall *call);
jehan's avatar
jehan committed
439 440 441 442 443 444 445
/**
 * Enables or disable echo cancellation for this call
 * @param call
 * @param val
 *
 * @ingroup media_parameters
**/
446
LINPHONE_PUBLIC	void linphone_call_enable_echo_cancellation(LinphoneCall *call, bool_t val) ;
jehan's avatar
jehan committed
447 448 449 450 451
/**
 * Returns TRUE if echo cancellation is enabled.
 *
 * @ingroup media_parameters
**/
452
LINPHONE_PUBLIC	bool_t linphone_call_echo_cancellation_enabled(LinphoneCall *lc);
jehan's avatar
jehan committed
453 454 455 456 457 458 459
/**
 * Enables or disable echo limiter for this call
 * @param call
 * @param val
 *
 * @ingroup media_parameters
**/
460
LINPHONE_PUBLIC	void linphone_call_enable_echo_limiter(LinphoneCall *call, bool_t val);
jehan's avatar
jehan committed
461 462 463 464 465
/**
 * Returns TRUE if echo limiter is enabled.
 *
 * @ingroup media_parameters
**/
466
LINPHONE_PUBLIC	bool_t linphone_call_echo_limiter_enabled(const LinphoneCall *call);
Simon Morlat's avatar
Simon Morlat committed
467 468

/*keep this in sync with mediastreamer2/msvolume.h*/
Simon Morlat's avatar
Simon Morlat committed
469 470 471 472 473 474

/**
 * 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
475

smorlat's avatar
smorlat committed
476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495
/**
 * @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.
**/
496
typedef struct _LinphoneProxyConfig LinphoneProxyConfig;
aymeric's avatar
aymeric committed
497

498 499 500 501
/**
 * LinphoneRegistrationState describes proxy registration states.
**/
typedef enum _LinphoneRegistrationState{
Simon Morlat's avatar
Simon Morlat committed
502 503 504 505 506
	LinphoneRegistrationNone, /**<Initial state for registrations */
	LinphoneRegistrationProgress, /**<Registration is in progress */
	LinphoneRegistrationOk,	/**< Registration is successful */
	LinphoneRegistrationCleared, /**< Unregistration succeeded */
	LinphoneRegistrationFailed	/**<Registration failed */
507 508
}LinphoneRegistrationState;

509 510 511 512
/**
 * Human readable version of the #LinphoneRegistrationState
 * @param cs sate
 */
513
LINPHONE_PUBLIC	const char *linphone_registration_state_to_string(LinphoneRegistrationState cs);
514

515 516 517 518 519
LINPHONE_PUBLIC	LinphoneProxyConfig *linphone_proxy_config_new(void);
LINPHONE_PUBLIC	int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *server_addr);
LINPHONE_PUBLIC	int linphone_proxy_config_set_identity(LinphoneProxyConfig *obj, const char *identity);
LINPHONE_PUBLIC	int linphone_proxy_config_set_route(LinphoneProxyConfig *obj, const char *route);
LINPHONE_PUBLIC	void linphone_proxy_config_expires(LinphoneProxyConfig *obj, int expires);
520 521 522 523 524 525
/**
 * 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
 */
526
LINPHONE_PUBLIC	void linphone_proxy_config_enable_register(LinphoneProxyConfig *obj, bool_t val);
aymeric's avatar
aymeric committed
527
#define linphone_proxy_config_enableregister linphone_proxy_config_enable_register
528 529
LINPHONE_PUBLIC	void linphone_proxy_config_edit(LinphoneProxyConfig *obj);
LINPHONE_PUBLIC	int linphone_proxy_config_done(LinphoneProxyConfig *obj);
jehan's avatar
jehan committed
530 531 532 533 534 535 536
/**
 * 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
 *
 */
537
LINPHONE_PUBLIC	void linphone_proxy_config_enable_publish(LinphoneProxyConfig *obj, bool_t val);
Sylvain Berfini's avatar
Sylvain Berfini committed
538 539
LINPHONE_PUBLIC	void linphone_proxy_config_set_dial_escape_plus(LinphoneProxyConfig *cfg, bool_t val);
LINPHONE_PUBLIC	void linphone_proxy_config_set_dial_prefix(LinphoneProxyConfig *cfg, const char *prefix);
540

Sylvain Berfini's avatar
Sylvain Berfini committed
541
LINPHONE_PUBLIC	LinphoneRegistrationState linphone_proxy_config_get_state(const LinphoneProxyConfig *obj);
542
LINPHONE_PUBLIC	bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj);
Sylvain Berfini's avatar
Sylvain Berfini committed
543
LINPHONE_PUBLIC	const char *linphone_proxy_config_get_domain(const LinphoneProxyConfig *cfg);
544

Sylvain Berfini's avatar
Sylvain Berfini committed
545
LINPHONE_PUBLIC	const char *linphone_proxy_config_get_route(const LinphoneProxyConfig *obj);
546
LINPHONE_PUBLIC	const char *linphone_proxy_config_get_identity(const LinphoneProxyConfig *obj);
547
LINPHONE_PUBLIC	bool_t linphone_proxy_config_publish_enabled(const LinphoneProxyConfig *obj);
548
LINPHONE_PUBLIC	const char *linphone_proxy_config_get_addr(const LinphoneProxyConfig *obj);
549
LINPHONE_PUBLIC	int linphone_proxy_config_get_expires(const LinphoneProxyConfig *obj);
Sylvain Berfini's avatar
Sylvain Berfini committed
550
LINPHONE_PUBLIC	bool_t linphone_proxy_config_register_enabled(const LinphoneProxyConfig *obj);
551 552
LINPHONE_PUBLIC	void linphone_proxy_config_refresh_register(LinphoneProxyConfig *obj);
LINPHONE_PUBLIC	const char *linphone_proxy_config_get_contact_parameters(const LinphoneProxyConfig *obj);
Sylvain Berfini's avatar
Sylvain Berfini committed
553
LINPHONE_PUBLIC	void linphone_proxy_config_set_contact_parameters(LinphoneProxyConfig *obj, const char *contact_params);
554 555
struct _LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyConfig *obj);

556 557
LINPHONE_PUBLIC	bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg);
LINPHONE_PUBLIC	const char * linphone_proxy_config_get_dial_prefix(const LinphoneProxyConfig *cfg);
558

559
LinphoneReason linphone_proxy_config_get_error(const LinphoneProxyConfig *cfg);
560 561 562 563 564 565 566
/*
 * return the transport from either : service route, route, or addr
 * @returns cfg object
 * @return transport as string (I.E udp, tcp, tls, dtls)*/

LINPHONE_PUBLIC const char* linphone_proxy_config_get_transport(const LinphoneProxyConfig *cfg);

567

aymeric's avatar
aymeric committed
568 569
/* destruction is called automatically when removing the proxy config */
void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg);
smorlat's avatar
smorlat committed
570 571
void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type);
SipSetupContext *linphone_proxy_config_get_sip_setup_context(LinphoneProxyConfig *cfg);
572
SipSetup *linphone_proxy_config_get_sip_setup(LinphoneProxyConfig *cfg);
573 574 575
/**
 * normalize a human readable phone number into a basic string. 888-444-222 becomes 888444222
 */
Sylvain Berfini's avatar
Sylvain Berfini committed
576
LINPHONE_PUBLIC	int linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const char *username, char *result, size_t result_len);
jehan's avatar
jehan committed
577 578 579
/*
 *  attached a user data to a proxy config
 */
580
LINPHONE_PUBLIC	void linphone_proxy_config_set_user_data(LinphoneProxyConfig *cr, void * ud);
jehan's avatar
jehan committed
581 582 583
/*
 *  get user data to a proxy config. return null if any
 */
584
LINPHONE_PUBLIC	void * linphone_proxy_config_get_user_data(LinphoneProxyConfig *cr);
smorlat's avatar
smorlat committed
585

smorlat's avatar
smorlat committed
586 587 588 589
/**
 * @}
**/

590 591 592 593 594 595
typedef struct _LinphoneAccountCreator{
	struct _LinphoneCore *lc;
	struct _SipSetupContext *ssctx;
	char *username;
	char *password;
	char *domain;
Sylvain Berfini's avatar
Sylvain Berfini committed
596 597 598
	char *route;
	char *email;
	int suscribe;
599 600 601
	bool_t succeeded;
}LinphoneAccountCreator;

602
LinphoneAccountCreator *linphone_account_creator_new(struct _LinphoneCore *core, const char *type);
603 604 605
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
606 607 608
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
609 610
const char * linphone_account_creator_get_username(LinphoneAccountCreator *obj);
const char * linphone_account_creator_get_domain(LinphoneAccountCreator *obj);
611
int linphone_account_creator_test_existence(LinphoneAccountCreator *obj);
Sylvain Berfini's avatar
Sylvain Berfini committed
612
int linphone_account_creator_test_validation(LinphoneAccountCreator *obj);
613 614 615
LinphoneProxyConfig * linphone_account_creator_validate(LinphoneAccountCreator *obj);
void linphone_account_creator_destroy(LinphoneAccountCreator *obj);

616 617
struct _LinphoneAuthInfo;

smorlat's avatar
smorlat committed
618 619 620 621 622 623 624 625 626 627 628 629
/**
 * @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
630
 * order to become known and used automatically when needed.
smorlat's avatar
smorlat committed
631 632 633 634 635 636
 * 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.
 *
637 638
 * 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
639 640 641
 * transactions and retry them with authentication headers.
 *
**/
642
typedef struct _LinphoneAuthInfo LinphoneAuthInfo;
aymeric's avatar
aymeric committed
643

644
LINPHONE_PUBLIC	LinphoneAuthInfo *linphone_auth_info_new(const char *username, const char *userid,
aymeric's avatar
aymeric committed
645
		const char *passwd, const char *ha1,const char *realm);
Ghislain MARY's avatar
Ghislain MARY committed
646 647 648 649 650 651 652 653 654 655 656
LINPHONE_PUBLIC void linphone_auth_info_set_passwd(LinphoneAuthInfo *info, const char *passwd);
LINPHONE_PUBLIC void linphone_auth_info_set_username(LinphoneAuthInfo *info, const char *username);
LINPHONE_PUBLIC void linphone_auth_info_set_userid(LinphoneAuthInfo *info, const char *userid);
LINPHONE_PUBLIC void linphone_auth_info_set_realm(LinphoneAuthInfo *info, const char *realm);
LINPHONE_PUBLIC void linphone_auth_info_set_ha1(LinphoneAuthInfo *info, const char *ha1);

LINPHONE_PUBLIC const char *linphone_auth_info_get_username(const LinphoneAuthInfo *i);
LINPHONE_PUBLIC const char *linphone_auth_info_get_passwd(const LinphoneAuthInfo *i);
LINPHONE_PUBLIC const char *linphone_auth_info_get_userid(const LinphoneAuthInfo *i);
LINPHONE_PUBLIC const char *linphone_auth_info_get_realm(const LinphoneAuthInfo *i);
LINPHONE_PUBLIC const char *linphone_auth_info_get_ha1(const LinphoneAuthInfo *i);
657

aymeric's avatar
aymeric committed
658 659 660 661
/* 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
662

663
struct _LinphoneChatRoom;
jehan's avatar
jehan committed
664 665 666 667
/**
 * @addtogroup chatroom
 * @{
 */
668 669 670 671 672 673 674

/**
 * 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
675 676 677 678
/**
 * 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
679
typedef struct _LinphoneChatRoom LinphoneChatRoom;
680 681

/**
682
 *LinphoneChatMessageState is used to notify if messages have been succesfully delivered or not.
683 684
 */
typedef enum _LinphoneChatMessageStates {
685 686 687 688
	LinphoneChatMessageStateIdle, /**<initial state*/
	LinphoneChatMessageStateInProgress, /**<delivery in progress**/
	LinphoneChatMessageStateDelivered, /**<message succesffully delivered an acknoleged by remote end point*/
	LinphoneChatMessageStateNotDelivered /**<message was not delivered*/
689 690 691
}LinphoneChatMessageState;

/**
692 693 694 695
 * Call back used to notify message delivery status
 *@param msg #LinphoneChatMessage object
 *@param status LinphoneChatMessageState
 *@param ud application user data
696
 */
697
typedef void (*LinphoneChatMessageStateChangeCb)(LinphoneChatMessage* msg,LinphoneChatMessageState state,void* ud);
698

Simon Morlat's avatar
Simon Morlat committed
699
void linphone_core_set_chat_database_path(LinphoneCore *lc, const char *path);
700
LINPHONE_PUBLIC	LinphoneChatRoom * linphone_core_create_chat_room(LinphoneCore *lc, const char *to);
Simon Morlat's avatar
Simon Morlat committed
701
LinphoneChatRoom *linphone_core_get_chat_room(LinphoneCore *lc, const LinphoneAddress *addr);
702
void linphone_chat_room_destroy(LinphoneChatRoom *cr);
703
LINPHONE_PUBLIC	LinphoneChatMessage* linphone_chat_room_create_message(LinphoneChatRoom *cr,const char* message);
704
const LinphoneAddress* linphone_chat_room_get_peer_address(LinphoneChatRoom *cr);
705 706
LINPHONE_PUBLIC	void linphone_chat_room_send_message(LinphoneChatRoom *cr, const char *msg);
LINPHONE_PUBLIC	void linphone_chat_room_send_message2(LinphoneChatRoom *cr, LinphoneChatMessage* msg,LinphoneChatMessageStateChangeCb status_cb,void* ud);
Simon Morlat's avatar
Simon Morlat committed
707 708 709
MSList *linphone_chat_room_get_history(LinphoneChatRoom *cr,int nb_message);
void linphone_chat_room_mark_as_read(LinphoneChatRoom *cr);
void linphone_chat_room_delete_history(LinphoneChatRoom *cr);
710
int linphone_chat_room_get_unread_messages_count(LinphoneChatRoom *cr);
711 712 713 714
LinphoneCore* linphone_chat_room_get_lc(LinphoneChatRoom *cr);
void linphone_chat_room_set_user_data(LinphoneChatRoom *cr, void * ud);
void * linphone_chat_room_get_user_data(LinphoneChatRoom *cr);

715
LINPHONE_PUBLIC	const char* linphone_chat_message_state_to_string(const LinphoneChatMessageState state);
Margaux Clerc's avatar
Margaux Clerc committed
716
LinphoneChatMessageState linphone_chat_message_get_state(const LinphoneChatMessage* message);
717
LinphoneChatMessage* linphone_chat_message_clone(const LinphoneChatMessage* message);
718
void linphone_chat_message_destroy(LinphoneChatMessage* msg);
719
void linphone_chat_message_set_from(LinphoneChatMessage* message, const LinphoneAddress* from);
720
LINPHONE_PUBLIC	const LinphoneAddress* linphone_chat_message_get_from(const LinphoneChatMessage* message);
Simon Morlat's avatar
Simon Morlat committed
721
const LinphoneAddress* linphone_chat_message_get_to(const LinphoneChatMessage* message);
722 723 724
LINPHONE_PUBLIC	const char* linphone_chat_message_get_external_body_url(const LinphoneChatMessage* message);
LINPHONE_PUBLIC	void linphone_chat_message_set_external_body_url(LinphoneChatMessage* message,const char* url);
LINPHONE_PUBLIC	const char * linphone_chat_message_get_text(const LinphoneChatMessage* message);
725
time_t linphone_chat_message_get_time(const LinphoneChatMessage* message);
726
void* linphone_chat_message_get_user_data(const LinphoneChatMessage* message);
727
void linphone_chat_message_set_user_data(LinphoneChatMessage* message,void*);
728
LinphoneChatRoom* linphone_chat_message_get_chat_room(LinphoneChatMessage *msg);
729
const LinphoneAddress* linphone_chat_message_get_peer_address(LinphoneChatMessage *msg);
Simon Morlat's avatar
Simon Morlat committed
730
LinphoneAddress *linphone_chat_message_get_local_address(const LinphoneChatMessage* message);
731 732
void linphone_chat_message_add_custom_header(LinphoneChatMessage* message, const char *header_name, const char *header_value);
const char * linphone_chat_message_get_custom_header(LinphoneChatMessage* message, const char *header_name);
aymeric's avatar
aymeric committed
733

jehan's avatar
jehan committed
734 735 736
/**
 * @}
 */
Simon Morlat's avatar
Simon Morlat committed
737 738 739 740 741 742 743 744 745 746 747


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

/**
 * LinphoneGlobalState describes the global state of the LinphoneCore object.
 * It is notified via the LinphoneCoreVTable::global_state_changed
**/
748 749 750 751 752 753 754
typedef enum _LinphoneGlobalState{
	LinphoneGlobalOff,
	LinphoneGlobalStartup,
	LinphoneGlobalOn,
	LinphoneGlobalShutdown
}LinphoneGlobalState;

755
const char *linphone_global_state_to_string(LinphoneGlobalState gs);
aymeric's avatar
aymeric committed
756

757 758 759 760 761

/**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);
762 763 764
/**Call encryption changed callback prototype*/
typedef void (*CallEncryptionChangedCb)(struct _LinphoneCore *lc, LinphoneCall *call, bool_t on, const char *authentication_token);

765 766 767
/** @ingroup Proxies
 * Registration state notification callback prototype
 * */
768
typedef void (*LinphoneRegistrationStateCb)(struct _LinphoneCore *lc, LinphoneProxyConfig *cfg, LinphoneRegistrationState cstate, const char *message);
smorlat's avatar
smorlat committed
769
/** Callback prototype */
aymeric's avatar
aymeric committed
770
typedef void (*ShowInterfaceCb)(struct _LinphoneCore *lc);
smorlat's avatar
smorlat committed
771
/** Callback prototype */
aymeric's avatar
aymeric committed
772
typedef void (*DisplayStatusCb)(struct _LinphoneCore *lc, const char *message);
smorlat's avatar
smorlat committed
773
/** Callback prototype */
aymeric's avatar
aymeric committed
774
typedef void (*DisplayMessageCb)(struct _LinphoneCore *lc, const char *message);
smorlat's avatar
smorlat committed
775
/** Callback prototype */
aymeric's avatar
aymeric committed
776
typedef void (*DisplayUrlCb)(struct _LinphoneCore *lc, const char *message, const char *url);
smorlat's avatar
smorlat committed
777
/** Callback prototype */
aymeric's avatar
aymeric committed
778
typedef void (*LinphoneCoreCbFunc)(struct _LinphoneCore *lc,void * user_data);
smorlat's avatar
smorlat committed
779
/** Callback prototype */
780
typedef void (*NotifyReceivedCb)(struct _LinphoneCore *lc, LinphoneCall *call, const char *from, const char *event);
jehan's avatar
jehan committed
781 782 783
/**
 * Report status change for a friend previously \link linphone_core_add_friend() added \endlink to #LinphoneCore.
 * @param lc #LinphoneCore object .
784 785 786 787 788 789 790 791 792 793 794 795
 * @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
796
/** Callback prototype */
aymeric's avatar
aymeric committed
797
typedef void (*AuthInfoRequested)(struct _LinphoneCore *lc, const char *realm, const char *username);
smorlat's avatar
smorlat committed
798
/** Callback prototype */
aymeric's avatar
aymeric committed
799
typedef void (*CallLogUpdated)(struct _LinphoneCore *lc, struct _LinphoneCallLog *newcl);
jehan's avatar
jehan committed
800 801
/**
 * Callback prototype
802
 * @deprecated use #MessageReceived instead.
jehan's avatar
jehan committed
803 804 805 806 807 808 809
 *
 * @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);
810 811 812 813 814 815 816 817 818
/**
 * 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
819
/** Callback prototype */
820
typedef void (*DtmfReceived)(struct _LinphoneCore* lc, LinphoneCall *call, int dtmf);
smorlat's avatar
smorlat committed
821
/** Callback prototype */
822
typedef void (*ReferReceived)(struct _LinphoneCore *lc, const char *refer_to);
smorlat's avatar
smorlat committed
823
/** Callback prototype */
824
typedef void (*BuddyInfoUpdated)(struct _LinphoneCore *lc, LinphoneFriend *lf);
825 826
/** 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
827
/** Callback prototype for receiving quality statistics for calls*/
828
typedef void (*CallStatsUpdated)(struct _LinphoneCore *lc, LinphoneCall *call, const LinphoneCallStats *stats);
829

smorlat's avatar
smorlat committed
830 831
/**
 * This structure holds all callbacks that the application should implement.
832
 *  None is mandatory.
smorlat's avatar
smorlat committed
833
**/
834 835 836 837
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*/
838
	NotifyPresenceReceivedCb notify_presence_recv; /**< Notify received presence events*/
839
	NewSubscribtionRequestCb new_subscription_request; /**< Notify about pending subscription request */
smorlat's avatar
smorlat committed
840 841
	AuthInfoRequested auth_info_requested; /**< Ask the application some authentication information */
	CallLogUpdated call_log_updated; /**< Notifies that call log list has been updated */
842 843
	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
844
	DtmfReceived dtmf_received; /**< A dtmf has been received received */
Simon Morlat's avatar
Simon Morlat committed
845
	ReferReceived refer_received; /**< An out of call refer was received */
846
	CallEncryptionChangedCb call_encryption_changed; /**<Notifies on change in the encryption of call streams */
847
	LinphoneTransferStateChanged transfer_state_changed; /**<Notifies when a transfer is in progress */
smorlat's avatar
smorlat committed
848
	BuddyInfoUpdated buddy_info_updated; /**< a LinphoneFriend's BuddyInfo has changed*/
849
	NotifyReceivedCb notify_recv; /**< Other notifications*/
Simon Morlat's avatar
Simon Morlat committed
850
	CallStatsUpdated call_stats_updated; /**<Notifies on refreshing of call's statistics. */
Simon Morlat's avatar
Simon Morlat committed
851 852 853 854 855
	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
856 857
} LinphoneCoreVTable;

smorlat's avatar
smorlat committed
858 859 860 861
/**
 * @}
**/

aymeric's avatar
aymeric committed
862 863 864 865 866 867 868 869 870
typedef struct _LCCallbackObj
{
  LinphoneCoreCbFunc _func;
  void * _user_data;
}LCCallbackObj;



typedef enum _LinphoneFirewallPolicy{
871 872
	LinphonePolicyNoFirewall,
	LinphonePolicyUseNatAddress,
873
	LinphonePolicyUseStun,
Yann Diorcet's avatar
Yann Diorcet committed
874 875
	LinphonePolicyUseIce,
	LinphonePolicyUseUpnp,
aymeric's avatar
aymeric committed
876 877
} LinphoneFirewallPolicy;

878 879 880 881 882 883
typedef enum _LinphoneWaitingState{
	LinphoneWaitingStart,
	LinphoneWaitingProgress,
	LinphoneWaitingFinished
} LinphoneWaitingState;
typedef void * (*LinphoneWaitingCallback)(struct _LinphoneCore *lc, void *context, LinphoneWaitingState ws, const char *purpose, float progress);
884

aymeric's avatar
aymeric committed
885 886 887

/* THE main API */

888 889 890 891 892 893 894
/**
 * Define a log handler.
 *
 * @ingroup misc
 *
 * @param logfunc The function pointer of the log handler.
 */
Ghislain MARY's avatar
Ghislain MARY committed
895
LINPHONE_PUBLIC void linphone_core_set_log_handler(OrtpLogFunc logfunc);
896 897 898 899 900 901 902 903 904
/**
 * Define a log file.
 *
 * @ingroup misc
 *
 * 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.
 */
Ghislain MARY's avatar
Ghislain MARY committed
905
LINPHONE_PUBLIC void linphone_core_set_log_file(FILE *file);
906 907 908 909 910 911 912 913 914 915
/**
 * Define the log level.
 *
 * @ingroup misc
 *
 * 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.
 *
 * @param loglevel A bitmask of the log levels to set.
 */
Ghislain MARY's avatar
Ghislain MARY committed
916
LINPHONE_PUBLIC void linphone_core_set_log_level(OrtpLogLevel loglevel);
917 918
LINPHONE_PUBLIC void linphone_core_enable_logs(FILE *file);
LINPHONE_PUBLIC void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc);
Ghislain MARY's avatar
Ghislain MARY committed
919
LINPHONE_PUBLIC void linphone_core_disable_logs(void);
920 921 922
LINPHONE_PUBLIC	const char *linphone_core_get_version(void);
LINPHONE_PUBLIC	const char *linphone_core_get_user_agent_name(void);
LINPHONE_PUBLIC	const char *linphone_core_get_user_agent_version(void);
aymeric's avatar
aymeric committed
923

924
LINPHONE_PUBLIC LinphoneCore *linphone_core_new(const LinphoneCoreVTable *vtable,
925
						const char *config_path, const char *factory_config, void* userdata);
aymeric's avatar
aymeric committed
926

927 928 929 930 931 932 933 934 935 936 937 938
/**
 * Instantiates a LinphoneCore object with a given LpConfig.
 * @ingroup initializing
 *
 * The LinphoneCore object is the primary handle for doing all phone actions.
 * It should be unique within your application.
 * @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.
 * @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
**/
Ghislain MARY's avatar
Ghislain MARY committed
939
LINPHONE_PUBLIC LinphoneCore *linphone_core_new_with_config(const LinphoneCoreVTable *vtable, struct _LpConfig *config, void *userdata);
940

aymeric's avatar
aymeric committed
941
/* function to be periodically called in a main loop */
942
/* For ICE to work properly it should be called every 20ms */
943
LINPHONE_PUBLIC	void linphone_core_iterate(LinphoneCore *lc);
jehan's avatar
jehan committed
944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961
#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
962

963
/*sets the user-agent string in sip messages, ideally called just after linphone_core_new() or linphone_core_init() */
964
LINPHONE_PUBLIC	void linphone_core_set_user_agent(LinphoneCore *lc, const char *ua_name, const char *version);
965

966
LINPHONE_PUBLIC	LinphoneAddress * linphone_core_interpret_url(LinphoneCore *lc, const char *url);
967

968
LINPHONE_PUBLIC	LinphoneCall * linphone_core_invite(LinphoneCore *lc, const char *url);
aymeric's avatar
aymeric committed
969

970
LINPHONE_PUBLIC	LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddress *addr);
971

972
LINPHONE_PUBLIC	LinphoneCall * linphone_core_invite_with_params(LinphoneCore *lc, const char *url, const LinphoneCallParams *params);
973

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

976
LINPHONE_PUBLIC	int linphone_core_transfer_call(LinphoneCore *lc, LinphoneCall *call, const char *refer_to);
aymeric's avatar
aymeric committed
977

978
LINPHONE_PUBLIC	int linphone_core_transfer_call_to_another(LinphoneCore *lc, LinphoneCall *call, LinphoneCall *dest);
979

980
LINPHONE_PUBLIC	bool_t linphone_core_inc_invite_pending(LinphoneCore*lc);
aymeric's avatar
aymeric committed
981

982
LINPHONE_PUBLIC bool_t linphone_core_in_call(const LinphoneCore *lc);
aymeric's avatar
aymeric committed
983

984
LINPHONE_PUBLIC	LinphoneCall *linphone_core_get_current_call(const LinphoneCore *lc);
985

986
LINPHONE_PUBLIC	int linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call);
987

988
LINPHONE_PUBLIC	int linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params);
989

990
LINPHONE_PUBLIC	int linphone_core_terminate_call(LinphoneCore *lc, LinphoneCall *call);
991

992 993
int linphone_core_redirect_call(LinphoneCore *lc, LinphoneCall *call, const char *redirect_uri);

994
LINPHONE_PUBLIC	int linphone_core_decline_call(LinphoneCore *lc, LinphoneCall * call, LinphoneReason reason);
995

996
LINPHONE_PUBLIC	int linphone_core_terminate_all_calls(LinphoneCore *lc);
aymeric's avatar
aymeric committed
997

998
LINPHONE_PUBLIC	int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *call);
999

1000
LINPHONE_PUBLIC	int linphone_core_pause_all_calls(LinphoneCore *lc);
1001

1002
LINPHONE_PUBLIC	int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *call);
aymeric's avatar
aymeric committed
1003

1004
LINPHONE_PUBLIC	int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params);
1005

1006
LINPHONE_PUBLIC	int linphone_core_defer_call_update(LinphoneCore *lc, LinphoneCall *call);
1007

1008
LINPHONE_PUBLIC	int linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params);
jehan's avatar
jehan committed
1009 1010 1011 1012 1013 1014
/**
 * @ingroup media_parameters
 * Get default call parameters reflecting current linphone core configuration
 * @param LinphoneCore object
 * @return  LinphoneCallParams
 */
1015
LINPHONE_PUBLIC	LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *lc);
1016

1017
LINPHONE_PUBLIC	LinphoneCall *linphone_core_get_call_by_remote_address(LinphoneCore *lc, const char *remote_address);
aymeric's avatar
aymeric committed
1018

Sylvain Berfini's avatar
Sylvain Berfini committed
1019
LINPHONE_PUBLIC	void linphone_core_send_dtmf(LinphoneCore *lc,char dtmf);
aymeric's avatar
aymeric committed
1020

1021
LINPHONE_PUBLIC	int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact);
aymeric's avatar
aymeric committed
1022

1023
LINPHONE_PUBLIC	const char *linphone_core_get_primary_contact(LinphoneCore *lc);
aymeric's avatar
aymeric committed
1024

1025
LINPHONE_PUBLIC	const char * linphone_core_get_identity(LinphoneCore *lc);
1026

aymeric's avatar
aymeric committed
1027 1028 1029
void linphone_core_set_guess_hostname(LinphoneCore *lc, bool_t val);
bool_t linphone_core_get_guess_hostname(LinphoneCore *lc);

1030 1031
LINPHONE_PUBLIC	bool_t linphone_core_ipv6_enabled(LinphoneCore *lc);
LINPHONE_PUBLIC	void linphone_core_enable_ipv6(LinphoneCore *lc, bool_t val);
aymeric's avatar
aymeric committed
1032

1033 1034
LINPHONE_PUBLIC	LinphoneAddress *linphone_core_get_primary_contact_parsed(LinphoneCore *lc);
LINPHONE_PUBLIC	const char * linphone_core_get_identity(LinphoneCore *lc);
aymeric's avatar
aymeric committed
1035
/*0= no bandwidth limit*/
1036 1037
LINPHONE_PUBLIC	void linphone_core_set_download_bandwidth(LinphoneCore *lc, int bw);
LINPHONE_PUBLIC	void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw);
aymeric's avatar
aymeric committed
1038

1039 1040
LINPHONE_PUBLIC	int linphone_core_get_download_bandwidth(const LinphoneCore *lc);
LINPHONE_PUBLIC	int linphone_core_get_upload_bandwidth(const LinphoneCore *lc);
1041 1042 1043

void linphone_core_enable_adaptive_rate_control(LinphoneCore *lc, bool_t enabled);
bool_t linphone_core_adaptive_rate_control_enabled(const LinphoneCore *lc);
1044

1045 1046
LINPHONE_PUBLIC	void linphone_core_set_download_ptime(LinphoneCore *lc, int ptime);
LINPHONE_PUBLIC	int  linphone_core_get_download_ptime(LinphoneCore *lc);
aymeric's avatar
aymeric committed
1047

1048
LINPHONE_PUBLIC	void linphone_core_set_upload_ptime(LinphoneCore *lc, int ptime);
Simon Morlat's avatar
Simon Morlat committed
1049

1050
LINPHONE_PUBLIC	int linphone_core_get_upload_ptime(LinphoneCore *lc);
Simon Morlat's avatar
Simon Morlat committed
1051

aymeric's avatar
aymeric committed
1052
/* returns a MSList of PayloadType */
1053
LINPHONE_PUBLIC	const MSList *linphone_core_get_audio_codecs(const LinphoneCore *lc);
aymeric's avatar
aymeric committed
1054 1055 1056 1057 1058 1059 1060

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

Ghislain MARY's avatar
Ghislain MARY committed
1061
LINPHONE_PUBLIC bool_t linphone_core_payload_type_enabled(LinphoneCore *lc, const PayloadType *pt);
jehan's avatar
jehan committed
1062 1063 1064 1065 1066 1067 1068 1069
/**
 * Enable payload type
 * @param linphone core
 * @param pt payload type to enable, can be retrieve from #linphone_core_find_payload_type
 * @param TRUE if enabled
 * @return 0 if succed
 *
 */
1070
LINPHONE_PUBLIC	int linphone_core_enable_payload_type(LinphoneCore *lc, PayloadType *pt, bool_t enable);
1071

1072
/**
jehan's avatar
jehan committed
1073
 * Wildcard value used by #linphone_core_find_payload_type to ignore rate in search algorithm
1074 1075 1076 1077
 * @ingroup media_parameters
 */
#define LINPHONE_FIND_PAYLOAD_IGNORE_RATE -1
/**
jehan's avatar
jehan committed
1078
 * Wildcard value used by #linphone_core_find_payload_type to ignore channel in search algorithm
1079 1080 1081 1082
 * @ingroup media_parameters
 */
#define LINPHONE_FIND_PAYLOAD_IGNORE_CHANNELS -1
/**
1083
 * Get payload type from mime type and clock rate
1084 1085 1086 1087
 * @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)
1088 1089
 * @param rate can be #LINPHONE_FIND_PAYLOAD_IGNORE_RATE
 * @param channels  number of channels, can be #LINPHONE_FIND_PAYLOAD_IGNORE_CHANNELS
1090 1091
 * @return Returns NULL if not found.
 */	
1092
LINPHONE_PUBLIC	PayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char* type, int rate, int channels) ;
jehan's avatar
jehan committed
1093

1094
LINPHONE_PUBLIC	int linphone_core_get_payload_type_number(LinphoneCore *lc, const PayloadType *pt);
1095

1096
LINPHONE_PUBLIC	const char *linphone_core_get_payload_type_description(LinphoneCore *lc, PayloadType *pt);
1097

1098
LINPHONE_PUBLIC	bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, PayloadType *pt);
aymeric's avatar
aymeric committed
1099

1100 1101 1102 1103 1104 1105
/**
 * @ingroup proxy 
 *Create a proxy config with default value from Linphone core.
 *@param lc #LinphoneCore object
 *@return #LinphoneProxyConfig with defualt value set 
 */
Sylvain Berfini's avatar
Sylvain Berfini committed
1106
LINPHONE_PUBLIC	LinphoneProxyConfig * linphone_core_create_proxy_config(LinphoneCore *lc);
1107
	
1108
LINPHONE_PUBLIC	int linphone_core_add_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *config);
aymeric's avatar
aymeric committed
1109

Sylvain Berfini's avatar
Sylvain Berfini committed
1110
LINPHONE_PUBLIC	void linphone_core_clear_proxy_config(LinphoneCore *lc);
1111

Sylvain Berfini's avatar
Sylvain Berfini committed
1112
LINPHONE_PUBLIC	void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *config);
aymeric's avatar
aymeric committed
1113

1114
LINPHONE_PUBLIC	const MSList *linphone_core_get_proxy_config_list(const LinphoneCore *lc);
aymeric's avatar
aymeric committed
1115

1116
LINPHONE_PUBLIC	void linphone_core_set_default_proxy(LinphoneCore *lc, LinphoneProxyConfig *config);
aymeric's avatar
aymeric committed
1117 1118 1119

void linphone_core_set_default_proxy_index(LinphoneCore *lc, int index);

1120
LINPHONE_PUBLIC	int linphone_core_get_default_proxy(LinphoneCore *lc, LinphoneProxyConfig **config);
aymeric's avatar
aymeric committed
1121

1122
LINPHONE_PUBLIC	void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info);
aymeric's avatar
aymeric committed
1123

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

Ghislain MARY's avatar
Ghislain MARY committed
1126
LINPHONE_PUBLIC const MSList *linphone_core_get_auth_info_list(const LinphoneCore *lc);
smorlat's avatar
smorlat committed
1127

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

aymeric's avatar
aymeric committed
1130 1131
void linphone_core_abort_authentication(LinphoneCore *lc,  LinphoneAuthInfo *info);

Sylvain Berfini's avatar
Sylvain Berfini committed
1132
LINPHONE_PUBLIC	void linphone_core_clear_all_auth_info(LinphoneCore *lc);
aymeric's avatar
aymeric committed
1133

1134 1135 1136 1137
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
1138 1139 1140
int linphone_core_get_audio_jittcomp(LinphoneCore *lc);

void linphone_core_set_audio_jittcomp(LinphoneCore *lc, int value);
1141 1142 1143 1144 1145 1146 1147 1148

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
1149

1150
LINPHONE_PUBLIC	int linphone_core_get_audio_port(const LinphoneCore *lc);
aymeric's avatar
aymeric committed
1151

1152
LINPHONE_PUBLIC	void linphone_core_get_audio_port_range(const LinphoneCore *lc, int *min_port, int *max_port);
1153

1154
LINPHONE_PUBLIC	int linphone_core_get_video_port(const LinphoneCore *lc);
aymeric's avatar
aymeric committed
1155

1156
LINPHONE_PUBLIC	void linphone_core_get_video_port_range(const LinphoneCore *lc, int *min_port, int *max_port);
1157

1158
LINPHONE_PUBLIC	int linphone_core_get_nortp_timeout(const LinphoneCore *lc);
aymeric's avatar
aymeric committed
1159

1160
LINPHONE_PUBLIC	void linphone_core_set_audio_port(LinphoneCore *lc, int port);
aymeric's avatar
aymeric committed
1161

1162
LINPHONE_PUBLIC	void linphone_core_set_audio_port_range(LinphoneCore *lc, int min_port, int max_port);
1163

1164
LINPHONE_PUBLIC	void linphone_core_set_video_port(LinphoneCore *lc, int port);
aymeric's avatar
aymeric committed
1165

1166
LINPHONE_PUBLIC	void linphone_core_set_video_port_range(LinphoneCore *lc, int min_port, int max_port);
1167

1168
LINPHONE_PUBLIC	void linphone_core_set_nortp_timeout(LinphoneCore *lc, int port);
aymeric's avatar
aymeric committed
1169

1170
LINPHONE_PUBLIC	void linphone_core_set_use_info_for_dtmf(LinphoneCore *lc, bool_t use_info);
aymeric's avatar
aymeric committed
1171

1172
LINPHONE_PUBLIC	bool_t linphone_core_get_use_info_for_dtmf(LinphoneCore *lc);
aymeric's avatar
aymeric committed
1173

1174
LINPHONE_PUBLIC	void linphone_core_set_use_rfc2833_for_dtmf(LinphoneCore *lc,bool_t use_rfc2833);
1175

1176
LINPHONE_PUBLIC	bool_t linphone_core_get_use_rfc2833_for_dtmf(LinphoneCore *lc);
1177

1178
LINPHONE_PUBLIC	void linphone_core_set_sip_port(LinphoneCore *lc, int port);
1179

1180
LINPHONE_PUBLIC	int linphone_core_get_sip_port(LinphoneCore *lc);
aymeric's avatar
aymeric committed
1181

1182
LINPHONE_PUBLIC	int linphone_core_set_sip_transports(LinphoneCore *lc, const LCSipTransports *transports);
1183

1184
LINPHONE_PUBLIC	int linphone_core_get_sip_transports(LinphoneCore *lc, LCSipTransports *transports);
jehan's avatar
jehan committed
1185
/**
1186
 *
jehan's avatar
jehan committed
1187 1188 1189 1190
 * 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
 */
1191 1192
ortp_socket_t linphone_core_get_sip_socket(LinphoneCore *lc);

1193
LINPHONE_PUBLIC	void linphone_core_set_inc_timeout(LinphoneCore *lc, int seconds);
aymeric's avatar
aymeric committed
1194

1195
LINPHONE_PUBLIC	int linphone_core_get_inc_timeout(LinphoneCore *lc);
aymeric's avatar
aymeric committed
1196

1197
LINPHONE_PUBLIC	void linphone_core_set_in_call_timeout(LinphoneCore *lc, int seconds);