mirror of
https://gitlab.linphone.org/BC/public/linphone-iphone.git
synced 2026-01-26 23:58:17 +00:00
Send full state NOTIFY of a conference to a specific device.
This commit is contained in:
parent
c50ba6614d
commit
e127ef09fa
2 changed files with 18 additions and 13 deletions
|
|
@ -29,10 +29,11 @@
|
|||
LINPHONE_BEGIN_NAMESPACE
|
||||
|
||||
class Participant;
|
||||
class ParticipantDevice;
|
||||
|
||||
class LocalConferenceEventHandlerPrivate : public ObjectPrivate {
|
||||
public:
|
||||
void notifyFullState (const std::string ¬ify, const std::shared_ptr<Participant> &participant);
|
||||
void notifyFullState (const std::string ¬ify, const std::shared_ptr<ParticipantDevice> &device);
|
||||
void notifyAllExcept (const std::string ¬ify, const std::shared_ptr<Participant> &exceptParticipant);
|
||||
void notifyAll (const std::string ¬ify);
|
||||
std::string createNotifyFullState (int notifyId = -1);
|
||||
|
|
@ -52,6 +53,7 @@ private:
|
|||
|
||||
std::string createNotify (Xsd::ConferenceInfo::ConferenceType confInfo, int notifyId = -1, bool isFullState = false);
|
||||
void notifyParticipant (const std::string ¬ify, const std::shared_ptr<Participant> &participant);
|
||||
void notifyParticipantDevice (const std::string ¬ify, const std::shared_ptr<ParticipantDevice> &device);
|
||||
|
||||
L_DECLARE_PUBLIC(LocalConferenceEventHandler);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ using namespace Xsd::ConferenceInfo;
|
|||
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
void LocalConferenceEventHandlerPrivate::notifyFullState (const string ¬ify, const shared_ptr<Participant> &participant) {
|
||||
notifyParticipant(notify, participant);
|
||||
void LocalConferenceEventHandlerPrivate::notifyFullState (const string ¬ify, const shared_ptr<ParticipantDevice> &device) {
|
||||
notifyParticipantDevice(notify, device);
|
||||
}
|
||||
|
||||
void LocalConferenceEventHandlerPrivate::notifyAllExcept (const string ¬ify, const shared_ptr<Participant> &exceptParticipant) {
|
||||
|
|
@ -54,14 +54,17 @@ void LocalConferenceEventHandlerPrivate::notifyAll (const string ¬ify) {
|
|||
}
|
||||
|
||||
void LocalConferenceEventHandlerPrivate::notifyParticipant (const string ¬ify, const shared_ptr<Participant> &participant) {
|
||||
for (const auto &device : participant->getPrivate()->getDevices()) {
|
||||
if (device->isSubscribedToConferenceEventPackage()) {
|
||||
LinphoneEvent *ev = device->getConferenceSubscribeEvent();
|
||||
LinphoneContent *content = linphone_core_create_content(ev->lc);
|
||||
linphone_content_set_buffer(content, (const uint8_t *)notify.c_str(), strlen(notify.c_str()));
|
||||
linphone_event_notify(ev, content);
|
||||
linphone_content_unref(content);
|
||||
}
|
||||
for (const auto &device : participant->getPrivate()->getDevices())
|
||||
notifyParticipantDevice(notify, device);
|
||||
}
|
||||
|
||||
void LocalConferenceEventHandlerPrivate::notifyParticipantDevice (const string ¬ify, const shared_ptr<ParticipantDevice> &device) {
|
||||
if (device->isSubscribedToConferenceEventPackage()) {
|
||||
LinphoneEvent *ev = device->getConferenceSubscribeEvent();
|
||||
LinphoneContent *content = linphone_core_create_content(ev->lc);
|
||||
linphone_content_set_buffer(content, (const uint8_t *)notify.c_str(), strlen(notify.c_str()));
|
||||
linphone_event_notify(ev, content);
|
||||
linphone_content_unref(content);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -280,9 +283,9 @@ void LocalConferenceEventHandler::subscribeReceived (LinphoneEvent *lev) {
|
|||
if (linphone_event_get_subscription_state(lev) == LinphoneSubscriptionActive) {
|
||||
unsigned int lastNotify = static_cast<unsigned int>(Utils::stoi(linphone_event_get_custom_header(lev, "Last-Notify-Version")));
|
||||
if (lastNotify == 0) {
|
||||
lInfo() << "Sending initial notify of conference:" << d->conf->getConferenceAddress().asStringUriOnly() << " to: " << participant->getAddress().asString();
|
||||
lInfo() << "Sending initial notify of conference:" << d->conf->getConferenceAddress().asStringUriOnly() << " to: " << device->getGruu().asString();
|
||||
device->setConferenceSubscribeEvent(lev);
|
||||
d->notifyFullState(d->createNotifyFullState(), participant);
|
||||
d->notifyFullState(d->createNotifyFullState(), device);
|
||||
} else if (lastNotify < d->lastNotify) {
|
||||
lInfo() << "Sending all missed notify for conference:" << d->conf->getConferenceAddress().asStringUriOnly() <<
|
||||
" from: " << lastNotify << " to: " << participant->getAddress().asString();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue