struct _MSSndCard;
struct _LinphoneCore;
-
-bool_t payload_type_enabled(struct _PayloadType *pt);
-void payload_type_set_enable(struct _PayloadType *pt,int value);
-const char *payload_type_get_description(struct _PayloadType *pt);
+struct SalOp;
struct _LpConfig;
-typedef struct sip_config
-{
- char *contact;
- char *guessed_contact;
- int sip_port;
- MSList *proxies;
- MSList *deleted_proxies;
- int inc_timeout; /*timeout after an un-answered incoming call is rejected*/
- bool_t use_info;
- bool_t use_rfc2833; /*force RFC2833 to be sent*/
- bool_t guess_hostname;
- bool_t loopback_only;
- bool_t ipv6_enabled;
- bool_t sdp_200_ack;
- bool_t only_one_codec; /*in SDP answers*/
- bool_t register_only_when_network_is_up;
-} sip_config_t;
-
-typedef struct rtp_config
-{
- int audio_rtp_port;
- int video_rtp_port;
- int audio_jitt_comp; /*jitter compensation*/
- int video_jitt_comp; /*jitter compensation*/
- int nortp_timeout;
-}rtp_config_t;
-
-
-
-typedef struct net_config
-{
- char *nat_address;
- char *stun_server;
- char *relay;
- int download_bw;
- int upload_bw;
- int firewall_policy;
- int mtu;
- bool_t nat_sdp_only;
-}net_config_t;
-
-
-typedef struct sound_config
-{
- struct _MSSndCard * ring_sndcard; /* the playback sndcard currently used */
- struct _MSSndCard * play_sndcard; /* the playback sndcard currently used */
- struct _MSSndCard * capt_sndcard; /* the capture sndcard currently used */
- const char **cards;
- int latency; /* latency in samples of the current used sound device */
- char rec_lev;
- char play_lev;
- char ring_lev;
- char source;
- char *local_ring;
- char *remote_ring;
- bool_t ec;
- bool_t ea;
- bool_t agc;
-} sound_config_t;
-
-typedef struct codecs_config
-{
- MSList *audio_codecs; /* list of audio codecs in order of preference*/
- MSList *video_codecs; /* for later use*/
-}codecs_config_t;
-
-typedef struct video_config{
- struct _MSWebCam *device;
- const char **cams;
- MSVideoSize vsize;
- bool_t capture;
- bool_t show_local;
- bool_t display;
- bool_t selfview; /*during calls*/
-}video_config_t;
-
-typedef struct ui_config
-{
- int is_daemon;
- int is_applet;
- unsigned int timer_id; /* the timer id for registration */
-}ui_config_t;
-
-
-
-typedef struct autoreplier_config
-{
- int enabled;
- int after_seconds; /* accept the call after x seconds*/
- int max_users; /* maximum number of user that can call simultaneously */
- int max_rec_time; /* the max time of incoming voice recorded */
- int max_rec_msg; /* maximum number of recorded messages */
- const char *message; /* the path of the file to be played */
-}autoreplier_config_t;
-
-struct osip_from;
/**
* Object that represents a SIP address.
* @ingroup linphone_address
* @var LinphoneAddress
*/
-typedef struct osip_from LinphoneAddress;
+typedef struct SalAddress LinphoneAddress;
LinphoneAddress * linphone_address_new(const char *uri);
LinphoneAddress * linphone_address_clone(const LinphoneAddress *uri);
char *linphone_address_as_string_uri_only(const LinphoneAddress *u);
void linphone_address_destroy(LinphoneAddress *u);
-struct _LinphoneCore;
-struct _sdp_context;
struct _SipSetupContext;
struct _LinphoneCall;
}LinphoneSubscribePolicy;
typedef enum _LinphoneOnlineStatus{
- LINPHONE_STATUS_UNKNOWN,
+ LINPHONE_STATUS_OFFLINE,
LINPHONE_STATUS_ONLINE,
LINPHONE_STATUS_BUSY,
LINPHONE_STATUS_BERIGHTBACK,
LINPHONE_STATUS_NOT_DISTURB,
LINPHONE_STATUS_MOVED,
LINPHONE_STATUS_ALT_SERVICE,
- LINPHONE_STATUS_OFFLINE,
LINPHONE_STATUS_PENDING,
- LINPHONE_STATUS_CLOSED,
LINPHONE_STATUS_END
}LinphoneOnlineStatus;
const char *linphone_online_status_to_string(LinphoneOnlineStatus ss);
-typedef struct _LinphoneFriend{
- LinphoneAddress *uri;
- int in_did;
- int out_did;
- int sid;
- int nid;
- LinphoneSubscribePolicy pol;
- LinphoneOnlineStatus status;
- struct _LinphoneProxyConfig *proxy;
- struct _LinphoneCore *lc;
- BuddyInfo *info;
- char *refkey;
- bool_t subscribe;
- bool_t inc_subscribe_pending;
-}LinphoneFriend;
+struct _LinphoneFriend;
+
+typedef struct _LinphoneFriend LinphoneFriend;
LinphoneFriend * linphone_friend_new();
LinphoneFriend *linphone_friend_new_with_addr(const char *addr);
int linphone_friend_set_name(LinphoneFriend *fr, const char *name);
int linphone_friend_send_subscribe(LinphoneFriend *fr, bool_t val);
int linphone_friend_set_inc_subscribe_policy(LinphoneFriend *fr, LinphoneSubscribePolicy pol);
-int linphone_friend_set_proxy(LinphoneFriend *fr, struct _LinphoneProxyConfig *cfg);
void linphone_friend_edit(LinphoneFriend *fr);
void linphone_friend_done(LinphoneFriend *fr);
void linphone_friend_destroy(LinphoneFriend *lf);
-const LinphoneAddress *linphone_friend_get_uri(const LinphoneFriend *lf);
+const LinphoneAddress *linphone_friend_get_address(const LinphoneFriend *lf);
bool_t linphone_friend_get_send_subscribe(const LinphoneFriend *lf);
LinphoneSubscribePolicy linphone_friend_get_inc_subscribe_policy(const LinphoneFriend *lf);
LinphoneOnlineStatus linphone_friend_get_status(const LinphoneFriend *lf);
BuddyInfo * linphone_friend_get_info(const LinphoneFriend *lf);
void linphone_friend_set_ref_key(LinphoneFriend *lf, const char *key);
const char *linphone_friend_get_ref_key(const LinphoneFriend *lf);
-#define linphone_friend_in_list(lf) ((lf)->lc!=NULL)
+bool_t linphone_friend_in_list(const LinphoneFriend *lf);
#define linphone_friend_url(lf) ((lf)->url)
+struct LinphoneProxyConfig;
+
/**
* @addtogroup proxies
* @{
* The default proxy (see linphone_core_set_default_proxy() ) is the one of the list
* that is used by default for calls.
**/
-typedef struct _LinphoneProxyConfig
-{
- struct _LinphoneCore *lc;
- char *reg_proxy;
- char *reg_identity;
- char *reg_route;
- char *realm;
- int expires;
- int reg_time;
- int rid;
- char *type;
- struct _SipSetupContext *ssctx;
- int auth_failures;
- char *contact_addr; /* our IP address as seen by the proxy, read from via 's received= parameter*/
- int contact_port; /*our IP port as seen by the proxy, read from via's rport= parameter */
- char *dial_prefix;
- bool_t commit;
- bool_t reg_sendregister;
- bool_t registered;
- bool_t publish;
- bool_t dial_escape_plus;
-} LinphoneProxyConfig;
+typedef struct _LinphoneProxyConfig LinphoneProxyConfig;
LinphoneProxyConfig *linphone_proxy_config_new(void);
int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *obj, const char *server_addr);
-void linphone_proxy_config_set_identity(LinphoneProxyConfig *obj, const char *identity);
-void linphone_proxy_config_set_route(LinphoneProxyConfig *obj, const char *route);
+int linphone_proxy_config_set_identity(LinphoneProxyConfig *obj, const char *identity);
+int linphone_proxy_config_set_route(LinphoneProxyConfig *obj, const char *route);
void linphone_proxy_config_expires(LinphoneProxyConfig *obj, int expires);
void linphone_proxy_config_enable_register(LinphoneProxyConfig *obj, bool_t val);
#define linphone_proxy_config_enableregister linphone_proxy_config_enable_register
bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj);
const char *linphone_proxy_config_get_domain(const LinphoneProxyConfig *cfg);
-/** Returns the proxy configured identity as a const char * */
-#define linphone_proxy_config_get_route(obj) ((obj)->reg_route)
-/** Returns the proxy configured identity as a const char * */
-#define linphone_proxy_config_get_identity(obj) ((obj)->reg_identity)
-#define linphone_proxy_config_publish_enabled(obj) ((obj)->publish)
-/** Returns the proxy sip address as const char * */
-#define linphone_proxy_config_get_addr(obj) ((obj)->reg_proxy)
-/** Returns the 'expire' time of the registration */
-#define linphone_proxy_config_get_expires(obj) ((obj)->expires)
-/** Returns TRUE if registration is enabled, FALSE otherwise */
-#define linphone_proxy_config_register_enabled(obj) ((obj)->reg_sendregister)
-#define linphone_proxy_config_get_core(obj) ((obj)->lc)
+
+const char *linphone_proxy_config_get_route(const LinphoneProxyConfig *obj);
+const char *linphone_proxy_config_get_identity(const LinphoneProxyConfig *obj);
+bool_t linphone_proxy_config_publish_enabled(const LinphoneProxyConfig *obj);
+const char *linphone_proxy_config_get_addr(const LinphoneProxyConfig *obj);
+int linphone_proxy_config_get_expires(const LinphoneProxyConfig *obj);
+bool_t linphone_proxy_config_register_enabled(const LinphoneProxyConfig *obj);
+struct _LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyConfig *obj);
+
bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg);
const char * linphone_proxy_config_get_dial_prefix(const LinphoneProxyConfig *cfg);
LinphoneProxyConfig * linphone_account_creator_validate(LinphoneAccountCreator *obj);
void linphone_account_creator_destroy(LinphoneAccountCreator *obj);
+struct _LinphoneAuthInfo;
+
/**
* @ingroup authentication
* Object holding authentication information.
* transactions and retry them with authentication headers.
*
**/
-typedef struct _LinphoneAuthInfo
-{
- char *username;
- char *realm;
- char *userid;
- char *passwd;
- char *ha1;
- bool_t works;
- bool_t first_time;
-}LinphoneAuthInfo;
+typedef struct _LinphoneAuthInfo LinphoneAuthInfo;
LinphoneAuthInfo *linphone_auth_info_new(const char *username, const char *userid,
const char *passwd, const char *ha1,const char *realm);
void linphone_auth_info_set_passwd(LinphoneAuthInfo *info, const char *passwd);
void linphone_auth_info_set_username(LinphoneAuthInfo *info, const char *username);
void linphone_auth_info_set_userid(LinphoneAuthInfo *info, const char *userid);
+
+const char *linphone_auth_info_get_username(const LinphoneAuthInfo *i);
+const char *linphone_auth_info_get_passwd(const LinphoneAuthInfo *i);
+const char *linphone_auth_info_get_userid(const LinphoneAuthInfo *i);
+
/* you don't need those function*/
void linphone_auth_info_destroy(LinphoneAuthInfo *info);
LinphoneAuthInfo * linphone_auth_info_new_from_config_file(struct _LpConfig *config, int pos);
-struct _LinphoneChatRoom{
- struct _LinphoneCore *lc;
- char *peer;
- char *route;
- LinphoneAddress *peer_url;
- void * user_data;
-};
+struct _LinphoneChatRoom;
typedef struct _LinphoneChatRoom LinphoneChatRoom;
LinphoneChatRoom * linphone_core_create_chat_room(struct _LinphoneCore *lc, const char *to);
/** Callback prototype */
typedef void (*LinphoneCoreCbFunc)(struct _LinphoneCore *lc,void * user_data);
/** Callback prototype */
-typedef void (*NotifyReceivedCb)(struct _LinphoneCore *lc, LinphoneFriend * fid, const char *url, const char *status, const char *img);
+typedef void (*NotifyReceivedCb)(struct _LinphoneCore *lc, LinphoneFriend * fid);
/** Callback prototype */
typedef void (*NewUnknownSubscriberCb)(struct _LinphoneCore *lc, LinphoneFriend *lf, const char *url);
/** Callback prototype */
AuthInfoRequested auth_info_requested; /**< Ask the application some authentication information */
DisplayStatusCb display_status; /**< Callback that notifies various events with human readable text.*/
DisplayMessageCb display_message;/**< Callback to display a message to the user */
-#ifdef VINCENT_MAURY_RSVP
- /* the yes/no dialog box */
- DisplayMessageCb display_yes_no;
-#endif
DisplayMessageCb display_warning;/** Callback to display a warning to the user */
DisplayUrlCb display_url;
DisplayQuestionCb display_question;
} LinphoneWaitingState;
typedef void * (*LinphoneWaitingCallback)(struct _LinphoneCore *lc, void *context, LinphoneWaitingState ws, const char *purpose, float progress);
-
-typedef struct _LinphoneCore
-{
- LinphoneCoreVTable vtable;
- struct _LpConfig *config;
- net_config_t net_conf;
- sip_config_t sip_conf;
- rtp_config_t rtp_conf;
- sound_config_t sound_conf;
- video_config_t video_conf;
- codecs_config_t codecs_conf;
- ui_config_t ui_conf;
- autoreplier_config_t autoreplier_conf;
- LinphoneProxyConfig *default_proxy;
- MSList *friends;
- MSList *auth_info;
- struct _RingStream *ringstream;
- LCCallbackObj preview_finished_cb;
- bool_t preview_finished;
- struct _LinphoneCall *call; /* the current call, in the future it will be a list of calls (conferencing)*/
- int rid; /*registration id*/
- MSList *queued_calls; /* used by the autoreplier */
- MSList *call_logs;
- MSList *chatrooms;
- int max_call_logs;
- int missed_calls;
- struct _AudioStream *audiostream; /**/
- struct _VideoStream *videostream;
- struct _VideoStream *previewstream;
- RtpTransport *a_rtp,*a_rtcp;
- struct _RtpProfile *local_profile;
- MSList *bl_reqs;
- MSList *subscribers; /* unknown subscribers */
- int minutes_away;
- LinphoneOnlineStatus presence_mode;
- LinphoneOnlineStatus prev_mode;
- char *alt_contact;
- void *data;
- ms_mutex_t lock;
- char *play_file;
- char *rec_file;
- time_t prevtime;
- int dw_audio_bw;
- int up_audio_bw;
- int dw_video_bw;
- int up_video_bw;
- int audio_bw;
- int automatic_action;
- gstate_t gstate_power;
- gstate_t gstate_reg;
- gstate_t gstate_call;
- LinphoneWaitingCallback wait_cb;
- void *wait_ctx;
- bool_t use_files;
- bool_t apply_nat_settings;
- bool_t ready;
- bool_t bl_refresh;
-#ifdef VINCENT_MAURY_RSVP
- /* QoS parameters*/
- int rsvp_enable;
- int rpc_enable;
-#endif
-} LinphoneCore;
-
-
+typedef struct _LinphoneCore LinphoneCore;
/* THE main API */
int linphone_core_set_video_codecs(LinphoneCore *lc, MSList *codecs);
+bool_t linphone_core_payload_type_enabled(LinphoneCore *lc, PayloadType *pt);
+
+int linphone_core_enable_payload_type(LinphoneCore *lc, PayloadType *pt, bool_t enable);
+
+const char *linphone_core_get_payload_type_description(LinphoneCore *lc, PayloadType *pt);
+
bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, PayloadType *pt);
int linphone_core_add_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *config);
const MSList * linphone_core_get_friend_list(const LinphoneCore *lc);
/* notify all friends that have subscribed */
void linphone_core_notify_all_friends(LinphoneCore *lc, LinphoneOnlineStatus os);
-LinphoneFriend *linphone_core_get_friend_by_uri(const LinphoneCore *lc, const char *uri);
+LinphoneFriend *linphone_core_get_friend_by_address(const LinphoneCore *lc, const char *addr);
LinphoneFriend *linphone_core_get_friend_by_ref_key(const LinphoneCore *lc, const char *key);
/* returns a list of LinphoneCallLog */
int linphone_core_get_mtu(const LinphoneCore *lc);
void linphone_core_set_mtu(LinphoneCore *lc, int mtu);
-bool_t linphone_core_is_in_main_thread(LinphoneCore *lc);
-
void *linphone_core_get_user_data(LinphoneCore *lc);
/* returns LpConfig object to read/write to the config file: usefull if you wish to extend
/*for advanced users:*/
void linphone_core_set_audio_transports(LinphoneCore *lc, RtpTransport *rtp, RtpTransport *rtcp);
-/* end of lecacy api */
-
-/*internal use only */
-#define linphone_core_lock(lc) ms_mutex_lock(&(lc)->lock)
-#define linphone_core_unlock(lc) ms_mutex_unlock((&lc)->lock)
-void linphone_core_start_media_streams(LinphoneCore *lc, struct _LinphoneCall *call);
-void linphone_core_stop_media_streams(LinphoneCore *lc);
-const char * linphone_core_get_identity(LinphoneCore *lc);
-const char * linphone_core_get_route(LinphoneCore *lc);
-bool_t linphone_core_interpret_url(LinphoneCore *lc, const char *url, LinphoneAddress **real_parsed_url, char **route);
-void linphone_core_start_waiting(LinphoneCore *lc, const char *purpose);
-void linphone_core_update_progress(LinphoneCore *lc, const char *purpose, float progresses);
-void linphone_core_stop_waiting(LinphoneCore *lc);
-
-
#ifdef __cplusplus
}
#endif