multi-stream: add new signals for media change

Add a 'mediaNegotiationStatus' signal to report media negotiation (SD)
status (SUCCES/FAIL).

Gitlab: #380

Change-Id: Id3ecb14484466ce80be716e05071a1eb31d50c2a
This commit is contained in:
Mohamed Chibani
2021-03-29 12:09:05 -04:00
parent 9028b7b2e7
commit 77a69e76c0
8 changed files with 73 additions and 31 deletions

View File

@ -856,7 +856,7 @@
<signal name="secureSdesOff" tp:name-for-bindings="secureSdesOff">
<tp:added version="0.9.7"/>
<tp:docstring>
<p>Sinal sent to notify that SDES session failed.</p>
<p>Signal sent to notify that SDES session failed.</p>
<p>Media transmission is not encrypted.</p>
</tp:docstring>
<arg type="s" name="callID" />
@ -919,5 +919,15 @@
<arg type="s" name="peerNumber" />
<arg type="b" name="remoteRecordingState" />
</signal>
<signal name="mediaNegotiationStatus" tp:name-for-bindings="mediaNegotiationStatus">
<tp:added version="9.10.0"/>
<tp:docstring>
<p>Report mediation negotation status.</p>
</tp:docstring>
<arg type="s" name="callID" />
<arg type="s" name="event" />
</signal>
</interface>
</node>

View File

@ -148,39 +148,58 @@ DBusClient::initLibrary(int flags)
auto confM = configurationManager_.get();
auto presM = presenceManager_.get();
#ifdef ENABLE_PLUGIN
auto plugM = pluginManagerInterface_.get();
#endif
#ifdef ENABLE_VIDEO
using DRing::VideoSignal;
auto videoM = videoManager_.get();
#endif
// Call event handlers
const std::map<std::string, SharedCallback> callEvHandlers = {
exportable_callback<CallSignal::StateChange>(bind(&DBusCallManager::callStateChanged, callM, _1, _2, _3)),
exportable_callback<CallSignal::TransferFailed>(bind(&DBusCallManager::transferFailed, callM)),
exportable_callback<CallSignal::TransferSucceeded>(bind(&DBusCallManager::transferSucceeded, callM)),
exportable_callback<CallSignal::RecordPlaybackStopped>(bind(&DBusCallManager::recordPlaybackStopped, callM, _1)),
exportable_callback<CallSignal::VoiceMailNotify>(bind(&DBusCallManager::voiceMailNotify, callM, _1, _2, _3, _4)),
exportable_callback<CallSignal::IncomingMessage>(bind(&DBusCallManager::incomingMessage, callM, _1, _2, _3)),
exportable_callback<CallSignal::IncomingCall>(bind(&DBusCallManager::incomingCall, callM, _1, _2, _3)),
exportable_callback<CallSignal::RecordPlaybackFilepath>(bind(&DBusCallManager::recordPlaybackFilepath, callM, _1, _2)),
exportable_callback<CallSignal::ConferenceCreated>(bind(&DBusCallManager::conferenceCreated, callM, _1)),
exportable_callback<CallSignal::ConferenceChanged>(bind(&DBusCallManager::conferenceChanged, callM, _1, _2)),
exportable_callback<CallSignal::UpdatePlaybackScale>(bind(&DBusCallManager::updatePlaybackScale, callM, _1, _2, _3)),
exportable_callback<CallSignal::ConferenceRemoved>(bind(&DBusCallManager::conferenceRemoved, callM, _1)),
exportable_callback<CallSignal::RecordingStateChanged>(bind(&DBusCallManager::recordingStateChanged, callM, _1, _2)),
exportable_callback<CallSignal::SecureSdesOn>(bind(&DBusCallManager::secureSdesOn, callM, _1)),
exportable_callback<CallSignal::SecureSdesOff>(bind(&DBusCallManager::secureSdesOff, callM, _1)),
exportable_callback<CallSignal::RtcpReportReceived>(bind(&DBusCallManager::onRtcpReportReceived, callM, _1, _2)),
exportable_callback<CallSignal::OnConferenceInfosUpdated>(bind(&DBusCallManager::onConferenceInfosUpdated, callM, _1, _2)),
exportable_callback<CallSignal::PeerHold>(bind(&DBusCallManager::peerHold, callM, _1, _2)),
exportable_callback<CallSignal::AudioMuted>(bind(&DBusCallManager::audioMuted, callM, _1, _2)),
exportable_callback<CallSignal::VideoMuted>(bind(&DBusCallManager::videoMuted, callM, _1, _2)),
exportable_callback<CallSignal::SmartInfo>(bind(&DBusCallManager::SmartInfo, callM, _1)),
exportable_callback<CallSignal::RemoteRecordingChanged>(bind(&DBusCallManager::remoteRecordingChanged, callM, _1, _2, _3))
};
const std::map<std::string, SharedCallback> callEvHandlers
= {exportable_callback<CallSignal::StateChange>(
bind(&DBusCallManager::callStateChanged, callM, _1, _2, _3)),
exportable_callback<CallSignal::TransferFailed>(
bind(&DBusCallManager::transferFailed, callM)),
exportable_callback<CallSignal::TransferSucceeded>(
bind(&DBusCallManager::transferSucceeded, callM)),
exportable_callback<CallSignal::RecordPlaybackStopped>(
bind(&DBusCallManager::recordPlaybackStopped, callM, _1)),
exportable_callback<CallSignal::VoiceMailNotify>(
bind(&DBusCallManager::voiceMailNotify, callM, _1, _2, _3, _4)),
exportable_callback<CallSignal::IncomingMessage>(
bind(&DBusCallManager::incomingMessage, callM, _1, _2, _3)),
exportable_callback<CallSignal::IncomingCall>(
bind(&DBusCallManager::incomingCall, callM, _1, _2, _3)),
exportable_callback<CallSignal::RecordPlaybackFilepath>(
bind(&DBusCallManager::recordPlaybackFilepath, callM, _1, _2)),
exportable_callback<CallSignal::ConferenceCreated>(
bind(&DBusCallManager::conferenceCreated, callM, _1)),
exportable_callback<CallSignal::ConferenceChanged>(
bind(&DBusCallManager::conferenceChanged, callM, _1, _2)),
exportable_callback<CallSignal::UpdatePlaybackScale>(
bind(&DBusCallManager::updatePlaybackScale, callM, _1, _2, _3)),
exportable_callback<CallSignal::ConferenceRemoved>(
bind(&DBusCallManager::conferenceRemoved, callM, _1)),
exportable_callback<CallSignal::RecordingStateChanged>(
bind(&DBusCallManager::recordingStateChanged, callM, _1, _2)),
exportable_callback<CallSignal::SecureSdesOn>(
bind(&DBusCallManager::secureSdesOn, callM, _1)),
exportable_callback<CallSignal::SecureSdesOff>(
bind(&DBusCallManager::secureSdesOff, callM, _1)),
exportable_callback<CallSignal::RtcpReportReceived>(
bind(&DBusCallManager::onRtcpReportReceived, callM, _1, _2)),
exportable_callback<CallSignal::OnConferenceInfosUpdated>(
bind(&DBusCallManager::onConferenceInfosUpdated, callM, _1, _2)),
exportable_callback<CallSignal::PeerHold>(
bind(&DBusCallManager::peerHold, callM, _1, _2)),
exportable_callback<CallSignal::AudioMuted>(
bind(&DBusCallManager::audioMuted, callM, _1, _2)),
exportable_callback<CallSignal::VideoMuted>(
bind(&DBusCallManager::videoMuted, callM, _1, _2)),
exportable_callback<CallSignal::SmartInfo>(bind(&DBusCallManager::SmartInfo, callM, _1)),
exportable_callback<CallSignal::RemoteRecordingChanged>(
bind(&DBusCallManager::remoteRecordingChanged, callM, _1, _2, _3)),
exportable_callback<CallSignal::MediaNegotiationStatus>(
bind(&DBusCallManager::mediaNegotiationStatus, callM, _1, _2))};
// Configuration event handlers
const std::map<std::string, SharedCallback> configEvHandlers = {

View File

@ -49,6 +49,7 @@ public:
virtual void peerHold(const std::string& call_id, bool holding){}
virtual void connectionUpdate(const std::string& id, int state){}
virtual void remoteRecordingChanged(const std::string& call_id, const std::string& peer_number, bool state){}
virtual void mediaNegotiationStatus(const std::string& call_id, const std::string& event){}
};
@ -144,5 +145,5 @@ public:
virtual void peerHold(const std::string& call_id, bool holding){}
virtual void connectionUpdate(const std::string& id, int state){}
virtual void remoteRecordingChanged(const std::string& call_id, const std::string& peer_number, bool state){}
virtual void mediaNegotiationStatus(const std::string& call_id, const std::string& event){}
};

View File

@ -252,7 +252,8 @@ void init(ConfigurationCallback* confM, Callback* callM, PresenceCallback* presM
exportable_callback<CallSignal::OnConferenceInfosUpdated>(bind(&Callback::onConferenceInfosUpdated, callM, _1, _2)),
exportable_callback<CallSignal::PeerHold>(bind(&Callback::peerHold, callM, _1, _2)),
exportable_callback<CallSignal::ConnectionUpdate>(bind(&Callback::connectionUpdate, callM, _1, _2)),
exportable_callback<CallSignal::RemoteRecordingChanged>(bind(&Callback::remoteRecordingChanged, callM, _1, _2, _3))
exportable_callback<CallSignal::RemoteRecordingChanged>(bind(&Callback::remoteRecordingChanged, callM, _1, _2, _3)),
exportable_callback<CallSignal::MediaNegotiationStatus>(bind(&Callback::mediaNegotiationStatus, callM, _1, _2))
};
// Configuration event handlers

View File

@ -50,6 +50,7 @@ getSignalHandlers()
exported_callback<DRing::CallSignal::ConnectionUpdate>(),
exported_callback<DRing::CallSignal::OnConferenceInfosUpdated>(),
exported_callback<DRing::CallSignal::RemoteRecordingChanged>(),
exported_callback<DRing::CallSignal::MediaNegotiationStatus>(),
/* Configuration */
exported_callback<DRing::ConfigurationSignal::VolumeChanged>(),

View File

@ -245,6 +245,12 @@ struct DRING_PUBLIC CallSignal
constexpr static const char* name = "RemoteRecordingChanged";
using cb_type = void(const std::string&, const std::string&, bool);
};
// Report media negotiation status
struct DRING_PUBLIC MediaNegotiationStatus
{
constexpr static const char* name = "MediaNegotiationStatus";
using cb_type = void(const std::string&, const std::string&);
};
};
} // namespace DRing

View File

@ -98,4 +98,9 @@ constexpr static auto AUDIO = "MEDIA_TYPE_AUDIO";
constexpr static auto VIDEO = "MEDIA_TYPE_VIDEO";
} // namespace MediaAttributeValue
namespace MediaNegotiationStatusEvents {
constexpr static auto NEGOTIATION_SUCCESS = "NEGOTIATION_SUCCESS";
constexpr static auto NEGOTIATION_FAIL = "NEGOTIATION_FAIL";
} // namespace MediaNegotiationStatusEvents
} // namespace jami

View File

@ -300,5 +300,4 @@ struct MediaDescription
/** Crypto parameters */
CryptoAttribute crypto {};
};
} // namespace jami