Decline incoming call with busy reason if more than one call

This commit is contained in:
Sylvain Berfini 2023-04-20 10:47:41 +02:00
parent 91601cdd8c
commit d54a707816
2 changed files with 8 additions and 2 deletions

View file

@ -25,6 +25,7 @@ Group changes to describe their impact on the project, as follows:
### Changed
- Account EXPIRES is now set to 1 month instead of 1 year for sip.linphone.org accounts
- Replaced voice recordings file name by localized placeholder text, like for video conferences invitations
- Decline incoming calls with Busy reason if there is at least another active call
- Removed jetifier as it is not needed
- Switched from gradle 7.5 to 8.0, requires JDK 17 (instead of 11)

View file

@ -750,8 +750,13 @@ class CoreContext(
call.redirectTo(voiceMailAddress)
}
} else {
Log.i("[Context] Declining call $call")
call.decline(Reason.Declined)
val reason = if (core.callsNb > 1) {
Reason.Busy
} else {
Reason.Declined
}
Log.i("[Context] Declining call [$call] with reason [$reason]")
call.decline(reason)
}
}