From 3aa871a496a36bc2a2b76fc2b326d7e19e493077 Mon Sep 17 00:00:00 2001 From: "Alfred E. Heggestad" Date: Fri, 9 Dec 2016 16:13:59 +0100 Subject: ua: simplify ua_call() --- src/ua.c | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/src/ua.c b/src/ua.c index 2b99255..c260c9d 100644 --- a/src/ua.c +++ b/src/ua.c @@ -1016,25 +1016,14 @@ const char *ua_outbound(const struct ua *ua) * Current call strategy: * * We can only have 1 current call. The current call is the one that was - * added last (end of the list), which is not on-hold + * added last (end of the list). */ struct call *ua_call(const struct ua *ua) { - struct le *le; - if (!ua) return NULL; - for (le = ua->calls.tail; le; le = le->prev) { - - struct call *call = le->data; - - /* todo: check if call is on-hold */ - - return call; - } - - return NULL; + return list_ledata(list_tail(&ua->calls)); } -- cgit v1.2.3