add: keys1[0] = user_col; keys1[1] = contact_col; keys1[2] = domain_col; keys2[0] = expires_col; keys2[1] = q_col; keys2[2] = callid_col; keys2[3] = cseq_col; keys2[4] = replicate_col; keys2[5] = state_col;
context: int db_update_ucontact(ucontact_t* _c){	char b[256];	char* dom;	db_key_t keys1[3] = {user_col, contact_col, domain_col};	db_val_t vals1[3];	db_key_t keys2[6] = {expires_col, q_col, callid_col, cseq_col, replicate_col, state_col};	db_val_t vals2[6];	vals1[0].type = DB_STR;	vals1[0].nul = 0;	vals1[0].val.str_val = *_c->aor;	vals1[1].type = DB_STR;	vals1[1].nul = 0;	vals1[1].val.str_val = _c->c;	vals2[0].type = DB_DATETIME;	vals2[0].nul = 0;	vals2[0].val.time_val = _c->expires;	vals2[1].type = DB_DOUBLE;	vals2[1].nul = 0;	vals2[1].val.double_val = _c->q;	vals2[2].type = DB_STR;	vals2[2].nul = 0;	vals2[2].val.str_val = _c->callid;	vals2[3].type = DB_INT;	vals2[3].nul = 0;	vals2[3].val.int_val = _c->cseq;	vals2[4].type = DB_INT;	vals2[4].nul = 0;	vals2[4].val.int_val = _c->replicate;	vals2[5].type = DB_INT;	vals2[5].nul = 0;	if (_c->state < CS_ZOMBIE_N)		vals2[5].val.int_val = 0;	else		vals2[5].val.int_val = 1;	if (use_domain) {		dom = q_memchr(_c->aor->s, '@', _c->aor->len);		vals1[0].val.str_val.len = dom - _c->aor->s;		vals1[2].type = DB_STR;		vals1[2].nul = 0;		vals1[2].val.str_val.s = dom + 1;		vals1[2].val.str_val.len = _c->aor->s + _c->aor->len - dom - 1;	}	     /* FIXME */	memcpy(b, _c->domain->s, _c->domain->len);	b[_c->domain->len] = '\0';	db_use_table(db, b);	if (db_update(db, keys1, 0, vals1, keys2, vals2, (use_domain) ? (3) : (2), 6) < 0) {		LOG(L_ERR, "db_upd_ucontact(): Error while updating database\n");		return -1;	}	return 0;}