From fda6a31d1f84c1308fe6f6aa106b567036879c3b Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Fri, 13 Dec 2013 17:56:03 +0100 Subject: [PATCH] add jni for LinphoneCore.startReferedCall() --- coreapi/linphonecore_jni.cc | 5 +++++ coreapi/private.h | 1 - java/common/org/linphone/core/LinphoneCore.java | 10 ++++++++++ java/impl/org/linphone/core/LinphoneCoreImpl.java | 7 +++++++ 4 files changed, 22 insertions(+), 1 deletion(-) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 9773da678..4dc3b6d04 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -2882,6 +2882,11 @@ extern "C" jint Java_org_linphone_core_LinphoneCoreImpl_transferCallToAnother(JN return (jint)linphone_core_transfer_call_to_another((LinphoneCore *) pCore, (LinphoneCall *) pCall, (LinphoneCall *) pDestCall); } +extern "C" jobject Java_org_linphone_core_LinphoneCoreImpl_startReferedCall(JNIEnv *env, jobject thiz, jlong lc, jlong callptr, jlong params){ + LinphoneCoreData *lcd=(LinphoneCoreData*)linphone_core_get_user_data((LinphoneCore*)lc); + return lcd->getCall(env,linphone_core_start_refered_call((LinphoneCore *)lc, (LinphoneCall *)callptr, (const LinphoneCallParams *)params)); +} + extern "C" void Java_org_linphone_core_LinphoneCoreImpl_setZrtpSecretsCache(JNIEnv *env,jobject thiz,jlong pCore, jstring jFile) { if (jFile) { const char* cFile=env->GetStringUTFChars(jFile, NULL); diff --git a/coreapi/private.h b/coreapi/private.h index 76181edc2..3f198579c 100644 --- a/coreapi/private.h +++ b/coreapi/private.h @@ -367,7 +367,6 @@ int linphone_core_start_invite(LinphoneCore *lc, LinphoneCall *call); int linphone_core_restart_invite(LinphoneCore *lc, LinphoneCall *call); int linphone_core_start_update_call(LinphoneCore *lc, LinphoneCall *call); int linphone_core_start_accept_call_update(LinphoneCore *lc, LinphoneCall *call); -void linphone_core_start_refered_call(LinphoneCore *lc, LinphoneCall *call, const LinphoneCallParams *params); void linphone_core_notify_incoming_call(LinphoneCore *lc, LinphoneCall *call); bool_t linphone_core_incompatible_security(LinphoneCore *lc, SalMediaDescription *md); extern SalCallbacks linphone_sal_callbacks; diff --git a/java/common/org/linphone/core/LinphoneCore.java b/java/common/org/linphone/core/LinphoneCore.java index ef310bc9a..0cedc40f8 100644 --- a/java/common/org/linphone/core/LinphoneCore.java +++ b/java/common/org/linphone/core/LinphoneCore.java @@ -1088,6 +1088,16 @@ public interface LinphoneCore { * @param dest a running call whose remote person will receive the transfer **/ void transferCallToAnother(LinphoneCall callToTransfer, LinphoneCall destination); + + /** + * Start a new call as a consequence of a transfer request received from a call. + * This function is for advanced usage: the execution of transfers is automatically managed by the LinphoneCore. However if an application + * wants to have control over the call parameters for the new call, it should call this function immediately during the LinphoneCallRefered notification. + * @param call a call that has just been notified about LinphoneCallRefered state event. + * @param params the call parameters to be applied to the new call. + * @return a LinphoneCall corresponding to the new call that is attempted to the transfer destination. + **/ + LinphoneCall startReferedCall(LinphoneCall call, LinphoneCallParams params); /** * Search from the list of current calls if a remote address match uri * @param uri which should match call remote uri diff --git a/java/impl/org/linphone/core/LinphoneCoreImpl.java b/java/impl/org/linphone/core/LinphoneCoreImpl.java index 420547e57..f9a61acf8 100644 --- a/java/impl/org/linphone/core/LinphoneCoreImpl.java +++ b/java/impl/org/linphone/core/LinphoneCoreImpl.java @@ -1081,4 +1081,11 @@ class LinphoneCoreImpl implements LinphoneCore { return new LinphoneAuthInfoImpl(ptr); } + private native LinphoneCall startReferedCall(long corePtr, long callptr, long paramsPtr); + @Override + public LinphoneCall startReferedCall(LinphoneCall call, + LinphoneCallParams params) { + long ptrParams =((LinphoneCallParamsImpl)params).nativePtr; + return startReferedCall(nativePtr, getCallPtr(call), ptrParams); + } }