From 01d35e5b53fca8358e2b9b8dc67d47b4cca4327f Mon Sep 17 00:00:00 2001 From: Simon Morlat Date: Wed, 14 Aug 2013 16:08:26 +0200 Subject: [PATCH] wrap new methods --- coreapi/linphonecore_jni.cc | 26 +++++++++++++++++++ .../org/linphone/core/LinphoneCall.java | 12 +++++++++ .../org/linphone/core/LinphoneCallImpl.java | 10 +++++++ 3 files changed, 48 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 677b45b8a..91a5ec19d 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1911,6 +1911,32 @@ JNIEXPORT jint JNICALL Java_org_linphone_core_LinphoneCallImpl_getTransferState( return linphone_call_get_transfer_state(call); } +/* + * Class: org_linphone_core_LinphoneCallImpl + * Method: getTransfererCall + * Signature: (J)Ljava/lang/Object; + */ +JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCallImpl_getTransfererCall(JNIEnv *env, jobject jCall, jlong callptr){ + LinphoneCall *call=(LinphoneCall*)callptr; + LinphoneCore *lc=linphone_call_get_core(call); + LinphoneCoreData *lcdata=(LinphoneCoreData*)linphone_core_get_user_data(lc); + LinphoneCall *ret=linphone_call_get_transferer_call(call); + return lcdata->getCall(env,ret); +} + +/* + * Class: org_linphone_core_LinphoneCallImpl + * Method: getTransferTargetCall + * Signature: (J)Ljava/lang/Object; + */ +JNIEXPORT jobject JNICALL Java_org_linphone_core_LinphoneCallImpl_getTransferTargetCall(JNIEnv *env, jobject jCall, jlong callptr){ + LinphoneCall *call=(LinphoneCall*)callptr; + LinphoneCore *lc=linphone_call_get_core(call); + LinphoneCoreData *lcdata=(LinphoneCoreData*)linphone_core_get_user_data(lc); + LinphoneCall *ret=linphone_call_get_transfer_target_call(call); + return lcdata->getCall(env,ret); +} + extern "C" void Java_org_linphone_core_LinphoneCallImpl_enableEchoCancellation( JNIEnv* env ,jobject thiz ,jlong ptr diff --git a/java/common/org/linphone/core/LinphoneCall.java b/java/common/org/linphone/core/LinphoneCall.java index 35dc9008b..62be0d638 100644 --- a/java/common/org/linphone/core/LinphoneCall.java +++ b/java/common/org/linphone/core/LinphoneCall.java @@ -303,4 +303,16 @@ public interface LinphoneCall { * Send an info message to remote peer. */ void sendInfoMessage(LinphoneInfoMessage msg); + + /** + * Returns the transferer if this call was started automatically as a result of an incoming transfer request. + * The call in which the transfer request was received is returned in this case. + **/ + LinphoneCall getTransfererCall(); + + /** + * When this call has received a transfer request, returns the new call that was automatically created as a result of the transfer. + **/ + LinphoneCall getTransferTargetCall(); + } diff --git a/java/impl/org/linphone/core/LinphoneCallImpl.java b/java/impl/org/linphone/core/LinphoneCallImpl.java index 5c681506f..e55ac22b0 100644 --- a/java/impl/org/linphone/core/LinphoneCallImpl.java +++ b/java/impl/org/linphone/core/LinphoneCallImpl.java @@ -217,4 +217,14 @@ class LinphoneCallImpl implements LinphoneCall { public void sendInfoMessage(LinphoneInfoMessage msg) { sendInfoMessage(nativePtr,((LinphoneInfoMessageImpl)msg).nativePtr); } + private native Object getTransfererCall(long callPtr); + @Override + public LinphoneCall getTransfererCall() { + return (LinphoneCall)getTransfererCall(nativePtr); + } + private native Object getTransferTargetCall(long callPtr); + @Override + public LinphoneCall getTransferTargetCall() { + return (LinphoneCall)getTransferTargetCall(nativePtr); + } }