diff --git a/src/conference/handlers/local-conference-list-event-handler.cpp b/src/conference/handlers/local-conference-list-event-handler.cpp index 4b768d2de..bdf61c7d2 100644 --- a/src/conference/handlers/local-conference-list-event-handler.cpp +++ b/src/conference/handlers/local-conference-list-event-handler.cpp @@ -130,18 +130,14 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con content.setBody(notifyBody); char token[17]; - ostringstream os; - os.str(""); belle_sip_random_token(token, sizeof(token)); - os << token << "@sip.linphone.org"; - Address cid(os.str()); - content.addHeader("Content-Id", cid.asStringUriOnly()); + content.addHeader("Content-Id", token); contents.push_back(content); // Add entry into the Rlmi content of the notify body Xsd::Rlmi::Resource resource(addr.asStringUriOnly()); Xsd::Rlmi::Resource::InstanceSequence instances; - Xsd::Rlmi::Instance instance(cid.asStringUriOnly(), Xsd::Rlmi::State::Value::active); + Xsd::Rlmi::Instance instance(token, Xsd::Rlmi::State::Value::active); instances.push_back(instance); resource.setInstance(instances); resources.push_back(resource); diff --git a/src/conference/handlers/remote-conference-list-event-handler.cpp b/src/conference/handlers/remote-conference-list-event-handler.cpp index f8ed05304..b20a92a5a 100644 --- a/src/conference/handlers/remote-conference-list-event-handler.cpp +++ b/src/conference/handlers/remote-conference-list-event-handler.cpp @@ -148,7 +148,7 @@ void RemoteConferenceListEventHandler::notifyReceived (const Content *notifyCont list contents = ContentManager::multipartToContentList(*notifyContent); bctbx_free(from); - map addresses; + map addresses; for (const auto &content : contents) { const string &body = content.getBodyAsString(); const ContentType &contentType = content.getContentType(); @@ -157,11 +157,10 @@ void RemoteConferenceListEventHandler::notifyReceived (const Content *notifyCont continue; } - const string &value = content.getHeaderValue("Content-Id"); - if (value.empty()) + const string &cid = content.getHeaderValue("Content-Id"); + if (cid.empty()) continue; - IdentityAddress cid(value); IdentityAddress peer = addresses[cid]; ChatRoomId id(peer, local); RemoteConferenceEventHandler *handler = findHandler(id); @@ -200,13 +199,13 @@ void RemoteConferenceListEventHandler::removeHandler (RemoteConferenceEventHandl handlers.remove(handler); } -map RemoteConferenceListEventHandler::parseRlmi (const string &xmlBody) const { +map RemoteConferenceListEventHandler::parseRlmi (const string &xmlBody) const { istringstream data(xmlBody); unique_ptr rlmi(Xsd::Rlmi::parseList( data, Xsd::XmlSchema::Flags::dont_validate )); - map addresses; + map addresses; for (const auto &resource : rlmi->getResource()) { if (resource.getInstance().empty()) continue; @@ -216,7 +215,7 @@ map RemoteConferenceListEventHandler::parseRlm if (!instance.getCid().present()) continue; - IdentityAddress cid(instance.getCid().get()); + string cid = instance.getCid().get(); addresses[cid] = peer; } } diff --git a/src/conference/handlers/remote-conference-list-event-handler.h b/src/conference/handlers/remote-conference-list-event-handler.h index 81abb2cf6..e7d504c86 100644 --- a/src/conference/handlers/remote-conference-list-event-handler.h +++ b/src/conference/handlers/remote-conference-list-event-handler.h @@ -56,7 +56,7 @@ private: std::list handlers; LinphoneEvent *lev = nullptr; - std::map parseRlmi (const std::string &xmlBody) const; + std::map parseRlmi (const std::string &xmlBody) const; // CoreListener void onNetworkReachable (bool sipNetworkReachable, bool mediaNetworkReachable) override;