Created and exported some methods to manage call logs from Java

This commit is contained in:
Sylvain Berfini 2012-06-13 10:15:16 +02:00
parent 3a4c17df8f
commit 160dc76b0e
5 changed files with 35 additions and 0 deletions

View 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){

View 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);

View 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) {

View file

@ -94,4 +94,6 @@ public interface LinphoneCallLog {
* @return
*/
public CallStatus getStatus();
public long getNativePtr();
}

View 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();
}