Use blue arrow down ico when incoming call was completed elsewhere

This commit is contained in:
Juha Heinanen
2025-06-15 17:24:43 +03:00
parent 4e4eb0e4b1
commit 9aa9e1d05a
5 changed files with 20 additions and 5 deletions

View File

@ -1017,7 +1017,7 @@ class BaresipService: Service() {
return
}
"call closed" -> {
Log.d(TAG, "AoR $aor call $callp is closed")
Log.d(TAG, "AoR $aor call $callp is closed prm: ${ev[1]}")
if (call != null) {
nm.cancel(CALL_NOTIFICATION_ID)
stopRinging()
@ -1055,10 +1055,11 @@ class BaresipService: Service() {
!reason.startsWith("480") &&
!reason.startsWith("Connection reset by")
val missed = call.dir == "in" && call.startTime == null && !call.rejected
val completedElsewhere = missed && ev[2].startsWith("SIP;cause=200")
if (ua.account.callHistory) {
val history = CallHistoryNew(aor, call.peerUri, call.dir)
history.startTime = call.startTime
history.stopTime = GregorianCalendar()
history.startTime = if (completedElsewhere) history.stopTime else call.startTime
history.rejected = call.rejected
if (call.startTime != null && call.dumpfiles[0] != "")
history.recording = call.dumpfiles

View File

@ -203,7 +203,7 @@ private fun startTime(detail: Details): String {
startTimeText = stopText
durationText = "?"
} else {
if (startTime == null) {
if (startTime == null || detail.direction == R.drawable.call_down_blue) {
startTimeText = stopText
durationText = ""
} else {

View File

@ -11,7 +11,8 @@ import java.util.GregorianCalendar
class CallHistoryNew(val aor: String, val peerUri: String, val direction: String) : Serializable {
var startTime: GregorianCalendar? = null // Set to time when call is established (if ever)
// Set to time when call is established (if ever) or stopTime if call was completed elsewhere
var startTime: GregorianCalendar? = null
var stopTime = GregorianCalendar() // Set to time when call is closed
var rejected = false
var recording = arrayOf("", "") // Encoder and decoder recording files

View File

@ -439,7 +439,10 @@ private fun loadCallHistory(aor: String): MutableList<CallRow> {
if (h.aor == aor) {
val direction: Int = if (h.direction == "in") {
if (h.startTime != null) {
R.drawable.call_down_green
if (h.startTime != h.stopTime)
R.drawable.call_down_green
else
R.drawable.call_down_blue
} else {
if (h.rejected)
R.drawable.call_down_red

View File

@ -0,0 +1,10 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="20dp"
android:height="20dp"
android:viewportWidth="960"
android:viewportHeight="960"
android:tint="@color/colorPrimary" >
<path
android:fillColor="@android:color/white"
android:pathData="M232.35,775.65L232.35,428.65L315.35,428.65L315.35,634L714.85,234.5L773.5,293.15L374,692.65L579.35,692.65L579.35,775.65L232.35,775.65Z"/>
</vector>