Liblinphone  3.11.1
Macros | Typedefs | Enumerations | Functions
Managing proxies

Macros

#define linphone_core_set_default_proxy(lc, config)   linphone_core_set_default_proxy_config(lc, config)
 
#define linphone_proxy_config_expires   linphone_proxy_config_set_expires
 
#define linphone_proxy_config_enableregister   linphone_proxy_config_enable_register
 
#define linphone_proxy_config_get_addr   linphone_proxy_config_get_server_addr
 

Typedefs

typedef struct _LinphoneProxyConfig LinphoneProxyConfig
 
typedef enum _LinphoneRegistrationState LinphoneRegistrationState
 

Enumerations

enum  _LinphoneRegistrationState {
  LinphoneRegistrationNone,
  LinphoneRegistrationProgress,
  LinphoneRegistrationOk,
  LinphoneRegistrationCleared,
  LinphoneRegistrationFailed
}
 

Functions

int linphone_core_set_primary_contact (LinphoneCore *lc, const char *contact)
 
const char * linphone_core_get_primary_contact (LinphoneCore *lc)
 
const char * linphone_core_get_identity (LinphoneCore *lc)
 
void linphone_core_set_guess_hostname (LinphoneCore *lc, bool_t val)
 
bool_t linphone_core_get_guess_hostname (LinphoneCore *lc)
 
LinphoneAddresslinphone_core_get_primary_contact_parsed (LinphoneCore *lc)
 
LinphoneProxyConfiglinphone_core_create_proxy_config (LinphoneCore *lc)
 
int linphone_core_add_proxy_config (LinphoneCore *lc, LinphoneProxyConfig *config)
 
void linphone_core_clear_proxy_config (LinphoneCore *lc)
 
void linphone_core_remove_proxy_config (LinphoneCore *lc, LinphoneProxyConfig *config)
 
const bctbx_list_t * linphone_core_get_proxy_config_list (const LinphoneCore *lc)
 
void linphone_core_set_default_proxy_index (LinphoneCore *lc, int index)
 
LINPHONE_DEPRECATED int linphone_core_get_default_proxy (LinphoneCore *lc, LinphoneProxyConfig **config)
 
LinphoneProxyConfiglinphone_core_get_default_proxy_config (LinphoneCore *lc)
 
void linphone_core_set_default_proxy_config (LinphoneCore *lc, LinphoneProxyConfig *config)
 
void linphone_core_refresh_registers (LinphoneCore *lc)
 
const char * linphone_registration_state_to_string (LinphoneRegistrationState cs)
 
LinphoneProxyConfiglinphone_proxy_config_new (void)
 
LinphoneProxyConfiglinphone_proxy_config_ref (LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_unref (LinphoneProxyConfig *cfg)
 
void * linphone_proxy_config_get_user_data (const LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_set_user_data (LinphoneProxyConfig *cfg, void *ud)
 
int linphone_proxy_config_set_server_addr (LinphoneProxyConfig *cfg, const char *server_addr)
 
int linphone_proxy_config_set_identity (LinphoneProxyConfig *cfg, const char *identity)
 
int linphone_proxy_config_set_identity_address (LinphoneProxyConfig *cfg, const LinphoneAddress *identity)
 
int linphone_proxy_config_set_route (LinphoneProxyConfig *cfg, const char *route)
 
void linphone_proxy_config_set_expires (LinphoneProxyConfig *cfg, int expires)
 
void linphone_proxy_config_enable_register (LinphoneProxyConfig *cfg, bool_t val)
 
void linphone_proxy_config_edit (LinphoneProxyConfig *cfg)
 
int linphone_proxy_config_done (LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_enable_publish (LinphoneProxyConfig *cfg, bool_t val)
 
void linphone_proxy_config_set_publish_expires (LinphoneProxyConfig *cfg, int expires)
 
int linphone_proxy_config_get_publish_expires (const LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_set_dial_escape_plus (LinphoneProxyConfig *cfg, bool_t val)
 
void linphone_proxy_config_set_dial_prefix (LinphoneProxyConfig *cfg, const char *prefix)
 
void linphone_proxy_config_enable_quality_reporting (LinphoneProxyConfig *cfg, bool_t enable)
 
bool_t linphone_proxy_config_quality_reporting_enabled (LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_set_quality_reporting_collector (LinphoneProxyConfig *cfg, const char *collector)
 
const char * linphone_proxy_config_get_quality_reporting_collector (const LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_set_quality_reporting_interval (LinphoneProxyConfig *cfg, int interval)
 
int linphone_proxy_config_get_quality_reporting_interval (LinphoneProxyConfig *cfg)
 
LinphoneRegistrationState linphone_proxy_config_get_state (const LinphoneProxyConfig *cfg)
 
bool_t linphone_proxy_config_is_registered (const LinphoneProxyConfig *cfg)
 
const char * linphone_proxy_config_get_domain (const LinphoneProxyConfig *cfg)
 
const char * linphone_proxy_config_get_realm (const LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_set_realm (LinphoneProxyConfig *cfg, const char *realm)
 
const char * linphone_proxy_config_get_route (const LinphoneProxyConfig *cfg)
 
const LinphoneAddresslinphone_proxy_config_get_identity_address (const LinphoneProxyConfig *cfg)
 
const char * linphone_proxy_config_get_identity (const LinphoneProxyConfig *cfg)
 
bool_t linphone_proxy_config_publish_enabled (const LinphoneProxyConfig *cfg)
 
const char * linphone_proxy_config_get_server_addr (const LinphoneProxyConfig *cfg)
 
int linphone_proxy_config_get_expires (const LinphoneProxyConfig *cfg)
 
bool_t linphone_proxy_config_register_enabled (const LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_refresh_register (LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_pause_register (LinphoneProxyConfig *cfg)
 
const LinphoneAddresslinphone_proxy_config_get_contact (const LinphoneProxyConfig *cfg)
 
const char * linphone_proxy_config_get_contact_parameters (const LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_set_contact_parameters (LinphoneProxyConfig *cfg, const char *contact_params)
 
void linphone_proxy_config_set_contact_uri_parameters (LinphoneProxyConfig *cfg, const char *contact_uri_params)
 
const char * linphone_proxy_config_get_contact_uri_parameters (const LinphoneProxyConfig *cfg)
 
LinphoneCorelinphone_proxy_config_get_core (const LinphoneProxyConfig *cfg)
 
bool_t linphone_proxy_config_get_dial_escape_plus (const LinphoneProxyConfig *cfg)
 
const char * linphone_proxy_config_get_dial_prefix (const LinphoneProxyConfig *cfg)
 
LinphoneReason linphone_proxy_config_get_error (const LinphoneProxyConfig *cfg)
 
const LinphoneErrorInfolinphone_proxy_config_get_error_info (const LinphoneProxyConfig *cfg)
 
const char * linphone_proxy_config_get_transport (const LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_destroy (LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_set_sip_setup (LinphoneProxyConfig *cfg, const char *type)
 
SipSetupContextlinphone_proxy_config_get_sip_setup_context (LinphoneProxyConfig *cfg)
 
SipSetuplinphone_proxy_config_get_sip_setup (LinphoneProxyConfig *cfg)
 
bool_t linphone_proxy_config_is_phone_number (LinphoneProxyConfig *proxy, const char *username)
 
LINPHONE_DEPRECATED bool_t linphone_proxy_config_normalize_number (LinphoneProxyConfig *proxy, const char *username, char *result, size_t result_len)
 
char * linphone_proxy_config_normalize_phone_number (LinphoneProxyConfig *proxy, const char *username)
 
LinphoneAddresslinphone_proxy_config_normalize_sip_uri (LinphoneProxyConfig *proxy, const char *username)
 
void linphone_proxy_config_set_privacy (LinphoneProxyConfig *cfg, LinphonePrivacyMask privacy)
 
LinphonePrivacyMask linphone_proxy_config_get_privacy (const LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_set_file_transfer_server (LinphoneProxyConfig *cfg, const char *server_url)
 
const char * linphone_proxy_config_get_file_transfer_server (const LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_enable_avpf (LinphoneProxyConfig *cfg, bool_t enable)
 
bool_t linphone_proxy_config_avpf_enabled (LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_set_avpf_rr_interval (LinphoneProxyConfig *cfg, uint8_t interval)
 
uint8_t linphone_proxy_config_get_avpf_rr_interval (const LinphoneProxyConfig *cfg)
 
LinphoneAVPFMode linphone_proxy_config_get_avpf_mode (const LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_set_avpf_mode (LinphoneProxyConfig *cfg, LinphoneAVPFMode mode)
 
const char * linphone_proxy_config_get_custom_header (LinphoneProxyConfig *cfg, const char *header_name)
 
void linphone_proxy_config_set_custom_header (LinphoneProxyConfig *cfg, const char *header_name, const char *header_value)
 
const LinphoneAuthInfolinphone_proxy_config_find_auth_info (const LinphoneProxyConfig *cfg)
 
const char * linphone_proxy_config_get_ref_key (const LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_set_ref_key (LinphoneProxyConfig *cfg, const char *refkey)
 
LinphoneNatPolicylinphone_proxy_config_get_nat_policy (const LinphoneProxyConfig *cfg)
 
void linphone_proxy_config_set_nat_policy (LinphoneProxyConfig *cfg, LinphoneNatPolicy *policy)
 

Detailed Description

User registration is controled by LinphoneProxyConfig settings.
Each LinphoneProxyConfig object can be configured with registration informations like proxy address , user id , refresh period , and so on.
A created proxy config using linphone_proxy_config_new(), once configured, must be added to LinphoneCore using function linphone_core_add_proxy_config().
It is recommended to set a default proxy config using function linphone_core_set_default_proxy(). Once done, if a proxy config has been configured with attribute enable register , next call to linphone_core_iterate() triggers a SIP register.
Registration status is reported by LinphoneCoreRegistrationStateChangedCb.

This pseudo code demonstrates basic registration operations:

/*create proxy config*/
/*parse identity*/
LinphoneAddress *from = linphone_address_new("sip:toto@sip.titi.com");
if (password!=NULL){
info=linphone_auth_info_new(linphone_address_get_username(from),NULL,"secret",NULL,NULL); /*create authentication structure from identity*/
linphone_core_add_auth_info(lc,info); /*add authentication info to LinphoneCore*/
}
// configure proxy entries
linphone_proxy_config_set_identity(proxy_cfg,identity); /*set identity with user name and domain*/
const char* server_addr = linphone_address_get_domain(from); /*extract domain address from identity*/
linphone_proxy_config_set_server_addr(proxy_cfg,server_addr); /* we assume domain = proxy server address*/
linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
linphone_address_destroy(from); /*release resource*/
linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/


Registration sate call back:

static void registration_state_changed(struct _LinphoneCore *lc, LinphoneProxyConfig *cfg, LinphoneRegistrationState cstate, const char *message){
printf("New registration state %s for user id [%s] at proxy [%s]\n"
,linphone_proxy_config_get_addr(cfg));
}


Authentication:
Most of the time, registration requires authentication to succeed. LinphoneAuthInfo info must be either added to LinphoneCore using function linphone_core_add_auth_info() before LinphoneProxyConfig is added to Linphone core, or on demand from call back LinphoneCoreAuthInfoRequestedCb.

Unregistration:
Unregistration or any changes to LinphoneProxyConfig must be first started by a call to function linphone_proxy_config_edit() and validated by function linphone_proxy_config_done()
This pseudo code shows how to unregister a user associated to a LinphoneProxyConfig

linphone_core_get_default_proxy(lc,&proxy_cfg); /* get default proxy config*/
linphone_proxy_config_edit(proxy_cfg); /*start editing proxy configuration*/
linphone_proxy_config_enable_register(proxy_cfg,FALSE); /*de-activate registration for this proxy config*/
linphone_proxy_config_done(proxy_cfg); /*initiate REGISTER with expire = 0*/


A complete tutorial can be found at : Registration tutorial

Macro Definition Documentation

§ linphone_core_set_default_proxy

#define linphone_core_set_default_proxy (   lc,
  config 
)    linphone_core_set_default_proxy_config(lc, config)

Typedef Documentation

§ LinphoneProxyConfig

typedef struct _LinphoneProxyConfig LinphoneProxyConfig

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.

§ LinphoneRegistrationState

LinphoneRegistrationState describes proxy registration states.

Enumeration Type Documentation

§ _LinphoneRegistrationState

LinphoneRegistrationState describes proxy registration states.

Enumerator
LinphoneRegistrationNone 

Initial state for registrations

LinphoneRegistrationProgress 

Registration is in progress

LinphoneRegistrationOk 

Registration is successful

LinphoneRegistrationCleared 

Unregistration succeeded

LinphoneRegistrationFailed 

Registration failed

Function Documentation

§ linphone_core_add_proxy_config()

int linphone_core_add_proxy_config ( LinphoneCore lc,
LinphoneProxyConfig config 
)

Add a proxy configuration. This will start registration on the proxy, if registration is enabled.

§ linphone_core_clear_proxy_config()

void linphone_core_clear_proxy_config ( LinphoneCore lc)

Erase all proxies from config.

§ linphone_core_create_proxy_config()

LinphoneProxyConfig* linphone_core_create_proxy_config ( LinphoneCore lc)

Create a proxy config with default values from Linphone core.

Parameters
[in]lcLinphoneCore object
Returns
LinphoneProxyConfig with default values set

§ linphone_core_get_default_proxy()

LINPHONE_DEPRECATED int linphone_core_get_default_proxy ( LinphoneCore lc,
LinphoneProxyConfig **  config 
)
Returns
the default proxy configuration, that is the one used to determine the current identity.
Deprecated:
Use linphone_core_get_default_proxy_config() instead.

§ linphone_core_get_default_proxy_config()

LinphoneProxyConfig* linphone_core_get_default_proxy_config ( LinphoneCore lc)
Returns
the default proxy configuration, that is the one used to determine the current identity.
Parameters
[in]lcLinphoneCore object
Returns
The default proxy configuration.

§ linphone_core_get_guess_hostname()

bool_t linphone_core_get_guess_hostname ( LinphoneCore lc)

Returns TRUE if hostname part of primary contact is guessed automatically.

§ linphone_core_get_identity()

const char * linphone_core_get_identity ( LinphoneCore lc)

Gets the default identity SIP address. This is an helper function. If no default proxy is set, this will return the primary contact ( see linphone_core_get_primary_contact() ). If a default proxy is set it returns the registered identity on the proxy.

Parameters
[in]lcLinphoneCore object
Returns
The default identity SIP address

§ linphone_core_get_primary_contact()

const char* linphone_core_get_primary_contact ( LinphoneCore lc)

Returns the default identity when no proxy configuration is used.

§ linphone_core_get_primary_contact_parsed()

LinphoneAddress* linphone_core_get_primary_contact_parsed ( LinphoneCore lc)

Same as linphone_core_get_primary_contact() but the result is a LinphoneAddress object instead of const char*

§ linphone_core_get_proxy_config_list()

const bctbx_list_t* linphone_core_get_proxy_config_list ( const LinphoneCore lc)

Returns an unmodifiable list of entered proxy configurations.

Parameters
[in]lcThe LinphoneCore object
Returns
A list of LinphoneProxyConfig objects.

§ linphone_core_refresh_registers()

void linphone_core_refresh_registers ( LinphoneCore lc)

force registration refresh to be initiated upon next iterate

§ linphone_core_remove_proxy_config()

void linphone_core_remove_proxy_config ( LinphoneCore lc,
LinphoneProxyConfig config 
)

Removes a proxy configuration.

LinphoneCore will then automatically unregister and place the proxy configuration on a deleted list. For that reason, a removed proxy does NOT need to be freed.

§ linphone_core_set_default_proxy_config()

void linphone_core_set_default_proxy_config ( LinphoneCore lc,
LinphoneProxyConfig config 
)

Sets the default proxy.

This default proxy must be part of the list of already entered LinphoneProxyConfig. Toggling it as default will make LinphoneCore use the identity associated with the proxy configuration in all incoming and outgoing calls.

Parameters
[in]lcLinphoneCore object
[in]configThe proxy configuration to use as the default one.

§ linphone_core_set_guess_hostname()

void linphone_core_set_guess_hostname ( LinphoneCore lc,
bool_t  val 
)

Tells LinphoneCore to guess local hostname automatically in primary contact.

§ linphone_core_set_primary_contact()

int linphone_core_set_primary_contact ( LinphoneCore lc,
const char *  contact 
)

Sets the local "from" identity.

This data is used in absence of any proxy configuration or when no default proxy configuration is set. See LinphoneProxyConfig

§ linphone_proxy_config_avpf_enabled()

bool_t linphone_proxy_config_avpf_enabled ( LinphoneProxyConfig cfg)

Indicates whether AVPF/SAVPF is being used for calls using this proxy config.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
True if AVPF/SAVPF is enabled, false otherwise.
Deprecated:
use linphone_proxy_config_set_avpf_mode()

§ linphone_proxy_config_destroy()

void linphone_proxy_config_destroy ( LinphoneProxyConfig cfg)

Destroys a proxy config.

Deprecated:
Note
: LinphoneProxyConfig that have been removed from LinphoneCore with linphone_core_remove_proxy_config() must not be freed.

§ linphone_proxy_config_done()

int linphone_proxy_config_done ( LinphoneProxyConfig cfg)

Commits modification made to the proxy configuration.

§ linphone_proxy_config_edit()

void linphone_proxy_config_edit ( LinphoneProxyConfig cfg)

Starts editing a proxy configuration.

Because proxy configuration must be consistent, applications MUST call linphone_proxy_config_edit() before doing any attempts to modify proxy configuration (such as identity, proxy address and so on). Once the modifications are done, then the application must call linphone_proxy_config_done() to commit the changes.

§ linphone_proxy_config_enable_avpf()

void linphone_proxy_config_enable_avpf ( LinphoneProxyConfig cfg,
bool_t  enable 
)

Indicates whether AVPF/SAVPF must be used for calls using this proxy config.

Parameters
[in]cfgLinphoneProxyConfig object.
[in]enableTrue to enable AVPF/SAVF, false to disable it.
Deprecated:
use linphone_proxy_config_set_avpf_mode()

§ linphone_proxy_config_enable_publish()

void linphone_proxy_config_enable_publish ( LinphoneProxyConfig cfg,
bool_t  val 
)

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.

Parameters
[in]cfgLinphoneProxyConfig object.
valif true, publish will be engaged

§ linphone_proxy_config_enable_quality_reporting()

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.

Parameters
[in]cfgLinphoneProxyConfig object.
[in]enableTrue to sotre quality statistics and sent them to the collector, false to disable it.

§ linphone_proxy_config_enable_register()

void linphone_proxy_config_enable_register ( LinphoneProxyConfig cfg,
bool_t  val 
)

Indicates either or not, REGISTRATION must be issued for this LinphoneProxyConfig .
In case this LinphoneProxyConfig has been added to LinphoneCore, follows the linphone_proxy_config_edit() rule.

Parameters
[in]cfgLinphoneProxyConfig object.
valif true, registration will be engaged

§ linphone_proxy_config_find_auth_info()

const LinphoneAuthInfo* linphone_proxy_config_find_auth_info ( const LinphoneProxyConfig cfg)

Find authentication info matching proxy config, if any, similarly to linphone_core_find_auth_info.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
a LinphoneAuthInfo matching proxy config criteria if possible, NULL if nothing can be found.

§ linphone_proxy_config_get_avpf_mode()

LinphoneAVPFMode linphone_proxy_config_get_avpf_mode ( const LinphoneProxyConfig cfg)

Get enablement status of RTCP feedback (also known as AVPF profile).

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
the enablement mode, which can be LinphoneAVPFDefault (use LinphoneCore's mode), LinphoneAVPFEnabled (avpf is enabled), or LinphoneAVPFDisabled (disabled).

§ linphone_proxy_config_get_avpf_rr_interval()

uint8_t linphone_proxy_config_get_avpf_rr_interval ( const LinphoneProxyConfig cfg)

Get the interval between regular RTCP reports when using AVPF/SAVPF.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
The interval in seconds.

§ linphone_proxy_config_get_contact_parameters()

const char* linphone_proxy_config_get_contact_parameters ( const LinphoneProxyConfig cfg)
Returns
previously set contact parameters.

§ linphone_proxy_config_get_contact_uri_parameters()

const char* linphone_proxy_config_get_contact_uri_parameters ( const LinphoneProxyConfig cfg)
Returns
previously set contact URI parameters.

§ linphone_proxy_config_get_core()

LinphoneCore* linphone_proxy_config_get_core ( const LinphoneProxyConfig cfg)

Get the LinphoneCore object to which is associated the LinphoneProxyConfig.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
The LinphoneCore object to which is associated the LinphoneProxyConfig.

§ linphone_proxy_config_get_custom_header()

const char* linphone_proxy_config_get_custom_header ( LinphoneProxyConfig cfg,
const char *  header_name 
)

Obtain the value of a header sent by the server in last answer to REGISTER.

Parameters
[in]cfgLinphoneProxyConfig object.
header_namethe header name for which to fetch corresponding value
Returns
the value of the queried header.

§ linphone_proxy_config_get_dial_escape_plus()

bool_t linphone_proxy_config_get_dial_escape_plus ( const LinphoneProxyConfig cfg)
Returns
whether liblinphone should replace "+" by "00" in dialed numbers (passed to linphone_core_invite ).

§ linphone_proxy_config_get_dial_prefix()

const char* linphone_proxy_config_get_dial_prefix ( const LinphoneProxyConfig cfg)
Returns
dialing prefix.

§ linphone_proxy_config_get_domain()

const char* linphone_proxy_config_get_domain ( const LinphoneProxyConfig cfg)

Get the domain name of the given proxy config.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
The domain name of the proxy config.

§ linphone_proxy_config_get_error()

LinphoneReason linphone_proxy_config_get_error ( const LinphoneProxyConfig cfg)

Get the reason why registration failed when the proxy config state is LinphoneRegistrationFailed.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
The reason why registration failed for this proxy config.

§ linphone_proxy_config_get_error_info()

const LinphoneErrorInfo* linphone_proxy_config_get_error_info ( const LinphoneProxyConfig cfg)

Get detailed information why registration failed when the proxy config state is LinphoneRegistrationFailed.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
The details why registration failed for this proxy config.

§ linphone_proxy_config_get_expires()

int linphone_proxy_config_get_expires ( const LinphoneProxyConfig cfg)
Returns
the duration of registration.

§ linphone_proxy_config_get_file_transfer_server()

const char* linphone_proxy_config_get_file_transfer_server ( const LinphoneProxyConfig cfg)

Get the http file transfer server to be used for content type application/vnd.gsma.rcs-ft-http+xml

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
URL of the file server like https://file.linphone.org/upload.php
Warning
That function isn't implemented yet.

§ linphone_proxy_config_get_identity()

const char* linphone_proxy_config_get_identity ( const LinphoneProxyConfig cfg)

§ linphone_proxy_config_get_identity_address()

const LinphoneAddress* linphone_proxy_config_get_identity_address ( const LinphoneProxyConfig cfg)
Returns
the SIP identity that belongs to this proxy configuration.

§ linphone_proxy_config_get_nat_policy()

LinphoneNatPolicy* linphone_proxy_config_get_nat_policy ( const LinphoneProxyConfig cfg)

Get The policy that is used to pass through NATs/firewalls when using this proxy config. If it is set to NULL, the default NAT policy from the core will be used instead.

Parameters
[in]cfgLinphoneProxyConfig object
Returns
LinphoneNatPolicy object in use.
See also
linphone_core_get_nat_policy()

§ linphone_proxy_config_get_privacy()

LinphonePrivacyMask linphone_proxy_config_get_privacy ( const LinphoneProxyConfig cfg)

Get default privacy policy for all calls routed through this proxy.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
Privacy mode

§ linphone_proxy_config_get_publish_expires()

int linphone_proxy_config_get_publish_expires ( const LinphoneProxyConfig cfg)

get the publish expiration time in second. Default value is the registration expiration value.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
expires in second

§ linphone_proxy_config_get_quality_reporting_collector()

const char* linphone_proxy_config_get_quality_reporting_collector ( const LinphoneProxyConfig cfg)

Get the route of the collector end-point when using quality reporting. This SIP address should be used on server-side to process packets directly before discarding packets. Collector address should be a non existing account and will not receive any messages. If NULL, reports will be send to the proxy domain.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
The SIP address of the collector end-point.

§ linphone_proxy_config_get_quality_reporting_interval()

int linphone_proxy_config_get_quality_reporting_interval ( LinphoneProxyConfig cfg)

Get the interval between interval reports when using quality reporting.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
The interval in seconds, 0 means interval reports are disabled.

§ linphone_proxy_config_get_realm()

const char* linphone_proxy_config_get_realm ( const LinphoneProxyConfig cfg)

Get the realm of the given proxy config.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
The realm of the proxy config.

§ linphone_proxy_config_get_ref_key()

const char* linphone_proxy_config_get_ref_key ( const LinphoneProxyConfig cfg)

Get the persistent reference key associated to the proxy config.

The reference key can be for example an id to an external database. It is stored in the config file, thus can survive to process exits/restarts.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
The reference key string that has been associated to the proxy config, or NULL if none has been associated.

§ linphone_proxy_config_get_route()

const char* linphone_proxy_config_get_route ( const LinphoneProxyConfig cfg)
Returns
the route set for this proxy configuration.

§ linphone_proxy_config_get_server_addr()

const char* linphone_proxy_config_get_server_addr ( const LinphoneProxyConfig cfg)
Returns
the proxy's SIP address.

§ linphone_proxy_config_get_state()

LinphoneRegistrationState linphone_proxy_config_get_state ( const LinphoneProxyConfig cfg)

Get the registration state of the given proxy config.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
The registration state of the proxy config.

§ linphone_proxy_config_get_transport()

const char* linphone_proxy_config_get_transport ( const LinphoneProxyConfig cfg)

Get the transport from either service route, route or addr.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
The transport as a string (I.E udp, tcp, tls, dtls)

§ linphone_proxy_config_get_user_data()

void* linphone_proxy_config_get_user_data ( const LinphoneProxyConfig cfg)

Retrieve the user pointer associated with the proxy config.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
The user pointer associated with the proxy config.

§ linphone_proxy_config_is_phone_number()

bool_t linphone_proxy_config_is_phone_number ( LinphoneProxyConfig proxy,
const char *  username 
)

Detect if the given input is a phone number or not.

Parameters
proxyLinphoneProxyConfig argument, unused yet but may contain useful data. Can be NULL.
usernamestring to parse.
Returns
TRUE if input is a phone number, FALSE otherwise.

§ linphone_proxy_config_is_registered()

bool_t linphone_proxy_config_is_registered ( const LinphoneProxyConfig cfg)
Returns
a boolean indicating that the user is sucessfully registered on the proxy.
Deprecated:
Use linphone_proxy_config_get_state() instead.

§ linphone_proxy_config_new()

LinphoneProxyConfig* linphone_proxy_config_new ( void  )

Creates an empty proxy config.

Deprecated:
, use linphone_core_create_proxy_config instead

§ linphone_proxy_config_normalize_number()

LINPHONE_DEPRECATED bool_t linphone_proxy_config_normalize_number ( LinphoneProxyConfig proxy,
const char *  username,
char *  result,
size_t  result_len 
)

See linphone_proxy_config_normalize_phone_number

Parameters
proxyLinphoneProxyConfig object containing country code and/or escape symbol. If NULL passed, will use default configuration.
usernamethe string to parse
resultthe newly normalized number
result_lenthe size of the normalized number result
Returns
TRUE if a phone number was recognized, FALSE otherwise.
Deprecated:
use linphone_proxy_config_normalize_phone_number()

§ linphone_proxy_config_normalize_phone_number()

char* linphone_proxy_config_normalize_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 object. This function will always generate a normalized username if input is a phone number.

Parameters
proxyLinphoneProxyConfig object containing country code and/or escape symbol. If NULL passed, will use default configuration.
usernamethe string to parse
Returns
NULL if input is an invalid phone number, normalized phone number from username input otherwise.

§ linphone_proxy_config_normalize_sip_uri()

LinphoneAddress* linphone_proxy_config_normalize_sip_uri ( LinphoneProxyConfig proxy,
const char *  username 
)

Normalize a human readable sip uri into a fully qualified LinphoneAddress. A sip address should look like DisplayName <sip:username@domain:port> . Basically this function performs the following tasks

  • if a phone number is entered, prepend country prefix and eventually escape the '+' by 00 of the proxy config.
  • if no domain part is supplied, append the domain name of the proxy config. Returns NULL if no proxy is provided at this point.
  • if no sip: is present, prepend it.

The result is a syntactically correct SIP address.

Parameters
proxyLinphoneProxyConfig object containing country code, escape symbol and/or domain name. Can be NULL if domain is already provided.
usernamethe string to parse
Returns
NULL if invalid input, normalized sip address otherwise.

§ linphone_proxy_config_pause_register()

void linphone_proxy_config_pause_register ( LinphoneProxyConfig cfg)

Prevent a proxy config from refreshing its registration. This is useful to let registrations to expire naturally (or) when the application wants to keep control on when refreshes are sent. However, linphone_core_set_network_reachable(lc,TRUE) will always request the proxy configs to refresh their registrations. The refreshing operations can be resumed with linphone_proxy_config_refresh_register().

Parameters
[in]cfgLinphoneProxyConfig object.

§ linphone_proxy_config_publish_enabled()

bool_t linphone_proxy_config_publish_enabled ( const LinphoneProxyConfig cfg)
Returns
TRUE if PUBLISH request is enabled for this proxy.

§ linphone_proxy_config_quality_reporting_enabled()

bool_t linphone_proxy_config_quality_reporting_enabled ( LinphoneProxyConfig cfg)

Indicates whether quality statistics during call should be stored and sent to a collector according to RFC 6035.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
True if quality repotring is enabled, false otherwise.

§ linphone_proxy_config_ref()

LinphoneProxyConfig* linphone_proxy_config_ref ( LinphoneProxyConfig cfg)

Acquire a reference to the proxy config.

Parameters
[in]cfgLinphoneProxyConfig object.
Returns
The same proxy config.

§ linphone_proxy_config_refresh_register()

void linphone_proxy_config_refresh_register ( LinphoneProxyConfig cfg)

Refresh a proxy registration. This is useful if for example you resuming from suspend, thus IP address may have changed.

§ linphone_proxy_config_register_enabled()

bool_t linphone_proxy_config_register_enabled ( const LinphoneProxyConfig cfg)
Returns
TRUE if registration to the proxy is enabled.

§ linphone_proxy_config_set_avpf_mode()

void linphone_proxy_config_set_avpf_mode ( LinphoneProxyConfig cfg,
LinphoneAVPFMode  mode 
)

Enable the use of RTCP feedback (also known as AVPF profile).

Parameters
[in]cfgLinphoneProxyConfig object.
[in]modethe enablement mode, which can be LinphoneAVPFDefault (use LinphoneCore's mode), LinphoneAVPFEnabled (avpf is enabled), or LinphoneAVPFDisabled (disabled).

§ linphone_proxy_config_set_avpf_rr_interval()

void linphone_proxy_config_set_avpf_rr_interval ( LinphoneProxyConfig cfg,
uint8_t  interval 
)

Set the interval between regular RTCP reports when using AVPF/SAVPF.

Parameters
[in]cfgLinphoneProxyConfig object.
[in]intervalThe interval in seconds (between 0 and 5 seconds).

§ linphone_proxy_config_set_contact_parameters()

void linphone_proxy_config_set_contact_parameters ( LinphoneProxyConfig cfg,
const char *  contact_params 
)

Set optional contact parameters that will be added to the contact information sent in the registration.

Parameters
[in]cfgLinphoneProxyConfig object.
contact_paramsa string contaning the additional parameters in text form, like "myparam=something;myparam2=something_else"

The main use case for this function is provide the proxy additional information regarding the user agent, like for example unique identifier or apple push id. As an example, the contact address in the SIP register sent will look like <sip:joe@1.nosp@m.5.12.nosp@m.8.128.nosp@m..93:50421>;apple-push-id=43143-DFE23F-2323-FA2232.

§ linphone_proxy_config_set_contact_uri_parameters()

void linphone_proxy_config_set_contact_uri_parameters ( LinphoneProxyConfig cfg,
const char *  contact_uri_params 
)

Set optional contact parameters that will be added to the contact information sent in the registration, inside the URI.

Parameters
[in]cfgLinphoneProxyConfig object.
contact_uri_paramsa string containing the additional parameters in text form, like "myparam=something;myparam2=something_else"

The main use case for this function is provide the proxy additional information regarding the user agent, like for example unique identifier or apple push id. As an example, the contact address in the SIP register sent will look like <sip:joe@1.nosp@m.5.12.nosp@m.8.128.nosp@m..93:50421;apple-push-id=43143-DFE23F-2323-FA2232>.

§ linphone_proxy_config_set_custom_header()

void linphone_proxy_config_set_custom_header ( LinphoneProxyConfig cfg,
const char *  header_name,
const char *  header_value 
)

Set the value of a custom header sent to the server in REGISTERs request.

Parameters
[in]cfgLinphoneProxyConfig object.
header_namethe header name
header_valuethe header's value

§ linphone_proxy_config_set_dial_escape_plus()

void linphone_proxy_config_set_dial_escape_plus ( LinphoneProxyConfig cfg,
bool_t  val 
)

Sets whether liblinphone should replace "+" by international calling prefix in dialed numbers (passed to linphone_core_invite ).

§ linphone_proxy_config_set_dial_prefix()

void linphone_proxy_config_set_dial_prefix ( LinphoneProxyConfig cfg,
const char *  prefix 
)

Sets a dialing prefix to be automatically prepended when inviting a number with linphone_core_invite(); This dialing prefix shall usually be the country code of the country where the user is living, without "+".

§ linphone_proxy_config_set_expires()

void linphone_proxy_config_set_expires ( LinphoneProxyConfig cfg,
int  expires 
)

Sets the registration expiration time in seconds.

§ linphone_proxy_config_set_file_transfer_server()

void linphone_proxy_config_set_file_transfer_server ( LinphoneProxyConfig cfg,
const char *  server_url 
)

Set the http file transfer server to be used for content type application/vnd.gsma.rcs-ft-http+xml

Parameters
[in]cfgLinphoneProxyConfig object.
server_urlURL of the file server like https://file.linphone.org/upload.php
Warning
That function isn't implemented yet.

§ linphone_proxy_config_set_identity()

int linphone_proxy_config_set_identity ( LinphoneProxyConfig cfg,
const char *  identity 
)

§ linphone_proxy_config_set_identity_address()

int linphone_proxy_config_set_identity_address ( LinphoneProxyConfig cfg,
const LinphoneAddress identity 
)

Sets the user identity as a SIP address.

This identity is normally formed with display name, username and domain, such as: Alice <sip:alice.nosp@m.@exa.nosp@m.mple..nosp@m.net> The REGISTER messages will have from and to set to this identity.

§ linphone_proxy_config_set_nat_policy()

void linphone_proxy_config_set_nat_policy ( LinphoneProxyConfig cfg,
LinphoneNatPolicy policy 
)

Set the policy to use to pass through NATs/firewalls when using this proxy config. If it is set to NULL, the default NAT policy from the core will be used instead.

Parameters
[in]cfgLinphoneProxyConfig object
[in]policyLinphoneNatPolicy object
See also
linphone_core_set_nat_policy()

§ linphone_proxy_config_set_privacy()

void linphone_proxy_config_set_privacy ( LinphoneProxyConfig cfg,
LinphonePrivacyMask  privacy 
)

Set default privacy policy for all calls routed through this proxy.

Parameters
[in]cfgLinphoneProxyConfig object.
privacyLinphonePrivacy to configure privacy

§ linphone_proxy_config_set_publish_expires()

void linphone_proxy_config_set_publish_expires ( LinphoneProxyConfig cfg,
int  expires 
)

Set the publish expiration time in second.

Parameters
[in]cfgLinphoneProxyConfig object.
expiresin second

§ linphone_proxy_config_set_quality_reporting_collector()

void linphone_proxy_config_set_quality_reporting_collector ( LinphoneProxyConfig cfg,
const char *  collector 
)

Set the route of the collector end-point when using quality reporting. This SIP address should be used on server-side to process packets directly before discarding packets. Collector address should be a non existing account and will not receive any messages. If NULL, reports will be send to the proxy domain.

Parameters
[in]cfgLinphoneProxyConfig object.
[in]collectorroute of the collector end-point, if NULL PUBLISH will be sent to the proxy domain.

§ linphone_proxy_config_set_quality_reporting_interval()

void linphone_proxy_config_set_quality_reporting_interval ( LinphoneProxyConfig cfg,
int  interval 
)

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.

Parameters
[in]cfgLinphoneProxyConfig object.
[in]intervalThe interval in seconds, 0 means interval reports are disabled.

§ linphone_proxy_config_set_realm()

void linphone_proxy_config_set_realm ( LinphoneProxyConfig cfg,
const char *  realm 
)

Set the realm of the given proxy config.

Parameters
[in]cfgLinphoneProxyConfig object.
[in]realmNew realm value.
Returns
The realm of the proxy config.

§ linphone_proxy_config_set_ref_key()

void linphone_proxy_config_set_ref_key ( LinphoneProxyConfig cfg,
const char *  refkey 
)

Associate a persistent reference key to the proxy config.

The reference key can be for example an id to an external database. It is stored in the config file, thus can survive to process exits/restarts.

Parameters
[in]cfgLinphoneProxyConfig object.
[in]refkeyThe reference key string to associate to the proxy config.

§ linphone_proxy_config_set_route()

int linphone_proxy_config_set_route ( LinphoneProxyConfig cfg,
const char *  route 
)

Sets a SIP route. When a route is set, all outgoing calls will go to the route's destination if this proxy is the default one (see linphone_core_set_default_proxy() ).

Returns
-1 if route is invalid, 0 otherwise.

§ linphone_proxy_config_set_server_addr()

int linphone_proxy_config_set_server_addr ( LinphoneProxyConfig cfg,
const char *  server_addr 
)

Sets the proxy address

Examples of valid sip proxy address are:

  • IP address: sip:87.98.157.38
  • IP address with port: sip:87.98.157.38:5062
  • hostnames : sip:sip.example.net

§ linphone_proxy_config_set_user_data()

void linphone_proxy_config_set_user_data ( LinphoneProxyConfig cfg,
void *  ud 
)

Assign a user pointer to the proxy config.

Parameters
[in]cfgLinphoneProxyConfig object.
[in]udThe user pointer to associate with the proxy config.

§ linphone_proxy_config_unref()

void linphone_proxy_config_unref ( LinphoneProxyConfig cfg)

Release reference to the proxy config.

Parameters
[in]cfgLinphoneProxyConfig object.

§ linphone_registration_state_to_string()

const char* linphone_registration_state_to_string ( LinphoneRegistrationState  cs)

Human readable version of the LinphoneRegistrationState

Parameters
cssate