diff --git a/app/src/main/cpp/baresip.c b/app/src/main/cpp/baresip.c
index c04a55ee..3b17b5f4 100644
--- a/app/src/main/cpp/baresip.c
+++ b/app/src/main/cpp/baresip.c
@@ -1058,13 +1058,16 @@ Java_com_tutpro_baresip_Api_ua_1hangup(JNIEnv *env, jobject thiz, jlong ua, jlon
{
const uint16_t native_code = code;
const char *native_reason = (*env)->GetStringUTFChars(env, reason, 0);
+ const int thread_check = re_thread_check();
LOGD("hanging up call %ld/%ld\n", (long)ua, (long)call);
- // re_thread_enter();
+ if (thread_check != 0)
+ re_thread_enter();
if (strlen(native_reason) == 0)
ua_hangup((struct ua *)ua, (struct call *)call, native_code, NULL);
else
ua_hangup((struct ua *)ua, (struct call *)call, native_code, native_reason);
- // re_thread_leave();
+ if (thread_check != 0)
+ re_thread_leave();
(*env)->ReleaseStringUTFChars(env, reason, native_reason);
}
diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt
index 6f46af1a..cac1534d 100644
--- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt
+++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt
@@ -688,6 +688,9 @@ class BaresipService: Service() {
else if (!requestAudioFocus(applicationContext))
// request fails if there is an active telephony call
getString(R.string.audio_focus_denied)
+ else if (Call.inCall())
+ String.format(getString(R.string.call_auto_rejected),
+ Utils.friendlyUri(this, peerUri, ua.account))
else
""
if (toastMsg != "") {
diff --git a/app/src/main/res/values-fi/strings.xml b/app/src/main/res/values-fi/strings.xml
index f9a552ad..6bfe5005 100644
--- a/app/src/main/res/values-fi/strings.xml
+++ b/app/src/main/res/values-fi/strings.xml
@@ -247,6 +247,7 @@
%1$d vastaamatonta puhelua
Puhelun siirtopyyntö kohteeseen
Viesti lähettäjältä
+ Automaattisesti hylätty puhelu soittajalta \`%1$s\`
Kosketa käynnistääksesi sovelluksen
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 286a0199..b5ae1e9a 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -238,6 +238,7 @@
%1$d missed calls
Call transfer request to
Message from
+ Auto-rejected call from \`%1$s\`
Tap to start application