[sr-dev] git:master:845bdb88: presence: query_str filled with value of the corresponding column

Daniel-Constantin Mierla miconda at gmail.com
Tue Mar 31 15:16:30 CEST 2015


Module: kamailio
Branch: master
Commit: 845bdb8884743f5e126a53eb6aeb34f1f6afb1ea
URL: https://github.com/kamailio/kamailio/commit/845bdb8884743f5e126a53eb6aeb34f1f6afb1ea

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2015-03-31T15:15:27+02:00

presence: query_str filled with value of the corresponding column

- static value was used that made setting of parameter for column names
  not being considered

---

Modified: modules/presence/presentity.c
Modified: modules/presence/publish.c

---

Diff:  https://github.com/kamailio/kamailio/commit/845bdb8884743f5e126a53eb6aeb34f1f6afb1ea.diff
Patch: https://github.com/kamailio/kamailio/commit/845bdb8884743f5e126a53eb6aeb34f1f6afb1ea.patch

---

diff --git a/modules/presence/presentity.c b/modules/presence/presentity.c
index c358b81..0f3c3e5 100644
--- a/modules/presence/presentity.c
+++ b/modules/presence/presentity.c
@@ -885,6 +885,7 @@ int pres_htable_restore(void)
 	int event;
 	event_t ev;
 	char* sphere= NULL;
+	static str query_str;
 
 	result_cols[user_col= n_result_cols++]= &str_username_col;
 	result_cols[domain_col= n_result_cols++]= &str_domain_col;
@@ -899,7 +900,7 @@ int pres_htable_restore(void)
 		goto error;
 	}
 
-	static str query_str = str_init("username");
+	query_str = str_username_col;
 	if (db_fetch_query(&pa_dbf, pres_fetch_rows, pa_db, 0, 0, 0, result_cols,
 				0, n_result_cols, &query_str, &result) < 0)
 	{
diff --git a/modules/presence/publish.c b/modules/presence/publish.c
index 1b380bb..5a48f77 100644
--- a/modules/presence/publish.c
+++ b/modules/presence/publish.c
@@ -70,6 +70,7 @@ void msg_presentity_clean(unsigned int ticks,void *param)
 	int i = 0, num_watchers = 0;
 	presentity_t pres;
 	str uri = {0, 0}, event, *rules_doc = NULL;
+	static str query_str;
 
 	LM_DBG("cleaning expired presentity information\n");
 	if (pa_dbf.use_table(pa_db, &presentity_table) < 0) 
@@ -97,7 +98,7 @@ void msg_presentity_clean(unsigned int ticks,void *param)
 	result_cols[etag_col=n_result_cols++] = &str_etag_col;
 	result_cols[event_col=n_result_cols++] = &str_event_col;
 
-	static str query_str = str_init("username");
+	query_str = str_username_col;
 	if (db_fetch_query(&pa_dbf, pres_fetch_rows, pa_db, db_keys, db_ops,
 				db_vals, result_cols, n_db_cols, n_result_cols,
 				&query_str, &result) < 0)




More information about the sr-dev mailing list