No need for contact related API functions
This commit is contained in:
@@ -1575,28 +1575,6 @@ Java_com_tutpro_baresip_Api_video_1codecs(JNIEnv *env, jobject thiz)
|
|||||||
return (*env)->NewStringUTF(env, codec_buf);
|
return (*env)->NewStringUTF(env, codec_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT void JNICALL
|
|
||||||
Java_com_tutpro_baresip_Api_contact_1add(JNIEnv *env, jobject thiz, jstring javaContact) {
|
|
||||||
struct pl pl_addr;
|
|
||||||
const char *native_contact = (*env)->GetStringUTFChars(env, javaContact, 0);
|
|
||||||
pl_set_str(&pl_addr, native_contact);
|
|
||||||
if (contact_add(baresip_contacts(), NULL, &pl_addr) != 0) {
|
|
||||||
LOGE("failed to add contact %s\n", native_contact);
|
|
||||||
} else {
|
|
||||||
LOGD("added contact %s\n", native_contact);
|
|
||||||
}
|
|
||||||
(*env)->ReleaseStringUTFChars(env, javaContact, native_contact);
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL
|
|
||||||
Java_com_tutpro_baresip_Api_contacts_1remove(JNIEnv *env, jobject thiz) {
|
|
||||||
struct le *le;
|
|
||||||
while ((le = list_head(contact_list(baresip_contacts())))) {
|
|
||||||
struct contact *c = le->data;
|
|
||||||
contact_remove(baresip_contacts(), c);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT void JNICALL
|
JNIEXPORT void JNICALL
|
||||||
Java_com_tutpro_baresip_Api_log_1level_1set(JNIEnv *env, jobject thiz, jint level) {
|
Java_com_tutpro_baresip_Api_log_1level_1set(JNIEnv *env, jobject thiz, jint level) {
|
||||||
const enum log_level native_level = (enum log_level)level;
|
const enum log_level native_level = (enum log_level)level;
|
||||||
|
|||||||
@@ -68,9 +68,6 @@ object Api {
|
|||||||
|
|
||||||
external fun message_send(uap: String, peer_uri: String, message: String, time: String): Int
|
external fun message_send(uap: String, peer_uri: String, message: String, time: String): Int
|
||||||
|
|
||||||
external fun contact_add(contact: String)
|
|
||||||
external fun contacts_remove()
|
|
||||||
|
|
||||||
external fun audio_codecs(): String
|
external fun audio_codecs(): String
|
||||||
external fun video_codecs(): String
|
external fun video_codecs(): String
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ class Contact(var name: String, var uri: String, var color: Int, val id: Long) {
|
|||||||
val content = Utils.getFileContents(BaresipService.filesPath + "/contacts")
|
val content = Utils.getFileContents(BaresipService.filesPath + "/contacts")
|
||||||
?: return false
|
?: return false
|
||||||
val contacts = String(content)
|
val contacts = String(content)
|
||||||
Api.contacts_remove()
|
|
||||||
BaresipService.contacts.clear()
|
BaresipService.contacts.clear()
|
||||||
var contactNo = 0
|
var contactNo = 0
|
||||||
val baseId = System.currentTimeMillis()
|
val baseId = System.currentTimeMillis()
|
||||||
|
|||||||
Reference in New Issue
Block a user