Fixed handling of call action when baresip app was not running

This commit is contained in:
Juha Heinanen
2021-01-21 15:37:33 +02:00
parent 2038a3170a
commit 31fa509d34
3 changed files with 37 additions and 1 deletions
@@ -859,6 +859,18 @@ class BaresipService: Service() {
return ""
}
@Keep
fun started() {
Log.d(LOG_TAG, "Received 'started' from baresip")
if (callActionUri != "") {
val intent = Intent("service event")
intent.putExtra("event", "started")
intent.putExtra("params", arrayListOf(callActionUri))
LocalBroadcastManager.getInstance(this).sendBroadcast(intent)
callActionUri = ""
}
}
@Keep
fun stopped(error: String) {
Log.d(LOG_TAG, "Received 'stopped' from baresip with param '$error'")
@@ -1194,6 +1206,7 @@ class BaresipService: Service() {
var downloadsPath = ""
var logLevel = 2
var sipTrace = false
var callActionUri = ""
val uas = ArrayList<UserAgent>()
val status = ArrayList<Int>()