mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-02-07 14:18:25 +00:00
Remove CallListener and use CallSessionListener instead.
This commit is contained in:
parent
a02165ab81
commit
8816f39974
20 changed files with 182 additions and 444 deletions
|
|
@ -28,7 +28,6 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES
|
|||
c-wrapper/c-wrapper.h
|
||||
c-wrapper/internal/c-sal.h
|
||||
c-wrapper/internal/c-tools.h
|
||||
call/call-listener.h
|
||||
call/call-p.h
|
||||
call/call.h
|
||||
call/local-conference-call-p.h
|
||||
|
|
|
|||
|
|
@ -1,71 +0,0 @@
|
|||
/*
|
||||
* call-listener.h
|
||||
* Copyright (C) 2010-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 2
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#ifndef _CALL_LISTENER_H_
|
||||
#define _CALL_LISTENER_H_
|
||||
|
||||
#include "linphone/types.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class CallListener {
|
||||
public:
|
||||
virtual ~CallListener () = default;
|
||||
|
||||
virtual void onAckBeingSent (LinphoneHeaders *headers) = 0;
|
||||
virtual void onAckReceived (LinphoneHeaders *headers) = 0;
|
||||
virtual void onBackgroundTaskToBeStarted () = 0;
|
||||
virtual void onBackgroundTaskToBeStopped () = 0;
|
||||
virtual bool onCallAccepted () = 0;
|
||||
virtual void onCallSetReleased () = 0;
|
||||
virtual void onCallSetTerminated () = 0;
|
||||
virtual void onCallStateChanged (LinphoneCallState state, const std::string &message) = 0;
|
||||
virtual void onCheckForAcceptation () = 0;
|
||||
virtual void onDtmfReceived (char dtmf) = 0;
|
||||
virtual void onIncomingCallStarted () = 0;
|
||||
virtual void onIncomingCallNotified () = 0;
|
||||
virtual void onIncomingCallTimeoutCheck (int elapsed, bool oneSecondElapsed) = 0;
|
||||
virtual void onInfoReceived (const LinphoneInfoMessage *im) = 0;
|
||||
virtual void onNoMediaTimeoutCheck (bool oneSecondElapsed) = 0;
|
||||
|
||||
virtual void onEncryptionChanged (bool activated, const std::string &authToken) = 0;
|
||||
|
||||
virtual void onStatsUpdated (const LinphoneCallStats *stats) = 0;
|
||||
|
||||
virtual void onResetCurrentCall () = 0;
|
||||
virtual void onSetCurrentCall () = 0;
|
||||
|
||||
virtual void onFirstVideoFrameDecoded () = 0;
|
||||
virtual void onResetFirstVideoFrameDecoded () = 0;
|
||||
|
||||
virtual void onPlayErrorTone (LinphoneReason reason) = 0;
|
||||
virtual void onRingbackToneRequested (bool requested) = 0;
|
||||
virtual void onStartRinging () = 0;
|
||||
virtual void onStopRinging () = 0;
|
||||
virtual void onStopRingingIfInCall () = 0;
|
||||
virtual void onStopRingingIfNeeded () = 0;
|
||||
|
||||
virtual bool isPlayingRingbackTone () = 0;
|
||||
};
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
||||
#endif // ifndef _CALL_LISTENER_H_
|
||||
|
|
@ -20,9 +20,9 @@
|
|||
#ifndef _CALL_P_H_
|
||||
#define _CALL_P_H_
|
||||
|
||||
#include "call-listener.h"
|
||||
#include "call.h"
|
||||
#include "conference/conference.h"
|
||||
#include "conference/session/call-session-listener.h"
|
||||
#include "object/object-p.h"
|
||||
|
||||
// TODO: Remove me later.
|
||||
|
|
@ -32,7 +32,9 @@
|
|||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class CallPrivate : public ObjectPrivate, public CallListener {
|
||||
class CallSession;
|
||||
|
||||
class CallPrivate : public ObjectPrivate, public CallSessionListener {
|
||||
public:
|
||||
CallPrivate () = default;
|
||||
virtual ~CallPrivate () = default;
|
||||
|
|
@ -57,38 +59,39 @@ public:
|
|||
void createPlayer () const;
|
||||
|
||||
private:
|
||||
void resetFirstVideoFrameDecoded ();
|
||||
void startRemoteRing ();
|
||||
void terminateBecauseOfLostMedia ();
|
||||
|
||||
/* CallListener */
|
||||
void onAckBeingSent (LinphoneHeaders *headers) override;
|
||||
void onAckReceived (LinphoneHeaders *headers) override;
|
||||
void onBackgroundTaskToBeStarted () override;
|
||||
void onBackgroundTaskToBeStopped () override;
|
||||
bool onCallAccepted () override;
|
||||
void onCallSetReleased () override;
|
||||
void onCallSetTerminated () override;
|
||||
void onCallStateChanged (LinphoneCallState state, const std::string &message) override;
|
||||
void onCheckForAcceptation () override;
|
||||
void onDtmfReceived (char dtmf) override;
|
||||
void onIncomingCallNotified () override;
|
||||
void onIncomingCallStarted () override;
|
||||
void onIncomingCallTimeoutCheck (int elapsed, bool oneSecondElapsed) override;
|
||||
void onInfoReceived (const LinphoneInfoMessage *im) override;
|
||||
void onNoMediaTimeoutCheck (bool oneSecondElapsed) override;
|
||||
void onEncryptionChanged (bool activated, const std::string &authToken) override;
|
||||
void onStatsUpdated (const LinphoneCallStats *stats) override;
|
||||
void onResetCurrentCall () override;
|
||||
void onSetCurrentCall () override;
|
||||
void onFirstVideoFrameDecoded () override;
|
||||
void onResetFirstVideoFrameDecoded () override;
|
||||
void onPlayErrorTone (LinphoneReason reason) override;
|
||||
void onRingbackToneRequested (bool requested) override;
|
||||
void onStartRinging () override;
|
||||
void onStopRinging () override;
|
||||
void onStopRingingIfInCall () override;
|
||||
void onStopRingingIfNeeded () override;
|
||||
bool isPlayingRingbackTone () override;
|
||||
/* CallSessionListener */
|
||||
void onAckBeingSent (const std::shared_ptr<const CallSession> &session, LinphoneHeaders *headers) override;
|
||||
void onAckReceived (const std::shared_ptr<const CallSession> &session, LinphoneHeaders *headers) override;
|
||||
void onBackgroundTaskToBeStarted (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onBackgroundTaskToBeStopped (const std::shared_ptr<const CallSession> &session) override;
|
||||
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 onCallSessionStateChanged (const std::shared_ptr<const CallSession> &session, LinphoneCallState state, const std::string &message) 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;
|
||||
void onIncomingCallSessionStarted (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onIncomingCallSessionTimeoutCheck (const std::shared_ptr<const CallSession> &session, int elapsed, bool oneSecondElapsed) override;
|
||||
void onInfoReceived (const std::shared_ptr<const CallSession> &session, const LinphoneInfoMessage *im) override;
|
||||
void onNoMediaTimeoutCheck (const std::shared_ptr<const CallSession> &session, bool oneSecondElapsed) override;
|
||||
void onEncryptionChanged (const std::shared_ptr<const CallSession> &session, bool activated, const std::string &authToken) override;
|
||||
void onStatsUpdated (const std::shared_ptr<const CallSession> &session, const LinphoneCallStats *stats) override;
|
||||
void onResetCurrentSession (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onSetCurrentSession (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onFirstVideoFrameDecoded (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onResetFirstVideoFrameDecoded (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onPlayErrorTone (const std::shared_ptr<const CallSession> &session, LinphoneReason reason) override;
|
||||
void onRingbackToneRequested (const std::shared_ptr<const CallSession> &session, bool requested) override;
|
||||
void onStartRinging (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onStopRinging (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onStopRingingIfInCall (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onStopRingingIfNeeded (const std::shared_ptr<const CallSession> &session) override;
|
||||
bool isPlayingRingbackTone (const std::shared_ptr<const CallSession> &session) override;
|
||||
|
||||
mutable LinphonePlayer *player = nullptr;
|
||||
|
||||
|
|
|
|||
|
|
@ -89,6 +89,13 @@ void CallPrivate::createPlayer () const {
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void CallPrivate::resetFirstVideoFrameDecoded () {
|
||||
#ifdef VIDEO_ENABLED
|
||||
if (nextVideoFrameDecoded._func)
|
||||
static_cast<MediaSession *>(getActiveSession().get())->resetFirstVideoFrameDecoded();
|
||||
#endif // ifdef VIDEO_ENABLED
|
||||
}
|
||||
|
||||
void CallPrivate::startRemoteRing () {
|
||||
L_Q();
|
||||
LinphoneCore *lc = q->getCore()->getCCore();
|
||||
|
|
@ -118,28 +125,28 @@ void CallPrivate::terminateBecauseOfLostMedia () {
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void CallPrivate::onAckBeingSent (LinphoneHeaders *headers) {
|
||||
void CallPrivate::onAckBeingSent (const std::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 (LinphoneHeaders *headers) {
|
||||
void CallPrivate::onAckReceived (const std::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 () {
|
||||
void CallPrivate::onBackgroundTaskToBeStarted (const std::shared_ptr<const CallSession> &session) {
|
||||
backgroundTaskId = sal_begin_background_task("liblinphone call notification", nullptr, nullptr);
|
||||
}
|
||||
|
||||
void CallPrivate::onBackgroundTaskToBeStopped () {
|
||||
void CallPrivate::onBackgroundTaskToBeStopped (const std::shared_ptr<const CallSession> &session) {
|
||||
if (backgroundTaskId != 0) {
|
||||
sal_end_background_task(backgroundTaskId);
|
||||
backgroundTaskId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
bool CallPrivate::onCallAccepted () {
|
||||
bool CallPrivate::onCallSessionAccepted (const std::shared_ptr<const CallSession> &session) {
|
||||
L_Q();
|
||||
LinphoneCore *lc = q->getCore()->getCCore();
|
||||
bool wasRinging = false;
|
||||
|
|
@ -160,12 +167,12 @@ bool CallPrivate::onCallAccepted () {
|
|||
return wasRinging;
|
||||
}
|
||||
|
||||
void CallPrivate::onCallSetReleased () {
|
||||
void CallPrivate::onCallSessionSetReleased (const std::shared_ptr<const CallSession> &session) {
|
||||
L_Q();
|
||||
linphone_call_unref(L_GET_C_BACK_PTR(q));
|
||||
}
|
||||
|
||||
void CallPrivate::onCallSetTerminated () {
|
||||
void CallPrivate::onCallSessionSetTerminated (const std::shared_ptr<const CallSession> &session) {
|
||||
L_Q();
|
||||
LinphoneCore *core = q->getCore()->getCCore();
|
||||
if (q->getSharedFromThis() == q->getCore()->getCurrentCall()) {
|
||||
|
|
@ -190,12 +197,12 @@ void CallPrivate::onCallSetTerminated () {
|
|||
ms_bandwidth_controller_reset_state(core->bw_controller);
|
||||
}
|
||||
|
||||
void CallPrivate::onCallStateChanged (LinphoneCallState state, const string &message) {
|
||||
void CallPrivate::onCallSessionStateChanged (const std::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 () {
|
||||
void CallPrivate::onCheckForAcceptation (const std::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()));
|
||||
|
|
@ -218,23 +225,23 @@ void CallPrivate::onCheckForAcceptation () {
|
|||
bctbx_list_free(copy);
|
||||
}
|
||||
|
||||
void CallPrivate::onDtmfReceived (char dtmf) {
|
||||
void CallPrivate::onDtmfReceived (const std::shared_ptr<const CallSession> &session, char dtmf) {
|
||||
L_Q();
|
||||
linphone_call_notify_dtmf_received(L_GET_C_BACK_PTR(q), dtmf);
|
||||
}
|
||||
|
||||
void CallPrivate::onIncomingCallNotified () {
|
||||
void CallPrivate::onIncomingCallSessionNotified (const std::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::onIncomingCallStarted () {
|
||||
void CallPrivate::onIncomingCallSessionStarted (const std::shared_ptr<const CallSession> &session) {
|
||||
L_Q();
|
||||
linphone_core_notify_incoming_call(q->getCore()->getCCore(), L_GET_C_BACK_PTR(q));
|
||||
}
|
||||
|
||||
void CallPrivate::onIncomingCallTimeoutCheck (int elapsed, bool oneSecondElapsed) {
|
||||
void CallPrivate::onIncomingCallSessionTimeoutCheck (const std::shared_ptr<const CallSession> &session, int elapsed, bool oneSecondElapsed) {
|
||||
L_Q();
|
||||
if (oneSecondElapsed)
|
||||
lInfo() << "Incoming call ringing for " << elapsed << " seconds";
|
||||
|
|
@ -246,12 +253,12 @@ void CallPrivate::onIncomingCallTimeoutCheck (int elapsed, bool oneSecondElapsed
|
|||
}
|
||||
}
|
||||
|
||||
void CallPrivate::onInfoReceived (const LinphoneInfoMessage *im) {
|
||||
void CallPrivate::onInfoReceived (const std::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 (bool oneSecondElapsed) {
|
||||
void CallPrivate::onNoMediaTimeoutCheck (const std::shared_ptr<const CallSession> &session, bool oneSecondElapsed) {
|
||||
L_Q();
|
||||
int disconnectTimeout = linphone_core_get_nortp_timeout(q->getCore()->getCCore());
|
||||
bool disconnected = false;
|
||||
|
|
@ -263,27 +270,27 @@ void CallPrivate::onNoMediaTimeoutCheck (bool oneSecondElapsed) {
|
|||
terminateBecauseOfLostMedia();
|
||||
}
|
||||
|
||||
void CallPrivate::onEncryptionChanged (bool activated, const string &authToken) {
|
||||
void CallPrivate::onEncryptionChanged (const std::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 LinphoneCallStats *stats) {
|
||||
void CallPrivate::onStatsUpdated (const std::shared_ptr<const CallSession> &session, const LinphoneCallStats *stats) {
|
||||
L_Q();
|
||||
linphone_call_notify_stats_updated(L_GET_C_BACK_PTR(q), stats);
|
||||
}
|
||||
|
||||
void CallPrivate::onResetCurrentCall () {
|
||||
void CallPrivate::onResetCurrentSession (const std::shared_ptr<const CallSession> &session) {
|
||||
L_Q();
|
||||
q->getCore()->getPrivate()->setCurrentCall(nullptr);
|
||||
}
|
||||
|
||||
void CallPrivate::onSetCurrentCall () {
|
||||
void CallPrivate::onSetCurrentSession (const std::shared_ptr<const CallSession> &session) {
|
||||
L_Q();
|
||||
q->getCore()->getPrivate()->setCurrentCall(q->getSharedFromThis());
|
||||
}
|
||||
|
||||
void CallPrivate::onFirstVideoFrameDecoded () {
|
||||
void CallPrivate::onFirstVideoFrameDecoded (const std::shared_ptr<const CallSession> &session) {
|
||||
L_Q();
|
||||
if (nextVideoFrameDecoded._func) {
|
||||
nextVideoFrameDecoded._func(L_GET_C_BACK_PTR(q), nextVideoFrameDecoded._user_data);
|
||||
|
|
@ -292,19 +299,16 @@ void CallPrivate::onFirstVideoFrameDecoded () {
|
|||
}
|
||||
}
|
||||
|
||||
void CallPrivate::onResetFirstVideoFrameDecoded () {
|
||||
#ifdef VIDEO_ENABLED
|
||||
if (nextVideoFrameDecoded._func)
|
||||
static_cast<MediaSession *>(getActiveSession().get())->resetFirstVideoFrameDecoded();
|
||||
#endif // ifdef VIDEO_ENABLED
|
||||
void CallPrivate::onResetFirstVideoFrameDecoded (const std::shared_ptr<const CallSession> &session) {
|
||||
resetFirstVideoFrameDecoded();
|
||||
}
|
||||
|
||||
void CallPrivate::onPlayErrorTone (LinphoneReason reason) {
|
||||
void CallPrivate::onPlayErrorTone (const std::shared_ptr<const CallSession> &session, LinphoneReason reason) {
|
||||
L_Q();
|
||||
linphone_core_play_call_error_tone(q->getCore()->getCCore(), reason);
|
||||
}
|
||||
|
||||
void CallPrivate::onRingbackToneRequested (bool requested) {
|
||||
void CallPrivate::onRingbackToneRequested (const std::shared_ptr<const CallSession> &session, bool requested) {
|
||||
L_Q();
|
||||
if (requested && linphone_core_get_remote_ringback_tone(q->getCore()->getCCore()))
|
||||
playingRingbackTone = true;
|
||||
|
|
@ -312,7 +316,7 @@ void CallPrivate::onRingbackToneRequested (bool requested) {
|
|||
playingRingbackTone = false;
|
||||
}
|
||||
|
||||
void CallPrivate::onStartRinging () {
|
||||
void CallPrivate::onStartRinging (const std::shared_ptr<const CallSession> &session) {
|
||||
L_Q();
|
||||
LinphoneCore *lc = q->getCore()->getCCore();
|
||||
if (lc->ringstream)
|
||||
|
|
@ -320,12 +324,12 @@ void CallPrivate::onStartRinging () {
|
|||
startRemoteRing();
|
||||
}
|
||||
|
||||
void CallPrivate::onStopRinging () {
|
||||
void CallPrivate::onStopRinging (const std::shared_ptr<const CallSession> &session) {
|
||||
L_Q();
|
||||
linphone_core_stop_ringing(q->getCore()->getCCore());
|
||||
}
|
||||
|
||||
void CallPrivate::onStopRingingIfInCall () {
|
||||
void CallPrivate::onStopRingingIfInCall (const std::shared_ptr<const CallSession> &session) {
|
||||
L_Q();
|
||||
LinphoneCore *lc = q->getCore()->getCCore();
|
||||
// We stop the ring only if we have this current call or if we are in call
|
||||
|
|
@ -334,7 +338,7 @@ void CallPrivate::onStopRingingIfInCall () {
|
|||
}
|
||||
}
|
||||
|
||||
void CallPrivate::onStopRingingIfNeeded () {
|
||||
void CallPrivate::onStopRingingIfNeeded (const std::shared_ptr<const CallSession> &session) {
|
||||
L_Q();
|
||||
LinphoneCore *lc = q->getCore()->getCCore();
|
||||
bool stopRinging = true;
|
||||
|
|
@ -350,7 +354,7 @@ void CallPrivate::onStopRingingIfNeeded () {
|
|||
linphone_core_stop_ringing(lc);
|
||||
}
|
||||
|
||||
bool CallPrivate::isPlayingRingbackTone () {
|
||||
bool CallPrivate::isPlayingRingbackTone (const std::shared_ptr<const CallSession> &session) {
|
||||
return playingRingbackTone;
|
||||
}
|
||||
|
||||
|
|
@ -711,7 +715,7 @@ void Call::setNextVideoFrameDecodedCallback (LinphoneCallCbFunc cb, void *user_d
|
|||
L_D();
|
||||
d->nextVideoFrameDecoded._func = cb;
|
||||
d->nextVideoFrameDecoded._user_data = user_data;
|
||||
d->onResetFirstVideoFrameDecoded();
|
||||
d->resetFirstVideoFrameDecoded();
|
||||
}
|
||||
|
||||
void Call::setParams (const MediaSessionParams *msp) {
|
||||
|
|
|
|||
|
|
@ -22,12 +22,13 @@
|
|||
|
||||
#include "chat/chat-room/chat-room-p.h"
|
||||
#include "client-group-chat-room.h"
|
||||
#include "conference/session/call-session-listener.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class ClientGroupChatRoomPrivate : public ChatRoomPrivate {
|
||||
class ClientGroupChatRoomPrivate : public ChatRoomPrivate, public CallSessionListener {
|
||||
public:
|
||||
ClientGroupChatRoomPrivate () = default;
|
||||
|
||||
|
|
@ -37,6 +38,10 @@ public:
|
|||
void multipartNotifyReceived (const std::string &body);
|
||||
|
||||
private:
|
||||
// CallSessionListener
|
||||
void onCallSessionSetReleased (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 onChatMessageReceived (const std::shared_ptr<ChatMessage> &chatMessage) override;
|
||||
|
||||
L_DECLARE_PUBLIC(ClientGroupChatRoom);
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ shared_ptr<CallSession> ClientGroupChatRoomPrivate::createSession () {
|
|||
csp.addCustomContactParameter("text");
|
||||
|
||||
shared_ptr<Participant> focus = qConference->getPrivate()->focus;
|
||||
shared_ptr<CallSession> session = focus->getPrivate()->createSession(*q, &csp, false, q);
|
||||
shared_ptr<CallSession> session = focus->getPrivate()->createSession(*q, &csp, false, this);
|
||||
const Address &myAddress = q->getMe()->getAddress();
|
||||
Address myCleanedAddress(myAddress);
|
||||
myCleanedAddress.setUriParam("gr"); // Remove gr parameter for INVITE
|
||||
|
|
@ -81,6 +81,41 @@ void ClientGroupChatRoomPrivate::multipartNotifyReceived (const string &body) {
|
|||
qConference->getPrivate()->eventHandler->multipartNotifyReceived(body);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ClientGroupChatRoomPrivate::onCallSessionSetReleased (const shared_ptr<const CallSession> &session) {
|
||||
L_Q_T(RemoteConference, qConference);
|
||||
|
||||
ParticipantPrivate *participantPrivate = qConference->getPrivate()->focus->getPrivate();
|
||||
if (session == participantPrivate->getSession())
|
||||
participantPrivate->removeSession();
|
||||
}
|
||||
|
||||
void ClientGroupChatRoomPrivate::onCallSessionStateChanged (
|
||||
const shared_ptr<const CallSession> &session,
|
||||
LinphoneCallState newState,
|
||||
const string &message
|
||||
) {
|
||||
L_Q();
|
||||
L_Q_T(RemoteConference, qConference);
|
||||
|
||||
if (newState == LinphoneCallConnected) {
|
||||
if (state == ChatRoom::State::CreationPending) {
|
||||
IdentityAddress addr(session->getRemoteContactAddress()->asStringUriOnly());
|
||||
q->onConferenceCreated(addr);
|
||||
if (session->getRemoteContactAddress()->hasParam("isfocus"))
|
||||
qConference->getPrivate()->eventHandler->subscribe(q->getChatRoomId());
|
||||
} else if (state == ChatRoom::State::TerminationPending)
|
||||
qConference->getPrivate()->focus->getPrivate()->getSession()->terminate();
|
||||
} else if ((newState == LinphoneCallReleased) && (state == ChatRoom::State::TerminationPending)) {
|
||||
q->onConferenceTerminated(q->getConferenceAddress());
|
||||
} else if ((newState == LinphoneCallError) && (state == ChatRoom::State::CreationPending)) {
|
||||
setState(ChatRoom::State::CreationFailed);
|
||||
}
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ClientGroupChatRoomPrivate::onChatMessageReceived (const shared_ptr<ChatMessage> &) {}
|
||||
|
||||
// =============================================================================
|
||||
|
|
@ -475,37 +510,4 @@ void ClientGroupChatRoom::onParticipantDeviceRemoved (const shared_ptr<Conferenc
|
|||
cb(cr, L_GET_C_BACK_PTR(event));
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ClientGroupChatRoom::onCallSessionSetReleased (const shared_ptr<const CallSession> &session) {
|
||||
L_D_T(RemoteConference, dConference);
|
||||
|
||||
ParticipantPrivate *participantPrivate = dConference->focus->getPrivate();
|
||||
if (session == participantPrivate->getSession())
|
||||
participantPrivate->removeSession();
|
||||
}
|
||||
|
||||
void ClientGroupChatRoom::onCallSessionStateChanged (
|
||||
const shared_ptr<const CallSession> &session,
|
||||
LinphoneCallState state,
|
||||
const string &message
|
||||
) {
|
||||
L_D();
|
||||
L_D_T(RemoteConference, dConference);
|
||||
|
||||
if (state == LinphoneCallConnected) {
|
||||
if (d->state == ChatRoom::State::CreationPending) {
|
||||
IdentityAddress addr(session->getRemoteContactAddress()->asStringUriOnly());
|
||||
onConferenceCreated(addr);
|
||||
if (session->getRemoteContactAddress()->hasParam("isfocus"))
|
||||
dConference->eventHandler->subscribe(getChatRoomId());
|
||||
} else if (d->state == ChatRoom::State::TerminationPending)
|
||||
dConference->focus->getPrivate()->getSession()->terminate();
|
||||
} else if ((state == LinphoneCallReleased) && (d->state == ChatRoom::State::TerminationPending)) {
|
||||
onConferenceTerminated(getConferenceAddress());
|
||||
} else if ((state == LinphoneCallError) && (d->state == ChatRoom::State::CreationPending)) {
|
||||
d->setState(ChatRoom::State::CreationFailed);
|
||||
}
|
||||
}
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -91,9 +91,6 @@ private:
|
|||
void onParticipantDeviceAdded (const std::shared_ptr<ConferenceParticipantDeviceEvent> &event, bool isFullState) override;
|
||||
void onParticipantDeviceRemoved (const std::shared_ptr<ConferenceParticipantDeviceEvent> &event, bool isFullState) override;
|
||||
|
||||
void onCallSessionSetReleased (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onCallSessionStateChanged (const std::shared_ptr<const CallSession> &session, LinphoneCallState state, const std::string &message) override;
|
||||
|
||||
L_DECLARE_PRIVATE(ClientGroupChatRoom);
|
||||
L_DISABLE_COPY(ClientGroupChatRoom);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include "address/address.h"
|
||||
#include "chat-room-p.h"
|
||||
#include "server-group-chat-room.h"
|
||||
#include "conference/session/call-session-listener.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
|
|
@ -33,7 +34,7 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
|
||||
class Participant;
|
||||
|
||||
class ServerGroupChatRoomPrivate : public ChatRoomPrivate {
|
||||
class ServerGroupChatRoomPrivate : public ChatRoomPrivate, public CallSessionListener {
|
||||
public:
|
||||
ServerGroupChatRoomPrivate () = default;
|
||||
|
||||
|
|
@ -55,6 +56,9 @@ private:
|
|||
void finalizeCreation ();
|
||||
bool isAdminLeft () const;
|
||||
|
||||
// CallSessionListener
|
||||
void onCallSessionStateChanged (const std::shared_ptr<const CallSession> &session, LinphoneCallState state, const std::string &message) override;
|
||||
|
||||
void onChatMessageReceived (const std::shared_ptr<ChatMessage> &) override;
|
||||
|
||||
std::list<std::shared_ptr<Participant>> removedParticipants;
|
||||
|
|
|
|||
|
|
@ -73,6 +73,16 @@ bool ServerGroupChatRoomPrivate::isAdminLeft () const {
|
|||
return false;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ServerGroupChatRoomPrivate::onCallSessionStateChanged (
|
||||
const shared_ptr<const CallSession> &,
|
||||
LinphoneCallState,
|
||||
const string &
|
||||
) {}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ServerGroupChatRoomPrivate::onChatMessageReceived(const shared_ptr<ChatMessage> &) {}
|
||||
|
||||
// =============================================================================
|
||||
|
|
@ -142,12 +152,4 @@ void ServerGroupChatRoom::join () {}
|
|||
|
||||
void ServerGroupChatRoom::leave () {}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void ServerGroupChatRoom::onCallSessionStateChanged (
|
||||
const shared_ptr<const CallSession> &,
|
||||
LinphoneCallState,
|
||||
const string &
|
||||
) {}
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -76,9 +76,6 @@ public:
|
|||
void leave () override;
|
||||
|
||||
private:
|
||||
// TODO: Move me in ServerGroupChatRoomPrivate.
|
||||
void onCallSessionStateChanged (const std::shared_ptr<const CallSession> &session, LinphoneCallState state, const std::string &message) override;
|
||||
|
||||
L_DECLARE_PRIVATE(ServerGroupChatRoom);
|
||||
L_DISABLE_COPY(ServerGroupChatRoom);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class CallListener;
|
||||
class CallSessionListener;
|
||||
class Participant;
|
||||
|
||||
class ConferencePrivate {
|
||||
|
|
@ -40,11 +40,11 @@ protected:
|
|||
std::shared_ptr<Participant> activeParticipant;
|
||||
std::shared_ptr<Participant> me;
|
||||
|
||||
CallSessionListener *listener = nullptr;
|
||||
|
||||
Conference *mPublic = nullptr;
|
||||
|
||||
private:
|
||||
CallListener *callListener = nullptr;
|
||||
|
||||
L_DECLARE_PUBLIC(Conference);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#include "call/call-listener.h"
|
||||
#include "conference-p.h"
|
||||
#include "conference/session/call-session-p.h"
|
||||
#include "logger/logger.h"
|
||||
|
|
@ -33,12 +32,12 @@ Conference::Conference (
|
|||
ConferencePrivate &p,
|
||||
const shared_ptr<Core> &core,
|
||||
const IdentityAddress &myAddress,
|
||||
CallListener *listener
|
||||
CallSessionListener *listener
|
||||
) : CoreAccessor(core), mPrivate(&p) {
|
||||
L_D();
|
||||
d->mPublic = this;
|
||||
d->callListener = listener;
|
||||
d->me = make_shared<Participant>(myAddress);
|
||||
d->listener = listener;
|
||||
}
|
||||
|
||||
Conference::~Conference () {
|
||||
|
|
@ -122,178 +121,6 @@ void Conference::setSubject (const string &subject) {
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void Conference::onAckBeingSent (const shared_ptr<const CallSession> &session, LinphoneHeaders *headers) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onAckBeingSent(headers);
|
||||
}
|
||||
|
||||
void Conference::onAckReceived (const shared_ptr<const CallSession> &session, LinphoneHeaders *headers) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onAckReceived(headers);
|
||||
}
|
||||
|
||||
void Conference::onBackgroundTaskToBeStarted (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onBackgroundTaskToBeStarted();
|
||||
}
|
||||
|
||||
void Conference::onBackgroundTaskToBeStopped (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onBackgroundTaskToBeStopped();
|
||||
}
|
||||
|
||||
bool Conference::onCallSessionAccepted (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
return d->callListener->onCallAccepted();
|
||||
return false;
|
||||
}
|
||||
|
||||
void Conference::onCallSessionSetReleased (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onCallSetReleased();
|
||||
}
|
||||
|
||||
void Conference::onCallSessionSetTerminated (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onCallSetTerminated();
|
||||
}
|
||||
|
||||
void Conference::onCallSessionStateChanged (const shared_ptr<const CallSession> &session, LinphoneCallState state, const string &message) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onCallStateChanged(state, message);
|
||||
}
|
||||
|
||||
void Conference::onCheckForAcceptation (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onCheckForAcceptation();
|
||||
}
|
||||
|
||||
void Conference::onDtmfReceived (const shared_ptr<const CallSession> &session, char dtmf) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onDtmfReceived(dtmf);
|
||||
}
|
||||
|
||||
void Conference::onIncomingCallSessionNotified (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onIncomingCallNotified();
|
||||
}
|
||||
|
||||
void Conference::onIncomingCallSessionStarted (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onIncomingCallStarted();
|
||||
}
|
||||
|
||||
void Conference::onIncomingCallSessionTimeoutCheck (const shared_ptr<const CallSession> &session, int elapsed, bool oneSecondElapsed) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onIncomingCallTimeoutCheck(elapsed, oneSecondElapsed);
|
||||
}
|
||||
|
||||
void Conference::onInfoReceived (const shared_ptr<const CallSession> &session, const LinphoneInfoMessage *im) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onInfoReceived(im);
|
||||
}
|
||||
|
||||
void Conference::onNoMediaTimeoutCheck (const shared_ptr<const CallSession> &session, bool oneSecondElapsed) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onNoMediaTimeoutCheck(oneSecondElapsed);
|
||||
}
|
||||
|
||||
void Conference::onEncryptionChanged (const shared_ptr<const CallSession> &session, bool activated, const string &authToken) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onEncryptionChanged(activated, authToken);
|
||||
}
|
||||
|
||||
void Conference::onStatsUpdated (const LinphoneCallStats *stats) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onStatsUpdated(stats);
|
||||
}
|
||||
|
||||
void Conference::onResetCurrentSession (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onResetCurrentCall();
|
||||
}
|
||||
|
||||
void Conference::onSetCurrentSession (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onSetCurrentCall();
|
||||
}
|
||||
|
||||
void Conference::onFirstVideoFrameDecoded (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onFirstVideoFrameDecoded();
|
||||
}
|
||||
|
||||
void Conference::onResetFirstVideoFrameDecoded (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onResetFirstVideoFrameDecoded();
|
||||
}
|
||||
|
||||
void Conference::onPlayErrorTone (const shared_ptr<const CallSession> &session, LinphoneReason reason) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onPlayErrorTone(reason);
|
||||
}
|
||||
|
||||
void Conference::onRingbackToneRequested (const shared_ptr<const CallSession> &session, bool requested) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onRingbackToneRequested(requested);
|
||||
}
|
||||
|
||||
void Conference::onStartRinging (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onStartRinging();
|
||||
}
|
||||
|
||||
void Conference::onStopRinging (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onStopRinging();
|
||||
}
|
||||
|
||||
void Conference::onStopRingingIfInCall (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onStopRingingIfInCall();
|
||||
}
|
||||
|
||||
void Conference::onStopRingingIfNeeded (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
d->callListener->onStopRingingIfNeeded();
|
||||
}
|
||||
|
||||
bool Conference::isPlayingRingbackTone (const shared_ptr<const CallSession> &session) {
|
||||
L_D();
|
||||
if (d->callListener)
|
||||
return d->callListener->isPlayingRingbackTone();
|
||||
return false;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
shared_ptr<Participant> Conference::findParticipant (const IdentityAddress &addr) const {
|
||||
L_D();
|
||||
|
||||
|
|
|
|||
|
|
@ -23,20 +23,19 @@
|
|||
#include "linphone/types.h"
|
||||
|
||||
#include "conference/conference-interface.h"
|
||||
#include "conference/session/call-session-listener.h"
|
||||
#include "core/core-accessor.h"
|
||||
|
||||
// =============================================================================
|
||||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class CallListener;
|
||||
class CallSession;
|
||||
class CallSessionListener;
|
||||
class CallSessionPrivate;
|
||||
class ConferencePrivate;
|
||||
|
||||
class LINPHONE_PUBLIC Conference :
|
||||
public ConferenceInterface,
|
||||
public CallSessionListener,
|
||||
public CoreAccessor {
|
||||
friend class CallSessionPrivate;
|
||||
|
||||
|
|
@ -64,43 +63,12 @@ public:
|
|||
void setParticipantAdminStatus (std::shared_ptr<Participant> &participant, bool isAdmin) override;
|
||||
void setSubject (const std::string &subject) override;
|
||||
|
||||
private:
|
||||
/* CallSessionListener */
|
||||
void onAckBeingSent (const std::shared_ptr<const CallSession> &session, LinphoneHeaders *headers) override;
|
||||
void onAckReceived (const std::shared_ptr<const CallSession> &session, LinphoneHeaders *headers) override;
|
||||
void onBackgroundTaskToBeStarted (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onBackgroundTaskToBeStopped (const std::shared_ptr<const CallSession> &session) override;
|
||||
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 onCallSessionStateChanged (const std::shared_ptr<const CallSession> &session, LinphoneCallState state, const std::string &message) 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;
|
||||
void onIncomingCallSessionStarted (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onIncomingCallSessionTimeoutCheck (const std::shared_ptr<const CallSession> &session, int elapsed, bool oneSecondElapsed) override;
|
||||
void onInfoReceived (const std::shared_ptr<const CallSession> &session, const LinphoneInfoMessage *im) override;
|
||||
void onNoMediaTimeoutCheck (const std::shared_ptr<const CallSession> &session, bool oneSecondElapsed) override;
|
||||
void onEncryptionChanged (const std::shared_ptr<const CallSession> &session, bool activated, const std::string &authToken) override;
|
||||
void onStatsUpdated (const LinphoneCallStats *stats) override;
|
||||
void onResetCurrentSession (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onSetCurrentSession (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onFirstVideoFrameDecoded (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onResetFirstVideoFrameDecoded (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onPlayErrorTone (const std::shared_ptr<const CallSession> &session, LinphoneReason reason) override;
|
||||
void onRingbackToneRequested (const std::shared_ptr<const CallSession> &session, bool requested) override;
|
||||
void onStartRinging (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onStopRinging (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onStopRingingIfInCall (const std::shared_ptr<const CallSession> &session) override;
|
||||
void onStopRingingIfNeeded (const std::shared_ptr<const CallSession> &session) override;
|
||||
bool isPlayingRingbackTone (const std::shared_ptr<const CallSession> &session) override;
|
||||
|
||||
protected:
|
||||
explicit Conference (
|
||||
ConferencePrivate &p,
|
||||
const std::shared_ptr<Core> &core,
|
||||
const IdentityAddress &myAddress,
|
||||
CallListener *listener = nullptr
|
||||
CallSessionListener *listener
|
||||
);
|
||||
|
||||
bool isMe (const IdentityAddress &addr) const;
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ using namespace std;
|
|||
|
||||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
LocalConference::LocalConference (const shared_ptr<Core> &core, const IdentityAddress &myAddress, CallListener *listener)
|
||||
LocalConference::LocalConference (const shared_ptr<Core> &core, const IdentityAddress &myAddress, CallSessionListener *listener)
|
||||
: Conference(*new LocalConferencePrivate, core, myAddress, listener) {
|
||||
L_D();
|
||||
d->eventHandler.reset(new LocalConferenceEventHandler(this));
|
||||
|
|
@ -42,7 +42,7 @@ void LocalConference::addParticipant (const IdentityAddress &addr, const CallSes
|
|||
if (participant)
|
||||
return;
|
||||
participant = make_shared<Participant>(addr);
|
||||
participant->getPrivate()->createSession(*this, params, hasMedia, this);
|
||||
participant->getPrivate()->createSession(*this, params, hasMedia, d->listener);
|
||||
d->participants.push_back(participant);
|
||||
if (!d->activeParticipant)
|
||||
d->activeParticipant = participant;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class LocalConference : public Conference {
|
|||
friend class ServerGroupChatRoomPrivate;
|
||||
|
||||
public:
|
||||
LocalConference (const std::shared_ptr<Core> &core, const IdentityAddress &myAddress, CallListener *listener = nullptr);
|
||||
LocalConference (const std::shared_ptr<Core> &core, const IdentityAddress &myAddress, CallSessionListener *listener);
|
||||
|
||||
/* ConferenceInterface */
|
||||
void addParticipant (const IdentityAddress &addr, const CallSessionParams *params, bool hasMedia) override;
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ LINPHONE_BEGIN_NAMESPACE
|
|||
RemoteConference::RemoteConference (
|
||||
const shared_ptr<Core> &core,
|
||||
const IdentityAddress &myAddress,
|
||||
CallListener *listener
|
||||
CallSessionListener *listener
|
||||
) : Conference(*new RemoteConferencePrivate, core, myAddress, listener) {
|
||||
L_D();
|
||||
d->eventHandler.reset(new RemoteConferenceEventHandler(this));
|
||||
|
|
@ -50,7 +50,7 @@ void RemoteConference::addParticipant (const IdentityAddress &addr, const CallSe
|
|||
if (participant)
|
||||
return;
|
||||
participant = make_shared<Participant>(addr);
|
||||
participant->getPrivate()->createSession(*this, params, hasMedia, this);
|
||||
participant->getPrivate()->createSession(*this, params, hasMedia, d->listener);
|
||||
d->participants.push_back(participant);
|
||||
if (!d->activeParticipant)
|
||||
d->activeParticipant = participant;
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class LINPHONE_PUBLIC RemoteConference : public Conference, public ConferenceLis
|
|||
friend class ClientGroupChatRoomPrivate;
|
||||
|
||||
public:
|
||||
RemoteConference (const std::shared_ptr<Core> &core, const IdentityAddress &myAddress, CallListener *listener = nullptr);
|
||||
RemoteConference (const std::shared_ptr<Core> &core, const IdentityAddress &myAddress, CallSessionListener *listener);
|
||||
virtual ~RemoteConference();
|
||||
|
||||
/* ConferenceInterface */
|
||||
|
|
|
|||
|
|
@ -30,40 +30,40 @@ class LINPHONE_PUBLIC CallSessionListener {
|
|||
public:
|
||||
virtual ~CallSessionListener() = default;
|
||||
|
||||
virtual void onAckBeingSent (const std::shared_ptr<const CallSession> &session, LinphoneHeaders *headers) = 0;
|
||||
virtual void onAckReceived (const std::shared_ptr<const CallSession> &session, LinphoneHeaders *headers) = 0;
|
||||
virtual void onBackgroundTaskToBeStarted (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onBackgroundTaskToBeStopped (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual bool onCallSessionAccepted (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onCallSessionSetReleased (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onCallSessionSetTerminated (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onCallSessionStateChanged (const std::shared_ptr<const CallSession> &session, LinphoneCallState state, const std::string &message) = 0;
|
||||
virtual void onCheckForAcceptation (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onDtmfReceived (const std::shared_ptr<const CallSession> &session, char dtmf) = 0;
|
||||
virtual void onIncomingCallSessionNotified (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onIncomingCallSessionStarted (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onIncomingCallSessionTimeoutCheck (const std::shared_ptr<const CallSession> &session, int elapsed, bool oneSecondElapsed) = 0;
|
||||
virtual void onInfoReceived (const std::shared_ptr<const CallSession> &session, const LinphoneInfoMessage *im) = 0;
|
||||
virtual void onNoMediaTimeoutCheck (const std::shared_ptr<const CallSession> &session, bool oneSecondElapsed) = 0;
|
||||
virtual void onAckBeingSent (const std::shared_ptr<const CallSession> &session, LinphoneHeaders *headers) {}
|
||||
virtual void onAckReceived (const std::shared_ptr<const CallSession> &session, LinphoneHeaders *headers) {}
|
||||
virtual void onBackgroundTaskToBeStarted (const std::shared_ptr<const CallSession> &session) {}
|
||||
virtual void onBackgroundTaskToBeStopped (const std::shared_ptr<const CallSession> &session) {}
|
||||
virtual bool onCallSessionAccepted (const std::shared_ptr<const CallSession> &session) { return false; }
|
||||
virtual void onCallSessionSetReleased (const std::shared_ptr<const CallSession> &session) {}
|
||||
virtual void onCallSessionSetTerminated (const std::shared_ptr<const CallSession> &session) {}
|
||||
virtual void onCallSessionStateChanged (const std::shared_ptr<const CallSession> &session, LinphoneCallState state, const std::string &message) {}
|
||||
virtual void onCheckForAcceptation (const std::shared_ptr<const CallSession> &session) {}
|
||||
virtual void onDtmfReceived (const std::shared_ptr<const CallSession> &session, char dtmf) {}
|
||||
virtual void onIncomingCallSessionNotified (const std::shared_ptr<const CallSession> &session) {}
|
||||
virtual void onIncomingCallSessionStarted (const std::shared_ptr<const CallSession> &session) {}
|
||||
virtual void onIncomingCallSessionTimeoutCheck (const std::shared_ptr<const CallSession> &session, int elapsed, bool oneSecondElapsed) {}
|
||||
virtual void onInfoReceived (const std::shared_ptr<const CallSession> &session, const LinphoneInfoMessage *im) {}
|
||||
virtual void onNoMediaTimeoutCheck (const std::shared_ptr<const CallSession> &session, bool oneSecondElapsed) {}
|
||||
|
||||
virtual void onEncryptionChanged (const std::shared_ptr<const CallSession> &session, bool activated, const std::string &authToken) = 0;
|
||||
virtual void onEncryptionChanged (const std::shared_ptr<const CallSession> &session, bool activated, const std::string &authToken) {}
|
||||
|
||||
virtual void onStatsUpdated (const LinphoneCallStats *stats) = 0;
|
||||
virtual void onStatsUpdated (const std::shared_ptr<const CallSession> &session, const LinphoneCallStats *stats) {}
|
||||
|
||||
virtual void onResetCurrentSession (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onSetCurrentSession (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onResetCurrentSession (const std::shared_ptr<const CallSession> &session) {}
|
||||
virtual void onSetCurrentSession (const std::shared_ptr<const CallSession> &session) {}
|
||||
|
||||
virtual void onFirstVideoFrameDecoded (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onResetFirstVideoFrameDecoded (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onFirstVideoFrameDecoded (const std::shared_ptr<const CallSession> &session) {}
|
||||
virtual void onResetFirstVideoFrameDecoded (const std::shared_ptr<const CallSession> &session) {}
|
||||
|
||||
virtual void onPlayErrorTone (const std::shared_ptr<const CallSession> &session, LinphoneReason reason) = 0;
|
||||
virtual void onRingbackToneRequested (const std::shared_ptr<const CallSession> &session, bool requested) = 0;
|
||||
virtual void onStartRinging (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onStopRinging (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onStopRingingIfInCall (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onStopRingingIfNeeded (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual void onPlayErrorTone (const std::shared_ptr<const CallSession> &session, LinphoneReason reason) {}
|
||||
virtual void onRingbackToneRequested (const std::shared_ptr<const CallSession> &session, bool requested) {}
|
||||
virtual void onStartRinging (const std::shared_ptr<const CallSession> &session) {}
|
||||
virtual void onStopRinging (const std::shared_ptr<const CallSession> &session) {}
|
||||
virtual void onStopRingingIfInCall (const std::shared_ptr<const CallSession> &session) {}
|
||||
virtual void onStopRingingIfNeeded (const std::shared_ptr<const CallSession> &session) {}
|
||||
|
||||
virtual bool isPlayingRingbackTone (const std::shared_ptr<const CallSession> &session) = 0;
|
||||
virtual bool isPlayingRingbackTone (const std::shared_ptr<const CallSession> &session) { return false; }
|
||||
};
|
||||
|
||||
LINPHONE_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -839,6 +839,7 @@ void MediaSessionPrivate::initStats (LinphoneCallStats *stats, LinphoneStreamTyp
|
|||
}
|
||||
|
||||
void MediaSessionPrivate::notifyStatsUpdated (int streamIndex) const {
|
||||
L_Q();
|
||||
LinphoneCallStats *stats = nullptr;
|
||||
if (streamIndex == mainAudioStreamIndex)
|
||||
stats = audioStats;
|
||||
|
|
@ -860,7 +861,7 @@ void MediaSessionPrivate::notifyStatsUpdated (int streamIndex) const {
|
|||
break;
|
||||
}
|
||||
if (listener)
|
||||
listener->onStatsUpdated(stats);
|
||||
listener->onStatsUpdated(q->getSharedFromThis(), stats);
|
||||
_linphone_call_stats_set_updated(stats, 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -3653,7 +3654,7 @@ void MediaSessionPrivate::reportBandwidthForStream (MediaStream *ms, LinphoneStr
|
|||
linphone_call_stats_update(stats, ms);
|
||||
_linphone_call_stats_set_updated(stats, _linphone_call_stats_get_updated(stats) | LINPHONE_CALL_STATS_PERIODICAL_UPDATE);
|
||||
if (listener)
|
||||
listener->onStatsUpdated(stats);
|
||||
listener->onStatsUpdated(q->getSharedFromThis(), stats);
|
||||
_linphone_call_stats_set_updated(stats, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -465,7 +465,7 @@ public:
|
|||
string confSubject;
|
||||
};
|
||||
|
||||
ConferenceEventTester::ConferenceEventTester (LinphoneCore *core, const Address &confAddr) : RemoteConference(core->cppPtr, confAddr) {
|
||||
ConferenceEventTester::ConferenceEventTester (LinphoneCore *core, const Address &confAddr) : RemoteConference(core->cppPtr, confAddr, nullptr) {
|
||||
handler = new RemoteConferenceEventHandler(this);
|
||||
}
|
||||
|
||||
|
|
@ -806,7 +806,7 @@ void send_first_notify() {
|
|||
Address addr(identityStr);
|
||||
bctbx_free(identityStr);
|
||||
ConferenceEventTester tester(marie->lc, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr, nullptr);
|
||||
LinphoneAddress *cBobAddr = linphone_core_interpret_url(marie->lc, bobUri);
|
||||
char *bobAddrStr = linphone_address_as_string(cBobAddr);
|
||||
Address bobAddr(bobAddrStr);
|
||||
|
|
@ -851,7 +851,7 @@ void send_added_notify() {
|
|||
Address addr(identityStr);
|
||||
bctbx_free(identityStr);
|
||||
ConferenceEventTester tester(marie->lc, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr, nullptr);
|
||||
LinphoneAddress *cBobAddr = linphone_core_interpret_url(marie->lc, bobUri);
|
||||
char *bobAddrStr = linphone_address_as_string(cBobAddr);
|
||||
Address bobAddr(bobAddrStr);
|
||||
|
|
@ -912,7 +912,7 @@ void send_removed_notify() {
|
|||
Address addr(identityStr);
|
||||
bctbx_free(identityStr);
|
||||
ConferenceEventTester tester(marie->lc, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr, nullptr);
|
||||
LinphoneAddress *cBobAddr = linphone_core_interpret_url(marie->lc, bobUri);
|
||||
char *bobAddrStr = linphone_address_as_string(cBobAddr);
|
||||
Address bobAddr(bobAddrStr);
|
||||
|
|
@ -965,7 +965,7 @@ void send_admined_notify() {
|
|||
Address addr(identityStr);
|
||||
bctbx_free(identityStr);
|
||||
ConferenceEventTester tester(marie->lc, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr, nullptr);
|
||||
LinphoneAddress *cBobAddr = linphone_core_interpret_url(marie->lc, bobUri);
|
||||
char *bobAddrStr = linphone_address_as_string(cBobAddr);
|
||||
Address bobAddr(bobAddrStr);
|
||||
|
|
@ -1017,7 +1017,7 @@ void send_unadmined_notify() {
|
|||
Address addr(identityStr);
|
||||
bctbx_free(identityStr);
|
||||
ConferenceEventTester tester(marie->lc, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr, nullptr);
|
||||
LinphoneAddress *cBobAddr = linphone_core_interpret_url(marie->lc, bobUri);
|
||||
char *bobAddrStr = linphone_address_as_string(cBobAddr);
|
||||
Address bobAddr(bobAddrStr);
|
||||
|
|
@ -1070,7 +1070,7 @@ void send_subject_changed_notify () {
|
|||
Address addr(identityStr);
|
||||
bctbx_free(identityStr);
|
||||
ConferenceEventTester tester(marie->lc, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr, nullptr);
|
||||
LinphoneAddress *cBobAddr = linphone_core_interpret_url(marie->lc, bobUri);
|
||||
char *bobAddrStr = linphone_address_as_string(cBobAddr);
|
||||
Address bobAddr(bobAddrStr);
|
||||
|
|
@ -1130,7 +1130,7 @@ void send_device_added_notify() {
|
|||
Address addr(identityStr);
|
||||
bctbx_free(identityStr);
|
||||
ConferenceEventTester tester(marie->lc, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr, nullptr);
|
||||
LinphoneAddress *cBobAddr = linphone_core_interpret_url(marie->lc, bobUri);
|
||||
char *bobAddrStr = linphone_address_as_string(cBobAddr);
|
||||
Address bobAddr(bobAddrStr);
|
||||
|
|
@ -1182,7 +1182,7 @@ void send_device_removed_notify() {
|
|||
Address addr(identityStr);
|
||||
bctbx_free(identityStr);
|
||||
ConferenceEventTester tester(marie->lc, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr);
|
||||
LocalConference localConf(pauline->lc->cppPtr, addr, nullptr);
|
||||
LinphoneAddress *cBobAddr = linphone_core_interpret_url(marie->lc, bobUri);
|
||||
char *bobAddrStr = linphone_address_as_string(cBobAddr);
|
||||
Address bobAddr(bobAddrStr);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue