aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-03-26 19:51:33 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-03-26 19:51:33 +0100
commitb723cceee964ba57c23be30c7f736dece04b2ce3 (patch)
treef634267b293b655d5c987a6ad74e2be372dceb98 /src
parent586abf9f0fba385de1a8b22376a870a556909d97 (diff)
call: Create a call with a SIP leg
Clone the MNCC code and create a call with a SIP leg.
Diffstat (limited to 'src')
-rw-r--r--src/call.c24
-rw-r--r--src/call.h1
2 files changed, 25 insertions, 0 deletions
diff --git a/src/call.c b/src/call.c
index ad2c021..1316205 100644
--- a/src/call.c
+++ b/src/call.c
@@ -79,6 +79,30 @@ struct call *call_mncc_create(void)
return call;
}
+struct call *call_sip_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 sip_call_leg);
+ if (!call->initial) {
+ LOGP(DCALL, LOGL_ERROR, "Failed to allocate SIP leg\n");
+ talloc_free(call);
+ return NULL;
+ }
+
+ call->initial->type = CALL_TYPE_SIP;
+ call->initial->call = call;
+ llist_add(&call->entry, &g_call_list);
+ return call;
+}
+
struct call_leg *call_leg_other(struct call_leg *leg)
{
if (leg->call->initial == leg)
diff --git a/src/call.h b/src/call.h
index fe47e15..0b25fdd 100644
--- a/src/call.h
+++ b/src/call.h
@@ -120,3 +120,4 @@ void call_leg_release(struct call_leg *leg);
struct call *call_mncc_create(void);
+struct call *call_sip_create(void);