mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-12 22:09:25 +08:00
signal the client of peer holding
Refs #68897 Change-Id: Idf8176533f19a8bee266684adc71e829ed88a46c
This commit is contained in:

committed by
Guillaume Roguez

parent
be732d4737
commit
9dba306837
@ -792,5 +792,12 @@
|
||||
</tp:docstring>
|
||||
</arg>
|
||||
</signal>
|
||||
|
||||
<signal name="peerHold" tp:name-for-bindings="peerHold">
|
||||
<tp:added version="2.0.0"/>
|
||||
<arg type="s" name="callID" />
|
||||
<arg type="b" name="peerHolding" />
|
||||
</signal>
|
||||
|
||||
</interface>
|
||||
</node>
|
||||
|
@ -174,6 +174,7 @@ DBusClient::initLibrary(int sflphFlags)
|
||||
exportable_callback<CallSignal::ZrtpNotSuppOther>(bind(&DBusCallManager::zrtpNotSuppOther, callM, _1)),
|
||||
exportable_callback<CallSignal::ZrtpNegotiationFailed>(bind(&DBusCallManager::zrtpNegotiationFailed, callM, _1, _2, _3)),
|
||||
exportable_callback<CallSignal::RtcpReportReceived>(bind(&DBusCallManager::onRtcpReportReceived, callM, _1, _2)),
|
||||
exportable_callback<CallSignal::PeerHold>(bind(&DBusCallManager::peerHold, callM, _1, _2))
|
||||
};
|
||||
|
||||
// Configuration event handlers
|
||||
|
@ -87,9 +87,6 @@ const char * const Account::HAS_CUSTOM_USER_AGENT_KEY = "hasCustomUserAgent";
|
||||
const char * const Account::PRESENCE_MODULE_ENABLED_KEY = "presenceModuleEnabled";
|
||||
const char * const Account::UPNP_ENABLED_KEY = "upnpEnabled";
|
||||
|
||||
constexpr const char* Account::TRUE_STR;
|
||||
constexpr const char* Account::FALSE_STR;
|
||||
|
||||
Account::Account(const std::string &accountID)
|
||||
: accountID_(accountID)
|
||||
, username_()
|
||||
|
@ -86,9 +86,6 @@ class VoipLinkException : public std::runtime_error
|
||||
class Account : public Serializable, public std::enable_shared_from_this<Account>
|
||||
{
|
||||
public:
|
||||
constexpr static const char* TRUE_STR = "true";
|
||||
constexpr static const char* FALSE_STR = "false";
|
||||
|
||||
Account(const std::string& accountID);
|
||||
|
||||
/**
|
||||
|
@ -60,6 +60,7 @@ getSignalHandlers()
|
||||
exported_callback<DRing::CallSignal::ZrtpNotSuppOther>(),
|
||||
exported_callback<DRing::CallSignal::ZrtpNegotiationFailed>(),
|
||||
exported_callback<DRing::CallSignal::RtcpReportReceived>(),
|
||||
exported_callback<DRing::CallSignal::PeerHold>(),
|
||||
|
||||
/* Configuration */
|
||||
exported_callback<DRing::ConfigurationSignal::VolumeChanged>(),
|
||||
|
@ -43,6 +43,7 @@ constexpr static char CALL_STATE [] = "CALL_STATE" ;
|
||||
constexpr static char CONF_ID [] = "CONF_ID" ;
|
||||
constexpr static char TIMESTAMP_START [] = "TIMESTAMP_START" ;
|
||||
constexpr static char ACCOUNTID [] = "ACCOUNTID" ;
|
||||
constexpr static char PEER_HOLDING [] = "PEER_HOLDING" ;
|
||||
constexpr static char TLS_PEER_CERT [] = "TLS_PEER_CERT" ;
|
||||
constexpr static char TLS_CIPHER [] = "TLS_CIPHER" ;
|
||||
|
||||
|
@ -198,6 +198,10 @@ struct CallSignal {
|
||||
constexpr static const char* name = "RtcpReportReceived";
|
||||
using cb_type = void(const std::string&, const std::map<std::string, int>&);
|
||||
};
|
||||
struct PeerHold {
|
||||
constexpr static const char* name = "PeerHold";
|
||||
using cb_type = void(const std::string&, bool);
|
||||
};
|
||||
};
|
||||
|
||||
} // namespace DRing
|
||||
|
@ -258,7 +258,7 @@ Sdp::setMediaDescriptorLines(bool audio, bool holding, sip_utils::KeyExchangePro
|
||||
addRTCPAttribute(med); // video has its own RTCP
|
||||
}
|
||||
|
||||
med->attr[med->attr_count++] = pjmedia_sdp_attr_create(memPool_.get(), holding ? (audio ? "recvonly" : "inactive") : "sendrecv", NULL);
|
||||
med->attr[med->attr_count++] = pjmedia_sdp_attr_create(memPool_.get(), holding ? (audio ? "sendonly" : "inactive") : "sendrecv", NULL);
|
||||
|
||||
if (kx == sip_utils::KeyExchangeProtocol::SDES) {
|
||||
if (pjmedia_sdp_media_add_attr(med, generateSdesAttribute()) != PJ_SUCCESS)
|
||||
@ -586,7 +586,7 @@ Sdp::getMediaSlots(const pjmedia_sdp_session* session, bool remote) const
|
||||
descr.addr = std::string(conn->addr.ptr, conn->addr.slen);
|
||||
descr.addr.setPort(media->desc.port);
|
||||
|
||||
descr.holding = pjmedia_sdp_attr_find2(media->attr_count, media->attr, "recvonly", nullptr)
|
||||
descr.holding = pjmedia_sdp_attr_find2(media->attr_count, media->attr, "sendonly", nullptr)
|
||||
|| pjmedia_sdp_attr_find2(media->attr_count, media->attr, "inactive", nullptr);
|
||||
|
||||
// get codecs infos
|
||||
|
@ -1751,7 +1751,7 @@ set_opt(const std::map<std::string, std::string> &details, const char *key, bool
|
||||
std::map<std::string, std::string>::const_iterator it = details.find(key);
|
||||
|
||||
if (it != details.end())
|
||||
val = it->second == Account::TRUE_STR;
|
||||
val = it->second == TRUE_STR;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -42,6 +42,7 @@
|
||||
#include "sdp.h"
|
||||
#include "manager.h"
|
||||
#include "array_size.h"
|
||||
#include "string_utils.h"
|
||||
#include "upnp/upnp_control.h"
|
||||
|
||||
#include "audio/audio_rtp_session.h"
|
||||
@ -53,6 +54,7 @@
|
||||
#endif
|
||||
|
||||
#include "dring/call_const.h"
|
||||
#include "client/signal.h"
|
||||
|
||||
#ifdef RING_VIDEO
|
||||
#include "client/videomanager.h"
|
||||
@ -775,6 +777,7 @@ SIPCall::startAllMedia()
|
||||
}
|
||||
auto slots = sdp_->getMediaSlots();
|
||||
unsigned ice_comp_id = 0;
|
||||
bool peer_holding {true};
|
||||
|
||||
for (const auto& slot : slots) {
|
||||
const auto& local = slot.first;
|
||||
@ -805,6 +808,8 @@ SIPCall::startAllMedia()
|
||||
continue;
|
||||
}
|
||||
|
||||
peer_holding &= remote.holding;
|
||||
|
||||
if (isSecure() && (not local.crypto || not remote.crypto)) {
|
||||
RING_ERR("Can't perform secure call over insecure RTP transport");
|
||||
continue;
|
||||
@ -825,6 +830,10 @@ SIPCall::startAllMedia()
|
||||
} else
|
||||
rtp->start();
|
||||
}
|
||||
if (peerHolding_ != peer_holding) {
|
||||
peerHolding_ = peer_holding;
|
||||
emitSignal<DRing::CallSignal::PeerHold>(getCallId(), peerHolding_);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
@ -928,6 +937,7 @@ std::map<std::string, std::string>
|
||||
SIPCall::getDetails() const
|
||||
{
|
||||
auto details = Call::getDetails();
|
||||
details.emplace(DRing::Call::Details::PEER_HOLDING, peerHolding_ ? TRUE_STR : FALSE_STR);
|
||||
if (transport_ and transport_->isSecure()) {
|
||||
const auto& tlsInfos = transport_->getTlsInfos();
|
||||
auto cipher = pj_ssl_cipher_name(tlsInfos.cipher);
|
||||
|
@ -243,6 +243,7 @@ class SIPCall : public Call
|
||||
* The SDP session
|
||||
*/
|
||||
std::unique_ptr<Sdp> sdp_;
|
||||
bool peerHolding_ {false};
|
||||
|
||||
char contactBuffer_[PJSIP_MAX_URL_SIZE] {};
|
||||
pj_str_t contactHeader_ {contactBuffer_, 0};
|
||||
|
@ -41,6 +41,9 @@
|
||||
|
||||
namespace ring {
|
||||
|
||||
constexpr static const char* TRUE_STR = "true";
|
||||
constexpr static const char* FALSE_STR = "false";
|
||||
|
||||
#ifdef __ANDROID__
|
||||
|
||||
template <typename T>
|
||||
|
Reference in New Issue
Block a user