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

Data Structures

struct  _LinphoneContentPrivate

Defines

#define LINPHONE_CONTENT(lcp)   linphone_content_private_to_linphone_content(lcp)
#define LINPHONE_CONTENT_PRIVATE(lc)   linphone_content_to_linphone_content_private(lc)

Typedefs

typedef struct _LinphoneBuffer LinphoneBuffer
typedef struct _LinphoneContent LinphoneContent
typedef struct
_LinphoneContentPrivate 
LinphoneContentPrivate
typedef enum _LinphoneReason LinphoneReason
typedef struct _LinphoneErrorInfo LinphoneErrorInfo
typedef struct _LpConfig LpConfig

Enumerations

enum  _LinphoneReason { ,
  LinphoneReasonNoResponse,
  LinphoneReasonForbidden,
  LinphoneReasonDeclined,
  LinphoneReasonNotFound,
  LinphoneReasonNotAnswered,
  LinphoneReasonBusy,
  LinphoneReasonUnsupportedContent,
  LinphoneReasonIOError,
  LinphoneReasonDoNotDisturb,
  LinphoneReasonUnauthorized,
  LinphoneReasonNotAcceptable,
  LinphoneReasonNoMatch,
  LinphoneReasonMovedPermanently,
  LinphoneReasonGone,
  LinphoneReasonTemporarilyUnavailable,
  LinphoneReasonAddressIncomplete,
  LinphoneReasonNotImplemented,
  LinphoneReasonBadGateway,
  LinphoneReasonServerTimeout,
  LinphoneReasonUnknown
}

Functions

LinphoneBufferlinphone_buffer_new (void)
LinphoneBufferlinphone_buffer_new_from_data (const uint8_t *data, size_t size)
LinphoneBufferlinphone_buffer_new_from_string (const char *data)
LinphoneBufferlinphone_buffer_ref (LinphoneBuffer *buffer)
void linphone_buffer_unref (LinphoneBuffer *buffer)
void * linphone_buffer_get_user_data (const LinphoneBuffer *buffer)
void linphone_buffer_set_user_data (LinphoneBuffer *buffer, void *ud)
const uint8_t * linphone_buffer_get_content (const LinphoneBuffer *buffer)
void linphone_buffer_set_content (LinphoneBuffer *buffer, const uint8_t *content, size_t size)
const char * linphone_buffer_get_string_content (const LinphoneBuffer *buffer)
void linphone_buffer_set_string_content (LinphoneBuffer *buffer, const char *content)
size_t linphone_buffer_get_size (const LinphoneBuffer *buffer)
void linphone_buffer_set_size (LinphoneBuffer *buffer, size_t size)
bool_t linphone_buffer_is_empty (const LinphoneBuffer *buffer)
LinphoneContentlinphone_content_private_to_linphone_content (const LinphoneContentPrivate *lcp)
LinphoneContentPrivatelinphone_content_to_linphone_content_private (const LinphoneContent *content)
LinphoneContentlinphone_core_create_content (LinphoneCore *lc)
LinphoneContentlinphone_content_ref (LinphoneContent *content)
void linphone_content_unref (LinphoneContent *content)
void * linphone_content_get_user_data (const LinphoneContent *content)
void linphone_content_set_user_data (LinphoneContent *content, void *ud)
const char * linphone_content_get_type (const LinphoneContent *content)
void linphone_content_set_type (LinphoneContent *content, const char *type)
const char * linphone_content_get_subtype (const LinphoneContent *content)
void linphone_content_set_subtype (LinphoneContent *content, const char *subtype)
void * linphone_content_get_buffer (const LinphoneContent *content)
void linphone_content_set_buffer (LinphoneContent *content, const void *buffer, size_t size)
const char * linphone_content_get_string_buffer (const LinphoneContent *content)
void linphone_content_set_string_buffer (LinphoneContent *content, const char *buffer)
size_t linphone_content_get_size (const LinphoneContent *content)
void linphone_content_set_size (LinphoneContent *content, size_t size)
const char * linphone_content_get_encoding (const LinphoneContent *content)
void linphone_content_set_encoding (LinphoneContent *content, const char *encoding)
const char * linphone_content_get_name (const LinphoneContent *content)
void linphone_content_set_name (LinphoneContent *content, const char *name)
LinphoneDictionary * lp_config_section_to_dict (const LpConfig *lpconfig, const char *section)
void lp_config_load_dict_to_section (LpConfig *lpconfig, const char *section, const LinphoneDictionary *dict)
void linphone_core_enable_logs (FILE *file)
void linphone_core_enable_logs_with_cb (OrtpLogFunc logfunc)
void linphone_core_disable_logs (void)
const char * linphone_core_get_version (void)
void linphone_core_set_user_agent (LinphoneCore *lc, const char *name, const char *ver)
int linphone_core_play_local (LinphoneCore *lc, const char *audiofile)
LpConfiglinphone_core_get_config (LinphoneCore *lc)
const char * linphone_reason_to_string (LinphoneReason err)
LinphoneLogCollectionState linphone_core_log_collection_enabled (void)
void linphone_core_enable_log_collection (LinphoneLogCollectionState state)
const char * linphone_core_get_log_collection_path (void)
void linphone_core_set_log_collection_path (const char *path)
const char * linphone_core_get_log_collection_prefix (void)
void linphone_core_set_log_collection_prefix (const char *prefix)
int linphone_core_get_log_collection_max_file_size (void)
void linphone_core_set_log_collection_max_file_size (int size)
void linphone_core_set_log_collection_upload_server_url (LinphoneCore *core, const char *server_url)
void linphone_core_upload_log_collection (LinphoneCore *core)
char * linphone_core_compress_log_collection ()
void linphone_core_reset_log_collection ()
void linphone_core_set_log_handler (OrtpLogFunc logfunc)
void linphone_core_set_log_file (FILE *file)
void linphone_core_set_log_level (OrtpLogLevel loglevel)
void linphone_core_serialize_logs (void)
LpConfiglinphone_core_create_lp_config (LinphoneCore *lc, const char *filename)
void linphone_core_set_file_transfer_server (LinphoneCore *core, const char *server_url)
const char * linphone_core_get_file_transfer_server (LinphoneCore *core)
int linphone_dial_plan_lookup_ccc_from_iso (const char *iso)
int linphone_dial_plan_lookup_ccc_from_e164 (const char *e164)
LpConfiglp_config_new (const char *filename)
LpConfiglp_config_new_from_buffer (const char *buffer)
LpConfiglp_config_new_with_factory (const char *config_filename, const char *factory_config_filename)
int lp_config_read_file (LpConfig *lpconfig, const char *filename)
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)
int lp_config_get_default_int (const LpConfig *lpconfig, const char *section, const char *key, int default_value)
int64_t lp_config_get_default_int64 (const LpConfig *lpconfig, const char *section, const char *key, int64_t default_value)
float lp_config_get_default_float (const LpConfig *lpconfig, const char *section, const char *key, float default_value)
const char * lp_config_get_default_string (const LpConfig *lpconfig, const char *section, const char *key, const char *default_value)
const char * lp_config_get_section_param_string (const LpConfig *lpconfig, const char *section, const char *key, const char *default_value)
LpConfiglp_config_ref (LpConfig *lpconfig)
void lp_config_unref (LpConfig *lpconfig)
LinphoneReason linphone_error_info_get_reason (const LinphoneErrorInfo *ei)
const char * linphone_error_info_get_phrase (const LinphoneErrorInfo *ei)
const char * linphone_error_info_get_details (const LinphoneErrorInfo *ei)
int linphone_error_info_get_protocol_code (const LinphoneErrorInfo *ei)
void linphone_core_set_call_error_tone (LinphoneCore *lc, LinphoneReason reason, const char *audiofile)

Define Documentation

Convert a LinphoneContentPrivate structure to a LinphoneContent object.

Deprecated:
Utility macro to ease porting existing code from LinphoneContentPrivate structure (old LinphoneContent structure) to new LinphoneContent object.

Convert a LinphoneContent object to a LinphoneContentPrivate structure.

Deprecated:
Utility macro to ease porting existing code from LinphoneContentPrivate structure (old LinphoneContent structure) to new LinphoneContent object.

Typedef Documentation

typedef struct _LinphoneBuffer LinphoneBuffer

The LinphoneContent object representing a data buffer.

typedef struct _LinphoneContent LinphoneContent

The LinphoneContent object holds data that can be embedded in a signaling message.

Alias to the LinphoneContentPrivate struct.

Deprecated:

Enum describing failure reasons.

typedef struct _LinphoneErrorInfo LinphoneErrorInfo

Object representing full details about a signaling error or status. All LinphoneErrorInfo object returned by the liblinphone API are readonly and transcients. For safety they must be used immediately after obtaining them. Any other function call to the liblinphone may change their content or invalidate the pointer.

typedef struct _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 various failure reasons or contextual information for some events.

See also:
linphone_call_get_reason()
linphone_proxy_config_get_error()
linphone_error_info_get_reason()
Enumerator:
LinphoneReasonNoResponse 

No response received from remote

LinphoneReasonForbidden 

Authentication failed due to bad credentials or resource forbidden

LinphoneReasonDeclined 

The call has been declined

LinphoneReasonNotFound 

Destination of the call was not found.

LinphoneReasonNotAnswered 

The call was not answered in time (request timeout)

LinphoneReasonBusy 

Phone line was busy

LinphoneReasonUnsupportedContent 

Unsupported content

LinphoneReasonIOError 

Transport error: connection failures, disconnections etc...

LinphoneReasonDoNotDisturb 

Do not disturb reason

LinphoneReasonUnauthorized 

Operation is unauthorized because missing credential

LinphoneReasonNotAcceptable 

Operation like call update rejected by peer

LinphoneReasonNoMatch 

Operation could not be executed by server or remote client because it didn't have any context for it

LinphoneReasonMovedPermanently 

Resource moved permanently

LinphoneReasonGone 

Resource no longer exists

LinphoneReasonTemporarilyUnavailable 

Temporarily unavailable

LinphoneReasonAddressIncomplete 

Address incomplete

LinphoneReasonNotImplemented 

Not implemented

LinphoneReasonBadGateway 

Bad gateway

LinphoneReasonServerTimeout 

Server timeout

LinphoneReasonUnknown 

Unknown reason


Function Documentation

Create a new empty LinphoneBuffer object.

Returns:
A new LinphoneBuffer object.
LinphoneBuffer* linphone_buffer_new_from_data ( const uint8_t *  data,
size_t  size 
)

Create a new LinphoneBuffer object from existing data.

Parameters:
[in]dataThe initial data to store in the LinphoneBuffer.
[in]sizeThe size of the initial data to stroe in the LinphoneBuffer.
Returns:
A new LinphoneBuffer object.

Create a new LinphoneBuffer object from a string.

Parameters:
[in]dataThe initial string content of the LinphoneBuffer.
Returns:
A new LinphoneBuffer object.

Acquire a reference to the buffer.

Parameters:
[in]bufferLinphoneBuffer object.
Returns:
The same LinphoneBuffer object.

Release reference to the buffer.

Parameters:
[in]bufferLinphoneBuffer object.
void* linphone_buffer_get_user_data ( const LinphoneBuffer buffer)

Retrieve the user pointer associated with the buffer.

Parameters:
[in]bufferLinphoneBuffer object.
Returns:
The user pointer associated with the buffer.
void linphone_buffer_set_user_data ( LinphoneBuffer buffer,
void *  ud 
)

Assign a user pointer to the buffer.

Parameters:
[in]bufferLinphoneBuffer object.
[in]udThe user pointer to associate with the buffer.
const uint8_t* linphone_buffer_get_content ( const LinphoneBuffer buffer)

Get the content of the data buffer.

Parameters:
[in]bufferLinphoneBuffer object.
Returns:
The content of the data buffer.
void linphone_buffer_set_content ( LinphoneBuffer buffer,
const uint8_t *  content,
size_t  size 
)

Set the content of the data buffer.

Parameters:
[in]bufferLinphoneBuffer object.
[in]contentThe content of the data buffer.
[in]sizeThe size of the content of the data buffer.
const char* linphone_buffer_get_string_content ( const LinphoneBuffer buffer)

Get the string content of the data buffer.

Parameters:
[in]bufferLinphoneBuffer object
Returns:
The string content of the data buffer.
void linphone_buffer_set_string_content ( LinphoneBuffer buffer,
const char *  content 
)

Set the string content of the data buffer.

Parameters:
[in]bufferLinphoneBuffer object.
[in]contentThe string content of the data buffer.
size_t linphone_buffer_get_size ( const LinphoneBuffer buffer)

Get the size of the content of the data buffer.

Parameters:
[in]bufferLinphoneBuffer object.
Returns:
The size of the content of the data buffer.
void linphone_buffer_set_size ( LinphoneBuffer buffer,
size_t  size 
)

Set the size of the content of the data buffer.

Parameters:
[in]bufferLinphoneBuffer object
[in]sizeThe size of the content of the data buffer.
bool_t linphone_buffer_is_empty ( const LinphoneBuffer buffer)

Tell whether the LinphoneBuffer is empty.

Parameters:
[in]bufferLinphoneBuffer object
Returns:
A boolean value telling whether the LinphoneBuffer is empty or not.

Convert a LinphoneContentPrivate structure to a LinphoneContent object.

Deprecated:
Utility function to ease porting existing code from LinphoneContentPrivate structure (old LinphoneContent structure) to new LinphoneContent object.

Convert a LinphoneContent object to a LinphoneContentPrivate structure.

Deprecated:
Utility function to ease porting existing code from LinphoneContentPrivate structure (old LinphoneContent structure) to new LinphoneContent object.

Create a content with default values from Linphone core.

Parameters:
[in]lcLinphoneCore object
Returns:
LinphoneContent object with default values set

Acquire a reference to the content.

Parameters:
[in]contentLinphoneContent object.
Returns:
The same LinphoneContent object.

Release reference to the content.

Parameters:
[in]contentLinphoneContent object.
void* linphone_content_get_user_data ( const LinphoneContent content)

Retrieve the user pointer associated with the content.

Parameters:
[in]contentLinphoneContent object.
Returns:
The user pointer associated with the content.
void linphone_content_set_user_data ( LinphoneContent content,
void *  ud 
)

Assign a user pointer to the content.

Parameters:
[in]contentLinphoneContent object.
[in]udThe user pointer to associate with the content.
const char* linphone_content_get_type ( const LinphoneContent content)

Get the mime type of the content data.

Parameters:
[in]contentLinphoneContent object.
Returns:
The mime type of the content data, for example "application".
void linphone_content_set_type ( LinphoneContent content,
const char *  type 
)

Set the mime type of the content data.

Parameters:
[in]contentLinphoneContent object.
[in]typeThe mime type of the content data, for example "application".
const char* linphone_content_get_subtype ( const LinphoneContent content)

Get the mime subtype of the content data.

Parameters:
[in]contentLinphoneContent object.
Returns:
The mime subtype of the content data, for example "html".
void linphone_content_set_subtype ( LinphoneContent content,
const char *  subtype 
)

Set the mime subtype of the content data.

Parameters:
[in]contentLinphoneContent object.
[in]subtypeThe mime subtype of the content data, for example "html".
void* linphone_content_get_buffer ( const LinphoneContent content)

Get the content data buffer, usually a string.

Parameters:
[in]contentLinphoneContent object.
Returns:
The content data buffer.
void linphone_content_set_buffer ( LinphoneContent content,
const void *  buffer,
size_t  size 
)

Set the content data buffer, usually a string.

Parameters:
[in]contentLinphoneContent object.
[in]bufferThe content data buffer.
[in]sizeThe size of the content data buffer.
const char* linphone_content_get_string_buffer ( const LinphoneContent content)

Get the string content data buffer.

Parameters:
[in]contentLinphoneContent object
Returns:
The string content data buffer.
void linphone_content_set_string_buffer ( LinphoneContent content,
const char *  buffer 
)

Set the string content data buffer.

Parameters:
[in]contentLinphoneContent object.
[in]bufferThe string content data buffer.
size_t linphone_content_get_size ( const LinphoneContent content)

Get the content data buffer size, excluding null character despite null character is always set for convenience.

Parameters:
[in]contentLinphoneContent object.
Returns:
The content data buffer size.
void linphone_content_set_size ( LinphoneContent content,
size_t  size 
)

Set the content data size, excluding null character despite null character is always set for convenience.

Parameters:
[in]contentLinphoneContent object
[in]sizeThe content data buffer size.
const char* linphone_content_get_encoding ( const LinphoneContent content)

Get the encoding of the data buffer, for example "gzip".

Parameters:
[in]contentLinphoneContent object.
Returns:
The encoding of the data buffer.
void linphone_content_set_encoding ( LinphoneContent content,
const char *  encoding 
)

Set the encoding of the data buffer, for example "gzip".

Parameters:
[in]contentLinphoneContent object.
[in]encodingThe encoding of the data buffer.
const char* linphone_content_get_name ( const LinphoneContent content)

Get the name associated with a RCS file transfer message. It is used to store the original filename of the file to be downloaded from server.

Parameters:
[in]contentLinphoneContent object.
Returns:
The name of the content.
void linphone_content_set_name ( LinphoneContent content,
const char *  name 
)

Set the name associated with a RCS file transfer message. It is used to store the original filename of the file to be downloaded from server.

Parameters:
[in]contentLinphoneContent object.
[in]nameThe name of the content.
LinphoneDictionary * lp_config_section_to_dict ( const LpConfig lpconfig,
const char *  section 
)

Converts a config section into a dictionary.

Returns:
a #LinphoneDictionary with all the keys from a section, or NULL if the section doesn't exist
void lp_config_load_dict_to_section ( LpConfig lpconfig,
const char *  section,
const LinphoneDictionary *  dict 
)

Loads a dictionary into a section of the lpconfig. If the section doesn't exist it is created. Overwrites existing keys, creates non-existing keys.

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.

int linphone_core_play_local ( LinphoneCore lc,
const char *  audiofile 
)

Plays an audio file to the local user. This function works at any time, during calls, or when no calls are running. It doesn't request the underlying audio system to support multiple playback streams.

Parameters:
lcthe linphone core
audiofilepath to audio file in wav PCM 16 bit format.

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.

Converts a LinphoneReason enum to a string.

LinphoneLogCollectionState linphone_core_log_collection_enabled ( void  )

Tells whether the linphone core log collection is enabled.

Returns:
The state of the linphone core log collection.
void linphone_core_enable_log_collection ( LinphoneLogCollectionState  state)

Enable the linphone core log collection to upload logs on a server.

Parameters:
[in]stateLinphoneLogCollectionState value telling whether to enable log collection or not.
const char* linphone_core_get_log_collection_path ( void  )

Get the path where the log files will be written for log collection.

Returns:
The path where the log files will be written.
void linphone_core_set_log_collection_path ( const char *  path)

Set the path where the log files will be written for log collection.

Parameters:
[in]pathThe path where the log files will be written.

Get the prefix of the filenames that will be used for log collection.

Returns:
The prefix of the filenames used for log collection.
void linphone_core_set_log_collection_prefix ( const char *  prefix)

Set the prefix of the filenames that will be used for log collection.

Parameters:
[in]prefixThe prefix to use for the filenames for log collection.

Get the max file size in bytes of the files used for log collection.

Returns:
The max file size in bytes of the files used for log collection.

Set the max file size in bytes of the files used for log collection. Warning: this function should only not be used to change size dynamically but instead only before calling

See also:
linphone_core_enable_log_collection. If you increase max size on runtime, logs chronological order COULD be broken.
Parameters:
[in]sizeThe max file size in bytes of the files used for log collection.
void linphone_core_set_log_collection_upload_server_url ( LinphoneCore core,
const char *  server_url 
)

Set the url of the server where to upload the collected log files.

Parameters:
[in]coreLinphoneCore object
[in]server_urlThe url of the server where to upload the collected log files.

Upload the log collection to the configured server url.

Parameters:
[in]coreLinphoneCore object

Compress the log collection in a single file.

Returns:
The path of the compressed log collection file (to be freed calling ms_free()).

Reset the log collection by removing the log files.

void linphone_core_set_log_handler ( OrtpLogFunc  logfunc)

Define a log handler.

Parameters:
logfuncThe function pointer of the log handler.
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.
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.

Enable logs serialization (output logs from either the thread that creates the linphone core or the thread that calls linphone_core_iterate()). Must be called before creating the linphone core.

LpConfig* linphone_core_create_lp_config ( LinphoneCore lc,
const char *  filename 
)

Create a LpConfig object from a user config file.

Parameters:
[in]lcLinphoneCore object
[in]filenameThe filename of the config file to read to fill the instantiated LpConfig
void linphone_core_set_file_transfer_server ( LinphoneCore core,
const char *  server_url 
)

Globaly set an http file transfer server to be used for content type application/vnd.gsma.rcs-ft-http+xml. This value can also be set for a dedicated account using linphone_proxy_config_set_file_transfer_server

Parameters:
[in]coreLinphoneCore to be modified
[in]server_urlURL of the file server like https://file.linphone.org/upload.php

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

Parameters:
[in]coreLinphoneCore from which to get the server_url
Returns:
URL of the file server like https://file.linphone.org/upload.php
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
LpConfig* lp_config_new ( const char *  filename)

Instantiates a LpConfig object from a user config file. The caller of this constructor owns a reference. lp_config_unref() must be called when this object is no longer needed.

Parameters:
filenamethe filename of the config file to read to fill the instantiated LpConfig
See also:
lp_config_new_with_factory
LpConfig* lp_config_new_from_buffer ( const char *  buffer)

Instantiates a LpConfig object from a user provided buffer. The caller of this constructor owns a reference. lp_config_unref() must be called when this object is no longer needed.

Parameters:
bufferthe buffer from which the lpconfig will be retrieved. We expect the buffer to be null-terminated.
See also:
lp_config_new_with_factory
lp_config_new
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. The caller of this constructor owns a reference. lp_config_unref() must be called when this object is no longer needed.

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.

int lp_config_read_file ( LpConfig lpconfig,
const char *  filename 
)

Reads a user config file and fill the LpConfig with the read config values.

Parameters:
lpconfigThe LpConfig object to fill with the content of the file
filenameThe filename of the config file to read to fill the LpConfig
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.

int lp_config_get_default_int ( const LpConfig lpconfig,
const char *  section,
const char *  key,
int  default_value 
)

Retrieves a default 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_default_int64 ( const LpConfig lpconfig,
const char *  section,
const char *  key,
int64_t  default_value 
)

Retrieves a default 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_default_float ( const LpConfig lpconfig,
const char *  section,
const char *  key,
float  default_value 
)

Retrieves a default 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.

const char* lp_config_get_default_string ( const LpConfig lpconfig,
const char *  section,
const char *  key,
const char *  default_value 
)

Retrieves a default 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.

const char* lp_config_get_section_param_string ( const LpConfig lpconfig,
const char *  section,
const char *  key,
const char *  default_value 
)

Retrieves a section parameter item as a string, given its section and key.

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

LpConfig* lp_config_ref ( LpConfig lpconfig)

increment reference count

void lp_config_unref ( LpConfig lpconfig)

Decrement reference count, which will eventually free the object.

Get reason code from the error info.

Parameters:
eithe error info.
Returns:
a LinphoneReason

Get textual phrase from the error info. This is the text that is provided by the peer in the protocol (SIP).

Parameters:
eithe error info.
Returns:
the error phrase

Provides additional information regarding the failure. With SIP protocol, the "Reason" and "Warning" headers are returned.

Parameters:
eithe error info.
Returns:
more details about the failure.

Get the status code from the low level protocol (ex a SIP status code).

Parameters:
eithe error info.
Returns:
the status code.
void linphone_core_set_call_error_tone ( LinphoneCore lc,
LinphoneReason  reason,
const char *  audiofile 
)

Assign an audio file to be played locally upon call failure, for a given reason.

Parameters:
lcthe core
reasonthe LinphoneReason representing the failure error code.
audiofilea wav file to be played when such call failure happens.