From 58c708a10badf27965c00232de99904415f0b1a8 Mon Sep 17 00:00:00 2001 From: Sylvain Berfini Date: Tue, 11 Dec 2012 17:00:04 +0100 Subject: [PATCH] Add JNI glue to get timestamp for logs --- coreapi/linphonecore_jni.cc | 5 +++++ java/common/org/linphone/core/LinphoneCallLog.java | 5 +++++ java/impl/org/linphone/core/LinphoneCallLogImpl.java | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/coreapi/linphonecore_jni.cc b/coreapi/linphonecore_jni.cc index d5835fe3..63d94411 100644 --- a/coreapi/linphonecore_jni.cc +++ b/coreapi/linphonecore_jni.cc @@ -1294,6 +1294,11 @@ extern "C" jstring Java_org_linphone_core_LinphoneCallLogImpl_getStartDate(JNIEn jstring jvalue =env->NewStringUTF(((LinphoneCallLog*)ptr)->start_date); return jvalue; } +extern "C" jlong Java_org_linphone_core_LinphoneCallLogImpl_getTimestamp(JNIEnv* env + ,jobject thiz + ,jlong ptr) { + return static_cast (((LinphoneCallLog*)ptr)->start_date_time); +} extern "C" jint Java_org_linphone_core_LinphoneCallLogImpl_getCallDuration(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 821be24d..2e839234 100644 --- a/java/common/org/linphone/core/LinphoneCallLog.java +++ b/java/common/org/linphone/core/LinphoneCallLog.java @@ -100,6 +100,11 @@ public interface LinphoneCallLog { */ public String getStartDate(); + /** + * @return a timestamp of the start date/time of the call in milliseconds since January 1st 1970 + */ + public long getTimestamp(); + /** * @return the call duration, in seconds */ diff --git a/java/impl/org/linphone/core/LinphoneCallLogImpl.java b/java/impl/org/linphone/core/LinphoneCallLogImpl.java index 05468626..7582dbd4 100644 --- a/java/impl/org/linphone/core/LinphoneCallLogImpl.java +++ b/java/impl/org/linphone/core/LinphoneCallLogImpl.java @@ -30,6 +30,7 @@ class LinphoneCallLogImpl implements LinphoneCallLog { private native String getStartDate(long nativePtr); private native int getCallDuration(long nativePtr); private native int getCallId(long nativePtr); + private native long getTimestamp(long nativePtr); LinphoneCallLogImpl(long aNativePtr) { nativePtr = aNativePtr; @@ -64,4 +65,8 @@ class LinphoneCallLogImpl implements LinphoneCallLog { public int getCallId() { return getCallId(nativePtr); } + + public long getTimestamp() { + return getTimestamp(nativePtr); + } } -- 2.39.2