- Moved call related API functions to Call class.

This commit is contained in:
Juha Heinanen
2020-04-28 17:21:37 +03:00
parent ac32540a9b
commit 2d39c284b7
6 changed files with 98 additions and 33 deletions
@@ -375,7 +375,7 @@ class BaresipService: Service() {
if (call == null)
Log.w(LOG_TAG, "onStartCommand did not find call $callp")
else
Api.call_notify_sipfrag(callp, 603, "Decline")
call.notifySipfrag(603, "Decline")
nm.cancel(TRANSFER_NOTIFICATION_ID)
}
@@ -556,7 +556,12 @@ class BaresipService: Service() {
return
}
"call incoming" -> {
val peerUri = Api.call_peeruri(callp)
val call = Call.find(callp)
if (call == null) {
Log.w(LOG_TAG, "Incoming call $callp is not found")
return
}
val peerUri = call.peerUri()
if ((Call.calls().size > 0) ||
(tm.callState != TelephonyManager.CALL_STATE_IDLE) ||
!Utils.checkPermission(applicationContext,