Commit 48140cef authored by jehan's avatar jehan
Browse files

remove unwanted quotes from LinphoenMessage external body url

parent 04f3c8af
......@@ -108,12 +108,19 @@ static void process_request_event(void *op_base, const belle_sip_request_event_t
,belle_sip_header_cseq_get_seq_number(cseq));
salmsg.from=from;
salmsg.text=plain_text?belle_sip_message_get_body(BELLE_SIP_MESSAGE(req)):NULL;
salmsg.url=external_body?belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL"):NULL;
salmsg.url=NULL;
if (external_body && belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL")) {
size_t url_length=strlen(belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL"));
char* url = ms_malloc(url_length);
if (sscanf(belle_sip_parameters_get_parameter(BELLE_SIP_PARAMETERS(content_type),"URL"),"\"%s\"",url) ==1)
salmsg.url=url;
}
salmsg.message_id=message_id;
salmsg.time=date ? belle_sip_header_date_get_time(date) : time(NULL);
op->base.root->callbacks.text_received(op,&salmsg);
belle_sip_object_unref(address);
belle_sip_free(from);
if (salmsg.url) ms_free((char*)salmsg.url);
response_code=200;
} else {
ms_error("Unsupported MESSAGE with content type [%s/%s]",belle_sip_header_content_type_get_type(content_type)
......
......@@ -164,9 +164,10 @@ static void text_message_with_external_body(void) {
linphone_chat_room_send_message2(chat_room,message,linphone_chat_message_state_change,pauline->lc);
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&marie->stat.number_of_LinphoneMessageReceived,1));
CU_ASSERT_TRUE(wait_for(pauline->lc,marie->lc,&pauline->stat.number_of_LinphoneMessageDelivered,1));
CU_ASSERT_EQUAL(pauline->stat.number_of_LinphoneMessageInProgress,1);
CU_ASSERT_EQUAL(marie->stat.number_of_LinphoneMessageExtBodyReceived,1);
/*fixme use history to check message content*/
linphone_core_manager_destroy(marie);
linphone_core_manager_destroy(pauline);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment