From 3ec59a12392a12ca40de474fb7d6df2e548bea5a Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Wed, 28 Feb 2018 11:47:01 +0100 Subject: [PATCH] Allow not sending SIP RINGING message. --- src/conference/session/call-session-p.h | 1 + src/conference/session/call-session.cpp | 3 ++- src/conference/session/call-session.h | 2 +- src/conference/session/media-session.cpp | 4 ++-- src/conference/session/media-session.h | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/conference/session/call-session-p.h b/src/conference/session/call-session-p.h index 8ad819ce7..fb425b508 100644 --- a/src/conference/session/call-session-p.h +++ b/src/conference/session/call-session-p.h @@ -138,6 +138,7 @@ protected: bool deferUpdate = false; bool needLocalIpRefresh = false; bool nonOpError = false; /* Set when the LinphoneErrorInfo was set at higher level than sal */ + bool notifyRinging = true; bool referPending = false; bool reinviteOnCancelResponseRequested = false; diff --git a/src/conference/session/call-session.cpp b/src/conference/session/call-session.cpp index 14267ee12..8e6effe64 100644 --- a/src/conference/session/call-session.cpp +++ b/src/conference/session/call-session.cpp @@ -550,7 +550,8 @@ void CallSessionPrivate::handleIncomingReceivedStateInIncomingNotification () { L_Q(); /* Try to be best-effort in giving real local or routable contact address for 100Rel case */ setContactOp(); - op->notify_ringing(false); + if (notifyRinging) + op->notify_ringing(false); if (op->get_replaces() && lp_config_get_int(linphone_core_get_config(q->getCore()->getCCore()), "sip", "auto_answer_replacing_calls", 1)) q->accept(); } diff --git a/src/conference/session/call-session.h b/src/conference/session/call-session.h index a554db3a7..fa3969b64 100644 --- a/src/conference/session/call-session.h +++ b/src/conference/session/call-session.h @@ -69,7 +69,7 @@ public: virtual void iterate (time_t currentRealTime, bool oneSecondElapsed); LinphoneStatus redirect (const std::string &redirectUri); LinphoneStatus redirect (const Address &redirectAddr); - virtual void startIncomingNotification (); + virtual void startIncomingNotification (bool notifyRinging = true); virtual int startInvite (const Address *destination, const std::string &subject = "", const Content *content = nullptr); LinphoneStatus terminate (const LinphoneErrorInfo *ei = nullptr); LinphoneStatus transfer (const std::shared_ptr &dest); diff --git a/src/conference/session/media-session.cpp b/src/conference/session/media-session.cpp index c21b2fa22..506f8687d 100644 --- a/src/conference/session/media-session.cpp +++ b/src/conference/session/media-session.cpp @@ -4202,7 +4202,7 @@ void MediaSession::sendVfuRequest () { #endif } -void MediaSession::startIncomingNotification () { +void MediaSession::startIncomingNotification (bool notifyRinging) { L_D(); d->makeLocalMediaDescription(); d->op->set_local_media_description(d->localDesc); @@ -4218,7 +4218,7 @@ void MediaSession::startIncomingNotification () { } } - CallSession::startIncomingNotification(); + CallSession::startIncomingNotification(notifyRinging); } int MediaSession::startInvite (const Address *destination, const string &subject, const Content *content) { diff --git a/src/conference/session/media-session.h b/src/conference/session/media-session.h index 10a7f29ab..695c44ae4 100644 --- a/src/conference/session/media-session.h +++ b/src/conference/session/media-session.h @@ -56,7 +56,7 @@ public: LinphoneStatus sendDtmf (char dtmf); LinphoneStatus sendDtmfs (const std::string &dtmfs); void sendVfuRequest (); - void startIncomingNotification () override; + void startIncomingNotification (bool notifyRinging = true) override; int startInvite (const Address *destination, const std::string &subject = "", const Content *content = nullptr) override; void startRecording (); void stopRecording ();