sarting to generate notify body

This commit is contained in:
Benjamin Reis 2018-03-16 20:24:57 +01:00
parent ca7dd265fc
commit cb720429fa

View file

@ -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<Content> contents;
Content rlmiContent;
rlmiContent.setContentType(ContentType::Rlmi);
istringstream data(xmlBody);
unique_ptr<Xsd::ResourceLists::ResourceLists> 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 () {