summaryrefslogtreecommitdiff
path: root/src/ua.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ua.c')
-rw-r--r--src/ua.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ua.c b/src/ua.c
index 5bdb991..2f86d33 100644
--- a/src/ua.c
+++ b/src/ua.c
@@ -922,6 +922,26 @@ struct call *ua_call(const struct ua *ua)
return NULL;
}
+struct call *ua_prev_call(const struct ua *ua)
+{
+ struct le *le;
+
+ if (!ua)
+ return NULL;
+
+ int prev = 0;
+ for (le = ua->calls.tail; le; le = le->prev) {
+ if( prev == 1){
+ struct call *call = le->data;
+ return call;
+ }
+ if( prev == 0)
+ prev = 1;
+ }
+
+ return NULL;
+}
+
int ua_debug(struct re_printf *pf, const struct ua *ua)
{