From 5e01d28d2bb5388a82de982fa274ba1e9f843ef1 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Mon, 7 Apr 2014 11:57:59 +0200 Subject: [PATCH] Added linphonecore stop ringing JNI wrapper --- coreapi/linphonecore_jni.cc | 4 ++++ java/common/org/linphone/core/LinphoneCore.java | 5 +++++ java/impl/org/linphone/core/LinphoneCoreImpl.java | 6 ++++++ 3 files changed, 15 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index f5cc41bb9..f7c8f46eb 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -798,6 +798,10 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCallImpl_sendInfoMessage(J return linphone_call_send_info_message((LinphoneCall*)callptr,(LinphoneInfoMessage*)infoptr); } +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_stopRinging(JNIEnv* env, jobject thiz, jlong lc) { + linphone_core_stop_ringing((LinphoneCore*)lc); +} + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setChatDatabasePath(JNIEnv* env, jobject thiz, jlong lc, jstring jpath) { const char* path = env->GetStringUTFChars(jpath, NULL); linphone_core_set_chat_database_path((LinphoneCore*)lc, path); diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 72164a3fe..3d22e10ba 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -1585,4 +1585,9 @@ public interface LinphoneCore { **/ public boolean chatEnabled(); + /** + * Whenever the liblinphone is playing a ring to advertise an incoming call or ringback of an outgoing call, this function stops the ringing. + * Typical use is to stop ringing when the user requests to ignore the call. + **/ + public void stopRinging(); } diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index 16ca38e36..7a28a0867 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -149,6 +149,7 @@ class LinphoneCoreImpl implements LinphoneCore { private native void setCallErrorTone(long nativePtr, int reason, String path); private native void enableSdp200Ack(long nativePtr,boolean enable); private native boolean isSdp200AckEnabled(long nativePtr); + private native void stopRinging(long nativePtr); LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig, File factoryConfig, Object userdata) throws IOException { mListener = listener; @@ -1181,4 +1182,9 @@ class LinphoneCoreImpl implements LinphoneCore { return chatEnabled(nativePtr); } + @Override + public void stopRinging() { + stopRinging(nativePtr); + } + }