source: mediastreamer2/linphone/coreapi/linphonecore.h @ 295:7c2d63cfbe15

Last change on this file since 295:7c2d63cfbe15 was 295:7c2d63cfbe15, checked in by smorlat <smorlat@…>, 4 years ago

fix bug when adding contacts
sipsetup plugins work in progress.

git-svn-id: svn+ssh://svn.savannah.nongnu.org/linphone/trunk@298 3f6dc0c8-ddfe-455d-9043-3cd528dc4637

File size: 26.0 KB
Line 
1/*
2linphone
3Copyright (C) 2000  Simon MORLAT (simon.morlat@linphone.org)
4
5This program is free software; you can redistribute it and/or
6modify it under the terms of the GNU General Public License
7as published by the Free Software Foundation; either version 2
8of the License, or (at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18*/
19#ifndef LINPHONECORE_H
20#define LINPHONECORE_H
21
22
23#include <osipparser2/osip_message.h>
24#include "ortp/ortp.h"
25#include "ortp/payloadtype.h"
26#include "mediastreamer2/mscommon.h"
27#include "mediastreamer2/msvideo.h"
28
29#ifdef IN_LINPHONE
30#include "sipsetup.h"
31#else
32#include "linphone/sipsetup.h"
33#endif
34
35#define LINPHONE_IPADDR_SIZE 64
36#define LINPHONE_HOSTNAME_SIZE 128
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42struct _MSSndCard;
43struct _LinphoneCore;
44
45bool_t payload_type_enabled(struct _PayloadType *pt);
46void payload_type_set_enable(struct _PayloadType *pt,int value);
47const char *payload_type_get_description(struct _PayloadType *pt);
48int payload_type_get_bitrate(PayloadType *pt);
49const char *payload_type_get_mime(PayloadType *pt);
50int payload_type_get_rate(PayloadType *pt);
51
52
53struct _LpConfig;
54
55typedef struct sip_config
56{
57        char *contact;
58        char *guessed_contact;
59        int sip_port;
60        MSList *proxies;
61        MSList *deleted_proxies;
62        int inc_timeout;        /*timeout after an un-answered incoming call is rejected*/
63        bool_t use_info;
64        bool_t guess_hostname;
65        bool_t loopback_only;
66        bool_t ipv6_enabled;
67        bool_t sdp_200_ack;
68        bool_t only_one_codec; /*in SDP answers*/
69} sip_config_t;
70
71typedef struct rtp_config
72{
73        int audio_rtp_port;
74        int video_rtp_port;
75        int audio_jitt_comp;  /*jitter compensation*/
76        int video_jitt_comp;  /*jitter compensation*/
77        int nortp_timeout;
78}rtp_config_t;
79
80
81
82typedef struct net_config
83{
84        char *nat_address;
85        char *stun_server;
86        char *relay;
87        int download_bw;
88        int upload_bw;
89        int firewall_policy;
90        int mtu;
91        bool_t nat_sdp_only;
92}net_config_t;
93
94
95typedef struct sound_config
96{
97        struct _MSSndCard * ring_sndcard;       /* the playback sndcard currently used */
98        struct _MSSndCard * play_sndcard;       /* the playback sndcard currently used */
99        struct _MSSndCard * capt_sndcard; /* the capture sndcard currently used */
100        const char **cards;
101        int latency;    /* latency in samples of the current used sound device */
102        char rec_lev;
103        char play_lev;
104        char ring_lev;
105        char source;
106        char pad;
107        char *local_ring;
108        char *remote_ring;
109        bool_t ec;
110} sound_config_t;
111
112typedef struct codecs_config
113{
114        MSList *audio_codecs;  /* list of audio codecs in order of preference*/
115        MSList *video_codecs;   /* for later use*/
116}codecs_config_t;
117
118typedef struct video_config{
119        struct _MSWebCam *device;
120        const char **cams;
121        MSVideoSize vsize;
122        bool_t capture;
123        bool_t show_local;
124        bool_t display;
125        bool_t selfview; /*during calls*/
126}video_config_t;
127
128typedef struct ui_config
129{
130        int is_daemon;
131        int is_applet;
132        unsigned int timer_id;  /* the timer id for registration */
133}ui_config_t;
134
135
136
137typedef struct autoreplier_config
138{
139        int enabled;
140        int after_seconds;              /* accept the call after x seconds*/
141        int max_users;                  /* maximum number of user that can call simultaneously */
142        int max_rec_time;       /* the max time of incoming voice recorded */
143        int max_rec_msg;                /* maximum number of recorded messages */
144        const char *message;            /* the path of the file to be played */
145}autoreplier_config_t;
146
147
148struct _LinphoneCore;
149struct _sdp_context;
150struct _SipSetupContext;
151       
152typedef struct _StreamParams
153{
154        int initialized;
155        int line;
156        int localport;
157        int remoteport;
158        int remotertcpport;
159        int pt;
160        char *relay_session_id;
161        int natd_port;
162        char remoteaddr[LINPHONE_HOSTNAME_SIZE];
163        char natd_addr[LINPHONE_HOSTNAME_SIZE];
164} StreamParams;
165
166typedef enum _LCState{
167        LCStateInit,
168        LCStateRinging,
169        LCStateAVRunning
170}LCState;
171
172typedef enum _LinphoneCallDir {LinphoneCallOutgoing, LinphoneCallIncoming} LinphoneCallDir;
173
174
175typedef struct _LinphoneCall
176{
177        struct _LinphoneCore *core;
178        StreamParams audio_params;
179        StreamParams video_params;
180        LinphoneCallDir dir;
181        struct _RtpProfile *profile;    /*points to the local_profile or to the remote "guessed" profile*/
182        struct _LinphoneCallLog *log;
183        int cid; /*call id */
184        int did; /*dialog id */
185        int tid; /*last transaction id*/
186        struct _sdp_context *sdpctx;
187        time_t start_time;
188        LCState state;
189        bool_t auth_pending;   
190} LinphoneCall;
191
192LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, const osip_from_t *from, const osip_to_t *to);
193LinphoneCall * linphone_call_new_incoming(struct _LinphoneCore *lc, const char *from, const char *to, int cid, int did , int tid);
194#define linphone_call_set_state(lcall,st)       (lcall)->state=(st)
195void linphone_call_destroy(struct _LinphoneCall *obj);
196
197
198typedef enum _LinphoneCallStatus { 
199        LinphoneCallSuccess,
200        LinphoneCallAborted,
201        LinphoneCallMissed
202} LinphoneCallStatus;
203
204typedef struct _LinphoneCallLog{
205        LinphoneCallDir dir;
206        LinphoneCallStatus status;
207        char *from;
208        char *to;
209        char start_date[128];
210        int duration;
211       
212} LinphoneCallLog;
213
214/* private: */
215LinphoneCallLog * linphone_call_log_new(LinphoneCall *call, char *local, char * remote);
216void linphone_call_log_completed(LinphoneCallLog *calllog, LinphoneCall *call);
217void linphone_call_log_destroy(LinphoneCallLog *cl);
218
219/*public: */
220char * linphone_call_log_to_str(LinphoneCallLog *cl);
221
222typedef enum{
223        LinphoneSPWait,
224        LinphoneSPDeny,
225        LinphoneSPAccept
226}LinphoneSubscribePolicy;
227
228typedef enum _LinphoneOnlineStatus{
229        LINPHONE_STATUS_UNKNOWN,
230        LINPHONE_STATUS_ONLINE,
231        LINPHONE_STATUS_BUSY,
232        LINPHONE_STATUS_BERIGHTBACK,
233        LINPHONE_STATUS_AWAY,
234        LINPHONE_STATUS_ONTHEPHONE,
235        LINPHONE_STATUS_OUTTOLUNCH,
236        LINPHONE_STATUS_NOT_DISTURB,
237        LINPHONE_STATUS_MOVED,
238        LINPHONE_STATUS_ALT_SERVICE,
239        LINPHONE_STATUS_OFFLINE,
240        LINPHONE_STATUS_PENDING,
241        LINPHONE_STATUS_CLOSED,
242        LINPHONE_STATUS_END
243}LinphoneOnlineStatus;
244
245const char *linphone_online_status_to_string(LinphoneOnlineStatus ss);
246
247typedef struct _LinphoneFriend{
248        osip_from_t *url;
249        int in_did;
250        int out_did;
251        int sid;
252        int nid;
253        LinphoneSubscribePolicy pol;
254        LinphoneOnlineStatus status;
255        struct _LinphoneProxyConfig *proxy;
256        struct _LinphoneCore *lc;
257        bool_t subscribe;
258        bool_t inc_subscribe_pending;
259}LinphoneFriend;       
260
261LinphoneFriend * linphone_friend_new();
262LinphoneFriend *linphone_friend_new_with_addr(const char *addr);
263int linphone_friend_set_sip_addr(LinphoneFriend *fr, const char *uri);
264int linphone_friend_set_name(LinphoneFriend *fr, const char *name);
265int linphone_friend_send_subscribe(LinphoneFriend *fr, bool_t val);
266int linphone_friend_set_inc_subscribe_policy(LinphoneFriend *fr, LinphoneSubscribePolicy pol);
267int linphone_friend_set_proxy(LinphoneFriend *fr, struct _LinphoneProxyConfig *cfg);
268void linphone_friend_edit(LinphoneFriend *fr);
269void linphone_friend_done(LinphoneFriend *fr);
270void linphone_friend_destroy(LinphoneFriend *lf);
271/* memory returned by those 3 functions must be freed */
272char *linphone_friend_get_name(LinphoneFriend *lf);
273char *linphone_friend_get_addr(LinphoneFriend *lf);
274char *linphone_friend_get_url(LinphoneFriend *lf);      /* name <sip address> */
275bool_t linphone_friend_get_send_subscribe(const LinphoneFriend *lf);
276LinphoneSubscribePolicy linphone_friend_get_inc_subscribe_policy(const LinphoneFriend *lf);
277LinphoneOnlineStatus linphone_friend_get_status(const LinphoneFriend *lf);
278
279#define linphone_friend_url(lf) ((lf)->url)
280
281void linphone_friend_write_to_config_file(struct _LpConfig *config, LinphoneFriend *lf, int index);
282LinphoneFriend * linphone_friend_new_from_config_file(struct _LinphoneCore *lc, int index);
283
284typedef struct _LinphoneProxyConfig
285{
286        struct _LinphoneCore *lc;
287        char *reg_proxy;
288        char *reg_identity;
289        char *reg_route;
290        char *realm;
291        int expires;
292        int reg_time;
293        int rid;
294        char *type;
295        struct _SipSetupContext *ssctx;
296        bool_t frozen;
297        bool_t reg_sendregister;
298        bool_t auth_pending;
299        bool_t registered;
300        bool_t publish;
301} LinphoneProxyConfig;
302
303LinphoneProxyConfig *linphone_proxy_config_new(void);
304int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *server_addr);
305void linphone_proxy_config_set_identity(LinphoneProxyConfig *obj, const char *identity);
306void linphone_proxy_config_set_route(LinphoneProxyConfig *obj, const char *route);
307void linphone_proxy_config_expires(LinphoneProxyConfig *obj, const int expires);
308void linphone_proxy_config_enable_register(LinphoneProxyConfig *obj, bool_t val);
309#define linphone_proxy_config_enableregister linphone_proxy_config_enable_register
310void linphone_proxy_config_edit(LinphoneProxyConfig *obj);
311int linphone_proxy_config_done(LinphoneProxyConfig *obj);
312void linphone_proxy_config_enable_publish(LinphoneProxyConfig *obj, bool_t val);
313bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj);
314#define linphone_proxy_config_get_route(obj)  ((obj)->reg_route)
315#define linphone_proxy_config_get_identity(obj) ((obj)->reg_identity)
316#define linphone_proxy_config_publish_enabled(obj) ((obj)->publish)
317#define linphone_proxy_config_get_addr(obj) ((obj)->reg_proxy)
318#define linphone_proxy_config_get_expires(obj)  ((obj)->expires)
319#define linphone_proxy_config_register_enabled(obj) ((obj)->reg_sendregister)
320#define linphone_proxy_config_get_core(obj) ((obj)->lc)
321/* destruction is called automatically when removing the proxy config */
322void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg);
323LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(struct _LpConfig *config, int index);
324void linphone_proxy_config_write_to_config_file(struct _LpConfig* config,LinphoneProxyConfig *obj, int index);
325void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type);
326SipSetupContext *linphone_proxy_config_get_sip_setup_context(LinphoneProxyConfig *cfg);
327
328
329typedef struct _LinphoneAuthInfo
330{
331        char *username;
332        char *realm;
333        char *userid;
334        char *passwd;
335        char *ha1;
336        bool_t works;
337        bool_t first_time;
338}LinphoneAuthInfo;
339
340LinphoneAuthInfo *linphone_auth_info_new(const char *username, const char *userid,
341                const char *passwd, const char *ha1,const char *realm);
342void linphone_auth_info_set_passwd(LinphoneAuthInfo *info, const char *passwd);
343void linphone_auth_info_set_username(LinphoneAuthInfo *info, const char *username);
344/* you don't need those function*/
345void linphone_auth_info_destroy(LinphoneAuthInfo *info);
346LinphoneAuthInfo * linphone_auth_info_new_from_config_file(struct _LpConfig *config, int pos);
347
348struct _LinphoneChatRoom{
349        struct _LinphoneCore *lc;
350        char  *peer;
351        char *route;
352        osip_from_t *peer_url;
353        void * user_data;
354};
355typedef struct _LinphoneChatRoom LinphoneChatRoom;
356
357LinphoneChatRoom * linphone_core_create_chat_room(struct _LinphoneCore *lc, const char *to);
358void linphone_chat_room_send_message(LinphoneChatRoom *cr, const char *msg);
359void linphone_chat_room_destroy(LinphoneChatRoom *cr);
360void linphone_chat_room_set_user_data(LinphoneChatRoom *cr, void * ud);
361void * linphone_chat_room_get_user_data(LinphoneChatRoom *cr);
362
363/* describes the different groups of states */
364typedef enum _gstate_group {
365  GSTATE_GROUP_POWER,
366  GSTATE_GROUP_REG,
367  GSTATE_GROUP_CALL
368} gstate_group_t;
369
370typedef enum _gstate {
371  /* states for GSTATE_GROUP_POWER */
372  GSTATE_POWER_OFF = 0,        /* initial state */
373  GSTATE_POWER_STARTUP,
374  GSTATE_POWER_ON,
375  GSTATE_POWER_SHUTDOWN,
376  /* states for GSTATE_GROUP_REG */
377  GSTATE_REG_NONE = 10,       /* initial state */
378  GSTATE_REG_OK,
379  GSTATE_REG_FAILED,
380  /* states for GSTATE_GROUP_CALL */
381  GSTATE_CALL_IDLE = 20,      /* initial state */
382  GSTATE_CALL_OUT_INVITE,
383  GSTATE_CALL_OUT_CONNECTED,
384  GSTATE_CALL_IN_INVITE,
385  GSTATE_CALL_IN_CONNECTED,
386  GSTATE_CALL_END,
387  GSTATE_CALL_ERROR,
388  GSTATE_INVALID
389} gstate_t;
390
391struct _LinphoneGeneralState {
392  gstate_t old_state;
393  gstate_t new_state;
394  gstate_group_t group;
395  const char *message;
396};
397typedef struct _LinphoneGeneralState LinphoneGeneralState;
398
399/* private: set a new state */
400void gstate_new_state(struct _LinphoneCore *lc, gstate_t new_state, const char *message);
401/*private*/
402void gstate_initialize(struct _LinphoneCore *lc) ;
403
404typedef void (*ShowInterfaceCb)(struct _LinphoneCore *lc);
405typedef void (*InviteReceivedCb)(struct _LinphoneCore *lc, const char *from);
406typedef void (*ByeReceivedCb)(struct _LinphoneCore *lc, const char *from);
407typedef void (*DisplayStatusCb)(struct _LinphoneCore *lc, const char *message);
408typedef void (*DisplayMessageCb)(struct _LinphoneCore *lc, const char *message);
409typedef void (*DisplayUrlCb)(struct _LinphoneCore *lc, const char *message, const char *url);
410typedef void (*DisplayQuestionCb)(struct _LinphoneCore *lc, const char *message);
411typedef void (*LinphoneCoreCbFunc)(struct _LinphoneCore *lc,void * user_data);
412typedef void (*NotifyReceivedCb)(struct _LinphoneCore *lc, LinphoneFriend * fid, const char *url, const char *status, const char *img);
413typedef void (*NewUnknownSubscriberCb)(struct _LinphoneCore *lc, LinphoneFriend *lf, const char *url);
414typedef void (*AuthInfoRequested)(struct _LinphoneCore *lc, const char *realm, const char *username);
415typedef void (*CallLogUpdated)(struct _LinphoneCore *lc, struct _LinphoneCallLog *newcl);
416typedef void (*TextMessageReceived)(struct _LinphoneCore *lc, LinphoneChatRoom *room, const char *from, const char *message);
417typedef void (*GeneralStateChange)(struct _LinphoneCore *lc, LinphoneGeneralState *gstate);
418typedef void (*DtmfReceived)(struct _LinphoneCore* lc, int dtmf);
419
420typedef struct _LinphoneVTable
421{
422        ShowInterfaceCb show;
423        InviteReceivedCb inv_recv;
424        ByeReceivedCb bye_recv;
425        NotifyReceivedCb notify_recv;
426        NewUnknownSubscriberCb new_unknown_subscriber;
427        AuthInfoRequested auth_info_requested;
428        DisplayStatusCb display_status;
429        DisplayMessageCb display_message;
430#ifdef VINCENT_MAURY_RSVP
431        /* the yes/no dialog box */
432        DisplayMessageCb display_yes_no;
433#endif
434        DisplayMessageCb display_warning;
435        DisplayUrlCb display_url;
436        DisplayQuestionCb display_question;
437        CallLogUpdated call_log_updated;
438        TextMessageReceived text_received;
439        GeneralStateChange general_state;
440        DtmfReceived dtmf_received;
441} LinphoneCoreVTable;
442
443typedef struct _LCCallbackObj
444{
445  LinphoneCoreCbFunc _func;
446  void * _user_data;
447}LCCallbackObj;
448
449
450
451typedef enum _LinphoneFirewallPolicy{
452        LINPHONE_POLICY_NO_FIREWALL,
453        LINPHONE_POLICY_USE_NAT_ADDRESS,
454        LINPHONE_POLICY_USE_STUN
455} LinphoneFirewallPolicy;
456
457typedef struct _LinphoneCore
458{
459        LinphoneCoreVTable vtable;
460        struct _LpConfig *config;
461        net_config_t net_conf;
462        sip_config_t sip_conf;
463        rtp_config_t rtp_conf;
464        sound_config_t sound_conf;
465        video_config_t video_conf;
466        codecs_config_t codecs_conf;
467        ui_config_t ui_conf;
468        autoreplier_config_t autoreplier_conf;
469        LinphoneProxyConfig *default_proxy;
470        MSList *friends;
471        MSList *auth_info;
472        struct _RingStream *ringstream;
473        LCCallbackObj preview_finished_cb;
474        bool_t preview_finished;
475        LinphoneCall *call;   /* the current call, in the future it will be a list of calls (conferencing)*/
476        int rid; /*registration id*/
477        MSList *queued_calls;   /* used by the autoreplier */
478        MSList *call_logs;
479        MSList *chatrooms;
480        int max_call_logs;
481        int missed_calls;
482        struct _AudioStream *audiostream;  /**/
483        struct _VideoStream *videostream;
484        struct _VideoStream *previewstream;
485        struct _RtpProfile *local_profile;
486        MSList *subscribers;    /* unknown subscribers */
487        int minutes_away;
488        LinphoneOnlineStatus presence_mode;
489        LinphoneOnlineStatus prev_mode;
490        char *alt_contact;
491        void *data;
492        ms_mutex_t lock;
493        char *play_file;
494        char *rec_file;
495        time_t prevtime;
496        int dw_audio_bw;
497        int up_audio_bw;
498        int dw_video_bw;
499        int up_video_bw;
500        int audio_bw;
501        int automatic_action;
502        gstate_t gstate_power;
503        gstate_t gstate_reg;
504        gstate_t gstate_call;
505        bool_t use_files;
506        bool_t apply_nat_settings;
507        bool_t ready;
508#ifdef VINCENT_MAURY_RSVP
509        /* QoS parameters*/
510        int rsvp_enable;
511        int rpc_enable;
512#endif
513} LinphoneCore;
514
515
516
517/* THE main API */
518
519void linphone_core_enable_logs(FILE *file);
520void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc);
521void linphone_core_disable_logs(void);
522
523const char *linphone_core_get_version(void);
524
525LinphoneCore *linphone_core_new(const LinphoneCoreVTable *vtable,
526                                                const char *config_path, void* userdata);
527
528void linphone_core_init(LinphoneCore *lc, const LinphoneCoreVTable *vtable,
529                                                const char *config_path, void * userdata);
530
531/* function to be periodically called in a main loop */
532void linphone_core_iterate(LinphoneCore *lc);
533
534int linphone_core_invite(LinphoneCore *lc, const char *url);
535
536int linphone_core_refer(LinphoneCore *lc, const char *url);
537
538bool_t linphone_core_inc_invite_pending(LinphoneCore*lc);
539
540bool_t linphone_core_in_call(const LinphoneCore *lc);
541
542int linphone_core_accept_call(LinphoneCore *lc, const char *url);
543
544int linphone_core_terminate_call(LinphoneCore *lc, const char *url);
545
546void linphone_core_send_dtmf(LinphoneCore *lc,char dtmf);
547
548int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact);
549
550const char *linphone_core_get_primary_contact(LinphoneCore *lc);
551
552void linphone_core_set_guess_hostname(LinphoneCore *lc, bool_t val);
553bool_t linphone_core_get_guess_hostname(LinphoneCore *lc);
554
555bool_t linphone_core_ipv6_enabled(LinphoneCore *lc);
556void linphone_core_enable_ipv6(LinphoneCore *lc, bool_t val);
557
558osip_from_t *linphone_core_get_primary_contact_parsed(LinphoneCore *lc);
559
560/*0= no bandwidth limit*/
561void linphone_core_set_download_bandwidth(LinphoneCore *lc, int bw);
562void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw);
563
564int linphone_core_get_download_bandwidth(const LinphoneCore *lc);
565int linphone_core_get_upload_bandwidth(const LinphoneCore *lc);
566
567
568#ifdef VINCENT_MAURY_RSVP
569/* QoS functions */
570int linphone_core_set_rpc_mode(LinphoneCore *lc, int on); /* on = 1 (RPC_ENABLE = 1) */
571int linphone_core_set_rsvp_mode(LinphoneCore *lc, int on); /* on = 1 (RSVP_ENABLE = 1) */
572int linphone_core_change_qos(LinphoneCore *lc, int answer); /* answer = 1 for yes, 0 for no */
573#endif
574
575/* returns a MSList of PayloadType */
576const MSList *linphone_core_get_audio_codecs(const LinphoneCore *lc);
577
578int linphone_core_set_audio_codecs(LinphoneCore *lc, MSList *codecs);
579/* returns a MSList of PayloadType */
580const MSList *linphone_core_get_video_codecs(const LinphoneCore *lc);
581
582int linphone_core_set_video_codecs(LinphoneCore *lc, MSList *codecs);
583
584bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, PayloadType *pt);
585
586int linphone_core_add_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *config);
587
588void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *config);
589
590const MSList *linphone_core_get_proxy_config_list(const LinphoneCore *lc);
591
592void linphone_core_set_default_proxy(LinphoneCore *lc, LinphoneProxyConfig *config);
593
594void linphone_core_set_default_proxy_index(LinphoneCore *lc, int index);
595
596int linphone_core_get_default_proxy(LinphoneCore *lc, LinphoneProxyConfig **config);
597
598void linphone_core_add_auth_info(LinphoneCore *lc, LinphoneAuthInfo *info);
599
600void linphone_core_remove_auth_info(LinphoneCore *lc, LinphoneAuthInfo *info);
601
602void linphone_core_abort_authentication(LinphoneCore *lc,  LinphoneAuthInfo *info);
603
604void linphone_core_clear_all_auth_info(LinphoneCore *lc);
605
606int linphone_core_get_audio_jittcomp(LinphoneCore *lc);
607
608void linphone_core_set_audio_jittcomp(LinphoneCore *lc, int value);
609
610int linphone_core_get_audio_port(const LinphoneCore *lc);
611
612int linphone_core_get_video_port(const LinphoneCore *lc);
613
614int linphone_core_get_nortp_timeout(const LinphoneCore *lc);
615
616void linphone_core_set_audio_port(LinphoneCore *lc, int port);
617
618void linphone_core_set_video_port(LinphoneCore *lc, int port);
619
620void linphone_core_set_nortp_timeout(LinphoneCore *lc, int port);
621
622void linphone_core_set_use_info_for_dtmf(LinphoneCore *lc, bool_t use_info);
623
624bool_t linphone_core_get_use_info_for_dtmf(LinphoneCore *lc);
625
626int linphone_core_get_sip_port(LinphoneCore *lc);
627
628void linphone_core_set_sip_port(LinphoneCore *lc,int port);
629
630void linphone_core_set_inc_timeout(LinphoneCore *lc, int seconds);
631
632int linphone_core_get_inc_timeout(LinphoneCore *lc);
633
634void linphone_core_set_stun_server(LinphoneCore *lc, const char *server);
635
636const char * linphone_core_get_stun_server(const LinphoneCore *lc);
637
638void linphone_core_set_nat_address(LinphoneCore *lc, const char *addr);
639
640const char *linphone_core_get_nat_address(const LinphoneCore *lc);
641
642void linphone_core_set_firewall_policy(LinphoneCore *lc, LinphoneFirewallPolicy pol);
643
644LinphoneFirewallPolicy linphone_core_get_firewall_policy(const LinphoneCore *lc);
645
646const char * linphone_core_get_relay_addr(const LinphoneCore *lc);
647
648int linphone_core_set_relay_addr(LinphoneCore *lc, const char *addr);
649
650/* sound functions */
651/* returns a null terminated static array of string describing the sound devices */ 
652const char**  linphone_core_get_sound_devices(LinphoneCore *lc);
653bool_t linphone_core_sound_device_can_capture(LinphoneCore *lc, const char *device);
654bool_t linphone_core_sound_device_can_playback(LinphoneCore *lc, const char *device);
655int linphone_core_get_ring_level(LinphoneCore *lc);
656int linphone_core_get_play_level(LinphoneCore *lc);
657int linphone_core_get_rec_level(LinphoneCore *lc);
658void linphone_core_set_ring_level(LinphoneCore *lc, int level);
659void linphone_core_set_play_level(LinphoneCore *lc, int level);
660void linphone_core_set_rec_level(LinphoneCore *lc, int level);
661const char * linphone_core_get_ringer_device(LinphoneCore *lc);
662const char * linphone_core_get_playback_device(LinphoneCore *lc);
663const char * linphone_core_get_capture_device(LinphoneCore *lc);
664int linphone_core_set_ringer_device(LinphoneCore *lc, const char * devid);
665int linphone_core_set_playback_device(LinphoneCore *lc, const char * devid);
666int linphone_core_set_capture_device(LinphoneCore *lc, const char * devid);
667char linphone_core_get_sound_source(LinphoneCore *lc);
668void linphone_core_set_sound_source(LinphoneCore *lc, char source);
669void linphone_core_set_ring(LinphoneCore *lc, const char *path);
670const char *linphone_core_get_ring(const LinphoneCore *lc);
671void linphone_core_set_ringback(LinphoneCore *lc, const char *path);
672const char * linphone_core_get_ringback(const LinphoneCore *lc);
673int linphone_core_preview_ring(LinphoneCore *lc, const char *ring,LinphoneCoreCbFunc func,void * userdata);
674void linphone_core_enable_echo_cancelation(LinphoneCore *lc, bool_t val);
675bool_t linphone_core_echo_cancelation_enabled(LinphoneCore *lc);
676
677void linphone_core_set_presence_info(LinphoneCore *lc,int minutes_away,const char *contact,LinphoneOnlineStatus os);
678
679LinphoneOnlineStatus linphone_core_get_presence_info(const LinphoneCore *lc);
680
681void linphone_core_interpret_friend_uri(LinphoneCore *lc, const char *uri, char **result);
682void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *fr);
683void linphone_core_remove_friend(LinphoneCore *lc, LinphoneFriend *fr);
684void linphone_core_reject_subscriber(LinphoneCore *lc, LinphoneFriend *lf);
685/* a list of LinphoneFriend */
686const MSList * linphone_core_get_friend_list(LinphoneCore *lc);
687/* notify all friends that have subscribed */
688void linphone_core_notify_all_friends(LinphoneCore *lc, LinphoneOnlineStatus os);
689
690/* returns a list of LinphoneCallLog */
691MSList * linphone_core_get_call_logs(LinphoneCore *lc);
692
693/* video support */
694void linphone_core_enable_video(LinphoneCore *lc, bool_t vcap_enabled, bool_t display_enabled);
695bool_t linphone_core_video_enabled(LinphoneCore *lc);
696
697typedef struct MSVideoSizeDef{
698        MSVideoSize vsize;
699        const char *name;
700}MSVideoSizeDef;
701/* returns a zero terminated table of MSVideoSizeDef*/
702const MSVideoSizeDef *linphone_core_get_supported_video_sizes(LinphoneCore *lc);
703void linphone_core_set_preferred_video_size(LinphoneCore *lc, MSVideoSize vsize);
704MSVideoSize linphone_core_get_preferred_video_size(LinphoneCore *lc);
705void linphone_core_set_preferred_video_size_by_name(LinphoneCore *lc, const char *name);
706
707void linphone_core_enable_video_preview(LinphoneCore *lc, bool_t val);
708bool_t linphone_core_video_preview_enabled(const LinphoneCore *lc);
709
710void linphone_core_enable_self_view(LinphoneCore *lc, bool_t val);
711bool_t linphone_core_self_view_enabled(const LinphoneCore *lc);
712
713
714/* returns a null terminated static array of string describing the webcams */ 
715const char**  linphone_core_get_video_devices(const LinphoneCore *lc);
716int linphone_core_set_video_device(LinphoneCore *lc, const char *id);
717const char *linphone_core_get_video_device(const LinphoneCore *lc);
718
719/*function to be used for eventually setting window decorations (icons, title...)*/
720unsigned long linphone_core_get_native_video_window_id(const LinphoneCore *lc);
721
722
723/*play/record support: use files instead of soundcard*/
724void linphone_core_use_files(LinphoneCore *lc, bool_t yesno);
725void linphone_core_set_play_file(LinphoneCore *lc, const char *file);
726void linphone_core_set_record_file(LinphoneCore *lc, const char *file);
727
728gstate_t linphone_core_get_state(const LinphoneCore *lc, gstate_group_t group);
729int linphone_core_get_current_call_duration(const LinphoneCore *lc);
730
731int linphone_core_get_mtu(const LinphoneCore *lc);
732void linphone_core_set_mtu(LinphoneCore *lc, int mtu);
733
734bool_t linphone_core_is_in_main_thread(LinphoneCore *lc);
735
736void *linphone_core_get_user_data(LinphoneCore *lc);
737
738/* returns LpConfig object to read/write to the config file: usefull if you wish to extend
739the config file with your own sections */
740struct _LpConfig *linphone_core_get_config(LinphoneCore *lc);
741
742/* attempts to wake up another linphone engine already running.
743The "show" callback is called for the other linphone, causing gui to show up.
744The method returns 0 if an already running linphone was found*/
745int linphone_core_wake_up_possible_already_running_instance(const char *config_file);
746
747void linphone_core_uninit(LinphoneCore *lc);
748void linphone_core_destroy(LinphoneCore *lc);
749
750/* end of lecacy api */
751
752/*internal use only */
753#define linphone_core_lock(lc)  ms_mutex_lock(&(lc)->lock)
754#define linphone_core_unlock(lc)        ms_mutex_unlock((&lc)->lock)
755void linphone_core_start_media_streams(LinphoneCore *lc, LinphoneCall *call);
756void linphone_core_stop_media_streams(LinphoneCore *lc);
757const char * linphone_core_get_identity(LinphoneCore *lc);
758const char * linphone_core_get_route(LinphoneCore *lc);
759bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, char **real_url, osip_to_t **real_parsed_url, char **route);
760
761#ifdef __cplusplus
762}
763#endif
764
765#endif
Note: See TracBrowser for help on using the repository browser.