Beispiel #1
0
static int ua_call_alloc(struct call **callp, struct ua *ua,
			 enum vidmode vidmode, const struct sip_msg *msg,
			 struct call *xcall, const char *local_uri)
{
	struct call_prm cprm;

	if (*callp) {
		warning("ua: call_alloc: call is already allocated\n");
		return EALREADY;
	}

	cprm.vidmode = vidmode;
	cprm.af      = ua->af;

	return call_alloc(callp, conf_config(), &ua->calls,
			  ua->acc->dispname,
			  local_uri ? local_uri : ua->acc->aor,
			  ua->acc, ua, &cprm,
			  msg, xcall, call_event_handler, ua);
}
int call_lookup_alloc(struct call **callp, bool *allocated,
		      struct flowmgr *fm, const char *convid)
{
	struct call *call;
	int err = 0;

	call = dict_lookup(fm->calls, convid);
	if (call) {
		*callp = call;
		*allocated = false;

		return 0;
	}

	err = call_alloc(&call, fm, convid);
	if (err)
		return err;

	*callp = call;
	*allocated = true;

	return 0;
}