diff --git a/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt b/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt index 7eebbb963..98d0650d8 100644 --- a/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt +++ b/app/src/main/java/org/linphone/ui/call/viewmodel/CurrentCallViewModel.kt @@ -1112,7 +1112,19 @@ class CurrentCallViewModel if (call.dir == Call.Dir.Incoming) { val isVideo = call.remoteParams?.isVideoEnabled == true && call.remoteParams?.videoDirection != MediaDirection.Inactive if (call.core.accountList.size > 1) { - val displayName = LinphoneUtils.getDisplayName(call.toAddress) + val localAddress = call.callLog.toAddress + Log.i("$TAG Local address for incoming call is [${localAddress.asStringUriOnly()}]") + val localAccount = coreContext.core.accountList.find { + it.params.identityAddress?.weakEqual(localAddress) == true + } + val displayName = if (localAccount != null) { + LinphoneUtils.getDisplayName(localAccount.params.identityAddress) + } else { + Log.w("$TAG Matching local account was not found, using TO address display name or username") + LinphoneUtils.getDisplayName(localAddress) + } + Log.i("$TAG Showing account being called as [$displayName]") + if (isVideo) { incomingCallTitle.postValue( AppUtils.getFormattedString(