From af0425ee74e40bfc85f2756792605bcc38e1048f Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Sat, 22 Jan 2022 14:59:04 +0200 Subject: [PATCH] Cleaned uaEvent param handling --- .../main/kotlin/com/tutpro/baresip/BaresipService.kt | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt index e30738bd..146210d5 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/BaresipService.kt @@ -541,23 +541,25 @@ class BaresipService: Service() { if (!isServiceRunning) return + val ev = event.split(",") val ua = UserAgent.ofUap(uap) + val aor = ua?.account?.aor + + Log.d(TAG, "got uaEvent $event/$aor/$callp") + if (ua == null) { Log.w(TAG, "uaEvent $event did not find ua $uap") return } val call = Call.ofCallp(callp) - if (call == null && callp != "0" && event != "call incoming") { + if (call == null && callp != "0" && ev[0] != "call incoming") { Log.w(TAG, "uaEvent $event did not find call $callp") return } - Log.d(TAG, "got uaEvent $event/${ua.account.aor}/$callp") - - val aor = ua.account.aor var newEvent: String? = null - val ev = event.split(",") + for (account_index in uas.indices) { if (uas[account_index].account.aor == aor) { when (ev[0]) {