fix send of notify multipart

This commit is contained in:
Benjamin Reis 2018-05-09 15:04:41 +02:00
parent bad6d9e9e1
commit 1572ef97ee
3 changed files with 4 additions and 4 deletions

View file

@ -324,7 +324,7 @@ LinphoneStatus linphone_event_notify(LinphoneEvent *lev, const LinphoneContent *
ms_error("linphone_event_notify(): cannot notify if not an incoming subscription.");
return -1;
}
body_handler = sal_body_handler_from_content(body);
body_handler = sal_body_handler_from_content(body, false);
auto subscribeOp = dynamic_cast<SalSubscribeOp *>(lev->op);
return subscribeOp->notify(body_handler);
}

View file

@ -386,7 +386,7 @@ void linphone_configure_op(LinphoneCore *lc, LinphonePrivate::SalOp *op, const L
void linphone_configure_op_with_proxy(LinphoneCore *lc, LinphonePrivate::SalOp *op, const LinphoneAddress *dest, SalCustomHeader *headers, bool_t with_contact, LinphoneProxyConfig *proxy);
LinphoneContent * linphone_content_new(void);
LinphoneContent * linphone_content_copy(const LinphoneContent *ref);
SalBodyHandler *sal_body_handler_from_content(const LinphoneContent *content);
SalBodyHandler *sal_body_handler_from_content(const LinphoneContent *content, bool parseMultipart = true);
SalReason linphone_reason_to_sal(LinphoneReason reason);
LinphoneReason linphone_reason_from_sal(SalReason reason);
void linphone_error_info_to_sal(const LinphoneErrorInfo* ei, SalErrorInfo* sei);

View file

@ -303,13 +303,13 @@ LinphoneContent *linphone_content_from_sal_body_handler (SalBodyHandler *body_ha
return NULL;
}
SalBodyHandler *sal_body_handler_from_content (const LinphoneContent *content) {
SalBodyHandler *sal_body_handler_from_content (const LinphoneContent *content, bool parseMultipart) {
if (content == NULL) return NULL;
SalBodyHandler *body_handler;
LinphonePrivate::ContentType contentType = L_GET_CPP_PTR_FROM_C_OBJECT(content)->getContentType();
if (contentType.isMultipart()) {
if (contentType.isMultipart() && parseMultipart) {
size_t size = linphone_content_get_size(content);
char *buffer = bctbx_strdup(L_GET_CPP_PTR_FROM_C_OBJECT(content)->getBodyAsUtf8String().c_str());
const char *boundary = L_STRING_TO_C(contentType.getParameter("boundary").getValue());