From 0b9b574db7fc4fe06b028a6d79ffdb902826dc04 Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 22 Feb 2013 21:28:31 +0100 Subject: [PATCH] add conference recording API. --- coreapi/linphonecore_jni.cc | 18 ++++++++ .../org/linphone/core/LinphoneCore.java | 42 ++++++++++++++++++- .../org/linphone/core/LinphoneCoreImpl.java | 11 +++++ 3 files changed, 69 insertions(+), 2 deletions(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 9c8697f6..57ab7c4c 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -2060,9 +2060,11 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_leaveConference(JNIEnv * extern "C" void Java_org_linphone_core_LinphoneCoreImpl_addAllToConference(JNIEnv *env,jobject thiz,jlong pCore) { linphone_core_add_all_to_conference((LinphoneCore *) pCore); } + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_addToConference(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall) { linphone_core_add_to_conference((LinphoneCore *) pCore, (LinphoneCall *) pCall); } + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_removeFromConference(JNIEnv *env,jobject thiz,jlong pCore, jlong pCall) { linphone_core_remove_from_conference((LinphoneCore *) pCore, (LinphoneCall *) pCall); } @@ -2073,6 +2075,22 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_terminateConference(JNIE extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_getConferenceSize(JNIEnv *env,jobject thiz,jlong pCore) { return (jint)linphone_core_get_conference_size((LinphoneCore *) pCore); } + +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_startConferenceRecording(JNIEnv *env,jobject thiz,jlong pCore, jstring jpath){ + int err=-1; + if (jpath){ + const char *path=env->GetStringUTFChars(jpath, NULL); + err=linphone_core_start_conference_recording((LinphoneCore*)pCore,path); + env->ReleaseStringUTFChars(jpath,path); + } + return err; +} + +extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_stopConferenceRecording(JNIEnv *env,jobject thiz,jlong pCore){ + int err=linphone_core_stop_conference_recording((LinphoneCore*)pCore); + return err; +} + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_terminateAllCalls(JNIEnv *env,jobject thiz,jlong pCore) { linphone_core_terminate_all_calls((LinphoneCore *) pCore); } diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index 3a6cf2a7..87b5de09 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -761,25 +761,63 @@ public interface LinphoneCore { */ void adjustSoftwareVolume(int i); + /** + * Pause a call. + **/ boolean pauseCall(LinphoneCall call); + /** + * Resume a call. + **/ boolean resumeCall(LinphoneCall call); boolean pauseAllCalls(); void setZrtpSecretsCache(String file); void enableEchoLimiter(boolean val); + /** + * Indicates whether the local user is part of the conference. + **/ boolean isInConference(); + /** + * Connect the local user to the conference. + **/ boolean enterConference(); + /** + * Disconnect the local user from the conference. + **/ void leaveConference(); + /** + * Add an established call to the conference. The LinphoneCore is able to manage one client based conference. + **/ void addToConference(LinphoneCall call); - void addAllToConference(); + /** + * Remove an established call from the conference. + **/ void removeFromConference(LinphoneCall call); - + void addAllToConference(); + + /** + * Terminate the conference, all users are disconnected. + **/ void terminateConference(); int getConferenceSize(); + + /** + * Request recording of the conference into a supplied file path. + * The format is wav. + **/ + void startConferenceRecording(String path); + /** + * Stop recording of the conference. + **/ + void stopConferenceRecording(); + void terminateAllCalls(); + /** + * Returns all calls. + **/ LinphoneCall[] getCalls(); int getCallsNb(); diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index 7b596f7e..5a52f755 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -897,4 +897,15 @@ class LinphoneCoreImpl implements LinphoneCore { public String getUpnpExternalIpaddress() { return getUpnpExternalIpaddress(nativePtr); } + private native int startConferenceRecording(long nativePtr, String path); + @Override + public void startConferenceRecording(String path) { + startConferenceRecording(nativePtr,path); + } + + private native int stopConferenceRecording(long nativePtr); + @Override + public void stopConferenceRecording() { + stopConferenceRecording(nativePtr); + } } -- 2.39.2