aboutsummaryrefslogtreecommitdiffstats
path: root/src/call.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/call.c')
-rw-r--r--src/call.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/call.c b/src/call.c
index 5e0e726..ce339c0 100644
--- a/src/call.c
+++ b/src/call.c
@@ -23,8 +23,10 @@
#include <talloc.h>
+extern void *tall_mncc_ctx;
LLIST_HEAD(g_call_list);
+static uint32_t last_call_id = 5000;
void calls_init(void)
{}
@@ -48,3 +50,26 @@ void call_leg_release(struct call *call, struct call_leg *leg)
talloc_free(call);
}
}
+
+struct call *sip_call_mncc_create(void)
+{
+ struct call *call;
+
+ call = talloc_zero(tall_mncc_ctx, struct call);
+ if (!call) {
+ LOGP(DCALL, LOGL_ERROR, "Failed to allocate memory for call\n");
+ return NULL;
+ }
+ call->id = ++last_call_id;
+
+ call->initial = (struct call_leg *) talloc_zero(call, struct mncc_call_leg);
+ if (!call->initial) {
+ LOGP(DCALL, LOGL_ERROR, "Failed to allocate MNCC leg\n");
+ talloc_free(call);
+ return NULL;
+ }
+
+ call->initial->type = CALL_TYPE_MNCC;
+ llist_add(&call->entry, &g_call_list);
+ return call;
+}