/* linphone Copyright (C) 2000 - 2010 Simon MORLAT (simon.morlat@linphone.org) 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef LINPHONECORE_H #define LINPHONECORE_H #include "ortp/ortp.h" #include "ortp/payloadtype.h" #include "mediastreamer2/mscommon.h" #include "mediastreamer2/msvideo.h" #include "mediastreamer2/mediastream.h" #include "mediastreamer2/bitratecontrol.h" #ifdef IN_LINPHONE #include "sipsetup.h" #else #include "linphone/sipsetup.h" #endif #include "lpconfig.h" #define LINPHONE_IPADDR_SIZE 64 #define LINPHONE_HOSTNAME_SIZE 128 #ifndef LINPHONE_PUBLIC #define LINPHONE_PUBLIC MS2_PUBLIC #endif #ifdef __cplusplus extern "C" { #endif struct _LinphoneCore; /** * Linphone core main object created by function linphone_core_new() . * @ingroup initializing */ typedef struct _LinphoneCore LinphoneCore; /** * Disable a sip transport * Use with #LCSipTransports * @ingroup initializing */ #define LC_SIP_TRANSPORT_DISABLED 0 /** * Randomly chose a sip port for this transport * Use with #LCSipTransports * @ingroup initializing */ #define LC_SIP_TRANSPORT_RANDOM -1 /** * Linphone core SIP transport ports. * Use with #linphone_core_set_sip_transports * @ingroup initializing */ typedef struct _LCSipTransports{ /** * udp port to listening on, negative value if not set * */ int udp_port; /** * tcp port to listening on, negative value if not set * */ int tcp_port; /** * dtls port to listening on, negative value if not set * */ int dtls_port; /** * tls port to listening on, negative value if not set * */ int tls_port; } LCSipTransports; /** * Enum describing transport type for LinphoneAddress. * @ingroup linphone_address **/ enum _LinphoneTransportType{ LinphoneTransportUdp, LinphoneTransportTcp, LinphoneTransportTls, LinphoneTransportDtls }; /*this enum MUST be kept in sync with the SalTransport from sal.h*/ /** * Typedef for transport type enum. * @ingroup linphone_address **/ typedef enum _LinphoneTransportType LinphoneTransportType; /** * 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; typedef struct belle_sip_dict LinphoneDictionary; /** * The LinphoneCall object represents a call issued or received by the LinphoneCore * @ingroup call_control **/ struct _LinphoneCall; /** * The LinphoneCall object represents a call issued or received by the LinphoneCore * @ingroup call_control **/ typedef struct _LinphoneCall LinphoneCall; /** * 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 **/ enum _LinphoneReason{ LinphoneReasonNone, LinphoneReasonNoResponse, /** */ 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); #ifdef IN_LINPHONE #include "buffer.h" #include "call_log.h" #include "call_params.h" #include "content.h" #include "event.h" #include "linphonefriend.h" #else #include "linphone/buffer.h" #include "linphone/call_log.h" #include "linphone/call_params.h" #include "linphone/content.h" #include "linphone/event.h" #include "linphone/linphonefriend.h" #endif LINPHONE_PUBLIC LinphoneAddress * linphone_address_new(const char *addr); LINPHONE_PUBLIC LinphoneAddress * linphone_address_clone(const LinphoneAddress *addr); LINPHONE_PUBLIC LinphoneAddress * linphone_address_ref(LinphoneAddress *addr); LINPHONE_PUBLIC void linphone_address_unref(LinphoneAddress *addr); LINPHONE_PUBLIC const char *linphone_address_get_scheme(const LinphoneAddress *u); LINPHONE_PUBLIC const char *linphone_address_get_display_name(const LinphoneAddress* u); LINPHONE_PUBLIC const char *linphone_address_get_username(const LinphoneAddress *u); LINPHONE_PUBLIC const char *linphone_address_get_domain(const LinphoneAddress *u); LINPHONE_PUBLIC int linphone_address_get_port(const LinphoneAddress *u); LINPHONE_PUBLIC void linphone_address_set_display_name(LinphoneAddress *u, const char *display_name); LINPHONE_PUBLIC void linphone_address_set_username(LinphoneAddress *uri, const char *username); LINPHONE_PUBLIC void linphone_address_set_domain(LinphoneAddress *uri, const char *host); LINPHONE_PUBLIC void linphone_address_set_port(LinphoneAddress *uri, int port); /*remove tags, params etc... so that it is displayable to the user*/ LINPHONE_PUBLIC void linphone_address_clean(LinphoneAddress *uri); LINPHONE_PUBLIC bool_t linphone_address_is_secure(const LinphoneAddress *addr); LINPHONE_PUBLIC bool_t linphone_address_get_secure(const LinphoneAddress *addr); LINPHONE_PUBLIC void linphone_address_set_secure(LinphoneAddress *addr, bool_t enabled); LINPHONE_PUBLIC bool_t linphone_address_is_sip(const LinphoneAddress *uri); LINPHONE_PUBLIC LinphoneTransportType linphone_address_get_transport(const LinphoneAddress *uri); LINPHONE_PUBLIC void linphone_address_set_transport(LinphoneAddress *uri,LinphoneTransportType type); LINPHONE_PUBLIC char *linphone_address_as_string(const LinphoneAddress *u); LINPHONE_PUBLIC char *linphone_address_as_string_uri_only(const LinphoneAddress *u); LINPHONE_PUBLIC bool_t linphone_address_weak_equal(const LinphoneAddress *a1, const LinphoneAddress *a2); LINPHONE_PUBLIC bool_t linphone_address_equal(const LinphoneAddress *a1, const LinphoneAddress *a2); LINPHONE_PUBLIC void linphone_address_set_password(LinphoneAddress *addr, const char *passwd); LINPHONE_PUBLIC const char *linphone_address_get_password(const LinphoneAddress *addr); LINPHONE_PUBLIC void linphone_address_set_header(LinphoneAddress *addr, const char *header_name, const char *header_value); LINPHONE_PUBLIC void linphone_address_destroy(LinphoneAddress *u); /** * 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); struct _SipSetupContext; struct _LinphoneInfoMessage; /** * The LinphoneInfoMessage is an object representing an informational message sent or received by the core. **/ typedef struct _LinphoneInfoMessage LinphoneInfoMessage; LINPHONE_PUBLIC LinphoneInfoMessage *linphone_core_create_info_message(LinphoneCore*lc); LINPHONE_PUBLIC int linphone_call_send_info_message(struct _LinphoneCall *call, const LinphoneInfoMessage *info); LINPHONE_PUBLIC void linphone_info_message_add_header(LinphoneInfoMessage *im, const char *name, const char *value); LINPHONE_PUBLIC const char *linphone_info_message_get_header(const LinphoneInfoMessage *im, const char *name); LINPHONE_PUBLIC void linphone_info_message_set_content(LinphoneInfoMessage *im, const LinphoneContent *content); LINPHONE_PUBLIC const LinphoneContent * linphone_info_message_get_content(const LinphoneInfoMessage *im); 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; /** In case this #LinphoneProxyConfig has been added to #LinphoneCore, follows the linphone_proxy_config_edit() rule. * @param obj object pointer * @param val if true, registration will be engaged */ LINPHONE_PUBLIC void linphone_proxy_config_enable_register(LinphoneProxyConfig *obj, bool_t val); #define linphone_proxy_config_enableregister linphone_proxy_config_enable_register LINPHONE_PUBLIC void linphone_proxy_config_edit(LinphoneProxyConfig *obj); LINPHONE_PUBLIC int linphone_proxy_config_done(LinphoneProxyConfig *obj); /** * Indicates either or not, PUBLISH must be issued for this #LinphoneProxyConfig . *
In case this #LinphoneProxyConfig has been added to #LinphoneCore, follows the linphone_proxy_config_edit() rule. * @param obj object pointer * @param val if true, publish will be engaged * */ LINPHONE_PUBLIC void linphone_proxy_config_enable_publish(LinphoneProxyConfig *obj, bool_t val); /** * Set the publish expiration time in second. * @param obj proxy config * @param expires in second * */ LINPHONE_PUBLIC void linphone_proxy_config_set_publish_expires(LinphoneProxyConfig *obj, int expires); /** * get the publish expiration time in second. Default value is the registration expiration value. * @param obj proxy config * @return expires in second * */ LINPHONE_PUBLIC int linphone_proxy_config_get_publish_expires(const LinphoneProxyConfig *obj); LINPHONE_PUBLIC void linphone_proxy_config_set_dial_escape_plus(LinphoneProxyConfig *cfg, bool_t val); LINPHONE_PUBLIC void linphone_proxy_config_set_dial_prefix(LinphoneProxyConfig *cfg, const char *prefix); /** * Indicates whether quality statistics during call should be stored and sent to a collector according to RFC 6035. * @param[in] cfg #LinphoneProxyConfig object * @param[in] enable True to sotre quality statistics and sent them to the collector, false to disable it. */ LINPHONE_PUBLIC void linphone_proxy_config_enable_quality_reporting(LinphoneProxyConfig *cfg, bool_t enable); /** * Indicates whether quality statistics during call should be stored and sent to a collector according to RFC 6035. * @param[in] cfg #LinphoneProxyConfig object * @return True if quality repotring is enabled, false otherwise. */ LINPHONE_PUBLIC bool_t linphone_proxy_config_quality_reporting_enabled(LinphoneProxyConfig *cfg); /** * Set the SIP address of the collector end-point when using quality reporting. This SIP address * should be used on server-side to process packets directly then discard packets. Collector address * should be a non existing account and should not received any packets. * @param[in] cfg #LinphoneProxyConfig object * @param[in] collector SIP address of the collector end-point. */ LINPHONE_PUBLIC void linphone_proxy_config_set_quality_reporting_collector(LinphoneProxyConfig *cfg, const char *collector); /** * Get the SIP address of the collector end-point when using quality reporting. This SIP address * should be used on server-side to process packets directly then discard packets. Collector address * should be a non existing account and should not received any packets. * @param[in] cfg #LinphoneProxyConfig object * @return The SIP address of the collector end-point. */ LINPHONE_PUBLIC const char *linphone_proxy_config_get_quality_reporting_collector(const LinphoneProxyConfig *cfg); /** * Set the interval between 2 interval reports sending when using quality reporting. If call exceed interval size, an * interval report will be sent to the collector. On call termination, a session report will be sent * for the remaining period. Value must be 0 (disabled) or positive. * @param[in] cfg #LinphoneProxyConfig object * @param[in] interval The interval in seconds, 0 means interval reports are disabled. */ LINPHONE_PUBLIC void linphone_proxy_config_set_quality_reporting_interval(LinphoneProxyConfig *cfg, uint8_t interval); /** * Get the interval between interval reports when using quality reporting. * @param[in] cfg #LinphoneProxyConfig object * @return The interval in seconds, 0 means interval reports are disabled. */ LINPHONE_PUBLIC int linphone_proxy_config_get_quality_reporting_interval(LinphoneProxyConfig *cfg); /** * Get the registration state of the given proxy config. * @param[in] obj #LinphoneProxyConfig object. * @return The registration state of the proxy config. **/ LINPHONE_PUBLIC LinphoneRegistrationState linphone_proxy_config_get_state(const LinphoneProxyConfig *obj); LINPHONE_PUBLIC bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj); /** * Get the domain name of the given proxy config. * @param[in] cfg #LinphoneProxyConfig object. * @return The domain name of the proxy config. **/ LINPHONE_PUBLIC const char *linphone_proxy_config_get_domain(const LinphoneProxyConfig *cfg); /** * Get the realm of the given proxy config. * @param[in] cfg #LinphoneProxyConfig object. * @return The realm of the proxy config. **/ LINPHONE_PUBLIC const char *linphone_proxy_config_get_realm(const LinphoneProxyConfig *cfg); /** * Set the realm of the given proxy config. * @param[in] cfg #LinphoneProxyConfig object. * @param[in] realm New realm value. * @return The realm of the proxy config. **/ LINPHONE_PUBLIC void linphone_proxy_config_set_realm(LinphoneProxyConfig *cfg, const char * realm); LINPHONE_PUBLIC const char *linphone_proxy_config_get_route(const LinphoneProxyConfig *obj); LINPHONE_PUBLIC const char *linphone_proxy_config_get_identity(const LinphoneProxyConfig *obj); LINPHONE_PUBLIC bool_t linphone_proxy_config_publish_enabled(const LinphoneProxyConfig *obj); LINPHONE_PUBLIC const char *linphone_proxy_config_get_server_addr(const LinphoneProxyConfig *obj); #define linphone_proxy_config_get_addr linphone_proxy_config_get_server_addr LINPHONE_PUBLIC int linphone_proxy_config_get_expires(const LinphoneProxyConfig *obj); LINPHONE_PUBLIC bool_t linphone_proxy_config_register_enabled(const LinphoneProxyConfig *obj); LINPHONE_PUBLIC void linphone_proxy_config_refresh_register(LinphoneProxyConfig *obj); LINPHONE_PUBLIC void linphone_proxy_config_pause_register(LinphoneProxyConfig *obj); LINPHONE_PUBLIC const char *linphone_proxy_config_get_contact_parameters(const LinphoneProxyConfig *obj); LINPHONE_PUBLIC void linphone_proxy_config_set_contact_parameters(LinphoneProxyConfig *obj, const char *contact_params); LINPHONE_PUBLIC void linphone_proxy_config_set_contact_uri_parameters(LinphoneProxyConfig *obj, const char *contact_uri_params); LINPHONE_PUBLIC const char* linphone_proxy_config_get_contact_uri_parameters(const LinphoneProxyConfig *obj); /** * Get the #LinphoneCore object to which is associated the #LinphoneProxyConfig. * @param[in] obj #LinphoneProxyConfig object. * @return The #LinphoneCore object to which is associated the #LinphoneProxyConfig. **/ LINPHONE_PUBLIC LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyConfig *obj); LINPHONE_PUBLIC bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg); LINPHONE_PUBLIC const char * linphone_proxy_config_get_dial_prefix(const LinphoneProxyConfig *cfg); /** * Get the reason why registration failed when the proxy config state is LinphoneRegistrationFailed. * @param[in] cfg #LinphoneProxyConfig object. * @return The reason why registration failed for this proxy config. **/ LINPHONE_PUBLIC LinphoneReason linphone_proxy_config_get_error(const LinphoneProxyConfig *cfg); /** * Get detailed information why registration failed when the proxy config state is LinphoneRegistrationFailed. * @param[in] cfg #LinphoneProxyConfig object. * @return The details why registration failed for this proxy config. **/ LINPHONE_PUBLIC const LinphoneErrorInfo *linphone_proxy_config_get_error_info(const LinphoneProxyConfig *cfg); /** * Get the transport from either service route, route or addr. * @param[in] cfg #LinphoneProxyConfig object. * @return The transport as a string (I.E udp, tcp, tls, dtls) **/ LINPHONE_PUBLIC const char* linphone_proxy_config_get_transport(const LinphoneProxyConfig *cfg); /* destruction is called automatically when removing the proxy config */ 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); /** * Detect if the given input is a phone number or not. * @param proxy #LinphoneProxyConfig argument, unused yet but may contain useful data. Can be NULL. * @param username string to parse. * @return TRUE if input is a phone number, FALSE otherwise. **/ LINPHONE_PUBLIC bool_t linphone_proxy_config_is_phone_number(LinphoneProxyConfig *proxy, const char *username); /** * Normalize a human readable phone number into a basic string. 888-444-222 becomes 888444222 * or +33888444222 depending on the #LinphoneProxyConfig argument. This function will always * generate a normalized username; if input is not a phone number, output will be a copy of input. * @param proxy #LinphoneProxyConfig object containing country code and/or escape symbol. * @param username the string to parse * @param result the newly normalized number * @param result_len the size of the normalized number \a result * @return TRUE if a phone number was recognized, FALSE otherwise. */ LINPHONE_PUBLIC bool_t linphone_proxy_config_normalize_number(LinphoneProxyConfig *proxy, const char *username, char *result, size_t result_len); /** * Set default privacy policy for all calls routed through this proxy. * @param cfg #LinphoneProxyConfig object to be modified * @param privacy LinphonePrivacy to configure privacy * */ LINPHONE_PUBLIC void linphone_proxy_config_set_privacy(LinphoneProxyConfig *cfg, LinphonePrivacyMask privacy); /** * Get default privacy policy for all calls routed through this proxy. * @param cfg #LinphoneProxyConfig object * @return Privacy mode * */ LINPHONE_PUBLIC LinphonePrivacyMask linphone_proxy_config_get_privacy(const LinphoneProxyConfig *cfg); /** * Set the http file transfer server to be used for content type application/vnd.gsma.rcs-ft-http+xml * @param cfg #LinphoneProxyConfig object to be modified * @param server_url URL of the file server like https://file.linphone.org/upload.php * */ LINPHONE_PUBLIC void linphone_proxy_config_set_file_transfer_server(LinphoneProxyConfig *cfg, const char * server_url); /** * Get the http file transfer server to be used for content type application/vnd.gsma.rcs-ft-http+xml * @param cfg #LinphoneProxyConfig object * @return URL of the file server like https://file.linphone.org/upload.php * */ LINPHONE_PUBLIC const char* linphone_proxy_config_get_file_transfer_server(const LinphoneProxyConfig *cfg); /** * Indicates whether AVPF/SAVPF must be used for calls using this proxy config. * @param[in] cfg #LinphoneProxyConfig object * @param[in] enable True to enable AVPF/SAVF, false to disable it. * @deprecated use linphone_proxy_config_set_avpf_mode() */ LINPHONE_PUBLIC void linphone_proxy_config_enable_avpf(LinphoneProxyConfig *cfg, bool_t enable); /** * Indicates whether AVPF/SAVPF is being used for calls using this proxy config. * @param[in] cfg #LinphoneProxyConfig object * @return True if AVPF/SAVPF is enabled, false otherwise. * @deprecated use linphone_proxy_config_set_avpf_mode() */ LINPHONE_PUBLIC bool_t linphone_proxy_config_avpf_enabled(LinphoneProxyConfig *cfg); /** * Set the interval between regular RTCP reports when using AVPF/SAVPF. * @param[in] cfg #LinphoneProxyConfig object * @param[in] interval The interval in seconds (between 0 and 5 seconds). */ LINPHONE_PUBLIC void linphone_proxy_config_set_avpf_rr_interval(LinphoneProxyConfig *cfg, uint8_t interval); /** * Get the interval between regular RTCP reports when using AVPF/SAVPF. * @param[in] cfg #LinphoneProxyConfig object * @return The interval in seconds. */ LINPHONE_PUBLIC uint8_t linphone_proxy_config_get_avpf_rr_interval(const LinphoneProxyConfig *cfg); /** * Get enablement status of RTCP feedback (also known as AVPF profile). * @param[in] cfg the proxy config * @return the enablement mode, which can be LinphoneAVPFDefault (use LinphoneCore's mode), LinphoneAVPFEnabled (avpf is enabled), or LinphoneAVPFDisabled (disabled). **/ LINPHONE_PUBLIC LinphoneAVPFMode linphone_proxy_config_get_avpf_mode(const LinphoneProxyConfig *cfg); /** * Enable the use of RTCP feedback (also known as AVPF profile). * @param[in] cfg the proxy config * @param[in] mode the enablement mode, which can be LinphoneAVPFDefault (use LinphoneCore's mode), LinphoneAVPFEnabled (avpf is enabled), or LinphoneAVPFDisabled (disabled). **/ LINPHONE_PUBLIC void linphone_proxy_config_set_avpf_mode(LinphoneProxyConfig *cfg, LinphoneAVPFMode mode); /** * Obtain the value of a header sent by the server in last answer to REGISTER. * @param cfg the proxy config object * @param header_name the header name for which to fetch corresponding value * @return the value of the queried header. **/ LINPHONE_PUBLIC const char *linphone_proxy_config_get_custom_header(LinphoneProxyConfig *cfg, const char *header_name); /** * Set the value of a custom header sent to the server in REGISTERs request. * @param cfg the proxy config object * @param header_name the header name * @param header_value the header's value **/ LINPHONE_PUBLIC void linphone_proxy_config_set_custom_header(LinphoneProxyConfig *cfg, const char *header_name, const char *header_value); /** * @} **/ typedef struct _LinphoneAccountCreator{ LinphoneCore *lc; struct _SipSetupContext *ssctx; char *username; char *password; char *domain; char *route; char *email; int suscribe; bool_t succeeded; }LinphoneAccountCreator; LINPHONE_PUBLIC LinphoneAccountCreator *linphone_account_creator_new(LinphoneCore *core, const char *type); LINPHONE_PUBLIC void linphone_account_creator_set_username(LinphoneAccountCreator *obj, const char *username); LINPHONE_PUBLIC void linphone_account_creator_set_password(LinphoneAccountCreator *obj, const char *password); LINPHONE_PUBLIC void linphone_account_creator_set_domain(LinphoneAccountCreator *obj, const char *domain); LINPHONE_PUBLIC void linphone_account_creator_set_route(LinphoneAccountCreator *obj, const char *route); LINPHONE_PUBLIC void linphone_account_creator_set_email(LinphoneAccountCreator *obj, const char *email); LINPHONE_PUBLIC void linphone_account_creator_set_suscribe(LinphoneAccountCreator *obj, int suscribre); LINPHONE_PUBLIC const char * linphone_account_creator_get_username(LinphoneAccountCreator *obj); LINPHONE_PUBLIC const char * linphone_account_creator_get_domain(LinphoneAccountCreator *obj); LINPHONE_PUBLIC int linphone_account_creator_test_existence(LinphoneAccountCreator *obj); LINPHONE_PUBLIC int linphone_account_creator_test_validation(LinphoneAccountCreator *obj); LINPHONE_PUBLIC LinphoneProxyConfig * linphone_account_creator_validate(LinphoneAccountCreator *obj); LINPHONE_PUBLIC void linphone_account_creator_destroy(LinphoneAccountCreator *obj); struct _LinphoneAuthInfo; /** * @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; /** * Creates a #LinphoneAuthInfo object with supplied information. * The object can be created empty, that is with all arguments set to NULL. * Username, userid, password, realm and domain can be set later using specific methods. * At the end, username and passwd (or ha1) are required. * @param username The username that needs to be authenticated * @param userid The userid used for authenticating (use NULL if you don't know what it is) * @param passwd The password in clear text * @param ha1 The ha1-encrypted password if password is not given in clear text. * @param realm The authentication domain (which can be larger than the sip domain. Unfortunately many SIP servers don't use this parameter. * @param domain The SIP domain for which this authentication information is valid, if it has to be restricted for a single SIP domain. * @return A #LinphoneAuthInfo object. linphone_auth_info_destroy() must be used to destroy it when no longer needed. The LinphoneCore makes a copy of LinphoneAuthInfo * passed through linphone_core_add_auth_info(). **/ LINPHONE_PUBLIC LinphoneAuthInfo *linphone_auth_info_new(const char *username, const char *userid, const char *passwd, const char *ha1,const char *realm, const char *domain); /** * @addtogroup authentication * Instantiates a new auth info with values from source. * @param[in] source The #LinphoneAuthInfo object to be cloned * @return The newly created #LinphoneAuthInfo object. */ LINPHONE_PUBLIC LinphoneAuthInfo *linphone_auth_info_clone(const LinphoneAuthInfo* source); /** * Sets the password. * @param[in] info The #LinphoneAuthInfo object * @param[in] passwd The password. **/ LINPHONE_PUBLIC void linphone_auth_info_set_passwd(LinphoneAuthInfo *info, const char *passwd); /** * Sets the username. * @param[in] info The #LinphoneAuthInfo object * @param[in] username The username. **/ LINPHONE_PUBLIC void linphone_auth_info_set_username(LinphoneAuthInfo *info, const char *username); /** * Sets the userid. * @param[in] info The #LinphoneAuthInfo object * @param[in] userid The userid. **/ LINPHONE_PUBLIC void linphone_auth_info_set_userid(LinphoneAuthInfo *info, const char *userid); /** * Sets the realm. * @param[in] info The #LinphoneAuthInfo object * @param[in] realm The realm. **/ LINPHONE_PUBLIC void linphone_auth_info_set_realm(LinphoneAuthInfo *info, const char *realm); /** * Sets the domain for which this authentication is valid. * @param[in] info The #LinphoneAuthInfo object * @param[in] domain The domain. * This should not be necessary because realm is supposed to be unique and sufficient. * However, many SIP servers don't set realm correctly, then domain has to be used to distinguish between several SIP account bearing the same username. **/ LINPHONE_PUBLIC void linphone_auth_info_set_domain(LinphoneAuthInfo *info, const char *domain); /** * Sets the ha1. * @param[in] info The #LinphoneAuthInfo object * @param[in] ha1 The ha1. **/ LINPHONE_PUBLIC void linphone_auth_info_set_ha1(LinphoneAuthInfo *info, const char *ha1); /** * Gets the username. * * @param[in] info The #LinphoneAuthInfo object * @return The username. */ LINPHONE_PUBLIC const char *linphone_auth_info_get_username(const LinphoneAuthInfo *info); /** * Gets the password. * * @param[in] info The #LinphoneAuthInfo object * @return The password. */ LINPHONE_PUBLIC const char *linphone_auth_info_get_passwd(const LinphoneAuthInfo *info); /** * Gets the userid. * * @param[in] info The #LinphoneAuthInfo object * @return The userid. */ LINPHONE_PUBLIC const char *linphone_auth_info_get_userid(const LinphoneAuthInfo *info); /** * Gets the realm. * * @param[in] info The #LinphoneAuthInfo object * @return The realm. */ LINPHONE_PUBLIC const char *linphone_auth_info_get_realm(const LinphoneAuthInfo *info); /** * Gets the domain. * * @param[in] info The #LinphoneAuthInfo object * @return The domain. */ LINPHONE_PUBLIC const char *linphone_auth_info_get_domain(const LinphoneAuthInfo *info); /** * Gets the ha1. * * @param[in] info The #LinphoneAuthInfo object * @return The ha1. */ LINPHONE_PUBLIC const char *linphone_auth_info_get_ha1(const LinphoneAuthInfo *info); /* 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); /** * @} */ struct _LinphoneChatRoom; /** * @addtogroup chatroom * @{ */ /** * An object to handle the callbacks for the handling a LinphoneChatMessage objects. */ typedef struct _LinphoneChatMessageCbs LinphoneChatMessageCbs; /** * A chat room message to hold content to be sent. *
Can be created by linphone_chat_room_create_message(). */ typedef struct _LinphoneChatMessage LinphoneChatMessage; /** * A chat room is the place where text messages are exchanged. *
Can be created by linphone_core_create_chat_room(). */ typedef struct _LinphoneChatRoom LinphoneChatRoom; /** * LinphoneChatMessageState is used to notify if messages have been succesfully delivered or not. */ typedef enum _LinphoneChatMessageState { LinphoneChatMessageStateIdle, /**< Initial state */ LinphoneChatMessageStateInProgress, /**< Delivery in progress */ LinphoneChatMessageStateDelivered, /**< Message successfully delivered and acknowledged by remote end point */ LinphoneChatMessageStateNotDelivered, /**< Message was not delivered */ LinphoneChatMessageStateFileTransferError, /**< Message was received(and acknowledged) but cannot get file from server */ LinphoneChatMessageStateFileTransferDone /**< File transfer has been completed successfully. */ } LinphoneChatMessageState; /** * Call back used to notify message delivery status * @param msg #LinphoneChatMessage object * @param status LinphoneChatMessageState * @param ud application user data * @deprecated */ typedef void (*LinphoneChatMessageStateChangedCb)(LinphoneChatMessage* msg,LinphoneChatMessageState state,void* ud); /** * Call back used to notify message delivery status * @param msg #LinphoneChatMessage object * @param status LinphoneChatMessageState */ typedef void (*LinphoneChatMessageCbsMsgStateChangedCb)(LinphoneChatMessage* msg, LinphoneChatMessageState state); /** * File transfer receive callback prototype. This function is called by the core upon an incoming File transfer is started. This function may be call several time for the same file in case of large file. * @param message #LinphoneChatMessage message from which the body is received. * @param content #LinphoneContent incoming content information * @param buffer #LinphoneBuffer holding the received data. Empty buffer means end of file. */ typedef void (*LinphoneChatMessageCbsFileTransferRecvCb)(LinphoneChatMessage *message, const LinphoneContent* content, const LinphoneBuffer *buffer); /** * File transfer send callback prototype. This function is called by the core when an outgoing file transfer is started. This function is called until size is set to 0. * @param message #LinphoneChatMessage message from which the body is received. * @param content #LinphoneContent outgoing content * @param offset the offset in the file from where to get the data to be sent * @param size the number of bytes expected by the framework * @return A LinphoneBuffer object holding the data written by the application. An empty buffer means end of file. */ typedef LinphoneBuffer * (*LinphoneChatMessageCbsFileTransferSendCb)(LinphoneChatMessage *message, const LinphoneContent* content, size_t offset, size_t size); /** * File transfer progress indication callback prototype. * @param message #LinphoneChatMessage message from which the body is received. * @param content #LinphoneContent incoming content information * @param offset The number of bytes sent/received since the beginning of the transfer. * @param total The total number of bytes to be sent/received. */ typedef void (*LinphoneChatMessageCbsFileTransferProgressIndicationCb)(LinphoneChatMessage *message, const LinphoneContent* content, size_t offset, size_t total); LINPHONE_PUBLIC void linphone_core_set_chat_database_path(LinphoneCore *lc, const char *path); LINPHONE_PUBLIC LinphoneChatRoom * linphone_core_create_chat_room(LinphoneCore *lc, const char *to); LINPHONE_PUBLIC LinphoneChatRoom * linphone_core_get_or_create_chat_room(LinphoneCore *lc, const char *to); LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_get_chat_room(LinphoneCore *lc, const LinphoneAddress *addr); LINPHONE_PUBLIC LinphoneChatRoom *linphone_core_get_chat_room_from_uri(LinphoneCore *lc, const char *to); LINPHONE_PUBLIC void linphone_core_disable_chat(LinphoneCore *lc, LinphoneReason deny_reason); LINPHONE_PUBLIC void linphone_core_enable_chat(LinphoneCore *lc); LINPHONE_PUBLIC bool_t linphone_core_chat_enabled(const LinphoneCore *lc); LINPHONE_PUBLIC void linphone_chat_room_destroy(LinphoneChatRoom *cr); LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_room_create_message(LinphoneChatRoom *cr,const char* message); LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_room_create_message_2(LinphoneChatRoom *cr, const char* message, const char* external_body_url, LinphoneChatMessageState state, time_t time, bool_t is_read, bool_t is_incoming); /** * Acquire a reference to the chat room. * @param[in] cr The chat room. * @return The same chat room. **/ LINPHONE_PUBLIC LinphoneChatRoom *linphone_chat_room_ref(LinphoneChatRoom *cr); /** * Release reference to the chat room. * @param[in] cr The chat room. **/ LINPHONE_PUBLIC void linphone_chat_room_unref(LinphoneChatRoom *cr); /** * Retrieve the user pointer associated with the chat room. * @param[in] cr The chat room. * @return The user pointer associated with the chat room. **/ LINPHONE_PUBLIC void *linphone_chat_room_get_user_data(const LinphoneChatRoom *cr); /** * Assign a user pointer to the chat room. * @param[in] cr The chat room. * @param[in] ud The user pointer to associate with the chat room. **/ LINPHONE_PUBLIC void linphone_chat_room_set_user_data(LinphoneChatRoom *cr, void *ud); /** * Create a message attached to a dedicated chat room with a particular content. Use #linphone_chat_room_file_transfer_send to initiate the transfer * @param[in] cr the chat room. * @param[in] initial_content #LinphoneContent initial content. #LinphoneCoreVTable.file_transfer_send is invoked later to notify file transfer progress and collect next chunk of the message if #LinphoneContentSourceType.src_type is set to LINPHONE_CONTENT_SOURCE_CHUNKED_BUFFER. * @return a new #LinphoneChatMessage */ LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_room_create_file_transfer_message(LinphoneChatRoom *cr, LinphoneContent* initial_content); LINPHONE_PUBLIC const LinphoneAddress* linphone_chat_room_get_peer_address(LinphoneChatRoom *cr); LINPHONE_PUBLIC void linphone_chat_room_send_message(LinphoneChatRoom *cr, const char *msg); LINPHONE_PUBLIC void linphone_chat_room_send_message2(LinphoneChatRoom *cr, LinphoneChatMessage* msg,LinphoneChatMessageStateChangedCb status_cb,void* ud); LINPHONE_PUBLIC void linphone_chat_room_send_chat_message(LinphoneChatRoom *cr, LinphoneChatMessage *msg); LINPHONE_PUBLIC void linphone_chat_room_update_url(LinphoneChatRoom *cr, LinphoneChatMessage *msg); LINPHONE_PUBLIC MSList *linphone_chat_room_get_history(LinphoneChatRoom *cr,int nb_message); /** * Mark all messages of the conversation as read * @param[in] cr The #LinphoneChatRoom object corresponding to the conversation. */ LINPHONE_PUBLIC void linphone_chat_room_mark_as_read(LinphoneChatRoom *cr); /** * Delete a message from the chat room history. * @param[in] cr The #LinphoneChatRoom object corresponding to the conversation. * @param[in] msg The #LinphoneChatMessage object to remove. */ LINPHONE_PUBLIC void linphone_chat_room_delete_message(LinphoneChatRoom *cr, LinphoneChatMessage *msg); /** * Delete all messages from the history * @param[in] cr The #LinphoneChatRoom object corresponding to the conversation. */ LINPHONE_PUBLIC void linphone_chat_room_delete_history(LinphoneChatRoom *cr); /** * Gets the number of messages in a chat room. * @param[in] cr The #LinphoneChatRoom object corresponding to the conversation for which size has to be computed * @return the number of messages. */ LINPHONE_PUBLIC int linphone_chat_room_get_history_size(LinphoneChatRoom *cr); /** * Gets the partial list of messages in the given range, sorted from oldest to most recent. * @param[in] cr The #LinphoneChatRoom object corresponding to the conversation for which messages should be retrieved * @param[in] begin The first message of the range to be retrieved. History most recent message has index 0. * @param[in] end The last message of the range to be retrieved. History oldest message has index of history size - 1 (use #linphone_chat_room_get_history_size to retrieve history size) * @return \mslist{LinphoneChatMessage} */ LINPHONE_PUBLIC MSList *linphone_chat_room_get_history_range(LinphoneChatRoom *cr, int begin, int end); /** * Notifies the destination of the chat message being composed that the user is typing a new message. * @param[in] cr The #LinphoneChatRoom object corresponding to the conversation for which a new message is being typed. */ LINPHONE_PUBLIC void linphone_chat_room_compose(LinphoneChatRoom *cr); /** * Tells whether the remote is currently composing a message. * @param[in] cr The "LinphoneChatRoom object corresponding to the conversation. * @return TRUE if the remote is currently composing a message, FALSE otherwise. */ LINPHONE_PUBLIC bool_t linphone_chat_room_is_remote_composing(const LinphoneChatRoom *cr); /** * Gets the number of unread messages in the chatroom. * @param[in] cr The "LinphoneChatRoom object corresponding to the conversation. * @return the number of unread messages. */ LINPHONE_PUBLIC int linphone_chat_room_get_unread_messages_count(LinphoneChatRoom *cr); LINPHONE_PUBLIC LinphoneCore* linphone_chat_room_get_lc(LinphoneChatRoom *cr); LINPHONE_PUBLIC LinphoneCore* linphone_chat_room_get_core(LinphoneChatRoom *cr); LINPHONE_PUBLIC MSList* linphone_core_get_chat_rooms(LinphoneCore *lc); LINPHONE_PUBLIC unsigned int linphone_chat_message_store(LinphoneChatMessage *msg); LINPHONE_PUBLIC const char* linphone_chat_message_state_to_string(const LinphoneChatMessageState state); LINPHONE_PUBLIC LinphoneChatMessageState linphone_chat_message_get_state(const LinphoneChatMessage* message); LINPHONE_PUBLIC LinphoneChatMessage* linphone_chat_message_clone(const LinphoneChatMessage* message); LINPHONE_PUBLIC LinphoneChatMessage * linphone_chat_message_ref(LinphoneChatMessage *msg); LINPHONE_PUBLIC void linphone_chat_message_unref(LinphoneChatMessage *msg); LINPHONE_PUBLIC void linphone_chat_message_destroy(LinphoneChatMessage* msg); /** @deprecated Use linphone_chat_message_set_from_address() instead. */ #define linphone_chat_message_set_from(msg, addr) linphone_chat_message_set_from_address(msg, addr) LINPHONE_PUBLIC void linphone_chat_message_set_from_address(LinphoneChatMessage* message, const LinphoneAddress* addr); /** @deprecated Use linphone_chat_message_get_from_address() instead. */ #define linphone_chat_message_get_from(msg) linphone_chat_message_get_from_address(msg) LINPHONE_PUBLIC const LinphoneAddress* linphone_chat_message_get_from_address(const LinphoneChatMessage* message); #define linphone_chat_message_set_to(msg, addr) linphone_chat_message_set_to_address(msg, addr) LINPHONE_PUBLIC void linphone_chat_message_set_to_address(LinphoneChatMessage* message, const LinphoneAddress* addr); /** @deprecated Use linphone_chat_message_get_to_address() instead. */ #define linphone_chat_message_get_to(msg) linphone_chat_message_get_to_address(msg) LINPHONE_PUBLIC const LinphoneAddress* linphone_chat_message_get_to_address(const LinphoneChatMessage* message); LINPHONE_PUBLIC const char* linphone_chat_message_get_external_body_url(const LinphoneChatMessage* message); LINPHONE_PUBLIC void linphone_chat_message_set_external_body_url(LinphoneChatMessage* message,const char* url); LINPHONE_PUBLIC const LinphoneContent* linphone_chat_message_get_file_transfer_information(const LinphoneChatMessage* message); LINPHONE_PUBLIC void linphone_chat_message_start_file_download(LinphoneChatMessage* message, LinphoneChatMessageStateChangedCb status_cb, void* ud); LINPHONE_PUBLIC void linphone_chat_message_download_file(LinphoneChatMessage *message); LINPHONE_PUBLIC void linphone_chat_message_cancel_file_transfer(LinphoneChatMessage* msg); LINPHONE_PUBLIC const char* linphone_chat_message_get_appdata(const LinphoneChatMessage* message); LINPHONE_PUBLIC void linphone_chat_message_set_appdata(LinphoneChatMessage* message, const char* data); LINPHONE_PUBLIC const char* linphone_chat_message_get_text(const LinphoneChatMessage* message); LINPHONE_PUBLIC time_t linphone_chat_message_get_time(const LinphoneChatMessage* message); LINPHONE_PUBLIC void* linphone_chat_message_get_user_data(const LinphoneChatMessage* message); LINPHONE_PUBLIC void linphone_chat_message_set_user_data(LinphoneChatMessage* message,void*); LINPHONE_PUBLIC LinphoneChatRoom* linphone_chat_message_get_chat_room(LinphoneChatMessage *msg); LINPHONE_PUBLIC const LinphoneAddress* linphone_chat_message_get_peer_address(LinphoneChatMessage *msg); LINPHONE_PUBLIC LinphoneAddress *linphone_chat_message_get_local_address(const LinphoneChatMessage* message); LINPHONE_PUBLIC void linphone_chat_message_add_custom_header(LinphoneChatMessage* message, const char *header_name, const char *header_value); LINPHONE_PUBLIC const char * linphone_chat_message_get_custom_header(LinphoneChatMessage* message, const char *header_name); LINPHONE_PUBLIC bool_t linphone_chat_message_is_read(LinphoneChatMessage* message); LINPHONE_PUBLIC bool_t linphone_chat_message_is_outgoing(LinphoneChatMessage* message); LINPHONE_PUBLIC unsigned int linphone_chat_message_get_storage_id(LinphoneChatMessage* message); LINPHONE_PUBLIC LinphoneReason linphone_chat_message_get_reason(LinphoneChatMessage* msg); LINPHONE_PUBLIC const LinphoneErrorInfo *linphone_chat_message_get_error_info(const LinphoneChatMessage *msg); LINPHONE_PUBLIC void linphone_chat_message_set_file_transfer_filepath(LinphoneChatMessage *msg, const char *filepath); LINPHONE_PUBLIC const char * linphone_chat_message_get_file_transfer_filepath(LinphoneChatMessage *msg); LINPHONE_PUBLIC LinphoneChatMessageCbs * linphone_chat_message_get_callbacks(const LinphoneChatMessage *msg); LINPHONE_PUBLIC LinphoneChatMessageCbs * linphone_chat_message_cbs_ref(LinphoneChatMessageCbs *cbs); LINPHONE_PUBLIC void linphone_chat_message_cbs_unref(LinphoneChatMessageCbs *cbs); LINPHONE_PUBLIC void *linphone_chat_message_cbs_get_user_data(const LinphoneChatMessageCbs *cbs); LINPHONE_PUBLIC void linphone_chat_message_cbs_set_user_data(LinphoneChatMessageCbs *cbs, void *ud); LINPHONE_PUBLIC LinphoneChatMessageCbsMsgStateChangedCb linphone_chat_message_cbs_get_msg_state_changed(const LinphoneChatMessageCbs *cbs); LINPHONE_PUBLIC void linphone_chat_message_cbs_set_msg_state_changed(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsMsgStateChangedCb cb); LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferRecvCb linphone_chat_message_cbs_get_file_transfer_recv(const LinphoneChatMessageCbs *cbs); LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_recv(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferRecvCb cb); LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferSendCb linphone_chat_message_cbs_get_file_transfer_send(const LinphoneChatMessageCbs *cbs); LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_send(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferSendCb cb); LINPHONE_PUBLIC LinphoneChatMessageCbsFileTransferProgressIndicationCb linphone_chat_message_cbs_get_file_transfer_progress_indication(const LinphoneChatMessageCbs *cbs); LINPHONE_PUBLIC void linphone_chat_message_cbs_set_file_transfer_progress_indication(LinphoneChatMessageCbs *cbs, LinphoneChatMessageCbsFileTransferProgressIndicationCb cb); /** * @} */ /** * @addtogroup initializing * @{ **/ /** * LinphoneGlobalState describes the global state of the LinphoneCore object. * It is notified via the LinphoneCoreVTable::global_state_changed **/ typedef enum _LinphoneGlobalState{ LinphoneGlobalOff, LinphoneGlobalStartup, LinphoneGlobalOn, LinphoneGlobalShutdown, LinphoneGlobalConfiguring }LinphoneGlobalState; const char *linphone_global_state_to_string(LinphoneGlobalState gs); /** * LinphoneCoreLogCollectionUploadState is used to notify if log collection upload have been succesfully delivered or not. */ 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; /** * Global state notification callback. * @param lc * @param gstate the global state * @param message informational message. */ typedef void (*LinphoneCoreGlobalStateChangedCb)(LinphoneCore *lc, LinphoneGlobalState gstate, const char *message); /** * Call state notification callback. * @param lc the LinphoneCore * @param call the call object whose state is changed. * @param cstate the new state of the call * @param message an informational message about the state. */ typedef void (*LinphoneCoreCallStateChangedCb)(LinphoneCore *lc, LinphoneCall *call, LinphoneCallState cstate, const char *message); /** * Call encryption changed callback. * @param lc the LinphoneCore * @param call the call on which encryption is changed. * @param on whether encryption is activated. * @param authentication_token an authentication_token, currently set for ZRTP kind of encryption only. */ typedef void (*LinphoneCoreCallEncryptionChangedCb)(LinphoneCore *lc, LinphoneCall *call, bool_t on, const char *authentication_token); /** @ingroup Proxies * Registration state notification callback prototype * */ typedef void (*LinphoneCoreRegistrationStateChangedCb)(LinphoneCore *lc, LinphoneProxyConfig *cfg, LinphoneRegistrationState cstate, const char *message); /** Callback prototype * @deprecated */ typedef void (*ShowInterfaceCb)(LinphoneCore *lc); /** Callback prototype * @deprecated */ typedef void (*DisplayStatusCb)(LinphoneCore *lc, const char *message); /** Callback prototype * @deprecated */ typedef void (*DisplayMessageCb)(LinphoneCore *lc, const char *message); /** Callback prototype * @deprecated */ typedef void (*DisplayUrlCb)(LinphoneCore *lc, const char *message, const char *url); /** Callback prototype */ typedef void (*LinphoneCoreCbFunc)(LinphoneCore *lc,void * user_data); /** * Report status change for a friend previously \link linphone_core_add_friend() added \endlink to #LinphoneCore. * @param lc #LinphoneCore object . * @param lf Updated #LinphoneFriend . */ typedef void (*LinphoneCoreNotifyPresenceReceivedCb)(LinphoneCore *lc, LinphoneFriend * lf); /** * Reports that a new subscription request has been received and wait for a decision. * Status on this subscription request is notified by \link linphone_friend_set_inc_subscribe_policy() changing policy \endlink for this friend * @param lc #LinphoneCore object * @param lf #LinphoneFriend corresponding to the subscriber * @param url of the subscriber * Callback prototype */ typedef void (*LinphoneCoreNewSubscriptionRequestedCb)(LinphoneCore *lc, LinphoneFriend *lf, const char *url); /** * Callback for requesting authentication information to application or user. * @param lc the LinphoneCore * @param realm the realm (domain) on which authentication is required. * @param username the username that needs to be authenticated. * Application shall reply to this callback using linphone_core_add_auth_info(). */ typedef void (*LinphoneCoreAuthInfoRequestedCb)(LinphoneCore *lc, const char *realm, const char *username, const char *domain); /** * Callback to notify a new call-log entry has been added. * This is done typically when a call terminates. * @param lc the LinphoneCore * @param newcl the new call log entry added. */ typedef void (*LinphoneCoreCallLogUpdatedCb)(LinphoneCore *lc, LinphoneCallLog *newcl); /** * Callback prototype * @deprecated use #LinphoneCoreMessageReceivedCb instead. * * @param lc #LinphoneCore object * @param room #LinphoneChatRoom involved in this conversation. Can be be created by the framework in case \link #LinphoneAddress the from \endlink is not present in any chat room. * @param from #LinphoneAddress from * @param message incoming message */ typedef void (*LinphoneCoreTextMessageReceivedCb)(LinphoneCore *lc, LinphoneChatRoom *room, const LinphoneAddress *from, const char *message); /** * Chat message callback prototype * * @param lc #LinphoneCore object * @param room #LinphoneChatRoom involved in this conversation. Can be be created by the framework in case \link #LinphoneAddress the from \endlink is not present in any chat room. * @param LinphoneChatMessage incoming message */ typedef void (*LinphoneCoreMessageReceivedCb)(LinphoneCore *lc, LinphoneChatRoom *room, LinphoneChatMessage *message); /** * File transfer receive callback prototype. This function is called by the core upon an incoming File transfer is started. This function may be call several time for the same file in case of large file. * * * @param lc #LinphoneCore object * @param message #LinphoneChatMessage message from which the body is received. * @param content #LinphoneContent incoming content information * @param buff pointer to the received data * @param size number of bytes to be read from buff. 0 means end of file. * */ typedef void (*LinphoneCoreFileTransferRecvCb)(LinphoneCore *lc, LinphoneChatMessage *message, const LinphoneContent* content, const char* buff, size_t size); /** * 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. *
a #LinphoneContent with a size equal zero * * @param lc #LinphoneCore object * @param message #LinphoneChatMessage message from which the body is received. * @param content #LinphoneContent outgoing content * @param buff pointer to the buffer where data chunk shall be written by the app * @param size as input value, it represents the number of bytes expected by the framework. As output value, it means the number of bytes wrote by the application in the buffer. 0 means end of file. * */ typedef void (*LinphoneCoreFileTransferSendCb)(LinphoneCore *lc, LinphoneChatMessage *message, const LinphoneContent* content, char* buff, size_t* size); /** * 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 * @param offset The number of bytes sent/received since the beginning of the transfer. * @param total The total number of bytes to be sent/received. */ typedef void (*LinphoneCoreFileTransferProgressIndicationCb)(LinphoneCore *lc, LinphoneChatMessage *message, const LinphoneContent* content, size_t offset, size_t total); /** * Is composing notification callback prototype. * * @param[in] lc #LinphoneCore object * @param[in] room #LinphoneChatRoom involved in the conversation. */ typedef void (*LinphoneCoreIsComposingReceivedCb)(LinphoneCore *lc, LinphoneChatRoom *room); /** * Callback for being notified of DTMFs received. * @param lc the linphone core * @param call the call that received the dtmf * @param dtmf the ascii code of the dtmf */ typedef void (*LinphoneCoreDtmfReceivedCb)(LinphoneCore* lc, LinphoneCall *call, int dtmf); /** Callback prototype */ typedef void (*LinphoneCoreReferReceivedCb)(LinphoneCore *lc, const char *refer_to); /** Callback prototype */ typedef void (*LinphoneCoreBuddyInfoUpdatedCb)(LinphoneCore *lc, LinphoneFriend *lf); /** * Callback for notifying progresses of transfers. * @param lc the LinphoneCore * @param transfered the call that was transfered * @param new_call_state the state of the call to transfer target at the far end. */ typedef void (*LinphoneCoreTransferStateChangedCb)(LinphoneCore *lc, LinphoneCall *transfered, LinphoneCallState new_call_state); /** * Callback for receiving quality statistics for calls. * @param lc the LinphoneCore * @param call the call * @param stats the call statistics. */ typedef void (*LinphoneCoreCallStatsUpdatedCb)(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallStats *stats); /** * Callback prototype for receiving info messages. * @param lc the LinphoneCore * @param call the call whose info message belongs to. * @param msg the info message. */ typedef void (*LinphoneCoreInfoReceivedCb)(LinphoneCore *lc, LinphoneCall *call, const LinphoneInfoMessage *msg); /** * 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; /** * Callback prototype for configuring status changes notification * @param lc the LinphoneCore * @param message informational message. */ typedef void (*LinphoneCoreConfiguringStatusCb)(LinphoneCore *lc, LinphoneConfiguringState status, const char *message); /** * Callback prototype for reporting network change either automatically detected or notified by #linphone_core_set_network_reachable. * @param lc the LinphoneCore * @param reachable true if network is reachable. */ typedef void (*LinphoneCoreNetworkReachableCb)(LinphoneCore *lc, bool_t reachable); /** * Callback prototype for reporting log collection upload state change. * @param[in] lc LinphoneCore object * @param[in] state The state of the log collection upload * @param[in] info Additional information: error message in case of error state, URL of uploaded file in case of success. */ typedef void (*LinphoneCoreLogCollectionUploadStateChangedCb)(LinphoneCore *lc, LinphoneCoreLogCollectionUploadState state, const char *info); /** * Callback prototype for reporting log collection upload progress indication. * @param[in] lc LinphoneCore object * @param[in] progress Percentage of the file size of the log collection already uploaded. */ typedef void (*LinphoneCoreLogCollectionUploadProgressIndicationCb)(LinphoneCore *lc, size_t offset, size_t total); /** * This structure holds all callbacks that the application should implement. * None is mandatory. **/ typedef struct _LinphoneCoreVTable{ LinphoneCoreGlobalStateChangedCb global_state_changed; /** A text message has been received */ LinphoneCoreFileTransferRecvCb file_transfer_recv; /**< @deprecated Callback to store file received attached to a #LinphoneChatMessage */ LinphoneCoreFileTransferSendCb file_transfer_send; /**< @deprecated Callback to collect file chunk to be sent for a #LinphoneChatMessage */ LinphoneCoreFileTransferProgressIndicationCb file_transfer_progress_indication; /**< @deprecated Callback to indicate file transfer progress */ LinphoneCoreNetworkReachableCb network_reachable; /**< Callback to report IP network status (I.E up/down )*/ LinphoneCoreLogCollectionUploadStateChangedCb log_collection_upload_state_changed; /**< Callback to upload collected logs */ LinphoneCoreLogCollectionUploadProgressIndicationCb log_collection_upload_progress_indication; /**< Callback to indicate log collection upload progress */ void *user_data; /** 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 **/ LINPHONE_PUBLIC void linphone_core_enable_audio_multicast(LinphoneCore *core, bool_t yesno); /** * Use to get multicast state of audio stream. * @param core #LinphoneCore * @return true if subsequent calls will propose multicast ip set by #linphone_core_set_audio_multicast_addr * @ingroup media_parameters **/ LINPHONE_PUBLIC bool_t linphone_core_audio_multicast_enabled(const LinphoneCore *core); /** * 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. * @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 * @return true if subsequent calls will propose multicast ip set by #linphone_core_set_video_multicast_addr * @ingroup media_parameters **/ LINPHONE_PUBLIC bool_t linphone_core_video_multicast_enabled(const LinphoneCore *core); /** * Set the network simulator parameters. * Liblinphone has the capabability of simulating the effects of a network (latency, lost packets, jitter, max bandwidth). * Please refer to the oRTP documentation for the meaning of the parameters of the OrtpNetworkSimulatorParams structure. * This function has effect for future calls, but not for currently running calls, though this behavior may be changed in future versions. * @warning Due to design of network simulation in oRTP, simulation is applied independently for audio and video stream. This means for example that a bandwidth * limit of 250kbit/s will have no effect on an audio stream running at 40kbit/s while a videostream targetting 400kbit/s will be highly affected. * @param lc the LinphoneCore * @param params the parameters used for the network simulation. * @return 0 if successful, -1 otherwise. **/ 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 * @return a OrtpNetworkSimulatorParams structure. **/ LINPHONE_PUBLIC const OrtpNetworkSimulatorParams *linphone_core_get_network_simulator_params(const LinphoneCore *lc); #ifdef __cplusplus } #endif #endif