Liblinphone  5.3.0
Typedefs | Enumerations | Functions
Alert

Managing Alerts. More...

Typedefs

typedef void(* LinphoneCoreCbsNewAlertTriggeredCb) (LinphoneCore *core, LinphoneAlert *alert)
 Callback for notifying about an alert (e.g on Qos) More...
 
typedef void(* LinphoneAlertCbsTerminatedCb) (LinphoneAlert *alert)
 Callback to know if an alert stops. More...
 
typedef struct _LinphoneAlert LinphoneAlert
 Object that represents an alert. More...
 
typedef struct _LinphoneAlertCbs LinphoneAlertCbs
 Object that represents a callback attached to an alert.
 
typedef struct _LinphoneSignalInformation LinphoneSignalInformation
 Object to get signal (wifi/4G etc...) informations.
 
typedef enum _LinphoneAlertTypes LinphoneAlertType
 All kinds of alerts.
 

Enumerations

enum  _LinphoneAlertTypes {
  LinphoneAlertQoSCameraMisfunction,
  LinphoneAlertQoSCameraLowFramerate,
  LinphoneAlertQoSVideoStalled,
  LinphoneAlertQoSHighLossLateRate,
  LinphoneAlertQoSHighRemoteLossRate,
  LinphoneAlertQoSBurstOccured,
  LinphoneAlertQoSRetransmissionFailures,
  LinphoneAlertQoSLowDownloadBandwidthEstimation,
  LinphoneAlertQoSLowQualityReceivedVideo,
  LinphoneAlertQoSLowQualitySentVideo,
  LinphoneAlertQoSLowSignal,
  LinphoneAlertQoSLostSignal
}
 All kinds of alerts. More...
 

Functions

void linphone_core_cbs_set_new_alert_triggered (LinphoneCoreCbs *cbs, LinphoneCoreCbsNewAlertTriggeredCb alert_cb)
 Set the on alert callback. More...
 
LinphoneCoreCbsNewAlertTriggeredCb linphone_core_cbs_get_new_alert_triggered (LinphoneCoreCbs *cbs)
 Get the on alert callback. More...
 
void linphone_core_enable_alerts (LinphoneCore *core, bool_t enable)
 Enable alerts. More...
 
bool_t linphone_core_alerts_enabled (const LinphoneCore *core)
 Returns whether alert reporting is enabled. More...
 
LinphoneAlertCbslinphone_alert_cbs_ref (LinphoneAlertCbs *cbs)
 Acquire a reference to the alert callbacks object. More...
 
void linphone_alert_cbs_unref (LinphoneAlertCbs *cbs)
 Release reference to the alert callbacks object. More...
 
void * linphone_alert_cbs_get_user_data (const LinphoneAlertCbs *cbs)
 Retrieve the user pointer associated with the alert callbacks object. More...
 
void linphone_alert_cbs_set_user_data (LinphoneAlertCbs *cbs, void *user_data)
 Assign a user pointer to the alert callbacks object. More...
 
void linphone_alert_cbs_set_terminated (LinphoneAlertCbs *cbs, LinphoneAlertCbsTerminatedCb terminated)
 Assign a callback for when the alert is terminated. More...
 
LinphoneAlertCbsTerminatedCb linphone_alert_cbs_get_terminated (LinphoneAlertCbs *cbs)
 Get the callback for when the alert is terminated. More...
 
const char * linphone_alert_type_to_string (LinphoneAlertType type)
 Provide a string describing the alert type. More...
 
LinphoneAlertlinphone_alert_clone (const LinphoneAlert *alert)
 Clone the given alert. More...
 
LinphoneAlertlinphone_alert_ref (LinphoneAlert *alert)
 Take a reference on a LinphoneAlert. More...
 
void linphone_alert_unref (LinphoneAlert *alert)
 Release a LinphoneAlert. More...
 
time_t linphone_alert_get_start_time (const LinphoneAlert *alert)
 Return the start time of the alert. More...
 
time_t linphone_alert_get_end_time (const LinphoneAlert *alert)
 Return the end time of the alert. More...
 
LinphoneAlertType linphone_alert_get_type (const LinphoneAlert *alert)
 Return the type of the alert. More...
 
const LinphoneDictionarylinphone_alert_get_informations (const LinphoneAlert *alert)
 Return more informations about the alerts. More...
 
LinphoneCalllinphone_alert_get_call (const LinphoneAlert *alert)
 Return the call from the alert. More...
 
bool_t linphone_alert_get_state (const LinphoneAlert *alert)
 Return the state of the alert. More...
 
void linphone_alert_add_callbacks (LinphoneAlert *alert, LinphoneAlertCbs *cbs)
 Add a listener in order to be notified of LinphoneAlert events. More...
 
LinphoneAlertCbslinphone_alert_get_current_callbacks (const LinphoneAlert *alert)
 Gets the current LinphoneAlertCbs. More...
 
const bctbx_list_t * linphone_alert_get_callbacks_list (const LinphoneAlert *alert)
 Gets the list of listener in the alert. More...
 
void linphone_alert_remove_callbacks (LinphoneAlert *alert, LinphoneAlertCbs *cbs)
 Removes a LinphoneAlertCbs object associated to the LinphoneAlert. More...
 
void linphone_alert_notify_on_terminated (LinphoneAlert *alert)
 Notify the alert if it is terminated. More...
 

Detailed Description

Managing Alerts.

Typedef Documentation

◆ LinphoneAlert

typedef struct _LinphoneAlert LinphoneAlert

Object that represents an alert.

Alerts are raised at run-time when particular conditions are met, for example bad network quality. The full list of available alert types is described by the LinphoneAlertType enum. An application is notified of new alerts through the LinphoneCoreCbs interface. Once raised, the application may use the LinphoneAlertCbs interface to get notified when the alert stops. For each kind of alert, a LinphoneDictionary is filled with relevant informations, returned by linphone_alert_get_informations(). The keys available are documented per-type in LinphoneAlertType enum.

◆ LinphoneAlertCbsTerminatedCb

typedef void(* LinphoneAlertCbsTerminatedCb) (LinphoneAlert *alert)

Callback to know if an alert stops.

Parameters
alertthe alert that stops

◆ LinphoneCoreCbsNewAlertTriggeredCb

typedef void(* LinphoneCoreCbsNewAlertTriggeredCb) (LinphoneCore *core, LinphoneAlert *alert)

Callback for notifying about an alert (e.g on Qos)

Parameters
coreLinphoneCore object
alertLinphoneAlert to notify

Enumeration Type Documentation

◆ _LinphoneAlertTypes

All kinds of alerts.

Enumerator
LinphoneAlertQoSCameraMisfunction 

Camera is not working.

No other information

Note
Use the key "camera_misfunction_interval" in the section "alerts::camera" to set the interval at which the problem is checked in a LinphoneConfig.
LinphoneAlertQoSCameraLowFramerate 

Camera is capturing low framerate.

Information supplied : float framerate;

Note
Use the key "low_framerate_interval" in the section "alerts::camera" to set or get the interval at which the problem is checked in a LinphoneConfig.
LinphoneAlertQoSVideoStalled 

Video decoding has stopped for a given period (10 s by default).

No other information.

Note
Use the key "video_stalled_interval" in the section "alerts::camera" to set or get the interval at which the problem is checked in a LinphoneConfig.
LinphoneAlertQoSHighLossLateRate 

A received media stream suffers from high loss or late rate.

Information provided is:

  • loss-rate (float)
  • late-rate (float)
  • media-type (string) with values {audio, video, text}
    Note
    Use the key "loss_rate_interval" in the section "alerts::network" to set or get the interval at which the problem is checked in a LinphoneConfig.
LinphoneAlertQoSHighRemoteLossRate 

A report of high loss rate is received from remote party.

Information provided: loss-rate (float).

Note
Use the key "remote_loss_rate_interval" in the section "alerts::network" to set or get the interval at which the problem is checked in a LinphoneConfig.
LinphoneAlertQoSBurstOccured 

Packet Burst phenomenon.

Note
Use the key "burst_occured_interval" in the section "alerts::network" to set or get the interval at which the problem is checked in a LinphoneConfig.
LinphoneAlertQoSRetransmissionFailures 

Loss rate is significant but retransmissions fail to arrive on time.

Information provided: nack-performance (float) the fraction of lost packets recovered thanks to nack-triggered retransmissions.

Note
Use the key "nack_check_interval" in the section "alerts::network" to set or get the interval at which the problem is checked in a LinphoneConfig.
LinphoneAlertQoSLowDownloadBandwidthEstimation 

Low bandwidth detected.

Information provided: bandwidth (float) in kbit/s.

Note
Use the key "download_bandwidth_interval" in the section "alerts::video" to set or get the interval at which the problem is checked in a LinphoneConfig.
LinphoneAlertQoSLowQualityReceivedVideo 

Low quality (bitrate) video received.

Information provided: bitrate (float) in kbit/s, width (integer), int height (integer).

Note
Use the key "low_quality_received_interval" in the section "alerts::video" to set or get the interval at which the problem is checked in a LinphoneConfig.
LinphoneAlertQoSLowQualitySentVideo 

Low quality video is being sent.

Information provided: bitrate (float)in kbit/s, width (integer), height (integer).

Note
Use the key "quality_sent_interval" in the section "alerts::camera" to set or get the interval at which the problem is checked in a LinphoneConfig.
LinphoneAlertQoSLowSignal 

The operating system reports a low radio signal (wifi or mobile)

Note
Use the key "low_signal_interval" in the section "alerts::network" to set or get the interval at which the problem is checked in a LinphoneConfig.
LinphoneAlertQoSLostSignal 

The operating system reports a loss of radio signal (wifi or mobile).

Information provided: rssi-value (float), signal-type (string) with values {"wifi", "mobile", "other"}.

Note
Use the key "lost_signal_interval" in the section "alerts::network" to set or get the interval at which the problem is checked in a LinphoneConfig.

Function Documentation

◆ linphone_alert_add_callbacks()

void linphone_alert_add_callbacks ( LinphoneAlert alert,
LinphoneAlertCbs cbs 
)

Add a listener in order to be notified of LinphoneAlert events.

Parameters
alertThe LinphoneAlert object to monitor.
cbsA LinphoneAlertCbs object holding the callbacks you need.

◆ linphone_alert_cbs_get_terminated()

LinphoneAlertCbsTerminatedCb linphone_alert_cbs_get_terminated ( LinphoneAlertCbs cbs)

Get the callback for when the alert is terminated.

Parameters
cbsThe LinphoneAlertCbs object.
Returns
The #LinphoneAlertCbsOnTerminatedCb callback to execute.

◆ linphone_alert_cbs_get_user_data()

void* linphone_alert_cbs_get_user_data ( const LinphoneAlertCbs cbs)

Retrieve the user pointer associated with the alert callbacks object.

Parameters
cbsThe LinphoneAlertCbs object.
Returns
The user pointer associated with the alert callbacks object.

◆ linphone_alert_cbs_ref()

LinphoneAlertCbs* linphone_alert_cbs_ref ( LinphoneAlertCbs cbs)

Acquire a reference to the alert callbacks object.

Parameters
cbsThe LinphoneAlertCbs object.
Returns
The same alert callbacks object.

◆ linphone_alert_cbs_set_terminated()

void linphone_alert_cbs_set_terminated ( LinphoneAlertCbs cbs,
LinphoneAlertCbsTerminatedCb  terminated 
)

Assign a callback for when the alert is terminated.

Parameters
cbsThe LinphoneAlertCbs object.
on_terminatedThe #LinphoneAlertCbsOnTerminatedCb callback to execute.

◆ linphone_alert_cbs_set_user_data()

void linphone_alert_cbs_set_user_data ( LinphoneAlertCbs cbs,
void *  user_data 
)

Assign a user pointer to the alert callbacks object.

Parameters
cbsThe LinphoneAlertCbs object.
user_dataThe user pointer to associate with the alert callbacks object.

◆ linphone_alert_cbs_unref()

void linphone_alert_cbs_unref ( LinphoneAlertCbs cbs)

Release reference to the alert callbacks object.

Parameters
cbsThe LinphoneAlertCbs object.

◆ linphone_alert_clone()

LinphoneAlert* linphone_alert_clone ( const LinphoneAlert alert)

Clone the given alert.

Parameters
alertThe given alert.
Returns
A new alert with exactly same informations that param.

◆ linphone_alert_get_call()

LinphoneCall* linphone_alert_get_call ( const LinphoneAlert alert)

Return the call from the alert.

Parameters
alertThe given alert.
Returns
A LinphoneCall from the alert.

◆ linphone_alert_get_callbacks_list()

const bctbx_list_t* linphone_alert_get_callbacks_list ( const LinphoneAlert alert)

Gets the list of listener in the alert.

Parameters
alertLinphoneAlert object.
Returns
The list of LinphoneAlertCbs.

◆ linphone_alert_get_current_callbacks()

LinphoneAlertCbs* linphone_alert_get_current_callbacks ( const LinphoneAlert alert)

Gets the current LinphoneAlertCbs.

This is meant only to be called from a callback to be able to get the user_data associated with the LinphoneAlertCbs that is calling the callback.

Parameters
alertThe LinphoneAlert object.
Returns
The LinphoneAlertCbs that has called the last callback.

◆ linphone_alert_get_end_time()

time_t linphone_alert_get_end_time ( const LinphoneAlert alert)

Return the end time of the alert.

Parameters
alertThe given alert.
Returns
the end time of the alert.

◆ linphone_alert_get_informations()

const LinphoneDictionary* linphone_alert_get_informations ( const LinphoneAlert alert)

Return more informations about the alerts.

Parameters
alertThe given alert.
Returns
A LinphoneDictionary containing informations about the current alert.

◆ linphone_alert_get_start_time()

time_t linphone_alert_get_start_time ( const LinphoneAlert alert)

Return the start time of the alert.

Parameters
alertThe given alert.
Returns
the start time of the alert.

◆ linphone_alert_get_state()

bool_t linphone_alert_get_state ( const LinphoneAlert alert)

Return the state of the alert.

Parameters
alertThe given alert.
Returns
true if and only if the alert is active.

◆ linphone_alert_get_type()

LinphoneAlertType linphone_alert_get_type ( const LinphoneAlert alert)

Return the type of the alert.

Parameters
alertThe given alert.
Returns
A LinphoneAlertType corresponding to the current alert.

◆ linphone_alert_notify_on_terminated()

void linphone_alert_notify_on_terminated ( LinphoneAlert alert)

Notify the alert if it is terminated.

Parameters
alertThe given alert.

◆ linphone_alert_ref()

LinphoneAlert* linphone_alert_ref ( LinphoneAlert alert)

Take a reference on a LinphoneAlert.

Parameters
alertThe LinphoneAlert object.
Returns
the same LinphoneAlert object.

◆ linphone_alert_remove_callbacks()

void linphone_alert_remove_callbacks ( LinphoneAlert alert,
LinphoneAlertCbs cbs 
)

Removes a LinphoneAlertCbs object associated to the LinphoneAlert.

Parameters
alertLinphoneAlert object
cbsThe LinphoneAlertCbs object to be removed from the LinphoneAlert.

◆ linphone_alert_type_to_string()

const char* linphone_alert_type_to_string ( LinphoneAlertType  type)

Provide a string describing the alert type.

Parameters
typethe LinphoneAlertType
Returns
a string

◆ linphone_alert_unref()

void linphone_alert_unref ( LinphoneAlert alert)

Release a LinphoneAlert.

Parameters
alertThe LinphoneAlert object.

◆ linphone_core_alerts_enabled()

bool_t linphone_core_alerts_enabled ( const LinphoneCore core)

Returns whether alert reporting is enabled.

See LinphoneAlert for more details.

Parameters
corethe LinphoneCore .
Returns
whether alert reporting is enabled.

◆ linphone_core_cbs_get_new_alert_triggered()

LinphoneCoreCbsNewAlertTriggeredCb linphone_core_cbs_get_new_alert_triggered ( LinphoneCoreCbs cbs)

Get the on alert callback.

Parameters
cbsLinphoneCoreCbs object.
Returns
The #LinphoneCoreCbsOnAlertCb callback called.

◆ linphone_core_cbs_set_new_alert_triggered()

void linphone_core_cbs_set_new_alert_triggered ( LinphoneCoreCbs cbs,
LinphoneCoreCbsNewAlertTriggeredCb  alert_cb 
)

Set the on alert callback.

Parameters
cbsLinphoneCoreCbs object.
alert_cbThe #LinphoneCoreCbsOnAlertCb callback to call.

◆ linphone_core_enable_alerts()

void linphone_core_enable_alerts ( LinphoneCore core,
bool_t  enable 
)

Enable alerts.

See LinphoneAlert for more details.

Parameters
corethe LinphoneCore .
enablewhether alert reporting is enabled or not.