diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index edda58ab5..59d4bd5e3 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -97,6 +97,7 @@ set(LINPHONE_CXX_OBJECTS_PRIVATE_HEADER_FILES utils/payload-type-handler.h variant/variant.h xml/conference-info.h + xml/resource-lists.h xml/xml.h ) @@ -162,6 +163,7 @@ set(LINPHONE_CXX_OBJECTS_SOURCE_FILES utils/utils.cpp variant/variant.cpp xml/conference-info.cpp + xml/resource-lists.cpp xml/xml.cpp ) diff --git a/src/conference/remote-conference.cpp b/src/conference/remote-conference.cpp index 49ab55fac..8218cf31c 100644 --- a/src/conference/remote-conference.cpp +++ b/src/conference/remote-conference.cpp @@ -18,8 +18,10 @@ #include "remote-conference.h" #include "participant-p.h" +#include "xml/resource-lists.h" using namespace std; +using namespace LinphonePrivate::Xsd::ResourceLists; LINPHONE_BEGIN_NAMESPACE @@ -57,6 +59,25 @@ void RemoteConference::removeParticipant (const shared_ptr &p } } + +string RemoteConference::getResourceLists(const list> &participants) { + ResourceLists rl = ResourceLists(); + ListType l = ListType(); + for(const auto &p : participants) { + EntryType entry = EntryType(p->getAddress().asStringUriOnly()); + if(p->getAddress().getDisplayName() != "") { + entry.setDisplayName(DisplayName(p->getAddress().getDisplayName())); + } + l.getEntry().push_back(entry); + } + rl.getList().push_back(l); + + Xsd::XmlSchema::NamespaceInfomap map; + stringstream xmlBody; + serializeResourceLists(xmlBody, rl, map); + return xmlBody.str(); +} + // ----------------------------------------------------------------------------- void RemoteConference::onConferenceCreated (const Address &addr) {} diff --git a/src/conference/remote-conference.h b/src/conference/remote-conference.h index 3a33bb98f..94100bb21 100644 --- a/src/conference/remote-conference.h +++ b/src/conference/remote-conference.h @@ -39,6 +39,8 @@ public: std::shared_ptr addParticipant (const Address &addr, const CallSessionParams *params, bool hasMedia) override; void removeParticipant (const std::shared_ptr &participant) override; + std::string getResourceLists(const std::list> &participants); + protected: /* ConferenceListener */ void onConferenceCreated (const Address &addr) override;