diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2016-03-26 19:51:33 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2016-03-26 19:51:33 +0100 |
commit | b723cceee964ba57c23be30c7f736dece04b2ce3 (patch) | |
tree | f634267b293b655d5c987a6ad74e2be372dceb98 /src | |
parent | 586abf9f0fba385de1a8b22376a870a556909d97 (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.c | 24 | ||||
-rw-r--r-- | src/call.h | 1 |
2 files changed, 25 insertions, 0 deletions
@@ -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) @@ -120,3 +120,4 @@ void call_leg_release(struct call_leg *leg); struct call *call_mncc_create(void); +struct call *call_sip_create(void); |