summaryrefslogtreecommitdiffstats
path: root/src/call.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/call.c')
-rw-r--r--src/call.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/call.c b/src/call.c
index 464530f..5e0e726 100644
--- a/src/call.c
+++ b/src/call.c
@@ -19,6 +19,32 @@
*/
#include "call.h"
+#include "logging.h"
+
+#include <talloc.h>
LLIST_HEAD(g_call_list);
+
+void calls_init(void)
+{}
+
+void call_leg_release(struct call *call, struct call_leg *leg)
+{
+ if (leg == call->initial)
+ call->initial = NULL;
+ else if (leg == call->remote)
+ call->remote = NULL;
+ else {
+ LOGP(DAPP, LOGL_ERROR, "call(%u) with unknown leg(%p/%d)\n",
+ call->id, leg, leg->type);
+ return;
+ }
+
+ talloc_free(leg);
+ if (!call->initial && !call->remote) {
+ LOGP(DAPP, LOGL_DEBUG, "call(%u) releasing.\n", call->id);
+ llist_del(&call->entry);
+ talloc_free(call);
+ }
+}