rem: TRACE_LOG("storing into database\n");
add: DEBUG_LOG("storing into database\n");
context: int rls_db_add(rl_subscription_t *s){	db_key_t cols[20];	db_val_t vals[20];	str_t dialog = { 0, 0 };	int n = -1;	int res = 0;	time_t t;	if (!use_db) return 0;	/* store only external subscriptions */	if (s->type != rls_external_subscription) return 0;		TRACE_LOG("storing into database\n");		if (rls_dbf.use_table(rls_db, rls_table) < 0) {		LOG(L_ERR, "rls_db_add: Error in use_table\n");		return -1;	}		cols[++n] = "doc_version";	int_val(vals[n], s->doc_version);		cols[++n] = "status";	int_val(vals[n], s->external.status);		t = time(NULL);	t += rls_subscription_expires_in(s);	cols[++n] = "expires";	time_val(vals[n], t);		if (dlg_func.dlg2str(s->external.dialog, &dialog) != 0) {			LOG(L_ERR, "Error while serializing dialog\n");		return -1;	}	cols[++n] = "dialog";	blob_val(vals[n], dialog);		cols[++n] = "contact";	string_val(vals[n], s->external.contact);		cols[++n] = "uri";	string_val(vals[n], s->external.record_id);		cols[++n] = "package";	string_val(vals[n], s->external.package);		cols[++n] = "w_uri";	string_val(vals[n], s->external.subscriber);		cols[++n] = "id";	string_val_ex(vals[n], s->dbid, strlen(s->dbid));		/* insert new record into database */	if (rls_dbf.insert(rls_db, cols, vals, n + 1) < 0) {		LOG(L_ERR, "rls_db_add: Error while inserting subscription\n");		res = -1;	}		str_free_content(&dialog);	if (res == 0) res = vs_db_add(s);		return res;}