From f8cfb5e8bc4dae1b8e7fb00de346ae963644669a Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Sun, 21 Nov 2021 21:06:55 +0200 Subject: [PATCH] Execute ua_hangup and ua_mute in re thread --- app/src/main/cpp/baresip.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/src/main/cpp/baresip.c b/app/src/main/cpp/baresip.c index 7956e28a..4cbb79ca 100644 --- a/app/src/main/cpp/baresip.c +++ b/app/src/main/cpp/baresip.c @@ -1183,10 +1183,12 @@ Java_com_tutpro_baresip_Api_ua_1hangup(JNIEnv *env, jobject thiz, const uint16_t native_code = code; const char *native_reason = (*env)->GetStringUTFChars(env, reason, 0); LOGD("hanging up call %s/%s\n", native_ua, native_call); + re_thread_enter(); if (strlen(native_reason) == 0) ua_hangup(ua, call, native_code, NULL); else ua_hangup(ua, call, native_code, native_reason); + re_thread_leave(); (*env)->ReleaseStringUTFChars(env, javaUA, native_ua); (*env)->ReleaseStringUTFChars(env, javaCall, native_call); (*env)->ReleaseStringUTFChars(env, reason, native_reason); @@ -1383,7 +1385,9 @@ Java_com_tutpro_baresip_Call_call_1mute(JNIEnv *env, jobject thiz, jstring jCall const char *native_call = (*env)->GetStringUTFChars(env, jCall, 0); struct call *call = (struct call *) strtoul(native_call, NULL, 10); (*env)->ReleaseStringUTFChars(env, jCall, native_call); + re_thread_enter(); audio_mute(call_audio(call), mute); + re_thread_leave(); } JNIEXPORT jint JNICALL