From beede6a18d5599d1bebcbae702df3478c9a3ce69 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Thu, 7 Feb 2013 18:45:46 +0100 Subject: [PATCH] fix bugs. --- coreapi/linphonecall.c | 1 + coreapi/linphonecore_jni.cc | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecall.c b/coreapi/linphonecall.c index 27354f61..3b2054ae 100644 --- a/coreapi/linphonecall.c +++ b/coreapi/linphonecall.c @@ -473,6 +473,7 @@ LinphoneCall * linphone_call_new_outgoing(struct _LinphoneCore *lc, LinphoneAddr linphone_call_init_common(call,from,to); _linphone_call_params_copy(&call->params,params); sal_op_set_custom_header(call->op,call->params.custom_headers); + call->params.custom_headers=NULL; if (linphone_core_get_firewall_policy(call->core) == LinphonePolicyUseIce) { call->ice_session = ice_session_new(); diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 3cbcf8f7..52a0dec7 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1694,7 +1694,7 @@ extern "C" void Java_org_linphone_core_LinphoneChatMessageImpl_addCustomHeader(J const char *value=env->GetStringUTFChars(jheader_value,NULL); linphone_chat_message_add_custom_header((LinphoneChatMessage*)ptr,name,value); env->ReleaseStringUTFChars(jheader_name, name); - env->ReleaseStringUTFChars(jheader_name, name); + env->ReleaseStringUTFChars(jheader_value, value); } extern "C" jstring Java_org_linphone_core_LinphoneChatMessageImpl_getExternalBodyUrl(JNIEnv* env @@ -1876,7 +1876,7 @@ extern "C" jstring Java_org_linphone_core_LinphoneCallParamsImpl_getCustomHeader return header_value ? env->NewStringUTF(header_value) : NULL; } -extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_setCustomHeader(JNIEnv *env, jobject thiz, jlong lcp, jstring jheader_name, jstring jheader_value){ +extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_addCustomHeader(JNIEnv *env, jobject thiz, jlong lcp, jstring jheader_name, jstring jheader_value){ const char* header_name=env->GetStringUTFChars(jheader_name, NULL); const char* header_value=env->GetStringUTFChars(jheader_value, NULL); linphone_call_params_add_custom_header((LinphoneCallParams*)lcp,header_name,header_value); -- 2.39.2