3 Copyright (C) 2000 - 2010 Simon MORLAT (simon.morlat@linphone.org)
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 #ifndef LINPHONECORE_H
20 #define LINPHONECORE_H
22 #include "ortp/ortp.h"
23 #include "ortp/payloadtype.h"
24 #include "mediastreamer2/mscommon.h"
25 #include "mediastreamer2/msvideo.h"
30 #include "linphone/sipsetup.h"
33 #define LINPHONE_IPADDR_SIZE 64
34 #define LINPHONE_HOSTNAME_SIZE 128
48 * Object that represents a SIP address.
50 * The LinphoneAddress is an opaque object to represents SIP addresses, ie
51 * the content of SIP's 'from' and 'to' headers.
52 * A SIP address is made of display name, username, domain name, port, and various
53 * uri headers (such as tags). It looks like 'Alice <sip:alice@example.net>'.
54 * The LinphoneAddress has methods to extract and manipulate all parts of the address.
55 * When some part of the address (for example the username) is empty, the accessor methods
58 * @ingroup linphone_address
59 * @var LinphoneAddress
61 typedef struct SalAddress LinphoneAddress;
63 LinphoneAddress * linphone_address_new(const char *uri);
64 LinphoneAddress * linphone_address_clone(const LinphoneAddress *uri);
65 const char *linphone_address_get_scheme(const LinphoneAddress *u);
66 const char *linphone_address_get_display_name(const LinphoneAddress* u);
67 char *linphone_address_get_display_name_unquoted(const LinphoneAddress *u);
68 const char *linphone_address_get_username(const LinphoneAddress *u);
69 const char *linphone_address_get_domain(const LinphoneAddress *u);
70 void linphone_address_set_display_name(LinphoneAddress *u, const char *display_name);
71 void linphone_address_set_username(LinphoneAddress *uri, const char *username);
72 void linphone_address_set_domain(LinphoneAddress *uri, const char *host);
73 void linphone_address_set_port(LinphoneAddress *uri, const char *port);
74 void linphone_address_set_port_int(LinphoneAddress *uri, int port);
75 /*remove tags, params etc... so that it is displayable to the user*/
76 void linphone_address_clean(LinphoneAddress *uri);
77 char *linphone_address_as_string(const LinphoneAddress *u);
78 char *linphone_address_as_string_uri_only(const LinphoneAddress *u);
79 void linphone_address_destroy(LinphoneAddress *u);
81 struct _SipSetupContext;
84 * The LinphoneCall object represents a call issued or received by the LinphoneCore
87 typedef struct _LinphoneCall LinphoneCall;
89 bool_t linphone_call_asked_to_autoanswer(struct _LinphoneCall *call);
92 * Enum representing the direction of a call.
95 enum _LinphoneCallDir {
96 LinphoneCallOutgoing, /**< outgoing calls*/
97 LinphoneCallIncoming /**< incoming calls*/
104 typedef enum _LinphoneCallDir LinphoneCallDir;
107 * Enum representing the status of a call
110 typedef enum _LinphoneCallStatus {
111 LinphoneCallSuccess, /**< The call was sucessful*/
112 LinphoneCallAborted, /**< The call was aborted */
113 LinphoneCallMissed /**< The call was missed (unanswered)*/
114 } LinphoneCallStatus;
117 * Structure representing a call log.
122 typedef struct _LinphoneCallLog{
123 LinphoneCallDir dir; /**< The direction of the call*/
124 LinphoneCallStatus status; /**< The status of the call*/
125 LinphoneAddress *from; /**<Originator of the call as a LinphoneAddress object*/
126 LinphoneAddress *to; /**<Destination of the call as a LinphoneAddress object*/
127 char start_date[128]; /**<Human readable string containg the start date*/
128 int duration; /**<Duration of the call in seconds*/
131 rtp_stats_t local_stats;
132 rtp_stats_t remote_stats;
133 struct _LinphoneCore *lc;
139 void linphone_call_log_set_user_pointer(LinphoneCallLog *cl, void *up);
140 void *linphone_call_log_get_user_pointer(const LinphoneCallLog *cl);
141 void linphone_call_log_set_ref_key(LinphoneCallLog *cl, const char *refkey);
142 const char *linphone_call_log_get_ref_key(const LinphoneCallLog *cl);
143 const rtp_stats_t *linphone_call_log_get_local_stats(const LinphoneCallLog *cl);
144 const rtp_stats_t *linphone_call_log_get_remote_stats(const LinphoneCallLog *cl);
145 char * linphone_call_log_to_str(LinphoneCallLog *cl);
151 }LinphoneSubscribePolicy;
153 typedef enum _LinphoneOnlineStatus{
154 LINPHONE_STATUS_OFFLINE,
155 LINPHONE_STATUS_ONLINE,
156 LINPHONE_STATUS_BUSY,
157 LINPHONE_STATUS_BERIGHTBACK,
158 LINPHONE_STATUS_AWAY,
159 LINPHONE_STATUS_ONTHEPHONE,
160 LINPHONE_STATUS_OUTTOLUNCH,
161 LINPHONE_STATUS_NOT_DISTURB,
162 LINPHONE_STATUS_MOVED,
163 LINPHONE_STATUS_ALT_SERVICE,
164 LINPHONE_STATUS_PENDING,
166 }LinphoneOnlineStatus;
168 const char *linphone_online_status_to_string(LinphoneOnlineStatus ss);
170 struct _LinphoneFriend;
172 typedef struct _LinphoneFriend LinphoneFriend;
174 LinphoneFriend * linphone_friend_new();
175 LinphoneFriend *linphone_friend_new_with_addr(const char *addr);
176 int linphone_friend_set_sip_addr(LinphoneFriend *fr, const char *uri);
177 int linphone_friend_set_name(LinphoneFriend *fr, const char *name);
178 int linphone_friend_send_subscribe(LinphoneFriend *fr, bool_t val);
179 int linphone_friend_set_inc_subscribe_policy(LinphoneFriend *fr, LinphoneSubscribePolicy pol);
180 void linphone_friend_edit(LinphoneFriend *fr);
181 void linphone_friend_done(LinphoneFriend *fr);
182 void linphone_friend_destroy(LinphoneFriend *lf);
183 const LinphoneAddress *linphone_friend_get_address(const LinphoneFriend *lf);
184 bool_t linphone_friend_get_send_subscribe(const LinphoneFriend *lf);
185 LinphoneSubscribePolicy linphone_friend_get_inc_subscribe_policy(const LinphoneFriend *lf);
186 LinphoneOnlineStatus linphone_friend_get_status(const LinphoneFriend *lf);
187 BuddyInfo * linphone_friend_get_info(const LinphoneFriend *lf);
188 void linphone_friend_set_ref_key(LinphoneFriend *lf, const char *key);
189 const char *linphone_friend_get_ref_key(const LinphoneFriend *lf);
190 bool_t linphone_friend_in_list(const LinphoneFriend *lf);
192 #define linphone_friend_url(lf) ((lf)->url)
196 * @addtogroup proxies
200 * The LinphoneProxyConfig object represents a proxy configuration to be used
201 * by the LinphoneCore object.
202 * Its fields must not be used directly in favour of the accessors methods.
203 * Once created and filled properly the LinphoneProxyConfig can be given to
204 * LinphoneCore with linphone_core_add_proxy_config().
205 * This will automatically triggers the registration, if enabled.
207 * The proxy configuration are persistent to restarts because they are saved
208 * in the configuration file. As a consequence, after linphone_core_new() there
209 * might already be a list of configured proxy that can be examined with
210 * linphone_core_get_proxy_config_list().
212 * The default proxy (see linphone_core_set_default_proxy() ) is the one of the list
213 * that is used by default for calls.
215 typedef struct _LinphoneProxyConfig LinphoneProxyConfig;
217 LinphoneProxyConfig *linphone_proxy_config_new(void);
218 int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *server_addr);
219 int linphone_proxy_config_set_identity(LinphoneProxyConfig *obj, const char *identity);
220 int linphone_proxy_config_set_route(LinphoneProxyConfig *obj, const char *route);
221 void linphone_proxy_config_expires(LinphoneProxyConfig *obj, int expires);
222 void linphone_proxy_config_enable_register(LinphoneProxyConfig *obj, bool_t val);
223 #define linphone_proxy_config_enableregister linphone_proxy_config_enable_register
224 void linphone_proxy_config_edit(LinphoneProxyConfig *obj);
225 int linphone_proxy_config_done(LinphoneProxyConfig *obj);
226 void linphone_proxy_config_enable_publish(LinphoneProxyConfig *obj, bool_t val);
227 void linphone_proxy_config_set_dial_escape_plus(LinphoneProxyConfig *cfg, bool_t val);
228 void linphone_proxy_config_set_dial_prefix(LinphoneProxyConfig *cfg, const char *prefix);
230 bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj);
231 const char *linphone_proxy_config_get_domain(const LinphoneProxyConfig *cfg);
233 const char *linphone_proxy_config_get_route(const LinphoneProxyConfig *obj);
234 const char *linphone_proxy_config_get_identity(const LinphoneProxyConfig *obj);
235 bool_t linphone_proxy_config_publish_enabled(const LinphoneProxyConfig *obj);
236 const char *linphone_proxy_config_get_addr(const LinphoneProxyConfig *obj);
237 int linphone_proxy_config_get_expires(const LinphoneProxyConfig *obj);
238 bool_t linphone_proxy_config_register_enabled(const LinphoneProxyConfig *obj);
239 struct _LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyConfig *obj);
241 bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg);
242 const char * linphone_proxy_config_get_dial_prefix(const LinphoneProxyConfig *cfg);
244 /* destruction is called automatically when removing the proxy config */
245 void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg);
246 void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type);
247 SipSetupContext *linphone_proxy_config_get_sip_setup_context(LinphoneProxyConfig *cfg);
248 SipSetup *linphone_proxy_config_get_sip_setup(LinphoneProxyConfig *cfg);
250 * normalize a human readable phone number into a basic string. 888-444-222 becomes 888444222
252 int linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const char *username, char *result, size_t result_len);
254 * attached a user data to a proxy config
256 void linphone_proxy_config_set_user_data(LinphoneProxyConfig *cr, void * ud);
258 * get user data to a proxy config. return null if any
260 void * linphone_proxy_config_get_user_data(LinphoneProxyConfig *cr);
266 typedef struct _LinphoneAccountCreator{
267 struct _LinphoneCore *lc;
268 struct _SipSetupContext *ssctx;
273 }LinphoneAccountCreator;
275 LinphoneAccountCreator *linphone_account_creator_new(struct _LinphoneCore *core, const char *type);
276 void linphone_account_creator_set_username(LinphoneAccountCreator *obj, const char *username);
277 void linphone_account_creator_set_password(LinphoneAccountCreator *obj, const char *password);
278 void linphone_account_creator_set_domain(LinphoneAccountCreator *obj, const char *domain);
279 const char * linphone_account_creator_get_username(LinphoneAccountCreator *obj);
280 const char * linphone_account_creator_get_domain(LinphoneAccountCreator *obj);
281 int linphone_account_creator_test_existence(LinphoneAccountCreator *obj);
282 LinphoneProxyConfig * linphone_account_creator_validate(LinphoneAccountCreator *obj);
283 void linphone_account_creator_destroy(LinphoneAccountCreator *obj);
285 struct _LinphoneAuthInfo;
288 * @ingroup authentication
289 * Object holding authentication information.
291 * @note The object's fields should not be accessed directly. Prefer using
292 * the accessor methods.
294 * In most case, authentication information consists of a username and password.
295 * Sometimes, a userid is required by proxy, and realm can be useful to discriminate
296 * different SIP domains.
298 * Once created and filled, a LinphoneAuthInfo must be added to the LinphoneCore in
299 * order to become known and used automatically when needed.
300 * Use linphone_core_add_auth_info() for that purpose.
302 * The LinphoneCore object can take the initiative to request authentication information
303 * when needed to the application through the auth_info_requested callback of the
304 * LinphoneCoreVTable structure.
306 * The application can respond to this information request later using
307 * linphone_core_add_auth_info(). This will unblock all pending authentication
308 * transactions and retry them with authentication headers.
311 typedef struct _LinphoneAuthInfo LinphoneAuthInfo;
313 LinphoneAuthInfo *linphone_auth_info_new(const char *username, const char *userid,
314 const char *passwd, const char *ha1,const char *realm);
315 void linphone_auth_info_set_passwd(LinphoneAuthInfo *info, const char *passwd);
316 void linphone_auth_info_set_username(LinphoneAuthInfo *info, const char *username);
317 void linphone_auth_info_set_userid(LinphoneAuthInfo *info, const char *userid);
319 const char *linphone_auth_info_get_username(const LinphoneAuthInfo *i);
320 const char *linphone_auth_info_get_passwd(const LinphoneAuthInfo *i);
321 const char *linphone_auth_info_get_userid(const LinphoneAuthInfo *i);
323 /* you don't need those function*/
324 void linphone_auth_info_destroy(LinphoneAuthInfo *info);
325 LinphoneAuthInfo * linphone_auth_info_new_from_config_file(struct _LpConfig *config, int pos);
327 struct _LinphoneChatRoom;
328 typedef struct _LinphoneChatRoom LinphoneChatRoom;
330 LinphoneChatRoom * linphone_core_create_chat_room(struct _LinphoneCore *lc, const char *to);
331 void linphone_chat_room_send_message(LinphoneChatRoom *cr, const char *msg);
332 void linphone_chat_room_destroy(LinphoneChatRoom *cr);
333 void linphone_chat_room_set_user_data(LinphoneChatRoom *cr, void * ud);
334 void * linphone_chat_room_get_user_data(LinphoneChatRoom *cr);
336 /* describes the different groups of states */
337 typedef enum _gstate_group {
343 typedef enum _gstate {
344 /* states for GSTATE_GROUP_POWER */
345 GSTATE_POWER_OFF = 0, /* initial state */
346 GSTATE_POWER_STARTUP,
348 GSTATE_POWER_SHUTDOWN,
349 /* states for GSTATE_GROUP_REG */
350 GSTATE_REG_NONE = 10, /* initial state */
353 /* states for GSTATE_GROUP_CALL */
354 GSTATE_CALL_IDLE = 20, /* initial state */
355 GSTATE_CALL_OUT_INVITE,
356 GSTATE_CALL_OUT_CONNECTED,
357 GSTATE_CALL_IN_INVITE,
358 GSTATE_CALL_IN_CONNECTED,
364 struct _LinphoneGeneralState {
367 gstate_group_t group;
370 typedef struct _LinphoneGeneralState LinphoneGeneralState;
372 /* private: set a new state */
373 void gstate_new_state(struct _LinphoneCore *lc, gstate_t new_state, const char *message);
375 void gstate_initialize(struct _LinphoneCore *lc) ;
378 * @addtogroup initializing
382 /** Callback prototype */
383 typedef void (*ShowInterfaceCb)(struct _LinphoneCore *lc);
384 /** Callback prototype */
385 typedef void (*InviteReceivedCb)(struct _LinphoneCore *lc, const char *from);
386 /** Callback prototype */
387 typedef void (*ByeReceivedCb)(struct _LinphoneCore *lc, const char *from);
388 /** Callback prototype */
389 typedef void (*DisplayStatusCb)(struct _LinphoneCore *lc, const char *message);
390 /** Callback prototype */
391 typedef void (*DisplayMessageCb)(struct _LinphoneCore *lc, const char *message);
392 /** Callback prototype */
393 typedef void (*DisplayUrlCb)(struct _LinphoneCore *lc, const char *message, const char *url);
394 /** Callback prototype */
395 typedef void (*DisplayQuestionCb)(struct _LinphoneCore *lc, const char *message);
396 /** Callback prototype */
397 typedef void (*LinphoneCoreCbFunc)(struct _LinphoneCore *lc,void * user_data);
398 /** Callback prototype */
399 typedef void (*NotifyReceivedCb)(struct _LinphoneCore *lc, const char *from, const char *msg);
400 /** Callback prototype */
401 typedef void (*NotifyPresenceReceivedCb)(struct _LinphoneCore *lc, LinphoneFriend * fid);
402 /** Callback prototype */
403 typedef void (*NewUnknownSubscriberCb)(struct _LinphoneCore *lc, LinphoneFriend *lf, const char *url);
404 /** Callback prototype */
405 typedef void (*AuthInfoRequested)(struct _LinphoneCore *lc, const char *realm, const char *username);
406 /** Callback prototype */
407 typedef void (*CallLogUpdated)(struct _LinphoneCore *lc, struct _LinphoneCallLog *newcl);
408 /** Callback prototype */
409 typedef void (*TextMessageReceived)(struct _LinphoneCore *lc, LinphoneChatRoom *room, const char *from, const char *message);
410 /** Callback prototype */
411 typedef void (*GeneralStateChange)(struct _LinphoneCore *lc, LinphoneGeneralState *gstate);
412 /** Callback prototype */
413 typedef void (*DtmfReceived)(struct _LinphoneCore* lc, int dtmf);
414 /** Callback prototype */
415 typedef void (*ReferReceived)(struct _LinphoneCore *lc, const char *refer_to);
416 /** Callback prototype */
417 typedef void (*BuddyInfoUpdated)(struct _LinphoneCore *lc, LinphoneFriend *lf);
420 * This structure holds all callbacks that the application should implement.
423 typedef struct _LinphoneVTable
425 ShowInterfaceCb show; /**< Notifies the application that it should show up*/
426 InviteReceivedCb inv_recv; /**< Notifies incoming calls */
427 ByeReceivedCb bye_recv; /**< Notify calls terminated by far end*/
428 NotifyPresenceReceivedCb notify_presence_recv; /**< Notify received presence events*/
429 NewUnknownSubscriberCb new_unknown_subscriber; /**< Notify about unknown subscriber */
430 AuthInfoRequested auth_info_requested; /**< Ask the application some authentication information */
431 DisplayStatusCb display_status; /**< Callback that notifies various events with human readable text.*/
432 DisplayMessageCb display_message;/**< Callback to display a message to the user */
433 DisplayMessageCb display_warning;/** Callback to display a warning to the user */
434 DisplayUrlCb display_url;
435 DisplayQuestionCb display_question;
436 CallLogUpdated call_log_updated; /**< Notifies that call log list has been updated */
437 TextMessageReceived text_received; /**< A text message has been received */
438 GeneralStateChange general_state; /**< State notification callback */
439 DtmfReceived dtmf_received; /**< A dtmf has been received received */
440 ReferReceived refer_received; /**< A refer was received */
441 BuddyInfoUpdated buddy_info_updated; /**< a LinphoneFriend's BuddyInfo has changed*/
442 NotifyReceivedCb notify_recv; /**< Other notifications*/
443 } LinphoneCoreVTable;
449 typedef struct _LCCallbackObj
451 LinphoneCoreCbFunc _func;
457 typedef enum _LinphoneFirewallPolicy{
458 LINPHONE_POLICY_NO_FIREWALL,
459 LINPHONE_POLICY_USE_NAT_ADDRESS,
460 LINPHONE_POLICY_USE_STUN
461 } LinphoneFirewallPolicy;
463 typedef enum _LinphoneWaitingState{
464 LinphoneWaitingStart,
465 LinphoneWaitingProgress,
466 LinphoneWaitingFinished
467 } LinphoneWaitingState;
468 typedef void * (*LinphoneWaitingCallback)(struct _LinphoneCore *lc, void *context, LinphoneWaitingState ws, const char *purpose, float progress);
470 typedef struct _LinphoneCore LinphoneCore;
474 void linphone_core_enable_logs(FILE *file);
475 void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc);
476 void linphone_core_disable_logs(void);
477 /*sets the user-agent string in sip messages, must be set before linphone_core_new() or linphone_core_init() */
478 void linphone_core_set_user_agent(const char *ua_name, const char *version);
479 const char *linphone_core_get_version(void);
481 LinphoneCore *linphone_core_new(const LinphoneCoreVTable *vtable,
482 const char *config_path, const char *factory_config, void* userdata);
484 /* function to be periodically called in a main loop */
485 void linphone_core_iterate(LinphoneCore *lc);
487 LinphoneAddress * linphone_core_interpret_url(LinphoneCore *lc, const char *url);
489 int linphone_core_invite(LinphoneCore *lc, const char *url);
491 int linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddress *addr);
493 int linphone_core_refer(LinphoneCore *lc, const char *url);
495 bool_t linphone_core_inc_invite_pending(LinphoneCore*lc);
497 bool_t linphone_core_in_call(const LinphoneCore *lc);
499 LinphoneCall *linphone_core_get_current_call(LinphoneCore *lc);
501 int linphone_core_accept_call(LinphoneCore *lc, const char *url);
503 int linphone_core_terminate_call(LinphoneCore *lc, const char *url);
505 void linphone_core_send_dtmf(LinphoneCore *lc,char dtmf);
507 int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact);
509 const char *linphone_core_get_primary_contact(LinphoneCore *lc);
511 void linphone_core_set_guess_hostname(LinphoneCore *lc, bool_t val);
512 bool_t linphone_core_get_guess_hostname(LinphoneCore *lc);
514 bool_t linphone_core_ipv6_enabled(LinphoneCore *lc);
515 void linphone_core_enable_ipv6(LinphoneCore *lc, bool_t val);
517 LinphoneAddress *linphone_core_get_primary_contact_parsed(LinphoneCore *lc);
519 /*0= no bandwidth limit*/
520 void linphone_core_set_download_bandwidth(LinphoneCore *lc, int bw);
521 void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw);
523 int linphone_core_get_download_bandwidth(const LinphoneCore *lc);
524 int linphone_core_get_upload_bandwidth(const LinphoneCore *lc);
526 * set audio packetization time linphone expect to received from peer
527 * @ingroup media_parameters
530 void linphone_core_set_download_ptime(LinphoneCore *lc, int ptime);
532 * get audio packetization time linphone expect to received from peer, 0 means unspecified
533 * @ingroup media_parameters
535 int linphone_core_get_download_ptime(LinphoneCore *lc);
537 #ifdef VINCENT_MAURY_RSVP
539 int linphone_core_set_rpc_mode(LinphoneCore *lc, int on); /* on = 1 (RPC_ENABLE = 1) */
540 int linphone_core_set_rsvp_mode(LinphoneCore *lc, int on); /* on = 1 (RSVP_ENABLE = 1) */
541 int linphone_core_change_qos(LinphoneCore *lc, int answer); /* answer = 1 for yes, 0 for no */
544 /* returns a MSList of PayloadType */
545 const MSList *linphone_core_get_audio_codecs(const LinphoneCore *lc);
547 int linphone_core_set_audio_codecs(LinphoneCore *lc, MSList *codecs);
548 /* returns a MSList of PayloadType */
549 const MSList *linphone_core_get_video_codecs(const LinphoneCore *lc);
551 int linphone_core_set_video_codecs(LinphoneCore *lc, MSList *codecs);
553 bool_t linphone_core_payload_type_enabled(LinphoneCore *lc, PayloadType *pt);
555 int linphone_core_enable_payload_type(LinphoneCore *lc, PayloadType *pt, bool_t enable);
557 const char *linphone_core_get_payload_type_description(LinphoneCore *lc, PayloadType *pt);
559 bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, PayloadType *pt);
561 int linphone_core_add_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *config);
563 void linphone_core_clear_proxy_config(LinphoneCore *lc);
565 void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *config);
567 const MSList *linphone_core_get_proxy_config_list(const LinphoneCore *lc);
569 void linphone_core_set_default_proxy(LinphoneCore *lc, LinphoneProxyConfig *config);
571 void linphone_core_set_default_proxy_index(LinphoneCore *lc, int index);
573 int linphone_core_get_default_proxy(LinphoneCore *lc, LinphoneProxyConfig **config);
575 void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info);
577 void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info);
579 const MSList *linphone_core_get_auth_info_list(const LinphoneCore *lc);
581 const LinphoneAuthInfo *linphone_core_find_auth_info(LinphoneCore *lc, const char *realm, const char *username);
583 void linphone_core_abort_authentication(LinphoneCore *lc, LinphoneAuthInfo *info);
585 void linphone_core_clear_all_auth_info(LinphoneCore *lc);
587 int linphone_core_get_audio_jittcomp(LinphoneCore *lc);
589 void linphone_core_set_audio_jittcomp(LinphoneCore *lc, int value);
591 int linphone_core_get_audio_port(const LinphoneCore *lc);
593 int linphone_core_get_video_port(const LinphoneCore *lc);
595 int linphone_core_get_nortp_timeout(const LinphoneCore *lc);
597 void linphone_core_set_audio_port(LinphoneCore *lc, int port);
599 void linphone_core_set_video_port(LinphoneCore *lc, int port);
601 void linphone_core_set_nortp_timeout(LinphoneCore *lc, int port);
603 void linphone_core_set_use_info_for_dtmf(LinphoneCore *lc, bool_t use_info);
605 bool_t linphone_core_get_use_info_for_dtmf(LinphoneCore *lc);
607 void linphone_core_set_use_rfc2833_for_dtmf(LinphoneCore *lc,bool_t use_rfc2833);
609 bool_t linphone_core_get_use_rfc2833_for_dtmf(LinphoneCore *lc);
611 int linphone_core_get_sip_port(LinphoneCore *lc);
613 int linphone_core_set_sip_port(LinphoneCore *lc,int port);
615 ortp_socket_t linphone_core_get_sip_socket(LinphoneCore *lc);
617 void linphone_core_set_inc_timeout(LinphoneCore *lc, int seconds);
619 int linphone_core_get_inc_timeout(LinphoneCore *lc);
621 void linphone_core_set_stun_server(LinphoneCore *lc, const char *server);
623 const char * linphone_core_get_stun_server(const LinphoneCore *lc);
625 void linphone_core_set_nat_address(LinphoneCore *lc, const char *addr);
627 const char *linphone_core_get_nat_address(const LinphoneCore *lc);
629 void linphone_core_set_firewall_policy(LinphoneCore *lc, LinphoneFirewallPolicy pol);
631 LinphoneFirewallPolicy linphone_core_get_firewall_policy(const LinphoneCore *lc);
633 const char * linphone_core_get_relay_addr(const LinphoneCore *lc);
635 int linphone_core_set_relay_addr(LinphoneCore *lc, const char *addr);
637 /* sound functions */
638 /* returns a null terminated static array of string describing the sound devices */
639 const char** linphone_core_get_sound_devices(LinphoneCore *lc);
640 bool_t linphone_core_sound_device_can_capture(LinphoneCore *lc, const char *device);
641 bool_t linphone_core_sound_device_can_playback(LinphoneCore *lc, const char *device);
642 int linphone_core_get_ring_level(LinphoneCore *lc);
643 int linphone_core_get_play_level(LinphoneCore *lc);
644 int linphone_core_get_rec_level(LinphoneCore *lc);
645 void linphone_core_set_ring_level(LinphoneCore *lc, int level);
646 void linphone_core_set_play_level(LinphoneCore *lc, int level);
648 * Allow to control play level before entering sound card: level in db
650 * @ingroup media_parameters
652 void linphone_core_set_soft_play_level(LinphoneCore *lc, float level);
654 * get play level before entering sound card: level in db
656 * @ingroup media_parameters
658 float linphone_core_get_soft_play_level(LinphoneCore *lc);
659 void linphone_core_set_rec_level(LinphoneCore *lc, int level);
660 const char * linphone_core_get_ringer_device(LinphoneCore *lc);
661 const char * linphone_core_get_playback_device(LinphoneCore *lc);
662 const char * linphone_core_get_capture_device(LinphoneCore *lc);
663 int linphone_core_set_ringer_device(LinphoneCore *lc, const char * devid);
664 int linphone_core_set_playback_device(LinphoneCore *lc, const char * devid);
665 int linphone_core_set_capture_device(LinphoneCore *lc, const char * devid);
666 char linphone_core_get_sound_source(LinphoneCore *lc);
667 void linphone_core_set_sound_source(LinphoneCore *lc, char source);
668 void linphone_core_set_ring(LinphoneCore *lc, const char *path);
669 const char *linphone_core_get_ring(const LinphoneCore *lc);
670 void linphone_core_set_ringback(LinphoneCore *lc, const char *path);
671 const char * linphone_core_get_ringback(const LinphoneCore *lc);
672 int linphone_core_preview_ring(LinphoneCore *lc, const char *ring,LinphoneCoreCbFunc func,void * userdata);
673 void linphone_core_enable_echo_cancellation(LinphoneCore *lc, bool_t val);
674 bool_t linphone_core_echo_cancellation_enabled(LinphoneCore *lc);
676 void linphone_core_enable_echo_limiter(LinphoneCore *lc, bool_t val);
677 bool_t linphone_core_echo_limiter_enabled(const LinphoneCore *lc);
679 void linphone_core_enable_agc(LinphoneCore *lc, bool_t val);
680 bool_t linphone_core_agc_enabled(const LinphoneCore *lc);
682 void linphone_core_mute_mic(LinphoneCore *lc, bool_t muted);
686 * @ingroup media_parameters
688 bool_t linphone_core_is_mic_muted(LinphoneCore *lc);
690 void linphone_core_set_presence_info(LinphoneCore *lc,int minutes_away,const char *contact,LinphoneOnlineStatus os);
692 LinphoneOnlineStatus linphone_core_get_presence_info(const LinphoneCore *lc);
694 void linphone_core_interpret_friend_uri(LinphoneCore *lc, const char *uri, char **result);
695 void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *fr);
696 void linphone_core_remove_friend(LinphoneCore *lc, LinphoneFriend *fr);
697 void linphone_core_reject_subscriber(LinphoneCore *lc, LinphoneFriend *lf);
698 /* a list of LinphoneFriend */
699 const MSList * linphone_core_get_friend_list(const LinphoneCore *lc);
700 /* notify all friends that have subscribed */
701 void linphone_core_notify_all_friends(LinphoneCore *lc, LinphoneOnlineStatus os);
702 LinphoneFriend *linphone_core_get_friend_by_address(const LinphoneCore *lc, const char *addr);
703 LinphoneFriend *linphone_core_get_friend_by_ref_key(const LinphoneCore *lc, const char *key);
705 /* returns a list of LinphoneCallLog */
706 const MSList * linphone_core_get_call_logs(LinphoneCore *lc);
707 void linphone_core_clear_call_logs(LinphoneCore *lc);
710 void linphone_core_enable_video(LinphoneCore *lc, bool_t vcap_enabled, bool_t display_enabled);
711 bool_t linphone_core_video_enabled(LinphoneCore *lc);
713 typedef struct MSVideoSizeDef{
717 /* returns a zero terminated table of MSVideoSizeDef*/
718 const MSVideoSizeDef *linphone_core_get_supported_video_sizes(LinphoneCore *lc);
719 void linphone_core_set_preferred_video_size(LinphoneCore *lc, MSVideoSize vsize);
720 MSVideoSize linphone_core_get_preferred_video_size(LinphoneCore *lc);
721 void linphone_core_set_preferred_video_size_by_name(LinphoneCore *lc, const char *name);
723 void linphone_core_enable_video_preview(LinphoneCore *lc, bool_t val);
724 bool_t linphone_core_video_preview_enabled(const LinphoneCore *lc);
726 void linphone_core_enable_self_view(LinphoneCore *lc, bool_t val);
727 bool_t linphone_core_self_view_enabled(const LinphoneCore *lc);
730 /* returns a null terminated static array of string describing the webcams */
731 const char** linphone_core_get_video_devices(const LinphoneCore *lc);
732 int linphone_core_set_video_device(LinphoneCore *lc, const char *id);
733 const char *linphone_core_get_video_device(const LinphoneCore *lc);
735 /* Set static picture to be used when "Static picture" is the video device */
736 int linphone_core_set_static_picture(LinphoneCore *lc, const char *path);
738 /*function to be used for eventually setting window decorations (icons, title...)*/
739 unsigned long linphone_core_get_native_video_window_id(const LinphoneCore *lc);
742 /*play/record support: use files instead of soundcard*/
743 void linphone_core_use_files(LinphoneCore *lc, bool_t yesno);
744 void linphone_core_set_play_file(LinphoneCore *lc, const char *file);
745 void linphone_core_set_record_file(LinphoneCore *lc, const char *file);
747 gstate_t linphone_core_get_state(const LinphoneCore *lc, gstate_group_t group);
748 int linphone_core_get_current_call_duration(const LinphoneCore *lc);
749 const LinphoneAddress *linphone_core_get_remote_uri(LinphoneCore *lc);
751 int linphone_core_get_mtu(const LinphoneCore *lc);
752 void linphone_core_set_mtu(LinphoneCore *lc, int mtu);
755 * This method is called by the application to notify the linphone core library when network is reachable.
756 * Calling this method with true trigger linphone to initiate a registration process for all proxy
757 * configuration with parameter register set to enable.
758 * This method disable the automatic registration mode. It means you must call this method after each network state changes
761 void linphone_core_set_network_reachable(LinphoneCore* lc,bool_t value);
763 * return network state either as positioned by the application or by linphone
765 bool_t linphone_core_is_network_reachabled(LinphoneCore* lc);
768 void *linphone_core_get_user_data(LinphoneCore *lc);
770 /* returns LpConfig object to read/write to the config file: usefull if you wish to extend
771 the config file with your own sections */
772 struct _LpConfig *linphone_core_get_config(LinphoneCore *lc);
774 /* attempts to wake up another linphone engine already running.
775 The "show" callback is called for the other linphone, causing gui to show up.
776 call_addr is an optional sip-uri to call immediately after waking up.
777 The method returns 0 if an already running linphone was found*/
779 int linphone_core_wake_up_possible_already_running_instance(
780 const char * config_file, const char * call_addr);
782 /*set a callback for some blocking operations, it takes you informed of the progress of the operation*/
783 void linphone_core_set_waiting_callback(LinphoneCore *lc, LinphoneWaitingCallback cb, void *user_context);
785 /*returns the list of registered SipSetup (linphonecore plugins) */
786 const MSList * linphone_core_get_sip_setups(LinphoneCore *lc);
788 void linphone_core_destroy(LinphoneCore *lc);
790 /*for advanced users:*/
791 void linphone_core_set_audio_transports(LinphoneCore *lc, RtpTransport *rtp, RtpTransport *rtcp);
793 int linphone_core_get_current_call_stats(LinphoneCore *lc, rtp_stats_t *local, rtp_stats_t *remote);