Improved call auto-rejection
This commit is contained in:
@@ -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 uint16_t native_code = code;
|
||||||
const char *native_reason = (*env)->GetStringUTFChars(env, reason, 0);
|
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);
|
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)
|
if (strlen(native_reason) == 0)
|
||||||
ua_hangup((struct ua *)ua, (struct call *)call, native_code, NULL);
|
ua_hangup((struct ua *)ua, (struct call *)call, native_code, NULL);
|
||||||
else
|
else
|
||||||
ua_hangup((struct ua *)ua, (struct call *)call, native_code, native_reason);
|
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);
|
(*env)->ReleaseStringUTFChars(env, reason, native_reason);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -688,6 +688,9 @@ class BaresipService: Service() {
|
|||||||
else if (!requestAudioFocus(applicationContext))
|
else if (!requestAudioFocus(applicationContext))
|
||||||
// request fails if there is an active telephony call
|
// request fails if there is an active telephony call
|
||||||
getString(R.string.audio_focus_denied)
|
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
|
else
|
||||||
""
|
""
|
||||||
if (toastMsg != "") {
|
if (toastMsg != "") {
|
||||||
|
|||||||
@@ -247,6 +247,7 @@
|
|||||||
<string name="missed_calls_count">%1$d vastaamatonta puhelua</string>
|
<string name="missed_calls_count">%1$d vastaamatonta puhelua</string>
|
||||||
<string name="transfer_request_to">Puhelun siirtopyyntö kohteeseen</string>
|
<string name="transfer_request_to">Puhelun siirtopyyntö kohteeseen</string>
|
||||||
<string name="message_from">Viesti lähettäjältä</string>
|
<string name="message_from">Viesti lähettäjältä</string>
|
||||||
|
<string name="call_auto_rejected">Automaattisesti hylätty puhelu soittajalta \`%1$s\`</string>
|
||||||
<!-- Boot Completed Receiver -->
|
<!-- Boot Completed Receiver -->
|
||||||
<string name="tap_to_start">Kosketa käynnistääksesi sovelluksen</string>
|
<string name="tap_to_start">Kosketa käynnistääksesi sovelluksen</string>
|
||||||
<!-- Calls Activity -->
|
<!-- Calls Activity -->
|
||||||
|
|||||||
@@ -238,6 +238,7 @@
|
|||||||
<string name="missed_calls_count">%1$d missed calls</string>
|
<string name="missed_calls_count">%1$d missed calls</string>
|
||||||
<string name="transfer_request_to">Call transfer request to</string>
|
<string name="transfer_request_to">Call transfer request to</string>
|
||||||
<string name="message_from">Message from</string>
|
<string name="message_from">Message from</string>
|
||||||
|
<string name="call_auto_rejected">Auto-rejected call from \`%1$s\`</string>
|
||||||
<!-- Boot Completed Receiver -->
|
<!-- Boot Completed Receiver -->
|
||||||
<string name="tap_to_start">Tap to start application</string>
|
<string name="tap_to_start">Tap to start application</string>
|
||||||
<!-- Calls Activity -->
|
<!-- Calls Activity -->
|
||||||
|
|||||||
Reference in New Issue
Block a user