Commit 6c26de9e authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Various fixes in call handling.

parent 7c6d7bc2
......@@ -175,21 +175,6 @@ static void call_rejected(SalCallOp *h){
linphone_core_report_early_failed_call(lc, LinphoneCallIncoming, linphone_address_new(h->get_from()), linphone_address_new(h->get_to()), ei);
}
#if 0
static void start_remote_ring(LinphoneCore *lc, LinphoneCall *call) {
if (lc->sound_conf.play_sndcard!=NULL){
MSSndCard *ringcard=lc->sound_conf.lsd_card ? lc->sound_conf.lsd_card : lc->sound_conf.play_sndcard;
if (call->localdesc->streams[0].max_rate>0) ms_snd_card_set_preferred_sample_rate(ringcard, call->localdesc->streams[0].max_rate);
/*we release sound before playing ringback tone*/
if (call->audiostream)
audio_stream_unprepare_sound(call->audiostream);
if( lc->sound_conf.remote_ring ){
lc->ringstream=ring_start(lc->factory, lc->sound_conf.remote_ring,2000,ringcard);
}
}
}
#endif
static void call_ringing(SalOp *h) {
LinphonePrivate::CallSession *session = reinterpret_cast<LinphonePrivate::CallSession *>(h->get_user_pointer());
if (!session) return;
......
......@@ -48,7 +48,6 @@ void linphone_call_notify_ack_processing(LinphoneCall *call, LinphoneHeaders *ms
LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, const LinphoneCallParams *params, LinphoneProxyConfig *cfg);
LinphoneCall * linphone_call_new_incoming(struct _LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to, LinphonePrivate::SalCallOp *op);
void _linphone_call_set_new_params(LinphoneCall *call, const LinphoneCallParams *params);
void linphone_call_set_state(LinphoneCall *call, LinphoneCallState cstate, const char *message);
/* private: */
LinphoneCallLog * linphone_call_log_new(LinphoneCallDir dir, LinphoneAddress *from, LinphoneAddress * to);
......@@ -227,7 +226,6 @@ void _linphone_call_stats_set_rtcp_download_bandwidth (LinphoneCallStats *stats,
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);
bool_t _linphone_call_stats_rtcp_received_via_mux (const LinphoneCallStats *stats);
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);
bool_t linphone_core_media_description_contains_video_stream(const SalMediaDescription *md);
......@@ -252,20 +250,12 @@ void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *c
void linphone_call_init_media_streams(LinphoneCall *call);
void linphone_call_start_media_streams_for_ice_gathering(LinphoneCall *call);
void linphone_call_stop_media_streams(LinphoneCall *call);
void linphone_call_delete_upnp_session(LinphoneCall *call);
int _linphone_core_apply_transports(LinphoneCore *lc);
void linphone_core_start_waiting(LinphoneCore *lc, const char *purpose);
void linphone_core_update_progress(LinphoneCore *lc, const char *purpose, float progresses);
void linphone_core_stop_waiting(LinphoneCore *lc);
int linphone_call_proceed_with_invite_if_ready(LinphoneCall *call, LinphoneProxyConfig *dest_proxy);
int linphone_call_start_invite(LinphoneCall *call, const LinphoneAddress *destination/* = NULL if to be taken from the call log */);
/*
* param automatic_offering aims is to take into account previous answer for video in case of automatic re-invite.
* Purpose is to avoid to re-ask video previously declined */
int linphone_call_start_update(LinphoneCall *call);
int linphone_call_start_accept_update(LinphoneCall *call, LinphoneCallState next_state, const char *state_info);
void linphone_core_notify_incoming_call(LinphoneCore *lc, LinphoneCall *call);
bool_t linphone_core_incompatible_security(LinphoneCore *lc, SalMediaDescription *md);
extern LinphonePrivate::Sal::Callbacks linphone_sal_callbacks;
......@@ -318,7 +308,6 @@ int linphone_core_get_calls_nb(const LinphoneCore *lc);
void linphone_core_set_state(LinphoneCore *lc, LinphoneGlobalState gstate, const char *message);
void linphone_call_update_biggest_desc(LinphoneCall *call, SalMediaDescription *md);
void linphone_call_make_local_media_description(LinphoneCall *call);
void linphone_call_make_local_media_description_with_params(LinphoneCore *lc, LinphoneCall *call, LinphoneCallParams *params);
bool_t linphone_core_is_payload_type_usable_for_bandwidth(const LinphoneCore *lc, const PayloadType *pt, int bandwidth_limit);
......@@ -401,7 +390,6 @@ bool_t linphone_core_tone_indications_enabled(LinphoneCore*lc);
const char *linphone_core_create_uuid(LinphoneCore *lc);
void linphone_configure_op(LinphoneCore *lc, LinphonePrivate::SalOp *op, const LinphoneAddress *dest, SalCustomHeader *headers, bool_t with_contact);
void linphone_configure_op_with_proxy(LinphoneCore *lc, LinphonePrivate::SalOp *op, const LinphoneAddress *dest, SalCustomHeader *headers, bool_t with_contact, LinphoneProxyConfig *proxy);
void linphone_call_create_op(LinphoneCall *call);
LinphoneContent * linphone_content_new(void);
LinphoneContent * linphone_content_copy(const LinphoneContent *ref);
SalBodyHandler *sal_body_handler_from_content(const LinphoneContent *content);
......
......@@ -45,47 +45,53 @@ L_DECLARE_C_OBJECT_IMPL_WITH_XTORS(Call,
LinphoneCallParams *currentParamsCache;
LinphoneCallParams *paramsCache;
LinphoneCallParams *remoteParamsCache;
LinphoneAddress *diversionAddressCache;
LinphoneAddress *remoteAddressCache;
LinphoneAddress *toAddressCache;
char *remoteContactCache;
char *remoteUserAgentCache;
mutable char *toHeaderCache;
/* TODO: all the fields need to be removed */
struct _LinphoneCore *core;
LinphoneErrorInfo *ei;
LinphonePrivate::SalOp *op;
LinphoneCallState transfer_state; /*idle if no transfer*/
struct _AudioStream *audiostream; /**/
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 */
LinphonePlayer *player;
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;
bool_t defer_update;
bool_t non_op_error; /*set when the LinphoneErrorInfo was set at higher level than sal*/
)
static void _linphone_call_constructor (LinphoneCall *call) {
call->currentParamsCache = linphone_call_params_new_for_wrapper();
call->paramsCache = linphone_call_params_new_for_wrapper();
call->remoteParamsCache = linphone_call_params_new_for_wrapper();
call->diversionAddressCache = linphone_address_new(nullptr);
call->remoteAddressCache = linphone_address_new(nullptr);
call->toAddressCache = linphone_address_new(nullptr);
}
static void _linphone_call_destructor (LinphoneCall *call) {
if (call->currentParamsCache) {
if (call->currentParamsCache)
linphone_call_params_unref(call->currentParamsCache);
call->currentParamsCache = nullptr;
}
if (call->paramsCache) {
if (call->paramsCache)
linphone_call_params_unref(call->paramsCache);
call->paramsCache = nullptr;
}
if (call->remoteParamsCache) {
if (call->remoteParamsCache)
linphone_call_params_unref(call->remoteParamsCache);
call->remoteParamsCache = nullptr;
}
if (call->remoteAddressCache) {
if (call->diversionAddressCache)
linphone_address_unref(call->diversionAddressCache);
if (call->remoteAddressCache)
linphone_address_unref(call->remoteAddressCache);
call->remoteAddressCache = nullptr;
}
if (call->toAddressCache)
linphone_address_unref(call->toAddressCache);
if (call->remoteContactCache)
bctbx_free(call->remoteContactCache);
if (call->remoteUserAgentCache)
bctbx_free(call->remoteUserAgentCache);
if (call->toHeaderCache)
bctbx_free(call->toHeaderCache);
bctbx_list_free_with_data(call->callbacks, (bctbx_list_free_func)linphone_call_cbs_unref);
if (call->op) {
call->op->release();
......@@ -103,7 +109,6 @@ static void _linphone_call_destructor (LinphoneCall *call) {
linphone_call_unref(call->transfer_target);
call->transfer_target=nullptr;
}
if (call->ei) linphone_error_info_unref(call->ei);
}
......@@ -119,12 +124,6 @@ MSWebCam *get_nowebcam_device (MSFactory* f) {
#endif
}
void linphone_call_update_local_media_description_from_ice_or_upnp (LinphoneCall *call) {}
void linphone_call_make_local_media_description (LinphoneCall *call) {}
void linphone_call_create_op (LinphoneCall *call) {}
void linphone_call_set_state (LinphoneCall *call, LinphoneCallState cstate, const char *message) {}
void linphone_call_init_media_streams (LinphoneCall *call) {}
......@@ -132,14 +131,6 @@ void linphone_call_init_media_streams (LinphoneCall *call) {}
/*This function is not static because used internally in linphone-daemon project*/
void _post_configure_audio_stream (AudioStream *st, LinphoneCore *lc, bool_t muted) {}
#if 0
static void setup_ring_player (LinphoneCore *lc, LinphoneCall *call) {
int pause_time=3000;
audio_stream_play(call->audiostream,lc->sound_conf.ringback_tone);
ms_filter_call_method(call->audiostream->soundread,MS_FILE_PLAYER_LOOP,&pause_time);
}
#endif
#if 0
static bool_t linphone_call_sound_resources_available (LinphoneCall *call) {
LinphoneCore *lc=call->core;
......@@ -149,28 +140,8 @@ static bool_t linphone_call_sound_resources_available (LinphoneCall *call) {
}
#endif
void linphone_call_delete_upnp_session (LinphoneCall *call) {}
void linphone_call_stop_media_streams (LinphoneCall *call) {}
#if 0
static void linphone_call_lost (LinphoneCall *call) {
LinphoneCore *lc = call->core;
char *temp = nullptr;
char *from = nullptr;
from = linphone_call_get_remote_address_as_string(call);
temp = ms_strdup_printf("Media connectivity with %s is lost, call is going to be closed.", from ? from : "?");
if (from) ms_free(from);
ms_message("LinphoneCall [%p]: %s", call, temp);
call->non_op_error = TRUE;
linphone_error_info_set(call->ei,nullptr, LinphoneReasonIOError, 503, "Media lost", nullptr);
linphone_call_terminate(call);
linphone_core_play_named_tone(lc, LinphoneToneCallLost);
ms_free(temp);
}
#endif
void linphone_call_set_transfer_state (LinphoneCall *call, LinphoneCallState state) {
#if 0
if (state != call->transfer_state) {
......@@ -183,33 +154,11 @@ void linphone_call_set_transfer_state (LinphoneCall *call, LinphoneCallState sta
#endif
}
void _linphone_call_set_new_params (LinphoneCall *call, const LinphoneCallParams *params) {}
/* Internal version that does not play tone indication*/
int _linphone_call_pause (LinphoneCall *call) {
return 0;
}
#if 0
static void terminate_call (LinphoneCall *call) {}
#endif
int linphone_call_start_update (LinphoneCall *call) {
return 0;
}
int linphone_call_start_accept_update (LinphoneCall *call, LinphoneCallState next_state, const char *state_info) {
return 0;
}
int linphone_call_proceed_with_invite_if_ready (LinphoneCall *call, LinphoneProxyConfig *dest_proxy) {
return 0;
}
int linphone_call_start_invite (LinphoneCall *call, const LinphoneAddress *destination /* = NULL if to be taken from the call log */) {
return 0;
}
// =============================================================================
// Private functions.
......@@ -314,20 +263,19 @@ const LinphoneAddress *linphone_call_get_remote_address (const LinphoneCall *cal
return call->remoteAddressCache;
}
const LinphoneAddress *linphone_call_get_to_address (const LinphoneCall *call){
#if 0
return (const LinphoneAddress *)sal_op_get_to_address(call->op);
#else
return nullptr;
#endif
const LinphoneAddress *linphone_call_get_to_address (const LinphoneCall *call) {
L_SET_CPP_PTR_FROM_C_OBJECT(call->toAddressCache, &L_GET_CPP_PTR_FROM_C_OBJECT(call)->getToAddress());
return call->toAddressCache;
}
const char *linphone_call_get_to_header (const LinphoneCall *call, const char *name) {
#if 0
return sal_custom_header_find(sal_op_get_recv_custom_header(call->op),name);
#else
return nullptr;
#endif
string header = L_GET_CPP_PTR_FROM_C_OBJECT(call)->getToHeader(name);
if (header.empty())
return nullptr;
if (call->toHeaderCache)
bctbx_free(call->toHeaderCache);
call->toHeaderCache = bctbx_strdup(header.c_str());
return call->toHeaderCache;
}
char *linphone_call_get_remote_address_as_string (const LinphoneCall *call) {
......@@ -335,11 +283,11 @@ char *linphone_call_get_remote_address_as_string (const LinphoneCall *call) {
}
const LinphoneAddress *linphone_call_get_diversion_address (const LinphoneCall *call) {
#if 0
return call->op?(const LinphoneAddress *)sal_op_get_diversion_address(call->op):nullptr;
#else
return nullptr;
#endif
LinphonePrivate::Address diversionAddress(L_GET_CPP_PTR_FROM_C_OBJECT(call)->getDiversionAddress());
if (!diversionAddress.isValid())
return nullptr;
L_SET_CPP_PTR_FROM_C_OBJECT(call->diversionAddressCache, &diversionAddress);
return call->diversionAddressCache;
}
LinphoneCallDir linphone_call_get_dir (const LinphoneCall *call) {
......@@ -536,11 +484,7 @@ LinphoneConference *linphone_call_get_conference (const LinphoneCall *call) {
}
void linphone_call_set_audio_route (LinphoneCall *call, LinphoneAudioRoute route) {
#if 0
if (call && call->audiostream){
audio_stream_set_audio_route(call->audiostream, (MSAudioRoute) route);
}
#endif
L_GET_CPP_PTR_FROM_C_OBJECT(call)->setAudioRoute(route);
}
int linphone_call_get_stream_count (const LinphoneCall *call) {
......@@ -608,22 +552,7 @@ LinphoneStatus linphone_call_update (LinphoneCall *call, const LinphoneCallParam
}
LinphoneStatus linphone_call_defer_update (LinphoneCall *call) {
#if 0
if (call->state != LinphoneCallUpdatedByRemote) {
ms_error("linphone_call_defer_update() not done in state LinphoneCallUpdatedByRemote");
return -1;
}
if (call->expect_media_in_ack) {
ms_error("linphone_call_defer_update() is not possible during a late offer incoming reINVITE (INVITE without SDP)");
return -1;
}
call->defer_update=TRUE;
return 0;
#else
return 0;
#endif
return L_GET_CPP_PTR_FROM_C_OBJECT(call)->deferUpdate();
}
LinphoneStatus linphone_call_accept_update (LinphoneCall *call, const LinphoneCallParams *params) {
......@@ -838,10 +767,6 @@ LinphoneCall *linphone_call_new_outgoing (LinphoneCore *lc, const LinphoneAddres
cfg, nullptr, L_GET_CPP_PTR_FROM_C_OBJECT(params));
}
L_SET_CPP_PTR_FROM_C_OBJECT(lcall, call);
lcall->currentParamsCache = linphone_call_params_new_for_wrapper();
lcall->paramsCache = linphone_call_params_new_for_wrapper();
lcall->remoteParamsCache = linphone_call_params_new_for_wrapper();
lcall->remoteAddressCache = linphone_address_new(nullptr);
return lcall;
}
......@@ -859,10 +784,6 @@ LinphoneCall *linphone_call_new_incoming (LinphoneCore *lc, const LinphoneAddres
nullptr, op, nullptr);
}
L_SET_CPP_PTR_FROM_C_OBJECT(lcall, call);
lcall->currentParamsCache = linphone_call_params_new_for_wrapper();
lcall->paramsCache = linphone_call_params_new_for_wrapper();
lcall->remoteParamsCache = linphone_call_params_new_for_wrapper();
lcall->remoteAddressCache = linphone_address_new(nullptr);
L_GET_PRIVATE_FROM_C_OBJECT(lcall)->initiateIncoming();
return lcall;
}
......@@ -32,14 +32,19 @@ public:
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 onIncomingCallToBeAdded () = 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;
......@@ -50,6 +55,15 @@ public:
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
......
......@@ -57,28 +57,48 @@ public:
void createPlayer () const;
private:
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 onIncomingCallToBeAdded () 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;
mutable LinphonePlayer *player = nullptr;
CallCallbackObj nextVideoFrameDecoded;
unsigned long backgroundTaskId = 0;
bool ringingBeep = false;
bool playingRingbackTone = false;
L_DECLARE_PUBLIC(Call);
};
......
This diff is collapsed.
......@@ -47,6 +47,7 @@ public:
void cancelDtmfs ();
LinphoneStatus decline (LinphoneReason reason);
LinphoneStatus decline (const LinphoneErrorInfo *ei);
LinphoneStatus deferUpdate ();
void oglRender () const;
LinphoneStatus pause ();
LinphoneStatus redirect (const std::string &redirectUri);
......@@ -77,6 +78,7 @@ public:
const MediaSessionParams *getCurrentParams () const;
float getCurrentQuality () const;
LinphoneCallDir getDirection () const;
const Address &getDiversionAddress () const;
int getDuration () const;
const LinphoneErrorInfo *getErrorInfo () const;
LinphoneCallLog *getLog () const;
......@@ -100,8 +102,11 @@ public:
int getStreamCount () const;
MSFormatType getStreamType (int streamIndex) const;
LinphoneCallStats *getTextStats () const;
const Address &getToAddress () const;
std::string getToHeader (const std::string &name) const;
LinphoneCallStats *getVideoStats () const;
bool mediaInProgress () const;
void setAudioRoute (LinphoneAudioRoute route);
void setAuthenticationTokenVerified (bool value);
void setMicrophoneVolumeGain (float value);
void setNativeVideoWindowId (void *id);
......
......@@ -134,10 +134,23 @@ void Conference::onAckReceived (const shared_ptr<const CallSession> &session, Li
d->callListener->onAckReceived(headers);
}
void Conference::onCallSessionAccepted (const shared_ptr<const CallSession> &session) {
void Conference::onBackgroundTaskToBeStarted (const shared_ptr<const CallSession> &session) {
L_D();
if (d->callListener)
d->callListener->onIncomingCallToBeAdded();
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) {
......@@ -164,24 +177,42 @@ void Conference::onCheckForAcceptation (const shared_ptr<const CallSession> &ses
d->callListener->onCheckForAcceptation();
}
void Conference::onDtmfReceived (const std::shared_ptr<const CallSession> &session, char dtmf) {
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::onInfoReceived (const std::shared_ptr<const CallSession> &session, const LinphoneInfoMessage *im) {
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)
......@@ -218,6 +249,49 @@ void Conference::onResetFirstVideoFrameDecoded (const shared_ptr<const CallSessi
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 {
......
......@@ -68,20 +68,32 @@ 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 onCallSessionAccepted (const std::shared_ptr<const CallSession> &session) 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;