Added linphonecore stop ringing JNI wrapper

This commit is contained in:
Sylvain Berfini 2014-04-07 11:57:59 +02:00
parent 9b4197fef9
commit 5e01d28d2b
3 changed files with 15 additions and 0 deletions

View file

@ -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);

View file

@ -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();
}

View file

@ -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);
}
}