int flow_act_handler(struct flow *flow, struct json_object *jobj)
{
	bool active;
	int err;
	struct flowmgr *fm;
	struct call *call;

	if (!flow || !jobj) {
		return EINVAL;
	}

	call = flow->call;
	fm = call->fm;
	
	err = jzon_bool(&active, jobj, "active");
	if (err) {
		warning("flowmgr: flow_act_handler: no active flag\n");
		return err;
	}

	info("flowmgr(%p): call(%p): flow(%p -- %s): active=%d\n",
	     fm, call, flow, flow->flowid, active);

	err = flow_activate(flow, active);

	return err;
}
Esempio n. 2
0
bool jzon_bool_opt(struct json_object *obj, const char *key, bool dflt)
{
	bool res;
	int err;

	err = jzon_bool(&res, obj, key);
	if (err)
		return dflt;
	else
		return res;
}