From 9366856ee9f522dea60da57ca35498fcfb77f29a Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Sat, 17 Mar 2018 12:15:52 +0100 Subject: [PATCH] generate rlmi content for notify body --- .../local-conference-list-event-handler.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/src/conference/handlers/local-conference-list-event-handler.cpp b/src/conference/handlers/local-conference-list-event-handler.cpp index a2ddee5ea..d182bacd8 100644 --- a/src/conference/handlers/local-conference-list-event-handler.cpp +++ b/src/conference/handlers/local-conference-list-event-handler.cpp @@ -46,6 +46,10 @@ void LocalConferenceListEventHandler::subscribeReceived (const string &xmlBody) Content rlmiContent; rlmiContent.setContentType(ContentType::Rlmi); + // Create Rlmi body + Xsd::Rlmi::List::ResourceSequence resources; + + // Parse resource list istringstream data(xmlBody); unique_ptr rl(Xsd::ResourceLists::parseResourceLists( data, @@ -84,10 +88,23 @@ void LocalConferenceListEventHandler::subscribeReceived (const string &xmlBody) content.addHeader("Content-Id", cid.asStringUriOnly()); contents.push_back(content); - // Add entry into the rlmi content of the notify body + // 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); + instances.push_back(instance); + resource.setInstance(instances); + resources.push_back(resource); } } + Xsd::Rlmi::List list("", 0, TRUE); + list.setResource(resources); + Xsd::XmlSchema::NamespaceInfomap map; + stringstream rlmiBody; + Xsd::Rlmi::serializeList(rlmiBody, list, map); + rlmiContent.setBody(rlmiBody.str()); + contents.push_front(rlmiContent); Content multipart = ContentManager::contentListToMultipart(contents, MultipartBoundaryListEventHandler); (void) multipart;