Use blue arrow down ico when incoming call was completed elsewhere
This commit is contained in:
@@ -1017,7 +1017,7 @@ class BaresipService: Service() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
"call closed" -> {
|
"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) {
|
if (call != null) {
|
||||||
nm.cancel(CALL_NOTIFICATION_ID)
|
nm.cancel(CALL_NOTIFICATION_ID)
|
||||||
stopRinging()
|
stopRinging()
|
||||||
@@ -1055,10 +1055,11 @@ class BaresipService: Service() {
|
|||||||
!reason.startsWith("480") &&
|
!reason.startsWith("480") &&
|
||||||
!reason.startsWith("Connection reset by")
|
!reason.startsWith("Connection reset by")
|
||||||
val missed = call.dir == "in" && call.startTime == null && !call.rejected
|
val missed = call.dir == "in" && call.startTime == null && !call.rejected
|
||||||
|
val completedElsewhere = missed && ev[2].startsWith("SIP;cause=200")
|
||||||
if (ua.account.callHistory) {
|
if (ua.account.callHistory) {
|
||||||
val history = CallHistoryNew(aor, call.peerUri, call.dir)
|
val history = CallHistoryNew(aor, call.peerUri, call.dir)
|
||||||
history.startTime = call.startTime
|
|
||||||
history.stopTime = GregorianCalendar()
|
history.stopTime = GregorianCalendar()
|
||||||
|
history.startTime = if (completedElsewhere) history.stopTime else call.startTime
|
||||||
history.rejected = call.rejected
|
history.rejected = call.rejected
|
||||||
if (call.startTime != null && call.dumpfiles[0] != "")
|
if (call.startTime != null && call.dumpfiles[0] != "")
|
||||||
history.recording = call.dumpfiles
|
history.recording = call.dumpfiles
|
||||||
|
|||||||
@@ -203,7 +203,7 @@ private fun startTime(detail: Details): String {
|
|||||||
startTimeText = stopText
|
startTimeText = stopText
|
||||||
durationText = "?"
|
durationText = "?"
|
||||||
} else {
|
} else {
|
||||||
if (startTime == null) {
|
if (startTime == null || detail.direction == R.drawable.call_down_blue) {
|
||||||
startTimeText = stopText
|
startTimeText = stopText
|
||||||
durationText = ""
|
durationText = ""
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ import java.util.GregorianCalendar
|
|||||||
|
|
||||||
class CallHistoryNew(val aor: String, val peerUri: String, val direction: String) : Serializable {
|
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 stopTime = GregorianCalendar() // Set to time when call is closed
|
||||||
var rejected = false
|
var rejected = false
|
||||||
var recording = arrayOf("", "") // Encoder and decoder recording files
|
var recording = arrayOf("", "") // Encoder and decoder recording files
|
||||||
|
|||||||
@@ -439,7 +439,10 @@ private fun loadCallHistory(aor: String): MutableList<CallRow> {
|
|||||||
if (h.aor == aor) {
|
if (h.aor == aor) {
|
||||||
val direction: Int = if (h.direction == "in") {
|
val direction: Int = if (h.direction == "in") {
|
||||||
if (h.startTime != null) {
|
if (h.startTime != null) {
|
||||||
|
if (h.startTime != h.stopTime)
|
||||||
R.drawable.call_down_green
|
R.drawable.call_down_green
|
||||||
|
else
|
||||||
|
R.drawable.call_down_blue
|
||||||
} else {
|
} else {
|
||||||
if (h.rejected)
|
if (h.rejected)
|
||||||
R.drawable.call_down_red
|
R.drawable.call_down_red
|
||||||
|
|||||||
@@ -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>
|
||||||
Reference in New Issue
Block a user