liblinphone  3.6.1
Data Structures | Typedefs | Enumerations | Functions
Miscenalleous: logs, version strings, config storage

Data Structures

struct  _LinphoneContent
 

Typedefs

typedef struct _LinphoneContent LinphoneContent
 
typedef enum _LinphoneReason LinphoneReason
 
typedef struct _LpConfig LpConfig
 

Enumerations

enum  _LinphoneReason { ,
  LinphoneReasonNoResponse,
  LinphoneReasonBadCredentials,
  LinphoneReasonDeclined,
  LinphoneReasonNotFound,
  LinphoneReasonNotAnswered,
  LinphoneReasonBusy,
  LinphoneReasonMedia,
  LinphoneReasonIOError
}
 

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)
 
const char * linphone_reason_to_string (LinphoneReason err)
 
MS2_PUBLIC void linphone_core_set_log_handler (OrtpLogFunc logfunc)
 
MS2_PUBLIC void linphone_core_set_log_file (FILE *file)
 
MS2_PUBLIC void linphone_core_set_log_level (OrtpLogLevel loglevel)
 
LINPHONE_PUBLIC int linphone_dial_plan_lookup_ccc_from_iso (const char *iso)
 
LINPHONE_PUBLIC int linphone_dial_plan_lookup_ccc_from_e164 (const char *e164)
 
MS2_PUBLIC LpConfiglp_config_new (const char *filename)
 
MS2_PUBLIC LpConfiglp_config_new_with_factory (const char *config_filename, const char *factory_config_filename)
 
MS2_PUBLIC const char * lp_config_get_string (const LpConfig *lpconfig, const char *section, const char *key, const char *default_string)
 
MS2_PUBLIC 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)
 
MS2_PUBLIC int lp_config_get_int (const LpConfig *lpconfig, const char *section, const char *key, int default_value)
 
MS2_PUBLIC int64_t lp_config_get_int64 (const LpConfig *lpconfig, const char *section, const char *key, int64_t default_value)
 
MS2_PUBLIC float lp_config_get_float (const LpConfig *lpconfig, const char *section, const char *key, float default_value)
 
MS2_PUBLIC void lp_config_set_string (LpConfig *lpconfig, const char *section, const char *key, const char *value)
 
MS2_PUBLIC void lp_config_set_range (LpConfig *lpconfig, const char *section, const char *key, int min_value, int max_value)
 
MS2_PUBLIC 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)
 
MS2_PUBLIC void lp_config_set_int64 (LpConfig *lpconfig, const char *section, const char *key, int64_t value)
 
MS2_PUBLIC 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

Alias to the LinphoneContent struct.

Enum describing failure reasons.

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

Enumeration Type Documentation

Enum describing failure reasons.

Enumerator
LinphoneReasonNoResponse 

No response received from remote

LinphoneReasonBadCredentials 

Authentication failed due to bad or missing credentials

LinphoneReasonDeclined 

The call has been declined

LinphoneReasonNotFound 

Destination of the calls was not found.

LinphoneReasonNotAnswered 

The call was not answered in time

LinphoneReasonBusy 

Phone line was busy

LinphoneReasonMedia 

Incompatible media

LinphoneReasonIOError 

Transport error: connection failures, disconnections etc...

Function Documentation

void linphone_core_enable_logs ( FILE *  file)

Enable logs in supplied FILE*.

Deprecated:
Use linphone_core_set_log_file and linphone_core_set_log_level instead.
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.

Deprecated:
Use linphone_core_set_log_handler and linphone_core_set_log_level instead.
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.

Deprecated:
Use linphone_core_set_log_level instead.
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.

const char* linphone_reason_to_string ( LinphoneReason  err)

Converts a LinphoneReason enum to a string.

MS2_PUBLIC void linphone_core_set_log_handler ( OrtpLogFunc  logfunc)

Define a log handler.

Parameters
logfuncThe function pointer of the log handler.
MS2_PUBLIC void linphone_core_set_log_file ( FILE *  file)

Define a log file.

If the file pointer passed as an argument is NULL, stdout is used instead.

Parameters
fileA pointer to the FILE structure of the file to write to.
MS2_PUBLIC void linphone_core_set_log_level ( OrtpLogLevel  loglevel)

Define the log level.

The loglevel parameter is a bitmask parameter. Therefore to enable only warning and error messages, use ORTP_WARNING | ORTP_ERROR. To disable logs, simply set loglevel to 0.

Parameters
loglevelA bitmask of the log levels to set.
LINPHONE_PUBLIC 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
LINPHONE_PUBLIC 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
MS2_PUBLIC LpConfig* lp_config_new ( const char *  filename)

Instantiates a LpConfig object from a user config file.

Parameters
filenamethe filename of the config file to read to fill the instantiated LpConfig
See Also
lp_config_new_with_factory
MS2_PUBLIC LpConfig* lp_config_new_with_factory ( const char *  config_filename,
const char *  factory_config_filename 
)

Instantiates a LpConfig object from a user config file and a factory config file.

Parameters
config_filenamethe filename of the user config file to read to fill the instantiated LpConfig
factory_config_filenamethe filename of the factory config file to read to fill the instantiated LpConfig
See Also
lp_config_new

The user config file is read first to fill the LpConfig and then the factory config file is read. Therefore the configuration parameters defined in the user config file will be overwritten by the parameters defined in the factory config file.

MS2_PUBLIC 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.

MS2_PUBLIC 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.
MS2_PUBLIC 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.

MS2_PUBLIC 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.

MS2_PUBLIC 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.

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

Sets a string config item

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

Sets a range config item

MS2_PUBLIC 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

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

Sets a 64 bits integer config item

MS2_PUBLIC 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.