From c1f90bf28303de890bcd2e5de9eb090de97cbe55 Mon Sep 17 00:00:00 2001 From: Ghislain MARY Date: Mon, 19 Oct 2015 16:20:01 +0200 Subject: [PATCH] Add JNI for the API to clear custom SDP attributes. --- coreapi/linphonecore_jni.cc | 8 ++++++++ .../common/org/linphone/core/LinphoneCallParams.java | 11 +++++++++++ .../org/linphone/core/LinphoneCallParamsImpl.java | 12 ++++++++++++ 3 files changed, 31 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 989074639..3390df536 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -3718,6 +3718,14 @@ JNIEXPORT jstring JNICALL Java_org_linphone_core_LinphoneCallParamsImpl_getCusto return value ? env->NewStringUTF(value) : NULL; } +JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCallParamsImpl_clearCustomSdpAttributes(JNIEnv *env, jobject thiz, jlong ptr) { + linphone_call_params_clear_custom_sdp_attributes((LinphoneCallParams *)ptr); +} + +JNIEXPORT void JNICALL Java_org_linphone_core_LinphoneCallParamsImpl_clearCustomSdpMediaAttributes(JNIEnv *env, jobject thiz, jlong ptr, jint jtype) { + linphone_call_params_clear_custom_sdp_media_attributes((LinphoneCallParams *)ptr, (LinphoneStreamType)jtype); +} + extern "C" void Java_org_linphone_core_LinphoneCallParamsImpl_setRecordFile(JNIEnv *env, jobject thiz, jlong lcp, jstring jrecord_file){ if (jrecord_file){ const char* record_file=env->GetStringUTFChars(jrecord_file, NULL); diff --git a/java/common/org/linphone/core/LinphoneCallParams.java b/java/common/org/linphone/core/LinphoneCallParams.java index ed16ec396..cd8c67712 100644 --- a/java/common/org/linphone/core/LinphoneCallParams.java +++ b/java/common/org/linphone/core/LinphoneCallParams.java @@ -129,6 +129,17 @@ public interface LinphoneCallParams { **/ String getCustomSdpMediaAttribute(StreamType type, String name); + /** + * Clear the custom SDP attributes related to all the streams in the SDP exchanged within SIP messages during a call. + **/ + void clearCustomSdpAttributes(); + + /** + * Clear the custom SDP attributes related to a specific stream in the SDP exchanged within SIP messages during a call. + * @param type The type of the stream to clear custom SDP attributes from. + **/ + void clearCustomSdpMediaAttributes(StreamType type); + /** * Set the privacy for the call. * @param privacy_mask a or'd int of values defined in interface {@link org.linphone.core.Privacy} diff --git a/java/impl/org/linphone/core/LinphoneCallParamsImpl.java b/java/impl/org/linphone/core/LinphoneCallParamsImpl.java index df91d4d81..7a76d82f3 100644 --- a/java/impl/org/linphone/core/LinphoneCallParamsImpl.java +++ b/java/impl/org/linphone/core/LinphoneCallParamsImpl.java @@ -133,6 +133,18 @@ public class LinphoneCallParamsImpl implements LinphoneCallParams { return getCustomSdpMediaAttribute(nativePtr, type.mValue, name); } + private native void clearCustomSdpAttributes(long nativePtr); + @Override + public void clearCustomSdpAttributes() { + clearCustomSdpAttributes(nativePtr); + } + + private native void clearCustomSdpMediaAttributes(long nativePtr, int type); + @Override + public void clearCustomSdpMediaAttributes(StreamType type) { + clearCustomSdpMediaAttributes(nativePtr, type.mValue); + } + private native void setPrivacy(long nativePtr, int mask); @Override public void setPrivacy(int privacy_mask) {