diff --git a/app/src/main/kotlin/com/tutpro/baresip/AccountScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/AccountScreen.kt
index e3b9905d..b53c1a5f 100644
--- a/app/src/main/kotlin/com/tutpro/baresip/AccountScreen.kt
+++ b/app/src/main/kotlin/com/tutpro/baresip/AccountScreen.kt
@@ -1067,7 +1067,10 @@ private fun AccountContent(
@Composable
fun Voicemail() {
val voicemailUriTitle = stringResource(R.string.voicemail_uri)
- val voicemailUriHelp = stringResource(R.string.voicemain_uri_help)
+ val voicemailUriHelp = if (ua.account.isMobile)
+ stringResource(R.string.voicemain_tel_uri_help)
+ else
+ stringResource(R.string.voicemain_uri_help)
val vmUri by viewModel.vmUri.collectAsState()
Row(
Modifier.fillMaxWidth().padding(end = 10.dp),
diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt
index c17ca7de..5aee597f 100644
--- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt
+++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt
@@ -1758,7 +1758,7 @@ class BaresipService: Service() {
android.telecom.Call.STATE_RINGING -> "incoming"
android.telecom.Call.STATE_DIALING, android.telecom.Call.STATE_CONNECTING -> "outgoing"
android.telecom.Call.STATE_ACTIVE -> "connected"
- android.telecom.Call.STATE_DISCONNECTED -> "closed"
+ android.telecom.Call.STATE_DISCONNECTED, android.telecom.Call.STATE_DISCONNECTING -> "closed"
android.telecom.Call.STATE_HOLDING -> {
calls.find { it.callp == call.hashCode().toLong() }?.onhold = true
"connected"
diff --git a/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt b/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt
index 2a2188cf..6e320541 100644
--- a/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt
+++ b/app/src/main/kotlin/com/tutpro/baresip/MainScreen.kt
@@ -740,6 +740,9 @@ private fun BottomBar(ctx: Context, viewModel: ViewModel, navController: NavCont
val hasNewVoicemail = remember(aor, accountUpdate) {
if (aor.isNotEmpty()) (Account.ofAor(aor)?.vmNew ?: 0) > 0 else false
}
+ val isMobile = remember(aor, accountUpdate) {
+ if (aor.isNotEmpty()) Account.ofAor(aor)?.isMobile ?: false else false
+ }
val hasUnreadMessages = remember(aor, accountUpdate) {
if (aor.isNotEmpty()) Account.ofAor(aor)?.unreadMessages ?: false else false
}
@@ -768,19 +771,26 @@ private fun BottomBar(ctx: Context, viewModel: ViewModel, navController: NavCont
val ua = UserAgent.ofAor(aor)!!
val acc = ua.account
if (acc.vmUri.isNotEmpty()) {
- dialogTitle.value = ctx.getString(R.string.voicemail_messages)
- dialogMessage.value = acc.vmMessages(ctx)
- firstText.value = ctx.getString(R.string.cancel)
- onFirstClicked.value = {}
- secondText.value = ""
- lastText.value = ctx.getString(R.string.listen)
- onLastClicked.value = {
+ if (isMobile) {
val intent = Intent(ctx, MainActivity::class.java)
intent.putExtra("uap", ua.uap)
intent.putExtra("peer", acc.vmUri)
handleIntent(ctx, viewModel, intent, "call")
+ } else {
+ dialogTitle.value = ctx.getString(R.string.voicemail_messages)
+ dialogMessage.value = acc.vmMessages(ctx)
+ firstText.value = ctx.getString(R.string.cancel)
+ onFirstClicked.value = {}
+ secondText.value = ""
+ lastText.value = ctx.getString(R.string.listen)
+ onLastClicked.value = {
+ val intent = Intent(ctx, MainActivity::class.java)
+ intent.putExtra("uap", ua.uap)
+ intent.putExtra("peer", acc.vmUri)
+ handleIntent(ctx, viewModel, intent, "call")
+ }
+ showDialog.value = true
}
- showDialog.value = true
}
},
modifier = Modifier
@@ -809,22 +819,23 @@ private fun BottomBar(ctx: Context, viewModel: ViewModel, navController: NavCont
)
}
- IconButton(
- enabled = aor.isNotEmpty(),
- onClick = {
- navController.navigate("chats/$aor")
- },
- modifier = Modifier
- .weight(1f)
- .size(buttonSize)
- ) {
- Icon(
- imageVector = Icons.AutoMirrored.Filled.Chat,
- contentDescription = null,
- Modifier.size(buttonSize),
- tint = if (hasUnreadMessages) MaterialTheme.colorScheme.error else MaterialTheme.colorScheme.secondary
- )
- }
+ if (!isMobile)
+ IconButton(
+ enabled = aor.isNotEmpty(),
+ onClick = {
+ navController.navigate("chats/$aor")
+ },
+ modifier = Modifier
+ .weight(1f)
+ .size(buttonSize)
+ ) {
+ Icon(
+ imageVector = Icons.AutoMirrored.Filled.Chat,
+ contentDescription = null,
+ Modifier.size(buttonSize),
+ tint = if (hasUnreadMessages) MaterialTheme.colorScheme.error else MaterialTheme.colorScheme.secondary
+ )
+ }
IconButton(
enabled = aor.isNotEmpty(),
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 4ff482af..fa54d400 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -206,9 +206,10 @@
Block Unknown
Block calls and messages from peers that are not found in contacts.
Voicemail URI
- SIP or TEL URI for checking of voicemail messages. If left empty, voicemail
+ SIP URI for checking of voicemail messages. If left empty, voicemail
messages (Message Waiting Indications) are not subscribed to.
+ TEL URI for checking of voicemail messages.
Country Code
E.164 country code of this account. If From URI userpart of
incoming call or message contains a telephone number that does not start with \'+\' sign and if contact