From cc211d4813f09a75f9fe27484e55031d39c2aee2 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Wed, 13 Jun 2012 14:15:48 +0200 Subject: [PATCH] Exported JNI method to get call duration from log --- coreapi/linphonecore_jni.cc | 5 +++++ java/common/org/linphone/core/LinphoneCallLog.java | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index 35ee7f26..d45f6009 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1152,6 +1152,11 @@ extern "C" jstring Java_org_linphone_core_LinphoneCallLogImpl_getStartDate(JNIEn jstring jvalue =env->NewStringUTF(((LinphoneCallLog*)ptr)->start_date); return jvalue; } +extern "C" jint Java_org_linphone_core_LinphoneCallLogImpl_getCallDuration(JNIEnv* env + ,jobject thiz + ,jlong ptr) { + return ((LinphoneCallLog*)ptr)->duration; +} /*payloadType*/ extern "C" jstring Java_org_linphone_core_PayloadTypeImpl_toString(JNIEnv* env,jobject thiz,jlong ptr) { diff --git a/java/common/org/linphone/core/LinphoneCallLog.java b/java/common/org/linphone/core/LinphoneCallLog.java index fa1bc2ae..98bf40c5 100644 --- a/java/common/org/linphone/core/LinphoneCallLog.java +++ b/java/common/org/linphone/core/LinphoneCallLog.java @@ -101,4 +101,9 @@ public interface LinphoneCallLog { * @return a human readble String with the start date/time of the call */ public String getStartDate(); + + /** + * @return the call duration, in seconds + */ + public int getCallDuration(); } -- 2.39.2