diff --git a/coreapi/event.c b/coreapi/event.c index 149eda87c..ade697ab0 100644 --- a/coreapi/event.c +++ b/coreapi/event.c @@ -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(lev->op); return subscribeOp->notify(body_handler); } diff --git a/coreapi/private_functions.h b/coreapi/private_functions.h index 9d6b29b08..8c09ba1cf 100644 --- a/coreapi/private_functions.h +++ b/coreapi/private_functions.h @@ -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); diff --git a/src/c-wrapper/api/c-content.cpp b/src/c-wrapper/api/c-content.cpp index 1575248a1..9938b9cb7 100644 --- a/src/c-wrapper/api/c-content.cpp +++ b/src/c-wrapper/api/c-content.cpp @@ -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());