diff --git a/daemon/README b/daemon/README index df9de2a4d7e8be0e353f42fd9a5e7248e40807ba..46befaa292c224b46f2ee2ff3a7d7f4a3e96c1f4 100644 --- a/daemon/README +++ b/daemon/README @@ -175,9 +175,6 @@ interaction between daemon and client will not work; for each platform where dbus is not available the client should implement all the methods in the *_stub.cpp files. -Note that you need a recent version of ucommon (>= 6.0.0) and of ccrtp -compiled against it to use clang. - SIP/IAx2 accounts --------------------- diff --git a/daemon/src/client/callmanager.cpp b/daemon/src/client/callmanager.cpp index 42450ed2bf9252ff4409e36e00d1cd8adf85d918..8fad82a7c4effcb25bf9a0c3532a92d238499f1c 100644 --- a/daemon/src/client/callmanager.cpp +++ b/daemon/src/client/callmanager.cpp @@ -280,28 +280,6 @@ CallManager::startTone(int32_t start, int32_t type) Manager::instance().stopTone(); } -// TODO: this will have to be adapted -// for conferencing in order to get -// the right pointer for the given -// callID. -#if USE_CCRTP && HAVE_ZRTP -ring::AudioZrtpSession * -CallManager::getAudioZrtpSession(const std::string& callID) -{ - // TODO: remove SIP dependency - const auto call = Manager::instance().callFactory.getCall<SIPCall>(callID); - if (!call) - throw CallManagerException("Call id " + callID + " is not valid"); - - ring::AudioZrtpSession * zSession = call->getAudioRtp().getAudioZrtpSession(); - - if (!zSession) - throw CallManagerException("Failed to get AudioZrtpSession"); - - return zSession; -} -#endif - void CallManager::setSASVerified(const std::string& callID) { diff --git a/daemon/src/client/callmanager.h b/daemon/src/client/callmanager.h index 004321a035611e4a29a69c17b555fce53843b7c4..c8ebec64ca21d95a7bd84b10667d5d084ff21d88 100644 --- a/daemon/src/client/callmanager.h +++ b/daemon/src/client/callmanager.h @@ -156,12 +156,6 @@ class CallManager void onRtcpReportReceived(const std::string& callID, const std::map<std::string, int>& stats); private: - -#if USE_CCRTP && HAVE_ZRTP - ring::AudioZrtpSession * getAudioZrtpSession(const std::string& callID); -#endif - - private: #pragma GCC diagnostic ignored "-Wmissing-field-initializers" // Event handlers; needed by the library API ring_call_ev_handlers evHandlers_{}; diff --git a/daemon/src/media/audio/audiolayer.h b/daemon/src/media/audio/audiolayer.h index eff45116c5d6edc947f0ea2c4f2db261f85bf76f..98afab5695e5256801cf4792b88e1c296a34b1f6 100644 --- a/daemon/src/media/audio/audiolayer.h +++ b/daemon/src/media/audio/audiolayer.h @@ -60,10 +60,6 @@ class AudioPreference; -namespace ost { -class Time; -} - namespace ring { class Resampler; diff --git a/daemon/src/ringdht/ringaccount.cpp b/daemon/src/ringdht/ringaccount.cpp index fc001770febf62df724ed99d7f45157ddec91b22..338aaccb7a0dc3a0f19889069767377f75522843 100644 --- a/daemon/src/ringdht/ringaccount.cpp +++ b/daemon/src/ringdht/ringaccount.cpp @@ -239,21 +239,6 @@ RingAccount::createOutgoingCall(const std::shared_ptr<SIPCall>& call, const std: std::vector<ring::AudioCodec *> audioCodecs; audioCodecs.push_back(ac); -#if USE_CCRTP - try { - call->getAudioRtp().initConfig(); - call->getAudioRtp().initSession(); - - if (isStunEnabled()) - call->updateSDPFromSTUN(); - - call->getAudioRtp().initLocalCryptoInfo(); - call->getAudioRtp().start(audioCodecs); - } catch (...) { - throw VoipLinkException("Could not start rtp session for early media"); - } -#endif - // Building the local SDP offer auto& sdp = call->getSDP(); diff --git a/daemon/src/sip/sipaccount.cpp b/daemon/src/sip/sipaccount.cpp index b1b8ff4c092a6ce23b133d0d19bdb68de44d86f1..e51b160f69213595e5260dbbc4001f0f42ea7be2 100644 --- a/daemon/src/sip/sipaccount.cpp +++ b/daemon/src/sip/sipaccount.cpp @@ -235,21 +235,6 @@ SIPAccount::newOutgoingCall(const std::string& id, const std::string& toUrl) std::vector<ring::AudioCodec *> audioCodecs; audioCodecs.push_back(ac); -#if USE_CCRTP - try { - call->getAudioRtp().initConfig(); - call->getAudioRtp().initSession(); - - if (isStunEnabled()) - call->updateSDPFromSTUN(); - - call->getAudioRtp().initLocalCryptoInfo(); - call->getAudioRtp().start(audioCodecs); - } catch (...) { - throw VoipLinkException("Could not start rtp session for early media"); - } -#endif - // Building the local SDP offer auto& sdp = call->getSDP(); diff --git a/daemon/src/sip/sipcall.cpp b/daemon/src/sip/sipcall.cpp index 33dc2c3ab78570f9778928f0f601ec0e68bcc37e..31575639a060abda2d542260573e148a99bd400e 100644 --- a/daemon/src/sip/sipcall.cpp +++ b/daemon/src/sip/sipcall.cpp @@ -91,9 +91,7 @@ static void dtmfSend(SIPCall &call, char code, const std::string &dtmf) { if (dtmf == SIPAccount::OVERRTP_STR) { -#if USE_CCRTP - call.getAudioRtp().sendDtmfDigit(code); -#endif + RING_WARN("DTMF over RTP not supported yet"); return; } else if (dtmf != SIPAccount::SIPINFO_STR) { RING_WARN("Unknown DTMF type %s, defaulting to %s instead", @@ -246,24 +244,7 @@ SIPCall::sendSIPInfo(const char *const body, const char *const subtype) void SIPCall::updateSDPFromSTUN() { -#if USE_CCRTP - auto& account = getSIPAccount(); - std::vector<long> socketDescriptors(getAudioRtp().getSocketDescriptors()); - - try { - std::vector<pj_sockaddr> stunPorts(getSIPVoIPLink()->sipTransport->getSTUNAddresses(account.getStunServerName(), account.getStunPort(), socketDescriptors)); - - // FIXME: get video sockets - //stunPorts.resize(4); - - account.setPublishedAddress(stunPorts[0]); - // published IP MUST be updated first, since RTCP depends on it - sdp_->setPublishedIP(account.getPublishedAddress()); - sdp_->updatePorts(stunPorts); - } catch (const std::runtime_error &e) { - RING_ERR("%s", e.what()); - } -#endif + RING_WARN("SIPCall::updateSDPFromSTUN() not implemented", __func__); } void SIPCall::answer() @@ -598,13 +579,6 @@ SIPCall::offhold() RING_ERR("%s", e.what()); throw VoipLinkException("SDP issue in offhold"); } -#if USE_CCRTP - catch (const ost::Socket *) { - throw VoipLinkException("Socket problem in offhold"); - } catch (const ring::AudioRtpFactoryException &) { - throw VoipLinkException("Socket problem in offhold"); - } -#endif } void @@ -642,18 +616,6 @@ SIPCall::internalOffHold(const std::function<void()> &SDPUpdateFunc) throw std::runtime_error("Could not instantiate any codecs"); } -#if USE_CCRTP - audiortp_.initConfig(); - audiortp_.initSession(); - - // Invoke closure - SDPUpdateFunc(); - - audiortp_.restoreLocalContext(); - audiortp_.initLocalCryptoInfoOnOffHold(); - audiortp_.start(audioCodecs); -#endif - sdp_->removeAttributeFromLocalAudioMedia("sendrecv"); sdp_->removeAttributeFromLocalAudioMedia("sendonly"); sdp_->addAttributeToLocalAudioMedia("sendrecv"); @@ -842,52 +804,6 @@ SIPCall::startAllMedia() CryptoOffer crypto_offer; getSDP().getRemoteSdpCryptoFromOffer(sdp_->getActiveRemoteSdpSession(), crypto_offer); -#if USE_CCRTP && HAVE_SDES - bool nego_success = false; - - if (!crypto_offer.empty()) { - std::vector<ring::CryptoSuiteDefinition> localCapabilities; - - for (size_t i = 0; i < RING_ARRAYSIZE(ring::CryptoSuites); ++i) - localCapabilities.push_back(ring::CryptoSuites[i]); - - ring::SdesNegotiator sdesnego(localCapabilities, crypto_offer); - auto callMgr = Manager::instance().getClient()->getCallManager(); - - if (sdesnego.negotiate()) { - nego_success = true; - - try { - audiortp_.setRemoteCryptoInfo(sdesnego); - callMgr->secureSdesOn(getCallId()); - } catch (const AudioRtpFactoryException &e) { - RING_ERR("%s", e.what()); - callMgr->secureSdesOff(getCallId()); - } - } else { - RING_ERR("SDES negotiation failure"); - callMgr->secureSdesOff(getCallId()); - } - } else { - RING_DBG("No crypto offer available"); - } - - // We did not find any crypto context for this media, RTP fallback - if (!nego_success && audiortp_.isSdesEnabled()) { - RING_ERR("Negotiation failed but SRTP is enabled, fallback on RTP"); - audiortp_.stop(); - audiortp_.setSrtpEnabled(false); - - const auto& account = getSIPAccount(); - if (account.getSrtpFallback()) { - audiortp_.initSession(); - - if (account.isStunEnabled()) - updateSDPFromSTUN(); - } - } -#endif // USE_CCRTP && HAVE_SDES - std::vector<ring::AudioCodec*> sessionMedia(sdp_->getSessionAudioMedia()); if (sessionMedia.empty()) { @@ -914,11 +830,6 @@ SIPCall::startAllMedia() audioCodecs.push_back(ac); } } - -#if USE_CCRTP - if (not audioCodecs.empty()) - getAudioRtp().updateSessionMedia(audioCodecs); -#endif } catch (const SdpException &e) { RING_ERR("%s", e.what()); } catch (const std::exception &rtpException) { diff --git a/daemon/src/sip/sipcall.h b/daemon/src/sip/sipcall.h index fba24c03c33f7e18db58d426e89fc073f2a79c9a..e8dfbecc9b8eb384ec3250cd7e6b49cc19637a26 100644 --- a/daemon/src/sip/sipcall.h +++ b/daemon/src/sip/sipcall.h @@ -39,9 +39,7 @@ #endif #include "call.h" -#if USE_CCRTP -#include "audio/audiortp/audio_rtp_factory.h" -#endif + #ifdef RING_VIDEO #include "video/video_rtp_session.h" #endif @@ -94,22 +92,12 @@ class SIPCall : public Call return *sdp_; } -#if USE_CCRTP - /** - * Returns a pointer to the AudioRtp object - */ - ring::AudioRtpFactory& getAudioRtp() { - return audiortp_; - } -#else - /** * Returns a pointer to the AVFormatRtpSession object */ ring::AVFormatRtpSession& getAVFormatRTP() const { return *avformatrtp_; } -#endif #ifdef RING_VIDEO /** @@ -211,14 +199,7 @@ class SIPCall : public Call std::vector<ring::IceCandidate> getAllRemoteCandidates(); -#if USE_CCRTP - /** - * Audio Rtp Session factory - */ - ring::AudioRtpFactory audiortp_; -#else std::unique_ptr<ring::AVFormatRtpSession> avformatrtp_; -#endif #ifdef RING_VIDEO /** diff --git a/daemon/src/sip/sipvoiplink.cpp b/daemon/src/sip/sipvoiplink.cpp index 5d240ccaf39c21b4d02ae3b9f7bcf25fbbcb88f6..6e65b611f46963f3402547c9e96f8d72b541a329 100644 --- a/daemon/src/sip/sipvoiplink.cpp +++ b/daemon/src/sip/sipvoiplink.cpp @@ -326,53 +326,10 @@ transaction_request_cb(pjsip_rx_data *rdata) call->initRecFilename(peerNumber); call->setCallMediaLocal(addrToUse); call->getSDP().setPublishedIP(addrSdp); -#if USE_CCRTP - call->getAudioRtp().initConfig(); - try { - call->getAudioRtp().initSession(); - } catch (const ost::Socket::Error &err) { - RING_ERR("AudioRtp socket error"); - return PJ_FALSE; - } -#endif if (account->isStunEnabled()) call->updateSDPFromSTUN(); -#if USE_CCRTP - if (body and body->len > 0 and call->getAudioRtp().isSdesEnabled()) { - std::string sdpOffer(static_cast<const char*>(body->data), body->len); - size_t start = sdpOffer.find("a=crypto:"); - - // Found crypto header in SDP - if (start != std::string::npos) { - CryptoOffer crypto_offer; - crypto_offer.push_back(std::string(sdpOffer.substr(start, (sdpOffer.size() - start) - 1))); - - const size_t size = RING_ARRAYSIZE(ring::CryptoSuites); - std::vector<ring::CryptoSuiteDefinition> localCapabilities(size); - - std::copy(ring::CryptoSuites, ring::CryptoSuites + size, - localCapabilities.begin()); - -#if HAVE_SDES - ring::SdesNegotiator sdesnego(localCapabilities, crypto_offer); - - if (sdesnego.negotiate()) { - try { - call->getAudioRtp().setRemoteCryptoInfo(sdesnego); - call->getAudioRtp().initLocalCryptoInfo(); - } catch (const AudioRtpFactoryException &e) { - RING_ERR("%s", e.what()); - return PJ_FALSE; - } - } - -#endif - } - } -#endif - call->getSDP().receiveOffer(r_sdp, account->getActiveAudioCodecs(), account->getActiveVideoCodecs()); if (not call->getIceTransport()) { RING_DBG("Initializing ICE transport"); @@ -390,9 +347,6 @@ transaction_request_cb(pjsip_rx_data *rdata) std::vector<ring::AudioCodec *> audioCodecs; audioCodecs.push_back(ac); -#if USE_CCRTP - call->getAudioRtp().start(audioCodecs); -#endif pjsip_dialog *dialog = 0;