summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/baresip.h1
-rw-r--r--src/ua.c7
2 files changed, 5 insertions, 3 deletions
diff --git a/include/baresip.h b/include/baresip.h
index cfd3972..9ade882 100644
--- a/include/baresip.h
+++ b/include/baresip.h
@@ -509,6 +509,7 @@ const char *ua_local_cuser(const struct ua *ua);
struct account *ua_account(const struct ua *ua);
const char *ua_outbound(const struct ua *ua);
struct call *ua_call(const struct ua *ua);
+struct call *ua_prev_call(const struct ua *ua);
struct account *ua_prm(const struct ua *ua);
struct list *ua_calls(const struct ua *ua);
enum presence_status ua_presence_status(const struct ua *ua);
diff --git a/src/ua.c b/src/ua.c
index 2f86d33..0010de5 100644
--- a/src/ua.c
+++ b/src/ua.c
@@ -922,20 +922,21 @@ struct call *ua_call(const struct ua *ua)
return NULL;
}
+
struct call *ua_prev_call(const struct ua *ua)
{
struct le *le;
+ int prev = 0;
if (!ua)
return NULL;
- int prev = 0;
for (le = ua->calls.tail; le; le = le->prev) {
- if( prev == 1){
+ if ( prev == 1) {
struct call *call = le->data;
return call;
}
- if( prev == 0)
+ if ( prev == 0)
prev = 1;
}