aboutsummaryrefslogtreecommitdiffstats
path: root/src/call.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-03-22 20:56:45 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-03-22 21:04:56 +0100
commit29b556490f593a621e8356f5e64ced036152d306 (patch)
tree2481fa96a2784d190598bc299940882fdf537680 /src/call.c
parent90e713969110306cd979f0edcbbd86a46d97518a (diff)
mncc: Dispatch setup and issue rtp create in response then continue
The code is not tested and might be broken. Parse the setup request of a MO call, create a new "call" with a MNCC leg and then issue the call to create a RTP socket. Once this has been done, release the call as the code to open a second leg has not been written yet.
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;
+}