Fixed calling back incoming group call

This commit is contained in:
Sylvain Berfini 2022-05-20 15:50:05 +02:00
parent 7f122c7ab8
commit 3104ee6471
2 changed files with 12 additions and 7 deletions

View file

@ -223,17 +223,14 @@ class MasterCallLogsFragment : MasterFragment<HistoryMasterFragmentBinding, Call
viewLifecycleOwner, viewLifecycleOwner,
) { ) {
it.consume { callLogGroup -> it.consume { callLogGroup ->
// To remove the GRUU if any val callLog = callLogGroup.lastCallLog
val remoteAddress = callLogGroup.lastCallLog.remoteAddress val conferenceInfo = callLog.conferenceInfo
val cleanAddress = remoteAddress.clone()
cleanAddress.clean()
val conferenceInfo = coreContext.core.findConferenceInformationFromUri(remoteAddress)
when { when {
conferenceInfo != null -> { conferenceInfo != null -> {
navigateToConferenceWaitingRoom(remoteAddress.asStringUriOnly(), conferenceInfo.subject) navigateToConferenceWaitingRoom(conferenceInfo.uri?.asStringUriOnly().orEmpty(), conferenceInfo.subject)
} }
coreContext.core.callsNb > 0 -> { coreContext.core.callsNb > 0 -> {
val cleanAddress = LinphoneUtils.getCleanedAddress(callLog.remoteAddress)
Log.i("[History] Starting dialer with pre-filled URI ${cleanAddress.asStringUriOnly()}, is transfer? ${sharedViewModel.pendingCallTransfer}") Log.i("[History] Starting dialer with pre-filled URI ${cleanAddress.asStringUriOnly()}, is transfer? ${sharedViewModel.pendingCallTransfer}")
sharedViewModel.updateDialerAnimationsBasedOnDestination.value = Event(R.id.masterCallLogsFragment) sharedViewModel.updateDialerAnimationsBasedOnDestination.value = Event(R.id.masterCallLogsFragment)
val args = Bundle() val args = Bundle()
@ -243,6 +240,7 @@ class MasterCallLogsFragment : MasterFragment<HistoryMasterFragmentBinding, Call
navigateToDialer(args) navigateToDialer(args)
} }
else -> { else -> {
val cleanAddress = LinphoneUtils.getCleanedAddress(callLog.remoteAddress)
val localAddress = callLogGroup.lastCallLog.localAddress val localAddress = callLogGroup.lastCallLog.localAddress
Log.i("[History] Starting call to ${cleanAddress.asStringUriOnly()} with local address ${localAddress.asStringUriOnly()}") Log.i("[History] Starting call to ${cleanAddress.asStringUriOnly()} with local address ${localAddress.asStringUriOnly()}")
coreContext.startCall(cleanAddress, localAddress = localAddress) coreContext.startCall(cleanAddress, localAddress = localAddress)

View file

@ -67,6 +67,13 @@ class LinphoneUtils {
} }
} }
fun getCleanedAddress(address: Address): Address {
// To remove the GRUU if any
val cleanAddress = address.clone()
cleanAddress.clean()
return cleanAddress
}
fun isLimeAvailable(): Boolean { fun isLimeAvailable(): Boolean {
val core = coreContext.core val core = coreContext.core
return core.limeX3DhAvailable() && core.isLimeX3DhEnabled && return core.limeX3DhAvailable() && core.isLimeX3DhEnabled &&