From cb720429fad3128ce7af1cd352eab3ec2a3be5cf Mon Sep 17 00:00:00 2001 From: Benjamin Reis Date: Fri, 16 Mar 2018 20:24:57 +0100 Subject: [PATCH] sarting to generate notify body --- .../local-conference-list-event-handler.cpp | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/conference/handlers/local-conference-list-event-handler.cpp b/src/conference/handlers/local-conference-list-event-handler.cpp index 26168f753..96e47470f 100644 --- a/src/conference/handlers/local-conference-list-event-handler.cpp +++ b/src/conference/handlers/local-conference-list-event-handler.cpp @@ -20,9 +20,13 @@ #include "linphone/utils/utils.h" #include "address/address.h" +#include "content/content.h" +#include "content/content-manager.h" +#include "content/content-type.h" #include "local-conference-event-handler.h" #include "local-conference-list-event-handler.h" #include "xml/resource-lists.h" +#include "xml/rlmi.h" // ============================================================================= @@ -30,9 +34,17 @@ using namespace std; LINPHONE_BEGIN_NAMESPACE +namespace { + constexpr const char MultipartBoundary[] = "---------------------------14737809831412343453453"; +} + // ----------------------------------------------------------------------------- void LocalConferenceListEventHandler::subscribeReceived (const string &xmlBody) { + list contents; + Content rlmiContent; + rlmiContent.setContentType(ContentType::Rlmi); + istringstream data(xmlBody); unique_ptr rl(Xsd::ResourceLists::parseResourceLists( data, @@ -53,8 +65,25 @@ void LocalConferenceListEventHandler::subscribeReceived (const string &xmlBody) if (notifyBody.empty()) continue; + Content content; + if (notifyId > 0) { + ContentType contentType(ContentType::Multipart); + contentType.setParameter("boundary=" + string(MultipartBoundary)); + content.setContentType(contentType); + } else + content.setContentType(ContentType::ConferenceInfo); + + content.setBody(notifyBody); + content.addHeader("Content-Id", addr.asStringUriOnly()); + contents.push_back(content); + + // Add entry into the rlmi content of the notify body } } + + contents.push_front(rlmiContent); + Content multipart = ContentManager::contentListToMultipart(contents); + (void) multipart; } void LocalConferenceListEventHandler::notify () {