diff --git a/coreapi/call_params.c b/coreapi/call_params.c index 5eaa84592..6cd19b464 100644 --- a/coreapi/call_params.c +++ b/coreapi/call_params.c @@ -17,6 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "linphone/call_params.h" #include "private.h" diff --git a/coreapi/chat.c b/coreapi/chat.c index dbbec6ff8..3247a6cb1 100644 --- a/coreapi/chat.c +++ b/coreapi/chat.c @@ -1546,18 +1546,6 @@ unsigned int linphone_chat_message_get_storage_id(LinphoneChatMessage *msg) { } LinphoneChatMessage *linphone_chat_message_clone(const LinphoneChatMessage *msg) { - /*struct _LinphoneChatMessage { - char* msg; - LinphoneChatRoom* chat_room; - LinphoneChatMessageStateChangeCb cb; - void* cb_ud; - void* message_userdata; - char* external_body_url; - LinphoneAddress* from; - time_t time; - SalCustomHeader *custom_headers; - LinphoneChatMessageState state; - };*/ LinphoneChatMessage *new_message = linphone_chat_room_create_message(msg->chat_room, msg->message); if (msg->external_body_url) new_message->external_body_url = ms_strdup(msg->external_body_url); diff --git a/coreapi/conference.cc b/coreapi/conference.cc index eb696becb..520eeb4b9 100644 --- a/coreapi/conference.cc +++ b/coreapi/conference.cc @@ -23,6 +23,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#include "linphone/core.h" #include "private.h" #include "conference_private.h" #include diff --git a/coreapi/factory.c b/coreapi/factory.c index ba304603e..e3f171cb0 100644 --- a/coreapi/factory.c +++ b/coreapi/factory.c @@ -17,6 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include "linphone/factory.h" #include "private.h" extern LinphoneCore *_linphone_core_new_with_config(LinphoneCoreCbs *cbs, struct _LpConfig *config, void *userdata); @@ -84,3 +85,7 @@ LinphoneAddress *linphone_factory_create_address(const LinphoneFactory *factory, LinphoneAuthInfo *linphone_factory_create_auth_info(const LinphoneFactory *factory, const char *username, const char *userid, const char *passwd, const char *ha1, const char *realm, const char *domain) { return linphone_auth_info_new(username, userid, passwd, ha1, realm, domain); } + +LinphoneVcard *linphone_factory_create_vcard(LinphoneFactory *factory) { + return linphone_vcard_new(); +} diff --git a/coreapi/private.h b/coreapi/private.h index 857461d48..87fa19693 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -37,6 +37,7 @@ #include "linphone/ringtoneplayer.h" #include "vcard_private.h" #include "carddav.h" +#include "linphone/player.h" #include "bctoolbox/port.h" #include "bctoolbox/map.h" @@ -392,7 +393,6 @@ void linphone_call_set_symmetric_rtp(LinphoneCall *call, bool_t val); /* private: */ LinphoneCallLog * linphone_call_log_new(LinphoneCallDir dir, LinphoneAddress *local, LinphoneAddress * remote); void linphone_call_log_completed(LinphoneCall *call); -void linphone_call_log_destroy(LinphoneCallLog *cl); void linphone_call_set_transfer_state(LinphoneCall* call, LinphoneCallState state); LinphonePlayer *linphone_call_build_player(LinphoneCall*call); void linphone_call_refresh_sockets(LinphoneCall *call); @@ -407,7 +407,8 @@ void linphone_call_params_set_custom_headers(LinphoneCallParams *params, const S void linphone_call_params_set_custom_sdp_attributes(LinphoneCallParams *params, const SalCustomSdpAttribute *csa); void linphone_call_params_set_custom_sdp_media_attributes(LinphoneCallParams *params, LinphoneStreamType type, const SalCustomSdpAttribute *csa); -void linphone_auth_info_write_config(struct _LpConfig *config, LinphoneAuthInfo *obj, int pos); +void linphone_auth_info_write_config(LinphoneConfig *config, LinphoneAuthInfo *obj, int pos); +LinphoneAuthInfo * linphone_auth_info_new_from_config_file(LpConfig *config, int pos); void linphone_core_write_auth_info(LinphoneCore *lc, LinphoneAuthInfo *ai); const LinphoneAuthInfo *_linphone_core_find_tls_auth_info(LinphoneCore *lc); const LinphoneAuthInfo *_linphone_core_find_auth_info(LinphoneCore *lc, const char *realm, const char *username, const char *domain, bool_t ignore_realm); @@ -542,7 +543,7 @@ bool_t linphone_core_media_description_contains_video_stream(const SalMediaDescr void linphone_core_send_initial_subscribes(LinphoneCore *lc); void linphone_core_write_friends_config(LinphoneCore* lc); -void linphone_friend_write_to_config_file(struct _LpConfig *config, LinphoneFriend *lf, int index); +void linphone_friend_write_to_config_file(LinphoneConfig *config, LinphoneFriend *lf, int index); LinphoneFriend * linphone_friend_new_from_config_file(struct _LinphoneCore *lc, int index); void linphone_proxy_config_update(LinphoneProxyConfig *cfg); @@ -552,7 +553,7 @@ int linphone_core_get_local_ip_for(int type, const char *dest, char *result); LINPHONE_PUBLIC void linphone_core_get_local_ip(LinphoneCore *lc, int af, const char *dest, char *result); LinphoneProxyConfig *linphone_proxy_config_new_from_config_file(LinphoneCore *lc, int index); -void linphone_proxy_config_write_to_config_file(struct _LpConfig* config,LinphoneProxyConfig *obj, int index); +void linphone_proxy_config_write_to_config_file(LinphoneConfig* config,LinphoneProxyConfig *obj, int index); LinphoneReason linphone_core_message_received(LinphoneCore *lc, SalOp *op, const SalMessage *msg); void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *cr, uint32_t character, LinphoneCall *call); @@ -965,6 +966,10 @@ struct _LinphoneCoreCbs { void _linphone_core_cbs_set_v_table(LinphoneCoreCbs *cbs, LinphoneCoreVTable *vtable, bool_t autorelease); +typedef struct _LCCallbackObj { + LinphoneCoreCbFunc _func; + void *_user_data; +} LCCallbackObj; struct _LinphoneCore { diff --git a/coreapi/vcard.cc b/coreapi/vcard.cc index b56f89886..f05369ba3 100644 --- a/coreapi/vcard.cc +++ b/coreapi/vcard.cc @@ -23,6 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "sal/sal.h" #include #include "private.h" +#include "linphone/factory.h" #include "linphone/wrapper_utils.h" #define VCARD_MD5_HASH_SIZE 16 @@ -98,10 +99,6 @@ LinphoneVcard *linphone_vcard_new(void) { return _linphone_vcard_new(); } -LinphoneVcard *linphone_factory_create_vcard(LinphoneFactory *factory) { - return _linphone_vcard_new(); -} - static LinphoneVcard* linphone_vcard_new_from_belcard(shared_ptr belcard) { LinphoneVcard* vCard = belle_sip_object_new(LinphoneVcard); vCard->belCard = belcard; diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index e06ff794a..a26d72714 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -35,6 +35,7 @@ set(HEADER_FILES content.h core.h core_utils.h + defs.h dictionary.h error_info.h event.h @@ -43,9 +44,13 @@ set(HEADER_FILES friendlist.h im_encryption_engine.h im_notif_policy.h + info_message.h ldapprovider.h lpconfig.h + misc.h nat_policy.h + payload_type.h + player.h presence.h proxy_config.h ringtoneplayer.h diff --git a/include/linphone/Makefile.am b/include/linphone/Makefile.am index 3a706de8d..55e8edb0e 100644 --- a/include/linphone/Makefile.am +++ b/include/linphone/Makefile.am @@ -15,6 +15,7 @@ linphone_include_HEADERS=\ content.h \ core.h \ core_utils.h \ + defs.h \ dictionary.h \ error_info.h \ event.h \ @@ -23,9 +24,13 @@ linphone_include_HEADERS=\ friendlist.h \ im_encryption_engine.h \ im_notif_policy.h \ + info_message.h \ ldapprovider.h \ lpconfig.h \ + misc.h \ nat_policy.h \ + payload_type.h \ + player.h \ presence.h \ proxy_config.h \ ringtoneplayer.h \ diff --git a/include/linphone/account_creator.h b/include/linphone/account_creator.h index ebe8337bf..c17e8c54c 100644 --- a/include/linphone/account_creator.h +++ b/include/linphone/account_creator.h @@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef LINPHONE_ACCOUNT_CREATOR_H_ #define LINPHONE_ACCOUNT_CREATOR_H_ -#include "linphonecore.h" +#include "linphone/types.h" #ifdef __cplusplus extern "C" { @@ -31,63 +31,6 @@ extern "C" { * @{ */ -/** -* Enum describing the status of a LinphoneAccountCreator operation. -**/ -typedef enum _LinphoneAccountCreatorStatus { - LinphoneAccountCreatorOK, - LinphoneAccountCreatorReqFailed, - - LinphoneAccountCreatorAccountCreated, - LinphoneAccountCreatorAccountNotCreated, - - LinphoneAccountCreatorAccountExist, - LinphoneAccountCreatorAccountExistWithAlias, - LinphoneAccountCreatorAccountNotExist, - - LinphoneAccountCreatorAccountActivated, - LinphoneAccountCreatorAccountAlreadyActivated, - LinphoneAccountCreatorAccountNotActivated, - - LinphoneAccountCreatorAccountLinked, - LinphoneAccountCreatorAccountNotLinked, - - LinphoneAccountCreatorEmailInvalid, - - LinphoneAccountCreatorUsernameInvalid, - LinphoneAccountCreatorUsernameTooShort, - LinphoneAccountCreatorUsernameTooLong, - LinphoneAccountCreatorUsernameInvalidSize, - - LinphoneAccountCreatorPhoneNumberInvalid, - LinphoneAccountCreatorPhoneNumberTooShort, - LinphoneAccountCreatorPhoneNumberTooLong, - LinphoneAccountCreatorPhoneNumberUsedAccount, - LinphoneAccountCreatorPhoneNumberUsedAlias, - LinphoneAccountCreatorPhoneNumberNotUsed, - - LinphoneAccountCreatorPasswordTooShort, - LinphoneAccountCreatorPasswordTooLong, - - LinphoneAccountCreatorDomainInvalid, - LinphoneAccountCreatorRouteInvalid, - LinphoneAccountCreatorDisplayNameInvalid, - LinphoneAccountCreatorTransportNotSupported, - LinphoneAccountCreatorCountryCodeInvalid, - - LinphoneAccountCreatorErrorServer, -} LinphoneAccountCreatorStatus; - -/** - * The LinphoneAccountCreator object used to create an account on a server via XML-RPC. -**/ -typedef struct _LinphoneAccountCreator LinphoneAccountCreator; - -/** - * An object to handle the callbacks for handling the LinphoneAccountCreator operations. -**/ -typedef struct _LinphoneAccountCreatorCbs LinphoneAccountCreatorCbs; - /** * Callback to notify a status change of the account creator. * @param[in] creator LinphoneAccountCreator object @@ -514,6 +457,7 @@ LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_g LINPHONE_PUBLIC void linphone_account_creator_cbs_set_is_phone_number_used(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); LINPHONE_PUBLIC void linphone_account_creator_cbs_set_recover_phone_account(LinphoneAccountCreatorCbs *cbs, LinphoneAccountCreatorCbsStatusCb cb); + LINPHONE_PUBLIC LinphoneAccountCreatorCbsStatusCb linphone_account_creator_cbs_get_recover_phone_account(const LinphoneAccountCreatorCbs *cbs); /** diff --git a/include/linphone/address.h b/include/linphone/address.h index 41dcabddf..b5f0f55f9 100644 --- a/include/linphone/address.h +++ b/include/linphone/address.h @@ -20,6 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef LINPHONE_ADDRESS_H #define LINPHONE_ADDRESS_H +#include "linphone/types.h" + #ifdef __cplusplus extern "C" { #endif @@ -29,19 +31,6 @@ extern "C" { * @{ */ -/** - * Object that represents a SIP address. - * - * The LinphoneAddress is an opaque object to represents SIP addresses, ie - * the content of SIP's 'from' and 'to' headers. - * A SIP address is made of display name, username, domain name, port, and various - * uri headers (such as tags). It looks like 'Alice '. - * The LinphoneAddress has methods to extract and manipulate all parts of the address. - * When some part of the address (for example the username) is empty, the accessor methods - * return NULL. - */ -typedef struct SalAddress LinphoneAddress; - /** * Constructs a LinphoneAddress object by parsing the user supplied address, * given as a string. diff --git a/include/linphone/auth_info.h b/include/linphone/auth_info.h index 3f5553c47..55e0d425c 100644 --- a/include/linphone/auth_info.h +++ b/include/linphone/auth_info.h @@ -21,37 +21,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define LINPHONE_AUTH_INFO_H #include +#include "linphone/types.h" /** * @addtogroup authentication * @{ */ -/** - * Object holding authentication information. - * - * @note The object's fields should not be accessed directly. Prefer using - * the accessor methods. - * - * In most case, authentication information consists of a username and password. - * Sometimes, a userid is required by proxy, and realm can be useful to discriminate - * different SIP domains. - * - * Once created and filled, a LinphoneAuthInfo must be added to the LinphoneCore in - * order to become known and used automatically when needed. - * Use linphone_core_add_auth_info() for that purpose. - * - * The LinphoneCore object can take the initiative to request authentication information - * when needed to the application through the auth_info_requested callback of the - * LinphoneCoreVTable structure. - * - * The application can respond to this information request later using - * linphone_core_add_auth_info(). This will unblock all pending authentication - * transactions and retry them with authentication headers. - * -**/ -typedef struct _LinphoneAuthInfo LinphoneAuthInfo; - /** * Safely cast a belle_sip_object_t into LinphoneAuthInfo */ @@ -229,7 +205,6 @@ LINPHONE_PUBLIC const char *linphone_auth_info_get_tls_key_path(const LinphoneAu /* you don't need those function*/ LINPHONE_PUBLIC void linphone_auth_info_destroy(LinphoneAuthInfo *info); -LINPHONE_PUBLIC LinphoneAuthInfo * linphone_auth_info_new_from_config_file(LpConfig *config, int pos); /** * @} diff --git a/include/linphone/buffer.h b/include/linphone/buffer.h index 8bc9d6b85..bb7450666 100644 --- a/include/linphone/buffer.h +++ b/include/linphone/buffer.h @@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define LINPHONE_BUFFER_H_ +#include "linphone/types.h" + + #ifdef __cplusplus extern "C" { #endif @@ -31,12 +34,6 @@ extern "C" { * @{ */ -/** - * The LinphoneContent object representing a data buffer. -**/ -typedef struct _LinphoneBuffer LinphoneBuffer; - - /** * Create a new empty LinphoneBuffer object. * @return A new LinphoneBuffer object. diff --git a/include/linphone/call.h b/include/linphone/call.h index 4be10ce39..2bd4b347f 100644 --- a/include/linphone/call.h +++ b/include/linphone/call.h @@ -21,12 +21,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define LINPHONE_CALL_H #include - -#include "linphone/address.h" -#include "linphone/call_log.h" -#include "linphone/call_params.h" -#include "linphone/conference.h" -#include "linphone/error_info.h" #include "linphone/types.h" /** @@ -34,48 +28,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * @{ */ -/** - * LinphoneCallState enum represents the different state a call can reach into. - * The application is notified of state changes through the LinphoneCoreVTable::call_state_changed callback. -**/ -typedef enum _LinphoneCallState{ - LinphoneCallIdle, /** - */ - LinphonePrivacyUser=0x1, - /** - * Request that privacy services modify headers that cannot - * be set arbitrarily by the user (Contact/Via). - */ - LinphonePrivacyHeader=0x2, - /** - * Request that privacy services provide privacy for session - * media - */ - LinphonePrivacySession=0x4, - /** - * rfc3325 - * The presence of this privacy type in - * a Privacy header field indicates that the user would like the Network - * Asserted Identity to be kept private with respect to SIP entities - * outside the Trust Domain with which the user authenticated. Note - * that a user requesting multiple types of privacy MUST include all of - * the requested privacy types in its Privacy header field value - * - */ - LinphonePrivacyId=0x8, - /** - * Privacy service must perform the specified services or - * fail the request - * - **/ - LinphonePrivacyCritical=0x10, - - /** - * Special keyword to use privacy as defined either globally or by proxy using linphone_proxy_config_set_privacy() - */ - LinphonePrivacyDefault=0x8000, -} LinphonePrivacy; -/* - * a mask of #LinphonePrivacy values - * */ -typedef unsigned int LinphonePrivacyMask; - - -LINPHONE_PUBLIC const char* linphone_privacy_to_string(LinphonePrivacy privacy); - - -/** - * Player interface. - * @ingroup call_control -**/ -typedef struct _LinphonePlayer LinphonePlayer; - -/** - * Callback for notifying end of play (file). - * @param obj the LinphonePlayer - * @param user_data the user_data provided when calling linphone_player_open(). - * @ingroup call_control -**/ -typedef void (*LinphonePlayerEofCallback)(struct _LinphonePlayer *obj, void *user_data); - -LINPHONE_PUBLIC int linphone_player_open(LinphonePlayer *obj, const char *filename, LinphonePlayerEofCallback, void *user_data); -LINPHONE_PUBLIC int linphone_player_start(LinphonePlayer *obj); -LINPHONE_PUBLIC int linphone_player_pause(LinphonePlayer *obj); -LINPHONE_PUBLIC int linphone_player_seek(LinphonePlayer *obj, int time_ms); -LINPHONE_PUBLIC MSPlayerState linphone_player_get_state(LinphonePlayer *obj); -LINPHONE_PUBLIC int linphone_player_get_duration(LinphonePlayer *obj); -LINPHONE_PUBLIC int linphone_player_get_current_position(LinphonePlayer *obj); -LINPHONE_PUBLIC void linphone_player_close(LinphonePlayer *obj); -LINPHONE_PUBLIC void linphone_player_destroy(LinphonePlayer *obj); /** * Create an independent media file player. @@ -357,45 +100,6 @@ LINPHONE_PUBLIC void linphone_player_destroy(LinphonePlayer *obj); */ LINPHONE_PUBLIC LinphonePlayer *linphone_core_create_local_player(LinphoneCore *lc, MSSndCard *snd_card, const char *video_out, void *window_id); -/** - * Check whether Matroksa format is supported by the player - * @return TRUE if it is supported - */ -LINPHONE_PUBLIC bool_t linphone_local_player_matroska_supported(void); - - -#include "linphone/address.h" -#include "linphone/buffer.h" -#include "linphone/call.h" -#include "linphone/call_log.h" -#include "linphone/call_params.h" -#include "linphone/content.h" -#include "linphone/event.h" -#include "linphone/im_notif_policy.h" -#include "linphone/linphonefriend.h" -#include "linphone/nat_policy.h" -#include "linphone/xmlrpc.h" -#include "linphone/conference.h" - -/** - * Create a #LinphoneAddress object by parsing the user supplied address, given as a string. - * @param[in] lc #LinphoneCore object - * @param[in] address String containing the user supplied address - * @return The create #LinphoneAddress object - * @ingroup linphone_address - */ -LINPHONE_PUBLIC LinphoneAddress * linphone_core_create_address(LinphoneCore *lc, const char *address); - -/** - * @addtogroup misc - * @{ - */ - -/** - * The LinphoneInfoMessage is an object representing an informational message sent or received by the core. -**/ -typedef struct _LinphoneInfoMessage LinphoneInfoMessage; - /** * Creates an empty info message. * @param lc the LinphoneCore @@ -406,158 +110,10 @@ typedef struct _LinphoneInfoMessage LinphoneInfoMessage; **/ LINPHONE_PUBLIC LinphoneInfoMessage *linphone_core_create_info_message(LinphoneCore*lc); -/** - * Send a LinphoneInfoMessage through an established call - * @param call the call - * @param info the info message -**/ -LINPHONE_PUBLIC int linphone_call_send_info_message(LinphoneCall *call, const LinphoneInfoMessage *info); - -/** - * Add a header to an info message to be sent. - * @param im the info message - * @param name the header'name - * @param value the header's value -**/ -LINPHONE_PUBLIC void linphone_info_message_add_header(LinphoneInfoMessage *im, const char *name, const char *value); - -/** - * Obtain a header value from a received info message. - * @param im the info message - * @param name the header'name - * @return the corresponding header's value, or NULL if not exists. -**/ -LINPHONE_PUBLIC const char *linphone_info_message_get_header(const LinphoneInfoMessage *im, const char *name); - -/** - * Assign a content to the info message. - * @param im the linphone info message - * @param content the content described as a #LinphoneContent structure. - * All fields of the LinphoneContent are copied, thus the application can destroy/modify/recycloe the content object freely ater the function returns. -**/ -LINPHONE_PUBLIC void linphone_info_message_set_content(LinphoneInfoMessage *im, const LinphoneContent *content); - -/** - * Returns the info message's content as a #LinphoneContent structure. -**/ -LINPHONE_PUBLIC const LinphoneContent * linphone_info_message_get_content(const LinphoneInfoMessage *im); - -/** - * Destroy a LinphoneInfoMessage -**/ -LINPHONE_PUBLIC void linphone_info_message_destroy(LinphoneInfoMessage *im); -LINPHONE_PUBLIC LinphoneInfoMessage *linphone_info_message_copy(const LinphoneInfoMessage *orig); - /** * @} */ - -/** - * Structure describing policy regarding video streams establishments. - * @ingroup media_parameters -**/ -struct _LinphoneVideoPolicy{ - bool_t automatically_initiate; /** a #LinphoneContent with a size equal zero - * + * File transfer send callback prototype. This function is called by the core upon an outgoing file transfer is started. This function is called until size is set to 0. * @param lc #LinphoneCore object * @param message #LinphoneChatMessage message from which the body is received. * @param content #LinphoneContent outgoing content @@ -853,7 +340,6 @@ typedef void (*LinphoneCoreFileTransferSendCb)(LinphoneCore *lc, LinphoneChatMes /** * File transfer progress indication callback prototype. - * * @param lc #LinphoneCore object * @param message #LinphoneChatMessage message from which the body is received. * @param content #LinphoneContent incoming content information @@ -864,11 +350,11 @@ typedef void (*LinphoneCoreFileTransferProgressIndicationCb)(LinphoneCore *lc, L /** * Is composing notification callback prototype. - * * @param[in] lc #LinphoneCore object * @param[in] room #LinphoneChatRoom involved in the conversation. */ typedef void (*LinphoneCoreCbsIsComposingReceivedCb)(LinphoneCore *lc, LinphoneChatRoom *room); + /** * Old name of #LinphoneCoreCbsIsComposingReceivedCb. */ @@ -881,6 +367,7 @@ typedef LinphoneCoreCbsIsComposingReceivedCb LinphoneCoreIsComposingReceivedCb; * @param dtmf the ascii code of the dtmf */ typedef void (*LinphoneCoreCbsDtmfReceivedCb)(LinphoneCore* lc, LinphoneCall *call, int dtmf); + /** * Old name of #LinphoneCoreCbsDtmfReceivedCb. */ @@ -888,16 +375,20 @@ typedef LinphoneCoreCbsDtmfReceivedCb LinphoneCoreDtmfReceivedCb; /** Callback prototype */ typedef void (*LinphoneCoreCbsReferReceivedCb)(LinphoneCore *lc, const char *refer_to); + /** * Old name of #LinphoneCoreCbsReferReceivedCb. */ typedef LinphoneCoreCbsReferReceivedCb LinphoneCoreReferReceivedCb; + /** Callback prototype */ typedef void (*LinphoneCoreCbsBuddyInfoUpdatedCb)(LinphoneCore *lc, LinphoneFriend *lf); + /** * Old name of #LinphoneCoreCbsBuddyInfoUpdatedCb. */ typedef LinphoneCoreCbsBuddyInfoUpdatedCb LinphoneCoreBuddyInfoUpdatedCb; + /** * Callback for notifying progresses of transfers. * @param lc the LinphoneCore @@ -905,6 +396,7 @@ typedef LinphoneCoreCbsBuddyInfoUpdatedCb LinphoneCoreBuddyInfoUpdatedCb; * @param new_call_state the state of the call to transfer target at the far end. */ typedef void (*LinphoneCoreCbsTransferStateChangedCb)(LinphoneCore *lc, LinphoneCall *transfered, LinphoneCallState new_call_state); + /** * Old name of LinphoneCoreCbsTransferStateChangedCb. */ @@ -917,6 +409,7 @@ typedef LinphoneCoreCbsTransferStateChangedCb LinphoneCoreTransferStateChangedCb * @param stats the call statistics. */ typedef void (*LinphoneCoreCbsCallStatsUpdatedCb)(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallStats *stats); + /** * Old name of #LinphoneCoreCbsCallStatsUpdatedCb. */ @@ -929,33 +422,19 @@ typedef LinphoneCoreCbsCallStatsUpdatedCb LinphoneCoreCallStatsUpdatedCb; * @param msg the info message. */ typedef void (*LinphoneCoreCbsInfoReceivedCb)(LinphoneCore *lc, LinphoneCall *call, const LinphoneInfoMessage *msg); + /** * Old name of #LinphoneCoreCbsInfoReceivedCb. */ typedef LinphoneCoreCbsInfoReceivedCb LinphoneCoreInfoReceivedCb; -/** - * LinphoneGlobalState describes the global state of the LinphoneCore object. - * It is notified via the LinphoneCoreVTable::global_state_changed -**/ -typedef enum _LinphoneConfiguringState { - LinphoneConfiguringSuccessful, - LinphoneConfiguringFailed, - LinphoneConfiguringSkipped -} LinphoneConfiguringState; - -/** - * Converts a _LinphoneConfiguringState enum to a string. - * @ingroup misc -**/ -LINPHONE_PUBLIC const char *linphone_configuring_state_to_string(LinphoneConfiguringState cs); - /** * Callback prototype for configuring status changes notification * @param lc the LinphoneCore * @param message informational message. */ typedef void (*LinphoneCoreCbsConfiguringStatusCb)(LinphoneCore *lc, LinphoneConfiguringState status, const char *message); + /** * Old name of #LinphoneCoreCbsConfiguringStatusCb. */ @@ -967,6 +446,7 @@ typedef LinphoneCoreCbsConfiguringStatusCb LinphoneCoreConfiguringStatusCb; * @param reachable true if network is reachable. */ typedef void (*LinphoneCoreCbsNetworkReachableCb)(LinphoneCore *lc, bool_t reachable); + /** * Old name of #LinphoneCoreCbsNetworkReachableCb. */ @@ -979,6 +459,7 @@ typedef LinphoneCoreCbsNetworkReachableCb LinphoneCoreNetworkReachableCb; * @param[in] info Additional information: error message in case of error state, URL of uploaded file in case of success. */ typedef void (*LinphoneCoreCbsLogCollectionUploadStateChangedCb)(LinphoneCore *lc, LinphoneCoreLogCollectionUploadState state, const char *info); + /** * Old name of #LinphoneCoreCbsLogCollectionUploadStateChangedCb. */ @@ -989,6 +470,7 @@ typedef LinphoneCoreCbsLogCollectionUploadStateChangedCb LinphoneCoreLogCollecti * @param[in] lc LinphoneCore object */ typedef void (*LinphoneCoreCbsLogCollectionUploadProgressIndicationCb)(LinphoneCore *lc, size_t offset, size_t total); + /** * Old name of #LinphoneCoreCbsLogCollectionUploadProgressIndicationCb. */ @@ -1000,6 +482,7 @@ typedef LinphoneCoreCbsLogCollectionUploadProgressIndicationCb LinphoneCoreLogCo * @param[in] list LinphoneFriendList object */ typedef void (*LinphoneCoreCbsFriendListCreatedCb) (LinphoneCore *lc, LinphoneFriendList *list); + /** * Old name of #LinphoneCoreCbsFriendListCreatedCb. */ @@ -1011,6 +494,7 @@ typedef LinphoneCoreCbsFriendListCreatedCb LinphoneCoreFriendListCreatedCb; * @param[in] list LinphoneFriendList object */ typedef void (*LinphoneCoreCbsFriendListRemovedCb) (LinphoneCore *lc, LinphoneFriendList *list); + /** * Old name of #LinphoneCoreCbsFriendListRemovedCb. */ @@ -1018,7 +502,7 @@ typedef LinphoneCoreCbsFriendListRemovedCb LinphoneCoreFriendListRemovedCb; /** * This structure holds all callbacks that the application should implement. - * None is mandatory. + * None is mandatory. **/ typedef struct _LinphoneCoreVTable{ LinphoneCoreGlobalStateChangedCb global_state_changed; /** For incoming calls behavior is unchanged. + * If enabled, outgoing calls put a multicast address from #linphone_core_get_video_multicast_addr into audio cline. In case of outgoing call audio stream is sent to this multicast address. + * For incoming calls behavior is unchanged. * @param core #LinphoneCore * @param yesno if yes, subsequent calls will propose multicast ip set by #linphone_core_set_audio_multicast_addr * @ingroup media_parameters @@ -4754,12 +4163,13 @@ LINPHONE_PUBLIC bool_t linphone_core_audio_multicast_enabled(const LinphoneCore /** * Use to enable multicast rtp for video stream. * If enabled, outgoing calls put a multicast address from #linphone_core_get_video_multicast_addr into video cline. In case of outgoing call video stream is sent to this multicast address. - *
For incoming calls behavior is unchanged. + * For incoming calls behavior is unchanged. * @param core #LinphoneCore * @param yesno if yes, subsequent outgoing calls will propose multicast ip set by #linphone_core_set_video_multicast_addr * @ingroup media_parameters **/ LINPHONE_PUBLIC void linphone_core_enable_video_multicast(LinphoneCore *core, bool_t yesno); + /** * Use to get multicast state of video stream. * @param core #LinphoneCore @@ -4782,7 +4192,6 @@ LINPHONE_PUBLIC bool_t linphone_core_video_multicast_enabled(const LinphoneCore **/ LINPHONE_PUBLIC int linphone_core_set_network_simulator_params(LinphoneCore *lc, const OrtpNetworkSimulatorParams *params); - /** * Get the previously set network simulation parameters. * @see linphone_core_set_network_simulator_params @@ -4847,106 +4256,89 @@ LINPHONE_PUBLIC const char *linphone_core_get_http_proxy_host(const LinphoneCore */ LINPHONE_PUBLIC int linphone_core_get_http_proxy_port(const LinphoneCore *lc); -/** - * Converts a LinphoneTransportType enum to a lowercase string. - * @ingroup misc -**/ -LINPHONE_PUBLIC const char* linphone_transport_to_string(LinphoneTransportType transport); - -/** - * Converts a lowercase string to a LinphoneTransportType enum. - * @ingroup misc - * @return Transport matching input, or LinphoneTransportUdp if nothing is found -**/ -LINPHONE_PUBLIC LinphoneTransportType linphone_transport_parse(const char* transport); - -typedef struct _LinphoneRingtonePlayer LinphoneRingtonePlayer; - LINPHONE_PUBLIC LinphoneRingtonePlayer *linphone_core_get_ringtoneplayer(LinphoneCore *lc); /** - * @ingroup network_parameters * Sets a TLS certificate used for TLS authentication * The certificate won't be stored, you have to set it after each LinphoneCore startup * @param lc LinphoneCore object * @param tls_cert the TLS certificate + * @ingroup network_parameters */ LINPHONE_PUBLIC void linphone_core_set_tls_cert(LinphoneCore *lc, const char *tls_cert); /** - * @ingroup network_parameters * Sets a TLS key used for TLS authentication * The key won't be stored, you have to set it after each LinphoneCore startup * @param lc LinphoneCore object * @param tls_key the TLS key + * @ingroup network_parameters */ LINPHONE_PUBLIC void linphone_core_set_tls_key(LinphoneCore *lc, const char *tls_key); /** - * @ingroup network_parameters * Sets a TLS certificate path used for TLS authentication * The path will be stored in the rc file and automatically restored on startup * @param lc LinphoneCore object * @param tls_cert_path path to the TLS certificate + * @ingroup network_parameters */ LINPHONE_PUBLIC void linphone_core_set_tls_cert_path(LinphoneCore *lc, const char *tls_cert_path); /** - * @ingroup network_parameters * Sets a TLS key path used for TLS authentication * The path will be stored in the rc file and automatically restored on startup * @param lc LinphoneCore object * @param tls_key_path path to the TLS key + * @ingroup network_parameters */ LINPHONE_PUBLIC void linphone_core_set_tls_key_path(LinphoneCore *lc, const char *tls_key_path); /** - * @ingroup network_parameters * Gets the TLS certificate * @param lc LinphoneCore object * @return the TLS certificate or NULL if not set yet + * @ingroup network_parameters */ LINPHONE_PUBLIC const char *linphone_core_get_tls_cert(const LinphoneCore *lc); /** - * @ingroup network_parameters * Gets the TLS key * @param lc LinphoneCore object - * @return the TLS key or NULL if not set yet + * @return the TLS key or NULL if not set yet + * @ingroup network_parameters */ LINPHONE_PUBLIC const char *linphone_core_get_tls_key(const LinphoneCore *lc); /** - * @ingroup network_parameters * Gets the path to the TLS certificate file * @param lc LinphoneCore object * @return the TLS certificate path or NULL if not set yet + * @ingroup network_parameters */ LINPHONE_PUBLIC const char *linphone_core_get_tls_cert_path(const LinphoneCore *lc); /** - * @ingroup network_parameters * Gets the path to the TLS key file * @param lc LinphoneCore object * @return the TLS key path or NULL if not set yet + * @ingroup network_parameters */ LINPHONE_PUBLIC const char *linphone_core_get_tls_key_path(const LinphoneCore *lc); -#include "linphone/im_encryption_engine.h" - /** - * @ingroup chatroom * Sets an IM Encryption Engine in the core * @param lc LinphoneCore object * @param imee LinphoneImEncryptionEngine object + * @ingroup chatroom */ LINPHONE_PUBLIC void linphone_core_set_im_encryption_engine(LinphoneCore *lc, LinphoneImEncryptionEngine *imee); /** - * @ingroup chatroom * Gets the IM Encryption Engine in the core if possible * @param lc LinphoneCore object * @return the IM Encryption Engine in the core or NULL + * @ingroup chatroom */ LINPHONE_PUBLIC LinphoneImEncryptionEngine * linphone_core_get_im_encryption_engine(const LinphoneCore *lc); @@ -4966,8 +4358,429 @@ LINPHONE_PUBLIC bool_t linphone_core_is_content_type_supported(const LinphoneCor */ LINPHONE_PUBLIC void linphone_core_add_content_type_support(LinphoneCore *lc, const char *content_type); -#include "linphone/ringtoneplayer.h" -#include "linphone/factory.h" + +/** + * @addtogroup chatroom + * @{ + */ + +/** + * Set the chat database path. + * @param lc the linphone core + * @param path the database path + */ +LINPHONE_PUBLIC void linphone_core_set_chat_database_path(LinphoneCore *lc, const char *path); + +/** + * Get path to the database file used for storing chat messages. + * @param lc the linphone core + * @return file path or NULL if not exist + **/ +LINPHONE_PUBLIC const char *linphone_core_get_chat_database_path(const LinphoneCore *lc); + +/** + * Get a chat room whose peer is the supplied address. If it does not exist yet, it will be created. + * No reference is transfered to the application. The LinphoneCore keeps a reference on the chat room. + * @param lc the linphone core + * @param addr a linphone address. + * @return #LinphoneChatRoom where messaging can take place. +**/ +LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_get_chat_room(LinphoneCore *lc, const LinphoneAddress *addr); + +/** + * Get a chat room for messaging from a sip uri like sip:joe@sip.linphone.org. If it does not exist yet, it will be created. + * No reference is transfered to the application. The LinphoneCore keeps a reference on the chat room. + * @param lc A #LinphoneCore object + * @param to The destination address for messages. + * @return #LinphoneChatRoom where messaging can take place. +**/ +LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_get_chat_room_from_uri(LinphoneCore *lc, const char *to); + +/** + * Removes a chatroom including all message history from the LinphoneCore. + * @param lc A #LinphoneCore object + * @param cr A #LinphoneChatRoom object +**/ +LINPHONE_PUBLIC void linphone_core_delete_chat_room(LinphoneCore *lc, LinphoneChatRoom *cr); + +/** + * Inconditionnaly disable incoming chat messages. + * @param lc A #LinphoneCore object + * @param deny_reason the deny reason (#LinphoneReasonNone has no effect). +**/ +LINPHONE_PUBLIC void linphone_core_disable_chat(LinphoneCore *lc, LinphoneReason deny_reason); + +/** + * Enable reception of incoming chat messages. + * By default it is enabled but it can be disabled with linphone_core_disable_chat(). + * @param lc A #LinphoneCore object +**/ +LINPHONE_PUBLIC void linphone_core_enable_chat(LinphoneCore *lc); + +/** + * Returns whether chat is enabled. + * @param lc A #LinphoneCore object +**/ +LINPHONE_PUBLIC bool_t linphone_core_chat_enabled(const LinphoneCore *lc); + +/** + * Get the LinphoneImNotifPolicy object controlling the instant messaging notifications. + * @param[in] lc LinphoneCore object + * @return A LinphoneImNotifPolicy object. + */ +LINPHONE_PUBLIC LinphoneImNotifPolicy * linphone_core_get_im_notif_policy(const LinphoneCore *lc); + +/** + * @} + */ + +/** + * Create a content with default values from Linphone core. + * @param[in] lc LinphoneCore object + * @return LinphoneContent object with default values set + * @ingroup misc + */ +LINPHONE_PUBLIC LinphoneContent * linphone_core_create_content(LinphoneCore *lc); + + +/** + * @addtogroup event_api + * @{ +**/ + +/** + * Create an outgoing subscription, specifying the destination resource, the event name, and an optional content body. + * If accepted, the subscription runs for a finite period, but is automatically renewed if not terminated before. + * @param lc the #LinphoneCore + * @param resource the destination resource + * @param event the event name + * @param expires the whished duration of the subscription + * @param body an optional body, may be NULL. + * @return a LinphoneEvent holding the context of the created subcription. +**/ +LINPHONE_PUBLIC LinphoneEvent *linphone_core_subscribe(LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires, const LinphoneContent *body); + +/** + * Create an outgoing subscription, specifying the destination resource, the event name, and an optional content body. + * If accepted, the subscription runs for a finite period, but is automatically renewed if not terminated before. + * Unlike linphone_core_subscribe() the subscription isn't sent immediately. It will be send when calling linphone_event_send_subscribe(). + * @param lc the #LinphoneCore + * @param resource the destination resource + * @param event the event name + * @param expires the whished duration of the subscription + * @return a LinphoneEvent holding the context of the created subcription. +**/ +LINPHONE_PUBLIC LinphoneEvent *linphone_core_create_subscribe(LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires); + + +/** + * Create an out-of-dialog notification, specifying the destination resource, the event name. + * The notification can be send with linphone_event_notify(). + * @param lc the #LinphoneCore + * @param resource the destination resource + * @param event the event name + * @return a LinphoneEvent holding the context of the notification. +**/ +LINPHONE_PUBLIC LinphoneEvent *linphone_core_create_notify(LinphoneCore *lc, const LinphoneAddress *resource, const char *event); + +/** + * Publish an event state. + * This first create a LinphoneEvent with linphone_core_create_publish() and calls linphone_event_send_publish() to actually send it. + * After expiry, the publication is refreshed unless it is terminated before. + * @param lc the #LinphoneCore + * @param resource the resource uri for the event + * @param event the event name + * @param expires the lifetime of event being published, -1 if no associated duration, in which case it will not be refreshed. + * @param body the actual published data + * @return the LinphoneEvent holding the context of the publish. +**/ +LINPHONE_PUBLIC LinphoneEvent *linphone_core_publish(LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires, const LinphoneContent *body); + +/** + * Create a publish context for an event state. + * After being created, the publish must be sent using linphone_event_send_publish(). + * After expiry, the publication is refreshed unless it is terminated before. + * @param lc the #LinphoneCore + * @param resource the resource uri for the event + * @param event the event name + * @param expires the lifetime of event being published, -1 if no associated duration, in which case it will not be refreshed. + * @return the LinphoneEvent holding the context of the publish. +**/ +LINPHONE_PUBLIC LinphoneEvent *linphone_core_create_publish(LinphoneCore *lc, const LinphoneAddress *resource, const char *event, int expires); + +/** + * Create a publish context for a one-shot publish. + * After being created, the publish must be sent using linphone_event_send_publish(). + * The LinphoneEvent is automatically terminated when the publish transaction is finished, either with success or failure. + * The application must not call linphone_event_terminate() for such one-shot publish. + * @param lc the #LinphoneCore + * @param resource the resource uri for the event + * @param event the event name + * @return the LinphoneEvent holding the context of the publish. +**/ +LINPHONE_PUBLIC LinphoneEvent *linphone_core_create_one_shot_publish(LinphoneCore *lc, const LinphoneAddress *resource, const char *event); + +/** + * @} + */ + + +/** + * @addtogroup buddy_list + * @{ + */ + +/** + * Create a default LinphoneFriend. + * @param[in] lc #LinphoneCore object + * @return The created #LinphoneFriend object + */ +LINPHONE_PUBLIC LinphoneFriend * linphone_core_create_friend(LinphoneCore *lc); + +/** + * Create a LinphoneFriend from the given address. + * @param[in] lc #LinphoneCore object + * @param[in] address A string containing the address to create the LinphoneFriend from + * @return The created #LinphoneFriend object + */ +LINPHONE_PUBLIC LinphoneFriend * linphone_core_create_friend_with_address(LinphoneCore *lc, const char *address); + +/** + * Set my presence status + * @param[in] lc #LinphoneCore object + * @param[in] minutes_away how long in away + * @param[in] alternative_contact sip uri used to redirect call in state #LinphoneStatusMoved + * @param[in] os #LinphoneOnlineStatus + * @deprecated Use linphone_core_set_presence_model() instead + */ +LINPHONE_PUBLIC void linphone_core_set_presence_info(LinphoneCore *lc,int minutes_away,const char *alternative_contact,LinphoneOnlineStatus os); + +/** + * Set my presence model + * @param[in] lc #LinphoneCore object + * @param[in] presence #LinphonePresenceModel + */ +LINPHONE_PUBLIC void linphone_core_set_presence_model(LinphoneCore *lc, LinphonePresenceModel *presence); + +/** + * Get my presence status + * @param[in] lc #LinphoneCore object + * @return #LinphoneOnlineStatus + * @deprecated Use linphone_core_get_presence_model() instead + */ +LINPHONE_PUBLIC LinphoneOnlineStatus linphone_core_get_presence_info(const LinphoneCore *lc); + +/** + * Get my presence model + * @param[in] lc #LinphoneCore object + * @return A #LinphonePresenceModel object, or NULL if no presence model has been set. + */ +LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_get_presence_model(const LinphoneCore *lc); + +/** + * @deprecated Use linphone_core_interpret_url() instead + */ +LINPHONE_PUBLIC void linphone_core_interpret_friend_uri(LinphoneCore *lc, const char *uri, char **result); + +/** + * Add a friend to the current buddy list, if \link linphone_friend_enable_subscribes() subscription attribute \endlink is set, a SIP SUBSCRIBE message is sent. + * @param lc #LinphoneCore object + * @param fr #LinphoneFriend to add + * @deprecated use linphone_friend_list_add_friend() instead. + */ +LINPHONE_PUBLIC void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *fr); + +/** + * Removes a friend from the buddy list + * @param lc #LinphoneCore object + * @param fr #LinphoneFriend to remove + * @deprecated use linphone_friend_list_remove_friend() instead. + */ +LINPHONE_PUBLIC void linphone_core_remove_friend(LinphoneCore *lc, LinphoneFriend *fr); + +/** + * Black list a friend. same as linphone_friend_set_inc_subscribe_policy() with #LinphoneSPDeny policy; + * @param lc #LinphoneCore object + * @param lf #LinphoneFriend to add + */ +LINPHONE_PUBLIC void linphone_core_reject_subscriber(LinphoneCore *lc, LinphoneFriend *lf); + +/** + * Get Buddy list of LinphoneFriend + * @param[in] lc #LinphoneCore object + * @return \bctbx_list{LinphoneFriend} + * @deprecated use linphone_core_get_friends_lists() or linphone_friend_list_get_friends() instead. + */ +LINPHONE_PUBLIC const bctbx_list_t * linphone_core_get_friend_list(const LinphoneCore *lc); + +/** + * Notify all friends that have subscribed + * @param lc #LinphoneCore object + * @param presence #LinphonePresenceModel to notify + */ +LINPHONE_PUBLIC void linphone_core_notify_all_friends(LinphoneCore *lc, LinphonePresenceModel *presence); + +/** + * Search a LinphoneFriend by its address. + * @param[in] lc #LinphoneCore object. + * @param[in] addr The address to use to search the friend. + * @return The #LinphoneFriend object corresponding to the given address. + * @deprecated use linphone_core_find_friend() instead. + */ +LINPHONE_PUBLIC LinphoneFriend *linphone_core_get_friend_by_address(const LinphoneCore *lc, const char *addr); + +/** + * Search a LinphoneFriend by its address. + * @param[in] lc #LinphoneCore object. + * @param[in] addr The address to use to search the friend. + * @return The #LinphoneFriend object corresponding to the given address. + */ +LINPHONE_PUBLIC LinphoneFriend *linphone_core_find_friend(const LinphoneCore *lc, const LinphoneAddress *addr); + +/** + * Search a LinphoneFriend by its reference key. + * @param[in] lc #LinphoneCore object. + * @param[in] key The reference key to use to search the friend. + * @return The #LinphoneFriend object corresponding to the given reference key. + */ +LINPHONE_PUBLIC LinphoneFriend *linphone_core_get_friend_by_ref_key(const LinphoneCore *lc, const char *key); + +/** + * Sets the database filename where friends will be stored. + * If the file does not exist, it will be created. + * @ingroup initializing + * @param lc the linphone core + * @param path filesystem path +**/ +LINPHONE_PUBLIC void linphone_core_set_friends_database_path(LinphoneCore *lc, const char *path); + +/** + * Migrates the friends from the linphonerc to the database if not done yet + * @ingroup initializing + * @param lc the linphone core +**/ +LINPHONE_PUBLIC void linphone_core_migrate_friends_from_rc_to_db(LinphoneCore *lc); + +/** + * Create a new empty LinphoneFriendList object. + * @param[in] lc LinphoneCore object. + * @return A new LinphoneFriendList object. +**/ +LINPHONE_PUBLIC LinphoneFriendList * linphone_core_create_friend_list(LinphoneCore *lc); + +/** + * Add a friend list. + * @param[in] lc LinphoneCore object + * @param[in] list LinphoneFriendList object + */ +LINPHONE_PUBLIC void linphone_core_add_friend_list(LinphoneCore *lc, LinphoneFriendList *list); + +/** + * Removes a friend list. + * @param[in] lc LinphoneCore object + * @param[in] list LinphoneFriendList object + */ +LINPHONE_PUBLIC void linphone_core_remove_friend_list(LinphoneCore *lc, LinphoneFriendList *list); + +/** + * Retrieves the list of LinphoneFriendList from the core. + * @param[in] lc LinphoneCore object + * @return \bctbx_list{LinphoneFriendList} a list of LinphoneFriendList + */ +LINPHONE_PUBLIC const bctbx_list_t * linphone_core_get_friends_lists(const LinphoneCore *lc); + +/** + * Retrieves the first list of LinphoneFriend from the core. + * @param[in] lc LinphoneCore object + * @return the first LinphoneFriendList object or NULL + */ +LINPHONE_PUBLIC LinphoneFriendList * linphone_core_get_default_friend_list(const LinphoneCore *lc); + +/** + * Create a LinphonePresenceActivity with the given type and description. + * @param[in] lc #LinphoneCore object. + * @param[in] acttype The #LinphonePresenceActivityType to set for the activity. + * @param[in] description An additional description of the activity to set for the activity. Can be NULL if no additional description is to be added. + * @return The created #LinphonePresenceActivity object. + */ +LINPHONE_PUBLIC LinphonePresenceActivity * linphone_core_create_presence_activity(LinphoneCore *lc, LinphonePresenceActivityType acttype, const char *description); + +/** + * Create a default LinphonePresenceModel. + * @param[in] lc #LinphoneCore object. + * @return The created #LinphonePresenceModel object. + */ +LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_create_presence_model(LinphoneCore *lc); + +/** + * Create a LinphonePresenceModel with the given activity type and activity description. + * @param[in] lc #LinphoneCore object. + * @param[in] acttype The #LinphonePresenceActivityType to set for the activity of the created model. + * @param[in] description An additional description of the activity to set for the activity. Can be NULL if no additional description is to be added. + * @return The created #LinphonePresenceModel object. + */ +LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_create_presence_model_with_activity(LinphoneCore *lc, LinphonePresenceActivityType acttype, const char *description); + +/** + * Create a LinphonePresenceModel with the given activity type, activity description, note content and note language. + * @param[in] lc #LinphoneCore object. + * @param[in] acttype The #LinphonePresenceActivityType to set for the activity of the created model. + * @param[in] description An additional description of the activity to set for the activity. Can be NULL if no additional description is to be added. + * @param[in] note The content of the note to be added to the created model. + * @param[in] lang The language of the note to be added to the created model. + * @return The created #LinphonePresenceModel object. + */ +LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_create_presence_model_with_activity_and_note(LinphoneCore *lc, LinphonePresenceActivityType acttype, const char *description, const char *note, const char *lang); + +/** + * Create a LinphonePresenceNote with the given content and language. + * @param[in] lc #LinphoneCore object. + * @param[in] content The content of the note to be created. + * @param[in] lang The language of the note to be created. + * @return The created #LinphonePresenceNote object. + */ +LINPHONE_PUBLIC LinphonePresenceNote * linphone_core_create_presence_note(LinphoneCore *lc, const char *content, const char *lang); + +/** + * Create a LinphonePresencePerson with the given id. + * @param[in] lc #LinphoneCore object + * @param[in] id The id of the person to be created. + * @return The created #LinphonePresencePerson object. + */ +LINPHONE_PUBLIC LinphonePresencePerson * linphone_core_create_presence_person(LinphoneCore *lc, const char *id); + +/** + * Create a LinphonePresenceService with the given id, basic status and contact. + * @param[in] lc #LinphoneCore object. + * @param[in] id The id of the service to be created. + * @param[in] basic_status The basic status of the service to be created. + * @param[in] contact A string containing a contact information corresponding to the service to be created. + * @return The created #LinphonePresenceService object. + */ +LINPHONE_PUBLIC LinphonePresenceService * linphone_core_create_presence_service(LinphoneCore *lc, const char *id, LinphonePresenceBasicStatus basic_status, const char *contact); + +/** + * @} + */ + + +/** + * Create a new LinphoneNatPolicy object with every policies being disabled. + * @param[in] lc LinphoneCore object + * @return A new LinphoneNatPolicy object. + * @ingroup network_parameters + */ +LINPHONE_PUBLIC LinphoneNatPolicy * linphone_core_create_nat_policy(LinphoneCore *lc); + +/** + * Create a new LinphoneNatPolicy by reading the config of a LinphoneCore according to the passed ref. + * @param[in] lc LinphoneCore object + * @param[in] ref The reference of a NAT policy in the config of the LinphoneCore + * @return A new LinphoneNatPolicy object. + * @ingroup network_parameters + */ +LINPHONE_PUBLIC LinphoneNatPolicy * linphone_core_create_nat_policy_from_config(LinphoneCore *lc, const char *ref); + #ifdef __cplusplus } diff --git a/include/linphone/core_utils.h b/include/linphone/core_utils.h index 09ed34c8a..441b53550 100644 --- a/include/linphone/core_utils.h +++ b/include/linphone/core_utils.h @@ -17,17 +17,17 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef LINPHONECORE_UTILS_H -#define LINPHONECORE_UTILS_H +#ifndef LINPHONE_CORE_UTILS_H_ +#define LINPHONE_CORE_UTILS_H_ + + +#include "linphone/types.h" + -#include "linphone/core.h" #ifdef __cplusplus extern "C" { #endif -typedef struct _LsdPlayer LsdPlayer; -typedef struct _LinphoneSoundDaemon LinphoneSoundDaemon; - typedef void (*LsdEndOfPlayCallback)(LsdPlayer *p); LINPHONE_PUBLIC void lsd_player_set_callback(LsdPlayer *p, LsdEndOfPlayCallback cb); @@ -48,16 +48,6 @@ LINPHONE_PUBLIC void linphone_sound_daemon_release_all_players(LinphoneSoundDaem LINPHONE_PUBLIC void linphone_core_use_sound_daemon(LinphoneCore *lc, LinphoneSoundDaemon *lsd); LINPHONE_PUBLIC void linphone_sound_daemon_destroy(LinphoneSoundDaemon *obj); -/** - * Enum describing the result of the echo canceller calibration process. -**/ -typedef enum { - LinphoneEcCalibratorInProgress, /**< The echo canceller calibration process is on going. */ - LinphoneEcCalibratorDone, /**< The echo canceller calibration has been performed and produced an echo delay measure. */ - LinphoneEcCalibratorFailed, /**< The echo canceller calibration process has failed. */ - LinphoneEcCalibratorDoneNoEcho /**< The echo canceller calibration has been performed and no echo has been detected. */ -}LinphoneEcCalibratorStatus; - typedef void (*LinphoneEcCalibrationCallback)(LinphoneCore *lc, LinphoneEcCalibratorStatus status, int delay_ms, void *data); typedef void (*LinphoneEcCalibrationAudioInit)(void *data); @@ -112,6 +102,7 @@ typedef struct _LinphoneDialPlan { *@return call country code or -1 if not found */ LINPHONE_PUBLIC int linphone_dial_plan_lookup_ccc_from_iso(const char* iso); + /** * @ingroup misc *Function to get call country code from an e164 number, ex: +33952650121 will return 33 @@ -135,8 +126,7 @@ LINPHONE_PUBLIC const LinphoneDialPlan* linphone_dial_plan_by_ccc(const char *cc * @return Return matching dial plan, or a generic one if none found **/ LINPHONE_PUBLIC const LinphoneDialPlan* linphone_dial_plan_by_ccc_as_int(int ccc); - - + /** * Return if given plan is generic **/ @@ -145,5 +135,5 @@ LINPHONE_PUBLIC bool_t linphone_dial_plan_is_generic(const LinphoneDialPlan *ccc #ifdef __cplusplus } #endif -#endif +#endif /* LINPHONE_CORE_UTILS_H_ */ diff --git a/include/linphone/defs.h b/include/linphone/defs.h new file mode 100644 index 000000000..3e985b3de --- /dev/null +++ b/include/linphone/defs.h @@ -0,0 +1,48 @@ +/* +defs.h +Copyright (C) 2010-2017 Belledonne Communications SARL + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#ifndef LINPHONE_DEFS_H_ +#define LINPHONE_DEFS_H_ + + +#include "mediastreamer2/mscommon.h" + + +#define LINPHONE_IPADDR_SIZE 64 +#define LINPHONE_HOSTNAME_SIZE 128 + +#ifndef LINPHONE_PUBLIC +#if defined(_MSC_VER) +#ifdef LINPHONE_EXPORTS +#define LINPHONE_PUBLIC __declspec(dllexport) +#else +#define LINPHONE_PUBLIC __declspec(dllimport) +#endif +#else +#define LINPHONE_PUBLIC +#endif +#endif + + +#ifndef LINPHONE_DEPRECATED +#define LINPHONE_DEPRECATED MS2_DEPRECATED +#endif + + +#endif /* LINPHONE_DEFS_H_ */ diff --git a/include/linphone/dictionary.h b/include/linphone/dictionary.h index 3000ec62e..d57b8c1f3 100644 --- a/include/linphone/dictionary.h +++ b/include/linphone/dictionary.h @@ -20,9 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef LINPHONE_DICTIONARY_H #define LINPHONE_DICTIONARY_H -#include - -typedef struct belle_sip_dict LinphoneDictionary; +#include "linphone/types.h" #ifdef __cplusplus extern "C" { diff --git a/include/linphone/error_info.h b/include/linphone/error_info.h index 05173850c..af54bc387 100644 --- a/include/linphone/error_info.h +++ b/include/linphone/error_info.h @@ -20,85 +20,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef LINPHONE_ERROR_INFO_H #define LINPHONE_ERROR_INFO_H -#include - -/** - * @addtogroup misc - * @{ - */ - -/** - * Enum describing various failure reasons or contextual information for some events. - * @see linphone_call_get_reason() - * @see linphone_proxy_config_get_error() - * @see linphone_error_info_get_reason() -**/ -enum _LinphoneReason{ - LinphoneReasonNone, /**< No reason has been set by the core */ - LinphoneReasonNoResponse, /**< No response received from remote */ - LinphoneReasonForbidden, /**< Authentication failed due to bad credentials or resource forbidden */ - LinphoneReasonDeclined, /**< The call has been declined */ - LinphoneReasonNotFound, /**< Destination of the call was not found */ - LinphoneReasonNotAnswered, /**< The call was not answered in time (request timeout) */ - LinphoneReasonBusy, /**< Phone line was busy */ - LinphoneReasonUnsupportedContent, /**< Unsupported content */ - LinphoneReasonIOError, /**< Transport error: connection failures, disconnections etc... */ - LinphoneReasonDoNotDisturb, /**< Do not disturb reason */ - LinphoneReasonUnauthorized, /**< Operation is unauthorized because missing credential */ - LinphoneReasonNotAcceptable, /**< Operation is rejected due to incompatible or unsupported media parameters */ - LinphoneReasonNoMatch, /**< Operation could not be executed by server or remote client because it didn't have any context for it */ - LinphoneReasonMovedPermanently, /**< Resource moved permanently */ - LinphoneReasonGone, /**< Resource no longer exists */ - LinphoneReasonTemporarilyUnavailable, /**< Temporarily unavailable */ - LinphoneReasonAddressIncomplete, /**< Address incomplete */ - LinphoneReasonNotImplemented, /**< Not implemented */ - LinphoneReasonBadGateway, /**< Bad gateway */ - LinphoneReasonServerTimeout, /**< Server timeout */ - LinphoneReasonUnknown /**< Unknown reason */ -}; - -#define LinphoneReasonBadCredentials LinphoneReasonForbidden - -/*for compatibility*/ -#define LinphoneReasonMedia LinphoneReasonUnsupportedContent - -/** - * Enum describing failure reasons. -**/ -typedef enum _LinphoneReason LinphoneReason; - -/** - * Object representing full details about a signaling error or status. - * All LinphoneErrorInfo object returned by the liblinphone API are readonly and transcients. For safety they must be used immediately - * after obtaining them. Any other function call to the liblinphone may change their content or invalidate the pointer. -**/ -typedef struct _LinphoneErrorInfo LinphoneErrorInfo; - +#include "linphone/types.h" #ifdef __cplusplus extern "C" { #endif /** - * Converts a LinphoneReason enum to a string. - * @param[in] err A #LinphoneReason - * @return The string representation of the specified LinphoneReason -**/ -LINPHONE_PUBLIC const char *linphone_reason_to_string(LinphoneReason err); - -/** - * Converts an error code to a LinphoneReason. - * @param[in] err An error code - * @return The LinphoneReason corresponding to the specified error code -**/ -LINPHONE_PUBLIC LinphoneReason linphone_error_code_to_reason(int err); - -/** - * Converts a LinphoneReason to an error code. - * @param[in] reason A LinphoneReason - * @return The error code corresponding to the specified LinphoneReason + * @addtogroup misc + * @{ */ -LINPHONE_PUBLIC int linphone_reason_to_error_code(LinphoneReason reason); /** * Get reason code from the error info. diff --git a/include/linphone/event.h b/include/linphone/event.h index 73b29542b..94961f5ea 100644 --- a/include/linphone/event.h +++ b/include/linphone/event.h @@ -16,82 +16,22 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef LINPHONEEVENT_H -#define LINPHONEEVENT_H + +#ifndef LINPHONE_EVENT_H_ +#define LINPHONE_EVENT_H_ + +#include "linphone/types.h" /** * @addtogroup event_api * @{ **/ -struct _LinphoneEvent; - -/** - * Object representing an event state, which is subcribed or published. - * @see linphone_core_publish() - * @see linphone_core_subscribe() -**/ -typedef struct _LinphoneEvent LinphoneEvent; - -/** - * Enum for subscription direction (incoming or outgoing). -**/ -enum _LinphoneSubscriptionDir{ - LinphoneSubscriptionIncoming, /**< Incoming subscription. */ - LinphoneSubscriptionOutgoing, /**< Outgoing subscription. */ - LinphoneSubscriptionInvalidDir /**< Invalid subscription direction. */ -}; - -/** - * Typedef alias for _LinphoneSubscriptionDir -**/ -typedef enum _LinphoneSubscriptionDir LinphoneSubscriptionDir; - -/** - * Enum for subscription states. - * LinphoneSubscriptionTerminated and LinphoneSubscriptionError are final states. -**/ -enum _LinphoneSubscriptionState{ - LinphoneSubscriptionNone, /**< Initial state, should not be used.**/ - LinphoneSubscriptionOutgoingProgress, /**refresh_generic_subscribe property is set to 0.*/ -}; - -/** - * Typedef for subscription state enum. -**/ -typedef enum _LinphoneSubscriptionState LinphoneSubscriptionState; - -LINPHONE_PUBLIC const char *linphone_subscription_state_to_string(LinphoneSubscriptionState state); - -/** - * Enum for publish states. -**/ -enum _LinphonePublishState{ - LinphonePublishNone, /**< Initial state, do not use**/ - LinphonePublishProgress, /**refresh_generic_publish property is set to 0.*/ - LinphonePublishCleared /** Use by linphone_friend_set_inc_subscribe_policy() - */ -typedef enum _LinphoneSubscribePolicy { - /** - * Does not automatically accept an incoming subscription request. - * This policy implies that a decision has to be taken for each incoming subscription request notified by callback LinphoneCoreVTable.new_subscription_requested - * - */ - LinphoneSPWait, - /** - * Rejects incoming subscription request. - */ - LinphoneSPDeny, - /** - * Automatically accepts a subscription request. - */ - LinphoneSPAccept -} LinphoneSubscribePolicy; - -/** - * Enum describing remote friend status - * @deprecated Use #LinphonePresenceModel and #LinphonePresenceActivity instead - */ -typedef enum _LinphoneOnlineStatus{ - /** - * Offline - */ - LinphoneStatusOffline, - /** - * Online - */ - LinphoneStatusOnline, - /** - * Busy - */ - LinphoneStatusBusy, - /** - * Be right back - */ - LinphoneStatusBeRightBack, - /** - * Away - */ - LinphoneStatusAway, - /** - * On the phone - */ - LinphoneStatusOnThePhone, - /** - * Out to lunch - */ - LinphoneStatusOutToLunch, - /** - * Do not disturb - */ - LinphoneStatusDoNotDisturb, - /** - * Moved in this sate, call can be redirected if an alternate contact address has been set using function linphone_core_set_presence_info() - */ - LinphoneStatusMoved, - /** - * Using another messaging service - */ - LinphoneStatusAltService, - /** - * Pending - */ - LinphoneStatusPending, - /** - * Vacation - */ - LinphoneStatusVacation, - - LinphoneStatusEnd -}LinphoneOnlineStatus; - - -struct _LinphoneFriend; -/** - * Represents a buddy, all presence actions like subscription and status change notification are performed on this object - */ -typedef struct _LinphoneFriend LinphoneFriend; /** * Contructor @@ -357,130 +272,6 @@ LINPHONE_PUBLIC const char *linphone_friend_get_ref_key(const LinphoneFriend *lf **/ LINPHONE_PUBLIC bool_t linphone_friend_in_list(const LinphoneFriend *lf); - -/** - * Return humain readable presence status - * @param ss - * @deprecated Use #LinphonePresenceModel, #LinphonePresenceActivity and linphone_presence_activity_to_string() instead. - */ -LINPHONE_PUBLIC const char *linphone_online_status_to_string(LinphoneOnlineStatus ss); - - -/** - * Create a default LinphoneFriend. - * @param[in] lc #LinphoneCore object - * @return The created #LinphoneFriend object - */ -LINPHONE_PUBLIC LinphoneFriend * linphone_core_create_friend(LinphoneCore *lc); - -/** - * Create a LinphoneFriend from the given address. - * @param[in] lc #LinphoneCore object - * @param[in] address A string containing the address to create the LinphoneFriend from - * @return The created #LinphoneFriend object - */ -LINPHONE_PUBLIC LinphoneFriend * linphone_core_create_friend_with_address(LinphoneCore *lc, const char *address); - -/** - * Set my presence status - * @param[in] lc #LinphoneCore object - * @param[in] minutes_away how long in away - * @param[in] alternative_contact sip uri used to redirect call in state #LinphoneStatusMoved - * @param[in] os #LinphoneOnlineStatus - * @deprecated Use linphone_core_set_presence_model() instead - */ -LINPHONE_PUBLIC void linphone_core_set_presence_info(LinphoneCore *lc,int minutes_away,const char *alternative_contact,LinphoneOnlineStatus os); - -/** - * Set my presence model - * @param[in] lc #LinphoneCore object - * @param[in] presence #LinphonePresenceModel - */ -LINPHONE_PUBLIC void linphone_core_set_presence_model(LinphoneCore *lc, LinphonePresenceModel *presence); - -/** - * Get my presence status - * @param[in] lc #LinphoneCore object - * @return #LinphoneOnlineStatus - * @deprecated Use linphone_core_get_presence_model() instead - */ -LINPHONE_PUBLIC LinphoneOnlineStatus linphone_core_get_presence_info(const LinphoneCore *lc); - -/** - * Get my presence model - * @param[in] lc #LinphoneCore object - * @return A #LinphonePresenceModel object, or NULL if no presence model has been set. - */ -LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_get_presence_model(const LinphoneCore *lc); - -/** - * @deprecated Use linphone_core_interpret_url() instead - */ -LINPHONE_PUBLIC void linphone_core_interpret_friend_uri(LinphoneCore *lc, const char *uri, char **result); - -/** - * Add a friend to the current buddy list, if \link linphone_friend_enable_subscribes() subscription attribute \endlink is set, a SIP SUBSCRIBE message is sent. - * @param lc #LinphoneCore object - * @param fr #LinphoneFriend to add - * @deprecated use linphone_friend_list_add_friend() instead. - */ -LINPHONE_PUBLIC void linphone_core_add_friend(LinphoneCore *lc, LinphoneFriend *fr); - -/** - * Removes a friend from the buddy list - * @param lc #LinphoneCore object - * @param fr #LinphoneFriend to remove - * @deprecated use linphone_friend_list_remove_friend() instead. - */ -LINPHONE_PUBLIC void linphone_core_remove_friend(LinphoneCore *lc, LinphoneFriend *fr); - -/** - * Black list a friend. same as linphone_friend_set_inc_subscribe_policy() with #LinphoneSPDeny policy; - * @param lc #LinphoneCore object - * @param lf #LinphoneFriend to add - */ -LINPHONE_PUBLIC void linphone_core_reject_subscriber(LinphoneCore *lc, LinphoneFriend *lf); - -/** - * Get Buddy list of LinphoneFriend - * @param[in] lc #LinphoneCore object - * @return \bctbx_list{LinphoneFriend} - * @deprecated use linphone_core_get_friends_lists() or linphone_friend_list_get_friends() instead. - */ -LINPHONE_PUBLIC const bctbx_list_t * linphone_core_get_friend_list(const LinphoneCore *lc); - -/** - * Notify all friends that have subscribed - * @param lc #LinphoneCore object - * @param presence #LinphonePresenceModel to notify - */ -LINPHONE_PUBLIC void linphone_core_notify_all_friends(LinphoneCore *lc, LinphonePresenceModel *presence); - -/** - * Search a LinphoneFriend by its address. - * @param[in] lc #LinphoneCore object. - * @param[in] addr The address to use to search the friend. - * @return The #LinphoneFriend object corresponding to the given address. - * @deprecated use linphone_core_find_friend() instead. - */ -LINPHONE_PUBLIC LinphoneFriend *linphone_core_get_friend_by_address(const LinphoneCore *lc, const char *addr); - -/** - * Search a LinphoneFriend by its address. - * @param[in] lc #LinphoneCore object. - * @param[in] addr The address to use to search the friend. - * @return The #LinphoneFriend object corresponding to the given address. - */ -LINPHONE_PUBLIC LinphoneFriend *linphone_core_find_friend(const LinphoneCore *lc, const LinphoneAddress *addr); - -/** - * Search a LinphoneFriend by its reference key. - * @param[in] lc #LinphoneCore object. - * @param[in] key The reference key to use to search the friend. - * @return The #LinphoneFriend object corresponding to the given reference key. - */ -LINPHONE_PUBLIC LinphoneFriend *linphone_core_get_friend_by_ref_key(const LinphoneCore *lc, const char *key); - /** * Acquire a reference to the linphone friend. * @param[in] lf LinphoneFriend object @@ -528,22 +319,6 @@ LINPHONE_PUBLIC bool_t linphone_friend_create_vcard(LinphoneFriend *fr, const ch */ LINPHONE_PUBLIC LinphoneFriend *linphone_friend_new_from_vcard(LinphoneVcard *vcard); -/** - * Sets the database filename where friends will be stored. - * If the file does not exist, it will be created. - * @ingroup initializing - * @param lc the linphone core - * @param path filesystem path -**/ -LINPHONE_PUBLIC void linphone_core_set_friends_database_path(LinphoneCore *lc, const char *path); - -/** - * Migrates the friends from the linphonerc to the database if not done yet - * @ingroup initializing - * @param lc the linphone core -**/ -LINPHONE_PUBLIC void linphone_core_migrate_friends_from_rc_to_db(LinphoneCore *lc); - /** * Saves a friend either in database if configured, otherwise in linphonerc * @param fr the linphone friend to save @@ -559,4 +334,4 @@ LINPHONE_PUBLIC void linphone_friend_save(LinphoneFriend *fr, LinphoneCore *lc); } #endif -#endif /* LINPHONEFRIEND_H_ */ +#endif /* LINPHONE_FRIEND_H_ */ diff --git a/include/linphone/friendlist.h b/include/linphone/friendlist.h index 2989fcc95..4c7ef43a5 100644 --- a/include/linphone/friendlist.h +++ b/include/linphone/friendlist.h @@ -22,8 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define LINPHONE_FRIENDLIST_H_ -#include "linphone/friend.h" -#include "linphone/presence.h" +#include "linphone/types.h" #ifdef __cplusplus @@ -35,64 +34,6 @@ extern "C" { * @{ */ -/** -* Enum describing the status of a LinphoneFriendList operation. -**/ -typedef enum _LinphoneFriendListStatus { - LinphoneFriendListOK, - LinphoneFriendListNonExistentFriend, - LinphoneFriendListInvalidFriend -} LinphoneFriendListStatus; - -/** - * Enum describing the status of a CardDAV synchronization - */ -typedef enum _LinphoneFriendListSyncStatus { - LinphoneFriendListSyncStarted, - LinphoneFriendListSyncSuccessful, - LinphoneFriendListSyncFailure -} LinphoneFriendListSyncStatus; - -/** - * The LinphoneFriendList object representing a list of friends. -**/ -typedef struct _LinphoneFriendList LinphoneFriendList; - -/** - * Create a new empty LinphoneFriendList object. - * @param[in] lc LinphoneCore object. - * @return A new LinphoneFriendList object. -**/ -LINPHONE_PUBLIC LinphoneFriendList * linphone_core_create_friend_list(LinphoneCore *lc); - -/** - * Add a friend list. - * @param[in] lc LinphoneCore object - * @param[in] list LinphoneFriendList object - */ -LINPHONE_PUBLIC void linphone_core_add_friend_list(LinphoneCore *lc, LinphoneFriendList *list); - -/** - * Removes a friend list. - * @param[in] lc LinphoneCore object - * @param[in] list LinphoneFriendList object - */ -LINPHONE_PUBLIC void linphone_core_remove_friend_list(LinphoneCore *lc, LinphoneFriendList *list); - -/** - * Retrieves the list of LinphoneFriendList from the core. - * @param[in] lc LinphoneCore object - * @return \bctbx_list{LinphoneFriendList} a list of LinphoneFriendList - */ -LINPHONE_PUBLIC const bctbx_list_t * linphone_core_get_friends_lists(const LinphoneCore *lc); - -/** - * Retrieves the first list of LinphoneFriend from the core. - * @param[in] lc LinphoneCore object - * @return the first LinphoneFriendList object or NULL - */ -LINPHONE_PUBLIC LinphoneFriendList * linphone_core_get_default_friend_list(const LinphoneCore *lc); - /** * Acquire a reference to the friend list. * @param[in] list LinphoneFriendList object. @@ -148,7 +89,6 @@ LINPHONE_PUBLIC const char * linphone_friend_list_get_rls_uri(const LinphoneFrie **/ LINPHONE_PUBLIC void linphone_friend_list_set_rls_uri(LinphoneFriendList *list, const char *rls_uri); - /** * Get the RLS (Resource List Server) URI associated with the friend list to subscribe to these friends presence. * @param[in] list LinphoneFriendList object. @@ -254,11 +194,6 @@ LINPHONE_PUBLIC void linphone_friend_list_set_uri(LinphoneFriendList *list, cons */ LINPHONE_PUBLIC void linphone_friend_list_update_revision(LinphoneFriendList *list, int rev); -/** - * An object to handle the callbacks for LinphoneFriend synchronization. -**/ -typedef struct _LinphoneFriendListCbs LinphoneFriendListCbs; - /** * Callback used to notify a new contact has been created on the CardDAV server and downloaded locally * @param list The LinphoneFriendList object the new contact is added to diff --git a/include/linphone/im_encryption_engine.h b/include/linphone/im_encryption_engine.h index e24d7d29c..7f340d6b0 100644 --- a/include/linphone/im_encryption_engine.h +++ b/include/linphone/im_encryption_engine.h @@ -20,18 +20,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef LINPHONE_IM_ENCRYPTION_ENGINE_H #define LINPHONE_IM_ENCRYPTION_ENGINE_H -#include +#include "linphone/types.h" /** * @addtogroup misc * @{ */ -/** - * IM encryption engine. - */ -typedef struct _LinphoneImEncryptionEngine LinphoneImEncryptionEngine; - /** * Callback to decrypt incoming LinphoneChatMessage * @param engine ImEncryptionEngine object @@ -90,11 +85,6 @@ typedef int (*LinphoneImEncryptionEngineCbsDownloadingFileCb)(LinphoneImEncrypti */ typedef int (*LinphoneImEncryptionEngineCbsUploadingFileCb)(LinphoneImEncryptionEngine *engine, LinphoneChatMessage *msg, size_t offset, const char *buffer, size_t *size, char *encrypted_buffer); -/** - * An object to handle the callbacks for the handling a LinphoneImEncryptionEngine object. - */ -typedef struct _LinphoneImEncryptionEngineCbs LinphoneImEncryptionEngineCbs; - /** * Acquire a reference to the LinphoneImEncryptionEngineCbs. * @param[in] cbs LinphoneImEncryptionEngineCbs object. diff --git a/include/linphone/im_notif_policy.h b/include/linphone/im_notif_policy.h index 8d1c74dd4..ee2c1a5a3 100644 --- a/include/linphone/im_notif_policy.h +++ b/include/linphone/im_notif_policy.h @@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define LINPHONE_IM_NOTIF_POLICY_H_ +#include "linphone/types.h" + + #ifdef __cplusplus extern "C" { #endif @@ -31,13 +34,6 @@ extern "C" { * @{ */ -/** - * Policy to use to send/receive instant messaging composing/delivery/display notifications. - * The sending of this information is done as in the RFCs 3994 (is_composing) and 5438 (imdn delivered/displayed). - */ -typedef struct _LinphoneImNotifPolicy LinphoneImNotifPolicy; - - /** * Acquire a reference to the LinphoneImNotifPolicy object. * @param[in] policy LinphoneImNotifPolicy object. @@ -161,13 +157,6 @@ LINPHONE_PUBLIC bool_t linphone_im_notif_policy_get_recv_imdn_displayed(const Li */ LINPHONE_PUBLIC void linphone_im_notif_policy_set_recv_imdn_displayed(LinphoneImNotifPolicy *policy, bool_t enable); -/** - * Get the LinphoneImNotifPolicy object controlling the instant messaging notifications. - * @param[in] lc LinphoneCore object - * @return A LinphoneImNotifPolicy object. - */ -LINPHONE_PUBLIC LinphoneImNotifPolicy * linphone_core_get_im_notif_policy(const LinphoneCore *lc); - /** * @} */ diff --git a/include/linphone/info_message.h b/include/linphone/info_message.h new file mode 100644 index 000000000..406f7d6e7 --- /dev/null +++ b/include/linphone/info_message.h @@ -0,0 +1,84 @@ +/* +info_message.h +Copyright (C) 2010-2017 Belledonne Communications SARL + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#ifndef LINPHONE_INFO_MESSAGE_H_ +#define LINPHONE_INFO_MESSAGE_H_ + + +#include "linphone/types.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @addtogroup misc + * @{ + */ + + +/** + * Add a header to an info message to be sent. + * @param im the info message + * @param name the header'name + * @param value the header's value +**/ +LINPHONE_PUBLIC void linphone_info_message_add_header(LinphoneInfoMessage *im, const char *name, const char *value); + +/** + * Obtain a header value from a received info message. + * @param im the info message + * @param name the header'name + * @return the corresponding header's value, or NULL if not exists. +**/ +LINPHONE_PUBLIC const char *linphone_info_message_get_header(const LinphoneInfoMessage *im, const char *name); + +/** + * Assign a content to the info message. + * @param im the linphone info message + * @param content the content described as a #LinphoneContent structure. + * All fields of the LinphoneContent are copied, thus the application can destroy/modify/recycloe the content object freely ater the function returns. +**/ +LINPHONE_PUBLIC void linphone_info_message_set_content(LinphoneInfoMessage *im, const LinphoneContent *content); + +/** + * Returns the info message's content as a #LinphoneContent structure. +**/ +LINPHONE_PUBLIC const LinphoneContent * linphone_info_message_get_content(const LinphoneInfoMessage *im); + +/** + * Destroy a LinphoneInfoMessage +**/ +LINPHONE_PUBLIC void linphone_info_message_destroy(LinphoneInfoMessage *im); + +LINPHONE_PUBLIC LinphoneInfoMessage *linphone_info_message_copy(const LinphoneInfoMessage *orig); + + +/** + * @} + */ + + +#ifdef __cplusplus +} +#endif + +#endif /* LINPHONE_INFO_MESSAGE_H_ */ diff --git a/include/linphone/ldapprovider.h b/include/linphone/ldapprovider.h index 7a988c56b..b37f8280a 100644 --- a/include/linphone/ldapprovider.h +++ b/include/linphone/ldapprovider.h @@ -14,28 +14,43 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ +#ifndef LINPHONE_LDAPPROVIDER_H_ +#define LINPHONE_LDAPPROVIDER_H_ + + #include "linphone/contactprovider.h" -typedef struct _LinphoneLDAPContactProvider LinphoneLDAPContactProvider; +#ifdef __cplusplus +extern "C" { +#endif /* LinphoneLDAPContactSearch */ -typedef struct _LinphoneLDAPContactSearch LinphoneLDAPContactSearch; -LinphoneLDAPContactSearch* linphone_ldap_contact_search_create(LinphoneLDAPContactProvider* ld, - const char* predicate, - ContactSearchCallback cb, - void* cb_data); +LinphoneLDAPContactSearch * linphone_ldap_contact_search_create(LinphoneLDAPContactProvider *ld, const char *predicate, ContactSearchCallback cb, void *cb_data); -LINPHONE_PUBLIC unsigned int linphone_ldap_contact_search_result_count(LinphoneLDAPContactSearch* obj); -LINPHONE_PUBLIC LinphoneLDAPContactSearch* linphone_ldap_contact_search_cast( void* obj ); +LINPHONE_PUBLIC unsigned int linphone_ldap_contact_search_result_count(LinphoneLDAPContactSearch *obj); + +LINPHONE_PUBLIC LinphoneLDAPContactSearch * linphone_ldap_contact_search_cast(void *obj); /* LinphoneLDAPContactProvider */ -LINPHONE_PUBLIC LinphoneLDAPContactProvider* linphone_ldap_contact_provider_create(LinphoneCore* lc, const LinphoneDictionary* config); -LINPHONE_PUBLIC unsigned int linphone_ldap_contact_provider_get_max_result(const LinphoneLDAPContactProvider* obj); -LINPHONE_PUBLIC LinphoneLDAPContactProvider* linphone_ldap_contact_provider_ref( void* obj ); -void linphone_ldap_contact_provider_unref( void* obj ); -LinphoneLDAPContactProvider* linphone_ldap_contact_provider_cast( void* obj ); -LINPHONE_PUBLIC int linphone_ldap_contact_provider_available(void); +LINPHONE_PUBLIC LinphoneLDAPContactProvider * linphone_ldap_contact_provider_create(LinphoneCore *lc, const LinphoneDictionary *config); + +LINPHONE_PUBLIC unsigned int linphone_ldap_contact_provider_get_max_result(const LinphoneLDAPContactProvider *obj); + +LINPHONE_PUBLIC LinphoneLDAPContactProvider * linphone_ldap_contact_provider_ref(void *obj); + +void linphone_ldap_contact_provider_unref(void *obj); + +LinphoneLDAPContactProvider * linphone_ldap_contact_provider_cast(void *obj); + +LINPHONE_PUBLIC int linphone_ldap_contact_provider_available(void); + +#ifdef __cplusplus +} +#endif + + +#endif /* LINPHONE_LDAPPROVIDER_H_ */ diff --git a/include/linphone/lpconfig.h b/include/linphone/lpconfig.h index c3c041c6e..330d7e8ff 100644 --- a/include/linphone/lpconfig.h +++ b/include/linphone/lpconfig.h @@ -25,39 +25,13 @@ #ifndef LPCONFIG_H #define LPCONFIG_H -#include -#include -#include "linphone/dictionary.h" +#include "linphone/types.h" /** * @addtogroup misc * @{ */ -/** - * The LinphoneConfig object is used to manipulate a configuration file. - * - * The format of the configuration file is a .ini like format: - * - sections are defined in [] - * - each section contains a sequence of key=value pairs. - * - * Example: - * @code - * [sound] - * echocanceler=1 - * playback_dev=ALSA: Default device - * - * [video] - * enabled=1 - * @endcode -**/ -typedef struct _LpConfig LinphoneConfig; - -/** - * Define old struct name for backward compatibility - */ -#define LpConfig LinphoneConfig - /** * Safely downcast a belle_sip_object into LinphoneConfig */ diff --git a/include/linphone/misc.h b/include/linphone/misc.h new file mode 100644 index 000000000..ce9d2e74a --- /dev/null +++ b/include/linphone/misc.h @@ -0,0 +1,174 @@ +/* +misc.h +Copyright (C) 2010-2017 Belledonne Communications SARL + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#ifndef LINPHONE_MISC_H_ +#define LINPHONE_MISC_H_ + + +#include "linphone/types.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * Lowest volume measurement that can be returned by linphone_call_get_play_volume() or linphone_call_get_record_volume(), corresponding to pure silence. + * @ingroup call_misc +**/ +#define LINPHONE_VOLUME_DB_LOWEST (-120) /* WARNING: keep this in sync with mediastreamer2/msvolume.h */ + + +/** + * Disable a sip transport + * Use with #LinphoneSipTransports + * @ingroup initializing + */ +#define LC_SIP_TRANSPORT_DISABLED 0 +/** + * Randomly chose a sip port for this transport + * Use with #LinphoneSipTransports + * @ingroup initializing + */ +#define LC_SIP_TRANSPORT_RANDOM (-1) + +/** + * Don't create any server socket for this transport, ie don't bind on any port. + * Use with #LinphoneSipTransports + * @ingroup initializing +**/ +#define LC_SIP_TRANSPORT_DONTBIND (-2) + + +/** + * Function returning a human readable value for LinphoneStreamType. + * @ingroup initializing + **/ +LINPHONE_PUBLIC const char *linphone_stream_type_to_string(const LinphoneStreamType); + +/** + * Human readable version of the #LinphoneRegistrationState + * @param cs sate + * @ingroup proxies + */ +LINPHONE_PUBLIC const char *linphone_registration_state_to_string(LinphoneRegistrationState cs); + +/** + * Convert enum member to string. + * @ingroup media_parameters +**/ +LINPHONE_PUBLIC const char *linphone_media_encryption_to_string(LinphoneMediaEncryption menc); + +LINPHONE_PUBLIC const char* linphone_privacy_to_string(LinphonePrivacy privacy); + +LINPHONE_PUBLIC const char *linphone_subscription_state_to_string(LinphoneSubscriptionState state); + +LINPHONE_PUBLIC const char *linphone_publish_state_to_string(LinphonePublishState state); + +LINPHONE_PUBLIC const char *linphone_ice_state_to_string(LinphoneIceState state); + +LINPHONE_PUBLIC const char *linphone_global_state_to_string(LinphoneGlobalState gs); + +LINPHONE_PUBLIC const char *linphone_core_log_collection_upload_state_to_string(const LinphoneCoreLogCollectionUploadState lcus); + +LINPHONE_PUBLIC const char *linphone_call_state_to_string(LinphoneCallState cs); + +/** + * Converts a _LinphoneConfiguringState enum to a string. + * @ingroup misc +**/ +LINPHONE_PUBLIC const char *linphone_configuring_state_to_string(LinphoneConfiguringState cs); + +/** + * Returns a #LinphoneChatMessageState as a string. + */ +LINPHONE_PUBLIC const char* linphone_chat_message_state_to_string(const LinphoneChatMessageState state); + +/** + * Converts a LinphoneReason enum to a string. + * @param[in] err A #LinphoneReason + * @return The string representation of the specified LinphoneReason + * @ingroup misc +**/ +LINPHONE_PUBLIC const char *linphone_reason_to_string(LinphoneReason err); + +/** + * Return humain readable presence status + * @param ss + * @deprecated Use #LinphonePresenceModel, #LinphonePresenceActivity and linphone_presence_activity_to_string() instead. + */ +LINPHONE_PUBLIC const char *linphone_online_status_to_string(LinphoneOnlineStatus ss); + +/** + * Convert a string into LinphoneTunnelMode enum + * @param string String to convert + * @return An LinphoneTunnelMode enum. If the passed string is NULL or + * does not match with any mode, the LinphoneTunnelModeDisable is returned. + */ +LINPHONE_PUBLIC LinphoneTunnelMode linphone_tunnel_mode_from_string(const char *string); + +/** + * Convert a tunnel mode enum into string + * @param mode Enum to convert + * @return "disable", "enable" or "auto" + */ +LINPHONE_PUBLIC const char *linphone_tunnel_mode_to_string(LinphoneTunnelMode mode); + +/** + * Check whether Matroksa format is supported by the player + * @return TRUE if it is supported + */ +LINPHONE_PUBLIC bool_t linphone_local_player_matroska_supported(void); + +/** + * Converts a LinphoneTransportType enum to a lowercase string. + * @ingroup misc +**/ +LINPHONE_PUBLIC const char* linphone_transport_to_string(LinphoneTransportType transport); + +/** + * Converts a lowercase string to a LinphoneTransportType enum. + * @ingroup misc + * @return Transport matching input, or LinphoneTransportUdp if nothing is found +**/ +LINPHONE_PUBLIC LinphoneTransportType linphone_transport_parse(const char* transport); + +/** + * Converts an error code to a LinphoneReason. + * @param[in] err An error code + * @return The LinphoneReason corresponding to the specified error code + * @ingroup misc +**/ +LINPHONE_PUBLIC LinphoneReason linphone_error_code_to_reason(int err); + +/** + * Converts a LinphoneReason to an error code. + * @param[in] reason A LinphoneReason + * @return The error code corresponding to the specified LinphoneReason + * @ingroup misc + */ +LINPHONE_PUBLIC int linphone_reason_to_error_code(LinphoneReason reason); + + +#ifdef __cplusplus +} +#endif + +#endif /* LINPHONE_MISC_H_ */ diff --git a/include/linphone/nat_policy.h b/include/linphone/nat_policy.h index 92f6067c1..b409a974f 100644 --- a/include/linphone/nat_policy.h +++ b/include/linphone/nat_policy.h @@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define LINPHONE_NAT_POLICY_H_ +#include "linphone/types.h" + + #ifdef __cplusplus extern "C" { #endif @@ -31,12 +34,6 @@ extern "C" { * @{ */ -/** - * Policy to use to pass through NATs/firewalls. - */ -typedef struct _LinphoneNatPolicy LinphoneNatPolicy; - - /** * Acquire a reference to the LinphoneNatPolicy object. * @param[in] policy LinphoneNatPolicy object. @@ -178,21 +175,6 @@ LINPHONE_PUBLIC void linphone_nat_policy_resolve_stun_server(LinphoneNatPolicy * */ LINPHONE_PUBLIC const struct addrinfo * linphone_nat_policy_get_stun_server_addrinfo(LinphoneNatPolicy *policy); -/** - * Create a new LinphoneNatPolicy object with every policies being disabled. - * @param[in] lc LinphoneCore object - * @return A new LinphoneNatPolicy object. - */ -LINPHONE_PUBLIC LinphoneNatPolicy * linphone_core_create_nat_policy(LinphoneCore *lc); - -/** - * Create a new LinphoneNatPolicy by reading the config of a LinphoneCore according to the passed ref. - * @param[in] lc LinphoneCore object - * @param[in] ref The reference of a NAT policy in the config of the LinphoneCore - * @return A new LinphoneNatPolicy object. - */ -LINPHONE_PUBLIC LinphoneNatPolicy * linphone_core_create_nat_policy_from_config(LinphoneCore *lc, const char *ref); - /** * @} */ diff --git a/include/linphone/payload_type.h b/include/linphone/payload_type.h new file mode 100644 index 000000000..746f61f90 --- /dev/null +++ b/include/linphone/payload_type.h @@ -0,0 +1,74 @@ +/* +payload_type.h +Copyright (C) 2010-2017 Belledonne Communications SARL + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#ifndef LINPHONE_PAYLOAD_TYPE_H_ +#define LINPHONE_PAYLOAD_TYPE_H_ + + +#include "linphone/types.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @addtogroup media_parameters + * @{ +**/ + +/** + * Get the type of payload. + * @param[in] pt LinphonePayloadType object + * @return The type of payload. + */ +LINPHONE_PUBLIC int linphone_payload_type_get_type(const LinphonePayloadType *pt); + +/** + * Get the normal bitrate in bits/s. + * @param[in] pt LinphonePayloadType object + * @return The normal bitrate in bits/s. + */ +LINPHONE_PUBLIC int linphone_payload_type_get_normal_bitrate(const LinphonePayloadType *pt); + +/** + * Get the mime type. + * @param[in] pt LinphonePayloadType object + * @return The mime type. + */ +LINPHONE_PUBLIC const char * linphone_payload_type_get_mime_type(const LinphonePayloadType *pt); + +/** + * Get the number of channels. + * @param[in] pt LinphonePayloadType object + * @return The number of channels. + */ +LINPHONE_PUBLIC int linphone_payload_type_get_channels(const LinphonePayloadType *pt); + +/** + * @} +**/ + + +#ifdef __cplusplus +} +#endif + +#endif /* LINPHONE_PAYLOAD_TYPE_H_ */ diff --git a/include/linphone/player.h b/include/linphone/player.h new file mode 100644 index 000000000..4cac075cf --- /dev/null +++ b/include/linphone/player.h @@ -0,0 +1,64 @@ +/* +player.h +Copyright (C) 2010-2017 Belledonne Communications SARL + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +*/ + +#ifndef LINPHONE_PLAYER_H_ +#define LINPHONE_PLAYER_H_ + + +#include "linphone/types.h" +#include "mediastreamer2/msinterfaces.h" + + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * Callback for notifying end of play (file). + * @param obj the LinphonePlayer + * @param user_data the user_data provided when calling linphone_player_open(). + * @ingroup call_control +**/ +typedef void (*LinphonePlayerEofCallback)(LinphonePlayer *obj, void *user_data); + +LINPHONE_PUBLIC int linphone_player_open(LinphonePlayer *obj, const char *filename, LinphonePlayerEofCallback, void *user_data); + +LINPHONE_PUBLIC int linphone_player_start(LinphonePlayer *obj); + +LINPHONE_PUBLIC int linphone_player_pause(LinphonePlayer *obj); + +LINPHONE_PUBLIC int linphone_player_seek(LinphonePlayer *obj, int time_ms); + +LINPHONE_PUBLIC MSPlayerState linphone_player_get_state(LinphonePlayer *obj); + +LINPHONE_PUBLIC int linphone_player_get_duration(LinphonePlayer *obj); + +LINPHONE_PUBLIC int linphone_player_get_current_position(LinphonePlayer *obj); + +LINPHONE_PUBLIC void linphone_player_close(LinphonePlayer *obj); + +LINPHONE_PUBLIC void linphone_player_destroy(LinphonePlayer *obj); + + +#ifdef __cplusplus +} +#endif + +#endif /* LINPHONE_PLAYER_H_ */ diff --git a/include/linphone/presence.h b/include/linphone/presence.h index a5350fa69..a0340ecf4 100644 --- a/include/linphone/presence.h +++ b/include/linphone/presence.h @@ -1,5 +1,5 @@ /* -linphonepresence.h +presence.h Copyright (C) 2010-2013 Belledonne Communications SARL This program is free software; you can redistribute it and/or @@ -17,8 +17,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef LINPHONEPRESENCE_H_ -#define LINPHONEPRESENCE_H_ +#ifndef LINPHONE_PRESENCE_H_ +#define LINPHONE_PRESENCE_H_ + + +#include "linphone/types.h" #ifdef __cplusplus @@ -31,167 +34,6 @@ extern "C" { * @{ */ - -/** Basic status as defined in section 4.1.4 of RFC 3863 */ -typedef enum LinphonePresenceBasicStatus { - /** This value means that the associated contact element, if any, is ready to accept communication. */ - LinphonePresenceBasicStatusOpen, - - /** This value means that the associated contact element, if any, is unable to accept communication. */ - LinphonePresenceBasicStatusClosed -} LinphonePresenceBasicStatus; - -/** Activities as defined in section 3.2 of RFC 4480 */ -typedef enum LinphonePresenceActivityType { - /** This value is not defined in the RFC, it corresponds to no activity with a basic status of "closed". */ - LinphonePresenceActivityOffline, - - /** This value is not defined in the RFC, it corresponds to no activity with a basic status of "open". */ - LinphonePresenceActivityOnline, - - /** The person has a calendar appointment, without specifying exactly of what type. This activity is - * indicated if more detailed information is not available or the person chooses not to reveal more - * information. */ - LinphonePresenceActivityAppointment, - - /** The person is physically away from all interactive communication devices. */ - LinphonePresenceActivityAway, - - /** The person is eating the first meal of the day, usually eaten in the morning. */ - LinphonePresenceActivityBreakfast, - - /** The person is busy, without further details. */ - LinphonePresenceActivityBusy, - - /** The person is having his or her main meal of the day, eaten in the evening or at midday. */ - LinphonePresenceActivityDinner, - - /** This is a scheduled national or local holiday. */ - LinphonePresenceActivityHoliday, - - /** The person is riding in a vehicle, such as a car, but not steering. */ - LinphonePresenceActivityInTransit, - - /** The person is looking for (paid) work. */ - LinphonePresenceActivityLookingForWork, - - /** The person is eating his or her midday meal. */ - LinphonePresenceActivityLunch, - - /** The person is scheduled for a meal, without specifying whether it is breakfast, lunch, or dinner, - * or some other meal. */ - LinphonePresenceActivityMeal, - - /** The person is in an assembly or gathering of people, as for a business, social, or religious purpose. - * A meeting is a sub-class of an appointment. */ - LinphonePresenceActivityMeeting, - - /** The person is talking on the telephone. */ - LinphonePresenceActivityOnThePhone, - - /** The person is engaged in an activity with no defined representation. A string describing the activity - * in plain text SHOULD be provided. */ - LinphonePresenceActivityOther, - - /** A performance is a sub-class of an appointment and includes musical, theatrical, and cinematic - * performances as well as lectures. It is distinguished from a meeting by the fact that the person - * may either be lecturing or be in the audience, with a potentially large number of other people, - * making interruptions particularly noticeable. */ - LinphonePresenceActivityPerformance, - - /** The person will not return for the foreseeable future, e.g., because it is no longer working for - * the company. */ - LinphonePresenceActivityPermanentAbsence, - - /** The person is occupying himself or herself in amusement, sport, or other recreation. */ - LinphonePresenceActivityPlaying, - - /** The person is giving a presentation, lecture, or participating in a formal round-table discussion. */ - LinphonePresenceActivityPresentation, - - /** The person is visiting stores in search of goods or services. */ - LinphonePresenceActivityShopping, - - /** The person is sleeping.*/ - LinphonePresenceActivitySleeping, - - /** The person is observing an event, such as a sports event. */ - LinphonePresenceActivitySpectator, - - /** The person is controlling a vehicle, watercraft, or plane. */ - LinphonePresenceActivitySteering, - - /** The person is on a business or personal trip, but not necessarily in-transit. */ - LinphonePresenceActivityTravel, - - /** The person is watching television. */ - LinphonePresenceActivityTV, - - /** The activity of the person is unknown. */ - LinphonePresenceActivityUnknown, - - /** A period of time devoted to pleasure, rest, or relaxation. */ - LinphonePresenceActivityVacation, - - /** The person is engaged in, typically paid, labor, as part of a profession or job. */ - LinphonePresenceActivityWorking, - - /** The person is participating in religious rites. */ - LinphonePresenceActivityWorship -} LinphonePresenceActivityType; - -/** - * Structure holding the information about the presence of a person. - */ -struct _LinphonePresenceModel; - -/** - * Presence model type holding information about the presence of a person. - */ -typedef struct _LinphonePresenceModel LinphonePresenceModel; - -/** - * Structure holding the information about a presence service. - */ -struct _LinphonePresenceService; - -/** - * Structure holding the information about a presence person. - */ -struct _LinphonePresencePerson; - -/** - * Presence person holding information about a presence person. - */ -typedef struct _LinphonePresencePerson LinphonePresencePerson; - -/** - * Presence service type holding information about a presence service. - */ -typedef struct _LinphonePresenceService LinphonePresenceService; - -/** - * Structure holding the information about a presence activity. - */ -struct _LinphonePresenceActivity; - -/** - * Presence activity type holding information about a presence activity. - */ -typedef struct _LinphonePresenceActivity LinphonePresenceActivity; - -/** - * Structure holding the information about a presence note. - */ -struct _LinphonePresenceNote; - -/** - * Presence note type holding information about a presence note. - */ -typedef struct _LinphonePresenceNote LinphonePresenceNote; - - - /***************************************************************************** * HELPER FUNCTIONS TO EASE ACCESS IN MOST SIMPLER CASES * ****************************************************************************/ @@ -268,6 +110,7 @@ LINPHONE_PUBLIC int linphone_presence_model_set_contact(LinphonePresenceModel *m * @return 0 if successful, a value < 0 in case of error. */ LINPHONE_PUBLIC int linphone_presence_model_set_presentity(LinphonePresenceModel *model, const LinphoneAddress *presentity); + /** * Gets the presentity of a presence model. * @param[in] model The #LinphonePresenceModel object to get the contact from. @@ -882,73 +725,6 @@ LINPHONE_PUBLIC void linphone_presence_note_set_user_data(LinphonePresenceNote * LINPHONE_PUBLIC void * linphone_presence_note_get_user_data(const LinphonePresenceNote *note); -/***************************************************************************** - * LINPHONE CORE FUNCTIONS RELATED TO PRESENCE * - ****************************************************************************/ - -/** - * Create a LinphonePresenceActivity with the given type and description. - * @param[in] lc #LinphoneCore object. - * @param[in] acttype The #LinphonePresenceActivityType to set for the activity. - * @param[in] description An additional description of the activity to set for the activity. Can be NULL if no additional description is to be added. - * @return The created #LinphonePresenceActivity object. - */ -LINPHONE_PUBLIC LinphonePresenceActivity * linphone_core_create_presence_activity(LinphoneCore *lc, LinphonePresenceActivityType acttype, const char *description); - -/** - * Create a default LinphonePresenceModel. - * @param[in] lc #LinphoneCore object. - * @return The created #LinphonePresenceModel object. - */ -LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_create_presence_model(LinphoneCore *lc); - -/** - * Create a LinphonePresenceModel with the given activity type and activity description. - * @param[in] lc #LinphoneCore object. - * @param[in] acttype The #LinphonePresenceActivityType to set for the activity of the created model. - * @param[in] description An additional description of the activity to set for the activity. Can be NULL if no additional description is to be added. - * @return The created #LinphonePresenceModel object. - */ -LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_create_presence_model_with_activity(LinphoneCore *lc, LinphonePresenceActivityType acttype, const char *description); - -/** - * Create a LinphonePresenceModel with the given activity type, activity description, note content and note language. - * @param[in] lc #LinphoneCore object. - * @param[in] acttype The #LinphonePresenceActivityType to set for the activity of the created model. - * @param[in] description An additional description of the activity to set for the activity. Can be NULL if no additional description is to be added. - * @param[in] note The content of the note to be added to the created model. - * @param[in] lang The language of the note to be added to the created model. - * @return The created #LinphonePresenceModel object. - */ -LINPHONE_PUBLIC LinphonePresenceModel * linphone_core_create_presence_model_with_activity_and_note(LinphoneCore *lc, LinphonePresenceActivityType acttype, const char *description, const char *note, const char *lang); - -/** - * Create a LinphonePresenceNote with the given content and language. - * @param[in] lc #LinphoneCore object. - * @param[in] content The content of the note to be created. - * @param[in] lang The language of the note to be created. - * @return The created #LinphonePresenceNote object. - */ -LINPHONE_PUBLIC LinphonePresenceNote * linphone_core_create_presence_note(LinphoneCore *lc, const char *content, const char *lang); - -/** - * Create a LinphonePresencePerson with the given id. - * @param[in] lc #LinphoneCore object - * @param[in] id The id of the person to be created. - * @return The created #LinphonePresencePerson object. - */ -LINPHONE_PUBLIC LinphonePresencePerson * linphone_core_create_presence_person(LinphoneCore *lc, const char *id); - -/** - * Create a LinphonePresenceService with the given id, basic status and contact. - * @param[in] lc #LinphoneCore object. - * @param[in] id The id of the service to be created. - * @param[in] basic_status The basic status of the service to be created. - * @param[in] contact A string containing a contact information corresponding to the service to be created. - * @return The created #LinphonePresenceService object. - */ -LINPHONE_PUBLIC LinphonePresenceService * linphone_core_create_presence_service(LinphoneCore *lc, const char *id, LinphonePresenceBasicStatus basic_status, const char *contact); - /** * @} */ diff --git a/include/linphone/proxy_config.h b/include/linphone/proxy_config.h index d0b94adb9..eb6a30d02 100644 --- a/include/linphone/proxy_config.h +++ b/include/linphone/proxy_config.h @@ -19,6 +19,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef LINPHONE_PROXY_CONFIG_H #define LINPHONE_PROXY_CONFIG_H +#include "linphone/types.h" + +#ifdef __cplusplus +extern "C" { +#endif + /** * @addtogroup proxies * @{ @@ -382,7 +388,9 @@ LINPHONE_PUBLIC const char* linphone_proxy_config_get_transport(const LinphonePr LINPHONE_PUBLIC void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg); LINPHONE_PUBLIC void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const char *type); + LINPHONE_PUBLIC SipSetupContext *linphone_proxy_config_get_sip_setup_context(LinphoneProxyConfig *cfg); + LINPHONE_PUBLIC SipSetup *linphone_proxy_config_get_sip_setup(LinphoneProxyConfig *cfg); /** @@ -526,7 +534,6 @@ LINPHONE_PUBLIC void linphone_proxy_config_set_custom_header(LinphoneProxyConfig **/ LINPHONE_PUBLIC const LinphoneAuthInfo* linphone_proxy_config_find_auth_info(const LinphoneProxyConfig *cfg); - /** * Get the persistent reference key associated to the proxy config. * @@ -571,4 +578,8 @@ LINPHONE_PUBLIC void linphone_proxy_config_set_nat_policy(LinphoneProxyConfig *c * @} */ +#ifdef __cplusplus +} +#endif + #endif diff --git a/include/linphone/ringtoneplayer.h b/include/linphone/ringtoneplayer.h index 984a86427..7f20f199b 100644 --- a/include/linphone/ringtoneplayer.h +++ b/include/linphone/ringtoneplayer.h @@ -16,8 +16,15 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef RINGPLAYER_H -#define RINGPLAYER_H + +#ifndef LINPHONE_RINGTONEPLAYER_H +#define LINPHONE_RINGTONEPLAYER_H + +#include "linphone/types.h" + +#ifdef __cplusplus +extern "C" { +#endif typedef void (*LinphoneRingtonePlayerFunc)(LinphoneRingtonePlayer* rp, void* user_data, int status); @@ -41,4 +48,8 @@ LINPHONE_PUBLIC int linphone_ringtoneplayer_start_with_cb(MSFactory *factory, Li LINPHONE_PUBLIC bool_t linphone_ringtoneplayer_is_started(LinphoneRingtonePlayer* rp); LINPHONE_PUBLIC int linphone_ringtoneplayer_stop(LinphoneRingtonePlayer* rp); +#ifdef __cplusplus +} #endif + +#endif /* LINPHONE_RINGTONEPLAYER_H */ diff --git a/include/linphone/tunnel.h b/include/linphone/tunnel.h index 3d8430b2f..1847031a3 100644 --- a/include/linphone/tunnel.h +++ b/include/linphone/tunnel.h @@ -23,10 +23,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#ifndef LINPHONETUNNEL_H -#define LINPHONETUNNEL_H +#ifndef LINPHONE_TUNNEL_H_ +#define LINPHONE_TUNNEL_H_ -#include "linphone/core.h" +#include "linphone/types.h" /** @@ -34,25 +34,25 @@ * @{ **/ - /** - * Linphone tunnel aims is to bypass IP traffic blocking due to aggressive firewalls which typically only authorize TCP traffic with destination port 443. - *
Its principle is tunneling all SIP and/or RTP traffic through a single secure https connection up to a detunnelizer server. - *
This set of methods enhance LinphoneCore functionalities in order to provide an easy to use API to - * \li provision tunnel servers IP addresses and ports. This functionality is an option not implemented under GPL. Availability can be check at runtime using function #linphone_core_tunnel_available - * \li start/stop the tunneling service - * \li perform auto-detection whether tunneling is required, based on a test of sending/receiving a flow of UDP packets. - * - * It takes in charge automatically the SIP registration procedure when connecting or disconnecting to a tunnel server. - * No other action on LinphoneCore is required to enable full operation in tunnel mode. - * - *
Provision is done using object #LinphoneTunnelConfig created by function #linphone_tunnel_config_new(). Functions #linphone_tunnel_config_set_host - * and #linphone_tunnel_config_set_port allow to point to tunnel server IP/port. Once set, use function #linphone_tunnel_add_server to provision a tunnel server. - *
Finally tunnel mode configuration is achieved by function #linphone_tunnel_set_mode. - *
Tunnel connection status can be checked using function #linphone_tunnel_connected. - * - * Bellow pseudo code that can be use to configure, enable, check state and disable tunnel functionality: - * - * \code +/** + * Linphone tunnel aims is to bypass IP traffic blocking due to aggressive firewalls which typically only authorize TCP traffic with destination port 443. + *
Its principle is tunneling all SIP and/or RTP traffic through a single secure https connection up to a detunnelizer server. + *
This set of methods enhance LinphoneCore functionalities in order to provide an easy to use API to + * \li provision tunnel servers IP addresses and ports. This functionality is an option not implemented under GPL. Availability can be check at runtime using function #linphone_core_tunnel_available + * \li start/stop the tunneling service + * \li perform auto-detection whether tunneling is required, based on a test of sending/receiving a flow of UDP packets. + * + * It takes in charge automatically the SIP registration procedure when connecting or disconnecting to a tunnel server. + * No other action on LinphoneCore is required to enable full operation in tunnel mode. + * + *
Provision is done using object #LinphoneTunnelConfig created by function #linphone_tunnel_config_new(). Functions #linphone_tunnel_config_set_host + * and #linphone_tunnel_config_set_port allow to point to tunnel server IP/port. Once set, use function #linphone_tunnel_add_server to provision a tunnel server. + *
Finally tunnel mode configuration is achieved by function #linphone_tunnel_set_mode. + *
Tunnel connection status can be checked using function #linphone_tunnel_connected. + * + * Bellow pseudo code that can be use to configure, enable, check state and disable tunnel functionality: + * + * \code LinphoneTunnel *tunnel = linphone_core_get_tunnel(linphone_core); LinphoneTunnelConfig *config=linphone_tunnel_config_new(); //instantiate tunnel configuration linphone_tunnel_config_set_host(config, "tunnel.linphone.org"); //set tunnel server host address @@ -79,40 +79,13 @@ linphone_call_unref(call); //release reference on the call \endcode -* -* **/ +**/ #ifdef __cplusplus extern "C" { #endif -typedef struct _LinphoneTunnelConfig LinphoneTunnelConfig; - -/** - * Enum describing the tunnel modes. -**/ -typedef enum _LinphoneTunnelMode { - LinphoneTunnelModeDisable, /**< The tunnel is disabled. */ - LinphoneTunnelModeEnable, /**< The tunnel is enabled. */ - LinphoneTunnelModeAuto /**< The tunnel is enabled automatically if it is required. */ -} LinphoneTunnelMode; - -/** - * Convert a string into LinphoneTunnelMode enum - * @param string String to convert - * @return An LinphoneTunnelMode enum. If the passed string is NULL or - * does not match with any mode, the LinphoneTunnelModeDisable is returned. - */ -LINPHONE_PUBLIC LinphoneTunnelMode linphone_tunnel_mode_from_string(const char *string); - -/** - * Convert a tunnel mode enum into string - * @param mode Enum to convert - * @return "disable", "enable" or "auto" - */ -LINPHONE_PUBLIC const char *linphone_tunnel_mode_to_string(LinphoneTunnelMode mode); - /** * Create a new tunnel configuration */ @@ -211,7 +184,6 @@ LINPHONE_PUBLIC int linphone_tunnel_config_get_delay(const LinphoneTunnelConfig **/ LINPHONE_PUBLIC LinphoneTunnelConfig * linphone_tunnel_config_ref(LinphoneTunnelConfig *cfg); - /** * Decrement the refcount of LinphoneTunnelConfig object. * @param cfg the LinphoneTunnelConfig object. @@ -366,7 +338,6 @@ LINPHONE_PUBLIC void linphone_tunnel_get_http_proxy(LinphoneTunnel*tunnel,const */ LINPHONE_PUBLIC void linphone_tunnel_set_http_proxy_auth_info(LinphoneTunnel*tunnel, const char* username,const char* passwd); - /** * Sets whether tunneling of SIP and RTP is required. * @param tunnel object @@ -413,5 +384,5 @@ LINPHONE_PUBLIC void linphone_tunnel_simulate_udp_loss(LinphoneTunnel *tunnel, b #endif -#endif //LINPHONETUNNEL_H +#endif /* LINPHONE_TUNNEL_H_ */ diff --git a/include/linphone/types.h b/include/linphone/types.h index 7da78b41f..a9c901de3 100644 --- a/include/linphone/types.h +++ b/include/linphone/types.h @@ -21,11 +21,156 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define LINPHONE_TYPES_H_ +#include "ortp/payloadtype.h" +#include "mediastreamer2/msinterfaces.h" +#include "mediastreamer2/msvideo.h" +#include "sal/sal.h" +#include "linphone/defs.h" + + /** - * The LinphoneCall object represents a call issued or received by the LinphoneCore + * The LinphoneAccountCreator object used to create an account on a server via XML-RPC. + * @ingroup misc +**/ +typedef struct _LinphoneAccountCreator LinphoneAccountCreator; + +/** + * An object to handle the callbacks for handling the LinphoneAccountCreator operations. + * @ingroup misc +**/ +typedef struct _LinphoneAccountCreatorCbs LinphoneAccountCreatorCbs; + +/** +* Enum describing the status of a LinphoneAccountCreator operation. +* @ingroup misc +**/ +typedef enum _LinphoneAccountCreatorStatus { + LinphoneAccountCreatorOK, + LinphoneAccountCreatorReqFailed, + + LinphoneAccountCreatorAccountCreated, + LinphoneAccountCreatorAccountNotCreated, + + LinphoneAccountCreatorAccountExist, + LinphoneAccountCreatorAccountExistWithAlias, + LinphoneAccountCreatorAccountNotExist, + + LinphoneAccountCreatorAccountActivated, + LinphoneAccountCreatorAccountAlreadyActivated, + LinphoneAccountCreatorAccountNotActivated, + + LinphoneAccountCreatorAccountLinked, + LinphoneAccountCreatorAccountNotLinked, + + LinphoneAccountCreatorEmailInvalid, + + LinphoneAccountCreatorUsernameInvalid, + LinphoneAccountCreatorUsernameTooShort, + LinphoneAccountCreatorUsernameTooLong, + LinphoneAccountCreatorUsernameInvalidSize, + + LinphoneAccountCreatorPhoneNumberInvalid, + LinphoneAccountCreatorPhoneNumberTooShort, + LinphoneAccountCreatorPhoneNumberTooLong, + LinphoneAccountCreatorPhoneNumberUsedAccount, + LinphoneAccountCreatorPhoneNumberUsedAlias, + LinphoneAccountCreatorPhoneNumberNotUsed, + + LinphoneAccountCreatorPasswordTooShort, + LinphoneAccountCreatorPasswordTooLong, + + LinphoneAccountCreatorDomainInvalid, + LinphoneAccountCreatorRouteInvalid, + LinphoneAccountCreatorDisplayNameInvalid, + LinphoneAccountCreatorTransportNotSupported, + LinphoneAccountCreatorCountryCodeInvalid, + + LinphoneAccountCreatorErrorServer, +} LinphoneAccountCreatorStatus; + +/** + * Object that represents a SIP address. + * + * The LinphoneAddress is an opaque object to represents SIP addresses, ie + * the content of SIP's 'from' and 'to' headers. + * A SIP address is made of display name, username, domain name, port, and various + * uri headers (such as tags). It looks like 'Alice '. + * The LinphoneAddress has methods to extract and manipulate all parts of the address. + * When some part of the address (for example the username) is empty, the accessor methods + * return NULL. + * @ingroup linphone_address + */ +typedef struct SalAddress LinphoneAddress; + +/** + * Enum describing Ip family. + * @ingroup initializing +**/ +typedef enum _LinphoneAddressFamily { + LinphoneAddressFamilyInet, /**< IpV4 */ + LinphoneAddressFamilyInet6, /**< IpV6 */ + LinphoneAddressFamilyUnspec, /**< Unknown */ +} LinphoneAddressFamily; + +/** + * Enum describing type of audio route. * @ingroup call_control **/ -struct _LinphoneCall; +typedef enum _LinphoneAudioRoute { + LinphoneAudioRouteEarpiece = MSAudioRouteEarpiece, + LinphoneAudioRouteSpeaker = MSAudioRouteSpeaker +} LinphoneAudioRoute; + +/** + * Object holding authentication information. + * + * @note The object's fields should not be accessed directly. Prefer using + * the accessor methods. + * + * In most case, authentication information consists of a username and password. + * Sometimes, a userid is required by proxy, and realm can be useful to discriminate + * different SIP domains. + * + * Once created and filled, a LinphoneAuthInfo must be added to the LinphoneCore in + * order to become known and used automatically when needed. + * Use linphone_core_add_auth_info() for that purpose. + * + * The LinphoneCore object can take the initiative to request authentication information + * when needed to the application through the auth_info_requested callback of the + * LinphoneCoreVTable structure. + * + * The application can respond to this information request later using + * linphone_core_add_auth_info(). This will unblock all pending authentication + * transactions and retry them with authentication headers. + * + * @ingroup authentication +**/ +typedef struct _LinphoneAuthInfo LinphoneAuthInfo; + +/** + * Enum describing the authentication methods + * @ingroup network_parameters +**/ +typedef enum _LinphoneAuthMethod { + LinphoneAuthHttpDigest, /**< Digest authentication requested */ + LinphoneAuthTls, /**< Client certificate requested */ +} LinphoneAuthMethod; + +/** + * Enum describing RTP AVPF activation modes. + * @ingroup media_parameters +**/ +typedef enum _LinphoneAVPFMode { + LinphoneAVPFDefault = -1, /**< Use default value defined at upper level */ + LinphoneAVPFDisabled, /**< AVPF is disabled */ + LinphoneAVPFEnabled /**< AVPF is enabled */ +} LinphoneAVPFMode; + +/** + * The LinphoneContent object representing a data buffer. + * @ingroup misc +**/ +typedef struct _LinphoneBuffer LinphoneBuffer; /** * The LinphoneCall object represents a call issued or received by the LinphoneCore @@ -34,10 +179,78 @@ struct _LinphoneCall; typedef struct _LinphoneCall LinphoneCall; /** - * An object to handle the callbacks for the handling a LinphoneChatMessage objects. - * @ingroup chatroom - */ -typedef struct _LinphoneChatMessageCbs LinphoneChatMessageCbs; + * Enum representing the direction of a call. + * @ingroup call_logs +**/ +typedef enum _LinphoneCallDir { + LinphoneCallOutgoing, /**< outgoing calls*/ + LinphoneCallIncoming /**< incoming calls*/ +} LinphoneCallDir; + +/** + * Structure representing a call log. + * @ingroup call_logs +**/ +typedef struct _LinphoneCallLog LinphoneCallLog; + +/** + * The LinphoneCallParams is an object containing various call related parameters. + * It can be used to retrieve parameters from a currently running call or modify + * the call's characteristics dynamically. + * @ingroup call_control +**/ +typedef struct _LinphoneCallParams LinphoneCallParams; + +/** + * LinphoneCallState enum represents the different state a call can reach into. + * The application is notified of state changes through the LinphoneCoreVTable::call_state_changed callback. + * @ingroup call_control +**/ +typedef enum _LinphoneCallState{ + LinphoneCallIdle, /**< Initial call state */ + LinphoneCallIncomingReceived, /**< This is a new incoming call */ + LinphoneCallOutgoingInit, /**< An outgoing call is started */ + LinphoneCallOutgoingProgress, /**< An outgoing call is in progress */ + LinphoneCallOutgoingRinging, /**< An outgoing call is ringing at remote end */ + LinphoneCallOutgoingEarlyMedia, /**< An outgoing call is proposed early media */ + LinphoneCallConnected, /**< Connected, the call is answered */ + LinphoneCallStreamsRunning, /**< The media streams are established and running */ + LinphoneCallPausing, /**< The call is pausing at the initiative of local end */ + LinphoneCallPaused, /**< The call is paused, remote end has accepted the pause */ + LinphoneCallResuming, /**< The call is being resumed by local end */ + LinphoneCallRefered, /**< The call is being transfered to another party, resulting in a new outgoing call to follow immediately */ + LinphoneCallError, /**< The call encountered an error */ + LinphoneCallEnd, /**< The call ended normally */ + LinphoneCallPausedByRemote, /**< The call is paused by remote end */ + LinphoneCallUpdatedByRemote, /**< The call's parameters change is requested by remote end, used for example when video is added by remote */ + LinphoneCallIncomingEarlyMedia, /**< We are proposing early media to an incoming call */ + LinphoneCallUpdating, /**< A call update has been initiated by us */ + LinphoneCallReleased, /**< The call object is no more retained by the core */ + LinphoneCallEarlyUpdatedByRemote, /*< The call is updated by remote while not yet answered (early dialog SIP UPDATE received) */ + LinphoneCallEarlyUpdating /*< We are updating the call while not yet answered (early dialog SIP UPDATE sent) */ +} LinphoneCallState; + +/** + * The LinphoneCallStats objects carries various statistic informations regarding quality of audio or video streams. + * + * To receive these informations periodically and as soon as they are computed, the application is invited to place a #LinphoneCoreCallStatsUpdatedCb callback in the LinphoneCoreVTable structure + * it passes for instanciating the LinphoneCore object (see linphone_core_new() ). + * + * At any time, the application can access last computed statistics using linphone_call_get_audio_stats() or linphone_call_get_video_stats(). + * @ingroup call_misc +**/ +typedef struct _LinphoneCallStats LinphoneCallStats; + +/** + * Enum representing the status of a call + * @ingroup call_logs +**/ +typedef enum _LinphoneCallStatus { + LinphoneCallSuccess, /**< The call was sucessful */ + LinphoneCallAborted, /**< The call was aborted */ + LinphoneCallMissed, /**< The call was missed (unanswered) */ + LinphoneCallDeclined /**< The call was declined, either locally or by remote end */ +} LinphoneCallStatus; /** * A chat room message to hold content to be sent. @@ -46,6 +259,27 @@ typedef struct _LinphoneChatMessageCbs LinphoneChatMessageCbs; */ typedef struct _LinphoneChatMessage LinphoneChatMessage; +/** + * An object to handle the callbacks for the handling a LinphoneChatMessage objects. + * @ingroup chatroom + */ +typedef struct _LinphoneChatMessageCbs LinphoneChatMessageCbs; + +/** + * LinphoneChatMessageState is used to notify if messages have been succesfully delivered or not. + * @ingroup chatroom + */ +typedef enum _LinphoneChatMessageState { + LinphoneChatMessageStateIdle, /**< Initial state */ + LinphoneChatMessageStateInProgress, /**< Delivery in progress */ + LinphoneChatMessageStateDelivered, /**< Message successfully delivered and acknowledged by server */ + LinphoneChatMessageStateNotDelivered, /**< Message was not delivered */ + LinphoneChatMessageStateFileTransferError, /**< Message was received(and acknowledged) but cannot get file from server */ + LinphoneChatMessageStateFileTransferDone, /**< File transfer has been completed successfully */ + LinphoneChatMessageStateDeliveredToUser, /**< Message successfully delivered and acknowledged to destination */ + LinphoneChatMessageStateDisplayed /**< Message displayed to the remote user */ +} LinphoneChatMessageState; + /** * A chat room is the place where text messages are exchanged. * Can be created by linphone_core_create_chat_room(). @@ -53,5 +287,803 @@ typedef struct _LinphoneChatMessage LinphoneChatMessage; */ typedef struct _LinphoneChatRoom LinphoneChatRoom; +/** + * LinphoneConference class + * The _LinphoneConference struct does not exists, it's the Conference C++ class that is used behind + * @ingroup call_control + */ +typedef struct _LinphoneConference LinphoneConference; + +/** + * Parameters for initialization of conferences + * The _LinphoneConferenceParams struct does not exists, it's the ConferenceParams C++ class that is used behind + * @ingroup call_control + */ +typedef struct _LinphoneConferenceParams LinphoneConferenceParams; + +/** + * The LinphoneConfig object is used to manipulate a configuration file. + * + * The format of the configuration file is a .ini like format: + * - sections are defined in [] + * - each section contains a sequence of key=value pairs. + * + * Example: + * @code + * [sound] + * echocanceler=1 + * playback_dev=ALSA: Default device + * + * [video] + * enabled=1 + * @endcode + * + * @ingroup misc +**/ +typedef struct _LpConfig LinphoneConfig; + +/** + * Define old struct name for backward compatibility + */ +#define LpConfig LinphoneConfig + +/** + * LinphoneGlobalState describes the global state of the LinphoneCore object. + * It is notified via the LinphoneCoreVTable::global_state_changed + * @ingroup initializing +**/ +typedef enum _LinphoneConfiguringState { + LinphoneConfiguringSuccessful, + LinphoneConfiguringFailed, + LinphoneConfiguringSkipped +} LinphoneConfiguringState; + +typedef struct _LinphoneContactProvider LinphoneContactProvider; + +typedef struct _LinphoneContactSearch LinphoneContactSearch; + +typedef unsigned int LinphoneContactSearchID; + +/** + * Old name of LinphoneContactSearchID + * @deprecated + */ +typedef LinphoneContactSearchID ContactSearchID; + +/** + * The LinphoneContent object holds data that can be embedded in a signaling message. + * @ingroup misc +**/ +typedef struct _LinphoneContent LinphoneContent; + +/** + * Linphone core main object created by function linphone_core_new() . + * @ingroup initializing + */ +typedef struct _LinphoneCore LinphoneCore; + +/** + * That class holds all the callbacks which are called by #LinphoneCore. + * + * Use linphone_factory_create_core_cbs() to create an instance. Then, call the + * callback setters on the events you need to monitor and pass the object to + * a #LinphoneCore instance through linphone_core_add_listener(). + * + * That class is inherited from belle_sip_object_t. + * @ingroup initializing + */ +typedef struct _LinphoneCoreCbs LinphoneCoreCbs; + +typedef struct belle_sip_dict LinphoneDictionary; + +/** + * Enum describing the result of the echo canceller calibration process. +**/ +typedef enum { + LinphoneEcCalibratorInProgress, /**< The echo canceller calibration process is on going */ + LinphoneEcCalibratorDone, /**< The echo canceller calibration has been performed and produced an echo delay measure */ + LinphoneEcCalibratorFailed, /**< The echo canceller calibration process has failed */ + LinphoneEcCalibratorDoneNoEcho /**< The echo canceller calibration has been performed and no echo has been detected */ +} LinphoneEcCalibratorStatus; + +/** + * Object representing full details about a signaling error or status. + * All LinphoneErrorInfo object returned by the liblinphone API are readonly and transcients. For safety they must be used immediately + * after obtaining them. Any other function call to the liblinphone may change their content or invalidate the pointer. + * @ingroup misc +**/ +typedef struct _LinphoneErrorInfo LinphoneErrorInfo; + +/** + * Object representing an event state, which is subcribed or published. + * @see linphone_core_publish() + * @see linphone_core_subscribe() + * @ingroup event_api +**/ +typedef struct _LinphoneEvent LinphoneEvent; + +/** + * #LinphoneFactory is a singleton object devoted to the creation of all the object + * of Liblinphone that cannot created by #LinphoneCore or #LinphoneCore itself. + * @ingroup initializing + */ +typedef struct _LinphoneFactory LinphoneFactory; + +/** + * Policy to use to pass through firewalls. + * @ingroup network_parameters + * @deprecated Use #LinphoneNatPolicy instead. +**/ +typedef enum _LinphoneFirewallPolicy { + LinphonePolicyNoFirewall, /**< Do not use any mechanism to pass through firewalls */ + LinphonePolicyUseNatAddress, /**< Use the specified public adress */ + LinphonePolicyUseStun, /**< Use a STUN server to get the public address */ + LinphonePolicyUseIce, /**< Use the ICE protocol */ + LinphonePolicyUseUpnp, /**< Use the uPnP protocol */ +} LinphoneFirewallPolicy; + +/** + * Represents a buddy, all presence actions like subscription and status change notification are performed on this object + * @ingroup buddy_list + */ +typedef struct _LinphoneFriend LinphoneFriend; + +/** + * The LinphoneFriendList object representing a list of friends. + * @ingroup buddy_list +**/ +typedef struct _LinphoneFriendList LinphoneFriendList; + +/** + * An object to handle the callbacks for LinphoneFriend synchronization. +**/ +typedef struct _LinphoneFriendListCbs LinphoneFriendListCbs; + +/** +* Enum describing the status of a LinphoneFriendList operation. +* @ingroup buddy_list +**/ +typedef enum _LinphoneFriendListStatus { + LinphoneFriendListOK, + LinphoneFriendListNonExistentFriend, + LinphoneFriendListInvalidFriend +} LinphoneFriendListStatus; + +/** + * Enum describing the status of a CardDAV synchronization + * @ingroup buddy_list + */ +typedef enum _LinphoneFriendListSyncStatus { + LinphoneFriendListSyncStarted, + LinphoneFriendListSyncSuccessful, + LinphoneFriendListSyncFailure +} LinphoneFriendListSyncStatus; + +/** + * LinphoneGlobalState describes the global state of the LinphoneCore object. + * It is notified via the LinphoneCoreVTable::global_state_changed + * @ingroup initializing +**/ +typedef enum _LinphoneGlobalState { + LinphoneGlobalOff, + LinphoneGlobalStartup, + LinphoneGlobalOn, + LinphoneGlobalShutdown, + LinphoneGlobalConfiguring +} LinphoneGlobalState; + +/** + * Enum describing ICE states. + * @ingroup initializing +**/ +typedef enum _LinphoneIceState { + LinphoneIceStateNotActivated, /**< ICE has not been activated for this call or stream*/ + LinphoneIceStateFailed, /**< ICE processing has failed */ + LinphoneIceStateInProgress, /**< ICE process is in progress */ + LinphoneIceStateHostConnection, /**< ICE has established a direct connection to the remote host */ + LinphoneIceStateReflexiveConnection, /**< ICE has established a connection to the remote host through one or several NATs */ + LinphoneIceStateRelayConnection /**< ICE has established a connection through a relay */ +} LinphoneIceState; + +/** + * IM encryption engine. + * @ingroup misc + */ +typedef struct _LinphoneImEncryptionEngine LinphoneImEncryptionEngine; + +/** + * An object to handle the callbacks for the handling a LinphoneImEncryptionEngine object. + * @ingroup misc + */ +typedef struct _LinphoneImEncryptionEngineCbs LinphoneImEncryptionEngineCbs; + +/** + * Policy to use to send/receive instant messaging composing/delivery/display notifications. + * The sending of this information is done as in the RFCs 3994 (is_composing) and 5438 (imdn delivered/displayed). + * @ingroup chatroom + */ +typedef struct _LinphoneImNotifPolicy LinphoneImNotifPolicy; + +/** + * The LinphoneInfoMessage is an object representing an informational message sent or received by the core. + * @ingroup misc +**/ +typedef struct _LinphoneInfoMessage LinphoneInfoMessage; + +typedef struct _LinphoneLDAPContactProvider LinphoneLDAPContactProvider; + +typedef struct _LinphoneLDAPContactSearch LinphoneLDAPContactSearch; + +typedef enum _LinphoneLimeState { + LinphoneLimeDisabled, /**< Lime is not used at all */ + LinphoneLimeMandatory, /**< Lime is always used */ + LinphoneLimePreferred, /**< Lime is used only if we already shared a secret with remote */ +} LinphoneLimeState; + +/** + * @ingroup initializing + */ +typedef enum _LinphoneLogCollectionState { + LinphoneLogCollectionDisabled, + LinphoneLogCollectionEnabled, + LinphoneLogCollectionEnabledWithoutPreviousLogHandler +} LinphoneLogCollectionState; + +/** + * LinphoneCoreLogCollectionUploadState is used to notify if log collection upload have been succesfully delivered or not. + * @ingroup initializing + */ +typedef enum _LinphoneCoreLogCollectionUploadState { + LinphoneCoreLogCollectionUploadStateInProgress, /**< Delivery in progress */ + LinphoneCoreLogCollectionUploadStateDelivered, /**< Log collection upload successfully delivered and acknowledged by remote end point */ + LinphoneCoreLogCollectionUploadStateNotDelivered, /**< Log collection upload was not delivered */ +} LinphoneCoreLogCollectionUploadState; + +/** + * Indicates for a given media the stream direction + * @ingroup call_control + */ +typedef enum _LinphoneMediaDirection { + LinphoneMediaDirectionInvalid = -1, + LinphoneMediaDirectionInactive, /** No active media not supported yet*/ + LinphoneMediaDirectionSendOnly, /** Send only mode*/ + LinphoneMediaDirectionRecvOnly, /** recv only mode*/ + LinphoneMediaDirectionSendRecv, /** send receive*/ +} LinphoneMediaDirection; + +/** + * Enum describing type of media encryption types. + * @ingroup media_parameters +**/ +typedef enum _LinphoneMediaEncryption { + LinphoneMediaEncryptionNone, /**< No media encryption is used */ + LinphoneMediaEncryptionSRTP, /**< Use SRTP media encryption */ + LinphoneMediaEncryptionZRTP, /**< Use ZRTP media encryption */ + LinphoneMediaEncryptionDTLS /**< Use DTLS media encryption */ +} LinphoneMediaEncryption; + +/** + * Policy to use to pass through NATs/firewalls. + * @ingroup network_parameters + */ +typedef struct _LinphoneNatPolicy LinphoneNatPolicy; + +/** + * Enum describing remote friend status + * @deprecated Use #LinphonePresenceModel and #LinphonePresenceActivity instead + */ +typedef enum _LinphoneOnlineStatus{ + LinphoneStatusOffline, /**< Offline */ + LinphoneStatusOnline, /**< Online */ + LinphoneStatusBusy, /**< Busy */ + LinphoneStatusBeRightBack, /**< Be right back */ + LinphoneStatusAway, /**< Away */ + LinphoneStatusOnThePhone, /** On the phone */ + LinphoneStatusOutToLunch, /**< Out to lunch */ + LinphoneStatusDoNotDisturb, /**< Do not disturb */ + LinphoneStatusMoved, /**< Moved in this sate, call can be redirected if an alternate contact address has been set using function linphone_core_set_presence_info() */ + LinphoneStatusAltService, /**< Using another messaging service */ + LinphoneStatusPending, /**< Pending */ + LinphoneStatusVacation, /**< Vacation */ + + LinphoneStatusEnd +} LinphoneOnlineStatus; + +/** + * Object representing an RTP payload type. + * @ingroup media_parameters + */ +typedef PayloadType LinphonePayloadType; + +/** + * Player interface. + * @ingroup call_control +**/ +typedef struct _LinphonePlayer LinphonePlayer; + +/** + * Presence activity type holding information about a presence activity. + * @ingroup buddy_list + */ +typedef struct _LinphonePresenceActivity LinphonePresenceActivity; + +/** + * Activities as defined in section 3.2 of RFC 4480 + * @ingroup buddy_list + */ +typedef enum LinphonePresenceActivityType { + /** This value is not defined in the RFC, it corresponds to no activity with a basic status of "closed". */ + LinphonePresenceActivityOffline, + + /** This value is not defined in the RFC, it corresponds to no activity with a basic status of "open". */ + LinphonePresenceActivityOnline, + + /** The person has a calendar appointment, without specifying exactly of what type. This activity is + * indicated if more detailed information is not available or the person chooses not to reveal more + * information. */ + LinphonePresenceActivityAppointment, + + /** The person is physically away from all interactive communication devices. */ + LinphonePresenceActivityAway, + + /** The person is eating the first meal of the day, usually eaten in the morning. */ + LinphonePresenceActivityBreakfast, + + /** The person is busy, without further details. */ + LinphonePresenceActivityBusy, + + /** The person is having his or her main meal of the day, eaten in the evening or at midday. */ + LinphonePresenceActivityDinner, + + /** This is a scheduled national or local holiday. */ + LinphonePresenceActivityHoliday, + + /** The person is riding in a vehicle, such as a car, but not steering. */ + LinphonePresenceActivityInTransit, + + /** The person is looking for (paid) work. */ + LinphonePresenceActivityLookingForWork, + + /** The person is eating his or her midday meal. */ + LinphonePresenceActivityLunch, + + /** The person is scheduled for a meal, without specifying whether it is breakfast, lunch, or dinner, + * or some other meal. */ + LinphonePresenceActivityMeal, + + /** The person is in an assembly or gathering of people, as for a business, social, or religious purpose. + * A meeting is a sub-class of an appointment. */ + LinphonePresenceActivityMeeting, + + /** The person is talking on the telephone. */ + LinphonePresenceActivityOnThePhone, + + /** The person is engaged in an activity with no defined representation. A string describing the activity + * in plain text SHOULD be provided. */ + LinphonePresenceActivityOther, + + /** A performance is a sub-class of an appointment and includes musical, theatrical, and cinematic + * performances as well as lectures. It is distinguished from a meeting by the fact that the person + * may either be lecturing or be in the audience, with a potentially large number of other people, + * making interruptions particularly noticeable. */ + LinphonePresenceActivityPerformance, + + /** The person will not return for the foreseeable future, e.g., because it is no longer working for + * the company. */ + LinphonePresenceActivityPermanentAbsence, + + /** The person is occupying himself or herself in amusement, sport, or other recreation. */ + LinphonePresenceActivityPlaying, + + /** The person is giving a presentation, lecture, or participating in a formal round-table discussion. */ + LinphonePresenceActivityPresentation, + + /** The person is visiting stores in search of goods or services. */ + LinphonePresenceActivityShopping, + + /** The person is sleeping.*/ + LinphonePresenceActivitySleeping, + + /** The person is observing an event, such as a sports event. */ + LinphonePresenceActivitySpectator, + + /** The person is controlling a vehicle, watercraft, or plane. */ + LinphonePresenceActivitySteering, + + /** The person is on a business or personal trip, but not necessarily in-transit. */ + LinphonePresenceActivityTravel, + + /** The person is watching television. */ + LinphonePresenceActivityTV, + + /** The activity of the person is unknown. */ + LinphonePresenceActivityUnknown, + + /** A period of time devoted to pleasure, rest, or relaxation. */ + LinphonePresenceActivityVacation, + + /** The person is engaged in, typically paid, labor, as part of a profession or job. */ + LinphonePresenceActivityWorking, + + /** The person is participating in religious rites. */ + LinphonePresenceActivityWorship +} LinphonePresenceActivityType; + +/** + * Basic status as defined in section 4.1.4 of RFC 3863 + * @ingroup buddy_list + */ +typedef enum LinphonePresenceBasicStatus { + /** This value means that the associated contact element, if any, is ready to accept communication. */ + LinphonePresenceBasicStatusOpen, + + /** This value means that the associated contact element, if any, is unable to accept communication. */ + LinphonePresenceBasicStatusClosed +} LinphonePresenceBasicStatus; + +/** + * Presence model type holding information about the presence of a person. + * @ingroup buddy_list + */ +typedef struct _LinphonePresenceModel LinphonePresenceModel; + +/** + * Presence note type holding information about a presence note. + * @ingroup buddy_list + */ +typedef struct _LinphonePresenceNote LinphonePresenceNote; + +/** + * Presence person holding information about a presence person. + * @ingroup buddy_list + */ +typedef struct _LinphonePresencePerson LinphonePresencePerson; + +/** + * Presence service type holding information about a presence service. + * @ingroup buddy_list + */ +typedef struct _LinphonePresenceService LinphonePresenceService; + +/** + * @ingroup call_control + * Defines privacy policy to apply as described by rfc3323 +**/ +typedef enum _LinphonePrivacy { + /** + * Privacy services must not perform any privacy function + */ + LinphonePrivacyNone = 0x0, + /** + * Request that privacy services provide a user-level privacy + * function. + * With this mode, "from" header is hidden, usually replaced by From: "Anonymous" + */ + LinphonePrivacyUser = 0x1, + /** + * Request that privacy services modify headers that cannot + * be set arbitrarily by the user (Contact/Via). + */ + LinphonePrivacyHeader = 0x2, + /** + * Request that privacy services provide privacy for session + * media + */ + LinphonePrivacySession = 0x4, + /** + * rfc3325 + * The presence of this privacy type in + * a Privacy header field indicates that the user would like the Network + * Asserted Identity to be kept private with respect to SIP entities + * outside the Trust Domain with which the user authenticated. Note + * that a user requesting multiple types of privacy MUST include all of + * the requested privacy types in its Privacy header field value + * + */ + LinphonePrivacyId = 0x8, + /** + * Privacy service must perform the specified services or + * fail the request + * + **/ + LinphonePrivacyCritical = 0x10, + + /** + * Special keyword to use privacy as defined either globally or by proxy using linphone_proxy_config_set_privacy() + */ + LinphonePrivacyDefault = 0x8000, +} LinphonePrivacy; +/* WARNING This enum MUST be kept in sync with the SalPrivacy enum from sal.h */ + +/** + * A mask of #LinphonePrivacy values + * @ingroup call_control + */ +typedef unsigned int LinphonePrivacyMask; + +/** + * The LinphoneProxyConfig object represents a proxy configuration to be used + * by the LinphoneCore object. + * Its fields must not be used directly in favour of the accessors methods. + * Once created and filled properly the LinphoneProxyConfig can be given to + * LinphoneCore with linphone_core_add_proxy_config(). + * This will automatically triggers the registration, if enabled. + * + * The proxy configuration are persistent to restarts because they are saved + * in the configuration file. As a consequence, after linphone_core_new() there + * might already be a list of configured proxy that can be examined with + * linphone_core_get_proxy_config_list(). + * + * The default proxy (see linphone_core_set_default_proxy() ) is the one of the list + * that is used by default for calls. + * @ingroup proxies +**/ +typedef struct _LinphoneProxyConfig LinphoneProxyConfig; + +/** + * Enum for publish states. +**/ +typedef enum _LinphonePublishState{ + LinphonePublishNone, /**< Initial state, do not use */ + LinphonePublishProgress, /**< An outgoing publish was created and submitted */ + LinphonePublishOk, /**< Publish is accepted */ + LinphonePublishError, /**< Publish encoutered an error, linphone_event_get_reason() gives reason code */ + LinphonePublishExpiring, /**< Publish is about to expire, only sent if [sip]->refresh_generic_publish property is set to 0 */ + LinphonePublishCleared /**< Event has been un published */ +} LinphonePublishState; + +/** + * Enum describing various failure reasons or contextual information for some events. + * @see linphone_call_get_reason() + * @see linphone_proxy_config_get_error() + * @see linphone_error_info_get_reason() + * @ingroup misc +**/ +typedef enum _LinphoneReason{ + LinphoneReasonNone, /**< No reason has been set by the core */ + LinphoneReasonNoResponse, /**< No response received from remote */ + LinphoneReasonForbidden, /**< Authentication failed due to bad credentials or resource forbidden */ + LinphoneReasonDeclined, /**< The call has been declined */ + LinphoneReasonNotFound, /**< Destination of the call was not found */ + LinphoneReasonNotAnswered, /**< The call was not answered in time (request timeout) */ + LinphoneReasonBusy, /**< Phone line was busy */ + LinphoneReasonUnsupportedContent, /**< Unsupported content */ + LinphoneReasonIOError, /**< Transport error: connection failures, disconnections etc... */ + LinphoneReasonDoNotDisturb, /**< Do not disturb reason */ + LinphoneReasonUnauthorized, /**< Operation is unauthorized because missing credential */ + LinphoneReasonNotAcceptable, /**< Operation is rejected due to incompatible or unsupported media parameters */ + LinphoneReasonNoMatch, /**< Operation could not be executed by server or remote client because it didn't have any context for it */ + LinphoneReasonMovedPermanently, /**< Resource moved permanently */ + LinphoneReasonGone, /**< Resource no longer exists */ + LinphoneReasonTemporarilyUnavailable, /**< Temporarily unavailable */ + LinphoneReasonAddressIncomplete, /**< Address incomplete */ + LinphoneReasonNotImplemented, /**< Not implemented */ + LinphoneReasonBadGateway, /**< Bad gateway */ + LinphoneReasonServerTimeout, /**< Server timeout */ + LinphoneReasonUnknown /**< Unknown reason */ +} LinphoneReason; + +#define LinphoneReasonBadCredentials LinphoneReasonForbidden + +/*for compatibility*/ +#define LinphoneReasonMedia LinphoneReasonUnsupportedContent + +/** + * LinphoneRegistrationState describes proxy registration states. + * @ingroup proxies +**/ +typedef enum _LinphoneRegistrationState { + LinphoneRegistrationNone, /**< Initial state for registrations */ + LinphoneRegistrationProgress, /**< Registration is in progress */ + LinphoneRegistrationOk, /**< Registration is successful */ + LinphoneRegistrationCleared, /**< Unregistration succeeded */ + LinphoneRegistrationFailed /**< Registration failed */ +} LinphoneRegistrationState; + +typedef struct _LinphoneRingtonePlayer LinphoneRingtonePlayer; + +/** + * Linphone core SIP transport ports. + * Special values #LC_SIP_TRANSPORT_RANDOM, #LC_SIP_TRANSPORT_RANDOM, #LC_SIP_TRANSPORT_DONTBIND can be used. + * Use with #linphone_core_set_sip_transports + * @ingroup initializing + */ +typedef struct _LinphoneSipTransports { + int udp_port; /**< SIP/UDP port */ + int tcp_port; /**< SIP/TCP port */ + int dtls_port; /**< SIP/DTLS port */ + int tls_port; /**< SIP/TLS port */ +} LinphoneSipTransports; + +/** + * Old name of LinphoneSipTransports + * @deprecated + */ +typedef struct _LinphoneSipTransports LCSipTransports; + +typedef struct _LinphoneSoundDaemon LinphoneSoundDaemon; + +/** + * Enum describing the stream types. + * @ingroup initializing +**/ +typedef enum _LinphoneStreamType { + LinphoneStreamTypeAudio, + LinphoneStreamTypeVideo, + LinphoneStreamTypeText, + LinphoneStreamTypeUnknown /* WARNING: Make sure this value remains the last one in the list */ +} LinphoneStreamType; + +/** + * Enum controlling behavior for incoming subscription request. + * Use by linphone_friend_set_inc_subscribe_policy() + * @ingroup buddy_list + */ +typedef enum _LinphoneSubscribePolicy { + /** + * Does not automatically accept an incoming subscription request. + * This policy implies that a decision has to be taken for each incoming subscription request notified by callback LinphoneCoreVTable.new_subscription_requested + */ + LinphoneSPWait, + LinphoneSPDeny, /**< Rejects incoming subscription request */ + LinphoneSPAccept /**< Automatically accepts a subscription request */ +} LinphoneSubscribePolicy; + +/** + * Enum for subscription direction (incoming or outgoing). + * @ingroup event_api +**/ +typedef enum _LinphoneSubscriptionDir{ + LinphoneSubscriptionIncoming, /**< Incoming subscription. */ + LinphoneSubscriptionOutgoing, /**< Outgoing subscription. */ + LinphoneSubscriptionInvalidDir /**< Invalid subscription direction. */ +} LinphoneSubscriptionDir; + +/** + * Enum for subscription states. + * LinphoneSubscriptionTerminated and LinphoneSubscriptionError are final states. + * @ingroup event_api +**/ +typedef enum _LinphoneSubscriptionState{ + LinphoneSubscriptionNone, /**< Initial state, should not be used */ + LinphoneSubscriptionOutgoingProgress, /**< An outgoing subcription was sent */ + LinphoneSubscriptionIncomingReceived, /**< An incoming subcription is received */ + LinphoneSubscriptionPending, /**< Subscription is pending, waiting for user approval */ + LinphoneSubscriptionActive, /**< Subscription is accepted */ + LinphoneSubscriptionTerminated, /**< Subscription is terminated normally */ + LinphoneSubscriptionError, /**< Subscription was terminated by an error, indicated by linphone_event_get_reason() */ + LinphoneSubscriptionExpiring, /**< Subscription is about to expire, only sent if [sip]->refresh_generic_subscribe property is set to 0 */ +} LinphoneSubscriptionState; + +/** + * Enum listing frequent telephony tones. + * @ingroup misc +**/ +typedef enum _LinphoneToneID { + LinphoneToneUndefined, /**< Not a tone */ + LinphoneToneBusy, /**< Busy tone */ + LinphoneToneCallWaiting, /** Call waiting tone */ + LinphoneToneCallOnHold, /** Call on hold tone */ + LinphoneToneCallLost /** Tone played when call is abruptly disconnected (media lost)*/ +} LinphoneToneID; + +/** + * Enum describing transport type for LinphoneAddress. + * @ingroup linphone_address +**/ +typedef enum _LinphoneTransportType { + LinphoneTransportUdp, + LinphoneTransportTcp, + LinphoneTransportTls, + LinphoneTransportDtls +} LinphoneTransportType; +/* WARNING This enum MUST be kept in sync with the SalTransport enum from sal.h */ + +/** + * Linphone tunnel object. + * @ingroup tunnel + */ +typedef struct _LinphoneTunnel LinphoneTunnel; + +typedef struct _LinphoneTunnelConfig LinphoneTunnelConfig; + +/** + * Enum describing the tunnel modes. + * @ingroup tunnel +**/ +typedef enum _LinphoneTunnelMode { + LinphoneTunnelModeDisable, /**< The tunnel is disabled */ + LinphoneTunnelModeEnable, /**< The tunnel is enabled */ + LinphoneTunnelModeAuto /**< The tunnel is enabled automatically if it is required */ +} LinphoneTunnelMode; + +/** + * Enum describing uPnP states. + * @ingroup initializing +**/ +typedef enum _LinphoneUpnpState { + LinphoneUpnpStateIdle, /**< uPnP is not activate */ + LinphoneUpnpStatePending, /**< uPnP process is in progress */ + LinphoneUpnpStateAdding, /**< Internal use: Only used by port binding */ + LinphoneUpnpStateRemoving, /**< Internal use: Only used by port binding */ + LinphoneUpnpStateNotAvailable, /**< uPnP is not available */ + LinphoneUpnpStateOk, /**< uPnP is enabled */ + LinphoneUpnpStateKo, /**< uPnP processing has failed */ + LinphoneUpnpStateBlacklisted, /**< IGD router is blacklisted */ +} LinphoneUpnpState; + +/** + * The LinphoneVcard object. + * @ingroup carddav_vcard + */ +typedef struct _LinphoneVcard LinphoneVcard; + +/** + * Structure describing policy regarding video streams establishments. + * @ingroup media_parameters +**/ +typedef struct _LinphoneVideoPolicy { + bool_t automatically_initiate; /** +#include "linphone/types.h" #ifdef __cplusplus extern "C" @@ -32,11 +32,6 @@ extern "C" * @{ */ -/** - * The LinphoneVcard object. - */ -typedef struct _LinphoneVcard LinphoneVcard; - /** * Cast a belle_sip_object_t into LinphoneVcard. */ diff --git a/include/linphone/wrapper_utils.h b/include/linphone/wrapper_utils.h index fd76034b9..1201468f7 100644 --- a/include/linphone/wrapper_utils.h +++ b/include/linphone/wrapper_utils.h @@ -25,7 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef _WRAPPER_UTILS_H #define _WRAPPER_UTILS_H -#include "chat.h" +#include "linphone/types.h" #ifdef __cplusplus extern "C" { diff --git a/include/linphone/xmlrpc.h b/include/linphone/xmlrpc.h index c5e28e221..efcf50ed1 100644 --- a/include/linphone/xmlrpc.h +++ b/include/linphone/xmlrpc.h @@ -21,6 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define LINPHONE_XMLRPC_H_ +#include "linphone/types.h" + + #ifdef __cplusplus extern "C" { #endif @@ -31,39 +34,6 @@ extern "C" { * @{ */ -/** -* Enum describing the types of argument for LinphoneXmlRpcRequest. -**/ -typedef enum _LinphoneXmlRpcArgType { - LinphoneXmlRpcArgNone, - LinphoneXmlRpcArgInt, - LinphoneXmlRpcArgString -} LinphoneXmlRpcArgType; - -/** -* Enum describing the status of a LinphoneXmlRpcRequest. -**/ -typedef enum _LinphoneXmlRpcStatus { - LinphoneXmlRpcStatusPending, - LinphoneXmlRpcStatusOk, - LinphoneXmlRpcStatusFailed -} LinphoneXmlRpcStatus; - -/** - * The LinphoneXmlRpcRequest object representing a XML-RPC request to be sent. -**/ -typedef struct _LinphoneXmlRpcRequest LinphoneXmlRpcRequest; - -/** - * An object to handle the callbacks for handling the LinphoneXmlRpcRequest operations. -**/ -typedef struct _LinphoneXmlRpcRequestCbs LinphoneXmlRpcRequestCbs; - -/** - * The LinphoneXmlRpcSession object used to send XML-RPC requests and handle their responses. -**/ -typedef struct _LinphoneXmlRpcSession LinphoneXmlRpcSession; - /** * Callback used to notify the response to an XML-RPC request. * @param[in] request LinphoneXmlRpcRequest object @@ -163,7 +133,6 @@ LINPHONE_PUBLIC int linphone_xml_rpc_request_get_int_response(const LinphoneXmlR **/ LINPHONE_PUBLIC const char * linphone_xml_rpc_request_get_string_response(const LinphoneXmlRpcRequest *request); - /** * Create a new LinphoneXmlRpcSession object. * @param[in] core The LinphoneCore object used to send the XML-RPC requests. @@ -207,14 +176,12 @@ LINPHONE_PUBLIC void linphone_xml_rpc_session_set_user_data(LinphoneXmlRpcSessio **/ LINPHONE_PUBLIC void linphone_xml_rpc_session_send_request(LinphoneXmlRpcSession *session, LinphoneXmlRpcRequest *request); - /** * Stop and unref an XML rpc session. Pending requests will be aborted. * @param[in] session LinphoneXmlRpcSession object. **/ LINPHONE_PUBLIC void linphone_xml_rpc_session_release(LinphoneXmlRpcSession *session); - /** * Acquire a reference to a LinphoneXmlRpcRequestCbs object. * @param[in] cbs LinphoneXmlRpcRequestCbs object.