- Used new ua_destroy API call to destroy User Agent when account is
deleted - Fixed return type of set_outbound API call
This commit is contained in:
@@ -609,7 +609,7 @@ Java_com_tutpro_baresip_AccountKt_account_1outbound(JNIEnv *env, jobject thiz, j
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT int JNICALL
|
JNIEXPORT jint JNICALL
|
||||||
Java_com_tutpro_baresip_AccountKt_account_1set_1outbound(JNIEnv *env, jobject thiz, jstring javaAcc,
|
Java_com_tutpro_baresip_AccountKt_account_1set_1outbound(JNIEnv *env, jobject thiz, jstring javaAcc,
|
||||||
jstring javaOb, jint javaIx) {
|
jstring javaOb, jint javaIx) {
|
||||||
const char *native_acc = (*env)->GetStringUTFChars(env, javaAcc, 0);
|
const char *native_acc = (*env)->GetStringUTFChars(env, javaAcc, 0);
|
||||||
@@ -933,7 +933,7 @@ Java_com_tutpro_baresip_Api_ua_1isregistered(JNIEnv *env, jobject thiz, jstring
|
|||||||
const char *native_ua = (*env)->GetStringUTFChars(env, javaUA, 0);
|
const char *native_ua = (*env)->GetStringUTFChars(env, javaUA, 0);
|
||||||
struct ua *ua = (struct ua *)strtoul(native_ua, NULL, 10);
|
struct ua *ua = (struct ua *)strtoul(native_ua, NULL, 10);
|
||||||
(*env)->ReleaseStringUTFChars(env, javaUA, native_ua);
|
(*env)->ReleaseStringUTFChars(env, javaUA, native_ua);
|
||||||
return ua_isregistered(ua);
|
return ua_isregistered(ua)?true:false;
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jint JNICALL
|
JNIEXPORT jint JNICALL
|
||||||
@@ -952,7 +952,7 @@ Java_com_tutpro_baresip_Api_ua_1destroy(JNIEnv *env, jobject thiz, jstring javaU
|
|||||||
struct ua *ua = (struct ua *)strtoul(native_ua, NULL, 10);
|
struct ua *ua = (struct ua *)strtoul(native_ua, NULL, 10);
|
||||||
LOGD("destroying ua %s\n", native_ua);
|
LOGD("destroying ua %s\n", native_ua);
|
||||||
(*env)->ReleaseStringUTFChars(env, javaUA, native_ua);
|
(*env)->ReleaseStringUTFChars(env, javaUA, native_ua);
|
||||||
mem_deref(ua);
|
ua_destroy(ua);
|
||||||
}
|
}
|
||||||
|
|
||||||
JNIEXPORT jstring JNICALL
|
JNIEXPORT jstring JNICALL
|
||||||
|
|||||||
@@ -40,9 +40,7 @@ class AccountListAdapter(private val cxt: Context, private val rows: ArrayList<A
|
|||||||
val deleteDialog = AlertDialog.Builder(cxt)
|
val deleteDialog = AlertDialog.Builder(cxt)
|
||||||
deleteDialog.setMessage("Do you want to delete account ${ua.account.aor}?")
|
deleteDialog.setMessage("Do you want to delete account ${ua.account.aor}?")
|
||||||
deleteDialog.setPositiveButton("Delete") { dialog, _ ->
|
deleteDialog.setPositiveButton("Delete") { dialog, _ ->
|
||||||
if (Api.ua_isregistered(ua.uap))
|
Api.ua_destroy(ua.uap)
|
||||||
Api.ua_unregister(ua.uap)
|
|
||||||
// Api.ua_destroy(ua.uap)
|
|
||||||
UserAgent.remove(ua)
|
UserAgent.remove(ua)
|
||||||
AccountsActivity.generateAccounts()
|
AccountsActivity.generateAccounts()
|
||||||
AccountsActivity.saveAccounts()
|
AccountsActivity.saveAccounts()
|
||||||
|
|||||||
Reference in New Issue
Block a user