From 5a3d14d7731b4c75efec3eb33b22b5e100cb4def Mon Sep 17 00:00:00 2001 From: Juha Heinanen Date: Thu, 13 Dec 2018 11:09:21 +0200 Subject: [PATCH] notify user about registration failure --- app/src/main/cpp/baresip.c | 4 +++- app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/src/main/cpp/baresip.c b/app/src/main/cpp/baresip.c index fac095ab..168bc081 100644 --- a/app/src/main/cpp/baresip.c +++ b/app/src/main/cpp/baresip.c @@ -99,9 +99,11 @@ static void ua_event_handler(struct ua *ua, enum ua_event ev, case UA_EVENT_REGISTERING: case UA_EVENT_UNREGISTERING: case UA_EVENT_REGISTER_OK: - case UA_EVENT_REGISTER_FAIL: re_snprintf(event_buf, sizeof event_buf, "%s", ua_event_reg_str(ev)); break; + case UA_EVENT_REGISTER_FAIL: + re_snprintf(event_buf, sizeof event_buf, "registering failed,%s", prm); + break; case UA_EVENT_CALL_INCOMING: if (list_count(ua_calls(ua)) > 1) { play = mem_deref(play); diff --git a/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt b/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt index 4c76a2ed..cc809e7c 100644 --- a/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt +++ b/app/src/main/kotlin/com/tutpro/baresip/MainActivity.kt @@ -440,9 +440,15 @@ class MainActivity : AppCompatActivity() { uaAdapter.notifyDataSetChanged() if (aorSpinner.selectedItemPosition == -1) aorSpinner.setSelection(0) } - "registered", "registering failed", "unregistering" -> { + "registered", "unregistering" -> { uaAdapter.notifyDataSetChanged() } + "registering failed" -> { + uaAdapter.notifyDataSetChanged() + Toast.makeText(applicationContext, + "Registering of $aor failed: ${ev[1]}", + Toast.LENGTH_LONG).show() + } "call ringing" -> { } "call rejected" -> {