call: Create a call with a SIP leg

Clone the MNCC code and create a call with a SIP leg.
zecke/mt-mncc-call
Holger Hans Peter Freyther 7 years ago
parent 586abf9f0f
commit b723cceee9
  1. 24
      src/call.c
  2. 1
      src/call.h

@ -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);

Loading…
Cancel
Save