diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index b562cf31a..3e895a6ce 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -2747,6 +2747,12 @@ extern "C" jlong Java_org_linphone_core_LinphoneCallImpl_getPlayer(JNIEnv *env, return (jlong)linphone_call_get_player((LinphoneCall *)callPtr); } +extern "C" jboolean Java_org_linphone_core_LinphoneCallImpl_mediaInProgress( JNIEnv* env + ,jobject thiz + ,jlong ptr) { + return (jboolean) linphone_call_media_in_progress((LinphoneCall*)ptr); +} + //LinphoneFriend extern "C" jlong Java_org_linphone_core_LinphoneFriendImpl_newLinphoneFriend(JNIEnv* env ,jobject thiz diff --git a/java/common/org/linphone/core/LinphoneCall.java b/java/common/org/linphone/core/LinphoneCall.java index 404fdbcf0..cd74b6d07 100644 --- a/java/common/org/linphone/core/LinphoneCall.java +++ b/java/common/org/linphone/core/LinphoneCall.java @@ -268,6 +268,16 @@ public interface LinphoneCall { void setAuthenticationTokenVerified(boolean verified); boolean isInConference(); + + /** + * Indicates whether an operation is in progress at the media side. + * It can a bad idea to initiate signaling operations (adding video, pausing the call, removing video, changing video parameters) while + * the media is busy in establishing the connection (typically ICE connectivity checks). It can result in failures generating loss of time + * in future operations in the call. + * Applications are invited to check this function after each call state change to decide whether certain operations are permitted or not. + * @return TRUE if media is busy in establishing the connection, FALSE otherwise. + **/ + boolean mediaInProgress(); float getPlayVolume(); @@ -349,4 +359,5 @@ public interface LinphoneCall { * @return A player */ public LinphonePlayer getPlayer(); + } diff --git a/java/impl/org/linphone/core/LinphoneCallImpl.java b/java/impl/org/linphone/core/LinphoneCallImpl.java index b2cad202c..de9e25364 100644 --- a/java/impl/org/linphone/core/LinphoneCallImpl.java +++ b/java/impl/org/linphone/core/LinphoneCallImpl.java @@ -43,6 +43,7 @@ class LinphoneCallImpl implements LinphoneCall { private native int getDuration(long nativePtr); private native float getCurrentQuality(long nativePtr); private native float getAverageQuality(long nativePtr); + private native boolean mediaInProgress(long nativePtr); /* * This method must always be called from JNI, nothing else. @@ -167,6 +168,8 @@ class LinphoneCallImpl implements LinphoneCall { return params.localConferenceMode(); } + public boolean mediaInProgress() { return mediaInProgress(nativePtr);} + @Override public String toString() { return "Call " + nativePtr; @@ -251,4 +254,5 @@ class LinphoneCallImpl implements LinphoneCall { public LinphonePlayer getPlayer() { return new LinphonePlayerImpl(getPlayer(nativePtr)); } + }