source: mediastreamer2/linphone/coreapi/linphonecore.h @ 177:db43877d8d4c

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

merge patch from telezorg

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

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