Liblinphone  3.11.1
Data Structures | Macros | Typedefs | Functions
Obtaining information about a running call: sound volumes, quality indicators

Data Structures

struct  _LinphoneCallStats
 

Macros

#define LINPHONE_CALL_STATS_AUDIO   ((int)LinphoneStreamTypeAudio)
 
#define LINPHONE_CALL_STATS_VIDEO   ((int)LinphoneStreamTypeVideo)
 
#define LINPHONE_CALL_STATS_TEXT   ((int)LinphoneStreamTypeText)
 
#define LINPHONE_CALL_STATS_RECEIVED_RTCP_UPDATE   (1 << 0)
 
#define LINPHONE_CALL_STATS_SENT_RTCP_UPDATE   (1 << 1)
 
#define LINPHONE_CALL_STATS_PERIODICAL_UPDATE   (1 << 2)
 
#define LINPHONE_VOLUME_DB_LOWEST   (-120) /* WARNING: keep this in sync with mediastreamer2/msvolume.h */
 

Typedefs

typedef struct _LinphoneCallStats LinphoneCallStats
 

Functions

LinphoneChatRoomlinphone_call_get_chat_room (LinphoneCall *call)
 
float linphone_call_get_play_volume (LinphoneCall *call)
 
float linphone_call_get_record_volume (LinphoneCall *call)
 
float linphone_call_get_speaker_volume_gain (const LinphoneCall *call)
 
void linphone_call_set_speaker_volume_gain (LinphoneCall *call, float volume)
 
float linphone_call_get_microphone_volume_gain (const LinphoneCall *call)
 
void linphone_call_set_microphone_volume_gain (LinphoneCall *call, float volume)
 
float linphone_call_get_current_quality (LinphoneCall *call)
 
float linphone_call_get_average_quality (LinphoneCall *call)
 
void linphone_call_start_recording (LinphoneCall *call)
 
void linphone_call_stop_recording (LinphoneCall *call)
 
LinphonePlayerlinphone_call_get_player (LinphoneCall *call)
 
bool_t linphone_call_media_in_progress (LinphoneCall *call)
 
void linphone_call_ogl_render (LinphoneCall *call, bool_t is_preview)
 
int linphone_call_send_info_message (LinphoneCall *call, const LinphoneInfoMessage *info)
 
const LinphoneCallStatslinphone_call_get_stats (LinphoneCall *call, LinphoneStreamType type)
 
const LinphoneCallStatslinphone_call_get_audio_stats (LinphoneCall *call)
 
const LinphoneCallStatslinphone_call_get_video_stats (LinphoneCall *call)
 
const LinphoneCallStatslinphone_call_get_text_stats (LinphoneCall *call)
 
float linphone_call_stats_get_sender_loss_rate (const LinphoneCallStats *stats)
 
float linphone_call_stats_get_receiver_loss_rate (const LinphoneCallStats *stats)
 
float linphone_call_stats_get_sender_interarrival_jitter (const LinphoneCallStats *stats)
 
float linphone_call_stats_get_receiver_interarrival_jitter (const LinphoneCallStats *stats)
 
const rtp_stats_t * linphone_call_stats_get_rtp_stats (const LinphoneCallStats *stats)
 
uint64_t linphone_call_stats_get_late_packets_cumulative_number (const LinphoneCallStats *stats)
 
float linphone_call_stats_get_download_bandwidth (const LinphoneCallStats *stats)
 
float linphone_call_stats_get_upload_bandwidth (const LinphoneCallStats *stats)
 
LinphoneIceState linphone_call_stats_get_ice_state (const LinphoneCallStats *stats)
 
LinphoneUpnpState linphone_call_stats_get_upnp_state (const LinphoneCallStats *stats)
 

Detailed Description

When a call is running, it is possible to retrieve in real time current measured volumes and quality indicator.

Macro Definition Documentation

§ LINPHONE_CALL_STATS_PERIODICAL_UPDATE

#define LINPHONE_CALL_STATS_PERIODICAL_UPDATE   (1 << 2)

Every seconds LinphoneCallStats object has been updated

§ LINPHONE_CALL_STATS_RECEIVED_RTCP_UPDATE

#define LINPHONE_CALL_STATS_RECEIVED_RTCP_UPDATE   (1 << 0)

received_rtcp field of LinphoneCallStats object has been updated

§ LINPHONE_CALL_STATS_SENT_RTCP_UPDATE

#define LINPHONE_CALL_STATS_SENT_RTCP_UPDATE   (1 << 1)

sent_rtcp field of LinphoneCallStats object has been updated

§ LINPHONE_VOLUME_DB_LOWEST

#define LINPHONE_VOLUME_DB_LOWEST   (-120) /* WARNING: keep this in sync with mediastreamer2/msvolume.h */

Lowest volume measurement that can be returned by linphone_call_get_play_volume() or linphone_call_get_record_volume(), corresponding to pure silence.

Typedef Documentation

§ LinphoneCallStats

The LinphoneCallStats objects carries various statistic informations regarding quality of audio or video streams.

To receive these informations periodically and as soon as they are computed, the application is invited to place a LinphoneCoreCallStatsUpdatedCb callback in the LinphoneCoreVTable structure it passes for instanciating the LinphoneCore object (see linphone_core_new() ).

At any time, the application can access last computed statistics using linphone_call_get_audio_stats() or linphone_call_get_video_stats().

Function Documentation

§ linphone_call_get_average_quality()

float linphone_call_get_average_quality ( LinphoneCall call)

Returns call quality averaged over all the duration of the call.

See linphone_call_get_current_quality() for more details about quality measurement.

§ linphone_call_get_chat_room()

LinphoneChatRoom* linphone_call_get_chat_room ( LinphoneCall call)

Create a new chat room for messaging from a call if not already existing, else return existing one. No reference is given to the caller: the chat room will be deleted when the call is ended.

Parameters
callLinphoneCall object
Returns
LinphoneChatRoom where messaging can take place.

§ linphone_call_get_current_quality()

float linphone_call_get_current_quality ( LinphoneCall call)

Obtain real-time quality rating of the call

Based on local RTP statistics and RTCP feedback, a quality rating is computed and updated during all the duration of the call. This function returns its value at the time of the function call. It is expected that the rating is updated at least every 5 seconds or so. The rating is a floating point number comprised between 0 and 5.

4-5 = good quality
3-4 = average quality
2-3 = poor quality
1-2 = very poor quality
0-1 = can't be worse, mostly unusable

Returns
The function returns -1 if no quality measurement is available, for example if no active audio stream exist. Otherwise it returns the quality rating.

§ linphone_call_get_microphone_volume_gain()

float linphone_call_get_microphone_volume_gain ( const LinphoneCall call)

Get microphone volume gain. If the sound backend supports it, the returned gain is equal to the gain set with the system mixer.

Parameters
callThe call.
Returns
double Percenatge of the max supported volume gain. Valid values are in [ 0.0 : 1.0 ]. In case of failure, a negative value is returned

§ linphone_call_get_play_volume()

float linphone_call_get_play_volume ( LinphoneCall call)

Get the mesured playback volume level (received from remote) in dbm0.

Parameters
callThe call.
Returns
float Volume level in percentage.

§ linphone_call_get_record_volume()

float linphone_call_get_record_volume ( LinphoneCall call)

Get the mesured record volume level (sent to remote) in dbm0.

Parameters
callThe call.
Returns
float Volume level in percentage.

§ linphone_call_get_speaker_volume_gain()

float linphone_call_get_speaker_volume_gain ( const LinphoneCall call)

Get speaker volume gain. If the sound backend supports it, the returned gain is equal to the gain set with the system mixer.

Parameters
callThe call.
Returns
Percenatge of the max supported volume gain. Valid values are in [ 0.0 : 1.0 ]. In case of failure, a negative value is returned

§ linphone_call_get_stats()

const LinphoneCallStats* linphone_call_get_stats ( LinphoneCall call,
LinphoneStreamType  type 
)

Return call statistics for a particular stream type.

Parameters
callthe call
typethe stream type

§ linphone_call_media_in_progress()

bool_t linphone_call_media_in_progress ( LinphoneCall call)

Indicates whether an operation is in progress at the media side. It can be a bad idea to initiate signaling operations (adding video, pausing the call, removing video, changing video parameters) while the media is busy in establishing the connection (typically ICE connectivity checks). It can result in failures generating loss of time in future operations in the call. Applications are invited to check this function after each call state change to decide whether certain operations are permitted or not.

Parameters
callthe call
Returns
TRUE if media is busy in establishing the connection, FALSE otherwise.

§ linphone_call_ogl_render()

void linphone_call_ogl_render ( LinphoneCall call,
bool_t  is_preview 
)

Call generic OpenGL render for a given call.

Parameters
callThe call. If true the preview is displayed otherwise it's the input stream.

§ linphone_call_send_info_message()

int linphone_call_send_info_message ( LinphoneCall call,
const LinphoneInfoMessage info 
)

Send a LinphoneInfoMessage through an established call

Parameters
callthe call
infothe info message

§ linphone_call_set_microphone_volume_gain()

void linphone_call_set_microphone_volume_gain ( LinphoneCall call,
float  volume 
)

Set microphone volume gain. If the sound backend supports it, the new gain will synchronized with the system mixer.

Parameters
callThe call.
volumePercentage of the max supported gain. Valid values are in [ 0.0 : 1.0 ].

§ linphone_call_set_speaker_volume_gain()

void linphone_call_set_speaker_volume_gain ( LinphoneCall call,
float  volume 
)

Set speaker volume gain. If the sound backend supports it, the new gain will synchronized with the system mixer.

Parameters
callThe call.
volumePercentage of the max supported gain. Valid values are in [ 0.0 : 1.0 ].

§ linphone_call_start_recording()

void linphone_call_start_recording ( LinphoneCall call)

Start call recording. The output file where audio is recorded must be previously specified with linphone_call_params_set_record_file().

§ linphone_call_stats_get_download_bandwidth()

float linphone_call_stats_get_download_bandwidth ( const LinphoneCallStats stats)

Get the bandwidth measurement of the received stream, expressed in kbit/s, including IP/UDP/RTP headers.

Parameters
[in]statsLinphoneCallStats object
Returns
The bandwidth measurement of the received stream in kbit/s.

§ linphone_call_stats_get_ice_state()

LinphoneIceState linphone_call_stats_get_ice_state ( const LinphoneCallStats stats)

Get the state of ICE processing.

Parameters
[in]statsLinphoneCallStats object
Returns
The state of ICE processing.

§ linphone_call_stats_get_late_packets_cumulative_number()

uint64_t linphone_call_stats_get_late_packets_cumulative_number ( const LinphoneCallStats stats)

Gets the cumulative number of late packets

Parameters
[in]statsLinphoneCallStats object
Returns
The cumulative number of late packets

§ linphone_call_stats_get_receiver_interarrival_jitter()

float linphone_call_stats_get_receiver_interarrival_jitter ( const LinphoneCallStats stats)

Gets the remote reported interarrival jitter

Parameters
[in]statsLinphoneCallStats object
Returns
The interarrival jitter at last received receiver report

§ linphone_call_stats_get_receiver_loss_rate()

float linphone_call_stats_get_receiver_loss_rate ( const LinphoneCallStats stats)

Gets the remote reported loss rate since last report

Returns
The receiver loss rate

§ linphone_call_stats_get_sender_interarrival_jitter()

float linphone_call_stats_get_sender_interarrival_jitter ( const LinphoneCallStats stats)

Gets the local interarrival jitter

Parameters
[in]statsLinphoneCallStats object
Returns
The interarrival jitter at last emitted sender report

§ linphone_call_stats_get_sender_loss_rate()

float linphone_call_stats_get_sender_loss_rate ( const LinphoneCallStats stats)

Get the local loss rate since last report

Returns
The sender loss rate

§ linphone_call_stats_get_upload_bandwidth()

float linphone_call_stats_get_upload_bandwidth ( const LinphoneCallStats stats)

Get the bandwidth measurement of the sent stream, expressed in kbit/s, including IP/UDP/RTP headers.

Parameters
[in]statsLinphoneCallStats object
Returns
The bandwidth measurement of the sent stream in kbit/s.

§ linphone_call_stats_get_upnp_state()

LinphoneUpnpState linphone_call_stats_get_upnp_state ( const LinphoneCallStats stats)

Get the state of uPnP processing.

Parameters
[in]statsLinphoneCallStats object
Returns
The state of uPnP processing.

§ linphone_call_stop_recording()

void linphone_call_stop_recording ( LinphoneCall call)

Stop call recording.