]> sjero.net Git - linphone/commitdiff
Created and exported some methods to manage call logs from Java
authorSylvain Berfini <Sylvain.Berfini@Belledonne-Communications.com>
Wed, 13 Jun 2012 08:15:16 +0000 (10:15 +0200)
committerSylvain Berfini <Sylvain.Berfini@Belledonne-Communications.com>
Wed, 13 Jun 2012 08:15:16 +0000 (10:15 +0200)
coreapi/linphonecore.c
coreapi/linphonecore.h
coreapi/linphonecore_jni.cc
java/common/org/linphone/core/LinphoneCallLog.java
java/common/org/linphone/core/LinphoneCore.java

index c0531ae9a52a5600ab334dc6a7e25403cd974309..ada24237d8e417b4d311096c957ab6319970cec7 100644 (file)
@@ -3485,6 +3485,14 @@ void linphone_core_clear_call_logs(LinphoneCore *lc){
        call_logs_write_to_config_file(lc);
 }
 
+int linphone_core_get_missed_calls_count(LinphoneCore *lc) {
+       return lc->missed_calls;
+}
+
+void linphone_core_remove_call_log(LinphoneCore *lc, void *data) {
+       lc->call_logs = ms_list_remove(lc->call_logs, data);
+}
+
 static void toggle_video_preview(LinphoneCore *lc, bool_t val){
 #ifdef VIDEO_ENABLED
        if (val){
index 59dbca0cba3d09c7f960cc91fac6577216f919a9..a59353a21b9b7bcae572130a6edfa835560eb896 100644 (file)
@@ -969,6 +969,8 @@ void linphone_core_set_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, bool_t val);
 /* returns a list of LinphoneCallLog */
 const MSList * linphone_core_get_call_logs(LinphoneCore *lc);
 void linphone_core_clear_call_logs(LinphoneCore *lc);
+int linphone_core_get_missed_calls_count(LinphoneCore *lc);
+void linphone_core_remove_call_log(LinphoneCore *lc, void *data);
 
 /* video support */
 bool_t linphone_core_video_supported(LinphoneCore *lc);
index 52f5d24ad5ee09cdc5d96f6d97e1a891c82c3de4..f3ba286857a47a220c7519924c26c511535d904d 100644 (file)
@@ -642,6 +642,18 @@ extern "C" void Java_org_linphone_core_LinphoneCoreImpl_stopDtmf(  JNIEnv*  env
        linphone_core_stop_dtmf((LinphoneCore*)lc);
 }
 
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_getMissedCallsCount(JNIEnv*  env
+                                                                                                                                               ,jobject  thiz
+                                                                                                                                               ,jlong lc) {
+       linphone_core_get_missed_calls_count((LinphoneCore*)lc);
+}
+
+extern "C" void Java_org_linphone_core_LinphoneCoreImpl_removeCallLog(JNIEnv*  env
+                                                                                                                                               ,jobject  thiz
+                                                                                                                                               ,jlong lc, jlong log) {
+       linphone_core_remove_call_log((LinphoneCore*)lc, (void*) log);
+}
+
 extern "C" void Java_org_linphone_core_LinphoneCoreImpl_clearCallLogs(JNIEnv*  env
                                                                                                                                                ,jobject  thiz
                                                                                                                                                ,jlong lc) {
index 015f071dfbd9a38b477274cab3f6a6aa1ff33a34..c56f324d131e47423c49f0a6bd15794a709c8180 100644 (file)
@@ -94,4 +94,6 @@ public interface LinphoneCallLog {
         * @return
         */
        public CallStatus getStatus();
+       
+       public long getNativePtr();
 }
index 0d8e14ae9aa2af4ffb4e5cc6729237140ff27640..b6830863c487bf83e1ff93531b860b839ffe2e65 100644 (file)
@@ -20,6 +20,7 @@ package org.linphone.core;
 
 import java.util.Vector;
 
+import org.linphone.core.LinphoneCallLog;
 import org.linphone.core.LinphoneCallParams;
 
 /**
@@ -759,4 +760,14 @@ public interface LinphoneCore {
        void setUserAgent(String name, String version);
        
        void setCpuCount(int count);
+       
+       /**
+        * remove a call log
+        */
+       public void removeCallLog(LinphoneCallLog log);
+       
+       /**
+        * @return count of missed calls
+        */
+       public int getMissedCallsCount();
 }