From af93de9a95171530c93e22919e88f0db0d785919 Mon Sep 17 00:00:00 2001 From: Erwan Croze Date: Mon, 5 Jun 2017 17:32:47 +0200 Subject: [PATCH] Add get_incoming_timeout to JNI --- coreapi/linphonecore_jni.cc | 4 ++++ java/common/org/linphone/core/LinphoneCore.java | 6 ++++++ java/impl/org/linphone/core/LinphoneCoreImpl.java | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index ecf2a48a9..c7b9d7c8b 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -5911,6 +5911,10 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setIncomingTimeout(JNIEn linphone_core_set_inc_timeout((LinphoneCore *)lc, timeout); } +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getIncomingTimeout(JNIEnv *env, jobject thiz, jlong lc) { + return linphone_core_get_inc_timeout((LinphoneCore *)lc); +} + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setInCallTimeout(JNIEnv *env, jobject thiz, jlong lc, jint timeout) { linphone_core_set_in_call_timeout((LinphoneCore *)lc, timeout); } diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 43da962cc..fc94cdb42 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -1920,6 +1920,12 @@ public interface LinphoneCore { **/ void setIncomingTimeout(int timeout); + /** + * Return the incoming call timeout in seconds. + * @return the incoming call timeout in seconds. + **/ + int getIncomingTimeout(); + /** * Set the call timeout in seconds. * Once this time is elapsed (ringing included), the call is automatically hung up. diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index f1e2f6da6..48bab01d0 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -194,6 +194,7 @@ class LinphoneCoreImpl implements LinphoneCore { private native void setDefaultSoundDevices(long nativePtr); private native Object createFriend(long nativePtr); private native Object createFriendWithAddress(long nativePtr, String address); + private native int getIncomingTimeout(long nativePtr); LinphoneCoreImpl(LinphoneCoreListener listener, File userConfig, File factoryConfig, Object userdata) throws IOException { mListener = listener; @@ -1102,6 +1103,10 @@ class LinphoneCoreImpl implements LinphoneCore { setIncomingTimeout(nativePtr, timeout); } + public synchronized int getIncomingTimeout() { + return getIncomingTimeout(nativePtr); + } + public synchronized void setInCallTimeout(int timeout) { setInCallTimeout(nativePtr, timeout);