fix body of notify

This commit is contained in:
Benjamin Reis 2018-03-20 13:57:28 +01:00
parent 561c5dd757
commit 12fb92ec0b
2 changed files with 5 additions and 4 deletions

View file

@ -131,10 +131,10 @@ void LocalConferenceListEventHandler::subscribeReceived (LinphoneEvent *lev, con
content.setBody(notifyBody);
char token[17];
ostringstream os;
belle_sip_random_token(token, sizeof(token));
os << "@sip.linphone.org";
Address cid(os.str());
os.str("");
belle_sip_random_token(token, sizeof(token));
os << token << "@sip.linphone.org";
Address cid(os.str());
content.addHeader("Content-Id", cid.asStringUriOnly());
contents.push_back(content);

View file

@ -228,7 +228,8 @@ const string &Content::getHeaderValue (const string &headerName) const {
LinphoneContent *Content::toLinphoneContent () const {
LinphoneContent *content = linphone_core_create_content(nullptr);
linphone_content_set_type(content, getContentType().getType().c_str());
linphone_content_set_subtype(content, getContentType().getSubType().c_str());
string subtype = getContentType().getSubType() + getContentType().getParameter();
linphone_content_set_subtype(content, subtype.c_str());
linphone_content_set_buffer(content, (const uint8_t *)getBodyAsUtf8String().c_str(), getBodyAsUtf8String().size());
return content;
}