Liblinphone 5.3.0

Typedefs | Enumerations | Functions
Call logs

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

## 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).
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).
LinphoneCallLog * | linphone_core_get_last_outgoing_call_log (LinphoneCore *core)
| Get the latest outgoing call log.
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.
LinphoneCallLog * | linphone_core_find_call_log (LinphoneCore *core, const char *call_id, int limit)
| Get the call log matching the call id, or NULL if can't be found.
void | linphone_core_clear_call_logs (LinphoneCore *core)
| Erase the call log.
int | linphone_core_get_missed_calls_count (LinphoneCore *core)
| Get the number of missed calls.
void | linphone_core_reset_missed_calls_count (LinphoneCore *core)
| Reset the counter of missed calls.
void | linphone_core_remove_call_log (LinphoneCore *core, LinphoneCallLog *call_log)
| Remove a specific call log from call history list.
LinphoneCallLog * | linphone_call_log_ref (LinphoneCallLog *call_log)
| Acquire a reference to the call log.
void | linphone_call_log_unref (LinphoneCallLog *call_log)
| Release a reference to the call log.
const char * | linphone_call_log_get_call_id (const LinphoneCallLog *call_log)
| Get the call ID used by the call.
LinphoneCallDir | linphone_call_log_get_dir (const LinphoneCallLog *call_log)
| Get the direction of the call.
int | linphone_call_log_get_duration (const LinphoneCallLog *call_log)
| Get the duration of the call since connected.
const LinphoneAddress * | linphone_call_log_get_from_address (const LinphoneCallLog *call_log)
| Get the origin address (ie from) of the call.
float | linphone_call_log_get_quality (const LinphoneCallLog *call_log)
| Get the overall quality indication of the call.
const char * | linphone_call_log_get_ref_key (const LinphoneCallLog *call_log)
| Get the persistent reference key associated to the call log.
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)
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).
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).
time_t | linphone_call_log_get_start_date (const LinphoneCallLog *call_log)
| Get the start date of the call.
LinphoneCallStatus | linphone_call_log_get_status (const LinphoneCallLog *call_log)
| Get the status of the call.
const LinphoneAddress * | linphone_call_log_get_to_address (const LinphoneCallLog *call_log)
| Get the destination address (ie to) of the call.
void | linphone_call_log_set_ref_key (LinphoneCallLog *call_log, const char *refkey)
| Associate a persistent reference key to the call log.
bool_t | linphone_call_log_video_enabled (const LinphoneCallLog *call_log)
| Tell whether video was enabled at the end of the call or not.
char * | linphone_call_log_to_str (const LinphoneCallLog *call_log)
| Get a human readable string describing the call.
bool_t | linphone_call_log_was_conference (LinphoneCallLog *call_log)
| Tells whether that call was part of a conference.
const LinphoneErrorInfo * | linphone_call_log_get_error_info (const LinphoneCallLog *call_log)
| When the call was failed, return an object describing the failure.
void * | linphone_call_log_get_user_data (const LinphoneCallLog *call_log)
| Get the user data associated with the call log.
void | linphone_call_log_set_user_data (LinphoneCallLog *call_log, void *user_data)
| Assign a user data to the call log.
LinphoneConferenceInfo * | linphone_call_log_get_conference_info (LinphoneCallLog *call_log)
| Retrieves the conference info associated to this call log in DB.
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.

## 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 _LinphoneCallDir

Enum representing the direction of a call.

Enumerator
LinphoneCallOutgoing | outgoing calls
LinphoneCallIncoming | incoming calls

## ◆ _LinphoneCallStatus

enum _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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog object
  refkey | The 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_log | LinphoneCallLog object
  address | LinphoneAddress 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_log | LinphoneCallLog object
  user_data | The 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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_log | LinphoneCallLog 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

  core | LinphoneCore 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

  core | LinphoneCore object
  from | LinphoneAddress of caller
  to | LinphoneAddress of callee
  dir | LinphoneCallDir of call
  duration | call length in seconds
  start_time | timestamp of call start time
  connected_time | timestamp of call connection
  status | LinphoneCallStatus of call
  video_enabled | whether video was enabled or not for this call
  quality | call quality

Returns
  a LinphoneCallLog object

## ◆ linphone_core_find_call_log()

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

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

Parameters

  core | LinphoneCore object
  call_id | Call id of the call log to find
  limit | Search 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

  core | LinphoneCore object
  call_id | Call 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

  core | LinphoneCore object.
  peer_address | The remote LinphoneAddress object.
  local_address | The 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

  core | LinphoneCore 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

  core | LinphoneCore 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

  core | LinphoneCore 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

  core | LinphoneCore object
  call_log | LinphoneCallLog 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

  core | LinphoneCore object.