Commit 3c28b144 authored by Ghislain MARY's avatar Ghislain MARY

Use the c-tools for the Call object.

parent 553d8b1c
......@@ -169,7 +169,7 @@ static void call_received(SalOp *h) {
LinphoneCall *call = linphone_call_new_incoming(lc, fromAddr, toAddr, h);
linphone_address_unref(fromAddr);
linphone_address_unref(toAddr);
L_GET_PRIVATE(linphone_call_get_cpp_obj(call).get())->startIncomingNotification();
L_GET_PRIVATE_FROM_C_STRUCT(call, Call)->startIncomingNotification();
}
static void call_rejected(SalOp *h){
......
......@@ -76,12 +76,6 @@ LinphoneInfoMessage *linphone_core_create_info_message(LinphoneCore *lc){
return belle_sip_object_new(LinphoneInfoMessage);
}
LinphoneStatus linphone_call_send_info_message(LinphoneCall *call, const LinphoneInfoMessage *info) {
SalBodyHandler *body_handler = sal_body_handler_from_content(info->content);
sal_op_set_sent_custom_header(linphone_call_get_op(call), info->headers);
return sal_send_info(linphone_call_get_op(call), NULL, NULL, body_handler);
}
void linphone_info_message_add_header(LinphoneInfoMessage *im, const char *name, const char *value){
im->headers=sal_custom_header_append(im->headers, name, value);
}
......@@ -98,6 +92,10 @@ const LinphoneContent * linphone_info_message_get_content(const LinphoneInfoMess
return (im->content && linphone_content_get_type(im->content)) ? im->content : NULL;
}
SalCustomHeader *linphone_info_message_get_headers (const LinphoneInfoMessage *im) {
return im->headers;
}
void linphone_core_notify_info_message(LinphoneCore* lc,SalOp *op, SalBodyHandler *body_handler){
LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
if (call){
......
This diff is collapsed.
......@@ -454,14 +454,6 @@ int lc_callback_obj_invoke(LCCallbackObj *obj, LinphoneCore *lc){
return 0;
}
bool_t linphone_call_asked_to_autoanswer(LinphoneCall *call){
//return TRUE if the unique(for the moment) incoming call asked to be autoanswered
if(call)
return sal_call_autoanswer_asked(linphone_call_get_op(call));
else
return FALSE;
}
int linphone_core_get_current_call_duration(const LinphoneCore *lc){
LinphoneCall *call=linphone_core_get_current_call((LinphoneCore *)lc);
if (call) return linphone_call_get_duration(call);
......@@ -3232,7 +3224,7 @@ void linphone_core_iterate(LinphoneCore *lc){
/* Get immediately a reference to next one in case the one we are going to examine is destroyed
* and removed during linphone_call_start_invite() */
calls = bctbx_list_next(calls);
L_GET_PRIVATE(linphone_call_get_cpp_obj(call).get())->iterate(current_real_time, one_second_elapsed);
L_GET_PRIVATE_FROM_C_STRUCT(call, Call)->iterate(current_real_time, one_second_elapsed);
}
if (linphone_core_video_preview_enabled(lc)){
......@@ -3558,9 +3550,9 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
if (linphone_call_params_get_local_conference_mode(params) == FALSE)
#endif
lc->current_call=call;
bool defer = L_GET_PRIVATE(linphone_call_get_cpp_obj(call).get())->initiateOutgoing();
bool defer = L_GET_PRIVATE_FROM_C_STRUCT(call, Call)->initiateOutgoing();
if (!defer) {
if (L_GET_PRIVATE(linphone_call_get_cpp_obj(call).get())->startInvite(nullptr) != 0) {
if (L_GET_PRIVATE_FROM_C_STRUCT(call, Call)->startInvite(nullptr) != 0) {
/* The call has already gone to error and released state, so do not return it */
call = nullptr;
}
......
......@@ -228,19 +228,7 @@ typedef struct _PortConfig{
int rtcp_port;
}PortConfig;
struct _LinphoneCallCbs {
belle_sip_object_t base;
void *user_data;
LinphoneCallCbsDtmfReceivedCb dtmf_received_cb;
LinphoneCallCbsEncryptionChangedCb encryption_changed_cb;
LinphoneCallCbsInfoMessageReceivedCb info_message_received_cb;
LinphoneCallCbsStateChangedCb state_changed_cb;
LinphoneCallCbsStatsUpdatedCb stats_updated_cb;
LinphoneCallCbsTransferStateChangedCb transfer_state_changed_cb;
LinphoneCallCbsAckProcessingCb ack_processing;
};
LinphoneCallCbs * _linphone_call_cbs_new(void);
LinphoneCallCbs *_linphone_call_cbs_new(void);
void linphone_call_notify_state_changed(LinphoneCall *call, LinphoneCallState cstate, const char *message);
......@@ -416,8 +404,21 @@ LINPHONE_PUBLIC void linphone_core_enable_short_turn_refresh(LinphoneCore *lc, b
void linphone_call_update_ice_state_in_call_stats(LinphoneCall *call);
LINPHONE_PUBLIC void linphone_call_stats_fill(LinphoneCallStats *stats, MediaStream *ms, OrtpEvent *ev);
void linphone_call_stats_update(LinphoneCallStats *stats, MediaStream *stream);
void linphone_call_stats_uninit(LinphoneCallStats *stats);
LinphoneCallStats *_linphone_call_stats_new(void);
void _linphone_call_stats_uninit(LinphoneCallStats *stats);
void _linphone_call_stats_clone(LinphoneCallStats *dst, const LinphoneCallStats *src);
void _linphone_call_stats_set_ice_state (LinphoneCallStats *stats, LinphoneIceState state);
void _linphone_call_stats_set_type (LinphoneCallStats *stats, LinphoneStreamType type);
void _linphone_call_stats_set_received_rtcp (LinphoneCallStats *stats, mblk_t *m);
void _linphone_call_stats_set_sent_rtcp (LinphoneCallStats *stats, mblk_t *m);
int _linphone_call_stats_get_updated (const LinphoneCallStats *stats);
void _linphone_call_stats_set_updated (LinphoneCallStats *stats, int updated);
void _linphone_call_stats_set_rtp_stats (LinphoneCallStats *stats, const rtp_stats_t *rtpStats);
void _linphone_call_stats_set_download_bandwidth (LinphoneCallStats *stats, float bandwidth);
void _linphone_call_stats_set_upload_bandwidth (LinphoneCallStats *stats, float bandwidth);
void _linphone_call_stats_set_rtcp_download_bandwidth (LinphoneCallStats *stats, float bandwidth);
void _linphone_call_stats_set_rtcp_upload_bandwidth (LinphoneCallStats *stats, float bandwidth);
void _linphone_call_stats_set_ip_family_of_remote (LinphoneCallStats *stats, LinphoneAddressFamily family);
void linphone_call_update_local_media_description_from_ice_or_upnp(LinphoneCall *call);
void linphone_call_update_ice_from_remote_media_description(LinphoneCall *call, const SalMediaDescription *md, bool_t is_offer);
void linphone_call_clear_unused_ice_candidates(LinphoneCall *call, const SalMediaDescription *md);
......@@ -1520,7 +1521,6 @@ void linphone_error_info_from_sal_op(LinphoneErrorInfo *ei, const SalOp *op);
void payload_type_set_enable(OrtpPayloadType *pt, bool_t value);
bool_t payload_type_enabled(const OrtpPayloadType *pt);
bool_t is_payload_type_number_available(const MSList *l, int number, const OrtpPayloadType *ignore);
LinphonePayloadType *linphone_payload_type_new(LinphoneCore *lc, OrtpPayloadType *ortp_pt);
bool_t _linphone_core_check_payload_type_usability(const LinphoneCore *lc, const OrtpPayloadType *pt);
OrtpPayloadType *linphone_payload_type_get_ortp_pt(const LinphonePayloadType *pt);
......@@ -1592,40 +1592,6 @@ BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneVideoActivationPolicy);
LINPHONE_PUBLIC LinphoneVideoActivationPolicy *linphone_video_activation_policy_new(void);
/**
* 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 instantiating 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().
**/
struct _LinphoneCallStats {
belle_sip_object_t base;
void *user_data;
LinphoneStreamType type; /**< Type of the stream which the stats refer to */
jitter_stats_t jitter_stats; /**<jitter buffer statistics, see oRTP documentation for details */
mblk_t *received_rtcp; /**<Last RTCP packet received, as a mblk_t structure. See oRTP documentation for details how to extract information from it*/
mblk_t *sent_rtcp;/**<Last RTCP packet sent, as a mblk_t structure. See oRTP documentation for details how to extract information from it*/
float round_trip_delay; /**<Round trip propagation time in seconds if known, -1 if unknown.*/
LinphoneIceState ice_state; /**< State of ICE processing. */
LinphoneUpnpState upnp_state; /**< State of uPnP processing. */
float download_bandwidth; /**<Download bandwidth measurement of received stream, expressed in kbit/s, including IP/UDP/RTP headers*/
float upload_bandwidth; /**<Download bandwidth measurement of sent stream, expressed in kbit/s, including IP/UDP/RTP headers*/
float local_late_rate; /**<percentage of packet received too late over last second*/
float local_loss_rate; /**<percentage of lost packet over last second*/
int updated; /**< Tell which RTCP packet has been updated (received_rtcp or sent_rtcp). Can be either LINPHONE_CALL_STATS_RECEIVED_RTCP_UPDATE or LINPHONE_CALL_STATS_SENT_RTCP_UPDATE */
float rtcp_download_bandwidth; /**<RTCP download bandwidth measurement of received stream, expressed in kbit/s, including IP/UDP/RTP headers*/
float rtcp_upload_bandwidth; /**<RTCP download bandwidth measurement of sent stream, expressed in kbit/s, including IP/UDP/RTP headers*/
rtp_stats_t rtp_stats; /**< RTP stats */
int rtp_remote_family; /**< Ip adress family of the remote destination */
int clockrate; /*RTP clockrate of the stream, provided here for easily converting timestamp units expressed in RTCP packets in milliseconds*/
bool_t rtcp_received_via_mux; /*private flag, for non-regression test only*/
};
BELLE_SIP_DECLARE_VPTR_NO_EXPORT(LinphoneCallStats);
LinphoneCallStats *linphone_call_stats_new(void);
/** Belle Sip-based objects need unique ids
*/
......@@ -1825,6 +1791,9 @@ const char* _linphone_config_load_from_xml_string(LpConfig *lpc, const char *buf
LinphoneNatPolicy * linphone_config_create_nat_policy_from_section(const LinphoneConfig *config, const char* section);
SalCustomHeader *linphone_info_message_get_headers (const LinphoneInfoMessage *im);
#ifdef __cplusplus
}
#endif
......
......@@ -76,6 +76,9 @@ set(ROOT_HEADER_FILES
set(C_API_HEADER_FILES
c-address.h
c-api.h
c-call.h
c-call-cbs.h
c-call-stats.h
c-callbacks.h
c-chat-message.h
c-chat-message-cbs.h
......
/*
* c-call-cbs.h
* Copyright (C) 2017 Belledonne Communications SARL
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _C_CALL_CBS_H_
#define _C_CALL_CBS_H_
#include "linphone/api/c-callbacks.h"
#include "linphone/api/c-types.h"
// =============================================================================
#ifdef __cplusplus
extern "C" {
#endif // ifdef __cplusplus
/**
* @addtogroup call_control
* @{
*/
/**
* Acquire a reference to the LinphoneCallCbs object.
* @param[in] cbs LinphoneCallCbs object.
* @return The same LinphoneCallCbs object.
*/
LINPHONE_PUBLIC LinphoneCallCbs *linphone_call_cbs_ref (LinphoneCallCbs *cbs);
/**
* Release reference to the LinphoneCallCbs object.
* @param[in] cbs LinphoneCallCbs object.
*/
LINPHONE_PUBLIC void linphone_call_cbs_unref (LinphoneCallCbs *cbs);
/**
* Retrieve the user pointer associated with the LinphoneCallCbs object.
* @param[in] cbs LinphoneCallCbs object.
* @return The user pointer associated with the LinphoneCallCbs object.
*/
LINPHONE_PUBLIC void *linphone_call_cbs_get_user_data (const LinphoneCallCbs *cbs);
/**
* Assign a user pointer to the LinphoneCallCbs object.
* @param[in] cbs LinphoneCallCbs object.
* @param[in] ud The user pointer to associate with the LinphoneCallCbs object.
*/
LINPHONE_PUBLIC void linphone_call_cbs_set_user_data (LinphoneCallCbs *cbs, void *ud);
/**
* Get the dtmf received callback.
* @param[in] cbs LinphoneCallCbs object.
* @return The current dtmf received callback.
*/
LINPHONE_PUBLIC LinphoneCallCbsDtmfReceivedCb linphone_call_cbs_get_dtmf_received (LinphoneCallCbs *cbs);
/**
* Set the dtmf received callback.
* @param[in] cbs LinphoneCallCbs object.
* @param[in] cb The dtmf received callback to be used.
*/
LINPHONE_PUBLIC void linphone_call_cbs_set_dtmf_received (LinphoneCallCbs *cbs, LinphoneCallCbsDtmfReceivedCb cb);
/**
* Get the encryption changed callback.
* @param[in] cbs LinphoneCallCbs object.
* @return The current encryption changed callback.
*/
LINPHONE_PUBLIC LinphoneCallCbsEncryptionChangedCb linphone_call_cbs_get_encryption_changed (LinphoneCallCbs *cbs);
/**
* Set the encryption changed callback.
* @param[in] cbs LinphoneCallCbs object.
* @param[in] cb The encryption changed callback to be used.
*/
LINPHONE_PUBLIC void linphone_call_cbs_set_encryption_changed (LinphoneCallCbs *cbs, LinphoneCallCbsEncryptionChangedCb cb);
/**
* Get the info message received callback.
* @param[in] cbs LinphoneCallCbs object.
* @return The current info message received callback.
*/
LINPHONE_PUBLIC LinphoneCallCbsInfoMessageReceivedCb linphone_call_cbs_get_info_message_received (LinphoneCallCbs *cbs);
/**
* Set the info message received callback.
* @param[in] cbs LinphoneCallCbs object.
* @param[in] cb The info message received callback to be used.
*/
LINPHONE_PUBLIC void linphone_call_cbs_set_info_message_received (LinphoneCallCbs *cbs, LinphoneCallCbsInfoMessageReceivedCb cb);
/**
* Get the state changed callback.
* @param[in] cbs LinphoneCallCbs object.
* @return The current state changed callback.
*/
LINPHONE_PUBLIC LinphoneCallCbsStateChangedCb linphone_call_cbs_get_state_changed (LinphoneCallCbs *cbs);
/**
* Set the state changed callback.
* @param[in] cbs LinphoneCallCbs object.
* @param[in] cb The state changed callback to be used.
*/
LINPHONE_PUBLIC void linphone_call_cbs_set_state_changed (LinphoneCallCbs *cbs, LinphoneCallCbsStateChangedCb cb);
/**
* Get the stats updated callback.
* @param[in] cbs LinphoneCallCbs object.
* @return The current stats updated callback.
*/
LINPHONE_PUBLIC LinphoneCallCbsStatsUpdatedCb linphone_call_cbs_get_stats_updated (LinphoneCallCbs *cbs);
/**
* Set the stats updated callback.
* @param[in] cbs LinphoneCallCbs object.
* @param[in] cb The stats updated callback to be used.
*/
LINPHONE_PUBLIC void linphone_call_cbs_set_stats_updated (LinphoneCallCbs *cbs, LinphoneCallCbsStatsUpdatedCb cb);
/**
* Get the transfer state changed callback.
* @param[in] cbs LinphoneCallCbs object.
* @return The current transfer state changed callback.
*/
LINPHONE_PUBLIC LinphoneCallCbsTransferStateChangedCb linphone_call_cbs_get_transfer_state_changed (LinphoneCallCbs *cbs);
/**
* Set the transfer state changed callback.
* @param[in] cbs LinphoneCallCbs object.
* @param[in] cb The transfer state changed callback to be used.
*/
LINPHONE_PUBLIC void linphone_call_cbs_set_transfer_state_changed (LinphoneCallCbs *cbs, LinphoneCallCbsTransferStateChangedCb cb);
/**
* Get the ACK processing callback.
* @param[in] cbs LinphoneCallCbs object.
* @return The current ack processing callback.
*/
LINPHONE_PUBLIC LinphoneCallCbsAckProcessingCb linphone_call_cbs_get_ack_processing (LinphoneCallCbs *cbs);
/**
* Set ACK processing callback.
* @param[in] cbs LinphoneCallCbs object.
* @param[in] cb The ack processing callback to be used.
*/
LINPHONE_PUBLIC void linphone_call_cbs_set_ack_processing (LinphoneCallCbs *cbs, LinphoneCallCbsAckProcessingCb cb);
/**
* @}
*/
#ifdef __cplusplus
}
#endif // ifdef __cplusplus
#endif // ifndef _C_CALL_CBS_H_
/*
* c-call-stats.h
* Copyright (C) 2017 Belledonne Communications SARL
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _C_CALL_STATS_H_
#define _C_CALL_STATS_H_
#include <ortp/rtp.h>
#include "linphone/api/c-callbacks.h"
#include "linphone/api/c-types.h"
// =============================================================================
#ifdef __cplusplus
extern "C" {
#endif // ifdef __cplusplus
/**
* @addtogroup call_misc
* @{
*/
#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) /**< received_rtcp field of LinphoneCallStats object has been updated */
#define LINPHONE_CALL_STATS_SENT_RTCP_UPDATE (1 << 1) /**< sent_rtcp field of LinphoneCallStats object has been updated */
#define LINPHONE_CALL_STATS_PERIODICAL_UPDATE (1 << 2) /**< Every seconds LinphoneCallStats object has been updated */
/**
* Increment refcount.
* @param[in] stats LinphoneCallStats object
* @ingroup misc
**/
LINPHONE_PUBLIC LinphoneCallStats *linphone_call_stats_ref (LinphoneCallStats *stats);
/**
* Decrement refcount and possibly free the object.
* @param[in] stats LinphoneCallStats object
* @ingroup misc
**/
LINPHONE_PUBLIC void linphone_call_stats_unref (LinphoneCallStats *stats);
/**
* Gets the user data in the LinphoneCallStats object
* @param[in] stats the LinphoneCallStats
* @return the user data
* @ingroup misc
*/
LINPHONE_PUBLIC void *linphone_call_stats_get_user_data (const LinphoneCallStats *stats);
/**
* Sets the user data in the LinphoneCallStats object
* @param[in] stats the LinphoneCallStats object
* @param[in] data the user data
* @ingroup misc
*/
LINPHONE_PUBLIC void linphone_call_stats_set_user_data (LinphoneCallStats *stats, void *data);
/**
* Get the type of the stream the stats refer to.
* @param[in] stats LinphoneCallStats object
* @return The type of the stream the stats refer to
*/
LINPHONE_PUBLIC LinphoneStreamType linphone_call_stats_get_type (const LinphoneCallStats *stats);
/**
* Get the local loss rate since last report
* @return The sender loss rate
**/
LINPHONE_PUBLIC float linphone_call_stats_get_sender_loss_rate (const LinphoneCallStats *stats);
/**
* Gets the remote reported loss rate since last report
* @return The receiver loss rate
**/
LINPHONE_PUBLIC float linphone_call_stats_get_receiver_loss_rate (const LinphoneCallStats *stats);
/**
* Get the local loss rate since last report
* @return The local loss rate
**/
LINPHONE_PUBLIC float linphone_call_stats_get_local_loss_rate (const LinphoneCallStats *stats);
/**
* Gets the local late rate since last report
* @return The local late rate
**/
LINPHONE_PUBLIC float linphone_call_stats_get_local_late_rate (const LinphoneCallStats *stats);
/**
* Gets the local interarrival jitter
* @param[in] stats LinphoneCallStats object
* @return The interarrival jitter at last emitted sender report
**/
LINPHONE_PUBLIC float linphone_call_stats_get_sender_interarrival_jitter (const LinphoneCallStats *stats);
/**
* Gets the remote reported interarrival jitter
* @param[in] stats LinphoneCallStats object
* @return The interarrival jitter at last received receiver report
**/
LINPHONE_PUBLIC float linphone_call_stats_get_receiver_interarrival_jitter (const LinphoneCallStats *stats);
LINPHONE_PUBLIC const rtp_stats_t *linphone_call_stats_get_rtp_stats (const LinphoneCallStats *stats);
/**
* Gets the cumulative number of late packets
* @param[in] stats LinphoneCallStats object
* @return The cumulative number of late packets
**/
LINPHONE_PUBLIC uint64_t linphone_call_stats_get_late_packets_cumulative_number (const LinphoneCallStats *stats);
/**
* Get the bandwidth measurement of the received stream, expressed in kbit/s, including IP/UDP/RTP headers.
* @param[in] stats LinphoneCallStats object
* @return The bandwidth measurement of the received stream in kbit/s.
*/
LINPHONE_PUBLIC float linphone_call_stats_get_download_bandwidth (const LinphoneCallStats *stats);
/**
* Get the bandwidth measurement of the sent stream, expressed in kbit/s, including IP/UDP/RTP headers.
* @param[in] stats LinphoneCallStats object
* @return The bandwidth measurement of the sent stream in kbit/s.
*/
LINPHONE_PUBLIC float linphone_call_stats_get_upload_bandwidth (const LinphoneCallStats *stats);
/**
* Get the bandwidth measurement of the received RTCP, expressed in kbit/s, including IP/UDP/RTP headers.
* @param[in] stats LinphoneCallStats object
* @return The bandwidth measurement of the received RTCP in kbit/s.
*/
LINPHONE_PUBLIC float linphone_call_stats_get_rtcp_download_bandwidth (const LinphoneCallStats *stats);
/**
* Get the bandwidth measurement of the sent RTCP, expressed in kbit/s, including IP/UDP/RTP headers.
* @param[in] stats LinphoneCallStats object
* @return The bandwidth measurement of the sent RTCP in kbit/s.
*/
LINPHONE_PUBLIC float linphone_call_stats_get_rtcp_upload_bandwidth( const LinphoneCallStats *stats);
/**
* Get the state of ICE processing.
* @param[in] stats LinphoneCallStats object
* @return The state of ICE processing.
*/
LINPHONE_PUBLIC LinphoneIceState linphone_call_stats_get_ice_state (const LinphoneCallStats *stats);
/**
* Get the state of uPnP processing.
* @param[in] stats LinphoneCallStats object
* @return The state of uPnP processing.
*/
LINPHONE_PUBLIC LinphoneUpnpState linphone_call_stats_get_upnp_state (const LinphoneCallStats *stats);
/**
* Get the IP address family of the remote peer.
* @param[in] stats LinphoneCallStats object
* @return The IP address family of the remote peer.
*/
LINPHONE_PUBLIC LinphoneAddressFamily linphone_call_stats_get_ip_family_of_remote (const LinphoneCallStats *stats);
/**
* Get the jitter buffer size in ms.
* @param[in] stats LinphoneCallStats object
* @return The jitter buffer size in ms.
*/
LINPHONE_PUBLIC float linphone_call_stats_get_jitter_buffer_size_ms (const LinphoneCallStats *stats);
/**
* Get the round trip delay in s.
* @param[in] stats LinphoneCallStats object
* @return The round trip delay in s.
*/
LINPHONE_PUBLIC float linphone_call_stats_get_round_trip_delay (const LinphoneCallStats *stats);
/**
* @}
*/
#ifdef __cplusplus
}
#endif // ifdef __cplusplus
#endif // ifndef _C_CALL_STATS_H_
This diff is collapsed.
......@@ -29,6 +29,68 @@
extern "C" {
#endif // ifdef __cplusplus
/**
* @addtogroup call_control
* @{
**/
/**
* Callback for being notified of received DTMFs.
* @param call LinphoneCall object that received the dtmf
* @param dtmf The ascii code of the dtmf
*/
typedef void (*LinphoneCallCbsDtmfReceivedCb)(LinphoneCall *call, int dtmf);
/**
* Call encryption changed callback.
* @param call LinphoneCall object whose encryption is changed.
* @param on Whether encryption is activated.
* @param authentication_token An authentication_token, currently set for ZRTP kind of encryption only.
*/
typedef void (*LinphoneCallCbsEncryptionChangedCb)(LinphoneCall *call, bool_t on, const char *authentication_token);
/**
* Callback for receiving info messages.
* @param call LinphoneCall whose info message belongs to.
* @param msg LinphoneInfoMessage object.
*/
typedef void (*LinphoneCallCbsInfoMessageReceivedCb)(LinphoneCall *call, const LinphoneInfoMessage *msg);
/**
* Call state notification callback.
* @param call LinphoneCall whose state is changed.
* @param cstate The new state of the call
* @param message An informational message about the state.
*/
typedef void (*LinphoneCallCbsStateChangedCb)(LinphoneCall *call, LinphoneCallState cstate, const char *message);
/**
* Callback for receiving quality statistics for calls.
* @param call LinphoneCall object whose statistics are notified
* @param stats LinphoneCallStats object
*/
typedef void (*LinphoneCallCbsStatsUpdatedCb)(LinphoneCall *call, const LinphoneCallStats *stats);
/**
* Callback for notifying progresses of transfers.
* @param call LinphoneCall that was transfered
* @param cstate The state of the call to transfer target at the far end.
*/
typedef void (*LinphoneCallCbsTransferStateChangedCb)(LinphoneCall *call, LinphoneCallState cstate);
/**
* Callback for notifying the processing SIP ACK messages.
* @param call LinphoneCall for which an ACK is being received or sent
* @param ack the ACK message
* @param is_received if TRUE this ACK is an incoming one, otherwise it is an ACK about to be sent.
*/
typedef void (*LinphoneCallCbsAckProcessingCb)(LinphoneCall *call, LinphoneHeaders *ack, bool_t is_received);
/**
* @}
**/
/**
* @addtogroup chatroom
* @{
......
......@@ -69,11 +69,24 @@ typedef unsigned char bool_t;
*/
typedef struct _LinphoneAddress LinphoneAddress;
/**
* The LinphoneCall object represents a call issued or received by the LinphoneCore
* @ingroup call_control
**/
typedef struct _LinphoneCall LinphoneCall;
// -----------------------------------------------------------------------------
// Chatroom.
// -----------------------------------------------------------------------------
/** Callback prototype */
typedef void (*LinphoneCallCbFunc) (LinphoneCall *call, void *ud);
/**
* That class holds all the callbacks which are called by LinphoneCall objects.
*
* Use linphone_factory_create_call_cbs() to create an instance. Then, call the
* callback setters on the events you need to monitor and pass the object to
* a LinphoneCall instance through linphone_call_add_callbacks().
* @ingroup call_control
*/
typedef struct _LinphoneCallCbs LinphoneCallCbs;
/**
* A chat room is the place where text messages are exchanged.
......
This diff is collapsed.
......@@ -20,164 +20,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef LINPHONE_CALL_STATS_H
#define LINPHONE_CALL_STATS_H
#include "linphone/types.h"
#include "linphone/api/c-call-stats.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup call_misc
* @{
*/
#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) /**< received_rtcp field of LinphoneCallStats object has been updated */
#define LINPHONE_CALL_STATS_SENT_RTCP_UPDATE (1 << 1) /**< sent_rtcp field of LinphoneCallStats object has been updated */
#define LINPHONE_CALL_STATS_PERIODICAL_UPDATE (1 << 2) /**< Every seconds LinphoneCallStats object has been updated */
/**
* Increment refcount.
* @param[in] stats LinphoneCallStats object
* @ingroup misc
**/
LINPHONE_PUBLIC LinphoneCallStats *linphone_call_stats_ref(LinphoneCallStats *stats);
/**
* Decrement refcount and possibly free the object.
* @param[in] stats LinphoneCallStats object
* @ingroup misc
**/
LINPHONE_PUBLIC void linphone_call_stats_unref(LinphoneCallStats *stats);
/**
* Gets the user data in the LinphoneCallStats object
* @param[in] stats the LinphoneCallStats
* @return the user data
* @ingroup misc
*/
LINPHONE_PUBLIC void *linphone_call_stats_get_user_data(const LinphoneCallStats *stats);
/**
* Sets the user data in the LinphoneCallStats object
* @param[in] stats the LinphoneCallStats object
* @param[in] data the user data
* @ingroup misc
*/
LINPHONE_PUBLIC void linphone_call_stats_set_user_data(LinphoneCallStats *stats, void *data);
/**
* Get the type of the stream the stats refer to.
* @param[in] stats LinphoneCallStats object
* @return The type of the stream the stats refer to
*/
LINPHONE_PUBLIC LinphoneStreamType linphone_call_stats_get_type(const LinphoneCallStats *stats);
/**
* Get the local loss rate since last report
* @return The sender loss rate
**/
LINPHONE_PUBLIC float linphone_call_stats_get_sender_loss_rate(const LinphoneCallStats *stats);
/**
* Gets the remote reported loss rate since last report
* @return The receiver loss rate
**/
LINPHONE_PUBLIC float linphone_call_stats_get_receiver_loss_rate(const LinphoneCallStats *stats);
/**
* Get the local loss rate since last report
* @return The local loss rate
**/
LINPHONE_PUBLIC float linphone_call_stats_get_local_loss_rate(const LinphoneCallStats *stats);