Liblinphone  5.3.0
Typedefs | Enumerations | Functions
Call logs

Managing call logs. More...

Typedefs

typedef enum _LinphoneCallDir LinphoneCallDir
 Enum representing the direction of a call.
 
typedef enum _LinphoneCallStatus LinphoneCallStatus
 Enum representing the status of a call.
 
typedef struct _LinphoneCallLog LinphoneCallLog
 Object used to keep track of all calls initiated, received or missed. More...
 

Enumerations

enum  _LinphoneCallDir {
  LinphoneCallOutgoing = 0,
  LinphoneCallIncoming = 1
}
 Enum representing the direction of a call. More...
 
enum  _LinphoneCallStatus {
  LinphoneCallSuccess = 0,
  LinphoneCallAborted = 1,
  LinphoneCallMissed = 2,
  LinphoneCallDeclined = 3,
  LinphoneCallEarlyAborted,
  LinphoneCallAcceptedElsewhere = 5,
  LinphoneCallDeclinedElsewhere = 6
}
 Enum representing the status of a call. More...
 

Functions

const bctbx_list_t * linphone_core_get_call_logs (LinphoneCore *core)
 Get the list of call logs (past calls). More...
 
bctbx_list_t * linphone_core_get_call_history_2 (LinphoneCore *core, const LinphoneAddress *peer_address, const LinphoneAddress *local_address)
 Get the list of call logs (past calls). More...
 
LinphoneCallLoglinphone_core_get_last_outgoing_call_log (LinphoneCore *core)
 Get the latest outgoing call log. More...
 
LinphoneCallLoglinphone_core_find_call_log_from_call_id (LinphoneCore *core, const char *call_id)
 Get the call log matching the call id, or NULL if can't be found. More...
 
LinphoneCallLoglinphone_core_find_call_log (LinphoneCore *lc, const char *call_id, int limit)
 Get the call log matching the call id, or NULL if can't be found. More...
 
void linphone_core_clear_call_logs (LinphoneCore *core)
 Erase the call log. More...
 
int linphone_core_get_missed_calls_count (LinphoneCore *core)
 Get the number of missed calls. More...
 
void linphone_core_reset_missed_calls_count (LinphoneCore *core)
 Reset the counter of missed calls. More...
 
void linphone_core_remove_call_log (LinphoneCore *core, LinphoneCallLog *call_log)
 Remove a specific call log from call history list. More...
 
LinphoneCallLoglinphone_call_log_ref (LinphoneCallLog *call_log)
 Acquire a reference to the call log. More...
 
void linphone_call_log_unref (LinphoneCallLog *call_log)
 Release a reference to the call log. More...
 
const char * linphone_call_log_get_call_id (const LinphoneCallLog *call_log)
 Get the call ID used by the call. More...
 
LinphoneCallDir linphone_call_log_get_dir (const LinphoneCallLog *call_log)
 Get the direction of the call. More...
 
int linphone_call_log_get_duration (const LinphoneCallLog *call_log)
 Get the duration of the call since connected. More...
 
const LinphoneAddresslinphone_call_log_get_from_address (const LinphoneCallLog *call_log)
 Get the origin address (ie from) of the call. More...
 
float linphone_call_log_get_quality (const LinphoneCallLog *call_log)
 Get the overall quality indication of the call. More...
 
const char * linphone_call_log_get_ref_key (const LinphoneCallLog *call_log)
 Get the persistent reference key associated to the call log. More...
 
const LinphoneAddresslinphone_call_log_get_local_address (const LinphoneCallLog *call_log)
 Get the local address (that is from or to depending on call direction) More...
 
const LinphoneAddresslinphone_call_log_get_remote_address (const LinphoneCallLog *call_log)
 Get the remote address (that is from or to depending on call direction). More...
 
void linphone_call_log_set_remote_address (LinphoneCallLog *call_log, LinphoneAddress *address)
 Set the remote address (that is 'from' or 'to' depending on call direction). More...
 
time_t linphone_call_log_get_start_date (const LinphoneCallLog *call_log)
 Get the start date of the call. More...
 
LinphoneCallStatus linphone_call_log_get_status (const LinphoneCallLog *call_log)
 Get the status of the call. More...
 
const LinphoneAddresslinphone_call_log_get_to_address (const LinphoneCallLog *call_log)
 Get the destination address (ie to) of the call. More...
 
void linphone_call_log_set_ref_key (LinphoneCallLog *call_log, const char *refkey)
 Associate a persistent reference key to the call log. More...
 
bool_t linphone_call_log_video_enabled (const LinphoneCallLog *call_log)
 Tell whether video was enabled at the end of the call or not. More...
 
char * linphone_call_log_to_str (const LinphoneCallLog *call_log)
 Get a human readable string describing the call. More...
 
bool_t linphone_call_log_was_conference (LinphoneCallLog *call_log)
 Tells whether that call was part of a conference. More...
 
const LinphoneErrorInfolinphone_call_log_get_error_info (const LinphoneCallLog *call_log)
 When the call was failed, return an object describing the failure. More...
 
void * linphone_call_log_get_user_data (const LinphoneCallLog *call_log)
 Get the user data associated with the call log. More...
 
void linphone_call_log_set_user_data (LinphoneCallLog *call_log, void *user_data)
 Assign a user data to the call log. More...
 
LinphoneConferenceInfolinphone_call_log_get_conference_info (LinphoneCallLog *call_log)
 Retrieves the conference info associated to this call log in DB. More...
 
LinphoneCallLoglinphone_core_create_call_log (LinphoneCore *core, LinphoneAddress *from, LinphoneAddress *to, LinphoneCallDir dir, int duration, time_t start_time, time_t connected_time, LinphoneCallStatus status, bool_t video_enabled, float quality)
 Creates a fake LinphoneCallLog. More...
 

Detailed Description

Managing call logs.

Typedef Documentation

◆ LinphoneCallLog

typedef struct _LinphoneCallLog LinphoneCallLog

Object used to keep track of all calls initiated, received or missed.

It contains the call ID, date & time at which the call took place and it's duration (0 if it wasn't answered). You can also know if video was enabled or not or if it was a conference, as well as it's average quality.

If needed, you can also create a fake LinphoneCallLog using linphone_core_create_call_log(), otherwise use linphone_core_get_call_logs() or even linphone_call_get_call_log() to get the log of an ongoing call.

Enumeration Type Documentation

◆ _LinphoneCallDir

Enum representing the direction of a call.

Enumerator
LinphoneCallOutgoing 

outgoing calls

LinphoneCallIncoming 

incoming calls

◆ _LinphoneCallStatus

Enum representing the status of a call.

Enumerator
LinphoneCallSuccess 

The call was sucessful.

LinphoneCallAborted 

The call was aborted (caller hanged up)

LinphoneCallMissed 

The call was missed (incoming call timed out without being answered or hanged up)

LinphoneCallDeclined 

The call was declined, either locally or by remote end.

LinphoneCallEarlyAborted 

The call was aborted before being advertised to the application - for protocol reasons.

LinphoneCallAcceptedElsewhere 

The call was answered on another device.

LinphoneCallDeclinedElsewhere 

The call was declined on another device.

Function Documentation

◆ linphone_call_log_get_call_id()

const char* linphone_call_log_get_call_id ( const LinphoneCallLog call_log)

Get the call ID used by the call.

Parameters
call_logLinphoneCallLog object
Returns
The call ID used by the call as a string.

◆ linphone_call_log_get_conference_info()

LinphoneConferenceInfo* linphone_call_log_get_conference_info ( LinphoneCallLog call_log)

Retrieves the conference info associated to this call log in DB.

Parameters
call_logLinphoneCallLog object.
Returns
The LinphoneConferenceInfo associated.

◆ linphone_call_log_get_dir()

LinphoneCallDir linphone_call_log_get_dir ( const LinphoneCallLog call_log)

Get the direction of the call.

Parameters
call_logLinphoneCallLog object
Returns
The LinphoneCallDir of the call.

◆ linphone_call_log_get_duration()

int linphone_call_log_get_duration ( const LinphoneCallLog call_log)

Get the duration of the call since connected.

Parameters
call_logLinphoneCallLog object
Returns
The duration of the call in seconds.

◆ linphone_call_log_get_error_info()

const LinphoneErrorInfo* linphone_call_log_get_error_info ( const LinphoneCallLog call_log)

When the call was failed, return an object describing the failure.

Parameters
call_logLinphoneCallLog object
Returns
LinphoneErrorInfo about the error encountered by the call associated with this call log or NULL.

◆ linphone_call_log_get_from_address()

const LinphoneAddress* linphone_call_log_get_from_address ( const LinphoneCallLog call_log)

Get the origin address (ie from) of the call.

Parameters
call_logLinphoneCallLog object
Returns
The origin LinphoneAddress (ie from) of the call.

◆ linphone_call_log_get_local_address()

const LinphoneAddress* linphone_call_log_get_local_address ( const LinphoneCallLog call_log)

Get the local address (that is from or to depending on call direction)

Parameters
call_logLinphoneCallLog object
Returns
The local LinphoneAddress of the call

◆ linphone_call_log_get_quality()

float linphone_call_log_get_quality ( const LinphoneCallLog call_log)

Get the overall quality indication of the call.

Parameters
call_logLinphoneCallLog object
Returns
The overall quality indication of the call.

◆ linphone_call_log_get_ref_key()

const char* linphone_call_log_get_ref_key ( const LinphoneCallLog call_log)

Get the persistent reference key associated to the call log.

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
call_logLinphoneCallLog object
Returns
The reference key string that has been associated to the call log, or NULL if none has been associated.

◆ linphone_call_log_get_remote_address()

const LinphoneAddress* linphone_call_log_get_remote_address ( const LinphoneCallLog call_log)

Get the remote address (that is from or to depending on call direction).

Parameters
call_logLinphoneCallLog object
Returns
The remote LinphoneAddress of the call.

◆ linphone_call_log_get_start_date()

time_t linphone_call_log_get_start_date ( const LinphoneCallLog call_log)

Get the start date of the call.

Parameters
call_logLinphoneCallLog object
Returns
The date of the beginning of the call.

◆ linphone_call_log_get_status()

LinphoneCallStatus linphone_call_log_get_status ( const LinphoneCallLog call_log)

Get the status of the call.

Parameters
call_logLinphoneCallLog object
Returns
The LinphoneCallStatus of the call.

◆ linphone_call_log_get_to_address()

const LinphoneAddress* linphone_call_log_get_to_address ( const LinphoneCallLog call_log)

Get the destination address (ie to) of the call.

Parameters
call_logLinphoneCallLog object
Returns
The destination LinphoneAddress (ie to) of the call.

◆ linphone_call_log_get_user_data()

void* linphone_call_log_get_user_data ( const LinphoneCallLog call_log)

Get the user data associated with the call log.

Parameters
call_logLinphoneCallLog object
Returns
The user data associated with the call log.

◆ linphone_call_log_ref()

LinphoneCallLog* linphone_call_log_ref ( LinphoneCallLog call_log)

Acquire a reference to the call log.

Parameters
call_logLinphoneCallLog object
Returns
The same LinphoneCallLog object

◆ linphone_call_log_set_ref_key()

void linphone_call_log_set_ref_key ( LinphoneCallLog call_log,
const char *  refkey 
)

Associate a persistent reference key to the call log.

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
call_logLinphoneCallLog object
refkeyThe reference key string to associate to the call log.

◆ linphone_call_log_set_remote_address()

void linphone_call_log_set_remote_address ( LinphoneCallLog call_log,
LinphoneAddress address 
)

Set the remote address (that is 'from' or 'to' depending on call direction).

It allows to fill more information that the SDK doesn't have. A use case can be to fill the display name (coming from an external address book) into a call log on incoming call. When the call end, the database will take account of the new information and can be used later

Parameters
call_logLinphoneCallLog object
addressLinphoneAddress object

◆ linphone_call_log_set_user_data()

void linphone_call_log_set_user_data ( LinphoneCallLog call_log,
void *  user_data 
)

Assign a user data to the call log.

Parameters
call_logLinphoneCallLog object
user_dataThe user data to associate with the call log.

◆ linphone_call_log_to_str()

char* linphone_call_log_to_str ( const LinphoneCallLog call_log)

Get a human readable string describing the call.

Note
: the returned string must be freed by the application (use ms_free()).
Parameters
call_logLinphoneCallLog object
Returns
A human readable string describing the call.

◆ linphone_call_log_unref()

void linphone_call_log_unref ( LinphoneCallLog call_log)

Release a reference to the call log.

Parameters
call_logLinphoneCallLog object

◆ linphone_call_log_video_enabled()

bool_t linphone_call_log_video_enabled ( const LinphoneCallLog call_log)

Tell whether video was enabled at the end of the call or not.

Parameters
call_logLinphoneCallLog object
Returns
A boolean value telling whether video was enabled at the end of the call.

◆ linphone_call_log_was_conference()

bool_t linphone_call_log_was_conference ( LinphoneCallLog call_log)

Tells whether that call was part of a conference.

Parameters
call_logLinphoneCallLog object
Returns
TRUE if the call was part of a conference, FALSE otherwise.

◆ linphone_core_clear_call_logs()

void linphone_core_clear_call_logs ( LinphoneCore core)

Erase the call log.

Parameters
coreLinphoneCore object

◆ linphone_core_create_call_log()

LinphoneCallLog* linphone_core_create_call_log ( LinphoneCore core,
LinphoneAddress from,
LinphoneAddress to,
LinphoneCallDir  dir,
int  duration,
time_t  start_time,
time_t  connected_time,
LinphoneCallStatus  status,
bool_t  video_enabled,
float  quality 
)

Creates a fake LinphoneCallLog.

Parameters
coreLinphoneCore object
fromLinphoneAddress of caller
toLinphoneAddress of callee
dirLinphoneCallDir of call
durationcall length in seconds
start_timetimestamp of call start time
connected_timetimestamp of call connection
statusLinphoneCallStatus of call
video_enabledwhether video was enabled or not for this call
qualitycall quality
Returns
a LinphoneCallLog object

◆ linphone_core_find_call_log()

LinphoneCallLog* linphone_core_find_call_log ( LinphoneCore lc,
const char *  call_id,
int  limit 
)

Get the call log matching the call id, or NULL if can't be found.

Parameters
coreLinphoneCore object
call_idCall id of the call log to find
limitSearch limit of the most recent call logs to find
Returns
A call log matching the call id if any.

◆ linphone_core_find_call_log_from_call_id()

LinphoneCallLog* linphone_core_find_call_log_from_call_id ( LinphoneCore core,
const char *  call_id 
)

Get the call log matching the call id, or NULL if can't be found.

Parameters
coreLinphoneCore object
call_idCall id of the call log to find
Returns
A call log matching the call id if any.

◆ linphone_core_get_call_history_2()

bctbx_list_t* linphone_core_get_call_history_2 ( LinphoneCore core,
const LinphoneAddress peer_address,
const LinphoneAddress local_address 
)

Get the list of call logs (past calls).

At the contrary of linphone_core_get_call_logs, it is your responsibility to unref the logs and free this list once you are done using it. Requires ENABLE_DB_STORAGE to work.

Parameters
coreLinphoneCore object.
peer_addressThe remote LinphoneAddress object.
local_addressThe local LinphoneAddress object
Returns
A list of LinphoneCallLog.

◆ linphone_core_get_call_logs()

const bctbx_list_t* linphone_core_get_call_logs ( LinphoneCore core)

Get the list of call logs (past calls).

Parameters
coreLinphoneCore object
Returns
A list of LinphoneCallLog.

◆ linphone_core_get_last_outgoing_call_log()

LinphoneCallLog* linphone_core_get_last_outgoing_call_log ( LinphoneCore core)

Get the latest outgoing call log.

Conference calls are not returned by this function! Requires ENABLE_DB_STORAGE to work.

Parameters
coreLinphoneCore object
Returns
The last outgoing call log if any.

◆ linphone_core_get_missed_calls_count()

int linphone_core_get_missed_calls_count ( LinphoneCore core)

Get the number of missed calls.

Once checked, this counter can be reset with linphone_core_reset_missed_calls_count().

Parameters
coreLinphoneCore object.
Returns
The number of missed calls.

◆ linphone_core_remove_call_log()

void linphone_core_remove_call_log ( LinphoneCore core,
LinphoneCallLog call_log 
)

Remove a specific call log from call history list.

This function destroys the call log object. It must not be accessed anymore by the application after calling this function.

Parameters
coreLinphoneCore object
call_logLinphoneCallLog object to remove.

◆ linphone_core_reset_missed_calls_count()

void linphone_core_reset_missed_calls_count ( LinphoneCore core)

Reset the counter of missed calls.

Parameters
coreLinphoneCore object.