Commit 382c22a8 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Convert call transfer handling to C++.

parent bf2a9ade
......@@ -181,12 +181,6 @@ static void call_ringing(SalOp *h) {
L_GET_PRIVATE(session)->remoteRinging();
}
#if 0
static void start_pending_refer(LinphoneCall *call){
linphone_core_start_refered_call(call->core, call,NULL);
}
#endif
/*
* could be reach :
* - when the call is accepted
......@@ -363,30 +357,20 @@ static void dtmf_received(SalOp *op, char dtmf) {
L_GET_PRIVATE(mediaSession)->dtmfReceived(dtmf);
}
static void call_refer_received(SalOp *op, const SalAddress *referto){
#if 0
LinphoneCore *lc=(LinphoneCore *)sal_get_user_pointer(sal);
LinphoneCall *call=(LinphoneCall*)sal_op_get_user_pointer(op);
LinphoneAddress *refer_to_addr = linphone_address_new(referto);
char method[20] = "";
if(refer_to_addr) {
const char *tmp = linphone_address_get_method_param(refer_to_addr);
if(tmp) strncpy(method, tmp, sizeof(method));
linphone_address_unref(refer_to_addr);
}
if (call && (strlen(method) == 0 || strcmp(method, "INVITE") == 0)) {
if (call->refer_to!=NULL){
ms_free(call->refer_to);
}
call->refer_to=ms_strdup(referto);
call->refer_pending=TRUE;
linphone_call_set_state(call,LinphoneCallRefered,"Refered");
if (call->refer_pending) linphone_core_start_refered_call(lc,call,NULL);
}else {
linphone_core_notify_refer_received(lc,referto);
static void call_refer_received(SalOp *op, const SalAddress *referTo) {
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
char *addrStr = sal_address_as_string_uri_only(referTo);
Address referToAddr(addrStr);
string method;
if (referToAddr.isValid())
method = referToAddr.getMethodParam();
if (session && (method.empty() || (method == "INVITE"))) {
L_GET_PRIVATE(session)->referred(referToAddr);
} else {
LinphoneCore *lc = reinterpret_cast<LinphoneCore *>(op->get_sal()->get_user_pointer());
linphone_core_notify_refer_received(lc, addrStr);
}
#endif
bctbx_free(addrStr);
}
static void message_received(SalOp *op, const SalMessage *msg){
......@@ -534,31 +518,30 @@ static bool_t auth_requested(Sal* sal, SalAuthInfo* sai) {
}
}
static void notify_refer(SalOp *op, SalReferStatus status){
LinphoneCall *call=(LinphoneCall*) op->get_user_pointer();
LinphoneCallState cstate;
if (call==NULL) {
ms_warning("Receiving notify_refer for unknown call.");
return ;
static void notify_refer(SalOp *op, SalReferStatus status) {
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(op->get_user_pointer());
if (!session) {
ms_warning("Receiving notify_refer for unknown CallSession");
return;
}
switch(status){
LinphoneCallState cstate;
switch (status) {
case SalReferTrying:
cstate=LinphoneCallOutgoingProgress;
break;
cstate = LinphoneCallOutgoingProgress;
break;
case SalReferSuccess:
cstate=LinphoneCallConnected;
break;
cstate = LinphoneCallConnected;
break;
case SalReferFailed:
cstate=LinphoneCallError;
break;
cstate = LinphoneCallError;
break;
default:
cstate=LinphoneCallError;
}
linphone_call_set_transfer_state(call, cstate);
if (cstate==LinphoneCallConnected){
/*automatically terminate the call as the transfer is complete.*/
linphone_call_terminate(call);
cstate = LinphoneCallError;
break;
}
L_GET_PRIVATE(session)->setTransferState(cstate);
if (cstate == LinphoneCallConnected)
session->terminate(); // Automatically terminate the call as the transfer is complete
}
static LinphoneChatMessageState chatStatusSal2Linphone(SalMessageDeliveryStatus status){
......
......@@ -3372,42 +3372,10 @@ const char * linphone_core_get_route(LinphoneCore *lc){
return route;
}
LinphoneCall * linphone_core_start_refered_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params){
#if 0
LinphoneCallParams *cp=params ? linphone_call_params_copy(params) : linphone_core_create_call_params(lc, NULL);
LinphoneCall *newcall;
if (call->state!=LinphoneCallPaused){
ms_message("Automatically pausing current call to accept transfer.");
_linphone_call_pause(call);
call->was_automatically_paused=TRUE;
}
if (!params){
linphone_call_params_enable_audio(cp, linphone_call_params_audio_enabled(call->current_params));
linphone_call_params_enable_video(cp, linphone_call_params_video_enabled(call->current_params)); /*start the call to refer-target with video enabled if original call had video*/
}
linphone_call_params_set_referer(cp, call);
ms_message("Starting new call to refered address %s",call->refer_to);
call->refer_pending=FALSE;
newcall=linphone_core_invite_with_params(lc,call->refer_to,cp);
linphone_call_params_unref(cp);
if (newcall) {
call->transfer_target=linphone_call_ref(newcall);
linphone_core_notify_refer_state(lc,call,newcall);
}
return newcall;
#else
return nullptr;
#endif
}
void linphone_core_notify_refer_state(LinphoneCore *lc, LinphoneCall *referer, LinphoneCall *newcall){
#if 0
if (referer->op!=NULL){
sal_call_notify_refer_state(referer->op,newcall ? newcall->op : NULL);
}
#endif
LinphoneCall * linphone_core_start_refered_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params) {
shared_ptr<LinphonePrivate::Call> referredCall = L_GET_PRIVATE_FROM_C_OBJECT(call)->startReferredCall(params
? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
return L_GET_C_BACK_PTR(referredCall);
}
/*
......@@ -3786,7 +3754,7 @@ int linphone_core_preempt_sound_resources(LinphoneCore *lc){
current_call=linphone_core_get_current_call(lc);
if(current_call != NULL){
ms_message("Pausing automatically the current call.");
err = _linphone_call_pause(current_call);
err = L_GET_CPP_PTR_FROM_C_OBJECT(current_call)->pause();
}
if (lc->ringstream){
linphone_core_stop_ringing(lc);
......
......@@ -51,7 +51,6 @@ LinphoneCall * linphone_call_new_incoming(struct _LinphoneCore *lc, const Linpho
void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const char *message);
/* private: */
LinphoneCallLog * linphone_call_log_new(LinphoneCallDir dir, LinphoneAddress *from, LinphoneAddress * to);
void linphone_call_set_transfer_state(LinphoneCall* call, LinphoneCallState state);
LinphonePlayer *linphone_call_build_player(LinphoneCall*call);
LinphonePrivate::SalCallOp *linphone_call_get_op(const LinphoneCall *call);
......@@ -327,7 +326,6 @@ int _linphone_call_pause(LinphoneCall *call);
/*conferencing subsystem*/
void _post_configure_audio_stream(AudioStream *st, LinphoneCore *lc, bool_t muted);
bool_t linphone_core_sound_resources_available(LinphoneCore *lc);
void linphone_core_notify_refer_state(LinphoneCore *lc, LinphoneCall *referer, LinphoneCall *newcall);
LINPHONE_PUBLIC unsigned int linphone_core_get_audio_features(LinphoneCore *lc);
void _linphone_core_codec_config_write(LinphoneCore *lc);
......
......@@ -18,9 +18,11 @@
*/
#include "c-wrapper/c-wrapper.h"
#include "call/call-p.h"
#include "core/core.h"
#include "conference/params/call-session-params-p.h"
#include "conference/params/media-session-params-p.h"
#include "conference/session/call-session.h"
#include "linphone/call_params.h"
......@@ -437,11 +439,18 @@ SalCustomSdpAttribute *linphone_call_params_get_custom_sdp_media_attributes (con
}
LinphoneCall *linphone_call_params_get_referer (const LinphoneCallParams *params) {
return L_GET_PRIVATE_FROM_C_OBJECT(params)->getReferer();
shared_ptr<LinphonePrivate::CallSession> session = L_GET_PRIVATE_FROM_C_OBJECT(params)->getReferer();
if (!session)
return nullptr;
for (const auto &call : session->getCore()->getCalls()) {
if (L_GET_PRIVATE(call)->getActiveSession() == session)
return L_GET_C_BACK_PTR(call);
}
return nullptr;
}
void linphone_call_params_set_referer (LinphoneCallParams *params, LinphoneCall *referer) {
L_GET_PRIVATE_FROM_C_OBJECT(params)->setReferer(referer);
L_GET_PRIVATE_FROM_C_OBJECT(params)->setReferer(L_GET_PRIVATE_FROM_C_OBJECT(referer)->getActiveSession());
}
bool_t linphone_call_params_get_update_call_when_ice_completed (const LinphoneCallParams *params) {
......
......@@ -48,6 +48,7 @@ L_DECLARE_C_OBJECT_IMPL_WITH_XTORS(Call,
LinphoneAddress *diversionAddressCache;
LinphoneAddress *remoteAddressCache;
LinphoneAddress *toAddressCache;
mutable char *referToCache;
char *remoteContactCache;
char *remoteUserAgentCache;
mutable char *toHeaderCache;
......@@ -56,12 +57,10 @@ L_DECLARE_C_OBJECT_IMPL_WITH_XTORS(Call,
LinphonePrivate::SalOp *op;
LinphoneCallState transfer_state; /*idle if no transfer*/
MSAudioEndpoint *endpoint; /*used for conferencing*/
char *refer_to;
LinphoneCall *referer; /*when this call is the result of a transfer, referer is set to the original call that caused the transfer*/
LinphoneCall *transfer_target;/*if this call received a transfer request, then transfer_target points to the new call created to the refer target */
LinphoneChatRoom *chat_room;
LinphoneConference *conf_ref; /**> Point on the associated conference if this call is part of a conference. NULL instead. */
bool_t refer_pending;
)
static void _linphone_call_constructor (LinphoneCall *call) {
......@@ -86,6 +85,8 @@ static void _linphone_call_destructor (LinphoneCall *call) {
linphone_address_unref(call->remoteAddressCache);
if (call->toAddressCache)
linphone_address_unref(call->toAddressCache);
if (call->referToCache)
bctbx_free(call->referToCache);
if (call->remoteContactCache)
bctbx_free(call->remoteContactCache);
if (call->remoteUserAgentCache)
......@@ -97,10 +98,6 @@ static void _linphone_call_destructor (LinphoneCall *call) {
call->op->release();
call->op=nullptr;
}
if (call->refer_to){
ms_free(call->refer_to);
call->refer_to=nullptr;
}
if (call->referer){
linphone_call_unref(call->referer);
call->referer=nullptr;
......@@ -142,18 +139,6 @@ static bool_t linphone_call_sound_resources_available (LinphoneCall *call) {
void linphone_call_stop_media_streams (LinphoneCall *call) {}
void linphone_call_set_transfer_state (LinphoneCall *call, LinphoneCallState state) {
#if 0
if (state != call->transfer_state) {
ms_message("Transfer state for call [%p] changed from [%s] to [%s]",call
,linphone_call_state_to_string(call->transfer_state)
,linphone_call_state_to_string(state));
call->transfer_state = state;
linphone_call_notify_transfer_state_changed(call, state);
}
#endif
}
/* Internal version that does not play tone indication*/
int _linphone_call_pause (LinphoneCall *call) {
return 0;
......@@ -299,35 +284,31 @@ LinphoneCallLog *linphone_call_get_call_log (const LinphoneCall *call) {
}
const char *linphone_call_get_refer_to (const LinphoneCall *call) {
#if 0
return call->refer_to;
#else
return nullptr;
#endif
string referTo = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getReferTo();
if (referTo.empty())
return nullptr;
if (call->referToCache)
bctbx_free(call->referToCache);
call->referToCache = bctbx_strdup(referTo.c_str());
return call->referToCache;
}
bool_t linphone_call_has_transfer_pending (const LinphoneCall *call) {
#if 0
return call->refer_pending;
#else
return FALSE;
#endif
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->hasTransferPending();
}
LinphoneCall *linphone_call_get_transferer_call (const LinphoneCall *call) {
#if 0
return call->referer;
#else
return nullptr;
#endif
shared_ptr<LinphonePrivate::Call> referer = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getReferer();
if (!referer)
return nullptr;
return L_GET_C_BACK_PTR(referer);
}
LinphoneCall *linphone_call_get_transfer_target_call (const LinphoneCall *call) {
#if 0
return call->transfer_target;
#else
return nullptr;
#endif
shared_ptr<LinphonePrivate::Call> transferTarget = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getTransferTarget();
if (!transferTarget)
return nullptr;
return L_GET_C_BACK_PTR(transferTarget);
}
LinphoneCall *linphone_call_get_replaced_call (LinphoneCall *call) {
......@@ -430,11 +411,7 @@ void linphone_call_set_next_video_frame_decoded_callback (LinphoneCall *call, Li
}
LinphoneCallState linphone_call_get_transfer_state (LinphoneCall *call) {
#if 0
return call->transfer_state;
#else
return LinphoneCallIdle;
#endif
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->getTransferState();
}
void linphone_call_zoom_video (LinphoneCall* call, float zoom_factor, float* cx, float* cy) {
......@@ -559,36 +536,12 @@ LinphoneStatus linphone_call_accept_update (LinphoneCall *call, const LinphoneCa
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->acceptUpdate(params ? L_GET_CPP_PTR_FROM_C_OBJECT(params) : nullptr);
}
LinphoneStatus linphone_call_transfer (LinphoneCall *call, const char *refer_to) {
#if 0
char *real_url = nullptr;
LinphoneCore *lc = linphone_call_get_core(call);
LinphoneAddress *real_parsed_url = linphone_core_interpret_url(lc, refer_to);
if (!real_parsed_url) {
/* bad url */
return -1;
}
//lc->call = nullptr; // Do not do that you will lose the call afterward...
real_url = linphone_address_as_string(real_parsed_url);
sal_call_refer(call->op, real_url);
ms_free(real_url);
linphone_address_unref(real_parsed_url);
linphone_call_set_transfer_state(call, LinphoneCallOutgoingInit);
return 0;
#else
return 0;
#endif
LinphoneStatus linphone_call_transfer (LinphoneCall *call, const char *referTo) {
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->transfer(referTo);
}
LinphoneStatus linphone_call_transfer_to_another (LinphoneCall *call, LinphoneCall *dest) {
#if 0
int result = sal_call_refer_with_replaces (call->op, dest->op);
linphone_call_set_transfer_state(call, LinphoneCallOutgoingInit);
return result;
#else
return 0;
#endif
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->transfer(L_GET_CPP_PTR_FROM_C_OBJECT(dest));
}
void *linphone_call_get_native_video_window_id (const LinphoneCall *call) {
......
......@@ -44,7 +44,9 @@ public:
void iterate (time_t currentRealTime, bool oneSecondElapsed);
void startIncomingNotification ();
void pauseForTransfer ();
int startInvite (const Address *destination);
std::shared_ptr<Call> startReferredCall (const MediaSessionParams *params);
virtual std::shared_ptr<CallSession> getActiveSession () const { return nullptr; }
bool getAudioMuted () const;
......@@ -71,7 +73,9 @@ private:
bool onCallSessionAccepted (const std::shared_ptr<const CallSession> &session) override;
void onCallSessionSetReleased (const std::shared_ptr<const CallSession> &session) override;
void onCallSessionSetTerminated (const std::shared_ptr<const CallSession> &session) override;
void onCallSessionStartReferred (const std::shared_ptr<const CallSession> &session) override;
void onCallSessionStateChanged (const std::shared_ptr<const CallSession> &session, LinphoneCallState state, const std::string &message) override;
void onCallSessionTransferStateChanged (const std::shared_ptr<const CallSession> &session, LinphoneCallState state) override;
void onCheckForAcceptation (const std::shared_ptr<const CallSession> &session) override;
void onDtmfReceived (const std::shared_ptr<const CallSession> &session, char dtmf) override;
void onIncomingCallSessionNotified (const std::shared_ptr<const CallSession> &session) override;
......
......@@ -19,6 +19,7 @@
#include "c-wrapper/c-wrapper.h"
#include "call-p.h"
#include "conference/params/media-session-params-p.h"
#include "conference/session/call-session-p.h"
#include "conference/session/media-session-p.h"
#include "core/core-p.h"
......@@ -76,10 +77,39 @@ void CallPrivate::startIncomingNotification () {
getActiveSession()->startIncomingNotification();
}
void CallPrivate::pauseForTransfer () {
static_pointer_cast<MediaSession>(getActiveSession())->getPrivate()->pauseForTransfer();
}
int CallPrivate::startInvite (const Address *destination) {
return getActiveSession()->startInvite(destination, "");
}
shared_ptr<Call> CallPrivate::startReferredCall (const MediaSessionParams *params) {
L_Q();
if (q->getState() != LinphoneCallPaused) {
pauseForTransfer();
}
MediaSessionParams msp;
if (params)
msp = *params;
else {
msp.initDefault(q->getCore());
msp.enableAudio(q->getCurrentParams()->audioEnabled());
msp.enableVideo(q->getCurrentParams()->videoEnabled());
}
lInfo() << "Starting new call to referred address " << q->getReferTo();
L_GET_PRIVATE(&msp)->setReferer(getActiveSession());
L_GET_PRIVATE(getActiveSession())->setReferPending(false);
LinphoneCall *newCall = linphone_core_invite_with_params(
q->getCore()->getCCore(), q->getReferTo().c_str(), L_GET_C_BACK_PTR(&msp));
if (newCall) {
getActiveSession()->getPrivate()->setTransferTarget(L_GET_PRIVATE_FROM_C_OBJECT(newCall)->getActiveSession());
L_GET_PRIVATE_FROM_C_OBJECT(newCall)->getActiveSession()->getPrivate()->notifyReferState();
}
return L_GET_CPP_PTR_FROM_C_OBJECT(newCall);
}
// -----------------------------------------------------------------------------
void CallPrivate::createPlayer () const {
......@@ -125,28 +155,28 @@ void CallPrivate::terminateBecauseOfLostMedia () {
// -----------------------------------------------------------------------------
void CallPrivate::onAckBeingSent (const std::shared_ptr<const CallSession> &session, LinphoneHeaders *headers) {
void CallPrivate::onAckBeingSent (const shared_ptr<const CallSession> &session, LinphoneHeaders *headers) {
L_Q();
linphone_call_notify_ack_processing(L_GET_C_BACK_PTR(q), headers, false);
}
void CallPrivate::onAckReceived (const std::shared_ptr<const CallSession> &session, LinphoneHeaders *headers) {
void CallPrivate::onAckReceived (const shared_ptr<const CallSession> &session, LinphoneHeaders *headers) {
L_Q();
linphone_call_notify_ack_processing(L_GET_C_BACK_PTR(q), headers, true);
}
void CallPrivate::onBackgroundTaskToBeStarted (const std::shared_ptr<const CallSession> &session) {
void CallPrivate::onBackgroundTaskToBeStarted (const shared_ptr<const CallSession> &session) {
backgroundTaskId = sal_begin_background_task("liblinphone call notification", nullptr, nullptr);
}
void CallPrivate::onBackgroundTaskToBeStopped (const std::shared_ptr<const CallSession> &session) {
void CallPrivate::onBackgroundTaskToBeStopped (const shared_ptr<const CallSession> &session) {
if (backgroundTaskId != 0) {
sal_end_background_task(backgroundTaskId);
backgroundTaskId = 0;
}
}
bool CallPrivate::onCallSessionAccepted (const std::shared_ptr<const CallSession> &session) {
bool CallPrivate::onCallSessionAccepted (const shared_ptr<const CallSession> &session) {
L_Q();
LinphoneCore *lc = q->getCore()->getCCore();
bool wasRinging = false;
......@@ -167,12 +197,12 @@ bool CallPrivate::onCallSessionAccepted (const std::shared_ptr<const CallSession
return wasRinging;
}
void CallPrivate::onCallSessionSetReleased (const std::shared_ptr<const CallSession> &session) {
void CallPrivate::onCallSessionSetReleased (const shared_ptr<const CallSession> &session) {
L_Q();
linphone_call_unref(L_GET_C_BACK_PTR(q));
}
void CallPrivate::onCallSessionSetTerminated (const std::shared_ptr<const CallSession> &session) {
void CallPrivate::onCallSessionSetTerminated (const shared_ptr<const CallSession> &session) {
L_Q();
LinphoneCore *core = q->getCore()->getCCore();
if (q->getSharedFromThis() == q->getCore()->getCurrentCall()) {
......@@ -197,12 +227,21 @@ void CallPrivate::onCallSessionSetTerminated (const std::shared_ptr<const CallSe
ms_bandwidth_controller_reset_state(core->bw_controller);
}
void CallPrivate::onCallSessionStateChanged (const std::shared_ptr<const CallSession> &session, LinphoneCallState state, const string &message) {
void CallPrivate::onCallSessionStartReferred (const shared_ptr<const CallSession> &session) {
startReferredCall(nullptr);
}
void CallPrivate::onCallSessionStateChanged (const shared_ptr<const CallSession> &session, LinphoneCallState state, const string &message) {
L_Q();
linphone_call_notify_state_changed(L_GET_C_BACK_PTR(q), state, message.c_str());
}
void CallPrivate::onCheckForAcceptation (const std::shared_ptr<const CallSession> &session) {
void CallPrivate::onCallSessionTransferStateChanged (const shared_ptr<const CallSession> &session, LinphoneCallState state) {
L_Q();
linphone_call_notify_transfer_state_changed(L_GET_C_BACK_PTR(q), state);
}
void CallPrivate::onCheckForAcceptation (const shared_ptr<const CallSession> &session) {
L_Q();
LinphoneCall *lcall = L_GET_C_BACK_PTR(q);
bctbx_list_t *copy = bctbx_list_copy(linphone_core_get_calls(q->getCore()->getCCore()));
......@@ -225,23 +264,23 @@ void CallPrivate::onCheckForAcceptation (const std::shared_ptr<const CallSession
bctbx_list_free(copy);
}
void CallPrivate::onDtmfReceived (const std::shared_ptr<const CallSession> &session, char dtmf) {
void CallPrivate::onDtmfReceived (const shared_ptr<const CallSession> &session, char dtmf) {
L_Q();
linphone_call_notify_dtmf_received(L_GET_C_BACK_PTR(q), dtmf);
}
void CallPrivate::onIncomingCallSessionNotified (const std::shared_ptr<const CallSession> &session) {
void CallPrivate::onIncomingCallSessionNotified (const shared_ptr<const CallSession> &session) {
L_Q();
/* The call is acceptable so we can now add it to our list */
q->getCore()->getPrivate()->addCall(q->getSharedFromThis());
}
void CallPrivate::onIncomingCallSessionStarted (const std::shared_ptr<const CallSession> &session) {
void CallPrivate::onIncomingCallSessionStarted (const shared_ptr<const CallSession> &session) {
L_Q();
linphone_core_notify_incoming_call(q->getCore()->getCCore(), L_GET_C_BACK_PTR(q));
}
void CallPrivate::onIncomingCallSessionTimeoutCheck (const std::shared_ptr<const CallSession> &session, int elapsed, bool oneSecondElapsed) {
void CallPrivate::onIncomingCallSessionTimeoutCheck (const shared_ptr<const CallSession> &session, int elapsed, bool oneSecondElapsed) {
L_Q();
if (oneSecondElapsed)
lInfo() << "Incoming call ringing for " << elapsed << " seconds";
......@@ -253,12 +292,12 @@ void CallPrivate::onIncomingCallSessionTimeoutCheck (const std::shared_ptr<const
}
}
void CallPrivate::onInfoReceived (const std::shared_ptr<const CallSession> &session, const LinphoneInfoMessage *im) {
void CallPrivate::onInfoReceived (const shared_ptr<const CallSession> &session, const LinphoneInfoMessage *im) {
L_Q();
linphone_call_notify_info_message_received(L_GET_C_BACK_PTR(q), im);
}
void CallPrivate::onNoMediaTimeoutCheck (const std::shared_ptr<const CallSession> &session, bool oneSecondElapsed) {
void CallPrivate::onNoMediaTimeoutCheck (const shared_ptr<const CallSession> &session, bool oneSecondElapsed) {
L_Q();
int disconnectTimeout = linphone_core_get_nortp_timeout(q->getCore()->getCCore());
bool disconnected = false;
......@@ -270,27 +309,27 @@ void CallPrivate::onNoMediaTimeoutCheck (const std::shared_ptr<const CallSession
terminateBecauseOfLostMedia();
}
void CallPrivate::onEncryptionChanged (const std::shared_ptr<const CallSession> &session, bool activated, const string &authToken) {
void CallPrivate::onEncryptionChanged (const shared_ptr<const CallSession> &session, bool activated, const string &authToken) {
L_Q();
linphone_call_notify_encryption_changed(L_GET_C_BACK_PTR(q), activated, authToken.empty() ? nullptr : authToken.c_str());
}
void CallPrivate::onStatsUpdated (const std::shared_ptr<const CallSession> &session, const LinphoneCallStats *stats) {
void CallPrivate::onStatsUpdated (const shared_ptr<const CallSession> &session, const LinphoneCallStats *stats) {
L_Q();
linphone_call_notify_stats_updated(L_GET_C_BACK_PTR(q), stats);
}
void CallPrivate::onResetCurrentSession (const std::shared_ptr<const CallSession> &session) {
void CallPrivate::onResetCurrentSession (const shared_ptr<const CallSession> &session) {
L_Q();
q->getCore()->getPrivate()->setCurrentCall(nullptr);
}
void CallPrivate::onSetCurrentSession (const std::shared_ptr<const CallSession> &session) {
void CallPrivate::onSetCurrentSession (const shared_ptr<const CallSession> &session) {
L_Q();
q->getCore()->getPrivate()->setCurrentCall(q->getSharedFromThis());
}
void CallPrivate::onFirstVideoFrameDecoded (const std::shared_ptr<const CallSession> &session) {
void CallPrivate::onFirstVideoFrameDecoded (const shared_ptr<const CallSession> &session) {
L_Q();
if (nextVideoFrameDecoded._func) {
nextVideoFrameDecoded._func(L_GET_C_BACK_PTR(q), nextVideoFrameDecoded._user_data);
......@@ -299,16 +338,16 @@ void CallPrivate::onFirstVideoFrameDecoded (const std::shared_ptr<const CallSess
}
}
void CallPrivate::onResetFirstVideoFrameDecoded (const std::shared_ptr<const CallSession> &session) {
void CallPrivate::onResetFirstVideoFrameDecoded (const shared_ptr<const CallSession> &session) {
resetFirstVideoFrameDecoded();
}
void CallPrivate::onPlayErrorTone (const std::shared_ptr<const CallSession> &session, LinphoneReason reason) {
void CallPrivate::onPlayErrorTone (const shared_ptr<const CallSession> &session, LinphoneReason reason) {
L_Q();
linphone_core_play_call_error_tone(q->getCore()->getCCore(), reason);
}
void CallPrivate::onRingbackToneRequested (const std::shared_ptr<const CallSession> &session, bool requested) {
void CallPrivate::onRingbackToneRequested (const shared_ptr<const CallSession> &session, bool requested) {
L_Q();
if (requested && linphone_core_get_remote_ringback_tone(q->getCore()->getCCore()))
playingRingbackTone = true;
......@@ -316,7 +355,7 @@ void CallPrivate::onRingbackToneRequested (const std::shared_ptr<const CallSessi