diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index ee4744faa..d04f21b40 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1987,6 +1987,22 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setRingback(JNIEnv* env } +extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setProvisioningUri(JNIEnv* env + ,jobject thiz + ,jlong lc + ,jstring jpath) { + const char* path = jpath?env->GetStringUTFChars(jpath, NULL):NULL; + linphone_core_set_provisioning_uri((LinphoneCore*)lc,path); + if (path) env->ReleaseStringUTFChars(jpath, path); +} + +extern "C" jstring Java_org_linphone_core_LinphoneCoreImpl_getProvisioningUri(JNIEnv* env + ,jobject thiz + ,jlong lc) { + const char* path = linphone_core_get_provisioning_uri((LinphoneCore*)lc); + return path ? env->NewStringUTF(path) : NULL; +} + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_enableKeepAlive(JNIEnv* env ,jobject thiz ,jlong lc @@ -4005,6 +4021,10 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getSipDscp(JNIEnv* env,j return linphone_core_get_sip_dscp((LinphoneCore*)ptr); } +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getGlobalState(JNIEnv* env,jobject thiz,jlong ptr){ + return linphone_core_get_global_state((LinphoneCore*)ptr); +} + extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getSignalingTransportPort(JNIEnv* env,jobject thiz,jlong ptr, jint code) { LCSipTransports tr; linphone_core_get_sip_transports((LinphoneCore *) ptr, &tr); diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 8d4a8c1e2..ab11a78b1 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -567,6 +567,11 @@ public interface LinphoneCore { */ public void setContext(Object context); + /** + * Get the LinphoneCore's global state. + **/ + public GlobalState getGlobalState(); + /** * clear all added proxy configs */ @@ -2170,4 +2175,14 @@ public interface LinphoneCore { * @return The name of the video preset used for video calls (can be null if the default video preset is used). */ public String getVideoPreset(); + + /** + * Set a provisioning URI to fetch an xml linphonerc config file from, at next LinphoneCore instantiation. + **/ + public void setProvisioningUri(String uri); + + /** + * Get the provisioning URI previously set. + **/ + public String getProvisioningUri(); } diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index 2c159134a..43f1eec9c 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -1525,4 +1525,19 @@ class LinphoneCoreImpl implements LinphoneCore { long ptr = createCallParams(nativePtr, callptr); return new LinphoneCallParamsImpl(ptr); } + private native void setProvisioningUri(long nativePtr, String uri); + @Override + public void setProvisioningUri(String uri){ + setProvisioningUri(nativePtr, uri); + } + + private native String getProvisioningUri(long nativePtr); + @Override + public String getProvisioningUri(){ + return getProvisioningUri(nativePtr); + } + private native int getGlobalState(long nativePtr); + public GlobalState getGlobalState(){ + return GlobalState.fromInt(getGlobalState(nativePtr)); + } }