liblinphone  3.5.99.0
Typedefs | Functions
Miscenalleous: logs, version strings, config storage

Typedefs

typedef struct _LpConfig LpConfig

Functions

void linphone_core_enable_logs (FILE *file)
void linphone_core_enable_logs_with_cb (OrtpLogFunc logfunc)
void linphone_core_disable_logs ()
const char * linphone_core_get_version (void)
void linphone_core_set_user_agent (LinphoneCore *lc, const char *name, const char *ver)
LpConfiglinphone_core_get_config (LinphoneCore *lc)
int linphone_dial_plan_lookup_ccc_from_iso (const char *iso)
int linphone_dial_plan_lookup_ccc_from_e164 (const char *e164)
const char * lp_config_get_string (const LpConfig *lpconfig, const char *section, const char *key, const char *default_string)
bool_t lp_config_get_range (const LpConfig *lpconfig, const char *section, const char *key, int *min, int *max, int default_min, int default_max)
int lp_config_get_int (const LpConfig *lpconfig, const char *section, const char *key, int default_value)
int64_t lp_config_get_int64 (const LpConfig *lpconfig, const char *section, const char *key, int64_t default_value)
float lp_config_get_float (const LpConfig *lpconfig, const char *section, const char *key, float default_value)
void lp_config_set_string (LpConfig *lpconfig, const char *section, const char *key, const char *value)
void lp_config_set_range (LpConfig *lpconfig, const char *section, const char *key, int min_value, int max_value)
void lp_config_set_int (LpConfig *lpconfig, const char *section, const char *key, int value)
void lp_config_set_int_hex (LpConfig *lpconfig, const char *section, const char *key, int value)
void lp_config_set_int64 (LpConfig *lpconfig, const char *section, const char *key, int64_t value)
void lp_config_set_float (LpConfig *lpconfig, const char *section, const char *key, float value)
int lp_config_sync (LpConfig *lpconfig)
int lp_config_has_section (const LpConfig *lpconfig, const char *section)
void lp_config_clean_section (LpConfig *lpconfig, const char *section)
void lp_config_for_each_section (const LpConfig *lpconfig, void(*callback)(const char *section, void *ctx), void *ctx)
void lp_config_for_each_entry (const LpConfig *lpconfig, const char *section, void(*callback)(const char *entry, void *ctx), void *ctx)

Detailed Description


Typedef Documentation

typedef struct _LpConfig LpConfig

The LpConfig object is used to manipulate a configuration file.

The format of the configuration file is a .ini like format:

  • sections are defined in []
  • each section contains a sequence of key=value pairs.

Example:

[sound]
echocanceler=1
playback_dev=ALSA: Default device
[video]
enabled=1

Function Documentation

void linphone_core_enable_logs ( FILE *  file)

Enable logs in supplied FILE*.

Parameters:
filea C FILE* where to fprintf logs. If null stdout is used.
void linphone_core_enable_logs_with_cb ( OrtpLogFunc  logfunc)

Enable logs through the user's supplied log callback.

Parameters:
logfuncThe address of a OrtpLogFunc callback whose protoype is typedef void (*OrtpLogFunc)(OrtpLogLevel lev, const char *fmt, va_list args);
void linphone_core_disable_logs ( void  )

Entirely disable logging.

const char* linphone_core_get_version ( void  )

Returns liblinphone's version as a string.

void linphone_core_set_user_agent ( LinphoneCore lc,
const char *  name,
const char *  ver 
)

Sets the user agent string used in SIP messages.

LpConfig* linphone_core_get_config ( LinphoneCore lc)
read

Returns the LpConfig object used to manage the storage (config) file.

The application can use the LpConfig object to insert its own private sections and pairs of key=value in the configuration file.

int linphone_dial_plan_lookup_ccc_from_iso ( const char *  iso)

*Function to get call country code from ISO 3166-1 alpha-2 code, ex: FR returns 33

Parameters:
isocountry code alpha2
Returns:
call country code or -1 if not found
int linphone_dial_plan_lookup_ccc_from_e164 ( const char *  e164)

*Function to get call country code from an e164 number, ex: +33952650121 will return 33

Parameters:
e164phone number
Returns:
call country code or -1 if not found
const char* lp_config_get_string ( const LpConfig lpconfig,
const char *  section,
const char *  key,
const char *  default_string 
)

Retrieves a configuration item as a string, given its section, key, and default value.

The default value string is returned if the config item isn't found.

bool_t lp_config_get_range ( const LpConfig lpconfig,
const char *  section,
const char *  key,
int *  min,
int *  max,
int  default_min,
int  default_max 
)

Retrieves a configuration item as a range, given its section, key, and default min and max values.

Returns:
TRUE if the value is successfully parsed as a range, FALSE otherwise. If FALSE is returned, min and max are filled respectively with default_min and default_max values.
int lp_config_get_int ( const LpConfig lpconfig,
const char *  section,
const char *  key,
int  default_value 
)

Retrieves a configuration item as an integer, given its section, key, and default value.

The default integer value is returned if the config item isn't found.

int64_t lp_config_get_int64 ( const LpConfig lpconfig,
const char *  section,
const char *  key,
int64_t  default_value 
)

Retrieves a configuration item as a 64 bit integer, given its section, key, and default value.

The default integer value is returned if the config item isn't found.

float lp_config_get_float ( const LpConfig lpconfig,
const char *  section,
const char *  key,
float  default_value 
)

Retrieves a configuration item as a float, given its section, key, and default value.

The default float value is returned if the config item isn't found.

void lp_config_set_string ( LpConfig lpconfig,
const char *  section,
const char *  key,
const char *  value 
)

Sets a string config item

void lp_config_set_range ( LpConfig lpconfig,
const char *  section,
const char *  key,
int  min_value,
int  max_value 
)

Sets a range config item

void lp_config_set_int ( LpConfig lpconfig,
const char *  section,
const char *  key,
int  value 
)

Sets an integer config item

void lp_config_set_int_hex ( LpConfig lpconfig,
const char *  section,
const char *  key,
int  value 
)

Sets an integer config item, but store it as hexadecimal

void lp_config_set_int64 ( LpConfig lpconfig,
const char *  section,
const char *  key,
int64_t  value 
)

Sets a 64 bits integer config item

void lp_config_set_float ( LpConfig lpconfig,
const char *  section,
const char *  key,
float  value 
)

Sets a float config item

int lp_config_sync ( LpConfig lpconfig)

Writes the config file to disk.

int lp_config_has_section ( const LpConfig lpconfig,
const char *  section 
)

Returns 1 if a given section is present in the configuration.

void lp_config_clean_section ( LpConfig lpconfig,
const char *  section 
)

Removes every pair of key,value in a section and remove the section.

void lp_config_for_each_section ( const LpConfig lpconfig,
void(*)(const char *section, void *ctx)  callback,
void *  ctx 
)

Call a function for each section present in the configuration.

void lp_config_for_each_entry ( const LpConfig lpconfig,
const char *  section,
void(*)(const char *entry, void *ctx)  callback,
void *  ctx 
)

Call a function for each entry present in a section configuration.